html-flip-book-react 0.0.0-alpha.48 → 0.0.0-alpha.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FlipBook.d.ts +5 -2
- package/dist/FlipBook.d.ts.map +1 -1
- package/dist/assets/html-flip-book.css +1 -1
- package/dist/flip-book.js +207 -158
- package/dist/flip-book.js.map +1 -1
- package/dist/toolbar/BookmarkToggleButton.d.ts +8 -0
- package/dist/toolbar/BookmarkToggleButton.d.ts.map +1 -0
- package/dist/toolbar/DownloadDropdown.d.ts.map +1 -1
- package/dist/toolbar/index.d.ts +2 -0
- package/dist/toolbar/index.d.ts.map +1 -1
- package/dist/toolbar/index.js +421 -389
- package/dist/toolbar/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../base/dist/store/index.js","../../../base/dist/commands/index.js","../../src/commands/CommandContext.tsx","../../src/icons/index.tsx","../../src/toolbar/ToolbarButton.tsx","../../src/toolbar/ActionButton.tsx","../../../base/dist/intl.js","../../src/toolbar/ToolbarContext.tsx","../../src/toolbar/DownloadDropdown.tsx","../../src/toolbar/FirstPageButton.tsx","../../src/toolbar/FullscreenButton.tsx","../../src/toolbar/LastPageButton.tsx","../../src/toolbar/MouseModeButton.tsx","../../src/toolbar/NextButton.tsx","../../src/toolbar/PageIndicator.tsx","../../src/toolbar/PrevButton.tsx","../../src/toolbar/TocButton.tsx","../../src/commands/open-download-menu-command.ts","../../src/toolbar/Toolbar.tsx"],"sourcesContent":["let e = 4;\nfunction n() {\n return e;\n}\nfunction o(t) {\n e = t;\n}\nexport {\n n as getTocPageIndex,\n o as setTocPageIndex\n};\n//# sourceMappingURL=index.js.map\n","import { getTocPageIndex as a } from \"../store/index.js\";\nconst r = {\n id: \"download\",\n enName: \"Download\",\n enDescription: \"Download entire book or page range\",\n nameKey: \"toolbarItem.download\",\n hotkeys: [],\n execute: (e) => {\n e.data?.onDownload?.(\n e.data?.from,\n e.data?.to\n );\n },\n canExecute: (e) => typeof e.data?.onDownload == \"function\"\n}, c = [\n { key: \"ArrowRight\" },\n { key: \"PageDown\" },\n { key: \" \" }\n // Space\n], d = {\n id: \"flipNext\",\n navKind: \"flip\",\n enName: \"Next Page\",\n enDescription: \"Flip to the next page\",\n nameKey: \"command.jumpToNextPage\",\n hotkeys: c,\n execute: (e) => {\n e.handle?.flipNext();\n },\n canExecute: (e) => (e.handle?.getCurrentPageIndex() ?? 0) < (e.handle?.getTotalPages() ?? 0) - 1\n}, l = [{ key: \"ArrowLeft\" }, { key: \"PageUp\" }], s = {\n id: \"flipPrev\",\n navKind: \"flip\",\n enName: \"Previous Page\",\n enDescription: \"Flip to the previous page\",\n nameKey: \"command.jumpToPrevPage\",\n hotkeys: l,\n execute: (e) => {\n e.handle?.flipPrev();\n },\n canExecute: (e) => (e.handle?.getCurrentPageIndex() ?? 0) > 0\n}, i = [{ key: \"Home\" }, { key: \"ArrowLeft\", modifiers: { ctrl: !0 } }], u = {\n id: \"goToFirst\",\n navKind: \"jump\",\n enName: \"First Page\",\n enDescription: \"Jump to the first page\",\n nameKey: \"command.jumpToFirstPage\",\n hotkeys: i,\n execute: (e) => {\n e.handle?.jumpToPage(0);\n },\n canExecute: (e) => e.handle?.getCurrentPageIndex() !== 0\n}, m = [{ key: \"End\" }, { key: \"ArrowRight\", modifiers: { ctrl: !0 } }], g = {\n id: \"goToLast\",\n navKind: \"jump\",\n enName: \"Last Page\",\n enDescription: \"Jump to the last page\",\n nameKey: \"command.jumpToLastPage\",\n hotkeys: m,\n execute: (e) => {\n const t = e.handle?.getTotalPages() ?? 0;\n e.handle?.jumpToPage(t - 1);\n },\n canExecute: (e) => {\n const t = e.handle?.getCurrentPageIndex() ?? 0, o = e.handle?.getTotalPages() ?? 0;\n return t !== o - 1;\n }\n}, f = [{ key: \"t\" }], h = {\n id: \"goToToc\",\n navKind: \"jump\",\n enName: \"Table of Contents\",\n enDescription: \"Jump to the table of contents\",\n nameKey: \"command.jumpToToc\",\n hotkeys: f,\n execute: (e) => {\n const t = e.handle?.getTocPageIndex?.() ?? a();\n e.handle?.jumpToPage(t);\n },\n canExecute: (e) => {\n const t = e.handle?.getTocPageIndex?.() ?? a();\n return e.handle?.getCurrentPageIndex() !== t;\n }\n}, p = [{ key: \"d\", modifiers: { ctrl: !0, alt: !0 } }], y = {\n id: \"toggleDebug\",\n enName: \"Toggle Debug Toolbar\",\n enDescription: \"Show or hide the debug toolbar (Ctrl+Alt+D)\",\n nameKey: \"command.toggleDebug\",\n descriptionKey: \"command.toggleDebugDesc\",\n hotkeys: p,\n execute: (e) => {\n e.handle?.toggleDebugBar?.();\n }\n}, P = [{ key: \"F11\" }], T = {\n id: \"toggleFullscreen\",\n enName: \"Toggle Fullscreen\",\n enDescription: \"Enter or exit fullscreen mode\",\n nameKey: \"command.toggleFullscreen\",\n descriptionKey: \"command.toggleFullscreenDesc\",\n hotkeys: P,\n execute: (e) => {\n const t = e.data;\n document.fullscreenElement ? document.exitFullscreen().catch(console.warn) : (t?.getFullscreenTarget?.() ?? document.documentElement).requestFullscreen().catch(console.warn);\n }\n}, K = [\n d,\n s,\n u,\n g,\n h,\n T,\n y,\n r\n];\nfunction k(e, t) {\n return t !== \"rtl\" ? e : e === \"ArrowLeft\" ? \"ArrowRight\" : e === \"ArrowRight\" ? \"ArrowLeft\" : e;\n}\nfunction w(e, t, o) {\n if (k(t.key, o) !== e.key) return !1;\n const n = e.modifiers ?? {};\n return !(!!n.ctrl !== t.ctrlKey || !!n.shift !== t.shiftKey || !!n.alt !== t.altKey || !!n.meta !== t.metaKey);\n}\nexport {\n K as defaultCommands,\n r as downloadCommand,\n d as flipNextCommand,\n s as flipPrevCommand,\n k as getEffectiveKey,\n u as goToFirstCommand,\n g as goToLastCommand,\n h as goToTocCommand,\n w as hotkeyMatches,\n y as toggleDebugCommand,\n T as toggleFullscreenCommand\n};\n//# sourceMappingURL=index.js.map\n","import {\n\ttype CommandContext as CommandCtx,\n\ttype CommandDefinition,\n\ttype CommandOptions,\n\ttype CommandRegistry,\n\tdefaultCommands,\n\thotkeyMatches,\n} from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { createContext, useCallback, useContext, useEffect, useMemo } from \"react\";\nimport type { FlipBookHandle } from \"../FlipBook\";\n\ninterface CommandProviderProps {\n\t/** Reference to the FlipBook instance */\n\tflipBookRef: React.RefObject<FlipBookHandle | null>;\n\t/** Current page index */\n\tcurrentPage: number;\n\t/** Total number of pages */\n\ttotalPages: number;\n\t/** Reading direction */\n\tdirection?: \"rtl\" | \"ltr\";\n\t/** Custom commands to register (merged with defaults) */\n\tcommands?: CommandDefinition[];\n\t/** Options for specific commands */\n\tcommandOptions?: Record<string, CommandOptions>;\n\t/** Disable all hotkey bindings */\n\tdisableHotkeys?: boolean;\n\tchildren: React.ReactNode;\n}\n\ninterface CommandsContextValue {\n\t/** Execute a command (pass the command object, not a string ID). */\n\texecute: (command: CommandDefinition, runData?: Record<string, unknown>) => void;\n\t/** Check if a command can execute (for disabled state). */\n\tcanExecute: (command: CommandDefinition) => boolean;\n\t/** Get all registered commands. */\n\tgetAllCommands: () => CommandDefinition[];\n}\n\nconst CommandsContext = createContext<CommandsContextValue | null>(null);\n\n/**\n * Provider component that manages flipbook commands and hotkeys.\n * Uses framework-agnostic commands from base; only the provider and hook are React-specific.\n */\nexport const CommandProvider: React.FC<CommandProviderProps> = ({\n\tflipBookRef,\n\tcurrentPage: _currentPage,\n\ttotalPages: _totalPages,\n\tdirection = \"ltr\",\n\tcommands: customCommands = [],\n\tcommandOptions = {},\n\tdisableHotkeys = false,\n\tchildren,\n}) => {\n\tconst registry = useMemo<CommandRegistry>(() => {\n\t\tconst reg: CommandRegistry = {};\n\n\t\tfor (const cmd of defaultCommands) {\n\t\t\treg[cmd.id] = {\n\t\t\t\tcommand: cmd,\n\t\t\t\toptions: commandOptions[cmd.id] ?? {},\n\t\t\t};\n\t\t}\n\n\t\tfor (const cmd of customCommands) {\n\t\t\treg[cmd.id] = {\n\t\t\t\tcommand: cmd,\n\t\t\t\toptions: commandOptions[cmd.id] ?? {},\n\t\t\t};\n\t\t}\n\n\t\treturn reg;\n\t}, [customCommands, commandOptions]);\n\n\tconst createCommandContext = useCallback(\n\t\t(command: CommandDefinition, runData?: Record<string, unknown>): CommandCtx => {\n\t\t\tconst options = registry[command.id]?.options ?? {};\n\t\t\tconst data = runData ? { ...options.data, ...runData } : options.data;\n\t\t\treturn {\n\t\t\t\thandle: flipBookRef.current,\n\t\t\t\tdata,\n\t\t\t};\n\t\t},\n\t\t[flipBookRef, registry],\n\t);\n\n\tconst execute = useCallback(\n\t\t(command: CommandDefinition, runData?: Record<string, unknown>) => {\n\t\t\tconst ctx = createCommandContext(command, runData);\n\t\t\tif (command.canExecute && !command.canExecute(ctx)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcommand.execute(ctx);\n\t\t},\n\t\t[createCommandContext],\n\t);\n\n\tconst canExecute = useCallback(\n\t\t(command: CommandDefinition): boolean => {\n\t\t\tconst ctx = createCommandContext(command);\n\t\t\tif (!command.canExecute) return true;\n\t\t\treturn command.canExecute(ctx);\n\t\t},\n\t\t[createCommandContext],\n\t);\n\n\tconst getAllCommands = useCallback(\n\t\t(): CommandDefinition[] => Object.values(registry).map((e) => e.command),\n\t\t[registry],\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tconst target = event.target as HTMLElement;\n\t\t\tif (target.tagName === \"INPUT\" || target.tagName === \"TEXTAREA\" || target.isContentEditable) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (const entry of Object.values(registry)) {\n\t\t\t\tif (entry.options.disableHotkeys) continue;\n\n\t\t\t\tconst hotkeys = entry.options.hotkeys ?? entry.command.hotkeys ?? [];\n\t\t\t\tfor (const binding of hotkeys) {\n\t\t\t\t\tif (hotkeyMatches(binding, event, direction)) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\texecute(entry.command);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[registry, execute, direction],\n\t);\n\n\tuseEffect(() => {\n\t\tif (disableHotkeys) return;\n\n\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\treturn () => document.removeEventListener(\"keydown\", handleKeyDown);\n\t}, [disableHotkeys, handleKeyDown]);\n\n\tconst value = useMemo<CommandsContextValue>(\n\t\t() => ({\n\t\t\texecute,\n\t\t\tcanExecute,\n\t\t\tgetAllCommands,\n\t\t}),\n\t\t[execute, canExecute, getAllCommands],\n\t);\n\n\treturn <CommandsContext.Provider value={value}>{children}</CommandsContext.Provider>;\n};\n\nexport const useCommands = (): CommandsContextValue => {\n\tconst ctx = useContext(CommandsContext);\n\tif (!ctx) {\n\t\tthrow new Error(\"useCommands must be used within a CommandProvider\");\n\t}\n\treturn ctx;\n};\n","/**\n * Icon components for the flipbook toolbar.\n * All icons use currentColor for stroke, making them themeable.\n */\nimport type React from \"react\";\n\ninterface IconProps {\n\t/** Icon size in pixels. Default: 24 */\n\tsize?: number;\n\t/** Additional CSS class */\n\tclassName?: string;\n}\n\nconst defaultProps: IconProps = { size: 24 };\n\nexport const ChevronLeftIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"m15 18-6-6 6-6\" />\n\t</svg>\n);\n\nexport const ChevronRightIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"m9 18 6-6-6-6\" />\n\t</svg>\n);\n\nexport const ChevronFirstIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"m17 18-6-6 6-6\" />\n\t\t<path d=\"M7 6v12\" />\n\t</svg>\n);\n\nexport const ChevronLastIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"m7 18 6-6-6-6\" />\n\t\t<path d=\"M17 6v12\" />\n\t</svg>\n);\n\nexport const MaximizeIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M8 3H5a2 2 0 0 0-2 2v3\" />\n\t\t<path d=\"M21 8V5a2 2 0 0 0-2-2h-3\" />\n\t\t<path d=\"M3 16v3a2 2 0 0 0 2 2h3\" />\n\t\t<path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />\n\t</svg>\n);\n\nexport const MinimizeIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M8 3v3a2 2 0 0 1-2 2H3\" />\n\t\t<path d=\"M21 8h-3a2 2 0 0 1-2-2V3\" />\n\t\t<path d=\"M3 16h3a2 2 0 0 1 2 2v3\" />\n\t\t<path d=\"M16 21v-3a2 2 0 0 1 2-2h3\" />\n\t</svg>\n);\n\nexport const TableOfContentsIcon: React.FC<IconProps> = ({\n\tsize = defaultProps.size,\n\tclassName,\n}) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M16 5H3\" />\n\t\t<path d=\"M16 12H3\" />\n\t\t<path d=\"M16 19H3\" />\n\t\t<path d=\"M21 5h.01\" />\n\t\t<path d=\"M21 12h.01\" />\n\t\t<path d=\"M21 19h.01\" />\n\t</svg>\n);\n\nexport const BookshelfIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t{/* Shelf */}\n\t\t<path d=\"M3 21h18\" />\n\t\t{/* Books */}\n\t\t<rect x=\"4\" y=\"7\" width=\"3\" height=\"14\" rx=\"0.5\" />\n\t\t<rect x=\"8\" y=\"5\" width=\"3\" height=\"16\" rx=\"0.5\" />\n\t\t<rect x=\"12\" y=\"9\" width=\"3\" height=\"12\" rx=\"0.5\" />\n\t\t<rect x=\"16\" y=\"6\" width=\"4\" height=\"15\" rx=\"0.5\" />\n\t</svg>\n);\n\nexport const DownloadIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n\t\t<polyline points=\"7 10 12 15 17 10\" />\n\t\t<line x1=\"12\" x2=\"12\" y1=\"15\" y2=\"3\" />\n\t</svg>\n);\n\nexport type { IconProps };\n","import type React from \"react\";\n\ninterface ToolbarButtonProps {\n\t/** Click handler */\n\tonClick: () => void;\n\t/** Accessible label for the button */\n\tariaLabel: string;\n\t/** Toggle state for mode buttons. */\n\tariaPressed?: boolean;\n\t/** Whether the button is disabled */\n\tdisabled?: boolean;\n\t/** Button content (icon or text) */\n\tchildren: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n\t/** Title tooltip */\n\ttitle?: string;\n}\n\n/**\n * Base button component for toolbar actions.\n */\nconst ToolbarButton: React.FC<ToolbarButtonProps> = ({\n\tonClick,\n\tariaLabel,\n\tariaPressed,\n\tdisabled = false,\n\tchildren,\n\tclassName = \"\",\n\ttitle,\n}) => {\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonClick={onClick}\n\t\t\taria-label={ariaLabel}\n\t\t\taria-pressed={ariaPressed}\n\t\t\tdisabled={disabled}\n\t\t\ttitle={title ?? ariaLabel}\n\t\t\tclassName={`flipbook-toolbar-button ${className}`.trim()}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n};\n\nexport { ToolbarButton };\nexport type { ToolbarButtonProps };\n","import type React from \"react\";\nimport { ToolbarButton } from \"./ToolbarButton\";\n\ninterface ActionButtonProps {\n\t/** Click handler for custom action */\n\tonClick: () => void;\n\t/** ARIA label for accessibility */\n\tariaLabel: string;\n\t/** Custom content (icon or text) */\n\tchildren: React.ReactNode;\n\t/** Whether the button is disabled */\n\tdisabled?: boolean;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Generic toolbar button for custom actions.\n * Use this for actions that aren't standard flipbook navigation.\n */\nconst ActionButton: React.FC<ActionButtonProps> = ({\n\tonClick,\n\tariaLabel,\n\tchildren,\n\tdisabled = false,\n\tclassName,\n}) => {\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={onClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\tdisabled={disabled}\n\t\t\tclassName={`flipbook-toolbar-action ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { ActionButton };\nexport type { ActionButtonProps };\n","const r = {\n align: \"left\",\n direction: \"ltr\",\n translations: {\n \"toolbarItem.download\": \"Download\",\n \"toolbarItem.downloadPageRange\": \"Download page range…\",\n \"toolbarItem.download.from\": \"From\",\n \"toolbarItem.download.to\": \"To\",\n \"toolbarItem.download.download\": \"Download\",\n \"command.downloadEntireBook\": \"Download entire book\",\n \"command.jumpToToc\": \"Table of contents\",\n \"command.jumpToFirstPage\": \"First page\",\n \"command.jumpToLastPage\": \"Last page\",\n \"command.jumpToPrevPage\": \"Previous page\",\n \"command.jumpToNextPage\": \"Next page\",\n \"command.toggleFullscreen\": \"Toggle fullscreen\",\n \"command.toggleFullscreenDesc\": \"Enter or exit fullscreen mode\",\n \"command.toggleDebug\": \"Toggle debug toolbar\",\n \"command.toggleDebugDesc\": \"Show or hide the debug toolbar (Ctrl+Alt+D)\",\n \"toolbarItem.goToPage\": \"Go to page\",\n \"toolbarItem.selectText\": \"Select text with mouse\",\n \"toolbarItem.selectionLetters\": \"Aa\"\n }\n}, d = {\n align: \"right\",\n direction: \"rtl\",\n translations: {\n \"toolbarItem.download\": \"הורדה\",\n \"toolbarItem.downloadPageRange\": \"הורד טווח עמודים…\",\n \"toolbarItem.download.from\": \"מ\",\n \"toolbarItem.download.to\": \"עד\",\n \"toolbarItem.download.download\": \"הורד\",\n \"command.downloadEntireBook\": \"הורד את כל הספר\",\n \"command.jumpToToc\": \"תוכן העניינים\",\n \"command.jumpToFirstPage\": \"עמוד ראשון\",\n \"command.jumpToLastPage\": \"עמוד אחרון\",\n \"command.jumpToPrevPage\": \"עמוד קודם\",\n \"command.jumpToNextPage\": \"עמוד הבא\",\n \"command.toggleFullscreen\": \"מסך מלא\",\n \"command.toggleFullscreenDesc\": \"כניסה או יציאה ממסך מלא\",\n \"command.toggleDebug\": \"סרגל כלים לדיבוג\",\n \"command.toggleDebugDesc\": \"הצג או הסתר סרגל הדיבוג (Ctrl+Alt+D)\",\n \"toolbarItem.goToPage\": \"מעבר לעמוד\",\n \"toolbarItem.selectText\": \"בחירת טקסט עם העכבר\",\n \"toolbarItem.selectionLetters\": \"אב\"\n }\n}, a = {\n \"en-US\": r,\n \"he-IL\": d\n}, n = \"en-US\", g = {\n \"toolbarItem.download\": \"Download\",\n \"toolbarItem.downloadPageRange\": \"Download page range…\",\n \"toolbarItem.download.from\": \"From\",\n \"toolbarItem.download.to\": \"To\",\n \"toolbarItem.download.download\": \"Download\",\n \"command.downloadEntireBook\": \"Download entire book\",\n \"command.jumpToToc\": \"Table of contents\",\n \"command.jumpToFirstPage\": \"First page\",\n \"command.jumpToLastPage\": \"Last page\",\n \"command.jumpToPrevPage\": \"Previous page\",\n \"command.jumpToNextPage\": \"Next page\",\n \"command.toggleFullscreen\": \"Toggle fullscreen\",\n \"command.toggleFullscreenDesc\": \"Enter or exit fullscreen mode\",\n \"command.toggleDebug\": \"Toggle debug toolbar\",\n \"command.toggleDebugDesc\": \"Show or hide the debug toolbar (Ctrl+Alt+D)\",\n \"toolbarItem.goToPage\": \"Go to page\"\n};\nfunction l(o) {\n return a[o] ?? a[n];\n}\nfunction c(o) {\n return l(o).direction === \"rtl\";\n}\nfunction u(o) {\n return c(o) ? \"rtl\" : \"ltr\";\n}\nfunction i(o, m) {\n const e = l(m).translations[o];\n if (e !== void 0 && e !== \"\") return e;\n const t = a[n].translations[o];\n return t !== void 0 && t !== \"\" ? t : g[o] ?? o;\n}\nexport {\n n as defaultLocale,\n u as directionFromLocale,\n l as getConfig,\n c as isRtl,\n i as t\n};\n//# sourceMappingURL=intl.js.map\n","import type React from \"react\";\nimport { createContext, useContext } from \"react\";\nimport type { FlipBookHandle, MouseMode, PageSemantics } from \"../FlipBook\";\nimport type { Locale } from \"../i18n\";\n\ninterface ToolbarContextValue {\n\tflipBookRef: React.RefObject<FlipBookHandle | null>;\n\tdirection: \"ltr\" | \"rtl\";\n\t/** Locale for UI strings (toolbar, download menu). Defaults to en-US. */\n\tlocale: Locale;\n\tpageSemantics?: PageSemantics;\n\tcurrentPage: number;\n\ttotalPages: number;\n\t/** \"Of\" value from the book (for page indicator). Sourced from FlipBook ref. */\n\tof: string | number;\n\tisFirstPage: boolean;\n\tisLastPage: boolean;\n\tmouseMode: MouseMode;\n\t/** Ref used by openDownloadMenu command (Ctrl+S) to open the download dropdown. DownloadDropdown sets this. */\n\topenDownloadMenuRef: React.MutableRefObject<(() => void) | null>;\n\t/** Ref set by DownloadDropdown: (from?, to?) => void to run download (entire book or range). Used by download command. */\n\tdownloadExecutorRef: React.MutableRefObject<((from?: number, to?: number) => void) | null>;\n\t/** When set (via Toolbar fullscreenTargetRef), fullscreen targets this container (e.g. sefer + toolbar). */\n\tfullscreenTargetRef?: React.RefObject<HTMLElement | null>;\n}\n\nconst ToolbarContext = createContext<ToolbarContextValue | null>(null);\n\nexport function useToolbar(): ToolbarContextValue {\n\tconst context = useContext(ToolbarContext);\n\tif (!context) {\n\t\tthrow new Error(\"Toolbar components must be used within a Toolbar\");\n\t}\n\treturn context;\n}\n\nexport { ToolbarContext };\nexport type { ToolbarContextValue };\n","import type React from \"react\";\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport type { SemanticPageInfo } from \"../download/types\";\nimport { isRtl, t } from \"../i18n\";\nimport { DownloadIcon } from \"../icons\";\nimport { useToolbar } from \"./ToolbarContext\";\nimport \"./DownloadDropdown.css\";\n\n/** Strip Hebrew punctuation (geresh, gershaim) from a name for use in filenames. */\nfunction sanitizeForFilename(name: string): string {\n\treturn name.replace(/[׳'״\"]/g, \"\");\n}\n\nfunction triggerDownload(result: { ext: string; data: string }, filenameBase: string): void {\n\ttry {\n\t\tconst binary = atob(result.data);\n\t\tconst bytes = new Uint8Array(binary.length);\n\t\tfor (let i = 0; i < binary.length; i++) {\n\t\t\tbytes[i] = binary.charCodeAt(i);\n\t\t}\n\t\tconst blob = new Blob([bytes]);\n\t\tconst url = URL.createObjectURL(blob);\n\t\tconst a = document.createElement(\"a\");\n\t\ta.href = url;\n\t\ta.download = `${filenameBase}.${result.ext}`;\n\t\ta.click();\n\t\tURL.revokeObjectURL(url);\n\t} catch (e) {\n\t\tconsole.error(\"Download failed:\", e);\n\t}\n}\n\n/** Collect pages that have a semantic name for range selector options.\n * Pages without a semantic name (covers, blanks, TOC) are excluded. */\nfunction getSelectablePages(\n\ttotalPages: number,\n\tpageSemantics?: {\n\t\tindexToSemanticName: (i: number) => string;\n\t\tindexToTitle: (i: number) => string;\n\t},\n): SemanticPageInfo[] {\n\tconst list: SemanticPageInfo[] = [];\n\tfor (let i = 0; i < totalPages; i++) {\n\t\tconst semanticName = pageSemantics?.indexToSemanticName(i) ?? \"\";\n\t\tconst title = pageSemantics?.indexToTitle(i) ?? \"\";\n\t\t// Only include pages with a real semantic identity\n\t\tif (!semanticName && !title) {\n\t\t\t// No semantics at all — fall back to 1-based index only when\n\t\t\t// no pageSemantics provider exists (plain book without metadata).\n\t\t\tif (!pageSemantics) {\n\t\t\t\tlist.push({ pageIndex: i, semanticName: String(i + 1), title: `Page ${i + 1}` });\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tlist.push({\n\t\t\tpageIndex: i,\n\t\t\tsemanticName: semanticName || String(i + 1),\n\t\t\ttitle: title || semanticName,\n\t\t});\n\t}\n\treturn list;\n}\n\nexport interface DownloadDropdownProps {\n\t/** Label for \"Download\" button. Default: \"Download\" */\n\tariaLabel?: string;\n\tclassName?: string;\n}\n\nconst DownloadDropdown: React.FC<DownloadDropdownProps> = ({\n\tariaLabel = \"Download\",\n\tclassName,\n}) => {\n\tconst {\n\t\ttotalPages,\n\t\tpageSemantics,\n\t\tlocale,\n\t\topenDownloadMenuRef,\n\t\tdownloadExecutorRef,\n\t\tflipBookRef,\n\t} = useToolbar();\n\tconst downloadConfig = flipBookRef.current?.getDownloadConfig?.() ?? undefined;\n\tconst [open, setOpen] = useState(false);\n\n\tuseEffect(() => {\n\t\topenDownloadMenuRef.current = () => setOpen(true);\n\t\treturn () => {\n\t\t\topenDownloadMenuRef.current = null;\n\t\t};\n\t}, [openDownloadMenuRef]);\n\ttype DownloadMode = \"entire\" | \"range\";\n\tconst [downloadMode, setDownloadMode] = useState<DownloadMode>(\"entire\");\n\tconst [fromIndex, setFromIndex] = useState(0);\n\tconst [toIndex, setToIndex] = useState(0);\n\tconst [loading, setLoading] = useState<\"sefer\" | \"range\" | null>(null);\n\tconst [openUp, setOpenUp] = useState(false);\n\tconst dropdownRef = useRef<HTMLDivElement>(null);\n\tconst menuRef = useRef<HTMLDivElement>(null);\n\n\tconst selectablePages = useMemo(\n\t\t() => getSelectablePages(totalPages, pageSemantics),\n\t\t[totalPages, pageSemantics],\n\t);\n\n\tconst hasSefer = Boolean(downloadConfig?.onDownloadSefer);\n\tconst hasRange = Boolean(downloadConfig?.onDownloadPageRange);\n\tconst showDropdown = hasSefer || hasRange;\n\n\t// Pre-compute primitive values from the memoised list so the effect deps stay stable\n\tconst firstSelectablePage = selectablePages[0]?.pageIndex ?? 0;\n\tconst lastSelectablePage = selectablePages[selectablePages.length - 1]?.pageIndex ?? 0;\n\n\t// When opening, default mode to \"entire\" if available, else \"range\"; init range to first/last selectable page\n\tuseEffect(() => {\n\t\tif (!open) return;\n\t\tsetDownloadMode(hasSefer ? \"entire\" : \"range\");\n\t\tsetFromIndex(firstSelectablePage);\n\t\tsetToIndex(lastSelectablePage);\n\t}, [open, hasSefer, firstSelectablePage, lastSelectablePage]);\n\n\tconst closeDropdown = useCallback(() => {\n\t\tsetOpen(false);\n\t}, []);\n\n\t// Keep dropdown menu inside viewport: open upward when near bottom\n\tuseLayoutEffect(() => {\n\t\tif (!open || !menuRef.current || !dropdownRef.current) return;\n\t\tconst menu = menuRef.current;\n\t\tconst trigger = dropdownRef.current.querySelector(\".flipbook-toolbar-download-trigger\");\n\t\tconst updateOpenUp = () => {\n\t\t\tconst triggerRect = trigger?.getBoundingClientRect();\n\t\t\tif (!triggerRect) return;\n\t\t\tconst menuHeight = menu.getBoundingClientRect().height;\n\t\t\tconst spaceBelow = window.innerHeight - triggerRect.bottom;\n\t\t\tconst padding = 8;\n\t\t\tsetOpenUp(spaceBelow < menuHeight + padding);\n\t\t};\n\t\tupdateOpenUp();\n\t\tconst ro = new ResizeObserver(updateOpenUp);\n\t\tro.observe(menu);\n\t\treturn () => ro.disconnect();\n\t}, [open]);\n\n\tuseEffect(() => {\n\t\tif (!open) return;\n\t\tconst handleClickOutside = (e: MouseEvent) => {\n\t\t\tif (dropdownRef.current && !dropdownRef.current.contains(e.target as Node)) {\n\t\t\t\tcloseDropdown();\n\t\t\t}\n\t\t};\n\t\tdocument.addEventListener(\"mousedown\", handleClickOutside);\n\t\treturn () => document.removeEventListener(\"mousedown\", handleClickOutside);\n\t}, [open, closeDropdown]);\n\n\tconst handleEntireBook = useCallback(async () => {\n\t\tconst config = flipBookRef.current?.getDownloadConfig?.();\n\t\tif (!config?.onDownloadSefer) return;\n\t\tsetLoading(\"sefer\");\n\t\ttry {\n\t\t\tconst result = await config.onDownloadSefer();\n\t\t\tif (result) triggerDownload(result, config.entireBookFilename ?? \"book\");\n\t\t\tcloseDropdown();\n\t\t} finally {\n\t\t\tsetLoading(null);\n\t\t}\n\t}, [flipBookRef, closeDropdown]);\n\n\tconst runRangeDownload = useCallback(\n\t\tasync (from: number, to: number) => {\n\t\t\tconst config = flipBookRef.current?.getDownloadConfig?.();\n\t\t\tif (!config?.onDownloadPageRange) return;\n\t\t\tconst pages: number[] = [];\n\t\t\tconst semanticPages: SemanticPageInfo[] = [];\n\t\t\tfor (let i = from; i <= to; i++) {\n\t\t\t\tpages.push(i);\n\t\t\t\tconst info = selectablePages.find((sp) => sp.pageIndex === i);\n\t\t\t\tif (info) semanticPages.push(info);\n\t\t\t}\n\t\t\tsetLoading(\"range\");\n\t\t\ttry {\n\t\t\t\tconst result = await config.onDownloadPageRange(\n\t\t\t\t\tpages,\n\t\t\t\t\tsemanticPages,\n\t\t\t\t\tconfig.downloadContext,\n\t\t\t\t);\n\t\t\t\tif (result) {\n\t\t\t\t\tconst fromName = sanitizeForFilename(semanticPages[0]?.semanticName ?? String(from));\n\t\t\t\t\tconst toName = sanitizeForFilename(\n\t\t\t\t\t\tsemanticPages[semanticPages.length - 1]?.semanticName ?? String(to),\n\t\t\t\t\t);\n\t\t\t\t\ttriggerDownload(result, `${config.rangeFilename ?? \"pages\"}-${fromName}-${toName}`);\n\t\t\t\t}\n\t\t\t\tcloseDropdown();\n\t\t\t} finally {\n\t\t\t\tsetLoading(null);\n\t\t\t}\n\t\t},\n\t\t[flipBookRef, selectablePages, closeDropdown],\n\t);\n\n\tuseEffect(() => {\n\t\tdownloadExecutorRef.current = (from?: number, to?: number) => {\n\t\t\tif (from === undefined && to === undefined) {\n\t\t\t\tvoid handleEntireBook();\n\t\t\t} else if (from !== undefined && to !== undefined) {\n\t\t\t\tvoid runRangeDownload(from, to);\n\t\t\t}\n\t\t};\n\t\treturn () => {\n\t\t\tdownloadExecutorRef.current = null;\n\t\t};\n\t}, [downloadExecutorRef, handleEntireBook, runRangeDownload]);\n\n\tif (!showDropdown) return null;\n\n\treturn (\n\t\t<div className={`flipbook-toolbar-download-wrap ${className ?? \"\"}`.trim()} ref={dropdownRef}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"flipbook-toolbar-button flipbook-toolbar-download-trigger\"\n\t\t\t\tonClick={() => setOpen((o) => !o)}\n\t\t\t\taria-label={ariaLabel ?? t(\"toolbarItem.download\", locale)}\n\t\t\t\taria-expanded={open}\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\tdisabled={loading !== null}\n\t\t\t>\n\t\t\t\t<DownloadIcon size={18} />\n\t\t\t</button>\n\t\t\t{open && (\n\t\t\t\t<div\n\t\t\t\t\tref={menuRef}\n\t\t\t\t\tclassName={`flipbook-toolbar-download-menu ${openUp ? \"flipbook-toolbar-download-menu--open-up\" : \"\"}`.trim()}\n\t\t\t\t\trole=\"menu\"\n\t\t\t\t\tdir={isRtl(locale) ? \"rtl\" : \"ltr\"}\n\t\t\t\t>\n\t\t\t\t\t<fieldset\n\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-mode\"\n\t\t\t\t\t\taria-label={t(\"toolbarItem.download\", locale)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{hasSefer && (\n\t\t\t\t\t\t\t<label className=\"flipbook-toolbar-download-radio-label\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\tname=\"download-mode\"\n\t\t\t\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-radio\"\n\t\t\t\t\t\t\t\t\tchecked={downloadMode === \"entire\"}\n\t\t\t\t\t\t\t\t\tonChange={() => setDownloadMode(\"entire\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<span>{t(\"command.downloadEntireBook\", locale)}</span>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{hasRange && (\n\t\t\t\t\t\t\t<label className=\"flipbook-toolbar-download-radio-label\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\tname=\"download-mode\"\n\t\t\t\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-radio\"\n\t\t\t\t\t\t\t\t\tchecked={downloadMode === \"range\"}\n\t\t\t\t\t\t\t\t\tonChange={() => setDownloadMode(\"range\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<span>{t(\"toolbarItem.downloadPageRange\", locale)}</span>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</fieldset>\n\t\t\t\t\t{downloadMode === \"range\" && (\n\t\t\t\t\t\t<div className=\"flipbook-toolbar-download-range\">\n\t\t\t\t\t\t\t<label className=\"flipbook-toolbar-download-range-label\">\n\t\t\t\t\t\t\t\t{t(\"toolbarItem.download.from\", locale)}\n\t\t\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t\t\tvalue={fromIndex}\n\t\t\t\t\t\t\t\t\tonChange={(e) => setFromIndex(Number(e.target.value))}\n\t\t\t\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-range-select\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{selectablePages.map((p) => (\n\t\t\t\t\t\t\t\t\t\t<option key={p.pageIndex} value={p.pageIndex}>\n\t\t\t\t\t\t\t\t\t\t\t{p.semanticName || p.title || `Page ${p.pageIndex + 1}`}\n\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t<label className=\"flipbook-toolbar-download-range-label\">\n\t\t\t\t\t\t\t\t{t(\"toolbarItem.download.to\", locale)}\n\t\t\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t\t\tvalue={toIndex}\n\t\t\t\t\t\t\t\t\tonChange={(e) => setToIndex(Number(e.target.value))}\n\t\t\t\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-range-select\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{selectablePages.map((p) => (\n\t\t\t\t\t\t\t\t\t\t<option key={p.pageIndex} value={p.pageIndex}>\n\t\t\t\t\t\t\t\t\t\t\t{p.semanticName || p.title || `Page ${p.pageIndex + 1}`}\n\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-menuitem flipbook-toolbar-download-primary\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tif (downloadMode === \"entire\") {\n\t\t\t\t\t\t\t\tvoid handleEntireBook();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst total = flipBookRef.current?.getTotalPages?.() ?? totalPages;\n\t\t\t\t\t\t\t\tconst from = Math.min(fromIndex, toIndex);\n\t\t\t\t\t\t\t\tlet to = Math.max(fromIndex, toIndex);\n\t\t\t\t\t\t\t\tif (total > 0 && to >= total) to = total - 1;\n\t\t\t\t\t\t\t\tif (to < from) return;\n\t\t\t\t\t\t\t\tvoid runRangeDownload(from, to);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisabled={loading !== null}\n\t\t\t\t\t>\n\t\t\t\t\t\t{loading === \"sefer\"\n\t\t\t\t\t\t\t? \"…\"\n\t\t\t\t\t\t\t: loading === \"range\"\n\t\t\t\t\t\t\t\t? \"…\"\n\t\t\t\t\t\t\t\t: t(\"toolbarItem.download.download\", locale)}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport { DownloadDropdown };\n","import { goToFirstCommand } from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { useCommands } from \"../commands/CommandContext\";\nimport { t } from \"../i18n\";\nimport { ChevronFirstIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface FirstPageButtonProps {\n\t/** Custom content (icon or text). Defaults to ChevronFirstIcon */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to navigate to the first page. Same behavior in LTR and RTL.\n * Visual mirroring is handled by CSS (dir=\"rtl\" + icon flip).\n */\nconst FirstPageButton: React.FC<FirstPageButtonProps> = ({ children, className }) => {\n\tconst { locale } = useToolbar();\n\tconst { execute, canExecute } = useCommands();\n\n\tconst handleClick = () => {\n\t\texecute(goToFirstCommand);\n\t};\n\n\tconst defaultIcon = <ChevronFirstIcon size={18} />;\n\tconst ariaLabel = t(\"command.jumpToFirstPage\", locale);\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\ttitle={ariaLabel}\n\t\t\tdisabled={!canExecute(goToFirstCommand)}\n\t\t\tclassName={`flipbook-toolbar-first ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? defaultIcon}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { FirstPageButton };\nexport type { FirstPageButtonProps };\n","import type React from \"react\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { MaximizeIcon, MinimizeIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface FullscreenButtonProps {\n\t/** Target element to make fullscreen. If not provided, uses Toolbar's fullscreenTargetRef or document.documentElement */\n\ttargetRef?: React.RefObject<HTMLElement | null>;\n\t/** Custom content for enter fullscreen. Defaults to MaximizeIcon */\n\tenterIcon?: React.ReactNode;\n\t/** Custom content for exit fullscreen. Defaults to MinimizeIcon */\n\texitIcon?: React.ReactNode;\n\t/** ARIA label for entering fullscreen. Defaults to \"Enter fullscreen\" */\n\tariaLabelEnter?: string;\n\t/** ARIA label for exiting fullscreen. Defaults to \"Exit fullscreen\" */\n\tariaLabelExit?: string;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to toggle fullscreen mode.\n */\nconst FullscreenButton: React.FC<FullscreenButtonProps> = ({\n\ttargetRef: targetRefProp,\n\tenterIcon,\n\texitIcon,\n\tariaLabelEnter = \"Enter fullscreen\",\n\tariaLabelExit = \"Exit fullscreen\",\n\tclassName,\n}) => {\n\tconst [isFullscreen, setIsFullscreen] = useState(false);\n\tconst toolbar = useToolbar();\n\tconst targetRef = targetRefProp ?? toolbar.fullscreenTargetRef;\n\n\t// Check fullscreen state\n\tconst updateFullscreenState = useCallback(() => {\n\t\tsetIsFullscreen(!!document.fullscreenElement);\n\t}, []);\n\n\tuseEffect(() => {\n\t\tdocument.addEventListener(\"fullscreenchange\", updateFullscreenState);\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"fullscreenchange\", updateFullscreenState);\n\t\t};\n\t}, [updateFullscreenState]);\n\n\tconst handleClick = async () => {\n\t\ttry {\n\t\t\tif (isFullscreen) {\n\t\t\t\tawait document.exitFullscreen();\n\t\t\t} else {\n\t\t\t\tconst target = targetRef?.current ?? document.documentElement;\n\t\t\t\tawait target.requestFullscreen();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"Fullscreen request failed:\", error);\n\t\t}\n\t};\n\n\tconst label = isFullscreen ? ariaLabelExit : ariaLabelEnter;\n\tconst icon = isFullscreen\n\t\t? (exitIcon ?? <MinimizeIcon size={18} />)\n\t\t: (enterIcon ?? <MaximizeIcon size={18} />);\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={label}\n\t\t\tclassName={`flipbook-toolbar-fullscreen ${isFullscreen ? \"flipbook-toolbar-fullscreen--active\" : \"\"} ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{icon}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { FullscreenButton };\nexport type { FullscreenButtonProps };\n","import { goToLastCommand } from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { useCommands } from \"../commands/CommandContext\";\nimport { t } from \"../i18n\";\nimport { ChevronLastIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface LastPageButtonProps {\n\t/** Custom content (icon or text). Defaults to ChevronLastIcon */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to navigate to the last page. Same behavior in LTR and RTL.\n * Visual mirroring is handled by CSS (dir=\"rtl\" + icon flip).\n */\nconst LastPageButton: React.FC<LastPageButtonProps> = ({ children, className }) => {\n\tconst { locale } = useToolbar();\n\tconst { execute, canExecute } = useCommands();\n\n\tconst handleClick = () => {\n\t\texecute(goToLastCommand);\n\t};\n\n\tconst defaultIcon = <ChevronLastIcon size={18} />;\n\tconst ariaLabel = t(\"command.jumpToLastPage\", locale);\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\ttitle={ariaLabel}\n\t\t\tdisabled={!canExecute(goToLastCommand)}\n\t\t\tclassName={`flipbook-toolbar-last ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? defaultIcon}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { LastPageButton };\nexport type { LastPageButtonProps };\n","import type React from \"react\";\nimport { t } from \"../i18n\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\nexport interface MouseModeButtonProps {\n\t/** Override the locale's letters shown beside the text caret. */\n\tletters?: string;\n\t/** Override the localized accessible label. */\n\tariaLabel?: string;\n\tclassName?: string;\n}\n\n/** Switch mouse dragging between native page turning and text selection. */\nexport const MouseModeButton: React.FC<MouseModeButtonProps> = ({\n\tletters,\n\tariaLabel,\n\tclassName,\n}) => {\n\tconst { flipBookRef, locale, mouseMode } = useToolbar();\n\tconst label = ariaLabel ?? t(\"toolbarItem.selectText\", locale);\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={() => {\n\t\t\t\tflipBookRef.current?.setMouseMode(mouseMode === \"turn\" ? \"select\" : \"turn\");\n\t\t\t\twindow.getSelection()?.removeAllRanges();\n\t\t\t}}\n\t\t\tariaLabel={label}\n\t\t\tariaPressed={mouseMode === \"select\"}\n\t\t\tclassName={`flipbook-toolbar-mouse-mode ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t<span className=\"flipbook-toolbar-mouse-mode-icon\" aria-hidden=\"true\">\n\t\t\t\t<span className=\"flipbook-toolbar-mouse-mode-caret\" />\n\t\t\t\t<span>{letters ?? t(\"toolbarItem.selectionLetters\", locale)}</span>\n\t\t\t</span>\n\t\t</ToolbarButton>\n\t);\n};\n","import { flipNextCommand } from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { useCommands } from \"../commands/CommandContext\";\nimport { t } from \"../i18n\";\nimport { ChevronRightIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface NextButtonProps {\n\t/** Custom content (icon or text). Defaults to ChevronRightIcon */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button: next page. Same behavior in LTR and RTL.\n * Visual mirroring is handled by CSS (dir=\"rtl\" + icon flip).\n */\nconst NextButton: React.FC<NextButtonProps> = ({ children, className }) => {\n\tconst { locale } = useToolbar();\n\tconst { execute, canExecute } = useCommands();\n\n\tconst handleClick = () => {\n\t\texecute(flipNextCommand);\n\t};\n\n\tconst ariaLabel = t(\"command.jumpToNextPage\", locale);\n\tconst defaultIcon = <ChevronRightIcon size={20} />;\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\ttitle={ariaLabel}\n\t\t\tdisabled={!canExecute(flipNextCommand)}\n\t\t\tclassName={`flipbook-toolbar-next ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? defaultIcon}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { NextButton };\nexport type { NextButtonProps };\n","import type React from \"react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ntype PageIndicatorMode = \"semantic\" | \"index\";\n\ninterface PageIndicatorProps {\n\t/**\n\t * Display mode:\n\t * - \"semantic\": uses pageSemantics to show semantic names (e.g., \"א\", \"ב\")\n\t * - \"index\": shows 1-based page numbers\n\t * Defaults to \"semantic\" if pageSemantics is available, otherwise \"index\".\n\t */\n\tmode?: PageIndicatorMode;\n\t/** Whether to show \"/ total\" after the current page(s). Defaults to true. */\n\tshowTotal?: boolean;\n\t/** Placeholder when current page has no semantic name (semantic mode only) */\n\tplaceholder?: string;\n\t/** Whether the input is editable for navigation. Defaults to true in semantic mode. */\n\teditable?: boolean;\n\t/** Additional CSS class name */\n\tclassName?: string;\n\t/** Input aria-label for accessibility */\n\tariaLabel?: string;\n\t/** Maximum input length */\n\tmaxLength?: number;\n}\n\n/**\n * Displays the current page position with support for semantic names or indices.\n * Shows a range when a spread is visible (e.g., \"א - ב\" or \"1 - 2\").\n * Direction-aware: RTL shows right-left, LTR shows left-right.\n * When both pages have the same semantic name, shows scalar (no range).\n */\nconst PageIndicator: React.FC<PageIndicatorProps> = ({\n\tmode: modeProp,\n\tshowTotal = true,\n\tplaceholder = \"—\",\n\teditable: editableProp,\n\tclassName,\n\tariaLabel = \"Go to page\",\n\tmaxLength = 10,\n}) => {\n\tconst { flipBookRef, pageSemantics, direction, currentPage, totalPages, of } = useToolbar();\n\n\t// Determine effective mode\n\tconst mode: PageIndicatorMode = modeProp ?? (pageSemantics ? \"semantic\" : \"index\");\n\tconst editable = editableProp ?? (mode === \"semantic\" && !!pageSemantics);\n\n\tconst [inputValue, setInputValue] = useState(\"\");\n\tconst [isEditing, setIsEditing] = useState(false);\n\t// Ref-only flag: prevents handleBlur from reverting inputValue to a stale\n\t// displayText during the brief gap before Toolbar polling updates currentPage.\n\t// Cleared synchronously once the page actually changes.\n\tconst justNavigatedRef = useRef(false);\n\tconst prevCurrentPageRef = useRef(currentPage);\n\n\t// Calculate the spread pages (current page and its facing page)\n\tconst leftPageIndex = currentPage;\n\tconst rightPageIndex = currentPage + 1 < totalPages ? currentPage + 1 : null;\n\n\t// Get display names for pages\n\tconst getPageName = useCallback(\n\t\t(pageIndex: number): string => {\n\t\t\tif (mode === \"semantic\" && pageSemantics) {\n\t\t\t\treturn pageSemantics.indexToSemanticName(pageIndex) || \"\";\n\t\t\t}\n\t\t\treturn String(pageIndex + 1); // 1-based for display\n\t\t},\n\t\t[mode, pageSemantics],\n\t);\n\n\tconst leftName = getPageName(leftPageIndex);\n\tconst rightName = rightPageIndex != null ? getPageName(rightPageIndex) : \"\";\n\n\t// \"Of\" comes from the book (via context); default is total pages count\n\tconst getTotalDisplay = useCallback((): string => String(of), [of]);\n\n\t// Build display text for the range (always left physical page then right, e.g. י\"א - י\"ב)\n\tconst buildDisplayText = useCallback((): string => {\n\t\tconst firstName = leftName;\n\t\tconst secondName = rightName;\n\n\t\tlet rangeText: string;\n\t\tif (!firstName && !secondName) {\n\t\t\t// Both empty (e.g., cover pages)\n\t\t\trangeText = placeholder;\n\t\t} else if (!firstName) {\n\t\t\t// Only second has a name\n\t\t\trangeText = secondName;\n\t\t} else if (!secondName) {\n\t\t\t// Only first has a name\n\t\t\trangeText = firstName;\n\t\t} else if (firstName === secondName) {\n\t\t\t// Same name on both pages - show scalar\n\t\t\trangeText = firstName;\n\t\t} else {\n\t\t\t// Different names - show range\n\t\t\trangeText = `${firstName} - ${secondName}`;\n\t\t}\n\n\t\tif (showTotal) {\n\t\t\treturn `${rangeText} / ${getTotalDisplay()}`;\n\t\t}\n\t\treturn rangeText;\n\t}, [leftName, rightName, placeholder, showTotal, getTotalDisplay]);\n\n\t// The primary semantic name for editing (use left page in RTL reading order)\n\tconst primarySemanticName = direction === \"rtl\" ? rightName || leftName : leftName || rightName;\n\n\tconst displayText = buildDisplayText();\n\n\t// Sync input value when page changes and not editing.\n\t// After Enter navigation, justNavigatedRef prevents flashing the stale value;\n\t// once Toolbar polling updates currentPage, the flag is cleared and the\n\t// new displayText is applied. Because displayText includes the \" / total\"\n\t// suffix, it is always different from the user's typed value, guaranteeing\n\t// a state change that triggers a re-render.\n\tuseEffect(() => {\n\t\tconst pageChanged = currentPage !== prevCurrentPageRef.current;\n\t\tprevCurrentPageRef.current = currentPage;\n\n\t\tif (pageChanged) {\n\t\t\tjustNavigatedRef.current = false;\n\t\t}\n\t\tif (!isEditing && !justNavigatedRef.current) {\n\t\t\tsetInputValue(displayText);\n\t\t}\n\t}, [displayText, isEditing, currentPage]);\n\n\tconst handleFocus = useCallback(\n\t\t(e: React.FocusEvent<HTMLInputElement>) => {\n\t\t\tif (editable) {\n\t\t\t\tsetIsEditing(true);\n\t\t\t\tsetInputValue(primarySemanticName);\n\t\t\t\tjustNavigatedRef.current = false;\n\t\t\t\t// Select all text so the user can immediately type a replacement\n\t\t\t\tconst select = () => e.target.select();\n\t\t\t\ttypeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame(select) : select();\n\t\t\t}\n\t\t},\n\t\t[editable, primarySemanticName],\n\t);\n\n\tconst handleBlur = useCallback(() => {\n\t\tsetIsEditing(false);\n\t\t// After a successful Enter navigation, keep the user's typed value visible\n\t\t// until Toolbar polling updates currentPage with the new position.\n\t\tif (!justNavigatedRef.current) {\n\t\t\tsetInputValue(displayText);\n\t\t}\n\t}, [displayText]);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: React.KeyboardEvent<HTMLInputElement>) => {\n\t\t\tif (e.key === \"Enter\") {\n\t\t\t\t// Navigate on Enter\n\t\t\t\tif (pageSemantics && inputValue.trim()) {\n\t\t\t\t\tconst pageIndex = pageSemantics.semanticNameToIndex(inputValue.trim());\n\t\t\t\t\tif (pageIndex != null && pageIndex >= 0 && pageIndex < totalPages) {\n\t\t\t\t\t\tflipBookRef.current?.jumpToPage(pageIndex);\n\t\t\t\t\t\tjustNavigatedRef.current = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\te.currentTarget.blur();\n\t\t\t} else if (e.key === \"Escape\") {\n\t\t\t\t// Cancel editing\n\t\t\t\te.currentTarget.blur();\n\t\t\t}\n\t\t},\n\t\t[inputValue, pageSemantics, totalPages, flipBookRef],\n\t);\n\n\tconst handleChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\n\t\tsetInputValue(e.target.value);\n\t}, []);\n\n\t// Non-editable display (span)\n\tif (!editable) {\n\t\treturn (\n\t\t\t<span\n\t\t\t\tclassName={`flipbook-toolbar-indicator ${className ?? \"\"}`.trim()}\n\t\t\t\taria-live=\"polite\"\n\t\t\t\taria-atomic=\"true\"\n\t\t\t>\n\t\t\t\t{displayText}\n\t\t\t</span>\n\t\t);\n\t}\n\n\t// Editable input — always shows inputValue.\n\t// When not editing, useEffect keeps inputValue in sync with displayText.\n\t// During editing, inputValue holds the user's typed text.\n\t// After Enter navigation, inputValue keeps the typed value until polling\n\t// updates currentPage, at which point useEffect sets it to the new displayText.\n\tconst editingClass = isEditing ? \"flipbook-toolbar-indicator--editing\" : \"\";\n\treturn (\n\t\t<input\n\t\t\ttype=\"text\"\n\t\t\tclassName={`flipbook-toolbar-indicator ${editingClass} ${className ?? \"\"}`.trim()}\n\t\t\tvalue={inputValue}\n\t\t\tonFocus={handleFocus}\n\t\t\tonBlur={handleBlur}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tonChange={handleChange}\n\t\t\taria-label={ariaLabel}\n\t\t\taria-live=\"polite\"\n\t\t\taria-atomic=\"true\"\n\t\t\tmaxLength={maxLength}\n\t\t\treadOnly={!editable}\n\t\t/>\n\t);\n};\n\nexport { PageIndicator };\nexport type { PageIndicatorProps, PageIndicatorMode };\n","import { flipPrevCommand } from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { useCommands } from \"../commands/CommandContext\";\nimport { t } from \"../i18n\";\nimport { ChevronLeftIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface PrevButtonProps {\n\t/** Custom content (icon or text). Defaults to ChevronLeftIcon */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button: previous page. Same behavior in LTR and RTL.\n * Visual mirroring is handled by CSS (dir=\"rtl\" + icon flip).\n */\nconst PrevButton: React.FC<PrevButtonProps> = ({ children, className }) => {\n\tconst { locale } = useToolbar();\n\tconst { execute, canExecute } = useCommands();\n\n\tconst handleClick = () => {\n\t\texecute(flipPrevCommand);\n\t};\n\n\tconst ariaLabel = t(\"command.jumpToPrevPage\", locale);\n\tconst defaultIcon = <ChevronLeftIcon size={20} />;\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\ttitle={ariaLabel}\n\t\t\tdisabled={!canExecute(flipPrevCommand)}\n\t\t\tclassName={`flipbook-toolbar-prev ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? defaultIcon}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { PrevButton };\nexport type { PrevButtonProps };\n","import { goToTocCommand } from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { useCommands } from \"../commands/CommandContext\";\nimport { t } from \"../i18n\";\nimport { TableOfContentsIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface TocButtonProps {\n\t/** Custom content (icon or text). Defaults to TableOfContentsIcon */\n\tchildren?: React.ReactNode;\n\t/** Custom ARIA label. Defaults to localized \"Table of contents\" */\n\tariaLabel?: string;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to navigate to the Table of Contents page (instant jump, same as goToToc command).\n * TOC page index comes from store (populated by book config); command and UI both use the store.\n */\nconst TocButton: React.FC<TocButtonProps> = ({ children, ariaLabel: ariaLabelProp, className }) => {\n\tconst { locale } = useToolbar();\n\tconst { execute, canExecute } = useCommands();\n\tconst ariaLabel = ariaLabelProp ?? t(\"command.jumpToToc\", locale);\n\n\tconst handleClick = () => {\n\t\texecute(goToTocCommand);\n\t};\n\n\tconst disabled = !canExecute(goToTocCommand);\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\tdisabled={disabled}\n\t\t\tclassName={`flipbook-toolbar-toc ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? <TableOfContentsIcon size={18} />}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { TocButton };\nexport type { TocButtonProps };\n","import type { CommandDefinition } from \"html-flip-book-vanilla/commands\";\n\n/**\n * React-layer command: open the download dropdown (e.g. Ctrl+S).\n * Toolbar wires data.open to openDownloadMenuRef.current.\n */\nexport const openDownloadMenuCommand: CommandDefinition = {\n\tid: \"openDownloadMenu\",\n\tenName: \"Open download menu\",\n\tenDescription: \"Open the download menu\",\n\tnameKey: \"toolbarItem.download\",\n\thotkeys: [{ key: \"s\", modifiers: { ctrl: true } }],\n\texecute: (ctx) => {\n\t\t(ctx.data?.open as (() => void) | undefined)?.();\n\t\treturn undefined;\n\t},\n\tcanExecute: (ctx) => typeof ctx.data?.open === \"function\",\n};\n","import type React from \"react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { CommandDefinition, CommandOptions } from \"../commands\";\nimport { CommandProvider } from \"../commands/CommandContext\";\nimport { openDownloadMenuCommand } from \"../commands/open-download-menu-command\";\nimport type { FlipBookHandle, PageSemantics } from \"../FlipBook\";\nimport { defaultLocale, directionFromLocale, type Locale } from \"../i18n\";\nimport { ToolbarContext } from \"./ToolbarContext\";\nimport \"./Toolbar.css\";\n\ninterface ToolbarProps {\n\t/** Ref to the FlipBook component for programmatic control */\n\tflipBookRef: React.RefObject<FlipBookHandle | null>;\n\t/** Text direction. Defaults from intl locale (en-US → ltr). */\n\tdirection?: \"ltr\" | \"rtl\";\n\t/** Locale for UI strings. Defaults to en-US. */\n\tlocale?: Locale;\n\t/** Optional page semantics for semantic indicator (e.g. perek/chapter) */\n\tpageSemantics?: PageSemantics;\n\t/** Additional CSS class name */\n\tclassName?: string;\n\t/** Toolbar children in reading order: First, Prev, Indicator, Next, Last */\n\tchildren: React.ReactNode;\n\t/** Enable keyboard hotkeys for commands. Defaults to true */\n\tenableHotkeys?: boolean;\n\t/** Custom commands to register (merged with defaults) */\n\tcommands?: CommandDefinition[];\n\t/** Options for specific commands (e.g., custom hotkeys, data) */\n\tcommandOptions?: Record<string, CommandOptions>;\n\t/** When set, fullscreen (keyboard or button) targets this container only (e.g. sefer + toolbar wrapper). */\n\tfullscreenTargetRef?: React.RefObject<HTMLElement | null>;\n}\n\n/**\n * Container component for FlipBook toolbar controls.\n * Provides context to child components for accessing FlipBook methods.\n * Includes command system with configurable keyboard hotkeys.\n */\nconst Toolbar: React.FC<ToolbarProps> = ({\n\tflipBookRef,\n\tdirection: directionProp,\n\tlocale: localeProp,\n\tpageSemantics,\n\tclassName = \"\",\n\tchildren,\n\tenableHotkeys = true,\n\tcommands,\n\tcommandOptions,\n\tfullscreenTargetRef,\n}) => {\n\tconst direction = directionProp ?? directionFromLocale(localeProp ?? defaultLocale);\n\tconst locale = localeProp ?? (direction === \"rtl\" ? \"he-IL\" : \"en-US\");\n\tconst openDownloadMenuRef = useRef<(() => void) | null>(null);\n\tconst downloadExecutorRef = useRef<((from?: number, to?: number) => void) | null>(null);\n\tconst [currentPage, setCurrentPage] = useState(0);\n\tconst [totalPages, setTotalPages] = useState(0);\n\tconst [of, setOf] = useState<string | number>(0);\n\tconst [isFirstPage, setIsFirstPage] = useState(true);\n\tconst [isLastPage, setIsLastPage] = useState(false);\n\tconst [mouseMode, setMouseMode] = useState<\"turn\" | \"select\">(\"turn\");\n\n\tconst mergedCommandOptions: Record<string, CommandOptions> = {\n\t\t...(fullscreenTargetRef\n\t\t\t? {\n\t\t\t\t\ttoggleFullscreen: {\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tgetFullscreenTarget: () => fullscreenTargetRef.current ?? null,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: {}),\n\t\topenDownloadMenu: {\n\t\t\tdata: { open: () => openDownloadMenuRef.current?.() },\n\t\t},\n\t\tdownload: {\n\t\t\tdata: {\n\t\t\t\tonDownload: (from?: number, to?: number) => downloadExecutorRef.current?.(from, to),\n\t\t\t},\n\t\t},\n\t\t...commandOptions,\n\t};\n\n\t// Update state from FlipBook ref (book is source of truth for current, total, of)\n\tconst updateState = useCallback(() => {\n\t\tconst fb = flipBookRef.current;\n\t\tif (fb) {\n\t\t\tsetCurrentPage(fb.getCurrentPageIndex());\n\t\t\tsetTotalPages(fb.getTotalPages());\n\t\t\tsetOf(fb.getOf());\n\t\t\tsetIsFirstPage(fb.isFirstPage());\n\t\t\tsetIsLastPage(fb.isLastPage());\n\t\t\tsetMouseMode(fb.getMouseMode?.() ?? \"turn\");\n\t\t}\n\t}, [flipBookRef]);\n\n\t// Initial state update and periodic polling (throttled to reduce flicker)\n\t// TODO: Replace with event-based updates when FlipBook emits page change events\n\tuseEffect(() => {\n\t\tupdateState();\n\t\tconst interval = setInterval(updateState, 200);\n\t\treturn () => clearInterval(interval);\n\t}, [updateState]);\n\n\tconst toolbarContent = (\n\t\t<ToolbarContext.Provider\n\t\t\tvalue={{\n\t\t\t\tflipBookRef,\n\t\t\t\tdirection,\n\t\t\t\tlocale,\n\t\t\t\tpageSemantics,\n\t\t\t\tcurrentPage,\n\t\t\t\ttotalPages,\n\t\t\t\tof,\n\t\t\t\tisFirstPage,\n\t\t\t\tisLastPage,\n\t\t\t\tmouseMode,\n\t\t\t\topenDownloadMenuRef,\n\t\t\t\tdownloadExecutorRef,\n\t\t\t\tfullscreenTargetRef,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={`flipbook-toolbar ${direction === \"rtl\" ? \"flipbook-toolbar--rtl\" : \"\"} ${className}`.trim()}\n\t\t\t\trole=\"toolbar\"\n\t\t\t\taria-label=\"FlipBook navigation\"\n\t\t\t\tdir={direction}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</ToolbarContext.Provider>\n\t);\n\n\tconst allCommands: CommandDefinition[] = [openDownloadMenuCommand, ...(commands ?? [])];\n\n\treturn (\n\t\t<CommandProvider\n\t\t\tflipBookRef={flipBookRef}\n\t\t\tcurrentPage={currentPage}\n\t\t\ttotalPages={totalPages}\n\t\t\tdirection={direction}\n\t\t\tcommands={allCommands}\n\t\t\tcommandOptions={mergedCommandOptions}\n\t\t\tdisableHotkeys={!enableHotkeys}\n\t\t>\n\t\t\t{toolbarContent}\n\t\t</CommandProvider>\n\t);\n};\n\nexport { Toolbar };\nexport type { ToolbarProps };\n"],"names":["e","n","r","c","d","l","s","i","u","m","g","t","o","f","h","a","p","y","P","T","K","k","w","CommandsContext","createContext","CommandProvider","flipBookRef","_currentPage","_totalPages","direction","customCommands","commandOptions","disableHotkeys","children","registry","useMemo","reg","cmd","defaultCommands","createCommandContext","useCallback","command","runData","options","data","execute","ctx","canExecute","getAllCommands","handleKeyDown","event","target","entry","hotkeys","binding","hotkeyMatches","useEffect","value","jsx","useCommands","useContext","defaultProps","ChevronLeftIcon","size","className","ChevronRightIcon","ChevronFirstIcon","jsxs","ChevronLastIcon","MaximizeIcon","MinimizeIcon","TableOfContentsIcon","BookshelfIcon","DownloadIcon","ToolbarButton","onClick","ariaLabel","ariaPressed","disabled","title","ActionButton","ToolbarContext","useToolbar","context","sanitizeForFilename","name","triggerDownload","result","filenameBase","binary","bytes","blob","url","getSelectablePages","totalPages","pageSemantics","list","semanticName","DownloadDropdown","locale","openDownloadMenuRef","downloadExecutorRef","downloadConfig","open","setOpen","useState","downloadMode","setDownloadMode","fromIndex","setFromIndex","toIndex","setToIndex","loading","setLoading","openUp","setOpenUp","dropdownRef","useRef","menuRef","selectablePages","hasSefer","hasRange","showDropdown","firstSelectablePage","lastSelectablePage","closeDropdown","useLayoutEffect","menu","trigger","updateOpenUp","triggerRect","menuHeight","spaceBelow","ro","handleClickOutside","handleEntireBook","config","runRangeDownload","from","to","pages","semanticPages","info","sp","fromName","toName","isRtl","total","FirstPageButton","handleClick","goToFirstCommand","defaultIcon","FullscreenButton","targetRefProp","enterIcon","exitIcon","ariaLabelEnter","ariaLabelExit","isFullscreen","setIsFullscreen","toolbar","targetRef","updateFullscreenState","error","label","icon","LastPageButton","goToLastCommand","MouseModeButton","letters","mouseMode","NextButton","flipNextCommand","PageIndicator","modeProp","showTotal","placeholder","editableProp","maxLength","currentPage","of","mode","editable","inputValue","setInputValue","isEditing","setIsEditing","justNavigatedRef","prevCurrentPageRef","leftPageIndex","rightPageIndex","getPageName","pageIndex","leftName","rightName","getTotalDisplay","buildDisplayText","firstName","secondName","rangeText","primarySemanticName","displayText","pageChanged","handleFocus","select","handleBlur","handleChange","PrevButton","flipPrevCommand","TocButton","ariaLabelProp","goToTocCommand","openDownloadMenuCommand","Toolbar","directionProp","localeProp","enableHotkeys","commands","fullscreenTargetRef","directionFromLocale","defaultLocale","setCurrentPage","setTotalPages","setOf","isFirstPage","setIsFirstPage","isLastPage","setIsLastPage","setMouseMode","mergedCommandOptions","updateState","fb","interval","toolbarContent","allCommands"],"mappings":";;AAAA,IAAIA,KAAI;AACR,SAASC,KAAI;AACX,SAAOD;AACT;ACFK,MAACE,KAAI;AAAA,EACR,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,SAAS;AAAA,EACT,SAAS,CAAA;AAAA,EACT,SAAS,CAAC,MAAM;AACd,MAAE,MAAM;AAAA,MACN,EAAE,MAAM;AAAA,MACR,EAAE,MAAM;AAAA,IACd;AAAA,EACE;AAAA,EACA,YAAY,CAAC,MAAM,OAAO,EAAE,MAAM,cAAc;AAClD,GAAGC,KAAI;AAAA,EACL,EAAE,KAAK,aAAY;AAAA,EACnB,EAAE,KAAK,WAAU;AAAA,EACjB,EAAE,KAAK,IAAG;AAAA;AAEZ,GAAGC,IAAI;AAAA,EACL,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,SAAS;AAAA,EACT,SAASD;AAAAA,EACT,SAAS,CAAC,MAAM;AACd,MAAE,QAAQ,SAAQ;AAAA,EACpB;AAAA,EACA,YAAY,CAAC,OAAO,EAAE,QAAQ,oBAAmB,KAAM,MAAM,EAAE,QAAQ,cAAa,KAAM,KAAK;AACjG,GAAGE,KAAI,CAAC,EAAE,KAAK,YAAW,GAAI,EAAE,KAAK,SAAQ,CAAE,GAAGC,IAAI;AAAA,EACpD,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,SAAS;AAAA,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aAAAoF;AAAA,QACA,YAAArF;AAAA,QACA,IAAAsF;AAAA,QACA,aAAA4C;AAAA,QACA,YAAAE;AAAA,QACA,WAAAxD;AAAA,QACA,qBAAAtE;AAAA,QACA,qBAAAC;AAAA,QACA,qBAAAqH;AAAA,MAAA;AAAA,MAGD,UAAA,gBAAAhK;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,WAAW,oBAAoB7B,MAAc,QAAQ,0BAA0B,EAAE,IAAImC,CAAS,GAAG,KAAA;AAAA,UACjG,MAAK;AAAA,UACL,cAAW;AAAA,UACX,KAAKnC;AAAA,UAEJ,UAAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA,GAIIyM,IAAmC,CAACtB,IAAyB,GAAIK,KAAY,CAAA,CAAG;AAEtF,SACC,gBAAA/J;AAAA,IAACjC;AAAA,IAAA;AAAA,MACA,aAAAC;AAAA,MACA,aAAAyJ;AAAA,MACA,YAAArF;AAAA,MACA,WAAAjE;AAAA,MACA,UAAU6M;AAAA,MACV,gBAAgBL;AAAA,MAChB,gBAAgB,CAACb;AAAA,MAEhB,UAAAiB;AAAA,IAAA;AAAA,EAAA;AAGJ;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../base/dist/store/index.js","../../../base/dist/commands/index.js","../../src/commands/CommandContext.tsx","../../src/icons/index.tsx","../../src/toolbar/ToolbarButton.tsx","../../src/toolbar/ActionButton.tsx","../../src/toolbar/BookmarkToggleButton.tsx","../../../base/dist/intl.js","../../src/toolbar/ToolbarContext.tsx","../../src/toolbar/DownloadDropdown.tsx","../../src/toolbar/FirstPageButton.tsx","../../src/toolbar/FullscreenButton.tsx","../../src/toolbar/LastPageButton.tsx","../../src/toolbar/MouseModeButton.tsx","../../src/toolbar/NextButton.tsx","../../src/toolbar/PageIndicator.tsx","../../src/toolbar/PrevButton.tsx","../../src/toolbar/TocButton.tsx","../../src/commands/open-download-menu-command.ts","../../src/toolbar/Toolbar.tsx"],"sourcesContent":["let e = 4;\nfunction n() {\n return e;\n}\nfunction o(t) {\n e = t;\n}\nexport {\n n as getTocPageIndex,\n o as setTocPageIndex\n};\n//# sourceMappingURL=index.js.map\n","import { getTocPageIndex as a } from \"../store/index.js\";\nconst r = {\n id: \"download\",\n enName: \"Download\",\n enDescription: \"Download entire book or page range\",\n nameKey: \"toolbarItem.download\",\n hotkeys: [],\n execute: (e) => {\n e.data?.onDownload?.(\n e.data?.from,\n e.data?.to\n );\n },\n canExecute: (e) => typeof e.data?.onDownload == \"function\"\n}, c = [\n { key: \"ArrowRight\" },\n { key: \"PageDown\" },\n { key: \" \" }\n // Space\n], d = {\n id: \"flipNext\",\n navKind: \"flip\",\n enName: \"Next Page\",\n enDescription: \"Flip to the next page\",\n nameKey: \"command.jumpToNextPage\",\n hotkeys: c,\n execute: (e) => {\n e.handle?.flipNext();\n },\n canExecute: (e) => (e.handle?.getCurrentPageIndex() ?? 0) < (e.handle?.getTotalPages() ?? 0) - 1\n}, l = [{ key: \"ArrowLeft\" }, { key: \"PageUp\" }], s = {\n id: \"flipPrev\",\n navKind: \"flip\",\n enName: \"Previous Page\",\n enDescription: \"Flip to the previous page\",\n nameKey: \"command.jumpToPrevPage\",\n hotkeys: l,\n execute: (e) => {\n e.handle?.flipPrev();\n },\n canExecute: (e) => (e.handle?.getCurrentPageIndex() ?? 0) > 0\n}, i = [{ key: \"Home\" }, { key: \"ArrowLeft\", modifiers: { ctrl: !0 } }], u = {\n id: \"goToFirst\",\n navKind: \"jump\",\n enName: \"First Page\",\n enDescription: \"Jump to the first page\",\n nameKey: \"command.jumpToFirstPage\",\n hotkeys: i,\n execute: (e) => {\n e.handle?.jumpToPage(0);\n },\n canExecute: (e) => e.handle?.getCurrentPageIndex() !== 0\n}, m = [{ key: \"End\" }, { key: \"ArrowRight\", modifiers: { ctrl: !0 } }], g = {\n id: \"goToLast\",\n navKind: \"jump\",\n enName: \"Last Page\",\n enDescription: \"Jump to the last page\",\n nameKey: \"command.jumpToLastPage\",\n hotkeys: m,\n execute: (e) => {\n const t = e.handle?.getTotalPages() ?? 0;\n e.handle?.jumpToPage(t - 1);\n },\n canExecute: (e) => {\n const t = e.handle?.getCurrentPageIndex() ?? 0, o = e.handle?.getTotalPages() ?? 0;\n return t !== o - 1;\n }\n}, f = [{ key: \"t\" }], h = {\n id: \"goToToc\",\n navKind: \"jump\",\n enName: \"Table of Contents\",\n enDescription: \"Jump to the table of contents\",\n nameKey: \"command.jumpToToc\",\n hotkeys: f,\n execute: (e) => {\n const t = e.handle?.getTocPageIndex?.() ?? a();\n e.handle?.jumpToPage(t);\n },\n canExecute: (e) => {\n const t = e.handle?.getTocPageIndex?.() ?? a();\n return e.handle?.getCurrentPageIndex() !== t;\n }\n}, p = [{ key: \"d\", modifiers: { ctrl: !0, alt: !0 } }], y = {\n id: \"toggleDebug\",\n enName: \"Toggle Debug Toolbar\",\n enDescription: \"Show or hide the debug toolbar (Ctrl+Alt+D)\",\n nameKey: \"command.toggleDebug\",\n descriptionKey: \"command.toggleDebugDesc\",\n hotkeys: p,\n execute: (e) => {\n e.handle?.toggleDebugBar?.();\n }\n}, P = [{ key: \"F11\" }], T = {\n id: \"toggleFullscreen\",\n enName: \"Toggle Fullscreen\",\n enDescription: \"Enter or exit fullscreen mode\",\n nameKey: \"command.toggleFullscreen\",\n descriptionKey: \"command.toggleFullscreenDesc\",\n hotkeys: P,\n execute: (e) => {\n const t = e.data;\n document.fullscreenElement ? document.exitFullscreen().catch(console.warn) : (t?.getFullscreenTarget?.() ?? document.documentElement).requestFullscreen().catch(console.warn);\n }\n}, K = [\n d,\n s,\n u,\n g,\n h,\n T,\n y,\n r\n];\nfunction k(e, t) {\n return t !== \"rtl\" ? e : e === \"ArrowLeft\" ? \"ArrowRight\" : e === \"ArrowRight\" ? \"ArrowLeft\" : e;\n}\nfunction w(e, t, o) {\n if (k(t.key, o) !== e.key) return !1;\n const n = e.modifiers ?? {};\n return !(!!n.ctrl !== t.ctrlKey || !!n.shift !== t.shiftKey || !!n.alt !== t.altKey || !!n.meta !== t.metaKey);\n}\nexport {\n K as defaultCommands,\n r as downloadCommand,\n d as flipNextCommand,\n s as flipPrevCommand,\n k as getEffectiveKey,\n u as goToFirstCommand,\n g as goToLastCommand,\n h as goToTocCommand,\n w as hotkeyMatches,\n y as toggleDebugCommand,\n T as toggleFullscreenCommand\n};\n//# sourceMappingURL=index.js.map\n","import {\n\ttype CommandContext as CommandCtx,\n\ttype CommandDefinition,\n\ttype CommandOptions,\n\ttype CommandRegistry,\n\tdefaultCommands,\n\thotkeyMatches,\n} from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { createContext, useCallback, useContext, useEffect, useMemo } from \"react\";\nimport type { FlipBookHandle } from \"../FlipBook\";\n\ninterface CommandProviderProps {\n\t/** Reference to the FlipBook instance */\n\tflipBookRef: React.RefObject<FlipBookHandle | null>;\n\t/** Current page index */\n\tcurrentPage: number;\n\t/** Total number of pages */\n\ttotalPages: number;\n\t/** Reading direction */\n\tdirection?: \"rtl\" | \"ltr\";\n\t/** Custom commands to register (merged with defaults) */\n\tcommands?: CommandDefinition[];\n\t/** Options for specific commands */\n\tcommandOptions?: Record<string, CommandOptions>;\n\t/** Disable all hotkey bindings */\n\tdisableHotkeys?: boolean;\n\tchildren: React.ReactNode;\n}\n\ninterface CommandsContextValue {\n\t/** Execute a command (pass the command object, not a string ID). */\n\texecute: (command: CommandDefinition, runData?: Record<string, unknown>) => void;\n\t/** Check if a command can execute (for disabled state). */\n\tcanExecute: (command: CommandDefinition) => boolean;\n\t/** Get all registered commands. */\n\tgetAllCommands: () => CommandDefinition[];\n}\n\nconst CommandsContext = createContext<CommandsContextValue | null>(null);\n\n/**\n * Provider component that manages flipbook commands and hotkeys.\n * Uses framework-agnostic commands from base; only the provider and hook are React-specific.\n */\nexport const CommandProvider: React.FC<CommandProviderProps> = ({\n\tflipBookRef,\n\tcurrentPage: _currentPage,\n\ttotalPages: _totalPages,\n\tdirection = \"ltr\",\n\tcommands: customCommands = [],\n\tcommandOptions = {},\n\tdisableHotkeys = false,\n\tchildren,\n}) => {\n\tconst registry = useMemo<CommandRegistry>(() => {\n\t\tconst reg: CommandRegistry = {};\n\n\t\tfor (const cmd of defaultCommands) {\n\t\t\treg[cmd.id] = {\n\t\t\t\tcommand: cmd,\n\t\t\t\toptions: commandOptions[cmd.id] ?? {},\n\t\t\t};\n\t\t}\n\n\t\tfor (const cmd of customCommands) {\n\t\t\treg[cmd.id] = {\n\t\t\t\tcommand: cmd,\n\t\t\t\toptions: commandOptions[cmd.id] ?? {},\n\t\t\t};\n\t\t}\n\n\t\treturn reg;\n\t}, [customCommands, commandOptions]);\n\n\tconst createCommandContext = useCallback(\n\t\t(command: CommandDefinition, runData?: Record<string, unknown>): CommandCtx => {\n\t\t\tconst options = registry[command.id]?.options ?? {};\n\t\t\tconst data = runData ? { ...options.data, ...runData } : options.data;\n\t\t\treturn {\n\t\t\t\thandle: flipBookRef.current,\n\t\t\t\tdata,\n\t\t\t};\n\t\t},\n\t\t[flipBookRef, registry],\n\t);\n\n\tconst execute = useCallback(\n\t\t(command: CommandDefinition, runData?: Record<string, unknown>) => {\n\t\t\tconst ctx = createCommandContext(command, runData);\n\t\t\tif (command.canExecute && !command.canExecute(ctx)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcommand.execute(ctx);\n\t\t},\n\t\t[createCommandContext],\n\t);\n\n\tconst canExecute = useCallback(\n\t\t(command: CommandDefinition): boolean => {\n\t\t\tconst ctx = createCommandContext(command);\n\t\t\tif (!command.canExecute) return true;\n\t\t\treturn command.canExecute(ctx);\n\t\t},\n\t\t[createCommandContext],\n\t);\n\n\tconst getAllCommands = useCallback(\n\t\t(): CommandDefinition[] => Object.values(registry).map((e) => e.command),\n\t\t[registry],\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tconst target = event.target as HTMLElement;\n\t\t\tif (target.tagName === \"INPUT\" || target.tagName === \"TEXTAREA\" || target.isContentEditable) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (const entry of Object.values(registry)) {\n\t\t\t\tif (entry.options.disableHotkeys) continue;\n\n\t\t\t\tconst hotkeys = entry.options.hotkeys ?? entry.command.hotkeys ?? [];\n\t\t\t\tfor (const binding of hotkeys) {\n\t\t\t\t\tif (hotkeyMatches(binding, event, direction)) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\texecute(entry.command);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[registry, execute, direction],\n\t);\n\n\tuseEffect(() => {\n\t\tif (disableHotkeys) return;\n\n\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\treturn () => document.removeEventListener(\"keydown\", handleKeyDown);\n\t}, [disableHotkeys, handleKeyDown]);\n\n\tconst value = useMemo<CommandsContextValue>(\n\t\t() => ({\n\t\t\texecute,\n\t\t\tcanExecute,\n\t\t\tgetAllCommands,\n\t\t}),\n\t\t[execute, canExecute, getAllCommands],\n\t);\n\n\treturn <CommandsContext.Provider value={value}>{children}</CommandsContext.Provider>;\n};\n\nexport const useCommands = (): CommandsContextValue => {\n\tconst ctx = useContext(CommandsContext);\n\tif (!ctx) {\n\t\tthrow new Error(\"useCommands must be used within a CommandProvider\");\n\t}\n\treturn ctx;\n};\n","/**\n * Icon components for the flipbook toolbar.\n * All icons use currentColor for stroke, making them themeable.\n */\nimport type React from \"react\";\n\ninterface IconProps {\n\t/** Icon size in pixels. Default: 24 */\n\tsize?: number;\n\t/** Additional CSS class */\n\tclassName?: string;\n}\n\nconst defaultProps: IconProps = { size: 24 };\n\nexport const ChevronLeftIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"m15 18-6-6 6-6\" />\n\t</svg>\n);\n\nexport const ChevronRightIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"m9 18 6-6-6-6\" />\n\t</svg>\n);\n\nexport const ChevronFirstIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"m17 18-6-6 6-6\" />\n\t\t<path d=\"M7 6v12\" />\n\t</svg>\n);\n\nexport const ChevronLastIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"m7 18 6-6-6-6\" />\n\t\t<path d=\"M17 6v12\" />\n\t</svg>\n);\n\nexport const MaximizeIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M8 3H5a2 2 0 0 0-2 2v3\" />\n\t\t<path d=\"M21 8V5a2 2 0 0 0-2-2h-3\" />\n\t\t<path d=\"M3 16v3a2 2 0 0 0 2 2h3\" />\n\t\t<path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />\n\t</svg>\n);\n\nexport const MinimizeIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M8 3v3a2 2 0 0 1-2 2H3\" />\n\t\t<path d=\"M21 8h-3a2 2 0 0 1-2-2V3\" />\n\t\t<path d=\"M3 16h3a2 2 0 0 1 2 2v3\" />\n\t\t<path d=\"M16 21v-3a2 2 0 0 1 2-2h3\" />\n\t</svg>\n);\n\nexport const TableOfContentsIcon: React.FC<IconProps> = ({\n\tsize = defaultProps.size,\n\tclassName,\n}) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M16 5H3\" />\n\t\t<path d=\"M16 12H3\" />\n\t\t<path d=\"M16 19H3\" />\n\t\t<path d=\"M21 5h.01\" />\n\t\t<path d=\"M21 12h.01\" />\n\t\t<path d=\"M21 19h.01\" />\n\t</svg>\n);\n\nexport const BookshelfIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t{/* Shelf */}\n\t\t<path d=\"M3 21h18\" />\n\t\t{/* Books */}\n\t\t<rect x=\"4\" y=\"7\" width=\"3\" height=\"14\" rx=\"0.5\" />\n\t\t<rect x=\"8\" y=\"5\" width=\"3\" height=\"16\" rx=\"0.5\" />\n\t\t<rect x=\"12\" y=\"9\" width=\"3\" height=\"12\" rx=\"0.5\" />\n\t\t<rect x=\"16\" y=\"6\" width=\"4\" height=\"15\" rx=\"0.5\" />\n\t</svg>\n);\n\nexport const DownloadIcon: React.FC<IconProps> = ({ size = defaultProps.size, className }) => (\n\t<svg\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\twidth={size}\n\t\theight={size}\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\tclassName={className}\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n\t\t<polyline points=\"7 10 12 15 17 10\" />\n\t\t<line x1=\"12\" x2=\"12\" y1=\"15\" y2=\"3\" />\n\t</svg>\n);\n\nexport type { IconProps };\n","import type React from \"react\";\n\ninterface ToolbarButtonProps {\n\t/** Click handler */\n\tonClick: () => void;\n\t/** Accessible label for the button */\n\tariaLabel: string;\n\t/** Toggle state for mode buttons. */\n\tariaPressed?: boolean;\n\t/** Whether the button is disabled */\n\tdisabled?: boolean;\n\t/** Button content (icon or text) */\n\tchildren: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n\t/** Title tooltip */\n\ttitle?: string;\n}\n\n/**\n * Base button component for toolbar actions.\n */\nconst ToolbarButton: React.FC<ToolbarButtonProps> = ({\n\tonClick,\n\tariaLabel,\n\tariaPressed,\n\tdisabled = false,\n\tchildren,\n\tclassName = \"\",\n\ttitle,\n}) => {\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonClick={onClick}\n\t\t\taria-label={ariaLabel}\n\t\t\taria-pressed={ariaPressed}\n\t\t\tdisabled={disabled}\n\t\t\ttitle={title ?? ariaLabel}\n\t\t\tclassName={`flipbook-toolbar-button ${className}`.trim()}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n};\n\nexport { ToolbarButton };\nexport type { ToolbarButtonProps };\n","import type React from \"react\";\nimport { ToolbarButton } from \"./ToolbarButton\";\n\ninterface ActionButtonProps {\n\t/** Click handler for custom action */\n\tonClick: () => void;\n\t/** ARIA label for accessibility */\n\tariaLabel: string;\n\t/** Custom content (icon or text) */\n\tchildren: React.ReactNode;\n\t/** Whether the button is disabled */\n\tdisabled?: boolean;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Generic toolbar button for custom actions.\n * Use this for actions that aren't standard flipbook navigation.\n */\nconst ActionButton: React.FC<ActionButtonProps> = ({\n\tonClick,\n\tariaLabel,\n\tchildren,\n\tdisabled = false,\n\tclassName,\n}) => {\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={onClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\tdisabled={disabled}\n\t\t\tclassName={`flipbook-toolbar-action ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { ActionButton };\nexport type { ActionButtonProps };\n","import { ToolbarButton } from \"./ToolbarButton\";\n\nexport interface BookmarkToggleButtonProps {\n\t/** Current consumer-controlled bookmark visibility. */\n\tenabled: boolean;\n\t/** Update the book's enableBookmarks prop without changing its navigation state. */\n\tonChange: (enabled: boolean) => void;\n\tariaLabel?: string;\n\tclassName?: string;\n}\n\n/** An opt-in bookmark visibility control for a consumer's toolbar. */\nexport const BookmarkToggleButton = ({\n\tenabled,\n\tonChange,\n\tariaLabel,\n\tclassName,\n}: BookmarkToggleButtonProps) => (\n\t<ToolbarButton\n\t\tonClick={() => onChange(!enabled)}\n\t\tariaLabel={ariaLabel ?? (enabled ? \"Hide bookmarks\" : \"Show bookmarks\")}\n\t\tariaPressed={enabled}\n\t\tclassName={`flipbook-toolbar-bookmarks ${className ?? \"\"}`.trim()}\n\t>\n\t\t<svg width=\"18\" height=\"18\" viewBox=\"0 0 20 20\" aria-hidden=\"true\" focusable=\"false\">\n\t\t\t<path\n\t\t\t\td=\"M5 2.5h10v15l-5-3-5 3z\"\n\t\t\t\tfill={enabled ? \"currentColor\" : \"none\"}\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth=\"1.5\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t/>\n\t\t</svg>\n\t</ToolbarButton>\n);\n","const r = {\n align: \"left\",\n direction: \"ltr\",\n translations: {\n \"toolbarItem.download\": \"Download\",\n \"toolbarItem.downloadPageRange\": \"Download page range…\",\n \"toolbarItem.download.from\": \"From\",\n \"toolbarItem.download.to\": \"To\",\n \"toolbarItem.download.download\": \"Download\",\n \"command.downloadEntireBook\": \"Download entire book\",\n \"command.jumpToToc\": \"Table of contents\",\n \"command.jumpToFirstPage\": \"First page\",\n \"command.jumpToLastPage\": \"Last page\",\n \"command.jumpToPrevPage\": \"Previous page\",\n \"command.jumpToNextPage\": \"Next page\",\n \"command.toggleFullscreen\": \"Toggle fullscreen\",\n \"command.toggleFullscreenDesc\": \"Enter or exit fullscreen mode\",\n \"command.toggleDebug\": \"Toggle debug toolbar\",\n \"command.toggleDebugDesc\": \"Show or hide the debug toolbar (Ctrl+Alt+D)\",\n \"toolbarItem.goToPage\": \"Go to page\",\n \"toolbarItem.selectText\": \"Select text with mouse\",\n \"toolbarItem.selectionLetters\": \"Aa\"\n }\n}, d = {\n align: \"right\",\n direction: \"rtl\",\n translations: {\n \"toolbarItem.download\": \"הורדה\",\n \"toolbarItem.downloadPageRange\": \"הורד טווח עמודים…\",\n \"toolbarItem.download.from\": \"מ\",\n \"toolbarItem.download.to\": \"עד\",\n \"toolbarItem.download.download\": \"הורד\",\n \"command.downloadEntireBook\": \"הורד את כל הספר\",\n \"command.jumpToToc\": \"תוכן העניינים\",\n \"command.jumpToFirstPage\": \"עמוד ראשון\",\n \"command.jumpToLastPage\": \"עמוד אחרון\",\n \"command.jumpToPrevPage\": \"עמוד קודם\",\n \"command.jumpToNextPage\": \"עמוד הבא\",\n \"command.toggleFullscreen\": \"מסך מלא\",\n \"command.toggleFullscreenDesc\": \"כניסה או יציאה ממסך מלא\",\n \"command.toggleDebug\": \"סרגל כלים לדיבוג\",\n \"command.toggleDebugDesc\": \"הצג או הסתר סרגל הדיבוג (Ctrl+Alt+D)\",\n \"toolbarItem.goToPage\": \"מעבר לעמוד\",\n \"toolbarItem.selectText\": \"בחירת טקסט עם העכבר\",\n \"toolbarItem.selectionLetters\": \"אב\"\n }\n}, a = {\n \"en-US\": r,\n \"he-IL\": d\n}, n = \"en-US\", g = {\n \"toolbarItem.download\": \"Download\",\n \"toolbarItem.downloadPageRange\": \"Download page range…\",\n \"toolbarItem.download.from\": \"From\",\n \"toolbarItem.download.to\": \"To\",\n \"toolbarItem.download.download\": \"Download\",\n \"command.downloadEntireBook\": \"Download entire book\",\n \"command.jumpToToc\": \"Table of contents\",\n \"command.jumpToFirstPage\": \"First page\",\n \"command.jumpToLastPage\": \"Last page\",\n \"command.jumpToPrevPage\": \"Previous page\",\n \"command.jumpToNextPage\": \"Next page\",\n \"command.toggleFullscreen\": \"Toggle fullscreen\",\n \"command.toggleFullscreenDesc\": \"Enter or exit fullscreen mode\",\n \"command.toggleDebug\": \"Toggle debug toolbar\",\n \"command.toggleDebugDesc\": \"Show or hide the debug toolbar (Ctrl+Alt+D)\",\n \"toolbarItem.goToPage\": \"Go to page\"\n};\nfunction l(o) {\n return a[o] ?? a[n];\n}\nfunction c(o) {\n return l(o).direction === \"rtl\";\n}\nfunction u(o) {\n return c(o) ? \"rtl\" : \"ltr\";\n}\nfunction i(o, m) {\n const e = l(m).translations[o];\n if (e !== void 0 && e !== \"\") return e;\n const t = a[n].translations[o];\n return t !== void 0 && t !== \"\" ? t : g[o] ?? o;\n}\nexport {\n n as defaultLocale,\n u as directionFromLocale,\n l as getConfig,\n c as isRtl,\n i as t\n};\n//# sourceMappingURL=intl.js.map\n","import type React from \"react\";\nimport { createContext, useContext } from \"react\";\nimport type { FlipBookHandle, MouseMode, PageSemantics } from \"../FlipBook\";\nimport type { Locale } from \"../i18n\";\n\ninterface ToolbarContextValue {\n\tflipBookRef: React.RefObject<FlipBookHandle | null>;\n\tdirection: \"ltr\" | \"rtl\";\n\t/** Locale for UI strings (toolbar, download menu). Defaults to en-US. */\n\tlocale: Locale;\n\tpageSemantics?: PageSemantics;\n\tcurrentPage: number;\n\ttotalPages: number;\n\t/** \"Of\" value from the book (for page indicator). Sourced from FlipBook ref. */\n\tof: string | number;\n\tisFirstPage: boolean;\n\tisLastPage: boolean;\n\tmouseMode: MouseMode;\n\t/** Ref used by openDownloadMenu command (Ctrl+S) to open the download dropdown. DownloadDropdown sets this. */\n\topenDownloadMenuRef: React.MutableRefObject<(() => void) | null>;\n\t/** Ref set by DownloadDropdown: (from?, to?) => void to run download (entire book or range). Used by download command. */\n\tdownloadExecutorRef: React.MutableRefObject<((from?: number, to?: number) => void) | null>;\n\t/** When set (via Toolbar fullscreenTargetRef), fullscreen targets this container (e.g. sefer + toolbar). */\n\tfullscreenTargetRef?: React.RefObject<HTMLElement | null>;\n}\n\nconst ToolbarContext = createContext<ToolbarContextValue | null>(null);\n\nexport function useToolbar(): ToolbarContextValue {\n\tconst context = useContext(ToolbarContext);\n\tif (!context) {\n\t\tthrow new Error(\"Toolbar components must be used within a Toolbar\");\n\t}\n\treturn context;\n}\n\nexport { ToolbarContext };\nexport type { ToolbarContextValue };\n","import type React from \"react\";\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport type { SemanticPageInfo } from \"../download/types\";\nimport { isRtl, t } from \"../i18n\";\nimport { DownloadIcon } from \"../icons\";\nimport { useToolbar } from \"./ToolbarContext\";\nimport \"./DownloadDropdown.css\";\n\n/** Strip Hebrew punctuation (geresh, gershaim) from a name for use in filenames. */\nfunction sanitizeForFilename(name: string): string {\n\treturn name.replace(/[׳'״\"]/g, \"\");\n}\n\nfunction triggerDownload(result: { ext: string; data: string }, filenameBase: string): void {\n\ttry {\n\t\tconst binary = atob(result.data);\n\t\tconst bytes = new Uint8Array(binary.length);\n\t\tfor (let i = 0; i < binary.length; i++) {\n\t\t\tbytes[i] = binary.charCodeAt(i);\n\t\t}\n\t\tconst blob = new Blob([bytes]);\n\t\tconst url = URL.createObjectURL(blob);\n\t\tconst a = document.createElement(\"a\");\n\t\ta.href = url;\n\t\ta.download = `${filenameBase}.${result.ext}`;\n\t\ta.click();\n\t\tURL.revokeObjectURL(url);\n\t} catch (e) {\n\t\tconsole.error(\"Download failed:\", e);\n\t}\n}\n\n/** Collect pages that have a semantic name for range selector options.\n * Pages without a semantic name (covers, blanks, TOC) are excluded. */\nfunction getSelectablePages(\n\ttotalPages: number,\n\tpageSemantics?: {\n\t\tindexToSemanticName: (i: number) => string;\n\t\tindexToTitle: (i: number) => string;\n\t},\n): SemanticPageInfo[] {\n\tconst list: SemanticPageInfo[] = [];\n\tfor (let i = 0; i < totalPages; i++) {\n\t\tconst semanticName = pageSemantics?.indexToSemanticName(i) ?? \"\";\n\t\tconst title = pageSemantics?.indexToTitle(i) ?? \"\";\n\t\t// Only include pages with a real semantic identity\n\t\tif (!semanticName && !title) {\n\t\t\t// No semantics at all — fall back to 1-based index only when\n\t\t\t// no pageSemantics provider exists (plain book without metadata).\n\t\t\tif (!pageSemantics) {\n\t\t\t\tlist.push({ pageIndex: i, semanticName: String(i + 1), title: `Page ${i + 1}` });\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tlist.push({\n\t\t\tpageIndex: i,\n\t\t\tsemanticName: semanticName || String(i + 1),\n\t\t\ttitle: title || semanticName,\n\t\t});\n\t}\n\treturn list;\n}\n\nexport interface DownloadDropdownProps {\n\t/** Label for \"Download\" button. Default: \"Download\" */\n\tariaLabel?: string;\n\tclassName?: string;\n}\n\nconst DownloadDropdown: React.FC<DownloadDropdownProps> = ({\n\tariaLabel = \"Download\",\n\tclassName,\n}) => {\n\tconst {\n\t\ttotalPages,\n\t\tpageSemantics,\n\t\tlocale,\n\t\topenDownloadMenuRef,\n\t\tdownloadExecutorRef,\n\t\tflipBookRef,\n\t} = useToolbar();\n\tconst downloadConfig = flipBookRef.current?.getDownloadConfig?.() ?? undefined;\n\tconst [open, setOpen] = useState(false);\n\n\tuseEffect(() => {\n\t\topenDownloadMenuRef.current = () => setOpen(true);\n\t\treturn () => {\n\t\t\topenDownloadMenuRef.current = null;\n\t\t};\n\t}, [openDownloadMenuRef]);\n\ttype DownloadMode = \"entire\" | \"range\";\n\tconst [downloadMode, setDownloadMode] = useState<DownloadMode>(\"entire\");\n\tconst [fromIndex, setFromIndex] = useState(0);\n\tconst [toIndex, setToIndex] = useState(0);\n\tconst [loading, setLoading] = useState<\"sefer\" | \"range\" | null>(null);\n\tconst [openUp, setOpenUp] = useState(false);\n\tconst dropdownRef = useRef<HTMLDivElement>(null);\n\tconst menuRef = useRef<HTMLDivElement>(null);\n\n\tconst selectablePages = useMemo(\n\t\t() => getSelectablePages(totalPages, pageSemantics),\n\t\t[totalPages, pageSemantics],\n\t);\n\n\tconst hasSefer = Boolean(downloadConfig?.onDownloadSefer);\n\tconst hasRange = Boolean(downloadConfig?.onDownloadPageRange);\n\tconst showDropdown = hasSefer || hasRange;\n\n\t// Pre-compute primitive values from the memoised list so the effect deps stay stable\n\tconst firstSelectablePage = selectablePages[0]?.pageIndex ?? 0;\n\tconst lastSelectablePage = selectablePages[selectablePages.length - 1]?.pageIndex ?? 0;\n\n\t// When opening, default mode to \"entire\" if available, else \"range\"; init range to first/last selectable page\n\tuseEffect(() => {\n\t\tif (!open) return;\n\t\tsetDownloadMode(hasSefer ? \"entire\" : \"range\");\n\t\tsetFromIndex(firstSelectablePage);\n\t\tsetToIndex(lastSelectablePage);\n\t}, [open, hasSefer, firstSelectablePage, lastSelectablePage]);\n\n\tconst closeDropdown = useCallback(() => {\n\t\tsetOpen(false);\n\t}, []);\n\n\t// Anchor to the trigger while keeping both axes inside the viewport, including scrolled toolbars.\n\tuseLayoutEffect(() => {\n\t\tif (!open || !menuRef.current || !dropdownRef.current) return;\n\t\tconst menu = menuRef.current;\n\t\tconst trigger = dropdownRef.current.querySelector(\".flipbook-toolbar-download-trigger\");\n\t\tconst updatePosition = () => {\n\t\t\tconst triggerRect = trigger?.getBoundingClientRect();\n\t\t\tif (!triggerRect) return;\n\t\t\tconst padding = 8;\n\t\t\tconst gap = 6;\n\t\t\tconst spaceBelow = window.innerHeight - triggerRect.bottom - gap - padding;\n\t\t\tconst spaceAbove = triggerRect.top - gap - padding;\n\t\t\tconst desiredHeight = Math.min(menu.scrollHeight, window.innerHeight * 0.7, 480);\n\t\t\tconst above = spaceBelow < desiredHeight && spaceAbove > spaceBelow;\n\t\t\tmenu.style.maxHeight = `${Math.max(0, Math.min(desiredHeight, above ? spaceAbove : spaceBelow))}px`;\n\t\t\tconst bounds = menu.getBoundingClientRect();\n\t\t\tconst left = isRtl(locale) ? triggerRect.left : triggerRect.right - bounds.width;\n\t\t\tmenu.style.left = `${Math.max(padding, Math.min(left, window.innerWidth - bounds.width - padding))}px`;\n\t\t\tconst top = above ? triggerRect.top - gap - bounds.height : triggerRect.bottom + gap;\n\t\t\tmenu.style.top = `${Math.max(padding, Math.min(top, window.innerHeight - bounds.height - padding))}px`;\n\t\t\tsetOpenUp(above);\n\t\t};\n\t\tupdatePosition();\n\t\tconst ro = new ResizeObserver(updatePosition);\n\t\tro.observe(menu);\n\t\tconst toolbar = dropdownRef.current.closest('[role=\"toolbar\"]');\n\t\tif (toolbar) ro.observe(toolbar);\n\t\twindow.addEventListener(\"resize\", updatePosition);\n\t\twindow.addEventListener(\"scroll\", updatePosition, true);\n\t\treturn () => {\n\t\t\tro.disconnect();\n\t\t\twindow.removeEventListener(\"resize\", updatePosition);\n\t\t\twindow.removeEventListener(\"scroll\", updatePosition, true);\n\t\t};\n\t}, [open, locale]);\n\n\tuseEffect(() => {\n\t\tif (!open) return;\n\t\tconst handleClickOutside = (e: MouseEvent) => {\n\t\t\tif (dropdownRef.current && !dropdownRef.current.contains(e.target as Node)) {\n\t\t\t\tcloseDropdown();\n\t\t\t}\n\t\t};\n\t\tdocument.addEventListener(\"mousedown\", handleClickOutside);\n\t\treturn () => document.removeEventListener(\"mousedown\", handleClickOutside);\n\t}, [open, closeDropdown]);\n\n\tconst handleEntireBook = useCallback(async () => {\n\t\tconst config = flipBookRef.current?.getDownloadConfig?.();\n\t\tif (!config?.onDownloadSefer) return;\n\t\tsetLoading(\"sefer\");\n\t\ttry {\n\t\t\tconst result = await config.onDownloadSefer();\n\t\t\tif (result) triggerDownload(result, config.entireBookFilename ?? \"book\");\n\t\t\tcloseDropdown();\n\t\t} finally {\n\t\t\tsetLoading(null);\n\t\t}\n\t}, [flipBookRef, closeDropdown]);\n\n\tconst runRangeDownload = useCallback(\n\t\tasync (from: number, to: number) => {\n\t\t\tconst config = flipBookRef.current?.getDownloadConfig?.();\n\t\t\tif (!config?.onDownloadPageRange) return;\n\t\t\tconst pages: number[] = [];\n\t\t\tconst semanticPages: SemanticPageInfo[] = [];\n\t\t\tfor (let i = from; i <= to; i++) {\n\t\t\t\tpages.push(i);\n\t\t\t\tconst info = selectablePages.find((sp) => sp.pageIndex === i);\n\t\t\t\tif (info) semanticPages.push(info);\n\t\t\t}\n\t\t\tsetLoading(\"range\");\n\t\t\ttry {\n\t\t\t\tconst result = await config.onDownloadPageRange(\n\t\t\t\t\tpages,\n\t\t\t\t\tsemanticPages,\n\t\t\t\t\tconfig.downloadContext,\n\t\t\t\t);\n\t\t\t\tif (result) {\n\t\t\t\t\tconst fromName = sanitizeForFilename(semanticPages[0]?.semanticName ?? String(from));\n\t\t\t\t\tconst toName = sanitizeForFilename(\n\t\t\t\t\t\tsemanticPages[semanticPages.length - 1]?.semanticName ?? String(to),\n\t\t\t\t\t);\n\t\t\t\t\ttriggerDownload(result, `${config.rangeFilename ?? \"pages\"}-${fromName}-${toName}`);\n\t\t\t\t}\n\t\t\t\tcloseDropdown();\n\t\t\t} finally {\n\t\t\t\tsetLoading(null);\n\t\t\t}\n\t\t},\n\t\t[flipBookRef, selectablePages, closeDropdown],\n\t);\n\n\tuseEffect(() => {\n\t\tdownloadExecutorRef.current = (from?: number, to?: number) => {\n\t\t\tif (from === undefined && to === undefined) {\n\t\t\t\tvoid handleEntireBook();\n\t\t\t} else if (from !== undefined && to !== undefined) {\n\t\t\t\tvoid runRangeDownload(from, to);\n\t\t\t}\n\t\t};\n\t\treturn () => {\n\t\t\tdownloadExecutorRef.current = null;\n\t\t};\n\t}, [downloadExecutorRef, handleEntireBook, runRangeDownload]);\n\n\tif (!showDropdown) return null;\n\n\treturn (\n\t\t<div className={`flipbook-toolbar-download-wrap ${className ?? \"\"}`.trim()} ref={dropdownRef}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"flipbook-toolbar-button flipbook-toolbar-download-trigger\"\n\t\t\t\tonClick={() => setOpen((o) => !o)}\n\t\t\t\taria-label={ariaLabel ?? t(\"toolbarItem.download\", locale)}\n\t\t\t\taria-expanded={open}\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\tdisabled={loading !== null}\n\t\t\t>\n\t\t\t\t<DownloadIcon size={18} />\n\t\t\t</button>\n\t\t\t{open && (\n\t\t\t\t<div\n\t\t\t\t\tref={menuRef}\n\t\t\t\t\tclassName={`flipbook-toolbar-download-menu ${openUp ? \"flipbook-toolbar-download-menu--open-up\" : \"\"}`.trim()}\n\t\t\t\t\trole=\"menu\"\n\t\t\t\t\tdir={isRtl(locale) ? \"rtl\" : \"ltr\"}\n\t\t\t\t>\n\t\t\t\t\t<fieldset\n\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-mode\"\n\t\t\t\t\t\taria-label={t(\"toolbarItem.download\", locale)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{hasSefer && (\n\t\t\t\t\t\t\t<label className=\"flipbook-toolbar-download-radio-label\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\tname=\"download-mode\"\n\t\t\t\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-radio\"\n\t\t\t\t\t\t\t\t\tchecked={downloadMode === \"entire\"}\n\t\t\t\t\t\t\t\t\tonChange={() => setDownloadMode(\"entire\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<span>{t(\"command.downloadEntireBook\", locale)}</span>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{hasRange && (\n\t\t\t\t\t\t\t<label className=\"flipbook-toolbar-download-radio-label\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\tname=\"download-mode\"\n\t\t\t\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-radio\"\n\t\t\t\t\t\t\t\t\tchecked={downloadMode === \"range\"}\n\t\t\t\t\t\t\t\t\tonChange={() => setDownloadMode(\"range\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<span>{t(\"toolbarItem.downloadPageRange\", locale)}</span>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</fieldset>\n\t\t\t\t\t{downloadMode === \"range\" && (\n\t\t\t\t\t\t<div className=\"flipbook-toolbar-download-range\">\n\t\t\t\t\t\t\t<label className=\"flipbook-toolbar-download-range-label\">\n\t\t\t\t\t\t\t\t{t(\"toolbarItem.download.from\", locale)}\n\t\t\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t\t\tvalue={fromIndex}\n\t\t\t\t\t\t\t\t\tonChange={(e) => setFromIndex(Number(e.target.value))}\n\t\t\t\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-range-select\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{selectablePages.map((p) => (\n\t\t\t\t\t\t\t\t\t\t<option key={p.pageIndex} value={p.pageIndex}>\n\t\t\t\t\t\t\t\t\t\t\t{p.semanticName || p.title || `Page ${p.pageIndex + 1}`}\n\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t<label className=\"flipbook-toolbar-download-range-label\">\n\t\t\t\t\t\t\t\t{t(\"toolbarItem.download.to\", locale)}\n\t\t\t\t\t\t\t\t<select\n\t\t\t\t\t\t\t\t\tvalue={toIndex}\n\t\t\t\t\t\t\t\t\tonChange={(e) => setToIndex(Number(e.target.value))}\n\t\t\t\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-range-select\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{selectablePages.map((p) => (\n\t\t\t\t\t\t\t\t\t\t<option key={p.pageIndex} value={p.pageIndex}>\n\t\t\t\t\t\t\t\t\t\t\t{p.semanticName || p.title || `Page ${p.pageIndex + 1}`}\n\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\tclassName=\"flipbook-toolbar-download-menuitem flipbook-toolbar-download-primary\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tif (downloadMode === \"entire\") {\n\t\t\t\t\t\t\t\tvoid handleEntireBook();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst total = flipBookRef.current?.getTotalPages?.() ?? totalPages;\n\t\t\t\t\t\t\t\tconst from = Math.min(fromIndex, toIndex);\n\t\t\t\t\t\t\t\tlet to = Math.max(fromIndex, toIndex);\n\t\t\t\t\t\t\t\tif (total > 0 && to >= total) to = total - 1;\n\t\t\t\t\t\t\t\tif (to < from) return;\n\t\t\t\t\t\t\t\tvoid runRangeDownload(from, to);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisabled={loading !== null}\n\t\t\t\t\t>\n\t\t\t\t\t\t{loading === \"sefer\"\n\t\t\t\t\t\t\t? \"…\"\n\t\t\t\t\t\t\t: loading === \"range\"\n\t\t\t\t\t\t\t\t? \"…\"\n\t\t\t\t\t\t\t\t: t(\"toolbarItem.download.download\", locale)}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport { DownloadDropdown };\n","import { goToFirstCommand } from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { useCommands } from \"../commands/CommandContext\";\nimport { t } from \"../i18n\";\nimport { ChevronFirstIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface FirstPageButtonProps {\n\t/** Custom content (icon or text). Defaults to ChevronFirstIcon */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to navigate to the first page. Same behavior in LTR and RTL.\n * Visual mirroring is handled by CSS (dir=\"rtl\" + icon flip).\n */\nconst FirstPageButton: React.FC<FirstPageButtonProps> = ({ children, className }) => {\n\tconst { locale } = useToolbar();\n\tconst { execute, canExecute } = useCommands();\n\n\tconst handleClick = () => {\n\t\texecute(goToFirstCommand);\n\t};\n\n\tconst defaultIcon = <ChevronFirstIcon size={18} />;\n\tconst ariaLabel = t(\"command.jumpToFirstPage\", locale);\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\ttitle={ariaLabel}\n\t\t\tdisabled={!canExecute(goToFirstCommand)}\n\t\t\tclassName={`flipbook-toolbar-first ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? defaultIcon}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { FirstPageButton };\nexport type { FirstPageButtonProps };\n","import type React from \"react\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { MaximizeIcon, MinimizeIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface FullscreenButtonProps {\n\t/** Target element to make fullscreen. If not provided, uses Toolbar's fullscreenTargetRef or document.documentElement */\n\ttargetRef?: React.RefObject<HTMLElement | null>;\n\t/** Custom content for enter fullscreen. Defaults to MaximizeIcon */\n\tenterIcon?: React.ReactNode;\n\t/** Custom content for exit fullscreen. Defaults to MinimizeIcon */\n\texitIcon?: React.ReactNode;\n\t/** ARIA label for entering fullscreen. Defaults to \"Enter fullscreen\" */\n\tariaLabelEnter?: string;\n\t/** ARIA label for exiting fullscreen. Defaults to \"Exit fullscreen\" */\n\tariaLabelExit?: string;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to toggle fullscreen mode.\n */\nconst FullscreenButton: React.FC<FullscreenButtonProps> = ({\n\ttargetRef: targetRefProp,\n\tenterIcon,\n\texitIcon,\n\tariaLabelEnter = \"Enter fullscreen\",\n\tariaLabelExit = \"Exit fullscreen\",\n\tclassName,\n}) => {\n\tconst [isFullscreen, setIsFullscreen] = useState(false);\n\tconst toolbar = useToolbar();\n\tconst targetRef = targetRefProp ?? toolbar.fullscreenTargetRef;\n\n\t// Check fullscreen state\n\tconst updateFullscreenState = useCallback(() => {\n\t\tsetIsFullscreen(!!document.fullscreenElement);\n\t}, []);\n\n\tuseEffect(() => {\n\t\tdocument.addEventListener(\"fullscreenchange\", updateFullscreenState);\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"fullscreenchange\", updateFullscreenState);\n\t\t};\n\t}, [updateFullscreenState]);\n\n\tconst handleClick = async () => {\n\t\ttry {\n\t\t\tif (isFullscreen) {\n\t\t\t\tawait document.exitFullscreen();\n\t\t\t} else {\n\t\t\t\tconst target = targetRef?.current ?? document.documentElement;\n\t\t\t\tawait target.requestFullscreen();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"Fullscreen request failed:\", error);\n\t\t}\n\t};\n\n\tconst label = isFullscreen ? ariaLabelExit : ariaLabelEnter;\n\tconst icon = isFullscreen\n\t\t? (exitIcon ?? <MinimizeIcon size={18} />)\n\t\t: (enterIcon ?? <MaximizeIcon size={18} />);\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={label}\n\t\t\tclassName={`flipbook-toolbar-fullscreen ${isFullscreen ? \"flipbook-toolbar-fullscreen--active\" : \"\"} ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{icon}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { FullscreenButton };\nexport type { FullscreenButtonProps };\n","import { goToLastCommand } from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { useCommands } from \"../commands/CommandContext\";\nimport { t } from \"../i18n\";\nimport { ChevronLastIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface LastPageButtonProps {\n\t/** Custom content (icon or text). Defaults to ChevronLastIcon */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to navigate to the last page. Same behavior in LTR and RTL.\n * Visual mirroring is handled by CSS (dir=\"rtl\" + icon flip).\n */\nconst LastPageButton: React.FC<LastPageButtonProps> = ({ children, className }) => {\n\tconst { locale } = useToolbar();\n\tconst { execute, canExecute } = useCommands();\n\n\tconst handleClick = () => {\n\t\texecute(goToLastCommand);\n\t};\n\n\tconst defaultIcon = <ChevronLastIcon size={18} />;\n\tconst ariaLabel = t(\"command.jumpToLastPage\", locale);\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\ttitle={ariaLabel}\n\t\t\tdisabled={!canExecute(goToLastCommand)}\n\t\t\tclassName={`flipbook-toolbar-last ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? defaultIcon}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { LastPageButton };\nexport type { LastPageButtonProps };\n","import type React from \"react\";\nimport { t } from \"../i18n\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\nexport interface MouseModeButtonProps {\n\t/** Override the locale's letters shown beside the text caret. */\n\tletters?: string;\n\t/** Override the localized accessible label. */\n\tariaLabel?: string;\n\tclassName?: string;\n}\n\n/** Switch mouse dragging between native page turning and text selection. */\nexport const MouseModeButton: React.FC<MouseModeButtonProps> = ({\n\tletters,\n\tariaLabel,\n\tclassName,\n}) => {\n\tconst { flipBookRef, locale, mouseMode } = useToolbar();\n\tconst label = ariaLabel ?? t(\"toolbarItem.selectText\", locale);\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={() => {\n\t\t\t\tflipBookRef.current?.setMouseMode(mouseMode === \"turn\" ? \"select\" : \"turn\");\n\t\t\t\twindow.getSelection()?.removeAllRanges();\n\t\t\t}}\n\t\t\tariaLabel={label}\n\t\t\tariaPressed={mouseMode === \"select\"}\n\t\t\tclassName={`flipbook-toolbar-mouse-mode ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t<span className=\"flipbook-toolbar-mouse-mode-icon\" aria-hidden=\"true\">\n\t\t\t\t<span className=\"flipbook-toolbar-mouse-mode-caret\" />\n\t\t\t\t<span>{letters ?? t(\"toolbarItem.selectionLetters\", locale)}</span>\n\t\t\t</span>\n\t\t</ToolbarButton>\n\t);\n};\n","import { flipNextCommand } from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { useCommands } from \"../commands/CommandContext\";\nimport { t } from \"../i18n\";\nimport { ChevronRightIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface NextButtonProps {\n\t/** Custom content (icon or text). Defaults to ChevronRightIcon */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button: next page. Same behavior in LTR and RTL.\n * Visual mirroring is handled by CSS (dir=\"rtl\" + icon flip).\n */\nconst NextButton: React.FC<NextButtonProps> = ({ children, className }) => {\n\tconst { locale } = useToolbar();\n\tconst { execute, canExecute } = useCommands();\n\n\tconst handleClick = () => {\n\t\texecute(flipNextCommand);\n\t};\n\n\tconst ariaLabel = t(\"command.jumpToNextPage\", locale);\n\tconst defaultIcon = <ChevronRightIcon size={20} />;\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\ttitle={ariaLabel}\n\t\t\tdisabled={!canExecute(flipNextCommand)}\n\t\t\tclassName={`flipbook-toolbar-next ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? defaultIcon}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { NextButton };\nexport type { NextButtonProps };\n","import type React from \"react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ntype PageIndicatorMode = \"semantic\" | \"index\";\n\ninterface PageIndicatorProps {\n\t/**\n\t * Display mode:\n\t * - \"semantic\": uses pageSemantics to show semantic names (e.g., \"א\", \"ב\")\n\t * - \"index\": shows 1-based page numbers\n\t * Defaults to \"semantic\" if pageSemantics is available, otherwise \"index\".\n\t */\n\tmode?: PageIndicatorMode;\n\t/** Whether to show \"/ total\" after the current page(s). Defaults to true. */\n\tshowTotal?: boolean;\n\t/** Placeholder when current page has no semantic name (semantic mode only) */\n\tplaceholder?: string;\n\t/** Whether the input is editable for navigation. Defaults to true in semantic mode. */\n\teditable?: boolean;\n\t/** Additional CSS class name */\n\tclassName?: string;\n\t/** Input aria-label for accessibility */\n\tariaLabel?: string;\n\t/** Maximum input length */\n\tmaxLength?: number;\n}\n\n/**\n * Displays the current page position with support for semantic names or indices.\n * Shows a range when a spread is visible (e.g., \"א - ב\" or \"1 - 2\").\n * Direction-aware: RTL shows right-left, LTR shows left-right.\n * When both pages have the same semantic name, shows scalar (no range).\n */\nconst PageIndicator: React.FC<PageIndicatorProps> = ({\n\tmode: modeProp,\n\tshowTotal = true,\n\tplaceholder = \"—\",\n\teditable: editableProp,\n\tclassName,\n\tariaLabel = \"Go to page\",\n\tmaxLength = 10,\n}) => {\n\tconst { flipBookRef, pageSemantics, direction, currentPage, totalPages, of } = useToolbar();\n\n\t// Determine effective mode\n\tconst mode: PageIndicatorMode = modeProp ?? (pageSemantics ? \"semantic\" : \"index\");\n\tconst editable = editableProp ?? (mode === \"semantic\" && !!pageSemantics);\n\n\tconst [inputValue, setInputValue] = useState(\"\");\n\tconst [isEditing, setIsEditing] = useState(false);\n\t// Ref-only flag: prevents handleBlur from reverting inputValue to a stale\n\t// displayText during the brief gap before Toolbar polling updates currentPage.\n\t// Cleared synchronously once the page actually changes.\n\tconst justNavigatedRef = useRef(false);\n\tconst prevCurrentPageRef = useRef(currentPage);\n\n\t// Calculate the spread pages (current page and its facing page)\n\tconst leftPageIndex = currentPage;\n\tconst rightPageIndex = currentPage + 1 < totalPages ? currentPage + 1 : null;\n\n\t// Get display names for pages\n\tconst getPageName = useCallback(\n\t\t(pageIndex: number): string => {\n\t\t\tif (mode === \"semantic\" && pageSemantics) {\n\t\t\t\treturn pageSemantics.indexToSemanticName(pageIndex) || \"\";\n\t\t\t}\n\t\t\treturn String(pageIndex + 1); // 1-based for display\n\t\t},\n\t\t[mode, pageSemantics],\n\t);\n\n\tconst leftName = getPageName(leftPageIndex);\n\tconst rightName = rightPageIndex != null ? getPageName(rightPageIndex) : \"\";\n\n\t// \"Of\" comes from the book (via context); default is total pages count\n\tconst getTotalDisplay = useCallback((): string => String(of), [of]);\n\n\t// Build display text for the range (always left physical page then right, e.g. י\"א - י\"ב)\n\tconst buildDisplayText = useCallback((): string => {\n\t\tconst firstName = leftName;\n\t\tconst secondName = rightName;\n\n\t\tlet rangeText: string;\n\t\tif (!firstName && !secondName) {\n\t\t\t// Both empty (e.g., cover pages)\n\t\t\trangeText = placeholder;\n\t\t} else if (!firstName) {\n\t\t\t// Only second has a name\n\t\t\trangeText = secondName;\n\t\t} else if (!secondName) {\n\t\t\t// Only first has a name\n\t\t\trangeText = firstName;\n\t\t} else if (firstName === secondName) {\n\t\t\t// Same name on both pages - show scalar\n\t\t\trangeText = firstName;\n\t\t} else {\n\t\t\t// Different names - show range\n\t\t\trangeText = `${firstName} - ${secondName}`;\n\t\t}\n\n\t\tif (showTotal) {\n\t\t\treturn `${rangeText} / ${getTotalDisplay()}`;\n\t\t}\n\t\treturn rangeText;\n\t}, [leftName, rightName, placeholder, showTotal, getTotalDisplay]);\n\n\t// The primary semantic name for editing (use left page in RTL reading order)\n\tconst primarySemanticName = direction === \"rtl\" ? rightName || leftName : leftName || rightName;\n\n\tconst displayText = buildDisplayText();\n\n\t// Sync input value when page changes and not editing.\n\t// After Enter navigation, justNavigatedRef prevents flashing the stale value;\n\t// once Toolbar polling updates currentPage, the flag is cleared and the\n\t// new displayText is applied. Because displayText includes the \" / total\"\n\t// suffix, it is always different from the user's typed value, guaranteeing\n\t// a state change that triggers a re-render.\n\tuseEffect(() => {\n\t\tconst pageChanged = currentPage !== prevCurrentPageRef.current;\n\t\tprevCurrentPageRef.current = currentPage;\n\n\t\tif (pageChanged) {\n\t\t\tjustNavigatedRef.current = false;\n\t\t}\n\t\tif (!isEditing && !justNavigatedRef.current) {\n\t\t\tsetInputValue(displayText);\n\t\t}\n\t}, [displayText, isEditing, currentPage]);\n\n\tconst handleFocus = useCallback(\n\t\t(e: React.FocusEvent<HTMLInputElement>) => {\n\t\t\tif (editable) {\n\t\t\t\tsetIsEditing(true);\n\t\t\t\tsetInputValue(primarySemanticName);\n\t\t\t\tjustNavigatedRef.current = false;\n\t\t\t\t// Select all text so the user can immediately type a replacement\n\t\t\t\tconst select = () => e.target.select();\n\t\t\t\ttypeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame(select) : select();\n\t\t\t}\n\t\t},\n\t\t[editable, primarySemanticName],\n\t);\n\n\tconst handleBlur = useCallback(() => {\n\t\tsetIsEditing(false);\n\t\t// After a successful Enter navigation, keep the user's typed value visible\n\t\t// until Toolbar polling updates currentPage with the new position.\n\t\tif (!justNavigatedRef.current) {\n\t\t\tsetInputValue(displayText);\n\t\t}\n\t}, [displayText]);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: React.KeyboardEvent<HTMLInputElement>) => {\n\t\t\tif (e.key === \"Enter\") {\n\t\t\t\t// Navigate on Enter\n\t\t\t\tif (pageSemantics && inputValue.trim()) {\n\t\t\t\t\tconst pageIndex = pageSemantics.semanticNameToIndex(inputValue.trim());\n\t\t\t\t\tif (pageIndex != null && pageIndex >= 0 && pageIndex < totalPages) {\n\t\t\t\t\t\tflipBookRef.current?.jumpToPage(pageIndex);\n\t\t\t\t\t\tjustNavigatedRef.current = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\te.currentTarget.blur();\n\t\t\t} else if (e.key === \"Escape\") {\n\t\t\t\t// Cancel editing\n\t\t\t\te.currentTarget.blur();\n\t\t\t}\n\t\t},\n\t\t[inputValue, pageSemantics, totalPages, flipBookRef],\n\t);\n\n\tconst handleChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\n\t\tsetInputValue(e.target.value);\n\t}, []);\n\n\t// Non-editable display (span)\n\tif (!editable) {\n\t\treturn (\n\t\t\t<span\n\t\t\t\tclassName={`flipbook-toolbar-indicator ${className ?? \"\"}`.trim()}\n\t\t\t\taria-live=\"polite\"\n\t\t\t\taria-atomic=\"true\"\n\t\t\t>\n\t\t\t\t{displayText}\n\t\t\t</span>\n\t\t);\n\t}\n\n\t// Editable input — always shows inputValue.\n\t// When not editing, useEffect keeps inputValue in sync with displayText.\n\t// During editing, inputValue holds the user's typed text.\n\t// After Enter navigation, inputValue keeps the typed value until polling\n\t// updates currentPage, at which point useEffect sets it to the new displayText.\n\tconst editingClass = isEditing ? \"flipbook-toolbar-indicator--editing\" : \"\";\n\treturn (\n\t\t<input\n\t\t\ttype=\"text\"\n\t\t\tclassName={`flipbook-toolbar-indicator ${editingClass} ${className ?? \"\"}`.trim()}\n\t\t\tvalue={inputValue}\n\t\t\tonFocus={handleFocus}\n\t\t\tonBlur={handleBlur}\n\t\t\tonKeyDown={handleKeyDown}\n\t\t\tonChange={handleChange}\n\t\t\taria-label={ariaLabel}\n\t\t\taria-live=\"polite\"\n\t\t\taria-atomic=\"true\"\n\t\t\tmaxLength={maxLength}\n\t\t\treadOnly={!editable}\n\t\t/>\n\t);\n};\n\nexport { PageIndicator };\nexport type { PageIndicatorProps, PageIndicatorMode };\n","import { flipPrevCommand } from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { useCommands } from \"../commands/CommandContext\";\nimport { t } from \"../i18n\";\nimport { ChevronLeftIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface PrevButtonProps {\n\t/** Custom content (icon or text). Defaults to ChevronLeftIcon */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button: previous page. Same behavior in LTR and RTL.\n * Visual mirroring is handled by CSS (dir=\"rtl\" + icon flip).\n */\nconst PrevButton: React.FC<PrevButtonProps> = ({ children, className }) => {\n\tconst { locale } = useToolbar();\n\tconst { execute, canExecute } = useCommands();\n\n\tconst handleClick = () => {\n\t\texecute(flipPrevCommand);\n\t};\n\n\tconst ariaLabel = t(\"command.jumpToPrevPage\", locale);\n\tconst defaultIcon = <ChevronLeftIcon size={20} />;\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\ttitle={ariaLabel}\n\t\t\tdisabled={!canExecute(flipPrevCommand)}\n\t\t\tclassName={`flipbook-toolbar-prev ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? defaultIcon}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { PrevButton };\nexport type { PrevButtonProps };\n","import { goToTocCommand } from \"html-flip-book-vanilla/commands\";\nimport type React from \"react\";\nimport { useCommands } from \"../commands/CommandContext\";\nimport { t } from \"../i18n\";\nimport { TableOfContentsIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface TocButtonProps {\n\t/** Custom content (icon or text). Defaults to TableOfContentsIcon */\n\tchildren?: React.ReactNode;\n\t/** Custom ARIA label. Defaults to localized \"Table of contents\" */\n\tariaLabel?: string;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to navigate to the Table of Contents page (instant jump, same as goToToc command).\n * TOC page index comes from store (populated by book config); command and UI both use the store.\n */\nconst TocButton: React.FC<TocButtonProps> = ({ children, ariaLabel: ariaLabelProp, className }) => {\n\tconst { locale } = useToolbar();\n\tconst { execute, canExecute } = useCommands();\n\tconst ariaLabel = ariaLabelProp ?? t(\"command.jumpToToc\", locale);\n\n\tconst handleClick = () => {\n\t\texecute(goToTocCommand);\n\t};\n\n\tconst disabled = !canExecute(goToTocCommand);\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\tdisabled={disabled}\n\t\t\tclassName={`flipbook-toolbar-toc ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? <TableOfContentsIcon size={18} />}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { TocButton };\nexport type { TocButtonProps };\n","import type { CommandDefinition } from \"html-flip-book-vanilla/commands\";\n\n/**\n * React-layer command: open the download dropdown (e.g. Ctrl+S).\n * Toolbar wires data.open to openDownloadMenuRef.current.\n */\nexport const openDownloadMenuCommand: CommandDefinition = {\n\tid: \"openDownloadMenu\",\n\tenName: \"Open download menu\",\n\tenDescription: \"Open the download menu\",\n\tnameKey: \"toolbarItem.download\",\n\thotkeys: [{ key: \"s\", modifiers: { ctrl: true } }],\n\texecute: (ctx) => {\n\t\t(ctx.data?.open as (() => void) | undefined)?.();\n\t\treturn undefined;\n\t},\n\tcanExecute: (ctx) => typeof ctx.data?.open === \"function\",\n};\n","import type React from \"react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { CommandDefinition, CommandOptions } from \"../commands\";\nimport { CommandProvider } from \"../commands/CommandContext\";\nimport { openDownloadMenuCommand } from \"../commands/open-download-menu-command\";\nimport type { FlipBookHandle, PageSemantics } from \"../FlipBook\";\nimport { defaultLocale, directionFromLocale, type Locale } from \"../i18n\";\nimport { ToolbarContext } from \"./ToolbarContext\";\nimport \"./Toolbar.css\";\n\ninterface ToolbarProps {\n\t/** Ref to the FlipBook component for programmatic control */\n\tflipBookRef: React.RefObject<FlipBookHandle | null>;\n\t/** Text direction. Defaults from intl locale (en-US → ltr). */\n\tdirection?: \"ltr\" | \"rtl\";\n\t/** Locale for UI strings. Defaults to en-US. */\n\tlocale?: Locale;\n\t/** Optional page semantics for semantic indicator (e.g. perek/chapter) */\n\tpageSemantics?: PageSemantics;\n\t/** Additional CSS class name */\n\tclassName?: string;\n\t/** Toolbar children in reading order: First, Prev, Indicator, Next, Last */\n\tchildren: React.ReactNode;\n\t/** Enable keyboard hotkeys for commands. Defaults to true */\n\tenableHotkeys?: boolean;\n\t/** Custom commands to register (merged with defaults) */\n\tcommands?: CommandDefinition[];\n\t/** Options for specific commands (e.g., custom hotkeys, data) */\n\tcommandOptions?: Record<string, CommandOptions>;\n\t/** When set, fullscreen (keyboard or button) targets this container only (e.g. sefer + toolbar wrapper). */\n\tfullscreenTargetRef?: React.RefObject<HTMLElement | null>;\n}\n\n/**\n * Container component for FlipBook toolbar controls.\n * Provides context to child components for accessing FlipBook methods.\n * Includes command system with configurable keyboard hotkeys.\n */\nconst Toolbar: React.FC<ToolbarProps> = ({\n\tflipBookRef,\n\tdirection: directionProp,\n\tlocale: localeProp,\n\tpageSemantics,\n\tclassName = \"\",\n\tchildren,\n\tenableHotkeys = true,\n\tcommands,\n\tcommandOptions,\n\tfullscreenTargetRef,\n}) => {\n\tconst direction = directionProp ?? directionFromLocale(localeProp ?? defaultLocale);\n\tconst locale = localeProp ?? (direction === \"rtl\" ? \"he-IL\" : \"en-US\");\n\tconst openDownloadMenuRef = useRef<(() => void) | null>(null);\n\tconst downloadExecutorRef = useRef<((from?: number, to?: number) => void) | null>(null);\n\tconst [currentPage, setCurrentPage] = useState(0);\n\tconst [totalPages, setTotalPages] = useState(0);\n\tconst [of, setOf] = useState<string | number>(0);\n\tconst [isFirstPage, setIsFirstPage] = useState(true);\n\tconst [isLastPage, setIsLastPage] = useState(false);\n\tconst [mouseMode, setMouseMode] = useState<\"turn\" | \"select\">(\"turn\");\n\n\tconst mergedCommandOptions: Record<string, CommandOptions> = {\n\t\t...(fullscreenTargetRef\n\t\t\t? {\n\t\t\t\t\ttoggleFullscreen: {\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tgetFullscreenTarget: () => fullscreenTargetRef.current ?? null,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: {}),\n\t\topenDownloadMenu: {\n\t\t\tdata: { open: () => openDownloadMenuRef.current?.() },\n\t\t},\n\t\tdownload: {\n\t\t\tdata: {\n\t\t\t\tonDownload: (from?: number, to?: number) => downloadExecutorRef.current?.(from, to),\n\t\t\t},\n\t\t},\n\t\t...commandOptions,\n\t};\n\n\t// Update state from FlipBook ref (book is source of truth for current, total, of)\n\tconst updateState = useCallback(() => {\n\t\tconst fb = flipBookRef.current;\n\t\tif (fb) {\n\t\t\tsetCurrentPage(fb.getCurrentPageIndex());\n\t\t\tsetTotalPages(fb.getTotalPages());\n\t\t\tsetOf(fb.getOf());\n\t\t\tsetIsFirstPage(fb.isFirstPage());\n\t\t\tsetIsLastPage(fb.isLastPage());\n\t\t\tsetMouseMode(fb.getMouseMode?.() ?? \"turn\");\n\t\t}\n\t}, [flipBookRef]);\n\n\t// Initial state update and periodic polling (throttled to reduce flicker)\n\t// TODO: Replace with event-based updates when FlipBook emits page change events\n\tuseEffect(() => {\n\t\tupdateState();\n\t\tconst interval = setInterval(updateState, 200);\n\t\treturn () => clearInterval(interval);\n\t}, [updateState]);\n\n\tconst toolbarContent = (\n\t\t<ToolbarContext.Provider\n\t\t\tvalue={{\n\t\t\t\tflipBookRef,\n\t\t\t\tdirection,\n\t\t\t\tlocale,\n\t\t\t\tpageSemantics,\n\t\t\t\tcurrentPage,\n\t\t\t\ttotalPages,\n\t\t\t\tof,\n\t\t\t\tisFirstPage,\n\t\t\t\tisLastPage,\n\t\t\t\tmouseMode,\n\t\t\t\topenDownloadMenuRef,\n\t\t\t\tdownloadExecutorRef,\n\t\t\t\tfullscreenTargetRef,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={`flipbook-toolbar ${direction === \"rtl\" ? \"flipbook-toolbar--rtl\" : \"\"} ${className}`.trim()}\n\t\t\t\trole=\"toolbar\"\n\t\t\t\taria-label=\"FlipBook navigation\"\n\t\t\t\tdir={direction}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</ToolbarContext.Provider>\n\t);\n\n\tconst allCommands: CommandDefinition[] = [openDownloadMenuCommand, ...(commands ?? [])];\n\n\treturn (\n\t\t<CommandProvider\n\t\t\tflipBookRef={flipBookRef}\n\t\t\tcurrentPage={currentPage}\n\t\t\ttotalPages={totalPages}\n\t\t\tdirection={direction}\n\t\t\tcommands={allCommands}\n\t\t\tcommandOptions={mergedCommandOptions}\n\t\t\tdisableHotkeys={!enableHotkeys}\n\t\t>\n\t\t\t{toolbarContent}\n\t\t</CommandProvider>\n\t);\n};\n\nexport { Toolbar };\nexport type { ToolbarProps };\n"],"names":["e","n","r","c","d","l","s","i","u","m","g","t","o","f","h","a","p","y","P","T","K","k","w","CommandsContext","createContext","CommandProvider","flipBookRef","_currentPage","_totalPages","direction","customCommands","commandOptions","disableHotkeys","children","registry","useMemo","reg","cmd","defaultCommands","createCommandContext","useCallback","command","runData","options","data","execute","ctx","canExecute","getAllCommands","handleKeyDown","event","target","entry","hotkeys","binding","hotkeyMatches","useEffect","value","jsx","useCommands","useContext","defaultProps","ChevronLeftIcon","size","className","ChevronRightIcon","ChevronFirstIcon","jsxs","ChevronLastIcon","MaximizeIcon","MinimizeIcon","TableOfContentsIcon","BookshelfIcon","DownloadIcon","ToolbarButton","onClick","ariaLabel","ariaPressed","disabled","title","ActionButton","BookmarkToggleButton","enabled","onChange","ToolbarContext","useToolbar","context","sanitizeForFilename","name","triggerDownload","result","filenameBase","binary","bytes","blob","url","getSelectablePages","totalPages","pageSemantics","list","semanticName","DownloadDropdown","locale","openDownloadMenuRef","downloadExecutorRef","downloadConfig","open","setOpen","useState","downloadMode","setDownloadMode","fromIndex","setFromIndex","toIndex","setToIndex","loading","setLoading","openUp","setOpenUp","dropdownRef","useRef","menuRef","selectablePages","hasSefer","hasRange","showDropdown","firstSelectablePage","lastSelectablePage","closeDropdown","useLayoutEffect","menu","trigger","updatePosition","triggerRect","padding","gap","spaceBelow","spaceAbove","desiredHeight","above","bounds","left","isRtl","top","ro","toolbar","handleClickOutside","handleEntireBook","config","runRangeDownload","from","to","pages","semanticPages","info","sp","fromName","toName","total","FirstPageButton","handleClick","goToFirstCommand","defaultIcon","FullscreenButton","targetRefProp","enterIcon","exitIcon","ariaLabelEnter","ariaLabelExit","isFullscreen","setIsFullscreen","targetRef","updateFullscreenState","error","label","icon","LastPageButton","goToLastCommand","MouseModeButton","letters","mouseMode","NextButton","flipNextCommand","PageIndicator","modeProp","showTotal","placeholder","editableProp","maxLength","currentPage","of","mode","editable","inputValue","setInputValue","isEditing","setIsEditing","justNavigatedRef","prevCurrentPageRef","leftPageIndex","rightPageIndex","getPageName","pageIndex","leftName","rightName","getTotalDisplay","buildDisplayText","firstName","secondName","rangeText","primarySemanticName","displayText","pageChanged","handleFocus","select","handleBlur","handleChange","PrevButton","flipPrevCommand","TocButton","ariaLabelProp","goToTocCommand","openDownloadMenuCommand","Toolbar","directionProp","localeProp","enableHotkeys","commands","fullscreenTargetRef","directionFromLocale","defaultLocale","setCurrentPage","setTotalPages","setOf","isFirstPage","setIsFirstPage","isLastPage","setIsLastPage","setMouseMode","mergedCommandOptions","updateState","fb","interval","toolbarContent","allCommands"],"mappings":";;AAAA,IAAIA,KAAI;AACR,SAASC,KAAI;AACX,SAAOD;AACT;ACFK,MAACE,KAAI;AAAA,EACR,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,SAAS;AAAA,EACT,SAAS,CAAA;AAAA,EACT,SAAS,CAAC,MAAM;AACd,MAAE,MAAM;AAAA,MACN,EAAE,MAAM;AAAA,MACR,EAAE,MAAM;AAAA,IACd;AAAA,EACE;AAAA,EACA,YAAY,CAAC,MAAM,OAAO,EAAE,MAAM,cAAc;AAClD,GAAGC,KAAI;A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J,UAAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA,GAIImN,IAAmC,CAACtB,IAAyB,GAAIK,KAAY,CAAA,CAAG;AAEtF,SACC,gBAAAzK;AAAA,IAACjC;AAAA,IAAA;AAAA,MACA,aAAAC;AAAA,MACA,aAAAmK;AAAA,MACA,YAAA5F;AAAA,MACA,WAAApE;AAAA,MACA,UAAUuN;AAAA,MACV,gBAAgBL;AAAA,MAChB,gBAAgB,CAACb;AAAA,MAEhB,UAAAiB;AAAA,IAAA;AAAA,EAAA;AAGJ;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "html-flip-book-react",
|
|
3
3
|
"description": "Flip Book React Component",
|
|
4
|
-
"version": "0.0.0-alpha.
|
|
4
|
+
"version": "0.0.0-alpha.49",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "DoradSoft",
|
|
7
7
|
"main": "./dist/flip-book.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react-dom": "^18.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"html-flip-book-vanilla": "0.0.0-alpha.
|
|
42
|
+
"html-flip-book-vanilla": "0.0.0-alpha.49"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/react": "^19.2.13",
|