From 0bf1aaec3ea5b5b8f3d3f53877a7e3b5612024bd Mon Sep 17 00:00:00 2001 From: Anang Yusman Date: Wed, 17 Apr 2024 16:13:29 +0700 Subject: [PATCH] feat:add form and table magazine --- app/admin/magazine/create/page.tsx | 11 + app/admin/magazine/detail/page.tsx | 11 + app/admin/magazine/page.tsx | 10 + app/admin/page.tsx | 36 --- components/form/magazine/magazine-form.tsx | 261 ++++++++++++++++ components/icons.tsx | 136 ++++++++- components/table/magazine/magazine-table.tsx | 232 ++++++++++++++ config/swal.ts | 95 ++++++ package-lock.json | 302 +++++++++++-------- package.json | 4 +- 10 files changed, 933 insertions(+), 165 deletions(-) create mode 100644 app/admin/magazine/create/page.tsx create mode 100644 app/admin/magazine/detail/page.tsx create mode 100644 app/admin/magazine/page.tsx create mode 100644 components/form/magazine/magazine-form.tsx create mode 100644 components/table/magazine/magazine-table.tsx create mode 100644 config/swal.ts diff --git a/app/admin/magazine/create/page.tsx b/app/admin/magazine/create/page.tsx new file mode 100644 index 0000000..89d98a2 --- /dev/null +++ b/app/admin/magazine/create/page.tsx @@ -0,0 +1,11 @@ +import CreateMagazineForm from '@/components/form/magazine/magazine-form' +import MagazineTable from '@/components/table/magazine/magazine-table' +import React from 'react' + +const AdminMagazineCreate = () => { + return ( +
+ ) +} + +export default AdminMagazineCreate \ No newline at end of file diff --git a/app/admin/magazine/detail/page.tsx b/app/admin/magazine/detail/page.tsx new file mode 100644 index 0000000..597c324 --- /dev/null +++ b/app/admin/magazine/detail/page.tsx @@ -0,0 +1,11 @@ +import CreateMagazineForm from '@/components/form/magazine/magazine-form' +import MagazineTable from '@/components/table/magazine/magazine-table' +import React from 'react' + +const AdminMagazineDetail = () => { + return ( +
+ ) +} + +export default AdminMagazineDetail \ No newline at end of file diff --git a/app/admin/magazine/page.tsx b/app/admin/magazine/page.tsx new file mode 100644 index 0000000..b2250f5 --- /dev/null +++ b/app/admin/magazine/page.tsx @@ -0,0 +1,10 @@ +import MagazineTable from '@/components/table/magazine/magazine-table' +import React from 'react' + +const AdminMagazine = () => { + return ( +
+ ) +} + +export default AdminMagazine \ No newline at end of file diff --git a/app/admin/page.tsx b/app/admin/page.tsx index 0084293..bda639f 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -5,42 +5,6 @@ export default function AdminHumasPage() {
1
1
- -
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
) } diff --git a/components/form/magazine/magazine-form.tsx b/components/form/magazine/magazine-form.tsx new file mode 100644 index 0000000..e8eed6f --- /dev/null +++ b/components/form/magazine/magazine-form.tsx @@ -0,0 +1,261 @@ +'use client' +import { Button } from "@nextui-org/button"; +import { Card, Checkbox, CheckboxGroup, Divider, Input, Radio, RadioGroup, Select, SelectItem, Slider, Switch, Tab, Table, Tabs, Textarea, User } from "@nextui-org/react"; +import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { TimesIcon } from "@/components/icons"; +import Link from "next/link"; +import { useRouter } from "next/navigation"; +import { close, error, loading } from "@/config/swal"; +import Swal from 'sweetalert2'; +import withReactContent from 'sweetalert2-react-content'; +import dynamic from 'next/dynamic'; +import { useForm } from "react-hook-form"; +import * as z from "zod"; +import { zodResolver } from "@hookform/resolvers/zod"; + +export default function CreateMagazineForm() { + const router = useRouter(); + const JoditEditor = dynamic(() => import('jodit-react'), { ssr: false }); + const MySwal = withReactContent(Swal); + const [isVisible, setIsVisible] = useState(false); + const [tabs, setTabs] = useState("personal-info") + const editor = useRef(null); + const [content, setContent] = useState(''); + const handleTab = (tab: any) => { + setTabs(tab); + }; + + let [files, setFiles] = useState([]); + + const removeFile = (name: string) => { + const arrayFile: File[] = []; + for (const element of files) { + if (element.name !== name) { + arrayFile.push(element); + } + } + setFiles(arrayFile); + }; + + const handleFileChange = (event: any) => { + const newFiles: FileList | null = event.target.files; + if (newFiles) { + const allowedExtensions = ['.doc', '.docx', '.pdf', '.ppt', '.pptx', '.xlsx', '.csv']; + let temp: File[] = [...files]; // Salin file-file yang sudah ada + for (let i = 0; i < newFiles.length; i++) { + const file = newFiles[i]; + const fileExtension = file.name.split('.').pop()?.toLowerCase(); + if (fileExtension && allowedExtensions.includes(`.${fileExtension}`)) { + temp.push(file); + } else { + alert('Format file tidak valid. Hanya file .doc, .docx, .ppt, .pptx, .xlsx, .csv atau .pdf yang diperbolehkan.'); + } + } + setFiles(temp); + } + }; + + const toggleVisibility = () => setIsVisible(!isVisible); + + const validationSchema = z.object({ + title: z.string().min(1, { message: "Required" }), + slug: z.string().min(1, { message: "Required" }), + }); + + const formOptions = { resolver: zodResolver(validationSchema) }; + type ArticleSchema = z.infer; + + const { register, handleSubmit, formState: { errors }, formState, setValue } = useForm(formOptions); + + const save = async (data: any) => { + + const request = { + title: data.title, + slug: data.slug, + articleBody: data.articleBody, + status: 1, + }; + // loading(); + // // const res = await saveManualContext(request); + // if (res.error) { + // error(res.message); + // return false; + // } + close(); + successSubmit("/admin/magazine") + } + + async function onSubmit(data: any) { + MySwal.fire({ + title: "Save Data", + text: "", + icon: "warning", + showCancelButton: true, + cancelButtonColor: "#d33", + confirmButtonColor: "#3085d6", + confirmButtonText: "Save", + }).then((result) => { + if (result.isConfirmed) { + save(data); + } + }); + } + + function successSubmit(redirect: string) { + MySwal.fire({ + title: 'Sukses', + icon: 'success', + confirmButtonColor: '#3085d6', + confirmButtonText: 'OK', + }).then((result) => { + if (result.isConfirmed) { + router.push(redirect); + } + }); + } + + return ( +
+
+ +
+
+ <> +
+
+
+ + +
+ } + /> + {errors.title?.message && ( +

+ {errors.title?.message} +

+ )} +
+
+ + +
+ } + /> + {errors.slug?.message && ( +

+ {errors.slug?.message} +

+ )} +
+
+

Upload File (Opsional)

+
+
+ +
+
+

Support file format in word, excel, ppt and pdf

+
+ {files?.length > 0 && + files?.map((list: File) => ( +
+ {list.name} + removeFile(list.name)}> +
+ )) + } +
+
+

Description

+ setContent(newContent)} + className="dark:text-black" + /> +
+
+ + {" "} + + +
+
+ + +
+ + + + + ) +} diff --git a/components/icons.tsx b/components/icons.tsx index 99fd9b9..68f120f 100644 --- a/components/icons.tsx +++ b/components/icons.tsx @@ -770,4 +770,138 @@ export const Checklist = ({ -); \ No newline at end of file +); + +export const AddIcon = ({ + size, + height = 12, + width = 12, + fill = "none", + ...props +}: IconSvgProps) => ( + + + +); + +export const CreateIconIon = ({ + size, + height = 24, + width = 24, + fill = "currentColor", + ...props +}: IconSvgProps) => ( + + + + +); + +export const DeleteIcon = ({ + size, + height = 12, + width = 10, + fill = "none", + ...props +}: IconSvgProps) => ( + + + +); + +export const DotsYIcon = ({ + size, + height = 24, + width = 24, + fill = "currentColor", + ...props +}: IconSvgProps) => ( + + + + +); + +export const EyeIconMdi = ({ + size, + height = 24, + width = 24, + fill = "currentColor", + ...props +}: IconSvgProps) => ( + + + +); + +export const TimesIcon = ({ + size, + height = 24, + width = 24, + fill = "currentColor", + ...props +}: IconSvgProps) => ( + + + +); + diff --git a/components/table/magazine/magazine-table.tsx b/components/table/magazine/magazine-table.tsx new file mode 100644 index 0000000..cc98c8c --- /dev/null +++ b/components/table/magazine/magazine-table.tsx @@ -0,0 +1,232 @@ +"use client"; +import { + TableCell, + TableRow, + Table, + TableHeader, + TableColumn, + TableBody, + Pagination, + Dropdown, + DropdownTrigger, + DropdownMenu, + DropdownItem, + Input, + User, + Card, + Divider, + Chip, + ChipProps, +} from "@nextui-org/react"; +import { Button } from "@nextui-org/button"; +import React, { Key, useCallback, useMemo, useState } from "react"; +import { + AddIcon, + CreateIconIon, + DeleteIcon, + DotsYIcon, + EyeFilledIcon, + EyeIconMdi, +} from "@/components/icons"; +import Link from "next/link"; + +type UserObject = { + id: number; + title: string; + status: string; + description: string; + avatar: string; +}; + +const statusColorMap = { + active: "success", + paused: "danger", + vacation: "warning", +}; + + +export default function MagazineTable() { + type TableRow = (typeof magazineTable)[0]; + + const columns = [ + + { name: "Title", uid: "title" }, + { name: "Description", uid: "description" }, + { name: "Action", uid: "actions" }, + ]; + + const magazineTable = [ + { + id: 1, + title: "Proses pembuatan website humas ", + status: "active", + description: "Pembuatan website Humas adalah sebuah proses yang strategis untuk membangun identitas digital sebuah organisasi atau entitas, yang bertujuan untuk menyebarkan informasi kepada publik, memperkuat citra merek, serta menjaga keterbukaan dan transparansi. Proses ini melibatkan beberapa tahapan yang terstruktur dan terkoordinasi dengan baik", + avatar: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSa8Luglga9J2R3Bxt_PsWZISUHQWODD6_ZTAJ5mIQgxYCAE-YbkY81faTqp-hSA_jVPTs&usqp=CAU", + }, + { + id: 2, + title: "Proses pembuatan website humas ", + status: "active", + description: "Pembuatan website Humas adalah sebuah proses yang strategis untuk membangun identitas digital sebuah organisasi atau entitas, yang bertujuan untuk menyebarkan informasi kepada publik, memperkuat citra merek, serta menjaga keterbukaan dan transparansi. Proses ini melibatkan beberapa tahapan yang terstruktur dan terkoordinasi dengan baik", + avatar: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSa8Luglga9J2R3Bxt_PsWZISUHQWODD6_ZTAJ5mIQgxYCAE-YbkY81faTqp-hSA_jVPTs&usqp=CAU", + }, + { + id: 3, + title: "Proses pembuatan website humas ", + status: "active", + description: "Pembuatan website Humas adalah sebuah proses yang strategis untuk membangun identitas digital sebuah organisasi atau entitas, yang bertujuan untuk menyebarkan informasi kepada publik, memperkuat citra merek, serta menjaga keterbukaan dan transparansi. Proses ini melibatkan beberapa tahapan yang terstruktur dan terkoordinasi dengan baik", + avatar: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSa8Luglga9J2R3Bxt_PsWZISUHQWODD6_ZTAJ5mIQgxYCAE-YbkY81faTqp-hSA_jVPTs&usqp=CAU", + }, + { + id: 4, + title: "Proses pembuatan website humas ", + status: "active", + description: "Pembuatan website Humas adalah sebuah proses yang strategis untuk membangun identitas digital sebuah organisasi atau entitas, yang bertujuan untuk menyebarkan informasi kepada publik, memperkuat citra merek, serta menjaga keterbukaan dan transparansi. Proses ini melibatkan beberapa tahapan yang terstruktur dan terkoordinasi dengan baik", + avatar: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSa8Luglga9J2R3Bxt_PsWZISUHQWODD6_ZTAJ5mIQgxYCAE-YbkY81faTqp-hSA_jVPTs&usqp=CAU", + }, + { + id: 5, + title: "Proses pembuatan website humas ", + status: "active", + description: "Pembuatan website Humas adalah sebuah proses yang strategis untuk membangun identitas digital sebuah organisasi atau entitas, yang bertujuan untuk menyebarkan informasi kepada publik, memperkuat citra merek, serta menjaga keterbukaan dan transparansi. Proses ini melibatkan beberapa tahapan yang terstruktur dan terkoordinasi dengan baik", + avatar: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSa8Luglga9J2R3Bxt_PsWZISUHQWODD6_ZTAJ5mIQgxYCAE-YbkY81faTqp-hSA_jVPTs&usqp=CAU", + }, + ]; + + const renderCell = useCallback((magazine: TableRow, columnKey: Key) => { + const cellValue = magazine[columnKey as keyof UserObject]; + const statusColorMap: Record = { + active: "primary", + cancel: "danger", + pending: "success", + }; + + switch (columnKey) { + case "no": + return ( +
{magazine.id}
+ ) + + case "title": + return ( +
{magazine.title}
+ ) + + case "description": + return ( +
{magazine.description}
+ ) + + case "status": + return ( + +
+ {cellValue} +
+
+ ); + + case "actions": + return ( +
+ + + + + + + + + + Detail + + + + + + + + Edit + + + + + + + + Delete + + + + + + +
+ ); + + default: + return cellValue; + } + }, []); + + return ( + <> +
+ + + +
+ + + {(column) => ( + {column.name} + )} + + + {(item) => ( + + {(columnKey) => ( + {renderCell(item, columnKey)} + )} + + )} + +
+
+
+ + + ); +} diff --git a/config/swal.ts b/config/swal.ts new file mode 100644 index 0000000..d27ce92 --- /dev/null +++ b/config/swal.ts @@ -0,0 +1,95 @@ +import Swal from "sweetalert2"; +import withReactContent from "sweetalert2-react-content"; +import { useRouter } from "next/navigation"; + +const MySwal = withReactContent(Swal); + +const Toast = MySwal.mixin({ + toast: true, + position: "top-end", + showConfirmButton: false, + timer: 3000, + timerProgressBar: true, + didOpen: (toast) => { + toast.addEventListener("mouseenter", Swal.stopTimer); + toast.addEventListener("mouseleave", Swal.resumeTimer); + }, +}); + +export function loading(msg?: any) { + let timerInterval: any; + MySwal.fire({ + title: msg || "Loading...", + allowOutsideClick: false, + timerProgressBar: true, + didOpen: () => { + MySwal.showLoading(); + timerInterval = setInterval(() => {}, 100); + }, + willClose: () => { + clearInterval(timerInterval); + }, + }); +} + +export function error(msg?: any) { + MySwal.fire({ + icon: "error", + title: "Failed...", + text: msg || "Unknown Error", + }); +} + +export function successRouter(redirect: string, router?: any) { + MySwal.fire({ + title: "Success!", + icon: "success", + confirmButtonColor: "#3085d6", + confirmButtonText: "Ok", + allowOutsideClick: false, + }).then((result) => { + if (result.isConfirmed) { + router.push(redirect); + } + }); +} + +export function success(title: string) { + MySwal.fire({ + title: title || "Success!", + icon: "success", + confirmButtonColor: "#3085d6", + confirmButtonText: "OK", + }).then((result) => { + if (result.isConfirmed) { + return true; + } + }); +} + +export function close() { + MySwal.close(); +} + +export function warning(text: string, redirect: string, router?: any) { + MySwal.fire({ + title: text, + icon: "warning", + confirmButtonColor: "#3085d6", + confirmButtonText: "OK", + }).then((result) => { + if (result.isConfirmed) { + router.push(redirect); + } + }); +} + +export function successToast(title: string, text: string) { + Toast.fire({ + icon: "success", + title: title, + text: text, + }); +} + + diff --git a/package-lock.json b/package-lock.json index 8abe0e8..64674b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,7 @@ "eslint-config-next": "14.0.2", "framer-motion": "^10.18.0", "intl-messageformat": "^10.5.0", + "jodit-react": "^4.0.25", "next": "14.0.2", "next-themes": "^0.2.1", "postcss": "8.4.31", @@ -43,11 +44,12 @@ "react-icons": "^5.0.1", "react-tailwindcss-datepicker": "^1.6.6", "react-tweet": "^3.2.0", + "sweetalert2-react-content": "^5.0.7", "swiper": "^11.0.6", "tailwind-variants": "^0.1.18", "tailwindcss": "3.3.5", "typescript": "5.0.4", - "zod": "^3.22.4" + "zod": "^1.11.17" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -338,6 +340,126 @@ "glob": "7.1.7" } }, + "node_modules/@next/swc-darwin-arm64": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.2.tgz", + "integrity": "sha512-i+jQY0fOb8L5gvGvojWyZMfQoQtDVB2kYe7fufOEiST6sicvzI2W5/EXo4lX5bLUjapHKe+nFxuVv7BA+Pd7LQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.2.tgz", + "integrity": "sha512-zRCAO0d2hW6gBEa4wJaLn+gY8qtIqD3gYd9NjruuN98OCI6YyelmhWVVLlREjS7RYrm9OUQIp/iVJFeB6kP1hg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.2.tgz", + "integrity": "sha512-tSJmiaon8YaKsVhi7GgRizZoV0N1Sx5+i+hFTrCKKQN7s3tuqW0Rov+RYdPhAv/pJl4qiG+XfSX4eJXqpNg3dA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.2.tgz", + "integrity": "sha512-dXJLMSEOwqJKcag1BeX1C+ekdPPJ9yXbWIt3nAadhbLx5CjACoB2NQj9Xcqu2tmdr5L6m34fR+fjGPs+ZVPLzA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.2.tgz", + "integrity": "sha512-WC9KAPSowj6as76P3vf1J3mf2QTm3Wv3FBzQi7UJ+dxWjK3MhHVWsWUo24AnmHx9qDcEtHM58okgZkXVqeLB+Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.2.tgz", + "integrity": "sha512-KSSAwvUcjtdZY4zJFa2f5VNJIwuEVnOSlqYqbQIawREJA+gUI6egeiRu290pXioQXnQHYYdXmnVNZ4M+VMB7KQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.2.tgz", + "integrity": "sha512-2/O0F1SqJ0bD3zqNuYge0ok7OEWCQwk55RPheDYD0va5ij7kYwrFkq5ycCRN0TLjLfxSF6xI5NM6nC5ux7svEQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.2.tgz", + "integrity": "sha512-vJI/x70Id0oN4Bq/R6byBqV1/NS5Dl31zC+lowO8SDu1fHmUxoAdILZR5X/sKbiJpuvKcCrwbYgJU8FF/Gh50Q==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@next/swc-win32-x64-msvc": { "version": "14.0.2", "cpu": [ @@ -2849,6 +2971,15 @@ "has-symbols": "^1.0.3" } }, + "node_modules/autobind-decorator": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/autobind-decorator/-/autobind-decorator-2.4.0.tgz", + "integrity": "sha512-OGYhWUO72V6DafbF8PM8rm3EPbfuyMZcJhtm5/n26IDwO18pohE4eNazLoCGhPiXOCD0gEGmrbU3849QvM8bbw==", + "engines": { + "node": ">=8.10", + "npm": ">=6.4.1" + } + }, "node_modules/autoprefixer": { "version": "10.4.16", "funding": [ @@ -4525,6 +4656,26 @@ "jiti": "bin/jiti.js" } }, + "node_modules/jodit": { + "version": "4.1.16", + "resolved": "https://registry.npmjs.org/jodit/-/jodit-4.1.16.tgz", + "integrity": "sha512-rqBGuYkmaU4cJrmid2vtdBFMA0eCFp6S7qhP2aNf92wBiLYmo+UnvyW08lH+CcZ2ZoWtVjEiqzGMvj8kZ0zsKA==", + "dependencies": { + "autobind-decorator": "^2.4.0" + } + }, + "node_modules/jodit-react": { + "version": "4.0.25", + "resolved": "https://registry.npmjs.org/jodit-react/-/jodit-react-4.0.25.tgz", + "integrity": "sha512-HFbbpabQlE3UdD5mOVm/ZHCRVMtNHCy5oZi4mWquM1W6uNrQG5sO7GuIYTxmW84qfTpuKPWjyw2q1ov/YFW8ug==", + "dependencies": { + "jodit": "^4.1.16" + }, + "peerDependencies": { + "react": "~0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", + "react-dom": "~0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "license": "MIT" @@ -5830,6 +5981,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/sweetalert2": { + "version": "11.10.7", + "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.10.7.tgz", + "integrity": "sha512-5Jlzrmaitay6KzU+2+LhYu9q+L4v/dZ8oZyEDH14ep0C/QilCnFLHmqAyD/Lhq/lm5DiwsOs6Tr58iv8k3wyGg==", + "peer": true, + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/limonte" + } + }, + "node_modules/sweetalert2-react-content": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/sweetalert2-react-content/-/sweetalert2-react-content-5.0.7.tgz", + "integrity": "sha512-8Fk82Mpk45lFXpJWKIFF/lq8k/dJKDDQGFcuqVosaL/qRdViyAs5+u37LoTGfnOIvf+rfQB3PAXcp1XLLn+0ew==", + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0", + "sweetalert2": "^11.0.0" + } + }, "node_modules/swiper": { "version": "11.0.7", "resolved": "https://registry.npmjs.org/swiper/-/swiper-11.0.7.tgz", @@ -6327,132 +6498,9 @@ } }, "node_modules/zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, - "node_modules/@next/swc-darwin-arm64": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.2.tgz", - "integrity": "sha512-i+jQY0fOb8L5gvGvojWyZMfQoQtDVB2kYe7fufOEiST6sicvzI2W5/EXo4lX5bLUjapHKe+nFxuVv7BA+Pd7LQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-darwin-x64": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.2.tgz", - "integrity": "sha512-zRCAO0d2hW6gBEa4wJaLn+gY8qtIqD3gYd9NjruuN98OCI6YyelmhWVVLlREjS7RYrm9OUQIp/iVJFeB6kP1hg==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.2.tgz", - "integrity": "sha512-tSJmiaon8YaKsVhi7GgRizZoV0N1Sx5+i+hFTrCKKQN7s3tuqW0Rov+RYdPhAv/pJl4qiG+XfSX4eJXqpNg3dA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.2.tgz", - "integrity": "sha512-dXJLMSEOwqJKcag1BeX1C+ekdPPJ9yXbWIt3nAadhbLx5CjACoB2NQj9Xcqu2tmdr5L6m34fR+fjGPs+ZVPLzA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.2.tgz", - "integrity": "sha512-WC9KAPSowj6as76P3vf1J3mf2QTm3Wv3FBzQi7UJ+dxWjK3MhHVWsWUo24AnmHx9qDcEtHM58okgZkXVqeLB+Q==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-x64-musl": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.2.tgz", - "integrity": "sha512-KSSAwvUcjtdZY4zJFa2f5VNJIwuEVnOSlqYqbQIawREJA+gUI6egeiRu290pXioQXnQHYYdXmnVNZ4M+VMB7KQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.2.tgz", - "integrity": "sha512-2/O0F1SqJ0bD3zqNuYge0ok7OEWCQwk55RPheDYD0va5ij7kYwrFkq5ycCRN0TLjLfxSF6xI5NM6nC5ux7svEQ==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.0.2", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.2.tgz", - "integrity": "sha512-vJI/x70Id0oN4Bq/R6byBqV1/NS5Dl31zC+lowO8SDu1fHmUxoAdILZR5X/sKbiJpuvKcCrwbYgJU8FF/Gh50Q==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } + "version": "1.11.17", + "resolved": "https://registry.npmjs.org/zod/-/zod-1.11.17.tgz", + "integrity": "sha512-UzIwO92D0dSFwIRyyqAfRXICITLjF0IP8tRbEK/un7adirMssWZx8xF/1hZNE7t61knWZ+lhEuUvxlu2MO8qqA==" } } } diff --git a/package.json b/package.json index 0308e2a..463b515 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "eslint-config-next": "14.0.2", "framer-motion": "^10.18.0", "intl-messageformat": "^10.5.0", + "jodit-react": "^4.0.25", "next": "14.0.2", "next-themes": "^0.2.1", "postcss": "8.4.31", @@ -44,10 +45,11 @@ "react-icons": "^5.0.1", "react-tailwindcss-datepicker": "^1.6.6", "react-tweet": "^3.2.0", + "sweetalert2-react-content": "^5.0.7", "swiper": "^11.0.6", "tailwind-variants": "^0.1.18", "tailwindcss": "3.3.5", "typescript": "5.0.4", - "zod": "^3.22.4" + "zod": "^1.11.17" } }