@contentful/rich-text-html-renderer
Advanced tools
Comparing version 2.8.0 to 2.9.0
@@ -6,3 +6,2 @@ "use strict"; | ||
return { | ||
nodeClass: 'document', | ||
nodeType: 'document', | ||
@@ -12,13 +11,4 @@ data: {}, | ||
{ | ||
nodeClass: 'block', | ||
nodeType: rich_text_types_1.BLOCKS.EMBEDDED_ENTRY, | ||
content: [ | ||
{ | ||
data: {}, | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
value: '', | ||
marks: [], | ||
}, | ||
], | ||
content: [], | ||
data: { | ||
@@ -25,0 +15,0 @@ target: entry, |
@@ -6,10 +6,7 @@ "use strict"; | ||
nodeType: 'document', | ||
nodeClass: 'document', | ||
content: [ | ||
{ | ||
nodeClass: 'block', | ||
nodeType: heading, | ||
content: [ | ||
{ | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -16,0 +13,0 @@ value: 'hello world', |
@@ -9,3 +9,2 @@ "use strict"; | ||
marks: [], | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -16,3 +15,2 @@ value: 'hello world', | ||
data: {}, | ||
nodeClass: 'block', | ||
nodeType: 'paragraph', | ||
@@ -24,3 +22,2 @@ }, | ||
marks: [], | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -31,3 +28,2 @@ value: '', | ||
data: {}, | ||
nodeClass: 'block', | ||
nodeType: 'hr', | ||
@@ -39,3 +35,2 @@ }, | ||
marks: [], | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -46,9 +41,7 @@ value: '', | ||
data: {}, | ||
nodeClass: 'block', | ||
nodeType: 'paragraph', | ||
}, | ||
], | ||
nodeClass: 'document', | ||
nodeType: 'document', | ||
}; | ||
//# sourceMappingURL=hr.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = { | ||
nodeClass: 'document', | ||
nodeType: 'document', | ||
content: [ | ||
{ | ||
nodeClass: 'block', | ||
nodeType: 'paragraph', | ||
content: [ | ||
{ | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -18,7 +15,5 @@ value: 'Some text ', | ||
{ | ||
nodeClass: 'inline', | ||
nodeType: 'hyperlink', | ||
content: [ | ||
{ | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -34,3 +29,2 @@ value: 'link', | ||
{ | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -37,0 +31,0 @@ value: ' text.', |
@@ -7,4 +7,2 @@ "use strict"; | ||
exports.hyperlinkDoc = hyperlink_1.default; | ||
var invalid_category_1 = require("./invalid-category"); | ||
exports.invalidCategoryDoc = invalid_category_1.default; | ||
var invalid_marks_1 = require("./invalid-marks"); | ||
@@ -11,0 +9,0 @@ exports.invalidMarksDoc = invalid_marks_1.default; |
@@ -13,3 +13,2 @@ "use strict"; | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
@@ -23,7 +22,5 @@ { | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
], | ||
nodeType: inlineType, | ||
nodeClass: 'inline', | ||
}, | ||
@@ -34,11 +31,8 @@ { | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
], | ||
nodeType: 'paragraph', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'document', | ||
nodeClass: 'document', | ||
}; | ||
@@ -45,0 +39,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = { | ||
nodeClass: 'document', | ||
nodeType: 'document', | ||
content: [ | ||
{ | ||
nodeClass: 'block', | ||
nodeType: 'paragraph', | ||
content: [ | ||
{ | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -14,0 +11,0 @@ value: 'Hello world!', |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = { | ||
nodeClass: 'document', | ||
nodeType: 'document', | ||
content: [ | ||
{ | ||
nodeClass: 'block', | ||
nodeType: 'UNRECOGNIZED_TYPE', | ||
content: [ | ||
{ | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -14,0 +11,0 @@ value: 'Hello world!', |
@@ -6,10 +6,7 @@ "use strict"; | ||
nodeType: 'document', | ||
nodeClass: 'document', | ||
content: [ | ||
{ | ||
nodeClass: 'block', | ||
nodeType: 'paragraph', | ||
content: [ | ||
{ | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -16,0 +13,0 @@ value: 'hello world', |
@@ -18,11 +18,8 @@ "use strict"; | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
], | ||
nodeType: 'paragraph', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'list-item', | ||
nodeClass: 'block', | ||
}, | ||
@@ -39,15 +36,11 @@ { | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
], | ||
nodeType: 'paragraph', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'list-item', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'ordered-list', | ||
nodeClass: 'block', | ||
}, | ||
@@ -61,12 +54,9 @@ { | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
], | ||
nodeType: 'paragraph', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'document', | ||
nodeClass: 'document', | ||
}; | ||
//# sourceMappingURL=ol.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = { | ||
nodeClass: 'document', | ||
nodeType: 'document', | ||
content: [ | ||
{ | ||
nodeClass: 'block', | ||
nodeType: 'paragraph', | ||
content: [ | ||
{ | ||
nodeClass: 'text', | ||
nodeType: 'text', | ||
@@ -14,0 +11,0 @@ value: 'hello world', |
@@ -12,7 +12,5 @@ "use strict"; | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
], | ||
nodeType: 'paragraph', | ||
nodeClass: 'block', | ||
}, | ||
@@ -26,12 +24,9 @@ { | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
], | ||
nodeType: 'blockquote', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'document', | ||
nodeClass: 'document', | ||
}; | ||
//# sourceMappingURL=quote.js.map |
@@ -18,11 +18,8 @@ "use strict"; | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
], | ||
nodeType: 'paragraph', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'list-item', | ||
nodeClass: 'block', | ||
}, | ||
@@ -39,15 +36,11 @@ { | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
], | ||
nodeType: 'paragraph', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'list-item', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'unordered-list', | ||
nodeClass: 'block', | ||
}, | ||
@@ -61,12 +54,9 @@ { | ||
nodeType: 'text', | ||
nodeClass: 'text', | ||
}, | ||
], | ||
nodeType: 'paragraph', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'document', | ||
nodeClass: 'document', | ||
}; | ||
//# sourceMappingURL=ul.js.map |
@@ -11,3 +11,2 @@ "use strict"; | ||
nodeType: 'document', | ||
nodeClass: 'document', | ||
data: {}, | ||
@@ -94,7 +93,2 @@ content: [], | ||
}); | ||
it('renders empty node if it is of unrecognized category', function () { | ||
var document = documents_1.invalidCategoryDoc; | ||
var expected = ''; | ||
expect(index_1.documentToHtmlString(document)).toEqual(expected); | ||
}); | ||
it('renders default entry link block', function () { | ||
@@ -101,0 +95,0 @@ var entrySys = { |
@@ -55,11 +55,3 @@ "use strict"; | ||
var _b = _a.renderNode, renderNode = _b === void 0 ? {} : _b, _c = _a.renderMark, renderMark = _c === void 0 ? {} : _c; | ||
if (node.nodeClass === 'block' || node.nodeClass === 'inline') { | ||
var nextNode = function (nodes) { return nodeListToHtmlString(nodes, { renderMark: renderMark, renderNode: renderNode }); }; | ||
if (!node.nodeType || !renderNode[node.nodeType]) { | ||
// TODO: Figure what to return when passed an unrecognized node. | ||
return ''; | ||
} | ||
return renderNode[node.nodeType](node, nextNode); | ||
} | ||
else if (node.nodeClass === 'text') { | ||
if (node.nodeType === 'text') { | ||
var textNode = node; | ||
@@ -77,5 +69,10 @@ if (textNode.marks.length > 0) { | ||
else { | ||
return ''; | ||
var nextNode = function (nodes) { return nodeListToHtmlString(nodes, { renderMark: renderMark, renderNode: renderNode }); }; | ||
if (!node.nodeType || !renderNode[node.nodeType]) { | ||
// TODO: Figure what to return when passed an unrecognized node. | ||
return ''; | ||
} | ||
return renderNode[node.nodeType](node, nextNode); | ||
} | ||
} | ||
//# sourceMappingURL=index.js.map |
@@ -102,2 +102,3 @@ 'use strict'; | ||
BLOCKS.EMBEDDED_ENTRY, | ||
BLOCKS.EMBEDDED_ASSET, | ||
]; | ||
@@ -107,7 +108,3 @@ /** | ||
*/ | ||
var VOID_BLOCKS = [ | ||
BLOCKS.HR, | ||
BLOCKS.EMBEDDED_ENTRY, | ||
BLOCKS.EMBEDDED_ASSET, | ||
]; | ||
var VOID_BLOCKS = [BLOCKS.HR, BLOCKS.EMBEDDED_ENTRY, BLOCKS.EMBEDDED_ASSET]; | ||
/** | ||
@@ -182,11 +179,3 @@ * Dictionary of all container block types, and the set block types they accept as children. | ||
var _b = _a.renderNode, renderNode = _b === void 0 ? {} : _b, _c = _a.renderMark, renderMark = _c === void 0 ? {} : _c; | ||
if (node.nodeClass === 'block' || node.nodeClass === 'inline') { | ||
var nextNode = function (nodes) { return nodeListToHtmlString(nodes, { renderMark: renderMark, renderNode: renderNode }); }; | ||
if (!node.nodeType || !renderNode[node.nodeType]) { | ||
// TODO: Figure what to return when passed an unrecognized node. | ||
return ''; | ||
} | ||
return renderNode[node.nodeType](node, nextNode); | ||
} | ||
else if (node.nodeClass === 'text') { | ||
if (node.nodeType === 'text') { | ||
var textNode = node; | ||
@@ -204,3 +193,8 @@ if (textNode.marks.length > 0) { | ||
else { | ||
return ''; | ||
var nextNode = function (nodes) { return nodeListToHtmlString(nodes, { renderMark: renderMark, renderNode: renderNode }); }; | ||
if (!node.nodeType || !renderNode[node.nodeType]) { | ||
// TODO: Figure what to return when passed an unrecognized node. | ||
return ''; | ||
} | ||
return renderNode[node.nodeType](node, nextNode); | ||
} | ||
@@ -207,0 +201,0 @@ } |
export { default as hrDoc } from './hr'; | ||
export { default as hyperlinkDoc } from './hyperlink'; | ||
export { default as invalidCategoryDoc } from './invalid-category'; | ||
export { default as invalidMarksDoc } from './invalid-marks'; | ||
@@ -5,0 +4,0 @@ export { default as invalidTypeDoc } from './invalid-type'; |
{ | ||
"name": "@contentful/rich-text-html-renderer", | ||
"version": "2.8.0", | ||
"version": "2.9.0", | ||
"description": "", | ||
@@ -117,4 +117,4 @@ "keywords": [], | ||
"dependencies": { | ||
"@contentful/rich-text-types": "^4.1.0" | ||
"@contentful/rich-text-types": "^5.0.0" | ||
} | ||
} |
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69209
50
896
+ Added@contentful/rich-text-types@5.0.0(transitive)
- Removed@contentful/rich-text-types@4.2.0(transitive)