This repository has been archived on 2026-04-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
core/server/pages/templates/surfaces/notes.html
2026-03-21 20:16:19 +00:00

48 lines
1.8 KiB
HTML

{{/*
Notes surface (v0.37.9).
Server renders the layout shell. SDK boots Preact NotesPane kit
into #notesMainMount via sw.notesPane().
*/}}
{{define "surface-notes"}}
<div class="surface-notes" id="surfaceNotes">
<div class="surface-notes-body">
{{/* Notes list + editor */}}
<div class="surface-notes-main" id="notesMainMount"></div>
{{/* Chat assist pane (optional, can toggle) */}}
<div class="surface-notes-assist" id="notesAssistMount"></div>
</div>
</div>
{{end}}
{{define "css-notes"}}
{{/* v0.37.9: Notes surface CSS — sw-notes-pane.css loaded in base.html */}}
<link rel="stylesheet" href="{{.BasePath}}/branding/custom.css" onerror="this.remove()">
{{end}}
{{define "scripts-notes"}}
{{/* v0.37.9: Notes surface — Preact vendor globals + SDK boot + NotesPane */}}
<script type="module" nonce="{{.CSPNonce}}">
// Vendor: Preact + htm → globals
const { h, render } = await import('{{.BasePath}}/js/sw/vendor/preact.module.js');
const hooksModule = await import('{{.BasePath}}/js/sw/vendor/hooks.module.js');
const { default: htm } = await import('{{.BasePath}}/js/sw/vendor/htm.module.js');
const html = htm.bind(h);
window.preact = window.preact || { h, render };
window.hooks = window.hooks || hooksModule;
window.html = window.html || html;
// Boot SDK
const { boot } = await import('{{.BasePath}}/js/sw/sdk/index.js?v={{.Version}}');
const sw = await boot();
// Mount NotesPane
const mount = document.getElementById('notesMainMount');
if (mount) sw.notesPane(mount, { standalone: true });
// Optional: mount chat assist pane
const assist = document.getElementById('notesAssistMount');
if (assist) sw.chatPane(assist, { standalone: true });
</script>
{{end}}