@atlaskit/editor-plugin-card
Version:
Card plugin for @atlaskit/editor-core
23 lines • 1.12 kB
JavaScript
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
import { inlineCardNodeView } from './inlineCard';
export var lazyInlineCardView = function lazyInlineCardView(props) {
var _props$isPageSSRed = props.isPageSSRed,
isPageSSRed = _props$isPageSSRed === void 0 ? false : _props$isPageSSRed;
if (editorExperiment('platform_editor_exp_lazy_node_views', false) || expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) || isPageSSRed) {
return inlineCardNodeView(props);
}
return withLazyLoading({
nodeName: 'inlineCard',
getNodeViewOptions: function getNodeViewOptions() {},
loader: function loader() {
var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-inline-card-item-nodeview" */
'./inlineCard').then(function (_ref) {
var inlineCardNodeView = _ref.inlineCardNodeView;
return inlineCardNodeView(props);
});
return result;
}
});
};