Added Word Count

This commit is contained in:
2026-04-08 14:26:50 +00:00
parent 43df9fb760
commit c588867625
9 changed files with 174 additions and 31 deletions
+7 -1
View File
@@ -3,12 +3,13 @@
import Editor from '$lib/components/Editor.svelte';
import Preview from '$lib/components/Preview.svelte';
import Toolbar from '$lib/components/Toolbar.svelte';
import DocFooter from '$lib/components/DocFooter.svelte';
import ErrorBanner from '$lib/components/ErrorBanner.svelte';
import { text, initYjs, cleanupYjs } from '$lib/ts/yjs-setup';
import { compileTypst } from '$lib/ts/typst-api';
import type { Diagnostic } from '$lib/ts/typst-api';
import { page } from '$app/stores';
import { commentsSidebarOpen, commentReference, editorViewStore, editorErrors } from '$lib/ts/store';
import { commentsSidebarOpen, commentReference, editorViewStore, editorErrors, documentStatsStore } from '$lib/ts/store';
let svgs = $state<string[]>([]);
let errors = $state<Diagnostic[]>([]);
@@ -57,6 +58,9 @@
const docId = $page.params.id;
compileTypst(content, docId)
.then((res) => {
if (res.stats) {
$documentStatsStore = res.stats;
}
if (res.svgs) {
svgs = res.svgs;
errors = [];
@@ -133,6 +137,8 @@
<ErrorBanner {errors} />
</div>
</main>
<DocFooter />
</div>
<!-- Custom Context Menu for Editor -->