From 5b0abf2e0b8408f4552a56c9e01323e3071e85e2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 10:02:09 +0000 Subject: [PATCH 1/5] Initial plan From 0fc71c15404c76e37ad69a0caab2a2de0ef3ea84 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 10:18:30 +0000 Subject: [PATCH 2/5] Add editor iframe to homepage with beautiful styling Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com> --- src/components/EditorPreview/index.js | 54 ++++++++++ .../EditorPreview/styles.module.css | 98 +++++++++++++++++++ src/pages/index.js | 2 + 3 files changed, 154 insertions(+) create mode 100644 src/components/EditorPreview/index.js create mode 100644 src/components/EditorPreview/styles.module.css diff --git a/src/components/EditorPreview/index.js b/src/components/EditorPreview/index.js new file mode 100644 index 00000000..a7abb451 --- /dev/null +++ b/src/components/EditorPreview/index.js @@ -0,0 +1,54 @@ +import React, {useEffect, useState} from "react"; +import {useColorMode} from "@docusaurus/theme-common"; +import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +import Link from "@docusaurus/Link"; +import Translate from "@docusaurus/Translate"; +import styles from "./styles.module.css"; + +function EditorPreview() { + const {colorMode} = useColorMode(); + const {i18n} = useDocusaurusContext(); + const currentLanguage = i18n.currentLocale; + const [editorUrl, setEditorUrl] = useState(""); + + useEffect(() => { + setEditorUrl(`https://editor.casbin.org/?theme=${colorMode}&lang=${currentLanguage}`); + }, [colorMode, currentLanguage]); + + return ( +
+
+
+

+ Try Casbin Online Editor +

+

+ + Write and test your Casbin model and policy in real-time with our interactive online editor. + Experiment with different access control models and see results instantly. + +

+
+
+
+