@multiplatform.one/components 8.3.0 → 8.5.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/README.md +18 -3
- package/dist/cjs/Accordion/index.native.js +1 -1
- package/dist/cjs/Accordion/index.native.js.map +1 -1
- package/dist/cjs/Alert/index.native.js.map +1 -1
- package/dist/cjs/AnimateHeight/index.native.js.map +1 -1
- package/dist/cjs/Avatar/getInitials.native.js.map +1 -1
- package/dist/cjs/Avatar/index.native.js.map +1 -1
- package/dist/cjs/Badge/index.native.js.map +1 -1
- package/dist/cjs/Button.native.js.map +1 -1
- package/dist/cjs/Card.native.js.map +1 -1
- package/dist/cjs/CardFooter.native.js.map +1 -1
- package/dist/cjs/CardHeader.native.js.map +1 -1
- package/dist/cjs/Carousel/geometry.native.js.map +1 -1
- package/dist/cjs/Carousel/index.native.js +3 -3
- package/dist/cjs/Carousel/index.native.js.map +1 -1
- package/dist/cjs/ChatTurn/index.native.js.map +1 -1
- package/dist/cjs/CheckGlyph/MenuCheckColumn.native.js.map +1 -1
- package/dist/cjs/CheckGlyph/index.native.js.map +1 -1
- package/dist/cjs/Chip/index.cjs +1 -1
- package/dist/cjs/Chip/index.native.js +1 -1
- package/dist/cjs/Chip/index.native.js.map +1 -1
- package/dist/cjs/ChoiceChips/index.native.js +1 -1
- package/dist/cjs/ChoiceChips/index.native.js.map +1 -1
- package/dist/cjs/Collapsible.native.js.map +1 -1
- package/dist/cjs/ContextMenu/index.native.js.map +1 -1
- package/dist/cjs/CopyField/CopyMenuButton.native.js +1 -1
- package/dist/cjs/CopyField/CopyMenuButton.native.js.map +1 -1
- package/dist/cjs/CopyField/index.native.js.map +1 -1
- package/dist/cjs/Dialog.native.js +1 -1
- package/dist/cjs/Dialog.native.js.map +1 -1
- package/dist/cjs/Diff/diff.native.js.map +1 -1
- package/dist/cjs/Diff/index.native.js.map +1 -1
- package/dist/cjs/DotIndicator/index.native.js.map +1 -1
- package/dist/cjs/DrillStack/DrillBar.native.js.map +1 -1
- package/dist/cjs/DrillStack/context.native.js.map +1 -1
- package/dist/cjs/DrillStack/drillMotion.native.js.map +1 -1
- package/dist/cjs/DropDownPanel/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/menuSettle.native.js.map +1 -1
- package/dist/cjs/ElapsedProgress/index.native.js.map +1 -1
- package/dist/cjs/ErrorBoundary/index.native.js.map +1 -1
- package/dist/cjs/Heading.native.js.map +1 -1
- package/dist/cjs/Kbd/index.native.js.map +1 -1
- package/dist/cjs/Kbd/keys.native.js.map +1 -1
- package/dist/cjs/Lightbox/MediaControl.native.js.map +1 -1
- package/dist/cjs/Lightbox/index.gnome.native.js.map +1 -1
- package/dist/cjs/Lightbox/index.native.js +1 -1
- package/dist/cjs/Lightbox/shared.native.js.map +1 -1
- package/dist/cjs/Lightbox/useLightbox.native.js.map +1 -1
- package/dist/cjs/MachineLiteral/index.native.js.map +1 -1
- package/dist/cjs/Material/blur.native.js +5 -1
- package/dist/cjs/Material/blur.native.js.map +1 -1
- package/dist/cjs/Material/index.native.js.map +1 -1
- package/dist/cjs/Meter/index.native.js +1 -1
- package/dist/cjs/Meter/index.native.js.map +1 -1
- package/dist/cjs/Meter/meter.native.js.map +1 -1
- package/dist/cjs/MiddleEllipsisText/middleSplit.native.js.map +1 -1
- package/dist/cjs/MiddleEllipsisText/types.native.js.map +1 -1
- package/dist/cjs/OverflowRow/index.native.js +1 -1
- package/dist/cjs/OverflowRow/index.native.js.map +1 -1
- package/dist/cjs/Pagination.native.js +1 -1
- package/dist/cjs/Pagination.native.js.map +1 -1
- package/dist/cjs/Popover.native.js +1 -1
- package/dist/cjs/Popover.native.js.map +1 -1
- package/dist/cjs/ProgressSteps/index.native.js.map +1 -1
- package/dist/cjs/Quote/index.native.js.map +1 -1
- package/dist/cjs/SchemeToggle/index.native.js +1 -1
- package/dist/cjs/SchemeToggle/index.native.js.map +1 -1
- package/dist/cjs/ScrollView/revealFocusedField.native.js.map +1 -1
- package/dist/cjs/ScrollView/useRevealFocusedField.native.js +3 -2
- package/dist/cjs/ScrollView/useRevealFocusedField.native.js.map +1 -1
- package/dist/cjs/Separator/index.native.js.map +1 -1
- package/dist/cjs/Sheet.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetHeader.native.js.map +1 -1
- package/dist/cjs/SheetModal/SheetNavigation.native.js.map +1 -1
- package/dist/cjs/SheetModal/detents.cjs +11 -37
- package/dist/cjs/SheetModal/detents.native.js +11 -43
- package/dist/cjs/SheetModal/detents.native.js.map +1 -1
- package/dist/cjs/SheetModal/index.cjs +13 -1
- package/dist/cjs/SheetModal/index.native.js +21 -11
- package/dist/cjs/SheetModal/index.native.js.map +1 -1
- package/dist/cjs/SheetModal/useSheetFrameFocus.native.js.map +1 -1
- package/dist/cjs/SheetScrollView/index.native.js +1 -1
- package/dist/cjs/SheetScrollView/index.native.js.map +1 -1
- package/dist/cjs/SheetScrollView/sheetHandoff.native.js.map +1 -1
- package/dist/cjs/Skeleton/index.native.js.map +1 -1
- package/dist/cjs/SkipLink/index.native.js.map +1 -1
- package/dist/cjs/SortableList/SortableHandle.native.js.map +1 -1
- package/dist/cjs/SortableList/index.native.js.map +1 -1
- package/dist/cjs/SortableList/useSortableRows.native.js.map +1 -1
- package/dist/cjs/SortableList/useUserOrder.native.js.map +1 -1
- package/dist/cjs/SwipeDismissRow/index.native.js.map +1 -1
- package/dist/cjs/Tabs/index.cjs +16 -39
- package/dist/cjs/Tabs/index.native.js +18 -41
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/Text.native.js.map +1 -1
- package/dist/cjs/ThemePresetPicker/index.native.js +1 -1
- package/dist/cjs/ThemePresetPicker/index.native.js.map +1 -1
- package/dist/cjs/Toast/index.native.js.map +1 -1
- package/dist/cjs/Toast/store.native.js.map +1 -1
- package/dist/cjs/Tooltip/index.native.js +9 -1
- package/dist/cjs/Tooltip/index.native.js.map +1 -1
- package/dist/cjs/Tooltip/nativePress.native.js.map +1 -1
- package/dist/cjs/Tooltip/tooltipShared.native.js.map +1 -1
- package/dist/cjs/TreeSelect/index.native.js +2 -2
- package/dist/cjs/TreeSelect/index.native.js.map +1 -1
- package/dist/cjs/TreeSelect/treeSelectModel.native.js.map +1 -1
- package/dist/cjs/Video/PlayerChrome.native.js.map +1 -1
- package/dist/cjs/Video/VideoFrame.native.js.map +1 -1
- package/dist/cjs/Video/types.native.js.map +1 -1
- package/dist/cjs/Wheel/index.native.js.map +1 -1
- package/dist/cjs/Wizard/index.native.js +2 -2
- package/dist/cjs/Wizard/index.native.js.map +1 -1
- package/dist/cjs/actions/ActionBar.native.js.map +1 -1
- package/dist/cjs/actions/DangerSection.native.js.map +1 -1
- package/dist/cjs/actions/DestructiveAction.native.js.map +1 -1
- package/dist/cjs/actions/HeaderActions.native.js +2 -2
- package/dist/cjs/actions/HeaderActions.native.js.map +1 -1
- package/dist/cjs/actions/StandardAction.native.js +1 -1
- package/dist/cjs/actions/StandardAction.native.js.map +1 -1
- package/dist/cjs/actions/devWarn.native.js.map +1 -1
- package/dist/cjs/actions/index.native.js.map +1 -1
- package/dist/cjs/actions/severity.native.js.map +1 -1
- package/dist/cjs/appShell/AppShell.cjs +91 -107
- package/dist/cjs/appShell/AppShell.native.js +101 -115
- package/dist/cjs/appShell/AppShell.native.js.map +1 -1
- package/dist/cjs/appShell/BottomChromeClearance.native.js.map +1 -1
- package/dist/cjs/appShell/Dock.native.js.map +1 -1
- package/dist/cjs/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/cjs/appShell/ScopeMenu.native.js +1 -1
- package/dist/cjs/appShell/ScopeMenu.native.js.map +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js +1 -1
- package/dist/cjs/appShell/SettingsSplit.native.js.map +1 -1
- package/dist/cjs/appShell/Springboard.cjs +2 -2
- package/dist/cjs/appShell/Springboard.native.js +3 -3
- package/dist/cjs/appShell/Springboard.native.js.map +1 -1
- package/dist/cjs/appShell/SystemBar.cjs +147 -55
- package/dist/cjs/appShell/SystemBar.native.js +152 -59
- package/dist/cjs/appShell/SystemBar.native.js.map +1 -1
- package/dist/cjs/appShell/TabBar.native.js +1 -1
- package/dist/cjs/appShell/TabBar.native.js.map +1 -1
- package/dist/cjs/appShell/TabHost.native.js +5 -2
- package/dist/cjs/appShell/TabHost.native.js.map +1 -1
- package/dist/cjs/appShell/appTile.native.js +1 -1
- package/dist/cjs/appShell/appTile.native.js.map +1 -1
- package/dist/cjs/appShell/bottomChrome.native.js.map +1 -1
- package/dist/cjs/appShell/index.native.js.map +1 -1
- package/dist/cjs/appShell/stackBack.cjs +49 -0
- package/dist/cjs/appShell/stackBack.native.js +55 -0
- package/dist/cjs/appShell/stackBack.native.js.map +1 -0
- package/dist/cjs/appShell/systemBarFit.cjs +12 -2
- package/dist/cjs/appShell/systemBarFit.native.js +16 -2
- package/dist/cjs/appShell/systemBarFit.native.js.map +1 -1
- package/dist/cjs/charts/Axis.native.js.map +1 -1
- package/dist/cjs/charts/BarChart.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.native.js +2 -2
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -1
- package/dist/cjs/charts/ChartSurface.native.js.map +1 -1
- package/dist/cjs/charts/LineChart.native.js.map +1 -1
- package/dist/cjs/charts/PieChart.native.js.map +1 -1
- package/dist/cjs/charts/Sparkline.native.js.map +1 -1
- package/dist/cjs/charts/accessibility.native.js.map +1 -1
- package/dist/cjs/charts/chartHeight.native.js.map +1 -1
- package/dist/cjs/charts/composeChart.native.js.map +1 -1
- package/dist/cjs/charts/index.native.js.map +1 -1
- package/dist/cjs/charts/math.native.js.map +1 -1
- package/dist/cjs/charts/series.native.js.map +1 -1
- package/dist/cjs/charts/svg.native.js.map +1 -1
- package/dist/cjs/charts/types.native.js.map +1 -1
- package/dist/cjs/charts/useChartTheme.native.js.map +1 -1
- package/dist/cjs/code/Code/index.native.js.map +1 -1
- package/dist/cjs/code/CodeBlock/index.cjs +21 -12
- package/dist/cjs/code/CodeBlock/index.native.js +28 -19
- package/dist/cjs/code/CodeBlock/index.native.js.map +1 -1
- package/dist/cjs/code/HighlightedCode/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/houseSyntaxTheme.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/index.native.js.map +1 -1
- package/dist/cjs/code/Highlighter/namedGroupMatchAll.native.js.map +1 -1
- package/dist/cjs/code/HoldSelect/index.cjs +69 -0
- package/dist/cjs/code/HoldSelect/index.native.js +132 -0
- package/dist/cjs/code/HoldSelect/index.native.js.map +1 -0
- package/dist/cjs/code/HoldSelect/tapGate.cjs +88 -0
- package/dist/cjs/code/HoldSelect/tapGate.native.js +95 -0
- package/dist/cjs/code/HoldSelect/tapGate.native.js.map +1 -0
- package/dist/cjs/code/LogView.cjs +14 -3
- package/dist/cjs/code/LogView.native.js +15 -3
- package/dist/cjs/code/LogView.native.js.map +1 -1
- package/dist/cjs/code/PayloadView/index.native.js +5 -5
- package/dist/cjs/code/PayloadView/index.native.js.map +1 -1
- package/dist/cjs/code/PayloadView/payloadModel.native.js.map +1 -1
- package/dist/cjs/code/Pre/index.native.js.map +1 -1
- package/dist/cjs/code/index.cjs +1 -0
- package/dist/cjs/code/index.native.js +7 -6
- package/dist/cjs/code/index.native.js.map +1 -1
- package/dist/cjs/componentColors.cjs +5 -4
- package/dist/cjs/componentColors.native.js +5 -4
- package/dist/cjs/componentColors.native.js.map +1 -1
- package/dist/cjs/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/cjs/feedback/NotifyHost.native.js +2 -2
- package/dist/cjs/feedback/NotifyHost.native.js.map +1 -1
- package/dist/cjs/feedback/copy.native.js.map +1 -1
- package/dist/cjs/feedback/index.native.js.map +1 -1
- package/dist/cjs/feedback/notify.native.js.map +1 -1
- package/dist/cjs/feedback/route.native.js.map +1 -1
- package/dist/cjs/feedback/store.native.js.map +1 -1
- package/dist/cjs/formLayouts/FormLayouts.native.js +1 -1
- package/dist/cjs/formLayouts/FormLayouts.native.js.map +1 -1
- package/dist/cjs/formLayouts/PreferencePanel.native.js +2 -2
- package/dist/cjs/formLayouts/PreferencePanel.native.js.map +1 -1
- package/dist/cjs/formLayouts/index.native.js.map +1 -1
- package/dist/cjs/hooks/index.native.js +1 -1
- package/dist/cjs/hooks/index.native.js.map +1 -1
- package/dist/cjs/hooks/useClipboard.native.js.map +1 -1
- package/dist/cjs/hooks/useDocumentTitle.native.js.map +1 -1
- package/dist/cjs/icons/CheckRegular.native.js.map +1 -1
- package/dist/cjs/icons/MinusRegular.native.js.map +1 -1
- package/dist/cjs/icons/index.native.js.map +1 -1
- package/dist/cjs/icons/lucide.native.js.map +1 -1
- package/dist/cjs/icons/themed.native.js.map +1 -1
- package/dist/cjs/images/Image/ImageFrame.native.js +1 -1
- package/dist/cjs/images/Image/ImageFrame.native.js.map +1 -1
- package/dist/cjs/images/Image/framing.native.js.map +1 -1
- package/dist/cjs/images/Image/index.native.js +1 -1
- package/dist/cjs/images/Image/mediaRadius.native.js.map +1 -1
- package/dist/cjs/images/Image/shared.native.js +1 -1
- package/dist/cjs/images/Image/shared.native.js.map +1 -1
- package/dist/cjs/images/Image/types.native.js.map +1 -1
- package/dist/cjs/images/RemoteArt/index.native.js +1 -1
- package/dist/cjs/images/RemoteArt/remoteArtCache.native.js.map +1 -1
- package/dist/cjs/images/RemoteArt/svgMarkup.native.js.map +1 -1
- package/dist/cjs/images/RemoteArt/types.native.js.map +1 -1
- package/dist/cjs/images/index.native.js.map +1 -1
- package/dist/cjs/index.gnome.native.js +22 -22
- package/dist/cjs/index.gnome.native.js.map +1 -1
- package/dist/cjs/index.native.js +46 -46
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/knobImmuneExports.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.cjs +21 -1
- package/dist/cjs/layouts/AsyncBoundary.native.js +23 -3
- package/dist/cjs/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/cjs/layouts/Debug/index.native.js.map +1 -1
- package/dist/cjs/layouts/EmptyState.native.js +1 -1
- package/dist/cjs/layouts/EmptyState.native.js.map +1 -1
- package/dist/cjs/layouts/IdentityPlate.native.js +1 -1
- package/dist/cjs/layouts/IdentityPlate.native.js.map +1 -1
- package/dist/cjs/layouts/KeyboardAvoidingWrapper/behavior.native.js.map +1 -1
- package/dist/cjs/layouts/PageTemplates.native.js.map +1 -1
- package/dist/cjs/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/cjs/layouts/SafeAreaWrapper/insets.native.js.map +1 -1
- package/dist/cjs/layouts/StatusDot.native.js.map +1 -1
- package/dist/cjs/layouts/StatusGlyphStrip.native.js +1 -1
- package/dist/cjs/layouts/StatusGlyphStrip.native.js.map +1 -1
- package/dist/cjs/layouts/ViewSwitcher.native.js.map +1 -1
- package/dist/cjs/layouts/asyncFailure.cjs +15 -15
- package/dist/cjs/layouts/asyncFailure.native.js +15 -15
- package/dist/cjs/layouts/asyncFailure.native.js.map +1 -1
- package/dist/cjs/layouts/attachments.cjs +45 -6
- package/dist/cjs/layouts/attachments.native.js +49 -8
- package/dist/cjs/layouts/attachments.native.js.map +1 -1
- package/dist/cjs/layouts/barTitleSpan.native.js.map +1 -1
- package/dist/cjs/layouts/bottomAccessory.native.js.map +1 -1
- package/dist/cjs/layouts/breadcrumbs.native.js.map +1 -1
- package/dist/cjs/layouts/index.native.js +3 -3
- package/dist/cjs/layouts/index.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +89 -13
- package/dist/cjs/layouts/page.native.js +95 -16
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/layouts/pageHeadingScope.native.js.map +1 -1
- package/dist/cjs/layouts/screenScroll.cjs +8 -4
- package/dist/cjs/layouts/screenScroll.native.js +12 -4
- package/dist/cjs/layouts/screenScroll.native.js.map +1 -1
- package/dist/cjs/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/cjs/layouts/sidebar.native.js +1 -1
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/tags.cjs +2 -1
- package/dist/cjs/layouts/tags.native.js +4 -3
- package/dist/cjs/layouts/tags.native.js.map +1 -1
- package/dist/cjs/layouts/timeline.native.js +2 -2
- package/dist/cjs/layouts/timeline.native.js.map +1 -1
- package/dist/cjs/layouts/toolbar.native.js +1 -1
- package/dist/cjs/layouts/toolbar.native.js.map +1 -1
- package/dist/cjs/shared/actionScan.native.js.map +1 -1
- package/dist/cjs/shared/i18n.native.js.map +1 -1
- package/dist/cjs/shared/restoreRetries.native.js.map +1 -1
- package/dist/cjs/shared/t.native.js.map +1 -1
- package/dist/cjs/shared/textRidesText.native.js.map +1 -1
- package/dist/cjs/shared/useReturnFocusOnClose.native.js.map +1 -1
- package/dist/cjs/surfaces.native.js +1 -1
- package/dist/cjs/surfaces.native.js.map +1 -1
- package/dist/cjs/tamagui.native.js +1 -1
- package/dist/cjs/tamagui.native.js.map +1 -1
- package/dist/cjs/testSetup.native.js.map +1 -1
- package/dist/cjs/utils/unwrapText.native.js.map +1 -1
- package/dist/cjs/views/Calendar.native.js +1 -1
- package/dist/cjs/views/Calendar.native.js.map +1 -1
- package/dist/cjs/views/CardGrid.native.js.map +1 -1
- package/dist/cjs/views/Dashboard.cjs +18 -5
- package/dist/cjs/views/Dashboard.native.js +20 -7
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/FilePreview.cjs +624 -0
- package/dist/cjs/views/FilePreview.native.js +675 -0
- package/dist/cjs/views/FilePreview.native.js.map +1 -0
- package/dist/cjs/views/Gantt.native.js +2 -2
- package/dist/cjs/views/Gantt.native.js.map +1 -1
- package/dist/cjs/views/GanttDateGrip.native.js.map +1 -1
- package/dist/cjs/views/ImageGrid.native.js +2 -2
- package/dist/cjs/views/ImageGrid.native.js.map +1 -1
- package/dist/cjs/views/Kanban.native.js +1 -1
- package/dist/cjs/views/List.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.cjs +2 -2
- package/dist/cjs/views/ListGroup.native.js +3 -3
- package/dist/cjs/views/ListGroup.native.js.map +1 -1
- package/dist/cjs/views/ListRow.native.js.map +1 -1
- package/dist/cjs/views/Matrix.native.js +2 -2
- package/dist/cjs/views/Matrix.native.js.map +1 -1
- package/dist/cjs/views/ReportBuilder.native.js +2 -2
- package/dist/cjs/views/ReportBuilder.native.js.map +1 -1
- package/dist/cjs/views/ShortcutCard.native.js.map +1 -1
- package/dist/cjs/views/TreeView.native.js.map +1 -1
- package/dist/cjs/views/calendarMath.native.js.map +1 -1
- package/dist/cjs/views/ganttIntervals.native.js.map +1 -1
- package/dist/cjs/views/ganttMath.native.js.map +1 -1
- package/dist/cjs/views/index.cjs +13 -0
- package/dist/cjs/views/index.native.js +14 -1
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/cjs/views/kanbanDnd.native.js.map +1 -1
- package/dist/cjs/views/matrixMath.native.js.map +1 -1
- package/dist/cjs/views/sameNameScope.native.js.map +1 -1
- package/dist/cjs/views/treeViewDnd.native.js.map +1 -1
- package/dist/cjs/views/treeViewLayout.native.js.map +1 -1
- package/dist/cjs/views/treeViewMotion.native.js.map +1 -1
- package/dist/cjs/views/treeViewReveal.native.js.map +1 -1
- package/dist/cjs/views/usePageFlowLoadMore.native.js.map +1 -1
- package/dist/cjs/views/widgetChrome.native.js.map +1 -1
- package/dist/esm/Chip/index.mjs +3 -3
- package/dist/esm/Chip/index.mjs.map +1 -1
- package/dist/esm/Chip/index.native.js +3 -3
- package/dist/esm/Chip/index.native.js.map +1 -1
- package/dist/esm/Material/blur.native.js +5 -1
- package/dist/esm/Material/blur.native.js.map +1 -1
- package/dist/esm/ScrollView/useRevealFocusedField.native.js +3 -2
- package/dist/esm/ScrollView/useRevealFocusedField.native.js.map +1 -1
- package/dist/esm/SheetModal/detents.mjs +2 -32
- package/dist/esm/SheetModal/detents.mjs.map +1 -1
- package/dist/esm/SheetModal/detents.native.js +2 -38
- package/dist/esm/SheetModal/detents.native.js.map +1 -1
- package/dist/esm/SheetModal/index.mjs +13 -1
- package/dist/esm/SheetModal/index.mjs.map +1 -1
- package/dist/esm/SheetModal/index.native.js +22 -12
- package/dist/esm/SheetModal/index.native.js.map +1 -1
- package/dist/esm/Tabs/index.mjs +16 -40
- package/dist/esm/Tabs/index.mjs.map +1 -1
- package/dist/esm/Tabs/index.native.js +17 -41
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/Tooltip/index.native.js +10 -2
- package/dist/esm/Tooltip/index.native.js.map +1 -1
- package/dist/esm/appShell/AppShell.mjs +91 -107
- package/dist/esm/appShell/AppShell.mjs.map +1 -1
- package/dist/esm/appShell/AppShell.native.js +100 -114
- package/dist/esm/appShell/AppShell.native.js.map +1 -1
- package/dist/esm/appShell/MpoTabHost.mjs.map +1 -1
- package/dist/esm/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/esm/appShell/Springboard.mjs +1 -1
- package/dist/esm/appShell/Springboard.mjs.map +1 -1
- package/dist/esm/appShell/Springboard.native.js +1 -1
- package/dist/esm/appShell/Springboard.native.js.map +1 -1
- package/dist/esm/appShell/SystemBar.mjs +147 -58
- package/dist/esm/appShell/SystemBar.mjs.map +1 -1
- package/dist/esm/appShell/SystemBar.native.js +152 -62
- package/dist/esm/appShell/SystemBar.native.js.map +1 -1
- package/dist/esm/appShell/TabHost.native.js +5 -2
- package/dist/esm/appShell/TabHost.native.js.map +1 -1
- package/dist/esm/appShell/stackBack.mjs +23 -0
- package/dist/esm/appShell/stackBack.mjs.map +1 -0
- package/dist/esm/appShell/stackBack.native.js +26 -0
- package/dist/esm/appShell/stackBack.native.js.map +1 -0
- package/dist/esm/appShell/systemBarFit.mjs +12 -2
- package/dist/esm/appShell/systemBarFit.mjs.map +1 -1
- package/dist/esm/appShell/systemBarFit.native.js +16 -2
- package/dist/esm/appShell/systemBarFit.native.js.map +1 -1
- package/dist/esm/code/CodeBlock/index.mjs +21 -12
- package/dist/esm/code/CodeBlock/index.mjs.map +1 -1
- package/dist/esm/code/CodeBlock/index.native.js +21 -12
- package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
- package/dist/esm/code/HoldSelect/index.mjs +42 -0
- package/dist/esm/code/HoldSelect/index.mjs.map +1 -0
- package/dist/esm/code/HoldSelect/index.native.js +102 -0
- package/dist/esm/code/HoldSelect/index.native.js.map +1 -0
- package/dist/esm/code/HoldSelect/tapGate.mjs +61 -0
- package/dist/esm/code/HoldSelect/tapGate.mjs.map +1 -0
- package/dist/esm/code/HoldSelect/tapGate.native.js +65 -0
- package/dist/esm/code/HoldSelect/tapGate.native.js.map +1 -0
- package/dist/esm/code/LogView.mjs +13 -3
- package/dist/esm/code/LogView.mjs.map +1 -1
- package/dist/esm/code/LogView.native.js +14 -3
- package/dist/esm/code/LogView.native.js.map +1 -1
- package/dist/esm/code/index.mjs +1 -0
- package/dist/esm/code/index.mjs.map +1 -1
- package/dist/esm/code/index.native.js +1 -0
- package/dist/esm/code/index.native.js.map +1 -1
- package/dist/esm/componentColors.mjs +5 -4
- package/dist/esm/componentColors.mjs.map +1 -1
- package/dist/esm/componentColors.native.js +5 -4
- package/dist/esm/componentColors.native.js.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.mjs +22 -2
- package/dist/esm/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/esm/layouts/AsyncBoundary.native.js +22 -2
- package/dist/esm/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/esm/layouts/asyncFailure.mjs +15 -15
- package/dist/esm/layouts/asyncFailure.mjs.map +1 -1
- package/dist/esm/layouts/asyncFailure.native.js +15 -15
- package/dist/esm/layouts/asyncFailure.native.js.map +1 -1
- package/dist/esm/layouts/attachments.mjs +45 -6
- package/dist/esm/layouts/attachments.mjs.map +1 -1
- package/dist/esm/layouts/attachments.native.js +47 -6
- package/dist/esm/layouts/attachments.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +94 -18
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +96 -17
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/layouts/screenScroll.mjs +8 -4
- package/dist/esm/layouts/screenScroll.mjs.map +1 -1
- package/dist/esm/layouts/screenScroll.native.js +12 -4
- package/dist/esm/layouts/screenScroll.native.js.map +1 -1
- package/dist/esm/layouts/tags.mjs +2 -1
- package/dist/esm/layouts/tags.mjs.map +1 -1
- package/dist/esm/layouts/tags.native.js +2 -1
- package/dist/esm/layouts/tags.native.js.map +1 -1
- package/dist/esm/views/Dashboard.mjs +19 -6
- package/dist/esm/views/Dashboard.mjs.map +1 -1
- package/dist/esm/views/Dashboard.native.js +19 -6
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/FilePreview.mjs +588 -0
- package/dist/esm/views/FilePreview.mjs.map +1 -0
- package/dist/esm/views/FilePreview.native.js +636 -0
- package/dist/esm/views/FilePreview.native.js.map +1 -0
- package/dist/esm/views/ListGroup.mjs +1 -1
- package/dist/esm/views/ListGroup.native.js +1 -1
- package/dist/esm/views/index.mjs +2 -1
- package/dist/esm/views/index.mjs.map +1 -1
- package/dist/esm/views/index.native.js +2 -1
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/jsx/Chip/index.mjs +3 -3
- package/dist/jsx/Chip/index.mjs.map +1 -1
- package/dist/jsx/Chip/index.native.js +1 -1
- package/dist/jsx/Chip/index.native.js.map +1 -1
- package/dist/jsx/Material/blur.native.js +5 -1
- package/dist/jsx/Material/blur.native.js.map +1 -1
- package/dist/jsx/ScrollView/useRevealFocusedField.native.js +3 -2
- package/dist/jsx/ScrollView/useRevealFocusedField.native.js.map +1 -1
- package/dist/jsx/SheetModal/detents.mjs +2 -32
- package/dist/jsx/SheetModal/detents.mjs.map +1 -1
- package/dist/jsx/SheetModal/detents.native.js +11 -43
- package/dist/jsx/SheetModal/detents.native.js.map +1 -1
- package/dist/jsx/SheetModal/index.mjs +13 -1
- package/dist/jsx/SheetModal/index.mjs.map +1 -1
- package/dist/jsx/SheetModal/index.native.js +21 -11
- package/dist/jsx/SheetModal/index.native.js.map +1 -1
- package/dist/jsx/Tabs/index.mjs +16 -40
- package/dist/jsx/Tabs/index.mjs.map +1 -1
- package/dist/jsx/Tabs/index.native.js +17 -40
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/Tooltip/index.native.js +9 -1
- package/dist/jsx/Tooltip/index.native.js.map +1 -1
- package/dist/jsx/appShell/AppShell.mjs +91 -107
- package/dist/jsx/appShell/AppShell.mjs.map +1 -1
- package/dist/jsx/appShell/AppShell.native.js +100 -114
- package/dist/jsx/appShell/AppShell.native.js.map +1 -1
- package/dist/jsx/appShell/MpoTabHost.mjs.map +1 -1
- package/dist/jsx/appShell/MpoTabHost.native.js.map +1 -1
- package/dist/jsx/appShell/Springboard.mjs +1 -1
- package/dist/jsx/appShell/Springboard.mjs.map +1 -1
- package/dist/jsx/appShell/Springboard.native.js +2 -2
- package/dist/jsx/appShell/Springboard.native.js.map +1 -1
- package/dist/jsx/appShell/SystemBar.mjs +147 -58
- package/dist/jsx/appShell/SystemBar.mjs.map +1 -1
- package/dist/jsx/appShell/SystemBar.native.js +152 -59
- package/dist/jsx/appShell/SystemBar.native.js.map +1 -1
- package/dist/jsx/appShell/TabHost.native.js +5 -2
- package/dist/jsx/appShell/TabHost.native.js.map +1 -1
- package/dist/jsx/appShell/stackBack.mjs +23 -0
- package/dist/jsx/appShell/stackBack.mjs.map +1 -0
- package/dist/jsx/appShell/stackBack.native.js +55 -0
- package/dist/jsx/appShell/stackBack.native.js.map +1 -0
- package/dist/jsx/appShell/systemBarFit.mjs +12 -2
- package/dist/jsx/appShell/systemBarFit.mjs.map +1 -1
- package/dist/jsx/appShell/systemBarFit.native.js +16 -2
- package/dist/jsx/appShell/systemBarFit.native.js.map +1 -1
- package/dist/jsx/code/CodeBlock/index.mjs +21 -12
- package/dist/jsx/code/CodeBlock/index.mjs.map +1 -1
- package/dist/jsx/code/CodeBlock/index.native.js +21 -12
- package/dist/jsx/code/CodeBlock/index.native.js.map +1 -1
- package/dist/jsx/code/HoldSelect/index.mjs +42 -0
- package/dist/jsx/code/HoldSelect/index.mjs.map +1 -0
- package/dist/jsx/code/HoldSelect/index.native.js +132 -0
- package/dist/jsx/code/HoldSelect/index.native.js.map +1 -0
- package/dist/jsx/code/HoldSelect/tapGate.mjs +61 -0
- package/dist/jsx/code/HoldSelect/tapGate.mjs.map +1 -0
- package/dist/jsx/code/HoldSelect/tapGate.native.js +95 -0
- package/dist/jsx/code/HoldSelect/tapGate.native.js.map +1 -0
- package/dist/jsx/code/LogView.mjs +13 -3
- package/dist/jsx/code/LogView.mjs.map +1 -1
- package/dist/jsx/code/LogView.native.js +15 -3
- package/dist/jsx/code/LogView.native.js.map +1 -1
- package/dist/jsx/code/index.mjs +1 -0
- package/dist/jsx/code/index.mjs.map +1 -1
- package/dist/jsx/code/index.native.js +1 -0
- package/dist/jsx/code/index.native.js.map +1 -1
- package/dist/jsx/componentColors.mjs +5 -4
- package/dist/jsx/componentColors.mjs.map +1 -1
- package/dist/jsx/componentColors.native.js +5 -4
- package/dist/jsx/componentColors.native.js.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.mjs +22 -2
- package/dist/jsx/layouts/AsyncBoundary.mjs.map +1 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js +21 -1
- package/dist/jsx/layouts/AsyncBoundary.native.js.map +1 -1
- package/dist/jsx/layouts/asyncFailure.mjs +15 -15
- package/dist/jsx/layouts/asyncFailure.mjs.map +1 -1
- package/dist/jsx/layouts/asyncFailure.native.js +15 -15
- package/dist/jsx/layouts/asyncFailure.native.js.map +1 -1
- package/dist/jsx/layouts/attachments.mjs +45 -6
- package/dist/jsx/layouts/attachments.mjs.map +1 -1
- package/dist/jsx/layouts/attachments.native.js +47 -6
- package/dist/jsx/layouts/attachments.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +94 -18
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +93 -14
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/layouts/screenScroll.mjs +8 -4
- package/dist/jsx/layouts/screenScroll.mjs.map +1 -1
- package/dist/jsx/layouts/screenScroll.native.js +12 -4
- package/dist/jsx/layouts/screenScroll.native.js.map +1 -1
- package/dist/jsx/layouts/tags.mjs +2 -1
- package/dist/jsx/layouts/tags.mjs.map +1 -1
- package/dist/jsx/layouts/tags.native.js +2 -1
- package/dist/jsx/layouts/tags.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.mjs +19 -6
- package/dist/jsx/views/Dashboard.mjs.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +18 -5
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/FilePreview.mjs +588 -0
- package/dist/jsx/views/FilePreview.mjs.map +1 -0
- package/dist/jsx/views/FilePreview.native.js +675 -0
- package/dist/jsx/views/FilePreview.native.js.map +1 -0
- package/dist/jsx/views/ListGroup.mjs +1 -1
- package/dist/jsx/views/ListGroup.native.js +2 -2
- package/dist/jsx/views/ListGroup.native.js.map +1 -1
- package/dist/jsx/views/index.mjs +2 -1
- package/dist/jsx/views/index.mjs.map +1 -1
- package/dist/jsx/views/index.native.js +13 -0
- package/dist/jsx/views/index.native.js.map +1 -1
- package/package.json +8 -11
- package/src/Chip/index.tsx +4 -3
- package/src/Material/blur.native.tsx +7 -1
- package/src/OverflowRow/OverflowRow.native.spec.tsx +10 -0
- package/src/OverflowRow/OverflowRow.stories.tsx +46 -17
- package/src/ScrollView/useRevealFocusedField.native.ts +2 -2
- package/src/SheetModal/SheetModal.detentLayout.spec.tsx +65 -1
- package/src/SheetModal/SheetModal.elevation.spec.tsx +4 -4
- package/src/SheetModal/SheetModal.fill.spec.tsx +47 -0
- package/src/SheetModal/SheetModal.spec.tsx +8 -3
- package/src/SheetModal/SheetModal.stories.tsx +17 -0
- package/src/SheetModal/detents.ts +25 -78
- package/src/SheetModal/index.native.tsx +24 -12
- package/src/SheetModal/index.tsx +27 -5
- package/src/Tabs/Tabs.edgeFades.spec.tsx +77 -0
- package/src/Tabs/Tabs.fades.native.spec.tsx +23 -21
- package/src/Tabs/Tabs.measurement.spec.tsx +3 -3
- package/src/Tabs/Tabs.native.spec.tsx +1 -1
- package/src/Tabs/index.tsx +29 -50
- package/src/Tooltip/Tooltip.holdCue.native.spec.tsx +71 -0
- package/src/Tooltip/Tooltip.spec.tsx +1 -1
- package/src/Tooltip/index.native.tsx +6 -1
- package/src/appShell/AppShell.native.spec.tsx +104 -0
- package/src/appShell/AppShell.spec.tsx +49 -0
- package/src/appShell/AppShell.stackBack.native-press.spec.tsx +61 -0
- package/src/appShell/AppShell.stackBack.spec.tsx +112 -0
- package/src/appShell/AppShell.stories.tsx +51 -1
- package/src/appShell/AppShell.tsx +66 -80
- package/src/appShell/MpoTabHost.tsx +6 -0
- package/src/appShell/Springboard.spec.tsx +1 -1
- package/src/appShell/Springboard.tsx +1 -1
- package/src/appShell/SystemBar.phoneWidth.spec.tsx +17 -0
- package/src/appShell/SystemBar.spec.tsx +155 -3
- package/src/appShell/SystemBar.stories.tsx +48 -3
- package/src/appShell/SystemBar.tsx +172 -48
- package/src/appShell/TabHost.native.tsx +4 -2
- package/src/appShell/stackBack.ts +31 -0
- package/src/appShell/systemBarFit.ts +10 -7
- package/src/checkedRow.native-press.spec.tsx +4 -4
- package/src/checkedRow.spec.tsx +2 -2
- package/src/code/CodeBlock/codeBlock.stories.ts +21 -0
- package/src/code/CodeBlock/index.tsx +24 -17
- package/src/code/HoldSelect/holdSelect.spec.tsx +128 -0
- package/src/code/HoldSelect/index.native.tsx +86 -0
- package/src/code/HoldSelect/index.tsx +53 -0
- package/src/code/HoldSelect/tapGate.ts +87 -0
- package/src/code/LogView.follow.spec.tsx +104 -0
- package/src/code/LogView.tsx +29 -4
- package/src/code/index.ts +1 -0
- package/src/componentColors.spec.ts +3 -3
- package/src/componentColors.ts +5 -4
- package/src/elevatedGround.spec.tsx +7 -7
- package/src/layouts/AsyncBoundary.reason.spec.tsx +64 -23
- package/src/layouts/AsyncBoundary.stories.tsx +1 -0
- package/src/layouts/AsyncBoundary.tsx +21 -2
- package/src/layouts/Attachments.stories.tsx +31 -1
- package/src/layouts/ScreenToolbar.stories.tsx +54 -1
- package/src/layouts/Sidebar.spec.tsx +6 -1
- package/src/layouts/asyncFailure.spec.ts +28 -13
- package/src/layouts/asyncFailure.ts +17 -19
- package/src/layouts/attachments.tsx +60 -8
- package/src/layouts/heroBarTitle.native-press.spec.tsx +132 -0
- package/src/layouts/page.tsx +136 -16
- package/src/layouts/screenScroll.tsx +21 -14
- package/src/layouts/tags.tsx +2 -1
- package/src/layouts/toolbarLeadingClip.spec.tsx +120 -0
- package/src/overlayElevation.spec.tsx +1 -1
- package/src/overlayGround.spec.tsx +77 -0
- package/src/views/Dashboard.stories.tsx +21 -0
- package/src/views/Dashboard.tsx +34 -7
- package/src/views/FilePreview.tsx +640 -0
- package/src/views/Kanban.spec.tsx +6 -1
- package/src/views/List.selection.spec.tsx +42 -0
- package/src/views/List.spec.tsx +1 -26
- package/src/views/ListGroup.states.spec.tsx +1 -1
- package/src/views/ListGroup.stories.tsx +119 -2
- package/src/views/ListGroup.tsx +1 -1
- package/src/views/ReportBuilder.spec.tsx +9 -4
- package/src/views/TreeView.spec.tsx +6 -1
- package/src/views/dataIdentity.spec.tsx +5 -0
- package/src/views/filePreview.spec.tsx +282 -0
- package/src/views/index.ts +17 -0
- package/src/views/kpiNotMeasured.spec.tsx +56 -0
- package/types/Chip/index.d.ts.map +1 -1
- package/types/Material/blur.native.d.ts.map +1 -1
- package/types/SheetModal/detents.d.ts +9 -54
- package/types/SheetModal/detents.d.ts.map +1 -1
- package/types/SheetModal/index.d.ts +23 -5
- package/types/SheetModal/index.d.ts.map +1 -1
- package/types/SheetModal/index.native.d.ts +1 -1
- package/types/SheetModal/index.native.d.ts.map +1 -1
- package/types/Tabs/index.d.ts +2 -1
- package/types/Tabs/index.d.ts.map +1 -1
- package/types/Tooltip/index.native.d.ts.map +1 -1
- package/types/appShell/AppShell.d.ts +5 -1
- package/types/appShell/AppShell.d.ts.map +1 -1
- package/types/appShell/MpoTabHost.d.ts +6 -0
- package/types/appShell/MpoTabHost.d.ts.map +1 -1
- package/types/appShell/Springboard.d.ts.map +1 -1
- package/types/appShell/SystemBar.d.ts +39 -2
- package/types/appShell/SystemBar.d.ts.map +1 -1
- package/types/appShell/TabHost.native.d.ts +1 -1
- package/types/appShell/TabHost.native.d.ts.map +1 -1
- package/types/appShell/stackBack.d.ts +3 -0
- package/types/appShell/stackBack.d.ts.map +1 -0
- package/types/appShell/systemBarFit.d.ts +1 -0
- package/types/appShell/systemBarFit.d.ts.map +1 -1
- package/types/code/CodeBlock/index.d.ts +3 -1
- package/types/code/CodeBlock/index.d.ts.map +1 -1
- package/types/code/HoldSelect/index.d.ts +16 -0
- package/types/code/HoldSelect/index.d.ts.map +1 -0
- package/types/code/HoldSelect/index.native.d.ts +17 -0
- package/types/code/HoldSelect/index.native.d.ts.map +1 -0
- package/types/code/HoldSelect/tapGate.d.ts +41 -0
- package/types/code/HoldSelect/tapGate.d.ts.map +1 -0
- package/types/code/LogView.d.ts +3 -1
- package/types/code/LogView.d.ts.map +1 -1
- package/types/code/index.d.ts +1 -0
- package/types/code/index.d.ts.map +1 -1
- package/types/componentColors.d.ts +4 -4
- package/types/componentColors.d.ts.map +1 -1
- package/types/layouts/AsyncBoundary.d.ts +3 -1
- package/types/layouts/AsyncBoundary.d.ts.map +1 -1
- package/types/layouts/asyncFailure.d.ts +4 -1
- package/types/layouts/asyncFailure.d.ts.map +1 -1
- package/types/layouts/attachments.d.ts.map +1 -1
- package/types/layouts/page.d.ts.map +1 -1
- package/types/layouts/screenScroll.d.ts +4 -2
- package/types/layouts/screenScroll.d.ts.map +1 -1
- package/types/layouts/tags.d.ts.map +1 -1
- package/types/views/Dashboard.d.ts +7 -1
- package/types/views/Dashboard.d.ts.map +1 -1
- package/types/views/FilePreview.d.ts +62 -0
- package/types/views/FilePreview.d.ts.map +1 -0
- package/types/views/index.d.ts +1 -0
- package/types/views/index.d.ts.map +1 -1
- package/dist/cjs/hooks/useHoldCue.cjs +0 -52
- package/dist/cjs/hooks/useHoldCue.native.js +0 -60
- package/dist/cjs/hooks/useHoldCue.native.js.map +0 -1
- package/dist/esm/hooks/useHoldCue.mjs +0 -26
- package/dist/esm/hooks/useHoldCue.mjs.map +0 -1
- package/dist/esm/hooks/useHoldCue.native.js +0 -31
- package/dist/esm/hooks/useHoldCue.native.js.map +0 -1
- package/dist/jsx/hooks/useHoldCue.mjs +0 -26
- package/dist/jsx/hooks/useHoldCue.mjs.map +0 -1
- package/dist/jsx/hooks/useHoldCue.native.js +0 -60
- package/dist/jsx/hooks/useHoldCue.native.js.map +0 -1
- package/src/hooks/useHoldCue.ts +0 -23
- package/types/hooks/useHoldCue.d.ts +0 -8
- package/types/hooks/useHoldCue.d.ts.map +0 -1
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
import { Button, Spinner } from "@multiplatform.one/forms";
|
|
15
15
|
import { sizeTokenStep, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
16
|
-
import { WarningCircleIcon } from "@phosphor-icons/react";
|
|
16
|
+
import { LockSimpleIcon, WarningCircleIcon } from "@phosphor-icons/react";
|
|
17
17
|
import {
|
|
18
18
|
createContext,
|
|
19
19
|
isValidElement,
|
|
@@ -107,6 +107,8 @@ export interface AsyncBoundaryProps extends Omit<YStackProps, "children"> {
|
|
|
107
107
|
layout?: AsyncBoundaryLayout;
|
|
108
108
|
/** Retry action shown on the default error UI. */
|
|
109
109
|
onRetry?: () => void;
|
|
110
|
+
/** Log in action shown when the failure is an ended session. */
|
|
111
|
+
onSignIn?: () => void;
|
|
110
112
|
/** Default error EmptyState title. */
|
|
111
113
|
errorTitle?: string;
|
|
112
114
|
/** Default empty EmptyState title when `empty={true}`. */
|
|
@@ -189,6 +191,7 @@ interface ErrorCopy {
|
|
|
189
191
|
title: string;
|
|
190
192
|
description?: string;
|
|
191
193
|
retry: boolean;
|
|
194
|
+
signIn: boolean;
|
|
192
195
|
refusal: boolean;
|
|
193
196
|
}
|
|
194
197
|
|
|
@@ -198,6 +201,7 @@ interface ReasonCopyOptions {
|
|
|
198
201
|
live?: boolean;
|
|
199
202
|
reasons?: Record<string, AsyncFailureReason>;
|
|
200
203
|
canRetry: boolean;
|
|
204
|
+
canSignIn: boolean;
|
|
201
205
|
errorTitle?: string;
|
|
202
206
|
errorDescription?: string;
|
|
203
207
|
}
|
|
@@ -215,6 +219,7 @@ function errorCopy(
|
|
|
215
219
|
subject: opts.subject,
|
|
216
220
|
reason,
|
|
217
221
|
retry: opts.canRetry,
|
|
222
|
+
signIn: opts.canSignIn,
|
|
218
223
|
live: opts.live,
|
|
219
224
|
reasons: opts.reasons,
|
|
220
225
|
});
|
|
@@ -222,12 +227,14 @@ function errorCopy(
|
|
|
222
227
|
title: opts.errorTitle ?? failure.title,
|
|
223
228
|
description: errorDescription ?? failure.description,
|
|
224
229
|
retry: failure.retry,
|
|
230
|
+
signIn: failure.signIn,
|
|
225
231
|
refusal: failure.refusal,
|
|
226
232
|
};
|
|
227
233
|
}
|
|
228
234
|
return {
|
|
229
235
|
...plainErrorCopy(error, errorTitle, errorDescription),
|
|
230
236
|
retry: opts.canRetry,
|
|
237
|
+
signIn: false,
|
|
231
238
|
refusal: false,
|
|
232
239
|
};
|
|
233
240
|
}
|
|
@@ -499,13 +506,17 @@ function defaultEmptyBody({
|
|
|
499
506
|
function defaultErrorBody({
|
|
500
507
|
copy,
|
|
501
508
|
onRetry,
|
|
509
|
+
onSignIn,
|
|
502
510
|
retryLabel,
|
|
511
|
+
signInLabel,
|
|
503
512
|
size,
|
|
504
513
|
small,
|
|
505
514
|
}: {
|
|
506
515
|
copy: ErrorCopy;
|
|
507
516
|
onRetry?: () => void;
|
|
517
|
+
onSignIn?: () => void;
|
|
508
518
|
retryLabel: string;
|
|
519
|
+
signInLabel: string;
|
|
509
520
|
size?: SizeTokens;
|
|
510
521
|
small: boolean;
|
|
511
522
|
}): ReactNode {
|
|
@@ -517,6 +528,7 @@ function defaultErrorBody({
|
|
|
517
528
|
data-async-state="refused"
|
|
518
529
|
title={copy.title}
|
|
519
530
|
description={copy.description}
|
|
531
|
+
icon={<LockSimpleIcon size={small ? 24 : 32} />}
|
|
520
532
|
/>
|
|
521
533
|
);
|
|
522
534
|
}
|
|
@@ -533,6 +545,10 @@ function defaultErrorBody({
|
|
|
533
545
|
<Button size={small ? "$3" : "$4"} onPress={onRetry}>
|
|
534
546
|
<Text fontWeight="400">{retryLabel}</Text>
|
|
535
547
|
</Button>
|
|
548
|
+
) : onSignIn && copy.signIn ? (
|
|
549
|
+
<Button size={small ? "$3" : "$4"} onPress={onSignIn}>
|
|
550
|
+
<Text fontWeight="400">{signInLabel}</Text>
|
|
551
|
+
</Button>
|
|
536
552
|
) : undefined
|
|
537
553
|
}
|
|
538
554
|
/>
|
|
@@ -583,6 +599,7 @@ export function AsyncBoundary({
|
|
|
583
599
|
children,
|
|
584
600
|
layout = "generic",
|
|
585
601
|
onRetry,
|
|
602
|
+
onSignIn,
|
|
586
603
|
errorTitle,
|
|
587
604
|
emptyTitle = "No items found",
|
|
588
605
|
emptyDescription,
|
|
@@ -604,6 +621,7 @@ export function AsyncBoundary({
|
|
|
604
621
|
// MPO-48 / R7: Retry is a §6.1 label — weight 400 on the TEXT NODE via
|
|
605
622
|
// house Text. Alert's actionLabel hardcodes 600; the action slot does not.
|
|
606
623
|
const retryLabel = t("Retry");
|
|
624
|
+
const signInLabel = t("Log in");
|
|
607
625
|
const copy =
|
|
608
626
|
status === "error" && !isReactNodeSlot(error)
|
|
609
627
|
? errorCopy(error, errorTitle ?? "Couldn't load data", errorDescription, {
|
|
@@ -612,6 +630,7 @@ export function AsyncBoundary({
|
|
|
612
630
|
live,
|
|
613
631
|
reasons,
|
|
614
632
|
canRetry: !!onRetry,
|
|
633
|
+
canSignIn: !!onSignIn,
|
|
615
634
|
errorTitle,
|
|
616
635
|
errorDescription,
|
|
617
636
|
})
|
|
@@ -682,7 +701,7 @@ export function AsyncBoundary({
|
|
|
682
701
|
if (isReactNodeSlot(error)) {
|
|
683
702
|
body = error;
|
|
684
703
|
} else if (copy) {
|
|
685
|
-
body = defaultErrorBody({ copy, onRetry, retryLabel, size, small });
|
|
704
|
+
body = defaultErrorBody({ copy, onRetry, onSignIn, retryLabel, signInLabel, size, small });
|
|
686
705
|
}
|
|
687
706
|
} else if (refetching && settled) {
|
|
688
707
|
pending = true;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { action } from "@multiplatform.one/storybook";
|
|
2
|
-
import { YStack } from "tamagui";
|
|
2
|
+
import { View, YStack } from "tamagui";
|
|
3
3
|
import { Attachments, type AttachmentItem } from "./attachments";
|
|
4
4
|
import { Text } from "../Text";
|
|
5
|
+
import { FileViewerHost } from "../views/FilePreview";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: "Components/Attachments",
|
|
@@ -210,3 +211,32 @@ AllStates.parameters = {
|
|
|
210
211
|
},
|
|
211
212
|
},
|
|
212
213
|
};
|
|
214
|
+
|
|
215
|
+
const notes =
|
|
216
|
+
"Deploy notes\n\n1. Pull the new image.\n2. Run the migration.\n3. Roll the web service.\n";
|
|
217
|
+
|
|
218
|
+
export const TextFile = () => (
|
|
219
|
+
<View height="100vh">
|
|
220
|
+
<FileViewerHost>
|
|
221
|
+
<YStack width="100%" maxWidth={480} padding="$4">
|
|
222
|
+
<Attachments
|
|
223
|
+
label="Attachments"
|
|
224
|
+
enableAdd={false}
|
|
225
|
+
items={[
|
|
226
|
+
{
|
|
227
|
+
id: "file-101",
|
|
228
|
+
fileName: "deploy-notes.txt",
|
|
229
|
+
fileUrl: `data:text/plain;charset=utf-8,${encodeURIComponent(notes)}`,
|
|
230
|
+
fileSize: notes.length,
|
|
231
|
+
fileType: "text/plain",
|
|
232
|
+
},
|
|
233
|
+
...sampleItems.slice(0, 2),
|
|
234
|
+
]}
|
|
235
|
+
onDownload={action("download")}
|
|
236
|
+
onRemove={action("remove")}
|
|
237
|
+
/>
|
|
238
|
+
</YStack>
|
|
239
|
+
</FileViewerHost>
|
|
240
|
+
</View>
|
|
241
|
+
);
|
|
242
|
+
TextFile.parameters = { layout: "fullscreen" };
|
|
@@ -2,9 +2,12 @@ import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
|
2
2
|
// Catalog Button (G-15 story honesty / LC-18): raw tamagui buttons pinned a
|
|
3
3
|
// non-house radius and ignored every knob, poisoning the knob probes.
|
|
4
4
|
import { Button } from "@multiplatform.one/forms";
|
|
5
|
+
import { Text, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
6
|
+
import { PlusIcon } from "@phosphor-icons/react";
|
|
5
7
|
import { YStack } from "tamagui";
|
|
6
8
|
import { ActionButton } from "../actions/StandardAction";
|
|
7
|
-
import {
|
|
9
|
+
import { Tabs } from "../Tabs";
|
|
10
|
+
import { PageBarButton, PageMenuButton, ScreenToolbar } from "./page";
|
|
8
11
|
|
|
9
12
|
const meta: Meta<typeof ScreenToolbar> = {
|
|
10
13
|
title: "Components/ScreenToolbar",
|
|
@@ -89,3 +92,53 @@ export const ManyActionsNarrow: Story = {
|
|
|
89
92
|
</YStack>
|
|
90
93
|
),
|
|
91
94
|
};
|
|
95
|
+
|
|
96
|
+
const appTabs = [
|
|
97
|
+
{ value: "home", label: "Home" },
|
|
98
|
+
{ value: "todos", label: "Todos" },
|
|
99
|
+
{ value: "pokedex", label: "Pokédex" },
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
function Brand({ children }: { children: string }) {
|
|
103
|
+
const { knobProps } = useResolvedKnobs();
|
|
104
|
+
return <Text {...knobProps.heading}>{children}</Text>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* FZ-9032: the One VS Code panel's bar at 390. The leading brand gives way
|
|
109
|
+
* to the tabs and truncates with an ellipsis instead of running under them.
|
|
110
|
+
*/
|
|
111
|
+
export const BrandAndTabsOnPhone: Story = {
|
|
112
|
+
parameters: { viewport: { defaultViewport: "mobile1" } },
|
|
113
|
+
render: () => (
|
|
114
|
+
<ScreenToolbar
|
|
115
|
+
leading={<Brand>multiplatform.one</Brand>}
|
|
116
|
+
trailing={<Tabs items={appTabs} defaultValue="home" />}
|
|
117
|
+
/>
|
|
118
|
+
),
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* FZ-9032: long leading text and tabs beside trailing actions at 390. The
|
|
123
|
+
* text truncates on one line (LC-143) and the tabs clip at the leading
|
|
124
|
+
* group's edge; neither paints under the actions.
|
|
125
|
+
*/
|
|
126
|
+
export const LongLeadingOnPhone: Story = {
|
|
127
|
+
parameters: { viewport: { defaultViewport: "mobile1" } },
|
|
128
|
+
render: () => (
|
|
129
|
+
<ScreenToolbar
|
|
130
|
+
leading={
|
|
131
|
+
<>
|
|
132
|
+
<Brand>multiplatform.one workspace</Brand>
|
|
133
|
+
<Tabs items={appTabs} defaultValue="todos" />
|
|
134
|
+
</>
|
|
135
|
+
}
|
|
136
|
+
trailing={
|
|
137
|
+
<>
|
|
138
|
+
<PageBarButton icon={PlusIcon} aria-label="Add" />
|
|
139
|
+
<PageMenuButton edge="end" />
|
|
140
|
+
</>
|
|
141
|
+
}
|
|
142
|
+
/>
|
|
143
|
+
),
|
|
144
|
+
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { createDefaultThemeConfig } from "@multiplatform.one/theme";
|
|
1
2
|
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
3
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
3
4
|
import { Sidebar } from "./sidebar";
|
|
4
5
|
|
|
6
|
+
// LC-05: the selection fills are `$selectFill` / `$selectPress`, keys only
|
|
7
|
+
// MPO's themes define (FZ-8400), so these render under MPO's own config.
|
|
8
|
+
createDefaultThemeConfig({});
|
|
9
|
+
|
|
5
10
|
const surface = vi.hoisted(() => ({ touch: false }));
|
|
6
11
|
vi.mock("@multiplatform.one/theme", async (original) => ({
|
|
7
12
|
...(await original<typeof import("@multiplatform.one/theme")>()),
|
|
@@ -33,7 +38,7 @@ describe("Sidebar selection tier", () => {
|
|
|
33
38
|
/>,
|
|
34
39
|
);
|
|
35
40
|
const row = result.container.querySelector("[data-active]")!;
|
|
36
|
-
expect(row.className).toContain("_bg-
|
|
41
|
+
expect(row.className).toContain("_bg-selectFill");
|
|
37
42
|
for (const label of ["Selected", "Details", "(2)"]) {
|
|
38
43
|
expect(result.getByText(label).className).toContain("_col-color12");
|
|
39
44
|
}
|
|
@@ -5,31 +5,33 @@ describe("asyncFailure next step", () => {
|
|
|
5
5
|
it("says try again later when the caller can't retry", () => {
|
|
6
6
|
expect(asyncFailure({ reason: "timeout" })).toEqual({
|
|
7
7
|
title: "Couldn't load data",
|
|
8
|
-
description: "The server took too long
|
|
8
|
+
description: "The server took too long. Try again later.",
|
|
9
9
|
retry: false,
|
|
10
|
+
signIn: false,
|
|
10
11
|
refusal: false,
|
|
11
12
|
});
|
|
12
13
|
});
|
|
13
14
|
|
|
14
|
-
it("
|
|
15
|
+
it("states the cause alone when the caller can retry", () => {
|
|
15
16
|
const failure = asyncFailure({ reason: "busy", retry: true, subject: "Orders" });
|
|
16
17
|
expect(failure.title).toBe("Orders didn't load");
|
|
17
|
-
expect(failure.description).toBe("The server is busy.
|
|
18
|
+
expect(failure.description).toBe("The server is busy.");
|
|
18
19
|
expect(failure.retry).toBe(true);
|
|
19
20
|
});
|
|
20
21
|
|
|
21
|
-
it("
|
|
22
|
+
it("words a live view the same as any other", () => {
|
|
22
23
|
expect(asyncFailure({ reason: "unreachable", retry: true, live: true }).description).toBe(
|
|
23
|
-
"Can't reach the server.
|
|
24
|
+
"Can't reach the server.",
|
|
24
25
|
);
|
|
25
26
|
});
|
|
26
27
|
|
|
27
28
|
it("keeps a reason's own next step and withholds Retry when retrying can't help", () => {
|
|
28
29
|
const failure = asyncFailure({ reason: "payload_large", retry: true, live: true });
|
|
29
|
-
expect(failure.description).toBe(
|
|
30
|
-
"The response is too large to load. Retrying won't help until the view asks for less.",
|
|
31
|
-
);
|
|
30
|
+
expect(failure.description).toBe("Too much to load at once.");
|
|
32
31
|
expect(failure.retry).toBe(false);
|
|
32
|
+
expect(asyncFailure({ reason: "credentials_refused", retry: true }).description).toBe(
|
|
33
|
+
"The server can't sign in to its data. Ask an admin.",
|
|
34
|
+
);
|
|
33
35
|
});
|
|
34
36
|
|
|
35
37
|
it("uses a caller's reason without a next step as retryable", () => {
|
|
@@ -38,9 +40,21 @@ describe("asyncFailure next step", () => {
|
|
|
38
40
|
retry: true,
|
|
39
41
|
reasons: { quota_hit: { cause: "The quota ran out." } },
|
|
40
42
|
});
|
|
41
|
-
expect(failure.description).toBe("The quota ran out.
|
|
43
|
+
expect(failure.description).toBe("The quota ran out.");
|
|
42
44
|
expect(failure.retry).toBe(true);
|
|
43
45
|
});
|
|
46
|
+
|
|
47
|
+
it("offers Log in for an ended session only when the caller can sign in", () => {
|
|
48
|
+
expect(asyncFailure({ reason: "session_expired", signIn: true })).toMatchObject({
|
|
49
|
+
description: "Your session ended.",
|
|
50
|
+
signIn: true,
|
|
51
|
+
retry: false,
|
|
52
|
+
});
|
|
53
|
+
expect(asyncFailure({ reason: "session_expired" })).toMatchObject({
|
|
54
|
+
description: "Your session ended. Log in again.",
|
|
55
|
+
signIn: false,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
44
58
|
});
|
|
45
59
|
|
|
46
60
|
describe("asyncFailure codes", () => {
|
|
@@ -55,7 +69,7 @@ describe("asyncFailure codes", () => {
|
|
|
55
69
|
|
|
56
70
|
it("maps a code to its family, preferring the caller's copy of that family", () => {
|
|
57
71
|
expect(asyncFailure({ reason: "gateway_timed_out" }).description).toMatch(
|
|
58
|
-
/^The server took too long
|
|
72
|
+
/^The server took too long\./,
|
|
59
73
|
);
|
|
60
74
|
expect(
|
|
61
75
|
asyncFailure({
|
|
@@ -73,13 +87,14 @@ describe("asyncFailure codes", () => {
|
|
|
73
87
|
|
|
74
88
|
it("turns a refusal into the access copy unless the caller words that code", () => {
|
|
75
89
|
expect(asyncFailure({ reason: "permission_denied", retry: true })).toEqual({
|
|
76
|
-
title: "
|
|
77
|
-
description: "Ask an admin
|
|
90
|
+
title: "No access",
|
|
91
|
+
description: "Ask an admin.",
|
|
78
92
|
retry: false,
|
|
93
|
+
signIn: false,
|
|
79
94
|
refusal: true,
|
|
80
95
|
});
|
|
81
96
|
expect(asyncFailure({ reason: "forbidden", subject: "Invoices" }).title).toBe(
|
|
82
|
-
"
|
|
97
|
+
"No access to Invoices",
|
|
83
98
|
);
|
|
84
99
|
expect(
|
|
85
100
|
asyncFailure({ reason: "forbidden", reasons: { forbidden: { cause: "Locked." } } }).refusal,
|
|
@@ -2,12 +2,14 @@ export interface AsyncFailureReason {
|
|
|
2
2
|
cause: string;
|
|
3
3
|
retry?: boolean;
|
|
4
4
|
next?: string;
|
|
5
|
+
signIn?: boolean;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
export interface AsyncFailure {
|
|
8
9
|
title: string;
|
|
9
10
|
description: string;
|
|
10
11
|
retry: boolean;
|
|
12
|
+
signIn: boolean;
|
|
11
13
|
refusal: boolean;
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -15,30 +17,28 @@ export interface AsyncFailureOptions {
|
|
|
15
17
|
subject?: string;
|
|
16
18
|
reason?: string | null;
|
|
17
19
|
retry?: boolean;
|
|
20
|
+
signIn?: boolean;
|
|
18
21
|
live?: boolean;
|
|
19
22
|
reasons?: Record<string, AsyncFailureReason>;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
const defaultReasons: Record<string, AsyncFailureReason> = {
|
|
23
|
-
timeout: { cause: "The server took too long
|
|
26
|
+
timeout: { cause: "The server took too long." },
|
|
24
27
|
busy: { cause: "The server is busy." },
|
|
25
28
|
unreachable: { cause: "Can't reach the server." },
|
|
26
29
|
down: { cause: "The server is down." },
|
|
27
30
|
failed: { cause: "The server couldn't finish the request." },
|
|
28
|
-
too_large: {
|
|
29
|
-
cause: "The response is too large to load.",
|
|
30
|
-
retry: false,
|
|
31
|
-
next: "Retrying won't help until the view asks for less.",
|
|
32
|
-
},
|
|
31
|
+
too_large: { cause: "Too much to load at once.", retry: false, next: "" },
|
|
33
32
|
credentials_refused: {
|
|
34
|
-
cause: "The server
|
|
33
|
+
cause: "The server can't sign in to its data.",
|
|
35
34
|
retry: false,
|
|
36
|
-
next: "
|
|
35
|
+
next: "Ask an admin.",
|
|
37
36
|
},
|
|
38
37
|
session_ended: {
|
|
39
38
|
cause: "Your session ended.",
|
|
40
39
|
retry: false,
|
|
41
|
-
|
|
40
|
+
signIn: true,
|
|
41
|
+
next: "Log in again.",
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -76,34 +76,32 @@ function lookup(
|
|
|
76
76
|
return reasons?.failed ?? defaultReasons.failed!;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
function nextStep(canRetry: boolean, live: boolean): string {
|
|
80
|
-
if (!canRetry) return "Try again later.";
|
|
81
|
-
return live ? "It will retry; tap Retry to try now." : "Tap Retry to try again.";
|
|
82
|
-
}
|
|
83
|
-
|
|
84
79
|
export function asyncFailure({
|
|
85
80
|
subject,
|
|
86
81
|
reason,
|
|
87
82
|
retry = false,
|
|
88
|
-
|
|
83
|
+
signIn = false,
|
|
89
84
|
reasons,
|
|
90
85
|
}: AsyncFailureOptions): AsyncFailure {
|
|
91
86
|
const code = typeof reason === "string" && codeShape.test(reason) ? reason : "failed";
|
|
92
87
|
if (refusals.test(code) && !reasons?.[code]) {
|
|
93
88
|
return {
|
|
94
|
-
title: subject ?
|
|
95
|
-
description: "Ask an admin
|
|
89
|
+
title: subject ? `No access to ${subject}` : "No access",
|
|
90
|
+
description: "Ask an admin.",
|
|
96
91
|
retry: false,
|
|
92
|
+
signIn: false,
|
|
97
93
|
refusal: true,
|
|
98
94
|
};
|
|
99
95
|
}
|
|
100
96
|
const entry = lookup(code, reasons);
|
|
101
97
|
const retryable = entry.retry !== false;
|
|
102
|
-
const
|
|
98
|
+
const offersSignIn = entry.signIn === true && signIn;
|
|
99
|
+
const next = (retryable && retry) || offersSignIn ? "" : (entry.next ?? "Try again later.");
|
|
103
100
|
return {
|
|
104
101
|
title: subject ? `${subject} didn't load` : "Couldn't load data",
|
|
105
|
-
description: `${entry.cause} ${next}
|
|
102
|
+
description: next ? `${entry.cause} ${next}` : entry.cause,
|
|
106
103
|
retry: retryable && retry,
|
|
104
|
+
signIn: offersSignIn,
|
|
107
105
|
refusal: false,
|
|
108
106
|
};
|
|
109
107
|
}
|
|
@@ -45,6 +45,7 @@ import { useReturnFocusOnClose } from "../shared/useReturnFocusOnClose";
|
|
|
45
45
|
import { AsyncBoundary, resolveAsyncStatus } from "./AsyncBoundary";
|
|
46
46
|
import { MiddleEllipsisText } from "../MiddleEllipsisText";
|
|
47
47
|
import { Text } from "../Text";
|
|
48
|
+
import { FileViewer, isTextFile, useFileViewerHost, type PreviewFile } from "../views/FilePreview";
|
|
48
49
|
|
|
49
50
|
// ---------------------------------------------------------------------------
|
|
50
51
|
// Types (generic -- no Frappe dependency)
|
|
@@ -175,6 +176,22 @@ function isImageFile(attachment: AttachmentItem): boolean {
|
|
|
175
176
|
return imageExtensions.includes(ext);
|
|
176
177
|
}
|
|
177
178
|
|
|
179
|
+
function isTextAttachment(attachment: AttachmentItem): boolean {
|
|
180
|
+
if (isImageFile(attachment)) return false;
|
|
181
|
+
const mime = (attachment.fileType || "").toLowerCase();
|
|
182
|
+
if (mime.startsWith("text/") || /json|yaml|xml|javascript|toml/.test(mime)) return true;
|
|
183
|
+
return isTextFile({ name: attachment.fileName });
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function attachmentPreviewFile(attachment: AttachmentItem): PreviewFile {
|
|
187
|
+
return {
|
|
188
|
+
name: attachment.fileName,
|
|
189
|
+
meta: attachment.formattedSize || formatFileSize(attachment.fileSize),
|
|
190
|
+
url: attachment.fileUrl,
|
|
191
|
+
kind: "text",
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
178
195
|
function getFileExtension(attachment: AttachmentItem): string {
|
|
179
196
|
const name = attachment.fileName || "";
|
|
180
197
|
const dot = name.lastIndexOf(".");
|
|
@@ -305,6 +322,7 @@ interface AttachmentRowProps {
|
|
|
305
322
|
previewLabel: string;
|
|
306
323
|
downloadLabel: string;
|
|
307
324
|
removeLabel: string;
|
|
325
|
+
selected: boolean;
|
|
308
326
|
onAttachmentClick?: (attachment: AttachmentItem) => void;
|
|
309
327
|
onPreview: (attachment: AttachmentItem) => void;
|
|
310
328
|
onDownload: (attachment: AttachmentItem) => void;
|
|
@@ -330,6 +348,7 @@ function AttachmentRow({
|
|
|
330
348
|
previewLabel,
|
|
331
349
|
downloadLabel,
|
|
332
350
|
removeLabel,
|
|
351
|
+
selected,
|
|
333
352
|
onAttachmentClick,
|
|
334
353
|
onPreview,
|
|
335
354
|
onDownload,
|
|
@@ -345,7 +364,8 @@ function AttachmentRow({
|
|
|
345
364
|
const ext = getFileExtension(attachment);
|
|
346
365
|
const iconSize = small ? 14 : 16;
|
|
347
366
|
const position = getGroupPosition(index, count);
|
|
348
|
-
const corners = stackRadiusProps(position, knobProps.containerRadius.borderRadius);
|
|
367
|
+
const corners = stackRadiusProps(position, selected ? 0 : knobProps.containerRadius.borderRadius);
|
|
368
|
+
const metaInk = selected ? componentColors.selection.ink : componentColors.text.subtle;
|
|
349
369
|
|
|
350
370
|
const actions = {
|
|
351
371
|
onPreview: () => onPreview(attachment),
|
|
@@ -381,7 +401,7 @@ function AttachmentRow({
|
|
|
381
401
|
|
|
382
402
|
const actionButtons = (
|
|
383
403
|
<XStack gap="$1" alignItems="center">
|
|
384
|
-
{enablePreview && isImage && (
|
|
404
|
+
{enablePreview && (isImage || isTextAttachment(attachment)) && (
|
|
385
405
|
<Button
|
|
386
406
|
size="$2"
|
|
387
407
|
chromeless
|
|
@@ -437,15 +457,23 @@ function AttachmentRow({
|
|
|
437
457
|
overflow="hidden"
|
|
438
458
|
cursor="pointer"
|
|
439
459
|
{...corners}
|
|
460
|
+
{...(selected
|
|
461
|
+
? ({
|
|
462
|
+
backgroundColor: componentColors.selection.background,
|
|
463
|
+
"data-selected": true,
|
|
464
|
+
} as Record<string, unknown>)
|
|
465
|
+
: null)}
|
|
440
466
|
{...transitionProps(knobProps.motion.control)}
|
|
441
467
|
hoverStyle={{
|
|
442
468
|
backgroundColor: componentColors.interactive.background,
|
|
443
469
|
...control.hoverKnobProps,
|
|
470
|
+
...(selected ? { backgroundColor: componentColors.selection.hover } : null),
|
|
444
471
|
...corners,
|
|
445
472
|
}}
|
|
446
473
|
pressStyle={{
|
|
447
474
|
backgroundColor: componentColors.interactive.hover,
|
|
448
475
|
...control.pressKnobProps,
|
|
476
|
+
...(selected ? { backgroundColor: componentColors.selection.press } : null),
|
|
449
477
|
...corners,
|
|
450
478
|
}}
|
|
451
479
|
{...(kbFocus ? ensureFocusVisibleRing({ outlineOffset: -2 }) : { outlineWidth: 0 })}
|
|
@@ -470,10 +498,10 @@ function AttachmentRow({
|
|
|
470
498
|
</Text>
|
|
471
499
|
{ext ? (
|
|
472
500
|
<>
|
|
473
|
-
<Text fontSize="$2" color={
|
|
501
|
+
<Text fontSize="$2" color={metaInk}>
|
|
474
502
|
·
|
|
475
503
|
</Text>
|
|
476
|
-
<Text fontSize="$2" color={
|
|
504
|
+
<Text fontSize="$2" color={metaInk}>
|
|
477
505
|
{ext}
|
|
478
506
|
</Text>
|
|
479
507
|
</>
|
|
@@ -533,6 +561,7 @@ export function Attachments({
|
|
|
533
561
|
const LabelTag = small ? Label : SizableText;
|
|
534
562
|
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
535
563
|
const [previewFile, setPreviewFile] = useState<AttachmentItem | null>(null);
|
|
564
|
+
const viewerHost = useFileViewerHost();
|
|
536
565
|
const [uploadError, setUploadError] = useState<string | null>(null);
|
|
537
566
|
const [dragOver, setDragOver] = useState(false);
|
|
538
567
|
useReturnFocusOnClose(!!previewFile);
|
|
@@ -586,9 +615,16 @@ export function Attachments({
|
|
|
586
615
|
[acceptFile],
|
|
587
616
|
);
|
|
588
617
|
|
|
589
|
-
const handlePreview = useCallback(
|
|
590
|
-
|
|
591
|
-
|
|
618
|
+
const handlePreview = useCallback(
|
|
619
|
+
(attachment: AttachmentItem) => {
|
|
620
|
+
if (viewerHost && isTextAttachment(attachment)) {
|
|
621
|
+
viewerHost.open(attachmentPreviewFile(attachment));
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
setPreviewFile(attachment);
|
|
625
|
+
},
|
|
626
|
+
[viewerHost],
|
|
627
|
+
);
|
|
592
628
|
|
|
593
629
|
const handleDownload = useCallback(
|
|
594
630
|
(attachment: AttachmentItem) => {
|
|
@@ -758,6 +794,12 @@ export function Attachments({
|
|
|
758
794
|
previewLabel={previewLabel}
|
|
759
795
|
downloadLabel={downloadLabel}
|
|
760
796
|
removeLabel={removeLabel}
|
|
797
|
+
selected={
|
|
798
|
+
previewFile?.id === attachment.id ||
|
|
799
|
+
(viewerHost?.file != null &&
|
|
800
|
+
isTextAttachment(attachment) &&
|
|
801
|
+
viewerHost.file.url === attachment.fileUrl)
|
|
802
|
+
}
|
|
761
803
|
onAttachmentClick={onAttachmentClick}
|
|
762
804
|
onPreview={handlePreview}
|
|
763
805
|
onDownload={handleDownload}
|
|
@@ -768,7 +810,17 @@ export function Attachments({
|
|
|
768
810
|
</YStack>
|
|
769
811
|
</AsyncBoundary>
|
|
770
812
|
|
|
771
|
-
<
|
|
813
|
+
<FileViewer
|
|
814
|
+
file={
|
|
815
|
+
previewFile && isTextAttachment(previewFile) ? attachmentPreviewFile(previewFile) : null
|
|
816
|
+
}
|
|
817
|
+
open={!!previewFile && isTextAttachment(previewFile)}
|
|
818
|
+
onOpenChange={(open) => !open && setPreviewFile(null)}
|
|
819
|
+
/>
|
|
820
|
+
<Dialog
|
|
821
|
+
open={!!previewFile && !isTextAttachment(previewFile)}
|
|
822
|
+
onOpenChange={(open) => !open && setPreviewFile(null)}
|
|
823
|
+
>
|
|
772
824
|
<Dialog.Portal>
|
|
773
825
|
<DialogOverlay opacity={0.5} />
|
|
774
826
|
<DialogContent maxWidth={800} maxHeight="80vh">
|