@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
|
@@ -673,6 +673,7 @@ var VALIDATIONS = {
|
|
|
673
673
|
ENABLED_MARKS: 'enabledMarks',
|
|
674
674
|
ENABLED_NODE_TYPES: 'enabledNodeTypes'
|
|
675
675
|
};
|
|
676
|
+
var DEFAULT_ENABLED_NODE_TYPES = [BLOCKS.DOCUMENT, BLOCKS.PARAGRAPH, 'text'];
|
|
676
677
|
|
|
677
678
|
var getRichTextValidation = function getRichTextValidation(field, validationType) {
|
|
678
679
|
return flow(function (v) {
|
|
@@ -683,13 +684,14 @@ var getRichTextValidation = function getRichTextValidation(field, validationType
|
|
|
683
684
|
};
|
|
684
685
|
|
|
685
686
|
var isFormattingOptionEnabled = function isFormattingOptionEnabled(field, validationType, nodeTypeOrMark) {
|
|
686
|
-
var enabledFormattings = getRichTextValidation(field, validationType);
|
|
687
|
+
var enabledFormattings = getRichTextValidation(field, validationType); // TODO: In the future, validations will always be opt-in. In that case
|
|
688
|
+
// we don't need this step.
|
|
687
689
|
|
|
688
690
|
if (enabledFormattings === undefined) {
|
|
689
691
|
return true;
|
|
690
692
|
}
|
|
691
693
|
|
|
692
|
-
return enabledFormattings.includes(nodeTypeOrMark);
|
|
694
|
+
return DEFAULT_ENABLED_NODE_TYPES.concat(enabledFormattings).includes(nodeTypeOrMark);
|
|
693
695
|
};
|
|
694
696
|
|
|
695
697
|
var isNodeTypeEnabled = function isNodeTypeEnabled(field, nodeType) {
|
|
@@ -3705,6 +3707,8 @@ function addTableTrackingEvents(editor, _ref) {
|
|
|
3705
3707
|
});
|
|
3706
3708
|
}
|
|
3707
3709
|
}, 1);
|
|
3710
|
+
} else {
|
|
3711
|
+
insertData(data);
|
|
3708
3712
|
}
|
|
3709
3713
|
};
|
|
3710
3714
|
}
|
|
@@ -4883,6 +4887,8 @@ function withPasteHandling(editor) {
|
|
|
4883
4887
|
var sanitized = sanitizeHtml(html, editor);
|
|
4884
4888
|
var newData = htmlToDataTransfer(sanitized);
|
|
4885
4889
|
insertData(newData);
|
|
4890
|
+
} else {
|
|
4891
|
+
insertData(data);
|
|
4886
4892
|
}
|
|
4887
4893
|
};
|
|
4888
4894
|
};
|