|
| 1 | +import type { UmbPropertyEditorUiTiptapElement } from './property-editor-ui-tiptap.element.js'; |
| 2 | +import type { Meta, StoryObj } from '@storybook/web-components'; |
| 3 | +import { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor'; |
| 4 | + |
| 5 | +import './property-editor-ui-tiptap.element.js'; |
| 6 | + |
| 7 | +const config = new UmbPropertyEditorConfigCollection([ |
| 8 | + { |
| 9 | + alias: 'hideLabel', |
| 10 | + value: true, |
| 11 | + }, |
| 12 | + { alias: 'dimensions', value: { height: 500 } }, |
| 13 | + { alias: 'maxImageSize', value: 500 }, |
| 14 | + { alias: 'ignoreUserStartNodes', value: false }, |
| 15 | + { |
| 16 | + alias: 'toolbar', |
| 17 | + value: [ |
| 18 | + [ |
| 19 | + [ |
| 20 | + ['Umb.Tiptap.Toolbar.Bold', 'Umb.Tiptap.Toolbar.Italic', 'Umb.Tiptap.Toolbar.Underline'], |
| 21 | + [ |
| 22 | + 'Umb.Tiptap.Toolbar.TextAlignLeft', |
| 23 | + 'Umb.Tiptap.Toolbar.TextAlignCenter', |
| 24 | + 'Umb.Tiptap.Toolbar.TextAlignRight', |
| 25 | + ], |
| 26 | + ['Umb.Tiptap.Toolbar.Heading1', 'Umb.Tiptap.Toolbar.Heading2', 'Umb.Tiptap.Toolbar.Heading3'], |
| 27 | + ['Umb.Tiptap.Toolbar.Unlink', 'Umb.Tiptap.Toolbar.Link'], |
| 28 | + ['Umb.Tiptap.Toolbar.Embed', 'Umb.Tiptap.Toolbar.MediaPicker', 'Umb.Tiptap.Toolbar.BlockPicker'], |
| 29 | + ['Umb.Tiptap.Toolbar.Redo', 'Umb.Tiptap.Toolbar.Undo'], |
| 30 | + ], |
| 31 | + ], |
| 32 | + ], |
| 33 | + }, |
| 34 | + { |
| 35 | + alias: 'extensions', |
| 36 | + value: [ |
| 37 | + 'Umb.Tiptap.Bold', |
| 38 | + 'Umb.Tiptap.Italic', |
| 39 | + 'Umb.Tiptap.Underline', |
| 40 | + 'Umb.Tiptap.Strike', |
| 41 | + 'Umb.Tiptap.Blockquote', |
| 42 | + 'Umb.Tiptap.CodeBlock', |
| 43 | + 'Umb.Tiptap.HorizontalRule', |
| 44 | + 'Umb.Tiptap.Figure', |
| 45 | + 'Umb.Tiptap.Table', |
| 46 | + 'Umb.Tiptap.Link', |
| 47 | + 'Umb.Tiptap.Embed', |
| 48 | + 'Umb.Tiptap.Image', |
| 49 | + 'Umb.Tiptap.Heading', |
| 50 | + 'Umb.Tiptap.List', |
| 51 | + 'Umb.Tiptap.TextAlign', |
| 52 | + 'Umb.Tiptap.MediaUpload', |
| 53 | + 'Umb.Tiptap.Block', |
| 54 | + ], |
| 55 | + }, |
| 56 | +]); |
| 57 | + |
| 58 | +const meta: Meta<UmbPropertyEditorUiTiptapElement> = { |
| 59 | + title: 'Property Editor UIs/Tiptap', |
| 60 | + component: 'umb-property-editor-ui-tiptap', |
| 61 | + id: 'umb-property-editor-ui-tiptap', |
| 62 | + args: { |
| 63 | + config: undefined, |
| 64 | + value: { |
| 65 | + blocks: { |
| 66 | + layout: {}, |
| 67 | + contentData: [], |
| 68 | + settingsData: [], |
| 69 | + }, |
| 70 | + markup: ` |
| 71 | + <h2>Tiptap</h2> |
| 72 | + <p>I am a default value for the Tiptap text editor story.</p> |
| 73 | + <p> |
| 74 | + <a href="https://docs.umbraco.com" target="_blank" rel="noopener noreferrer">Umbraco documentation</a> |
| 75 | + </p> |
| 76 | + `, |
| 77 | + }, |
| 78 | + }, |
| 79 | +}; |
| 80 | + |
| 81 | +export default meta; |
| 82 | +type Story = StoryObj<UmbPropertyEditorUiTiptapElement>; |
| 83 | + |
| 84 | +export const Default: Story = {}; |
| 85 | + |
| 86 | +export const DefaultConfig: Story = { |
| 87 | + args: { |
| 88 | + config, |
| 89 | + }, |
| 90 | +}; |
0 commit comments