Preferences config WIP

This commit is contained in:
nicwands
2026-03-11 13:36:10 -04:00
parent 99e6761e92
commit 4d04f4f2ff
4 changed files with 77 additions and 17 deletions

View File

@@ -168,7 +168,6 @@ app.whenReady().then(async () => {
return await adapter[method](...args); return await adapter[method](...args);
}); });
broadcastNoteChange("plugin-changed", pluginId); broadcastNoteChange("plugin-changed", pluginId);
console.log("activePlugin: ", pluginId);
return true; return true;
}; };
await setActivePlugin(initialConfig.activeAdapter); await setActivePlugin(initialConfig.activeAdapter);

View File

@@ -116,7 +116,8 @@ onBeforeUnmount(() => {
font-weight: 700; font-weight: 700;
} }
p em { p em {
font-style: italic; /* font-style: italic; */
color: var(--grey-100);
} }
hr { hr {
border: 1px dashed currentColor; border: 1px dashed currentColor;

View File

@@ -0,0 +1,28 @@
Medieval Translation
Nota = Note
Capitulum = Category
Intructio = Instructions
Tabula = Index/Overview
\*This can be disabled via toolbar
---
Program Key Commands
cmd + s = save
cmd + t = new capitulum
cmd + n = new nota
cmd + x = close window
dbl click = change name / open nota
paste hyperlink twice = activated url
---
Text Markdowns
cmd + b = Bold
cmd + u = underline
--- = ---------- (ruled line break)
/_text_/ = Desaturated text

View File

@@ -12,10 +12,29 @@
:id="plugin.id" :id="plugin.id"
:value="plugin.id" :value="plugin.id"
/> />
<label :for="plugin.id"> <div class="info">
<p class="name bold">{{ plugin.name }}</p> <p class="name bold">{{ plugin.name }}</p>
<p class="description">{{ plugin.description }}</p> <p class="description">{{ plugin.description }}</p>
</label>
<form v-if="plugin.configSchema.length" class="config">
<div
v-for="field in plugin.configSchema"
class="config-field"
:key="field.key"
>
<label :for="field.key">
{{ field.label }}
</label>
<input
v-model="config.adapters[plugin.id][field.key]"
:id="field.key"
:type="field.type"
:placeholder="field.default"
:required="field.required"
/>
</div>
</form>
</div>
</div> </div>
</main> </main>
</template> </template>
@@ -23,20 +42,16 @@
<script setup> <script setup>
import usePlugins from '@/composables/usePlugins' import usePlugins from '@/composables/usePlugins'
import useConfig from '@/composables/useConfig' import useConfig from '@/composables/useConfig'
import { ref, onMounted, watch } from 'vue' import { ref, watch } from 'vue'
const { plugins, setActivePlugin } = await usePlugins() const { plugins, setActivePlugin } = await usePlugins()
const { config, ensureConfig } = useConfig() const { config, ensureConfig } = useConfig()
await ensureConfig()
const activePluginId = ref(plugins.value[0].id) const activePluginId = ref(config.value.activeAdapter)
onMounted(async () => { watch(activePluginId, async (id) => {
await ensureConfig() await setActivePlugin(id)
activePluginId.value = config.value.activeAdapter
watch(activePluginId, async (id) => {
await setActivePlugin(id)
})
}) })
</script> </script>
@@ -52,7 +67,7 @@ onMounted(async () => {
} }
h1 { h1 {
margin-bottom: 15px; margin-bottom: 20px;
} }
.plugin { .plugin {
@@ -74,13 +89,30 @@ onMounted(async () => {
} }
} }
label { .info {
cursor: pointer;
.description { .description {
color: var(--grey-100); color: var(--grey-100);
margin-top: 6px; margin-top: 6px;
} }
} }
.config {
display: flex;
flex-direction: column;
gap: 10px;
margin-top: 16px;
}
.config-field {
display: flex;
flex-direction: column;
gap: 4px;
input {
width: 100%;
border: 1px solid var(--grey-100);
border-radius: 0.2em;
padding: 0.2em 0.5em;
}
}
} }
</style> </style>