@oxy.so/bloom 23.1.0 → 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
|
@@ -6,7 +6,7 @@ import { useMessages } from "../locale/messages.js";
|
|
|
6
6
|
import { ZOOMABLE_MEDIA_GALLERY_MESSAGES } from "./messages.js";
|
|
7
7
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import { View, Text, StyleSheet, Pressable, Platform, ScrollView, Share, useWindowDimensions } from 'react-native';
|
|
9
|
-
import Animated, { useSharedValue, useAnimatedStyle, withSpring, withTiming, runOnJS, Easing } from 'react-native-reanimated';
|
|
9
|
+
import Animated, { useSharedValue, useAnimatedStyle, useDerivedValue, withSpring, withTiming, runOnJS, Easing } from 'react-native-reanimated';
|
|
10
10
|
import { GestureHandlerRootView, Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
11
11
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
12
12
|
import { borderRadius } from "../styles/tokens.js";
|
|
@@ -116,6 +116,22 @@ const SCRIM_CHROME = {
|
|
|
116
116
|
background: 'rgba(0,0,0,0.55)',
|
|
117
117
|
foreground: '#fff'
|
|
118
118
|
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Calls `onCommit` from the commit that mounts it. Placed INSIDE the portaled
|
|
122
|
+
* overlay, so it runs once the overlay itself is in the tree — the viewer's
|
|
123
|
+
* own effects run a commit earlier, before the portal outlet has rendered the
|
|
124
|
+
* content, and a flight started there would be under way before its first
|
|
125
|
+
* frame was on screen.
|
|
126
|
+
*/
|
|
127
|
+
function OnCommit({
|
|
128
|
+
onCommit
|
|
129
|
+
}) {
|
|
130
|
+
useLayoutEffect(() => {
|
|
131
|
+
onCommit();
|
|
132
|
+
}, [onCommit]);
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
119
135
|
export function createZoomableMediaGallery(Button) {
|
|
120
136
|
function NavArrow({
|
|
121
137
|
direction,
|
|
@@ -166,10 +182,14 @@ export function createZoomableMediaGallery(Button) {
|
|
|
166
182
|
* renders through the Bloom `Portal` on BOTH platforms (RN's `Modal` is not
|
|
167
183
|
* used on native — on the New Architecture / Fabric Android its host views
|
|
168
184
|
* mount full-screen but never composite, leaving the viewer invisible).
|
|
169
|
-
* - The OPENING (tapped) item
|
|
170
|
-
* aspect-ratio-preserving fit within {@link FIT_FRACTION} of the screen
|
|
171
|
-
*
|
|
172
|
-
*
|
|
185
|
+
* - The OPENING (tapped) item flies from its measured rect to a centered,
|
|
186
|
+
* aspect-ratio-preserving fit within {@link FIT_FRACTION} of the screen, and
|
|
187
|
+
* every dismissal flies it back. The horizontal paging `ScrollView` is
|
|
188
|
+
* mounted from the first frame, seeded at the tapped index, and the flight
|
|
189
|
+
* transforms it: the media on screen is ONE surface, the active page's, from
|
|
190
|
+
* the first frame of the open to the last frame of the close. One shared
|
|
191
|
+
* value (`flight`) drives the transform and the backdrop, on the UI thread;
|
|
192
|
+
* `hiddenThumbIndex` lets the consumer hide the thumbnail it stands in for.
|
|
173
193
|
* - Gesture disambiguation: the pager owns horizontal swipes; a vertical-only
|
|
174
194
|
* `Gesture.Pan` (`activeOffsetY` + `failOffsetX`) owns drag-to-dismiss, so the
|
|
175
195
|
* two never fight.
|
|
@@ -182,8 +202,8 @@ export function createZoomableMediaGallery(Button) {
|
|
|
182
202
|
* handing the same player to this gallery moves a playing video into fullscreen
|
|
183
203
|
* without re-opening the stream. Exactly ONE view is mounted per opening — the
|
|
184
204
|
* active page's — while every other page and every strip tile renders the still
|
|
185
|
-
* (`MediaPoster`). The
|
|
186
|
-
*
|
|
205
|
+
* (`MediaPoster`). The active page's view lives from the first frame of the
|
|
206
|
+
* open to the last frame of the close, so the transition swaps nothing.
|
|
187
207
|
*
|
|
188
208
|
* `expo-video` is an OPTIONAL peer loaded through `media-flight/expo-video-module`.
|
|
189
209
|
* Without it a video page degrades to its poster, once, with a dev warning.
|
|
@@ -197,7 +217,8 @@ export function createZoomableMediaGallery(Button) {
|
|
|
197
217
|
cornerRadius = DEFAULT_CORNER_RADIUS,
|
|
198
218
|
indicatorVariant = 'dots',
|
|
199
219
|
videoControls = false,
|
|
200
|
-
labels: labelsProp
|
|
220
|
+
labels: labelsProp,
|
|
221
|
+
hiddenThumbIndex
|
|
201
222
|
}, ref) => {
|
|
202
223
|
const {
|
|
203
224
|
messages
|
|
@@ -241,8 +262,9 @@ export function createZoomableMediaGallery(Button) {
|
|
|
241
262
|
const insets = useCssSafeAreaInsets(useSafeAreaInsets());
|
|
242
263
|
const radiusFor = useCallback(fit => resolveCornerRadius(cornerRadius, fit), [cornerRadius]);
|
|
243
264
|
const [isOpen, setIsOpen] = useState(false);
|
|
244
|
-
//
|
|
245
|
-
|
|
265
|
+
// True once the open flight has landed, until a dismissal starts: the
|
|
266
|
+
// chrome (share, counter, arrows) shows and the pager may page.
|
|
267
|
+
const [settled, setSettled] = useState(false);
|
|
246
268
|
const [items, setItems] = useState([]);
|
|
247
269
|
// The accepted opening's item identities are needed by async probes even
|
|
248
270
|
// before React commits the corresponding state update.
|
|
@@ -266,10 +288,23 @@ export function createZoomableMediaGallery(Button) {
|
|
|
266
288
|
if (Platform.OS !== 'web') return true;
|
|
267
289
|
return typeof navigator !== 'undefined' && typeof navigator.share === 'function';
|
|
268
290
|
});
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
291
|
+
|
|
292
|
+
// The transition is ONE value: 0 is the media standing on its thumbnail,
|
|
293
|
+
// 1 is the media fitted on screen. Open springs it to 1, every dismissal
|
|
294
|
+
// springs it back to 0, and both ends of the media's transform and the
|
|
295
|
+
// backdrop's fade are read from it — so a close started mid-open, or from
|
|
296
|
+
// wherever a drag left the media, lands on the thumbnail by construction,
|
|
297
|
+
// and its one completion callback is the frame the viewer has returned.
|
|
298
|
+
const flight = useSharedValue(0);
|
|
299
|
+
// The finger's offset while dragging to dismiss, applied at the fitted
|
|
300
|
+
// end of the flight. Rest is (0, 0, 1).
|
|
301
|
+
const dragX = useSharedValue(0);
|
|
302
|
+
const dragY = useSharedValue(0);
|
|
303
|
+
const dragScale = useSharedValue(1);
|
|
304
|
+
// The media itself is opaque: only the backdrop and chrome fade. It fades
|
|
305
|
+
// only where there is no thumbnail to fly to (or from), and drops to 0 on
|
|
306
|
+
// the frame the fly-back lands, when the thumbnail takes its place.
|
|
307
|
+
const mediaOpacity = useSharedValue(1);
|
|
273
308
|
|
|
274
309
|
// Zoom transform of the active media, kept SEPARATE from the open/close +
|
|
275
310
|
// dismiss-drag transform above (reusing those would collide two meanings).
|
|
@@ -285,13 +320,13 @@ export function createZoomableMediaGallery(Button) {
|
|
|
285
320
|
// Origin (offset from screen center) of the tapped item.
|
|
286
321
|
const originX = useSharedValue(0);
|
|
287
322
|
const originY = useSharedValue(0);
|
|
323
|
+
|
|
324
|
+
// Per-drag baseline captured at pan start (transient).
|
|
288
325
|
const startX = useSharedValue(0);
|
|
289
326
|
const startY = useSharedValue(0);
|
|
290
|
-
// Per-drag baseline captured at pan start (transient).
|
|
291
327
|
const startScale = useSharedValue(1);
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
// shrinks back to it. Never overwritten by the drag gesture.
|
|
328
|
+
// Scale of the fitted media at its thumbnail (thumbWidth / fittedWidth):
|
|
329
|
+
// the flight's 0 end.
|
|
295
330
|
const originScale = useSharedValue(1);
|
|
296
331
|
const pagerRef = useRef(null);
|
|
297
332
|
const shareButtonRef = useRef(null);
|
|
@@ -305,54 +340,35 @@ export function createZoomableMediaGallery(Button) {
|
|
|
305
340
|
// True from the first dismiss request until the viewer is actually unmounted.
|
|
306
341
|
const dismissingRef = useRef(false);
|
|
307
342
|
|
|
308
|
-
//
|
|
309
|
-
// the
|
|
310
|
-
//
|
|
311
|
-
//
|
|
312
|
-
// gesture or an imperative `open()` — never from an effect — so React's own
|
|
313
|
-
// teardown reaches none of them. A screen left within the ~300 ms of the open
|
|
314
|
-
// transition therefore leaves a live timer holding the whole subtree, and the
|
|
315
|
-
// state it eventually writes lands on a tree nobody is rendering. React makes
|
|
316
|
-
// that a silent no-op rather than an error, which is exactly why it survived:
|
|
317
|
-
// measured under jest, the gallery's `revealPager` timer outlives the file
|
|
318
|
-
// that mounted it and fires inside the NEXT test file in the same worker
|
|
319
|
-
// process, sometimes re-scheduling itself two files further on.
|
|
320
|
-
const pendingRef = useRef(new Set());
|
|
321
|
-
const frameRef = useRef(null);
|
|
343
|
+
// Nothing in the transition is a timer: the open starts from the commit
|
|
344
|
+
// that mounts the overlay and ends in its spring's callback, and the close
|
|
345
|
+
// ends in its own. An unmount only has to stop that callback from writing
|
|
346
|
+
// (`unmountedRef`) and give the thumbnail back.
|
|
322
347
|
const unmountedRef = useRef(false);
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
// this can be reached once the component is already gone — starting a timer
|
|
326
|
-
// there would put one back after the cleanup has run.
|
|
327
|
-
if (unmountedRef.current) return;
|
|
328
|
-
const handle = setTimeout(() => {
|
|
329
|
-
pendingRef.current.delete(handle);
|
|
330
|
-
step();
|
|
331
|
-
}, delay);
|
|
332
|
-
pendingRef.current.add(handle);
|
|
333
|
-
}, []);
|
|
348
|
+
const hiddenThumbRef = useRef(hiddenThumbIndex);
|
|
349
|
+
hiddenThumbRef.current = hiddenThumbIndex;
|
|
334
350
|
useEffect(() => {
|
|
335
351
|
unmountedRef.current = false;
|
|
336
352
|
return () => {
|
|
337
353
|
unmountedRef.current = true;
|
|
338
354
|
reportOpen(false);
|
|
339
|
-
|
|
340
|
-
pendingRef.current.clear();
|
|
341
|
-
if (frameRef.current !== null) {
|
|
342
|
-
cancelAnimationFrame(frameRef.current);
|
|
343
|
-
frameRef.current = null;
|
|
344
|
-
}
|
|
355
|
+
if (hiddenThumbRef.current) hiddenThumbRef.current.value = -1;
|
|
345
356
|
};
|
|
346
357
|
}, [reportOpen]);
|
|
347
358
|
|
|
348
359
|
// Single writer for the current index: updates state (drives indicator + open
|
|
349
360
|
// image) and the synchronous mirror together, and only when it changes.
|
|
361
|
+
// The thumbnail the media stands in for follows the page, so a swipe
|
|
362
|
+
// gives back the one it left and hides the one it reached.
|
|
350
363
|
const setActiveIndexBoth = useCallback((next, opening = false) => {
|
|
351
364
|
const changed = activeIndexRef.current !== next;
|
|
352
365
|
activeIndexRef.current = next;
|
|
353
366
|
setActiveIndex(prev => prev === next ? prev : next);
|
|
367
|
+
if (changed && hiddenThumbIndex && !opening && !dismissingRef.current) {
|
|
368
|
+
hiddenThumbIndex.value = next;
|
|
369
|
+
}
|
|
354
370
|
if (changed || opening) onIndexChangeRef.current?.(next);
|
|
355
|
-
}, []);
|
|
371
|
+
}, [hiddenThumbIndex]);
|
|
356
372
|
|
|
357
373
|
// Snap the active media back to its un-zoomed baseline (no animation) and
|
|
358
374
|
// clear all zoom bookkeeping. Called on every path that changes the active
|
|
@@ -397,7 +413,7 @@ export function createZoomableMediaGallery(Button) {
|
|
|
397
413
|
};
|
|
398
414
|
}, [fitBox]);
|
|
399
415
|
|
|
400
|
-
// Fitted size of the
|
|
416
|
+
// Fitted size of the media for the CURRENT page. On open this is
|
|
401
417
|
// the opened item's fit;
|
|
402
418
|
// after swiping it tracks the viewed item so the collapse-on-dismiss renders
|
|
403
419
|
// and flies back the media actually on screen.
|
|
@@ -444,78 +460,54 @@ export function createZoomableMediaGallery(Button) {
|
|
|
444
460
|
});
|
|
445
461
|
}, [isCurrentRatioProbe]);
|
|
446
462
|
|
|
447
|
-
//
|
|
448
|
-
// every dismiss path (fly-back and fade-out fallback).
|
|
463
|
+
// The viewer has returned: unmount and put every value back at rest.
|
|
449
464
|
const finalizeDismiss = useCallback(() => {
|
|
465
|
+
if (unmountedRef.current) return;
|
|
450
466
|
setIsOpen(false);
|
|
451
467
|
// Keep the dismissal latch until the next open. Throttled web scroll
|
|
452
468
|
// events can arrive after the pager unmounts and must not reset selection.
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
469
|
+
flight.value = 0;
|
|
470
|
+
dragX.value = 0;
|
|
471
|
+
dragY.value = 0;
|
|
472
|
+
dragScale.value = 1;
|
|
473
|
+
resetZoom();
|
|
457
474
|
reportOpen(false);
|
|
458
|
-
}, [
|
|
475
|
+
}, [dragScale, dragX, dragY, flight, reportOpen, resetZoom]);
|
|
459
476
|
|
|
460
|
-
// Fly the
|
|
461
|
-
//
|
|
462
|
-
//
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
duration,
|
|
473
|
-
easing
|
|
474
|
-
});
|
|
475
|
-
translateY.value = withTiming(target.y, {
|
|
476
|
-
duration,
|
|
477
|
-
easing
|
|
478
|
-
});
|
|
479
|
-
opacity.value = withTiming(0, {
|
|
480
|
-
duration,
|
|
481
|
-
easing
|
|
482
|
-
});
|
|
483
|
-
schedule(finalizeDismiss, duration + 20);
|
|
477
|
+
// Fly the media home: back to `target` (the current item's thumbnail,
|
|
478
|
+
// relative to the screen center), or, with no thumbnail to land on, into
|
|
479
|
+
// the center while it fades. Both end on the same callback — the frame
|
|
480
|
+
// the flight reaches 0 hides the media and gives the thumbnail back
|
|
481
|
+
// together, on the UI thread, so the photo is on screen exactly once.
|
|
482
|
+
const flyHome = useCallback(target => {
|
|
483
|
+
if (unmountedRef.current) return;
|
|
484
|
+
const web = Platform.OS === 'web';
|
|
485
|
+
if (target) {
|
|
486
|
+
originX.value = target.x;
|
|
487
|
+
originY.value = target.y;
|
|
488
|
+
originScale.value = target.scale;
|
|
484
489
|
} else {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
duration: OPACITY_DURATION
|
|
490
|
+
originX.value = 0;
|
|
491
|
+
originY.value = 0;
|
|
492
|
+
originScale.value = MIN_DRAG_SCALE;
|
|
493
|
+
mediaOpacity.value = withTiming(0, {
|
|
494
|
+
duration: web ? CLOSE_DURATION_WEB : OPACITY_DURATION
|
|
490
495
|
});
|
|
491
|
-
schedule(finalizeDismiss, CLOSE_DURATION_WEB);
|
|
492
496
|
}
|
|
493
|
-
|
|
497
|
+
const thumb = hiddenThumbIndex;
|
|
498
|
+
const landed = finished => {
|
|
499
|
+
'worklet';
|
|
494
500
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
});
|
|
506
|
-
opacity.value = withTiming(0, {
|
|
507
|
-
duration,
|
|
508
|
-
easing
|
|
509
|
-
});
|
|
510
|
-
schedule(finalizeDismiss, duration + 20);
|
|
511
|
-
} else {
|
|
512
|
-
scale.value = withSpring(MIN_DRAG_SCALE, CLOSE_SPRING);
|
|
513
|
-
opacity.value = withTiming(0, {
|
|
514
|
-
duration: OPACITY_DURATION
|
|
515
|
-
});
|
|
516
|
-
schedule(finalizeDismiss, CLOSE_DURATION_WEB);
|
|
517
|
-
}
|
|
518
|
-
}, [finalizeDismiss, opacity, scale, schedule]);
|
|
501
|
+
if (!finished) return;
|
|
502
|
+
mediaOpacity.value = 0;
|
|
503
|
+
if (thumb) thumb.value = -1;
|
|
504
|
+
runOnJS(finalizeDismiss)();
|
|
505
|
+
};
|
|
506
|
+
flight.value = web ? withTiming(0, {
|
|
507
|
+
duration: CLOSE_DURATION_WEB,
|
|
508
|
+
easing: Easing.in(Easing.cubic)
|
|
509
|
+
}, landed) : withSpring(0, CLOSE_SPRING, landed);
|
|
510
|
+
}, [finalizeDismiss, flight, hiddenThumbIndex, mediaOpacity, originScale, originX, originY]);
|
|
519
511
|
const handleDismiss = useCallback(() => {
|
|
520
512
|
// A press on the image reaches BOTH its tap gesture and the page beneath it
|
|
521
513
|
// (which owns the dismiss for the empty area around the image), so this can
|
|
@@ -524,40 +516,79 @@ export function createZoomableMediaGallery(Button) {
|
|
|
524
516
|
if (dismissingRef.current) return;
|
|
525
517
|
dismissingRef.current = true;
|
|
526
518
|
pendingShareFocus.current = null;
|
|
527
|
-
|
|
528
|
-
//
|
|
529
|
-
|
|
519
|
+
setSettled(false);
|
|
520
|
+
// A zoomed page unzooms on the way home, in step with the flight.
|
|
521
|
+
zoomScale.value = withSpring(1, CLOSE_SPRING);
|
|
522
|
+
zoomTranslateX.value = withSpring(0, CLOSE_SPRING);
|
|
523
|
+
zoomTranslateY.value = withSpring(0, CLOSE_SPRING);
|
|
530
524
|
const index = activeIndexRef.current;
|
|
531
525
|
const current = items[index];
|
|
532
|
-
//
|
|
533
|
-
//
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
if (measureThumb && current) {
|
|
537
|
-
const centerX = SCREEN_WIDTH / 2;
|
|
538
|
-
const centerY = SCREEN_HEIGHT / 2;
|
|
539
|
-
void measureThumb(index).then(rect => {
|
|
540
|
-
if (rect && rect.width > 0 && activeFit.width > 0) {
|
|
541
|
-
flyBackTo({
|
|
542
|
-
x: rect.x + rect.width / 2 - centerX,
|
|
543
|
-
y: rect.y + rect.height / 2 - centerY,
|
|
544
|
-
scale: rect.width / activeFit.width
|
|
545
|
-
});
|
|
546
|
-
} else {
|
|
547
|
-
fadeOutCenter();
|
|
548
|
-
}
|
|
549
|
-
});
|
|
526
|
+
// The target is the CURRENT item's thumbnail, measured now: the page may
|
|
527
|
+
// have changed, and the list under the viewer may have scrolled.
|
|
528
|
+
if (!measureThumb || !current) {
|
|
529
|
+
flyHome(null);
|
|
550
530
|
return;
|
|
551
531
|
}
|
|
552
|
-
|
|
553
|
-
|
|
532
|
+
const centerX = SCREEN_WIDTH / 2;
|
|
533
|
+
const centerY = SCREEN_HEIGHT / 2;
|
|
534
|
+
void measureThumb(index).then(rect => {
|
|
535
|
+
flyHome(rect && rect.width > 0 && activeFit.width > 0 ? {
|
|
536
|
+
x: rect.x + rect.width / 2 - centerX,
|
|
537
|
+
y: rect.y + rect.height / 2 - centerY,
|
|
538
|
+
scale: rect.width / activeFit.width
|
|
539
|
+
} : null);
|
|
540
|
+
});
|
|
541
|
+
}, [activeFit, flyHome, items, measureThumb, SCREEN_HEIGHT, SCREEN_WIDTH, zoomScale, zoomTranslateX, zoomTranslateY]);
|
|
554
542
|
|
|
555
|
-
//
|
|
556
|
-
//
|
|
557
|
-
//
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
543
|
+
// The open flight: from the thumbnail to the fitted center. The thumbnail
|
|
544
|
+
// is hidden in the same write, so the photo is on screen exactly once. It
|
|
545
|
+
// starts when the opened media shows a picture (`onPicture`) if it has a
|
|
546
|
+
// preview — the thumbnail's own, already decoded URL — and otherwise as
|
|
547
|
+
// soon as the overlay is committed. Started any earlier, the thumbnail
|
|
548
|
+
// was hidden and the media had flown a frame or two before its first
|
|
549
|
+
// pixel was drawn: a hole where the avatar was, then a photo already on
|
|
550
|
+
// its way.
|
|
551
|
+
const flightPendingRef = useRef(false);
|
|
552
|
+
const startOpenFlight = useCallback(() => {
|
|
553
|
+
if (!flightPendingRef.current) return;
|
|
554
|
+
flightPendingRef.current = false;
|
|
555
|
+
const generation = openingGenerationRef.current;
|
|
556
|
+
const settle = () => {
|
|
557
|
+
if (unmountedRef.current || dismissingRef.current || openingGenerationRef.current !== generation) return;
|
|
558
|
+
setSettled(true);
|
|
559
|
+
};
|
|
560
|
+
const landed = finished => {
|
|
561
|
+
'worklet';
|
|
562
|
+
|
|
563
|
+
if (finished) runOnJS(settle)();
|
|
564
|
+
};
|
|
565
|
+
if (hiddenThumbIndex) hiddenThumbIndex.value = activeIndexRef.current;
|
|
566
|
+
if (mediaOpacity.value < 1) {
|
|
567
|
+
mediaOpacity.value = withTiming(1, {
|
|
568
|
+
duration: Platform.OS === 'web' ? OPEN_DURATION_WEB : OPACITY_DURATION
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
flight.value = Platform.OS === 'web' ? withTiming(1, {
|
|
572
|
+
duration: OPEN_DURATION_WEB,
|
|
573
|
+
easing: Easing.out(Easing.cubic)
|
|
574
|
+
}, landed) : withSpring(1, OPEN_SPRING, landed);
|
|
575
|
+
}, [flight, hiddenThumbIndex, mediaOpacity]);
|
|
576
|
+
|
|
577
|
+
// The overlay is committed (see `OnCommit`). Seat the pager on the opened
|
|
578
|
+
// page now that it exists: `contentOffset` alone is not honoured on web
|
|
579
|
+
// for a pager mounted with the overlay (it stayed on page 0 while the
|
|
580
|
+
// counter said 2 / 2), and the viewer's own layout effects run before the
|
|
581
|
+
// portal has rendered the pager.
|
|
582
|
+
const onOverlayCommit = useCallback(() => {
|
|
583
|
+
pagerRef.current?.scrollTo({
|
|
584
|
+
x: activeIndexRef.current * SCREEN_WIDTH,
|
|
585
|
+
y: 0,
|
|
586
|
+
animated: false
|
|
587
|
+
});
|
|
588
|
+
const opened = openedItemsRef.current[activeIndexRef.current];
|
|
589
|
+
const waitsForPicture = opened !== undefined && opened.kind !== 'video' && opened.previewUri !== undefined && opened.previewUri !== opened.uri;
|
|
590
|
+
if (!waitsForPicture) startOpenFlight();
|
|
591
|
+
}, [startOpenFlight, SCREEN_WIDTH]);
|
|
561
592
|
const open = useCallback((nextItems, index, rect) => {
|
|
562
593
|
if (openRef.current || unmountedRef.current || nextItems.length === 0) return;
|
|
563
594
|
dismissingRef.current = false;
|
|
@@ -602,10 +633,9 @@ export function createZoomableMediaGallery(Button) {
|
|
|
602
633
|
});
|
|
603
634
|
}
|
|
604
635
|
|
|
605
|
-
// The
|
|
606
|
-
//
|
|
607
|
-
//
|
|
608
|
-
// of the thumbnail width to the fitted width.
|
|
636
|
+
// The media is laid out at its FINAL fitted size and the flight scales it
|
|
637
|
+
// down onto the thumbnail: its 0 end is the thumbnail's center (as an
|
|
638
|
+
// offset from the screen's) and width over the fitted width.
|
|
609
639
|
const fitted = fitForRatio(ratio, targetUri);
|
|
610
640
|
const centerX = SCREEN_WIDTH / 2;
|
|
611
641
|
const centerY = SCREEN_HEIGHT / 2;
|
|
@@ -613,52 +643,23 @@ export function createZoomableMediaGallery(Button) {
|
|
|
613
643
|
originX.value = rect.x + rect.width / 2 - centerX;
|
|
614
644
|
originY.value = rect.y + rect.height / 2 - centerY;
|
|
615
645
|
originScale.value = rect.width / fitted.width;
|
|
646
|
+
mediaOpacity.value = 1;
|
|
616
647
|
} else {
|
|
648
|
+
// Nothing to grow out of: the media appears in place and fades in.
|
|
617
649
|
originX.value = 0;
|
|
618
650
|
originY.value = 0;
|
|
619
651
|
originScale.value = 1;
|
|
652
|
+
mediaOpacity.value = 0;
|
|
620
653
|
}
|
|
654
|
+
flight.value = 0;
|
|
655
|
+
dragX.value = 0;
|
|
656
|
+
dragY.value = 0;
|
|
657
|
+
dragScale.value = 1;
|
|
658
|
+
flightPendingRef.current = true;
|
|
659
|
+
setSettled(false);
|
|
621
660
|
setIsOpen(true);
|
|
622
661
|
reportOpen(true);
|
|
623
|
-
|
|
624
|
-
translateY.value = originY.value;
|
|
625
|
-
scale.value = originScale.value;
|
|
626
|
-
opacity.value = 0;
|
|
627
|
-
if (Platform.OS === 'web') {
|
|
628
|
-
frameRef.current = requestAnimationFrame(() => {
|
|
629
|
-
frameRef.current = null;
|
|
630
|
-
const duration = OPEN_DURATION_WEB;
|
|
631
|
-
const easing = Easing.out(Easing.cubic);
|
|
632
|
-
scale.value = withTiming(1, {
|
|
633
|
-
duration,
|
|
634
|
-
easing
|
|
635
|
-
});
|
|
636
|
-
translateX.value = withTiming(0, {
|
|
637
|
-
duration,
|
|
638
|
-
easing
|
|
639
|
-
});
|
|
640
|
-
translateY.value = withTiming(0, {
|
|
641
|
-
duration,
|
|
642
|
-
easing
|
|
643
|
-
});
|
|
644
|
-
opacity.value = withTiming(1, {
|
|
645
|
-
duration,
|
|
646
|
-
easing
|
|
647
|
-
});
|
|
648
|
-
schedule(revealPager, duration);
|
|
649
|
-
});
|
|
650
|
-
} else {
|
|
651
|
-
schedule(() => {
|
|
652
|
-
scale.value = withSpring(1, OPEN_SPRING);
|
|
653
|
-
translateX.value = withSpring(0, OPEN_SPRING);
|
|
654
|
-
translateY.value = withSpring(0, OPEN_SPRING);
|
|
655
|
-
opacity.value = withTiming(1, {
|
|
656
|
-
duration: OPACITY_DURATION
|
|
657
|
-
});
|
|
658
|
-
schedule(revealPager, OPEN_DURATION_WEB);
|
|
659
|
-
}, 0);
|
|
660
|
-
}
|
|
661
|
-
}, [SCREEN_WIDTH, SCREEN_HEIGHT, fitForRatio, isCurrentRatioProbe, opacity, originScale, originX, originY, revealPager, reportOpen, scale, schedule, setActiveIndexBoth, translateX, translateY]);
|
|
662
|
+
}, [SCREEN_WIDTH, SCREEN_HEIGHT, dragScale, dragX, dragY, fitForRatio, flight, isCurrentRatioProbe, mediaOpacity, originScale, originX, originY, reportOpen, setActiveIndexBoth]);
|
|
662
663
|
|
|
663
664
|
// Closing from outside is the same dismissal a press on the backdrop starts.
|
|
664
665
|
const close = useCallback(() => {
|
|
@@ -668,6 +669,11 @@ export function createZoomableMediaGallery(Button) {
|
|
|
668
669
|
open,
|
|
669
670
|
close
|
|
670
671
|
}), [open, close]);
|
|
672
|
+
|
|
673
|
+
// Drag to dismiss: the media follows the finger on the UI thread, shrinking
|
|
674
|
+
// and dimming the backdrop with distance. Short of the threshold it springs
|
|
675
|
+
// back carrying the finger's speed; past it, the same flight home as any
|
|
676
|
+
// other dismissal, starting from wherever the finger left it.
|
|
671
677
|
const panGesture = useMemo(() => Gesture.Pan()
|
|
672
678
|
// Disabled while zoomed so a drag pans the zoomed image (via the
|
|
673
679
|
// per-page pan gesture) instead of trying to dismiss the whole viewer.
|
|
@@ -675,30 +681,31 @@ export function createZoomableMediaGallery(Button) {
|
|
|
675
681
|
// Only claim drags that are decided to be vertical; horizontal drags
|
|
676
682
|
// fall through to the pager's ScrollView so swiping changes pages.
|
|
677
683
|
.activeOffsetY([-AXIS_DECISION_OFFSET, AXIS_DECISION_OFFSET]).failOffsetX([-AXIS_DECISION_OFFSET, AXIS_DECISION_OFFSET]).onStart(() => {
|
|
678
|
-
startX.value =
|
|
679
|
-
startY.value =
|
|
680
|
-
startScale.value =
|
|
684
|
+
startX.value = dragX.value;
|
|
685
|
+
startY.value = dragY.value;
|
|
686
|
+
startScale.value = dragScale.value;
|
|
681
687
|
}).onUpdate(event => {
|
|
682
|
-
|
|
683
|
-
|
|
688
|
+
dragX.value = startX.value + event.translationX;
|
|
689
|
+
dragY.value = startY.value + event.translationY;
|
|
684
690
|
const dragDistance = Math.sqrt(event.translationX ** 2 + event.translationY ** 2);
|
|
685
|
-
const maxDrag = SCREEN_HEIGHT * MAX_DRAG_FRACTION;
|
|
686
|
-
opacity.value = Math.max(0, 1 - dragDistance / maxDrag);
|
|
687
691
|
const scaleReduction = Math.max(MIN_DRAG_SCALE, 1 - dragDistance / (SCREEN_HEIGHT * SCALE_DRAG_FRACTION));
|
|
688
|
-
|
|
692
|
+
dragScale.value = startScale.value * scaleReduction;
|
|
689
693
|
}).onEnd(event => {
|
|
690
694
|
const dragDistance = Math.sqrt(event.translationX ** 2 + event.translationY ** 2);
|
|
691
695
|
if (dragDistance > SCREEN_HEIGHT * DISMISS_FRACTION) {
|
|
692
696
|
runOnJS(handleDismiss)();
|
|
693
697
|
} else {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
698
|
+
dragScale.value = withSpring(1, SNAP_BACK_SPRING);
|
|
699
|
+
dragX.value = withSpring(0, {
|
|
700
|
+
...SNAP_BACK_SPRING,
|
|
701
|
+
velocity: event.velocityX
|
|
702
|
+
});
|
|
703
|
+
dragY.value = withSpring(0, {
|
|
704
|
+
...SNAP_BACK_SPRING,
|
|
705
|
+
velocity: event.velocityY
|
|
699
706
|
});
|
|
700
707
|
}
|
|
701
|
-
}), [handleDismiss, isOpen, isZoomed, SCREEN_HEIGHT,
|
|
708
|
+
}), [dragScale, dragX, dragY, handleDismiss, isOpen, isZoomed, SCREEN_HEIGHT, startScale, startX, startY]);
|
|
702
709
|
|
|
703
710
|
// CRITICAL — every shared value a mapper READS must be listed in its dependency
|
|
704
711
|
// array. On web WITHOUT the react-native-worklets babel plugin (what every Oxy
|
|
@@ -709,32 +716,36 @@ export function createZoomableMediaGallery(Button) {
|
|
|
709
716
|
// double-tap zoom on web. Native (plugin present) auto-tracks and ignores the
|
|
710
717
|
// extra deps, so listing them is correct on both platforms. Same rule as
|
|
711
718
|
// `bottom-sheet/BottomSheetBase.tsx`. Do NOT strip these.
|
|
719
|
+
//
|
|
720
|
+
// The backdrop (and the chrome over it) is the flight, dimmed by how far
|
|
721
|
+
// the media has been dragged.
|
|
722
|
+
const backdropProgress = useDerivedValue(() => {
|
|
723
|
+
const dragDistance = Math.sqrt(dragX.value ** 2 + dragY.value ** 2);
|
|
724
|
+
const dragDim = Math.max(0, 1 - dragDistance / (SCREEN_HEIGHT * MAX_DRAG_FRACTION));
|
|
725
|
+
return flight.value * dragDim;
|
|
726
|
+
}, [dragX, dragY, flight, SCREEN_HEIGHT]);
|
|
712
727
|
const backdropStyle = useAnimatedStyle(() => ({
|
|
713
|
-
opacity:
|
|
714
|
-
}), [
|
|
715
|
-
|
|
716
|
-
// The single open-surface animates from origin → fitted center.
|
|
717
|
-
const openImageStyle = useAnimatedStyle(() => ({
|
|
718
|
-
transform: [{
|
|
719
|
-
translateX: translateX.value
|
|
720
|
-
}, {
|
|
721
|
-
translateY: translateY.value
|
|
722
|
-
}, {
|
|
723
|
-
scale: scale.value
|
|
724
|
-
}]
|
|
725
|
-
}), [translateX, translateY, scale]);
|
|
728
|
+
opacity: backdropProgress.value
|
|
729
|
+
}), [backdropProgress]);
|
|
726
730
|
|
|
727
|
-
//
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
731
|
+
// The pager — and so the active page's media, centered in it — rides the
|
|
732
|
+
// flight: at 0 it stands on the thumbnail, at 1 it is where the finger
|
|
733
|
+
// has it. ONE surface paints the media from the first frame of the open
|
|
734
|
+
// to the last frame of the close; nothing is swapped, remounted or
|
|
735
|
+
// re-decoded on the way, which is what used to flash.
|
|
736
|
+
const mediaStyle = useAnimatedStyle(() => {
|
|
737
|
+
const t = flight.value;
|
|
738
|
+
return {
|
|
739
|
+
opacity: mediaOpacity.value,
|
|
740
|
+
transform: [{
|
|
741
|
+
translateX: originX.value + (dragX.value - originX.value) * t
|
|
742
|
+
}, {
|
|
743
|
+
translateY: originY.value + (dragY.value - originY.value) * t
|
|
744
|
+
}, {
|
|
745
|
+
scale: originScale.value + (dragScale.value - originScale.value) * t
|
|
746
|
+
}]
|
|
747
|
+
};
|
|
748
|
+
}, [dragScale, dragX, dragY, flight, mediaOpacity, originScale, originX, originY]);
|
|
738
749
|
|
|
739
750
|
// Pinch/double-tap zoom transform, layered on TOP of the active page image's
|
|
740
751
|
// `fit`-based sizing (composed, never replacing it).
|
|
@@ -753,7 +764,7 @@ export function createZoomableMediaGallery(Button) {
|
|
|
753
764
|
// close fly-back target). Shared by `onMomentumScrollEnd` (native) and `onScroll`
|
|
754
765
|
// (web, where paging may not fire a reliable momentum-end).
|
|
755
766
|
const updateIndexFromOffset = useCallback(offsetX => {
|
|
756
|
-
if (dismissingRef.current || !
|
|
767
|
+
if (dismissingRef.current || !settled) return;
|
|
757
768
|
const lastIndex = items.length - 1;
|
|
758
769
|
if (lastIndex < 0) return;
|
|
759
770
|
const next = Math.min(Math.max(Math.round(offsetX / SCREEN_WIDTH), 0), lastIndex);
|
|
@@ -774,13 +785,13 @@ export function createZoomableMediaGallery(Button) {
|
|
|
774
785
|
setActiveIndexBoth(next);
|
|
775
786
|
const item = items[next];
|
|
776
787
|
if (item) ensureRatio(next, item);
|
|
777
|
-
}, [ensureRatio, items,
|
|
788
|
+
}, [ensureRatio, items, resetZoom, setActiveIndexBoth, settled, SCREEN_WIDTH]);
|
|
778
789
|
|
|
779
790
|
// Programmatically page to `index` (arrow buttons, keyboard, thumbnail taps).
|
|
780
791
|
// Clamps into range and lets the existing scroll handlers own the index/ratio
|
|
781
792
|
// state-sync — this only triggers the scroll. No-op until the pager is mounted.
|
|
782
793
|
const pageTo = useCallback(index => {
|
|
783
|
-
if (!
|
|
794
|
+
if (!settled) return;
|
|
784
795
|
const lastIndex = items.length - 1;
|
|
785
796
|
if (lastIndex < 0) return;
|
|
786
797
|
const clamped = Math.min(Math.max(index, 0), lastIndex);
|
|
@@ -790,7 +801,7 @@ export function createZoomableMediaGallery(Button) {
|
|
|
790
801
|
y: 0,
|
|
791
802
|
animated: true
|
|
792
803
|
});
|
|
793
|
-
}, [items.length,
|
|
804
|
+
}, [items.length, resetZoom, settled, SCREEN_WIDTH]);
|
|
794
805
|
const onPagerScroll = useCallback(event => {
|
|
795
806
|
updateIndexFromOffset(event.nativeEvent.contentOffset.x);
|
|
796
807
|
}, [updateIndexFromOffset]);
|
|
@@ -828,13 +839,13 @@ export function createZoomableMediaGallery(Button) {
|
|
|
828
839
|
// `SCREEN_WIDTH` makes the two agree by construction, and running it before
|
|
829
840
|
// paint keeps the corrected offset from being visible as a jump.
|
|
830
841
|
useLayoutEffect(() => {
|
|
831
|
-
if (!
|
|
842
|
+
if (!isOpen) return;
|
|
832
843
|
pagerRef.current?.scrollTo({
|
|
833
844
|
x: activeIndexRef.current * SCREEN_WIDTH,
|
|
834
845
|
y: 0,
|
|
835
846
|
animated: false
|
|
836
847
|
});
|
|
837
|
-
}, [
|
|
848
|
+
}, [isOpen, SCREEN_WIDTH]);
|
|
838
849
|
|
|
839
850
|
// Double-tap toggles zoom: reset when already zoomed, else zoom to the tapped
|
|
840
851
|
// point (biased toward it, clamped near the image center). `x`/`y` are local
|
|
@@ -976,16 +987,16 @@ export function createZoomableMediaGallery(Button) {
|
|
|
976
987
|
// `onRequestClose`: Android back flies the media home like every other
|
|
977
988
|
// dismiss. The viewer is a Portal, not an RN `Modal`, so without it nothing
|
|
978
989
|
// consumed the press and back finished the whole app.
|
|
979
|
-
|
|
990
|
+
_jsxs(OverlayRoot, {
|
|
980
991
|
style: styles.modalContainer,
|
|
981
992
|
onRequestClose: handleDismiss,
|
|
982
993
|
modal: true,
|
|
983
|
-
children: /*#__PURE__*/_jsxs(GestureHandlerRootView, {
|
|
994
|
+
children: [/*#__PURE__*/_jsxs(GestureHandlerRootView, {
|
|
984
995
|
style: StyleSheet.absoluteFill,
|
|
985
996
|
children: [/*#__PURE__*/_jsx(Backdrop, {
|
|
986
997
|
onPress: handleDismiss,
|
|
987
998
|
accessibilityLabel: labels.close,
|
|
988
|
-
progress:
|
|
999
|
+
progress: backdropProgress,
|
|
989
1000
|
blurIntensity: page || !overlayCanBlur() ? 0 : undefined,
|
|
990
1001
|
dimColor: pagePalette?.background,
|
|
991
1002
|
dimOpacity: page ? 1 : overlayCanBlur() ? undefined : UNBLURRED_DIM_OPACITY
|
|
@@ -997,34 +1008,17 @@ export function createZoomableMediaGallery(Button) {
|
|
|
997
1008
|
height: SCREEN_HEIGHT
|
|
998
1009
|
}, webUserSelectNoneStyle],
|
|
999
1010
|
pointerEvents: "box-none",
|
|
1000
|
-
children: [
|
|
1001
|
-
|
|
1002
|
-
style: webPointerStyle,
|
|
1003
|
-
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
1004
|
-
style: [styles.mediaBox, {
|
|
1005
|
-
width: activeFit.width,
|
|
1006
|
-
height: activeFit.height,
|
|
1007
|
-
borderRadius: radiusFor(activeFit)
|
|
1008
|
-
}, openImageStyle],
|
|
1009
|
-
children: /*#__PURE__*/_jsx(MediaSurface, {
|
|
1010
|
-
content: activeItem,
|
|
1011
|
-
contentFit: "contain",
|
|
1012
|
-
nativeControls: videoControls,
|
|
1013
|
-
accessibilityLabel: activeItem.alt,
|
|
1014
|
-
style: StyleSheet.absoluteFill
|
|
1015
|
-
})
|
|
1016
|
-
})
|
|
1017
|
-
}), pagerReady && /*#__PURE__*/_jsx(Animated.View, {
|
|
1018
|
-
style: [StyleSheet.absoluteFill, pagerContainerStyle],
|
|
1011
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
1012
|
+
style: [StyleSheet.absoluteFill, mediaStyle],
|
|
1019
1013
|
children: /*#__PURE__*/_jsx(ScrollView, {
|
|
1020
1014
|
ref: pagerRef,
|
|
1021
1015
|
testID: "bloom-media-gallery-pager",
|
|
1022
1016
|
horizontal: true,
|
|
1023
1017
|
pagingEnabled: true
|
|
1024
|
-
// Frozen while zoomed so a horizontal drag pans
|
|
1025
|
-
// instead of paging away from it.
|
|
1018
|
+
// Frozen in flight, and while zoomed so a horizontal drag pans
|
|
1019
|
+
// the zoomed image instead of paging away from it.
|
|
1026
1020
|
,
|
|
1027
|
-
scrollEnabled: !isZoomed,
|
|
1021
|
+
scrollEnabled: settled && !isZoomed,
|
|
1028
1022
|
showsHorizontalScrollIndicator: false,
|
|
1029
1023
|
contentOffset: {
|
|
1030
1024
|
x: activeIndexRef.current * SCREEN_WIDTH,
|
|
@@ -1074,6 +1068,7 @@ export function createZoomableMediaGallery(Button) {
|
|
|
1074
1068
|
contentFit: "contain",
|
|
1075
1069
|
nativeControls: videoControls,
|
|
1076
1070
|
accessibilityLabel: item.alt,
|
|
1071
|
+
onPicture: startOpenFlight,
|
|
1077
1072
|
style: StyleSheet.absoluteFill
|
|
1078
1073
|
})
|
|
1079
1074
|
})
|
|
@@ -1100,7 +1095,7 @@ export function createZoomableMediaGallery(Button) {
|
|
|
1100
1095
|
}, mediaKey(item, idx));
|
|
1101
1096
|
})
|
|
1102
1097
|
})
|
|
1103
|
-
}),
|
|
1098
|
+
}), settled && items.length > 1 && /*#__PURE__*/_jsxs(Animated.View, {
|
|
1104
1099
|
style: [styles.indicatorWrap, {
|
|
1105
1100
|
bottom: INDICATOR_BOTTOM + insets.bottom
|
|
1106
1101
|
}, backdropStyle],
|
|
@@ -1143,19 +1138,19 @@ export function createZoomableMediaGallery(Button) {
|
|
|
1143
1138
|
}]
|
|
1144
1139
|
}, `dot-${mediaKey(item, idx)}`))
|
|
1145
1140
|
})]
|
|
1146
|
-
}), Platform.OS === 'web' &&
|
|
1141
|
+
}), Platform.OS === 'web' && settled && items.length > 1 && activeIndex > 0 && /*#__PURE__*/_jsx(NavArrow, {
|
|
1147
1142
|
buttonRef: previousButtonRef,
|
|
1148
1143
|
pageColors: pageColors,
|
|
1149
1144
|
direction: "left",
|
|
1150
1145
|
label: labels.previous,
|
|
1151
1146
|
onPress: () => pageTo(activeIndex - 1)
|
|
1152
|
-
}), Platform.OS === 'web' &&
|
|
1147
|
+
}), Platform.OS === 'web' && settled && items.length > 1 && activeIndex < items.length - 1 && /*#__PURE__*/_jsx(NavArrow, {
|
|
1153
1148
|
buttonRef: nextButtonRef,
|
|
1154
1149
|
pageColors: pageColors,
|
|
1155
1150
|
direction: "right",
|
|
1156
1151
|
label: labels.next,
|
|
1157
1152
|
onPress: () => pageTo(activeIndex + 1)
|
|
1158
|
-
}), canShare &&
|
|
1153
|
+
}), canShare && settled && activeItem && /*#__PURE__*/_jsx(Button, {
|
|
1159
1154
|
ref: shareButtonRef,
|
|
1160
1155
|
onPress: handleShare,
|
|
1161
1156
|
disabled: activeItem.shareUrl !== undefined && shareUri(activeItem) === undefined,
|
|
@@ -1214,7 +1209,9 @@ export function createZoomableMediaGallery(Button) {
|
|
|
1214
1209
|
children: videoOverlay
|
|
1215
1210
|
})
|
|
1216
1211
|
})]
|
|
1217
|
-
})
|
|
1212
|
+
}), /*#__PURE__*/_jsx(OnCommit, {
|
|
1213
|
+
onCommit: onOverlayCommit
|
|
1214
|
+
})]
|
|
1218
1215
|
});
|
|
1219
1216
|
if (!isOpen) return null;
|
|
1220
1217
|
|