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

This commit is contained in:
Quixos Template Publisher
2000-01-01 00:00:00 +00:00
commit 502d04213a
26 changed files with 3830 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { configureOptions } from "./configuration.js";
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({
configureOptions,
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;
},
});