html-flip-book-react 0.0.0-alpha.18 → 0.0.0-alpha.21
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 +8 -0
- package/dist/FlipBook.d.ts.map +1 -1
- package/dist/TocPage.d.ts +21 -0
- package/dist/TocPage.d.ts.map +1 -0
- package/dist/assets/html-flip-book.css +1 -1
- package/dist/commands/CommandContext.d.ts +23 -0
- package/dist/commands/CommandContext.d.ts.map +1 -0
- package/dist/commands/defaultCommands.d.ts +4 -0
- package/dist/commands/defaultCommands.d.ts.map +1 -0
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/types.d.ts +36 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/flip-book.js +99 -40
- package/dist/flip-book.js.map +1 -1
- package/dist/icons/index.d.ts +15 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/toolbar/ActionButton.d.ts +12 -0
- package/dist/toolbar/ActionButton.d.ts.map +1 -0
- package/dist/toolbar/FirstPageButton.d.ts.map +1 -1
- package/dist/toolbar/FullscreenButton.d.ts +2 -0
- package/dist/toolbar/FullscreenButton.d.ts.map +1 -1
- package/dist/toolbar/LastPageButton.d.ts.map +1 -1
- package/dist/toolbar/NextButton.d.ts.map +1 -1
- package/dist/toolbar/PageIndicator.d.ts +8 -2
- package/dist/toolbar/PageIndicator.d.ts.map +1 -1
- package/dist/toolbar/PrevButton.d.ts.map +1 -1
- package/dist/toolbar/TocButton.d.ts +11 -0
- package/dist/toolbar/TocButton.d.ts.map +1 -0
- package/dist/toolbar/Toolbar.d.ts +6 -1
- package/dist/toolbar/Toolbar.d.ts.map +1 -1
- package/dist/toolbar/ToolbarContext.d.ts +2 -1
- package/dist/toolbar/ToolbarContext.d.ts.map +1 -1
- package/dist/toolbar/index.d.ts +10 -2
- package/dist/toolbar/index.d.ts.map +1 -1
- package/dist/toolbar/index.js +556 -96
- package/dist/toolbar/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/toolbar/ToolbarButton.tsx","../../src/toolbar/ToolbarContext.tsx","../../src/toolbar/FirstPageButton.tsx","../../src/toolbar/FullscreenButton.tsx","../../src/toolbar/LastPageButton.tsx","../../src/toolbar/NextButton.tsx","../../src/toolbar/PageIndicator.tsx","../../src/toolbar/PrevButton.tsx","../../src/toolbar/Toolbar.tsx"],"sourcesContent":["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/** 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\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\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 { createContext, useContext } from \"react\";\nimport type { FlipBookHandle } from \"../FlipBook\";\n\ninterface ToolbarContextValue {\n\tflipBookRef: React.RefObject<FlipBookHandle | null>;\n\tdirection: \"ltr\" | \"rtl\";\n\tcurrentPage: number;\n\ttotalPages: number;\n\tisFirstPage: boolean;\n\tisLastPage: boolean;\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 { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface FirstPageButtonProps {\n\t/** Custom content (icon or text). Defaults to \"⏮\" */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to navigate to the first page.\n */\nconst FirstPageButton: React.FC<FirstPageButtonProps> = ({ children, className }) => {\n\tconst { flipBookRef, isFirstPage } = useToolbar();\n\n\tconst handleClick = () => {\n\t\tflipBookRef.current?.jumpToPage(0);\n\t};\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel=\"First page\"\n\t\t\tdisabled={isFirstPage}\n\t\t\tclassName={`flipbook-toolbar-first ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? \"⏮\"}\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 { ToolbarButton } from \"./ToolbarButton\";\n\ninterface FullscreenButtonProps {\n\t/** Target element to make fullscreen. If not provided, uses document.documentElement */\n\ttargetRef?: React.RefObject<HTMLElement | null>;\n\t/** Custom content for enter fullscreen. Defaults to \"⛶\" */\n\tenterIcon?: React.ReactNode;\n\t/** Custom content for exit fullscreen. Defaults to \"⛶\" */\n\texitIcon?: React.ReactNode;\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,\n\tenterIcon,\n\texitIcon,\n\tclassName,\n}) => {\n\tconst [isFullscreen, setIsFullscreen] = useState(false);\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 ? \"Exit fullscreen\" : \"Enter fullscreen\";\n\tconst icon = isFullscreen ? (exitIcon ?? \"⛶\") : (enterIcon ?? \"⛶\");\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 type React from \"react\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface LastPageButtonProps {\n\t/** Custom content (icon or text). Defaults to \"⏭\" */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to navigate to the last page.\n */\nconst LastPageButton: React.FC<LastPageButtonProps> = ({ children, className }) => {\n\tconst { flipBookRef, isLastPage, totalPages } = useToolbar();\n\n\tconst handleClick = () => {\n\t\tflipBookRef.current?.jumpToPage(totalPages - 1);\n\t};\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel=\"Last page\"\n\t\t\tdisabled={isLastPage}\n\t\t\tclassName={`flipbook-toolbar-last ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? \"⏭\"}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { LastPageButton };\nexport type { LastPageButtonProps };\n","import type React from \"react\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface NextButtonProps {\n\t/** Custom content (icon or text). Defaults to \"›\" */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to navigate to the next page.\n */\nconst NextButton: React.FC<NextButtonProps> = ({ children, className }) => {\n\tconst { flipBookRef, isLastPage, direction } = useToolbar();\n\n\tconst handleClick = () => {\n\t\tflipBookRef.current?.flipNext();\n\t};\n\n\t// In RTL, the visual \"next\" is actually previous in reading order\n\tconst label = direction === \"rtl\" ? \"Previous page\" : \"Next page\";\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={label}\n\t\t\tdisabled={isLastPage}\n\t\t\tclassName={`flipbook-toolbar-next ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? \"›\"}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { NextButton };\nexport type { NextButtonProps };\n","import type React from \"react\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface PageIndicatorProps {\n\t/** Format string with {current} and {total} placeholders. Defaults to \"{current} / {total}\" */\n\tformat?: string;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Displays the current page position (e.g., \"3 / 10\").\n */\nconst PageIndicator: React.FC<PageIndicatorProps> = ({\n\tformat = \"{current} / {total}\",\n\tclassName,\n}) => {\n\tconst { currentPage, totalPages } = useToolbar();\n\n\t// Display 1-based page numbers for users\n\tconst displayPage = currentPage + 1;\n\n\tconst text = format\n\t\t.replace(\"{current}\", displayPage.toString())\n\t\t.replace(\"{total}\", totalPages.toString());\n\n\treturn (\n\t\t<span\n\t\t\tclassName={`flipbook-toolbar-indicator ${className ?? \"\"}`.trim()}\n\t\t\taria-live=\"polite\"\n\t\t\taria-atomic=\"true\"\n\t\t>\n\t\t\t{text}\n\t\t</span>\n\t);\n};\n\nexport { PageIndicator };\nexport type { PageIndicatorProps };\n","import type React from \"react\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface PrevButtonProps {\n\t/** Custom content (icon or text). Defaults to \"‹\" */\n\tchildren?: React.ReactNode;\n\t/** Additional CSS class name */\n\tclassName?: string;\n}\n\n/**\n * Button to navigate to the previous page.\n */\nconst PrevButton: React.FC<PrevButtonProps> = ({ children, className }) => {\n\tconst { flipBookRef, isFirstPage, direction } = useToolbar();\n\n\tconst handleClick = () => {\n\t\tflipBookRef.current?.flipPrev();\n\t};\n\n\t// In RTL, the visual \"previous\" is actually next in reading order\n\tconst label = direction === \"rtl\" ? \"Next page\" : \"Previous page\";\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={label}\n\t\t\tdisabled={isFirstPage}\n\t\t\tclassName={`flipbook-toolbar-prev ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? \"‹\"}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { PrevButton };\nexport type { PrevButtonProps };\n","import type React from \"react\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport type { FlipBookHandle } from \"../FlipBook\";\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 for button layout. Defaults to \"ltr\" */\n\tdirection?: \"ltr\" | \"rtl\";\n\t/** Additional CSS class name */\n\tclassName?: string;\n\t/** Toolbar children (buttons, indicators, etc.) */\n\tchildren: React.ReactNode;\n}\n\n/**\n * Container component for FlipBook toolbar controls.\n * Provides context to child components for accessing FlipBook methods.\n */\nconst Toolbar: React.FC<ToolbarProps> = ({\n\tflipBookRef,\n\tdirection = \"ltr\",\n\tclassName = \"\",\n\tchildren,\n}) => {\n\tconst [currentPage, setCurrentPage] = useState(0);\n\tconst [totalPages, setTotalPages] = useState(0);\n\tconst [isFirstPage, setIsFirstPage] = useState(true);\n\tconst [isLastPage, setIsLastPage] = useState(false);\n\n\t// Update state from FlipBook ref\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\tsetIsFirstPage(fb.isFirstPage());\n\t\t\tsetIsLastPage(fb.isLastPage());\n\t\t}\n\t}, [flipBookRef]);\n\n\t// Initial state update and periodic polling\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, 100);\n\t\treturn () => clearInterval(interval);\n\t}, [updateState]);\n\n\treturn (\n\t\t<ToolbarContext.Provider\n\t\t\tvalue={{\n\t\t\t\tflipBookRef,\n\t\t\t\tdirection,\n\t\t\t\tcurrentPage,\n\t\t\t\ttotalPages,\n\t\t\t\tisFirstPage,\n\t\t\t\tisLastPage,\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>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</ToolbarContext.Provider>\n\t);\n};\n\nexport { Toolbar };\nexport type { ToolbarProps };\n"],"names":["ToolbarButton","onClick","ariaLabel","disabled","children","className","title","jsx","ToolbarContext","createContext","useToolbar","context","useContext","FirstPageButton","flipBookRef","isFirstPage","FullscreenButton","targetRef","enterIcon","exitIcon","isFullscreen","setIsFullscreen","useState","updateFullscreenState","useCallback","useEffect","handleClick","error","label","icon","LastPageButton","isLastPage","totalPages","NextButton","direction","PageIndicator","format","currentPage","displayPage","text","PrevButton","Toolbar","setCurrentPage","setTotalPages","setIsFirstPage","setIsLastPage","updateState","fb","interval"],"mappings":";;AAoBA,MAAMA,IAA8C,CAAC;AAAA,EACpD,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC;AACD,MAEE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,MAAK;AAAA,IACL,SAAAN;AAAA,IACA,cAAYC;AAAA,IACZ,UAAAC;AAAA,IACA,OAAOG,KAASJ;AAAA,IAChB,WAAW,2BAA2BG,CAAS,GAAG,KAAA;AAAA,IAEjD,UAAAD;AAAA,EAAA;AAAA,GCxBEI,IAAiBC,EAA0C,IAAI;AAE9D,SAASC,IAAkC;AACjD,QAAMC,IAAUC,EAAWJ,CAAc;AACzC,MAAI,CAACG;AACJ,UAAM,IAAI,MAAM,kDAAkD;AAEnE,SAAOA;AACR;ACPA,MAAME,IAAkD,CAAC,EAAE,UAAAT,GAAU,WAAAC,QAAgB;AACpF,QAAM,EAAE,aAAAS,GAAa,aAAAC,EAAA,IAAgBL,EAAA;AAMrC,SACC,gBAAAH;AAAA,IAACP;AAAA,IAAA;AAAA,MACA,SANkB,MAAM;AACzB,QAAAc,EAAY,SAAS,WAAW,CAAC;AAAA,MAClC;AAAA,MAKE,WAAU;AAAA,MACV,UAAUC;AAAA,MACV,WAAW,0BAA0BV,KAAa,EAAE,GAAG,KAAA;AAAA,MAEtD,UAAAD,KAAY;AAAA,IAAA;AAAA,EAAA;AAGhB,GCbMY,IAAoD,CAAC;AAAA,EAC1D,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAd;AACD,MAAM;AACL,QAAM,CA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3B;AAAA,EACA,WAAAoB,IAAY;AAAA,EACZ,WAAA7B,IAAY;AAAA,EACZ,UAAAD;AACD,MAAM;AACL,QAAM,CAACiC,GAAaK,CAAc,IAAIpB,EAAS,CAAC,GAC1C,CAACU,GAAYW,CAAa,IAAIrB,EAAS,CAAC,GACxC,CAACP,GAAa6B,CAAc,IAAItB,EAAS,EAAI,GAC7C,CAACS,GAAYc,CAAa,IAAIvB,EAAS,EAAK,GAG5CwB,IAActB,EAAY,MAAM;AACrC,UAAMuB,IAAKjC,EAAY;AACvB,IAAIiC,MACHL,EAAeK,EAAG,qBAAqB,GACvCJ,EAAcI,EAAG,eAAe,GAChCH,EAAeG,EAAG,aAAa,GAC/BF,EAAcE,EAAG,YAAY;AAAA,EAE/B,GAAG,CAACjC,CAAW,CAAC;AAIhB,SAAAW,EAAU,MAAM;AACf,IAAAqB,EAAA;AACA,UAAME,IAAW,YAAYF,GAAa,GAAG;AAC7C,WAAO,MAAM,cAAcE,CAAQ;AAAA,EACpC,GAAG,CAACF,CAAW,CAAC,GAGf,gBAAAvC;AAAA,IAACC,EAAe;AAAA,IAAf;AAAA,MACA,OAAO;AAAA,QACN,aAAAM;AAAA,QACA,WAAAoB;AAAA,QACA,aAAAG;AAAA,QACA,YAAAL;AAAA,QACA,aAAAjB;AAAA,QACA,YAAAgB;AAAA,MAAA;AAAA,MAGD,UAAA,gBAAAxB;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,WAAW,oBAAoB2B,MAAc,QAAQ,0BAA0B,EAAE,IAAI7B,CAAS,GAAG,KAAA;AAAA,UACjG,MAAK;AAAA,UACL,cAAW;AAAA,UAEV,UAAAD;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGH;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/commands/defaultCommands.ts","../../src/commands/CommandContext.tsx","../../src/icons/index.tsx","../../src/toolbar/ToolbarButton.tsx","../../src/toolbar/ActionButton.tsx","../../src/toolbar/ToolbarContext.tsx","../../src/toolbar/FirstPageButton.tsx","../../src/toolbar/FullscreenButton.tsx","../../src/toolbar/LastPageButton.tsx","../../src/toolbar/NextButton.tsx","../../src/toolbar/PageIndicator.tsx","../../src/toolbar/PrevButton.tsx","../../src/toolbar/TocButton.tsx","../../src/toolbar/Toolbar.tsx"],"sourcesContent":["import type { Command, HotkeyBinding } from \"./types\";\n\n/**\n * Default hotkey bindings for built-in commands.\n */\nexport const DEFAULT_HOTKEYS: Record<string, HotkeyBinding[]> = {\n\tflipNext: [\n\t\t{ key: \"ArrowRight\" },\n\t\t{ key: \"PageDown\" },\n\t\t{ key: \" \" }, // Space\n\t],\n\tflipPrev: [{ key: \"ArrowLeft\" }, { key: \"PageUp\" }],\n\tgoToFirst: [{ key: \"Home\" }],\n\tgoToLast: [{ key: \"End\" }],\n\tgoToToc: [{ key: \"t\" }],\n\ttoggleFullscreen: [{ key: \"f\" }],\n};\n\n/**\n * Built-in commands for flipbook navigation.\n */\nexport const defaultCommands: Command[] = [\n\t{\n\t\tid: \"flipNext\",\n\t\tname: \"Next Page\",\n\t\tdescription: \"Flip to the next page\",\n\t\texecute: ({ flipBookRef }) => {\n\t\t\tflipBookRef.current?.flipNext();\n\t\t\treturn undefined;\n\t\t},\n\t\tcanExecute: ({ currentPage, totalPages }) => currentPage < totalPages - 1,\n\t},\n\t{\n\t\tid: \"flipPrev\",\n\t\tname: \"Previous Page\",\n\t\tdescription: \"Flip to the previous page\",\n\t\texecute: ({ flipBookRef }) => {\n\t\t\tflipBookRef.current?.flipPrev();\n\t\t\treturn undefined;\n\t\t},\n\t\tcanExecute: ({ currentPage }) => currentPage > 0,\n\t},\n\t{\n\t\tid: \"goToFirst\",\n\t\tname: \"First Page\",\n\t\tdescription: \"Jump to the first page\",\n\t\texecute: ({ flipBookRef }) => {\n\t\t\tflipBookRef.current?.jumpToPage(0);\n\t\t\treturn undefined;\n\t\t},\n\t\tcanExecute: ({ currentPage }) => currentPage > 0,\n\t},\n\t{\n\t\tid: \"goToLast\",\n\t\tname: \"Last Page\",\n\t\tdescription: \"Jump to the last page\",\n\t\texecute: ({ flipBookRef, totalPages }) => {\n\t\t\tflipBookRef.current?.jumpToPage(totalPages - 1);\n\t\t\treturn undefined;\n\t\t},\n\t\tcanExecute: ({ currentPage, totalPages }) => currentPage < totalPages - 1,\n\t},\n\t{\n\t\tid: \"goToToc\",\n\t\tname: \"Table of Contents\",\n\t\tdescription: \"Jump to the table of contents\",\n\t\texecute: ({ flipBookRef, data }) => {\n\t\t\tconst tocIndex = (data?.tocPageIndex as number) ?? 4;\n\t\t\tflipBookRef.current?.jumpToPage(tocIndex);\n\t\t\treturn undefined;\n\t\t},\n\t\tcanExecute: ({ currentPage, data }) => {\n\t\t\tconst tocIndex = (data?.tocPageIndex as number) ?? 4;\n\t\t\treturn currentPage !== tocIndex;\n\t\t},\n\t},\n\t{\n\t\tid: \"toggleFullscreen\",\n\t\tname: \"Toggle Fullscreen\",\n\t\tdescription: \"Enter or exit fullscreen mode\",\n\t\texecute: ({ data }) => {\n\t\t\tconst targetRef = data?.fullscreenTargetRef as\n\t\t\t\t| React.RefObject<HTMLElement | null>\n\t\t\t\t| undefined;\n\t\t\tif (document.fullscreenElement) {\n\t\t\t\tdocument.exitFullscreen().catch(console.warn);\n\t\t\t} else {\n\t\t\t\tconst target = targetRef?.current ?? document.documentElement;\n\t\t\t\ttarget.requestFullscreen().catch(console.warn);\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t},\n];\n","import type React from \"react\";\nimport { createContext, useCallback, useContext, useEffect, useMemo } from \"react\";\nimport type { FlipBookHandle } from \"../FlipBook\";\nimport { DEFAULT_HOTKEYS, defaultCommands } from \"./defaultCommands\";\nimport type {\n\tCommand,\n\tCommandContext as CommandCtx,\n\tCommandOptions,\n\tCommandRegistry,\n\tHotkeyBinding,\n} from \"./types\";\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?: Command[];\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 by ID */\n\texecuteCommand: (commandId: string) => void;\n\t/** Check if a command can be executed */\n\tcanExecute: (commandId: string) => boolean;\n\t/** Get a command by ID */\n\tgetCommand: (commandId: string) => Command | undefined;\n\t/** Get all registered commands */\n\tgetAllCommands: () => Command[];\n}\n\nconst CommandsContext = createContext<CommandsContextValue | null>(null);\n\n/**\n * Check if a hotkey binding matches a keyboard event.\n */\nfunction hotkeyMatches(binding: HotkeyBinding, event: KeyboardEvent): boolean {\n\tif (event.key !== binding.key) return false;\n\n\tconst modifiers = binding.modifiers ?? {};\n\tif (!!modifiers.ctrl !== event.ctrlKey) return false;\n\tif (!!modifiers.shift !== event.shiftKey) return false;\n\tif (!!modifiers.alt !== event.altKey) return false;\n\tif (!!modifiers.meta !== event.metaKey) return false;\n\n\treturn true;\n}\n\n/**\n * Provider component that manages flipbook commands and hotkeys.\n */\nexport const CommandProvider: React.FC<CommandProviderProps> = ({\n\tflipBookRef,\n\tcurrentPage,\n\ttotalPages,\n\tdirection = \"ltr\",\n\tcommands: customCommands = [],\n\tcommandOptions = {},\n\tdisableHotkeys = false,\n\tchildren,\n}) => {\n\t// Build the command registry\n\tconst registry = useMemo<CommandRegistry>(() => {\n\t\tconst reg: CommandRegistry = {};\n\n\t\t// Register default commands\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\t// Register/override with custom commands\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\t// Create command context for execution\n\tconst createCommandContext = useCallback(\n\t\t(commandId: string): CommandCtx => {\n\t\t\tconst options = registry[commandId]?.options ?? {};\n\t\t\treturn {\n\t\t\t\tflipBookRef,\n\t\t\t\tcurrentPage,\n\t\t\t\ttotalPages,\n\t\t\t\tdirection,\n\t\t\t\tdata: options.data,\n\t\t\t};\n\t\t},\n\t\t[flipBookRef, currentPage, totalPages, direction, registry],\n\t);\n\n\t// Execute a command\n\tconst executeCommand = useCallback(\n\t\t(commandId: string) => {\n\t\t\tconst entry = registry[commandId];\n\t\t\tif (!entry) {\n\t\t\t\tconsole.warn(`Command \"${commandId}\" not found`);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst ctx = createCommandContext(commandId);\n\t\t\tif (entry.command.canExecute && !entry.command.canExecute(ctx)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tentry.command.execute(ctx);\n\t\t},\n\t\t[registry, createCommandContext],\n\t);\n\n\t// Check if command can execute\n\tconst canExecute = useCallback(\n\t\t(commandId: string): boolean => {\n\t\t\tconst entry = registry[commandId];\n\t\t\tif (!entry) return false;\n\n\t\t\tconst ctx = createCommandContext(commandId);\n\t\t\tif (!entry.command.canExecute) return true;\n\t\t\treturn entry.command.canExecute(ctx);\n\t\t},\n\t\t[registry, createCommandContext],\n\t);\n\n\t// Get a command\n\tconst getCommand = useCallback(\n\t\t(commandId: string): Command | undefined => registry[commandId]?.command,\n\t\t[registry],\n\t);\n\n\t// Get all commands\n\tconst getAllCommands = useCallback(\n\t\t(): Command[] => Object.values(registry).map((e) => e.command),\n\t\t[registry],\n\t);\n\n\t// Keyboard event handler\n\tconst handleKeyDown = useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\t// Ignore when typing in inputs\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\t// Check each command's hotkeys\n\t\t\tfor (const [commandId, entry] of Object.entries(registry)) {\n\t\t\t\tif (entry.options.disableHotkeys) continue;\n\n\t\t\t\tconst hotkeys = entry.options.hotkeys ?? DEFAULT_HOTKEYS[commandId] ?? [];\n\t\t\t\tfor (const binding of hotkeys) {\n\t\t\t\t\tif (hotkeyMatches(binding, event)) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\texecuteCommand(commandId);\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, executeCommand],\n\t);\n\n\t// Register keyboard listener\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\texecuteCommand,\n\t\t\tcanExecute,\n\t\t\tgetCommand,\n\t\t\tgetAllCommands,\n\t\t}),\n\t\t[executeCommand, canExecute, getCommand, getAllCommands],\n\t);\n\n\treturn <CommandsContext.Provider value={value}>{children}</CommandsContext.Provider>;\n};\n\n/**\n * Hook to access the commands system.\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 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/** 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\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\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 type React from \"react\";\nimport { createContext, useContext } from \"react\";\nimport type { FlipBookHandle, PageSemantics } from \"../FlipBook\";\n\ninterface ToolbarContextValue {\n\tflipBookRef: React.RefObject<FlipBookHandle | null>;\n\tdirection: \"ltr\" | \"rtl\";\n\tpageSemantics?: PageSemantics;\n\tcurrentPage: number;\n\ttotalPages: number;\n\tisFirstPage: boolean;\n\tisLastPage: boolean;\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 { ChevronFirstIcon, ChevronLastIcon } 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.\n */\nconst FirstPageButton: React.FC<FirstPageButtonProps> = ({ children, className }) => {\n\tconst { flipBookRef, isFirstPage, direction } = useToolbar();\n\n\tconst handleClick = () => {\n\t\tflipBookRef.current?.jumpToPage(0);\n\t};\n\n\t// In RTL, \"first\" page is on the right; use icon pointing right so it matches visual direction\n\tconst defaultIcon =\n\t\tdirection === \"rtl\" ? <ChevronLastIcon size={18} /> : <ChevronFirstIcon size={18} />;\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel=\"First page\"\n\t\t\tdisabled={isFirstPage}\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\";\n\ninterface FullscreenButtonProps {\n\t/** Target element to make fullscreen. If not provided, uses 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,\n\tenterIcon,\n\texitIcon,\n\tariaLabelEnter = \"Enter fullscreen\",\n\tariaLabelExit = \"Exit fullscreen\",\n\tclassName,\n}) => {\n\tconst [isFullscreen, setIsFullscreen] = useState(false);\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 type React from \"react\";\nimport { ChevronFirstIcon, 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.\n */\nconst LastPageButton: React.FC<LastPageButtonProps> = ({ children, className }) => {\n\tconst { flipBookRef, isLastPage, totalPages, direction } = useToolbar();\n\n\tconst handleClick = () => {\n\t\tflipBookRef.current?.jumpToPage(totalPages - 1);\n\t};\n\n\t// In RTL, \"last\" page is on the left; use icon pointing left so it matches visual direction\n\tconst defaultIcon =\n\t\tdirection === \"rtl\" ? <ChevronFirstIcon size={18} /> : <ChevronLastIcon size={18} />;\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel=\"Last page\"\n\t\t\tdisabled={isLastPage}\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 { 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 to navigate to the next page.\n */\nconst NextButton: React.FC<NextButtonProps> = ({ children, className }) => {\n\tconst { flipBookRef, isLastPage, direction } = useToolbar();\n\n\tconst handleClick = () => {\n\t\tflipBookRef.current?.flipNext();\n\t};\n\n\t// In RTL, the visual \"next\" is actually previous in reading order\n\tconst label = direction === \"rtl\" ? \"Previous page\" : \"Next page\";\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={label}\n\t\t\tdisabled={isLastPage}\n\t\t\tclassName={`flipbook-toolbar-next ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? <ChevronRightIcon size={20} />}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { NextButton };\nexport type { NextButtonProps };\n","import type React from \"react\";\nimport { useCallback, useEffect, 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 } = 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\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// Get total display (last page name or total count)\n\tconst getTotalDisplay = useCallback((): string => {\n\t\tif (mode === \"semantic\" && pageSemantics) {\n\t\t\t// Find the last page with a semantic name\n\t\t\tfor (let i = totalPages - 1; i >= 0; i--) {\n\t\t\t\tconst name = pageSemantics.indexToSemanticName(i);\n\t\t\t\tif (name) return name;\n\t\t\t}\n\t\t\treturn String(totalPages);\n\t\t}\n\t\treturn String(totalPages);\n\t}, [mode, pageSemantics, totalPages]);\n\n\t// Build display text for the range\n\tconst buildDisplayText = useCallback((): string => {\n\t\t// Determine which names to show based on direction\n\t\t// RTL: right page shown first (physically on right side)\n\t\t// LTR: left page shown first (physically on left side)\n\t\tconst firstName = direction === \"rtl\" ? rightName : leftName;\n\t\tconst secondName = direction === \"rtl\" ? leftName : 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}, [direction, 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\t// Sync input value when page changes and not editing\n\tuseEffect(() => {\n\t\tif (!isEditing) {\n\t\t\tsetInputValue(primarySemanticName);\n\t\t}\n\t}, [primarySemanticName, isEditing]);\n\n\tconst handleFocus = useCallback(() => {\n\t\tif (editable) {\n\t\t\tsetIsEditing(true);\n\t\t\tsetInputValue(primarySemanticName);\n\t\t}\n\t}, [editable, primarySemanticName]);\n\n\tconst handleBlur = useCallback(() => {\n\t\t// Always revert on blur - navigation only happens on Enter\n\t\tsetIsEditing(false);\n\t\tsetInputValue(primarySemanticName);\n\t}, [primarySemanticName]);\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}\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\tconst displayText = buildDisplayText();\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\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={isEditing ? inputValue : displayText}\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 type React from \"react\";\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 to navigate to the previous page.\n */\nconst PrevButton: React.FC<PrevButtonProps> = ({ children, className }) => {\n\tconst { flipBookRef, isFirstPage, direction } = useToolbar();\n\n\tconst handleClick = () => {\n\t\tflipBookRef.current?.flipPrev();\n\t};\n\n\t// In RTL, the visual \"previous\" is actually next in reading order\n\tconst label = direction === \"rtl\" ? \"Next page\" : \"Previous page\";\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={label}\n\t\t\tdisabled={isFirstPage}\n\t\t\tclassName={`flipbook-toolbar-prev ${className ?? \"\"}`.trim()}\n\t\t>\n\t\t\t{children ?? <ChevronLeftIcon size={20} />}\n\t\t</ToolbarButton>\n\t);\n};\n\nexport { PrevButton };\nexport type { PrevButtonProps };\n","import type React from \"react\";\nimport { TableOfContentsIcon } from \"../icons\";\nimport { ToolbarButton } from \"./ToolbarButton\";\nimport { useToolbar } from \"./ToolbarContext\";\n\ninterface TocButtonProps {\n\t/** Page index where TOC is located. Defaults to 4 (after front/back covers and soft covers). */\n\ttocPageIndex?: number;\n\t/** Custom content (icon or text). Defaults to TableOfContentsIcon */\n\tchildren?: React.ReactNode;\n\t/** Custom ARIA label. Defaults to \"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.\n */\nconst TocButton: React.FC<TocButtonProps> = ({\n\ttocPageIndex = 4,\n\tchildren,\n\tariaLabel = \"Table of contents\",\n\tclassName,\n}) => {\n\tconst { flipBookRef, currentPage } = useToolbar();\n\n\tconst handleClick = () => {\n\t\tflipBookRef.current?.jumpToPage(tocPageIndex);\n\t};\n\n\tconst isOnToc = currentPage === tocPageIndex;\n\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={handleClick}\n\t\t\tariaLabel={ariaLabel}\n\t\t\tdisabled={isOnToc}\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 React from \"react\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { CommandProvider } from \"../commands/CommandContext\";\nimport type { Command, CommandOptions } from \"../commands/types\";\nimport type { FlipBookHandle, PageSemantics } from \"../FlipBook\";\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 for button layout. Defaults to \"ltr\" */\n\tdirection?: \"ltr\" | \"rtl\";\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?: Command[];\n\t/** Options for specific commands (e.g., custom hotkeys, data) */\n\tcommandOptions?: Record<string, CommandOptions>;\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 = \"ltr\",\n\tpageSemantics,\n\tclassName = \"\",\n\tchildren,\n\tenableHotkeys = true,\n\tcommands,\n\tcommandOptions,\n}) => {\n\tconst [currentPage, setCurrentPage] = useState(0);\n\tconst [totalPages, setTotalPages] = useState(0);\n\tconst [isFirstPage, setIsFirstPage] = useState(true);\n\tconst [isLastPage, setIsLastPage] = useState(false);\n\n\t// Update state from FlipBook ref\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\tsetIsFirstPage(fb.isFirstPage());\n\t\t\tsetIsLastPage(fb.isLastPage());\n\t\t}\n\t}, [flipBookRef]);\n\n\t// Initial state update and periodic polling\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, 100);\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\tpageSemantics,\n\t\t\t\tcurrentPage,\n\t\t\t\ttotalPages,\n\t\t\t\tisFirstPage,\n\t\t\t\tisLastPage,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={`flipbook-toolbar ${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\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={commands}\n\t\t\tcommandOptions={commandOptions}\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":["DEFAULT_HOTKEYS","defaultCommands","flipBookRef","currentPage","totalPages","data","tocIndex","targetRef","CommandsContext","createContext","hotkeyMatches","binding","event","modifiers","CommandProvider","direction","customCommands","commandOptions","disableHotkeys","children","registry","useMemo","reg","cmd","createCommandContext","useCallback","commandId","options","executeCommand","entry","ctx","canExecute","getCommand","getAllCommands","e","handleKeyDown","target","hotkeys","useEffect","value","jsx","useCommands","useContext","defaultProps","ChevronLeftIcon","size","className","ChevronRightIcon","ChevronFirstIcon","jsxs","ChevronLastIcon","MaximizeIcon","MinimizeIcon","TableOfContentsIcon","BookshelfIcon","ToolbarButton","onClick","ariaLabel","disabled","title","ActionButton","ToolbarContext","useToolbar","context","FirstPageButton","isFirstPage","handleClick","defaultIcon","FullscreenButton","enterIcon","exitIcon","ariaLabelEnter","ariaLabelExit","isFullscreen","setIsFullscreen","useState","updateFullscreenState","error","label","icon","LastPageButton","isLastPage","NextButton","PageIndicator","modeProp","showTotal","placeholder","editableProp","maxLength","pageSemantics","mode","editable","inputValue","setInputValue","isEditing","setIsEditing","leftPageIndex","rightPageIndex","getPageName","pageIndex","leftName","rightName","getTotalDisplay","i","name","buildDisplayText","firstName","secondName","rangeText","primarySemanticName","handleFocus","handleBlur","handleChange","displayText","PrevButton","TocButton","tocPageIndex","Toolbar","enableHotkeys","commands","setCurrentPage","setTotalPages","setIsFirstPage","setIsLastPage","updateState","fb","interval","toolbarContent"],"mappings":";;AAKO,MAAMA,IAAmD;AAAA,EAC/D,UAAU;AAAA,IACT,EAAE,KAAK,aAAA;AAAA,IACP,EAAE,KAAK,WAAA;AAAA,IACP,EAAE,KAAK,IAAA;AAAA;AAAA,EAAI;AAAA,EAEZ,UAAU,CAAC,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU;AAAA,EAClD,WAAW,CAAC,EAAE,KAAK,QAAQ;AAAA,EAC3B,UAAU,CAAC,EAAE,KAAK,OAAO;AAAA,EACzB,SAAS,CAAC,EAAE,KAAK,KAAK;AAAA,EACtB,kBAAkB,CAAC,EAAE,KAAK,KAAK;AAChC,GAKaC,IAA6B;AAAA,EACzC;AAAA,IACC,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS,CAAC,EAAE,aAAAC,QAAkB;AAC7B,MAAAA,EAAY,SAAS,SAAA;AAAA,IAEtB;AAAA,IACA,YAAY,CAAC,EAAE,aAAAC,GAAa,YAAAC,EAAA,MAAiBD,IAAcC,IAAa;AAAA,EAAA;AAAA,EAEzE;AAAA,IACC,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,SAAS,CAAC,EAAE,aAAAF,QAAkB;AAC7B,MAA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A;AAAA,MAGD,UAAA,gBAAAzC;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,WAAW,oBAAoBM,CAAS,GAAG,KAAA;AAAA,UAC3C,MAAK;AAAA,UACL,cAAW;AAAA,UACX,KAAK/B;AAAA,UAEJ,UAAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAIF,SACC,gBAAAqB;AAAA,IAAC1B;AAAA,IAAA;AAAA,MACA,aAAAZ;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,WAAAW;AAAA,MACA,UAAAwG;AAAA,MACA,gBAAAtG;AAAA,MACA,gBAAgB,CAACqG;AAAA,MAEhB,UAAAS;AAAA,IAAA;AAAA,EAAA;AAGJ;"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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.21",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "DoradSoft",
|
|
7
7
|
"main": "./dist/flip-book.js",
|
|
8
|
-
"types": "./dist/
|
|
8
|
+
"types": "./dist/FlipBook.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"import": "./dist/flip-book.js",
|
|
12
|
-
"types": "./dist/
|
|
12
|
+
"types": "./dist/FlipBook.d.ts"
|
|
13
13
|
},
|
|
14
14
|
"./toolbar": {
|
|
15
15
|
"import": "./dist/toolbar/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react-dom": "^18.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"html-flip-book-vanilla": "0.0.0-alpha.
|
|
41
|
+
"html-flip-book-vanilla": "0.0.0-alpha.21"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/react": "^19.2.8",
|