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

@contentful/contentful-slatejs-adapter

Package Overview
Dependencies
Maintainers
142
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/contentful-slatejs-adapter - npm Package Compare versions

Comparing version 15.13.1 to 15.15.1

54

dist/contentful-slatejs-adapter.es5.js

@@ -5,8 +5,30 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var get = _interopDefault(require('lodash.get'));
var flatmap = require('lodash.flatmap');
var get = require('lodash.get');
var Contentful = require('@contentful/rich-text-types');
var flatmap = _interopDefault(require('lodash.flatmap'));
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var flatmap__default = /*#__PURE__*/_interopDefaultLegacy(flatmap);
var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
var Contentful__namespace = /*#__PURE__*/_interopNamespace(Contentful);
/*! *****************************************************************************

@@ -74,3 +96,3 @@ Copyright (c) Microsoft Corporation.

var root = Object.values(Contentful.BLOCKS).includes(node.nodeType) ? 'blocks' : 'inlines';
return get(schema, [root, node.nodeType, 'isVoid'], false);
return get__default["default"](schema, [root, node.nodeType, 'isVoid'], false);
},

@@ -89,5 +111,5 @@ isTextContainer: function (nodeType) {

// this will be a compatibility problem for existing users.
return flatmap(document.content, function (node) { return convertNode(node, fromJSON(schema)); });
return flatmap__default["default"](document.content, function (node) { return convertNode$1(node, fromJSON(schema)); });
}
function convertNode(node, schema) {
function convertNode$1(node, schema) {
if (node.nodeType === 'text') {

@@ -98,3 +120,5 @@ return convertTextNode(node);

var contentfulNode = node;
var childNodes = flatmap(contentfulNode.content, function (childNode) { return convertNode(childNode, schema); });
var childNodes = flatmap__default["default"](contentfulNode.content, function (childNode) {
return convertNode$1(childNode, schema);
});
var slateNode = convertElementNode(contentfulNode, childNodes, schema);

@@ -134,8 +158,8 @@ return slateNode;

return {
nodeType: Contentful.BLOCKS.DOCUMENT,
nodeType: Contentful__namespace.BLOCKS.DOCUMENT,
data: {},
content: flatmap(document, function (node) { return convertNode$1(node, fromJSON(schema)); }),
content: flatmap__default["default"](document, function (node) { return convertNode(node, fromJSON(schema)); }),
};
}
function convertNode$1(node, schema) {
function convertNode(node, schema) {
var nodes = [];

@@ -149,4 +173,4 @@ if (isSlateElement(node)) {

if (!schema.isVoid(contentfulElement)) {
contentfulElement.content = flatmap(node.children, function (childNode) {
return convertNode$1(childNode, schema);
contentfulElement.content = flatmap__default["default"](node.children, function (childNode) {
return convertNode(childNode, schema);
});

@@ -166,3 +190,3 @@ }

function convertText(node) {
var text = node.text, data = node.data, marks = __rest(node, ["text", "data"]);
node.text; node.data; var marks = __rest(node, ["text", "data"]);
return {

@@ -187,4 +211,4 @@ nodeType: 'text',

exports.toContentfulDocument = toContentfulDocument;
exports.toSlatejsDocument = toSlatejsDocument;
exports.toContentfulDocument = toContentfulDocument;
//# sourceMappingURL=contentful-slatejs-adapter.es5.js.map

@@ -29,3 +29,5 @@ var __assign = (this && this.__assign) || function () {

var contentfulNode = node;
var childNodes = flatmap(contentfulNode.content, function (childNode) { return convertNode(childNode, schema); });
var childNodes = flatmap(contentfulNode.content, function (childNode) {
return convertNode(childNode, schema);
});
var slateNode = convertElementNode(contentfulNode, childNodes, schema);

@@ -32,0 +34,0 @@ return slateNode;

@@ -0,0 +0,0 @@ import { BLOCKS, INLINES, Document, Block, Inline, Text, Mark, TopLevelBlock, TopLevelBlockEnum } from '@contentful/rich-text-types';

@@ -0,0 +0,0 @@ import { SchemaJSON } from './schema';

/**
* Ensures that data defaults to an empty object.
*/
export declare const getDataOrDefault: (value?: Record<string, any> | undefined) => Record<string, any>;
export declare const getDataOrDefault: (value?: Record<string, any>) => Record<string, any>;
export { default as toSlatejsDocument } from './contentful-to-slatejs-adapter';
export { default as toContentfulDocument } from './slatejs-to-contentful-adapter';

@@ -0,0 +0,0 @@ import { ContentfulElementNode } from './types';

@@ -0,0 +0,0 @@ import { SchemaJSON } from './schema';

import * as Contentful from '@contentful/rich-text-types';
export declare type SlateMarks = {
export type SlateMarks = {
bold?: boolean;

@@ -7,7 +7,7 @@ italic?: boolean;

};
export declare type SlateText = SlateMarks & {
export type SlateText = SlateMarks & {
text: string;
data: object;
};
export declare type SlateElement = {
export type SlateElement = {
type: string;

@@ -18,4 +18,4 @@ data: object;

};
export declare type ContentfulElementNode = Contentful.Block | Contentful.Inline;
export declare type ContentfulNode = ContentfulElementNode | Contentful.Text;
export declare type SlateNode = SlateElement | SlateText;
export type ContentfulElementNode = Contentful.Block | Contentful.Inline;
export type ContentfulNode = ContentfulElementNode | Contentful.Text;
export type SlateNode = SlateElement | SlateText;

@@ -0,0 +0,0 @@ declare namespace Slate {

{
"name": "@contentful/contentful-slatejs-adapter",
"version": "15.13.1",
"version": "15.15.1",
"description": "",

@@ -28,11 +28,4 @@ "keywords": [],

"test:prod": "npm run lint && npm run test -- --coverage --no-cache",
"report-coverage": "cat ./coverage/lcov.info | coveralls",
"precommit": "lint-staged"
"report-coverage": "cat ./coverage/lcov.info | coveralls"
},
"lint-staged": {
"{src,test}/**/*.ts": [
"prettier --write",
"git add"
]
},
"jest": {

@@ -59,8 +52,4 @@ "transform": {

},
"prettier": {
"singleQuote": true,
"trailingComma": "all"
},
"dependencies": {
"@contentful/rich-text-types": "^15.12.1",
"@contentful/rich-text-types": "^15.15.1",
"lodash.flatmap": "^4.5.0",

@@ -83,9 +72,7 @@ "lodash.get": "^4.4.2",

"jest": "^27.1.0",
"lint-staged": "^7.0.0",
"lodash.camelcase": "^4.3.0",
"prettier": "^1.19.1",
"prompt": "^1.0.0",
"replace-in-file": "^3.0.0-beta.2",
"rimraf": "^2.6.1",
"rollup": "^0.58.0",
"rollup": "^2.79.0",
"rollup-plugin-commonjs": "^9.0.0",

@@ -98,5 +85,2 @@ "rollup-plugin-json": "^4.0.0",

"ts-node": "^6.0.0",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.1.0",
"tslint-config-standard": "^7.0.0",
"typescript": "^4.4.2"

@@ -107,3 +91,3 @@ },

},
"gitHead": "b29c17da186b4211a17fda22052c466651960015"
"gitHead": "c7e34bc0f0172728999b121af43df88995eec305"
}

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