fix(Folder Structure Diagram): use monaco editor

Allow Tab and align on indent
Fix https://github.com/CorentinTh/it-tools/issues/938#issuecomment-2869035338
This commit is contained in:
ShareVB committed 2025-05-11 20:36:16 +02:00
1 parent dd5ca6f693
commit 665db9b9ec
1 file changed
+15 -9
@@ -21,19 +21,25 @@ const inputStructure = ref([
'empty dir', 'empty dir',
].join('\n')); ].join('\n'));
const outputTree = computed(() => withDefaultOnError(() => generateTree(parseInput(inputStructure.value)), '')); const outputTree = computed(() => withDefaultOnError(() => generateTree(parseInput(inputStructure.value)), ''));
const MONACO_EDITOR_OPTIONS = {
automaticLayout: true,
formatOnType: true,
formatOnPaste: true,
};
</script> </script>
<template> <template>
<div> <div>
<c-input-text <c-card title="Your indented structure" w-full>
v-model:value="inputStructure" <c-monaco-editor
label="Your indented structure" v-model:value="inputStructure"
placeholder="Paste your indented structure here..." theme="vs-dark"
rows="20" height="250px"
multiline placeholder="Paste your indented structure here..."
raw-text :options="MONACO_EDITOR_OPTIONS"
monospace />
/> </c-card>
<n-divider /> <n-divider />