@slate-serializers/dom
Advanced tools
Comparing version 2.1.6 to 2.2.0
{ | ||
"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" | ||
} | ||
} |
@@ -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
39937
8
36
588
+ Addedhtmlparser2@9.1.0(transitive)
+ Addedimmer@10.1.1(transitive)
+ Addedslate@0.102.0(transitive)
+ Addedtslib@2.6.3(transitive)
- Removed@slate-serializers/utilities@2.1.5
- Removedpostcss@^8.4.24
- Removedpostcss-js@^4.0.1
- Removed@slate-serializers/utilities@2.1.5(transitive)
- Removedcamelcase-css@2.0.1(transitive)
- Removeddom-serializer@1.4.1(transitive)
- Removeddomhandler@4.3.1(transitive)
- Removeddomutils@2.8.0(transitive)
- Removedentities@2.2.03.0.1(transitive)
- Removedhtmlparser2@7.2.0(transitive)
- Removedimmer@9.0.21(transitive)
- Removednanoid@3.3.8(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedpostcss@8.4.49(transitive)
- Removedpostcss-js@4.0.1(transitive)
- Removedslate@0.94.1(transitive)
- Removedsource-map-js@1.2.1(transitive)
- Removedtslib@2.5.0(transitive)
Updatedhtml-entities@^2.5.2
Updatedhtmlparser2@9.1.0
Updatedslate@^0.102.0
Updatedtslib@2.6.3