Skip to content

Commit

Permalink
Merge branch 'ttu-ttu:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
peldas authored Mar 12, 2024
2 parents ee64216 + a6659ea commit d5668f8
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 34 deletions.
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"tailwindcss": "3.4.1",
"tslib": "2.6.2",
"typescript": "5.4.2",
"vite": "5.1.5"
"vite": "5.1.6"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "6.5.1",
Expand Down
20 changes: 20 additions & 0 deletions apps/web/src/lib/components/book-reader/book-reader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import { pxReader } from '$lib/components/book-reader/css-classes';
import type { BooksDbBookmarkData } from '$lib/data/database/books-db/versions/books-db';
import type { FuriganaStyle } from '$lib/data/furigana-style';
import { skipKeyDownListener$ } from '$lib/data/store';
import { ViewMode } from '$lib/data/view-mode';
import { iffBrowser } from '$lib/functions/rxjs/iff-browser';
import { reduceToEmptyString } from '$lib/functions/rxjs/reduce-to-empty-string';
Expand All @@ -25,6 +26,7 @@
import { reactiveElements } from './reactive-elements';
import type { AutoScroller, BookmarkManager, PageManager } from './types';
import BookReaderPaginated from './book-reader-paginated/book-reader-paginated.svelte';
import { onMount } from 'svelte';
export let htmlContent: string;
Expand Down Expand Up @@ -109,6 +111,24 @@
? firstDimensionMargin * 2
: 0;
/** Experimental Code - May be removed any time without warning */
onMount(() => {
document.addEventListener('ttu-action', handleAction, false);
return () => document.removeEventListener('ttu-action', handleAction, false);
});
function handleAction({ detail }: any) {
if (!detail.type) {
return;
}
if (detail.type === 'skipKeyDownListener') {
skipKeyDownListener$.next(detail.params.value);
}
}
/** Experimental Code - May be removed any time without warning */
const computedStyle$ = combineLatest([
containerEl$.pipe(filter((el): el is HTMLElement => !!el)),
combineLatest([width$, height$]).pipe(startWith(0))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"devDependencies": {
"@commitlint/cli": "19.0.3",
"@commitlint/config-conventional": "19.0.3",
"@types/node": "20.11.25",
"@types/node": "20.11.26",
"@typescript-eslint/eslint-plugin": "7.1.1",
"@typescript-eslint/parser": "7.1.1",
"eslint": "8.57.0",
Expand Down
64 changes: 32 additions & 32 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d5668f8

Please sign in to comment.