2021-09-09 15:09:24 +00:00
|
|
|
import { ContentEditor } from './index';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
component: ContentEditor,
|
2021-10-01 12:13:32 +00:00
|
|
|
title: 'content_editor/components/content_editor',
|
2021-09-09 15:09:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const Template = (_, { argTypes }) => ({
|
|
|
|
components: { ContentEditor },
|
|
|
|
props: Object.keys(argTypes),
|
|
|
|
template: '<content-editor v-bind="$props" @initialized="loadContent" />',
|
|
|
|
methods: {
|
|
|
|
loadContent(contentEditor) {
|
|
|
|
// eslint-disable-next-line @gitlab/require-i18n-strings
|
|
|
|
contentEditor.setSerializedContent('Hello content editor');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export const Default = Template.bind({});
|
|
|
|
|
|
|
|
Default.args = {
|
|
|
|
renderMarkdown: () => '<p>Hello content editor</p>',
|
|
|
|
uploadsPath: '/uploads/',
|
|
|
|
serializerConfig: {},
|
|
|
|
extensions: [],
|
|
|
|
};
|