diff --git a/components/editor/custom-editor.js b/components/editor/custom-editor.js
index d2a16e4..cee120f 100644
--- a/components/editor/custom-editor.js
+++ b/components/editor/custom-editor.js
@@ -1,40 +1,78 @@
-// components/custom-editor.js
-
-import React from "react";
+import React, { useCallback, useEffect, useRef, useState } from "react";
import { CKEditor } from "@ckeditor/ckeditor5-react";
+
+import "@/styles/custom-editor.css";
import Editor from "@/vendor/ckeditor5/build/ckeditor";
function CustomEditor(props) {
+ const maxHeight = props.maxHeight || 600;
+
return (
-
{
- const data = editor.getData();
- console.log({ event, editor, data });
- props.onChange(data);
- }}
- config={{
- toolbar: [
- "heading",
- "fontsize",
- "bold",
- "italic",
- "link",
- "numberedList",
- "bulletedList",
- "undo",
- "redo",
- "alignment",
- "outdent",
- "indent",
- "blockQuote",
- "insertTable",
- "codeBlock",
- "sourceEditing",
- ],
- }}
- />
+
+ {
+ const data = editor.getData();
+ console.log({ event, editor, data });
+ props.onChange(data);
+ }}
+ config={{
+ toolbar: [
+ "heading",
+ "fontsize",
+ "bold",
+ "italic",
+ "link",
+ "numberedList",
+ "bulletedList",
+ "undo",
+ "redo",
+ "alignment",
+ "outdent",
+ "indent",
+ "blockQuote",
+ "insertTable",
+ "codeBlock",
+ "sourceEditing",
+ ],
+ content_style: `
+ body {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
+ font-size: 14px;
+ line-height: 1.6;
+ color: #111 !important;
+ background: #fff !important;
+ margin: 0;
+ padding: 1rem;
+ }
+ p {
+ margin: 0.5em 0 !important;
+ }
+ h1, h2, h3, h4, h5, h6 {
+ margin: 1em 0 0.5em 0;
+ color: inherit !important;
+ }
+ ul, ol {
+ margin: 0.5em 0;
+ padding-left: 2em;
+ }
+ blockquote {
+ margin: 1em 0;
+ padding: 0.5em 1em;
+ border-left: 4px solid #d1d5db;
+ background-color: #f9fafb;
+ color: inherit !important;
+ }
+ `,
+ height: props.height || 400,
+ removePlugins: ["Title"],
+ mobile: {
+ theme: "silver",
+ },
+ }}
+ />
+
);
}
diff --git a/components/editor/view-editor.js b/components/editor/view-editor.js
index 2dae74e..1e579b0 100644
--- a/components/editor/view-editor.js
+++ b/components/editor/view-editor.js
@@ -3,17 +3,262 @@ import { CKEditor } from "@ckeditor/ckeditor5-react";
import Editor from "@/vendor/ckeditor5/build/ckeditor";
function ViewEditor(props) {
+ const maxHeight = props.maxHeight || 600; // Default max height 600px
+
return (
-
+
+
+
+
);
}
export default ViewEditor;
+
+// import React from "react";
+// import { CKEditor } from "@ckeditor/ckeditor5-react";
+// import Editor from "ckeditor5-custom-build";
+
+// function ViewEditor(props) {
+// const maxHeight = props.maxHeight || 600;
+
+// return (
+//
+//
+//
+//
+// );
+// }
+
+// export default ViewEditor;
diff --git a/components/table/article-table.tsx b/components/table/article-table.tsx
index 3a50853..919c99d 100644
--- a/components/table/article-table.tsx
+++ b/components/table/article-table.tsx
@@ -316,7 +316,7 @@ export default function ArticleTable() {
return cellValue;
}
},
- [article, page]
+ [article, page],
);
let typingTimer: NodeJS.Timeout;
@@ -445,8 +445,8 @@ export default function ArticleTable() {