@multiplatform.one/components 9.12.0 → 9.13.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/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.cjs +4 -15
- package/dist/cjs/Avatar/index.native.js +4 -15
- 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 +2 -2
- 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.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 +14 -7
- package/dist/cjs/Lightbox/index.native.js.map +1 -1
- package/dist/cjs/Lightbox/shared.cjs +20 -0
- package/dist/cjs/Lightbox/shared.native.js +22 -0
- 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/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/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.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/SheetBodyRegion.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.native.js.map +1 -1
- package/dist/cjs/SheetModal/useSheetFrameFocus.native.js.map +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 +9 -2
- package/dist/cjs/Tabs/index.native.js +9 -2
- 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/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.native.js +1 -1
- 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.map +1 -1
- package/dist/cjs/appShell/Springboard.native.js +1 -1
- package/dist/cjs/appShell/Springboard.native.js.map +1 -1
- package/dist/cjs/appShell/SystemBar.native.js +1 -1
- 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/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.native.js.map +1 -1
- package/dist/cjs/appShell/systemBarFit.native.js.map +1 -1
- package/dist/cjs/canvas/index.cjs +20 -0
- package/dist/cjs/canvas/index.native.js +23 -0
- package/dist/cjs/canvas/index.native.js.map +1 -0
- package/dist/cjs/canvas/panBounds.cjs +76 -0
- package/dist/cjs/canvas/panBounds.native.js +83 -0
- package/dist/cjs/canvas/panBounds.native.js.map +1 -0
- 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 +1 -1
- 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/SeriesLegend.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.native.js +7 -7
- 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/tapGate.native.js.map +1 -1
- package/dist/cjs/code/LogView.native.js.map +1 -1
- package/dist/cjs/code/PayloadView/index.native.js +4 -4
- 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.native.js +7 -7
- package/dist/cjs/code/index.native.js.map +1 -1
- 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/SingleTaskColumn.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/useDirection.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.cjs +1 -0
- 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 -45
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/knobImmuneExports.native.js.map +1 -1
- package/dist/cjs/layouts/AsyncBoundary.native.js +2 -2
- 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.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.native.js.map +1 -1
- package/dist/cjs/layouts/attachments.native.js +2 -2
- 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.native.js +1 -1
- 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.native.js.map +1 -1
- package/dist/cjs/layouts/shellSidebarSlot.native.js.map +1 -1
- package/dist/cjs/layouts/sidebar.native.js.map +1 -1
- package/dist/cjs/layouts/tags.native.js +1 -1
- 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.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.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.cjs +281 -40
- package/dist/cjs/views/Calendar.native.js +291 -40
- 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.native.js +1 -1
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/FilePreview.native.js +2 -2
- package/dist/cjs/views/FilePreview.native.js.map +1 -1
- package/dist/cjs/views/Gantt.native.js +1 -1
- 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/List.native.js.map +1 -1
- package/dist/cjs/views/ListGroup.native.js +1 -1
- 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 +1 -1
- package/dist/cjs/views/Matrix.native.js.map +1 -1
- package/dist/cjs/views/ReportBuilder.native.js +1 -1
- 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.cjs +14 -0
- package/dist/cjs/views/calendarMath.native.js +14 -0
- 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.native.js +1 -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/Avatar/index.mjs +5 -15
- package/dist/esm/Avatar/index.mjs.map +1 -1
- package/dist/esm/Avatar/index.native.js +5 -15
- package/dist/esm/Avatar/index.native.js.map +1 -1
- package/dist/esm/Lightbox/index.native.js +14 -7
- package/dist/esm/Lightbox/index.native.js.map +1 -1
- package/dist/esm/Lightbox/shared.mjs +20 -1
- package/dist/esm/Lightbox/shared.mjs.map +1 -1
- package/dist/esm/Lightbox/shared.native.js +22 -1
- package/dist/esm/Lightbox/shared.native.js.map +1 -1
- package/dist/esm/Tabs/index.mjs +10 -3
- package/dist/esm/Tabs/index.mjs.map +1 -1
- package/dist/esm/Tabs/index.native.js +10 -3
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/canvas/index.mjs +2 -0
- package/dist/esm/canvas/index.mjs.map +1 -0
- package/dist/esm/canvas/index.native.js +2 -0
- package/dist/esm/canvas/index.native.js.map +1 -0
- package/dist/esm/canvas/panBounds.mjs +46 -0
- package/dist/esm/canvas/panBounds.mjs.map +1 -0
- package/dist/esm/canvas/panBounds.native.js +50 -0
- package/dist/esm/canvas/panBounds.native.js.map +1 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +1 -0
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/views/Calendar.mjs +283 -42
- package/dist/esm/views/Calendar.mjs.map +1 -1
- package/dist/esm/views/Calendar.native.js +293 -42
- package/dist/esm/views/Calendar.native.js.map +1 -1
- package/dist/esm/views/calendarMath.mjs +14 -1
- package/dist/esm/views/calendarMath.mjs.map +1 -1
- package/dist/esm/views/calendarMath.native.js +14 -1
- package/dist/esm/views/calendarMath.native.js.map +1 -1
- package/dist/jsx/Avatar/index.mjs +5 -15
- package/dist/jsx/Avatar/index.mjs.map +1 -1
- package/dist/jsx/Avatar/index.native.js +4 -15
- package/dist/jsx/Avatar/index.native.js.map +1 -1
- package/dist/jsx/Lightbox/index.native.js +13 -6
- package/dist/jsx/Lightbox/index.native.js.map +1 -1
- package/dist/jsx/Lightbox/shared.mjs +20 -1
- package/dist/jsx/Lightbox/shared.mjs.map +1 -1
- package/dist/jsx/Lightbox/shared.native.js +22 -0
- package/dist/jsx/Lightbox/shared.native.js.map +1 -1
- package/dist/jsx/Tabs/index.mjs +10 -3
- package/dist/jsx/Tabs/index.mjs.map +1 -1
- package/dist/jsx/Tabs/index.native.js +9 -2
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/canvas/index.mjs +2 -0
- package/dist/jsx/canvas/index.mjs.map +1 -0
- package/dist/jsx/canvas/index.native.js +23 -0
- package/dist/jsx/canvas/index.native.js.map +1 -0
- package/dist/jsx/canvas/panBounds.mjs +46 -0
- package/dist/jsx/canvas/panBounds.mjs.map +1 -0
- package/dist/jsx/canvas/panBounds.native.js +83 -0
- package/dist/jsx/canvas/panBounds.native.js.map +1 -0
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -0
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +1 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/views/Calendar.mjs +283 -42
- package/dist/jsx/views/Calendar.mjs.map +1 -1
- package/dist/jsx/views/Calendar.native.js +291 -40
- package/dist/jsx/views/Calendar.native.js.map +1 -1
- package/dist/jsx/views/calendarMath.mjs +14 -1
- package/dist/jsx/views/calendarMath.mjs.map +1 -1
- package/dist/jsx/views/calendarMath.native.js +14 -0
- package/dist/jsx/views/calendarMath.native.js.map +1 -1
- package/package.json +7 -7
- package/src/Avatar/Avatar.spec.tsx +7 -18
- package/src/Avatar/index.tsx +6 -34
- package/src/Lightbox/index.native.tsx +16 -5
- package/src/Lightbox/shared.spec.ts +39 -0
- package/src/Lightbox/shared.ts +23 -0
- package/src/Tabs/Tabs.gutter.spec.tsx +61 -1
- package/src/Tabs/Tabs.measurement.spec.tsx +4 -1
- package/src/Tabs/Tabs.stories.tsx +39 -0
- package/src/Tabs/index.tsx +18 -3
- package/src/canvas/index.ts +1 -0
- package/src/canvas/panBounds.spec.ts +95 -0
- package/src/canvas/panBounds.ts +84 -0
- package/src/index.ts +1 -0
- package/src/surfaces.spec.tsx +2 -2
- package/src/views/Calendar.eventFill.spec.tsx +118 -0
- package/src/views/Calendar.nativeResize.spec.tsx +233 -0
- package/src/views/Calendar.stories.tsx +3 -0
- package/src/views/Calendar.tsx +295 -33
- package/src/views/calendarMath.ts +21 -0
- package/src/views/dataIdentity.spec.tsx +4 -3
- package/types/Avatar/index.d.ts +2 -11
- package/types/Avatar/index.d.ts.map +1 -1
- package/types/Lightbox/index.native.d.ts.map +1 -1
- package/types/Lightbox/shared.d.ts +12 -0
- package/types/Lightbox/shared.d.ts.map +1 -1
- package/types/Tabs/index.d.ts.map +1 -1
- package/types/canvas/index.d.ts +2 -0
- package/types/canvas/index.d.ts.map +1 -0
- package/types/canvas/panBounds.d.ts +23 -0
- package/types/canvas/panBounds.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/views/Calendar.d.ts +7 -2
- package/types/views/Calendar.d.ts.map +1 -1
- package/types/views/calendarMath.d.ts +13 -0
- package/types/views/calendarMath.d.ts.map +1 -1
package/src/Avatar/index.tsx
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Children,
|
|
3
|
-
createContext,
|
|
4
|
-
isValidElement,
|
|
5
|
-
useContext,
|
|
6
|
-
type ReactElement,
|
|
7
|
-
type ReactNode,
|
|
8
|
-
} from "react";
|
|
1
|
+
import { Children, createContext, isValidElement, useContext, type ReactNode } from "react";
|
|
9
2
|
import { UserIcon } from "@phosphor-icons/react";
|
|
10
3
|
import {
|
|
11
4
|
MIN_PRESS_TARGET,
|
|
@@ -191,30 +184,11 @@ export function initialsMetrics(px: number): InitialsMetrics {
|
|
|
191
184
|
};
|
|
192
185
|
}
|
|
193
186
|
|
|
194
|
-
|
|
195
|
-
* LC-276: the widest capital's advance in em. Two of them at the initials em
|
|
196
|
-
* set the box a covered initials face must keep clear of the face on top.
|
|
197
|
-
*/
|
|
198
|
-
export const initialsCapAdvance = 0.84;
|
|
199
|
-
|
|
200
|
-
const PHOTO_STACK_OVERLAP = 0.32;
|
|
201
|
-
|
|
202
|
-
export type AvatarGroupCovered = "photo" | "initials";
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* LC-276: how far each face slides under the next. A covered photo keeps the
|
|
206
|
-
* Primer 32% stack; a covered initials face gives way until both letters clear.
|
|
207
|
-
*/
|
|
208
|
-
export function avatarGroupOverlapPx(px: number, covered: AvatarGroupCovered): number {
|
|
209
|
-
const photo = Math.round(px * PHOTO_STACK_OVERLAP);
|
|
210
|
-
if (covered === "photo") return photo;
|
|
211
|
-
const clear = Math.floor(px / 2 - initialsCapAdvance * initialsMetrics(px).fontPx);
|
|
212
|
-
return Math.max(0, Math.min(photo, clear));
|
|
213
|
-
}
|
|
187
|
+
const STACK_OVERLAP = 0.32;
|
|
214
188
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return
|
|
189
|
+
/** LC-276: each face slides under the next by the Primer 32% of its diameter. */
|
|
190
|
+
export function avatarGroupOverlapPx(px: number): number {
|
|
191
|
+
return Math.round(px * STACK_OVERLAP);
|
|
218
192
|
}
|
|
219
193
|
|
|
220
194
|
// The RN/Tamagui `onPress` type is `((event: GestureResponderEvent) => void)
|
|
@@ -417,9 +391,7 @@ function AvatarGroup({
|
|
|
417
391
|
const items = Children.toArray(children).filter(isValidElement);
|
|
418
392
|
const shown = items.slice(0, Math.max(1, max));
|
|
419
393
|
const extra = items.length - shown.length;
|
|
420
|
-
const
|
|
421
|
-
const coveredFace = covered.some(showsInitials) ? "initials" : "photo";
|
|
422
|
-
const overlapPx = overlap ? avatarGroupOverlapPx(visualPx, coveredFace) : 0;
|
|
394
|
+
const overlapPx = overlap ? avatarGroupOverlapPx(visualPx) : 0;
|
|
423
395
|
const total = shown.length + (extra > 0 ? 1 : 0);
|
|
424
396
|
const overflowLabel = extra > 9 ? "9+" : `+${extra}`;
|
|
425
397
|
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
isOpenIndex,
|
|
34
34
|
maxZoom,
|
|
35
35
|
positionLabel,
|
|
36
|
+
panShift,
|
|
36
37
|
zoomRect,
|
|
37
38
|
} from "./shared";
|
|
38
39
|
|
|
@@ -189,9 +190,17 @@ function LightboxPage({ item, width, height, animate, onZoomChange, onSingleTap
|
|
|
189
190
|
const next = Math.min(maxZoom, Math.max(1, (state.scale * distance) / state.distance));
|
|
190
191
|
state.current = next;
|
|
191
192
|
scale.setValue(next);
|
|
193
|
+
shift.setValue(panShift(next, { x: state.x, y: state.y }, width, height));
|
|
192
194
|
return;
|
|
193
195
|
}
|
|
194
|
-
shift.setValue(
|
|
196
|
+
shift.setValue(
|
|
197
|
+
panShift(
|
|
198
|
+
state.current,
|
|
199
|
+
{ x: state.x + gesture.dx, y: state.y + gesture.dy },
|
|
200
|
+
width,
|
|
201
|
+
height,
|
|
202
|
+
),
|
|
203
|
+
);
|
|
195
204
|
},
|
|
196
205
|
onPanResponderRelease: (_event, gesture) => {
|
|
197
206
|
const state = pinch.current;
|
|
@@ -200,10 +209,12 @@ function LightboxPage({ item, width, height, animate, onZoomChange, onSingleTap
|
|
|
200
209
|
settleAndroid(1, 0, 0);
|
|
201
210
|
return;
|
|
202
211
|
}
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
212
|
+
const { x, y } = panShift(
|
|
213
|
+
state.current,
|
|
214
|
+
{ x: state.x + gesture.dx, y: state.y + gesture.dy },
|
|
215
|
+
width,
|
|
216
|
+
height,
|
|
217
|
+
);
|
|
207
218
|
settleAndroid(state.current, x, y);
|
|
208
219
|
},
|
|
209
220
|
onPanResponderTerminationRequest: () => !zoomedRef.current,
|
|
@@ -2,6 +2,9 @@ import { describe, expect, it } from "vitest";
|
|
|
2
2
|
import {
|
|
3
3
|
classifyDrag,
|
|
4
4
|
dismissDistance,
|
|
5
|
+
doubleTapZoom,
|
|
6
|
+
maxZoom,
|
|
7
|
+
panShift,
|
|
5
8
|
dragGroundOpacity,
|
|
6
9
|
isOpenIndex,
|
|
7
10
|
positionLabel,
|
|
@@ -76,3 +79,39 @@ describe("Lightbox double-tap zoom", () => {
|
|
|
76
79
|
expect(zoomRect(400, 800, 400, 800, 2)).toEqual({ x: 200, y: 400, width: 200, height: 400 });
|
|
77
80
|
});
|
|
78
81
|
});
|
|
82
|
+
|
|
83
|
+
describe("Lightbox pan stays on the photo (LC-283)", () => {
|
|
84
|
+
const width = 390;
|
|
85
|
+
const height = 844;
|
|
86
|
+
|
|
87
|
+
it("stops a drag past the edge at the photo's edge while zoomed", () => {
|
|
88
|
+
const limitX = (width * (doubleTapZoom - 1)) / 2;
|
|
89
|
+
const limitY = (height * (doubleTapZoom - 1)) / 2;
|
|
90
|
+
expect(panShift(doubleTapZoom, { x: 5000, y: -5000 }, width, height)).toEqual({
|
|
91
|
+
x: limitX,
|
|
92
|
+
y: -limitY,
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("never shows ground beside the photo at any zoom", () => {
|
|
97
|
+
for (const scale of [1, 1.5, doubleTapZoom, maxZoom]) {
|
|
98
|
+
for (const shift of [
|
|
99
|
+
{ x: 900, y: 0 },
|
|
100
|
+
{ x: -900, y: 1200 },
|
|
101
|
+
{ x: 30, y: -40 },
|
|
102
|
+
]) {
|
|
103
|
+
const next = panShift(scale, shift, width, height);
|
|
104
|
+
const left = width / 2 - (width * scale) / 2 + next.x;
|
|
105
|
+
const top = height / 2 - (height * scale) / 2 + next.y;
|
|
106
|
+
expect(left).toBeLessThanOrEqual(1e-6);
|
|
107
|
+
expect(left + width * scale).toBeGreaterThanOrEqual(width - 1e-6);
|
|
108
|
+
expect(top).toBeLessThanOrEqual(1e-6);
|
|
109
|
+
expect(top + height * scale).toBeGreaterThanOrEqual(height - 1e-6);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("returns to centre at 1x", () => {
|
|
115
|
+
expect(panShift(1, { x: 80, y: -60 }, width, height)).toEqual({ x: 0, y: 0 });
|
|
116
|
+
});
|
|
117
|
+
});
|
package/src/Lightbox/shared.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { clampView } from "../canvas/panBounds";
|
|
1
2
|
import type { ImageProps } from "../images/Image/types";
|
|
2
3
|
|
|
3
4
|
export interface LightboxItem {
|
|
@@ -89,6 +90,28 @@ export function zoomRect(
|
|
|
89
90
|
return { x, y, width: w, height: h };
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Clamps a zoomed page's shift so the photo never slides off the screen at any
|
|
95
|
+
* scale (LC-283). The page scales about its centre, so the shift is measured
|
|
96
|
+
* from there.
|
|
97
|
+
*/
|
|
98
|
+
export function panShift(
|
|
99
|
+
scale: number,
|
|
100
|
+
shift: { x: number; y: number },
|
|
101
|
+
width: number,
|
|
102
|
+
height: number,
|
|
103
|
+
): { x: number; y: number } {
|
|
104
|
+
const page = { width, height };
|
|
105
|
+
const origin = (size: number) => (size - size * scale) / 2;
|
|
106
|
+
const view = clampView(
|
|
107
|
+
{ scale, x: origin(width) + shift.x, y: origin(height) + shift.y },
|
|
108
|
+
page,
|
|
109
|
+
page,
|
|
110
|
+
{ maxScale: maxZoom },
|
|
111
|
+
);
|
|
112
|
+
return { x: view.x - origin(width) || 0, y: view.y - origin(height) || 0 };
|
|
113
|
+
}
|
|
114
|
+
|
|
92
115
|
/** "2 of 5", or empty for a single item. */
|
|
93
116
|
export function positionLabel(
|
|
94
117
|
index: number,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { cleanup, screen } from "@testing-library/react";
|
|
10
10
|
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
11
|
-
import { PageGutter } from "@multiplatform.one/theme";
|
|
11
|
+
import { PageGutter, panelPaddingPx, useResolvedKnobs } from "@multiplatform.one/theme";
|
|
12
12
|
import type { ReactNode } from "react";
|
|
13
13
|
import { afterEach, describe, expect, it } from "vitest";
|
|
14
14
|
import { Screen } from "../layouts/page";
|
|
@@ -93,3 +93,63 @@ describe.each(["underline", "contained", "band"] as const)("%s Tabs panel inset"
|
|
|
93
93
|
expect(atoms(panel, "_pr-").map(value)).toEqual([gutter]);
|
|
94
94
|
});
|
|
95
95
|
});
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* LC-287 STRIP-ON-PAGE-LINE: an edge-to-edge strip insets its row so the first
|
|
99
|
+
* label (underline) or the track and band columns (contained, band) start on
|
|
100
|
+
* the gutter its panel pads by; the strip itself still spans the edges.
|
|
101
|
+
*/
|
|
102
|
+
function TabPadProbe() {
|
|
103
|
+
const { knobProps } = useResolvedKnobs({ component: "Tabs" });
|
|
104
|
+
return <span data-testid="tab-pad" data-px={knobProps.tab.paddingHorizontal} />;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function stripInset(container: HTMLElement): number {
|
|
108
|
+
return Number(
|
|
109
|
+
container.querySelector("[data-tabs-strip-inset]")?.getAttribute("data-tabs-strip-inset"),
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
describe("LC-287 an edge-to-edge strip starts on the page line", () => {
|
|
114
|
+
it.each([
|
|
115
|
+
["standalone", (tabs: ReactNode) => tabs],
|
|
116
|
+
["noPadding Screen", (tabs: ReactNode) => <Screen noPadding>{tabs}</Screen>],
|
|
117
|
+
])("underline (%s): first label sits on the panel gutter", (_name, wrap) => {
|
|
118
|
+
const { container } = renderWithProviders(
|
|
119
|
+
<>
|
|
120
|
+
<TabPadProbe />
|
|
121
|
+
{wrap(<Tabs items={items} variant="underline" />)}
|
|
122
|
+
</>,
|
|
123
|
+
);
|
|
124
|
+
const padX = Number(screen.getByTestId("tab-pad").getAttribute("data-px"));
|
|
125
|
+
expect(padX).toBeGreaterThan(0);
|
|
126
|
+
expect(stripInset(container) + padX).toBe(panelPaddingPx());
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it.each(["contained", "band"] as const)("%s: the track starts on the panel gutter", (variant) => {
|
|
130
|
+
const { container } = renderWithProviders(<Tabs items={items} variant={variant} />);
|
|
131
|
+
expect(stripInset(container)).toBe(panelPaddingPx());
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it.each(["underline", "contained", "band"] as const)(
|
|
135
|
+
"%s under a page gutter adds no strip inset",
|
|
136
|
+
(variant) => {
|
|
137
|
+
const { container } = renderWithProviders(
|
|
138
|
+
<PageGutter inset="$4">
|
|
139
|
+
<Tabs items={items} variant={variant} />
|
|
140
|
+
</PageGutter>,
|
|
141
|
+
);
|
|
142
|
+
expect(stripInset(container)).toBe(0);
|
|
143
|
+
},
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
it("pads the scroll content, so the hairline and scrolled labels still reach both edges", () => {
|
|
147
|
+
const { container } = renderWithProviders(<Tabs items={items} variant="underline" />);
|
|
148
|
+
const inset = stripInset(container);
|
|
149
|
+
const scroller = container.querySelector('[data-tabs-scroll="true"]') as HTMLElement;
|
|
150
|
+
const content = scroller.firstElementChild as HTMLElement;
|
|
151
|
+
expect(getComputedStyle(content).paddingLeft).toBe(`${inset}px`);
|
|
152
|
+
expect(getComputedStyle(content).paddingRight).toBe(`${inset}px`);
|
|
153
|
+
expect(getComputedStyle(scroller).paddingLeft || "0px").toMatch(/^0(px)?$/);
|
|
154
|
+
});
|
|
155
|
+
});
|
|
@@ -160,7 +160,10 @@ it("rechecks changed content width without fighting subsequent manual scroll", (
|
|
|
160
160
|
tree.content(620);
|
|
161
161
|
expect(tree.scroll).not.toHaveBeenCalled();
|
|
162
162
|
tree.content(650);
|
|
163
|
-
|
|
163
|
+
const inset = Number(
|
|
164
|
+
document.querySelector("[data-tabs-strip-inset]")?.getAttribute("data-tabs-strip-inset"),
|
|
165
|
+
);
|
|
166
|
+
expect(tree.scroll).toHaveBeenCalledExactlyOnceWith({ x: 242 + inset, animated: true });
|
|
164
167
|
});
|
|
165
168
|
|
|
166
169
|
it("waits for the latest selected tab's layout when dimensions were pending", () => {
|
|
@@ -494,3 +494,42 @@ export const InPageGutter: Story = {
|
|
|
494
494
|
</Screen>
|
|
495
495
|
),
|
|
496
496
|
};
|
|
497
|
+
|
|
498
|
+
const consoleTabs: TabsItem[] = [
|
|
499
|
+
"Overview",
|
|
500
|
+
"Apps",
|
|
501
|
+
"Services",
|
|
502
|
+
"Volumes",
|
|
503
|
+
"Networks",
|
|
504
|
+
"Secrets",
|
|
505
|
+
"Logs",
|
|
506
|
+
"Events",
|
|
507
|
+
"Backups",
|
|
508
|
+
"Domains",
|
|
509
|
+
"Settings",
|
|
510
|
+
].map((label) => ({
|
|
511
|
+
value: label.toLowerCase(),
|
|
512
|
+
label,
|
|
513
|
+
content: <Panel title={label} body="The panel pads by the page gutter." />,
|
|
514
|
+
}));
|
|
515
|
+
|
|
516
|
+
export const EdgeToEdgeStrip: Story = {
|
|
517
|
+
parameters: {
|
|
518
|
+
layout: "fullscreen",
|
|
519
|
+
docs: {
|
|
520
|
+
description: {
|
|
521
|
+
story:
|
|
522
|
+
"LC-287 STRIP-ON-PAGE-LINE (FZ-7972): in an edge-to-edge surface the strip and its hairline run to both edges, while the first label starts on the gutter the header and panel use, and the last label ends on it once scrolled to the end.",
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
args: { variant: "underline" },
|
|
527
|
+
render: (args) => (
|
|
528
|
+
<Screen noPadding scroll={false}>
|
|
529
|
+
<YStack paddingHorizontal="$4">
|
|
530
|
+
<PageHeader title="mpo-stack" subtitle="11 sections" />
|
|
531
|
+
</YStack>
|
|
532
|
+
<Tabs {...args} items={consoleTabs} />
|
|
533
|
+
</Screen>
|
|
534
|
+
),
|
|
535
|
+
};
|
package/src/Tabs/index.tsx
CHANGED
|
@@ -28,6 +28,7 @@ import { IconSlot } from "@multiplatform.one/theme";
|
|
|
28
28
|
import {
|
|
29
29
|
MIN_PRESS_TARGET,
|
|
30
30
|
PageGutter,
|
|
31
|
+
panelPaddingPx,
|
|
31
32
|
usePageGutter,
|
|
32
33
|
ensureKeyboardModalityTracking,
|
|
33
34
|
getGroupPosition,
|
|
@@ -449,6 +450,12 @@ function TabsRoot({
|
|
|
449
450
|
component: "Tabs",
|
|
450
451
|
size,
|
|
451
452
|
});
|
|
453
|
+
const stripInsetPx = pageInset
|
|
454
|
+
? 0
|
|
455
|
+
: Math.max(
|
|
456
|
+
0,
|
|
457
|
+
panelPaddingPx() - (variant === "underline" ? knobProps.tab.paddingHorizontal : 0),
|
|
458
|
+
);
|
|
452
459
|
|
|
453
460
|
if (isWeb) ensureKeyboardModalityTracking();
|
|
454
461
|
// Tab value currently showing the manual keyboard focus ring (see tracker note)
|
|
@@ -578,11 +585,17 @@ function TabsRoot({
|
|
|
578
585
|
React.useEffect(() => {
|
|
579
586
|
if (!activeLayout || activeLayout.value !== currentValue) return;
|
|
580
587
|
const { offset, viewport, content } = scrollMetrics.current;
|
|
581
|
-
const target = tabsScrollIntoViewX(
|
|
588
|
+
const target = tabsScrollIntoViewX(
|
|
589
|
+
{ ...activeLayout, x: activeLayout.x + stripInsetPx },
|
|
590
|
+
offset,
|
|
591
|
+
viewport,
|
|
592
|
+
content,
|
|
593
|
+
direction,
|
|
594
|
+
);
|
|
582
595
|
if (target !== undefined && Math.abs(target - offset) >= 1) {
|
|
583
596
|
scrollRef.current?.scrollTo({ x: target, animated: true });
|
|
584
597
|
}
|
|
585
|
-
}, [activeLayout, currentValue, direction, sizeRevision]);
|
|
598
|
+
}, [activeLayout, currentValue, direction, sizeRevision, stripInsetPx]);
|
|
586
599
|
|
|
587
600
|
const isUnderline = variant === "underline";
|
|
588
601
|
const isBand = variant === "band";
|
|
@@ -943,11 +956,12 @@ function TabsRoot({
|
|
|
943
956
|
{...(isUnderline || isFrame
|
|
944
957
|
? { ...hairline.bottom, borderColor: componentColors.surface.border }
|
|
945
958
|
: undefined)}
|
|
959
|
+
data-tabs-strip-inset={stripInsetPx}
|
|
946
960
|
data-fade-left={fades.left ? "true" : undefined}
|
|
947
961
|
data-fade-right={fades.right ? "true" : undefined}
|
|
948
962
|
>
|
|
949
963
|
{equalDistribution ? (
|
|
950
|
-
<View alignSelf="stretch" minWidth={0}>
|
|
964
|
+
<View alignSelf="stretch" minWidth={0} paddingHorizontal={stripInsetPx}>
|
|
951
965
|
{tabList}
|
|
952
966
|
</View>
|
|
953
967
|
) : (
|
|
@@ -961,6 +975,7 @@ function TabsRoot({
|
|
|
961
975
|
// the painted tab is smaller than the floor (LC-54 / nested scale).
|
|
962
976
|
contentContainerStyle={{
|
|
963
977
|
paddingVertical: slop,
|
|
978
|
+
paddingHorizontal: stripInsetPx,
|
|
964
979
|
...(isFrame ? { flexGrow: 1 } : undefined),
|
|
965
980
|
}}
|
|
966
981
|
marginVertical={-slop}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./panBounds";
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { clampView, fitScale, zoomAt, type CanvasExtent, type CanvasView } from "./panBounds";
|
|
3
|
+
|
|
4
|
+
const viewport: CanvasExtent = { width: 400, height: 300 };
|
|
5
|
+
|
|
6
|
+
function coversOrCentres(view: CanvasView, content: CanvasExtent, port: CanvasExtent) {
|
|
7
|
+
const width = content.width * view.scale;
|
|
8
|
+
const height = content.height * view.scale;
|
|
9
|
+
const eps = 1e-6;
|
|
10
|
+
if (width > port.width) {
|
|
11
|
+
expect(view.x).toBeLessThanOrEqual(eps);
|
|
12
|
+
expect(view.x + width).toBeGreaterThanOrEqual(port.width - eps);
|
|
13
|
+
} else {
|
|
14
|
+
expect(view.x).toBeCloseTo((port.width - width) / 2, 6);
|
|
15
|
+
}
|
|
16
|
+
if (height > port.height) {
|
|
17
|
+
expect(view.y).toBeLessThanOrEqual(eps);
|
|
18
|
+
expect(view.y + height).toBeGreaterThanOrEqual(port.height - eps);
|
|
19
|
+
} else {
|
|
20
|
+
expect(view.y).toBeCloseTo((port.height - height) / 2, 6);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function seeded(seed: number) {
|
|
25
|
+
let state = seed;
|
|
26
|
+
return () => {
|
|
27
|
+
state = (state * 1664525 + 1013904223) % 4294967296;
|
|
28
|
+
return state / 4294967296;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe("LC-283 pan bounds: a zoomable canvas pans only over its content", () => {
|
|
33
|
+
it("fits the whole content at the least scale, never above 1:1, with a floor", () => {
|
|
34
|
+
expect(fitScale({ width: 800, height: 300 }, viewport)).toBe(0.5);
|
|
35
|
+
expect(fitScale({ width: 200, height: 100 }, viewport)).toBe(1);
|
|
36
|
+
expect(fitScale({ width: 40000, height: 300 }, viewport)).toBe(0.1);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("stops a pan at the content's edge instead of showing empty space", () => {
|
|
40
|
+
const content = { width: 1000, height: 800 };
|
|
41
|
+
expect(clampView({ scale: 1, x: 250, y: -2000 }, content, viewport)).toEqual({
|
|
42
|
+
scale: 1,
|
|
43
|
+
x: 0,
|
|
44
|
+
y: -500,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("centres an axis where the content is smaller than the viewport", () => {
|
|
49
|
+
const content = { width: 200, height: 1000 };
|
|
50
|
+
const view = clampView({ scale: 1, x: -90, y: 0 }, content, viewport);
|
|
51
|
+
expect(view.x).toBe(100);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("caps zoom-in at 1:1 unless the canvas is a magnifier", () => {
|
|
55
|
+
const content = { width: 1000, height: 800 };
|
|
56
|
+
expect(clampView({ scale: 3, x: 0, y: 0 }, content, viewport).scale).toBe(1);
|
|
57
|
+
expect(clampView({ scale: 3, x: 0, y: 0 }, content, viewport, { maxScale: 4 }).scale).toBe(3);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("keeps the point under the focal spot while zooming, inside the bounds", () => {
|
|
61
|
+
const content = { width: 1000, height: 800 };
|
|
62
|
+
const start = { scale: 0.5, x: -100, y: -50 };
|
|
63
|
+
const next = zoomAt(start, 1, { x: 200, y: 150 }, content, viewport);
|
|
64
|
+
expect(next.scale).toBe(1);
|
|
65
|
+
expect(next.x).toBe(200 - (200 - -100) * 2);
|
|
66
|
+
coversOrCentres(next, content, viewport);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("never lets any pan or zoom leave the content (1,000 random views)", () => {
|
|
70
|
+
const random = seeded(283);
|
|
71
|
+
for (let i = 0; i < 1000; i++) {
|
|
72
|
+
const content = { width: 50 + random() * 3000, height: 50 + random() * 3000 };
|
|
73
|
+
const port = { width: 100 + random() * 1200, height: 100 + random() * 900 };
|
|
74
|
+
const maxScale = random() < 0.5 ? 1 : 4;
|
|
75
|
+
const wild = {
|
|
76
|
+
scale: random() * 6,
|
|
77
|
+
x: (random() - 0.5) * 8000,
|
|
78
|
+
y: (random() - 0.5) * 8000,
|
|
79
|
+
};
|
|
80
|
+
const view = clampView(wild, content, port, { maxScale });
|
|
81
|
+
expect(view.scale).toBeGreaterThanOrEqual(fitScale(content, port) - 1e-9);
|
|
82
|
+
expect(view.scale).toBeLessThanOrEqual(maxScale);
|
|
83
|
+
coversOrCentres(view, content, port);
|
|
84
|
+
const zoomed = zoomAt(
|
|
85
|
+
view,
|
|
86
|
+
random() * 6,
|
|
87
|
+
{ x: random() * port.width, y: random() * port.height },
|
|
88
|
+
content,
|
|
89
|
+
port,
|
|
90
|
+
{ maxScale },
|
|
91
|
+
);
|
|
92
|
+
coversOrCentres(zoomed, content, port);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export interface CanvasExtent {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface CanvasView {
|
|
7
|
+
scale: number;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface CanvasBounds {
|
|
13
|
+
maxScale?: number;
|
|
14
|
+
floor?: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const canvasZoomFloor = 0.1;
|
|
18
|
+
|
|
19
|
+
export function fitScale(
|
|
20
|
+
content: CanvasExtent,
|
|
21
|
+
viewport: CanvasExtent,
|
|
22
|
+
bounds: CanvasBounds = {},
|
|
23
|
+
): number {
|
|
24
|
+
"worklet";
|
|
25
|
+
const { maxScale = 1, floor = canvasZoomFloor } = bounds;
|
|
26
|
+
if (content.width <= 0 || content.height <= 0 || viewport.width <= 0 || viewport.height <= 0)
|
|
27
|
+
return 1;
|
|
28
|
+
const fit = Math.min(viewport.width / content.width, viewport.height / content.height);
|
|
29
|
+
return Math.min(1, maxScale, Math.max(floor, fit));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function clampOffset(offset: number, content: number, viewport: number): number {
|
|
33
|
+
"worklet";
|
|
34
|
+
if (content <= viewport) return (viewport - content) / 2;
|
|
35
|
+
return Math.min(0, Math.max(viewport - content, offset));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function clampScale(
|
|
39
|
+
scale: number,
|
|
40
|
+
content: CanvasExtent,
|
|
41
|
+
viewport: CanvasExtent,
|
|
42
|
+
bounds: CanvasBounds = {},
|
|
43
|
+
): number {
|
|
44
|
+
"worklet";
|
|
45
|
+
return Math.min(bounds.maxScale ?? 1, Math.max(fitScale(content, viewport, bounds), scale));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function clampView(
|
|
49
|
+
view: CanvasView,
|
|
50
|
+
content: CanvasExtent,
|
|
51
|
+
viewport: CanvasExtent,
|
|
52
|
+
bounds: CanvasBounds = {},
|
|
53
|
+
): CanvasView {
|
|
54
|
+
"worklet";
|
|
55
|
+
const scale = clampScale(view.scale, content, viewport, bounds);
|
|
56
|
+
return {
|
|
57
|
+
scale,
|
|
58
|
+
x: clampOffset(view.x, content.width * scale, viewport.width),
|
|
59
|
+
y: clampOffset(view.y, content.height * scale, viewport.height),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function zoomAt(
|
|
64
|
+
view: CanvasView,
|
|
65
|
+
scale: number,
|
|
66
|
+
focal: { x: number; y: number },
|
|
67
|
+
content: CanvasExtent,
|
|
68
|
+
viewport: CanvasExtent,
|
|
69
|
+
bounds: CanvasBounds = {},
|
|
70
|
+
): CanvasView {
|
|
71
|
+
"worklet";
|
|
72
|
+
const next = clampScale(scale, content, viewport, bounds);
|
|
73
|
+
const ratio = next / view.scale;
|
|
74
|
+
return clampView(
|
|
75
|
+
{
|
|
76
|
+
scale: next,
|
|
77
|
+
x: focal.x - (focal.x - view.x) * ratio,
|
|
78
|
+
y: focal.y - (focal.y - view.y) * ratio,
|
|
79
|
+
},
|
|
80
|
+
content,
|
|
81
|
+
viewport,
|
|
82
|
+
bounds,
|
|
83
|
+
);
|
|
84
|
+
}
|
package/src/index.ts
CHANGED
package/src/surfaces.spec.tsx
CHANGED
|
@@ -244,11 +244,11 @@ describe("overlay containers take the Axiom 1 child-clip cap (MPO-150)", () => {
|
|
|
244
244
|
expect(capped, "the cap must spread AFTER the uncapped scale token").toBeGreaterThan(elevated);
|
|
245
245
|
});
|
|
246
246
|
|
|
247
|
-
const sheetStop = { medium:
|
|
247
|
+
const sheetStop = { medium: 16, large: 20, full: 44 } as const;
|
|
248
248
|
for (const [borderRadius, stop] of Object.entries({ medium: 14, large: 20, full: 44 })) {
|
|
249
249
|
{
|
|
250
250
|
const capped = Math.min(stop, 16);
|
|
251
|
-
const sheetCapped =
|
|
251
|
+
const sheetCapped = sheetStop[borderRadius as keyof typeof sheetStop];
|
|
252
252
|
it(`caps every overlay frame at ${capped}px for borderRadius=${borderRadius} on the panelPadding role`, () => {
|
|
253
253
|
render(
|
|
254
254
|
<TamaguiProvider config={overlayCapConfig} defaultTheme="light">
|