Welcome to mirror list, hosted at ThFree Co, Russian Federation.

content_editor.stories.js « content_editor « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1aa6568848f29e0b646832b9ecb604f466068d81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { withGitLabAPIAccess } from 'storybook_addons/gitlab_api_access';
import Api from '~/api';
import { ContentEditor } from './index';

export default {
  component: ContentEditor,
  title: 'ce/content_editor/content_editor',
  decorators: [withGitLabAPIAccess],
};

const Template = (_, { argTypes }) => ({
  components: { ContentEditor },
  props: Object.keys(argTypes),
  template: `
    <content-editor v-bind="$props" />
  `,
});

export const Default = Template.bind({});

Default.args = {
  project: 'gitlab-org/gitlab-shell',
  renderMarkdown: async (text) => {
    const response = await Api.markdown({ text, gfm: true, project: Default.args.project });

    return response.data.html;
  },
  markdown: 'This is **bold text**',
  uploadsPath: '/uploads/',
  serializerConfig: {},
  extensions: [],
  enableAutocomplete: false,
};