@oxy.so/bloom 23.1.1 → 23.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/NOTICE +1 -2
- package/README.md +1 -1
- package/docs/adoption-matrix.mdx +1 -2
- package/docs/bloom-language-codemod.mdx +4 -2
- package/docs/bloom-language-for-agents.mdx +1 -0
- package/docs/bloom-language.mdx +9 -1
- package/docs/page-header.mdx +3 -3
- package/docs/public-parts.mdx +2 -5
- package/docs/semantic-composition.mdx +2 -2
- package/docs/task-catalog.json +1 -1
- package/docs/task-catalog.mdx +1 -1
- package/docs/verification.mdx +1 -1
- package/docs/zoomable-media-gallery.mdx +33 -3
- package/lib/commonjs/agent-chat/shared.js +1 -3
- package/lib/commonjs/agent-chat/shared.js.map +1 -1
- package/lib/commonjs/agent-progress/AgentProgressPlan.js +1 -2
- package/lib/commonjs/agent-progress/AgentProgressPlan.js.map +1 -1
- package/lib/commonjs/ai-chat/AiChatGalleryPanelBase.js +9 -9
- package/lib/commonjs/ai-chat/AiChatGalleryPanelBase.js.map +1 -1
- package/lib/commonjs/ai-chat/AiChatImageGenerationBase.js +6 -6
- package/lib/commonjs/ai-chat/AiChatImageGenerationBase.js.map +1 -1
- package/lib/commonjs/app-shell/use-shell-viewport.js +0 -11
- package/lib/commonjs/app-shell/use-shell-viewport.js.map +1 -1
- package/lib/commonjs/avatar/Avatar.js +37 -18
- package/lib/commonjs/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/avatar/LiveBadge.js +6 -1
- package/lib/commonjs/avatar/LiveBadge.js.map +1 -1
- package/lib/commonjs/avatar-flight/create-avatar-flight-layer.js +5 -5
- package/lib/commonjs/avatar-flight/create-avatar-flight-layer.js.map +1 -1
- package/lib/commonjs/button/shared.js +0 -7
- package/lib/commonjs/button/shared.js.map +1 -1
- package/lib/commonjs/canvas/CanvasPanelBase.js +2 -2
- package/lib/commonjs/canvas/CanvasPanelBase.js.map +1 -1
- package/lib/commonjs/card/SelectionCard.js +11 -11
- package/lib/commonjs/card/SelectionCard.js.map +1 -1
- package/lib/commonjs/chat-composer/shared.js +0 -7
- package/lib/commonjs/chat-composer/shared.js.map +1 -1
- package/lib/commonjs/chat-list/shared.js +1 -8
- package/lib/commonjs/chat-list/shared.js.map +1 -1
- package/lib/commonjs/chip/Chip.js +2 -2
- package/lib/commonjs/chip/Chip.js.map +1 -1
- package/lib/commonjs/composer-panel/ModelPickerBase.js +2 -1
- package/lib/commonjs/composer-panel/ModelPickerBase.js.map +1 -1
- package/lib/commonjs/composer-panel/shared.js +0 -7
- package/lib/commonjs/composer-panel/shared.js.map +1 -1
- package/lib/commonjs/content-panel/ContentPanel.web.js +12 -35
- package/lib/commonjs/content-panel/ContentPanel.web.js.map +1 -1
- package/lib/commonjs/cover-header/CoverHeader.js +1 -2
- package/lib/commonjs/cover-header/CoverHeader.js.map +1 -1
- package/lib/commonjs/dialog/DetailDialogMotion.js +1 -2
- package/lib/commonjs/dialog/DetailDialogMotion.js.map +1 -1
- package/lib/commonjs/floating/FloatingPanel.js +3 -3
- package/lib/commonjs/floating/FloatingPanel.js.map +1 -1
- package/lib/commonjs/floating/TriggerSlot.js +2 -2
- package/lib/commonjs/floating/TriggerSlot.js.map +1 -1
- package/lib/commonjs/floating/constants.js +1 -1
- package/lib/commonjs/floating/menu-swatch-row.js +2 -2
- package/lib/commonjs/floating/menu-swatch-row.js.map +1 -1
- package/lib/commonjs/floating/shared.js +2 -2
- package/lib/commonjs/floating/shared.js.map +1 -1
- package/lib/commonjs/image/BloomImage.js +4 -0
- package/lib/commonjs/image/BloomImage.js.map +1 -1
- package/lib/commonjs/image/expo-image-module.js.map +1 -1
- package/lib/commonjs/link-preview/LinkPreviewCard.js +21 -5
- package/lib/commonjs/link-preview/LinkPreviewCard.js.map +1 -1
- package/lib/commonjs/lyrics/shared.js +0 -12
- package/lib/commonjs/lyrics/shared.js.map +1 -1
- package/lib/commonjs/mail-list/shared.js +1 -11
- package/lib/commonjs/mail-list/shared.js.map +1 -1
- package/lib/commonjs/media-card/shared.js +0 -12
- package/lib/commonjs/media-card/shared.js.map +1 -1
- package/lib/commonjs/media-flight/MediaSurface.js +34 -12
- package/lib/commonjs/media-flight/MediaSurface.js.map +1 -1
- package/lib/commonjs/media-header/shared.js +0 -12
- package/lib/commonjs/media-header/shared.js.map +1 -1
- package/lib/commonjs/media-player/shared.js +0 -12
- package/lib/commonjs/media-player/shared.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/Marketplace.js +3 -3
- package/lib/commonjs/multi-agent-chat/Marketplace.js.map +1 -1
- package/lib/commonjs/music-library/shared.js +0 -12
- package/lib/commonjs/music-library/shared.js.map +1 -1
- package/lib/commonjs/page-header/EdgeScrim.js +19 -16
- package/lib/commonjs/page-header/EdgeScrim.js.map +1 -1
- package/lib/commonjs/page-header/PageHeader.js +10 -2
- package/lib/commonjs/page-header/PageHeader.js.map +1 -1
- package/lib/commonjs/project-board/ProjectBoardCanvas.js +2 -2
- package/lib/commonjs/project-board/ProjectBoardCanvas.js.map +1 -1
- package/lib/commonjs/property-insights/shared.js +1 -14
- package/lib/commonjs/property-insights/shared.js.map +1 -1
- package/lib/commonjs/radio/RadioHost.js +2 -2
- package/lib/commonjs/radio/RadioHost.js.map +1 -1
- package/lib/commonjs/select/Select.js +2 -2
- package/lib/commonjs/select/Select.js.map +1 -1
- package/lib/commonjs/select/Select.web.js +2 -2
- package/lib/commonjs/select/Select.web.js.map +1 -1
- package/lib/commonjs/select/shared.js +2 -2
- package/lib/commonjs/select/shared.js.map +1 -1
- package/lib/commonjs/shapes/Image.js +11 -3
- package/lib/commonjs/shapes/Image.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarItem.js +2 -2
- package/lib/commonjs/sidebar/SidebarItem.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarOnboardingCard.js +2 -2
- package/lib/commonjs/sidebar/SidebarOnboardingCard.js.map +1 -1
- package/lib/commonjs/sidebar/parts.js +0 -50
- package/lib/commonjs/sidebar/parts.js.map +1 -1
- package/lib/commonjs/stay-filters/EnergyRatingFilter.js +0 -6
- package/lib/commonjs/stay-filters/EnergyRatingFilter.js.map +1 -1
- package/lib/commonjs/styles/aria-hosts.js +20 -0
- package/lib/commonjs/styles/aria-hosts.js.map +1 -0
- package/lib/commonjs/surface/Surface.js +8 -2
- package/lib/commonjs/surface/Surface.js.map +1 -1
- package/lib/commonjs/surface/Surface.web.js +1 -2
- package/lib/commonjs/surface/Surface.web.js.map +1 -1
- package/lib/commonjs/surface/SurfacePaint.js +1 -2
- package/lib/commonjs/surface/SurfacePaint.js.map +1 -1
- package/lib/commonjs/toast/animations.js +1 -2
- package/lib/commonjs/toast/animations.js.map +1 -1
- package/lib/commonjs/typography/TypographyScope.js +0 -6
- package/lib/commonjs/typography/TypographyScope.js.map +1 -1
- package/lib/commonjs/zoomable-media-gallery/ZoomableMediaGalleryBase.js +255 -258
- package/lib/commonjs/zoomable-media-gallery/ZoomableMediaGalleryBase.js.map +1 -1
- package/lib/module/agent-chat/shared.js +0 -2
- package/lib/module/agent-chat/shared.js.map +1 -1
- package/lib/module/agent-progress/AgentProgressPlan.js +1 -2
- package/lib/module/agent-progress/AgentProgressPlan.js.map +1 -1
- package/lib/module/ai-chat/AiChatGalleryPanelBase.js +1 -1
- package/lib/module/ai-chat/AiChatGalleryPanelBase.js.map +1 -1
- package/lib/module/ai-chat/AiChatImageGenerationBase.js +1 -1
- package/lib/module/ai-chat/AiChatImageGenerationBase.js.map +1 -1
- package/lib/module/app-shell/use-shell-viewport.js +1 -11
- package/lib/module/app-shell/use-shell-viewport.js.map +1 -1
- package/lib/module/avatar/Avatar.js +37 -18
- package/lib/module/avatar/Avatar.js.map +1 -1
- package/lib/module/avatar/LiveBadge.js +6 -1
- package/lib/module/avatar/LiveBadge.js.map +1 -1
- package/lib/module/avatar-flight/create-avatar-flight-layer.js +6 -6
- package/lib/module/avatar-flight/create-avatar-flight-layer.js.map +1 -1
- package/lib/module/button/shared.js +0 -6
- package/lib/module/button/shared.js.map +1 -1
- package/lib/module/canvas/CanvasPanelBase.js +2 -2
- package/lib/module/canvas/CanvasPanelBase.js.map +1 -1
- package/lib/module/card/SelectionCard.js +1 -1
- package/lib/module/card/SelectionCard.js.map +1 -1
- package/lib/module/chat-composer/shared.js +1 -1
- package/lib/module/chat-composer/shared.js.map +1 -1
- package/lib/module/chat-list/shared.js +0 -7
- package/lib/module/chat-list/shared.js.map +1 -1
- package/lib/module/chip/Chip.js +2 -2
- package/lib/module/chip/Chip.js.map +1 -1
- package/lib/module/composer-panel/ModelPickerBase.js +2 -1
- package/lib/module/composer-panel/ModelPickerBase.js.map +1 -1
- package/lib/module/composer-panel/shared.js +0 -1
- package/lib/module/composer-panel/shared.js.map +1 -1
- package/lib/module/content-panel/ContentPanel.web.js +12 -35
- package/lib/module/content-panel/ContentPanel.web.js.map +1 -1
- package/lib/module/cover-header/CoverHeader.js +1 -2
- package/lib/module/cover-header/CoverHeader.js.map +1 -1
- package/lib/module/dialog/DetailDialogMotion.js +2 -3
- package/lib/module/dialog/DetailDialogMotion.js.map +1 -1
- package/lib/module/floating/FloatingPanel.js +3 -3
- package/lib/module/floating/FloatingPanel.js.map +1 -1
- package/lib/module/floating/TriggerSlot.js +2 -2
- package/lib/module/floating/TriggerSlot.js.map +1 -1
- package/lib/module/floating/constants.js +1 -1
- package/lib/module/floating/menu-swatch-row.js +2 -2
- package/lib/module/floating/menu-swatch-row.js.map +1 -1
- package/lib/module/floating/shared.js +2 -2
- package/lib/module/floating/shared.js.map +1 -1
- package/lib/module/image/BloomImage.js +4 -0
- package/lib/module/image/BloomImage.js.map +1 -1
- package/lib/module/image/expo-image-module.js.map +1 -1
- package/lib/module/link-preview/LinkPreviewCard.js +21 -5
- package/lib/module/link-preview/LinkPreviewCard.js.map +1 -1
- package/lib/module/lyrics/shared.js +1 -2
- package/lib/module/lyrics/shared.js.map +1 -1
- package/lib/module/mail-list/shared.js +0 -9
- package/lib/module/mail-list/shared.js.map +1 -1
- package/lib/module/media-card/shared.js +1 -2
- package/lib/module/media-card/shared.js.map +1 -1
- package/lib/module/media-flight/MediaSurface.js +34 -12
- package/lib/module/media-flight/MediaSurface.js.map +1 -1
- package/lib/module/media-header/shared.js +1 -2
- package/lib/module/media-header/shared.js.map +1 -1
- package/lib/module/media-player/shared.js +1 -2
- package/lib/module/media-player/shared.js.map +1 -1
- package/lib/module/multi-agent-chat/Marketplace.js +3 -3
- package/lib/module/multi-agent-chat/Marketplace.js.map +1 -1
- package/lib/module/music-library/shared.js +0 -1
- package/lib/module/music-library/shared.js.map +1 -1
- package/lib/module/page-header/EdgeScrim.js +19 -16
- package/lib/module/page-header/EdgeScrim.js.map +1 -1
- package/lib/module/page-header/PageHeader.js +11 -3
- package/lib/module/page-header/PageHeader.js.map +1 -1
- package/lib/module/project-board/ProjectBoardCanvas.js +2 -2
- package/lib/module/project-board/ProjectBoardCanvas.js.map +1 -1
- package/lib/module/property-insights/shared.js +1 -2
- package/lib/module/property-insights/shared.js.map +1 -1
- package/lib/module/radio/RadioHost.js +2 -2
- package/lib/module/radio/RadioHost.js.map +1 -1
- package/lib/module/select/Select.js +2 -2
- package/lib/module/select/Select.js.map +1 -1
- package/lib/module/select/Select.web.js +2 -2
- package/lib/module/select/Select.web.js.map +1 -1
- package/lib/module/select/shared.js +2 -2
- package/lib/module/select/shared.js.map +1 -1
- package/lib/module/shapes/Image.js +11 -3
- package/lib/module/shapes/Image.js.map +1 -1
- package/lib/module/sidebar/SidebarItem.js +2 -2
- package/lib/module/sidebar/SidebarItem.js.map +1 -1
- package/lib/module/sidebar/SidebarOnboardingCard.js +2 -2
- package/lib/module/sidebar/SidebarOnboardingCard.js.map +1 -1
- package/lib/module/sidebar/parts.js +3 -52
- package/lib/module/sidebar/parts.js.map +1 -1
- package/lib/module/stay-filters/EnergyRatingFilter.js +0 -1
- package/lib/module/stay-filters/EnergyRatingFilter.js.map +1 -1
- package/lib/module/styles/aria-hosts.js +16 -0
- package/lib/module/styles/aria-hosts.js.map +1 -0
- package/lib/module/surface/Surface.js +11 -5
- package/lib/module/surface/Surface.js.map +1 -1
- package/lib/module/surface/Surface.web.js +2 -3
- package/lib/module/surface/Surface.web.js.map +1 -1
- package/lib/module/surface/SurfacePaint.js +1 -2
- package/lib/module/surface/SurfacePaint.js.map +1 -1
- package/lib/module/toast/animations.js +0 -1
- package/lib/module/toast/animations.js.map +1 -1
- package/lib/module/typography/TypographyScope.js +0 -5
- package/lib/module/typography/TypographyScope.js.map +1 -1
- package/lib/module/zoomable-media-gallery/ZoomableMediaGalleryBase.js +256 -259
- package/lib/module/zoomable-media-gallery/ZoomableMediaGalleryBase.js.map +1 -1
- package/lib/typescript/commonjs/agent-chat/shared.d.ts +0 -2
- package/lib/typescript/commonjs/agent-chat/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-progress/AgentProgressPlan.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/use-shell-viewport.d.ts +0 -1
- package/lib/typescript/commonjs/app-shell/use-shell-viewport.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar/LiveBadge.d.ts +6 -2
- package/lib/typescript/commonjs/avatar/LiveBadge.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/shared.d.ts +0 -2
- package/lib/typescript/commonjs/button/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/types.d.ts +1 -1
- package/lib/typescript/commonjs/button/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-composer/shared.d.ts +0 -1
- package/lib/typescript/commonjs/chat-composer/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/chat-list/shared.d.ts +0 -9
- package/lib/typescript/commonjs/chat-list/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/composer-panel/shared.d.ts +0 -1
- package/lib/typescript/commonjs/composer-panel/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/content-panel/ContentPanel.web.d.ts +9 -11
- package/lib/typescript/commonjs/content-panel/ContentPanel.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/cover-header/CoverHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DetailDialogMotion.d.ts.map +1 -1
- package/lib/typescript/commonjs/floating/constants.d.ts +1 -1
- package/lib/typescript/commonjs/floating/shared.d.ts +1 -1
- package/lib/typescript/commonjs/floating/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/floating/types.d.ts +2 -2
- package/lib/typescript/commonjs/floating/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/image/BloomImage.d.ts +1 -1
- package/lib/typescript/commonjs/image/BloomImage.d.ts.map +1 -1
- package/lib/typescript/commonjs/image/expo-image-module.d.ts +3 -1
- package/lib/typescript/commonjs/image/expo-image-module.d.ts.map +1 -1
- package/lib/typescript/commonjs/image/index.d.ts +1 -1
- package/lib/typescript/commonjs/image/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/image/types.d.ts +18 -0
- package/lib/typescript/commonjs/image/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/link-preview/LinkPreviewCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/link-preview/types.d.ts +7 -0
- package/lib/typescript/commonjs/link-preview/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/lyrics/shared.d.ts +0 -2
- package/lib/typescript/commonjs/lyrics/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/mail-list/shared.d.ts +0 -9
- package/lib/typescript/commonjs/mail-list/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-card/shared.d.ts +0 -2
- package/lib/typescript/commonjs/media-card/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts +10 -1
- package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-header/shared.d.ts +0 -2
- package/lib/typescript/commonjs/media-header/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-header/types.d.ts +1 -1
- package/lib/typescript/commonjs/media-header/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-player/PlayerIconButton.d.ts +1 -1
- package/lib/typescript/commonjs/media-player/PlayerIconButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-player/shared.d.ts +0 -2
- package/lib/typescript/commonjs/media-player/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/music-library/shared.d.ts +0 -2
- package/lib/typescript/commonjs/music-library/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts +19 -16
- package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts.map +1 -1
- package/lib/typescript/commonjs/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/property-insights/shared.d.ts +0 -2
- package/lib/typescript/commonjs/property-insights/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/queue-panel/QueueIconButton.d.ts +1 -1
- package/lib/typescript/commonjs/queue-panel/QueueIconButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/shapes/Image.d.ts +1 -1
- package/lib/typescript/commonjs/shapes/Image.d.ts.map +1 -1
- package/lib/typescript/commonjs/shapes/types.d.ts +10 -0
- package/lib/typescript/commonjs/shapes/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/parts.d.ts +0 -6
- package/lib/typescript/commonjs/sidebar/parts.d.ts.map +1 -1
- package/lib/typescript/commonjs/stay-filters/EnergyRatingFilter.d.ts +1 -2
- package/lib/typescript/commonjs/stay-filters/EnergyRatingFilter.d.ts.map +1 -1
- package/lib/typescript/commonjs/styles/aria-hosts.d.ts +49 -0
- package/lib/typescript/commonjs/styles/aria-hosts.d.ts.map +1 -0
- package/lib/typescript/commonjs/surface/Surface.d.ts.map +1 -1
- package/lib/typescript/commonjs/surface/Surface.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/surface/SurfacePaint.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/animations.d.ts +0 -1
- package/lib/typescript/commonjs/toast/animations.d.ts.map +1 -1
- package/lib/typescript/commonjs/track-list/parts.d.ts +1 -1
- package/lib/typescript/commonjs/track-list/parts.d.ts.map +1 -1
- package/lib/typescript/commonjs/typography/TypographyScope.d.ts +0 -4
- package/lib/typescript/commonjs/typography/TypographyScope.d.ts.map +1 -1
- package/lib/typescript/commonjs/zoomable-media-gallery/ZoomableMediaGalleryBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/zoomable-media-gallery/types.d.ts +11 -0
- package/lib/typescript/commonjs/zoomable-media-gallery/types.d.ts.map +1 -1
- package/lib/typescript/module/agent-chat/shared.d.ts +0 -2
- package/lib/typescript/module/agent-chat/shared.d.ts.map +1 -1
- package/lib/typescript/module/agent-progress/AgentProgressPlan.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/use-shell-viewport.d.ts +0 -1
- package/lib/typescript/module/app-shell/use-shell-viewport.d.ts.map +1 -1
- package/lib/typescript/module/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/module/avatar/LiveBadge.d.ts +6 -2
- package/lib/typescript/module/avatar/LiveBadge.d.ts.map +1 -1
- package/lib/typescript/module/button/shared.d.ts +0 -2
- package/lib/typescript/module/button/shared.d.ts.map +1 -1
- package/lib/typescript/module/button/types.d.ts +1 -1
- package/lib/typescript/module/button/types.d.ts.map +1 -1
- package/lib/typescript/module/chat-composer/shared.d.ts +0 -1
- package/lib/typescript/module/chat-composer/shared.d.ts.map +1 -1
- package/lib/typescript/module/chat-list/shared.d.ts +0 -9
- package/lib/typescript/module/chat-list/shared.d.ts.map +1 -1
- package/lib/typescript/module/composer-panel/shared.d.ts +0 -1
- package/lib/typescript/module/composer-panel/shared.d.ts.map +1 -1
- package/lib/typescript/module/content-panel/ContentPanel.web.d.ts +9 -11
- package/lib/typescript/module/content-panel/ContentPanel.web.d.ts.map +1 -1
- package/lib/typescript/module/cover-header/CoverHeader.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DetailDialogMotion.d.ts.map +1 -1
- package/lib/typescript/module/floating/constants.d.ts +1 -1
- package/lib/typescript/module/floating/shared.d.ts +1 -1
- package/lib/typescript/module/floating/shared.d.ts.map +1 -1
- package/lib/typescript/module/floating/types.d.ts +2 -2
- package/lib/typescript/module/floating/types.d.ts.map +1 -1
- package/lib/typescript/module/image/BloomImage.d.ts +1 -1
- package/lib/typescript/module/image/BloomImage.d.ts.map +1 -1
- package/lib/typescript/module/image/expo-image-module.d.ts +3 -1
- package/lib/typescript/module/image/expo-image-module.d.ts.map +1 -1
- package/lib/typescript/module/image/index.d.ts +1 -1
- package/lib/typescript/module/image/index.d.ts.map +1 -1
- package/lib/typescript/module/image/types.d.ts +18 -0
- package/lib/typescript/module/image/types.d.ts.map +1 -1
- package/lib/typescript/module/link-preview/LinkPreviewCard.d.ts.map +1 -1
- package/lib/typescript/module/link-preview/types.d.ts +7 -0
- package/lib/typescript/module/link-preview/types.d.ts.map +1 -1
- package/lib/typescript/module/lyrics/shared.d.ts +0 -2
- package/lib/typescript/module/lyrics/shared.d.ts.map +1 -1
- package/lib/typescript/module/mail-list/shared.d.ts +0 -9
- package/lib/typescript/module/mail-list/shared.d.ts.map +1 -1
- package/lib/typescript/module/media-card/shared.d.ts +0 -2
- package/lib/typescript/module/media-card/shared.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/MediaSurface.d.ts +10 -1
- package/lib/typescript/module/media-flight/MediaSurface.d.ts.map +1 -1
- package/lib/typescript/module/media-header/shared.d.ts +0 -2
- package/lib/typescript/module/media-header/shared.d.ts.map +1 -1
- package/lib/typescript/module/media-header/types.d.ts +1 -1
- package/lib/typescript/module/media-header/types.d.ts.map +1 -1
- package/lib/typescript/module/media-player/PlayerIconButton.d.ts +1 -1
- package/lib/typescript/module/media-player/PlayerIconButton.d.ts.map +1 -1
- package/lib/typescript/module/media-player/shared.d.ts +0 -2
- package/lib/typescript/module/media-player/shared.d.ts.map +1 -1
- package/lib/typescript/module/music-library/shared.d.ts +0 -2
- package/lib/typescript/module/music-library/shared.d.ts.map +1 -1
- package/lib/typescript/module/page-header/EdgeScrim.d.ts +19 -16
- package/lib/typescript/module/page-header/EdgeScrim.d.ts.map +1 -1
- package/lib/typescript/module/page-header/PageHeader.d.ts.map +1 -1
- package/lib/typescript/module/property-insights/shared.d.ts +0 -2
- package/lib/typescript/module/property-insights/shared.d.ts.map +1 -1
- package/lib/typescript/module/queue-panel/QueueIconButton.d.ts +1 -1
- package/lib/typescript/module/queue-panel/QueueIconButton.d.ts.map +1 -1
- package/lib/typescript/module/shapes/Image.d.ts +1 -1
- package/lib/typescript/module/shapes/Image.d.ts.map +1 -1
- package/lib/typescript/module/shapes/types.d.ts +10 -0
- package/lib/typescript/module/shapes/types.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/parts.d.ts +0 -6
- package/lib/typescript/module/sidebar/parts.d.ts.map +1 -1
- package/lib/typescript/module/stay-filters/EnergyRatingFilter.d.ts +1 -2
- package/lib/typescript/module/stay-filters/EnergyRatingFilter.d.ts.map +1 -1
- package/lib/typescript/module/styles/aria-hosts.d.ts +49 -0
- package/lib/typescript/module/styles/aria-hosts.d.ts.map +1 -0
- package/lib/typescript/module/surface/Surface.d.ts.map +1 -1
- package/lib/typescript/module/surface/Surface.web.d.ts.map +1 -1
- package/lib/typescript/module/surface/SurfacePaint.d.ts.map +1 -1
- package/lib/typescript/module/toast/animations.d.ts +0 -1
- package/lib/typescript/module/toast/animations.d.ts.map +1 -1
- package/lib/typescript/module/track-list/parts.d.ts +1 -1
- package/lib/typescript/module/track-list/parts.d.ts.map +1 -1
- package/lib/typescript/module/typography/TypographyScope.d.ts +0 -4
- package/lib/typescript/module/typography/TypographyScope.d.ts.map +1 -1
- package/lib/typescript/module/zoomable-media-gallery/ZoomableMediaGalleryBase.d.ts.map +1 -1
- package/lib/typescript/module/zoomable-media-gallery/types.d.ts +11 -0
- package/lib/typescript/module/zoomable-media-gallery/types.d.ts.map +1 -1
- package/package.json +1 -18
- package/src/__tests__/support/held-animations.ts +33 -0
- package/src/__tests__/support/public-part-classifications.json +0 -3
- package/src/agent-chat/shared.ts +0 -2
- package/src/agent-progress/AgentProgressPlan.tsx +2 -3
- package/src/ai-chat/AiChatGalleryPanelBase.tsx +1 -1
- package/src/ai-chat/AiChatImageGenerationBase.tsx +1 -1
- package/src/app-shell/use-shell-viewport.ts +1 -7
- package/src/avatar/Avatar.tsx +44 -16
- package/src/avatar/LiveBadge.tsx +10 -3
- package/src/avatar-flight/create-avatar-flight-layer.tsx +8 -8
- package/src/button/shared.ts +0 -6
- package/src/button/types.ts +1 -1
- package/src/canvas/CanvasPanelBase.tsx +3 -3
- package/src/card/SelectionCard.tsx +1 -1
- package/src/chat-composer/shared.ts +0 -1
- package/src/chat-list/shared.ts +0 -7
- package/src/chip/Chip.tsx +3 -3
- package/src/composer-panel/ModelPickerBase.tsx +1 -1
- package/src/composer-panel/shared.ts +0 -1
- package/src/content-panel/ContentPanel.web.tsx +12 -35
- package/src/cover-header/CoverHeader.tsx +2 -3
- package/src/dialog/DetailDialogMotion.tsx +2 -3
- package/src/floating/FloatingPanel.tsx +3 -3
- package/src/floating/TriggerSlot.tsx +2 -2
- package/src/floating/constants.ts +1 -1
- package/src/floating/menu-swatch-row.tsx +3 -3
- package/src/floating/shared.tsx +3 -3
- package/src/floating/types.ts +2 -2
- package/src/image/BloomImage.tsx +4 -0
- package/src/image/expo-image-module.ts +3 -1
- package/src/image/index.ts +1 -0
- package/src/image/types.ts +19 -0
- package/src/link-preview/LinkPreviewCard.tsx +27 -5
- package/src/link-preview/types.ts +7 -0
- package/src/lyrics/shared.ts +0 -3
- package/src/mail-list/shared.ts +0 -9
- package/src/media-card/shared.ts +1 -9
- package/src/media-flight/MediaSurface.tsx +46 -8
- package/src/media-header/shared.ts +1 -8
- package/src/media-header/types.ts +1 -1
- package/src/media-player/PlayerIconButton.tsx +1 -1
- package/src/media-player/shared.ts +1 -8
- package/src/multi-agent-chat/Marketplace.tsx +5 -5
- package/src/music-library/shared.ts +0 -2
- package/src/page-header/EdgeScrim.tsx +17 -14
- package/src/page-header/PageHeader.tsx +11 -6
- package/src/project-board/ProjectBoardCanvas.tsx +3 -3
- package/src/property-insights/shared.ts +1 -3
- package/src/queue-panel/QueueIconButton.tsx +1 -1
- package/src/radio/RadioHost.tsx +2 -2
- package/src/select/Select.tsx +3 -3
- package/src/select/Select.web.tsx +3 -3
- package/src/select/shared.tsx +3 -3
- package/src/shapes/Image.tsx +18 -2
- package/src/shapes/types.ts +10 -0
- package/src/sidebar/SidebarItem.tsx +2 -2
- package/src/sidebar/SidebarOnboardingCard.tsx +3 -3
- package/src/sidebar/parts.tsx +3 -36
- package/src/stay-filters/EnergyRatingFilter.tsx +0 -2
- package/src/styles/aria-hosts.ts +62 -0
- package/src/surface/Surface.tsx +12 -6
- package/src/surface/Surface.web.tsx +3 -4
- package/src/surface/SurfacePaint.tsx +1 -2
- package/src/toast/animations.ts +0 -1
- package/src/track-list/parts.tsx +1 -1
- package/src/typography/TypographyScope.tsx +0 -5
- package/src/zoomable-media-gallery/ZoomableMediaGalleryBase.tsx +368 -324
- package/src/zoomable-media-gallery/types.ts +11 -0
- package/docs/teleport.mdx +0 -72
- package/lib/commonjs/styles/styled-primitives.js +0 -37
- package/lib/commonjs/styles/styled-primitives.js.map +0 -1
- package/lib/commonjs/teleport/Portal.js +0 -109
- package/lib/commonjs/teleport/Portal.js.map +0 -1
- package/lib/commonjs/teleport/PortalHost.js +0 -75
- package/lib/commonjs/teleport/PortalHost.js.map +0 -1
- package/lib/commonjs/teleport/PortalHostView.js +0 -40
- package/lib/commonjs/teleport/PortalHostView.js.map +0 -1
- package/lib/commonjs/teleport/PortalHostView.native.js +0 -24
- package/lib/commonjs/teleport/PortalHostView.native.js.map +0 -1
- package/lib/commonjs/teleport/PortalProvider.js +0 -57
- package/lib/commonjs/teleport/PortalProvider.js.map +0 -1
- package/lib/commonjs/teleport/PortalProviderView.js +0 -59
- package/lib/commonjs/teleport/PortalProviderView.js.map +0 -1
- package/lib/commonjs/teleport/PortalProviderView.native.js +0 -19
- package/lib/commonjs/teleport/PortalProviderView.native.js.map +0 -1
- package/lib/commonjs/teleport/PortalView.js +0 -83
- package/lib/commonjs/teleport/PortalView.js.map +0 -1
- package/lib/commonjs/teleport/PortalView.native.js +0 -14
- package/lib/commonjs/teleport/PortalView.native.js.map +0 -1
- package/lib/commonjs/teleport/index.js +0 -35
- package/lib/commonjs/teleport/index.js.map +0 -1
- package/lib/commonjs/teleport/portal-manager.js +0 -40
- package/lib/commonjs/teleport/portal-manager.js.map +0 -1
- package/lib/commonjs/teleport/portal-registry.js +0 -24
- package/lib/commonjs/teleport/portal-registry.js.map +0 -1
- package/lib/commonjs/teleport/reducer.js +0 -86
- package/lib/commonjs/teleport/reducer.js.map +0 -1
- package/lib/commonjs/teleport/scroll-view-context/context.js +0 -17
- package/lib/commonjs/teleport/scroll-view-context/context.js.map +0 -1
- package/lib/commonjs/teleport/scroll-view-context/context.native.js +0 -22
- package/lib/commonjs/teleport/scroll-view-context/context.native.js.map +0 -1
- package/lib/commonjs/teleport/scroll-view-context/types.js +0 -2
- package/lib/commonjs/teleport/scroll-view-context/types.js.map +0 -1
- package/lib/commonjs/teleport/specs/PortalHostViewNativeComponent.js +0 -17
- package/lib/commonjs/teleport/specs/PortalHostViewNativeComponent.js.map +0 -1
- package/lib/commonjs/teleport/specs/PortalViewNativeComponent.js +0 -17
- package/lib/commonjs/teleport/specs/PortalViewNativeComponent.js.map +0 -1
- package/lib/commonjs/teleport/teleport-global.d.ts +0 -11
- package/lib/commonjs/teleport/types.js +0 -6
- package/lib/commonjs/teleport/types.js.map +0 -1
- package/lib/commonjs/teleport/use-id.js +0 -24
- package/lib/commonjs/teleport/use-id.js.map +0 -1
- package/lib/commonjs/teleport/use-portal.js +0 -59
- package/lib/commonjs/teleport/use-portal.js.map +0 -1
- package/lib/module/styles/styled-primitives.js +0 -34
- package/lib/module/styles/styled-primitives.js.map +0 -1
- package/lib/module/teleport/Portal.js +0 -103
- package/lib/module/teleport/Portal.js.map +0 -1
- package/lib/module/teleport/PortalHost.js +0 -71
- package/lib/module/teleport/PortalHost.js.map +0 -1
- package/lib/module/teleport/PortalHostView.js +0 -35
- package/lib/module/teleport/PortalHostView.js.map +0 -1
- package/lib/module/teleport/PortalHostView.native.js +0 -18
- package/lib/module/teleport/PortalHostView.native.js.map +0 -1
- package/lib/module/teleport/PortalProvider.js +0 -51
- package/lib/module/teleport/PortalProvider.js.map +0 -1
- package/lib/module/teleport/PortalProviderView.js +0 -54
- package/lib/module/teleport/PortalProviderView.js.map +0 -1
- package/lib/module/teleport/PortalProviderView.native.js +0 -15
- package/lib/module/teleport/PortalProviderView.native.js.map +0 -1
- package/lib/module/teleport/PortalView.js +0 -79
- package/lib/module/teleport/PortalView.js.map +0 -1
- package/lib/module/teleport/PortalView.native.js +0 -10
- package/lib/module/teleport/PortalView.native.js.map +0 -1
- package/lib/module/teleport/index.js +0 -30
- package/lib/module/teleport/index.js.map +0 -1
- package/lib/module/teleport/portal-manager.js +0 -33
- package/lib/module/teleport/portal-manager.js.map +0 -1
- package/lib/module/teleport/portal-registry.js +0 -18
- package/lib/module/teleport/portal-registry.js.map +0 -1
- package/lib/module/teleport/reducer.js +0 -81
- package/lib/module/teleport/reducer.js.map +0 -1
- package/lib/module/teleport/scroll-view-context/context.js +0 -12
- package/lib/module/teleport/scroll-view-context/context.js.map +0 -1
- package/lib/module/teleport/scroll-view-context/context.native.js +0 -18
- package/lib/module/teleport/scroll-view-context/context.native.js.map +0 -1
- package/lib/module/teleport/scroll-view-context/types.js +0 -2
- package/lib/module/teleport/scroll-view-context/types.js.map +0 -1
- package/lib/module/teleport/specs/PortalHostViewNativeComponent.js +0 -13
- package/lib/module/teleport/specs/PortalHostViewNativeComponent.js.map +0 -1
- package/lib/module/teleport/specs/PortalViewNativeComponent.js +0 -13
- package/lib/module/teleport/specs/PortalViewNativeComponent.js.map +0 -1
- package/lib/module/teleport/teleport-global.d.ts +0 -11
- package/lib/module/teleport/types.js +0 -4
- package/lib/module/teleport/types.js.map +0 -1
- package/lib/module/teleport/use-id.js +0 -19
- package/lib/module/teleport/use-id.js.map +0 -1
- package/lib/module/teleport/use-portal.js +0 -55
- package/lib/module/teleport/use-portal.js.map +0 -1
- package/lib/typescript/commonjs/styles/styled-primitives.d.ts +0 -69
- package/lib/typescript/commonjs/styles/styled-primitives.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/Portal.d.ts +0 -48
- package/lib/typescript/commonjs/teleport/Portal.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/PortalHost.d.ts +0 -25
- package/lib/typescript/commonjs/teleport/PortalHost.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/PortalHostView.d.ts +0 -5
- package/lib/typescript/commonjs/teleport/PortalHostView.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/PortalHostView.native.d.ts +0 -4
- package/lib/typescript/commonjs/teleport/PortalHostView.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/PortalProvider.d.ts +0 -23
- package/lib/typescript/commonjs/teleport/PortalProvider.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/PortalProviderView.d.ts +0 -3
- package/lib/typescript/commonjs/teleport/PortalProviderView.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/PortalProviderView.native.d.ts +0 -9
- package/lib/typescript/commonjs/teleport/PortalProviderView.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/PortalView.d.ts +0 -9
- package/lib/typescript/commonjs/teleport/PortalView.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/PortalView.native.d.ts +0 -8
- package/lib/typescript/commonjs/teleport/PortalView.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/index.d.ts +0 -29
- package/lib/typescript/commonjs/teleport/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/portal-manager.d.ts +0 -16
- package/lib/typescript/commonjs/teleport/portal-manager.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/portal-registry.d.ts +0 -10
- package/lib/typescript/commonjs/teleport/portal-registry.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/reducer.d.ts +0 -40
- package/lib/typescript/commonjs/teleport/reducer.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/scroll-view-context/context.d.ts +0 -4
- package/lib/typescript/commonjs/teleport/scroll-view-context/context.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/scroll-view-context/context.native.d.ts +0 -13
- package/lib/typescript/commonjs/teleport/scroll-view-context/context.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/scroll-view-context/types.d.ts +0 -10
- package/lib/typescript/commonjs/teleport/scroll-view-context/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/specs/PortalHostViewNativeComponent.d.ts +0 -13
- package/lib/typescript/commonjs/teleport/specs/PortalHostViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/specs/PortalViewNativeComponent.d.ts +0 -14
- package/lib/typescript/commonjs/teleport/specs/PortalViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/types.d.ts +0 -22
- package/lib/typescript/commonjs/teleport/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/use-id.d.ts +0 -2
- package/lib/typescript/commonjs/teleport/use-id.d.ts.map +0 -1
- package/lib/typescript/commonjs/teleport/use-portal.d.ts +0 -35
- package/lib/typescript/commonjs/teleport/use-portal.d.ts.map +0 -1
- package/lib/typescript/module/styles/styled-primitives.d.ts +0 -69
- package/lib/typescript/module/styles/styled-primitives.d.ts.map +0 -1
- package/lib/typescript/module/teleport/Portal.d.ts +0 -48
- package/lib/typescript/module/teleport/Portal.d.ts.map +0 -1
- package/lib/typescript/module/teleport/PortalHost.d.ts +0 -25
- package/lib/typescript/module/teleport/PortalHost.d.ts.map +0 -1
- package/lib/typescript/module/teleport/PortalHostView.d.ts +0 -5
- package/lib/typescript/module/teleport/PortalHostView.d.ts.map +0 -1
- package/lib/typescript/module/teleport/PortalHostView.native.d.ts +0 -4
- package/lib/typescript/module/teleport/PortalHostView.native.d.ts.map +0 -1
- package/lib/typescript/module/teleport/PortalProvider.d.ts +0 -23
- package/lib/typescript/module/teleport/PortalProvider.d.ts.map +0 -1
- package/lib/typescript/module/teleport/PortalProviderView.d.ts +0 -3
- package/lib/typescript/module/teleport/PortalProviderView.d.ts.map +0 -1
- package/lib/typescript/module/teleport/PortalProviderView.native.d.ts +0 -9
- package/lib/typescript/module/teleport/PortalProviderView.native.d.ts.map +0 -1
- package/lib/typescript/module/teleport/PortalView.d.ts +0 -9
- package/lib/typescript/module/teleport/PortalView.d.ts.map +0 -1
- package/lib/typescript/module/teleport/PortalView.native.d.ts +0 -8
- package/lib/typescript/module/teleport/PortalView.native.d.ts.map +0 -1
- package/lib/typescript/module/teleport/index.d.ts +0 -29
- package/lib/typescript/module/teleport/index.d.ts.map +0 -1
- package/lib/typescript/module/teleport/portal-manager.d.ts +0 -16
- package/lib/typescript/module/teleport/portal-manager.d.ts.map +0 -1
- package/lib/typescript/module/teleport/portal-registry.d.ts +0 -10
- package/lib/typescript/module/teleport/portal-registry.d.ts.map +0 -1
- package/lib/typescript/module/teleport/reducer.d.ts +0 -40
- package/lib/typescript/module/teleport/reducer.d.ts.map +0 -1
- package/lib/typescript/module/teleport/scroll-view-context/context.d.ts +0 -4
- package/lib/typescript/module/teleport/scroll-view-context/context.d.ts.map +0 -1
- package/lib/typescript/module/teleport/scroll-view-context/context.native.d.ts +0 -13
- package/lib/typescript/module/teleport/scroll-view-context/context.native.d.ts.map +0 -1
- package/lib/typescript/module/teleport/scroll-view-context/types.d.ts +0 -10
- package/lib/typescript/module/teleport/scroll-view-context/types.d.ts.map +0 -1
- package/lib/typescript/module/teleport/specs/PortalHostViewNativeComponent.d.ts +0 -13
- package/lib/typescript/module/teleport/specs/PortalHostViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/teleport/specs/PortalViewNativeComponent.d.ts +0 -14
- package/lib/typescript/module/teleport/specs/PortalViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/teleport/types.d.ts +0 -22
- package/lib/typescript/module/teleport/types.d.ts.map +0 -1
- package/lib/typescript/module/teleport/use-id.d.ts +0 -2
- package/lib/typescript/module/teleport/use-id.d.ts.map +0 -1
- package/lib/typescript/module/teleport/use-portal.d.ts +0 -35
- package/lib/typescript/module/teleport/use-portal.d.ts.map +0 -1
- package/src/styles/styled-primitives.ts +0 -87
- package/src/teleport/Portal.tsx +0 -96
- package/src/teleport/PortalHost.tsx +0 -61
- package/src/teleport/PortalHostView.native.tsx +0 -14
- package/src/teleport/PortalHostView.tsx +0 -30
- package/src/teleport/PortalProvider.tsx +0 -51
- package/src/teleport/PortalProviderView.native.tsx +0 -11
- package/src/teleport/PortalProviderView.tsx +0 -54
- package/src/teleport/PortalView.native.tsx +0 -7
- package/src/teleport/PortalView.tsx +0 -83
- package/src/teleport/index.ts +0 -32
- package/src/teleport/portal-manager.tsx +0 -29
- package/src/teleport/portal-registry.ts +0 -24
- package/src/teleport/reducer.ts +0 -93
- package/src/teleport/scroll-view-context/context.native.ts +0 -19
- package/src/teleport/scroll-view-context/context.ts +0 -12
- package/src/teleport/scroll-view-context/types.ts +0 -7
- package/src/teleport/specs/PortalHostViewNativeComponent.ts +0 -15
- package/src/teleport/specs/PortalViewNativeComponent.ts +0 -16
- package/src/teleport/teleport-global.d.ts +0 -11
- package/src/teleport/types.ts +0 -22
- package/src/teleport/use-id.ts +0 -18
- package/src/teleport/use-portal.ts +0 -46
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
import Animated, {
|
|
27
27
|
useSharedValue,
|
|
28
28
|
useAnimatedStyle,
|
|
29
|
+
useDerivedValue,
|
|
29
30
|
withSpring,
|
|
30
31
|
withTiming,
|
|
31
32
|
runOnJS,
|
|
@@ -165,6 +166,20 @@ const UNBLURRED_DIM_OPACITY = 0.92;
|
|
|
165
166
|
*/
|
|
166
167
|
const SCRIM_CHROME = { background: 'rgba(0,0,0,0.55)', foreground: '#fff' } as const;
|
|
167
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Calls `onCommit` from the commit that mounts it. Placed INSIDE the portaled
|
|
171
|
+
* overlay, so it runs once the overlay itself is in the tree — the viewer's
|
|
172
|
+
* own effects run a commit earlier, before the portal outlet has rendered the
|
|
173
|
+
* content, and a flight started there would be under way before its first
|
|
174
|
+
* frame was on screen.
|
|
175
|
+
*/
|
|
176
|
+
function OnCommit({ onCommit }: { onCommit: () => void }) {
|
|
177
|
+
useLayoutEffect(() => {
|
|
178
|
+
onCommit();
|
|
179
|
+
}, [onCommit]);
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
|
|
168
183
|
export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>) {
|
|
169
184
|
function NavArrow({
|
|
170
185
|
direction,
|
|
@@ -229,10 +244,14 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
229
244
|
* renders through the Bloom `Portal` on BOTH platforms (RN's `Modal` is not
|
|
230
245
|
* used on native — on the New Architecture / Fabric Android its host views
|
|
231
246
|
* mount full-screen but never composite, leaving the viewer invisible).
|
|
232
|
-
* - The OPENING (tapped) item
|
|
233
|
-
* aspect-ratio-preserving fit within {@link FIT_FRACTION} of the screen
|
|
234
|
-
*
|
|
235
|
-
*
|
|
247
|
+
* - The OPENING (tapped) item flies from its measured rect to a centered,
|
|
248
|
+
* aspect-ratio-preserving fit within {@link FIT_FRACTION} of the screen, and
|
|
249
|
+
* every dismissal flies it back. The horizontal paging `ScrollView` is
|
|
250
|
+
* mounted from the first frame, seeded at the tapped index, and the flight
|
|
251
|
+
* transforms it: the media on screen is ONE surface, the active page's, from
|
|
252
|
+
* the first frame of the open to the last frame of the close. One shared
|
|
253
|
+
* value (`flight`) drives the transform and the backdrop, on the UI thread;
|
|
254
|
+
* `hiddenThumbIndex` lets the consumer hide the thumbnail it stands in for.
|
|
236
255
|
* - Gesture disambiguation: the pager owns horizontal swipes; a vertical-only
|
|
237
256
|
* `Gesture.Pan` (`activeOffsetY` + `failOffsetX`) owns drag-to-dismiss, so the
|
|
238
257
|
* two never fight.
|
|
@@ -245,8 +264,8 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
245
264
|
* handing the same player to this gallery moves a playing video into fullscreen
|
|
246
265
|
* without re-opening the stream. Exactly ONE view is mounted per opening — the
|
|
247
266
|
* active page's — while every other page and every strip tile renders the still
|
|
248
|
-
* (`MediaPoster`). The
|
|
249
|
-
*
|
|
267
|
+
* (`MediaPoster`). The active page's view lives from the first frame of the
|
|
268
|
+
* open to the last frame of the close, so the transition swaps nothing.
|
|
250
269
|
*
|
|
251
270
|
* `expo-video` is an OPTIONAL peer loaded through `media-flight/expo-video-module`.
|
|
252
271
|
* Without it a video page degrades to its poster, once, with a dev warning.
|
|
@@ -266,6 +285,7 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
266
285
|
indicatorVariant = 'dots',
|
|
267
286
|
videoControls = false,
|
|
268
287
|
labels: labelsProp,
|
|
288
|
+
hiddenThumbIndex,
|
|
269
289
|
},
|
|
270
290
|
ref,
|
|
271
291
|
) => {
|
|
@@ -307,8 +327,9 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
307
327
|
);
|
|
308
328
|
|
|
309
329
|
const [isOpen, setIsOpen] = useState(false);
|
|
310
|
-
//
|
|
311
|
-
|
|
330
|
+
// True once the open flight has landed, until a dismissal starts: the
|
|
331
|
+
// chrome (share, counter, arrows) shows and the pager may page.
|
|
332
|
+
const [settled, setSettled] = useState(false);
|
|
312
333
|
const [items, setItems] = useState<GalleryMedia[]>([]);
|
|
313
334
|
// The accepted opening's item identities are needed by async probes even
|
|
314
335
|
// before React commits the corresponding state update.
|
|
@@ -333,10 +354,22 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
333
354
|
return typeof navigator !== 'undefined' && typeof navigator.share === 'function';
|
|
334
355
|
});
|
|
335
356
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
357
|
+
// The transition is ONE value: 0 is the media standing on its thumbnail,
|
|
358
|
+
// 1 is the media fitted on screen. Open springs it to 1, every dismissal
|
|
359
|
+
// springs it back to 0, and both ends of the media's transform and the
|
|
360
|
+
// backdrop's fade are read from it — so a close started mid-open, or from
|
|
361
|
+
// wherever a drag left the media, lands on the thumbnail by construction,
|
|
362
|
+
// and its one completion callback is the frame the viewer has returned.
|
|
363
|
+
const flight = useSharedValue(0);
|
|
364
|
+
// The finger's offset while dragging to dismiss, applied at the fitted
|
|
365
|
+
// end of the flight. Rest is (0, 0, 1).
|
|
366
|
+
const dragX = useSharedValue(0);
|
|
367
|
+
const dragY = useSharedValue(0);
|
|
368
|
+
const dragScale = useSharedValue(1);
|
|
369
|
+
// The media itself is opaque: only the backdrop and chrome fade. It fades
|
|
370
|
+
// only where there is no thumbnail to fly to (or from), and drops to 0 on
|
|
371
|
+
// the frame the fly-back lands, when the thumbnail takes its place.
|
|
372
|
+
const mediaOpacity = useSharedValue(1);
|
|
340
373
|
|
|
341
374
|
// Zoom transform of the active media, kept SEPARATE from the open/close +
|
|
342
375
|
// dismiss-drag transform above (reusing those would collide two meanings).
|
|
@@ -353,13 +386,12 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
353
386
|
const originX = useSharedValue(0);
|
|
354
387
|
const originY = useSharedValue(0);
|
|
355
388
|
|
|
389
|
+
// Per-drag baseline captured at pan start (transient).
|
|
356
390
|
const startX = useSharedValue(0);
|
|
357
391
|
const startY = useSharedValue(0);
|
|
358
|
-
// Per-drag baseline captured at pan start (transient).
|
|
359
392
|
const startScale = useSharedValue(1);
|
|
360
|
-
//
|
|
361
|
-
//
|
|
362
|
-
// shrinks back to it. Never overwritten by the drag gesture.
|
|
393
|
+
// Scale of the fitted media at its thumbnail (thumbWidth / fittedWidth):
|
|
394
|
+
// the flight's 0 end.
|
|
363
395
|
const originScale = useSharedValue(1);
|
|
364
396
|
|
|
365
397
|
const pagerRef = useRef<ComponentRef<typeof ScrollView>>(null);
|
|
@@ -376,54 +408,38 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
376
408
|
// True from the first dismiss request until the viewer is actually unmounted.
|
|
377
409
|
const dismissingRef = useRef(false);
|
|
378
410
|
|
|
379
|
-
//
|
|
380
|
-
// the
|
|
381
|
-
//
|
|
382
|
-
//
|
|
383
|
-
// gesture or an imperative `open()` — never from an effect — so React's own
|
|
384
|
-
// teardown reaches none of them. A screen left within the ~300 ms of the open
|
|
385
|
-
// transition therefore leaves a live timer holding the whole subtree, and the
|
|
386
|
-
// state it eventually writes lands on a tree nobody is rendering. React makes
|
|
387
|
-
// that a silent no-op rather than an error, which is exactly why it survived:
|
|
388
|
-
// measured under jest, the gallery's `revealPager` timer outlives the file
|
|
389
|
-
// that mounted it and fires inside the NEXT test file in the same worker
|
|
390
|
-
// process, sometimes re-scheduling itself two files further on.
|
|
391
|
-
const pendingRef = useRef<Set<ReturnType<typeof setTimeout>>>(new Set());
|
|
392
|
-
const frameRef = useRef<number | null>(null);
|
|
411
|
+
// Nothing in the transition is a timer: the open starts from the commit
|
|
412
|
+
// that mounts the overlay and ends in its spring's callback, and the close
|
|
413
|
+
// ends in its own. An unmount only has to stop that callback from writing
|
|
414
|
+
// (`unmountedRef`) and give the thumbnail back.
|
|
393
415
|
const unmountedRef = useRef(false);
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
// this can be reached once the component is already gone — starting a timer
|
|
397
|
-
// there would put one back after the cleanup has run.
|
|
398
|
-
if (unmountedRef.current) return;
|
|
399
|
-
const handle = setTimeout(() => {
|
|
400
|
-
pendingRef.current.delete(handle);
|
|
401
|
-
step();
|
|
402
|
-
}, delay);
|
|
403
|
-
pendingRef.current.add(handle);
|
|
404
|
-
}, []);
|
|
416
|
+
const hiddenThumbRef = useRef(hiddenThumbIndex);
|
|
417
|
+
hiddenThumbRef.current = hiddenThumbIndex;
|
|
405
418
|
useEffect(() => {
|
|
406
419
|
unmountedRef.current = false;
|
|
407
420
|
return () => {
|
|
408
421
|
unmountedRef.current = true;
|
|
409
422
|
reportOpen(false);
|
|
410
|
-
|
|
411
|
-
pendingRef.current.clear();
|
|
412
|
-
if (frameRef.current !== null) {
|
|
413
|
-
cancelAnimationFrame(frameRef.current);
|
|
414
|
-
frameRef.current = null;
|
|
415
|
-
}
|
|
423
|
+
if (hiddenThumbRef.current) hiddenThumbRef.current.value = -1;
|
|
416
424
|
};
|
|
417
425
|
}, [reportOpen]);
|
|
418
426
|
|
|
419
427
|
// Single writer for the current index: updates state (drives indicator + open
|
|
420
428
|
// image) and the synchronous mirror together, and only when it changes.
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
429
|
+
// The thumbnail the media stands in for follows the page, so a swipe
|
|
430
|
+
// gives back the one it left and hides the one it reached.
|
|
431
|
+
const setActiveIndexBoth = useCallback(
|
|
432
|
+
(next: number, opening = false) => {
|
|
433
|
+
const changed = activeIndexRef.current !== next;
|
|
434
|
+
activeIndexRef.current = next;
|
|
435
|
+
setActiveIndex((prev) => (prev === next ? prev : next));
|
|
436
|
+
if (changed && hiddenThumbIndex && !opening && !dismissingRef.current) {
|
|
437
|
+
hiddenThumbIndex.value = next;
|
|
438
|
+
}
|
|
439
|
+
if (changed || opening) onIndexChangeRef.current?.(next);
|
|
440
|
+
},
|
|
441
|
+
[hiddenThumbIndex],
|
|
442
|
+
);
|
|
427
443
|
|
|
428
444
|
// Snap the active media back to its un-zoomed baseline (no animation) and
|
|
429
445
|
// clear all zoom bookkeeping. Called on every path that changes the active
|
|
@@ -475,7 +491,7 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
475
491
|
[fitBox],
|
|
476
492
|
);
|
|
477
493
|
|
|
478
|
-
// Fitted size of the
|
|
494
|
+
// Fitted size of the media for the CURRENT page. On open this is
|
|
479
495
|
// the opened item's fit;
|
|
480
496
|
// after swiping it tracks the viewed item so the collapse-on-dismiss renders
|
|
481
497
|
// and flies back the media actually on screen.
|
|
@@ -538,60 +554,60 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
538
554
|
[isCurrentRatioProbe],
|
|
539
555
|
);
|
|
540
556
|
|
|
541
|
-
//
|
|
542
|
-
// every dismiss path (fly-back and fade-out fallback).
|
|
557
|
+
// The viewer has returned: unmount and put every value back at rest.
|
|
543
558
|
const finalizeDismiss = useCallback(() => {
|
|
559
|
+
if (unmountedRef.current) return;
|
|
544
560
|
setIsOpen(false);
|
|
545
561
|
// Keep the dismissal latch until the next open. Throttled web scroll
|
|
546
562
|
// events can arrive after the pager unmounts and must not reset selection.
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
563
|
+
flight.value = 0;
|
|
564
|
+
dragX.value = 0;
|
|
565
|
+
dragY.value = 0;
|
|
566
|
+
dragScale.value = 1;
|
|
567
|
+
resetZoom();
|
|
551
568
|
reportOpen(false);
|
|
552
|
-
}, [
|
|
553
|
-
|
|
554
|
-
// Fly the
|
|
555
|
-
//
|
|
556
|
-
//
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
569
|
+
}, [dragScale, dragX, dragY, flight, reportOpen, resetZoom]);
|
|
570
|
+
|
|
571
|
+
// Fly the media home: back to `target` (the current item's thumbnail,
|
|
572
|
+
// relative to the screen center), or, with no thumbnail to land on, into
|
|
573
|
+
// the center while it fades. Both end on the same callback — the frame
|
|
574
|
+
// the flight reaches 0 hides the media and gives the thumbnail back
|
|
575
|
+
// together, on the UI thread, so the photo is on screen exactly once.
|
|
576
|
+
const flyHome = useCallback(
|
|
577
|
+
(target: { x: number; y: number; scale: number } | null) => {
|
|
578
|
+
if (unmountedRef.current) return;
|
|
579
|
+
const web = Platform.OS === 'web';
|
|
580
|
+
if (target) {
|
|
581
|
+
originX.value = target.x;
|
|
582
|
+
originY.value = target.y;
|
|
583
|
+
originScale.value = target.scale;
|
|
567
584
|
} else {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
585
|
+
originX.value = 0;
|
|
586
|
+
originY.value = 0;
|
|
587
|
+
originScale.value = MIN_DRAG_SCALE;
|
|
588
|
+
mediaOpacity.value = withTiming(0, {
|
|
589
|
+
duration: web ? CLOSE_DURATION_WEB : OPACITY_DURATION,
|
|
590
|
+
});
|
|
573
591
|
}
|
|
592
|
+
const thumb = hiddenThumbIndex;
|
|
593
|
+
const landed = (finished?: boolean) => {
|
|
594
|
+
'worklet';
|
|
595
|
+
if (!finished) return;
|
|
596
|
+
mediaOpacity.value = 0;
|
|
597
|
+
if (thumb) thumb.value = -1;
|
|
598
|
+
runOnJS(finalizeDismiss)();
|
|
599
|
+
};
|
|
600
|
+
flight.value = web
|
|
601
|
+
? withTiming(
|
|
602
|
+
0,
|
|
603
|
+
{ duration: CLOSE_DURATION_WEB, easing: Easing.in(Easing.cubic) },
|
|
604
|
+
landed,
|
|
605
|
+
)
|
|
606
|
+
: withSpring(0, CLOSE_SPRING, landed);
|
|
574
607
|
},
|
|
575
|
-
[finalizeDismiss,
|
|
608
|
+
[finalizeDismiss, flight, hiddenThumbIndex, mediaOpacity, originScale, originX, originY],
|
|
576
609
|
);
|
|
577
610
|
|
|
578
|
-
// Fallback when the current thumbnail cannot be measured (ref missing /
|
|
579
|
-
// unmounted / virtualized): a plain center fade-out with a slight scale-down,
|
|
580
|
-
// then unmount. Keeps the same web timing / native spring feel.
|
|
581
|
-
const fadeOutCenter = useCallback(() => {
|
|
582
|
-
if (Platform.OS === 'web') {
|
|
583
|
-
const duration = CLOSE_DURATION_WEB;
|
|
584
|
-
const easing = Easing.in(Easing.cubic);
|
|
585
|
-
scale.value = withTiming(MIN_DRAG_SCALE, { duration, easing });
|
|
586
|
-
opacity.value = withTiming(0, { duration, easing });
|
|
587
|
-
schedule(finalizeDismiss, duration + 20);
|
|
588
|
-
} else {
|
|
589
|
-
scale.value = withSpring(MIN_DRAG_SCALE, CLOSE_SPRING);
|
|
590
|
-
opacity.value = withTiming(0, { duration: OPACITY_DURATION });
|
|
591
|
-
schedule(finalizeDismiss, CLOSE_DURATION_WEB);
|
|
592
|
-
}
|
|
593
|
-
}, [finalizeDismiss, opacity, scale, schedule]);
|
|
594
|
-
|
|
595
611
|
const handleDismiss = useCallback(() => {
|
|
596
612
|
// A press on the image reaches BOTH its tap gesture and the page beneath it
|
|
597
613
|
// (which owns the dismiss for the empty area around the image), so this can
|
|
@@ -600,42 +616,106 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
600
616
|
if (dismissingRef.current) return;
|
|
601
617
|
dismissingRef.current = true;
|
|
602
618
|
pendingShareFocus.current = null;
|
|
603
|
-
|
|
604
|
-
//
|
|
605
|
-
|
|
619
|
+
setSettled(false);
|
|
620
|
+
// A zoomed page unzooms on the way home, in step with the flight.
|
|
621
|
+
zoomScale.value = withSpring(1, CLOSE_SPRING);
|
|
622
|
+
zoomTranslateX.value = withSpring(0, CLOSE_SPRING);
|
|
623
|
+
zoomTranslateY.value = withSpring(0, CLOSE_SPRING);
|
|
606
624
|
|
|
607
625
|
const index = activeIndexRef.current;
|
|
608
626
|
const current = items[index];
|
|
609
|
-
//
|
|
610
|
-
//
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
if (measureThumb && current) {
|
|
614
|
-
const centerX = SCREEN_WIDTH / 2;
|
|
615
|
-
const centerY = SCREEN_HEIGHT / 2;
|
|
616
|
-
void measureThumb(index).then((rect) => {
|
|
617
|
-
if (rect && rect.width > 0 && activeFit.width > 0) {
|
|
618
|
-
flyBackTo({
|
|
619
|
-
x: rect.x + rect.width / 2 - centerX,
|
|
620
|
-
y: rect.y + rect.height / 2 - centerY,
|
|
621
|
-
scale: rect.width / activeFit.width,
|
|
622
|
-
});
|
|
623
|
-
} else {
|
|
624
|
-
fadeOutCenter();
|
|
625
|
-
}
|
|
626
|
-
});
|
|
627
|
+
// The target is the CURRENT item's thumbnail, measured now: the page may
|
|
628
|
+
// have changed, and the list under the viewer may have scrolled.
|
|
629
|
+
if (!measureThumb || !current) {
|
|
630
|
+
flyHome(null);
|
|
627
631
|
return;
|
|
628
632
|
}
|
|
633
|
+
const centerX = SCREEN_WIDTH / 2;
|
|
634
|
+
const centerY = SCREEN_HEIGHT / 2;
|
|
635
|
+
void measureThumb(index).then((rect) => {
|
|
636
|
+
flyHome(
|
|
637
|
+
rect && rect.width > 0 && activeFit.width > 0
|
|
638
|
+
? {
|
|
639
|
+
x: rect.x + rect.width / 2 - centerX,
|
|
640
|
+
y: rect.y + rect.height / 2 - centerY,
|
|
641
|
+
scale: rect.width / activeFit.width,
|
|
642
|
+
}
|
|
643
|
+
: null,
|
|
644
|
+
);
|
|
645
|
+
});
|
|
646
|
+
}, [
|
|
647
|
+
activeFit,
|
|
648
|
+
flyHome,
|
|
649
|
+
items,
|
|
650
|
+
measureThumb,
|
|
651
|
+
SCREEN_HEIGHT,
|
|
652
|
+
SCREEN_WIDTH,
|
|
653
|
+
zoomScale,
|
|
654
|
+
zoomTranslateX,
|
|
655
|
+
zoomTranslateY,
|
|
656
|
+
]);
|
|
629
657
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
//
|
|
634
|
-
//
|
|
635
|
-
//
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
658
|
+
// The open flight: from the thumbnail to the fitted center. The thumbnail
|
|
659
|
+
// is hidden in the same write, so the photo is on screen exactly once. It
|
|
660
|
+
// starts when the opened media shows a picture (`onPicture`) if it has a
|
|
661
|
+
// preview — the thumbnail's own, already decoded URL — and otherwise as
|
|
662
|
+
// soon as the overlay is committed. Started any earlier, the thumbnail
|
|
663
|
+
// was hidden and the media had flown a frame or two before its first
|
|
664
|
+
// pixel was drawn: a hole where the avatar was, then a photo already on
|
|
665
|
+
// its way.
|
|
666
|
+
const flightPendingRef = useRef(false);
|
|
667
|
+
const startOpenFlight = useCallback(() => {
|
|
668
|
+
if (!flightPendingRef.current) return;
|
|
669
|
+
flightPendingRef.current = false;
|
|
670
|
+
const generation = openingGenerationRef.current;
|
|
671
|
+
const settle = () => {
|
|
672
|
+
if (
|
|
673
|
+
unmountedRef.current ||
|
|
674
|
+
dismissingRef.current ||
|
|
675
|
+
openingGenerationRef.current !== generation
|
|
676
|
+
)
|
|
677
|
+
return;
|
|
678
|
+
setSettled(true);
|
|
679
|
+
};
|
|
680
|
+
const landed = (finished?: boolean) => {
|
|
681
|
+
'worklet';
|
|
682
|
+
if (finished) runOnJS(settle)();
|
|
683
|
+
};
|
|
684
|
+
if (hiddenThumbIndex) hiddenThumbIndex.value = activeIndexRef.current;
|
|
685
|
+
if (mediaOpacity.value < 1) {
|
|
686
|
+
mediaOpacity.value = withTiming(1, {
|
|
687
|
+
duration: Platform.OS === 'web' ? OPEN_DURATION_WEB : OPACITY_DURATION,
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
flight.value =
|
|
691
|
+
Platform.OS === 'web'
|
|
692
|
+
? withTiming(
|
|
693
|
+
1,
|
|
694
|
+
{ duration: OPEN_DURATION_WEB, easing: Easing.out(Easing.cubic) },
|
|
695
|
+
landed,
|
|
696
|
+
)
|
|
697
|
+
: withSpring(1, OPEN_SPRING, landed);
|
|
698
|
+
}, [flight, hiddenThumbIndex, mediaOpacity]);
|
|
699
|
+
|
|
700
|
+
// The overlay is committed (see `OnCommit`). Seat the pager on the opened
|
|
701
|
+
// page now that it exists: `contentOffset` alone is not honoured on web
|
|
702
|
+
// for a pager mounted with the overlay (it stayed on page 0 while the
|
|
703
|
+
// counter said 2 / 2), and the viewer's own layout effects run before the
|
|
704
|
+
// portal has rendered the pager.
|
|
705
|
+
const onOverlayCommit = useCallback(() => {
|
|
706
|
+
pagerRef.current?.scrollTo({
|
|
707
|
+
x: activeIndexRef.current * SCREEN_WIDTH,
|
|
708
|
+
y: 0,
|
|
709
|
+
animated: false,
|
|
710
|
+
});
|
|
711
|
+
const opened = openedItemsRef.current[activeIndexRef.current];
|
|
712
|
+
const waitsForPicture =
|
|
713
|
+
opened !== undefined &&
|
|
714
|
+
opened.kind !== 'video' &&
|
|
715
|
+
opened.previewUri !== undefined &&
|
|
716
|
+
opened.previewUri !== opened.uri;
|
|
717
|
+
if (!waitsForPicture) startOpenFlight();
|
|
718
|
+
}, [startOpenFlight, SCREEN_WIDTH]);
|
|
639
719
|
|
|
640
720
|
const open = useCallback(
|
|
641
721
|
(nextItems: GalleryMedia[], index: number, rect?: MeasuredRect) => {
|
|
@@ -682,10 +762,9 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
682
762
|
});
|
|
683
763
|
}
|
|
684
764
|
|
|
685
|
-
// The
|
|
686
|
-
//
|
|
687
|
-
//
|
|
688
|
-
// of the thumbnail width to the fitted width.
|
|
765
|
+
// The media is laid out at its FINAL fitted size and the flight scales it
|
|
766
|
+
// down onto the thumbnail: its 0 end is the thumbnail's center (as an
|
|
767
|
+
// offset from the screen's) and width over the fitted width.
|
|
689
768
|
const fitted = fitForRatio(ratio, targetUri);
|
|
690
769
|
const centerX = SCREEN_WIDTH / 2;
|
|
691
770
|
const centerY = SCREEN_HEIGHT / 2;
|
|
@@ -693,56 +772,39 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
693
772
|
originX.value = rect.x + rect.width / 2 - centerX;
|
|
694
773
|
originY.value = rect.y + rect.height / 2 - centerY;
|
|
695
774
|
originScale.value = rect.width / fitted.width;
|
|
775
|
+
mediaOpacity.value = 1;
|
|
696
776
|
} else {
|
|
777
|
+
// Nothing to grow out of: the media appears in place and fades in.
|
|
697
778
|
originX.value = 0;
|
|
698
779
|
originY.value = 0;
|
|
699
780
|
originScale.value = 1;
|
|
781
|
+
mediaOpacity.value = 0;
|
|
700
782
|
}
|
|
783
|
+
flight.value = 0;
|
|
784
|
+
dragX.value = 0;
|
|
785
|
+
dragY.value = 0;
|
|
786
|
+
dragScale.value = 1;
|
|
787
|
+
flightPendingRef.current = true;
|
|
701
788
|
|
|
789
|
+
setSettled(false);
|
|
702
790
|
setIsOpen(true);
|
|
703
791
|
reportOpen(true);
|
|
704
|
-
translateX.value = originX.value;
|
|
705
|
-
translateY.value = originY.value;
|
|
706
|
-
scale.value = originScale.value;
|
|
707
|
-
opacity.value = 0;
|
|
708
|
-
|
|
709
|
-
if (Platform.OS === 'web') {
|
|
710
|
-
frameRef.current = requestAnimationFrame(() => {
|
|
711
|
-
frameRef.current = null;
|
|
712
|
-
const duration = OPEN_DURATION_WEB;
|
|
713
|
-
const easing = Easing.out(Easing.cubic);
|
|
714
|
-
scale.value = withTiming(1, { duration, easing });
|
|
715
|
-
translateX.value = withTiming(0, { duration, easing });
|
|
716
|
-
translateY.value = withTiming(0, { duration, easing });
|
|
717
|
-
opacity.value = withTiming(1, { duration, easing });
|
|
718
|
-
schedule(revealPager, duration);
|
|
719
|
-
});
|
|
720
|
-
} else {
|
|
721
|
-
schedule(() => {
|
|
722
|
-
scale.value = withSpring(1, OPEN_SPRING);
|
|
723
|
-
translateX.value = withSpring(0, OPEN_SPRING);
|
|
724
|
-
translateY.value = withSpring(0, OPEN_SPRING);
|
|
725
|
-
opacity.value = withTiming(1, { duration: OPACITY_DURATION });
|
|
726
|
-
schedule(revealPager, OPEN_DURATION_WEB);
|
|
727
|
-
}, 0);
|
|
728
|
-
}
|
|
729
792
|
},
|
|
730
793
|
[
|
|
731
794
|
SCREEN_WIDTH,
|
|
732
795
|
SCREEN_HEIGHT,
|
|
796
|
+
dragScale,
|
|
797
|
+
dragX,
|
|
798
|
+
dragY,
|
|
733
799
|
fitForRatio,
|
|
800
|
+
flight,
|
|
734
801
|
isCurrentRatioProbe,
|
|
735
|
-
|
|
802
|
+
mediaOpacity,
|
|
736
803
|
originScale,
|
|
737
804
|
originX,
|
|
738
805
|
originY,
|
|
739
|
-
revealPager,
|
|
740
806
|
reportOpen,
|
|
741
|
-
scale,
|
|
742
|
-
schedule,
|
|
743
807
|
setActiveIndexBoth,
|
|
744
|
-
translateX,
|
|
745
|
-
translateY,
|
|
746
808
|
],
|
|
747
809
|
);
|
|
748
810
|
|
|
@@ -753,6 +815,10 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
753
815
|
|
|
754
816
|
React.useImperativeHandle(ref, () => ({ open, close }), [open, close]);
|
|
755
817
|
|
|
818
|
+
// Drag to dismiss: the media follows the finger on the UI thread, shrinking
|
|
819
|
+
// and dimming the backdrop with distance. Short of the threshold it springs
|
|
820
|
+
// back carrying the finger's speed; past it, the same flight home as any
|
|
821
|
+
// other dismissal, starting from wherever the finger left it.
|
|
756
822
|
const panGesture = useMemo(
|
|
757
823
|
() =>
|
|
758
824
|
Gesture.Pan()
|
|
@@ -764,45 +830,41 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
764
830
|
.activeOffsetY([-AXIS_DECISION_OFFSET, AXIS_DECISION_OFFSET])
|
|
765
831
|
.failOffsetX([-AXIS_DECISION_OFFSET, AXIS_DECISION_OFFSET])
|
|
766
832
|
.onStart(() => {
|
|
767
|
-
startX.value =
|
|
768
|
-
startY.value =
|
|
769
|
-
startScale.value =
|
|
833
|
+
startX.value = dragX.value;
|
|
834
|
+
startY.value = dragY.value;
|
|
835
|
+
startScale.value = dragScale.value;
|
|
770
836
|
})
|
|
771
837
|
.onUpdate((event) => {
|
|
772
|
-
|
|
773
|
-
|
|
838
|
+
dragX.value = startX.value + event.translationX;
|
|
839
|
+
dragY.value = startY.value + event.translationY;
|
|
774
840
|
const dragDistance = Math.sqrt(event.translationX ** 2 + event.translationY ** 2);
|
|
775
|
-
const maxDrag = SCREEN_HEIGHT * MAX_DRAG_FRACTION;
|
|
776
|
-
opacity.value = Math.max(0, 1 - dragDistance / maxDrag);
|
|
777
841
|
const scaleReduction = Math.max(
|
|
778
842
|
MIN_DRAG_SCALE,
|
|
779
843
|
1 - dragDistance / (SCREEN_HEIGHT * SCALE_DRAG_FRACTION),
|
|
780
844
|
);
|
|
781
|
-
|
|
845
|
+
dragScale.value = startScale.value * scaleReduction;
|
|
782
846
|
})
|
|
783
847
|
.onEnd((event) => {
|
|
784
848
|
const dragDistance = Math.sqrt(event.translationX ** 2 + event.translationY ** 2);
|
|
785
849
|
if (dragDistance > SCREEN_HEIGHT * DISMISS_FRACTION) {
|
|
786
850
|
runOnJS(handleDismiss)();
|
|
787
851
|
} else {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
opacity.value = withTiming(1, { duration: OPACITY_DURATION });
|
|
852
|
+
dragScale.value = withSpring(1, SNAP_BACK_SPRING);
|
|
853
|
+
dragX.value = withSpring(0, { ...SNAP_BACK_SPRING, velocity: event.velocityX });
|
|
854
|
+
dragY.value = withSpring(0, { ...SNAP_BACK_SPRING, velocity: event.velocityY });
|
|
792
855
|
}
|
|
793
856
|
}),
|
|
794
857
|
[
|
|
858
|
+
dragScale,
|
|
859
|
+
dragX,
|
|
860
|
+
dragY,
|
|
795
861
|
handleDismiss,
|
|
796
862
|
isOpen,
|
|
797
863
|
isZoomed,
|
|
798
864
|
SCREEN_HEIGHT,
|
|
799
|
-
opacity,
|
|
800
|
-
scale,
|
|
801
865
|
startScale,
|
|
802
866
|
startX,
|
|
803
867
|
startY,
|
|
804
|
-
translateX,
|
|
805
|
-
translateY,
|
|
806
868
|
],
|
|
807
869
|
);
|
|
808
870
|
|
|
@@ -815,32 +877,35 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
815
877
|
// double-tap zoom on web. Native (plugin present) auto-tracks and ignores the
|
|
816
878
|
// extra deps, so listing them is correct on both platforms. Same rule as
|
|
817
879
|
// `bottom-sheet/BottomSheetBase.tsx`. Do NOT strip these.
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
//
|
|
821
|
-
const
|
|
822
|
-
(
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
[translateX, translateY, scale],
|
|
880
|
+
//
|
|
881
|
+
// The backdrop (and the chrome over it) is the flight, dimmed by how far
|
|
882
|
+
// the media has been dragged.
|
|
883
|
+
const backdropProgress = useDerivedValue(() => {
|
|
884
|
+
const dragDistance = Math.sqrt(dragX.value ** 2 + dragY.value ** 2);
|
|
885
|
+
const dragDim = Math.max(0, 1 - dragDistance / (SCREEN_HEIGHT * MAX_DRAG_FRACTION));
|
|
886
|
+
return flight.value * dragDim;
|
|
887
|
+
}, [dragX, dragY, flight, SCREEN_HEIGHT]);
|
|
888
|
+
const backdropStyle = useAnimatedStyle(
|
|
889
|
+
() => ({ opacity: backdropProgress.value }),
|
|
890
|
+
[backdropProgress],
|
|
830
891
|
);
|
|
831
892
|
|
|
832
|
-
//
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
893
|
+
// The pager — and so the active page's media, centered in it — rides the
|
|
894
|
+
// flight: at 0 it stands on the thumbnail, at 1 it is where the finger
|
|
895
|
+
// has it. ONE surface paints the media from the first frame of the open
|
|
896
|
+
// to the last frame of the close; nothing is swapped, remounted or
|
|
897
|
+
// re-decoded on the way, which is what used to flash.
|
|
898
|
+
const mediaStyle = useAnimatedStyle(() => {
|
|
899
|
+
const t = flight.value;
|
|
900
|
+
return {
|
|
901
|
+
opacity: mediaOpacity.value,
|
|
836
902
|
transform: [
|
|
837
|
-
{ translateX:
|
|
838
|
-
{ translateY:
|
|
839
|
-
{ scale:
|
|
903
|
+
{ translateX: originX.value + (dragX.value - originX.value) * t },
|
|
904
|
+
{ translateY: originY.value + (dragY.value - originY.value) * t },
|
|
905
|
+
{ scale: originScale.value + (dragScale.value - originScale.value) * t },
|
|
840
906
|
],
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
);
|
|
907
|
+
};
|
|
908
|
+
}, [dragScale, dragX, dragY, flight, mediaOpacity, originScale, originX, originY]);
|
|
844
909
|
|
|
845
910
|
// Pinch/double-tap zoom transform, layered on TOP of the active page image's
|
|
846
911
|
// `fit`-based sizing (composed, never replacing it).
|
|
@@ -861,7 +926,7 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
861
926
|
// (web, where paging may not fire a reliable momentum-end).
|
|
862
927
|
const updateIndexFromOffset = useCallback(
|
|
863
928
|
(offsetX: number) => {
|
|
864
|
-
if (dismissingRef.current || !
|
|
929
|
+
if (dismissingRef.current || !settled) return;
|
|
865
930
|
const lastIndex = items.length - 1;
|
|
866
931
|
if (lastIndex < 0) return;
|
|
867
932
|
const next = Math.min(Math.max(Math.round(offsetX / SCREEN_WIDTH), 0), lastIndex);
|
|
@@ -890,7 +955,7 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
890
955
|
const item = items[next];
|
|
891
956
|
if (item) ensureRatio(next, item);
|
|
892
957
|
},
|
|
893
|
-
[ensureRatio, items,
|
|
958
|
+
[ensureRatio, items, resetZoom, setActiveIndexBoth, settled, SCREEN_WIDTH],
|
|
894
959
|
);
|
|
895
960
|
|
|
896
961
|
// Programmatically page to `index` (arrow buttons, keyboard, thumbnail taps).
|
|
@@ -898,14 +963,14 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
898
963
|
// state-sync — this only triggers the scroll. No-op until the pager is mounted.
|
|
899
964
|
const pageTo = useCallback(
|
|
900
965
|
(index: number) => {
|
|
901
|
-
if (!
|
|
966
|
+
if (!settled) return;
|
|
902
967
|
const lastIndex = items.length - 1;
|
|
903
968
|
if (lastIndex < 0) return;
|
|
904
969
|
const clamped = Math.min(Math.max(index, 0), lastIndex);
|
|
905
970
|
resetZoom();
|
|
906
971
|
pagerRef.current?.scrollTo({ x: clamped * SCREEN_WIDTH, y: 0, animated: true });
|
|
907
972
|
},
|
|
908
|
-
[items.length,
|
|
973
|
+
[items.length, resetZoom, settled, SCREEN_WIDTH],
|
|
909
974
|
);
|
|
910
975
|
|
|
911
976
|
const onPagerScroll = useCallback(
|
|
@@ -956,13 +1021,13 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
956
1021
|
// `SCREEN_WIDTH` makes the two agree by construction, and running it before
|
|
957
1022
|
// paint keeps the corrected offset from being visible as a jump.
|
|
958
1023
|
useLayoutEffect(() => {
|
|
959
|
-
if (!
|
|
1024
|
+
if (!isOpen) return;
|
|
960
1025
|
pagerRef.current?.scrollTo({
|
|
961
1026
|
x: activeIndexRef.current * SCREEN_WIDTH,
|
|
962
1027
|
y: 0,
|
|
963
1028
|
animated: false,
|
|
964
1029
|
});
|
|
965
|
-
}, [
|
|
1030
|
+
}, [isOpen, SCREEN_WIDTH]);
|
|
966
1031
|
|
|
967
1032
|
// Double-tap toggles zoom: reset when already zoomed, else zoom to the tapped
|
|
968
1033
|
// point (biased toward it, clamped near the image center). `x`/`y` are local
|
|
@@ -1192,7 +1257,7 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
1192
1257
|
<Backdrop
|
|
1193
1258
|
onPress={handleDismiss}
|
|
1194
1259
|
accessibilityLabel={labels.close}
|
|
1195
|
-
progress={
|
|
1260
|
+
progress={backdropProgress}
|
|
1196
1261
|
blurIntensity={page || !overlayCanBlur() ? 0 : undefined}
|
|
1197
1262
|
dimColor={pagePalette?.background}
|
|
1198
1263
|
dimOpacity={page ? 1 : overlayCanBlur() ? undefined : UNBLURRED_DIM_OPACITY}
|
|
@@ -1208,128 +1273,104 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
1208
1273
|
]}
|
|
1209
1274
|
pointerEvents="box-none"
|
|
1210
1275
|
>
|
|
1211
|
-
{
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
horizontal
|
|
1244
|
-
pagingEnabled
|
|
1245
|
-
// Frozen while zoomed so a horizontal drag pans the zoomed image
|
|
1246
|
-
// instead of paging away from it.
|
|
1247
|
-
scrollEnabled={!isZoomed}
|
|
1248
|
-
showsHorizontalScrollIndicator={false}
|
|
1249
|
-
contentOffset={{ x: activeIndexRef.current * SCREEN_WIDTH, y: 0 }}
|
|
1250
|
-
onMomentumScrollEnd={onPagerScroll}
|
|
1251
|
-
{...(Platform.OS === 'web' ? { onScroll: onPagerScroll } : {})}
|
|
1252
|
-
scrollEventThrottle={16}
|
|
1253
|
-
style={StyleSheet.absoluteFill}
|
|
1254
|
-
>
|
|
1255
|
-
{items.map((item, idx) => {
|
|
1256
|
-
const uri = posterUri(item);
|
|
1257
|
-
const ratio = itemRatio(item, ratios.pages[idx]);
|
|
1258
|
-
const fit = fitForRatio(ratio, uri);
|
|
1259
|
-
// Only the active page is zoomable + gesture-wrapped (double-tap
|
|
1260
|
-
// / single-tap dismiss / pinch / pan). It is also the ONLY page
|
|
1261
|
-
// that mounts a real media surface: an off-screen page renders
|
|
1262
|
-
// the still, because a second `VideoView` on the same player is
|
|
1263
|
-
// exactly the duplicate surface this package exists to avoid.
|
|
1264
|
-
// The active media handles its own tap-to-dismiss through the
|
|
1265
|
-
// gesture, so it isn't wrapped in a Pressable.
|
|
1266
|
-
if (idx === activeIndex) {
|
|
1267
|
-
return (
|
|
1268
|
-
<Pressable
|
|
1269
|
-
key={mediaKey(item, idx)}
|
|
1270
|
-
// The page fills the screen ON TOP of the backdrop (the
|
|
1271
|
-
// pager below it needs pointer events to swipe), so a
|
|
1272
|
-
// press on the empty area around the media can never
|
|
1273
|
-
// reach the backdrop — the page dismisses it itself.
|
|
1274
|
-
// Same outcome as tapping the media, which already
|
|
1275
|
-
// dismisses through `singleTapDismissGesture`.
|
|
1276
|
-
onPress={handleDismiss}
|
|
1277
|
-
accessibilityLabel={labels.close}
|
|
1278
|
-
style={[
|
|
1279
|
-
styles.page,
|
|
1280
|
-
{ width: SCREEN_WIDTH, height: SCREEN_HEIGHT },
|
|
1281
|
-
webPointerStyle,
|
|
1282
|
-
]}
|
|
1283
|
-
>
|
|
1284
|
-
<GestureDetector gesture={activePageGesture}>
|
|
1285
|
-
<Animated.View
|
|
1286
|
-
style={[
|
|
1287
|
-
styles.mediaBox,
|
|
1288
|
-
{
|
|
1289
|
-
width: fit.width,
|
|
1290
|
-
height: fit.height,
|
|
1291
|
-
borderRadius: radiusFor(fit),
|
|
1292
|
-
},
|
|
1293
|
-
zoomImageStyle,
|
|
1294
|
-
]}
|
|
1295
|
-
>
|
|
1296
|
-
<MediaSurface
|
|
1297
|
-
content={item}
|
|
1298
|
-
contentFit="contain"
|
|
1299
|
-
nativeControls={videoControls}
|
|
1300
|
-
accessibilityLabel={item.alt}
|
|
1301
|
-
style={StyleSheet.absoluteFill}
|
|
1302
|
-
/>
|
|
1303
|
-
</Animated.View>
|
|
1304
|
-
</GestureDetector>
|
|
1305
|
-
</Pressable>
|
|
1306
|
-
);
|
|
1307
|
-
}
|
|
1276
|
+
{/* The transform rides the pager, so the active page's BOX moves —
|
|
1277
|
+
image and video arms identically, the box's radius clipping a
|
|
1278
|
+
video the way it rounds an image — and the pager clips its
|
|
1279
|
+
neighbours to the one page the flight is carrying. */}
|
|
1280
|
+
<Animated.View style={[StyleSheet.absoluteFill, mediaStyle]}>
|
|
1281
|
+
<ScrollView
|
|
1282
|
+
ref={pagerRef}
|
|
1283
|
+
testID="bloom-media-gallery-pager"
|
|
1284
|
+
horizontal
|
|
1285
|
+
pagingEnabled
|
|
1286
|
+
// Frozen in flight, and while zoomed so a horizontal drag pans
|
|
1287
|
+
// the zoomed image instead of paging away from it.
|
|
1288
|
+
scrollEnabled={settled && !isZoomed}
|
|
1289
|
+
showsHorizontalScrollIndicator={false}
|
|
1290
|
+
contentOffset={{ x: activeIndexRef.current * SCREEN_WIDTH, y: 0 }}
|
|
1291
|
+
onMomentumScrollEnd={onPagerScroll}
|
|
1292
|
+
{...(Platform.OS === 'web' ? { onScroll: onPagerScroll } : {})}
|
|
1293
|
+
scrollEventThrottle={16}
|
|
1294
|
+
style={StyleSheet.absoluteFill}
|
|
1295
|
+
>
|
|
1296
|
+
{items.map((item, idx) => {
|
|
1297
|
+
const uri = posterUri(item);
|
|
1298
|
+
const ratio = itemRatio(item, ratios.pages[idx]);
|
|
1299
|
+
const fit = fitForRatio(ratio, uri);
|
|
1300
|
+
// Only the active page is zoomable + gesture-wrapped (double-tap
|
|
1301
|
+
// / single-tap dismiss / pinch / pan). It is also the ONLY page
|
|
1302
|
+
// that mounts a real media surface: an off-screen page renders
|
|
1303
|
+
// the still, because a second `VideoView` on the same player is
|
|
1304
|
+
// exactly the duplicate surface this package exists to avoid.
|
|
1305
|
+
// The active media handles its own tap-to-dismiss through the
|
|
1306
|
+
// gesture, so it isn't wrapped in a Pressable.
|
|
1307
|
+
if (idx === activeIndex) {
|
|
1308
1308
|
return (
|
|
1309
1309
|
<Pressable
|
|
1310
1310
|
key={mediaKey(item, idx)}
|
|
1311
|
+
// The page fills the screen ON TOP of the backdrop (the
|
|
1312
|
+
// pager below it needs pointer events to swipe), so a
|
|
1313
|
+
// press on the empty area around the media can never
|
|
1314
|
+
// reach the backdrop — the page dismisses it itself.
|
|
1315
|
+
// Same outcome as tapping the media, which already
|
|
1316
|
+
// dismisses through `singleTapDismissGesture`.
|
|
1311
1317
|
onPress={handleDismiss}
|
|
1312
1318
|
accessibilityLabel={labels.close}
|
|
1313
|
-
style={[
|
|
1319
|
+
style={[
|
|
1320
|
+
styles.page,
|
|
1321
|
+
{ width: SCREEN_WIDTH, height: SCREEN_HEIGHT },
|
|
1322
|
+
webPointerStyle,
|
|
1323
|
+
]}
|
|
1314
1324
|
>
|
|
1315
|
-
<
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
+
<GestureDetector gesture={activePageGesture}>
|
|
1326
|
+
<Animated.View
|
|
1327
|
+
style={[
|
|
1328
|
+
styles.mediaBox,
|
|
1329
|
+
{
|
|
1330
|
+
width: fit.width,
|
|
1331
|
+
height: fit.height,
|
|
1332
|
+
borderRadius: radiusFor(fit),
|
|
1333
|
+
},
|
|
1334
|
+
zoomImageStyle,
|
|
1335
|
+
]}
|
|
1336
|
+
>
|
|
1337
|
+
<MediaSurface
|
|
1338
|
+
content={item}
|
|
1339
|
+
contentFit="contain"
|
|
1340
|
+
nativeControls={videoControls}
|
|
1341
|
+
accessibilityLabel={item.alt}
|
|
1342
|
+
onPicture={startOpenFlight}
|
|
1343
|
+
style={StyleSheet.absoluteFill}
|
|
1344
|
+
/>
|
|
1345
|
+
</Animated.View>
|
|
1346
|
+
</GestureDetector>
|
|
1325
1347
|
</Pressable>
|
|
1326
1348
|
);
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1349
|
+
}
|
|
1350
|
+
return (
|
|
1351
|
+
<Pressable
|
|
1352
|
+
key={mediaKey(item, idx)}
|
|
1353
|
+
onPress={handleDismiss}
|
|
1354
|
+
accessibilityLabel={labels.close}
|
|
1355
|
+
style={[styles.page, { width: SCREEN_WIDTH, height: SCREEN_HEIGHT }]}
|
|
1356
|
+
>
|
|
1357
|
+
<MediaPoster
|
|
1358
|
+
content={item}
|
|
1359
|
+
contentFit="contain"
|
|
1360
|
+
accessibilityLabel={item.alt}
|
|
1361
|
+
style={{
|
|
1362
|
+
width: fit.width,
|
|
1363
|
+
height: fit.height,
|
|
1364
|
+
borderRadius: radiusFor(fit),
|
|
1365
|
+
}}
|
|
1366
|
+
/>
|
|
1367
|
+
</Pressable>
|
|
1368
|
+
);
|
|
1369
|
+
})}
|
|
1370
|
+
</ScrollView>
|
|
1371
|
+
</Animated.View>
|
|
1331
1372
|
|
|
1332
|
-
{
|
|
1373
|
+
{settled && items.length > 1 && (
|
|
1333
1374
|
<Animated.View
|
|
1334
1375
|
style={[
|
|
1335
1376
|
styles.indicatorWrap,
|
|
@@ -1407,7 +1448,7 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
1407
1448
|
</Animated.View>
|
|
1408
1449
|
)}
|
|
1409
1450
|
|
|
1410
|
-
{Platform.OS === 'web' &&
|
|
1451
|
+
{Platform.OS === 'web' && settled && items.length > 1 && activeIndex > 0 && (
|
|
1411
1452
|
<NavArrow
|
|
1412
1453
|
buttonRef={previousButtonRef}
|
|
1413
1454
|
pageColors={pageColors}
|
|
@@ -1418,7 +1459,7 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
1418
1459
|
)}
|
|
1419
1460
|
|
|
1420
1461
|
{Platform.OS === 'web' &&
|
|
1421
|
-
|
|
1462
|
+
settled &&
|
|
1422
1463
|
items.length > 1 &&
|
|
1423
1464
|
activeIndex < items.length - 1 && (
|
|
1424
1465
|
<NavArrow
|
|
@@ -1430,7 +1471,7 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
1430
1471
|
/>
|
|
1431
1472
|
)}
|
|
1432
1473
|
|
|
1433
|
-
{canShare &&
|
|
1474
|
+
{canShare && settled && activeItem && (
|
|
1434
1475
|
<Button
|
|
1435
1476
|
ref={shareButtonRef}
|
|
1436
1477
|
onPress={handleShare}
|
|
@@ -1500,6 +1541,9 @@ export function createZoomableMediaGallery(Button: MemoRefComponent<ButtonProps>
|
|
|
1500
1541
|
</Animated.View>
|
|
1501
1542
|
)}
|
|
1502
1543
|
</GestureHandlerRootView>
|
|
1544
|
+
{/* LAST, so its layout effect runs after every ref above it — the
|
|
1545
|
+
pager's included — is attached. */}
|
|
1546
|
+
<OnCommit onCommit={onOverlayCommit} />
|
|
1503
1547
|
</OverlayRoot>
|
|
1504
1548
|
);
|
|
1505
1549
|
|