diff --git a/apps/storybook/.eslintrc.js b/apps/storybook/.eslintrc.js index f69cc2e9c2..d6a43deefb 100755 --- a/apps/storybook/.eslintrc.js +++ b/apps/storybook/.eslintrc.js @@ -1,6 +1,6 @@ -export default { +module.exports = { root: false, - extends: ["custom"], + extends: ['custom'], rules: { // eslint-plugin-import rules 'import/order': [ @@ -49,4 +49,4 @@ export default { typescript: {}, }, }, -}; \ No newline at end of file +}; diff --git a/apps/storybook/tailwind.config.js b/apps/storybook/tailwind.config.js index 5242e4b58d..bd0032c88f 100644 --- a/apps/storybook/tailwind.config.js +++ b/apps/storybook/tailwind.config.js @@ -1,4 +1,11 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires const tailwindConfig = require('../../packages/mirinae/tailwind.config.cjs'); -module.exports = tailwindConfig; +module.exports = { + content: [ + '../../packages/mirinae/src/**/*.{js,ts,jsx,tsx,vue}', + ], + theme: tailwindConfig.theme, + variants: tailwindConfig.variants, + plugins: tailwindConfig.plugins, +}; diff --git a/apps/web/package.json b/apps/web/package.json index e16e6602f9..84731787cd 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "web", - "version": "2.0.0-dev264", + "version": "2.0.0-dev278", "private": true, "description": "Cloudforet Console Web Application", "author": "Cloudforet", diff --git a/apps/web/public/images/opsflow-landing/img_landing_service-desk_hero.png b/apps/web/public/images/opsflow-landing/img_landing_service-desk_hero.png new file mode 100644 index 0000000000..355be57694 Binary files /dev/null and b/apps/web/public/images/opsflow-landing/img_landing_service-desk_hero.png differ diff --git a/apps/web/public/images/opsflow-landing/img_landing_service-desk_hero@2x.png b/apps/web/public/images/opsflow-landing/img_landing_service-desk_hero@2x.png new file mode 100644 index 0000000000..cce88c77a7 Binary files /dev/null and b/apps/web/public/images/opsflow-landing/img_landing_service-desk_hero@2x.png differ diff --git a/apps/web/public/images/opsflow-landing/img_landing_service-desk_hero@3x.png b/apps/web/public/images/opsflow-landing/img_landing_service-desk_hero@3x.png new file mode 100644 index 0000000000..a432f3f3c7 Binary files /dev/null and b/apps/web/public/images/opsflow-landing/img_landing_service-desk_hero@3x.png differ diff --git a/apps/web/src/common/components/editor/TextEditor.vue b/apps/web/src/common/components/editor/TextEditor.vue index ec12a0950d..30ccf031ea 100644 --- a/apps/web/src/common/components/editor/TextEditor.vue +++ b/apps/web/src/common/components/editor/TextEditor.vue @@ -14,33 +14,32 @@ import type { AnyExtension } from '@tiptap/vue-2'; import { Editor, EditorContent } from '@tiptap/vue-2'; import { Markdown } from 'tiptap-markdown'; +import { PTextarea } from '@cloudforet/mirinae'; + import { createImageExtension } from '@/common/components/editor/extensions/image'; -import { getAttachmentIds, setAttachmentsToContents } from '@/common/components/editor/extensions/image/helper'; -import type { Attachment, ImageUploader } from '@/common/components/editor/extensions/image/type'; +import type { ImageUploader } from '@/common/components/editor/extensions/image/type'; import MenuBar from '@/common/components/editor/MenuBar.vue'; +import type { TextEditorContentsType } from '@/common/components/editor/type'; import { loadMonospaceFonts } from '@/styles/fonts'; interface Props { value?: string; imageUploader?: ImageUploader; - attachments?: Attachment[]; invalid?: boolean; placeholder?: string; - contentType?: 'html'|'markdown'; + contentsType?: TextEditorContentsType; showUndoRedoButtons?: boolean; } const props = withDefaults(defineProps(), { value: '', imageUploader: undefined, - attachments: () => [], invalid: false, placeholder: '', - contentType: 'html', + contentsType: 'html', showUndoRedoButtons: true, }); const emit = defineEmits<{(e: 'update:value', value: string): void; - (e: 'update:attachment-ids', attachmentIds: string[]): void; }>(); loadMonospaceFonts(); @@ -68,13 +67,13 @@ const getExtensions = (): AnyExtension[] => { ]; // add extensions based on content type - if (props.contentType === 'html') { + if (props.contentsType === 'html') { extensions.push(Color); extensions.push(TextAlign.configure({ types: ['heading', 'paragraph'], })); } - if (props.contentType === 'markdown') { + if (props.contentsType === 'markdown') { extensions.push(Markdown); } @@ -87,18 +86,17 @@ const getExtensions = (): AnyExtension[] => { onMounted(() => { editor.value = new Editor({ - content: setAttachmentsToContents(props.value, props.attachments), + content: props.value, extensions: getExtensions(), onUpdate: () => { let content = ''; if (!editor.value) return; - if (props.contentType === 'html') { + if (props.contentsType === 'html') { content = editor.value?.getHTML() ?? ''; } else { content = editor.value.storage.markdown.getMarkdown() ?? ''; } emit('update:value', content); - emit('update:attachment-ids', getAttachmentIds(editor.value)); }, }); }); @@ -107,42 +105,50 @@ onBeforeUnmount(() => { if (editor.value) editor.value.destroy(); }); -watch([() => props.value, () => props.attachments], ([value, attachments], prev) => { +watch(() => props.value, (value) => { if (!editor.value) return; - let isSame; - if (props.contentType === 'html') { - isSame = editor.value.getHTML() === value; + + let contents: string; + if (props.contentsType === 'html') { + contents = editor.value?.getHTML() ?? ''; } else { - isSame = editor.value.storage.markdown.getMarkdown() === value; + contents = editor.value.storage.markdown.getMarkdown() ?? ''; } - if (isSame) return; - let newContents = value; - if (attachments !== prev[1]) newContents = setAttachmentsToContents(value, attachments); - editor.value.commands.setContent(newContents, false); + if (contents === value) return; // prevent infinite loop. + + editor.value.commands.setContent(value, false); }); - - diff --git a/apps/web/src/common/components/editor/TextEditorViewer.vue b/apps/web/src/common/components/editor/TextEditorViewer.vue index 2bde824d40..2050e92fff 100644 --- a/apps/web/src/common/components/editor/TextEditorViewer.vue +++ b/apps/web/src/common/components/editor/TextEditorViewer.vue @@ -1,45 +1,62 @@