Initial fork of github.com/alonswartz/notesium into librenotes: - Source moved to internal/notesium/ (package notesium) - Thin entry point at cmd/librenotes/main.go - Module renamed to git.librete.ch/public/librenotes - main() exposed as notesium.Run() - LICENSE preserved (MIT), NOTICE added with attribution - Web assets and completion.bash co-located with embedding code to satisfy go:embed path constraints Closes #3, #34, #35. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
30 lines
941 B
JavaScript
30 lines
941 B
JavaScript
const { reactive, watch } = Vue;
|
|
|
|
const defaultState = {
|
|
showGraphPanel: false,
|
|
showLabelsPanel: false,
|
|
showNotesPanel: false,
|
|
showNoteSidebar: true,
|
|
notesPanelDarkMode: false,
|
|
notesPanelCompact: false,
|
|
notesPanelCompactLabels: true,
|
|
sidePanelSortNotes: 'title', // title, links, mtime, ctime
|
|
sidePanelSortLabels: 'title', // title, links
|
|
editorFoldGutter: false,
|
|
editorLineWrapping: false,
|
|
editorConcealFormatting: true,
|
|
editorVimMode: false,
|
|
startOfWeek: 1, // 0 for Sunday, 1 for Monday, ...
|
|
};
|
|
|
|
const savedState = localStorage.getItem('notesiumState');
|
|
const initialState = savedState ? JSON.parse(savedState) : defaultState;
|
|
const notesiumState = reactive({ ...defaultState, ...initialState });
|
|
|
|
watch(notesiumState, (newState) => {
|
|
Object.assign(newState, { ...defaultState, ...newState });
|
|
localStorage.setItem('notesiumState', JSON.stringify(newState));
|
|
}, { deep: true });
|
|
|
|
export { notesiumState };
|