Skip to content

Commit 238e0e0

Browse files
author
Jicheng Lu
committed
refine code script
1 parent 1dfae15 commit 238e0e0

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/lib/common/shared/CodeScript.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
/** @type {string} */
2121
export let containerClasses = '';
2222
23+
/** @type {boolean} */
24+
export let darkTheme = true;
25+
26+
/** @type {boolean} */
27+
export let useBasicSetup = true;
28+
2329
2430
/** @type {import("@codemirror/state").Extension[]} */
2531
const baseExtensions = [
@@ -73,8 +79,9 @@
7379

7480
<CodeMirror
7581
class={`code-script-container ${containerClasses}`}
76-
theme={oneDark}
7782
lineWrapping
83+
basic={useBasicSetup}
84+
theme={darkTheme ? oneDark : null}
7885
extensions={extensions}
7986
value={scriptText}
8087
on:change={e => handleChange(e)}

src/routes/page/agent/[agentId]/agent-components/agent-rule.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@
548548
<CodeScript
549549
language="json"
550550
containerClasses="agent-action-config"
551+
useBasicSetup={false}
551552
scriptText={JSON.stringify(rule.action?.config || {}, null, 2)}
552553
on:change={(e) => changeContent(e, uid, 'action-config')}
553554
/>

0 commit comments

Comments
 (0)