@ankhorage/zora 28.1.5 → 28.3.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 +17 -0
- package/README.md +1 -1
- package/dist/capabilities/index.js +159 -2
- package/dist/capabilities/index.js.map +8 -5
- package/dist/constants/authoring.d.ts +6 -3
- package/dist/constants/authoring.d.ts.map +1 -1
- package/dist/constants/authoring.js +6 -0
- package/dist/constants/authoring.js.map +1 -1
- package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
- package/dist/features/audio/adapters/inbound/Audio.d.ts +5 -0
- package/dist/features/audio/adapters/inbound/Audio.d.ts.map +1 -0
- package/dist/features/audio/adapters/inbound/Audio.js +80 -0
- package/dist/features/audio/adapters/inbound/Audio.js.map +1 -0
- package/dist/features/audio/audioMeta.d.ts +22 -0
- package/dist/features/audio/audioMeta.d.ts.map +1 -0
- package/dist/features/audio/audioMeta.js +18 -0
- package/dist/features/audio/audioMeta.js.map +1 -0
- package/dist/features/audio/composition/AudioController.d.ts +13 -0
- package/dist/features/audio/composition/AudioController.d.ts.map +1 -0
- package/dist/features/audio/composition/AudioController.js +2 -0
- package/dist/features/audio/composition/AudioController.js.map +1 -0
- package/dist/features/audio/composition/useAudioController.d.ts +5 -0
- package/dist/features/audio/composition/useAudioController.d.ts.map +1 -0
- package/dist/features/audio/composition/useAudioController.js +22 -0
- package/dist/features/audio/composition/useAudioController.js.map +1 -0
- package/dist/features/audio/composition/useAudioController.web.d.ts +5 -0
- package/dist/features/audio/composition/useAudioController.web.d.ts.map +1 -0
- package/dist/features/audio/composition/useAudioController.web.js +80 -0
- package/dist/features/audio/composition/useAudioController.web.js.map +1 -0
- package/dist/features/audio/public.d.ts +3 -0
- package/dist/features/audio/public.d.ts.map +1 -0
- package/dist/features/audio/public.js +2 -0
- package/dist/features/audio/public.js.map +1 -0
- 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/link/adapters/inbound/Link.d.ts +2 -0
- package/dist/features/link/adapters/inbound/Link.d.ts.map +1 -0
- package/dist/features/link/adapters/inbound/Link.js +2 -0
- package/dist/features/link/adapters/inbound/Link.js.map +1 -0
- package/dist/features/link/adapters/inbound/Link.native.d.ts +5 -0
- package/dist/features/link/adapters/inbound/Link.native.d.ts.map +1 -0
- package/dist/features/link/adapters/inbound/Link.native.js +29 -0
- package/dist/features/link/adapters/inbound/Link.native.js.map +1 -0
- package/dist/features/link/adapters/inbound/Link.web.d.ts +5 -0
- package/dist/features/link/adapters/inbound/Link.web.d.ts.map +1 -0
- package/dist/features/link/adapters/inbound/Link.web.js +34 -0
- package/dist/features/link/adapters/inbound/Link.web.js.map +1 -0
- package/dist/features/link/linkMeta.d.ts +116 -0
- package/dist/features/link/linkMeta.d.ts.map +1 -0
- package/dist/features/link/linkMeta.js +82 -0
- package/dist/features/link/linkMeta.js.map +1 -0
- package/dist/features/link/public.d.ts +3 -0
- package/dist/features/link/public.d.ts.map +1 -0
- package/dist/features/link/public.js +2 -0
- package/dist/features/link/public.js.map +1 -0
- package/dist/features/link/utils/linkThemeRecipeMeta.d.ts +25 -0
- package/dist/features/link/utils/linkThemeRecipeMeta.d.ts.map +1 -0
- package/dist/features/link/utils/linkThemeRecipeMeta.js +26 -0
- package/dist/features/link/utils/linkThemeRecipeMeta.js.map +1 -0
- package/dist/features/list/flatListMeta.d.ts +1 -1
- package/dist/features/list/sectionListMeta.d.ts +1 -1
- package/dist/features/master-detail/masterDetailMeta.d.ts +1 -1
- package/dist/features/reader/meta.d.ts +2 -2
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts.map +1 -1
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js +6 -0
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js.map +1 -1
- package/dist/features/registry/bindableComponentMeta.d.ts +2 -2
- package/dist/features/registry/componentMeta.d.ts.map +1 -1
- package/dist/features/registry/componentMeta.js +6 -0
- package/dist/features/registry/componentMeta.js.map +1 -1
- package/dist/features/registry/themeRecipeMeta.d.ts.map +1 -1
- package/dist/features/registry/themeRecipeMeta.js +2 -0
- package/dist/features/registry/themeRecipeMeta.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/features/video/adapters/inbound/Video.d.ts +2 -0
- package/dist/features/video/adapters/inbound/Video.d.ts.map +1 -0
- package/dist/features/video/adapters/inbound/Video.js +2 -0
- package/dist/features/video/adapters/inbound/Video.js.map +1 -0
- package/dist/features/video/adapters/inbound/Video.native.d.ts +5 -0
- package/dist/features/video/adapters/inbound/Video.native.d.ts.map +1 -0
- package/dist/features/video/adapters/inbound/Video.native.js +160 -0
- package/dist/features/video/adapters/inbound/Video.native.js.map +1 -0
- package/dist/features/video/adapters/inbound/Video.web.d.ts +5 -0
- package/dist/features/video/adapters/inbound/Video.web.d.ts.map +1 -0
- package/dist/features/video/adapters/inbound/Video.web.js +30 -0
- package/dist/features/video/adapters/inbound/Video.web.js.map +1 -0
- package/dist/features/video/public.d.ts +3 -0
- package/dist/features/video/public.d.ts.map +1 -0
- package/dist/features/video/public.js +2 -0
- package/dist/features/video/public.js.map +1 -0
- package/dist/features/video/videoMeta.d.ts +64 -0
- package/dist/features/video/videoMeta.d.ts.map +1 -0
- package/dist/features/video/videoMeta.js +50 -0
- package/dist/features/video/videoMeta.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/readerFree.d.ts +5 -0
- package/dist/readerFree.d.ts.map +1 -1
- package/dist/readerFree.js +3 -0
- package/dist/readerFree.js.map +1 -1
- package/dist/types/audio.d.ts +15 -0
- package/dist/types/audio.d.ts.map +1 -0
- package/dist/types/audio.js +2 -0
- package/dist/types/audio.js.map +1 -0
- package/dist/types/link.d.ts +23 -0
- package/dist/types/link.d.ts.map +1 -0
- package/dist/types/link.js +2 -0
- package/dist/types/link.js.map +1 -0
- package/dist/types/video.d.ts +24 -0
- package/dist/types/video.d.ts.map +1 -0
- package/dist/types/video.js +2 -0
- package/dist/types/video.js.map +1 -0
- package/package.json +41 -3
- package/src/constants/authoring.ts +6 -0
- package/src/features/audio/adapters/inbound/Audio.tsx +158 -0
- package/src/features/audio/audioMeta.ts +20 -0
- package/src/features/audio/composition/AudioController.ts +12 -0
- package/src/features/audio/composition/useAudioController.ts +27 -0
- package/src/features/audio/composition/useAudioController.web.ts +106 -0
- package/src/features/audio/public.test.ts +37 -0
- package/src/features/audio/public.ts +2 -0
- package/src/features/link/Link.test.tsx +48 -0
- package/src/features/link/adapters/inbound/Link.native.tsx +62 -0
- package/src/features/link/adapters/inbound/Link.tsx +1 -0
- package/src/features/link/adapters/inbound/Link.web.tsx +67 -0
- package/src/features/link/linkMeta.ts +83 -0
- package/src/features/link/public.ts +2 -0
- package/src/features/link/utils/linkThemeRecipeMeta.ts +27 -0
- package/src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts +6 -0
- package/src/features/registry/componentMeta.test.ts +31 -0
- package/src/features/registry/componentMeta.ts +6 -0
- package/src/features/registry/themeRecipeMeta.test.ts +1 -0
- package/src/features/registry/themeRecipeMeta.ts +2 -0
- package/src/features/video/adapters/inbound/Video.native.tsx +296 -0
- package/src/features/video/adapters/inbound/Video.test.tsx +188 -0
- package/src/features/video/adapters/inbound/Video.tsx +1 -0
- package/src/features/video/adapters/inbound/Video.web.tsx +70 -0
- package/src/features/video/public.ts +7 -0
- package/src/features/video/videoMeta.ts +51 -0
- package/src/index.ts +2 -0
- package/src/readerFree.ts +15 -0
- package/src/types/audio.ts +16 -0
- package/src/types/link.ts +26 -0
- package/src/types/video.ts +28 -0
- package/web-dist/authoring/index.js +27 -0
- package/web-dist/chunks/{Accordion-15sxxjym.js → Accordion-17s33h1a.js} +1 -1
- package/web-dist/chunks/{Accordion-qrt9xz0h.js → Accordion-2wggrer7.js} +2 -2
- package/web-dist/chunks/{Accordion-9k7ktksc.js → Accordion-2xkxthf1.js} +3 -3
- package/web-dist/chunks/{Accordion-qkkeyr18.js → Accordion-2ys50fc8.js} +1 -1
- package/web-dist/chunks/{Accordion-xfkg7dcw.js → Accordion-379mgrse.js} +1 -1
- package/web-dist/chunks/{Accordion-xb9zhdhp.js → Accordion-38xvj0cq.js} +2 -2
- package/web-dist/chunks/{Accordion-q11svb96.js → Accordion-5qz4j8tt.js} +5 -5
- package/web-dist/chunks/{Accordion-8c4w7366.js → Accordion-5rwztz14.js} +1 -1
- package/web-dist/chunks/{Accordion-afpjg1d6.js → Accordion-8skz71ct.js} +1 -1
- package/web-dist/chunks/{Accordion-27yg9ktv.js → Accordion-9qg7cjt8.js} +1 -1
- package/web-dist/chunks/{Accordion-wb9pmykz.js → Accordion-a1mgdfg7.js} +1 -1
- package/web-dist/chunks/{Accordion-vzq344av.js → Accordion-axe7nsht.js} +1 -1
- package/web-dist/chunks/{Accordion-46n609yq.js → Accordion-bd9vzpbz.js} +2 -2
- package/web-dist/chunks/{Accordion-gnxmybxx.js → Accordion-bp9y7738.js} +4 -4
- package/web-dist/chunks/{Accordion-5cjhz94e.js → Accordion-bzgy9sg3.js} +2 -2
- package/web-dist/chunks/{Accordion-f4919ghm.js → Accordion-e0vm82xr.js} +1 -1
- package/web-dist/chunks/{Accordion-jmxe6kw0.js → Accordion-f1vargnk.js} +1 -1
- package/web-dist/chunks/{Accordion-de8srt4x.js → Accordion-f8zpd80k.js} +3 -3
- package/web-dist/chunks/{Accordion-qsppnx7g.js → Accordion-gnbt6w4q.js} +1 -1
- package/web-dist/chunks/{Accordion-h1q243zq.js → Accordion-htm3j8r8.js} +3 -3
- package/web-dist/chunks/{Accordion-01zvarrn.js → Accordion-kdb9g5b1.js} +1 -1
- package/web-dist/chunks/{Accordion-78tknqmc.js → Accordion-nmpzv3b0.js} +2 -2
- package/web-dist/chunks/{Accordion-22cda3h5.js → Accordion-r75ep5pg.js} +2 -2
- package/web-dist/chunks/{Accordion-34b3rwbc.js → Accordion-rq311z1k.js} +3 -3
- package/web-dist/chunks/{Accordion-epv5yhch.js → Accordion-tqagt6cz.js} +1 -1
- package/web-dist/chunks/{Accordion-0xaq2k2h.js → Accordion-vb52sts9.js} +1 -1
- package/web-dist/chunks/{Accordion-b8w0f8s0.js → Accordion-za0jcjgn.js} +1 -1
- package/web-dist/chunks/Video.native-97x0098j.js +905 -0
- package/web-dist/chunks/index-cnnsfz6n.js +1807 -0
- package/web-dist/components/accordion/Accordion.js +2 -2
- package/web-dist/components/accordion-item/AccordionItem.js +2 -2
- package/web-dist/components/app-bar/AppBar.js +4 -4
- package/web-dist/components/app-header/AppHeader.js +4 -4
- package/web-dist/components/audio/Audio.d.ts +7 -0
- package/web-dist/components/audio/Audio.dependency-0.d.ts +27 -0
- package/web-dist/components/audio/Audio.dependency-1.d.ts +3 -0
- package/web-dist/components/audio/Audio.js +264 -0
- package/web-dist/components/audio/Audio.types-0.d.ts +18 -0
- package/web-dist/components/audio/index.d.ts +2 -0
- package/web-dist/components/audio/index.js +2 -0
- package/web-dist/components/auth-screen/AuthScreen.js +6 -6
- package/web-dist/components/avatar/Avatar.js +2 -2
- package/web-dist/components/avatar-group/AvatarGroup.js +2 -2
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +5 -5
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +2 -2
- package/web-dist/components/button/Button.js +1 -1
- package/web-dist/components/button-group/ButtonGroup.js +1 -1
- package/web-dist/components/calendar/Calendar.js +3 -3
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +5 -5
- package/web-dist/components/card/Card.js +4 -4
- package/web-dist/components/chat-list-item/ChatListItem.js +3 -3
- package/web-dist/components/checkbox/Checkbox.js +2 -2
- package/web-dist/components/checkbox-group/CheckboxGroup.js +2 -2
- package/web-dist/components/chip/Chip.js +2 -2
- package/web-dist/components/chip-group/ChipGroup.js +2 -2
- package/web-dist/components/collection-editor/CollectionEditor.js +4 -4
- package/web-dist/components/color-hue-scale/ColorHueScale.js +6 -6
- package/web-dist/components/color-picker/ColorPicker.js +6 -6
- package/web-dist/components/color-tone/ColorTone.js +6 -6
- package/web-dist/components/color-wheel/ColorWheel.js +6 -6
- package/web-dist/components/content-rail/ContentRail.js +2 -2
- package/web-dist/components/data-table/DataTable.js +10 -10
- package/web-dist/components/date-picker/DatePicker.js +4 -4
- package/web-dist/components/dialog/Dialog.js +2 -2
- package/web-dist/components/empty-state/EmptyState.js +5 -5
- package/web-dist/components/explorer/Explorer.js +2 -2
- package/web-dist/components/field/Field.js +2 -2
- package/web-dist/components/file-explorer/FileExplorer.js +2 -2
- package/web-dist/components/flat-list/FlatList.js +3 -3
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +6 -6
- package/web-dist/components/form/Form.js +4 -4
- package/web-dist/components/form-actions/FormActions.js +4 -4
- package/web-dist/components/form-error/FormError.js +4 -4
- package/web-dist/components/heading/Heading.js +1 -1
- package/web-dist/components/hero/Hero.js +4 -4
- package/web-dist/components/icon-button/IconButton.js +1 -1
- package/web-dist/components/link/Link.d.ts +7 -0
- package/web-dist/components/link/Link.dependency-0.d.ts +27 -0
- package/web-dist/components/link/Link.dependency-1.d.ts +3 -0
- package/web-dist/components/link/Link.dependency-2.d.ts +7 -0
- package/web-dist/components/link/Link.dependency-3.d.ts +5 -0
- package/web-dist/components/link/Link.js +95 -0
- package/web-dist/components/link/Link.types-0.d.ts +28 -0
- package/web-dist/components/link/index.d.ts +2 -0
- package/web-dist/components/link/index.js +2 -0
- package/web-dist/components/list/List.js +3 -3
- package/web-dist/components/list-item/ListItem.js +3 -3
- package/web-dist/components/list-section/ListSection.js +3 -3
- package/web-dist/components/media-card/MediaCard.js +4 -4
- package/web-dist/components/media-explorer/MediaExplorer.js +2 -2
- package/web-dist/components/message-bubble/MessageBubble.js +3 -3
- package/web-dist/components/metric-card/MetricCard.js +4 -4
- package/web-dist/components/missing-element/MissingElement.js +1 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +6 -6
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +6 -6
- package/web-dist/components/otp-form/OtpForm.js +6 -6
- package/web-dist/components/pagination/Pagination.js +2 -2
- package/web-dist/components/palette-item/PaletteItem.js +4 -4
- package/web-dist/components/popover-menu/PopoverMenu.js +1 -1
- package/web-dist/components/post-card/PostCard.js +4 -4
- package/web-dist/components/product-card/ProductCard.js +4 -4
- package/web-dist/components/progress/Progress.js +2 -2
- package/web-dist/components/progress-ring/ProgressRing.js +2 -2
- package/web-dist/components/radio/Radio.js +2 -2
- package/web-dist/components/radio-group/RadioGroup.js +2 -2
- package/web-dist/components/reader/Reader.js +6 -6
- package/web-dist/components/scan-overlay/ScanOverlay.js +5 -5
- package/web-dist/components/screen-section/ScreenSection.js +2 -2
- package/web-dist/components/search-input/SearchInput.js +2 -2
- package/web-dist/components/section-header/SectionHeader.js +2 -2
- package/web-dist/components/section-list/SectionList.js +3 -3
- package/web-dist/components/select/Select.js +3 -3
- package/web-dist/components/sign-in-form/SignInForm.js +6 -6
- package/web-dist/components/sign-up-form/SignUpForm.js +6 -6
- package/web-dist/components/skeleton/Skeleton.js +7 -7
- package/web-dist/components/skeleton-card/SkeletonCard.js +7 -7
- package/web-dist/components/skeleton-list/SkeletonList.js +7 -7
- package/web-dist/components/skeleton-text/SkeletonText.js +7 -7
- package/web-dist/components/text/Text.js +1 -1
- package/web-dist/components/text-input/TextInput.js +2 -2
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +1 -1
- package/web-dist/components/time-picker/TimePicker.js +3 -3
- package/web-dist/components/timeline/Timeline.js +1 -1
- package/web-dist/components/toast/Toast.js +2 -2
- package/web-dist/components/toast-provider/ToastProvider.js +2 -2
- package/web-dist/components/toolbar/Toolbar.js +4 -4
- package/web-dist/components/tree-item/TreeItem.js +4 -4
- package/web-dist/components/uploader/Uploader.js +7 -7
- package/web-dist/components/video/Video.d.ts +7 -0
- package/web-dist/components/video/Video.dependency-0.d.ts +27 -0
- package/web-dist/components/video/Video.dependency-1.d.ts +3 -0
- package/web-dist/components/video/Video.dependency-2.d.ts +9 -0
- package/web-dist/components/video/Video.dependency-3.d.ts +23 -0
- package/web-dist/components/video/Video.js +80 -0
- package/web-dist/components/video/Video.types-0.d.ts +29 -0
- package/web-dist/components/video/index.d.ts +2 -0
- package/web-dist/components/video/index.js +2 -0
- package/web-dist/manifest.json +399 -294
- package/web-dist/runtime/ZoraProvider.js +1 -1
- /package/web-dist/chunks/{Accordion-7bd6zq4s.js → Accordion-2xb252py.js} +0 -0
- /package/web-dist/chunks/{Accordion-q046ws5p.js → Accordion-q683s6kd.js} +0 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { AudioProps } from '../../../types/audio';
|
|
4
|
+
import type { AudioController } from './AudioController';
|
|
5
|
+
|
|
6
|
+
interface ExpoAudioPlayer {
|
|
7
|
+
readonly currentTime: number;
|
|
8
|
+
readonly duration: number;
|
|
9
|
+
readonly isLoaded: boolean;
|
|
10
|
+
readonly playing: boolean;
|
|
11
|
+
volume: number;
|
|
12
|
+
pause(): void;
|
|
13
|
+
play(): void;
|
|
14
|
+
remove(): void;
|
|
15
|
+
seekTo(seconds: number): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface ExpoAudioModule {
|
|
19
|
+
createAudioPlayer(
|
|
20
|
+
source: AudioProps['source'],
|
|
21
|
+
options: { readonly updateInterval: number },
|
|
22
|
+
): ExpoAudioPlayer;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const UNAVAILABLE_AUDIO_CONTROLLER: AudioController = {
|
|
26
|
+
currentTime: 0,
|
|
27
|
+
duration: 0,
|
|
28
|
+
isLoaded: false,
|
|
29
|
+
pause: () => undefined,
|
|
30
|
+
play: () => undefined,
|
|
31
|
+
playing: false,
|
|
32
|
+
seekTo: () => Promise.resolve(),
|
|
33
|
+
setVolume: () => undefined,
|
|
34
|
+
volume: 1,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Applies the requested volume through Expo Audio's mutable web player boundary. */
|
|
38
|
+
function setWebAudioPlayerVolume(player: ExpoAudioPlayer, volume: number): void {
|
|
39
|
+
player.volume = volume;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Connects web Audio controls to Expo Audio after the SSR-safe client boundary mounts. */
|
|
43
|
+
export function useAudioController(source: AudioProps['source']): AudioController {
|
|
44
|
+
const [player, setPlayer] = React.useState<ExpoAudioPlayer | null>(null);
|
|
45
|
+
const [state, setState] = React.useState<AudioController>(UNAVAILABLE_AUDIO_CONTROLLER);
|
|
46
|
+
|
|
47
|
+
React.useEffect(() => {
|
|
48
|
+
let active = true;
|
|
49
|
+
let resolvedPlayer: ExpoAudioPlayer | null = null;
|
|
50
|
+
let timer: ReturnType<typeof setInterval> | null = null;
|
|
51
|
+
|
|
52
|
+
/** Publishes the latest lightweight Expo Audio player state. */
|
|
53
|
+
const publish = () => {
|
|
54
|
+
const activePlayer = resolvedPlayer;
|
|
55
|
+
if (!activePlayer || !active) return;
|
|
56
|
+
setState((current) => ({
|
|
57
|
+
...current,
|
|
58
|
+
currentTime: activePlayer.currentTime,
|
|
59
|
+
duration: activePlayer.duration,
|
|
60
|
+
isLoaded: activePlayer.isLoaded,
|
|
61
|
+
playing: activePlayer.playing,
|
|
62
|
+
volume: activePlayer.volume,
|
|
63
|
+
}));
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** Loads Expo Audio only after hydration, preserving a safe web module entrypoint. */
|
|
67
|
+
const load = async () => {
|
|
68
|
+
const expoAudio = (await import('expo-audio')) as ExpoAudioModule;
|
|
69
|
+
if (!active) return;
|
|
70
|
+
resolvedPlayer = expoAudio.createAudioPlayer(source, { updateInterval: 250 });
|
|
71
|
+
setPlayer(resolvedPlayer);
|
|
72
|
+
publish();
|
|
73
|
+
timer = setInterval(publish, 250);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
void load();
|
|
77
|
+
|
|
78
|
+
return () => {
|
|
79
|
+
active = false;
|
|
80
|
+
if (timer) clearInterval(timer);
|
|
81
|
+
resolvedPlayer?.remove();
|
|
82
|
+
setPlayer(null);
|
|
83
|
+
setState(UNAVAILABLE_AUDIO_CONTROLLER);
|
|
84
|
+
};
|
|
85
|
+
}, [source]);
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
...state,
|
|
89
|
+
pause: () => {
|
|
90
|
+
player?.pause();
|
|
91
|
+
setState((current) => ({ ...current, playing: false }));
|
|
92
|
+
},
|
|
93
|
+
play: () => {
|
|
94
|
+
player?.play();
|
|
95
|
+
setState((current) => ({ ...current, playing: true }));
|
|
96
|
+
},
|
|
97
|
+
seekTo: async (seconds) => {
|
|
98
|
+
await player?.seekTo(seconds);
|
|
99
|
+
setState((current) => ({ ...current, currentTime: seconds }));
|
|
100
|
+
},
|
|
101
|
+
setVolume: (volume) => {
|
|
102
|
+
if (player) setWebAudioPlayerVolume(player, volume);
|
|
103
|
+
setState((current) => ({ ...current, volume }));
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { MediaAssetReference } from '@ankhorage/contracts';
|
|
2
|
+
import { describe, expect, test } from 'bun:test';
|
|
3
|
+
|
|
4
|
+
import type { AudioManifestProps, AudioProps } from '../../types/audio';
|
|
5
|
+
import { audioMeta } from './audioMeta';
|
|
6
|
+
|
|
7
|
+
describe('Audio public contract', () => {
|
|
8
|
+
test('keeps the authored source portable and the runtime source resolved', () => {
|
|
9
|
+
const manifestProps: AudioManifestProps = { source: { mediaId: 'intro-audio' } };
|
|
10
|
+
const runtimeProps: AudioProps = { source: { uri: 'https://example.test/intro.mp3' } };
|
|
11
|
+
const reference: MediaAssetReference = manifestProps.source;
|
|
12
|
+
|
|
13
|
+
expect(reference.mediaId).toBe('intro-audio');
|
|
14
|
+
expect(runtimeProps.source).toEqual({ uri: 'https://example.test/intro.mp3' });
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('publishes the SDK 57 audio boundary and authoring metadata', async () => {
|
|
18
|
+
const [packageJson, rootSource, readerFreeSource, publicSource, nativeControllerSource] =
|
|
19
|
+
await Promise.all([
|
|
20
|
+
Bun.file('package.json').json() as Promise<{
|
|
21
|
+
dependencies: Readonly<Record<string, string>>;
|
|
22
|
+
}>,
|
|
23
|
+
Bun.file('src/index.ts').text(),
|
|
24
|
+
Bun.file('src/readerFree.ts').text(),
|
|
25
|
+
Bun.file('src/features/audio/public.ts').text(),
|
|
26
|
+
Bun.file('src/features/audio/composition/useAudioController.ts').text(),
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
expect(packageJson.dependencies['expo-audio']).toMatch(/^~57\.0\./u);
|
|
30
|
+
expect(packageJson.dependencies['expo-asset']).toMatch(/^~57\./u);
|
|
31
|
+
expect(`${rootSource}\n${readerFreeSource}`).toContain("from './features/audio/public'");
|
|
32
|
+
expect(publicSource).toContain('export { Audio }');
|
|
33
|
+
expect(nativeControllerSource).toContain("from 'expo-audio'");
|
|
34
|
+
expect(audioMeta.props.source).toMatchObject({ type: 'media', mediaKinds: ['audio'] });
|
|
35
|
+
expect(audioMeta.allowedChildren).toEqual([]);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { pathToFileURL } from 'node:url';
|
|
3
|
+
|
|
4
|
+
import { expect, test } from 'bun:test';
|
|
5
|
+
import { Window } from 'happy-dom';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { renderToStaticMarkup } from 'react-dom/server';
|
|
8
|
+
|
|
9
|
+
import type { Link as LinkComponent } from './adapters/inbound/Link';
|
|
10
|
+
|
|
11
|
+
const webDistRoot = join(import.meta.dir, '../../../web-dist');
|
|
12
|
+
|
|
13
|
+
/*** Loads the generated public Link artifact and its shared ZORA theme runtime. */
|
|
14
|
+
async function loadLink() {
|
|
15
|
+
const [linkModule, themeModule] = await Promise.all([
|
|
16
|
+
import(pathToFileURL(join(webDistRoot, 'components/link/index.js')).href) as Promise<{
|
|
17
|
+
Link: typeof LinkComponent;
|
|
18
|
+
}>,
|
|
19
|
+
import(pathToFileURL(join(webDistRoot, 'runtime/ZoraProvider.js')).href) as Promise<{
|
|
20
|
+
ZoraProvider: React.ComponentType<{ children?: React.ReactNode; mode: 'dark' | 'light' }>;
|
|
21
|
+
}>,
|
|
22
|
+
]);
|
|
23
|
+
return { Link: linkModule.Link, ZoraProvider: themeModule.ZoraProvider };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
test('renders a semantic web anchor that retains navigation, download, and secure new-tab semantics', async () => {
|
|
27
|
+
const { Link, ZoraProvider } = await loadLink();
|
|
28
|
+
const browser = new Window();
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
browser.document.body.innerHTML = renderToStaticMarkup(
|
|
32
|
+
<ZoraProvider mode="light">
|
|
33
|
+
<Link download href="/documents/guide.pdf" target="_blank">
|
|
34
|
+
Download guide
|
|
35
|
+
</Link>
|
|
36
|
+
</ZoraProvider>,
|
|
37
|
+
);
|
|
38
|
+
const link = browser.document.querySelector('a');
|
|
39
|
+
|
|
40
|
+
expect(link?.getAttribute('href')).toBe('/documents/guide.pdf');
|
|
41
|
+
expect(link?.hasAttribute('download')).toBe(true);
|
|
42
|
+
expect(link?.getAttribute('target')).toBe('_blank');
|
|
43
|
+
expect(link?.getAttribute('rel')).toBe('noopener noreferrer');
|
|
44
|
+
expect(link?.textContent).toBe('Download guide');
|
|
45
|
+
} finally {
|
|
46
|
+
browser.close();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Pressable } from '@ankhorage/surface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Linking, type TextStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import type { LinkProps } from '../../../../types/link';
|
|
6
|
+
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
7
|
+
import { useZoraThemeRecipe } from '../../../theme/composition/useZoraThemeRecipe';
|
|
8
|
+
import { Text } from '../../../typography/public';
|
|
9
|
+
import { resolveTextThemeRecipe } from '../../../typography/utils/resolveTextThemeRecipe';
|
|
10
|
+
import { linkThemeRecipeMeta } from '../../utils/linkThemeRecipeMeta';
|
|
11
|
+
|
|
12
|
+
const linkTextStyle: TextStyle = { textDecorationLine: 'underline' };
|
|
13
|
+
|
|
14
|
+
/*** Renders a platform link and delegates internal navigation to the host press handler. */
|
|
15
|
+
export const Link = withZoraThemeScope(LinkInner);
|
|
16
|
+
|
|
17
|
+
/*** Connects native link activation to an app-owned route handler or the platform URL boundary. */
|
|
18
|
+
function LinkInner({
|
|
19
|
+
themeId: _themeId,
|
|
20
|
+
mode: _mode,
|
|
21
|
+
children,
|
|
22
|
+
href,
|
|
23
|
+
target,
|
|
24
|
+
download = false,
|
|
25
|
+
disabled = false,
|
|
26
|
+
interactionPolicy,
|
|
27
|
+
color,
|
|
28
|
+
variant,
|
|
29
|
+
weight,
|
|
30
|
+
accessibilityLabel,
|
|
31
|
+
onPress,
|
|
32
|
+
}: LinkProps) {
|
|
33
|
+
const themeRecipe = resolveTextThemeRecipe(useZoraThemeRecipe(linkThemeRecipeMeta));
|
|
34
|
+
const handlePress = React.useCallback(() => {
|
|
35
|
+
const event = { download, href, target };
|
|
36
|
+
if (onPress !== undefined) {
|
|
37
|
+
onPress(event);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
void Linking.openURL(href);
|
|
42
|
+
}, [download, href, onPress, target]);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<Pressable
|
|
46
|
+
accessibilityLabel={accessibilityLabel}
|
|
47
|
+
accessibilityRole="link"
|
|
48
|
+
disabled={disabled}
|
|
49
|
+
interactionPolicy={interactionPolicy}
|
|
50
|
+
onPress={handlePress}
|
|
51
|
+
>
|
|
52
|
+
<Text
|
|
53
|
+
color={color ?? themeRecipe.color ?? 'primary'}
|
|
54
|
+
style={linkTextStyle}
|
|
55
|
+
variant={variant ?? themeRecipe.variant}
|
|
56
|
+
weight={weight ?? themeRecipe.weight}
|
|
57
|
+
>
|
|
58
|
+
{children}
|
|
59
|
+
</Text>
|
|
60
|
+
</Pressable>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Link } from './Link.web';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TextStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { LinkProps } from '../../../../types/link';
|
|
5
|
+
import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';
|
|
6
|
+
import { useZoraThemeRecipe } from '../../../theme/composition/useZoraThemeRecipe';
|
|
7
|
+
import { Text } from '../../../typography/public';
|
|
8
|
+
import { resolveTextThemeRecipe } from '../../../typography/utils/resolveTextThemeRecipe';
|
|
9
|
+
import { linkThemeRecipeMeta } from '../../utils/linkThemeRecipeMeta';
|
|
10
|
+
|
|
11
|
+
const linkTextStyle: TextStyle = { textDecorationLine: 'underline' };
|
|
12
|
+
|
|
13
|
+
/*** Renders a semantic browser anchor for internal navigation, external URLs, and downloads. */
|
|
14
|
+
export const Link = withZoraThemeScope(LinkInner);
|
|
15
|
+
|
|
16
|
+
/*** Connects the web anchor to host press handling without replacing browser navigation semantics. */
|
|
17
|
+
function LinkInner({
|
|
18
|
+
themeId: _themeId,
|
|
19
|
+
mode: _mode,
|
|
20
|
+
children,
|
|
21
|
+
href,
|
|
22
|
+
target,
|
|
23
|
+
download = false,
|
|
24
|
+
disabled = false,
|
|
25
|
+
interactionPolicy,
|
|
26
|
+
color,
|
|
27
|
+
variant,
|
|
28
|
+
weight,
|
|
29
|
+
accessibilityLabel,
|
|
30
|
+
onPress,
|
|
31
|
+
}: LinkProps) {
|
|
32
|
+
const themeRecipe = resolveTextThemeRecipe(useZoraThemeRecipe(linkThemeRecipeMeta));
|
|
33
|
+
const inactive = disabled || interactionPolicy === 'passive';
|
|
34
|
+
const handleClick = React.useCallback(
|
|
35
|
+
(event: { preventDefault: () => void }) => {
|
|
36
|
+
if (inactive) {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
onPress?.({ download, href, target });
|
|
42
|
+
},
|
|
43
|
+
[download, href, inactive, onPress, target],
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return React.createElement(
|
|
47
|
+
'a',
|
|
48
|
+
{
|
|
49
|
+
'aria-disabled': inactive || undefined,
|
|
50
|
+
'aria-label': accessibilityLabel,
|
|
51
|
+
download: download || undefined,
|
|
52
|
+
href,
|
|
53
|
+
onClick: handleClick,
|
|
54
|
+
rel: target === '_blank' ? 'noopener noreferrer' : undefined,
|
|
55
|
+
tabIndex: inactive ? -1 : undefined,
|
|
56
|
+
target,
|
|
57
|
+
},
|
|
58
|
+
<Text
|
|
59
|
+
color={color ?? themeRecipe.color ?? 'primary'}
|
|
60
|
+
style={linkTextStyle}
|
|
61
|
+
variant={variant ?? themeRecipe.variant}
|
|
62
|
+
weight={weight ?? themeRecipe.weight}
|
|
63
|
+
>
|
|
64
|
+
{children}
|
|
65
|
+
</Text>,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { COMPONENT_THEME_AUTHORING } from '../../constants/authoring';
|
|
2
|
+
import type { ZoraComponentMeta } from '../../types/authoring';
|
|
3
|
+
import { ZORA_COLORS } from '../theme/colorModel';
|
|
4
|
+
|
|
5
|
+
export const linkMeta = {
|
|
6
|
+
name: 'Link',
|
|
7
|
+
category: 'component',
|
|
8
|
+
description: 'A semantic link for app-owned routes, external URLs, and downloads.',
|
|
9
|
+
directManifestNode: true,
|
|
10
|
+
allowedChildren: [],
|
|
11
|
+
blueprint: { label: 'Link', defaultProps: { children: 'Link', href: '/' } },
|
|
12
|
+
events: {
|
|
13
|
+
press: {
|
|
14
|
+
label: 'Press',
|
|
15
|
+
eventType: 'link.press',
|
|
16
|
+
description: 'Requests the host to handle link navigation.',
|
|
17
|
+
payloadFields: [
|
|
18
|
+
{ path: 'href', type: 'string', label: 'URL' },
|
|
19
|
+
{ path: 'target', type: 'string', label: 'Target' },
|
|
20
|
+
{ path: 'download', type: 'boolean', label: 'Download' },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
children: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
category: 'Content',
|
|
28
|
+
label: 'Label',
|
|
29
|
+
default: 'Link',
|
|
30
|
+
authoring: { authority: 'instance' },
|
|
31
|
+
},
|
|
32
|
+
href: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
category: 'Navigation',
|
|
35
|
+
label: 'URL',
|
|
36
|
+
default: '/',
|
|
37
|
+
authoring: { authority: 'instance' },
|
|
38
|
+
},
|
|
39
|
+
target: {
|
|
40
|
+
type: 'enum',
|
|
41
|
+
category: 'Navigation',
|
|
42
|
+
label: 'Target',
|
|
43
|
+
enum: ['_self', '_blank', '_parent'],
|
|
44
|
+
default: '_self',
|
|
45
|
+
authoring: { authority: 'instance' },
|
|
46
|
+
},
|
|
47
|
+
download: {
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
category: 'Navigation',
|
|
50
|
+
label: 'Download',
|
|
51
|
+
default: false,
|
|
52
|
+
authoring: { authority: 'instance' },
|
|
53
|
+
},
|
|
54
|
+
disabled: {
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
category: 'State',
|
|
57
|
+
label: 'Disabled',
|
|
58
|
+
default: false,
|
|
59
|
+
authoring: { authority: 'instance' },
|
|
60
|
+
},
|
|
61
|
+
variant: {
|
|
62
|
+
type: 'enum',
|
|
63
|
+
category: 'Typography',
|
|
64
|
+
label: 'Variant',
|
|
65
|
+
enum: ['body', 'lead', 'bodySmall', 'caption', 'label', 'eyebrow', 'code'],
|
|
66
|
+
authoring: COMPONENT_THEME_AUTHORING,
|
|
67
|
+
},
|
|
68
|
+
color: {
|
|
69
|
+
type: 'enum',
|
|
70
|
+
category: 'Style',
|
|
71
|
+
label: 'Color',
|
|
72
|
+
enum: ZORA_COLORS,
|
|
73
|
+
authoring: COMPONENT_THEME_AUTHORING,
|
|
74
|
+
},
|
|
75
|
+
weight: {
|
|
76
|
+
type: 'enum',
|
|
77
|
+
category: 'Typography',
|
|
78
|
+
label: 'Weight',
|
|
79
|
+
enum: ['regular', 'medium', 'semiBold', 'bold'],
|
|
80
|
+
authoring: COMPONENT_THEME_AUTHORING,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ZoraThemeRecipeMeta } from '../../../types/theme-recipe';
|
|
2
|
+
import { ZORA_COLORS } from '../../theme/colorModel';
|
|
3
|
+
|
|
4
|
+
export const linkThemeRecipeMeta = {
|
|
5
|
+
name: 'Link',
|
|
6
|
+
kind: 'component',
|
|
7
|
+
description: 'Maps semantic Link typography defaults into runtime props.',
|
|
8
|
+
fields: {
|
|
9
|
+
variant: {
|
|
10
|
+
type: 'choice',
|
|
11
|
+
label: 'Typography variant',
|
|
12
|
+
options: ['body', 'lead', 'bodySmall', 'caption', 'label', 'eyebrow', 'code'],
|
|
13
|
+
default: 'body',
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
type: 'choice',
|
|
17
|
+
label: 'Color',
|
|
18
|
+
options: ZORA_COLORS,
|
|
19
|
+
default: 'primary',
|
|
20
|
+
},
|
|
21
|
+
weight: {
|
|
22
|
+
type: 'choice',
|
|
23
|
+
label: 'Weight',
|
|
24
|
+
options: ['regular', 'medium', 'semiBold', 'bold'],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
} as const satisfies ZoraThemeRecipeMeta;
|
|
@@ -6,6 +6,7 @@ import { Accordion, AccordionItem } from '../accordion/public';
|
|
|
6
6
|
import { ActivityIndicator } from '../activity-indicator/public';
|
|
7
7
|
import { AppBar } from '../app-bar/public';
|
|
8
8
|
import { AppHeader } from '../app-header/public';
|
|
9
|
+
import { Audio } from '../audio/public';
|
|
9
10
|
import {
|
|
10
11
|
AuthScreen,
|
|
11
12
|
ForgotPasswordForm,
|
|
@@ -56,6 +57,7 @@ import { Icon } from '../icon/public';
|
|
|
56
57
|
import { Image } from '../image/public';
|
|
57
58
|
import { KeyboardAvoidingView } from '../keyboard-avoiding-view/public';
|
|
58
59
|
import { AppShell, Divider, Grid, Screen, ScrollView, View } from '../layout/public';
|
|
60
|
+
import { Link } from '../link/public';
|
|
59
61
|
import { FlatList, List, ListItem, ListSection, SectionList } from '../list/public';
|
|
60
62
|
import { MasterDetail } from '../master-detail/public';
|
|
61
63
|
import { MatrixGrid } from '../matrix-grid/public';
|
|
@@ -88,6 +90,7 @@ import { Toolbar } from '../toolbar/public';
|
|
|
88
90
|
import { TreeItem, TreeView } from '../tree-view/public';
|
|
89
91
|
import { Heading, Text } from '../typography/public';
|
|
90
92
|
import { Uploader } from '../uploader/public';
|
|
93
|
+
import { Video } from '../video/public';
|
|
91
94
|
|
|
92
95
|
type ComponentPropsFor<K extends keyof typeof _ZORA_BASE_COMPONENT_REGISTRY> = React.ComponentProps<
|
|
93
96
|
(typeof _ZORA_BASE_COMPONENT_REGISTRY)[K]
|
|
@@ -116,6 +119,7 @@ const _ZORA_BASE_COMPONENT_REGISTRY = {
|
|
|
116
119
|
Accordion,
|
|
117
120
|
AccordionItem,
|
|
118
121
|
ActivityIndicator,
|
|
122
|
+
Audio,
|
|
119
123
|
AppBar,
|
|
120
124
|
AppHeader,
|
|
121
125
|
Avatar,
|
|
@@ -149,6 +153,7 @@ const _ZORA_BASE_COMPONENT_REGISTRY = {
|
|
|
149
153
|
IconButton,
|
|
150
154
|
Image,
|
|
151
155
|
KeyboardAvoidingView,
|
|
156
|
+
Link,
|
|
152
157
|
TextInput,
|
|
153
158
|
MediaCard,
|
|
154
159
|
MetricCard,
|
|
@@ -175,6 +180,7 @@ const _ZORA_BASE_COMPONENT_REGISTRY = {
|
|
|
175
180
|
Toast,
|
|
176
181
|
Toolbar,
|
|
177
182
|
Uploader,
|
|
183
|
+
Video,
|
|
178
184
|
BottomSheet,
|
|
179
185
|
FlatList,
|
|
180
186
|
SectionList,
|
|
@@ -91,6 +91,20 @@ describe('ZORA_COMPONENT_META event metadata', () => {
|
|
|
91
91
|
expect(event?.payloadFields).toEqual([]);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
+
test('declares Link navigation metadata with its serializable press payload', () => {
|
|
95
|
+
const link = ZORA_COMPONENT_META.Link;
|
|
96
|
+
|
|
97
|
+
expect(link.props.href).toMatchObject({ type: 'string', category: 'Navigation' });
|
|
98
|
+
expect(link.props.target?.enum).toEqual(['_self', '_blank', '_parent']);
|
|
99
|
+
expect(link.props.download).toMatchObject({ type: 'boolean', default: false });
|
|
100
|
+
expect(link.events?.press).toMatchObject({ eventType: 'link.press' });
|
|
101
|
+
expect(link.events?.press.payloadFields).toEqual([
|
|
102
|
+
{ path: 'href', type: 'string', label: 'URL' },
|
|
103
|
+
{ path: 'target', type: 'string', label: 'Target' },
|
|
104
|
+
{ path: 'download', type: 'boolean', label: 'Download' },
|
|
105
|
+
]);
|
|
106
|
+
});
|
|
107
|
+
|
|
94
108
|
test('declares collection item metadata for list rows', () => {
|
|
95
109
|
const event = ZORA_COMPONENT_META.ListItem.events?.itemPress;
|
|
96
110
|
const eventType: ZoraComponentEventPayloadKind = event?.eventType ?? 'collection.itemPress';
|
|
@@ -226,6 +240,7 @@ describe('ZORA_COMPONENT_META invariants', () => {
|
|
|
226
240
|
test('direct manifest node leaf/container rules', () => {
|
|
227
241
|
const expectedLeafNodes = new Set([
|
|
228
242
|
'ActivityIndicator',
|
|
243
|
+
'Audio',
|
|
229
244
|
'AuthScreen',
|
|
230
245
|
'ForgotPasswordForm',
|
|
231
246
|
'OAuthProviderButton',
|
|
@@ -288,6 +303,8 @@ describe('ZORA_COMPONENT_META invariants', () => {
|
|
|
288
303
|
'TabletopTable',
|
|
289
304
|
'PokerTrainingTable',
|
|
290
305
|
'Timeline',
|
|
306
|
+
'Link',
|
|
307
|
+
'Video',
|
|
291
308
|
]);
|
|
292
309
|
|
|
293
310
|
const expectedContainerNodes = new Set([
|
|
@@ -443,6 +460,20 @@ describe('ZORA_COMPONENT_META invariants', () => {
|
|
|
443
460
|
expect(ZORA_COMPONENT_META.Image.props.alt?.authoring).toEqual({ authority: 'instance' });
|
|
444
461
|
});
|
|
445
462
|
|
|
463
|
+
test('Video is a direct manifest leaf with canonical video and poster media metadata', () => {
|
|
464
|
+
expect(ZORA_COMPONENT_META.Video.directManifestNode).toBe(true);
|
|
465
|
+
expect(ZORA_COMPONENT_META.Video.allowedChildren).toEqual([]);
|
|
466
|
+
expect(ZORA_COMPONENT_META.Video.props.source).toMatchObject({
|
|
467
|
+
type: 'media',
|
|
468
|
+
mediaKinds: ['video'],
|
|
469
|
+
});
|
|
470
|
+
expect(ZORA_COMPONENT_META.Video.props.poster).toMatchObject({
|
|
471
|
+
type: 'media',
|
|
472
|
+
mediaKinds: ['image'],
|
|
473
|
+
});
|
|
474
|
+
expect(ZORA_COMPONENT_META.Video.props.aspectRatio?.default).toBe(16 / 9);
|
|
475
|
+
});
|
|
476
|
+
|
|
446
477
|
test('RadioGroup is a direct manifest leaf with card presentation and normalized value events', () => {
|
|
447
478
|
const radioGroup = ZORA_COMPONENT_META.RadioGroup;
|
|
448
479
|
|
|
@@ -4,6 +4,7 @@ import { accordionMeta } from '../accordion/accordionMeta';
|
|
|
4
4
|
import { activityIndicatorMeta } from '../activity-indicator/activityIndicatorMeta';
|
|
5
5
|
import { appBarMeta } from '../app-bar/appBarMeta';
|
|
6
6
|
import { appHeaderMeta } from '../app-header/appHeaderMeta';
|
|
7
|
+
import { audioMeta } from '../audio/audioMeta';
|
|
7
8
|
import { authScreenMeta } from '../auth/authScreenMeta';
|
|
8
9
|
import { forgotPasswordFormMeta } from '../auth/forgotPasswordFormMeta';
|
|
9
10
|
import { oauthProviderButtonMeta } from '../auth/oauthProviderButtonMeta';
|
|
@@ -67,6 +68,7 @@ import { gridMeta } from '../layout/gridMeta';
|
|
|
67
68
|
import { screenMeta } from '../layout/screenMeta';
|
|
68
69
|
import { scrollViewMeta } from '../layout/scrollViewMeta';
|
|
69
70
|
import { viewMeta } from '../layout/viewMeta';
|
|
71
|
+
import { linkMeta } from '../link/linkMeta';
|
|
70
72
|
import { flatListMeta } from '../list/flatListMeta';
|
|
71
73
|
import { listItemMeta, listMeta, listSectionMeta } from '../list/meta';
|
|
72
74
|
import { sectionListMeta } from '../list/sectionListMeta';
|
|
@@ -113,12 +115,14 @@ import { treeItemMeta, treeViewMeta } from '../tree-view/meta';
|
|
|
113
115
|
import { headingMeta } from '../typography/headingMeta';
|
|
114
116
|
import { textMeta } from '../typography/textMeta';
|
|
115
117
|
import { uploaderMeta } from '../uploader/uploaderMeta';
|
|
118
|
+
import { videoMeta } from '../video/videoMeta';
|
|
116
119
|
import { finalizeFeatureMetadata } from './finalizeFeatureMetadata';
|
|
117
120
|
|
|
118
121
|
export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = finalizeFeatureMetadata({
|
|
119
122
|
Accordion: accordionMeta,
|
|
120
123
|
AccordionItem: accordionItemMeta,
|
|
121
124
|
ActivityIndicator: activityIndicatorMeta,
|
|
125
|
+
Audio: audioMeta,
|
|
122
126
|
View: viewMeta,
|
|
123
127
|
ScrollView: scrollViewMeta,
|
|
124
128
|
Grid: gridMeta,
|
|
@@ -157,6 +161,7 @@ export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = finalizeFeatureMet
|
|
|
157
161
|
IconButton: iconButtonMeta,
|
|
158
162
|
Image: imageMeta,
|
|
159
163
|
KeyboardAvoidingView: keyboardAvoidingViewMeta,
|
|
164
|
+
Link: linkMeta,
|
|
160
165
|
MasterDetail: masterDetailMeta,
|
|
161
166
|
TextInput: textInputMeta,
|
|
162
167
|
MediaCard: mediaCardMeta,
|
|
@@ -185,6 +190,7 @@ export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = finalizeFeatureMet
|
|
|
185
190
|
ToastProvider: toastProviderMeta,
|
|
186
191
|
Toolbar: toolbarMeta,
|
|
187
192
|
Uploader: uploaderMeta,
|
|
193
|
+
Video: videoMeta,
|
|
188
194
|
BottomSheet: bottomSheetMeta,
|
|
189
195
|
FlatList: flatListMeta,
|
|
190
196
|
SectionList: sectionListMeta,
|
|
@@ -2,6 +2,7 @@ import type { ZoraThemeRecipeMetaRegistry } from '../../types/theme-recipe';
|
|
|
2
2
|
import { buttonThemeRecipeMeta } from '../button/utils/themeRecipeMeta';
|
|
3
3
|
import { cardThemeRecipeMeta } from '../card/utils/themeRecipeMeta';
|
|
4
4
|
import { radioGroupThemeRecipeMeta } from '../form/radio/themeRecipeMeta';
|
|
5
|
+
import { linkThemeRecipeMeta } from '../link/utils/linkThemeRecipeMeta';
|
|
5
6
|
import { headingThemeRecipeMeta } from '../typography/utils/headingThemeRecipeMeta';
|
|
6
7
|
import { textThemeRecipeMeta } from '../typography/utils/textThemeRecipeMeta';
|
|
7
8
|
|
|
@@ -9,6 +10,7 @@ export const ZORA_THEME_RECIPE_META: ZoraThemeRecipeMetaRegistry = {
|
|
|
9
10
|
Button: buttonThemeRecipeMeta,
|
|
10
11
|
Card: cardThemeRecipeMeta,
|
|
11
12
|
Heading: headingThemeRecipeMeta,
|
|
13
|
+
Link: linkThemeRecipeMeta,
|
|
12
14
|
RadioGroup: radioGroupThemeRecipeMeta,
|
|
13
15
|
Text: textThemeRecipeMeta,
|
|
14
16
|
};
|