@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
38 lines (36 loc) • 1.7 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = editorDeprecationWarnings;
function editorDeprecationWarnings(props) {
if (process.env.NODE_ENV === 'production') {
return;
}
var deprecatedProperties = {
allowTasksAndDecisions: {
message: 'To allow tasks and decisions use taskDecisionProvider – <Editor taskDecisionProvider={{ provider }} />',
type: 'removed'
},
allowConfluenceInlineComment: {
message: 'To integrate inline comments use experimental annotationProvider – <Editor annotationProviders={{ provider }} />',
type: 'removed'
},
smartLinks: {
message: 'To use smartLinks, pass the same object into the smartlinks key of linking - <Editor linking={{ smartLinks: {existing object} }}.',
type: 'removed'
}
};
Object.keys(deprecatedProperties).forEach(function (property) {
if (props.hasOwnProperty(property)) {
var meta = deprecatedProperties[property];
var type = meta.type || 'enabled by default';
// eslint-disable-next-line no-console
console.warn("".concat(property, " property is deprecated. ").concat(meta.message || '', " [Will be ").concat(type, " in the next major editor-core version]"));
}
});
if (props.hasOwnProperty('allowTables') && typeof props.allowTables !== 'boolean' && (!props.allowTables || !props.allowTables.advanced)) {
// eslint-disable-next-line no-console
console.warn("Advanced table options are deprecated (except isHeaderRowRequired) to continue using advanced table features use - <Editor allowTables={{ advanced: true }} /> [Will be changed in the next major editor-core version]");
}
}