@ankhorage/zora 23.4.3 → 24.0.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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/constants/authoring.d.ts +3 -3
- package/dist/constants/authoring.d.ts.map +1 -1
- package/dist/constants/authoring.js +1 -1
- package/dist/constants/authoring.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
- package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
- package/dist/features/card/cardMeta.d.ts +1 -1
- package/dist/features/card/mediaCardMeta.d.ts +1 -1
- package/dist/features/card/postCardMeta.d.ts +1 -1
- package/dist/features/chat/messageBubbleMeta.d.ts +1 -1
- package/dist/features/dialog/dialogMeta.d.ts +2 -2
- package/dist/features/gradient/gradientMeta.d.ts +1 -1
- package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
- package/dist/features/layout/gridMeta.d.ts +1 -1
- package/dist/features/layout/screenMeta.d.ts +1 -1
- package/dist/features/layout/scrollViewMeta.d.ts +1 -1
- package/dist/features/layout/viewMeta.d.ts +1 -1
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/features/reader/adapters/inbound/Reader.d.ts +9 -0
- package/dist/features/reader/adapters/inbound/Reader.d.ts.map +1 -0
- package/dist/features/reader/adapters/inbound/{ReaderSurface.js → Reader.js} +33 -9
- package/dist/features/reader/adapters/inbound/Reader.js.map +1 -0
- package/dist/features/reader/composition/useReaderController.d.ts +24 -0
- package/dist/features/reader/composition/useReaderController.d.ts.map +1 -0
- package/dist/features/reader/composition/useReaderController.js +73 -0
- package/dist/features/reader/composition/useReaderController.js.map +1 -0
- package/dist/features/reader/meta.d.ts +5 -9
- package/dist/features/reader/meta.d.ts.map +1 -1
- package/dist/features/reader/meta.js +3 -7
- package/dist/features/reader/meta.js.map +1 -1
- package/dist/features/reader/public.d.ts +2 -2
- package/dist/features/reader/public.d.ts.map +1 -1
- package/dist/features/reader/public.js +1 -1
- package/dist/features/reader/public.js.map +1 -1
- package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js +2 -2
- package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js.map +1 -1
- package/dist/features/registry/bindableComponentMeta.d.ts +5 -9
- package/dist/features/registry/bindableComponentMeta.d.ts.map +1 -1
- package/dist/features/registry/bindableComponentMeta.js +4 -4
- package/dist/features/registry/bindableComponentMeta.js.map +1 -1
- package/dist/features/registry/componentMeta.js +2 -2
- package/dist/features/registry/componentMeta.js.map +1 -1
- package/dist/features/scanner/meta.d.ts +2 -2
- package/dist/features/section/screenSectionMeta.d.ts +1 -1
- package/dist/features/surface/surfaceMeta.d.ts +1 -1
- package/dist/features/tabs/tabPanelMeta.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/reader.d.ts +3 -21
- package/dist/types/reader.d.ts.map +1 -1
- package/dist/types/reader.js.map +1 -1
- package/package.json +3 -2
- package/src/constants/authoring.ts +1 -1
- package/src/features/reader/adapters/inbound/{ReaderSurface.test.ts → Reader.test.ts} +6 -5
- package/src/features/reader/adapters/inbound/{ReaderSurface.tsx → Reader.tsx} +67 -33
- package/src/features/reader/composition/useReaderController.ts +110 -0
- package/src/features/reader/meta.ts +3 -8
- package/src/features/reader/public.ts +2 -2
- package/src/features/reader/utils/resolveReaderProgress.test.ts +1 -1
- package/src/features/registry/ZORA_COMPONENT_REGISTRY.ts +2 -2
- package/src/features/registry/bindableComponentMeta.test.ts +2 -2
- package/src/features/registry/bindableComponentMeta.ts +4 -4
- package/src/features/registry/componentMeta.test.ts +5 -5
- package/src/features/registry/componentMeta.ts +2 -2
- package/src/index.ts +2 -2
- package/src/interactionPolicy.test.ts +3 -3
- package/src/showcaseCoverage.test.ts +1 -1
- package/src/types/reader.ts +16 -29
- package/web-dist/chunks/{Accordion-ct805sm7.js → Accordion-0acrkcyd.js} +3 -3
- package/web-dist/chunks/{Accordion-m4brcz8v.js → Accordion-122fdtp0.js} +6 -6
- package/web-dist/chunks/{Accordion-6xrse5my.js → Accordion-1dah5bqg.js} +1 -1
- package/web-dist/chunks/{Accordion-yae3m7g7.js → Accordion-2afa2z5x.js} +4 -4
- package/web-dist/chunks/{Accordion-0047zyx7.js → Accordion-2bsecqwf.js} +4 -4
- package/web-dist/chunks/{Accordion-basd2gyf.js → Accordion-2csc57rv.js} +2 -2
- package/web-dist/chunks/{Accordion-73x0gt11.js → Accordion-2d3hbryv.js} +7 -7
- package/web-dist/chunks/{Accordion-8fne0gf9.js → Accordion-2q6p67xe.js} +5 -5
- package/web-dist/chunks/{Accordion-axxgq453.js → Accordion-3f5vnfk8.js} +7 -7
- package/web-dist/chunks/{Accordion-gkx1kszz.js → Accordion-3hg1wprb.js} +2 -2
- package/web-dist/chunks/{Accordion-d24n7srd.js → Accordion-3rv8psbv.js} +4 -4
- package/web-dist/chunks/{Accordion-8z7naxj2.js → Accordion-74rt38d4.js} +1 -1
- package/web-dist/chunks/{Accordion-2dqpjya2.js → Accordion-7bb37pdc.js} +7 -7
- package/web-dist/chunks/{Accordion-adc7k14q.js → Accordion-7q1qf7c0.js} +5 -5
- package/web-dist/chunks/{Accordion-zgzrah0a.js → Accordion-7rvtpcwt.js} +6 -6
- package/web-dist/chunks/{Accordion-a1ervhyg.js → Accordion-9rhbc32v.js} +14 -14
- package/web-dist/chunks/{Accordion-37n4bt3g.js → Accordion-ae7m1dkn.js} +2 -2
- package/web-dist/chunks/{Accordion-ekjwm5dw.js → Accordion-ansfkmye.js} +4 -4
- package/web-dist/chunks/{Accordion-qyssgtwe.js → Accordion-apwk2wjr.js} +2 -2
- package/web-dist/chunks/{Accordion-vjgk1sz7.js → Accordion-avnt7nkz.js} +2 -2
- package/web-dist/chunks/{Accordion-wxbh98kp.js → Accordion-brt4drx3.js} +9 -9
- package/web-dist/chunks/{Accordion-6ytrt7xj.js → Accordion-cs8k948c.js} +6 -6
- package/web-dist/chunks/{Accordion-693gvpde.js → Accordion-egq42kdy.js} +4 -4
- package/web-dist/chunks/{Accordion-8bxy3g7a.js → Accordion-fvkwq99h.js} +4 -4
- package/web-dist/chunks/{Accordion-mbqtk7y0.js → Accordion-g0c439br.js} +2 -2
- package/web-dist/chunks/{Accordion-3m6de80j.js → Accordion-h46676ex.js} +2 -2
- package/web-dist/chunks/{Accordion-7y9wt946.js → Accordion-hwd5ntgm.js} +2 -2
- package/web-dist/chunks/{Accordion-k6dg8zd2.js → Accordion-jdwwf626.js} +3 -3
- package/web-dist/chunks/{Accordion-q9zge7kd.js → Accordion-jkhq422b.js} +2 -2
- package/web-dist/chunks/{Accordion-p0fh69qq.js → Accordion-jtrpmvzs.js} +6 -6
- package/web-dist/chunks/{Accordion-tdjh81ax.js → Accordion-k8tfv274.js} +6 -6
- package/web-dist/chunks/{Accordion-1xpq9bxk.js → Accordion-kcwdwd5z.js} +8 -8
- package/web-dist/chunks/{Accordion-v4n4ygwn.js → Accordion-kpap0trj.js} +1 -1
- package/web-dist/chunks/{Accordion-rmp9sfra.js → Accordion-kpxyryke.js} +2 -2
- package/web-dist/chunks/{Accordion-wgesygtk.js → Accordion-mdc214tk.js} +11 -11
- package/web-dist/chunks/{Accordion-nkd7nhyx.js → Accordion-nanvzve9.js} +5 -5
- package/web-dist/chunks/{Accordion-ph15h010.js → Accordion-nay7yexy.js} +11 -11
- package/web-dist/chunks/{Accordion-9qvmwkxe.js → Accordion-nh0cs9hq.js} +31 -1
- package/web-dist/chunks/{Accordion-snyacfyh.js → Accordion-nj9g6p48.js} +9 -9
- package/web-dist/chunks/{Accordion-dbxpv5eq.js → Accordion-q1mnv5g8.js} +4 -4
- package/web-dist/chunks/{Accordion-1e1nfhtc.js → Accordion-qj4qxx1p.js} +6 -6
- package/web-dist/chunks/{Accordion-bz2dzbad.js → Accordion-qsxx5q34.js} +10 -10
- package/web-dist/chunks/{Accordion-ancjf7q8.js → Accordion-rg763dfb.js} +4 -4
- package/web-dist/chunks/{Accordion-g2d4fskg.js → Accordion-rkt7qdmj.js} +2 -2
- package/web-dist/chunks/{Accordion-pvz3r99n.js → Accordion-sek2q4r1.js} +1 -1
- package/web-dist/chunks/{Accordion-0yhkg017.js → Accordion-sxfqnnx6.js} +10 -10
- package/web-dist/chunks/{Accordion-wytj5wwc.js → Accordion-sxzax4x4.js} +4 -4
- package/web-dist/chunks/{Accordion-e2kr1z3g.js → Accordion-t3hm5tcv.js} +6 -6
- package/web-dist/chunks/{Accordion-0yvepteg.js → Accordion-vewrj1kr.js} +6 -6
- package/web-dist/chunks/Accordion-vgkvvdvg.js +4295 -0
- package/web-dist/chunks/{Accordion-kxa15n19.js → Accordion-x3tphbvw.js} +1 -1
- package/web-dist/chunks/{Accordion-ebw6xj6x.js → Accordion-x5v1p4df.js} +5 -5
- package/web-dist/chunks/{Accordion-70g7n6tk.js → Accordion-y2eyyqrk.js} +9 -9
- package/web-dist/chunks/ReadiumCSS-after.css-2389epxb.js +477 -0
- package/web-dist/chunks/ReadiumCSS-after.css-8se5z2w3.js +492 -0
- package/web-dist/chunks/ReadiumCSS-after.css-x15y26r7.js +532 -0
- package/web-dist/chunks/ReadiumCSS-after.css-z23c32jh.js +594 -0
- package/web-dist/chunks/ReadiumCSS-before.css-1t98py7y.js +531 -0
- package/web-dist/chunks/ReadiumCSS-before.css-hszzyv5p.js +531 -0
- package/web-dist/chunks/ReadiumCSS-before.css-mjvegqjq.js +532 -0
- package/web-dist/chunks/ReadiumCSS-before.css-pnpxcrwx.js +531 -0
- package/web-dist/chunks/ReadiumCSS-default.css-8gxjy9na.js +185 -0
- package/web-dist/chunks/ReadiumCSS-default.css-m8ts96nj.js +182 -0
- package/web-dist/chunks/ReadiumCSS-default.css-rg94gstv.js +164 -0
- package/web-dist/chunks/ReadiumCSS-default.css-y8p5hk56.js +164 -0
- package/web-dist/chunks/ReadiumCSS-ebpaj_fonts_patch.css-50yy1az9.js +84 -0
- package/web-dist/chunks/zip-reader-f0yphjb9.js +103 -0
- package/web-dist/components/accordion/Accordion.js +12 -12
- package/web-dist/components/accordion-item/AccordionItem.js +12 -12
- package/web-dist/components/activity-indicator/ActivityIndicator.js +4 -4
- package/web-dist/components/app-bar/AppBar.js +19 -19
- package/web-dist/components/app-header/AppHeader.js +19 -19
- package/web-dist/components/app-shell/AppShell.js +6 -6
- package/web-dist/components/auth-screen/AuthScreen.js +21 -21
- package/web-dist/components/avatar/Avatar.js +12 -12
- package/web-dist/components/avatar-group/AvatarGroup.js +12 -12
- package/web-dist/components/badge/Badge.js +7 -7
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +20 -20
- package/web-dist/components/bottom-sheet/BottomSheet.js +8 -8
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +8 -8
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +8 -8
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +8 -8
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +8 -8
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +8 -8
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +14 -14
- package/web-dist/components/button/Button.js +12 -12
- package/web-dist/components/button-group/ButtonGroup.js +12 -12
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +20 -20
- package/web-dist/components/card/Card.js +19 -19
- package/web-dist/components/card-back/CardBack.js +4 -4
- package/web-dist/components/card-hand/CardHand.js +4 -4
- package/web-dist/components/chat-list-item/ChatListItem.js +16 -16
- package/web-dist/components/checkbox/Checkbox.js +12 -12
- package/web-dist/components/checkbox-group/CheckboxGroup.js +12 -12
- package/web-dist/components/chess-board/ChessBoard.js +4 -4
- package/web-dist/components/chip/Chip.js +13 -13
- package/web-dist/components/chip-group/ChipGroup.js +13 -13
- package/web-dist/components/collection-editor/CollectionEditor.js +19 -19
- package/web-dist/components/content-rail/ContentRail.js +14 -14
- package/web-dist/components/data-table/DataTable.js +27 -27
- package/web-dist/components/date-picker/DatePicker.js +17 -17
- package/web-dist/components/dialog/Dialog.js +12 -12
- package/web-dist/components/divider/Divider.js +6 -6
- package/web-dist/components/empty-state/EmptyState.js +20 -20
- package/web-dist/components/field/Field.js +12 -12
- package/web-dist/components/flat-list/FlatList.js +13 -13
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +21 -21
- package/web-dist/components/form/Form.js +16 -16
- package/web-dist/components/form-actions/FormActions.js +16 -16
- package/web-dist/components/form-error/FormError.js +16 -16
- package/web-dist/components/game/Game.js +7 -7
- package/web-dist/components/game-entity/GameEntity.js +7 -7
- package/web-dist/components/game-field/GameField.js +7 -7
- package/web-dist/components/game-input-zone/GameInputZone.js +7 -7
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +7 -7
- package/web-dist/components/game-overlay/GameOverlay.js +7 -7
- package/web-dist/components/gradient/Gradient.js +7 -7
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +7 -7
- package/web-dist/components/graph-view/GraphView.js +1 -1
- package/web-dist/components/grid/Grid.js +6 -6
- package/web-dist/components/heading/Heading.js +6 -6
- package/web-dist/components/hero/Hero.js +19 -19
- package/web-dist/components/icon/Icon.js +4 -4
- package/web-dist/components/icon-button/IconButton.js +12 -12
- package/web-dist/components/image/Image.js +10 -10
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -3
- package/web-dist/components/list/List.js +13 -13
- package/web-dist/components/list-item/ListItem.js +13 -13
- package/web-dist/components/list-section/ListSection.js +13 -13
- package/web-dist/components/media-card/MediaCard.js +19 -19
- package/web-dist/components/message-bubble/MessageBubble.js +16 -16
- package/web-dist/components/metric-card/MetricCard.js +19 -19
- package/web-dist/components/missing-element/MissingElement.js +12 -12
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +21 -21
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +21 -21
- package/web-dist/components/opening-book/OpeningBook.js +4 -4
- package/web-dist/components/otp-form/OtpForm.js +21 -21
- package/web-dist/components/pagination/Pagination.js +13 -13
- package/web-dist/components/palette-item/PaletteItem.js +19 -19
- package/web-dist/components/playing-card/PlayingCard.js +4 -4
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +4 -4
- package/web-dist/components/popover-menu/PopoverMenu.js +14 -14
- package/web-dist/components/post-card/PostCard.js +19 -19
- package/web-dist/components/product-card/ProductCard.js +19 -19
- package/web-dist/components/progress/Progress.js +10 -10
- package/web-dist/components/progress-ring/ProgressRing.js +10 -10
- package/web-dist/components/radio/Radio.js +14 -14
- package/web-dist/components/radio-group/RadioGroup.js +14 -14
- package/web-dist/components/rating/Rating.js +9 -9
- package/web-dist/components/reader/Reader.d.ts +3 -0
- package/web-dist/components/reader/Reader.js +38562 -0
- package/web-dist/components/reader/index.d.ts +1 -0
- package/web-dist/components/reader/index.js +2 -0
- package/web-dist/components/scan-overlay/ScanOverlay.js +20 -20
- package/web-dist/components/screen/Screen.js +6 -6
- package/web-dist/components/screen-section/ScreenSection.js +10 -10
- package/web-dist/components/scroll-view/ScrollView.js +6 -6
- package/web-dist/components/search-input/SearchInput.js +13 -13
- package/web-dist/components/section-header/SectionHeader.js +10 -10
- package/web-dist/components/section-list/SectionList.js +13 -13
- package/web-dist/components/select/Select.js +16 -16
- package/web-dist/components/selectable-item/SelectableItem.js +6 -6
- package/web-dist/components/selection-provider/SelectionProvider.js +6 -6
- package/web-dist/components/sign-in-form/SignInForm.js +21 -21
- package/web-dist/components/sign-up-form/SignUpForm.js +21 -21
- package/web-dist/components/skeleton/Skeleton.js +22 -22
- package/web-dist/components/skeleton-card/SkeletonCard.js +22 -22
- package/web-dist/components/skeleton-list/SkeletonList.js +22 -22
- package/web-dist/components/skeleton-text/SkeletonText.js +22 -22
- package/web-dist/components/surface/Surface.js +7 -7
- package/web-dist/components/switch/Switch.js +7 -7
- package/web-dist/components/tab/Tab.js +7 -7
- package/web-dist/components/tab-list/TabList.js +7 -7
- package/web-dist/components/tab-panel/TabPanel.js +7 -7
- package/web-dist/components/tabletop-table/TabletopTable.js +4 -4
- package/web-dist/components/tabs/Tabs.js +7 -7
- package/web-dist/components/text/Text.js +6 -6
- package/web-dist/components/text-input/TextInput.js +13 -13
- package/web-dist/components/time-picker/TimePicker.js +18 -18
- package/web-dist/components/timeline/Timeline.js +11 -11
- package/web-dist/components/toast/Toast.js +9 -9
- package/web-dist/components/toast-provider/ToastProvider.js +9 -9
- package/web-dist/components/toolbar/Toolbar.js +19 -19
- package/web-dist/components/tree-item/TreeItem.js +18 -18
- package/web-dist/components/uploader/Uploader.js +22 -22
- package/web-dist/components/view/View.js +6 -6
- package/web-dist/manifest.json +1615 -1601
- package/web-dist/runtime/ZoraProvider.js +9 -9
- package/dist/features/reader/adapters/inbound/ReaderSurface.d.ts +0 -11
- package/dist/features/reader/adapters/inbound/ReaderSurface.d.ts.map +0 -1
- package/dist/features/reader/adapters/inbound/ReaderSurface.js.map +0 -1
- package/web-dist/components/reader-surface/ReaderSurface.d.ts +0 -3
- package/web-dist/components/reader-surface/ReaderSurface.js +0 -360
- package/web-dist/components/reader-surface/index.d.ts +0 -1
- package/web-dist/components/reader-surface/index.js +0 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ReaderView } from '@ankhorage/reader';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
|
|
3
|
-
import type {
|
|
4
|
+
import type { ReaderProps, ReaderStatus } from '../../../../types/reader';
|
|
4
5
|
import { AppBar } from '../../../app-bar/public';
|
|
5
6
|
import { IconButton } from '../../../button/public';
|
|
6
7
|
import { View } from '../../../layout/public';
|
|
@@ -9,6 +10,7 @@ import { Surface } from '../../../surface/public';
|
|
|
9
10
|
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
10
11
|
import { useZoraTheme } from '../../../theme/composition/useZoraTheme';
|
|
11
12
|
import { Text } from '../../../typography/public';
|
|
13
|
+
import { useReaderController } from '../../composition/useReaderController';
|
|
12
14
|
import { resolveReaderProgress } from '../../utils/resolveReaderProgress';
|
|
13
15
|
|
|
14
16
|
function resolvePageLabel(page: number | undefined, pageCount: number | undefined): string | null {
|
|
@@ -20,7 +22,7 @@ function resolvePageLabel(page: number | undefined, pageCount: number | undefine
|
|
|
20
22
|
function resolveCanGoPrevious({
|
|
21
23
|
canGoPrevious,
|
|
22
24
|
page,
|
|
23
|
-
}: Pick<
|
|
25
|
+
}: Pick<ReaderProps, 'canGoPrevious' | 'page'>): boolean {
|
|
24
26
|
if (canGoPrevious !== undefined) return canGoPrevious;
|
|
25
27
|
return page === undefined || page > 1;
|
|
26
28
|
}
|
|
@@ -29,7 +31,7 @@ function resolveCanGoNext({
|
|
|
29
31
|
canGoNext,
|
|
30
32
|
page,
|
|
31
33
|
pageCount,
|
|
32
|
-
}: Pick<
|
|
34
|
+
}: Pick<ReaderProps, 'canGoNext' | 'page' | 'pageCount'>): boolean {
|
|
33
35
|
if (canGoNext !== undefined) return canGoNext;
|
|
34
36
|
return page === undefined || pageCount === undefined || page < pageCount;
|
|
35
37
|
}
|
|
@@ -74,7 +76,7 @@ function ReaderHeader({
|
|
|
74
76
|
onOpenAppearance,
|
|
75
77
|
onToggleHighlight,
|
|
76
78
|
}: Pick<
|
|
77
|
-
|
|
79
|
+
ReaderProps,
|
|
78
80
|
| 'interactionPolicy'
|
|
79
81
|
| 'title'
|
|
80
82
|
| 'subtitle'
|
|
@@ -150,7 +152,7 @@ function ReaderFooter({
|
|
|
150
152
|
onPreviousPage,
|
|
151
153
|
onNextPage,
|
|
152
154
|
}: Pick<
|
|
153
|
-
|
|
155
|
+
ReaderProps,
|
|
154
156
|
| 'interactionPolicy'
|
|
155
157
|
| 'status'
|
|
156
158
|
| 'page'
|
|
@@ -231,19 +233,19 @@ function ReaderFooter({
|
|
|
231
233
|
);
|
|
232
234
|
}
|
|
233
235
|
|
|
234
|
-
function
|
|
236
|
+
function ReaderInner({
|
|
235
237
|
themeId: _themeId,
|
|
236
238
|
mode: _mode,
|
|
237
239
|
interactionPolicy,
|
|
238
|
-
source
|
|
239
|
-
format
|
|
240
|
-
location
|
|
241
|
-
status
|
|
242
|
-
page,
|
|
243
|
-
pageCount,
|
|
244
|
-
progress,
|
|
245
|
-
canGoPrevious,
|
|
246
|
-
canGoNext,
|
|
240
|
+
source,
|
|
241
|
+
format,
|
|
242
|
+
location,
|
|
243
|
+
status: statusOverride,
|
|
244
|
+
page: pageOverride,
|
|
245
|
+
pageCount: pageCountOverride,
|
|
246
|
+
progress: progressOverride,
|
|
247
|
+
canGoPrevious: canGoPreviousOverride,
|
|
248
|
+
canGoNext: canGoNextOverride,
|
|
247
249
|
title,
|
|
248
250
|
subtitle,
|
|
249
251
|
chapterLabel,
|
|
@@ -257,28 +259,62 @@ function ReaderSurfaceInner({
|
|
|
257
259
|
errorTitle = 'Unable to open this document.',
|
|
258
260
|
unavailableTitle = 'Reader preview unavailable.',
|
|
259
261
|
showChrome = true,
|
|
260
|
-
readerColorScheme
|
|
261
|
-
fontScale
|
|
262
|
-
lineHeight
|
|
262
|
+
readerColorScheme = 'system',
|
|
263
|
+
fontScale = 1,
|
|
264
|
+
lineHeight = 'normal',
|
|
263
265
|
highlighted = false,
|
|
264
|
-
viewport,
|
|
265
266
|
headerActions,
|
|
266
267
|
footerActions,
|
|
267
268
|
onPreviousPage,
|
|
268
269
|
onNextPage,
|
|
269
|
-
onLocationChange
|
|
270
|
+
onLocationChange,
|
|
270
271
|
onOpenContents,
|
|
271
272
|
onOpenAppearance,
|
|
272
273
|
onToggleHighlight,
|
|
273
|
-
onOpenExternalLink
|
|
274
|
-
onReaderError
|
|
274
|
+
onOpenExternalLink,
|
|
275
|
+
onReaderError,
|
|
275
276
|
testID,
|
|
276
|
-
}:
|
|
277
|
+
}: ReaderProps) {
|
|
277
278
|
const { theme } = useZoraTheme();
|
|
279
|
+
const reader = useReaderController({
|
|
280
|
+
source,
|
|
281
|
+
format,
|
|
282
|
+
location,
|
|
283
|
+
readerColorScheme,
|
|
284
|
+
fontScale,
|
|
285
|
+
lineHeight,
|
|
286
|
+
onNextPage,
|
|
287
|
+
onPreviousPage,
|
|
288
|
+
onLocationChange,
|
|
289
|
+
onOpenExternalLink,
|
|
290
|
+
onReaderError,
|
|
291
|
+
});
|
|
292
|
+
const status =
|
|
293
|
+
reader.sourceUri === undefined
|
|
294
|
+
? 'idle'
|
|
295
|
+
: reader.error === undefined
|
|
296
|
+
? (statusOverride ?? reader.state.status)
|
|
297
|
+
: 'error';
|
|
298
|
+
const page = pageOverride ?? reader.state.page;
|
|
299
|
+
const pageCount = pageCountOverride ?? reader.state.pageCount;
|
|
300
|
+
const progress = progressOverride ?? reader.state.progress;
|
|
301
|
+
const canGoPrevious = canGoPreviousOverride ?? reader.state.canGoPrevious;
|
|
302
|
+
const canGoNext = canGoNextOverride ?? reader.state.canGoNext;
|
|
303
|
+
const chapter = chapterLabel ?? reader.state.location?.chapterTitle;
|
|
278
304
|
|
|
279
305
|
const viewportContent =
|
|
280
|
-
|
|
281
|
-
|
|
306
|
+
reader.sourceUri !== undefined && status !== 'error' ? (
|
|
307
|
+
<ReaderView
|
|
308
|
+
key={`${reader.sourceUri}:${format}`}
|
|
309
|
+
sourceUri={reader.sourceUri}
|
|
310
|
+
format={format}
|
|
311
|
+
appearance={reader.appearance}
|
|
312
|
+
initialLocation={location}
|
|
313
|
+
command={reader.command}
|
|
314
|
+
onStateChange={reader.handleStateChange}
|
|
315
|
+
onError={reader.handleError}
|
|
316
|
+
onOpenExternalLink={reader.handleOpenExternalLink}
|
|
317
|
+
/>
|
|
282
318
|
) : (
|
|
283
319
|
<ReaderEmptyState
|
|
284
320
|
errorTitle={errorTitle}
|
|
@@ -320,12 +356,12 @@ function ReaderSurfaceInner({
|
|
|
320
356
|
<ReaderFooter
|
|
321
357
|
canGoNext={canGoNext}
|
|
322
358
|
canGoPrevious={canGoPrevious}
|
|
323
|
-
chapterLabel={
|
|
359
|
+
chapterLabel={chapter}
|
|
324
360
|
footerActions={footerActions}
|
|
325
361
|
interactionPolicy={interactionPolicy}
|
|
326
362
|
nextPageLabel={nextPageLabel}
|
|
327
|
-
onNextPage={
|
|
328
|
-
onPreviousPage={
|
|
363
|
+
onNextPage={reader.goNext}
|
|
364
|
+
onPreviousPage={reader.goPrevious}
|
|
329
365
|
page={page}
|
|
330
366
|
pageCount={pageCount}
|
|
331
367
|
pageLabel={pageLabel}
|
|
@@ -340,10 +376,8 @@ function ReaderSurfaceInner({
|
|
|
340
376
|
}
|
|
341
377
|
|
|
342
378
|
/***
|
|
343
|
-
*
|
|
379
|
+
* The themed EPUB/PDF Reader composed around the independent ReaderView engine.
|
|
344
380
|
*
|
|
345
|
-
*
|
|
346
|
-
* chrome, controlled state, progress, accessible controls, and normalized
|
|
347
|
-
* adapter callbacks.
|
|
381
|
+
* Rendering, pagination and navigation remain owned by @ankhorage/reader.
|
|
348
382
|
*/
|
|
349
|
-
export const
|
|
383
|
+
export const Reader = withZoraThemeScope(ReaderInner);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { ReaderCommand, ReaderErrorEvent, ReaderViewportState } from '@ankhorage/reader';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Image } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import type { ReaderProps } from '../../../types/reader';
|
|
6
|
+
|
|
7
|
+
const INITIAL_STATE: ReaderViewportState = {
|
|
8
|
+
canGoNext: false,
|
|
9
|
+
canGoPrevious: false,
|
|
10
|
+
page: 1,
|
|
11
|
+
progress: 0,
|
|
12
|
+
status: 'loading',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type ControllerProps = Pick<
|
|
16
|
+
ReaderProps,
|
|
17
|
+
| 'source'
|
|
18
|
+
| 'format'
|
|
19
|
+
| 'location'
|
|
20
|
+
| 'readerColorScheme'
|
|
21
|
+
| 'fontScale'
|
|
22
|
+
| 'lineHeight'
|
|
23
|
+
| 'onNextPage'
|
|
24
|
+
| 'onPreviousPage'
|
|
25
|
+
| 'onLocationChange'
|
|
26
|
+
| 'onOpenExternalLink'
|
|
27
|
+
| 'onReaderError'
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
/*** Coordinate themed Reader chrome with the standalone ReaderView's controlled events. */
|
|
31
|
+
export function useReaderController(props: ControllerProps) {
|
|
32
|
+
const {
|
|
33
|
+
source,
|
|
34
|
+
readerColorScheme,
|
|
35
|
+
fontScale,
|
|
36
|
+
lineHeight,
|
|
37
|
+
onLocationChange,
|
|
38
|
+
onReaderError,
|
|
39
|
+
onOpenExternalLink,
|
|
40
|
+
onNextPage,
|
|
41
|
+
onPreviousPage,
|
|
42
|
+
} = props;
|
|
43
|
+
const sourceUri = resolveReaderSourceUri(source);
|
|
44
|
+
const [snapshot, setSnapshot] = React.useState({
|
|
45
|
+
sourceUri,
|
|
46
|
+
value: INITIAL_STATE,
|
|
47
|
+
});
|
|
48
|
+
const [failure, setFailure] = React.useState<{
|
|
49
|
+
sourceUri: string | undefined;
|
|
50
|
+
event?: ReaderErrorEvent;
|
|
51
|
+
}>({ sourceUri });
|
|
52
|
+
const [command, setCommand] = React.useState<ReaderCommand>();
|
|
53
|
+
const state = snapshot.sourceUri === sourceUri ? snapshot.value : INITIAL_STATE;
|
|
54
|
+
const error = failure.sourceUri === sourceUri ? failure.event : undefined;
|
|
55
|
+
|
|
56
|
+
const handleStateChange = React.useCallback(
|
|
57
|
+
(next: ReaderViewportState) => {
|
|
58
|
+
setSnapshot({ sourceUri, value: next });
|
|
59
|
+
setFailure({ sourceUri });
|
|
60
|
+
if (next.location !== undefined) void onLocationChange?.(next.location);
|
|
61
|
+
},
|
|
62
|
+
[sourceUri, onLocationChange],
|
|
63
|
+
);
|
|
64
|
+
const handleError = React.useCallback(
|
|
65
|
+
(event: ReaderErrorEvent) => {
|
|
66
|
+
setFailure({ sourceUri, event });
|
|
67
|
+
void onReaderError?.(event);
|
|
68
|
+
},
|
|
69
|
+
[sourceUri, onReaderError],
|
|
70
|
+
);
|
|
71
|
+
const handleOpenExternalLink = React.useCallback(
|
|
72
|
+
(event: { readonly url: string }) => {
|
|
73
|
+
void onOpenExternalLink?.(event);
|
|
74
|
+
},
|
|
75
|
+
[onOpenExternalLink],
|
|
76
|
+
);
|
|
77
|
+
const navigate = (type: ReaderCommand['type']) => {
|
|
78
|
+
if (sourceUri === undefined) return;
|
|
79
|
+
setCommand((previous) => ({
|
|
80
|
+
id: (previous?.id ?? 0) + 1,
|
|
81
|
+
sourceUri,
|
|
82
|
+
type,
|
|
83
|
+
}));
|
|
84
|
+
if (type === 'next') void onNextPage?.();
|
|
85
|
+
else void onPreviousPage?.();
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
appearance: {
|
|
89
|
+
colorScheme: readerColorScheme ?? 'system',
|
|
90
|
+
fontScale: fontScale ?? 1,
|
|
91
|
+
lineHeight: lineHeight === 'compact' ? 1.25 : lineHeight === 'relaxed' ? 1.75 : 1.5,
|
|
92
|
+
},
|
|
93
|
+
command,
|
|
94
|
+
error,
|
|
95
|
+
goNext: () => navigate('next'),
|
|
96
|
+
goPrevious: () => navigate('previous'),
|
|
97
|
+
handleStateChange,
|
|
98
|
+
handleError,
|
|
99
|
+
handleOpenExternalLink,
|
|
100
|
+
sourceUri,
|
|
101
|
+
state,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/*** Resolve a ZORA file source to the independent ReaderView's URI. */
|
|
106
|
+
function resolveReaderSourceUri(source: ReaderProps['source']): string | undefined {
|
|
107
|
+
if (typeof source === 'string') return source;
|
|
108
|
+
if (typeof source === 'number') return Image.resolveAssetSource(source).uri;
|
|
109
|
+
return source?.uri;
|
|
110
|
+
}
|
|
@@ -3,11 +3,10 @@ import type { ZoraComponentMeta } from '../../types/authoring';
|
|
|
3
3
|
|
|
4
4
|
const EMPTY_EVENT_FIELDS = [] as const;
|
|
5
5
|
|
|
6
|
-
export const
|
|
7
|
-
name: '
|
|
6
|
+
export const readerMeta = {
|
|
7
|
+
name: 'Reader',
|
|
8
8
|
category: 'pattern',
|
|
9
|
-
description:
|
|
10
|
-
'Adapter-neutral EPUB and PDF reader shell with controlled chrome, progress, and navigation events.',
|
|
9
|
+
description: 'Themed EPUB and PDF reader with standalone engine, progress and navigation events.',
|
|
11
10
|
directManifestNode: true,
|
|
12
11
|
requirements: {
|
|
13
12
|
capabilities: { ebookReader: true },
|
|
@@ -88,10 +87,6 @@ export const readerSurfaceMeta = {
|
|
|
88
87
|
},
|
|
89
88
|
},
|
|
90
89
|
slots: {
|
|
91
|
-
viewport: {
|
|
92
|
-
label: 'Reader viewport adapter',
|
|
93
|
-
allowedChildren: [],
|
|
94
|
-
},
|
|
95
90
|
headerActions: {
|
|
96
91
|
label: 'Header actions',
|
|
97
92
|
allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
|
|
@@ -7,9 +7,9 @@ export type {
|
|
|
7
7
|
ReaderLineHeight,
|
|
8
8
|
ReaderLocationChangeEvent,
|
|
9
9
|
ReaderNavigationTrigger,
|
|
10
|
+
ReaderProps,
|
|
10
11
|
ReaderResolvedSource,
|
|
11
12
|
ReaderStatus,
|
|
12
|
-
ReaderSurfaceProps,
|
|
13
13
|
} from '../../types/reader';
|
|
14
|
-
export {
|
|
14
|
+
export { Reader } from './adapters/inbound/Reader';
|
|
15
15
|
export { resolveReaderProgress } from './utils/resolveReaderProgress';
|
|
@@ -6,7 +6,7 @@ describe('resolveReaderProgress', () => {
|
|
|
6
6
|
test('is exported from the package root', async () => {
|
|
7
7
|
const source = await Bun.file('src/index.ts').text();
|
|
8
8
|
|
|
9
|
-
expect(source).toContain('
|
|
9
|
+
expect(source).toContain('Reader, resolveReaderProgress');
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
test('clamps an explicit progress value', () => {
|
|
@@ -58,7 +58,7 @@ import { PaletteItem } from '../palette-item/public';
|
|
|
58
58
|
import { PopoverMenu } from '../popover-menu/public';
|
|
59
59
|
import { Progress, ProgressRing } from '../progress/public';
|
|
60
60
|
import { Rating } from '../rating/public';
|
|
61
|
-
import {
|
|
61
|
+
import { Reader } from '../reader/public';
|
|
62
62
|
import { BarcodeScannerView, CameraPermissionView, ScanOverlay } from '../scanner/public';
|
|
63
63
|
import { ScreenSection, SectionHeader } from '../section/public';
|
|
64
64
|
import { SelectableItem } from '../selection/public';
|
|
@@ -199,7 +199,7 @@ const _ZORA_COMPONENT_REGISTRY = {
|
|
|
199
199
|
MissingElement,
|
|
200
200
|
PostCard,
|
|
201
201
|
ProductCard,
|
|
202
|
-
|
|
202
|
+
Reader,
|
|
203
203
|
BarcodeScannerView,
|
|
204
204
|
CameraPermissionView,
|
|
205
205
|
ScanOverlay,
|
|
@@ -37,8 +37,8 @@ describe('ZORA bindable component metadata', () => {
|
|
|
37
37
|
expect(image.bindings.props.source.value.type).toBe('imageAsset');
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
it('describes serializable controlled
|
|
41
|
-
const reader = ZORA_BINDABLE_COMPONENT_META.
|
|
40
|
+
it('describes serializable controlled Reader bindings', () => {
|
|
41
|
+
const reader = ZORA_BINDABLE_COMPONENT_META.Reader;
|
|
42
42
|
|
|
43
43
|
expect(Object.keys(reader.bindings.props)).toEqual([
|
|
44
44
|
'location',
|
|
@@ -2,7 +2,7 @@ import type { UiComponentMetaRegistry } from '@ankhorage/contracts';
|
|
|
2
2
|
|
|
3
3
|
import { INVERTED_POLARITY_PROP } from '../../constants/authoring';
|
|
4
4
|
import { imageMeta } from '../image/imageMeta';
|
|
5
|
-
import {
|
|
5
|
+
import { readerMeta } from '../reader/meta';
|
|
6
6
|
|
|
7
7
|
export const ZORA_BINDABLE_COMPONENT_META = {
|
|
8
8
|
Text: {
|
|
@@ -410,9 +410,9 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
410
410
|
},
|
|
411
411
|
},
|
|
412
412
|
},
|
|
413
|
-
|
|
414
|
-
...
|
|
415
|
-
props: { ...
|
|
413
|
+
Reader: {
|
|
414
|
+
...readerMeta,
|
|
415
|
+
props: { ...readerMeta.props, inverted: INVERTED_POLARITY_PROP },
|
|
416
416
|
bindings: {
|
|
417
417
|
props: {
|
|
418
418
|
location: {
|
|
@@ -114,8 +114,8 @@ describe('ZORA_COMPONENT_META requirement metadata', () => {
|
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
test('declares ebook reader capability metadata for
|
|
118
|
-
expect(ZORA_COMPONENT_META.
|
|
117
|
+
test('declares ebook reader capability metadata for Reader', () => {
|
|
118
|
+
expect(ZORA_COMPONENT_META.Reader.requirements).toEqual({
|
|
119
119
|
capabilities: { ebookReader: true },
|
|
120
120
|
});
|
|
121
121
|
});
|
|
@@ -220,7 +220,7 @@ describe('ZORA_COMPONENT_META invariants', () => {
|
|
|
220
220
|
'ProductCard',
|
|
221
221
|
'Progress',
|
|
222
222
|
'ProgressRing',
|
|
223
|
-
'
|
|
223
|
+
'Reader',
|
|
224
224
|
'MissingElement',
|
|
225
225
|
'TimePicker',
|
|
226
226
|
'TabletopTable',
|
|
@@ -435,8 +435,8 @@ describe('ZORA_COMPONENT_META invariants', () => {
|
|
|
435
435
|
expect(progressRing.props.accessibilityValueText?.type).toBe('string');
|
|
436
436
|
});
|
|
437
437
|
|
|
438
|
-
test('
|
|
439
|
-
const reader = ZORA_COMPONENT_META.
|
|
438
|
+
test('Reader exposes a safe file-media blueprint and normalized events', () => {
|
|
439
|
+
const reader = ZORA_COMPONENT_META.Reader;
|
|
440
440
|
|
|
441
441
|
expect(reader.directManifestNode).toBe(true);
|
|
442
442
|
expect(reader.allowedChildren).toEqual([]);
|
|
@@ -71,7 +71,7 @@ import { paletteItemMeta } from '../palette-item/paletteItemMeta';
|
|
|
71
71
|
import { popoverMenuMeta } from '../popover-menu/popoverMenuMeta';
|
|
72
72
|
import { progressMeta, progressRingMeta } from '../progress/progressMeta';
|
|
73
73
|
import { ratingMeta } from '../rating/ratingMeta';
|
|
74
|
-
import {
|
|
74
|
+
import { readerMeta } from '../reader/meta';
|
|
75
75
|
import { barcodeScannerViewMeta, cameraPermissionViewMeta, scanOverlayMeta } from '../scanner/meta';
|
|
76
76
|
import { screenSectionMeta } from '../section/screenSectionMeta';
|
|
77
77
|
import { sectionHeaderMeta } from '../section/sectionHeaderMeta';
|
|
@@ -202,7 +202,7 @@ export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = finalizeFeatureMet
|
|
|
202
202
|
MissingElement: missingElementMeta,
|
|
203
203
|
PostCard: postCardMeta,
|
|
204
204
|
ProductCard: productCardMeta,
|
|
205
|
-
|
|
205
|
+
Reader: readerMeta,
|
|
206
206
|
BarcodeScannerView: barcodeScannerViewMeta,
|
|
207
207
|
CameraPermissionView: cameraPermissionViewMeta,
|
|
208
208
|
ScanOverlay: scanOverlayMeta,
|
package/src/index.ts
CHANGED
|
@@ -316,11 +316,11 @@ export type {
|
|
|
316
316
|
ReaderLineHeight,
|
|
317
317
|
ReaderLocationChangeEvent,
|
|
318
318
|
ReaderNavigationTrigger,
|
|
319
|
+
ReaderProps,
|
|
319
320
|
ReaderResolvedSource,
|
|
320
321
|
ReaderStatus,
|
|
321
|
-
ReaderSurfaceProps,
|
|
322
322
|
} from './features/reader/public';
|
|
323
|
-
export {
|
|
323
|
+
export { Reader, resolveReaderProgress } from './features/reader/public';
|
|
324
324
|
export type {
|
|
325
325
|
ZoraBindableComponentType,
|
|
326
326
|
ZoraComponentBlueprint,
|
|
@@ -153,19 +153,19 @@ describe('ProductCard', () => {
|
|
|
153
153
|
});
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
-
describe('
|
|
156
|
+
describe('Reader', () => {
|
|
157
157
|
test('types extend ZoraBaseProps instead of duplicating InteractionPolicy', () => {
|
|
158
158
|
const source = readSource('types/reader.ts');
|
|
159
159
|
|
|
160
160
|
expect(source).not.toMatch(
|
|
161
161
|
/import type \{\s*InteractionPolicy\s*\} from '@ankhorage\/surface';/,
|
|
162
162
|
);
|
|
163
|
-
expect(source).toMatch(/export interface
|
|
163
|
+
expect(source).toMatch(/export interface ReaderProps extends ZoraBaseProps/);
|
|
164
164
|
expect(source).not.toMatch(/interactionPolicy\?: InteractionPolicy;/);
|
|
165
165
|
});
|
|
166
166
|
|
|
167
167
|
test('forwards interactionPolicy to its owned interactive controls', () => {
|
|
168
|
-
const source = readFeature('reader', 'adapters', 'inbound', '
|
|
168
|
+
const source = readFeature('reader', 'adapters', 'inbound', 'Reader.tsx');
|
|
169
169
|
|
|
170
170
|
expect(source).not.toMatch(/interactionPolicy:\s*_interactionPolicy/);
|
|
171
171
|
expect(source).toMatch(
|
package/src/types/reader.ts
CHANGED
|
@@ -1,33 +1,21 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ReaderDocumentFormat,
|
|
3
|
+
ReaderErrorEvent,
|
|
4
|
+
ReaderLocationChangeEvent,
|
|
5
|
+
ReaderStatus,
|
|
6
|
+
} from '@ankhorage/reader';
|
|
1
7
|
import type React from 'react';
|
|
2
8
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
export type {
|
|
10
|
+
ReaderDocumentFormat,
|
|
11
|
+
ReaderErrorCode,
|
|
12
|
+
ReaderErrorEvent,
|
|
13
|
+
ReaderLocationChangeEvent,
|
|
14
|
+
ReaderNavigationTrigger,
|
|
15
|
+
ReaderStatus,
|
|
16
|
+
} from '@ankhorage/reader';
|
|
8
17
|
|
|
9
|
-
|
|
10
|
-
'swipe' | 'previousControl' | 'nextControl' | 'keyboard' | 'location';
|
|
11
|
-
|
|
12
|
-
export interface ReaderLocationChangeEvent {
|
|
13
|
-
format: ReaderDocumentFormat;
|
|
14
|
-
locator: string;
|
|
15
|
-
page: number;
|
|
16
|
-
pageCount?: number;
|
|
17
|
-
progression: number;
|
|
18
|
-
chapterId?: string;
|
|
19
|
-
chapterTitle?: string;
|
|
20
|
-
trigger: ReaderNavigationTrigger;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type ReaderErrorCode =
|
|
24
|
-
'invalid-document' | 'load-failed' | 'protected-document' | 'unsupported-format';
|
|
25
|
-
|
|
26
|
-
export interface ReaderErrorEvent {
|
|
27
|
-
code: ReaderErrorCode;
|
|
28
|
-
format?: ReaderDocumentFormat;
|
|
29
|
-
message: string;
|
|
30
|
-
}
|
|
18
|
+
import type { ZoraBaseProps } from './base';
|
|
31
19
|
|
|
32
20
|
export type ReaderColorScheme = 'system' | 'light' | 'dark' | 'sepia';
|
|
33
21
|
|
|
@@ -39,7 +27,7 @@ export interface ReaderExternalLinkEvent {
|
|
|
39
27
|
url: string;
|
|
40
28
|
}
|
|
41
29
|
|
|
42
|
-
export interface
|
|
30
|
+
export interface ReaderProps extends ZoraBaseProps {
|
|
43
31
|
source?: ReaderResolvedSource | null;
|
|
44
32
|
format: ReaderDocumentFormat;
|
|
45
33
|
location?: string;
|
|
@@ -66,7 +54,6 @@ export interface ReaderSurfaceProps extends ZoraBaseProps {
|
|
|
66
54
|
fontScale?: number;
|
|
67
55
|
lineHeight?: ReaderLineHeight;
|
|
68
56
|
highlighted?: boolean;
|
|
69
|
-
viewport?: React.ReactNode;
|
|
70
57
|
headerActions?: React.ReactNode;
|
|
71
58
|
footerActions?: React.ReactNode;
|
|
72
59
|
onPreviousPage?: () => void | Promise<void>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
require_cjs
|
|
4
|
-
} from "./Accordion-
|
|
4
|
+
} from "./Accordion-sek2q4r1.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
|
-
} from "./Accordion-
|
|
7
|
+
} from "./Accordion-74rt38d4.js";
|
|
8
8
|
import {
|
|
9
9
|
__toESM
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-nh0cs9hq.js";
|
|
11
11
|
|
|
12
12
|
// node_modules/@ankhorage/surface/src/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.tsx
|
|
13
13
|
var import_react_native = __toESM(require_cjs(), 1);
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
require_cjs
|
|
4
|
-
} from "./Accordion-
|
|
4
|
+
} from "./Accordion-sek2q4r1.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
|
-
} from "./Accordion-
|
|
7
|
+
} from "./Accordion-74rt38d4.js";
|
|
8
8
|
import {
|
|
9
9
|
View2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-vewrj1kr.js";
|
|
11
11
|
import {
|
|
12
12
|
Text3
|
|
13
|
-
} from "./Accordion-
|
|
13
|
+
} from "./Accordion-t3hm5tcv.js";
|
|
14
14
|
import {
|
|
15
15
|
useZoraTheme2
|
|
16
|
-
} from "./Accordion-
|
|
16
|
+
} from "./Accordion-1dah5bqg.js";
|
|
17
17
|
import {
|
|
18
18
|
__toESM
|
|
19
|
-
} from "./Accordion-
|
|
19
|
+
} from "./Accordion-nh0cs9hq.js";
|
|
20
20
|
|
|
21
21
|
// src/types/progress.ts
|
|
22
22
|
function resolveProgressRole(theme, color) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
Button2
|
|
4
|
-
} from "./Accordion-
|
|
4
|
+
} from "./Accordion-nj9g6p48.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
|
-
} from "./Accordion-
|
|
7
|
+
} from "./Accordion-74rt38d4.js";
|
|
8
8
|
import {
|
|
9
9
|
View2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-vewrj1kr.js";
|
|
11
11
|
import {
|
|
12
12
|
Card2
|
|
13
|
-
} from "./Accordion-
|
|
13
|
+
} from "./Accordion-9rhbc32v.js";
|
|
14
14
|
|
|
15
15
|
// src/features/empty-state/adapters/inbound/EmptyState.tsx
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
Field3
|
|
4
|
-
} from "./Accordion-
|
|
4
|
+
} from "./Accordion-jkhq422b.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
|
-
} from "./Accordion-
|
|
7
|
+
} from "./Accordion-74rt38d4.js";
|
|
8
8
|
import {
|
|
9
9
|
View2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-vewrj1kr.js";
|
|
11
11
|
import {
|
|
12
12
|
Text3
|
|
13
|
-
} from "./Accordion-
|
|
13
|
+
} from "./Accordion-t3hm5tcv.js";
|
|
14
14
|
|
|
15
15
|
// src/features/form/field/adapters/inbound/Field.tsx
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|