teableio/teable

View on GitHub
packages/sdk/src/components/comment/comment-editor/plugin/image-plugin/withImage.ts

Summary

Maintainability
A
0 mins
Test Coverage
import type { ExtendEditor } from '@udecode/plate-common';

import type { ImageConfig } from './ImagePlugin';

import { withImageEmbed } from './withImageEmbed';
import { withImageUpload } from './withImageUpload';

/**
 * @see withImageUpload
 * @see withImageEmbed
 */
export const withImage: ExtendEditor<ImageConfig> = ({ editor, ...ctx }) => {
  editor = withImageUpload({ editor, ...ctx });
  editor = withImageEmbed({ editor, ...ctx });

  return editor;
};