api: added custom storage option (#174)

This commit is contained in:
dswbx
2025-05-27 13:09:24 +02:00
committed by GitHub
parent db795ec050
commit 17ab35e245
10 changed files with 159 additions and 90 deletions

View File

@@ -1,4 +1,8 @@
import { default as CodeMirror, type ReactCodeMirrorProps } from "@uiw/react-codemirror";
import {
default as CodeMirror,
type ReactCodeMirrorProps,
EditorView,
} from "@uiw/react-codemirror";
import { json } from "@codemirror/lang-json";
import { html } from "@codemirror/lang-html";
import { useTheme } from "ui/client/use-theme";
@@ -43,7 +47,7 @@ export default function CodeEditor({
theme={theme === "dark" ? "dark" : "light"}
editable={editable}
basicSetup={_basicSetup}
extensions={extensions}
extensions={[...extensions, EditorView.lineWrapping]}
{...props}
/>
);

View File

@@ -19,6 +19,7 @@ export type DropdownItem =
onClick?: () => void;
destructive?: boolean;
disabled?: boolean;
title?: string;
[key: string]: any;
};
@@ -142,6 +143,7 @@ export function Dropdown({
item.destructive && "text-red-500 hover:bg-red-600 hover:text-white",
)}
onClick={onClick}
title={item.title}
>
{space_for_icon && (
<div className="size-[16px] text-left mr-1.5 opacity-80">