@contentful/field-editor-rich-text 0.26.1-next → 0.26.2-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/field-editor-rich-text.cjs.development.js +8 -2
- package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
- package/dist/field-editor-rich-text.esm.js +8 -2
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/dist/helpers/validations.d.ts +2 -1
- package/package.json +1 -1
|
@@ -680,6 +680,7 @@ var VALIDATIONS = {
|
|
|
680
680
|
ENABLED_MARKS: 'enabledMarks',
|
|
681
681
|
ENABLED_NODE_TYPES: 'enabledNodeTypes'
|
|
682
682
|
};
|
|
683
|
+
var DEFAULT_ENABLED_NODE_TYPES = [Contentful.BLOCKS.DOCUMENT, Contentful.BLOCKS.PARAGRAPH, 'text'];
|
|
683
684
|
|
|
684
685
|
var getRichTextValidation = function getRichTextValidation(field, validationType) {
|
|
685
686
|
return flow(function (v) {
|
|
@@ -690,13 +691,14 @@ var getRichTextValidation = function getRichTextValidation(field, validationType
|
|
|
690
691
|
};
|
|
691
692
|
|
|
692
693
|
var isFormattingOptionEnabled = function isFormattingOptionEnabled(field, validationType, nodeTypeOrMark) {
|
|
693
|
-
var enabledFormattings = getRichTextValidation(field, validationType);
|
|
694
|
+
var enabledFormattings = getRichTextValidation(field, validationType); // TODO: In the future, validations will always be opt-in. In that case
|
|
695
|
+
// we don't need this step.
|
|
694
696
|
|
|
695
697
|
if (enabledFormattings === undefined) {
|
|
696
698
|
return true;
|
|
697
699
|
}
|
|
698
700
|
|
|
699
|
-
return enabledFormattings.includes(nodeTypeOrMark);
|
|
701
|
+
return DEFAULT_ENABLED_NODE_TYPES.concat(enabledFormattings).includes(nodeTypeOrMark);
|
|
700
702
|
};
|
|
701
703
|
|
|
702
704
|
var isNodeTypeEnabled = function isNodeTypeEnabled(field, nodeType) {
|
|
@@ -3712,6 +3714,8 @@ function addTableTrackingEvents(editor, _ref) {
|
|
|
3712
3714
|
});
|
|
3713
3715
|
}
|
|
3714
3716
|
}, 1);
|
|
3717
|
+
} else {
|
|
3718
|
+
insertData(data);
|
|
3715
3719
|
}
|
|
3716
3720
|
};
|
|
3717
3721
|
}
|
|
@@ -4890,6 +4894,8 @@ function withPasteHandling(editor) {
|
|
|
4890
4894
|
var sanitized = sanitizeHtml(html, editor);
|
|
4891
4895
|
var newData = htmlToDataTransfer(sanitized);
|
|
4892
4896
|
insertData(newData);
|
|
4897
|
+
} else {
|
|
4898
|
+
insertData(data);
|
|
4893
4899
|
}
|
|
4894
4900
|
};
|
|
4895
4901
|
};
|