UNPKG

@atlaskit/editor-plugin-show-diff

Version:

ShowDiff plugin for @atlaskit/editor-core

17 lines 1.06 kB
import { fg } from '@atlaskit/platform-feature-flags/fg'; import { expValEquals } from '@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. */ export var isExtendedEnabled = function isExtendedEnabled(diffType) { return expValEquals('platform_editor_diff_plugin_extended', 'isEnabled', true) || diffType === 'smart' && fg('platform_editor_ai_smart_diff'); }; export var getDefaultDiffType = function getDefaultDiffType() { return fg('confluence_ncs_step_diffing_version_history') ? 'smart' : 'inline'; };