@prose-reader/react-reader 1.173.0 → 1.175.0
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/common/useFullscreen.d.ts +4 -0
- package/dist/components/ui/avatar.d.ts +16 -0
- package/dist/components/ui/checkbox.d.ts +8 -0
- package/dist/components/ui/close-button.d.ts +4 -0
- package/dist/components/ui/color-mode.d.ts +19 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/drawer.d.ts +19 -0
- package/dist/components/ui/field.d.ts +9 -0
- package/dist/components/ui/input-group.d.ts +12 -0
- package/dist/components/ui/popover.d.ts +17 -0
- package/dist/components/ui/progress.d.ts +9 -0
- package/dist/components/ui/provider.d.ts +2 -0
- package/dist/components/ui/radio.d.ts +8 -0
- package/dist/components/ui/slider.d.ts +11 -0
- package/dist/components/ui/toggle-tip.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts +11 -0
- package/dist/context/ReactReaderProvider.d.ts +5 -0
- package/dist/context/context.d.ts +3 -0
- package/dist/context/useReader.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +379 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.cjs +2 -0
- package/dist/index.umd.cjs.map +1 -0
- package/dist/navigation/QuickMenu/BottomBar.d.ts +3 -0
- package/dist/navigation/QuickMenu/PaginationInfoSection.d.ts +1 -0
- package/dist/navigation/QuickMenu/QuickBar.d.ts +4 -0
- package/dist/navigation/QuickMenu/QuickMenu.d.ts +5 -0
- package/dist/navigation/QuickMenu/Scrubber.d.ts +1 -0
- package/dist/navigation/QuickMenu/TimeIndicator.d.ts +3 -0
- package/dist/navigation/QuickMenu/TopBar.d.ts +5 -0
- package/dist/navigation/useNavigationContext.d.ts +11 -0
- package/dist/pagination/usePagination.d.ts +4 -0
- package/dist/settings/useSettings.d.ts +2 -0
- package/package.json +7 -4
- package/src/common/useFullscreen.ts +0 -44
- package/src/components/ui/avatar.tsx +0 -74
- package/src/components/ui/checkbox.tsx +0 -25
- package/src/components/ui/close-button.tsx +0 -17
- package/src/components/ui/color-mode.tsx +0 -75
- package/src/components/ui/dialog.tsx +0 -62
- package/src/components/ui/drawer.tsx +0 -52
- package/src/components/ui/field.tsx +0 -33
- package/src/components/ui/input-group.tsx +0 -53
- package/src/components/ui/popover.tsx +0 -59
- package/src/components/ui/progress.tsx +0 -34
- package/src/components/ui/provider.tsx +0 -12
- package/src/components/ui/radio.tsx +0 -24
- package/src/components/ui/slider.tsx +0 -82
- package/src/components/ui/toggle-tip.tsx +0 -70
- package/src/components/ui/tooltip.tsx +0 -46
- package/src/context/ReactReaderProvider.tsx +0 -14
- package/src/context/context.ts +0 -6
- package/src/context/useReader.ts +0 -9
- package/src/index.ts +0 -2
- package/src/navigation/QuickMenu/BottomBar.tsx +0 -65
- package/src/navigation/QuickMenu/PaginationInfoSection.tsx +0 -62
- package/src/navigation/QuickMenu/QuickBar.tsx +0 -40
- package/src/navigation/QuickMenu/QuickMenu.tsx +0 -22
- package/src/navigation/QuickMenu/Scrubber.tsx +0 -138
- package/src/navigation/QuickMenu/TimeIndicator.tsx +0 -29
- package/src/navigation/QuickMenu/TopBar.tsx +0 -72
- package/src/navigation/useNavigationContext.ts +0 -46
- package/src/pagination/usePagination.ts +0 -29
- package/src/settings/useSettings.ts +0 -9
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.app.json +0 -26
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -22
- package/vite.config.ts +0 -32
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GroupProps, SlotRecipeProps, Avatar as ChakraAvatar } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
type ImageProps = React.ImgHTMLAttributes<HTMLImageElement>;
|
|
4
|
+
export interface AvatarProps extends ChakraAvatar.RootProps {
|
|
5
|
+
name?: string;
|
|
6
|
+
src?: string;
|
|
7
|
+
srcSet?: string;
|
|
8
|
+
loading?: ImageProps["loading"];
|
|
9
|
+
icon?: React.ReactElement;
|
|
10
|
+
fallback?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
interface AvatarGroupProps extends GroupProps, SlotRecipeProps<"avatar"> {
|
|
14
|
+
}
|
|
15
|
+
export declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Checkbox as ChakraCheckbox } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface CheckboxProps extends ChakraCheckbox.RootProps {
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
6
|
+
rootRef?: React.Ref<HTMLLabelElement>;
|
|
7
|
+
}
|
|
8
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IconButtonProps } from '@chakra-ui/react';
|
|
2
|
+
import { ThemeProviderProps } from 'next-themes';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export interface ColorModeProviderProps extends ThemeProviderProps {
|
|
5
|
+
}
|
|
6
|
+
export declare function ColorModeProvider(props: ColorModeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export type ColorMode = "light" | "dark";
|
|
8
|
+
export interface UseColorModeReturn {
|
|
9
|
+
colorMode: ColorMode;
|
|
10
|
+
setColorMode: (colorMode: ColorMode) => void;
|
|
11
|
+
toggleColorMode: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function useColorMode(): UseColorModeReturn;
|
|
14
|
+
export declare function useColorModeValue<T>(light: T, dark: T): T;
|
|
15
|
+
export declare function ColorModeIcon(): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
interface ColorModeButtonProps extends Omit<IconButtonProps, "aria-label"> {
|
|
17
|
+
}
|
|
18
|
+
export declare const ColorModeButton: React.ForwardRefExoticComponent<ColorModeButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Dialog as ChakraDialog } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface DialogContentProps extends ChakraDialog.ContentProps {
|
|
4
|
+
portalled?: boolean;
|
|
5
|
+
portalRef?: React.RefObject<HTMLElement>;
|
|
6
|
+
backdrop?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const DialogCloseTrigger: React.ForwardRefExoticComponent<ChakraDialog.CloseTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export declare const DialogRoot: React.FC<ChakraDialog.RootProps>;
|
|
11
|
+
export declare const DialogFooter: React.ForwardRefExoticComponent<ChakraDialog.FooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const DialogHeader: React.ForwardRefExoticComponent<ChakraDialog.HeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const DialogBody: React.ForwardRefExoticComponent<ChakraDialog.BodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const DialogBackdrop: React.ForwardRefExoticComponent<ChakraDialog.BackdropProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const DialogTitle: React.ForwardRefExoticComponent<ChakraDialog.TitleProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export declare const DialogDescription: React.ForwardRefExoticComponent<ChakraDialog.DescriptionProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare const DialogTrigger: React.ForwardRefExoticComponent<ChakraDialog.TriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
export declare const DialogActionTrigger: React.ForwardRefExoticComponent<ChakraDialog.ActionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Drawer as ChakraDrawer } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface DrawerContentProps extends ChakraDrawer.ContentProps {
|
|
4
|
+
portalled?: boolean;
|
|
5
|
+
portalRef?: React.RefObject<HTMLElement>;
|
|
6
|
+
offset?: ChakraDrawer.ContentProps["padding"];
|
|
7
|
+
}
|
|
8
|
+
export declare const DrawerContent: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const DrawerCloseTrigger: React.ForwardRefExoticComponent<ChakraDrawer.CloseTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export declare const DrawerTrigger: React.ForwardRefExoticComponent<ChakraDrawer.TriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export declare const DrawerRoot: React.FC<ChakraDrawer.RootProps>;
|
|
12
|
+
export declare const DrawerFooter: React.ForwardRefExoticComponent<ChakraDrawer.FooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const DrawerHeader: React.ForwardRefExoticComponent<ChakraDrawer.HeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const DrawerBody: React.ForwardRefExoticComponent<ChakraDrawer.BodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const DrawerBackdrop: React.ForwardRefExoticComponent<ChakraDrawer.BackdropProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export declare const DrawerDescription: React.ForwardRefExoticComponent<ChakraDrawer.DescriptionProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare const DrawerTitle: React.ForwardRefExoticComponent<ChakraDrawer.TitleProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export declare const DrawerActionTrigger: React.ForwardRefExoticComponent<ChakraDrawer.ActionTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Field as ChakraField } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface FieldProps extends Omit<ChakraField.RootProps, "label"> {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
helperText?: React.ReactNode;
|
|
6
|
+
errorText?: React.ReactNode;
|
|
7
|
+
optionalText?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const Field: React.ForwardRefExoticComponent<FieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BoxProps, InputElementProps } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface InputGroupProps extends BoxProps {
|
|
4
|
+
startElementProps?: InputElementProps;
|
|
5
|
+
endElementProps?: InputElementProps;
|
|
6
|
+
startElement?: React.ReactNode;
|
|
7
|
+
endElement?: React.ReactNode;
|
|
8
|
+
children: React.ReactElement<InputElementProps>;
|
|
9
|
+
startOffset?: InputElementProps["paddingStart"];
|
|
10
|
+
endOffset?: InputElementProps["paddingEnd"];
|
|
11
|
+
}
|
|
12
|
+
export declare const InputGroup: React.ForwardRefExoticComponent<InputGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Popover as ChakraPopover } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface PopoverContentProps extends ChakraPopover.ContentProps {
|
|
4
|
+
portalled?: boolean;
|
|
5
|
+
portalRef?: React.RefObject<HTMLElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const PopoverArrow: React.ForwardRefExoticComponent<ChakraPopover.ArrowProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const PopoverCloseTrigger: React.ForwardRefExoticComponent<ChakraPopover.CloseTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export declare const PopoverTitle: React.ForwardRefExoticComponent<ChakraPopover.TitleProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export declare const PopoverDescription: React.ForwardRefExoticComponent<ChakraPopover.DescriptionProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const PopoverFooter: React.ForwardRefExoticComponent<ChakraPopover.FooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const PopoverHeader: React.ForwardRefExoticComponent<ChakraPopover.HeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const PopoverRoot: React.FC<ChakraPopover.RootProps>;
|
|
15
|
+
export declare const PopoverBody: React.ForwardRefExoticComponent<ChakraPopover.BodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export declare const PopoverTrigger: React.ForwardRefExoticComponent<ChakraPopover.TriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Progress as ChakraProgress } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare const ProgressBar: React.ForwardRefExoticComponent<ChakraProgress.TrackProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export interface ProgressLabelProps extends ChakraProgress.LabelProps {
|
|
5
|
+
info?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const ProgressLabel: React.ForwardRefExoticComponent<ProgressLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const ProgressRoot: React.ForwardRefExoticComponent<ChakraProgress.RootProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const ProgressValueText: React.ForwardRefExoticComponent<ChakraProgress.ValueTextProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RadioGroup as ChakraRadioGroup } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface RadioProps extends ChakraRadioGroup.ItemProps {
|
|
4
|
+
rootRef?: React.Ref<HTMLDivElement>;
|
|
5
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
8
|
+
export declare const RadioGroup: React.ForwardRefExoticComponent<ChakraRadioGroup.RootProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Slider as ChakraSlider } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface SliderProps extends ChakraSlider.RootProps {
|
|
4
|
+
marks?: Array<number | {
|
|
5
|
+
value: number;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
showValue?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Popover as ChakraPopover } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface ToggleTipProps extends ChakraPopover.RootProps {
|
|
4
|
+
showArrow?: boolean;
|
|
5
|
+
portalled?: boolean;
|
|
6
|
+
portalRef?: React.RefObject<HTMLElement>;
|
|
7
|
+
content?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const ToggleTip: React.ForwardRefExoticComponent<ToggleTipProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const InfoTip: React.ForwardRefExoticComponent<Partial<ToggleTipProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Tooltip as ChakraTooltip } from '@chakra-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface TooltipProps extends ChakraTooltip.RootProps {
|
|
4
|
+
showArrow?: boolean;
|
|
5
|
+
portalled?: boolean;
|
|
6
|
+
portalRef?: React.RefObject<HTMLElement>;
|
|
7
|
+
content: React.ReactNode;
|
|
8
|
+
contentProps?: ChakraTooltip.ContentProps;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { jsxs as c, jsx as r, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import { createContext as M, useContext as W, memo as w, useCallback as $, useEffect as R, useState as B } from "react";
|
|
4
|
+
import { Popover as h, Portal as L, IconButton as f, Progress as x, Stack as A, HStack as T, Text as g, Presence as V, Box as j } from "@chakra-ui/react";
|
|
5
|
+
import { RxDoubleArrowUp as N, RxDoubleArrowLeft as U, RxDoubleArrowDown as G, RxDoubleArrowRight as _ } from "react-icons/rx";
|
|
6
|
+
import { useObserve as b, useSubscribe as H, useSignal as Q } from "reactjrx";
|
|
7
|
+
import { HiOutlineInformationCircle as q } from "react-icons/hi";
|
|
8
|
+
import { NEVER as J, combineLatest as K, map as X } from "rxjs";
|
|
9
|
+
import Y from "rc-slider";
|
|
10
|
+
import "rc-slider/assets/index.css";
|
|
11
|
+
import { IoIosArrowBack as Z, IoMdMore as ee } from "react-icons/io";
|
|
12
|
+
import { MdFullscreenExit as te, MdFullscreen as ne } from "react-icons/md";
|
|
13
|
+
const D = M(void 0), I = () => W(D), re = p.forwardRef(
|
|
14
|
+
function(t, n) {
|
|
15
|
+
const {
|
|
16
|
+
showArrow: s,
|
|
17
|
+
children: o,
|
|
18
|
+
portalled: i = !0,
|
|
19
|
+
content: l,
|
|
20
|
+
portalRef: d,
|
|
21
|
+
...a
|
|
22
|
+
} = t;
|
|
23
|
+
return /* @__PURE__ */ c(
|
|
24
|
+
h.Root,
|
|
25
|
+
{
|
|
26
|
+
...a,
|
|
27
|
+
positioning: { ...a.positioning, gutter: 4 },
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ r(h.Trigger, { asChild: !0, children: o }),
|
|
30
|
+
/* @__PURE__ */ r(L, { disabled: !i, container: d, children: /* @__PURE__ */ r(h.Positioner, { children: /* @__PURE__ */ c(
|
|
31
|
+
h.Content,
|
|
32
|
+
{
|
|
33
|
+
width: "auto",
|
|
34
|
+
px: "2",
|
|
35
|
+
py: "1",
|
|
36
|
+
textStyle: "xs",
|
|
37
|
+
rounded: "sm",
|
|
38
|
+
ref: n,
|
|
39
|
+
children: [
|
|
40
|
+
s && /* @__PURE__ */ r(h.Arrow, { children: /* @__PURE__ */ r(h.ArrowTip, {}) }),
|
|
41
|
+
l
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
) }) })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
), oe = p.forwardRef(function(t, n) {
|
|
50
|
+
const { children: s, ...o } = t;
|
|
51
|
+
return /* @__PURE__ */ r(re, { content: s, ...o, ref: n, children: /* @__PURE__ */ r(
|
|
52
|
+
f,
|
|
53
|
+
{
|
|
54
|
+
variant: "ghost",
|
|
55
|
+
"aria-label": "info",
|
|
56
|
+
size: "2xs",
|
|
57
|
+
colorPalette: "gray",
|
|
58
|
+
children: /* @__PURE__ */ r(q, {})
|
|
59
|
+
}
|
|
60
|
+
) });
|
|
61
|
+
}), se = p.forwardRef(function(t, n) {
|
|
62
|
+
return /* @__PURE__ */ r(x.Track, { ...t, ref: n, children: /* @__PURE__ */ r(x.Range, {}) });
|
|
63
|
+
});
|
|
64
|
+
p.forwardRef(function(t, n) {
|
|
65
|
+
const { children: s, info: o, ...i } = t;
|
|
66
|
+
return /* @__PURE__ */ c(x.Label, { ...i, ref: n, children: [
|
|
67
|
+
s,
|
|
68
|
+
o && /* @__PURE__ */ r(oe, { children: o })
|
|
69
|
+
] });
|
|
70
|
+
});
|
|
71
|
+
const ie = x.Root, le = x.ValueText, P = () => {
|
|
72
|
+
const e = I();
|
|
73
|
+
return b(
|
|
74
|
+
() => e ? K([e.pagination.state$, e.context.state$]).pipe(
|
|
75
|
+
X(([t, n]) => {
|
|
76
|
+
var o;
|
|
77
|
+
const s = (o = n.manifest) == null ? void 0 : o.spineItems.every(
|
|
78
|
+
(i) => {
|
|
79
|
+
var l;
|
|
80
|
+
return (l = i.mediaType) == null ? void 0 : l.startsWith("image/");
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
return {
|
|
84
|
+
...t,
|
|
85
|
+
hasChapters: !n.isFullyPrePaginated && !s
|
|
86
|
+
};
|
|
87
|
+
})
|
|
88
|
+
) : J,
|
|
89
|
+
[e]
|
|
90
|
+
);
|
|
91
|
+
}, k = () => {
|
|
92
|
+
const e = P(), t = (e == null ? void 0 : e.numberOfTotalPages) === 1, n = ((e == null ? void 0 : e.beginNumberOfPagesInSpineItem) ?? 0) > 1, s = ((e == null ? void 0 : e.endNumberOfPagesInSpineItem) ?? 0) > 1, o = (e != null && e.hasChapters ? e == null ? void 0 : e.beginPageIndexInSpineItem : e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0, i = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [l = 0, d = 0] = [
|
|
93
|
+
o,
|
|
94
|
+
i
|
|
95
|
+
].sort((m, S) => m - S), a = (e == null ? void 0 : e.beginPageIndexInSpineItem) !== (e == null ? void 0 : e.endPageIndexInSpineItem) || (e == null ? void 0 : e.beginSpineItemIndex) !== (e == null ? void 0 : e.endSpineItemIndex), u = e != null && e.hasChapters ? e == null ? void 0 : e.beginNumberOfPagesInSpineItem : e == null ? void 0 : e.numberOfTotalPages;
|
|
96
|
+
return {
|
|
97
|
+
hasOnlyOnePage: t,
|
|
98
|
+
beginPageIndex: o,
|
|
99
|
+
endPageIndex: i,
|
|
100
|
+
isBeginWithinChapter: n,
|
|
101
|
+
isEndWithinChapter: s,
|
|
102
|
+
beginAndEndAreDifferent: a,
|
|
103
|
+
totalApproximatePages: u,
|
|
104
|
+
leftPageIndex: l,
|
|
105
|
+
rightPageIndex: d
|
|
106
|
+
};
|
|
107
|
+
}, ce = () => {
|
|
108
|
+
const e = P(), {
|
|
109
|
+
hasOnlyOnePage: t,
|
|
110
|
+
leftPageIndex: n,
|
|
111
|
+
rightPageIndex: s,
|
|
112
|
+
totalApproximatePages: o,
|
|
113
|
+
beginAndEndAreDifferent: i
|
|
114
|
+
} = k(), l = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), d = (u) => u != null && u.subChapter ? `${u.title} / ${d(u.subChapter)}` : (u == null ? void 0 : u.title) || "", a = d(e == null ? void 0 : e.beginChapterInfo);
|
|
115
|
+
return /* @__PURE__ */ c(A, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
|
|
116
|
+
/* @__PURE__ */ r(ie, { value: l, size: "xs", width: 150, children: /* @__PURE__ */ c(T, { justifyContent: "space-between", children: [
|
|
117
|
+
/* @__PURE__ */ r(se, { width: 110 }),
|
|
118
|
+
/* @__PURE__ */ r(le, { children: `${l}%` })
|
|
119
|
+
] }) }),
|
|
120
|
+
/* @__PURE__ */ r(g, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: a ? `Chapter: ${a}` : " " }),
|
|
121
|
+
!t && /* @__PURE__ */ c(T, { children: [
|
|
122
|
+
/* @__PURE__ */ r(g, { fontSize: "xs", children: i ? `${n + 1} - ${s + 1} of ${o}` : `${n + 1} of ${o}` }),
|
|
123
|
+
!!(e != null && e.hasChapters) && /* @__PURE__ */ c(y, { children: [
|
|
124
|
+
/* @__PURE__ */ r(g, { children: "-" }),
|
|
125
|
+
/* @__PURE__ */ c(g, { fontSize: "xs", children: [
|
|
126
|
+
"(",
|
|
127
|
+
((e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0) + 1,
|
|
128
|
+
")"
|
|
129
|
+
] })
|
|
130
|
+
] })
|
|
131
|
+
] })
|
|
132
|
+
] });
|
|
133
|
+
}, E = w(
|
|
134
|
+
({
|
|
135
|
+
children: e,
|
|
136
|
+
position: t,
|
|
137
|
+
...n
|
|
138
|
+
}) => /* @__PURE__ */ r(
|
|
139
|
+
V,
|
|
140
|
+
{
|
|
141
|
+
display: "flex",
|
|
142
|
+
flexDirection: "row",
|
|
143
|
+
width: "100%",
|
|
144
|
+
position: "absolute",
|
|
145
|
+
...t === "bottom" ? { bottom: 0 } : { top: 0 },
|
|
146
|
+
animationName: t === "bottom" ? {
|
|
147
|
+
_open: "slide-from-bottom, fade-in",
|
|
148
|
+
_closed: "slide-to-bottom, fade-out"
|
|
149
|
+
} : {
|
|
150
|
+
_open: "slide-from-top, fade-in",
|
|
151
|
+
_closed: "slide-to-top, fade-out"
|
|
152
|
+
},
|
|
153
|
+
animationDuration: "moderate",
|
|
154
|
+
bgColor: "bg.panel",
|
|
155
|
+
alignItems: "center",
|
|
156
|
+
justifyContent: "center",
|
|
157
|
+
shadow: "md",
|
|
158
|
+
px: 4,
|
|
159
|
+
...n,
|
|
160
|
+
children: e
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
), ae = () => {
|
|
164
|
+
const e = P(), t = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: n, totalApproximatePages: s = 0 } = k(), o = t ? Math.floor((n || 0) / 2) : n, [i, l] = Q({
|
|
165
|
+
default: o || 0
|
|
166
|
+
}), d = 0, a = Math.max(
|
|
167
|
+
0,
|
|
168
|
+
t ? Math.floor((s - 1) / 2) : s - 1
|
|
169
|
+
);
|
|
170
|
+
return R(() => {
|
|
171
|
+
l.setValue(o || 0);
|
|
172
|
+
}, [o, l]), {
|
|
173
|
+
value: i,
|
|
174
|
+
valueSignal: l,
|
|
175
|
+
min: d,
|
|
176
|
+
max: a
|
|
177
|
+
};
|
|
178
|
+
}, ue = () => {
|
|
179
|
+
const e = I(), t = P(), { manifest: n } = b(() => e == null ? void 0 : e.context.state$, []) ?? {}, s = (n == null ? void 0 : n.readingDirection) === "rtl", o = t == null ? void 0 : t.isUsingSpread, { totalApproximatePages: i = 0, isBeginWithinChapter: l } = k(), d = 1, a = l, { value: u, valueSignal: m, min: S, max: F } = ae(), z = $(
|
|
180
|
+
(C) => {
|
|
181
|
+
const [v = 0] = Array.isArray(C) ? C : [C];
|
|
182
|
+
m.setValue(v);
|
|
183
|
+
const O = o ? Math.floor(v) * 2 : Math.floor(v);
|
|
184
|
+
a ? e == null || e.navigation.goToPageOfSpineItem({
|
|
185
|
+
pageIndex: O,
|
|
186
|
+
spineItemId: e.pagination.getState().beginSpineItemIndex ?? 0,
|
|
187
|
+
animation: !1
|
|
188
|
+
}) : e == null || e.navigation.goToAbsolutePageIndex({
|
|
189
|
+
absolutePageIndex: O,
|
|
190
|
+
animation: !1
|
|
191
|
+
});
|
|
192
|
+
},
|
|
193
|
+
[e, o, m, a]
|
|
194
|
+
);
|
|
195
|
+
return H(
|
|
196
|
+
() => e == null ? void 0 : e.navigation.throttleLock({
|
|
197
|
+
duration: 100,
|
|
198
|
+
trigger: m.subject
|
|
199
|
+
}),
|
|
200
|
+
[e, m]
|
|
201
|
+
), i === 1 || o && i === 2 ? null : /* @__PURE__ */ r(
|
|
202
|
+
Y,
|
|
203
|
+
{
|
|
204
|
+
value: [u],
|
|
205
|
+
max: F,
|
|
206
|
+
min: S,
|
|
207
|
+
reverse: s,
|
|
208
|
+
step: d,
|
|
209
|
+
onChange: z
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}, de = () => {
|
|
213
|
+
const [e, t] = B(/* @__PURE__ */ new Date());
|
|
214
|
+
return R(() => {
|
|
215
|
+
const n = setInterval(() => {
|
|
216
|
+
t(/* @__PURE__ */ new Date());
|
|
217
|
+
}, 6e4);
|
|
218
|
+
return () => clearInterval(n);
|
|
219
|
+
}, []), e;
|
|
220
|
+
}, me = (e) => {
|
|
221
|
+
const t = de();
|
|
222
|
+
return /* @__PURE__ */ r(g, { fontSize: "xs", ...e, children: t.toLocaleTimeString(navigator.language, {
|
|
223
|
+
hour: "2-digit",
|
|
224
|
+
minute: "2-digit"
|
|
225
|
+
}) });
|
|
226
|
+
}, he = ({ open: e }) => {
|
|
227
|
+
const t = I(), n = b(() => t == null ? void 0 : t.navigation.state$, [t]), s = b(() => t == null ? void 0 : t.settings.values$, [t]), o = (s == null ? void 0 : s.computedPageTurnDirection) === "vertical";
|
|
228
|
+
return /* @__PURE__ */ c(E, { present: e, position: "bottom", height: 130, children: [
|
|
229
|
+
/* @__PURE__ */ r(
|
|
230
|
+
f,
|
|
231
|
+
{
|
|
232
|
+
"aria-label": "left",
|
|
233
|
+
size: "lg",
|
|
234
|
+
variant: "ghost",
|
|
235
|
+
flexShrink: 0,
|
|
236
|
+
onClick: () => t == null ? void 0 : t.navigation.goToLeftOrTopSpineItem(),
|
|
237
|
+
disabled: !(n != null && n.canGoLeftSpineItem) && !(n != null && n.canGoTopSpineItem),
|
|
238
|
+
children: o ? /* @__PURE__ */ r(N, {}) : /* @__PURE__ */ r(U, {})
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ c(
|
|
242
|
+
A,
|
|
243
|
+
{
|
|
244
|
+
flex: 1,
|
|
245
|
+
maxW: 400,
|
|
246
|
+
gap: 2,
|
|
247
|
+
alignItems: "center",
|
|
248
|
+
overflow: "auto",
|
|
249
|
+
px: 4,
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ r(ce, {}),
|
|
252
|
+
/* @__PURE__ */ r(j, { height: 5, maxW: 300, width: "100%", overflow: "visible", children: /* @__PURE__ */ r(ue, {}) })
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
),
|
|
256
|
+
/* @__PURE__ */ r(
|
|
257
|
+
f,
|
|
258
|
+
{
|
|
259
|
+
"aria-label": "right",
|
|
260
|
+
size: "lg",
|
|
261
|
+
flexShrink: 0,
|
|
262
|
+
variant: "ghost",
|
|
263
|
+
disabled: !(n != null && n.canGoRightSpineItem) && !(n != null && n.canGoBottomSpineItem),
|
|
264
|
+
onClick: () => {
|
|
265
|
+
t == null || t.navigation.goToRightOrBottomSpineItem();
|
|
266
|
+
},
|
|
267
|
+
children: o ? /* @__PURE__ */ r(G, {}) : /* @__PURE__ */ r(_, {})
|
|
268
|
+
}
|
|
269
|
+
),
|
|
270
|
+
/* @__PURE__ */ r(me, { position: "absolute", bottom: 0, left: 0, p: 2 })
|
|
271
|
+
] });
|
|
272
|
+
}, ge = () => {
|
|
273
|
+
const [e, t] = B(!1), n = $(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
|
|
274
|
+
t(!1);
|
|
275
|
+
}) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
|
|
276
|
+
t(!0);
|
|
277
|
+
}), []);
|
|
278
|
+
return R(() => {
|
|
279
|
+
function s() {
|
|
280
|
+
t(!!document.fullscreenElement);
|
|
281
|
+
}
|
|
282
|
+
return document.addEventListener("fullscreenchange", s), () => {
|
|
283
|
+
document.removeEventListener("fullscreenchange", s);
|
|
284
|
+
};
|
|
285
|
+
}, []), {
|
|
286
|
+
isFullscreen: e,
|
|
287
|
+
onToggleFullscreenClick: n
|
|
288
|
+
};
|
|
289
|
+
}, fe = ({
|
|
290
|
+
open: e,
|
|
291
|
+
onBackClick: t,
|
|
292
|
+
onMoreClick: n
|
|
293
|
+
}) => {
|
|
294
|
+
const s = I(), o = b(() => s == null ? void 0 : s.context.manifest$, [s]), { isFullscreen: i, onToggleFullscreenClick: l } = ge();
|
|
295
|
+
return /* @__PURE__ */ c(
|
|
296
|
+
E,
|
|
297
|
+
{
|
|
298
|
+
present: e,
|
|
299
|
+
position: "top",
|
|
300
|
+
height: "80px",
|
|
301
|
+
justifyContent: "space-between",
|
|
302
|
+
children: [
|
|
303
|
+
/* @__PURE__ */ r(
|
|
304
|
+
f,
|
|
305
|
+
{
|
|
306
|
+
"aria-label": "left",
|
|
307
|
+
size: "lg",
|
|
308
|
+
variant: "ghost",
|
|
309
|
+
flexShrink: 0,
|
|
310
|
+
onClick: t,
|
|
311
|
+
children: /* @__PURE__ */ r(Z, {})
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
/* @__PURE__ */ r(
|
|
315
|
+
A,
|
|
316
|
+
{
|
|
317
|
+
flex: 1,
|
|
318
|
+
maxW: 600,
|
|
319
|
+
gap: 1,
|
|
320
|
+
alignItems: "center",
|
|
321
|
+
overflow: "auto",
|
|
322
|
+
px: 4,
|
|
323
|
+
children: /* @__PURE__ */ r(g, { truncate: !0, maxWidth: "100%", children: o == null ? void 0 : o.title })
|
|
324
|
+
}
|
|
325
|
+
),
|
|
326
|
+
/* @__PURE__ */ c(T, { children: [
|
|
327
|
+
/* @__PURE__ */ r(
|
|
328
|
+
f,
|
|
329
|
+
{
|
|
330
|
+
"aria-label": "right",
|
|
331
|
+
size: "lg",
|
|
332
|
+
flexShrink: 0,
|
|
333
|
+
variant: "ghost",
|
|
334
|
+
onClick: n,
|
|
335
|
+
children: /* @__PURE__ */ r(ee, {})
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
/* @__PURE__ */ r(
|
|
339
|
+
f,
|
|
340
|
+
{
|
|
341
|
+
"aria-label": "right",
|
|
342
|
+
size: "lg",
|
|
343
|
+
flexShrink: 0,
|
|
344
|
+
variant: "ghost",
|
|
345
|
+
onClick: l,
|
|
346
|
+
children: i ? /* @__PURE__ */ r(te, {}) : /* @__PURE__ */ r(ne, {})
|
|
347
|
+
}
|
|
348
|
+
)
|
|
349
|
+
] })
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
}, Ae = w(
|
|
354
|
+
({
|
|
355
|
+
open: e,
|
|
356
|
+
onBackClick: t,
|
|
357
|
+
onMoreClick: n
|
|
358
|
+
}) => /* @__PURE__ */ c(y, { children: [
|
|
359
|
+
/* @__PURE__ */ r(
|
|
360
|
+
fe,
|
|
361
|
+
{
|
|
362
|
+
open: e,
|
|
363
|
+
onBackClick: t,
|
|
364
|
+
onMoreClick: n
|
|
365
|
+
}
|
|
366
|
+
),
|
|
367
|
+
/* @__PURE__ */ r(he, { open: e })
|
|
368
|
+
] })
|
|
369
|
+
), ke = w(
|
|
370
|
+
({
|
|
371
|
+
children: e,
|
|
372
|
+
reader: t
|
|
373
|
+
}) => /* @__PURE__ */ r(D.Provider, { value: t, children: e })
|
|
374
|
+
);
|
|
375
|
+
export {
|
|
376
|
+
Ae as QuickMenu,
|
|
377
|
+
ke as ReactReaderProvider
|
|
378
|
+
};
|
|
379
|
+
//# sourceMappingURL=index.js.map
|