From 793a372a2ea281b8ed423286b2653187de89c3a1 Mon Sep 17 00:00:00 2001 From: Deep Chudasama Date: Wed, 18 Dec 2024 00:12:27 +0530 Subject: [PATCH] chore(names): updated names of components and exported from index.ts --- .../tiptap-wysiwyg-editor.stories.tsx | 17 ------- .../rich-text-editor.stories.tsx | 17 ------- .../wysiwyg-editor/rich-text-editor.tsx | 48 ------------------- .../wysiwyg-editor/wysiwyg-editor.stories.tsx | 17 +++++++ .../wysiwyg-editor.tsx} | 4 +- src/index.ts | 2 + 6 files changed, 21 insertions(+), 84 deletions(-) delete mode 100644 src/components/tiptap-wysiwyg-editor/tiptap-wysiwyg-editor.stories.tsx delete mode 100644 src/components/wysiwyg-editor/rich-text-editor.stories.tsx delete mode 100644 src/components/wysiwyg-editor/rich-text-editor.tsx create mode 100644 src/components/wysiwyg-editor/wysiwyg-editor.stories.tsx rename src/components/{tiptap-wysiwyg-editor/tiptap-wysiwyg-editor.tsx => wysiwyg-editor/wysiwyg-editor.tsx} (98%) diff --git a/src/components/tiptap-wysiwyg-editor/tiptap-wysiwyg-editor.stories.tsx b/src/components/tiptap-wysiwyg-editor/tiptap-wysiwyg-editor.stories.tsx deleted file mode 100644 index 6d801b2..0000000 --- a/src/components/tiptap-wysiwyg-editor/tiptap-wysiwyg-editor.stories.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Meta, StoryObj } from '@storybook/react'; - -import { TiptapEditor } from './tiptap-wysiwyg-editor'; - -const meta: Meta = { - component: TiptapEditor, - title: 'Components/TipTap Editor', -}; - -export default meta; -type Story = StoryObj; - -export const Demo: Story = { - render: (_) => { - return ; - }, -}; diff --git a/src/components/wysiwyg-editor/rich-text-editor.stories.tsx b/src/components/wysiwyg-editor/rich-text-editor.stories.tsx deleted file mode 100644 index 6c57a3c..0000000 --- a/src/components/wysiwyg-editor/rich-text-editor.stories.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Meta, StoryObj } from '@storybook/react'; - -import { RichTextEditor } from './rich-text-editor'; - -const meta: Meta = { - component: RichTextEditor, - title: 'Components/Rich Text Editor', -}; - -export default meta; -type Story = StoryObj; - -export const Demo: Story = { - render: (_) => { - return ; - }, -}; diff --git a/src/components/wysiwyg-editor/rich-text-editor.tsx b/src/components/wysiwyg-editor/rich-text-editor.tsx deleted file mode 100644 index 08d7484..0000000 --- a/src/components/wysiwyg-editor/rich-text-editor.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { cn } from '@src/lib/utils'; - -// Require Editor CSS files. -import 'froala-editor/css/froala_style.min.css'; -import 'froala-editor/css/froala_editor.pkgd.min.css'; - -// Import all Froala Editor plugins; -import 'froala-editor/js/plugins.pkgd.min.js'; - -// Import a single Froala Editor plugin. -import 'froala-editor/js/plugins/align.min.js'; - -// Import a language file. -import 'froala-editor/js/languages/de.js'; - -// Import a third-party plugin. -// import 'froala-editor/js/third_party/image_tui.min.js'; -// import 'froala-editor/js/third_party/embedly.min.js'; -// import 'froala-editor/js/third_party/spell_checker.min.js'; - -// Include font-awesome css if required. -// install using "npm install font-awesome --save" -// import 'font-awesome/css/font-awesome.css'; -// import 'froala-editor/js/third_party/font_awesome.min.js'; - -// Include special components if required. -// import FroalaEditorView from 'react-froala-wysiwyg/FroalaEditorView'; -// import FroalaEditorA from 'react-froala-wysiwyg/FroalaEditorA'; -// import FroalaEditorButton from 'react-froala-wysiwyg/FroalaEditorButton'; -// import FroalaEditorImg from 'react-froala-wysiwyg/FroalaEditorImg'; -// import FroalaEditorInput from 'react-froala-wysiwyg/FroalaEditorInput'; - -import FroalaEditor from 'react-froala-wysiwyg'; - -const RichTextEditor = () => { - return ( -
- -
- ); -}; - -export { RichTextEditor }; diff --git a/src/components/wysiwyg-editor/wysiwyg-editor.stories.tsx b/src/components/wysiwyg-editor/wysiwyg-editor.stories.tsx new file mode 100644 index 0000000..2beac34 --- /dev/null +++ b/src/components/wysiwyg-editor/wysiwyg-editor.stories.tsx @@ -0,0 +1,17 @@ +import { Meta, StoryObj } from '@storybook/react'; + +import { WYSIWYGEditor } from './wysiwyg-editor'; + +const meta: Meta = { + component: WYSIWYGEditor, + title: 'Components/WYSIWYG Editor', +}; + +export default meta; +type Story = StoryObj; + +export const Demo: Story = { + render: (_) => { + return ; + }, +}; diff --git a/src/components/tiptap-wysiwyg-editor/tiptap-wysiwyg-editor.tsx b/src/components/wysiwyg-editor/wysiwyg-editor.tsx similarity index 98% rename from src/components/tiptap-wysiwyg-editor/tiptap-wysiwyg-editor.tsx rename to src/components/wysiwyg-editor/wysiwyg-editor.tsx index 4c73838..4396dd0 100644 --- a/src/components/tiptap-wysiwyg-editor/tiptap-wysiwyg-editor.tsx +++ b/src/components/wysiwyg-editor/wysiwyg-editor.tsx @@ -15,7 +15,7 @@ import Placeholder from '@tiptap/extension-placeholder'; // import { NodeViewContent, NodeViewWrapper } from '@tiptap/react'; import { Button } from '@components/button'; -const TiptapEditor: React.FC = () => { +const WYSIWYGEditor: React.FC = () => { const [content, setContent] = useState('

Type / to insert blocks...

'); const [commandMenu, setCommandMenu] = useState(false); @@ -181,4 +181,4 @@ const TiptapEditor: React.FC = () => { ); }; -export { TiptapEditor }; +export { WYSIWYGEditor }; diff --git a/src/index.ts b/src/index.ts index 8b2cdba..ca9a109 100644 --- a/src/index.ts +++ b/src/index.ts @@ -36,6 +36,8 @@ export * from '@components/truncated-text/truncated-text'; export * from '@components/breadcrumb/breadcrumb'; export * from '@components/color-picker-input/color-picker-input'; export * from '@components/drag-n-drop-file-input/drag-n-drop-file-input'; +export * from '@components/checkbox-tree-view/checkbox-tree-view'; +export * from '@components/wysiwyg-editor/wysiwyg-editor'; // Other stuff export * from '@src/lib/icons';