@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
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { transitionProps, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
|
|
3
|
+
import { TextInput, type GestureResponderEvent } from "react-native";
|
|
4
|
+
import { YStack } from "tamagui";
|
|
5
|
+
import { useHoldCue } from "@multiplatform.one/forms";
|
|
6
|
+
import { createTapGate, selectableField } from "./tapGate";
|
|
7
|
+
|
|
8
|
+
export { holdSelectMs, selectableField } from "./tapGate";
|
|
9
|
+
|
|
10
|
+
export interface HoldSelectProps {
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
/** A double tap on the text, which selects nothing. */
|
|
13
|
+
onDoubleTap?: () => void;
|
|
14
|
+
testID?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** A touch that travels this far is a scroll or a drag, not a tap. */
|
|
18
|
+
const tapSlop = 10;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* LC-285 SELECT-ON-HOLD on a phone: the text sits in a read-only text view,
|
|
22
|
+
* which selects with the system handles on a long press. After a tap the
|
|
23
|
+
* wrapper takes touches for the double-tap window, so the second tap never
|
|
24
|
+
* reaches the text view and goes to `onDoubleTap`. The LC-197 hold cue runs
|
|
25
|
+
* while a touch is held.
|
|
26
|
+
*/
|
|
27
|
+
export function HoldSelect({ children, onDoubleTap, testID }: HoldSelectProps) {
|
|
28
|
+
const { knobProps } = useResolvedKnobs();
|
|
29
|
+
const hold = useHoldCue();
|
|
30
|
+
const field = useRef<TextInput | null>(null);
|
|
31
|
+
const [shut, setShut] = useState(false);
|
|
32
|
+
const double = useRef(onDoubleTap);
|
|
33
|
+
double.current = onDoubleTap;
|
|
34
|
+
const gate = useMemo(
|
|
35
|
+
() =>
|
|
36
|
+
createTapGate({
|
|
37
|
+
setShut,
|
|
38
|
+
onDoubleTap: () => double.current?.(),
|
|
39
|
+
clearSelection: () => {
|
|
40
|
+
field.current?.setSelection?.(0, 0);
|
|
41
|
+
field.current?.blur?.();
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
[],
|
|
45
|
+
);
|
|
46
|
+
useEffect(() => () => gate.dispose(), [gate]);
|
|
47
|
+
const origin = useRef({ x: 0, y: 0, moved: false });
|
|
48
|
+
return (
|
|
49
|
+
<YStack
|
|
50
|
+
minWidth={0}
|
|
51
|
+
collapsable={false}
|
|
52
|
+
pointerEvents={shut ? "box-only" : "auto"}
|
|
53
|
+
data-hold={hold.holding ? "progress" : undefined}
|
|
54
|
+
testID={testID}
|
|
55
|
+
{...transitionProps(knobProps.motion.control)}
|
|
56
|
+
{...(hold.holding ? { scale: 0.97 } : {})}
|
|
57
|
+
{...({
|
|
58
|
+
onTouchStart: (event: GestureResponderEvent) => {
|
|
59
|
+
const { pageX, pageY } = event.nativeEvent;
|
|
60
|
+
origin.current = { x: pageX, y: pageY, moved: false };
|
|
61
|
+
gate.start();
|
|
62
|
+
hold.start();
|
|
63
|
+
},
|
|
64
|
+
onTouchMove: (event: GestureResponderEvent) => {
|
|
65
|
+
const { pageX, pageY } = event.nativeEvent;
|
|
66
|
+
if (Math.hypot(pageX - origin.current.x, pageY - origin.current.y) > tapSlop) {
|
|
67
|
+
origin.current.moved = true;
|
|
68
|
+
hold.stop();
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
onTouchEnd: () => {
|
|
72
|
+
hold.stop();
|
|
73
|
+
gate.end(origin.current.moved);
|
|
74
|
+
},
|
|
75
|
+
onTouchCancel: () => {
|
|
76
|
+
hold.stop();
|
|
77
|
+
gate.end(true);
|
|
78
|
+
},
|
|
79
|
+
} as object)}
|
|
80
|
+
>
|
|
81
|
+
<TextInput ref={field} {...selectableField} style={{ padding: 0 }}>
|
|
82
|
+
{children}
|
|
83
|
+
</TextInput>
|
|
84
|
+
</YStack>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { transitionProps, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { YStack } from "tamagui";
|
|
4
|
+
import { useHoldCue } from "@multiplatform.one/forms";
|
|
5
|
+
|
|
6
|
+
export { holdSelectMs, selectableField } from "./tapGate";
|
|
7
|
+
|
|
8
|
+
export interface HoldSelectProps {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
/** A double tap (a double click on the web) on the text, which selects nothing. */
|
|
11
|
+
onDoubleTap?: () => void;
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type WebMouse = { nativeEvent: { detail?: number }; preventDefault?: () => void };
|
|
16
|
+
type WebPointer = { nativeEvent: { pointerType?: string } };
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* LC-285 SELECT-ON-HOLD: read-only text that selects on a hold only. On the
|
|
20
|
+
* web a mouse drags a selection as always; a double click selects nothing and
|
|
21
|
+
* goes to `onDoubleTap`; a touch shows the LC-197 hold cue while the browser's
|
|
22
|
+
* own long press selects.
|
|
23
|
+
*/
|
|
24
|
+
export function HoldSelect({ children, onDoubleTap, testID }: HoldSelectProps) {
|
|
25
|
+
const { knobProps } = useResolvedKnobs();
|
|
26
|
+
const hold = useHoldCue();
|
|
27
|
+
return (
|
|
28
|
+
<YStack
|
|
29
|
+
minWidth={0}
|
|
30
|
+
data-hold-select=""
|
|
31
|
+
data-hold={hold.holding ? "progress" : undefined}
|
|
32
|
+
testID={testID}
|
|
33
|
+
{...transitionProps(knobProps.motion.control)}
|
|
34
|
+
{...(hold.holding ? { scale: 0.97 } : {})}
|
|
35
|
+
{...({
|
|
36
|
+
onMouseDown: (event: WebMouse) => {
|
|
37
|
+
if ((event.nativeEvent.detail ?? 0) > 1) event.preventDefault?.();
|
|
38
|
+
},
|
|
39
|
+
onClick: (event: WebMouse) => {
|
|
40
|
+
if (event.nativeEvent.detail === 2) onDoubleTap?.();
|
|
41
|
+
},
|
|
42
|
+
onPointerDown: (event: WebPointer) => {
|
|
43
|
+
if (event.nativeEvent.pointerType === "touch") hold.start();
|
|
44
|
+
},
|
|
45
|
+
onPointerUp: hold.stop,
|
|
46
|
+
onPointerCancel: hold.stop,
|
|
47
|
+
onPointerLeave: hold.stop,
|
|
48
|
+
} as object)}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
</YStack>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { doubleTapMs } from "../../Lightbox/shared";
|
|
2
|
+
|
|
3
|
+
/** LC-285: a touch held this long without moving is a hold, which selects. */
|
|
4
|
+
export const holdSelectMs = 450;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The native view's fixed props: a read-only text view (a UITextView on iOS)
|
|
8
|
+
* that grows with its text, keeps the system's handles, loupe and Copy, and
|
|
9
|
+
* cannot be typed into. `selectable` Text answers a long press with one Copy of
|
|
10
|
+
* its whole text instead.
|
|
11
|
+
*/
|
|
12
|
+
export const selectableField = {
|
|
13
|
+
editable: false,
|
|
14
|
+
multiline: true,
|
|
15
|
+
scrollEnabled: false,
|
|
16
|
+
caretHidden: true,
|
|
17
|
+
contextMenuHidden: false,
|
|
18
|
+
spellCheck: false,
|
|
19
|
+
autoCorrect: false,
|
|
20
|
+
showSoftInputOnFocus: false,
|
|
21
|
+
dataDetectorTypes: "none",
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
export type TapResult = "tap" | "double" | "hold";
|
|
25
|
+
|
|
26
|
+
export interface TapGateOptions {
|
|
27
|
+
onDoubleTap?: () => void;
|
|
28
|
+
/** Drops any selection the text view started on the double tap's first touch. */
|
|
29
|
+
clearSelection?: () => void;
|
|
30
|
+
/** True for the double-tap window: the wrapper takes the touch, so the text view never sees it. */
|
|
31
|
+
setShut: (shut: boolean) => void;
|
|
32
|
+
now?: () => number;
|
|
33
|
+
schedule?: (run: () => void, ms: number) => unknown;
|
|
34
|
+
cancel?: (handle: unknown) => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Reads touches on code text: a short touch is a tap, two inside the
|
|
39
|
+
* double-tap window are a double tap for the app, and a touch held past
|
|
40
|
+
* `holdSelectMs` (or dragged) is left to the text view, which selects.
|
|
41
|
+
*/
|
|
42
|
+
export function createTapGate({
|
|
43
|
+
onDoubleTap,
|
|
44
|
+
clearSelection,
|
|
45
|
+
setShut,
|
|
46
|
+
now = Date.now,
|
|
47
|
+
schedule = setTimeout,
|
|
48
|
+
cancel = (handle) => clearTimeout(handle as ReturnType<typeof setTimeout>),
|
|
49
|
+
}: TapGateOptions) {
|
|
50
|
+
let startedAt = 0;
|
|
51
|
+
let lastTap = Number.NEGATIVE_INFINITY;
|
|
52
|
+
let reopen: unknown;
|
|
53
|
+
const close = (shut: boolean) => {
|
|
54
|
+
if (reopen !== undefined) cancel(reopen);
|
|
55
|
+
reopen = undefined;
|
|
56
|
+
setShut(shut);
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
start() {
|
|
60
|
+
startedAt = now();
|
|
61
|
+
},
|
|
62
|
+
end(moved = false): TapResult {
|
|
63
|
+
const at = now();
|
|
64
|
+
if (moved || at - startedAt >= holdSelectMs) {
|
|
65
|
+
lastTap = Number.NEGATIVE_INFINITY;
|
|
66
|
+
return "hold";
|
|
67
|
+
}
|
|
68
|
+
if (at - lastTap < doubleTapMs) {
|
|
69
|
+
lastTap = Number.NEGATIVE_INFINITY;
|
|
70
|
+
close(false);
|
|
71
|
+
clearSelection?.();
|
|
72
|
+
onDoubleTap?.();
|
|
73
|
+
return "double";
|
|
74
|
+
}
|
|
75
|
+
lastTap = at;
|
|
76
|
+
close(true);
|
|
77
|
+
reopen = schedule(() => {
|
|
78
|
+
reopen = undefined;
|
|
79
|
+
setShut(false);
|
|
80
|
+
}, doubleTapMs);
|
|
81
|
+
return "tap";
|
|
82
|
+
},
|
|
83
|
+
dispose() {
|
|
84
|
+
if (reopen !== undefined) cancel(reopen);
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { act, fireEvent } from "@testing-library/react";
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
4
|
+
import { LogView, type LogEntry } from "./LogView";
|
|
5
|
+
|
|
6
|
+
const viewport = 200;
|
|
7
|
+
const rowHeight = 20;
|
|
8
|
+
|
|
9
|
+
function entries(count: number): LogEntry[] {
|
|
10
|
+
return Array.from({ length: count }, (_, i) => ({
|
|
11
|
+
id: String(i),
|
|
12
|
+
time: "2026-11-03T12:00:00Z",
|
|
13
|
+
message: `line ${i}`,
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function scroller(container: HTMLElement): HTMLElement {
|
|
18
|
+
const log = container.querySelector("[data-log-view]") as HTMLElement;
|
|
19
|
+
const node = [...log.querySelectorAll<HTMLElement>("*")].find(
|
|
20
|
+
(el) =>
|
|
21
|
+
getComputedStyle(el).overflowY === "auto" || getComputedStyle(el).overflowY === "scroll",
|
|
22
|
+
);
|
|
23
|
+
expect(node).toBeTruthy();
|
|
24
|
+
return node as HTMLElement;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function size(node: HTMLElement, rows: number) {
|
|
28
|
+
Object.defineProperty(node, "clientHeight", { configurable: true, value: viewport });
|
|
29
|
+
Object.defineProperty(node, "offsetHeight", { configurable: true, value: viewport });
|
|
30
|
+
Object.defineProperty(node, "scrollHeight", { configurable: true, value: rows * rowHeight });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function scrollTo(node: HTMLElement, top: number) {
|
|
34
|
+
node.scrollTop = top;
|
|
35
|
+
fireEvent.scroll(node);
|
|
36
|
+
act(() => vi.advanceTimersByTime(150));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function bottom(rows: number) {
|
|
40
|
+
return rows * rowHeight - viewport;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
describe("LogView follow is sticky (LC-167)", () => {
|
|
44
|
+
beforeEach(() => vi.useFakeTimers());
|
|
45
|
+
afterEach(() => vi.useRealTimers());
|
|
46
|
+
|
|
47
|
+
it("keeps the reader's place when lines arrive after they scrolled up", () => {
|
|
48
|
+
const { container, rerender } = renderWithProviders(
|
|
49
|
+
<LogView label="Worker log" entries={entries(50)} />,
|
|
50
|
+
);
|
|
51
|
+
const node = scroller(container);
|
|
52
|
+
size(node, 50);
|
|
53
|
+
scrollTo(node, bottom(50));
|
|
54
|
+
scrollTo(node, 300);
|
|
55
|
+
|
|
56
|
+
size(node, 60);
|
|
57
|
+
act(() => rerender(<LogView label="Worker log" entries={entries(60)} />));
|
|
58
|
+
|
|
59
|
+
expect(node.scrollTop).toBe(300);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("follows new lines while the reader is at the end", () => {
|
|
63
|
+
const { container, rerender } = renderWithProviders(
|
|
64
|
+
<LogView label="Worker log" entries={entries(50)} />,
|
|
65
|
+
);
|
|
66
|
+
const node = scroller(container);
|
|
67
|
+
size(node, 50);
|
|
68
|
+
scrollTo(node, bottom(50));
|
|
69
|
+
|
|
70
|
+
size(node, 60);
|
|
71
|
+
act(() => rerender(<LogView label="Worker log" entries={entries(60)} />));
|
|
72
|
+
|
|
73
|
+
expect(node.scrollTop).toBeGreaterThanOrEqual(bottom(60));
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("picks following back up when the reader returns to the end", () => {
|
|
77
|
+
const { container, rerender } = renderWithProviders(
|
|
78
|
+
<LogView label="Worker log" entries={entries(50)} />,
|
|
79
|
+
);
|
|
80
|
+
const node = scroller(container);
|
|
81
|
+
size(node, 50);
|
|
82
|
+
scrollTo(node, 300);
|
|
83
|
+
scrollTo(node, bottom(50) - 30);
|
|
84
|
+
|
|
85
|
+
size(node, 60);
|
|
86
|
+
act(() => rerender(<LogView label="Worker log" entries={entries(60)} />));
|
|
87
|
+
|
|
88
|
+
expect(node.scrollTop).toBeGreaterThanOrEqual(bottom(60));
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("never follows when follow is off", () => {
|
|
92
|
+
const { container, rerender } = renderWithProviders(
|
|
93
|
+
<LogView label="Worker log" entries={entries(50)} follow={false} />,
|
|
94
|
+
);
|
|
95
|
+
const node = scroller(container);
|
|
96
|
+
size(node, 50);
|
|
97
|
+
scrollTo(node, bottom(50));
|
|
98
|
+
|
|
99
|
+
size(node, 60);
|
|
100
|
+
act(() => rerender(<LogView label="Worker log" entries={entries(60)} follow={false} />));
|
|
101
|
+
|
|
102
|
+
expect(node.scrollTop).toBe(bottom(50));
|
|
103
|
+
});
|
|
104
|
+
});
|
package/src/code/LogView.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useLayoutSizeClass, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Text, View, XStack, YStack, useTheme, type YStackProps } from "tamagui";
|
|
4
4
|
import { WarningIcon, XCircleIcon } from "@phosphor-icons/react";
|
|
5
|
+
import { ScrollView } from "../ScrollView";
|
|
5
6
|
|
|
6
7
|
export type LogLevel = "debug" | "info" | "warn" | "error";
|
|
7
8
|
|
|
@@ -20,10 +21,21 @@ export interface LogViewProps extends Omit<YStackProps, "children"> {
|
|
|
20
21
|
entries: readonly LogEntry[];
|
|
21
22
|
/** Names the log for assistive tech ("Sync worker log"). */
|
|
22
23
|
label: string;
|
|
23
|
-
/** Keep the newest entry in view as entries arrive. Default: true. */
|
|
24
|
+
/** Keep the newest entry in view as entries arrive, while the reader is at the end. Default: true. */
|
|
24
25
|
follow?: boolean;
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
/** How close to the end, in px, the reader must be for new lines to follow (LC-167). */
|
|
29
|
+
export const logFollowSlop = 40;
|
|
30
|
+
|
|
31
|
+
interface ScrollMetrics {
|
|
32
|
+
nativeEvent: {
|
|
33
|
+
contentOffset: { y: number };
|
|
34
|
+
contentSize: { height: number };
|
|
35
|
+
layoutMeasurement: { height: number };
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
27
39
|
const levelInk = { warn: "yellow11", error: "red11" } as const;
|
|
28
40
|
const levelGlyph = { warn: WarningIcon, error: XCircleIcon } as const;
|
|
29
41
|
|
|
@@ -49,13 +61,26 @@ export function LogView({ entries, label, follow = true, ...rest }: LogViewProps
|
|
|
49
61
|
const scroller = useRef<{ scrollToEnd?: (options?: { animated?: boolean }) => void } | null>(
|
|
50
62
|
null,
|
|
51
63
|
);
|
|
64
|
+
const atEnd = useRef(true);
|
|
52
65
|
useEffect(() => {
|
|
53
|
-
if (follow) scroller.current?.scrollToEnd?.({ animated: false });
|
|
66
|
+
if (follow && atEnd.current) scroller.current?.scrollToEnd?.({ animated: false });
|
|
54
67
|
}, [entries, follow]);
|
|
55
68
|
|
|
56
69
|
return (
|
|
57
70
|
<YStack flex={1} minHeight={0} data-log-view="" role="log" aria-label={label} {...rest}>
|
|
58
|
-
<ScrollView
|
|
71
|
+
<ScrollView
|
|
72
|
+
ref={scroller as never}
|
|
73
|
+
flex={1}
|
|
74
|
+
keyboardShouldPersistTaps="handled"
|
|
75
|
+
scrollEventThrottle={16}
|
|
76
|
+
onScroll={({ nativeEvent }: ScrollMetrics) => {
|
|
77
|
+
const remaining =
|
|
78
|
+
nativeEvent.contentSize.height -
|
|
79
|
+
nativeEvent.contentOffset.y -
|
|
80
|
+
nativeEvent.layoutMeasurement.height;
|
|
81
|
+
atEnd.current = remaining <= logFollowSlop;
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
59
84
|
<YStack
|
|
60
85
|
{...knobProps.panelPadding}
|
|
61
86
|
{...(compact ? null : { paddingHorizontal: 0 })}
|
package/src/code/index.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { componentColors } from "./componentColors";
|
|
|
5
5
|
describe("shared selection and mark channels", () => {
|
|
6
6
|
it("uses the same neutral selection tier in components and forms", () => {
|
|
7
7
|
expect(componentColors.selection).toEqual({
|
|
8
|
-
background: "$
|
|
9
|
-
hover: "$
|
|
10
|
-
press: "$
|
|
8
|
+
background: "$selectFill",
|
|
9
|
+
hover: "$selectPress",
|
|
10
|
+
press: "$selectPress",
|
|
11
11
|
ink: "$color12",
|
|
12
12
|
ring: "$color8",
|
|
13
13
|
});
|
package/src/componentColors.ts
CHANGED
|
@@ -27,7 +27,8 @@ export const componentColors = {
|
|
|
27
27
|
/** Interactive element states (buttons, clickable items, hover/press) */
|
|
28
28
|
interactive: {
|
|
29
29
|
background: "$color3",
|
|
30
|
-
|
|
30
|
+
// `$color4` on a page, one step above a dark card's own fill (FZ-8400).
|
|
31
|
+
hover: "$selectFill",
|
|
31
32
|
active: "$color5",
|
|
32
33
|
border: "$color7",
|
|
33
34
|
},
|
|
@@ -39,9 +40,9 @@ export const componentColors = {
|
|
|
39
40
|
* edge or drop line. Same values as forms' formSelectionColors.
|
|
40
41
|
*/
|
|
41
42
|
selection: {
|
|
42
|
-
background: "$
|
|
43
|
-
hover: "$
|
|
44
|
-
press: "$
|
|
43
|
+
background: "$selectFill",
|
|
44
|
+
hover: "$selectPress",
|
|
45
|
+
press: "$selectPress",
|
|
45
46
|
ink: "$color12",
|
|
46
47
|
ring: "$color8",
|
|
47
48
|
},
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @vitest-environment jsdom
|
|
3
3
|
*
|
|
4
4
|
* FZ-7944. A Panel or an elevated Card that paints the dark elevated tint
|
|
5
|
-
* (`$
|
|
6
|
-
* step up (`$
|
|
5
|
+
* (`$color5`) marks its content elevated, so a neutral Button on it washes one
|
|
6
|
+
* step up (`$color6`) instead of vanishing into the ground. Nested under a
|
|
7
7
|
* painted parent they paint no tint, and the content wash stays.
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -49,9 +49,9 @@ describe("FZ-7944: frames that paint the elevated ground", () => {
|
|
|
49
49
|
</Card>
|
|
50
50
|
</>,
|
|
51
51
|
);
|
|
52
|
-
expect(restFill("InPanel")).toEqual(["_bg-
|
|
53
|
-
expect(restFill("InElevatedCard")).toEqual(["_bg-
|
|
54
|
-
expect(restFill("InContentCard")).toEqual(["_bg-
|
|
52
|
+
expect(restFill("InPanel")).toEqual(["_bg-color6"]);
|
|
53
|
+
expect(restFill("InElevatedCard")).toEqual(["_bg-color6"]);
|
|
54
|
+
expect(restFill("InContentCard")).toEqual(["_bg-color5"]);
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
it("nested under a painted parent they paint no tint and keep the content wash", () => {
|
|
@@ -65,7 +65,7 @@ describe("FZ-7944: frames that paint the elevated ground", () => {
|
|
|
65
65
|
</Card>
|
|
66
66
|
</Card>,
|
|
67
67
|
);
|
|
68
|
-
expect(restFill("NestedPanel")).toEqual(["_bg-
|
|
69
|
-
expect(restFill("NestedElevatedCard")).toEqual(["_bg-
|
|
68
|
+
expect(restFill("NestedPanel")).toEqual(["_bg-color5"]);
|
|
69
|
+
expect(restFill("NestedElevatedCard")).toEqual(["_bg-color5"]);
|
|
70
70
|
});
|
|
71
71
|
});
|
|
@@ -17,17 +17,19 @@ describe("asyncFailure copy from a reason (FZ-8045, LC-204)", () => {
|
|
|
17
17
|
it("names the subject, the cause and the next step", () => {
|
|
18
18
|
expect(asyncFailure({ subject: "Races", reason: "query_timeout", retry: true })).toEqual({
|
|
19
19
|
title: "Races didn't load",
|
|
20
|
-
description: "The server took too long
|
|
20
|
+
description: "The server took too long.",
|
|
21
21
|
retry: true,
|
|
22
|
+
signIn: false,
|
|
22
23
|
refusal: false,
|
|
23
24
|
});
|
|
24
25
|
});
|
|
25
26
|
|
|
26
|
-
it("
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.description,
|
|
30
|
-
|
|
27
|
+
it("shows the cause alone next to a Retry button, never how to use it", () => {
|
|
28
|
+
for (const live of [false, true]) {
|
|
29
|
+
expect(
|
|
30
|
+
asyncFailure({ subject: "Races", reason: "source_busy", retry: true, live }).description,
|
|
31
|
+
).toBe("The server is busy.");
|
|
32
|
+
}
|
|
31
33
|
});
|
|
32
34
|
|
|
33
35
|
it("states there is no action when the view has no Retry", () => {
|
|
@@ -40,28 +42,46 @@ describe("asyncFailure copy from a reason (FZ-8045, LC-204)", () => {
|
|
|
40
42
|
for (const reason of ["click_house_timeout", "weird_code_42", "failed"]) {
|
|
41
43
|
const copy = asyncFailure({ subject: "Races", reason, retry: true });
|
|
42
44
|
expect(copy.description).not.toContain(reason);
|
|
43
|
-
expect(copy.description).toMatch(
|
|
45
|
+
expect(copy.description).toMatch(/^The server [^.]+\.$/);
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
48
|
|
|
47
49
|
it.each([
|
|
48
|
-
["query_too_large", "
|
|
49
|
-
["credentials_refused", "The server
|
|
50
|
-
["session_expired", "Your session ended."],
|
|
51
|
-
])("drops Retry for %s, which retrying can't fix", (reason,
|
|
50
|
+
["query_too_large", "Too much to load at once."],
|
|
51
|
+
["credentials_refused", "The server can't sign in to its data. Ask an admin."],
|
|
52
|
+
["session_expired", "Your session ended. Log in again."],
|
|
53
|
+
])("drops Retry for %s, which retrying can't fix", (reason, description) => {
|
|
52
54
|
const copy = asyncFailure({ subject: "Races", reason, retry: true });
|
|
53
55
|
expect(copy.retry).toBe(false);
|
|
54
|
-
expect(copy.description
|
|
55
|
-
|
|
56
|
+
expect(copy.description).toBe(description);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("offers Log in for an ended session when the view can sign in", () => {
|
|
60
|
+
expect(
|
|
61
|
+
asyncFailure({ subject: "Races", reason: "session_expired", retry: true, signIn: true }),
|
|
62
|
+
).toEqual({
|
|
63
|
+
title: "Races didn't load",
|
|
64
|
+
description: "Your session ended.",
|
|
65
|
+
retry: false,
|
|
66
|
+
signIn: true,
|
|
67
|
+
refusal: false,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("never offers Log in for a failure that isn't an ended session", () => {
|
|
72
|
+
expect(asyncFailure({ subject: "Races", reason: "source_down", signIn: true }).signIn).toBe(
|
|
73
|
+
false,
|
|
74
|
+
);
|
|
56
75
|
});
|
|
57
76
|
|
|
58
77
|
it("routes a permission refusal to a neutral state", () => {
|
|
59
78
|
expect(
|
|
60
79
|
asyncFailure({ subject: "Approvals", reason: "permission_denied", retry: true }),
|
|
61
80
|
).toEqual({
|
|
62
|
-
title: "
|
|
63
|
-
description: "Ask an admin
|
|
81
|
+
title: "No access to Approvals",
|
|
82
|
+
description: "Ask an admin.",
|
|
64
83
|
retry: false,
|
|
84
|
+
signIn: false,
|
|
65
85
|
refusal: true,
|
|
66
86
|
});
|
|
67
87
|
});
|
|
@@ -73,7 +93,7 @@ describe("asyncFailure copy from a reason (FZ-8045, LC-204)", () => {
|
|
|
73
93
|
retry: true,
|
|
74
94
|
reasons: { source_unreachable: { cause: "Pelt can't reach its database." } },
|
|
75
95
|
});
|
|
76
|
-
expect(copy.description).toBe("Pelt can't reach its database.
|
|
96
|
+
expect(copy.description).toBe("Pelt can't reach its database.");
|
|
77
97
|
});
|
|
78
98
|
});
|
|
79
99
|
|
|
@@ -83,18 +103,14 @@ describe("AsyncBoundary reason (FZ-8045, LC-204)", () => {
|
|
|
83
103
|
<AsyncBoundary error reason="click_house_timeout" subject="Races" onRetry={() => {}} />,
|
|
84
104
|
);
|
|
85
105
|
expect(screen.getByText("Races didn't load")).toBeInTheDocument();
|
|
86
|
-
expect(
|
|
87
|
-
screen.getByText("The server took too long to answer. Tap Retry to try again."),
|
|
88
|
-
).toBeInTheDocument();
|
|
106
|
+
expect(screen.getByText("The server took too long.")).toBeInTheDocument();
|
|
89
107
|
expect(screen.queryByText(/click_house_timeout/)).toBeNull();
|
|
90
108
|
});
|
|
91
109
|
|
|
92
110
|
it("reads a code-shaped error string as its reason", () => {
|
|
93
111
|
renderWithProviders(<AsyncBoundary error="click_house_timeout" onRetry={() => {}} />);
|
|
94
112
|
expect(screen.queryByText("click_house_timeout")).toBeNull();
|
|
95
|
-
expect(
|
|
96
|
-
screen.getByText("The server took too long to answer. Tap Retry to try again."),
|
|
97
|
-
).toBeInTheDocument();
|
|
113
|
+
expect(screen.getByText("The server took too long.")).toBeInTheDocument();
|
|
98
114
|
});
|
|
99
115
|
|
|
100
116
|
it("keeps a one-word message that names no reason as the description", () => {
|
|
@@ -116,11 +132,36 @@ describe("AsyncBoundary reason (FZ-8045, LC-204)", () => {
|
|
|
116
132
|
expect(screen.queryByText("Retry")).toBeNull();
|
|
117
133
|
});
|
|
118
134
|
|
|
135
|
+
it("renders Log in for an ended session when onSignIn is set", () => {
|
|
136
|
+
const onSignIn = vi.fn();
|
|
137
|
+
renderWithProviders(
|
|
138
|
+
<AsyncBoundary
|
|
139
|
+
error
|
|
140
|
+
reason="session_expired"
|
|
141
|
+
subject="Races"
|
|
142
|
+
onRetry={() => {}}
|
|
143
|
+
onSignIn={onSignIn}
|
|
144
|
+
/>,
|
|
145
|
+
);
|
|
146
|
+
expect(screen.getByText("Your session ended.")).toBeInTheDocument();
|
|
147
|
+
expect(screen.queryByText("Retry")).toBeNull();
|
|
148
|
+
fireEvent.click(screen.getByText("Log in"));
|
|
149
|
+
expect(onSignIn).toHaveBeenCalledTimes(1);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it("says to log in again when there is no onSignIn", () => {
|
|
153
|
+
renderWithProviders(<AsyncBoundary error reason="session_expired" subject="Races" />);
|
|
154
|
+
expect(screen.getByText("Your session ended. Log in again.")).toBeInTheDocument();
|
|
155
|
+
expect(screen.queryByText("Log in")).toBeNull();
|
|
156
|
+
});
|
|
157
|
+
|
|
119
158
|
it("renders a permission refusal as a neutral EmptyState with no Retry (LC-165)", () => {
|
|
120
159
|
renderWithProviders(
|
|
121
160
|
<AsyncBoundary error reason="forbidden" subject="Approvals" onRetry={() => {}} />,
|
|
122
161
|
);
|
|
123
|
-
expect(screen.getByText("
|
|
162
|
+
expect(screen.getByText("No access to Approvals")).toBeInTheDocument();
|
|
163
|
+
expect(screen.getByText("Ask an admin.")).toBeInTheDocument();
|
|
164
|
+
expect(document.querySelector('[data-async-state="refused"] svg')).toBeTruthy();
|
|
124
165
|
expect(document.querySelector('[data-async-state="refused"]')).toBeTruthy();
|
|
125
166
|
expect(document.querySelector('[data-empty-intent="neutral"]')).toBeTruthy();
|
|
126
167
|
expect(document.querySelector('[data-empty-intent="error"]')).toBeNull();
|