@atlaskit/editor-plugin-card
Version:
Card plugin for @atlaskit/editor-core
24 lines • 787 B
JavaScript
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
import { embedCardNodeView } from './embedCard';
export const lazyEmbedCardView = props => {
const {
isPageSSRed
} = props;
if (editorExperiment('platform_editor_exp_lazy_node_views', false) || isPageSSRed) {
return embedCardNodeView(props);
}
return withLazyLoading({
nodeName: 'embedCard',
getNodeViewOptions: () => {},
loader: () => {
const result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-embed-card-item-nodeview" */
'./embedCard').then(({
embedCardNodeView
}) => {
return embedCardNodeView(props);
});
return result;
}
});
};