tempest-react-sdk 0.77.0 → 0.79.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 +6 -6
- package/bin/lib/alias/collect.mjs +20 -3
- package/bin/lib/alias/index.mjs +12 -1
- package/bin/lib/alias/index.test.mjs +24 -0
- package/bin/lib/css/analyze.test.mjs +21 -1
- package/bin/lib/css/collect.mjs +14 -0
- package/bin/lib/css/extract.mjs +63 -5
- package/bin/lib/css/extract.test.mjs +110 -1
- package/bin/lib/css/fix.e2e.test.mjs +50 -0
- package/bin/lib/css/index.mjs +6 -1
- package/bin/lib/fs/contain.mjs +50 -0
- package/bin/lib/icons/generate.mjs +28 -3
- package/bin/lib/icons/generate.test.mjs +57 -1
- package/bin/lib/openapi/escape.mjs +20 -6
- package/bin/lib/openapi/generate.encode.test.mjs +120 -0
- package/bin/lib/openapi/generate.hostile.test.mjs +38 -9
- package/bin/lib/openapi/generate.mjs +203 -64
- package/bin/lib/openapi/generate.pagination.test.mjs +3 -2
- package/bin/lib/openapi/generate.test.mjs +270 -3
- package/bin/lib/openapi/schema-to-zod.mjs +5 -3
- package/bin/tempest-gen.test.mjs +188 -0
- package/bin/tempest.mjs +120 -44
- package/dist/access/Can.cjs.map +1 -1
- package/dist/access/Can.js.map +1 -1
- package/dist/access/access-control-context.cjs.map +1 -1
- package/dist/access/access-control-context.js.map +1 -1
- package/dist/access/create-role-access-control.cjs.map +1 -1
- package/dist/access/create-role-access-control.js.map +1 -1
- package/dist/access/permissions-from-token.cjs.map +1 -1
- package/dist/access/permissions-from-token.js.map +1 -1
- package/dist/access/use-can.cjs.map +1 -1
- package/dist/access/use-can.js.map +1 -1
- package/dist/app/AppProviders.cjs.map +1 -1
- package/dist/app/AppProviders.js.map +1 -1
- package/dist/audio/audio-bus.cjs.map +1 -1
- package/dist/audio/audio-bus.js.map +1 -1
- package/dist/audio/audio-output.cjs.map +1 -1
- package/dist/audio/audio-output.js.map +1 -1
- package/dist/audio/audio-player.cjs.map +1 -1
- package/dist/audio/audio-player.js.map +1 -1
- package/dist/audio/audio-recorder.cjs.map +1 -1
- package/dist/audio/audio-recorder.js.map +1 -1
- package/dist/audio/duration.cjs.map +1 -1
- package/dist/audio/duration.js.map +1 -1
- package/dist/audio/level-meter.cjs.map +1 -1
- package/dist/audio/level-meter.js.map +1 -1
- package/dist/audio/media-access.cjs.map +1 -1
- package/dist/audio/media-access.js.map +1 -1
- package/dist/audio/noise-floor.cjs.map +1 -1
- package/dist/audio/noise-floor.js.map +1 -1
- package/dist/audio/sfx-pool.cjs.map +1 -1
- package/dist/audio/sfx-pool.js.map +1 -1
- package/dist/audio/use-audio-bus.cjs.map +1 -1
- package/dist/audio/use-audio-bus.js.map +1 -1
- package/dist/audio/use-audio-recorder.cjs.map +1 -1
- package/dist/audio/use-audio-recorder.js.map +1 -1
- package/dist/audio/use-audio.cjs.map +1 -1
- package/dist/audio/use-audio.js.map +1 -1
- package/dist/audio/use-microphone.cjs +1 -1
- package/dist/audio/use-microphone.cjs.map +1 -1
- package/dist/audio/use-microphone.js +1 -5
- package/dist/audio/use-microphone.js.map +1 -1
- package/dist/audio/use-sfx-pool.cjs.map +1 -1
- package/dist/audio/use-sfx-pool.js.map +1 -1
- package/dist/audio/voice-activity.cjs.map +1 -1
- package/dist/audio/voice-activity.js.map +1 -1
- package/dist/audio/voice-chain-stages.cjs.map +1 -1
- package/dist/audio/voice-chain-stages.js.map +1 -1
- package/dist/audio/voice-chain.cjs.map +1 -1
- package/dist/audio/voice-chain.js.map +1 -1
- package/dist/audio/wav.cjs.map +1 -1
- package/dist/audio/wav.js.map +1 -1
- package/dist/auth/AuthGuard.cjs.map +1 -1
- package/dist/auth/AuthGuard.js.map +1 -1
- package/dist/auth/create-auth-store.cjs.map +1 -1
- package/dist/auth/create-auth-store.js.map +1 -1
- package/dist/auth/create-tempest-auth.cjs +1 -1
- package/dist/auth/create-tempest-auth.cjs.map +1 -1
- package/dist/auth/create-tempest-auth.js +185 -114
- package/dist/auth/create-tempest-auth.js.map +1 -1
- package/dist/auth/jwt.cjs.map +1 -1
- package/dist/auth/jwt.js.map +1 -1
- package/dist/auth/lazy-with-retry.cjs.map +1 -1
- package/dist/auth/lazy-with-retry.js.map +1 -1
- package/dist/auth/passkey.cjs.map +1 -1
- package/dist/auth/passkey.js.map +1 -1
- package/dist/auth/refresh-queue.cjs.map +1 -1
- package/dist/auth/refresh-queue.js.map +1 -1
- package/dist/auth/use-passkey.cjs +1 -1
- package/dist/auth/use-passkey.cjs.map +1 -1
- package/dist/auth/use-passkey.js +1 -1
- package/dist/auth/use-passkey.js.map +1 -1
- package/dist/br/BrazilMap.cjs.map +1 -1
- package/dist/br/BrazilMap.js.map +1 -1
- package/dist/br/BrazilMap.module.cjs.map +1 -1
- package/dist/br/BrazilMap.module.js.map +1 -1
- package/dist/br/BrazilStateCitySelect.cjs.map +1 -1
- package/dist/br/BrazilStateCitySelect.js.map +1 -1
- package/dist/br/BrazilStateMap.cjs.map +1 -1
- package/dist/br/BrazilStateMap.js.map +1 -1
- package/dist/br/MapLegend.cjs.map +1 -1
- package/dist/br/MapLegend.js.map +1 -1
- package/dist/br/MapLegend.module.cjs.map +1 -1
- package/dist/br/MapLegend.module.js.map +1 -1
- package/dist/br/MapMarkers.cjs.map +1 -1
- package/dist/br/MapMarkers.js.map +1 -1
- package/dist/br/MapTooltip.cjs.map +1 -1
- package/dist/br/MapTooltip.js.map +1 -1
- package/dist/br/MunicipalitySearch.cjs +1 -1
- package/dist/br/MunicipalitySearch.cjs.map +1 -1
- package/dist/br/MunicipalitySearch.js +2 -5
- package/dist/br/MunicipalitySearch.js.map +1 -1
- package/dist/br/MunicipalitySearch.module.cjs.map +1 -1
- package/dist/br/MunicipalitySearch.module.js.map +1 -1
- package/dist/br/PixQRCode.cjs.map +1 -1
- package/dist/br/PixQRCode.js.map +1 -1
- package/dist/br/PixQRCode.module.cjs.map +1 -1
- package/dist/br/PixQRCode.module.js.map +1 -1
- package/dist/br/boleto.cjs.map +1 -1
- package/dist/br/boleto.js.map +1 -1
- package/dist/br/br-geo.cjs.map +1 -1
- package/dist/br/br-geo.js.map +1 -1
- package/dist/br/data/br-centroids.cjs.map +1 -1
- package/dist/br/data/br-centroids.js.map +1 -1
- package/dist/br/data/br-locations.cjs.map +1 -1
- package/dist/br/data/br-locations.js.map +1 -1
- package/dist/br/data/br-uf-geo.cjs.map +1 -1
- package/dist/br/data/br-uf-geo.js.map +1 -1
- package/dist/br/data/mun/AC.cjs.map +1 -1
- package/dist/br/data/mun/AC.js.map +1 -1
- package/dist/br/data/mun/AL.cjs.map +1 -1
- package/dist/br/data/mun/AL.js.map +1 -1
- package/dist/br/data/mun/AM.cjs.map +1 -1
- package/dist/br/data/mun/AM.js.map +1 -1
- package/dist/br/data/mun/AP.cjs.map +1 -1
- package/dist/br/data/mun/AP.js.map +1 -1
- package/dist/br/data/mun/BA.cjs.map +1 -1
- package/dist/br/data/mun/BA.js.map +1 -1
- package/dist/br/data/mun/CE.cjs.map +1 -1
- package/dist/br/data/mun/CE.js.map +1 -1
- package/dist/br/data/mun/DF.cjs.map +1 -1
- package/dist/br/data/mun/DF.js.map +1 -1
- package/dist/br/data/mun/ES.cjs.map +1 -1
- package/dist/br/data/mun/ES.js.map +1 -1
- package/dist/br/data/mun/GO.cjs.map +1 -1
- package/dist/br/data/mun/GO.js.map +1 -1
- package/dist/br/data/mun/MA.cjs.map +1 -1
- package/dist/br/data/mun/MA.js.map +1 -1
- package/dist/br/data/mun/MG.cjs.map +1 -1
- package/dist/br/data/mun/MG.js.map +1 -1
- package/dist/br/data/mun/MS.cjs.map +1 -1
- package/dist/br/data/mun/MS.js.map +1 -1
- package/dist/br/data/mun/MT.cjs.map +1 -1
- package/dist/br/data/mun/MT.js.map +1 -1
- package/dist/br/data/mun/PA.cjs.map +1 -1
- package/dist/br/data/mun/PA.js.map +1 -1
- package/dist/br/data/mun/PB.cjs.map +1 -1
- package/dist/br/data/mun/PB.js.map +1 -1
- package/dist/br/data/mun/PE.cjs.map +1 -1
- package/dist/br/data/mun/PE.js.map +1 -1
- package/dist/br/data/mun/PI.cjs.map +1 -1
- package/dist/br/data/mun/PI.js.map +1 -1
- package/dist/br/data/mun/PR.cjs.map +1 -1
- package/dist/br/data/mun/PR.js.map +1 -1
- package/dist/br/data/mun/RJ.cjs.map +1 -1
- package/dist/br/data/mun/RJ.js.map +1 -1
- package/dist/br/data/mun/RN.cjs.map +1 -1
- package/dist/br/data/mun/RN.js.map +1 -1
- package/dist/br/data/mun/RO.cjs.map +1 -1
- package/dist/br/data/mun/RO.js.map +1 -1
- package/dist/br/data/mun/RR.cjs.map +1 -1
- package/dist/br/data/mun/RR.js.map +1 -1
- package/dist/br/data/mun/RS.cjs.map +1 -1
- package/dist/br/data/mun/RS.js.map +1 -1
- package/dist/br/data/mun/SC.cjs.map +1 -1
- package/dist/br/data/mun/SC.js.map +1 -1
- package/dist/br/data/mun/SE.cjs.map +1 -1
- package/dist/br/data/mun/SE.js.map +1 -1
- package/dist/br/data/mun/SP.cjs.map +1 -1
- package/dist/br/data/mun/SP.js.map +1 -1
- package/dist/br/data/mun/TO.cjs.map +1 -1
- package/dist/br/data/mun/TO.js.map +1 -1
- package/dist/br/geocode.cjs.map +1 -1
- package/dist/br/geocode.js.map +1 -1
- package/dist/br/holidays.cjs.map +1 -1
- package/dist/br/holidays.js.map +1 -1
- package/dist/br/locations.cjs.map +1 -1
- package/dist/br/locations.js.map +1 -1
- package/dist/br/nfe.cjs.map +1 -1
- package/dist/br/nfe.js.map +1 -1
- package/dist/br/pix.cjs +1 -1
- package/dist/br/pix.cjs.map +1 -1
- package/dist/br/pix.js +108 -71
- package/dist/br/pix.js.map +1 -1
- package/dist/br/regions.cjs.map +1 -1
- package/dist/br/regions.js.map +1 -1
- package/dist/br/scales.cjs.map +1 -1
- package/dist/br/scales.js.map +1 -1
- package/dist/br/state-geo.cjs.map +1 -1
- package/dist/br/state-geo.js.map +1 -1
- package/dist/br/svg-utils.cjs.map +1 -1
- package/dist/br/svg-utils.js.map +1 -1
- package/dist/br/use-map-hover.cjs.map +1 -1
- package/dist/br/use-map-hover.js.map +1 -1
- package/dist/br/use-map-zoom.cjs.map +1 -1
- package/dist/br/use-map-zoom.js.map +1 -1
- package/dist/br/whatsapp.cjs.map +1 -1
- package/dist/br/whatsapp.js.map +1 -1
- package/dist/br.cjs.map +1 -1
- package/dist/br.d.ts +16 -5
- package/dist/br.js.map +1 -1
- package/dist/capture/barcode.cjs.map +1 -1
- package/dist/capture/barcode.js.map +1 -1
- package/dist/capture/media-recorder.cjs.map +1 -1
- package/dist/capture/media-recorder.js.map +1 -1
- package/dist/capture/use-barcode-scanner.cjs.map +1 -1
- package/dist/capture/use-barcode-scanner.js.map +1 -1
- package/dist/capture/use-screen-capture.cjs +1 -1
- package/dist/capture/use-screen-capture.cjs.map +1 -1
- package/dist/capture/use-screen-capture.js +1 -7
- package/dist/capture/use-screen-capture.js.map +1 -1
- package/dist/capture/use-speech-recognition.cjs +1 -1
- package/dist/capture/use-speech-recognition.cjs.map +1 -1
- package/dist/capture/use-speech-recognition.js +35 -36
- package/dist/capture/use-speech-recognition.js.map +1 -1
- package/dist/capture/use-torch.cjs.map +1 -1
- package/dist/capture/use-torch.js.map +1 -1
- package/dist/capture/use-video-recorder.cjs.map +1 -1
- package/dist/capture/use-video-recorder.js.map +1 -1
- package/dist/capture/video-recorder.cjs.map +1 -1
- package/dist/capture/video-recorder.js.map +1 -1
- package/dist/charts/AreaChart.cjs.map +1 -1
- package/dist/charts/AreaChart.js.map +1 -1
- package/dist/charts/BarChart.cjs.map +1 -1
- package/dist/charts/BarChart.js.map +1 -1
- package/dist/charts/LineChart.cjs.map +1 -1
- package/dist/charts/LineChart.js.map +1 -1
- package/dist/charts/PieChart.cjs.map +1 -1
- package/dist/charts/PieChart.js.map +1 -1
- package/dist/charts/RadarChart.cjs.map +1 -1
- package/dist/charts/RadarChart.js.map +1 -1
- package/dist/charts/palette.cjs.map +1 -1
- package/dist/charts/palette.js.map +1 -1
- package/dist/charts/scales.cjs.map +1 -1
- package/dist/charts/scales.js.map +1 -1
- package/dist/charts/types.cjs.map +1 -1
- package/dist/charts/types.js.map +1 -1
- package/dist/charts/use-chart-colors.cjs.map +1 -1
- package/dist/charts/use-chart-colors.js.map +1 -1
- package/dist/components/AIChat/AIChat.cjs +1 -1
- package/dist/components/AIChat/AIChat.cjs.map +1 -1
- package/dist/components/AIChat/AIChat.js +1 -5
- package/dist/components/AIChat/AIChat.js.map +1 -1
- package/dist/components/AIChat/AIChat.module.cjs.map +1 -1
- package/dist/components/AIChat/AIChat.module.js.map +1 -1
- package/dist/components/AIChat/AIChatComposer.cjs +1 -1
- package/dist/components/AIChat/AIChatComposer.cjs.map +1 -1
- package/dist/components/AIChat/AIChatComposer.js +1 -7
- package/dist/components/AIChat/AIChatComposer.js.map +1 -1
- package/dist/components/AIChat/AIChatTurn.cjs.map +1 -1
- package/dist/components/AIChat/AIChatTurn.js.map +1 -1
- package/dist/components/AIChat/ai-chat-turns.cjs.map +1 -1
- package/dist/components/AIChat/ai-chat-turns.js.map +1 -1
- package/dist/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Accordion/Accordion.module.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.module.js.map +1 -1
- package/dist/components/Alert/Alert.cjs.map +1 -1
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Alert/Alert.module.cjs.map +1 -1
- package/dist/components/Alert/Alert.module.js.map +1 -1
- package/dist/components/AppBar/AppBar.cjs.map +1 -1
- package/dist/components/AppBar/AppBar.js.map +1 -1
- package/dist/components/AppBar/AppBar.module.cjs.map +1 -1
- package/dist/components/AppBar/AppBar.module.js.map +1 -1
- package/dist/components/AppBar/use-sticky-body-warning.cjs +1 -1
- package/dist/components/AppBar/use-sticky-body-warning.cjs.map +1 -1
- package/dist/components/AppBar/use-sticky-body-warning.js +1 -1
- package/dist/components/AppBar/use-sticky-body-warning.js.map +1 -1
- package/dist/components/AppShell/AppShell.cjs.map +1 -1
- package/dist/components/AppShell/AppShell.js.map +1 -1
- package/dist/components/AppShell/AppShell.module.cjs.map +1 -1
- package/dist/components/AppShell/AppShell.module.js.map +1 -1
- package/dist/components/AspectRatio/AspectRatio.cjs.map +1 -1
- package/dist/components/AspectRatio/AspectRatio.js.map +1 -1
- package/dist/components/AspectRatio/AspectRatio.module.cjs.map +1 -1
- package/dist/components/AspectRatio/AspectRatio.module.js.map +1 -1
- package/dist/components/AudioPlayer/AudioPlayer.cjs +1 -1
- package/dist/components/AudioPlayer/AudioPlayer.cjs.map +1 -1
- package/dist/components/AudioPlayer/AudioPlayer.js +1 -7
- package/dist/components/AudioPlayer/AudioPlayer.js.map +1 -1
- package/dist/components/AudioPlayer/AudioPlayer.module.cjs.map +1 -1
- package/dist/components/AudioPlayer/AudioPlayer.module.js.map +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.cjs +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.cjs.map +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.js +16 -21
- package/dist/components/AudioRecorder/AudioRecorder.js.map +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.module.cjs.map +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.module.js.map +1 -1
- package/dist/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/Avatar.module.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.module.js.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.module.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.module.js.map +1 -1
- package/dist/components/Badge/Badge.cjs.map +1 -1
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/Badge.module.cjs.map +1 -1
- package/dist/components/Badge/Badge.module.js.map +1 -1
- package/dist/components/Banner/Banner.cjs.map +1 -1
- package/dist/components/Banner/Banner.js.map +1 -1
- package/dist/components/Banner/Banner.module.cjs.map +1 -1
- package/dist/components/Banner/Banner.module.js.map +1 -1
- package/dist/components/BarList/BarList.cjs.map +1 -1
- package/dist/components/BarList/BarList.js.map +1 -1
- package/dist/components/BarList/BarList.module.cjs.map +1 -1
- package/dist/components/BarList/BarList.module.js.map +1 -1
- package/dist/components/BarList/bar-list-model.cjs.map +1 -1
- package/dist/components/BarList/bar-list-model.js.map +1 -1
- package/dist/components/BarcodeScanner/BarcodeScanner.cjs.map +1 -1
- package/dist/components/BarcodeScanner/BarcodeScanner.js.map +1 -1
- package/dist/components/BarcodeScanner/BarcodeScanner.module.cjs.map +1 -1
- package/dist/components/BarcodeScanner/BarcodeScanner.module.js.map +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.cjs.map +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.js.map +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.module.cjs.map +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.module.js.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.module.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.module.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.module.cjs.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.module.js.map +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.module.cjs.map +1 -1
- package/dist/components/Button/Button.module.js.map +1 -1
- package/dist/components/Button/ButtonContent.cjs.map +1 -1
- package/dist/components/Button/ButtonContent.js.map +1 -1
- package/dist/components/Button/ButtonSlot.cjs.map +1 -1
- package/dist/components/Button/ButtonSlot.js.map +1 -1
- package/dist/components/Button/button-class.cjs.map +1 -1
- package/dist/components/Button/button-class.js.map +1 -1
- package/dist/components/Button/link-rel.cjs.map +1 -1
- package/dist/components/Button/link-rel.js.map +1 -1
- package/dist/components/Button/slot.cjs.map +1 -1
- package/dist/components/Button/slot.js.map +1 -1
- package/dist/components/Calendar/Calendar.cjs.map +1 -1
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Calendar/Calendar.module.cjs.map +1 -1
- package/dist/components/Calendar/Calendar.module.js.map +1 -1
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.module.cjs.map +1 -1
- package/dist/components/Card/Card.module.js.map +1 -1
- package/dist/components/Carousel/Carousel.cjs.map +1 -1
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/Carousel.module.cjs.map +1 -1
- package/dist/components/Carousel/Carousel.module.js.map +1 -1
- package/dist/components/Center/Center.cjs.map +1 -1
- package/dist/components/Center/Center.js.map +1 -1
- package/dist/components/Center/Center.module.cjs.map +1 -1
- package/dist/components/Center/Center.module.js.map +1 -1
- package/dist/components/Chat/Chat.cjs.map +1 -1
- package/dist/components/Chat/Chat.js.map +1 -1
- package/dist/components/Chat/Chat.module.cjs.map +1 -1
- package/dist/components/Chat/Chat.module.js.map +1 -1
- package/dist/components/Chat/ChatActionsMenu.cjs.map +1 -1
- package/dist/components/Chat/ChatActionsMenu.js.map +1 -1
- package/dist/components/Chat/ChatAttachments.cjs.map +1 -1
- package/dist/components/Chat/ChatAttachments.js.map +1 -1
- package/dist/components/Chat/ChatBubble.cjs.map +1 -1
- package/dist/components/Chat/ChatBubble.js.map +1 -1
- package/dist/components/Chat/ChatComposer.cjs.map +1 -1
- package/dist/components/Chat/ChatComposer.js.map +1 -1
- package/dist/components/Chat/chat-groups.cjs +1 -1
- package/dist/components/Chat/chat-groups.cjs.map +1 -1
- package/dist/components/Chat/chat-groups.js +2 -6
- package/dist/components/Chat/chat-groups.js.map +1 -1
- package/dist/components/Chat/chat-receipt.cjs.map +1 -1
- package/dist/components/Chat/chat-receipt.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.js.map +1 -1
- package/dist/components/ChipInput/ChipInput.cjs +1 -1
- package/dist/components/ChipInput/ChipInput.cjs.map +1 -1
- package/dist/components/ChipInput/ChipInput.js +2 -12
- package/dist/components/ChipInput/ChipInput.js.map +1 -1
- package/dist/components/ChipInput/ChipInput.module.cjs.map +1 -1
- package/dist/components/ChipInput/ChipInput.module.js.map +1 -1
- package/dist/components/ClickOutside/ClickOutside.cjs.map +1 -1
- package/dist/components/ClickOutside/ClickOutside.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.cjs +1 -1
- package/dist/components/CodeBlock/CodeBlock.cjs.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.js +1 -1
- package/dist/components/CodeBlock/CodeBlock.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.module.cjs.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.module.js.map +1 -1
- package/dist/components/CodeBlock/tokenize.cjs +1 -1
- package/dist/components/CodeBlock/tokenize.cjs.map +1 -1
- package/dist/components/CodeBlock/tokenize.js +54 -25
- package/dist/components/CodeBlock/tokenize.js.map +1 -1
- package/dist/components/Collapsible/Collapsible.cjs.map +1 -1
- package/dist/components/Collapsible/Collapsible.js.map +1 -1
- package/dist/components/Collapsible/Collapsible.module.cjs.map +1 -1
- package/dist/components/Collapsible/Collapsible.module.js.map +1 -1
- package/dist/components/Combobox/Combobox.cjs.map +1 -1
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/Combobox/Combobox.module.cjs.map +1 -1
- package/dist/components/Combobox/Combobox.module.js.map +1 -1
- package/dist/components/Combobox/use-listbox-dismiss.cjs.map +1 -1
- package/dist/components/Combobox/use-listbox-dismiss.js.map +1 -1
- package/dist/components/Command/Command.cjs +1 -1
- package/dist/components/Command/Command.cjs.map +1 -1
- package/dist/components/Command/Command.js +4 -11
- package/dist/components/Command/Command.js.map +1 -1
- package/dist/components/Command/Command.module.cjs.map +1 -1
- package/dist/components/Command/Command.module.js.map +1 -1
- package/dist/components/ConditionalWrapper/ConditionalWrapper.cjs.map +1 -1
- package/dist/components/ConditionalWrapper/ConditionalWrapper.js.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.cjs.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/ContextMenu/ContextMenu.cjs.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.module.cjs.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.module.js.map +1 -1
- package/dist/components/CopyButton/CopyButton.cjs.map +1 -1
- package/dist/components/CopyButton/CopyButton.js.map +1 -1
- package/dist/components/CopyButton/CopyButton.module.cjs.map +1 -1
- package/dist/components/CopyButton/CopyButton.module.js.map +1 -1
- package/dist/components/DataList/DataList.cjs.map +1 -1
- package/dist/components/DataList/DataList.js.map +1 -1
- package/dist/components/DataList/DataList.module.cjs.map +1 -1
- package/dist/components/DataList/DataList.module.js.map +1 -1
- package/dist/components/DataTable/DataTable.cjs +1 -1
- package/dist/components/DataTable/DataTable.cjs.map +1 -1
- package/dist/components/DataTable/DataTable.js +6 -14
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/DataTable/DataTable.module.cjs.map +1 -1
- package/dist/components/DataTable/DataTable.module.js.map +1 -1
- package/dist/components/DataTable/EditableCell.cjs +1 -1
- package/dist/components/DataTable/EditableCell.cjs.map +1 -1
- package/dist/components/DataTable/EditableCell.js +1 -9
- package/dist/components/DataTable/EditableCell.js.map +1 -1
- package/dist/components/DataTable/LoadingRows.cjs.map +1 -1
- package/dist/components/DataTable/LoadingRows.js.map +1 -1
- package/dist/components/DataTable/edit-labels.cjs.map +1 -1
- package/dist/components/DataTable/edit-labels.js.map +1 -1
- package/dist/components/DataTable/use-dev-warnings.cjs.map +1 -1
- package/dist/components/DataTable/use-dev-warnings.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.cjs.map +1 -1
- package/dist/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.cjs.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.module.cjs.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.module.js.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.cjs.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.module.cjs.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.module.js.map +1 -1
- package/dist/components/Divider/Divider.cjs.map +1 -1
- package/dist/components/Divider/Divider.js.map +1 -1
- package/dist/components/Divider/Divider.module.cjs.map +1 -1
- package/dist/components/Divider/Divider.module.js.map +1 -1
- package/dist/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/Drawer.module.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.module.js.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.cjs +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +2 -14
- package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.module.cjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.module.js.map +1 -1
- package/dist/components/Dropzone/Dropzone.cjs.map +1 -1
- package/dist/components/Dropzone/Dropzone.js.map +1 -1
- package/dist/components/Dropzone/Dropzone.module.cjs.map +1 -1
- package/dist/components/Dropzone/Dropzone.module.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.cjs.map +1 -1
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.module.cjs.map +1 -1
- package/dist/components/EmptyState/EmptyState.module.js.map +1 -1
- package/dist/components/ErrorState/ErrorState.cjs.map +1 -1
- package/dist/components/ErrorState/ErrorState.js.map +1 -1
- package/dist/components/ErrorState/ErrorState.module.cjs.map +1 -1
- package/dist/components/ErrorState/ErrorState.module.js.map +1 -1
- package/dist/components/ErrorText/ErrorText.cjs.map +1 -1
- package/dist/components/ErrorText/ErrorText.js.map +1 -1
- package/dist/components/ErrorText/ErrorText.module.cjs.map +1 -1
- package/dist/components/ErrorText/ErrorText.module.js.map +1 -1
- package/dist/components/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/FileUpload/FileUpload.cjs.map +1 -1
- package/dist/components/FileUpload/FileUpload.js +7 -17
- package/dist/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/components/FileUpload/FileUpload.module.cjs.map +1 -1
- package/dist/components/FileUpload/FileUpload.module.js.map +1 -1
- package/dist/components/FilterBar/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar/FilterBar.js.map +1 -1
- package/dist/components/FilterBar/FilterBar.module.cjs.map +1 -1
- package/dist/components/FilterBar/FilterBar.module.js.map +1 -1
- package/dist/components/FilterBar/filter-apply.cjs.map +1 -1
- package/dist/components/FilterBar/filter-apply.js.map +1 -1
- package/dist/components/FilterBar/filter-model.cjs.map +1 -1
- package/dist/components/FilterBar/filter-model.js.map +1 -1
- package/dist/components/FilterBar/filter-query.cjs +1 -1
- package/dist/components/FilterBar/filter-query.cjs.map +1 -1
- package/dist/components/FilterBar/filter-query.js +2 -5
- package/dist/components/FilterBar/filter-query.js.map +1 -1
- package/dist/components/FilterPanel/FilterPanel.cjs.map +1 -1
- package/dist/components/FilterPanel/FilterPanel.js.map +1 -1
- package/dist/components/FilterPanel/FilterPanel.module.cjs.map +1 -1
- package/dist/components/FilterPanel/FilterPanel.module.js.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.cjs.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.js.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.module.cjs.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.module.js.map +1 -1
- package/dist/components/For/For.cjs.map +1 -1
- package/dist/components/For/For.js.map +1 -1
- package/dist/components/Form/Form.cjs.map +1 -1
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/Form.module.cjs.map +1 -1
- package/dist/components/Form/Form.module.js.map +1 -1
- package/dist/components/HoverCard/HoverCard.cjs.map +1 -1
- package/dist/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/components/HoverCard/HoverCard.module.cjs.map +1 -1
- package/dist/components/HoverCard/HoverCard.module.js.map +1 -1
- package/dist/components/Image/Image.cjs.map +1 -1
- package/dist/components/Image/Image.js.map +1 -1
- package/dist/components/Image/Image.module.cjs.map +1 -1
- package/dist/components/Image/Image.module.js.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.cjs +1 -1
- package/dist/components/ImageCropper/ImageCropper.cjs.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.js +4 -8
- package/dist/components/ImageCropper/ImageCropper.js.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.cjs.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.js.map +1 -1
- package/dist/components/ImageCropper/crop-geometry.cjs.map +1 -1
- package/dist/components/ImageCropper/crop-geometry.js.map +1 -1
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/Input.module.cjs.map +1 -1
- package/dist/components/Input/Input.module.js.map +1 -1
- package/dist/components/InstallBanner/InstallBanner.cjs.map +1 -1
- package/dist/components/InstallBanner/InstallBanner.js.map +1 -1
- package/dist/components/InstallBanner/InstallBanner.module.cjs.map +1 -1
- package/dist/components/InstallBanner/InstallBanner.module.js.map +1 -1
- package/dist/components/InstallButton/InstallButton.cjs.map +1 -1
- package/dist/components/InstallButton/InstallButton.js.map +1 -1
- package/dist/components/InstallButton/InstallButton.module.cjs.map +1 -1
- package/dist/components/InstallButton/InstallButton.module.js.map +1 -1
- package/dist/components/InstallButton/install-hints.cjs.map +1 -1
- package/dist/components/InstallButton/install-hints.js.map +1 -1
- package/dist/components/Kanban/Kanban.cjs.map +1 -1
- package/dist/components/Kanban/Kanban.js.map +1 -1
- package/dist/components/Kanban/Kanban.module.cjs.map +1 -1
- package/dist/components/Kanban/Kanban.module.js.map +1 -1
- package/dist/components/Kbd/Kbd.cjs.map +1 -1
- package/dist/components/Kbd/Kbd.js.map +1 -1
- package/dist/components/Kbd/Kbd.module.cjs.map +1 -1
- package/dist/components/Kbd/Kbd.module.js.map +1 -1
- package/dist/components/Label/Label.cjs.map +1 -1
- package/dist/components/Label/Label.js.map +1 -1
- package/dist/components/Label/Label.module.cjs.map +1 -1
- package/dist/components/Label/Label.module.js.map +1 -1
- package/dist/components/Layout/Layout.cjs.map +1 -1
- package/dist/components/Layout/Layout.js.map +1 -1
- package/dist/components/Layout/Layout.module.cjs.map +1 -1
- package/dist/components/Layout/Layout.module.js.map +1 -1
- package/dist/components/Lightbox/Lightbox.cjs +1 -1
- package/dist/components/Lightbox/Lightbox.cjs.map +1 -1
- package/dist/components/Lightbox/Lightbox.js +1 -1
- package/dist/components/Lightbox/Lightbox.js.map +1 -1
- package/dist/components/Lightbox/Lightbox.module.cjs.map +1 -1
- package/dist/components/Lightbox/Lightbox.module.js.map +1 -1
- package/dist/components/ListTile/ListTile.cjs.map +1 -1
- package/dist/components/ListTile/ListTile.js.map +1 -1
- package/dist/components/ListTile/ListTile.module.cjs.map +1 -1
- package/dist/components/ListTile/ListTile.module.js.map +1 -1
- package/dist/components/Markdown/Markdown.cjs.map +1 -1
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Markdown/Markdown.module.cjs.map +1 -1
- package/dist/components/Markdown/Markdown.module.js.map +1 -1
- package/dist/components/Markdown/markdown-parse.cjs +6 -6
- package/dist/components/Markdown/markdown-parse.cjs.map +1 -1
- package/dist/components/Markdown/markdown-parse.js +94 -96
- package/dist/components/Markdown/markdown-parse.js.map +1 -1
- package/dist/components/Masonry/Masonry.cjs.map +1 -1
- package/dist/components/Masonry/Masonry.js.map +1 -1
- package/dist/components/Masonry/Masonry.module.cjs.map +1 -1
- package/dist/components/Masonry/Masonry.module.js.map +1 -1
- package/dist/components/Masonry/masonry-layout.cjs.map +1 -1
- package/dist/components/Masonry/masonry-layout.js.map +1 -1
- package/dist/components/Menubar/Menubar.cjs.map +1 -1
- package/dist/components/Menubar/Menubar.js.map +1 -1
- package/dist/components/Menubar/Menubar.module.cjs.map +1 -1
- package/dist/components/Menubar/Menubar.module.js.map +1 -1
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/Modal.module.cjs.map +1 -1
- package/dist/components/Modal/Modal.module.js.map +1 -1
- package/dist/components/ModalsManager/ModalsManager.cjs.map +1 -1
- package/dist/components/ModalsManager/ModalsManager.js.map +1 -1
- package/dist/components/ModalsManager/ModalsManager.module.cjs.map +1 -1
- package/dist/components/ModalsManager/ModalsManager.module.js.map +1 -1
- package/dist/components/Money/Money.cjs.map +1 -1
- package/dist/components/Money/Money.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.cjs.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.module.cjs.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.module.js.map +1 -1
- package/dist/components/NProgress/NProgress.cjs.map +1 -1
- package/dist/components/NProgress/NProgress.js.map +1 -1
- package/dist/components/NProgress/NProgress.module.cjs.map +1 -1
- package/dist/components/NProgress/NProgress.module.js.map +1 -1
- package/dist/components/Navbar/Navbar.cjs.map +1 -1
- package/dist/components/Navbar/Navbar.js.map +1 -1
- package/dist/components/Navbar/Navbar.module.cjs.map +1 -1
- package/dist/components/Navbar/Navbar.module.js.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.cjs.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.js.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.module.cjs.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.module.js.map +1 -1
- package/dist/components/NavigationRail/NavigationRail.cjs.map +1 -1
- package/dist/components/NavigationRail/NavigationRail.js.map +1 -1
- package/dist/components/NavigationRail/NavigationRail.module.cjs.map +1 -1
- package/dist/components/NavigationRail/NavigationRail.module.js.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.cjs.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.js.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.module.cjs.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.module.js.map +1 -1
- package/dist/components/NotificationCenter/use-notification-inbox.cjs.map +1 -1
- package/dist/components/NotificationCenter/use-notification-inbox.js.map +1 -1
- package/dist/components/OfflineIndicator/OfflineIndicator.cjs.map +1 -1
- package/dist/components/OfflineIndicator/OfflineIndicator.js.map +1 -1
- package/dist/components/OfflineIndicator/OfflineIndicator.module.cjs.map +1 -1
- package/dist/components/OfflineIndicator/OfflineIndicator.module.js.map +1 -1
- package/dist/components/Page/Page.cjs.map +1 -1
- package/dist/components/Page/Page.js.map +1 -1
- package/dist/components/Page/Page.module.cjs.map +1 -1
- package/dist/components/Page/Page.module.js.map +1 -1
- package/dist/components/Pagination/Pagination.cjs.map +1 -1
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/Pagination.module.cjs.map +1 -1
- package/dist/components/Pagination/Pagination.module.js.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.cjs.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.module.cjs.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.module.js.map +1 -1
- package/dist/components/PinInput/PinInput.cjs.map +1 -1
- package/dist/components/PinInput/PinInput.js.map +1 -1
- package/dist/components/PinInput/PinInput.module.cjs.map +1 -1
- package/dist/components/PinInput/PinInput.module.js.map +1 -1
- package/dist/components/Popover/Popover.cjs.map +1 -1
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/Popover.module.cjs.map +1 -1
- package/dist/components/Popover/Popover.module.js.map +1 -1
- package/dist/components/Portal/Portal.cjs.map +1 -1
- package/dist/components/Portal/Portal.js.map +1 -1
- package/dist/components/Portal/anchor-position.cjs.map +1 -1
- package/dist/components/Portal/anchor-position.js.map +1 -1
- package/dist/components/Portal/escape-layer.cjs.map +1 -1
- package/dist/components/Portal/escape-layer.js.map +1 -1
- package/dist/components/Portal/portal-host.cjs.map +1 -1
- package/dist/components/Portal/portal-host.js.map +1 -1
- package/dist/components/Portal/tab-bridge.cjs +1 -1
- package/dist/components/Portal/tab-bridge.cjs.map +1 -1
- package/dist/components/Portal/tab-bridge.js +1 -5
- package/dist/components/Portal/tab-bridge.js.map +1 -1
- package/dist/components/Progress/Progress.cjs.map +1 -1
- package/dist/components/Progress/Progress.js.map +1 -1
- package/dist/components/Progress/Progress.module.cjs.map +1 -1
- package/dist/components/Progress/Progress.module.js.map +1 -1
- package/dist/components/QRCode/QRCode.cjs.map +1 -1
- package/dist/components/QRCode/QRCode.js.map +1 -1
- package/dist/components/QRCode/QRCode.module.cjs.map +1 -1
- package/dist/components/QRCode/QRCode.module.js.map +1 -1
- package/dist/components/QRCode/qr-encode.cjs +1 -1
- package/dist/components/QRCode/qr-encode.cjs.map +1 -1
- package/dist/components/QRCode/qr-encode.js +7 -13
- package/dist/components/QRCode/qr-encode.js.map +1 -1
- package/dist/components/QRCode/qr-tables.cjs.map +1 -1
- package/dist/components/QRCode/qr-tables.js.map +1 -1
- package/dist/components/Radio/Radio.cjs.map +1 -1
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/Radio.module.cjs.map +1 -1
- package/dist/components/Radio/Radio.module.js.map +1 -1
- package/dist/components/RangeSlider/RangeSlider.cjs.map +1 -1
- package/dist/components/RangeSlider/RangeSlider.js.map +1 -1
- package/dist/components/RangeSlider/RangeSlider.module.cjs.map +1 -1
- package/dist/components/RangeSlider/RangeSlider.module.js.map +1 -1
- package/dist/components/RatingStars/RatingStars.cjs.map +1 -1
- package/dist/components/RatingStars/RatingStars.js.map +1 -1
- package/dist/components/RatingStars/RatingStars.module.cjs.map +1 -1
- package/dist/components/RatingStars/RatingStars.module.js.map +1 -1
- package/dist/components/RefreshIndicator/RefreshIndicator.cjs +1 -1
- package/dist/components/RefreshIndicator/RefreshIndicator.cjs.map +1 -1
- package/dist/components/RefreshIndicator/RefreshIndicator.js +10 -18
- package/dist/components/RefreshIndicator/RefreshIndicator.js.map +1 -1
- package/dist/components/RefreshIndicator/RefreshIndicator.module.cjs.map +1 -1
- package/dist/components/RefreshIndicator/RefreshIndicator.module.js.map +1 -1
- package/dist/components/RelativeTime/RelativeTime.cjs.map +1 -1
- package/dist/components/RelativeTime/RelativeTime.js.map +1 -1
- package/dist/components/Resizable/Resizable.cjs +1 -1
- package/dist/components/Resizable/Resizable.cjs.map +1 -1
- package/dist/components/Resizable/Resizable.js +1 -9
- package/dist/components/Resizable/Resizable.js.map +1 -1
- package/dist/components/Resizable/Resizable.module.cjs.map +1 -1
- package/dist/components/Resizable/Resizable.module.js.map +1 -1
- package/dist/components/Responsive/Responsive.cjs.map +1 -1
- package/dist/components/Responsive/Responsive.js.map +1 -1
- package/dist/components/Reveal/Reveal.cjs.map +1 -1
- package/dist/components/Reveal/Reveal.js.map +1 -1
- package/dist/components/Reveal/Reveal.module.cjs.map +1 -1
- package/dist/components/Reveal/Reveal.module.js.map +1 -1
- package/dist/components/Reveal/reveal-threshold.cjs.map +1 -1
- package/dist/components/Reveal/reveal-threshold.js.map +1 -1
- package/dist/components/SafeArea/SafeArea.cjs.map +1 -1
- package/dist/components/SafeArea/SafeArea.js.map +1 -1
- package/dist/components/SafeArea/SafeArea.module.cjs.map +1 -1
- package/dist/components/SafeArea/SafeArea.module.js.map +1 -1
- package/dist/components/Scheduler/Scheduler.cjs.map +1 -1
- package/dist/components/Scheduler/Scheduler.js.map +1 -1
- package/dist/components/Scheduler/Scheduler.module.cjs.map +1 -1
- package/dist/components/Scheduler/Scheduler.module.js.map +1 -1
- package/dist/components/Scheduler/scheduler-layout.cjs.map +1 -1
- package/dist/components/Scheduler/scheduler-layout.js.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.cjs.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.module.cjs.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.module.js.map +1 -1
- package/dist/components/SearchBar/SearchBar.cjs.map +1 -1
- package/dist/components/SearchBar/SearchBar.js.map +1 -1
- package/dist/components/SearchBar/SearchBar.module.cjs.map +1 -1
- package/dist/components/SearchBar/SearchBar.module.js.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.js.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.module.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.module.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.module.cjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.module.js.map +1 -1
- package/dist/components/Select/CaretIcon.cjs.map +1 -1
- package/dist/components/Select/CaretIcon.js.map +1 -1
- package/dist/components/Select/Select.cjs.map +1 -1
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/Select.module.cjs.map +1 -1
- package/dist/components/Select/Select.module.js.map +1 -1
- package/dist/components/Select/options.cjs.map +1 -1
- package/dist/components/Select/options.js.map +1 -1
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.cjs.map +1 -1
- package/dist/components/Sidebar/Sidebar.js +13 -23
- package/dist/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.cjs.map +1 -1
- package/dist/components/Sidebar/Sidebar.module.js.map +1 -1
- package/dist/components/Sidebar/SidebarEntry.cjs.map +1 -1
- package/dist/components/Sidebar/SidebarEntry.js.map +1 -1
- package/dist/components/Sidebar/active-nav-key.cjs.map +1 -1
- package/dist/components/Sidebar/active-nav-key.js.map +1 -1
- package/dist/components/SignaturePad/SignaturePad.cjs +1 -1
- package/dist/components/SignaturePad/SignaturePad.cjs.map +1 -1
- package/dist/components/SignaturePad/SignaturePad.js +1 -5
- package/dist/components/SignaturePad/SignaturePad.js.map +1 -1
- package/dist/components/SignaturePad/SignaturePad.module.cjs.map +1 -1
- package/dist/components/SignaturePad/SignaturePad.module.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.module.js.map +1 -1
- package/dist/components/Slider/Slider.cjs.map +1 -1
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Slider/Slider.module.cjs.map +1 -1
- package/dist/components/Slider/Slider.module.js.map +1 -1
- package/dist/components/Spacer/Spacer.cjs.map +1 -1
- package/dist/components/Spacer/Spacer.js.map +1 -1
- package/dist/components/Spacer/Spacer.module.cjs.map +1 -1
- package/dist/components/Spacer/Spacer.module.js.map +1 -1
- package/dist/components/Sparkline/Sparkline.cjs.map +1 -1
- package/dist/components/Sparkline/Sparkline.js.map +1 -1
- package/dist/components/Sparkline/Sparkline.module.cjs.map +1 -1
- package/dist/components/Sparkline/Sparkline.module.js.map +1 -1
- package/dist/components/Sparkline/sparkline-geometry.cjs.map +1 -1
- package/dist/components/Sparkline/sparkline-geometry.js.map +1 -1
- package/dist/components/Spinner/Spinner.cjs.map +1 -1
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/Spinner/Spinner.module.cjs.map +1 -1
- package/dist/components/Spinner/Spinner.module.js.map +1 -1
- package/dist/components/Stat/Stat.cjs.map +1 -1
- package/dist/components/Stat/Stat.js.map +1 -1
- package/dist/components/Stat/Stat.module.cjs.map +1 -1
- package/dist/components/Stat/Stat.module.js.map +1 -1
- package/dist/components/Stepper/Stepper.cjs.map +1 -1
- package/dist/components/Stepper/Stepper.js.map +1 -1
- package/dist/components/Stepper/Stepper.module.cjs.map +1 -1
- package/dist/components/Stepper/Stepper.module.js.map +1 -1
- package/dist/components/StepperInput/StepperInput.cjs.map +1 -1
- package/dist/components/StepperInput/StepperInput.js.map +1 -1
- package/dist/components/StepperInput/StepperInput.module.cjs.map +1 -1
- package/dist/components/StepperInput/StepperInput.module.js.map +1 -1
- package/dist/components/Switch/Switch.cjs.map +1 -1
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Switch/Switch.module.cjs.map +1 -1
- package/dist/components/Switch/Switch.module.js.map +1 -1
- package/dist/components/SyncStatusBadge/SyncStatusBadge.cjs.map +1 -1
- package/dist/components/SyncStatusBadge/SyncStatusBadge.js.map +1 -1
- package/dist/components/SyncStatusBadge/SyncStatusBadge.module.cjs.map +1 -1
- package/dist/components/SyncStatusBadge/SyncStatusBadge.module.js.map +1 -1
- package/dist/components/Table/Table.cjs.map +1 -1
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/Table.module.cjs.map +1 -1
- package/dist/components/Table/Table.module.js.map +1 -1
- package/dist/components/Tabs/Tabs.cjs.map +1 -1
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/Tabs.module.cjs.map +1 -1
- package/dist/components/Tabs/Tabs.module.js.map +1 -1
- package/dist/components/Tag/Tag.cjs.map +1 -1
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Tag/Tag.module.cjs.map +1 -1
- package/dist/components/Tag/Tag.module.js.map +1 -1
- package/dist/components/Textarea/Textarea.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/Textarea/Textarea.module.cjs.map +1 -1
- package/dist/components/Textarea/Textarea.module.js.map +1 -1
- package/dist/components/TimePicker/TimePicker.cjs.map +1 -1
- package/dist/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/components/TimePicker/TimePicker.module.cjs.map +1 -1
- package/dist/components/TimePicker/TimePicker.module.js.map +1 -1
- package/dist/components/Timeline/Timeline.cjs.map +1 -1
- package/dist/components/Timeline/Timeline.js.map +1 -1
- package/dist/components/Timeline/Timeline.module.cjs.map +1 -1
- package/dist/components/Timeline/Timeline.module.js.map +1 -1
- package/dist/components/Toast/Toast.module.cjs.map +1 -1
- package/dist/components/Toast/Toast.module.js.map +1 -1
- package/dist/components/Toast/ToastProvider.cjs.map +1 -1
- package/dist/components/Toast/ToastProvider.js.map +1 -1
- package/dist/components/Toggle/Toggle.cjs.map +1 -1
- package/dist/components/Toggle/Toggle.js.map +1 -1
- package/dist/components/Toggle/Toggle.module.cjs.map +1 -1
- package/dist/components/Toggle/Toggle.module.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.cjs.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.module.cjs.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.module.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.js.map +1 -1
- package/dist/components/Tour/Tour.cjs +1 -1
- package/dist/components/Tour/Tour.cjs.map +1 -1
- package/dist/components/Tour/Tour.js +1 -5
- package/dist/components/Tour/Tour.js.map +1 -1
- package/dist/components/Tour/Tour.module.cjs.map +1 -1
- package/dist/components/Tour/Tour.module.js.map +1 -1
- package/dist/components/Tour/tour-position.cjs.map +1 -1
- package/dist/components/Tour/tour-position.js.map +1 -1
- package/dist/components/Transfer/Transfer.cjs.map +1 -1
- package/dist/components/Transfer/Transfer.js.map +1 -1
- package/dist/components/Transfer/Transfer.module.cjs.map +1 -1
- package/dist/components/Transfer/Transfer.module.js.map +1 -1
- package/dist/components/Transfer/transfer-state.cjs.map +1 -1
- package/dist/components/Transfer/transfer-state.js.map +1 -1
- package/dist/components/TreeView/TreeView.cjs.map +1 -1
- package/dist/components/TreeView/TreeView.js.map +1 -1
- package/dist/components/TreeView/TreeView.module.cjs.map +1 -1
- package/dist/components/TreeView/TreeView.module.js.map +1 -1
- package/dist/components/TruncateText/TruncateText.cjs.map +1 -1
- package/dist/components/TruncateText/TruncateText.js.map +1 -1
- package/dist/components/TruncateText/TruncateText.module.cjs.map +1 -1
- package/dist/components/TruncateText/TruncateText.module.js.map +1 -1
- package/dist/components/UpdatePrompt/UpdatePrompt.cjs.map +1 -1
- package/dist/components/UpdatePrompt/UpdatePrompt.js.map +1 -1
- package/dist/components/UpdatePrompt/UpdatePrompt.module.cjs.map +1 -1
- package/dist/components/UpdatePrompt/UpdatePrompt.module.js.map +1 -1
- package/dist/components/VideoPlayer/VideoPlayer.cjs +1 -1
- package/dist/components/VideoPlayer/VideoPlayer.cjs.map +1 -1
- package/dist/components/VideoPlayer/VideoPlayer.js +1 -7
- package/dist/components/VideoPlayer/VideoPlayer.js.map +1 -1
- package/dist/components/VideoPlayer/VideoPlayer.module.cjs.map +1 -1
- package/dist/components/VideoPlayer/VideoPlayer.module.js.map +1 -1
- package/dist/components/VideoPlayer/playback-rates.cjs.map +1 -1
- package/dist/components/VideoPlayer/playback-rates.js.map +1 -1
- package/dist/components/VirtualList/VirtualList.cjs.map +1 -1
- package/dist/components/VirtualList/VirtualList.js.map +1 -1
- package/dist/components/VirtualList/VirtualList.module.cjs.map +1 -1
- package/dist/components/VirtualList/VirtualList.module.js.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.cjs.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.js.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.module.cjs.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.module.js.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.module.cjs.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.module.js.map +1 -1
- package/dist/components/Wizard/Wizard.cjs +1 -1
- package/dist/components/Wizard/Wizard.cjs.map +1 -1
- package/dist/components/Wizard/Wizard.js +4 -11
- package/dist/components/Wizard/Wizard.js.map +1 -1
- package/dist/components/Wizard/Wizard.module.cjs.map +1 -1
- package/dist/components/Wizard/Wizard.module.js.map +1 -1
- package/dist/data/create-data-provider.cjs.map +1 -1
- package/dist/data/create-data-provider.js.map +1 -1
- package/dist/data/data-provider-context.cjs.map +1 -1
- package/dist/data/data-provider-context.js.map +1 -1
- package/dist/data/use-resource.cjs.map +1 -1
- package/dist/data/use-resource.js.map +1 -1
- package/dist/editor/RichTextEditor.cjs.map +1 -1
- package/dist/editor/RichTextEditor.js.map +1 -1
- package/dist/editor/RichTextEditor.module.cjs.map +1 -1
- package/dist/editor/RichTextEditor.module.js.map +1 -1
- package/dist/editor.js +1 -2
- package/dist/error-boundary/ErrorBoundary.cjs.map +1 -1
- package/dist/error-boundary/ErrorBoundary.js.map +1 -1
- package/dist/error-boundary/use-error-handler.cjs.map +1 -1
- package/dist/error-boundary/use-error-handler.js.map +1 -1
- package/dist/feature-flags/FeatureFlagsProvider.cjs.map +1 -1
- package/dist/feature-flags/FeatureFlagsProvider.js.map +1 -1
- package/dist/feature-flags/growthbook-adapter.cjs.map +1 -1
- package/dist/feature-flags/growthbook-adapter.js.map +1 -1
- package/dist/feature-flags/in-memory-adapter.cjs.map +1 -1
- package/dist/feature-flags/in-memory-adapter.js.map +1 -1
- package/dist/feature-flags/launchdarkly-adapter.cjs.map +1 -1
- package/dist/feature-flags/launchdarkly-adapter.js.map +1 -1
- package/dist/forms/FormField.cjs.map +1 -1
- package/dist/forms/FormField.js.map +1 -1
- package/dist/forms/br-validators.cjs.map +1 -1
- package/dist/forms/br-validators.js.map +1 -1
- package/dist/forms/masked-inputs.cjs.map +1 -1
- package/dist/forms/masked-inputs.js.map +1 -1
- package/dist/forms/use-viacep.cjs.map +1 -1
- package/dist/forms/use-viacep.js.map +1 -1
- package/dist/forms/use-zod-form.cjs.map +1 -1
- package/dist/forms/use-zod-form.js.map +1 -1
- package/dist/forms/validate-form.cjs.map +1 -1
- package/dist/forms/validate-form.js.map +1 -1
- package/dist/forms/zod-resolver.cjs.map +1 -1
- package/dist/forms/zod-resolver.js.map +1 -1
- package/dist/geo/TrajectoryMap.cjs.map +1 -1
- package/dist/geo/TrajectoryMap.js.map +1 -1
- package/dist/geo/TrajectoryMap.module.cjs.map +1 -1
- package/dist/geo/TrajectoryMap.module.js.map +1 -1
- package/dist/geo/bounds.cjs.map +1 -1
- package/dist/geo/bounds.js.map +1 -1
- package/dist/geo/create-position-tracker.cjs +1 -1
- package/dist/geo/create-position-tracker.cjs.map +1 -1
- package/dist/geo/create-position-tracker.js +1 -7
- package/dist/geo/create-position-tracker.js.map +1 -1
- package/dist/geo/distance.cjs.map +1 -1
- package/dist/geo/distance.js.map +1 -1
- package/dist/geo/estimate.cjs.map +1 -1
- package/dist/geo/estimate.js.map +1 -1
- package/dist/geo/leaflet-map.cjs.map +1 -1
- package/dist/geo/leaflet-map.js.map +1 -1
- package/dist/geo/projection.cjs.map +1 -1
- package/dist/geo/projection.js.map +1 -1
- package/dist/geo/routing.cjs.map +1 -1
- package/dist/geo/routing.js.map +1 -1
- package/dist/geo/types.cjs.map +1 -1
- package/dist/geo/types.js.map +1 -1
- package/dist/geo/use-position-tracker.cjs.map +1 -1
- package/dist/geo/use-position-tracker.js.map +1 -1
- package/dist/hooks/pwa-env.cjs.map +1 -1
- package/dist/hooks/pwa-env.js.map +1 -1
- package/dist/hooks/tab-sequence.cjs.map +1 -1
- package/dist/hooks/tab-sequence.js.map +1 -1
- package/dist/hooks/use-announce.cjs +1 -1
- package/dist/hooks/use-announce.cjs.map +1 -1
- package/dist/hooks/use-announce.js +2 -2
- package/dist/hooks/use-announce.js.map +1 -1
- package/dist/hooks/use-async.cjs.map +1 -1
- package/dist/hooks/use-async.js.map +1 -1
- package/dist/hooks/use-before-install-prompt.cjs.map +1 -1
- package/dist/hooks/use-before-install-prompt.js.map +1 -1
- package/dist/hooks/use-breakpoint.cjs.map +1 -1
- package/dist/hooks/use-breakpoint.js.map +1 -1
- package/dist/hooks/use-click-outside.cjs.map +1 -1
- package/dist/hooks/use-click-outside.js.map +1 -1
- package/dist/hooks/use-client-filter.cjs.map +1 -1
- package/dist/hooks/use-client-filter.js.map +1 -1
- package/dist/hooks/use-clipboard.cjs.map +1 -1
- package/dist/hooks/use-clipboard.js.map +1 -1
- package/dist/hooks/use-countdown.cjs.map +1 -1
- package/dist/hooks/use-countdown.js.map +1 -1
- package/dist/hooks/use-counter.cjs.map +1 -1
- package/dist/hooks/use-counter.js.map +1 -1
- package/dist/hooks/use-debounce.cjs.map +1 -1
- package/dist/hooks/use-debounce.js.map +1 -1
- package/dist/hooks/use-deep-memo.cjs.map +1 -1
- package/dist/hooks/use-deep-memo.js.map +1 -1
- package/dist/hooks/use-disclosure.cjs.map +1 -1
- package/dist/hooks/use-disclosure.js.map +1 -1
- package/dist/hooks/use-document-title.cjs.map +1 -1
- package/dist/hooks/use-document-title.js.map +1 -1
- package/dist/hooks/use-document-visibility.cjs.map +1 -1
- package/dist/hooks/use-document-visibility.js.map +1 -1
- package/dist/hooks/use-draft-filters.cjs.map +1 -1
- package/dist/hooks/use-draft-filters.js.map +1 -1
- package/dist/hooks/use-event-listener.cjs.map +1 -1
- package/dist/hooks/use-event-listener.js.map +1 -1
- package/dist/hooks/use-favicon.cjs.map +1 -1
- package/dist/hooks/use-favicon.js.map +1 -1
- package/dist/hooks/use-focus-trap.cjs.map +1 -1
- package/dist/hooks/use-focus-trap.js.map +1 -1
- package/dist/hooks/use-fullscreen-element.cjs.map +1 -1
- package/dist/hooks/use-fullscreen-element.js.map +1 -1
- package/dist/hooks/use-fullscreen.cjs +1 -1
- package/dist/hooks/use-fullscreen.cjs.map +1 -1
- package/dist/hooks/use-fullscreen.js +7 -23
- package/dist/hooks/use-fullscreen.js.map +1 -1
- package/dist/hooks/use-geolocation.cjs.map +1 -1
- package/dist/hooks/use-geolocation.js.map +1 -1
- package/dist/hooks/use-hover.cjs.map +1 -1
- package/dist/hooks/use-hover.js.map +1 -1
- package/dist/hooks/use-idle.cjs.map +1 -1
- package/dist/hooks/use-idle.js.map +1 -1
- package/dist/hooks/use-install-prompt.cjs +1 -1
- package/dist/hooks/use-install-prompt.cjs.map +1 -1
- package/dist/hooks/use-install-prompt.js +1 -1
- package/dist/hooks/use-install-prompt.js.map +1 -1
- package/dist/hooks/use-intersection-observer.cjs.map +1 -1
- package/dist/hooks/use-intersection-observer.js.map +1 -1
- package/dist/hooks/use-interval.cjs.map +1 -1
- package/dist/hooks/use-interval.js.map +1 -1
- package/dist/hooks/use-is-first-render.cjs.map +1 -1
- package/dist/hooks/use-is-first-render.js.map +1 -1
- package/dist/hooks/use-keyboard-shortcut.cjs.map +1 -1
- package/dist/hooks/use-keyboard-shortcut.js.map +1 -1
- package/dist/hooks/use-latest-ref.cjs.map +1 -1
- package/dist/hooks/use-latest-ref.js.map +1 -1
- package/dist/hooks/use-list-state.cjs.map +1 -1
- package/dist/hooks/use-list-state.js.map +1 -1
- package/dist/hooks/use-local-storage.cjs +1 -1
- package/dist/hooks/use-local-storage.cjs.map +1 -1
- package/dist/hooks/use-local-storage.js +2 -5
- package/dist/hooks/use-local-storage.js.map +1 -1
- package/dist/hooks/use-long-press-handlers.cjs.map +1 -1
- package/dist/hooks/use-long-press-handlers.js.map +1 -1
- package/dist/hooks/use-long-press.cjs.map +1 -1
- package/dist/hooks/use-long-press.js.map +1 -1
- package/dist/hooks/use-map.cjs.map +1 -1
- package/dist/hooks/use-map.js.map +1 -1
- package/dist/hooks/use-media-devices.cjs.map +1 -1
- package/dist/hooks/use-media-devices.js.map +1 -1
- package/dist/hooks/use-media-permission.cjs +1 -1
- package/dist/hooks/use-media-permission.cjs.map +1 -1
- package/dist/hooks/use-media-permission.js +2 -5
- package/dist/hooks/use-media-permission.js.map +1 -1
- package/dist/hooks/use-media-query.cjs.map +1 -1
- package/dist/hooks/use-media-query.js.map +1 -1
- package/dist/hooks/use-object-url.cjs.map +1 -1
- package/dist/hooks/use-object-url.js.map +1 -1
- package/dist/hooks/use-online.cjs.map +1 -1
- package/dist/hooks/use-online.js.map +1 -1
- package/dist/hooks/use-pagination.cjs.map +1 -1
- package/dist/hooks/use-pagination.js.map +1 -1
- package/dist/hooks/use-previous.cjs.map +1 -1
- package/dist/hooks/use-previous.js.map +1 -1
- package/dist/hooks/use-push-to-talk.cjs.map +1 -1
- package/dist/hooks/use-push-to-talk.js.map +1 -1
- package/dist/hooks/use-queue.cjs.map +1 -1
- package/dist/hooks/use-queue.js.map +1 -1
- package/dist/hooks/use-resize-observer.cjs.map +1 -1
- package/dist/hooks/use-resize-observer.js.map +1 -1
- package/dist/hooks/use-scroll-lock.cjs.map +1 -1
- package/dist/hooks/use-scroll-lock.js.map +1 -1
- package/dist/hooks/use-scroll-overflow.cjs.map +1 -1
- package/dist/hooks/use-scroll-overflow.js.map +1 -1
- package/dist/hooks/use-service-worker-update.cjs.map +1 -1
- package/dist/hooks/use-service-worker-update.js.map +1 -1
- package/dist/hooks/use-set.cjs.map +1 -1
- package/dist/hooks/use-set.js.map +1 -1
- package/dist/hooks/use-sortable.cjs.map +1 -1
- package/dist/hooks/use-sortable.js.map +1 -1
- package/dist/hooks/use-stable-callback.cjs.map +1 -1
- package/dist/hooks/use-stable-callback.js.map +1 -1
- package/dist/hooks/use-storage-estimate.cjs.map +1 -1
- package/dist/hooks/use-storage-estimate.js.map +1 -1
- package/dist/hooks/use-throttle.cjs.map +1 -1
- package/dist/hooks/use-throttle.js.map +1 -1
- package/dist/hooks/use-timeout.cjs.map +1 -1
- package/dist/hooks/use-timeout.js.map +1 -1
- package/dist/hooks/use-toggle.cjs.map +1 -1
- package/dist/hooks/use-toggle.js.map +1 -1
- package/dist/hooks/use-typewriter.cjs.map +1 -1
- package/dist/hooks/use-typewriter.js.map +1 -1
- package/dist/hooks/use-window-size.cjs.map +1 -1
- package/dist/hooks/use-window-size.js.map +1 -1
- package/dist/http/api-client.cjs.map +1 -1
- package/dist/http/api-client.js.map +1 -1
- package/dist/http/build-url.cjs.map +1 -1
- package/dist/http/build-url.js.map +1 -1
- package/dist/http/credential-scope.cjs.map +1 -1
- package/dist/http/credential-scope.js.map +1 -1
- package/dist/http/csrf.cjs.map +1 -1
- package/dist/http/csrf.js.map +1 -1
- package/dist/http/decode-response.cjs.map +1 -1
- package/dist/http/decode-response.js.map +1 -1
- package/dist/http/describe-api-error.cjs.map +1 -1
- package/dist/http/describe-api-error.js.map +1 -1
- package/dist/http/errors.cjs.map +1 -1
- package/dist/http/errors.js.map +1 -1
- package/dist/http/idempotency.cjs.map +1 -1
- package/dist/http/idempotency.js.map +1 -1
- package/dist/http/parse-response.cjs.map +1 -1
- package/dist/http/parse-response.js.map +1 -1
- package/dist/http/resumable-upload.cjs +1 -1
- package/dist/http/resumable-upload.cjs.map +1 -1
- package/dist/http/resumable-upload.js +141 -105
- package/dist/http/resumable-upload.js.map +1 -1
- package/dist/http/retry.cjs +1 -1
- package/dist/http/retry.cjs.map +1 -1
- package/dist/http/retry.js +5 -6
- package/dist/http/retry.js.map +1 -1
- package/dist/http/timeout.cjs.map +1 -1
- package/dist/http/timeout.js.map +1 -1
- package/dist/http/upload-with-progress.cjs +1 -1
- package/dist/http/upload-with-progress.cjs.map +1 -1
- package/dist/http/upload-with-progress.js +2 -7
- package/dist/http/upload-with-progress.js.map +1 -1
- package/dist/http/use-describe-api-error.cjs.map +1 -1
- package/dist/http/use-describe-api-error.js.map +1 -1
- package/dist/http/use-poll.cjs +1 -1
- package/dist/http/use-poll.cjs.map +1 -1
- package/dist/http/use-poll.js +2 -5
- package/dist/http/use-poll.js.map +1 -1
- package/dist/i18n/I18nProvider.cjs.map +1 -1
- package/dist/i18n/I18nProvider.js.map +1 -1
- package/dist/i18n/create-i18n.cjs.map +1 -1
- package/dist/i18n/create-i18n.js.map +1 -1
- package/dist/icons/Icon.cjs.map +1 -1
- package/dist/icons/Icon.js.map +1 -1
- package/dist/icons/IconPicker.cjs.map +1 -1
- package/dist/icons/IconPicker.js.map +1 -1
- package/dist/icons/IconPicker.module.cjs.map +1 -1
- package/dist/icons/IconPicker.module.js.map +1 -1
- package/dist/icons/IconProvider.cjs.map +1 -1
- package/dist/icons/IconProvider.js.map +1 -1
- package/dist/icons/alias.cjs.map +1 -1
- package/dist/icons/alias.js.map +1 -1
- package/dist/icons/generated/aliases.cjs.map +1 -1
- package/dist/icons/generated/aliases.js.map +1 -1
- package/dist/icons/generated/icon-names.cjs.map +1 -1
- package/dist/icons/generated/icon-names.js.map +1 -1
- package/dist/icons/generated/loaders.cjs.map +1 -1
- package/dist/icons/generated/loaders.js.map +1 -1
- package/dist/icons/generated/shard-00.cjs.map +1 -1
- package/dist/icons/generated/shard-00.js.map +1 -1
- package/dist/icons/generated/shard-01.cjs.map +1 -1
- package/dist/icons/generated/shard-01.js.map +1 -1
- package/dist/icons/generated/shard-02.cjs.map +1 -1
- package/dist/icons/generated/shard-02.js.map +1 -1
- package/dist/icons/generated/shard-03.cjs.map +1 -1
- package/dist/icons/generated/shard-03.js.map +1 -1
- package/dist/icons/generated/shard-04.cjs.map +1 -1
- package/dist/icons/generated/shard-04.js.map +1 -1
- package/dist/icons/generated/shard-05.cjs.map +1 -1
- package/dist/icons/generated/shard-05.js.map +1 -1
- package/dist/icons/generated/shard-06.cjs.map +1 -1
- package/dist/icons/generated/shard-06.js.map +1 -1
- package/dist/icons/generated/shard-07.cjs.map +1 -1
- package/dist/icons/generated/shard-07.js.map +1 -1
- package/dist/icons/generated/shard-08.cjs.map +1 -1
- package/dist/icons/generated/shard-08.js.map +1 -1
- package/dist/icons/generated/shard-09.cjs.map +1 -1
- package/dist/icons/generated/shard-09.js.map +1 -1
- package/dist/icons/generated/shard-10.cjs.map +1 -1
- package/dist/icons/generated/shard-10.js.map +1 -1
- package/dist/icons/generated/shard-11.cjs.map +1 -1
- package/dist/icons/generated/shard-11.js.map +1 -1
- package/dist/icons/generated/shard-12.cjs.map +1 -1
- package/dist/icons/generated/shard-12.js.map +1 -1
- package/dist/icons/generated/shard-13.cjs.map +1 -1
- package/dist/icons/generated/shard-13.js.map +1 -1
- package/dist/icons/generated/shard-14.cjs.map +1 -1
- package/dist/icons/generated/shard-14.js.map +1 -1
- package/dist/icons/generated/shard-15.cjs.map +1 -1
- package/dist/icons/generated/shard-15.js.map +1 -1
- package/dist/icons/generated/shard-16.cjs.map +1 -1
- package/dist/icons/generated/shard-16.js.map +1 -1
- package/dist/icons/generated/shard-17.cjs.map +1 -1
- package/dist/icons/generated/shard-17.js.map +1 -1
- package/dist/icons/generated/shard-18.cjs.map +1 -1
- package/dist/icons/generated/shard-18.js.map +1 -1
- package/dist/icons/generated/shard-19.cjs.map +1 -1
- package/dist/icons/generated/shard-19.js.map +1 -1
- package/dist/icons/generated/shard-20.cjs.map +1 -1
- package/dist/icons/generated/shard-20.js.map +1 -1
- package/dist/icons/generated/shard-21.cjs.map +1 -1
- package/dist/icons/generated/shard-21.js.map +1 -1
- package/dist/icons/generated/shard-22.cjs.map +1 -1
- package/dist/icons/generated/shard-22.js.map +1 -1
- package/dist/icons/generated/shard-23.cjs.map +1 -1
- package/dist/icons/generated/shard-23.js.map +1 -1
- package/dist/icons/generated/shard-24.cjs.map +1 -1
- package/dist/icons/generated/shard-24.js.map +1 -1
- package/dist/icons/generated/shard-25.cjs.map +1 -1
- package/dist/icons/generated/shard-25.js.map +1 -1
- package/dist/icons/generated/shard-26.cjs.map +1 -1
- package/dist/icons/generated/shard-26.js.map +1 -1
- package/dist/icons/generated/shard-27.cjs.map +1 -1
- package/dist/icons/generated/shard-27.js.map +1 -1
- package/dist/icons/generated/shard-28.cjs.map +1 -1
- package/dist/icons/generated/shard-28.js.map +1 -1
- package/dist/icons/generated/shard-29.cjs.map +1 -1
- package/dist/icons/generated/shard-29.js.map +1 -1
- package/dist/icons/generated/shard-30.cjs.map +1 -1
- package/dist/icons/generated/shard-30.js.map +1 -1
- package/dist/icons/generated/shard-31.cjs.map +1 -1
- package/dist/icons/generated/shard-31.js.map +1 -1
- package/dist/icons/generated/shard-32.cjs.map +1 -1
- package/dist/icons/generated/shard-32.js.map +1 -1
- package/dist/icons/generated/shard-33.cjs.map +1 -1
- package/dist/icons/generated/shard-33.js.map +1 -1
- package/dist/icons/generated/shard-34.cjs.map +1 -1
- package/dist/icons/generated/shard-34.js.map +1 -1
- package/dist/icons/generated/shard-35.cjs.map +1 -1
- package/dist/icons/generated/shard-35.js.map +1 -1
- package/dist/icons/generated/shard-36.cjs.map +1 -1
- package/dist/icons/generated/shard-36.js.map +1 -1
- package/dist/icons/generated/shard-37.cjs.map +1 -1
- package/dist/icons/generated/shard-37.js.map +1 -1
- package/dist/icons/generated/shard-38.cjs.map +1 -1
- package/dist/icons/generated/shard-38.js.map +1 -1
- package/dist/icons/generated/shard-39.cjs.map +1 -1
- package/dist/icons/generated/shard-39.js.map +1 -1
- package/dist/icons/generated/shard-40.cjs.map +1 -1
- package/dist/icons/generated/shard-40.js.map +1 -1
- package/dist/icons/generated/shard-41.cjs.map +1 -1
- package/dist/icons/generated/shard-41.js.map +1 -1
- package/dist/icons/generated/shard-42.cjs.map +1 -1
- package/dist/icons/generated/shard-42.js.map +1 -1
- package/dist/icons/generated/shard-43.cjs.map +1 -1
- package/dist/icons/generated/shard-43.js.map +1 -1
- package/dist/icons/generated/shard-44.cjs.map +1 -1
- package/dist/icons/generated/shard-44.js.map +1 -1
- package/dist/icons/generated/shard-45.cjs.map +1 -1
- package/dist/icons/generated/shard-45.js.map +1 -1
- package/dist/icons/icon-context.cjs.map +1 -1
- package/dist/icons/icon-context.js.map +1 -1
- package/dist/icons/is-icon-name.cjs.map +1 -1
- package/dist/icons/is-icon-name.js.map +1 -1
- package/dist/icons/material-symbols.cjs.map +1 -1
- package/dist/icons/material-symbols.js.map +1 -1
- package/dist/icons/normalize-icon-name.cjs.map +1 -1
- package/dist/icons/normalize-icon-name.js.map +1 -1
- package/dist/icons/shard-cache.cjs +1 -1
- package/dist/icons/shard-cache.cjs.map +1 -1
- package/dist/icons/shard-cache.js +2 -5
- package/dist/icons/shard-cache.js.map +1 -1
- package/dist/icons/use-icon.cjs.map +1 -1
- package/dist/icons/use-icon.js.map +1 -1
- package/dist/icons/validate-icon-name.cjs.map +1 -1
- package/dist/icons/validate-icon-name.js.map +1 -1
- package/dist/icons-virtual.cjs.map +1 -1
- package/dist/icons-virtual.js.map +1 -1
- package/dist/imaging/canvas.cjs.map +1 -1
- package/dist/imaging/canvas.js.map +1 -1
- package/dist/imaging/compress.cjs.map +1 -1
- package/dist/imaging/compress.js.map +1 -1
- package/dist/imaging/decode.cjs.map +1 -1
- package/dist/imaging/decode.js.map +1 -1
- package/dist/imaging/encode.cjs.map +1 -1
- package/dist/imaging/encode.js.map +1 -1
- package/dist/imaging/exceptions.cjs.map +1 -1
- package/dist/imaging/exceptions.js.map +1 -1
- package/dist/imaging/frame.cjs.map +1 -1
- package/dist/imaging/frame.js.map +1 -1
- package/dist/imaging/thumbnails.cjs.map +1 -1
- package/dist/imaging/thumbnails.js.map +1 -1
- package/dist/imaging/transform.cjs.map +1 -1
- package/dist/imaging/transform.js.map +1 -1
- package/dist/imaging/use-image-processing.cjs.map +1 -1
- package/dist/imaging/use-image-processing.js.map +1 -1
- package/dist/logger/logger.cjs.map +1 -1
- package/dist/logger/logger.js.map +1 -1
- package/dist/neural.cjs.map +1 -1
- package/dist/neural.js.map +1 -1
- package/dist/oauth/GoogleSignIn.cjs +1 -1
- package/dist/oauth/GoogleSignIn.cjs.map +1 -1
- package/dist/oauth/GoogleSignIn.js +6 -9
- package/dist/oauth/GoogleSignIn.js.map +1 -1
- package/dist/oauth/callback.cjs.map +1 -1
- package/dist/oauth/callback.js.map +1 -1
- package/dist/oauth/use-oauth-callback.cjs.map +1 -1
- package/dist/oauth/use-oauth-callback.js.map +1 -1
- package/dist/offline/conflict.cjs.map +1 -1
- package/dist/offline/conflict.js.map +1 -1
- package/dist/offline/create-offline-database.cjs.map +1 -1
- package/dist/offline/create-offline-database.js.map +1 -1
- package/dist/offline/create-offline-store.cjs +1 -1
- package/dist/offline/create-offline-store.cjs.map +1 -1
- package/dist/offline/create-offline-store.js +1 -5
- package/dist/offline/create-offline-store.js.map +1 -1
- package/dist/offline/create-offline-sync.cjs +1 -1
- package/dist/offline/create-offline-sync.cjs.map +1 -1
- package/dist/offline/create-offline-sync.js +9 -14
- package/dist/offline/create-offline-sync.js.map +1 -1
- package/dist/offline/use-offline-sync.cjs.map +1 -1
- package/dist/offline/use-offline-sync.js.map +1 -1
- package/dist/perf/cache-size.cjs.map +1 -1
- package/dist/perf/cache-size.js.map +1 -1
- package/dist/perf/device.cjs.map +1 -1
- package/dist/perf/device.js.map +1 -1
- package/dist/perf/format.cjs.map +1 -1
- package/dist/perf/format.js.map +1 -1
- package/dist/perf/profiler.cjs.map +1 -1
- package/dist/perf/profiler.js.map +1 -1
- package/dist/push/use-push-subscription.cjs.map +1 -1
- package/dist/push/use-push-subscription.js.map +1 -1
- package/dist/push/utils.cjs.map +1 -1
- package/dist/push/utils.js.map +1 -1
- package/dist/push/web-push-client.cjs.map +1 -1
- package/dist/push/web-push-client.js.map +1 -1
- package/dist/query/QueryProvider.cjs.map +1 -1
- package/dist/query/QueryProvider.js.map +1 -1
- package/dist/query/constants.cjs.map +1 -1
- package/dist/query/constants.js.map +1 -1
- package/dist/query/create-query-keys.cjs.map +1 -1
- package/dist/query/create-query-keys.js.map +1 -1
- package/dist/query/foreign-client-warning.cjs.map +1 -1
- package/dist/query/foreign-client-warning.js.map +1 -1
- package/dist/query/offline-persistence.cjs +1 -1
- package/dist/query/offline-persistence.cjs.map +1 -1
- package/dist/query/offline-persistence.js +2 -10
- package/dist/query/offline-persistence.js.map +1 -1
- package/dist/query/optimistic.cjs.map +1 -1
- package/dist/query/optimistic.js.map +1 -1
- package/dist/query/pagination.cjs.map +1 -1
- package/dist/query/pagination.js.map +1 -1
- package/dist/query/retry-policy.cjs.map +1 -1
- package/dist/query/retry-policy.js.map +1 -1
- package/dist/query/use-cursor-query.cjs.map +1 -1
- package/dist/query/use-cursor-query.js.map +1 -1
- package/dist/query/use-offline-mutation.cjs.map +1 -1
- package/dist/query/use-offline-mutation.js.map +1 -1
- package/dist/query/use-paginated-query.cjs.map +1 -1
- package/dist/query/use-paginated-query.js.map +1 -1
- package/dist/router/AppRouter.cjs.map +1 -1
- package/dist/router/AppRouter.js.map +1 -1
- package/dist/router/RouteGuard.cjs.map +1 -1
- package/dist/router/RouteGuard.js.map +1 -1
- package/dist/router/index.js +2 -2
- package/dist/share/share-or-download.cjs.map +1 -1
- package/dist/share/share-or-download.js.map +1 -1
- package/dist/share/share.cjs.map +1 -1
- package/dist/share/share.js.map +1 -1
- package/dist/sse/create-event-stream.cjs.map +1 -1
- package/dist/sse/create-event-stream.js.map +1 -1
- package/dist/sse/use-event-stream.cjs.map +1 -1
- package/dist/sse/use-event-stream.js.map +1 -1
- package/dist/store/create-selectors.cjs.map +1 -1
- package/dist/store/create-selectors.js.map +1 -1
- package/dist/store/create-store.cjs.map +1 -1
- package/dist/store/create-store.js.map +1 -1
- package/dist/sw/background-sync.cjs +1 -1
- package/dist/sw/background-sync.cjs.map +1 -1
- package/dist/sw/background-sync.js +32 -31
- package/dist/sw/background-sync.js.map +1 -1
- package/dist/sw/cache-inspect.cjs.map +1 -1
- package/dist/sw/cache-inspect.js.map +1 -1
- package/dist/sw/cache.cjs +1 -1
- package/dist/sw/cache.cjs.map +1 -1
- package/dist/sw/cache.js +2 -6
- package/dist/sw/cache.js.map +1 -1
- package/dist/sw/create-push-handler.cjs.map +1 -1
- package/dist/sw/create-push-handler.js.map +1 -1
- package/dist/sw/credential-headers.cjs.map +1 -1
- package/dist/sw/credential-headers.js.map +1 -1
- package/dist/sw/periodic-sync.cjs.map +1 -1
- package/dist/sw/periodic-sync.js.map +1 -1
- package/dist/sw/register-service-worker.cjs.map +1 -1
- package/dist/sw/register-service-worker.js.map +1 -1
- package/dist/sw/session-data.cjs.map +1 -1
- package/dist/sw/session-data.js.map +1 -1
- package/dist/sw.d.ts +46 -8
- package/dist/tabular/assets.cjs.map +1 -1
- package/dist/tabular/assets.js.map +1 -1
- package/dist/tabular/cache.cjs.map +1 -1
- package/dist/tabular/cache.js.map +1 -1
- package/dist/tabular/compact.cjs.map +1 -1
- package/dist/tabular/compact.js.map +1 -1
- package/dist/tabular/exceptions.cjs.map +1 -1
- package/dist/tabular/exceptions.js.map +1 -1
- package/dist/tabular/manifest.cjs.map +1 -1
- package/dist/tabular/manifest.js.map +1 -1
- package/dist/tabular/predictor.cjs.map +1 -1
- package/dist/tabular/predictor.js.map +1 -1
- package/dist/tabular/use-tabular-predictor.cjs.map +1 -1
- package/dist/tabular/use-tabular-predictor.js.map +1 -1
- package/dist/telemetry/TelemetryProvider.cjs.map +1 -1
- package/dist/telemetry/TelemetryProvider.js.map +1 -1
- package/dist/telemetry/app-error-adapter.cjs.map +1 -1
- package/dist/telemetry/app-error-adapter.js.map +1 -1
- package/dist/telemetry/app-error-queue.cjs.map +1 -1
- package/dist/telemetry/app-error-queue.js.map +1 -1
- package/dist/telemetry/app-error-reporter.cjs +1 -1
- package/dist/telemetry/app-error-reporter.cjs.map +1 -1
- package/dist/telemetry/app-error-reporter.js +1 -1
- package/dist/telemetry/app-error-reporter.js.map +1 -1
- package/dist/telemetry/app-error-schema.cjs.map +1 -1
- package/dist/telemetry/app-error-schema.js.map +1 -1
- package/dist/telemetry/app-error-transport.cjs.map +1 -1
- package/dist/telemetry/app-error-transport.js.map +1 -1
- package/dist/telemetry/console-adapter.cjs.map +1 -1
- package/dist/telemetry/console-adapter.js.map +1 -1
- package/dist/telemetry/describe-app-error.cjs.map +1 -1
- package/dist/telemetry/describe-app-error.js.map +1 -1
- package/dist/telemetry/posthog-adapter.cjs +1 -1
- package/dist/telemetry/posthog-adapter.cjs.map +1 -1
- package/dist/telemetry/posthog-adapter.js +1 -5
- package/dist/telemetry/posthog-adapter.js.map +1 -1
- package/dist/telemetry/sentry-adapter.cjs.map +1 -1
- package/dist/telemetry/sentry-adapter.js.map +1 -1
- package/dist/tempest-react-sdk.cjs +1 -1
- package/dist/tempest-react-sdk.d.ts +448 -15
- package/dist/tempest-react-sdk.js +119 -119
- package/dist/testing/create-mock-handlers.cjs.map +1 -1
- package/dist/testing/create-mock-handlers.js.map +1 -1
- package/dist/testing.js +1 -2
- package/dist/theme/ThemeProvider.cjs.map +1 -1
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/apply-theme.cjs.map +1 -1
- package/dist/theme/apply-theme.js.map +1 -1
- package/dist/theme/color.cjs.map +1 -1
- package/dist/theme/color.js.map +1 -1
- package/dist/theme/create-theme.cjs.map +1 -1
- package/dist/theme/create-theme.js.map +1 -1
- package/dist/theme/data-viz-ramps.cjs.map +1 -1
- package/dist/theme/data-viz-ramps.js.map +1 -1
- package/dist/theme/initial-theme.cjs.map +1 -1
- package/dist/theme/initial-theme.js.map +1 -1
- package/dist/theme/inverse-render.cjs.map +1 -1
- package/dist/theme/inverse-render.js.map +1 -1
- package/dist/theme/inverse-restore.cjs.map +1 -1
- package/dist/theme/inverse-restore.js.map +1 -1
- package/dist/theme/inverse-surface.cjs.map +1 -1
- package/dist/theme/inverse-surface.js.map +1 -1
- package/dist/theme/status-tokens.cjs.map +1 -1
- package/dist/theme/status-tokens.js.map +1 -1
- package/dist/theme/theme-presets.cjs.map +1 -1
- package/dist/theme/theme-presets.js.map +1 -1
- package/dist/utils/absent.cjs.map +1 -1
- package/dist/utils/absent.js.map +1 -1
- package/dist/utils/arrays.cjs.map +1 -1
- package/dist/utils/arrays.js.map +1 -1
- package/dist/utils/base64.cjs.map +1 -1
- package/dist/utils/base64.js.map +1 -1
- package/dist/utils/cn.cjs.map +1 -1
- package/dist/utils/cn.js.map +1 -1
- package/dist/utils/compare-values.cjs.map +1 -1
- package/dist/utils/compare-values.js.map +1 -1
- package/dist/utils/compressed-storage.cjs.map +1 -1
- package/dist/utils/compressed-storage.js.map +1 -1
- package/dist/utils/csv.cjs +3 -3
- package/dist/utils/csv.cjs.map +1 -1
- package/dist/utils/csv.js +11 -10
- package/dist/utils/csv.js.map +1 -1
- package/dist/utils/dev-mode.cjs.map +1 -1
- package/dist/utils/dev-mode.js.map +1 -1
- package/dist/utils/duplicate-instance.cjs.map +1 -1
- package/dist/utils/duplicate-instance.js.map +1 -1
- package/dist/utils/format.cjs.map +1 -1
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/functions.cjs +1 -1
- package/dist/utils/functions.cjs.map +1 -1
- package/dist/utils/functions.js +1 -1
- package/dist/utils/functions.js.map +1 -1
- package/dist/utils/guards.cjs.map +1 -1
- package/dist/utils/guards.js.map +1 -1
- package/dist/utils/ids.cjs.map +1 -1
- package/dist/utils/ids.js.map +1 -1
- package/dist/utils/intl-cache.cjs.map +1 -1
- package/dist/utils/intl-cache.js.map +1 -1
- package/dist/utils/json-frame.cjs.map +1 -1
- package/dist/utils/json-frame.js.map +1 -1
- package/dist/utils/numbers.cjs.map +1 -1
- package/dist/utils/numbers.js.map +1 -1
- package/dist/utils/objects.cjs.map +1 -1
- package/dist/utils/objects.js.map +1 -1
- package/dist/{telemetry/app-error-owner.cjs → utils/owner-fingerprint.cjs} +2 -2
- package/dist/utils/owner-fingerprint.cjs.map +1 -0
- package/dist/{telemetry/app-error-owner.js → utils/owner-fingerprint.js} +3 -3
- package/dist/utils/owner-fingerprint.js.map +1 -0
- package/dist/utils/promises.cjs.map +1 -1
- package/dist/utils/promises.js.map +1 -1
- package/dist/utils/relative-time.cjs.map +1 -1
- package/dist/utils/relative-time.js.map +1 -1
- package/dist/utils/safe-url.cjs.map +1 -1
- package/dist/utils/safe-url.js.map +1 -1
- package/dist/utils/schema-like.cjs.map +1 -1
- package/dist/utils/schema-like.js.map +1 -1
- package/dist/utils/storage.cjs +1 -1
- package/dist/utils/storage.cjs.map +1 -1
- package/dist/utils/storage.js +2 -2
- package/dist/utils/storage.js.map +1 -1
- package/dist/utils/strings.cjs.map +1 -1
- package/dist/utils/strings.js.map +1 -1
- package/dist/utils/xlsx.cjs.map +1 -1
- package/dist/utils/xlsx.js.map +1 -1
- package/dist/vision/core/canvas.cjs.map +1 -1
- package/dist/vision/core/canvas.js.map +1 -1
- package/dist/vision/core/dtypes.cjs.map +1 -1
- package/dist/vision/core/dtypes.js.map +1 -1
- package/dist/vision/core/exceptions.cjs.map +1 -1
- package/dist/vision/core/exceptions.js.map +1 -1
- package/dist/vision/core/graph.cjs.map +1 -1
- package/dist/vision/core/graph.js.map +1 -1
- package/dist/vision/core/metadata.cjs +1 -1
- package/dist/vision/core/metadata.cjs.map +1 -1
- package/dist/vision/core/metadata.js +9 -26
- package/dist/vision/core/metadata.js.map +1 -1
- package/dist/vision/core/providers.cjs.map +1 -1
- package/dist/vision/core/providers.js.map +1 -1
- package/dist/vision/core/session.cjs.map +1 -1
- package/dist/vision/core/session.js.map +1 -1
- package/dist/vision/core/timing.cjs.map +1 -1
- package/dist/vision/core/timing.js.map +1 -1
- package/dist/vision/fusion.cjs.map +1 -1
- package/dist/vision/fusion.js.map +1 -1
- package/dist/vision/index.cjs.map +1 -1
- package/dist/vision/index.js.map +1 -1
- package/dist/vision/io/image.cjs.map +1 -1
- package/dist/vision/io/image.js.map +1 -1
- package/dist/vision/labels.cjs.map +1 -1
- package/dist/vision/labels.js.map +1 -1
- package/dist/vision/luminance.cjs.map +1 -1
- package/dist/vision/luminance.js.map +1 -1
- package/dist/vision/normalization.cjs.map +1 -1
- package/dist/vision/normalization.js.map +1 -1
- package/dist/vision/postprocess/classification.cjs.map +1 -1
- package/dist/vision/postprocess/classification.js.map +1 -1
- package/dist/vision/postprocess/detection.cjs.map +1 -1
- package/dist/vision/postprocess/detection.js.map +1 -1
- package/dist/vision/postprocess/segmentation.cjs.map +1 -1
- package/dist/vision/postprocess/segmentation.js.map +1 -1
- package/dist/vision/preprocess/image.cjs.map +1 -1
- package/dist/vision/preprocess/image.js.map +1 -1
- package/dist/vision/preprocess/pipeline.cjs.map +1 -1
- package/dist/vision/preprocess/pipeline.js.map +1 -1
- package/dist/vision/results.cjs.map +1 -1
- package/dist/vision/results.js.map +1 -1
- package/dist/vision/tasks/base.cjs.map +1 -1
- package/dist/vision/tasks/base.js.map +1 -1
- package/dist/vision/tasks/classifier.cjs.map +1 -1
- package/dist/vision/tasks/classifier.js.map +1 -1
- package/dist/vision/tasks/detectClassify.cjs.map +1 -1
- package/dist/vision/tasks/detectClassify.js.map +1 -1
- package/dist/vision/tasks/detector.cjs.map +1 -1
- package/dist/vision/tasks/detector.js.map +1 -1
- package/dist/vision/tasks/segmenter.cjs.map +1 -1
- package/dist/vision/tasks/segmenter.js.map +1 -1
- package/dist/vision/types.cjs.map +1 -1
- package/dist/vision/types.js.map +1 -1
- package/dist/vision/use-camera-stream.cjs +1 -1
- package/dist/vision/use-camera-stream.cjs.map +1 -1
- package/dist/vision/use-camera-stream.js +3 -9
- package/dist/vision/use-camera-stream.js.map +1 -1
- package/dist/vision/use-live-luminance.cjs +1 -1
- package/dist/vision/use-live-luminance.cjs.map +1 -1
- package/dist/vision/use-live-luminance.js +1 -5
- package/dist/vision/use-live-luminance.js.map +1 -1
- package/dist/vite/base-url.cjs.map +1 -1
- package/dist/vite/base-url.js.map +1 -1
- package/dist/vite/create-vite-config.cjs.map +1 -1
- package/dist/vite/create-vite-config.js.map +1 -1
- package/dist/vite/narrow-tokens.cjs.map +1 -1
- package/dist/vite/narrow-tokens.js.map +1 -1
- package/dist/vite/tempest-csp.cjs +2 -2
- package/dist/vite/tempest-csp.cjs.map +1 -1
- package/dist/vite/tempest-csp.js +69 -66
- package/dist/vite/tempest-csp.js.map +1 -1
- package/dist/vite/tempest-icons.cjs.map +1 -1
- package/dist/vite/tempest-icons.js.map +1 -1
- package/dist/vite/tempest-pwa-dev-sw.cjs +1 -1
- package/dist/vite/tempest-pwa-dev-sw.cjs.map +1 -1
- package/dist/vite/tempest-pwa-dev-sw.js +9 -16
- package/dist/vite/tempest-pwa-dev-sw.js.map +1 -1
- package/dist/vite/tempest-pwa-icons.cjs.map +1 -1
- package/dist/vite/tempest-pwa-icons.js.map +1 -1
- package/dist/vite/tempest-pwa-manifest.cjs.map +1 -1
- package/dist/vite/tempest-pwa-manifest.js.map +1 -1
- package/dist/vite/tempest-styles.cjs.map +1 -1
- package/dist/vite/tempest-styles.js.map +1 -1
- package/dist/vite/tempest-vitest.cjs.map +1 -1
- package/dist/vite/tempest-vitest.js.map +1 -1
- package/dist/vite.d.ts +5 -3
- package/dist/webrtc/link-stats.cjs.map +1 -1
- package/dist/webrtc/link-stats.js.map +1 -1
- package/dist/webrtc/mesh-quality.cjs.map +1 -1
- package/dist/webrtc/mesh-quality.js.map +1 -1
- package/dist/webrtc/opus-sdp.cjs.map +1 -1
- package/dist/webrtc/opus-sdp.js.map +1 -1
- package/dist/webrtc/peer-link.cjs +1 -1
- package/dist/webrtc/peer-link.cjs.map +1 -1
- package/dist/webrtc/peer-link.js +2 -5
- package/dist/webrtc/peer-link.js.map +1 -1
- package/dist/webrtc/peer-mesh.cjs +1 -1
- package/dist/webrtc/peer-mesh.cjs.map +1 -1
- package/dist/webrtc/peer-mesh.js +8 -24
- package/dist/webrtc/peer-mesh.js.map +1 -1
- package/dist/webrtc/sender-bitrate.cjs.map +1 -1
- package/dist/webrtc/sender-bitrate.js.map +1 -1
- package/dist/webrtc/use-link-stats.cjs.map +1 -1
- package/dist/webrtc/use-link-stats.js.map +1 -1
- package/dist/ws/create-web-socket.cjs +1 -1
- package/dist/ws/create-web-socket.cjs.map +1 -1
- package/dist/ws/create-web-socket.js +4 -22
- package/dist/ws/create-web-socket.js.map +1 -1
- package/dist/ws/resilience.cjs.map +1 -1
- package/dist/ws/resilience.js.map +1 -1
- package/dist/ws/use-web-socket.cjs.map +1 -1
- package/dist/ws/use-web-socket.js.map +1 -1
- package/package.json +9 -6
- package/template/package.json +1 -1
- package/dist/telemetry/app-error-owner.cjs.map +0 -1
- package/dist/telemetry/app-error-owner.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offline-persistence.js","names":[],"sources":["../../src/query/offline-persistence.ts"],"sourcesContent":["import {\n dehydrate,\n hydrate,\n type QueryCacheNotifyEvent,\n type QueryClient,\n} from \"@tanstack/react-query\";\nimport { createOfflineStore } from \"../offline/create-offline-store\";\nimport { isDevBuild } from \"../utils/dev-mode\";\n\n/**\n * Clears still running, per `databaseName` + `key` slot, across every handle.\n *\n * A handle's `clear()` deletes by key with no ordering against other handles,\n * so a new handle created on login while the previous one is still clearing\n * could `restore()` the previous user's snapshot before the delete lands, or\n * have its first write deleted by it. Every handle's `restore()` and writes\n * wait for the slot's pending clear first; the entry is dropped once settled.\n */\nconst pendingClears = new Map<string, Promise<unknown>>();\n\n/** Options for {@link persistQueryClientOffline}. */\nexport interface OfflineQueryPersistenceOptions {\n /** The `QueryClient` to snapshot and restore. */\n queryClient: QueryClient;\n /** IndexedDB database name for the snapshot. Default `\"TempestQueryCache\"`. */\n databaseName?: string;\n /** Row key under which the snapshot is stored. Default `\"tanstack-query\"`. */\n key?: string;\n /**\n * Minimum gap between snapshot writes, in ms — cache churn is coalesced into\n * one trailing write per window. Default `1000`.\n */\n throttleMs?: number;\n}\n\n/** Options for {@link OfflineQueryPersistence.clear}. */\nexport interface OfflineQueryClearOptions {\n /**\n * Also clear the in-memory `QueryClient` (`queryClient.clear()`) once\n * persistence has stopped and the snapshot is deleted — the one-call logout.\n * Default `false`: the client belongs to the app, which may want to keep\n * public queries (a catalog, feature flags) across sessions and drop only\n * the user-scoped keys with `removeQueries`.\n */\n resetClient?: boolean;\n}\n\n/** Handle returned by {@link persistQueryClientOffline}. */\nexport interface OfflineQueryPersistence {\n /**\n * Load the persisted snapshot into the `QueryClient`. Call once on boot,\n * before rendering queries, so cached data is available offline. A no-op\n * once {@link OfflineQueryPersistence.clear} has been called.\n */\n restore: () => Promise<void>;\n /**\n * Write the current cache snapshot immediately (bypassing the throttle). A\n * no-op once {@link OfflineQueryPersistence.clear} has been called.\n */\n flush: () => Promise<void>;\n /** Stop persisting and drop the pending write. Idempotent. */\n unsubscribe: () => void;\n /**\n * End the persisted session (e.g. on logout) and delete the snapshot.\n *\n * Terminal for this handle: it cancels the pending throttled write, stops\n * persisting cache changes, waits for any write already in flight and only\n * then deletes the row — so neither a write pending in the last throttle\n * window nor cache activity after logout (the next user's first query) can\n * re-persist the previous user's responses. Afterwards `restore`/`flush`\n * are no-ops; to persist a new session, call\n * {@link persistQueryClientOffline} again after login. In a dev build\n * (`isDevBuild()`), the first `restore`, `flush` or added/updated query on\n * an ended handle logs one `console.warn` saying so, because a handle kept\n * at module scope would otherwise stop persisting in silence.\n *\n * Ordered against other handles on the same `databaseName` + `key`: until\n * this clear settles, a new handle's `restore()` and writes wait for it, so\n * a handle created on login without awaiting the logout neither hydrates\n * the previous snapshot nor has its first write deleted.\n *\n * If the delete rejects, `resetClient` still clears the client and the\n * rejection reaches the caller.\n *\n * The in-memory `QueryClient` is cleared only with `resetClient: true`, and\n * then only after persistence has stopped, so the reset itself cannot\n * trigger a write. It is opt-in because the app owns the client and the\n * shape of its logout: it may keep public queries and drop only the\n * user-scoped keys with `removeQueries`. Because persistence is already\n * off, that manual call can come before or after this one.\n *\n * Idempotent and safe to call concurrently; every call deletes the row\n * again.\n *\n * @param options - `resetClient` also clears the in-memory `QueryClient`.\n */\n clear: (options?: OfflineQueryClearOptions) => Promise<void>;\n}\n\ninterface Snapshot {\n id: string;\n state: ReturnType<typeof dehydrate>;\n}\n\n/**\n * Persist a TanStack `QueryClient` cache to IndexedDB (via\n * {@link createOfflineStore}) and restore it on boot — so a reload or a cold\n * offline start shows the last-known data instead of empty screens.\n *\n * Self-contained: uses `dehydrate`/`hydrate` from `@tanstack/react-query`\n * directly, so no `@tanstack/react-query-persist-client` dependency is needed.\n * Writes are throttled and subscribe to the query cache; call `unsubscribe` on\n * teardown. Dexie is a peer dependency of the offline store — install it.\n *\n * @param options - The client plus storage/throttle configuration.\n * @returns A handle with `restore`, `flush`, `clear` and `unsubscribe`.\n *\n * `clear()` is terminal for the handle (see {@link OfflineQueryPersistence.clear}):\n * a logout that only deleted the row used to be undone by the pending write or\n * by the next cache event, restoring the previous user's data on the next boot\n * (#440).\n *\n * @example\n * const persistence = persistQueryClientOffline({ queryClient });\n * await persistence.restore();\n *\n * async function logout(): Promise<void> {\n * await persistence.clear({ resetClient: true });\n * }\n */\nexport function persistQueryClientOffline(\n options: OfflineQueryPersistenceOptions,\n): OfflineQueryPersistence {\n const { queryClient, throttleMs = 1000 } = options;\n const key = options.key ?? \"tanstack-query\";\n const databaseName = options.databaseName ?? \"TempestQueryCache\";\n const store = createOfflineStore<Snapshot, string>({\n databaseName,\n version: 1,\n tableName: \"cache\",\n indexes: \"&id\",\n keyPath: \"id\",\n });\n\n const slot = `${databaseName}\\u0000${key}`;\n let ended = false;\n let warnedEnded = false;\n let timer: ReturnType<typeof setTimeout> | null = null;\n const inFlight = new Set<Promise<unknown>>();\n\n async function afterPendingClear(): Promise<void> {\n const pending = pendingClears.get(slot);\n if (pending) await pending;\n }\n\n function warnEnded(): void {\n if (warnedEnded || !isDevBuild()) return;\n warnedEnded = true;\n console.warn(\n \"[tempest-react-sdk] persistQueryClientOffline: handle ended by clear(); \" +\n \"create a new one after login to keep persisting.\",\n );\n }\n\n async function save(): Promise<void> {\n if (ended) return;\n await afterPendingClear();\n if (ended) return;\n const write = store.put({ id: key, state: dehydrate(queryClient) });\n inFlight.add(write);\n try {\n await write;\n } finally {\n inFlight.delete(write);\n }\n }\n\n function cancelTimer(): void {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n }\n\n function schedule(): void {\n if (timer || ended) return;\n timer = setTimeout(() => {\n timer = null;\n void save();\n }, throttleMs);\n }\n\n function onCacheEvent(event: QueryCacheNotifyEvent): void {\n if (!ended) {\n schedule();\n return;\n }\n if (event.type !== \"added\" && event.type !== \"updated\") return;\n unsubscribeCache();\n warnEnded();\n }\n\n const unsubscribeCache = queryClient.getQueryCache().subscribe(onCacheEvent);\n\n async function endSession(resetClient: boolean): Promise<void> {\n try {\n await Promise.allSettled([...inFlight]);\n await store.delete(key);\n } finally {\n if (resetClient) queryClient.clear();\n }\n }\n\n return {\n async restore() {\n if (ended) {\n warnEnded();\n return;\n }\n await afterPendingClear();\n if (ended) return;\n const snapshot = await store.get(key);\n if (snapshot && !ended) hydrate(queryClient, snapshot.state);\n },\n async flush() {\n if (ended) {\n warnEnded();\n return;\n }\n cancelTimer();\n await save();\n },\n unsubscribe() {\n cancelTimer();\n unsubscribeCache();\n },\n async clear(clearOptions = {}) {\n ended = true;\n cancelTimer();\n const previous = pendingClears.get(slot);\n const run = endSession(clearOptions.resetClient ?? false);\n const settled = Promise.allSettled([previous, run]);\n pendingClears.set(slot, settled);\n void settled.then(() => {\n if (pendingClears.get(slot) === settled) pendingClears.delete(slot);\n });\n await run;\n },\n };\n}\n"],"mappings":";;;;AAkBA,IAAM,oBAAgB,IAAI,IAA8B;AAgHxD,SAAgB,EACZ,GACuB;CACvB,IAAM,EAAE,gBAAa,gBAAa,QAAS,GACrC,IAAM,EAAQ,OAAO,kBACrB,IAAe,EAAQ,gBAAgB,qBACvC,IAAQ,EAAqC;EAC/C;EACA,SAAS;EACT,WAAW;EACX,SAAS;EACT,SAAS;CACb,CAAC,GAEK,IAAO,GAAG,EAAa,QAAQ,KACjC,IAAQ,IACR,IAAc,IACd,IAA8C,MAC5C,oBAAW,IAAI,IAAsB;CAE3C,eAAe,IAAmC;EAC9C,IAAM,IAAU,EAAc,IAAI,CAAI;EACtC,AAAI,KAAS,MAAM;CACvB;CAEA,SAAS,IAAkB;EACnB,MAAgB,EAAW,MAC/B,IAAc,IACd,QAAQ,KACJ,0HAEJ;CACJ;CAEA,eAAe,IAAsB;EAGjC,IAFI,MACJ,MAAM,EAAkB,GACpB,IAAO;EACX,IAAM,IAAQ,EAAM,IAAI;GAAE,IAAI;GAAK,OAAO,EAAU,CAAW;EAAE,CAAC;EAClE,EAAS,IAAI,CAAK;EAClB,IAAI;GACA,MAAM;EACV,UAAU;GACN,EAAS,OAAO,CAAK;EACzB;CACJ;CAEA,SAAS,IAAoB;EACzB,AAEI,OADA,aAAa,CAAK,GACV;CAEhB;CAEA,SAAS,IAAiB;EAClB,KAAS,MACb,IAAQ,iBAAiB;GAErB,AADA,IAAQ,MACR,EAAU;EACd,GAAG,CAAU;CACjB;CAEA,SAAS,EAAa,GAAoC;EACtD,IAAI,CAAC,GAAO;GACR,EAAS;GACT;EACJ;EACI,GAAM,SAAS,WAAW,EAAM,SAAS,eAC7C,EAAiB,GACjB,EAAU;CACd;CAEA,IAAM,IAAmB,EAAY,cAAc,CAAC,CAAC,UAAU,CAAY;CAE3E,eAAe,EAAW,GAAqC;EAC3D,IAAI;GAEA,AADA,MAAM,QAAQ,WAAW,CAAC,GAAG,CAAQ,CAAC,GACtC,MAAM,EAAM,OAAO,CAAG;EAC1B,UAAU;GACN,AAAI,KAAa,EAAY,MAAM;EACvC;CACJ;CAEA,OAAO;EACH,MAAM,UAAU;GACZ,IAAI,GAAO;IACP,EAAU;IACV;GACJ;GAEA,IADA,MAAM,EAAkB,GACpB,GAAO;GACX,IAAM,IAAW,MAAM,EAAM,IAAI,CAAG;GACpC,AAAI,KAAY,CAAC,KAAO,EAAQ,GAAa,EAAS,KAAK;EAC/D;EACA,MAAM,QAAQ;GACV,IAAI,GAAO;IACP,EAAU;IACV;GACJ;GAEA,AADA,EAAY,GACZ,MAAM,EAAK;EACf;EACA,cAAc;GAEV,AADA,EAAY,GACZ,EAAiB;EACrB;EACA,MAAM,MAAM,IAAe,CAAC,GAAG;GAE3B,AADA,IAAQ,IACR,EAAY;GACZ,IAAM,IAAW,EAAc,IAAI,CAAI,GACjC,IAAM,EAAW,EAAa,eAAe,EAAK,GAClD,IAAU,QAAQ,WAAW,CAAC,GAAU,CAAG,CAAC;GAKlD,AAJA,EAAc,IAAI,GAAM,CAAO,GAC/B,EAAa,WAAW;IACpB,AAAI,EAAc,IAAI,CAAI,MAAM,KAAS,EAAc,OAAO,CAAI;GACtE,CAAC,GACD,MAAM;EACV;CACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"offline-persistence.js","names":["pendingClears","persistQueryClientOffline","options","key","databaseName","store","createOfflineStore","slot","ended","warnedEnded","timer","inFlight","afterPendingClear","pending","warnEnded","isDevBuild","save","write","dehydrate","queryClient","cancelTimer","schedule","throttleMs","onCacheEvent","event","unsubscribeCache","endSession","resetClient","snapshot","hydrate","previous","run","clearOptions","settled"],"sources":["../../src/query/offline-persistence.ts"],"sourcesContent":["import {\n dehydrate,\n hydrate,\n type QueryCacheNotifyEvent,\n type QueryClient,\n} from \"@tanstack/react-query\";\nimport { createOfflineStore } from \"../offline/create-offline-store\";\nimport { isDevBuild } from \"../utils/dev-mode\";\n\n/**\n * Clears still running, per `databaseName` + `key` slot, across every handle.\n *\n * A handle's `clear()` deletes by key with no ordering against other handles,\n * so a new handle created on login while the previous one is still clearing\n * could `restore()` the previous user's snapshot before the delete lands, or\n * have its first write deleted by it. Every handle's `restore()` and writes\n * wait for the slot's pending clear first; the entry is dropped once settled.\n */\nconst pendingClears = new Map<string, Promise<unknown>>();\n\n/** Options for {@link persistQueryClientOffline}. */\nexport interface OfflineQueryPersistenceOptions {\n /** The `QueryClient` to snapshot and restore. */\n queryClient: QueryClient;\n /** IndexedDB database name for the snapshot. Default `\"TempestQueryCache\"`. */\n databaseName?: string;\n /** Row key under which the snapshot is stored. Default `\"tanstack-query\"`. */\n key?: string;\n /**\n * Minimum gap between snapshot writes, in ms — cache churn is coalesced into\n * one trailing write per window. Default `1000`.\n */\n throttleMs?: number;\n}\n\n/** Options for {@link OfflineQueryPersistence.clear}. */\nexport interface OfflineQueryClearOptions {\n /**\n * Also clear the in-memory `QueryClient` (`queryClient.clear()`) once\n * persistence has stopped and the snapshot is deleted — the one-call logout.\n * Default `false`: the client belongs to the app, which may want to keep\n * public queries (a catalog, feature flags) across sessions and drop only\n * the user-scoped keys with `removeQueries`.\n */\n resetClient?: boolean;\n}\n\n/** Handle returned by {@link persistQueryClientOffline}. */\nexport interface OfflineQueryPersistence {\n /**\n * Load the persisted snapshot into the `QueryClient`. Call once on boot,\n * before rendering queries, so cached data is available offline. A no-op\n * once {@link OfflineQueryPersistence.clear} has been called.\n */\n restore: () => Promise<void>;\n /**\n * Write the current cache snapshot immediately (bypassing the throttle). A\n * no-op once {@link OfflineQueryPersistence.clear} has been called.\n */\n flush: () => Promise<void>;\n /** Stop persisting and drop the pending write. Idempotent. */\n unsubscribe: () => void;\n /**\n * End the persisted session (e.g. on logout) and delete the snapshot.\n *\n * Terminal for this handle: it cancels the pending throttled write, stops\n * persisting cache changes, waits for any write already in flight and only\n * then deletes the row — so neither a write pending in the last throttle\n * window nor cache activity after logout (the next user's first query) can\n * re-persist the previous user's responses. Afterwards `restore`/`flush`\n * are no-ops; to persist a new session, call\n * {@link persistQueryClientOffline} again after login. In a dev build\n * (`isDevBuild()`), the first `restore`, `flush` or added/updated query on\n * an ended handle logs one `console.warn` saying so, because a handle kept\n * at module scope would otherwise stop persisting in silence.\n *\n * Ordered against other handles on the same `databaseName` + `key`: until\n * this clear settles, a new handle's `restore()` and writes wait for it, so\n * a handle created on login without awaiting the logout neither hydrates\n * the previous snapshot nor has its first write deleted.\n *\n * If the delete rejects, `resetClient` still clears the client and the\n * rejection reaches the caller.\n *\n * The in-memory `QueryClient` is cleared only with `resetClient: true`, and\n * then only after persistence has stopped, so the reset itself cannot\n * trigger a write. It is opt-in because the app owns the client and the\n * shape of its logout: it may keep public queries and drop only the\n * user-scoped keys with `removeQueries`. Because persistence is already\n * off, that manual call can come before or after this one.\n *\n * Idempotent and safe to call concurrently; every call deletes the row\n * again.\n *\n * @param options - `resetClient` also clears the in-memory `QueryClient`.\n */\n clear: (options?: OfflineQueryClearOptions) => Promise<void>;\n}\n\ninterface Snapshot {\n id: string;\n state: ReturnType<typeof dehydrate>;\n}\n\n/**\n * Persist a TanStack `QueryClient` cache to IndexedDB (via\n * {@link createOfflineStore}) and restore it on boot — so a reload or a cold\n * offline start shows the last-known data instead of empty screens.\n *\n * Self-contained: uses `dehydrate`/`hydrate` from `@tanstack/react-query`\n * directly, so no `@tanstack/react-query-persist-client` dependency is needed.\n * Writes are throttled and subscribe to the query cache; call `unsubscribe` on\n * teardown. Dexie is a peer dependency of the offline store — install it.\n *\n * @param options - The client plus storage/throttle configuration.\n * @returns A handle with `restore`, `flush`, `clear` and `unsubscribe`.\n *\n * `clear()` is terminal for the handle (see {@link OfflineQueryPersistence.clear}):\n * a logout that only deleted the row used to be undone by the pending write or\n * by the next cache event, restoring the previous user's data on the next boot\n * (#440).\n *\n * @example\n * const persistence = persistQueryClientOffline({ queryClient });\n * await persistence.restore();\n *\n * async function logout(): Promise<void> {\n * await persistence.clear({ resetClient: true });\n * }\n */\nexport function persistQueryClientOffline(\n options: OfflineQueryPersistenceOptions,\n): OfflineQueryPersistence {\n const { queryClient, throttleMs = 1000 } = options;\n const key = options.key ?? \"tanstack-query\";\n const databaseName = options.databaseName ?? \"TempestQueryCache\";\n const store = createOfflineStore<Snapshot, string>({\n databaseName,\n version: 1,\n tableName: \"cache\",\n indexes: \"&id\",\n keyPath: \"id\",\n });\n\n const slot = `${databaseName}\\u0000${key}`;\n let ended = false;\n let warnedEnded = false;\n let timer: ReturnType<typeof setTimeout> | null = null;\n const inFlight = new Set<Promise<unknown>>();\n\n async function afterPendingClear(): Promise<void> {\n const pending = pendingClears.get(slot);\n if (pending) await pending;\n }\n\n function warnEnded(): void {\n if (warnedEnded || !isDevBuild()) return;\n warnedEnded = true;\n console.warn(\n \"[tempest-react-sdk] persistQueryClientOffline: handle ended by clear(); \" +\n \"create a new one after login to keep persisting.\",\n );\n }\n\n async function save(): Promise<void> {\n if (ended) return;\n await afterPendingClear();\n if (ended) return;\n const write = store.put({ id: key, state: dehydrate(queryClient) });\n inFlight.add(write);\n try {\n await write;\n } finally {\n inFlight.delete(write);\n }\n }\n\n function cancelTimer(): void {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n }\n\n function schedule(): void {\n if (timer || ended) return;\n timer = setTimeout(() => {\n timer = null;\n void save();\n }, throttleMs);\n }\n\n function onCacheEvent(event: QueryCacheNotifyEvent): void {\n if (!ended) {\n schedule();\n return;\n }\n if (event.type !== \"added\" && event.type !== \"updated\") return;\n unsubscribeCache();\n warnEnded();\n }\n\n const unsubscribeCache = queryClient.getQueryCache().subscribe(onCacheEvent);\n\n async function endSession(resetClient: boolean): Promise<void> {\n try {\n await Promise.allSettled([...inFlight]);\n await store.delete(key);\n } finally {\n if (resetClient) queryClient.clear();\n }\n }\n\n return {\n async restore() {\n if (ended) {\n warnEnded();\n return;\n }\n await afterPendingClear();\n if (ended) return;\n const snapshot = await store.get(key);\n if (snapshot && !ended) hydrate(queryClient, snapshot.state);\n },\n async flush() {\n if (ended) {\n warnEnded();\n return;\n }\n cancelTimer();\n await save();\n },\n unsubscribe() {\n cancelTimer();\n unsubscribeCache();\n },\n async clear(clearOptions = {}) {\n ended = true;\n cancelTimer();\n const previous = pendingClears.get(slot);\n const run = endSession(clearOptions.resetClient ?? false);\n const settled = Promise.allSettled([previous, run]);\n pendingClears.set(slot, settled);\n void settled.then(() => {\n if (pendingClears.get(slot) === settled) pendingClears.delete(slot);\n });\n await run;\n },\n };\n}\n"],"mappings":";;;;AAkBA,IAAMA,oBAAgB,IAAI,IAA8B;AAgHxD,SAAgBC,EACZ,GACuB;CACvB,IAAM,EAAE,gBAAa,gBAAa,QAASC,GACrCC,IAAMD,EAAQ,OAAO,kBACrBE,IAAeF,EAAQ,gBAAgB,qBACvCG,IAAQC,EAAqC;EAC/C;EACA,SAAS;EACT,WAAW;EACX,SAAS;EACT,SAAS;CACb,CAAC,GAEKC,IAAO,GAAGH,EAAa,QAAQD,KACjCK,IAAQ,IACRC,IAAc,IACdC,IAA8C,MAC5CC,oBAAW,IAAI,IAAsB;CAE3C,eAAeC,IAAmC;EAC9C,IAAMC,IAAUb,EAAc,IAAIO,CAAI;EACtC,AAAIM,KAAS,MAAMA;CACvB;CAEA,SAASC,IAAkB;EACvB,AAAI,MAAgBC,EAAW,MAC/B,IAAc,IACd,QAAQ,KACJ,0HAEJ;CACJ;CAEA,eAAeC,IAAsB;EAGjC,IAFIR,MACJ,MAAMI,EAAkB,GACpBJ,IAAO;EACX,IAAMS,IAAQZ,EAAM,IAAI;GAAE,IAAIF;GAAK,OAAOe,EAAUC,CAAW;EAAE,CAAC;EAClE,EAAS,IAAIF,CAAK;EAClB,IAAI;GACA,MAAMA;EACV,UAAU;GACN,EAAS,OAAOA,CAAK;EACzB;CACJ;CAEA,SAASG,IAAoB;EACzB,AAEIV,OADA,aAAaA,CAAK,GACV;CAEhB;CAEA,SAASW,IAAiB;EACtB,AAAIX,KAASF,MACb,IAAQ,iBAAiB;GAErB,AADA,IAAQ,MACRQ,EAAU;EACd,GAAGM,CAAU;CACjB;CAEA,SAASC,EAAa,GAAoC;EACtD,AAAKf,KAIDgB,EAAM,SAAS,WAAWA,EAAM,SAAS,eAC7CC,EAAiB,GACjBX,EAAU,KALNO,EAAS;CAMjB;CAEA,IAAMI,IAAmBN,EAAY,cAAc,CAAC,CAAC,UAAUI,CAAY;CAE3E,eAAeG,EAAW,GAAqC;EAC3D,IAAI;GAEA,AADA,MAAM,QAAQ,WAAW,CAAC,GAAGf,CAAQ,CAAC,GACtC,MAAMN,EAAM,OAAOF,CAAG;EAC1B,UAAU;GACN,AAAIwB,KAAaR,EAAY,MAAM;EACvC;CACJ;CAEA,OAAO;EACH,MAAM,UAAU;GACZ,IAAIX,GAAO;IACP,EAAU;IACV;GACJ;GAEA,IADA,MAAMI,EAAkB,GACpBJ,GAAO;GACX,IAAMoB,IAAW,MAAMvB,EAAM,IAAIF,CAAG;GACpC,AAAIyB,KAAY,CAACpB,KAAOqB,EAAQV,GAAaS,EAAS,KAAK;EAC/D;EACA,MAAM,QAAQ;GACV,AAAIpB,IACAM,EAAU,KAGdM,EAAY,GACZ,MAAMJ,EAAK;EACf;EACA,cAAc;GAEV,AADAI,EAAY,GACZK,EAAiB;EACrB;EACA,MAAM,MAAM,IAAe,CAAC,GAAG;GAE3B,AADA,IAAQ,IACRL,EAAY;GACZ,IAAMU,IAAW9B,EAAc,IAAIO,CAAI,GACjCwB,IAAML,EAAWM,EAAa,eAAe,EAAK,GAClDC,IAAU,QAAQ,WAAW,CAACH,GAAUC,CAAG,CAAC;GAKlD,AAJA/B,EAAc,IAAIO,GAAM0B,CAAO,GAC/BA,EAAa,WAAW;IACpB,AAAIjC,EAAc,IAAIO,CAAI,MAAM0B,KAASjC,EAAc,OAAOO,CAAI;GACtE,CAAC,GACD,MAAMwB;EACV;CACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optimistic.cjs","names":[],"sources":["../../src/query/optimistic.ts"],"sourcesContent":["/**\n * Ready-made `applyOptimistic` builders for {@link useOfflineMutation} over a\n * list-shaped query cache (`TData = T[]`). They cover the two most common\n * optimistic edits — insert-or-update and remove — so callers stop hand-writing\n * the array spread. Both compare records by an id field (`\"id\"` by default) and\n * treat the mutation variables as the record itself.\n */\n\n/**\n * Build an `applyOptimistic` that inserts the item when absent or shallow-merges\n * it into the existing entry (matched by `idField`). New items append to the end.\n *\n * @typeParam T - The list item shape.\n * @param idField - The identity field. Default `\"id\"`.\n * @returns An `(current, item) => T[]` patcher for a list cache.\n *\n * @example\n * useOfflineMutation<Note, Note[], Note>({\n * sync, queryKey: [\"notes\"],\n * toEntry: (n) => ({ op: \"update\", recordId: n.id, payload: n }),\n * applyOptimistic: upsertById(),\n * });\n */\nexport function upsertById<T>(\n idField: keyof T = \"id\" as keyof T,\n): (current: T[] | undefined, item: T) => T[] {\n return (current = [], item) => {\n const index = current.findIndex((entry) => entry[idField] === item[idField]);\n if (index === -1) return [...current, item];\n const next = current.slice();\n next[index] = { ...current[index], ...item };\n return next;\n };\n}\n\n/**\n * Build an `applyOptimistic` that removes the entry matching the item's id\n * (by `idField`) from the list. For `delete` mutations, pass variables carrying\n * at least the id field.\n *\n * @typeParam T - The list item shape.\n * @param idField - The identity field. Default `\"id\"`.\n * @returns An `(current, item) => T[]` patcher for a list cache.\n *\n * @example\n * useOfflineMutation<{ id: string }, Note[], Note>({\n * sync, queryKey: [\"notes\"],\n * toEntry: ({ id }) => ({ op: \"delete\", recordId: id }),\n * applyOptimistic: removeById(),\n * });\n */\nexport function removeById<T, V extends Partial<Record<keyof T, unknown>> = T>(\n idField: keyof T = \"id\" as keyof T,\n): (current: T[] | undefined, item: V) => T[] {\n return (current = [], item) => {\n const targetId = (item as Record<keyof T, unknown>)[idField];\n return current.filter((entry) => entry[idField] !== targetId);\n };\n}\n"],"mappings":"AAuBA,
|
|
1
|
+
{"version":3,"file":"optimistic.cjs","names":["upsertById","index","current","entry","idField","item","next","removeById","targetId"],"sources":["../../src/query/optimistic.ts"],"sourcesContent":["/**\n * Ready-made `applyOptimistic` builders for {@link useOfflineMutation} over a\n * list-shaped query cache (`TData = T[]`). They cover the two most common\n * optimistic edits — insert-or-update and remove — so callers stop hand-writing\n * the array spread. Both compare records by an id field (`\"id\"` by default) and\n * treat the mutation variables as the record itself.\n */\n\n/**\n * Build an `applyOptimistic` that inserts the item when absent or shallow-merges\n * it into the existing entry (matched by `idField`). New items append to the end.\n *\n * @typeParam T - The list item shape.\n * @param idField - The identity field. Default `\"id\"`.\n * @returns An `(current, item) => T[]` patcher for a list cache.\n *\n * @example\n * useOfflineMutation<Note, Note[], Note>({\n * sync, queryKey: [\"notes\"],\n * toEntry: (n) => ({ op: \"update\", recordId: n.id, payload: n }),\n * applyOptimistic: upsertById(),\n * });\n */\nexport function upsertById<T>(\n idField: keyof T = \"id\" as keyof T,\n): (current: T[] | undefined, item: T) => T[] {\n return (current = [], item) => {\n const index = current.findIndex((entry) => entry[idField] === item[idField]);\n if (index === -1) return [...current, item];\n const next = current.slice();\n next[index] = { ...current[index], ...item };\n return next;\n };\n}\n\n/**\n * Build an `applyOptimistic` that removes the entry matching the item's id\n * (by `idField`) from the list. For `delete` mutations, pass variables carrying\n * at least the id field.\n *\n * @typeParam T - The list item shape.\n * @param idField - The identity field. Default `\"id\"`.\n * @returns An `(current, item) => T[]` patcher for a list cache.\n *\n * @example\n * useOfflineMutation<{ id: string }, Note[], Note>({\n * sync, queryKey: [\"notes\"],\n * toEntry: ({ id }) => ({ op: \"delete\", recordId: id }),\n * applyOptimistic: removeById(),\n * });\n */\nexport function removeById<T, V extends Partial<Record<keyof T, unknown>> = T>(\n idField: keyof T = \"id\" as keyof T,\n): (current: T[] | undefined, item: V) => T[] {\n return (current = [], item) => {\n const targetId = (item as Record<keyof T, unknown>)[idField];\n return current.filter((entry) => entry[idField] !== targetId);\n };\n}\n"],"mappings":"AAuBA,SAAgBA,EACZ,EAAmB,KACuB,CAC1C,OAAQ,EAAU,CAAC,EAAG,IAAS,CAC3B,IAAMC,EAAQC,EAAQ,UAAW,GAAUC,EAAMC,KAAaC,EAAKD,EAAQ,EAC3E,GAAIH,IAAU,GAAI,MAAO,CAAC,GAAGC,EAASG,CAAI,EAC1C,IAAMC,EAAOJ,EAAQ,MAAM,EAE3B,MADA,GAAKD,GAAS,CAAE,GAAGC,EAAQD,GAAQ,GAAGI,CAAK,EACpCC,CACX,CACJ,CAkBA,SAAgBC,EACZ,EAAmB,KACuB,CAC1C,OAAQ,EAAU,CAAC,EAAG,IAAS,CAC3B,IAAMC,EAAYH,EAAkCD,GACpD,OAAOF,EAAQ,OAAQ,GAAUC,EAAMC,KAAaI,CAAQ,CAChE,CACJ,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optimistic.js","names":[],"sources":["../../src/query/optimistic.ts"],"sourcesContent":["/**\n * Ready-made `applyOptimistic` builders for {@link useOfflineMutation} over a\n * list-shaped query cache (`TData = T[]`). They cover the two most common\n * optimistic edits — insert-or-update and remove — so callers stop hand-writing\n * the array spread. Both compare records by an id field (`\"id\"` by default) and\n * treat the mutation variables as the record itself.\n */\n\n/**\n * Build an `applyOptimistic` that inserts the item when absent or shallow-merges\n * it into the existing entry (matched by `idField`). New items append to the end.\n *\n * @typeParam T - The list item shape.\n * @param idField - The identity field. Default `\"id\"`.\n * @returns An `(current, item) => T[]` patcher for a list cache.\n *\n * @example\n * useOfflineMutation<Note, Note[], Note>({\n * sync, queryKey: [\"notes\"],\n * toEntry: (n) => ({ op: \"update\", recordId: n.id, payload: n }),\n * applyOptimistic: upsertById(),\n * });\n */\nexport function upsertById<T>(\n idField: keyof T = \"id\" as keyof T,\n): (current: T[] | undefined, item: T) => T[] {\n return (current = [], item) => {\n const index = current.findIndex((entry) => entry[idField] === item[idField]);\n if (index === -1) return [...current, item];\n const next = current.slice();\n next[index] = { ...current[index], ...item };\n return next;\n };\n}\n\n/**\n * Build an `applyOptimistic` that removes the entry matching the item's id\n * (by `idField`) from the list. For `delete` mutations, pass variables carrying\n * at least the id field.\n *\n * @typeParam T - The list item shape.\n * @param idField - The identity field. Default `\"id\"`.\n * @returns An `(current, item) => T[]` patcher for a list cache.\n *\n * @example\n * useOfflineMutation<{ id: string }, Note[], Note>({\n * sync, queryKey: [\"notes\"],\n * toEntry: ({ id }) => ({ op: \"delete\", recordId: id }),\n * applyOptimistic: removeById(),\n * });\n */\nexport function removeById<T, V extends Partial<Record<keyof T, unknown>> = T>(\n idField: keyof T = \"id\" as keyof T,\n): (current: T[] | undefined, item: V) => T[] {\n return (current = [], item) => {\n const targetId = (item as Record<keyof T, unknown>)[idField];\n return current.filter((entry) => entry[idField] !== targetId);\n };\n}\n"],"mappings":";AAuBA,
|
|
1
|
+
{"version":3,"file":"optimistic.js","names":["upsertById","index","current","entry","idField","item","next","removeById","targetId"],"sources":["../../src/query/optimistic.ts"],"sourcesContent":["/**\n * Ready-made `applyOptimistic` builders for {@link useOfflineMutation} over a\n * list-shaped query cache (`TData = T[]`). They cover the two most common\n * optimistic edits — insert-or-update and remove — so callers stop hand-writing\n * the array spread. Both compare records by an id field (`\"id\"` by default) and\n * treat the mutation variables as the record itself.\n */\n\n/**\n * Build an `applyOptimistic` that inserts the item when absent or shallow-merges\n * it into the existing entry (matched by `idField`). New items append to the end.\n *\n * @typeParam T - The list item shape.\n * @param idField - The identity field. Default `\"id\"`.\n * @returns An `(current, item) => T[]` patcher for a list cache.\n *\n * @example\n * useOfflineMutation<Note, Note[], Note>({\n * sync, queryKey: [\"notes\"],\n * toEntry: (n) => ({ op: \"update\", recordId: n.id, payload: n }),\n * applyOptimistic: upsertById(),\n * });\n */\nexport function upsertById<T>(\n idField: keyof T = \"id\" as keyof T,\n): (current: T[] | undefined, item: T) => T[] {\n return (current = [], item) => {\n const index = current.findIndex((entry) => entry[idField] === item[idField]);\n if (index === -1) return [...current, item];\n const next = current.slice();\n next[index] = { ...current[index], ...item };\n return next;\n };\n}\n\n/**\n * Build an `applyOptimistic` that removes the entry matching the item's id\n * (by `idField`) from the list. For `delete` mutations, pass variables carrying\n * at least the id field.\n *\n * @typeParam T - The list item shape.\n * @param idField - The identity field. Default `\"id\"`.\n * @returns An `(current, item) => T[]` patcher for a list cache.\n *\n * @example\n * useOfflineMutation<{ id: string }, Note[], Note>({\n * sync, queryKey: [\"notes\"],\n * toEntry: ({ id }) => ({ op: \"delete\", recordId: id }),\n * applyOptimistic: removeById(),\n * });\n */\nexport function removeById<T, V extends Partial<Record<keyof T, unknown>> = T>(\n idField: keyof T = \"id\" as keyof T,\n): (current: T[] | undefined, item: V) => T[] {\n return (current = [], item) => {\n const targetId = (item as Record<keyof T, unknown>)[idField];\n return current.filter((entry) => entry[idField] !== targetId);\n };\n}\n"],"mappings":";AAuBA,SAAgBA,EACZ,IAAmB,MACuB;CAC1C,QAAQ,IAAU,CAAC,GAAG,MAAS;EAC3B,IAAMC,IAAQC,EAAQ,WAAW,MAAUC,EAAMC,OAAaC,EAAKD,EAAQ;EAC3E,IAAIH,MAAU,IAAI,OAAO,CAAC,GAAGC,GAASG,CAAI;EAC1C,IAAMC,IAAOJ,EAAQ,MAAM;EAE3B,OADA,EAAKD,KAAS;GAAE,GAAGC,EAAQD;GAAQ,GAAGI;EAAK,GACpCC;CACX;AACJ;AAkBA,SAAgBC,EACZ,IAAmB,MACuB;CAC1C,QAAQ,IAAU,CAAC,GAAG,MAAS;EAC3B,IAAMC,IAAYH,EAAkCD;EACpD,OAAOF,EAAQ,QAAQ,MAAUC,EAAMC,OAAaI,CAAQ;CAChE;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.cjs","names":[],"sources":["../../src/query/pagination.ts"],"sourcesContent":["// Contracts mirroring the Tempest FastAPI SDK pagination envelopes, so a\n// React frontend consumes them with no manual mapping.\n//\n// Offset (fastapi-pagination `Page` / BasePaginationSchema):\n// { items, total, page, size, pages } (some configs name the size `page_size`)\n// Cursor (CursorPaginationSchema):\n// { items, next_cursor, has_more, limit }\n\n/** Offset-paginated response envelope (fastapi-pagination `Page[T]`). */\nexport interface OffsetPage<T> {\n /** The rows for the current page. */\n items: T[];\n /** Total number of matching rows across all pages. */\n total: number;\n /** Current 1-based page number. */\n page: number;\n /** Total number of pages. */\n pages: number;\n /** Page size — fastapi-pagination emits `size`. */\n size?: number;\n /** Page size — some backends name it `page_size` instead. */\n page_size?: number;\n}\n\n/** Cursor-paginated response envelope (`CursorPaginationSchema[T]`). */\nexport interface CursorPage<T> {\n /** The rows for this batch. */\n items: T[];\n /** Opaque cursor for the next batch, or null when exhausted. Pass it back verbatim. */\n next_cursor: string | null;\n /** Whether another batch exists. */\n has_more: boolean;\n /** Batch size used for this query. */\n limit: number;\n}\n\n/** Offset filter query params (fastapi-pagination / `BasePaginationFilterSchema`). */\nexport interface OffsetParams {\n page?: number;\n /** Page size — fastapi-pagination convention. */\n size?: number;\n /** Page size — `page_size` convention. */\n page_size?: number;\n order_by?: string;\n ascending?: boolean;\n}\n\n/** Cursor filter query params (`CursorPaginationFilterSchema`). */\nexport interface CursorParams {\n cursor?: string | null;\n limit?: number;\n order_by?: string;\n ascending?: boolean;\n}\n\n/**\n * Type guard for an {@link OffsetPage} envelope.\n *\n * @param value - The unknown value to test.\n * @returns Whether it carries `items` + `total` + `page` + `pages`.\n */\nexport function isOffsetPage<T = unknown>(value: unknown): value is OffsetPage<T> {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return Array.isArray(v.items) && typeof v.total === \"number\" && typeof v.pages === \"number\";\n}\n\n/**\n * Type guard for a {@link CursorPage} envelope.\n *\n * @param value - The unknown value to test.\n * @returns Whether it carries `items` + `has_more` + a `next_cursor` key.\n */\nexport function isCursorPage<T = unknown>(value: unknown): value is CursorPage<T> {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return Array.isArray(v.items) && typeof v.has_more === \"boolean\" && \"next_cursor\" in v;\n}\n\n/**\n * Build an empty {@link OffsetPage} — handy as `placeholderData`/`initialData`.\n *\n * @param pageSize - The page size to report (default 20).\n * @returns An empty offset page on page 1.\n */\nexport function emptyOffsetPage<T>(pageSize = 20): OffsetPage<T> {\n return { items: [], total: 0, page: 1, size: pageSize, pages: 0 };\n}\n"],"mappings":"AA6DA,
|
|
1
|
+
{"version":3,"file":"pagination.cjs","names":["isOffsetPage","value","v","isCursorPage","emptyOffsetPage","pageSize"],"sources":["../../src/query/pagination.ts"],"sourcesContent":["// Contracts mirroring the Tempest FastAPI SDK pagination envelopes, so a\n// React frontend consumes them with no manual mapping.\n//\n// Offset (fastapi-pagination `Page` / BasePaginationSchema):\n// { items, total, page, size, pages } (some configs name the size `page_size`)\n// Cursor (CursorPaginationSchema):\n// { items, next_cursor, has_more, limit }\n\n/** Offset-paginated response envelope (fastapi-pagination `Page[T]`). */\nexport interface OffsetPage<T> {\n /** The rows for the current page. */\n items: T[];\n /** Total number of matching rows across all pages. */\n total: number;\n /** Current 1-based page number. */\n page: number;\n /** Total number of pages. */\n pages: number;\n /** Page size — fastapi-pagination emits `size`. */\n size?: number;\n /** Page size — some backends name it `page_size` instead. */\n page_size?: number;\n}\n\n/** Cursor-paginated response envelope (`CursorPaginationSchema[T]`). */\nexport interface CursorPage<T> {\n /** The rows for this batch. */\n items: T[];\n /** Opaque cursor for the next batch, or null when exhausted. Pass it back verbatim. */\n next_cursor: string | null;\n /** Whether another batch exists. */\n has_more: boolean;\n /** Batch size used for this query. */\n limit: number;\n}\n\n/** Offset filter query params (fastapi-pagination / `BasePaginationFilterSchema`). */\nexport interface OffsetParams {\n page?: number;\n /** Page size — fastapi-pagination convention. */\n size?: number;\n /** Page size — `page_size` convention. */\n page_size?: number;\n order_by?: string;\n ascending?: boolean;\n}\n\n/** Cursor filter query params (`CursorPaginationFilterSchema`). */\nexport interface CursorParams {\n cursor?: string | null;\n limit?: number;\n order_by?: string;\n ascending?: boolean;\n}\n\n/**\n * Type guard for an {@link OffsetPage} envelope.\n *\n * @param value - The unknown value to test.\n * @returns Whether it carries `items` + `total` + `page` + `pages`.\n */\nexport function isOffsetPage<T = unknown>(value: unknown): value is OffsetPage<T> {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return Array.isArray(v.items) && typeof v.total === \"number\" && typeof v.pages === \"number\";\n}\n\n/**\n * Type guard for a {@link CursorPage} envelope.\n *\n * @param value - The unknown value to test.\n * @returns Whether it carries `items` + `has_more` + a `next_cursor` key.\n */\nexport function isCursorPage<T = unknown>(value: unknown): value is CursorPage<T> {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return Array.isArray(v.items) && typeof v.has_more === \"boolean\" && \"next_cursor\" in v;\n}\n\n/**\n * Build an empty {@link OffsetPage} — handy as `placeholderData`/`initialData`.\n *\n * @param pageSize - The page size to report (default 20).\n * @returns An empty offset page on page 1.\n */\nexport function emptyOffsetPage<T>(pageSize = 20): OffsetPage<T> {\n return { items: [], total: 0, page: 1, size: pageSize, pages: 0 };\n}\n"],"mappings":"AA6DA,SAAgBA,EAA0B,EAAwC,CAC9E,GAAI,OAAOC,GAAU,WAAYA,EAAgB,MAAO,GACxD,IAAMC,EAAID,EACV,OAAO,MAAM,QAAQC,EAAE,KAAK,GAAK,OAAOA,EAAE,OAAU,UAAY,OAAOA,EAAE,OAAU,QACvF,CAQA,SAAgBC,EAA0B,EAAwC,CAC9E,GAAI,OAAOF,GAAU,WAAYA,EAAgB,MAAO,GACxD,IAAMC,EAAID,EACV,OAAO,MAAM,QAAQC,EAAE,KAAK,GAAK,OAAOA,EAAE,UAAa,WAAa,gBAAiBA,CACzF,CAQA,SAAgBE,EAAmB,EAAW,GAAmB,CAC7D,MAAO,CAAE,MAAO,CAAC,EAAG,MAAO,EAAG,KAAM,EAAG,KAAMC,EAAU,MAAO,CAAE,CACpE,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","names":[],"sources":["../../src/query/pagination.ts"],"sourcesContent":["// Contracts mirroring the Tempest FastAPI SDK pagination envelopes, so a\n// React frontend consumes them with no manual mapping.\n//\n// Offset (fastapi-pagination `Page` / BasePaginationSchema):\n// { items, total, page, size, pages } (some configs name the size `page_size`)\n// Cursor (CursorPaginationSchema):\n// { items, next_cursor, has_more, limit }\n\n/** Offset-paginated response envelope (fastapi-pagination `Page[T]`). */\nexport interface OffsetPage<T> {\n /** The rows for the current page. */\n items: T[];\n /** Total number of matching rows across all pages. */\n total: number;\n /** Current 1-based page number. */\n page: number;\n /** Total number of pages. */\n pages: number;\n /** Page size — fastapi-pagination emits `size`. */\n size?: number;\n /** Page size — some backends name it `page_size` instead. */\n page_size?: number;\n}\n\n/** Cursor-paginated response envelope (`CursorPaginationSchema[T]`). */\nexport interface CursorPage<T> {\n /** The rows for this batch. */\n items: T[];\n /** Opaque cursor for the next batch, or null when exhausted. Pass it back verbatim. */\n next_cursor: string | null;\n /** Whether another batch exists. */\n has_more: boolean;\n /** Batch size used for this query. */\n limit: number;\n}\n\n/** Offset filter query params (fastapi-pagination / `BasePaginationFilterSchema`). */\nexport interface OffsetParams {\n page?: number;\n /** Page size — fastapi-pagination convention. */\n size?: number;\n /** Page size — `page_size` convention. */\n page_size?: number;\n order_by?: string;\n ascending?: boolean;\n}\n\n/** Cursor filter query params (`CursorPaginationFilterSchema`). */\nexport interface CursorParams {\n cursor?: string | null;\n limit?: number;\n order_by?: string;\n ascending?: boolean;\n}\n\n/**\n * Type guard for an {@link OffsetPage} envelope.\n *\n * @param value - The unknown value to test.\n * @returns Whether it carries `items` + `total` + `page` + `pages`.\n */\nexport function isOffsetPage<T = unknown>(value: unknown): value is OffsetPage<T> {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return Array.isArray(v.items) && typeof v.total === \"number\" && typeof v.pages === \"number\";\n}\n\n/**\n * Type guard for a {@link CursorPage} envelope.\n *\n * @param value - The unknown value to test.\n * @returns Whether it carries `items` + `has_more` + a `next_cursor` key.\n */\nexport function isCursorPage<T = unknown>(value: unknown): value is CursorPage<T> {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return Array.isArray(v.items) && typeof v.has_more === \"boolean\" && \"next_cursor\" in v;\n}\n\n/**\n * Build an empty {@link OffsetPage} — handy as `placeholderData`/`initialData`.\n *\n * @param pageSize - The page size to report (default 20).\n * @returns An empty offset page on page 1.\n */\nexport function emptyOffsetPage<T>(pageSize = 20): OffsetPage<T> {\n return { items: [], total: 0, page: 1, size: pageSize, pages: 0 };\n}\n"],"mappings":";AA6DA,
|
|
1
|
+
{"version":3,"file":"pagination.js","names":["isOffsetPage","value","v","isCursorPage","emptyOffsetPage","pageSize"],"sources":["../../src/query/pagination.ts"],"sourcesContent":["// Contracts mirroring the Tempest FastAPI SDK pagination envelopes, so a\n// React frontend consumes them with no manual mapping.\n//\n// Offset (fastapi-pagination `Page` / BasePaginationSchema):\n// { items, total, page, size, pages } (some configs name the size `page_size`)\n// Cursor (CursorPaginationSchema):\n// { items, next_cursor, has_more, limit }\n\n/** Offset-paginated response envelope (fastapi-pagination `Page[T]`). */\nexport interface OffsetPage<T> {\n /** The rows for the current page. */\n items: T[];\n /** Total number of matching rows across all pages. */\n total: number;\n /** Current 1-based page number. */\n page: number;\n /** Total number of pages. */\n pages: number;\n /** Page size — fastapi-pagination emits `size`. */\n size?: number;\n /** Page size — some backends name it `page_size` instead. */\n page_size?: number;\n}\n\n/** Cursor-paginated response envelope (`CursorPaginationSchema[T]`). */\nexport interface CursorPage<T> {\n /** The rows for this batch. */\n items: T[];\n /** Opaque cursor for the next batch, or null when exhausted. Pass it back verbatim. */\n next_cursor: string | null;\n /** Whether another batch exists. */\n has_more: boolean;\n /** Batch size used for this query. */\n limit: number;\n}\n\n/** Offset filter query params (fastapi-pagination / `BasePaginationFilterSchema`). */\nexport interface OffsetParams {\n page?: number;\n /** Page size — fastapi-pagination convention. */\n size?: number;\n /** Page size — `page_size` convention. */\n page_size?: number;\n order_by?: string;\n ascending?: boolean;\n}\n\n/** Cursor filter query params (`CursorPaginationFilterSchema`). */\nexport interface CursorParams {\n cursor?: string | null;\n limit?: number;\n order_by?: string;\n ascending?: boolean;\n}\n\n/**\n * Type guard for an {@link OffsetPage} envelope.\n *\n * @param value - The unknown value to test.\n * @returns Whether it carries `items` + `total` + `page` + `pages`.\n */\nexport function isOffsetPage<T = unknown>(value: unknown): value is OffsetPage<T> {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return Array.isArray(v.items) && typeof v.total === \"number\" && typeof v.pages === \"number\";\n}\n\n/**\n * Type guard for a {@link CursorPage} envelope.\n *\n * @param value - The unknown value to test.\n * @returns Whether it carries `items` + `has_more` + a `next_cursor` key.\n */\nexport function isCursorPage<T = unknown>(value: unknown): value is CursorPage<T> {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return Array.isArray(v.items) && typeof v.has_more === \"boolean\" && \"next_cursor\" in v;\n}\n\n/**\n * Build an empty {@link OffsetPage} — handy as `placeholderData`/`initialData`.\n *\n * @param pageSize - The page size to report (default 20).\n * @returns An empty offset page on page 1.\n */\nexport function emptyOffsetPage<T>(pageSize = 20): OffsetPage<T> {\n return { items: [], total: 0, page: 1, size: pageSize, pages: 0 };\n}\n"],"mappings":";AA6DA,SAAgBA,EAA0B,GAAwC;CAC9E,IAAI,OAAOC,KAAU,aAAYA,GAAgB,OAAO;CACxD,IAAMC,IAAID;CACV,OAAO,MAAM,QAAQC,EAAE,KAAK,KAAK,OAAOA,EAAE,SAAU,YAAY,OAAOA,EAAE,SAAU;AACvF;AAQA,SAAgBC,EAA0B,GAAwC;CAC9E,IAAI,OAAOF,KAAU,aAAYA,GAAgB,OAAO;CACxD,IAAMC,IAAID;CACV,OAAO,MAAM,QAAQC,EAAE,KAAK,KAAK,OAAOA,EAAE,YAAa,aAAa,iBAAiBA;AACzF;AAQA,SAAgBE,EAAmB,IAAW,IAAmB;CAC7D,OAAO;EAAE,OAAO,CAAC;EAAG,OAAO;EAAG,MAAM;EAAG,MAAMC;EAAU,OAAO;CAAE;AACpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry-policy.cjs","names":[],"sources":["../../src/query/retry-policy.ts"],"sourcesContent":["import { isApiError, isRetriableStatus } from \"../http/errors\";\n\n/** How many times a retriable failure is replayed. */\nconst MAX_RETRIES = 1;\n\n/**\n * Default `retry` for SDK queries: replay transport and server failures, never a\n * deliberate client-side refusal.\n *\n * A flat `retry: 1` replays a 403 on an admin-only listing and a 404 for a record\n * somebody deleted. The server meant both — the second attempt returns the same\n * answer, doubles the network log and holds the spinner on screen for the length\n * of another round trip. A network failure or a 5xx is a different thing: it may\n * well succeed on the next try, so those keep the previous behaviour.\n *\n * The status list is {@link isRetriableStatus}, shared with the client's own\n * policy. It used to be a second copy here, and the copy was missing `425` — so\n * a `425 Too Early` was replayed by `createApiClient({ retry: true })` and not\n * by a query, for the same error in the same app.\n *\n * @example\n * new QueryClient({ defaultOptions: { queries: { retry: shouldRetryQuery } } });\n *\n * @param failureCount - Attempts already made, as react-query counts them.\n * @param error - The rejection value from the query function.\n * @returns Whether react-query should try again.\n */\nexport function shouldRetryQuery(failureCount: number, error: unknown): boolean {\n if (failureCount >= MAX_RETRIES) return false;\n if (!isApiError(error)) return true;\n return isRetriableStatus(error.status);\n}\n"],"mappings":"sCAGA,
|
|
1
|
+
{"version":3,"file":"retry-policy.cjs","names":["isApiError","isRetriableStatus","require_errors","MAX_RETRIES","shouldRetryQuery","failureCount","error"],"sources":["../../src/query/retry-policy.ts"],"sourcesContent":["import { isApiError, isRetriableStatus } from \"../http/errors\";\n\n/** How many times a retriable failure is replayed. */\nconst MAX_RETRIES = 1;\n\n/**\n * Default `retry` for SDK queries: replay transport and server failures, never a\n * deliberate client-side refusal.\n *\n * A flat `retry: 1` replays a 403 on an admin-only listing and a 404 for a record\n * somebody deleted. The server meant both — the second attempt returns the same\n * answer, doubles the network log and holds the spinner on screen for the length\n * of another round trip. A network failure or a 5xx is a different thing: it may\n * well succeed on the next try, so those keep the previous behaviour.\n *\n * The status list is {@link isRetriableStatus}, shared with the client's own\n * policy. It used to be a second copy here, and the copy was missing `425` — so\n * a `425 Too Early` was replayed by `createApiClient({ retry: true })` and not\n * by a query, for the same error in the same app.\n *\n * @example\n * new QueryClient({ defaultOptions: { queries: { retry: shouldRetryQuery } } });\n *\n * @param failureCount - Attempts already made, as react-query counts them.\n * @param error - The rejection value from the query function.\n * @returns Whether react-query should try again.\n */\nexport function shouldRetryQuery(failureCount: number, error: unknown): boolean {\n if (failureCount >= MAX_RETRIES) return false;\n if (!isApiError(error)) return true;\n return isRetriableStatus(error.status);\n}\n"],"mappings":"A,sCAGA,IAAMG,EAAc,EAwBpB,SAAgBC,EAAiB,EAAsB,EAAyB,CAG5E,OAFIC,GAAgBF,EAAoB,GACxC,CAAKH,EAAAA,WAAWM,CAAK,GACdL,EAAAA,kBAAkBK,EAAM,MAAM,CACzC,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry-policy.js","names":[],"sources":["../../src/query/retry-policy.ts"],"sourcesContent":["import { isApiError, isRetriableStatus } from \"../http/errors\";\n\n/** How many times a retriable failure is replayed. */\nconst MAX_RETRIES = 1;\n\n/**\n * Default `retry` for SDK queries: replay transport and server failures, never a\n * deliberate client-side refusal.\n *\n * A flat `retry: 1` replays a 403 on an admin-only listing and a 404 for a record\n * somebody deleted. The server meant both — the second attempt returns the same\n * answer, doubles the network log and holds the spinner on screen for the length\n * of another round trip. A network failure or a 5xx is a different thing: it may\n * well succeed on the next try, so those keep the previous behaviour.\n *\n * The status list is {@link isRetriableStatus}, shared with the client's own\n * policy. It used to be a second copy here, and the copy was missing `425` — so\n * a `425 Too Early` was replayed by `createApiClient({ retry: true })` and not\n * by a query, for the same error in the same app.\n *\n * @example\n * new QueryClient({ defaultOptions: { queries: { retry: shouldRetryQuery } } });\n *\n * @param failureCount - Attempts already made, as react-query counts them.\n * @param error - The rejection value from the query function.\n * @returns Whether react-query should try again.\n */\nexport function shouldRetryQuery(failureCount: number, error: unknown): boolean {\n if (failureCount >= MAX_RETRIES) return false;\n if (!isApiError(error)) return true;\n return isRetriableStatus(error.status);\n}\n"],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"retry-policy.js","names":["MAX_RETRIES","shouldRetryQuery","failureCount","isApiError","error","isRetriableStatus"],"sources":["../../src/query/retry-policy.ts"],"sourcesContent":["import { isApiError, isRetriableStatus } from \"../http/errors\";\n\n/** How many times a retriable failure is replayed. */\nconst MAX_RETRIES = 1;\n\n/**\n * Default `retry` for SDK queries: replay transport and server failures, never a\n * deliberate client-side refusal.\n *\n * A flat `retry: 1` replays a 403 on an admin-only listing and a 404 for a record\n * somebody deleted. The server meant both — the second attempt returns the same\n * answer, doubles the network log and holds the spinner on screen for the length\n * of another round trip. A network failure or a 5xx is a different thing: it may\n * well succeed on the next try, so those keep the previous behaviour.\n *\n * The status list is {@link isRetriableStatus}, shared with the client's own\n * policy. It used to be a second copy here, and the copy was missing `425` — so\n * a `425 Too Early` was replayed by `createApiClient({ retry: true })` and not\n * by a query, for the same error in the same app.\n *\n * @example\n * new QueryClient({ defaultOptions: { queries: { retry: shouldRetryQuery } } });\n *\n * @param failureCount - Attempts already made, as react-query counts them.\n * @param error - The rejection value from the query function.\n * @returns Whether react-query should try again.\n */\nexport function shouldRetryQuery(failureCount: number, error: unknown): boolean {\n if (failureCount >= MAX_RETRIES) return false;\n if (!isApiError(error)) return true;\n return isRetriableStatus(error.status);\n}\n"],"mappings":";;AAGA,IAAMA,IAAc;AAwBpB,SAAgBC,EAAiB,GAAsB,GAAyB;CAG5E,OAFIC,KAAgBF,IAAoB,KACxC,CAAKG,EAAWC,CAAK,KACdC,EAAkBD,EAAM,MAAM;AACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cursor-query.cjs","names":[],"sources":["../../src/query/use-cursor-query.ts"],"sourcesContent":["import { useInfiniteQuery } from \"@tanstack/react-query\";\nimport type { InfiniteData, QueryKey, UseInfiniteQueryOptions } from \"@tanstack/react-query\";\n\nimport type { CursorPage, CursorParams } from \"./pagination\";\n\nexport interface UseCursorQueryOptions<T> extends Omit<\n UseInfiniteQueryOptions<\n CursorPage<T>,\n Error,\n InfiniteData<CursorPage<T>, string | null>,\n QueryKey,\n string | null\n >,\n \"queryKey\" | \"queryFn\" | \"initialPageParam\" | \"getNextPageParam\"\n> {\n /** Base query key — `limit`/sort is appended for cache isolation. */\n queryKey: QueryKey;\n /** Fetcher receiving the cursor params; return the backend envelope. */\n queryFn: (params: CursorParams) => Promise<CursorPage<T>> | CursorPage<T>;\n /** Batch size sent as `limit`. Default: 20. */\n limit?: number;\n /** Initial `order_by`. */\n orderBy?: string;\n /** Initial `ascending`. Default: false. */\n ascending?: boolean;\n}\n\nexport interface UseCursorQueryResult<T> {\n /** All rows fetched so far, flattened across batches. */\n items: T[];\n /** The raw batches, in fetch order. */\n pages: CursorPage<T>[];\n hasNextPage: boolean;\n isLoading: boolean;\n isFetchingNextPage: boolean;\n error: Error | null;\n /** Fetch the next batch (no-op when exhausted). */\n fetchNextPage: () => void;\n /** Refetch from the first batch. */\n refetch: () => void;\n}\n\n/**\n * Cursor-pagination hook over TanStack Query's `useInfiniteQuery` for the\n * Tempest `CursorPaginationSchema` envelope\n * (`{ items, next_cursor, has_more, limit }`).\n *\n * The opaque `next_cursor` is fed straight back as the next page param; the\n * loop stops when `has_more` is false (or `next_cursor` is null).\n *\n * @example\n * const feed = useCursorQuery<Post>({\n * queryKey: [\"feed\"],\n * limit: 30,\n * queryFn: (params) => postsService.listPosts(params),\n * });\n * // feed.items, feed.fetchNextPage(), feed.hasNextPage\n */\nexport function useCursorQuery<T>(options: UseCursorQueryOptions<T>): UseCursorQueryResult<T> {\n const { queryKey, queryFn, limit = 20, orderBy, ascending = false, ...queryOptions } = options;\n\n const query = useInfiniteQuery<\n CursorPage<T>,\n Error,\n InfiniteData<CursorPage<T>, string | null>,\n QueryKey,\n string | null\n >({\n ...queryOptions,\n queryKey: [...queryKey, { limit, orderBy, ascending }],\n initialPageParam: null,\n queryFn: ({ pageParam }) =>\n queryFn({ cursor: pageParam, limit, order_by: orderBy, ascending }),\n getNextPageParam: (last) => (last.has_more ? last.next_cursor : undefined),\n });\n\n const pages = query.data?.pages ?? [];\n\n return {\n items: pages.flatMap((p) => p.items),\n pages,\n hasNextPage: query.hasNextPage,\n isLoading: query.isLoading,\n isFetchingNextPage: query.isFetchingNextPage,\n error: query.error,\n fetchNextPage: () => void query.fetchNextPage(),\n refetch: () => void query.refetch(),\n };\n}\n"],"mappings":"uCA0DA,
|
|
1
|
+
{"version":3,"file":"use-cursor-query.cjs","names":["useInfiniteQuery","_tanstack_react_query","useCursorQuery","queryOptions","options","query","queryKey","queryFn","pageParam","orderBy","last","pages","p"],"sources":["../../src/query/use-cursor-query.ts"],"sourcesContent":["import { useInfiniteQuery } from \"@tanstack/react-query\";\nimport type { InfiniteData, QueryKey, UseInfiniteQueryOptions } from \"@tanstack/react-query\";\n\nimport type { CursorPage, CursorParams } from \"./pagination\";\n\nexport interface UseCursorQueryOptions<T> extends Omit<\n UseInfiniteQueryOptions<\n CursorPage<T>,\n Error,\n InfiniteData<CursorPage<T>, string | null>,\n QueryKey,\n string | null\n >,\n \"queryKey\" | \"queryFn\" | \"initialPageParam\" | \"getNextPageParam\"\n> {\n /** Base query key — `limit`/sort is appended for cache isolation. */\n queryKey: QueryKey;\n /** Fetcher receiving the cursor params; return the backend envelope. */\n queryFn: (params: CursorParams) => Promise<CursorPage<T>> | CursorPage<T>;\n /** Batch size sent as `limit`. Default: 20. */\n limit?: number;\n /** Initial `order_by`. */\n orderBy?: string;\n /** Initial `ascending`. Default: false. */\n ascending?: boolean;\n}\n\nexport interface UseCursorQueryResult<T> {\n /** All rows fetched so far, flattened across batches. */\n items: T[];\n /** The raw batches, in fetch order. */\n pages: CursorPage<T>[];\n hasNextPage: boolean;\n isLoading: boolean;\n isFetchingNextPage: boolean;\n error: Error | null;\n /** Fetch the next batch (no-op when exhausted). */\n fetchNextPage: () => void;\n /** Refetch from the first batch. */\n refetch: () => void;\n}\n\n/**\n * Cursor-pagination hook over TanStack Query's `useInfiniteQuery` for the\n * Tempest `CursorPaginationSchema` envelope\n * (`{ items, next_cursor, has_more, limit }`).\n *\n * The opaque `next_cursor` is fed straight back as the next page param; the\n * loop stops when `has_more` is false (or `next_cursor` is null).\n *\n * @example\n * const feed = useCursorQuery<Post>({\n * queryKey: [\"feed\"],\n * limit: 30,\n * queryFn: (params) => postsService.listPosts(params),\n * });\n * // feed.items, feed.fetchNextPage(), feed.hasNextPage\n */\nexport function useCursorQuery<T>(options: UseCursorQueryOptions<T>): UseCursorQueryResult<T> {\n const { queryKey, queryFn, limit = 20, orderBy, ascending = false, ...queryOptions } = options;\n\n const query = useInfiniteQuery<\n CursorPage<T>,\n Error,\n InfiniteData<CursorPage<T>, string | null>,\n QueryKey,\n string | null\n >({\n ...queryOptions,\n queryKey: [...queryKey, { limit, orderBy, ascending }],\n initialPageParam: null,\n queryFn: ({ pageParam }) =>\n queryFn({ cursor: pageParam, limit, order_by: orderBy, ascending }),\n getNextPageParam: (last) => (last.has_more ? last.next_cursor : undefined),\n });\n\n const pages = query.data?.pages ?? [];\n\n return {\n items: pages.flatMap((p) => p.items),\n pages,\n hasNextPage: query.hasNextPage,\n isLoading: query.isLoading,\n isFetchingNextPage: query.isFetchingNextPage,\n error: query.error,\n fetchNextPage: () => void query.fetchNextPage(),\n refetch: () => void query.refetch(),\n };\n}\n"],"mappings":"A,uCA0DA,SAAgBE,EAAkB,EAA4D,CAC1F,GAAM,CAAE,WAAU,UAAS,QAAQ,GAAI,UAAS,YAAY,GAAO,GAAGC,GAAiBC,EAEjFC,GAAA,EAAQL,EAAAA,iBAAAA,CAMZ,CACE,GAAGG,EACH,SAAU,CAAC,GAAGG,EAAU,CAAE,QAAO,UAAS,WAAU,CAAC,EACrD,iBAAkB,KAClB,SAAU,CAAE,eACRC,EAAQ,CAAE,OAAQC,EAAW,QAAO,SAAUC,EAAS,WAAU,CAAC,EACtE,iBAAmB,GAAUC,EAAK,SAAWA,EAAK,YAAc,IAAA,EACpE,CAAC,EAEKC,EAAQN,EAAM,MAAM,OAAS,CAAC,EAEpC,MAAO,CACH,MAAOM,EAAM,QAAS,GAAMC,EAAE,KAAK,EACnC,QACA,YAAaP,EAAM,YACnB,UAAWA,EAAM,UACjB,mBAAoBA,EAAM,mBAC1B,MAAOA,EAAM,MACb,kBAAqB,KAAKA,EAAM,cAAc,EAC9C,YAAe,KAAKA,EAAM,QAAQ,CACtC,CACJ,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cursor-query.js","names":[],"sources":["../../src/query/use-cursor-query.ts"],"sourcesContent":["import { useInfiniteQuery } from \"@tanstack/react-query\";\nimport type { InfiniteData, QueryKey, UseInfiniteQueryOptions } from \"@tanstack/react-query\";\n\nimport type { CursorPage, CursorParams } from \"./pagination\";\n\nexport interface UseCursorQueryOptions<T> extends Omit<\n UseInfiniteQueryOptions<\n CursorPage<T>,\n Error,\n InfiniteData<CursorPage<T>, string | null>,\n QueryKey,\n string | null\n >,\n \"queryKey\" | \"queryFn\" | \"initialPageParam\" | \"getNextPageParam\"\n> {\n /** Base query key — `limit`/sort is appended for cache isolation. */\n queryKey: QueryKey;\n /** Fetcher receiving the cursor params; return the backend envelope. */\n queryFn: (params: CursorParams) => Promise<CursorPage<T>> | CursorPage<T>;\n /** Batch size sent as `limit`. Default: 20. */\n limit?: number;\n /** Initial `order_by`. */\n orderBy?: string;\n /** Initial `ascending`. Default: false. */\n ascending?: boolean;\n}\n\nexport interface UseCursorQueryResult<T> {\n /** All rows fetched so far, flattened across batches. */\n items: T[];\n /** The raw batches, in fetch order. */\n pages: CursorPage<T>[];\n hasNextPage: boolean;\n isLoading: boolean;\n isFetchingNextPage: boolean;\n error: Error | null;\n /** Fetch the next batch (no-op when exhausted). */\n fetchNextPage: () => void;\n /** Refetch from the first batch. */\n refetch: () => void;\n}\n\n/**\n * Cursor-pagination hook over TanStack Query's `useInfiniteQuery` for the\n * Tempest `CursorPaginationSchema` envelope\n * (`{ items, next_cursor, has_more, limit }`).\n *\n * The opaque `next_cursor` is fed straight back as the next page param; the\n * loop stops when `has_more` is false (or `next_cursor` is null).\n *\n * @example\n * const feed = useCursorQuery<Post>({\n * queryKey: [\"feed\"],\n * limit: 30,\n * queryFn: (params) => postsService.listPosts(params),\n * });\n * // feed.items, feed.fetchNextPage(), feed.hasNextPage\n */\nexport function useCursorQuery<T>(options: UseCursorQueryOptions<T>): UseCursorQueryResult<T> {\n const { queryKey, queryFn, limit = 20, orderBy, ascending = false, ...queryOptions } = options;\n\n const query = useInfiniteQuery<\n CursorPage<T>,\n Error,\n InfiniteData<CursorPage<T>, string | null>,\n QueryKey,\n string | null\n >({\n ...queryOptions,\n queryKey: [...queryKey, { limit, orderBy, ascending }],\n initialPageParam: null,\n queryFn: ({ pageParam }) =>\n queryFn({ cursor: pageParam, limit, order_by: orderBy, ascending }),\n getNextPageParam: (last) => (last.has_more ? last.next_cursor : undefined),\n });\n\n const pages = query.data?.pages ?? [];\n\n return {\n items: pages.flatMap((p) => p.items),\n pages,\n hasNextPage: query.hasNextPage,\n isLoading: query.isLoading,\n isFetchingNextPage: query.isFetchingNextPage,\n error: query.error,\n fetchNextPage: () => void query.fetchNextPage(),\n refetch: () => void query.refetch(),\n };\n}\n"],"mappings":";;AA0DA,
|
|
1
|
+
{"version":3,"file":"use-cursor-query.js","names":["useCursorQuery","queryOptions","options","query","useInfiniteQuery","queryKey","queryFn","pageParam","orderBy","last","pages","p"],"sources":["../../src/query/use-cursor-query.ts"],"sourcesContent":["import { useInfiniteQuery } from \"@tanstack/react-query\";\nimport type { InfiniteData, QueryKey, UseInfiniteQueryOptions } from \"@tanstack/react-query\";\n\nimport type { CursorPage, CursorParams } from \"./pagination\";\n\nexport interface UseCursorQueryOptions<T> extends Omit<\n UseInfiniteQueryOptions<\n CursorPage<T>,\n Error,\n InfiniteData<CursorPage<T>, string | null>,\n QueryKey,\n string | null\n >,\n \"queryKey\" | \"queryFn\" | \"initialPageParam\" | \"getNextPageParam\"\n> {\n /** Base query key — `limit`/sort is appended for cache isolation. */\n queryKey: QueryKey;\n /** Fetcher receiving the cursor params; return the backend envelope. */\n queryFn: (params: CursorParams) => Promise<CursorPage<T>> | CursorPage<T>;\n /** Batch size sent as `limit`. Default: 20. */\n limit?: number;\n /** Initial `order_by`. */\n orderBy?: string;\n /** Initial `ascending`. Default: false. */\n ascending?: boolean;\n}\n\nexport interface UseCursorQueryResult<T> {\n /** All rows fetched so far, flattened across batches. */\n items: T[];\n /** The raw batches, in fetch order. */\n pages: CursorPage<T>[];\n hasNextPage: boolean;\n isLoading: boolean;\n isFetchingNextPage: boolean;\n error: Error | null;\n /** Fetch the next batch (no-op when exhausted). */\n fetchNextPage: () => void;\n /** Refetch from the first batch. */\n refetch: () => void;\n}\n\n/**\n * Cursor-pagination hook over TanStack Query's `useInfiniteQuery` for the\n * Tempest `CursorPaginationSchema` envelope\n * (`{ items, next_cursor, has_more, limit }`).\n *\n * The opaque `next_cursor` is fed straight back as the next page param; the\n * loop stops when `has_more` is false (or `next_cursor` is null).\n *\n * @example\n * const feed = useCursorQuery<Post>({\n * queryKey: [\"feed\"],\n * limit: 30,\n * queryFn: (params) => postsService.listPosts(params),\n * });\n * // feed.items, feed.fetchNextPage(), feed.hasNextPage\n */\nexport function useCursorQuery<T>(options: UseCursorQueryOptions<T>): UseCursorQueryResult<T> {\n const { queryKey, queryFn, limit = 20, orderBy, ascending = false, ...queryOptions } = options;\n\n const query = useInfiniteQuery<\n CursorPage<T>,\n Error,\n InfiniteData<CursorPage<T>, string | null>,\n QueryKey,\n string | null\n >({\n ...queryOptions,\n queryKey: [...queryKey, { limit, orderBy, ascending }],\n initialPageParam: null,\n queryFn: ({ pageParam }) =>\n queryFn({ cursor: pageParam, limit, order_by: orderBy, ascending }),\n getNextPageParam: (last) => (last.has_more ? last.next_cursor : undefined),\n });\n\n const pages = query.data?.pages ?? [];\n\n return {\n items: pages.flatMap((p) => p.items),\n pages,\n hasNextPage: query.hasNextPage,\n isLoading: query.isLoading,\n isFetchingNextPage: query.isFetchingNextPage,\n error: query.error,\n fetchNextPage: () => void query.fetchNextPage(),\n refetch: () => void query.refetch(),\n };\n}\n"],"mappings":";;AA0DA,SAAgBA,EAAkB,GAA4D;CAC1F,IAAM,EAAE,aAAU,YAAS,WAAQ,IAAI,YAAS,eAAY,IAAO,GAAGC,MAAiBC,GAEjFC,IAAQC,EAMZ;EACE,GAAGH;EACH,UAAU,CAAC,GAAGI,GAAU;GAAE;GAAO;GAAS;EAAU,CAAC;EACrD,kBAAkB;EAClB,UAAU,EAAE,mBACRC,EAAQ;GAAE,QAAQC;GAAW;GAAO,UAAUC;GAAS;EAAU,CAAC;EACtE,mBAAmB,MAAUC,EAAK,WAAWA,EAAK,cAAc,KAAA;CACpE,CAAC,GAEKC,IAAQP,EAAM,MAAM,SAAS,CAAC;CAEpC,OAAO;EACH,OAAOO,EAAM,SAAS,MAAMC,EAAE,KAAK;EACnC;EACA,aAAaR,EAAM;EACnB,WAAWA,EAAM;EACjB,oBAAoBA,EAAM;EAC1B,OAAOA,EAAM;EACb,qBAAqB,KAAKA,EAAM,cAAc;EAC9C,eAAe,KAAKA,EAAM,QAAQ;CACtC;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-offline-mutation.cjs","names":[],"sources":["../../src/query/use-offline-mutation.ts"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport type { QueryKey, UseMutationResult } from \"@tanstack/react-query\";\nimport type { OfflineSync, OutboxOp, SyncTrigger } from \"../offline\";\n\n/** The outbox entry a mutation's variables map to. */\nexport interface OutboxDraft<TPayload> {\n /** The mutation kind. */\n op: OutboxOp;\n /** Primary key of the affected record. */\n recordId: string;\n /** Record snapshot for `create`/`update` (omit for `delete`). */\n payload?: TPayload;\n}\n\n/**\n * Configuration for {@link useOfflineMutation}.\n *\n * @typeParam TVariables - The `mutate(variables)` input shape.\n * @typeParam TData - The cached query data optimistically patched.\n * @typeParam TPayload - Record snapshot carried by outbox entries.\n */\nexport interface UseOfflineMutationOptions<TVariables, TData, TPayload> {\n /** The engine the mutation enqueues into. */\n sync: OfflineSync<TPayload>;\n /** Map `mutate` variables into an outbox entry. */\n toEntry: (variables: TVariables) => OutboxDraft<TPayload>;\n /**\n * Query key to optimistically patch and (optionally) invalidate. Omit to\n * only enqueue without touching the React Query cache.\n */\n queryKey?: QueryKey;\n /**\n * Produce the next cached value from the current one and the variables.\n * Runs in `onMutate`; the previous value is restored automatically if the\n * enqueue throws. Requires `queryKey`.\n */\n applyOptimistic?: (current: TData | undefined, variables: TVariables) => TData;\n /**\n * Trigger a flush after enqueueing. `true` (default) uses\n * `\"after-mutation\"`; pass a custom {@link SyncTrigger} string, or `false`\n * to leave flushing to the caller / auto-flush hooks.\n */\n flush?: boolean | SyncTrigger;\n /** Invalidate `queryKey` in `onSettled` so a later read refetches. Default `false`. */\n invalidate?: boolean;\n}\n\ninterface MutationContext<TData> {\n previous: TData | undefined;\n}\n\n/**\n * Optimistic mutation that writes to an {@link OfflineSync} outbox instead of\n * hitting the network directly, bridging the sync engine and TanStack Query.\n *\n * On `mutate` it enqueues the entry, optimistically patches the given query\n * cache key and kicks a flush; if the enqueue itself throws, the cache is\n * rolled back to its previous value. Server delivery happens later inside the\n * engine's flush loop, so the UI updates instantly and survives reloads and\n * offline periods.\n *\n * @typeParam TVariables - The `mutate(variables)` input shape.\n * @typeParam TData - The cached query data optimistically patched.\n * @typeParam TPayload - Record snapshot carried by outbox entries.\n * @param options - Engine, variables→entry mapping and cache wiring.\n * @returns The TanStack {@link UseMutationResult}; the mutation resolves to the\n * generated outbox entry id.\n *\n * @example\n * const addNote = useOfflineMutation({\n * sync: notesSync,\n * queryKey: [\"notes\"],\n * toEntry: (note: Note) => ({ op: \"create\", recordId: note.id, payload: note }),\n * applyOptimistic: (current: Note[] = [], note) => [...current, note],\n * });\n * addNote.mutate(newNote);\n */\nexport function useOfflineMutation<TVariables, TData = unknown, TPayload = unknown>(\n options: UseOfflineMutationOptions<TVariables, TData, TPayload>,\n): UseMutationResult<string, Error, TVariables, MutationContext<TData>> {\n const { sync, toEntry, queryKey, applyOptimistic, flush = true, invalidate = false } = options;\n const client = useQueryClient();\n\n return useMutation<string, Error, TVariables, MutationContext<TData>>({\n mutationFn: async (variables) => {\n const draft = toEntry(variables);\n const id = await sync.enqueue(draft.op, draft.recordId, draft.payload);\n if (flush !== false) {\n const trigger: SyncTrigger = flush === true ? \"after-mutation\" : flush;\n void sync.flush(trigger);\n }\n return id;\n },\n onMutate: async (variables) => {\n if (!queryKey || !applyOptimistic) return { previous: undefined };\n await client.cancelQueries({ queryKey });\n const previous = client.getQueryData<TData>(queryKey);\n client.setQueryData<TData>(queryKey, (current) => applyOptimistic(current, variables));\n return { previous };\n },\n onError: (_error, _variables, context) => {\n if (queryKey && context) client.setQueryData(queryKey, context.previous);\n },\n onSettled: () => {\n if (invalidate && queryKey) void client.invalidateQueries({ queryKey });\n },\n });\n}\n"],"mappings":"uCA6EA,
|
|
1
|
+
{"version":3,"file":"use-offline-mutation.cjs","names":["useQueryClient","useMutation","_tanstack_react_query","useOfflineMutation","options","client","draft","toEntry","variables","id","sync","flush","trigger","queryKey","applyOptimistic","previous","current","context","invalidate"],"sources":["../../src/query/use-offline-mutation.ts"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport type { QueryKey, UseMutationResult } from \"@tanstack/react-query\";\nimport type { OfflineSync, OutboxOp, SyncTrigger } from \"../offline\";\n\n/** The outbox entry a mutation's variables map to. */\nexport interface OutboxDraft<TPayload> {\n /** The mutation kind. */\n op: OutboxOp;\n /** Primary key of the affected record. */\n recordId: string;\n /** Record snapshot for `create`/`update` (omit for `delete`). */\n payload?: TPayload;\n}\n\n/**\n * Configuration for {@link useOfflineMutation}.\n *\n * @typeParam TVariables - The `mutate(variables)` input shape.\n * @typeParam TData - The cached query data optimistically patched.\n * @typeParam TPayload - Record snapshot carried by outbox entries.\n */\nexport interface UseOfflineMutationOptions<TVariables, TData, TPayload> {\n /** The engine the mutation enqueues into. */\n sync: OfflineSync<TPayload>;\n /** Map `mutate` variables into an outbox entry. */\n toEntry: (variables: TVariables) => OutboxDraft<TPayload>;\n /**\n * Query key to optimistically patch and (optionally) invalidate. Omit to\n * only enqueue without touching the React Query cache.\n */\n queryKey?: QueryKey;\n /**\n * Produce the next cached value from the current one and the variables.\n * Runs in `onMutate`; the previous value is restored automatically if the\n * enqueue throws. Requires `queryKey`.\n */\n applyOptimistic?: (current: TData | undefined, variables: TVariables) => TData;\n /**\n * Trigger a flush after enqueueing. `true` (default) uses\n * `\"after-mutation\"`; pass a custom {@link SyncTrigger} string, or `false`\n * to leave flushing to the caller / auto-flush hooks.\n */\n flush?: boolean | SyncTrigger;\n /** Invalidate `queryKey` in `onSettled` so a later read refetches. Default `false`. */\n invalidate?: boolean;\n}\n\ninterface MutationContext<TData> {\n previous: TData | undefined;\n}\n\n/**\n * Optimistic mutation that writes to an {@link OfflineSync} outbox instead of\n * hitting the network directly, bridging the sync engine and TanStack Query.\n *\n * On `mutate` it enqueues the entry, optimistically patches the given query\n * cache key and kicks a flush; if the enqueue itself throws, the cache is\n * rolled back to its previous value. Server delivery happens later inside the\n * engine's flush loop, so the UI updates instantly and survives reloads and\n * offline periods.\n *\n * @typeParam TVariables - The `mutate(variables)` input shape.\n * @typeParam TData - The cached query data optimistically patched.\n * @typeParam TPayload - Record snapshot carried by outbox entries.\n * @param options - Engine, variables→entry mapping and cache wiring.\n * @returns The TanStack {@link UseMutationResult}; the mutation resolves to the\n * generated outbox entry id.\n *\n * @example\n * const addNote = useOfflineMutation({\n * sync: notesSync,\n * queryKey: [\"notes\"],\n * toEntry: (note: Note) => ({ op: \"create\", recordId: note.id, payload: note }),\n * applyOptimistic: (current: Note[] = [], note) => [...current, note],\n * });\n * addNote.mutate(newNote);\n */\nexport function useOfflineMutation<TVariables, TData = unknown, TPayload = unknown>(\n options: UseOfflineMutationOptions<TVariables, TData, TPayload>,\n): UseMutationResult<string, Error, TVariables, MutationContext<TData>> {\n const { sync, toEntry, queryKey, applyOptimistic, flush = true, invalidate = false } = options;\n const client = useQueryClient();\n\n return useMutation<string, Error, TVariables, MutationContext<TData>>({\n mutationFn: async (variables) => {\n const draft = toEntry(variables);\n const id = await sync.enqueue(draft.op, draft.recordId, draft.payload);\n if (flush !== false) {\n const trigger: SyncTrigger = flush === true ? \"after-mutation\" : flush;\n void sync.flush(trigger);\n }\n return id;\n },\n onMutate: async (variables) => {\n if (!queryKey || !applyOptimistic) return { previous: undefined };\n await client.cancelQueries({ queryKey });\n const previous = client.getQueryData<TData>(queryKey);\n client.setQueryData<TData>(queryKey, (current) => applyOptimistic(current, variables));\n return { previous };\n },\n onError: (_error, _variables, context) => {\n if (queryKey && context) client.setQueryData(queryKey, context.previous);\n },\n onSettled: () => {\n if (invalidate && queryKey) void client.invalidateQueries({ queryKey });\n },\n });\n}\n"],"mappings":"A,uCA6EA,SAAgBG,EACZ,EACoE,CACpE,GAAM,CAAE,OAAM,UAAS,WAAU,kBAAiB,QAAQ,GAAM,aAAa,IAAUC,EACjFC,GAAA,EAASL,EAAAA,eAAAA,CAAe,EAE9B,OAAA,EAAOC,EAAAA,YAAAA,CAA+D,CAClE,WAAY,KAAO,IAAc,CAC7B,IAAMK,EAAQC,EAAQC,CAAS,EACzBC,EAAK,MAAMC,EAAK,QAAQJ,EAAM,GAAIA,EAAM,SAAUA,EAAM,OAAO,EACrE,GAAIK,IAAU,GAAO,CACjB,IAAMC,EAAuBD,IAAU,GAAO,iBAAmBA,EACjED,EAAU,MAAME,CAAO,CAC3B,CACA,OAAOH,CACX,EACA,SAAU,KAAO,IAAc,CAC3B,GAAI,CAACI,GAAY,CAACC,EAAiB,MAAO,CAAE,SAAU,IAAA,EAAU,EAChE,MAAMT,EAAO,cAAc,CAAE,UAAS,CAAC,EACvC,IAAMU,EAAWV,EAAO,aAAoBQ,CAAQ,EAEpD,OADAR,EAAO,aAAoBQ,EAAW,GAAYC,EAAgBE,EAASR,CAAS,CAAC,EAC9E,CAAE,UAAS,CACtB,EACA,SAAU,EAAQ,EAAY,IAAY,CAClCK,GAAYI,GAASZ,EAAO,aAAaQ,EAAUI,EAAQ,QAAQ,CAC3E,EACA,cAAiB,CACTC,GAAcL,GAAUR,EAAY,kBAAkB,CAAE,UAAS,CAAC,CAC1E,CACJ,CAAC,CACL,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-offline-mutation.js","names":[],"sources":["../../src/query/use-offline-mutation.ts"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport type { QueryKey, UseMutationResult } from \"@tanstack/react-query\";\nimport type { OfflineSync, OutboxOp, SyncTrigger } from \"../offline\";\n\n/** The outbox entry a mutation's variables map to. */\nexport interface OutboxDraft<TPayload> {\n /** The mutation kind. */\n op: OutboxOp;\n /** Primary key of the affected record. */\n recordId: string;\n /** Record snapshot for `create`/`update` (omit for `delete`). */\n payload?: TPayload;\n}\n\n/**\n * Configuration for {@link useOfflineMutation}.\n *\n * @typeParam TVariables - The `mutate(variables)` input shape.\n * @typeParam TData - The cached query data optimistically patched.\n * @typeParam TPayload - Record snapshot carried by outbox entries.\n */\nexport interface UseOfflineMutationOptions<TVariables, TData, TPayload> {\n /** The engine the mutation enqueues into. */\n sync: OfflineSync<TPayload>;\n /** Map `mutate` variables into an outbox entry. */\n toEntry: (variables: TVariables) => OutboxDraft<TPayload>;\n /**\n * Query key to optimistically patch and (optionally) invalidate. Omit to\n * only enqueue without touching the React Query cache.\n */\n queryKey?: QueryKey;\n /**\n * Produce the next cached value from the current one and the variables.\n * Runs in `onMutate`; the previous value is restored automatically if the\n * enqueue throws. Requires `queryKey`.\n */\n applyOptimistic?: (current: TData | undefined, variables: TVariables) => TData;\n /**\n * Trigger a flush after enqueueing. `true` (default) uses\n * `\"after-mutation\"`; pass a custom {@link SyncTrigger} string, or `false`\n * to leave flushing to the caller / auto-flush hooks.\n */\n flush?: boolean | SyncTrigger;\n /** Invalidate `queryKey` in `onSettled` so a later read refetches. Default `false`. */\n invalidate?: boolean;\n}\n\ninterface MutationContext<TData> {\n previous: TData | undefined;\n}\n\n/**\n * Optimistic mutation that writes to an {@link OfflineSync} outbox instead of\n * hitting the network directly, bridging the sync engine and TanStack Query.\n *\n * On `mutate` it enqueues the entry, optimistically patches the given query\n * cache key and kicks a flush; if the enqueue itself throws, the cache is\n * rolled back to its previous value. Server delivery happens later inside the\n * engine's flush loop, so the UI updates instantly and survives reloads and\n * offline periods.\n *\n * @typeParam TVariables - The `mutate(variables)` input shape.\n * @typeParam TData - The cached query data optimistically patched.\n * @typeParam TPayload - Record snapshot carried by outbox entries.\n * @param options - Engine, variables→entry mapping and cache wiring.\n * @returns The TanStack {@link UseMutationResult}; the mutation resolves to the\n * generated outbox entry id.\n *\n * @example\n * const addNote = useOfflineMutation({\n * sync: notesSync,\n * queryKey: [\"notes\"],\n * toEntry: (note: Note) => ({ op: \"create\", recordId: note.id, payload: note }),\n * applyOptimistic: (current: Note[] = [], note) => [...current, note],\n * });\n * addNote.mutate(newNote);\n */\nexport function useOfflineMutation<TVariables, TData = unknown, TPayload = unknown>(\n options: UseOfflineMutationOptions<TVariables, TData, TPayload>,\n): UseMutationResult<string, Error, TVariables, MutationContext<TData>> {\n const { sync, toEntry, queryKey, applyOptimistic, flush = true, invalidate = false } = options;\n const client = useQueryClient();\n\n return useMutation<string, Error, TVariables, MutationContext<TData>>({\n mutationFn: async (variables) => {\n const draft = toEntry(variables);\n const id = await sync.enqueue(draft.op, draft.recordId, draft.payload);\n if (flush !== false) {\n const trigger: SyncTrigger = flush === true ? \"after-mutation\" : flush;\n void sync.flush(trigger);\n }\n return id;\n },\n onMutate: async (variables) => {\n if (!queryKey || !applyOptimistic) return { previous: undefined };\n await client.cancelQueries({ queryKey });\n const previous = client.getQueryData<TData>(queryKey);\n client.setQueryData<TData>(queryKey, (current) => applyOptimistic(current, variables));\n return { previous };\n },\n onError: (_error, _variables, context) => {\n if (queryKey && context) client.setQueryData(queryKey, context.previous);\n },\n onSettled: () => {\n if (invalidate && queryKey) void client.invalidateQueries({ queryKey });\n },\n });\n}\n"],"mappings":";;AA6EA,
|
|
1
|
+
{"version":3,"file":"use-offline-mutation.js","names":["useOfflineMutation","options","client","useQueryClient","useMutation","draft","toEntry","variables","id","sync","flush","trigger","queryKey","applyOptimistic","previous","current","context","invalidate"],"sources":["../../src/query/use-offline-mutation.ts"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport type { QueryKey, UseMutationResult } from \"@tanstack/react-query\";\nimport type { OfflineSync, OutboxOp, SyncTrigger } from \"../offline\";\n\n/** The outbox entry a mutation's variables map to. */\nexport interface OutboxDraft<TPayload> {\n /** The mutation kind. */\n op: OutboxOp;\n /** Primary key of the affected record. */\n recordId: string;\n /** Record snapshot for `create`/`update` (omit for `delete`). */\n payload?: TPayload;\n}\n\n/**\n * Configuration for {@link useOfflineMutation}.\n *\n * @typeParam TVariables - The `mutate(variables)` input shape.\n * @typeParam TData - The cached query data optimistically patched.\n * @typeParam TPayload - Record snapshot carried by outbox entries.\n */\nexport interface UseOfflineMutationOptions<TVariables, TData, TPayload> {\n /** The engine the mutation enqueues into. */\n sync: OfflineSync<TPayload>;\n /** Map `mutate` variables into an outbox entry. */\n toEntry: (variables: TVariables) => OutboxDraft<TPayload>;\n /**\n * Query key to optimistically patch and (optionally) invalidate. Omit to\n * only enqueue without touching the React Query cache.\n */\n queryKey?: QueryKey;\n /**\n * Produce the next cached value from the current one and the variables.\n * Runs in `onMutate`; the previous value is restored automatically if the\n * enqueue throws. Requires `queryKey`.\n */\n applyOptimistic?: (current: TData | undefined, variables: TVariables) => TData;\n /**\n * Trigger a flush after enqueueing. `true` (default) uses\n * `\"after-mutation\"`; pass a custom {@link SyncTrigger} string, or `false`\n * to leave flushing to the caller / auto-flush hooks.\n */\n flush?: boolean | SyncTrigger;\n /** Invalidate `queryKey` in `onSettled` so a later read refetches. Default `false`. */\n invalidate?: boolean;\n}\n\ninterface MutationContext<TData> {\n previous: TData | undefined;\n}\n\n/**\n * Optimistic mutation that writes to an {@link OfflineSync} outbox instead of\n * hitting the network directly, bridging the sync engine and TanStack Query.\n *\n * On `mutate` it enqueues the entry, optimistically patches the given query\n * cache key and kicks a flush; if the enqueue itself throws, the cache is\n * rolled back to its previous value. Server delivery happens later inside the\n * engine's flush loop, so the UI updates instantly and survives reloads and\n * offline periods.\n *\n * @typeParam TVariables - The `mutate(variables)` input shape.\n * @typeParam TData - The cached query data optimistically patched.\n * @typeParam TPayload - Record snapshot carried by outbox entries.\n * @param options - Engine, variables→entry mapping and cache wiring.\n * @returns The TanStack {@link UseMutationResult}; the mutation resolves to the\n * generated outbox entry id.\n *\n * @example\n * const addNote = useOfflineMutation({\n * sync: notesSync,\n * queryKey: [\"notes\"],\n * toEntry: (note: Note) => ({ op: \"create\", recordId: note.id, payload: note }),\n * applyOptimistic: (current: Note[] = [], note) => [...current, note],\n * });\n * addNote.mutate(newNote);\n */\nexport function useOfflineMutation<TVariables, TData = unknown, TPayload = unknown>(\n options: UseOfflineMutationOptions<TVariables, TData, TPayload>,\n): UseMutationResult<string, Error, TVariables, MutationContext<TData>> {\n const { sync, toEntry, queryKey, applyOptimistic, flush = true, invalidate = false } = options;\n const client = useQueryClient();\n\n return useMutation<string, Error, TVariables, MutationContext<TData>>({\n mutationFn: async (variables) => {\n const draft = toEntry(variables);\n const id = await sync.enqueue(draft.op, draft.recordId, draft.payload);\n if (flush !== false) {\n const trigger: SyncTrigger = flush === true ? \"after-mutation\" : flush;\n void sync.flush(trigger);\n }\n return id;\n },\n onMutate: async (variables) => {\n if (!queryKey || !applyOptimistic) return { previous: undefined };\n await client.cancelQueries({ queryKey });\n const previous = client.getQueryData<TData>(queryKey);\n client.setQueryData<TData>(queryKey, (current) => applyOptimistic(current, variables));\n return { previous };\n },\n onError: (_error, _variables, context) => {\n if (queryKey && context) client.setQueryData(queryKey, context.previous);\n },\n onSettled: () => {\n if (invalidate && queryKey) void client.invalidateQueries({ queryKey });\n },\n });\n}\n"],"mappings":";;AA6EA,SAAgBA,EACZ,GACoE;CACpE,IAAM,EAAE,SAAM,YAAS,aAAU,oBAAiB,WAAQ,IAAM,gBAAa,OAAUC,GACjFC,IAASC,EAAe;CAE9B,OAAOC,EAA+D;EAClE,YAAY,OAAO,MAAc;GAC7B,IAAMC,IAAQC,EAAQC,CAAS,GACzBC,IAAK,MAAMC,EAAK,QAAQJ,EAAM,IAAIA,EAAM,UAAUA,EAAM,OAAO;GACrE,IAAIK,MAAU,IAAO;IACjB,IAAMC,IAAuBD,MAAU,KAAO,mBAAmBA;IACjE,EAAU,MAAMC,CAAO;GAC3B;GACA,OAAOH;EACX;EACA,UAAU,OAAO,MAAc;GAC3B,IAAI,CAACI,KAAY,CAACC,GAAiB,OAAO,EAAE,UAAU,KAAA,EAAU;GAChE,MAAMX,EAAO,cAAc,EAAE,YAAS,CAAC;GACvC,IAAMY,IAAWZ,EAAO,aAAoBU,CAAQ;GAEpD,OADAV,EAAO,aAAoBU,IAAW,MAAYC,EAAgBE,GAASR,CAAS,CAAC,GAC9E,EAAE,YAAS;EACtB;EACA,UAAU,GAAQ,GAAY,MAAY;GACtC,AAAIK,KAAYI,KAASd,EAAO,aAAaU,GAAUI,EAAQ,QAAQ;EAC3E;EACA,iBAAiB;GACb,AAAIC,KAAcL,KAAUV,EAAY,kBAAkB,EAAE,YAAS,CAAC;EAC1E;CACJ,CAAC;AACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-paginated-query.cjs","names":[],"sources":["../../src/query/use-paginated-query.ts"],"sourcesContent":["import { useCallback, useState } from \"react\";\nimport { hashKey, keepPreviousData, useQuery } from \"@tanstack/react-query\";\nimport type { QueryKey, UseQueryOptions } from \"@tanstack/react-query\";\n\nimport type { OffsetPage, OffsetParams } from \"./pagination\";\n\nexport interface UsePaginatedQueryOptions<T> extends Omit<\n UseQueryOptions<OffsetPage<T>, Error, OffsetPage<T>, QueryKey>,\n \"queryKey\" | \"queryFn\"\n> {\n /**\n * Base query key — the current page/sort is appended for cache isolation.\n * Put the applied filters here: when the key changes structurally, the page\n * goes back to 1 in the same render.\n */\n queryKey: QueryKey;\n /** Fetcher receiving the offset params; return the backend envelope. */\n queryFn: (params: OffsetParams) => Promise<OffsetPage<T>> | OffsetPage<T>;\n /** Initial 1-based page. Default: 1. */\n initialPage?: number;\n /** Page size. Default: 20. */\n pageSize?: number;\n /**\n * Query-param name for the page size. fastapi-pagination uses `\"size\"`\n * (default); SDK `BasePaginationFilterSchema` configs may use `\"page_size\"`.\n */\n sizeParam?: \"size\" | \"page_size\";\n /** Initial `order_by` (only sent when set). */\n orderBy?: string;\n /** Initial `ascending` (only sent when `orderBy` is set). Default: false. */\n ascending?: boolean;\n}\n\nexport interface UsePaginatedQueryResult<T> {\n /** The current page envelope, or undefined while the first load is pending. */\n page: OffsetPage<T> | undefined;\n /** The rows of the current page (empty array while pending). */\n items: T[];\n /** Current 1-based page number (controlled by the hook; back to 1 on a new `queryKey`). */\n pageNumber: number;\n /** Total page count from the last successful response. */\n pageCount: number;\n /** Total row count from the last successful response. */\n total: number;\n hasNext: boolean;\n hasPrev: boolean;\n isLoading: boolean;\n isFetching: boolean;\n error: Error | null;\n /** Jump to a specific 1-based page (clamped to >= 1). */\n setPage: (page: number) => void;\n /** Go to the next page when available. */\n next: () => void;\n /** Go to the previous page when available. */\n prev: () => void;\n /** Refetch the current page. */\n refetch: () => void;\n}\n\n/**\n * Offset-pagination hook over TanStack Query for the fastapi-pagination /\n * Tempest envelope (`{ items, total, page, size, pages }`).\n *\n * It owns the page state, sends `page` + the size param (`size` by default,\n * or `page_size` via `sizeParam`) plus optional `order_by`/`ascending` to your\n * fetcher, keeps the previous page visible while the next loads, and derives\n * `hasNext`/`hasPrev`/`pageCount`.\n *\n * A structurally different `queryKey` (compared with TanStack's `hashKey`) is a\n * different result set, so the page returns to 1. The reset is applied during\n * render rather than in an effect: an effect would let one render go out with the\n * new key and the old page, and that render is a request — on page 7 of an\n * unfiltered list, applying a filter used to ask for page 7 of a two-page result\n * and show an empty table (#356).\n *\n * @example\n * const users = usePaginatedQuery<User>({\n * queryKey: [\"users\"],\n * pageSize: 25,\n * queryFn: (params) => usersService.listUsers(params),\n * });\n * // users.items, users.next(), users.hasNext, users.pageCount\n */\nexport function usePaginatedQuery<T>(\n options: UsePaginatedQueryOptions<T>,\n): UsePaginatedQueryResult<T> {\n const {\n queryKey,\n queryFn,\n initialPage = 1,\n pageSize = 20,\n sizeParam = \"size\",\n orderBy,\n ascending = false,\n ...queryOptions\n } = options;\n\n const keyHash = hashKey(queryKey);\n const [paging, setPaging] = useState({ keyHash, page: initialPage });\n if (paging.keyHash !== keyHash) setPaging({ keyHash, page: 1 });\n const pageNumber = paging.keyHash === keyHash ? paging.page : 1;\n\n const query = useQuery<OffsetPage<T>, Error>({\n ...queryOptions,\n queryKey: [...queryKey, { page: pageNumber, pageSize, sizeParam, orderBy, ascending }],\n queryFn: () => {\n const params: OffsetParams = { page: pageNumber, [sizeParam]: pageSize };\n if (orderBy) {\n params.order_by = orderBy;\n params.ascending = ascending;\n }\n return queryFn(params);\n },\n placeholderData: keepPreviousData,\n });\n\n const page = query.data;\n const pageCount = page?.pages ?? 0;\n const hasNext = pageNumber < pageCount;\n const hasPrev = pageNumber > 1;\n\n const setPage = useCallback(\n (next: number) => setPaging((s) => ({ ...s, page: Math.max(1, next) })),\n [],\n );\n const next = useCallback(\n () => setPaging((s) => (s.page < pageCount ? { ...s, page: s.page + 1 } : s)),\n [pageCount],\n );\n const prev = useCallback(\n () => setPaging((s) => (s.page > 1 ? { ...s, page: s.page - 1 } : s)),\n [],\n );\n\n return {\n page,\n items: page?.items ?? [],\n pageNumber,\n pageCount,\n total: page?.total ?? 0,\n hasNext,\n hasPrev,\n isLoading: query.isLoading,\n isFetching: query.isFetching,\n error: query.error,\n setPage,\n next,\n prev,\n refetch: () => void query.refetch(),\n };\n}\n"],"mappings":"0DAmFA,
|
|
1
|
+
{"version":3,"file":"use-paginated-query.cjs","names":["hashKey","useState","useQuery","keepPreviousData","useCallback","react","_tanstack_react_query","usePaginatedQuery","queryOptions","options","keyHash","queryKey","paging","setPaging","initialPage","pageNumber","query","params","sizeParam","pageSize","orderBy","ascending","queryFn","page","pageCount","hasNext","hasPrev","setPage","s","next","prev"],"sources":["../../src/query/use-paginated-query.ts"],"sourcesContent":["import { useCallback, useState } from \"react\";\nimport { hashKey, keepPreviousData, useQuery } from \"@tanstack/react-query\";\nimport type { QueryKey, UseQueryOptions } from \"@tanstack/react-query\";\n\nimport type { OffsetPage, OffsetParams } from \"./pagination\";\n\nexport interface UsePaginatedQueryOptions<T> extends Omit<\n UseQueryOptions<OffsetPage<T>, Error, OffsetPage<T>, QueryKey>,\n \"queryKey\" | \"queryFn\"\n> {\n /**\n * Base query key — the current page/sort is appended for cache isolation.\n * Put the applied filters here: when the key changes structurally, the page\n * goes back to 1 in the same render.\n */\n queryKey: QueryKey;\n /** Fetcher receiving the offset params; return the backend envelope. */\n queryFn: (params: OffsetParams) => Promise<OffsetPage<T>> | OffsetPage<T>;\n /** Initial 1-based page. Default: 1. */\n initialPage?: number;\n /** Page size. Default: 20. */\n pageSize?: number;\n /**\n * Query-param name for the page size. fastapi-pagination uses `\"size\"`\n * (default); SDK `BasePaginationFilterSchema` configs may use `\"page_size\"`.\n */\n sizeParam?: \"size\" | \"page_size\";\n /** Initial `order_by` (only sent when set). */\n orderBy?: string;\n /** Initial `ascending` (only sent when `orderBy` is set). Default: false. */\n ascending?: boolean;\n}\n\nexport interface UsePaginatedQueryResult<T> {\n /** The current page envelope, or undefined while the first load is pending. */\n page: OffsetPage<T> | undefined;\n /** The rows of the current page (empty array while pending). */\n items: T[];\n /** Current 1-based page number (controlled by the hook; back to 1 on a new `queryKey`). */\n pageNumber: number;\n /** Total page count from the last successful response. */\n pageCount: number;\n /** Total row count from the last successful response. */\n total: number;\n hasNext: boolean;\n hasPrev: boolean;\n isLoading: boolean;\n isFetching: boolean;\n error: Error | null;\n /** Jump to a specific 1-based page (clamped to >= 1). */\n setPage: (page: number) => void;\n /** Go to the next page when available. */\n next: () => void;\n /** Go to the previous page when available. */\n prev: () => void;\n /** Refetch the current page. */\n refetch: () => void;\n}\n\n/**\n * Offset-pagination hook over TanStack Query for the fastapi-pagination /\n * Tempest envelope (`{ items, total, page, size, pages }`).\n *\n * It owns the page state, sends `page` + the size param (`size` by default,\n * or `page_size` via `sizeParam`) plus optional `order_by`/`ascending` to your\n * fetcher, keeps the previous page visible while the next loads, and derives\n * `hasNext`/`hasPrev`/`pageCount`.\n *\n * A structurally different `queryKey` (compared with TanStack's `hashKey`) is a\n * different result set, so the page returns to 1. The reset is applied during\n * render rather than in an effect: an effect would let one render go out with the\n * new key and the old page, and that render is a request — on page 7 of an\n * unfiltered list, applying a filter used to ask for page 7 of a two-page result\n * and show an empty table (#356).\n *\n * @example\n * const users = usePaginatedQuery<User>({\n * queryKey: [\"users\"],\n * pageSize: 25,\n * queryFn: (params) => usersService.listUsers(params),\n * });\n * // users.items, users.next(), users.hasNext, users.pageCount\n */\nexport function usePaginatedQuery<T>(\n options: UsePaginatedQueryOptions<T>,\n): UsePaginatedQueryResult<T> {\n const {\n queryKey,\n queryFn,\n initialPage = 1,\n pageSize = 20,\n sizeParam = \"size\",\n orderBy,\n ascending = false,\n ...queryOptions\n } = options;\n\n const keyHash = hashKey(queryKey);\n const [paging, setPaging] = useState({ keyHash, page: initialPage });\n if (paging.keyHash !== keyHash) setPaging({ keyHash, page: 1 });\n const pageNumber = paging.keyHash === keyHash ? paging.page : 1;\n\n const query = useQuery<OffsetPage<T>, Error>({\n ...queryOptions,\n queryKey: [...queryKey, { page: pageNumber, pageSize, sizeParam, orderBy, ascending }],\n queryFn: () => {\n const params: OffsetParams = { page: pageNumber, [sizeParam]: pageSize };\n if (orderBy) {\n params.order_by = orderBy;\n params.ascending = ascending;\n }\n return queryFn(params);\n },\n placeholderData: keepPreviousData,\n });\n\n const page = query.data;\n const pageCount = page?.pages ?? 0;\n const hasNext = pageNumber < pageCount;\n const hasPrev = pageNumber > 1;\n\n const setPage = useCallback(\n (next: number) => setPaging((s) => ({ ...s, page: Math.max(1, next) })),\n [],\n );\n const next = useCallback(\n () => setPaging((s) => (s.page < pageCount ? { ...s, page: s.page + 1 } : s)),\n [pageCount],\n );\n const prev = useCallback(\n () => setPaging((s) => (s.page > 1 ? { ...s, page: s.page - 1 } : s)),\n [],\n );\n\n return {\n page,\n items: page?.items ?? [],\n pageNumber,\n pageCount,\n total: page?.total ?? 0,\n hasNext,\n hasPrev,\n isLoading: query.isLoading,\n isFetching: query.isFetching,\n error: query.error,\n setPage,\n next,\n prev,\n refetch: () => void query.refetch(),\n };\n}\n"],"mappings":"A,0DAmFA,SAAgBO,EACZ,EAC0B,CAC1B,GAAM,CACF,WACA,UACA,cAAc,EACd,WAAW,GACX,YAAY,OACZ,UACA,YAAY,GACZ,GAAGC,GACHC,EAEEC,GAAA,EAAUV,EAAAA,QAAAA,CAAQW,CAAQ,EAC1B,CAACC,EAAQC,IAAA,EAAaZ,EAAAA,SAAAA,CAAS,CAAE,UAAS,KAAMa,CAAY,CAAC,EAC/DF,EAAO,UAAYF,GAASG,EAAU,CAAE,UAAS,KAAM,CAAE,CAAC,EAC9D,IAAME,EAAaH,EAAO,UAAYF,EAAUE,EAAO,KAAO,EAExDI,GAAA,EAAQd,EAAAA,SAAAA,CAA+B,CACzC,GAAGM,EACH,SAAU,CAAC,GAAGG,EAAU,CAAE,KAAMI,EAAY,WAAU,YAAW,UAAS,WAAU,CAAC,EACrF,YAAe,CACX,IAAME,EAAuB,CAAE,KAAMF,GAAaG,GAAYC,CAAS,EAKvE,OAJIC,IACA,EAAO,SAAWA,EAClB,EAAO,UAAYC,GAEhBC,EAAQL,CAAM,CACzB,EACA,gBAAiBd,EAAAA,gBACrB,CAAC,EAEKoB,EAAOP,EAAM,KACbQ,EAAYD,GAAM,OAAS,EAC3BE,EAAUV,EAAaS,EACvBE,EAAUX,EAAa,EAEvBY,GAAA,EAAUvB,EAAAA,YAAAA,CACX,GAAiBS,EAAW,IAAO,CAAE,GAAGe,EAAG,KAAM,KAAK,IAAI,EAAGC,CAAI,CAAE,EAAE,EACtE,CAAC,CACL,EACMA,GAAA,EAAOzB,EAAAA,YAAAA,KACHS,EAAW,GAAOe,EAAE,KAAOJ,EAAY,CAAE,GAAGI,EAAG,KAAMA,EAAE,KAAO,CAAE,EAAIA,CAAE,EAC5E,CAACJ,CAAS,CACd,EACMM,GAAA,EAAO1B,EAAAA,YAAAA,KACHS,EAAW,GAAOe,EAAE,KAAO,EAAI,CAAE,GAAGA,EAAG,KAAMA,EAAE,KAAO,CAAE,EAAIA,CAAE,EACpE,CAAC,CACL,EAEA,MAAO,CACH,OACA,MAAOL,GAAM,OAAS,CAAC,EACvB,aACA,YACA,MAAOA,GAAM,OAAS,EACtB,UACA,UACA,UAAWP,EAAM,UACjB,WAAYA,EAAM,WAClB,MAAOA,EAAM,MACb,UACA,OACA,OACA,YAAe,KAAKA,EAAM,QAAQ,CACtC,CACJ,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-paginated-query.js","names":[],"sources":["../../src/query/use-paginated-query.ts"],"sourcesContent":["import { useCallback, useState } from \"react\";\nimport { hashKey, keepPreviousData, useQuery } from \"@tanstack/react-query\";\nimport type { QueryKey, UseQueryOptions } from \"@tanstack/react-query\";\n\nimport type { OffsetPage, OffsetParams } from \"./pagination\";\n\nexport interface UsePaginatedQueryOptions<T> extends Omit<\n UseQueryOptions<OffsetPage<T>, Error, OffsetPage<T>, QueryKey>,\n \"queryKey\" | \"queryFn\"\n> {\n /**\n * Base query key — the current page/sort is appended for cache isolation.\n * Put the applied filters here: when the key changes structurally, the page\n * goes back to 1 in the same render.\n */\n queryKey: QueryKey;\n /** Fetcher receiving the offset params; return the backend envelope. */\n queryFn: (params: OffsetParams) => Promise<OffsetPage<T>> | OffsetPage<T>;\n /** Initial 1-based page. Default: 1. */\n initialPage?: number;\n /** Page size. Default: 20. */\n pageSize?: number;\n /**\n * Query-param name for the page size. fastapi-pagination uses `\"size\"`\n * (default); SDK `BasePaginationFilterSchema` configs may use `\"page_size\"`.\n */\n sizeParam?: \"size\" | \"page_size\";\n /** Initial `order_by` (only sent when set). */\n orderBy?: string;\n /** Initial `ascending` (only sent when `orderBy` is set). Default: false. */\n ascending?: boolean;\n}\n\nexport interface UsePaginatedQueryResult<T> {\n /** The current page envelope, or undefined while the first load is pending. */\n page: OffsetPage<T> | undefined;\n /** The rows of the current page (empty array while pending). */\n items: T[];\n /** Current 1-based page number (controlled by the hook; back to 1 on a new `queryKey`). */\n pageNumber: number;\n /** Total page count from the last successful response. */\n pageCount: number;\n /** Total row count from the last successful response. */\n total: number;\n hasNext: boolean;\n hasPrev: boolean;\n isLoading: boolean;\n isFetching: boolean;\n error: Error | null;\n /** Jump to a specific 1-based page (clamped to >= 1). */\n setPage: (page: number) => void;\n /** Go to the next page when available. */\n next: () => void;\n /** Go to the previous page when available. */\n prev: () => void;\n /** Refetch the current page. */\n refetch: () => void;\n}\n\n/**\n * Offset-pagination hook over TanStack Query for the fastapi-pagination /\n * Tempest envelope (`{ items, total, page, size, pages }`).\n *\n * It owns the page state, sends `page` + the size param (`size` by default,\n * or `page_size` via `sizeParam`) plus optional `order_by`/`ascending` to your\n * fetcher, keeps the previous page visible while the next loads, and derives\n * `hasNext`/`hasPrev`/`pageCount`.\n *\n * A structurally different `queryKey` (compared with TanStack's `hashKey`) is a\n * different result set, so the page returns to 1. The reset is applied during\n * render rather than in an effect: an effect would let one render go out with the\n * new key and the old page, and that render is a request — on page 7 of an\n * unfiltered list, applying a filter used to ask for page 7 of a two-page result\n * and show an empty table (#356).\n *\n * @example\n * const users = usePaginatedQuery<User>({\n * queryKey: [\"users\"],\n * pageSize: 25,\n * queryFn: (params) => usersService.listUsers(params),\n * });\n * // users.items, users.next(), users.hasNext, users.pageCount\n */\nexport function usePaginatedQuery<T>(\n options: UsePaginatedQueryOptions<T>,\n): UsePaginatedQueryResult<T> {\n const {\n queryKey,\n queryFn,\n initialPage = 1,\n pageSize = 20,\n sizeParam = \"size\",\n orderBy,\n ascending = false,\n ...queryOptions\n } = options;\n\n const keyHash = hashKey(queryKey);\n const [paging, setPaging] = useState({ keyHash, page: initialPage });\n if (paging.keyHash !== keyHash) setPaging({ keyHash, page: 1 });\n const pageNumber = paging.keyHash === keyHash ? paging.page : 1;\n\n const query = useQuery<OffsetPage<T>, Error>({\n ...queryOptions,\n queryKey: [...queryKey, { page: pageNumber, pageSize, sizeParam, orderBy, ascending }],\n queryFn: () => {\n const params: OffsetParams = { page: pageNumber, [sizeParam]: pageSize };\n if (orderBy) {\n params.order_by = orderBy;\n params.ascending = ascending;\n }\n return queryFn(params);\n },\n placeholderData: keepPreviousData,\n });\n\n const page = query.data;\n const pageCount = page?.pages ?? 0;\n const hasNext = pageNumber < pageCount;\n const hasPrev = pageNumber > 1;\n\n const setPage = useCallback(\n (next: number) => setPaging((s) => ({ ...s, page: Math.max(1, next) })),\n [],\n );\n const next = useCallback(\n () => setPaging((s) => (s.page < pageCount ? { ...s, page: s.page + 1 } : s)),\n [pageCount],\n );\n const prev = useCallback(\n () => setPaging((s) => (s.page > 1 ? { ...s, page: s.page - 1 } : s)),\n [],\n );\n\n return {\n page,\n items: page?.items ?? [],\n pageNumber,\n pageCount,\n total: page?.total ?? 0,\n hasNext,\n hasPrev,\n isLoading: query.isLoading,\n isFetching: query.isFetching,\n error: query.error,\n setPage,\n next,\n prev,\n refetch: () => void query.refetch(),\n };\n}\n"],"mappings":";;;AAmFA,
|
|
1
|
+
{"version":3,"file":"use-paginated-query.js","names":["usePaginatedQuery","queryOptions","options","keyHash","hashKey","queryKey","paging","setPaging","useState","initialPage","pageNumber","query","useQuery","params","sizeParam","pageSize","orderBy","ascending","queryFn","keepPreviousData","page","pageCount","hasNext","hasPrev","setPage","useCallback","s","next","prev"],"sources":["../../src/query/use-paginated-query.ts"],"sourcesContent":["import { useCallback, useState } from \"react\";\nimport { hashKey, keepPreviousData, useQuery } from \"@tanstack/react-query\";\nimport type { QueryKey, UseQueryOptions } from \"@tanstack/react-query\";\n\nimport type { OffsetPage, OffsetParams } from \"./pagination\";\n\nexport interface UsePaginatedQueryOptions<T> extends Omit<\n UseQueryOptions<OffsetPage<T>, Error, OffsetPage<T>, QueryKey>,\n \"queryKey\" | \"queryFn\"\n> {\n /**\n * Base query key — the current page/sort is appended for cache isolation.\n * Put the applied filters here: when the key changes structurally, the page\n * goes back to 1 in the same render.\n */\n queryKey: QueryKey;\n /** Fetcher receiving the offset params; return the backend envelope. */\n queryFn: (params: OffsetParams) => Promise<OffsetPage<T>> | OffsetPage<T>;\n /** Initial 1-based page. Default: 1. */\n initialPage?: number;\n /** Page size. Default: 20. */\n pageSize?: number;\n /**\n * Query-param name for the page size. fastapi-pagination uses `\"size\"`\n * (default); SDK `BasePaginationFilterSchema` configs may use `\"page_size\"`.\n */\n sizeParam?: \"size\" | \"page_size\";\n /** Initial `order_by` (only sent when set). */\n orderBy?: string;\n /** Initial `ascending` (only sent when `orderBy` is set). Default: false. */\n ascending?: boolean;\n}\n\nexport interface UsePaginatedQueryResult<T> {\n /** The current page envelope, or undefined while the first load is pending. */\n page: OffsetPage<T> | undefined;\n /** The rows of the current page (empty array while pending). */\n items: T[];\n /** Current 1-based page number (controlled by the hook; back to 1 on a new `queryKey`). */\n pageNumber: number;\n /** Total page count from the last successful response. */\n pageCount: number;\n /** Total row count from the last successful response. */\n total: number;\n hasNext: boolean;\n hasPrev: boolean;\n isLoading: boolean;\n isFetching: boolean;\n error: Error | null;\n /** Jump to a specific 1-based page (clamped to >= 1). */\n setPage: (page: number) => void;\n /** Go to the next page when available. */\n next: () => void;\n /** Go to the previous page when available. */\n prev: () => void;\n /** Refetch the current page. */\n refetch: () => void;\n}\n\n/**\n * Offset-pagination hook over TanStack Query for the fastapi-pagination /\n * Tempest envelope (`{ items, total, page, size, pages }`).\n *\n * It owns the page state, sends `page` + the size param (`size` by default,\n * or `page_size` via `sizeParam`) plus optional `order_by`/`ascending` to your\n * fetcher, keeps the previous page visible while the next loads, and derives\n * `hasNext`/`hasPrev`/`pageCount`.\n *\n * A structurally different `queryKey` (compared with TanStack's `hashKey`) is a\n * different result set, so the page returns to 1. The reset is applied during\n * render rather than in an effect: an effect would let one render go out with the\n * new key and the old page, and that render is a request — on page 7 of an\n * unfiltered list, applying a filter used to ask for page 7 of a two-page result\n * and show an empty table (#356).\n *\n * @example\n * const users = usePaginatedQuery<User>({\n * queryKey: [\"users\"],\n * pageSize: 25,\n * queryFn: (params) => usersService.listUsers(params),\n * });\n * // users.items, users.next(), users.hasNext, users.pageCount\n */\nexport function usePaginatedQuery<T>(\n options: UsePaginatedQueryOptions<T>,\n): UsePaginatedQueryResult<T> {\n const {\n queryKey,\n queryFn,\n initialPage = 1,\n pageSize = 20,\n sizeParam = \"size\",\n orderBy,\n ascending = false,\n ...queryOptions\n } = options;\n\n const keyHash = hashKey(queryKey);\n const [paging, setPaging] = useState({ keyHash, page: initialPage });\n if (paging.keyHash !== keyHash) setPaging({ keyHash, page: 1 });\n const pageNumber = paging.keyHash === keyHash ? paging.page : 1;\n\n const query = useQuery<OffsetPage<T>, Error>({\n ...queryOptions,\n queryKey: [...queryKey, { page: pageNumber, pageSize, sizeParam, orderBy, ascending }],\n queryFn: () => {\n const params: OffsetParams = { page: pageNumber, [sizeParam]: pageSize };\n if (orderBy) {\n params.order_by = orderBy;\n params.ascending = ascending;\n }\n return queryFn(params);\n },\n placeholderData: keepPreviousData,\n });\n\n const page = query.data;\n const pageCount = page?.pages ?? 0;\n const hasNext = pageNumber < pageCount;\n const hasPrev = pageNumber > 1;\n\n const setPage = useCallback(\n (next: number) => setPaging((s) => ({ ...s, page: Math.max(1, next) })),\n [],\n );\n const next = useCallback(\n () => setPaging((s) => (s.page < pageCount ? { ...s, page: s.page + 1 } : s)),\n [pageCount],\n );\n const prev = useCallback(\n () => setPaging((s) => (s.page > 1 ? { ...s, page: s.page - 1 } : s)),\n [],\n );\n\n return {\n page,\n items: page?.items ?? [],\n pageNumber,\n pageCount,\n total: page?.total ?? 0,\n hasNext,\n hasPrev,\n isLoading: query.isLoading,\n isFetching: query.isFetching,\n error: query.error,\n setPage,\n next,\n prev,\n refetch: () => void query.refetch(),\n };\n}\n"],"mappings":";;;AAmFA,SAAgBA,EACZ,GAC0B;CAC1B,IAAM,EACF,aACA,YACA,iBAAc,GACd,cAAW,IACX,eAAY,QACZ,YACA,eAAY,IACZ,GAAGC,MACHC,GAEEC,IAAUC,EAAQC,CAAQ,GAC1B,CAACC,GAAQC,KAAaC,EAAS;EAAE;EAAS,MAAMC;CAAY,CAAC;CACnE,AAAIH,EAAO,YAAYH,KAASI,EAAU;EAAE;EAAS,MAAM;CAAE,CAAC;CAC9D,IAAMG,IAAaJ,EAAO,YAAYH,IAAUG,EAAO,OAAO,GAExDK,IAAQC,EAA+B;EACzC,GAAGX;EACH,UAAU,CAAC,GAAGI,GAAU;GAAE,MAAMK;GAAY;GAAU;GAAW;GAAS;EAAU,CAAC;EACrF,eAAe;GACX,IAAMG,IAAuB;IAAE,MAAMH;KAAaI,IAAYC;GAAS;GAKvE,OAJIC,MACA,EAAO,WAAWA,GAClB,EAAO,YAAYC,IAEhBC,EAAQL,CAAM;EACzB;EACA,iBAAiBM;CACrB,CAAC,GAEKC,IAAOT,EAAM,MACbU,IAAYD,GAAM,SAAS,GAC3BE,IAAUZ,IAAaW,GACvBE,IAAUb,IAAa,GAEvBc,IAAUC,GACX,MAAiBlB,GAAW,OAAO;EAAE,GAAGmB;EAAG,MAAM,KAAK,IAAI,GAAGC,CAAI;CAAE,EAAE,GACtE,CAAC,CACL,GACMA,IAAOF,QACHlB,GAAW,MAAOmB,EAAE,OAAOL,IAAY;EAAE,GAAGK;EAAG,MAAMA,EAAE,OAAO;CAAE,IAAIA,CAAE,GAC5E,CAACL,CAAS,CACd,GACMO,IAAOH,QACHlB,GAAW,MAAOmB,EAAE,OAAO,IAAI;EAAE,GAAGA;EAAG,MAAMA,EAAE,OAAO;CAAE,IAAIA,CAAE,GACpE,CAAC,CACL;CAEA,OAAO;EACH;EACA,OAAON,GAAM,SAAS,CAAC;EACvB;EACA;EACA,OAAOA,GAAM,SAAS;EACtB;EACA;EACA,WAAWT,EAAM;EACjB,YAAYA,EAAM;EAClB,OAAOA,EAAM;EACb;EACA;EACA;EACA,eAAe,KAAKA,EAAM,QAAQ;CACtC;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppRouter.cjs","names":[],"sources":["../../src/router/AppRouter.tsx"],"sourcesContent":["import { Suspense, useMemo } from \"react\";\nimport type { ComponentType, ReactNode } from \"react\";\nimport { BrowserRouter, HashRouter, MemoryRouter, Routes, Route } from \"react-router\";\nimport { lazyWithRetry } from \"../auth/lazy-with-retry\";\nimport { RouteGuard } from \"./RouteGuard\";\nimport type { RouteGuardResult, RouterKind, TempestRouteObject } from \"./types\";\n\n/**\n * Identity helper that types a declarative route tree. Use it so editors give\n * autocomplete and type-checking on every node; the array is returned as-is.\n *\n * @example\n * export const routes = defineRoutes([\n * { path: \"/\", element: <Layout />, children: [\n * { index: true, lazy: () => import(\"./pages/Home\") },\n * { path: \"settings\", lazy: () => import(\"./pages/Settings\"),\n * guard: () => useAuth.getState().isAuthenticated, redirectTo: \"/login\" },\n * ] },\n * ]);\n */\nexport function defineRoutes(routes: TempestRouteObject[]): TempestRouteObject[] {\n return routes;\n}\n\nconst lazyCache = new WeakMap<TempestRouteObject, ComponentType<unknown>>();\n\nfunction resolveLazy(route: TempestRouteObject): ComponentType<unknown> {\n let comp = lazyCache.get(route);\n if (!comp) {\n comp = lazyWithRetry(route.lazy!);\n lazyCache.set(route, comp);\n }\n return comp;\n}\n\n/**\n * Runs one route's `guard` and renders the outcome.\n *\n * The guard is called during this component's render, which is what lets it\n * call hooks — `useCan` returning `{ allowed, isLoading }` maps straight onto\n * the three outcomes. See {@link guardKey} for why each guarded route gets its\n * own instance.\n */\nfunction GuardedElement({\n guard,\n guardFallback,\n redirectTo,\n children,\n}: {\n guard: boolean | (() => RouteGuardResult);\n guardFallback?: ReactNode;\n redirectTo?: string;\n children: ReactNode;\n}) {\n const allowed = typeof guard === \"function\" ? guard() : guard;\n return (\n <RouteGuard when={allowed} fallback={guardFallback} redirectTo={redirectTo}>\n {children}\n </RouteGuard>\n );\n}\n\nconst guardKeys = new WeakMap<TempestRouteObject, string>();\nlet guardKeySeq = 0;\n\n/**\n * A key unique to each route object, so React remounts `GuardedElement` when\n * the matched route changes instead of reusing the instance.\n *\n * Load-bearing once guards may call hooks. React Router renders the matched\n * route's element at the same position in the tree, so without a differing key\n * React reconciles two different routes onto the same `GuardedElement`\n * instance and the previous route's guard state survives into the next one's —\n * a guard reading `useState(\"from-a\")` still reads `\"from-a\"` after navigating\n * to a route whose guard initialises it to `\"from-b\"`. Path is not enough on\n * its own: two routes in different branches can share one.\n */\nfunction guardKey(route: TempestRouteObject): string {\n let key = guardKeys.get(route);\n if (!key) {\n key = `guard-${++guardKeySeq}`;\n guardKeys.set(route, key);\n }\n return key;\n}\n\nfunction toRouteElements(routes: TempestRouteObject[], fallback: ReactNode): ReactNode {\n return routes.map((route, i) => {\n let element: ReactNode = route.element;\n if (route.lazy) {\n const LazyComponent = resolveLazy(route);\n element = <LazyComponent />;\n }\n if (route.guard !== undefined) {\n element = (\n <GuardedElement\n key={guardKey(route)}\n guard={route.guard}\n guardFallback={route.guardFallback ?? fallback}\n redirectTo={route.redirectTo}\n >\n {element}\n </GuardedElement>\n );\n }\n\n if (route.index) {\n return <Route key={`index-${i}`} index element={element} />;\n }\n\n return (\n <Route\n key={route.path ?? `route-${i}`}\n path={route.path}\n element={element}\n caseSensitive={route.caseSensitive}\n >\n {route.children ? toRouteElements(route.children, fallback) : null}\n </Route>\n );\n });\n}\n\nconst ROUTERS: Record<RouterKind, typeof BrowserRouter> = {\n browser: BrowserRouter,\n hash: HashRouter,\n memory: MemoryRouter,\n};\n\nexport interface AppRouterProps {\n /** Declarative route tree, ideally built with {@link defineRoutes}. */\n routes: TempestRouteObject[];\n /** History strategy (default: `\"browser\"`). */\n router?: RouterKind;\n /** App-wide base path forwarded to the underlying router. */\n basename?: string;\n /** Initial URLs for the `\"memory\"` router (tests / non-DOM hosts). */\n initialEntries?: string[];\n /**\n * Suspense fallback shown while a `lazy` route chunk loads, and the default\n * for a route whose `guard` answers `\"pending\"` — one spinner covers both\n * kinds of \"not ready yet\". A route overrides it with its own\n * `guardFallback`.\n */\n fallback?: ReactNode;\n}\n\n/**\n * Render a full React Router (v7 or v8, declarative mode) from a\n * {@link defineRoutes}\n * tree: picks the history strategy, wraps everything in a `<Suspense>` boundary\n * for `lazy` routes, and applies per-route `guard` redirects. This is the\n * single entry point apps mount at their root.\n *\n * @example\n * <AppRouter routes={routes} fallback={<Spinner />} />\n */\nexport function AppRouter({\n routes,\n router = \"browser\",\n basename,\n initialEntries,\n fallback = null,\n}: AppRouterProps) {\n const tree = useMemo(() => toRouteElements(routes, fallback), [routes, fallback]);\n const Router = ROUTERS[router];\n const routerProps = router === \"memory\" ? { basename, initialEntries } : { basename };\n\n return (\n <Router {...routerProps}>\n <Suspense fallback={fallback}>\n <Routes>{tree}</Routes>\n </Suspense>\n </Router>\n );\n}\n"],"mappings":"6JAoBA,
|
|
1
|
+
{"version":3,"file":"AppRouter.cjs","names":["lazyWithRetry","RouteGuard","Route","BrowserRouter","HashRouter","MemoryRouter","useMemo","Suspense","Routes","require_lazy_with_retry","require_RouteGuard","react","react_jsx_runtime","react_router","defineRoutes","routes","lazyCache","resolveLazy","comp","route","GuardedElement","allowed","guard","guardFallback","guardKeys","guardKeySeq","guardKey","key","toRouteElements","element","LazyComponent","fallback","i","ROUTERS","AppRouter","tree","Router","router"],"sources":["../../src/router/AppRouter.tsx"],"sourcesContent":["import { Suspense, useMemo } from \"react\";\nimport type { ComponentType, ReactNode } from \"react\";\nimport { BrowserRouter, HashRouter, MemoryRouter, Routes, Route } from \"react-router\";\nimport { lazyWithRetry } from \"../auth/lazy-with-retry\";\nimport { RouteGuard } from \"./RouteGuard\";\nimport type { RouteGuardResult, RouterKind, TempestRouteObject } from \"./types\";\n\n/**\n * Identity helper that types a declarative route tree. Use it so editors give\n * autocomplete and type-checking on every node; the array is returned as-is.\n *\n * @example\n * export const routes = defineRoutes([\n * { path: \"/\", element: <Layout />, children: [\n * { index: true, lazy: () => import(\"./pages/Home\") },\n * { path: \"settings\", lazy: () => import(\"./pages/Settings\"),\n * guard: () => useAuth.getState().isAuthenticated, redirectTo: \"/login\" },\n * ] },\n * ]);\n */\nexport function defineRoutes(routes: TempestRouteObject[]): TempestRouteObject[] {\n return routes;\n}\n\nconst lazyCache = new WeakMap<TempestRouteObject, ComponentType<unknown>>();\n\nfunction resolveLazy(route: TempestRouteObject): ComponentType<unknown> {\n let comp = lazyCache.get(route);\n if (!comp) {\n comp = lazyWithRetry(route.lazy!);\n lazyCache.set(route, comp);\n }\n return comp;\n}\n\n/**\n * Runs one route's `guard` and renders the outcome.\n *\n * The guard is called during this component's render, which is what lets it\n * call hooks — `useCan` returning `{ allowed, isLoading }` maps straight onto\n * the three outcomes. See {@link guardKey} for why each guarded route gets its\n * own instance.\n */\nfunction GuardedElement({\n guard,\n guardFallback,\n redirectTo,\n children,\n}: {\n guard: boolean | (() => RouteGuardResult);\n guardFallback?: ReactNode;\n redirectTo?: string;\n children: ReactNode;\n}) {\n const allowed = typeof guard === \"function\" ? guard() : guard;\n return (\n <RouteGuard when={allowed} fallback={guardFallback} redirectTo={redirectTo}>\n {children}\n </RouteGuard>\n );\n}\n\nconst guardKeys = new WeakMap<TempestRouteObject, string>();\nlet guardKeySeq = 0;\n\n/**\n * A key unique to each route object, so React remounts `GuardedElement` when\n * the matched route changes instead of reusing the instance.\n *\n * Load-bearing once guards may call hooks. React Router renders the matched\n * route's element at the same position in the tree, so without a differing key\n * React reconciles two different routes onto the same `GuardedElement`\n * instance and the previous route's guard state survives into the next one's —\n * a guard reading `useState(\"from-a\")` still reads `\"from-a\"` after navigating\n * to a route whose guard initialises it to `\"from-b\"`. Path is not enough on\n * its own: two routes in different branches can share one.\n */\nfunction guardKey(route: TempestRouteObject): string {\n let key = guardKeys.get(route);\n if (!key) {\n key = `guard-${++guardKeySeq}`;\n guardKeys.set(route, key);\n }\n return key;\n}\n\nfunction toRouteElements(routes: TempestRouteObject[], fallback: ReactNode): ReactNode {\n return routes.map((route, i) => {\n let element: ReactNode = route.element;\n if (route.lazy) {\n const LazyComponent = resolveLazy(route);\n element = <LazyComponent />;\n }\n if (route.guard !== undefined) {\n element = (\n <GuardedElement\n key={guardKey(route)}\n guard={route.guard}\n guardFallback={route.guardFallback ?? fallback}\n redirectTo={route.redirectTo}\n >\n {element}\n </GuardedElement>\n );\n }\n\n if (route.index) {\n return <Route key={`index-${i}`} index element={element} />;\n }\n\n return (\n <Route\n key={route.path ?? `route-${i}`}\n path={route.path}\n element={element}\n caseSensitive={route.caseSensitive}\n >\n {route.children ? toRouteElements(route.children, fallback) : null}\n </Route>\n );\n });\n}\n\nconst ROUTERS: Record<RouterKind, typeof BrowserRouter> = {\n browser: BrowserRouter,\n hash: HashRouter,\n memory: MemoryRouter,\n};\n\nexport interface AppRouterProps {\n /** Declarative route tree, ideally built with {@link defineRoutes}. */\n routes: TempestRouteObject[];\n /** History strategy (default: `\"browser\"`). */\n router?: RouterKind;\n /** App-wide base path forwarded to the underlying router. */\n basename?: string;\n /** Initial URLs for the `\"memory\"` router (tests / non-DOM hosts). */\n initialEntries?: string[];\n /**\n * Suspense fallback shown while a `lazy` route chunk loads, and the default\n * for a route whose `guard` answers `\"pending\"` — one spinner covers both\n * kinds of \"not ready yet\". A route overrides it with its own\n * `guardFallback`.\n */\n fallback?: ReactNode;\n}\n\n/**\n * Render a full React Router (v7 or v8, declarative mode) from a\n * {@link defineRoutes}\n * tree: picks the history strategy, wraps everything in a `<Suspense>` boundary\n * for `lazy` routes, and applies per-route `guard` redirects. This is the\n * single entry point apps mount at their root.\n *\n * @example\n * <AppRouter routes={routes} fallback={<Spinner />} />\n */\nexport function AppRouter({\n routes,\n router = \"browser\",\n basename,\n initialEntries,\n fallback = null,\n}: AppRouterProps) {\n const tree = useMemo(() => toRouteElements(routes, fallback), [routes, fallback]);\n const Router = ROUTERS[router];\n const routerProps = router === \"memory\" ? { basename, initialEntries } : { basename };\n\n return (\n <Router {...routerProps}>\n <Suspense fallback={fallback}>\n <Routes>{tree}</Routes>\n </Suspense>\n </Router>\n );\n}\n"],"mappings":"A,6JAoBA,SAAgBc,EAAa,EAAoD,CAC7E,OAAOC,CACX,CAEA,IAAMC,EAAY,IAAI,QAEtB,SAASC,EAAY,EAAmD,CACpE,IAAIC,EAAOF,EAAU,IAAIG,CAAK,EAK9B,OAJKD,IACD,EAAOlB,EAAAA,cAAcmB,EAAM,IAAK,EAChCH,EAAU,IAAIG,EAAOD,CAAI,GAEtBA,CACX,CAUA,SAASE,EAAe,CACpB,QACA,gBACA,aACA,YAMD,CACC,IAAMC,EAAU,OAAOC,GAAU,WAAaA,EAAM,EAAIA,EACxD,OACI,EAAAV,EAAA,IAAA,CAACX,EAAAA,WAAD,CAAY,KAAMoB,EAAS,SAAUE,EAA2B,aAC3D,UACO,CAAA,CAEpB,CAEA,IAAMC,EAAY,IAAI,QAClBC,EAAc,EAclB,SAASC,EAAS,EAAmC,CACjD,IAAIC,EAAMH,EAAU,IAAIL,CAAK,EAK7B,OAJKQ,IACD,EAAM,SAAS,EAAEF,IACjBD,EAAU,IAAIL,EAAOQ,CAAG,GAErBA,CACX,CAEA,SAASC,EAAgB,EAA8B,EAAgC,CACnF,OAAOb,EAAO,KAAK,EAAO,IAAM,CAC5B,IAAIc,EAAqBV,EAAM,QAC/B,GAAIA,EAAM,KAAM,CACZ,IAAMW,EAAgBb,EAAYE,CAAK,EACvC,GAAU,EAAAP,EAAA,IAAA,CAACkB,EAAD,CAAgB,CAAA,CAC9B,CAkBA,OAjBIX,EAAM,QAAU,IAAA,KAChB,GACI,EAAAP,EAAA,IAAA,CAACQ,EAAD,CAEI,MAAOD,EAAM,MACb,cAAeA,EAAM,eAAiBY,EACtC,WAAYZ,EAAM,WAEjB,SAAAU,CACW,EANPH,EAASP,CAAK,CAMP,GAIpBA,EAAM,OACC,EAAAP,EAAA,IAAA,CAACV,EAAAA,MAAD,CAA0B,MAAA,GAAe,SAAU,EAAvC,SAAS8B,GAA8B,GAI1D,EAAApB,EAAA,IAAA,CAACV,EAAAA,MAAD,CAEI,KAAMiB,EAAM,KACH,UACT,cAAeA,EAAM,cAEpB,SAAAA,EAAM,SAAWS,EAAgBT,EAAM,SAAUY,CAAQ,EAAI,IAC3D,EANEZ,EAAM,MAAQ,SAASa,GAMzB,CAEf,CAAC,CACL,CAEA,IAAMC,EAAoD,CACtD,QAAS9B,EAAAA,cACT,KAAMC,EAAAA,WACN,OAAQC,EAAAA,YACZ,EA8BA,SAAgB6B,EAAU,CACtB,SACA,SAAS,UACT,WACA,iBACA,WAAW,MACI,CACf,IAAMC,GAAA,EAAO7B,EAAAA,QAAAA,KAAcsB,EAAgBb,EAAQgB,CAAQ,EAAG,CAAChB,EAAQgB,CAAQ,CAAC,EAC1EK,EAASH,EAAQI,GAGvB,OACI,EAAAzB,EAAA,IAAA,CAACwB,EAAD,CAAQ,GAHQC,IAAW,SAAW,CAAE,WAAU,gBAAe,EAAI,CAAE,UAAS,EAI5E,UAAA,EAAAzB,EAAA,IAAA,CAACL,EAAAA,SAAD,CAAoB,WAChB,UAAA,EAAAK,EAAA,IAAA,CAACJ,EAAAA,OAAD,CAAA,SAAS2B,CAAa,CAAA,CAChB,CAAA,CACN,CAAA,CAEhB,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppRouter.js","names":[],"sources":["../../src/router/AppRouter.tsx"],"sourcesContent":["import { Suspense, useMemo } from \"react\";\nimport type { ComponentType, ReactNode } from \"react\";\nimport { BrowserRouter, HashRouter, MemoryRouter, Routes, Route } from \"react-router\";\nimport { lazyWithRetry } from \"../auth/lazy-with-retry\";\nimport { RouteGuard } from \"./RouteGuard\";\nimport type { RouteGuardResult, RouterKind, TempestRouteObject } from \"./types\";\n\n/**\n * Identity helper that types a declarative route tree. Use it so editors give\n * autocomplete and type-checking on every node; the array is returned as-is.\n *\n * @example\n * export const routes = defineRoutes([\n * { path: \"/\", element: <Layout />, children: [\n * { index: true, lazy: () => import(\"./pages/Home\") },\n * { path: \"settings\", lazy: () => import(\"./pages/Settings\"),\n * guard: () => useAuth.getState().isAuthenticated, redirectTo: \"/login\" },\n * ] },\n * ]);\n */\nexport function defineRoutes(routes: TempestRouteObject[]): TempestRouteObject[] {\n return routes;\n}\n\nconst lazyCache = new WeakMap<TempestRouteObject, ComponentType<unknown>>();\n\nfunction resolveLazy(route: TempestRouteObject): ComponentType<unknown> {\n let comp = lazyCache.get(route);\n if (!comp) {\n comp = lazyWithRetry(route.lazy!);\n lazyCache.set(route, comp);\n }\n return comp;\n}\n\n/**\n * Runs one route's `guard` and renders the outcome.\n *\n * The guard is called during this component's render, which is what lets it\n * call hooks — `useCan` returning `{ allowed, isLoading }` maps straight onto\n * the three outcomes. See {@link guardKey} for why each guarded route gets its\n * own instance.\n */\nfunction GuardedElement({\n guard,\n guardFallback,\n redirectTo,\n children,\n}: {\n guard: boolean | (() => RouteGuardResult);\n guardFallback?: ReactNode;\n redirectTo?: string;\n children: ReactNode;\n}) {\n const allowed = typeof guard === \"function\" ? guard() : guard;\n return (\n <RouteGuard when={allowed} fallback={guardFallback} redirectTo={redirectTo}>\n {children}\n </RouteGuard>\n );\n}\n\nconst guardKeys = new WeakMap<TempestRouteObject, string>();\nlet guardKeySeq = 0;\n\n/**\n * A key unique to each route object, so React remounts `GuardedElement` when\n * the matched route changes instead of reusing the instance.\n *\n * Load-bearing once guards may call hooks. React Router renders the matched\n * route's element at the same position in the tree, so without a differing key\n * React reconciles two different routes onto the same `GuardedElement`\n * instance and the previous route's guard state survives into the next one's —\n * a guard reading `useState(\"from-a\")` still reads `\"from-a\"` after navigating\n * to a route whose guard initialises it to `\"from-b\"`. Path is not enough on\n * its own: two routes in different branches can share one.\n */\nfunction guardKey(route: TempestRouteObject): string {\n let key = guardKeys.get(route);\n if (!key) {\n key = `guard-${++guardKeySeq}`;\n guardKeys.set(route, key);\n }\n return key;\n}\n\nfunction toRouteElements(routes: TempestRouteObject[], fallback: ReactNode): ReactNode {\n return routes.map((route, i) => {\n let element: ReactNode = route.element;\n if (route.lazy) {\n const LazyComponent = resolveLazy(route);\n element = <LazyComponent />;\n }\n if (route.guard !== undefined) {\n element = (\n <GuardedElement\n key={guardKey(route)}\n guard={route.guard}\n guardFallback={route.guardFallback ?? fallback}\n redirectTo={route.redirectTo}\n >\n {element}\n </GuardedElement>\n );\n }\n\n if (route.index) {\n return <Route key={`index-${i}`} index element={element} />;\n }\n\n return (\n <Route\n key={route.path ?? `route-${i}`}\n path={route.path}\n element={element}\n caseSensitive={route.caseSensitive}\n >\n {route.children ? toRouteElements(route.children, fallback) : null}\n </Route>\n );\n });\n}\n\nconst ROUTERS: Record<RouterKind, typeof BrowserRouter> = {\n browser: BrowserRouter,\n hash: HashRouter,\n memory: MemoryRouter,\n};\n\nexport interface AppRouterProps {\n /** Declarative route tree, ideally built with {@link defineRoutes}. */\n routes: TempestRouteObject[];\n /** History strategy (default: `\"browser\"`). */\n router?: RouterKind;\n /** App-wide base path forwarded to the underlying router. */\n basename?: string;\n /** Initial URLs for the `\"memory\"` router (tests / non-DOM hosts). */\n initialEntries?: string[];\n /**\n * Suspense fallback shown while a `lazy` route chunk loads, and the default\n * for a route whose `guard` answers `\"pending\"` — one spinner covers both\n * kinds of \"not ready yet\". A route overrides it with its own\n * `guardFallback`.\n */\n fallback?: ReactNode;\n}\n\n/**\n * Render a full React Router (v7 or v8, declarative mode) from a\n * {@link defineRoutes}\n * tree: picks the history strategy, wraps everything in a `<Suspense>` boundary\n * for `lazy` routes, and applies per-route `guard` redirects. This is the\n * single entry point apps mount at their root.\n *\n * @example\n * <AppRouter routes={routes} fallback={<Spinner />} />\n */\nexport function AppRouter({\n routes,\n router = \"browser\",\n basename,\n initialEntries,\n fallback = null,\n}: AppRouterProps) {\n const tree = useMemo(() => toRouteElements(routes, fallback), [routes, fallback]);\n const Router = ROUTERS[router];\n const routerProps = router === \"memory\" ? { basename, initialEntries } : { basename };\n\n return (\n <Router {...routerProps}>\n <Suspense fallback={fallback}>\n <Routes>{tree}</Routes>\n </Suspense>\n </Router>\n );\n}\n"],"mappings":";;;;;;AAoBA,
|
|
1
|
+
{"version":3,"file":"AppRouter.js","names":["defineRoutes","routes","lazyCache","resolveLazy","comp","route","lazyWithRetry","GuardedElement","allowed","guard","RouteGuard","guardFallback","guardKeys","guardKeySeq","guardKey","key","toRouteElements","element","LazyComponent","fallback","Route","i","ROUTERS","BrowserRouter","HashRouter","MemoryRouter","AppRouter","tree","useMemo","Router","router","Suspense","Routes"],"sources":["../../src/router/AppRouter.tsx"],"sourcesContent":["import { Suspense, useMemo } from \"react\";\nimport type { ComponentType, ReactNode } from \"react\";\nimport { BrowserRouter, HashRouter, MemoryRouter, Routes, Route } from \"react-router\";\nimport { lazyWithRetry } from \"../auth/lazy-with-retry\";\nimport { RouteGuard } from \"./RouteGuard\";\nimport type { RouteGuardResult, RouterKind, TempestRouteObject } from \"./types\";\n\n/**\n * Identity helper that types a declarative route tree. Use it so editors give\n * autocomplete and type-checking on every node; the array is returned as-is.\n *\n * @example\n * export const routes = defineRoutes([\n * { path: \"/\", element: <Layout />, children: [\n * { index: true, lazy: () => import(\"./pages/Home\") },\n * { path: \"settings\", lazy: () => import(\"./pages/Settings\"),\n * guard: () => useAuth.getState().isAuthenticated, redirectTo: \"/login\" },\n * ] },\n * ]);\n */\nexport function defineRoutes(routes: TempestRouteObject[]): TempestRouteObject[] {\n return routes;\n}\n\nconst lazyCache = new WeakMap<TempestRouteObject, ComponentType<unknown>>();\n\nfunction resolveLazy(route: TempestRouteObject): ComponentType<unknown> {\n let comp = lazyCache.get(route);\n if (!comp) {\n comp = lazyWithRetry(route.lazy!);\n lazyCache.set(route, comp);\n }\n return comp;\n}\n\n/**\n * Runs one route's `guard` and renders the outcome.\n *\n * The guard is called during this component's render, which is what lets it\n * call hooks — `useCan` returning `{ allowed, isLoading }` maps straight onto\n * the three outcomes. See {@link guardKey} for why each guarded route gets its\n * own instance.\n */\nfunction GuardedElement({\n guard,\n guardFallback,\n redirectTo,\n children,\n}: {\n guard: boolean | (() => RouteGuardResult);\n guardFallback?: ReactNode;\n redirectTo?: string;\n children: ReactNode;\n}) {\n const allowed = typeof guard === \"function\" ? guard() : guard;\n return (\n <RouteGuard when={allowed} fallback={guardFallback} redirectTo={redirectTo}>\n {children}\n </RouteGuard>\n );\n}\n\nconst guardKeys = new WeakMap<TempestRouteObject, string>();\nlet guardKeySeq = 0;\n\n/**\n * A key unique to each route object, so React remounts `GuardedElement` when\n * the matched route changes instead of reusing the instance.\n *\n * Load-bearing once guards may call hooks. React Router renders the matched\n * route's element at the same position in the tree, so without a differing key\n * React reconciles two different routes onto the same `GuardedElement`\n * instance and the previous route's guard state survives into the next one's —\n * a guard reading `useState(\"from-a\")` still reads `\"from-a\"` after navigating\n * to a route whose guard initialises it to `\"from-b\"`. Path is not enough on\n * its own: two routes in different branches can share one.\n */\nfunction guardKey(route: TempestRouteObject): string {\n let key = guardKeys.get(route);\n if (!key) {\n key = `guard-${++guardKeySeq}`;\n guardKeys.set(route, key);\n }\n return key;\n}\n\nfunction toRouteElements(routes: TempestRouteObject[], fallback: ReactNode): ReactNode {\n return routes.map((route, i) => {\n let element: ReactNode = route.element;\n if (route.lazy) {\n const LazyComponent = resolveLazy(route);\n element = <LazyComponent />;\n }\n if (route.guard !== undefined) {\n element = (\n <GuardedElement\n key={guardKey(route)}\n guard={route.guard}\n guardFallback={route.guardFallback ?? fallback}\n redirectTo={route.redirectTo}\n >\n {element}\n </GuardedElement>\n );\n }\n\n if (route.index) {\n return <Route key={`index-${i}`} index element={element} />;\n }\n\n return (\n <Route\n key={route.path ?? `route-${i}`}\n path={route.path}\n element={element}\n caseSensitive={route.caseSensitive}\n >\n {route.children ? toRouteElements(route.children, fallback) : null}\n </Route>\n );\n });\n}\n\nconst ROUTERS: Record<RouterKind, typeof BrowserRouter> = {\n browser: BrowserRouter,\n hash: HashRouter,\n memory: MemoryRouter,\n};\n\nexport interface AppRouterProps {\n /** Declarative route tree, ideally built with {@link defineRoutes}. */\n routes: TempestRouteObject[];\n /** History strategy (default: `\"browser\"`). */\n router?: RouterKind;\n /** App-wide base path forwarded to the underlying router. */\n basename?: string;\n /** Initial URLs for the `\"memory\"` router (tests / non-DOM hosts). */\n initialEntries?: string[];\n /**\n * Suspense fallback shown while a `lazy` route chunk loads, and the default\n * for a route whose `guard` answers `\"pending\"` — one spinner covers both\n * kinds of \"not ready yet\". A route overrides it with its own\n * `guardFallback`.\n */\n fallback?: ReactNode;\n}\n\n/**\n * Render a full React Router (v7 or v8, declarative mode) from a\n * {@link defineRoutes}\n * tree: picks the history strategy, wraps everything in a `<Suspense>` boundary\n * for `lazy` routes, and applies per-route `guard` redirects. This is the\n * single entry point apps mount at their root.\n *\n * @example\n * <AppRouter routes={routes} fallback={<Spinner />} />\n */\nexport function AppRouter({\n routes,\n router = \"browser\",\n basename,\n initialEntries,\n fallback = null,\n}: AppRouterProps) {\n const tree = useMemo(() => toRouteElements(routes, fallback), [routes, fallback]);\n const Router = ROUTERS[router];\n const routerProps = router === \"memory\" ? { basename, initialEntries } : { basename };\n\n return (\n <Router {...routerProps}>\n <Suspense fallback={fallback}>\n <Routes>{tree}</Routes>\n </Suspense>\n </Router>\n );\n}\n"],"mappings":";;;;;;AAoBA,SAAgBA,EAAa,GAAoD;CAC7E,OAAOC;AACX;AAEA,IAAMC,oBAAY,IAAI,QAAoD;AAE1E,SAASC,EAAY,GAAmD;CACpE,IAAIC,IAAOF,EAAU,IAAIG,CAAK;CAK9B,OAJKD,MACD,IAAOE,EAAcD,EAAM,IAAK,GAChCH,EAAU,IAAIG,GAAOD,CAAI,IAEtBA;AACX;AAUA,SAASG,EAAe,EACpB,UACA,kBACA,eACA,eAMD;CACC,IAAMC,IAAU,OAAOC,KAAU,aAAaA,EAAM,IAAIA;CACxD,OACI,kBAACC,GAAD;EAAY,MAAMF;EAAS,UAAUG;EAA2B;EAC3D;CACO,CAAA;AAEpB;AAEA,IAAMC,oBAAY,IAAI,QAAoC,GACtDC,IAAc;AAclB,SAASC,EAAS,GAAmC;CACjD,IAAIC,IAAMH,EAAU,IAAIP,CAAK;CAK7B,OAJKU,MACD,IAAM,SAAS,EAAEF,KACjBD,EAAU,IAAIP,GAAOU,CAAG,IAErBA;AACX;AAEA,SAASC,EAAgB,GAA8B,GAAgC;CACnF,OAAOf,EAAO,KAAK,GAAO,MAAM;EAC5B,IAAIgB,IAAqBZ,EAAM;EAC/B,IAAIA,EAAM,MAAM;GACZ,IAAMa,IAAgBf,EAAYE,CAAK;GACvC,IAAU,kBAACa,GAAD,CAAgB,CAAA;EAC9B;EAkBA,OAjBIb,EAAM,UAAU,KAAA,MAChB,IACI,kBAACE,GAAD;GAEI,OAAOF,EAAM;GACb,eAAeA,EAAM,iBAAiBc;GACtC,YAAYd,EAAM;GAEjB,UAAAY;EACW,GANPH,EAAST,CAAK,CAMP,IAIpBA,EAAM,QACC,kBAACe,GAAD;GAA0B,OAAA;GAAe;EAAU,GAAvC,SAASC,GAA8B,IAI1D,kBAACD,GAAD;GAEI,MAAMf,EAAM;GACH;GACT,eAAeA,EAAM;GAEpB,UAAAA,EAAM,WAAWW,EAAgBX,EAAM,UAAUc,CAAQ,IAAI;EAC3D,GANEd,EAAM,QAAQ,SAASgB,GAMzB;CAEf,CAAC;AACL;AAEA,IAAMC,IAAoD;CACtD,SAASC;CACT,MAAMC;CACN,QAAQC;AACZ;AA8BA,SAAgBC,EAAU,EACtB,WACA,YAAS,WACT,aACA,mBACA,cAAW,QACI;CACf,IAAMC,IAAOC,QAAcZ,EAAgBf,GAAQkB,CAAQ,GAAG,CAAClB,GAAQkB,CAAQ,CAAC,GAC1EU,IAASP,EAAQQ;CAGvB,OACI,kBAACD,GAAD;EAAQ,GAHQC,MAAW,WAAW;GAAE;GAAU;EAAe,IAAI,EAAE,YAAS;EAI5E,UAAA,kBAACC,GAAD;GAAoB;GAChB,UAAA,kBAACC,GAAD,EAAA,UAASL,EAAa,CAAA;EAChB,CAAA;CACN,CAAA;AAEhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteGuard.cjs","names":[],"sources":["../../src/router/RouteGuard.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Navigate } from \"react-router\";\nimport type { RouteGuardResult } from \"./types\";\n\nexport interface RouteGuardProps {\n /**\n * Whether access is allowed — typically\n * `useAuthStore((s) => s.isAuthenticated)`.\n *\n * `\"pending\"` is the third answer, for a permission that has not resolved\n * yet: it holds the decision and renders {@link fallback} instead of\n * choosing between two wrong moves — redirecting someone who does have\n * access, or showing the screen to someone who does not.\n */\n when: RouteGuardResult;\n /**\n * Rendered while `when` is `\"pending\"`. Defaults to nothing, which is a\n * blank screen — pass the same spinner the rest of the app uses.\n */\n fallback?: ReactNode;\n /** Where to redirect when `when` is falsy (default: `\"/\"`). */\n redirectTo?: string;\n /** Replace history entry on redirect instead of pushing (default: true). */\n replace?: boolean;\n /** Protected content, usually `<Outlet />` for a guarded layout route. */\n children: ReactNode;\n}\n\n/**\n * Declarative route guard built on React Router's `<Navigate>`. Renders its\n * children when `when` is `true`, redirects when it is `false`, and holds on\n * `\"pending\"`. Pairs naturally with `createAuthStore` for protected areas, and\n * with `useCan` for permissions that resolve over the network.\n *\n * @example\n * <RouteGuard when={useAuthStore((s) => s.isAuthenticated)} redirectTo=\"/login\">\n * <Outlet />\n * </RouteGuard>\n *\n * @example\n * const { allowed, isLoading } = useCan({ action: \"read\", resource: \"finance\" });\n *\n * <RouteGuard when={isLoading ? \"pending\" : allowed} fallback={<Spinner />}>\n * <Outlet />\n * </RouteGuard>\n */\nexport function RouteGuard({\n when,\n fallback = null,\n redirectTo = \"/\",\n replace = true,\n children,\n}: RouteGuardProps) {\n if (when === \"pending\") return <>{fallback}</>;\n return <>{when ? children : <Navigate to={redirectTo} replace={replace} />}</>;\n}\n"],"mappings":"6DA8CA,
|
|
1
|
+
{"version":3,"file":"RouteGuard.cjs","names":["_Fragment","Navigate","react_jsx_runtime","react_router","RouteGuard","when","fallback","children","redirectTo"],"sources":["../../src/router/RouteGuard.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Navigate } from \"react-router\";\nimport type { RouteGuardResult } from \"./types\";\n\nexport interface RouteGuardProps {\n /**\n * Whether access is allowed — typically\n * `useAuthStore((s) => s.isAuthenticated)`.\n *\n * `\"pending\"` is the third answer, for a permission that has not resolved\n * yet: it holds the decision and renders {@link fallback} instead of\n * choosing between two wrong moves — redirecting someone who does have\n * access, or showing the screen to someone who does not.\n */\n when: RouteGuardResult;\n /**\n * Rendered while `when` is `\"pending\"`. Defaults to nothing, which is a\n * blank screen — pass the same spinner the rest of the app uses.\n */\n fallback?: ReactNode;\n /** Where to redirect when `when` is falsy (default: `\"/\"`). */\n redirectTo?: string;\n /** Replace history entry on redirect instead of pushing (default: true). */\n replace?: boolean;\n /** Protected content, usually `<Outlet />` for a guarded layout route. */\n children: ReactNode;\n}\n\n/**\n * Declarative route guard built on React Router's `<Navigate>`. Renders its\n * children when `when` is `true`, redirects when it is `false`, and holds on\n * `\"pending\"`. Pairs naturally with `createAuthStore` for protected areas, and\n * with `useCan` for permissions that resolve over the network.\n *\n * @example\n * <RouteGuard when={useAuthStore((s) => s.isAuthenticated)} redirectTo=\"/login\">\n * <Outlet />\n * </RouteGuard>\n *\n * @example\n * const { allowed, isLoading } = useCan({ action: \"read\", resource: \"finance\" });\n *\n * <RouteGuard when={isLoading ? \"pending\" : allowed} fallback={<Spinner />}>\n * <Outlet />\n * </RouteGuard>\n */\nexport function RouteGuard({\n when,\n fallback = null,\n redirectTo = \"/\",\n replace = true,\n children,\n}: RouteGuardProps) {\n if (when === \"pending\") return <>{fallback}</>;\n return <>{when ? children : <Navigate to={redirectTo} replace={replace} />}</>;\n}\n"],"mappings":"A,6DA8CA,SAAgBI,EAAW,CACvB,OACA,WAAW,KACX,aAAa,IACb,UAAU,GACV,YACgB,CAEhB,OADIC,IAAS,WAAkB,EAAAH,EAAA,IAAA,CAAAF,EAAAA,SAAA,CAAA,SAAGM,CAAW,CAAA,GACtC,EAAAJ,EAAA,IAAA,CAAAF,EAAAA,SAAA,CAAA,SAAGK,EAAOE,GAAW,EAAAL,EAAA,IAAA,CAACD,EAAAA,SAAD,CAAU,GAAIO,EAAqB,SAAU,CAAA,CAAI,CAAA,CACjF,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteGuard.js","names":[],"sources":["../../src/router/RouteGuard.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Navigate } from \"react-router\";\nimport type { RouteGuardResult } from \"./types\";\n\nexport interface RouteGuardProps {\n /**\n * Whether access is allowed — typically\n * `useAuthStore((s) => s.isAuthenticated)`.\n *\n * `\"pending\"` is the third answer, for a permission that has not resolved\n * yet: it holds the decision and renders {@link fallback} instead of\n * choosing between two wrong moves — redirecting someone who does have\n * access, or showing the screen to someone who does not.\n */\n when: RouteGuardResult;\n /**\n * Rendered while `when` is `\"pending\"`. Defaults to nothing, which is a\n * blank screen — pass the same spinner the rest of the app uses.\n */\n fallback?: ReactNode;\n /** Where to redirect when `when` is falsy (default: `\"/\"`). */\n redirectTo?: string;\n /** Replace history entry on redirect instead of pushing (default: true). */\n replace?: boolean;\n /** Protected content, usually `<Outlet />` for a guarded layout route. */\n children: ReactNode;\n}\n\n/**\n * Declarative route guard built on React Router's `<Navigate>`. Renders its\n * children when `when` is `true`, redirects when it is `false`, and holds on\n * `\"pending\"`. Pairs naturally with `createAuthStore` for protected areas, and\n * with `useCan` for permissions that resolve over the network.\n *\n * @example\n * <RouteGuard when={useAuthStore((s) => s.isAuthenticated)} redirectTo=\"/login\">\n * <Outlet />\n * </RouteGuard>\n *\n * @example\n * const { allowed, isLoading } = useCan({ action: \"read\", resource: \"finance\" });\n *\n * <RouteGuard when={isLoading ? \"pending\" : allowed} fallback={<Spinner />}>\n * <Outlet />\n * </RouteGuard>\n */\nexport function RouteGuard({\n when,\n fallback = null,\n redirectTo = \"/\",\n replace = true,\n children,\n}: RouteGuardProps) {\n if (when === \"pending\") return <>{fallback}</>;\n return <>{when ? children : <Navigate to={redirectTo} replace={replace} />}</>;\n}\n"],"mappings":";;;AA8CA,
|
|
1
|
+
{"version":3,"file":"RouteGuard.js","names":["_Fragment","RouteGuard","when","Fragment","fallback","children","Navigate","redirectTo"],"sources":["../../src/router/RouteGuard.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Navigate } from \"react-router\";\nimport type { RouteGuardResult } from \"./types\";\n\nexport interface RouteGuardProps {\n /**\n * Whether access is allowed — typically\n * `useAuthStore((s) => s.isAuthenticated)`.\n *\n * `\"pending\"` is the third answer, for a permission that has not resolved\n * yet: it holds the decision and renders {@link fallback} instead of\n * choosing between two wrong moves — redirecting someone who does have\n * access, or showing the screen to someone who does not.\n */\n when: RouteGuardResult;\n /**\n * Rendered while `when` is `\"pending\"`. Defaults to nothing, which is a\n * blank screen — pass the same spinner the rest of the app uses.\n */\n fallback?: ReactNode;\n /** Where to redirect when `when` is falsy (default: `\"/\"`). */\n redirectTo?: string;\n /** Replace history entry on redirect instead of pushing (default: true). */\n replace?: boolean;\n /** Protected content, usually `<Outlet />` for a guarded layout route. */\n children: ReactNode;\n}\n\n/**\n * Declarative route guard built on React Router's `<Navigate>`. Renders its\n * children when `when` is `true`, redirects when it is `false`, and holds on\n * `\"pending\"`. Pairs naturally with `createAuthStore` for protected areas, and\n * with `useCan` for permissions that resolve over the network.\n *\n * @example\n * <RouteGuard when={useAuthStore((s) => s.isAuthenticated)} redirectTo=\"/login\">\n * <Outlet />\n * </RouteGuard>\n *\n * @example\n * const { allowed, isLoading } = useCan({ action: \"read\", resource: \"finance\" });\n *\n * <RouteGuard when={isLoading ? \"pending\" : allowed} fallback={<Spinner />}>\n * <Outlet />\n * </RouteGuard>\n */\nexport function RouteGuard({\n when,\n fallback = null,\n redirectTo = \"/\",\n replace = true,\n children,\n}: RouteGuardProps) {\n if (when === \"pending\") return <>{fallback}</>;\n return <>{when ? children : <Navigate to={redirectTo} replace={replace} />}</>;\n}\n"],"mappings":";;;AA8CA,SAAgBC,EAAW,EACvB,SACA,cAAW,MACX,gBAAa,KACb,aAAU,IACV,eACgB;CAEhB,OADIC,MAAS,YAAkB,kBAAAF,GAAA,EAAA,UAAGI,EAAW,CAAA,IACtC,kBAAAJ,GAAA,EAAA,UAAGE,IAAOG,IAAW,kBAACC,GAAD;EAAU,IAAIC;EAAqB;CAAU,CAAA,EAAI,CAAA;AACjF"}
|
package/dist/router/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RouteGuard as e } from "./RouteGuard.js";
|
|
2
2
|
import { AppRouter as t, defineRoutes as n } from "./AppRouter.js";
|
|
3
|
-
import {
|
|
4
|
-
export { t as AppRouter, r as
|
|
3
|
+
import { Await as r, BrowserRouter as i, Form as a, HashRouter as o, IDLE_BLOCKER as s, IDLE_FETCHER as c, IDLE_NAVIGATION as l, Link as u, MemoryRouter as d, NavLink as f, Navigate as p, NavigationType as m, Outlet as h, Route as g, Router as _, RouterProvider as v, Routes as y, ScrollRestoration as b, createBrowserRouter as x, createHashRouter as S, createMemoryRouter as C, createPath as w, createRoutesFromChildren as T, createRoutesFromElements as E, createSearchParams as D, data as O, generatePath as k, isRouteErrorResponse as A, matchPath as j, matchRoutes as M, parsePath as N, redirect as P, redirectDocument as F, renderMatches as I, replace as L, resolvePath as R, useActionData as z, useAsyncError as B, useAsyncValue as V, useBeforeUnload as H, useBlocker as U, useFetcher as W, useFetchers as G, useFormAction as K, useHref as q, useInRouterContext as J, useLinkClickHandler as Y, useLoaderData as X, useLocation as Z, useMatch as Q, useMatches as $, useNavigate as ee, useNavigation as te, useNavigationType as ne, useOutlet as re, useOutletContext as ie, useParams as ae, useResolvedPath as oe, useRevalidator as se, useRouteError as ce, useRouteLoaderData as le, useRoutes as ue, useSearchParams as de, useSubmit as fe, useViewTransitionState as pe } from "react-router";
|
|
4
|
+
export { t as AppRouter, r as Await, i as BrowserRouter, o as HashRouter, s as IDLE_BLOCKER, c as IDLE_FETCHER, l as IDLE_NAVIGATION, u as Link, d as MemoryRouter, f as NavLink, p as Navigate, m as NavigationType, h as Outlet, g as Route, e as RouteGuard, _ as Router, a as RouterForm, v as RouterProvider, y as Routes, b as ScrollRestoration, x as createBrowserRouter, S as createHashRouter, C as createMemoryRouter, w as createPath, T as createRoutesFromChildren, E as createRoutesFromElements, D as createSearchParams, O as data, n as defineRoutes, k as generatePath, A as isRouteErrorResponse, j as matchPath, M as matchRoutes, N as parsePath, P as redirect, F as redirectDocument, I as renderMatches, L as replace, R as resolvePath, z as useActionData, B as useAsyncError, V as useAsyncValue, H as useBeforeUnload, U as useBlocker, W as useFetcher, G as useFetchers, K as useFormAction, q as useHref, J as useInRouterContext, Y as useLinkClickHandler, X as useLoaderData, Z as useLocation, Q as useMatch, $ as useMatches, ee as useNavigate, te as useNavigation, ne as useNavigationType, re as useOutlet, ie as useOutletContext, ae as useParams, oe as useResolvedPath, se as useRevalidator, ce as useRouteError, le as useRouteLoaderData, ue as useRoutes, de as useSearchParams, fe as useSubmit, pe as useViewTransitionState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share-or-download.cjs","names":[],"sources":["../../src/share/share-or-download.ts"],"sourcesContent":["import { share } from \"./share\";\n\n/** Options for {@link shareOrDownloadBlob}. */\nexport interface ShareOrDownloadOptions {\n /** Title passed to the Web Share dialog. Defaults to the file name. */\n title?: string;\n}\n\n/**\n * Try the Web Share API with the given `Blob` as a file; fall back to a\n * download anchor when the browser cannot share files (desktop Firefox, older\n * iOS Safari, etc.).\n *\n * A companion to {@link share} for the common \"export a generated artifact\"\n * flow: on mobile it opens the native share sheet, and everywhere else it\n * triggers a plain download. Returns early when the user shares or cancels the\n * dialog; otherwise it downloads.\n *\n * @param blob - The binary payload to share or download.\n * @param fileName - The file name presented to the user.\n * @param options - Optional `title` for the share dialog.\n * @returns A promise that resolves once the share or download completes.\n *\n * @example\n * const zip = new Blob([bytes], { type: \"application/zip\" });\n * await shareOrDownloadBlob(zip, \"export.zip\");\n */\nexport async function shareOrDownloadBlob(\n blob: Blob,\n fileName: string,\n options: ShareOrDownloadOptions = {},\n): Promise<void> {\n const file = new File([blob], fileName, { type: blob.type });\n const result = await share({ title: options.title ?? fileName, files: [file] });\n if (result.shared || result.cancelled) return;\n\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement(\"a\");\n anchor.href = url;\n anchor.download = fileName;\n document.body.appendChild(anchor);\n anchor.click();\n anchor.remove();\n URL.revokeObjectURL(url);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"share-or-download.cjs","names":["share","require_share","shareOrDownloadBlob","file","blob","fileName","result","options","url","anchor"],"sources":["../../src/share/share-or-download.ts"],"sourcesContent":["import { share } from \"./share\";\n\n/** Options for {@link shareOrDownloadBlob}. */\nexport interface ShareOrDownloadOptions {\n /** Title passed to the Web Share dialog. Defaults to the file name. */\n title?: string;\n}\n\n/**\n * Try the Web Share API with the given `Blob` as a file; fall back to a\n * download anchor when the browser cannot share files (desktop Firefox, older\n * iOS Safari, etc.).\n *\n * A companion to {@link share} for the common \"export a generated artifact\"\n * flow: on mobile it opens the native share sheet, and everywhere else it\n * triggers a plain download. Returns early when the user shares or cancels the\n * dialog; otherwise it downloads.\n *\n * @param blob - The binary payload to share or download.\n * @param fileName - The file name presented to the user.\n * @param options - Optional `title` for the share dialog.\n * @returns A promise that resolves once the share or download completes.\n *\n * @example\n * const zip = new Blob([bytes], { type: \"application/zip\" });\n * await shareOrDownloadBlob(zip, \"export.zip\");\n */\nexport async function shareOrDownloadBlob(\n blob: Blob,\n fileName: string,\n options: ShareOrDownloadOptions = {},\n): Promise<void> {\n const file = new File([blob], fileName, { type: blob.type });\n const result = await share({ title: options.title ?? fileName, files: [file] });\n if (result.shared || result.cancelled) return;\n\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement(\"a\");\n anchor.href = url;\n anchor.download = fileName;\n document.body.appendChild(anchor);\n anchor.click();\n anchor.remove();\n URL.revokeObjectURL(url);\n}\n"],"mappings":"A,+BA2BA,eAAsBE,EAClB,EACA,EACA,EAAkC,CAAC,EACtB,CACb,IAAMC,EAAO,IAAI,KAAK,CAACC,CAAI,EAAGC,EAAU,CAAE,KAAMD,EAAK,IAAK,CAAC,EACrDE,EAAS,MAAMN,EAAAA,MAAM,CAAE,MAAOO,EAAQ,OAASF,EAAU,MAAO,CAACF,CAAI,CAAE,CAAC,EAC9E,GAAIG,EAAO,QAAUA,EAAO,UAAW,OAEvC,IAAME,EAAM,IAAI,gBAAgBJ,CAAI,EAC9BK,EAAS,SAAS,cAAc,GAAG,EACzC,EAAO,KAAOD,EACd,EAAO,SAAWH,EAClB,SAAS,KAAK,YAAYI,CAAM,EAChCA,EAAO,MAAM,EACbA,EAAO,OAAO,EACd,IAAI,gBAAgBD,CAAG,CAC3B,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share-or-download.js","names":[],"sources":["../../src/share/share-or-download.ts"],"sourcesContent":["import { share } from \"./share\";\n\n/** Options for {@link shareOrDownloadBlob}. */\nexport interface ShareOrDownloadOptions {\n /** Title passed to the Web Share dialog. Defaults to the file name. */\n title?: string;\n}\n\n/**\n * Try the Web Share API with the given `Blob` as a file; fall back to a\n * download anchor when the browser cannot share files (desktop Firefox, older\n * iOS Safari, etc.).\n *\n * A companion to {@link share} for the common \"export a generated artifact\"\n * flow: on mobile it opens the native share sheet, and everywhere else it\n * triggers a plain download. Returns early when the user shares or cancels the\n * dialog; otherwise it downloads.\n *\n * @param blob - The binary payload to share or download.\n * @param fileName - The file name presented to the user.\n * @param options - Optional `title` for the share dialog.\n * @returns A promise that resolves once the share or download completes.\n *\n * @example\n * const zip = new Blob([bytes], { type: \"application/zip\" });\n * await shareOrDownloadBlob(zip, \"export.zip\");\n */\nexport async function shareOrDownloadBlob(\n blob: Blob,\n fileName: string,\n options: ShareOrDownloadOptions = {},\n): Promise<void> {\n const file = new File([blob], fileName, { type: blob.type });\n const result = await share({ title: options.title ?? fileName, files: [file] });\n if (result.shared || result.cancelled) return;\n\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement(\"a\");\n anchor.href = url;\n anchor.download = fileName;\n document.body.appendChild(anchor);\n anchor.click();\n anchor.remove();\n URL.revokeObjectURL(url);\n}\n"],"mappings":";;AA2BA,
|
|
1
|
+
{"version":3,"file":"share-or-download.js","names":["shareOrDownloadBlob","file","blob","fileName","result","share","options","url","anchor"],"sources":["../../src/share/share-or-download.ts"],"sourcesContent":["import { share } from \"./share\";\n\n/** Options for {@link shareOrDownloadBlob}. */\nexport interface ShareOrDownloadOptions {\n /** Title passed to the Web Share dialog. Defaults to the file name. */\n title?: string;\n}\n\n/**\n * Try the Web Share API with the given `Blob` as a file; fall back to a\n * download anchor when the browser cannot share files (desktop Firefox, older\n * iOS Safari, etc.).\n *\n * A companion to {@link share} for the common \"export a generated artifact\"\n * flow: on mobile it opens the native share sheet, and everywhere else it\n * triggers a plain download. Returns early when the user shares or cancels the\n * dialog; otherwise it downloads.\n *\n * @param blob - The binary payload to share or download.\n * @param fileName - The file name presented to the user.\n * @param options - Optional `title` for the share dialog.\n * @returns A promise that resolves once the share or download completes.\n *\n * @example\n * const zip = new Blob([bytes], { type: \"application/zip\" });\n * await shareOrDownloadBlob(zip, \"export.zip\");\n */\nexport async function shareOrDownloadBlob(\n blob: Blob,\n fileName: string,\n options: ShareOrDownloadOptions = {},\n): Promise<void> {\n const file = new File([blob], fileName, { type: blob.type });\n const result = await share({ title: options.title ?? fileName, files: [file] });\n if (result.shared || result.cancelled) return;\n\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement(\"a\");\n anchor.href = url;\n anchor.download = fileName;\n document.body.appendChild(anchor);\n anchor.click();\n anchor.remove();\n URL.revokeObjectURL(url);\n}\n"],"mappings":";;AA2BA,eAAsBA,EAClB,GACA,GACA,IAAkC,CAAC,GACtB;CACb,IAAMC,IAAO,IAAI,KAAK,CAACC,CAAI,GAAGC,GAAU,EAAE,MAAMD,EAAK,KAAK,CAAC,GACrDE,IAAS,MAAMC,EAAM;EAAE,OAAOC,EAAQ,SAASH;EAAU,OAAO,CAACF,CAAI;CAAE,CAAC;CAC9E,IAAIG,EAAO,UAAUA,EAAO,WAAW;CAEvC,IAAMG,IAAM,IAAI,gBAAgBL,CAAI,GAC9BM,IAAS,SAAS,cAAc,GAAG;CAMzC,AALA,EAAO,OAAOD,GACd,EAAO,WAAWJ,GAClB,SAAS,KAAK,YAAYK,CAAM,GAChCA,EAAO,MAAM,GACbA,EAAO,OAAO,GACd,IAAI,gBAAgBD,CAAG;AAC3B"}
|
package/dist/share/share.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share.cjs","names":[],"sources":["../../src/share/share.ts"],"sourcesContent":["export interface SharePayload {\n title?: string;\n text?: string;\n url?: string;\n /** Files to share (supported only on a subset of browsers). */\n files?: File[];\n}\n\nexport interface ShareResult {\n /** True when `navigator.share` resolved successfully. */\n shared: boolean;\n /** True when the platform did not support the requested payload. */\n unsupported: boolean;\n /** True when the user cancelled the share dialog. */\n cancelled: boolean;\n error?: unknown;\n}\n\n/**\n * Wrap the Web Share API with a uniform result object. Falls through to\n * `unsupported: true` when the browser lacks `navigator.share`, leaving the\n * caller free to render a custom fallback (copy-link, social buttons).\n */\nexport async function share(payload: SharePayload): Promise<ShareResult> {\n if (typeof navigator === \"undefined\" || !(\"share\" in navigator)) {\n return { shared: false, unsupported: true, cancelled: false };\n }\n if (payload.files && !navigator.canShare?.({ files: payload.files })) {\n return { shared: false, unsupported: true, cancelled: false };\n }\n try {\n await navigator.share(payload);\n return { shared: true, unsupported: false, cancelled: false };\n } catch (error) {\n if (error instanceof DOMException && error.name === \"AbortError\") {\n return { shared: false, unsupported: false, cancelled: true };\n }\n return { shared: false, unsupported: false, cancelled: false, error };\n }\n}\n\n/** True when the Web Share API is available in this environment. */\nexport function isShareSupported(): boolean {\n return typeof navigator !== \"undefined\" && \"share\" in navigator;\n}\n"],"mappings":"AAuBA,
|
|
1
|
+
{"version":3,"file":"share.cjs","names":["share","payload","error","isShareSupported"],"sources":["../../src/share/share.ts"],"sourcesContent":["export interface SharePayload {\n title?: string;\n text?: string;\n url?: string;\n /** Files to share (supported only on a subset of browsers). */\n files?: File[];\n}\n\nexport interface ShareResult {\n /** True when `navigator.share` resolved successfully. */\n shared: boolean;\n /** True when the platform did not support the requested payload. */\n unsupported: boolean;\n /** True when the user cancelled the share dialog. */\n cancelled: boolean;\n error?: unknown;\n}\n\n/**\n * Wrap the Web Share API with a uniform result object. Falls through to\n * `unsupported: true` when the browser lacks `navigator.share`, leaving the\n * caller free to render a custom fallback (copy-link, social buttons).\n */\nexport async function share(payload: SharePayload): Promise<ShareResult> {\n if (typeof navigator === \"undefined\" || !(\"share\" in navigator)) {\n return { shared: false, unsupported: true, cancelled: false };\n }\n if (payload.files && !navigator.canShare?.({ files: payload.files })) {\n return { shared: false, unsupported: true, cancelled: false };\n }\n try {\n await navigator.share(payload);\n return { shared: true, unsupported: false, cancelled: false };\n } catch (error) {\n if (error instanceof DOMException && error.name === \"AbortError\") {\n return { shared: false, unsupported: false, cancelled: true };\n }\n return { shared: false, unsupported: false, cancelled: false, error };\n }\n}\n\n/** True when the Web Share API is available in this environment. */\nexport function isShareSupported(): boolean {\n return typeof navigator !== \"undefined\" && \"share\" in navigator;\n}\n"],"mappings":"AAuBA,eAAsBA,EAAM,EAA6C,CAIrE,GAHI,OAAO,UAAc,KAAe,EAAE,UAAW,YAGjDC,EAAQ,OAAS,CAAC,UAAU,WAAW,CAAE,MAAOA,EAAQ,KAAM,CAAC,EAC/D,MAAO,CAAE,OAAQ,GAAO,YAAa,GAAM,UAAW,EAAM,EAEhE,GAAI,CAEA,OADA,MAAM,UAAU,MAAMA,CAAO,EACtB,CAAE,OAAQ,GAAM,YAAa,GAAO,UAAW,EAAM,CAChE,OAASC,EAAO,CAIZ,OAHIA,aAAiB,cAAgBA,EAAM,OAAS,aACzC,CAAE,OAAQ,GAAO,YAAa,GAAO,UAAW,EAAK,EAEzD,CAAE,OAAQ,GAAO,YAAa,GAAO,UAAW,GAAO,OAAM,CACxE,CACJ,CAGA,SAAgBC,GAA4B,CACxC,OAAO,OAAO,UAAc,KAAe,UAAW,SAC1D,C"}
|