diff --git a/app/components/editor/editors/CustomFunctionEditor.tsx b/app/components/editor/editors/CustomFunctionEditor.tsx
deleted file mode 100644
index 7a86758..0000000
--- a/app/components/editor/editors/CustomFunctionEditor.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import CodeMirror from '@uiw/react-codemirror';
-import { monokai } from '@uiw/codemirror-theme-monokai';
-import { basicSetup } from 'codemirror';
-import { indentUnit, StreamLanguage } from '@codemirror/language';
-import { go } from '@codemirror/legacy-modes/mode/go';
-import { EditorView } from '@codemirror/view';
-import React, { CSSProperties } from 'react';
-export interface EditorProps {
- text: string;
- onChange: (text: string) => void;
- style?: CSSProperties;
-}
-export const CustomFunctionEditor = (props: EditorProps) => {
- return (
-
- );
-};
diff --git a/app/components/editor/editors/ModalEditor.tsx b/app/components/editor/editors/ModalEditor.tsx
deleted file mode 100644
index 27829e1..0000000
--- a/app/components/editor/editors/ModalEditor.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import { EditorProps } from '@/app/components/editor/editors/CustomFunctionEditor';
-import CodeMirror from '@uiw/react-codemirror';
-import { monokai } from '@uiw/codemirror-theme-monokai';
-import { basicSetup } from 'codemirror';
-import { CasbinConfSupport } from '@/app/components/editor/casbin-mode/casbin-conf';
-import { indentUnit } from '@codemirror/language';
-import { EditorView } from '@codemirror/view';
-import React from 'react';
-
-export const ModelEditor = (props: EditorProps) => {
- return (
-
- );
-};
diff --git a/app/components/editor/editors/PolicyEditor.tsx b/app/components/editor/editors/PolicyEditor.tsx
deleted file mode 100644
index 721cbe1..0000000
--- a/app/components/editor/editors/PolicyEditor.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import { EditorProps } from '@/app/components/editor/editors/CustomFunctionEditor';
-import CodeMirror from '@uiw/react-codemirror';
-import { basicSetup } from 'codemirror';
-import { CasbinPolicySupport } from '@/app/components/editor/casbin-mode/casbin-csv';
-import { indentUnit } from '@codemirror/language';
-import { EditorView } from '@codemirror/view';
-import { monokai } from '@uiw/codemirror-theme-monokai';
-import React from 'react';
-
-export const PolicyEditor = (props: EditorProps) => {
- return (
-
- );
-};
diff --git a/app/components/editor/editors/RequestEditor.tsx b/app/components/editor/editors/RequestEditor.tsx
deleted file mode 100644
index 7d49362..0000000
--- a/app/components/editor/editors/RequestEditor.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import { EditorProps } from '@/app/components/editor/editors/CustomFunctionEditor';
-import CodeMirror from '@uiw/react-codemirror';
-import { monokai } from '@uiw/codemirror-theme-monokai';
-import { basicSetup } from 'codemirror';
-import { CasbinPolicySupport } from '@/app/components/editor/casbin-mode/casbin-csv';
-import { indentUnit } from '@codemirror/language';
-import { EditorView } from '@codemirror/view';
-import React from 'react';
-
-export const RequestEditor = (props: EditorProps) => {
- return (
-
- );
-};
diff --git a/app/components/editor/editors/RequestResultEditor.tsx b/app/components/editor/editors/RequestResultEditor.tsx
deleted file mode 100644
index d0bf095..0000000
--- a/app/components/editor/editors/RequestResultEditor.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import React, { CSSProperties } from 'react';
-import CodeMirror from '@uiw/react-codemirror';
-import { monokai } from '@uiw/codemirror-theme-monokai';
-import { basicSetup } from 'codemirror';
-import { javascriptLanguage } from '@codemirror/lang-javascript';
-import { indentUnit } from '@codemirror/language';
-import { EditorView } from '@codemirror/view';
-
-interface RequestResultEditorProps {
- value: string;
- style?: CSSProperties;
-}
-
-export const RequestResultEditor = (props: RequestResultEditorProps) => {
- return (
-
);
diff --git a/app/components/editor/parts/ButtonGroup.tsx b/app/components/editor/parts/ButtonGroup.tsx
deleted file mode 100644
index ab68802..0000000
--- a/app/components/editor/parts/ButtonGroup.tsx
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import Syntax from '@/app/components/editor/syntax';
-import RunTest from '@/app/components/editor/run-test';
-import React, { isValidElement, ReactNode } from 'react';
-import Share from '@/app/components/editor/share';
-import Copy from '@/app/components/editor/copy';
-interface Props {
- modelText: string;
- echo: ReactNode;
- setEcho: (value: ReactNode) => void;
- modelKind: string;
- policy: string;
- customConfig: string;
- request: string;
- enforceContextData: Map;
- setRequestResult: (value: string) => void;
- share: string;
- setShare: (value: string) => void;
- handleShare: (value: ReactNode | string) => void;
-}
-
-export default function ButtonGroup({
- echo,
- modelText,
- modelKind,
- setEcho,
- policy,
- customConfig,
- request,
- enforceContextData,
- setRequestResult,
- share,
- setShare,
- handleShare,
-}: Props) {
- return (
-
- );
-}
diff --git a/app/components/editor/parts/EnforcementResult.tsx b/app/components/editor/parts/EnforcementResult.tsx
deleted file mode 100644
index 715a7cf..0000000
--- a/app/components/editor/parts/EnforcementResult.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import { RequestResultEditor } from '@/app/components/editor/editors/RequestResultEditor';
-import React from 'react';
-interface Props {
- requestResult: string;
-}
-
-export default function EnforcementResult({ requestResult }: Props) {
- return (
-
-
- Enforcement Result
-
-
-
- );
-}
diff --git a/app/components/editor/parts/Modal.tsx b/app/components/editor/parts/Modal.tsx
deleted file mode 100644
index 6bb06b5..0000000
--- a/app/components/editor/parts/Modal.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import SelectModel from '@/app/components/editor/select-model';
-import { ModelKind } from '@/app/components/editor/casbin-mode/example';
-import { ModelEditor } from '@/app/components/editor/editors/ModalEditor';
-import React from 'react';
-interface Props {
- setModelKind: (value: string) => void;
- modelText: string;
- setModelTextPersistent: (value: string) => void;
-}
-
-export default function Modal({
- setModelKind,
- modelText,
- setModelTextPersistent,
-}: Props) {
- return (
-
- );
-}
diff --git a/app/components/editor/parts/Policy.tsx b/app/components/editor/parts/Policy.tsx
deleted file mode 100644
index 220d4c1..0000000
--- a/app/components/editor/parts/Policy.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import { PolicyEditor } from '@/app/components/editor/editors/PolicyEditor';
-import React from 'react';
-interface Props {
- policy: string;
- setPolicyPersistent: (value: string) => void;
-}
-
-export default function Policy({ policy, setPolicyPersistent }: Props) {
- return (
-
-
Policy
-
-
- );
-}
diff --git a/app/components/editor/parts/Request.tsx b/app/components/editor/parts/Request.tsx
deleted file mode 100644
index 49ae151..0000000
--- a/app/components/editor/parts/Request.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import { SetupEnforceContext } from '@/app/components/editor/setup-enforce-context';
-import { RequestEditor } from '@/app/components/editor/editors/RequestEditor';
-import React from 'react';
-interface Props {
- request: string;
- setRequestPersistent: (value: string) => void;
- enforceContextData: Map;
- setEnforceContextDataPersistent: (value: Map) => void;
-}
-
-export default function Request({
- request,
- setRequestPersistent,
- enforceContextData,
- setEnforceContextDataPersistent,
-}: Props) {
- return (
-
-
-
Request
-
-
-
-
- );
-}
diff --git a/app/components/editor/parts/Settings.tsx b/app/components/editor/parts/Settings.tsx
deleted file mode 100644
index a6a2061..0000000
--- a/app/components/editor/parts/Settings.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import React, { useState } from 'react';
-
-import { CustomFunctionEditor } from '@/app/components/editor/editors/CustomFunctionEditor';
-
-interface SettingsProps {
- text: string;
- onCustomConfigChange: (text: string) => void;
-}
-
-export function Settings(props: SettingsProps) {
- const [open, setOpen] = useState(true);
-
- return (
-
-
- Custom config
-
{
- return setOpen(!open);
- }}
- >
-
-
-
-
- {open && (
-
-
-
- )}
-
-
- );
-}
diff --git a/app/components/editor/select-model.tsx b/app/components/editor/select-model.tsx
deleted file mode 100755
index 9cd9a87..0000000
--- a/app/components/editor/select-model.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import React from 'react';
-import { ModelKind, example } from './casbin-mode/example';
-
-interface SelectModelProps {
- onChange: (value: string) => void;
-}
-
-const SelectModel = (props: SelectModelProps) => {
- return (
-
- );
-};
-
-export default SelectModel;
diff --git a/app/components/editor/syntax.tsx b/app/components/editor/syntax.tsx
deleted file mode 100755
index 41f721b..0000000
--- a/app/components/editor/syntax.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2024 The casbin Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import React from 'react';
-import { Config } from 'casbin';
-
-interface SyntaxProps {
- model: string;
- onResponse: (com: JSX.Element) => void;
-}
-
-const Syntax = (props: SyntaxProps) => {
- return (
-
- );
-};
-
-export default Syntax;
diff --git a/app/favicon.ico b/app/favicon.ico
deleted file mode 100644
index 55382c5..0000000
Binary files a/app/favicon.ico and /dev/null differ
diff --git a/app/icon.png b/app/icon.png
new file mode 100644
index 0000000..9c0b156
Binary files /dev/null and b/app/icon.png differ
diff --git a/app/page.tsx b/app/page.tsx
index 4f69f24..d90578d 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -14,11 +14,17 @@
'use client';
import { EditorScreen } from '@/app/components/editor';
+import { clsx } from 'clsx';
export default function Home() {
return (
-