@atlaskit/editor-plugin-show-diff
Version:
ShowDiff plugin for @atlaskit/editor-core
23 lines (22 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isExtendedEnabled = exports.getDefaultDiffType = void 0;
var _fg = require("@atlaskit/platform-feature-flags/fg");
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
/**
* The "extended" diff pipeline is normally gated by `platform_editor_diff_plugin_extended`.
* The `smart` diff type REQUIRES the extended pipeline, so whenever `smart` is active (and its
* own gate `platform_editor_ai_smart_diff` is on) the extended pipeline is force-enabled,
* independent of the extended gate. For all other diff types the extended gate alone decides.
*
* Pass the active `diffType` so callers deep in the decoration layer render the extended shape
* when `smart` is active even if `platform_editor_diff_plugin_extended` is off.
*/
var isExtendedEnabled = exports.isExtendedEnabled = function isExtendedEnabled(diffType) {
return (0, _expValEquals.expValEquals)('platform_editor_diff_plugin_extended', 'isEnabled', true) || diffType === 'smart' && (0, _fg.fg)('platform_editor_ai_smart_diff');
};
var getDefaultDiffType = exports.getDefaultDiffType = function getDefaultDiffType() {
return (0, _fg.fg)('confluence_ncs_step_diffing_version_history') ? 'smart' : 'inline';
};