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

@slate-serializers/dom

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slate-serializers/dom - npm Package Compare versions

Comparing version 2.1.6 to 2.2.0

src/lib/utilities/index.d.ts

15

package.json
{
"name": "@slate-serializers/dom",
"version": "2.1.6",
"version": "2.2.0",
"description": "Serialize Slate JSON objects to the DOM. Can be used with `htmlparser2` and associated utilities to modify the DOM and generate HTML. Used by other serializers in this monorepo.",

@@ -10,12 +10,9 @@ "type": "commonjs",

"domutils": "^3.1.0",
"html-entities": "^2.3.3",
"postcss": "^8.4.24",
"postcss-js": "^4.0.1",
"slate": "^0.94.1",
"@slate-serializers/utilities": "2.1.5",
"html-entities": "^2.5.2",
"slate": "^0.102.0",
"css-select": "5.1.0",
"htmlparser2": "7.2.0",
"tslib": "2.5.0"
"htmlparser2": "9.1.0",
"tslib": "2.6.3"
},
"main": "./src/index.js"
}
}

2

src/lib/config/default.js

@@ -5,3 +5,3 @@ "use strict";

const domhandler_1 = require("domhandler");
const utilities_1 = require("@slate-serializers/utilities");
const utilities_1 = require("../utilities");
// Map Slate element names to HTML tag names

@@ -8,0 +8,0 @@ // Staightforward transform - no attributes are considered

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.config = void 0;
const utilities_1 = require("@slate-serializers/utilities");
const utilities_1 = require("../utilities");
const ELEMENT_NAME_TAG_MAP = {

@@ -6,0 +6,0 @@ ['block-quote']: 'blockquote',

@@ -9,1 +9,2 @@ export { slateToDom } from './serializers';

export { extractCssFromStyle } from './utilities/domhandler';
export { isEmptyObject, styleMapToAttribs } from './utilities';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractCssFromStyle = exports.convertSlate = exports.slateDemoSlateToDomConfig = exports.payloadSlateToDomConfig = exports.slateToDomConfig = exports.slateToDom = void 0;
exports.styleMapToAttribs = exports.isEmptyObject = exports.extractCssFromStyle = exports.convertSlate = exports.slateDemoSlateToDomConfig = exports.payloadSlateToDomConfig = exports.slateToDomConfig = exports.slateToDom = void 0;
// Serializers

@@ -18,2 +18,5 @@ var serializers_1 = require("./serializers");

Object.defineProperty(exports, "extractCssFromStyle", { enumerable: true, get: function () { return domhandler_1.extractCssFromStyle; } });
var utilities_1 = require("./utilities");
Object.defineProperty(exports, "isEmptyObject", { enumerable: true, get: function () { return utilities_1.isEmptyObject; } });
Object.defineProperty(exports, "styleMapToAttribs", { enumerable: true, get: function () { return utilities_1.styleMapToAttribs; } });
//# sourceMappingURL=dom.js.map

@@ -10,4 +10,4 @@ "use strict";

const domhandler_2 = require("./domhandler");
const utilities_1 = require("@slate-serializers/utilities");
const utilities_2 = require("@slate-serializers/utilities");
const _1 = require(".");
const _2 = require(".");
const convertSlate = ({ node, config = default_1.config, isLastNodeInDocument = false, customElementTransforms,

@@ -19,3 +19,3 @@ /* tslint:disable:no-shadowed-variable */

if (slate_1.Text.isText(node)) {
const str = config.alwaysEncodeBreakingEntities && !config.encodeEntities ? (0, utilities_1.encodeBreakingEntities)(node.text) : node.text;
const str = config.alwaysEncodeBreakingEntities && !config.encodeEntities ? (0, _1.encodeBreakingEntities)(node.text) : node.text;
const strLines = config.convertLineBreakToBr ? str.split('\n') : [str];

@@ -26,3 +26,3 @@ const textChildren = [];

const markElements = [];
const markTransformKeys = (0, utilities_2.intersection)(config.markTransforms || {}, node);
const markTransformKeys = (0, _2.intersection)(config.markTransforms || {}, node);
markTransformKeys.forEach((key) => {

@@ -59,3 +59,3 @@ var _a;

// revert the earlier encoding - encode will re-encode
line = (0, utilities_1.decodeBreakingEntities)(line);
line = (0, _1.decodeBreakingEntities)(line);
}

@@ -62,0 +62,0 @@ textChildren.push((0, domhandler_2.nestedMarkElements)(markElementsClone, new domhandler_1.Text((0, html_entities_1.encode)(line))));

@@ -7,3 +7,3 @@ "use strict";

const dom_serializer_1 = require("dom-serializer");
const utilities_1 = require("@slate-serializers/utilities");
const _1 = require(".");
/**

@@ -76,3 +76,3 @@ * Generate nested mark elements

if (cssText) {
const css = (0, utilities_1.parseStyleCssText)(cssText);
const css = (0, _1.parseStyleCssText)(cssText);
if (css[attribute]) {

@@ -79,0 +79,0 @@ return css[attribute];

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

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