Export template source from be30143a326d5d7d7b0cbabea5bc5ac0301ef5b9:examples/local-first/packages/language-reader-runtime

This commit is contained in:
Quixos Template Publisher
2000-01-01 00:00:00 +00:00
commit 320c126960
25 changed files with 3666 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import { plan } from "./planning.js";
import { archiveType } from "./type-archives.js";
import { openDocument, selectSettings, attachReader } from "./navigation.js";
import { createRegistry } from "./gen/qx.js";
import { QxReject } from "@quixos/camino-replica-core";
export const registry = createRegistry({
archiveType,
plan,
openDocument,
selectSettings,
attachReader,
setReadingView: async ({ input, ports }) => {
if (!["pages", "scroll"].includes(input.displayMode)) throw new QxReject("INVALID_READING_VIEW");
await ports.reading.set(input);
return null;
},
setEnabled: async ({ input, ports }) => {
const data = await ports.data.get();
if (data.enabled !== input) await ports.data.set({ ...data, enabled: input });
return null;
},
});