tempest-react-sdk 0.78.0 → 0.80.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/openapi/generate.hostile.test.mjs +45 -4
- package/bin/lib/openapi/generate.mjs +303 -88
- package/bin/lib/openapi/generate.pagination.test.mjs +3 -2
- package/bin/lib/openapi/generate.test.mjs +462 -1
- package/bin/lib/openapi/schema-to-zod.mjs +4 -3
- 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 +1 -3
- 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 -74
- 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 +6 -2
- 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.map +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.map +1 -1
- 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 +2 -2
- package/dist/components/Markdown/markdown-parse.cjs.map +1 -1
- package/dist/components/Markdown/markdown-parse.js +8 -27
- 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 +1 -1
- package/dist/http/api-client.cjs.map +1 -1
- package/dist/http/api-client.js +5 -1
- package/dist/http/api-client.js.map +1 -1
- package/dist/http/build-url.cjs +1 -1
- package/dist/http/build-url.cjs.map +1 -1
- package/dist/http/build-url.js +3 -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/presigned-post.cjs +2 -0
- package/dist/http/presigned-post.cjs.map +1 -0
- package/dist/http/presigned-post.js +73 -0
- package/dist/http/presigned-post.js.map +1 -0
- package/dist/http/resumable-upload.cjs.map +1 -1
- package/dist/http/resumable-upload.js.map +1 -1
- package/dist/http/retry.cjs.map +1 -1
- 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 +1 -1
- package/dist/sse/create-event-stream.cjs.map +1 -1
- package/dist/sse/create-event-stream.js +44 -30
- package/dist/sse/create-event-stream.js.map +1 -1
- package/dist/sse/ticket-event-stream.cjs +2 -0
- package/dist/sse/ticket-event-stream.cjs.map +1 -0
- package/dist/sse/ticket-event-stream.js +41 -0
- package/dist/sse/ticket-event-stream.js.map +1 -0
- package/dist/sse/use-event-stream.cjs +1 -1
- package/dist/sse/use-event-stream.cjs.map +1 -1
- package/dist/sse/use-event-stream.js +7 -4
- 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.map +1 -1
- 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/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.map +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 +440 -7
- package/dist/tempest-react-sdk.js +122 -120
- 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.map +1 -1
- 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/utils/owner-fingerprint.cjs.map +1 -1
- package/dist/utils/owner-fingerprint.js.map +1 -1
- 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 +1 -1
- package/dist/vite/tempest-csp.cjs.map +1 -1
- package/dist/vite/tempest-csp.js +2 -10
- 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/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/http/timeout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeout.js","names":[],"sources":["../../src/http/timeout.ts"],"sourcesContent":["/**\n * The timeout half of `createApiClient`'s request plumbing.\n *\n * It lives beside the client rather than inside it because it is the one piece\n * with no knowledge of the SDK: given a caller's signal and a deadline it hands\n * back a signal to pass `fetch`, a way to tell whose abort fired, and the\n * cleanup. That makes it testable on its own and keeps the client file about\n * requests.\n */\n\n/** A signal to hand `fetch`, plus how to read the outcome and clean up. */\nexport interface TimedSignal {\n /** Pass this to `fetch`. */\n signal: AbortSignal | undefined;\n /** Whether the abort came from the timeout rather than the caller. */\n timedOut: () => boolean;\n /** Clear the timer and drop the listener. Always call it. */\n dispose: () => void;\n}\n\n/**\n * Compose the caller's signal with a timeout, tracking which one fires.\n *\n * Written with an explicit flag rather than `AbortSignal.timeout()`, whose\n * `TimeoutError` reason would tell the two apart for free. Two reasons: this\n * needs no `AbortSignal.any`, which is Baseline 2024 and would raise the\n * package's support floor for one line of convenience, and the flag is read\n * directly instead of through a reason string that a polyfill could reshape.\n *\n * A caller signal that is already aborted aborts immediately, so a request never\n * goes out for a query react-query has already cancelled.\n *\n * @param signal - The caller's signal, if any.\n * @param ms - Timeout in milliseconds, or `null` to only forward the signal.\n * @returns The composed signal, the outcome reader, and the cleanup.\n */\nexport function withTimeout(\n signal: AbortSignal | null | undefined,\n ms: number | null,\n): TimedSignal {\n if (ms === null) {\n return { signal: signal ?? undefined, timedOut: () => false, dispose: () => {} };\n }\n\n const controller = new AbortController();\n let timedOut = false;\n const timer = setTimeout(() => {\n timedOut = true;\n controller.abort();\n }, ms);\n const onAbort = (): void => controller.abort();\n\n if (signal) {\n if (signal.aborted) controller.abort();\n else signal.addEventListener(\"abort\", onAbort, { once: true });\n }\n\n return {\n signal: controller.signal,\n timedOut: () => timedOut,\n dispose: () => {\n clearTimeout(timer);\n signal?.removeEventListener(\"abort\", onAbort);\n },\n };\n}\n"],"mappings":";AAoCA,
|
|
1
|
+
{"version":3,"file":"timeout.js","names":["withTimeout","ms","signal","controller","timedOut","timer","onAbort"],"sources":["../../src/http/timeout.ts"],"sourcesContent":["/**\n * The timeout half of `createApiClient`'s request plumbing.\n *\n * It lives beside the client rather than inside it because it is the one piece\n * with no knowledge of the SDK: given a caller's signal and a deadline it hands\n * back a signal to pass `fetch`, a way to tell whose abort fired, and the\n * cleanup. That makes it testable on its own and keeps the client file about\n * requests.\n */\n\n/** A signal to hand `fetch`, plus how to read the outcome and clean up. */\nexport interface TimedSignal {\n /** Pass this to `fetch`. */\n signal: AbortSignal | undefined;\n /** Whether the abort came from the timeout rather than the caller. */\n timedOut: () => boolean;\n /** Clear the timer and drop the listener. Always call it. */\n dispose: () => void;\n}\n\n/**\n * Compose the caller's signal with a timeout, tracking which one fires.\n *\n * Written with an explicit flag rather than `AbortSignal.timeout()`, whose\n * `TimeoutError` reason would tell the two apart for free. Two reasons: this\n * needs no `AbortSignal.any`, which is Baseline 2024 and would raise the\n * package's support floor for one line of convenience, and the flag is read\n * directly instead of through a reason string that a polyfill could reshape.\n *\n * A caller signal that is already aborted aborts immediately, so a request never\n * goes out for a query react-query has already cancelled.\n *\n * @param signal - The caller's signal, if any.\n * @param ms - Timeout in milliseconds, or `null` to only forward the signal.\n * @returns The composed signal, the outcome reader, and the cleanup.\n */\nexport function withTimeout(\n signal: AbortSignal | null | undefined,\n ms: number | null,\n): TimedSignal {\n if (ms === null) {\n return { signal: signal ?? undefined, timedOut: () => false, dispose: () => {} };\n }\n\n const controller = new AbortController();\n let timedOut = false;\n const timer = setTimeout(() => {\n timedOut = true;\n controller.abort();\n }, ms);\n const onAbort = (): void => controller.abort();\n\n if (signal) {\n if (signal.aborted) controller.abort();\n else signal.addEventListener(\"abort\", onAbort, { once: true });\n }\n\n return {\n signal: controller.signal,\n timedOut: () => timedOut,\n dispose: () => {\n clearTimeout(timer);\n signal?.removeEventListener(\"abort\", onAbort);\n },\n };\n}\n"],"mappings":";AAoCA,SAAgBA,EACZ,GACA,GACW;CACX,IAAIC,MAAO,MACP,OAAO;EAAE,QAAQC,KAAU,KAAA;EAAW,gBAAgB;EAAO,eAAe,CAAC;CAAE;CAGnF,IAAMC,IAAa,IAAI,gBAAgB,GACnCC,IAAW,IACTC,IAAQ,iBAAiB;EAE3B,AADA,IAAW,IACXF,EAAW,MAAM;CACrB,GAAGF,CAAE,GACCK,UAAsBH,EAAW,MAAM;CAO7C,OALID,MACIA,EAAO,UAASC,EAAW,MAAM,IAChCD,EAAO,iBAAiB,SAASI,GAAS,EAAE,MAAM,GAAK,CAAC,IAG1D;EACH,QAAQH,EAAW;EACnB,gBAAgBC;EAChB,eAAe;GAEX,AADA,aAAaC,CAAK,GAClBH,GAAQ,oBAAoB,SAASI,CAAO;EAChD;CACJ;AACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../utils/ids.cjs"),t=require("./credential-scope.cjs"),n=require("./csrf.cjs"),r=require("./errors.cjs");function i(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function a(a){let{url:o,body:s,method:c=`POST`,headers:l={},getToken:u,credentialOrigin:d,trustedOrigins:f,withCredentials:p=!1,csrf:m,onProgress:h,signal:g,parser:_=JSON.parse,requestId:v}=a;return new Promise((a,y)=>{if(g?.aborted){y(new DOMException(`Aborted`,`AbortError`));return}let b=new XMLHttpRequest;b.open(c,o),b.withCredentials=p;let x=u?.(),S=v?v():e.randomId(),C={...l};x&&!(`Authorization`in C)&&(d===void 0||t.isTrustedCredentialTarget(o,d,f)?C.Authorization=`Bearer ${x}`:t.reportSuppressedCredential(o,d)),Object.assign(C,n.csrfHeaders({method:c,url:o,reference:d??globalThis.location?.origin??o,csrf:m,trustedOrigins:f,headers:l})),S&&!(`X-Request-ID`in C)&&(C[`X-Request-ID`]=S);for(let[e,t]of Object.entries(C))b.setRequestHeader(e,t);h&&(b.upload.onprogress=e=>{h({loaded:e.loaded,total:e.total,fraction:e.lengthComputable?e.loaded/e.total:null,lengthComputable:e.lengthComputable})});function w(){b.abort()}g?.addEventListener(`abort`,w),b.onload=()=>{g?.removeEventListener(`abort`,w);let e=b.status>=200&&b.status<300,t=b.getResponseHeader(`content-type`)??``;if(!e){let e=i(b.responseText);y(new r.TempestApiError(r.buildApiError(b.status,e,{get:e=>b.getResponseHeader(e)},S)))
|
|
1
|
+
const e=require("../utils/ids.cjs"),t=require("./credential-scope.cjs"),n=require("./csrf.cjs"),r=require("./errors.cjs");function i(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function a(a){let{url:o,body:s,method:c=`POST`,headers:l={},getToken:u,credentialOrigin:d,trustedOrigins:f,withCredentials:p=!1,csrf:m,onProgress:h,signal:g,parser:_=JSON.parse,requestId:v}=a;return new Promise((a,y)=>{if(g?.aborted){y(new DOMException(`Aborted`,`AbortError`));return}let b=new XMLHttpRequest;b.open(c,o),b.withCredentials=p;let x=u?.(),S=v?v():e.randomId(),C={...l};x&&!(`Authorization`in C)&&(d===void 0||t.isTrustedCredentialTarget(o,d,f)?C.Authorization=`Bearer ${x}`:t.reportSuppressedCredential(o,d)),Object.assign(C,n.csrfHeaders({method:c,url:o,reference:d??globalThis.location?.origin??o,csrf:m,trustedOrigins:f,headers:l})),S&&!(`X-Request-ID`in C)&&(C[`X-Request-ID`]=S);for(let[e,t]of Object.entries(C))b.setRequestHeader(e,t);h&&(b.upload.onprogress=e=>{h({loaded:e.loaded,total:e.total,fraction:e.lengthComputable?e.loaded/e.total:null,lengthComputable:e.lengthComputable})});function w(){b.abort()}g?.addEventListener(`abort`,w),b.onload=()=>{g?.removeEventListener(`abort`,w);let e=b.status>=200&&b.status<300,t=b.getResponseHeader(`content-type`)??``;if(!e){let e=i(b.responseText);y(new r.TempestApiError(r.buildApiError(b.status,e,{get:e=>b.getResponseHeader(e)},S)))}else if(b.status===204||!b.responseText)a(void 0);else if(t.includes(`application/json`))try{a(_(b.responseText))}catch(e){y(e)}else a(b.responseText)},b.onerror=()=>{g?.removeEventListener(`abort`,w),y(new r.TempestApiError({status:0,detail:`Falha de rede no upload.`,requestId:S||void 0}))},b.onabort=()=>{g?.removeEventListener(`abort`,w),y(new DOMException(`Aborted`,`AbortError`))},b.send(s)})}exports.uploadWithProgress=a;
|
|
2
2
|
//# sourceMappingURL=upload-with-progress.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-with-progress.cjs","names":[],"sources":["../../src/http/upload-with-progress.ts"],"sourcesContent":["/**\n * @tempest-limits function-lines — XMLHttpRequest is used instead of fetch precisely\n * because it reports upload progress, and its API is event-based: the body wires\n * load, error, abort, timeout and progress against one request object, plus the\n * AbortSignal bridge.\n */\nimport { randomId } from \"../utils\";\nimport { isTrustedCredentialTarget, reportSuppressedCredential } from \"./credential-scope\";\nimport { csrfHeaders } from \"./csrf\";\nimport type { CsrfOptions } from \"./csrf\";\nimport { buildApiError, TempestApiError } from \"./errors\";\n\nexport interface UploadProgressEvent {\n /** Bytes already uploaded. */\n loaded: number;\n /** Total payload size in bytes — only meaningful when `lengthComputable` is true. */\n total: number;\n /** Fraction between 0 and 1, or null when total is unknown. */\n fraction: number | null;\n lengthComputable: boolean;\n}\n\nexport interface UploadWithProgressOptions {\n url: string;\n body: FormData | Blob | File;\n method?: \"POST\" | \"PUT\" | \"PATCH\";\n headers?: Record<string, string>;\n /** Returns the current bearer token. */\n getToken?: () => string | null | undefined;\n /**\n * Origin the `getToken` credential belongs to, normally the API's.\n *\n * Unlike `createApiClient`, this helper has no base URL to infer a scope\n * from — the caller names the destination on every call. Set this when the\n * `url` can come from somewhere other than your own code (a signed URL the\n * API handed back, a value from a response body) and the token must not\n * follow it off-origin. Left unset, the header goes wherever `url` points,\n * which is the behaviour every version before 0.66.0 had.\n */\n credentialOrigin?: string;\n /**\n * Extra origins allowed to receive the credential, on top of\n * {@link credentialOrigin}. Ignored when that one is unset.\n */\n trustedOrigins?: readonly string[];\n /** Send cookies. Defaults to false. */\n withCredentials?: boolean;\n /**\n * Send a CSRF token with the upload, as `createApiClient`'s `csrf` does.\n * Off by default; `true` reads the `csrf_token` cookie into `X-CSRF-Token`.\n *\n * Scoped to {@link credentialOrigin} plus {@link trustedOrigins} — and,\n * unlike the bearer token, scoped even when `credentialOrigin` is unset:\n * then the scope is the page's own origin. The bearer default stays open\n * only for compatibility with every version before 0.66.0; this option is\n * new, so it starts closed. An API on another origin sets\n * `credentialOrigin` to receive the token.\n */\n csrf?: boolean | CsrfOptions;\n /** Called on every `progress` event from the XHR upload channel. */\n onProgress?: (event: UploadProgressEvent) => void;\n /** Abort the request. */\n signal?: AbortSignal;\n /** Override the JSON parser. Defaults to `JSON.parse`. */\n parser?: (raw: string) => unknown;\n /**\n * Per-request correlation id sent as `X-Request-ID` (Tempest convention).\n * Defaults to a generated id. Return an empty string to disable.\n */\n requestId?: () => string;\n}\n\nfunction parseErrorBody(raw: string): unknown {\n if (!raw) return null;\n try {\n return JSON.parse(raw);\n } catch {\n return raw;\n }\n}\n\n/**\n * Upload a file (or any payload) with byte-level progress reporting.\n *\n * `fetch` cannot report upload progress in browsers, so this helper falls\n * back to `XMLHttpRequest`. It mirrors the error contract used by\n * {@link createApiClient}: non-2xx responses reject with a `TempestApiError`.\n *\n * @returns The parsed JSON response, or the raw text when the response is not JSON.\n */\nexport function uploadWithProgress<T = unknown>(options: UploadWithProgressOptions): Promise<T> {\n const {\n url,\n body,\n method = \"POST\",\n headers = {},\n getToken,\n credentialOrigin,\n trustedOrigins,\n withCredentials = false,\n csrf,\n onProgress,\n signal,\n parser = JSON.parse,\n requestId,\n } = options;\n\n return new Promise<T>((resolve, reject) => {\n if (signal?.aborted) {\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n return;\n }\n\n const xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.withCredentials = withCredentials;\n\n const token = getToken?.();\n const sentRequestId = requestId ? requestId() : randomId();\n const finalHeaders: Record<string, string> = { ...headers };\n if (token && !(\"Authorization\" in finalHeaders)) {\n if (\n credentialOrigin === undefined ||\n isTrustedCredentialTarget(url, credentialOrigin, trustedOrigins)\n ) {\n finalHeaders.Authorization = `Bearer ${token}`;\n } else {\n reportSuppressedCredential(url, credentialOrigin);\n }\n }\n Object.assign(\n finalHeaders,\n csrfHeaders({\n method,\n url,\n reference: credentialOrigin ?? globalThis.location?.origin ?? url,\n csrf,\n trustedOrigins,\n headers,\n }),\n );\n if (sentRequestId && !(\"X-Request-ID\" in finalHeaders)) {\n finalHeaders[\"X-Request-ID\"] = sentRequestId;\n }\n for (const [key, value] of Object.entries(finalHeaders)) {\n xhr.setRequestHeader(key, value);\n }\n\n if (onProgress) {\n xhr.upload.onprogress = (event) => {\n onProgress({\n loaded: event.loaded,\n total: event.total,\n fraction: event.lengthComputable ? event.loaded / event.total : null,\n lengthComputable: event.lengthComputable,\n });\n };\n }\n\n function handleAbort(): void {\n xhr.abort();\n }\n signal?.addEventListener(\"abort\", handleAbort);\n\n xhr.onload = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n const isSuccess = xhr.status >= 200 && xhr.status < 300;\n const contentType = xhr.getResponseHeader(\"content-type\") ?? \"\";\n\n if (!isSuccess) {\n const errorBody = parseErrorBody(xhr.responseText);\n reject(\n new TempestApiError(\n buildApiError(\n xhr.status,\n errorBody,\n { get: (name) => xhr.getResponseHeader(name) },\n sentRequestId,\n ),\n ),\n );\n return;\n }\n\n if (xhr.status === 204 || !xhr.responseText) {\n resolve(undefined as T);\n return;\n }\n\n if (contentType.includes(\"application/json\")) {\n try {\n resolve(parser(xhr.responseText) as T);\n } catch (err) {\n reject(err);\n }\n } else {\n resolve(xhr.responseText as unknown as T);\n }\n };\n\n xhr.onerror = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n reject(\n new TempestApiError({\n status: 0,\n detail: \"Falha de rede no upload.\",\n requestId: sentRequestId || undefined,\n }),\n );\n };\n\n xhr.onabort = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n };\n\n xhr.send(body);\n });\n}\n"],"mappings":"0HAwEA,SAAS,EAAe,EAAsB,CAC1C,GAAI,CAAC,EAAK,OAAO,KACjB,GAAI,CACA,OAAO,KAAK,MAAM,CAAG,CACzB,MAAQ,CACJ,OAAO,CACX,CACJ,CAWA,SAAgB,EAAgC,EAAgD,CAC5F,GAAM,CACF,MACA,OACA,SAAS,OACT,UAAU,CAAC,EACX,WACA,mBACA,iBACA,kBAAkB,GAClB,OACA,aACA,SACA,SAAS,KAAK,MACd,aACA,EAEJ,OAAO,IAAI,SAAY,EAAS,IAAW,CACvC,GAAI,GAAQ,QAAS,CACjB,EAAO,IAAI,aAAa,UAAW,YAAY,CAAC,EAChD,MACJ,CAEA,IAAM,EAAM,IAAI,eAChB,EAAI,KAAK,EAAQ,CAAG,EACpB,EAAI,gBAAkB,EAEtB,IAAM,EAAQ,IAAW,EACnB,EAAgB,EAAY,EAAU,EAAI,EAAA,SAAS,EACnD,EAAuC,CAAE,GAAG,CAAQ,EACtD,GAAS,EAAE,kBAAmB,KAE1B,IAAqB,IAAA,IACrB,EAAA,0BAA0B,EAAK,EAAkB,CAAc,EAE/D,EAAa,cAAgB,UAAU,IAEvC,EAAA,2BAA2B,EAAK,CAAgB,GAGxD,OAAO,OACH,EACA,EAAA,YAAY,CACR,SACA,MACA,UAAW,GAAoB,WAAW,UAAU,QAAU,EAC9D,OACA,iBACA,SACJ,CAAC,CACL,EACI,GAAiB,EAAE,iBAAkB,KACrC,EAAa,gBAAkB,GAEnC,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAY,EAClD,EAAI,iBAAiB,EAAK,CAAK,EAG/B,IACA,EAAI,OAAO,WAAc,GAAU,CAC/B,EAAW,CACP,OAAQ,EAAM,OACd,MAAO,EAAM,MACb,SAAU,EAAM,iBAAmB,EAAM,OAAS,EAAM,MAAQ,KAChE,iBAAkB,EAAM,gBAC5B,CAAC,CACL,GAGJ,SAAS,GAAoB,CACzB,EAAI,MAAM,CACd,CACA,GAAQ,iBAAiB,QAAS,CAAW,EAE7C,EAAI,WAAe,CACf,GAAQ,oBAAoB,QAAS,CAAW,EAChD,IAAM,EAAY,EAAI,QAAU,KAAO,EAAI,OAAS,IAC9C,EAAc,EAAI,kBAAkB,cAAc,GAAK,GAE7D,GAAI,CAAC,EAAW,CACZ,IAAM,EAAY,EAAe,EAAI,YAAY,EACjD,EACI,IAAI,EAAA,gBACA,EAAA,cACI,EAAI,OACJ,EACA,CAAE,IAAM,GAAS,EAAI,kBAAkB,CAAI,CAAE,EAC7C,CACJ,CACJ,CACJ,EACA,MACJ,CAEA,GAAI,EAAI,SAAW,KAAO,CAAC,EAAI,aAAc,CACzC,EAAQ,IAAA,EAAc,EACtB,MACJ,CAEA,GAAI,EAAY,SAAS,kBAAkB,EACvC,GAAI,CACA,EAAQ,EAAO,EAAI,YAAY,CAAM,CACzC,OAAS,EAAK,CACV,EAAO,CAAG,CACd,MAEA,EAAQ,EAAI,YAA4B,CAEhD,EAEA,EAAI,YAAgB,CAChB,GAAQ,oBAAoB,QAAS,CAAW,EAChD,EACI,IAAI,EAAA,gBAAgB,CAChB,OAAQ,EACR,OAAQ,2BACR,UAAW,GAAiB,IAAA,EAChC,CAAC,CACL,CACJ,EAEA,EAAI,YAAgB,CAChB,GAAQ,oBAAoB,QAAS,CAAW,EAChD,EAAO,IAAI,aAAa,UAAW,YAAY,CAAC,CACpD,EAEA,EAAI,KAAK,CAAI,CACjB,CAAC,CACL"}
|
|
1
|
+
{"version":3,"file":"upload-with-progress.cjs","names":["randomId","isTrustedCredentialTarget","csrfHeaders","TempestApiError","buildApiError","require_ids","require_credential_scope","require_csrf","require_errors","parseErrorBody","raw","uploadWithProgress","options","signal","reject","xhr","method","url","withCredentials","token","getToken","sentRequestId","requestId","finalHeaders","headers","credentialOrigin","trustedOrigins","key","value","onProgress","event","handleAbort","isSuccess","contentType","errorBody","name","resolve","parser","err","body"],"sources":["../../src/http/upload-with-progress.ts"],"sourcesContent":["/**\n * @tempest-limits function-lines — XMLHttpRequest is used instead of fetch precisely\n * because it reports upload progress, and its API is event-based: the body wires\n * load, error, abort, timeout and progress against one request object, plus the\n * AbortSignal bridge.\n */\nimport { randomId } from \"../utils\";\nimport { isTrustedCredentialTarget, reportSuppressedCredential } from \"./credential-scope\";\nimport { csrfHeaders } from \"./csrf\";\nimport type { CsrfOptions } from \"./csrf\";\nimport { buildApiError, TempestApiError } from \"./errors\";\n\nexport interface UploadProgressEvent {\n /** Bytes already uploaded. */\n loaded: number;\n /** Total payload size in bytes — only meaningful when `lengthComputable` is true. */\n total: number;\n /** Fraction between 0 and 1, or null when total is unknown. */\n fraction: number | null;\n lengthComputable: boolean;\n}\n\nexport interface UploadWithProgressOptions {\n url: string;\n body: FormData | Blob | File;\n method?: \"POST\" | \"PUT\" | \"PATCH\";\n headers?: Record<string, string>;\n /** Returns the current bearer token. */\n getToken?: () => string | null | undefined;\n /**\n * Origin the `getToken` credential belongs to, normally the API's.\n *\n * Unlike `createApiClient`, this helper has no base URL to infer a scope\n * from — the caller names the destination on every call. Set this when the\n * `url` can come from somewhere other than your own code (a signed URL the\n * API handed back, a value from a response body) and the token must not\n * follow it off-origin. Left unset, the header goes wherever `url` points,\n * which is the behaviour every version before 0.66.0 had.\n */\n credentialOrigin?: string;\n /**\n * Extra origins allowed to receive the credential, on top of\n * {@link credentialOrigin}. Ignored when that one is unset.\n */\n trustedOrigins?: readonly string[];\n /** Send cookies. Defaults to false. */\n withCredentials?: boolean;\n /**\n * Send a CSRF token with the upload, as `createApiClient`'s `csrf` does.\n * Off by default; `true` reads the `csrf_token` cookie into `X-CSRF-Token`.\n *\n * Scoped to {@link credentialOrigin} plus {@link trustedOrigins} — and,\n * unlike the bearer token, scoped even when `credentialOrigin` is unset:\n * then the scope is the page's own origin. The bearer default stays open\n * only for compatibility with every version before 0.66.0; this option is\n * new, so it starts closed. An API on another origin sets\n * `credentialOrigin` to receive the token.\n */\n csrf?: boolean | CsrfOptions;\n /** Called on every `progress` event from the XHR upload channel. */\n onProgress?: (event: UploadProgressEvent) => void;\n /** Abort the request. */\n signal?: AbortSignal;\n /** Override the JSON parser. Defaults to `JSON.parse`. */\n parser?: (raw: string) => unknown;\n /**\n * Per-request correlation id sent as `X-Request-ID` (Tempest convention).\n * Defaults to a generated id. Return an empty string to disable.\n */\n requestId?: () => string;\n}\n\nfunction parseErrorBody(raw: string): unknown {\n if (!raw) return null;\n try {\n return JSON.parse(raw);\n } catch {\n return raw;\n }\n}\n\n/**\n * Upload a file (or any payload) with byte-level progress reporting.\n *\n * `fetch` cannot report upload progress in browsers, so this helper falls\n * back to `XMLHttpRequest`. It mirrors the error contract used by\n * {@link createApiClient}: non-2xx responses reject with a `TempestApiError`.\n *\n * @returns The parsed JSON response, or the raw text when the response is not JSON.\n */\nexport function uploadWithProgress<T = unknown>(options: UploadWithProgressOptions): Promise<T> {\n const {\n url,\n body,\n method = \"POST\",\n headers = {},\n getToken,\n credentialOrigin,\n trustedOrigins,\n withCredentials = false,\n csrf,\n onProgress,\n signal,\n parser = JSON.parse,\n requestId,\n } = options;\n\n return new Promise<T>((resolve, reject) => {\n if (signal?.aborted) {\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n return;\n }\n\n const xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.withCredentials = withCredentials;\n\n const token = getToken?.();\n const sentRequestId = requestId ? requestId() : randomId();\n const finalHeaders: Record<string, string> = { ...headers };\n if (token && !(\"Authorization\" in finalHeaders)) {\n if (\n credentialOrigin === undefined ||\n isTrustedCredentialTarget(url, credentialOrigin, trustedOrigins)\n ) {\n finalHeaders.Authorization = `Bearer ${token}`;\n } else {\n reportSuppressedCredential(url, credentialOrigin);\n }\n }\n Object.assign(\n finalHeaders,\n csrfHeaders({\n method,\n url,\n reference: credentialOrigin ?? globalThis.location?.origin ?? url,\n csrf,\n trustedOrigins,\n headers,\n }),\n );\n if (sentRequestId && !(\"X-Request-ID\" in finalHeaders)) {\n finalHeaders[\"X-Request-ID\"] = sentRequestId;\n }\n for (const [key, value] of Object.entries(finalHeaders)) {\n xhr.setRequestHeader(key, value);\n }\n\n if (onProgress) {\n xhr.upload.onprogress = (event) => {\n onProgress({\n loaded: event.loaded,\n total: event.total,\n fraction: event.lengthComputable ? event.loaded / event.total : null,\n lengthComputable: event.lengthComputable,\n });\n };\n }\n\n function handleAbort(): void {\n xhr.abort();\n }\n signal?.addEventListener(\"abort\", handleAbort);\n\n xhr.onload = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n const isSuccess = xhr.status >= 200 && xhr.status < 300;\n const contentType = xhr.getResponseHeader(\"content-type\") ?? \"\";\n\n if (!isSuccess) {\n const errorBody = parseErrorBody(xhr.responseText);\n reject(\n new TempestApiError(\n buildApiError(\n xhr.status,\n errorBody,\n { get: (name) => xhr.getResponseHeader(name) },\n sentRequestId,\n ),\n ),\n );\n return;\n }\n\n if (xhr.status === 204 || !xhr.responseText) {\n resolve(undefined as T);\n return;\n }\n\n if (contentType.includes(\"application/json\")) {\n try {\n resolve(parser(xhr.responseText) as T);\n } catch (err) {\n reject(err);\n }\n } else {\n resolve(xhr.responseText as unknown as T);\n }\n };\n\n xhr.onerror = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n reject(\n new TempestApiError({\n status: 0,\n detail: \"Falha de rede no upload.\",\n requestId: sentRequestId || undefined,\n }),\n );\n };\n\n xhr.onabort = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n };\n\n xhr.send(body);\n });\n}\n"],"mappings":"A,0HAwEA,SAASS,EAAe,EAAsB,CAC1C,GAAI,CAACC,EAAK,OAAO,KACjB,GAAI,CACA,OAAO,KAAK,MAAMA,CAAG,CACzB,MAAQ,CACJ,OAAOA,CACX,CACJ,CAWA,SAAgBC,EAAgC,EAAgD,CAC5F,GAAM,CACF,MACA,OACA,SAAS,OACT,UAAU,CAAC,EACX,WACA,mBACA,iBACA,kBAAkB,GAClB,OACA,aACA,SACA,SAAS,KAAK,MACd,aACAC,EAEJ,OAAO,IAAI,SAAY,EAAS,IAAW,CACvC,GAAIC,GAAQ,QAAS,CACjBC,EAAO,IAAI,aAAa,UAAW,YAAY,CAAC,EAChD,MACJ,CAEA,IAAMC,EAAM,IAAI,eAChBA,EAAI,KAAKC,EAAQC,CAAG,EACpB,EAAI,gBAAkBC,EAEtB,IAAMC,EAAQC,IAAW,EACnBC,EAAgBC,EAAYA,EAAU,EAAItB,EAAAA,SAAS,EACnDuB,EAAuC,CAAE,GAAGC,CAAQ,EACtDL,GAAS,EAAE,kBAAmBI,KAE1BE,IAAqB,IAAA,IACrBxB,EAAAA,0BAA0BgB,EAAKQ,EAAkBC,CAAc,EAE/D,EAAa,cAAgB,UAAUP,IAEvCb,EAAA,2BAA2BW,EAAKQ,CAAgB,GAGxD,OAAO,OACHF,EACArB,EAAAA,YAAY,CACR,SACA,MACA,UAAWuB,GAAoB,WAAW,UAAU,QAAUR,EAC9D,OACA,iBACA,SACJ,CAAC,CACL,EACII,GAAiB,EAAE,iBAAkBE,KACrC,EAAa,gBAAkBF,GAEnC,IAAK,GAAM,CAACM,EAAKC,KAAU,OAAO,QAAQL,CAAY,EAClDR,EAAI,iBAAiBY,EAAKC,CAAK,EAG/BC,IACA,EAAI,OAAO,WAAc,GAAU,CAC/BA,EAAW,CACP,OAAQC,EAAM,OACd,MAAOA,EAAM,MACb,SAAUA,EAAM,iBAAmBA,EAAM,OAASA,EAAM,MAAQ,KAChE,iBAAkBA,EAAM,gBAC5B,CAAC,CACL,GAGJ,SAASC,GAAoB,CACzBhB,EAAI,MAAM,CACd,CACAF,GAAQ,iBAAiB,QAASkB,CAAW,EAE7C,EAAI,WAAe,CACflB,GAAQ,oBAAoB,QAASkB,CAAW,EAChD,IAAMC,EAAYjB,EAAI,QAAU,KAAOA,EAAI,OAAS,IAC9CkB,EAAclB,EAAI,kBAAkB,cAAc,GAAK,GAE7D,GAAI,CAACiB,EAAW,CACZ,IAAME,EAAYzB,EAAeM,EAAI,YAAY,EACjDD,EACI,IAAIX,EAAAA,gBACAC,EAAAA,cACIW,EAAI,OACJmB,EACA,CAAE,IAAM,GAASnB,EAAI,kBAAkBoB,CAAI,CAAE,EAC7Cd,CACJ,CACJ,CACJ,CAEJ,MAEA,GAAIN,EAAI,SAAW,KAAO,CAACA,EAAI,aAC3BqB,EAAQ,IAAA,EAAc,OAI1B,GAAIH,EAAY,SAAS,kBAAkB,EACvC,GAAI,CACAG,EAAQC,EAAOtB,EAAI,YAAY,CAAM,CACzC,OAASuB,EAAK,CACVxB,EAAOwB,CAAG,CACd,MAEAF,EAAQrB,EAAI,YAA4B,CAEhD,EAEA,EAAI,YAAgB,CAChBF,GAAQ,oBAAoB,QAASkB,CAAW,EAChDjB,EACI,IAAIX,EAAAA,gBAAgB,CAChB,OAAQ,EACR,OAAQ,2BACR,UAAWkB,GAAiB,IAAA,EAChC,CAAC,CACL,CACJ,EAEA,EAAI,YAAgB,CAChBR,GAAQ,oBAAoB,QAASkB,CAAW,EAChDjB,EAAO,IAAI,aAAa,UAAW,YAAY,CAAC,CACpD,EAEAC,EAAI,KAAKwB,CAAI,CACjB,CAAC,CACL,C"}
|
|
@@ -47,13 +47,8 @@ function s(s) {
|
|
|
47
47
|
if (!e) {
|
|
48
48
|
let e = o(S.responseText);
|
|
49
49
|
x(new i(a(S.status, e, { get: (e) => S.getResponseHeader(e) }, w)));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (S.status === 204 || !S.responseText) {
|
|
53
|
-
s(void 0);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (t.includes("application/json")) try {
|
|
50
|
+
} else if (S.status === 204 || !S.responseText) s(void 0);
|
|
51
|
+
else if (t.includes("application/json")) try {
|
|
57
52
|
s(y(S.responseText));
|
|
58
53
|
} catch (e) {
|
|
59
54
|
x(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-with-progress.js","names":[],"sources":["../../src/http/upload-with-progress.ts"],"sourcesContent":["/**\n * @tempest-limits function-lines — XMLHttpRequest is used instead of fetch precisely\n * because it reports upload progress, and its API is event-based: the body wires\n * load, error, abort, timeout and progress against one request object, plus the\n * AbortSignal bridge.\n */\nimport { randomId } from \"../utils\";\nimport { isTrustedCredentialTarget, reportSuppressedCredential } from \"./credential-scope\";\nimport { csrfHeaders } from \"./csrf\";\nimport type { CsrfOptions } from \"./csrf\";\nimport { buildApiError, TempestApiError } from \"./errors\";\n\nexport interface UploadProgressEvent {\n /** Bytes already uploaded. */\n loaded: number;\n /** Total payload size in bytes — only meaningful when `lengthComputable` is true. */\n total: number;\n /** Fraction between 0 and 1, or null when total is unknown. */\n fraction: number | null;\n lengthComputable: boolean;\n}\n\nexport interface UploadWithProgressOptions {\n url: string;\n body: FormData | Blob | File;\n method?: \"POST\" | \"PUT\" | \"PATCH\";\n headers?: Record<string, string>;\n /** Returns the current bearer token. */\n getToken?: () => string | null | undefined;\n /**\n * Origin the `getToken` credential belongs to, normally the API's.\n *\n * Unlike `createApiClient`, this helper has no base URL to infer a scope\n * from — the caller names the destination on every call. Set this when the\n * `url` can come from somewhere other than your own code (a signed URL the\n * API handed back, a value from a response body) and the token must not\n * follow it off-origin. Left unset, the header goes wherever `url` points,\n * which is the behaviour every version before 0.66.0 had.\n */\n credentialOrigin?: string;\n /**\n * Extra origins allowed to receive the credential, on top of\n * {@link credentialOrigin}. Ignored when that one is unset.\n */\n trustedOrigins?: readonly string[];\n /** Send cookies. Defaults to false. */\n withCredentials?: boolean;\n /**\n * Send a CSRF token with the upload, as `createApiClient`'s `csrf` does.\n * Off by default; `true` reads the `csrf_token` cookie into `X-CSRF-Token`.\n *\n * Scoped to {@link credentialOrigin} plus {@link trustedOrigins} — and,\n * unlike the bearer token, scoped even when `credentialOrigin` is unset:\n * then the scope is the page's own origin. The bearer default stays open\n * only for compatibility with every version before 0.66.0; this option is\n * new, so it starts closed. An API on another origin sets\n * `credentialOrigin` to receive the token.\n */\n csrf?: boolean | CsrfOptions;\n /** Called on every `progress` event from the XHR upload channel. */\n onProgress?: (event: UploadProgressEvent) => void;\n /** Abort the request. */\n signal?: AbortSignal;\n /** Override the JSON parser. Defaults to `JSON.parse`. */\n parser?: (raw: string) => unknown;\n /**\n * Per-request correlation id sent as `X-Request-ID` (Tempest convention).\n * Defaults to a generated id. Return an empty string to disable.\n */\n requestId?: () => string;\n}\n\nfunction parseErrorBody(raw: string): unknown {\n if (!raw) return null;\n try {\n return JSON.parse(raw);\n } catch {\n return raw;\n }\n}\n\n/**\n * Upload a file (or any payload) with byte-level progress reporting.\n *\n * `fetch` cannot report upload progress in browsers, so this helper falls\n * back to `XMLHttpRequest`. It mirrors the error contract used by\n * {@link createApiClient}: non-2xx responses reject with a `TempestApiError`.\n *\n * @returns The parsed JSON response, or the raw text when the response is not JSON.\n */\nexport function uploadWithProgress<T = unknown>(options: UploadWithProgressOptions): Promise<T> {\n const {\n url,\n body,\n method = \"POST\",\n headers = {},\n getToken,\n credentialOrigin,\n trustedOrigins,\n withCredentials = false,\n csrf,\n onProgress,\n signal,\n parser = JSON.parse,\n requestId,\n } = options;\n\n return new Promise<T>((resolve, reject) => {\n if (signal?.aborted) {\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n return;\n }\n\n const xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.withCredentials = withCredentials;\n\n const token = getToken?.();\n const sentRequestId = requestId ? requestId() : randomId();\n const finalHeaders: Record<string, string> = { ...headers };\n if (token && !(\"Authorization\" in finalHeaders)) {\n if (\n credentialOrigin === undefined ||\n isTrustedCredentialTarget(url, credentialOrigin, trustedOrigins)\n ) {\n finalHeaders.Authorization = `Bearer ${token}`;\n } else {\n reportSuppressedCredential(url, credentialOrigin);\n }\n }\n Object.assign(\n finalHeaders,\n csrfHeaders({\n method,\n url,\n reference: credentialOrigin ?? globalThis.location?.origin ?? url,\n csrf,\n trustedOrigins,\n headers,\n }),\n );\n if (sentRequestId && !(\"X-Request-ID\" in finalHeaders)) {\n finalHeaders[\"X-Request-ID\"] = sentRequestId;\n }\n for (const [key, value] of Object.entries(finalHeaders)) {\n xhr.setRequestHeader(key, value);\n }\n\n if (onProgress) {\n xhr.upload.onprogress = (event) => {\n onProgress({\n loaded: event.loaded,\n total: event.total,\n fraction: event.lengthComputable ? event.loaded / event.total : null,\n lengthComputable: event.lengthComputable,\n });\n };\n }\n\n function handleAbort(): void {\n xhr.abort();\n }\n signal?.addEventListener(\"abort\", handleAbort);\n\n xhr.onload = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n const isSuccess = xhr.status >= 200 && xhr.status < 300;\n const contentType = xhr.getResponseHeader(\"content-type\") ?? \"\";\n\n if (!isSuccess) {\n const errorBody = parseErrorBody(xhr.responseText);\n reject(\n new TempestApiError(\n buildApiError(\n xhr.status,\n errorBody,\n { get: (name) => xhr.getResponseHeader(name) },\n sentRequestId,\n ),\n ),\n );\n return;\n }\n\n if (xhr.status === 204 || !xhr.responseText) {\n resolve(undefined as T);\n return;\n }\n\n if (contentType.includes(\"application/json\")) {\n try {\n resolve(parser(xhr.responseText) as T);\n } catch (err) {\n reject(err);\n }\n } else {\n resolve(xhr.responseText as unknown as T);\n }\n };\n\n xhr.onerror = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n reject(\n new TempestApiError({\n status: 0,\n detail: \"Falha de rede no upload.\",\n requestId: sentRequestId || undefined,\n }),\n );\n };\n\n xhr.onabort = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n };\n\n xhr.send(body);\n });\n}\n"],"mappings":";;;;;AAwEA,SAAS,EAAe,GAAsB;CAC1C,IAAI,CAAC,GAAK,OAAO;CACjB,IAAI;EACA,OAAO,KAAK,MAAM,CAAG;CACzB,QAAQ;EACJ,OAAO;CACX;AACJ;AAWA,SAAgB,EAAgC,GAAgD;CAC5F,IAAM,EACF,QACA,SACA,YAAS,QACT,aAAU,CAAC,GACX,aACA,qBACA,mBACA,qBAAkB,IAClB,SACA,eACA,WACA,YAAS,KAAK,OACd,iBACA;CAEJ,OAAO,IAAI,SAAY,GAAS,MAAW;EACvC,IAAI,GAAQ,SAAS;GACjB,EAAO,IAAI,aAAa,WAAW,YAAY,CAAC;GAChD;EACJ;EAEA,IAAM,IAAM,IAAI,eAAe;EAE/B,AADA,EAAI,KAAK,GAAQ,CAAG,GACpB,EAAI,kBAAkB;EAEtB,IAAM,IAAQ,IAAW,GACnB,IAAgB,IAAY,EAAU,IAAI,EAAS,GACnD,IAAuC,EAAE,GAAG,EAAQ;EAsB1D,AArBI,KAAS,EAAE,mBAAmB,OAE1B,MAAqB,KAAA,KACrB,EAA0B,GAAK,GAAkB,CAAc,IAE/D,EAAa,gBAAgB,UAAU,MAEvC,EAA2B,GAAK,CAAgB,IAGxD,OAAO,OACH,GACA,EAAY;GACR;GACA;GACA,WAAW,KAAoB,WAAW,UAAU,UAAU;GAC9D;GACA;GACA;EACJ,CAAC,CACL,GACI,KAAiB,EAAE,kBAAkB,OACrC,EAAa,kBAAkB;EAEnC,KAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,CAAY,GAClD,EAAI,iBAAiB,GAAK,CAAK;EAGnC,AAAI,MACA,EAAI,OAAO,cAAc,MAAU;GAC/B,EAAW;IACP,QAAQ,EAAM;IACd,OAAO,EAAM;IACb,UAAU,EAAM,mBAAmB,EAAM,SAAS,EAAM,QAAQ;IAChE,kBAAkB,EAAM;GAC5B,CAAC;EACL;EAGJ,SAAS,IAAoB;GACzB,EAAI,MAAM;EACd;EAuDA,AAtDA,GAAQ,iBAAiB,SAAS,CAAW,GAE7C,EAAI,eAAe;GACf,GAAQ,oBAAoB,SAAS,CAAW;GAChD,IAAM,IAAY,EAAI,UAAU,OAAO,EAAI,SAAS,KAC9C,IAAc,EAAI,kBAAkB,cAAc,KAAK;GAE7D,IAAI,CAAC,GAAW;IACZ,IAAM,IAAY,EAAe,EAAI,YAAY;IACjD,EACI,IAAI,EACA,EACI,EAAI,QACJ,GACA,EAAE,MAAM,MAAS,EAAI,kBAAkB,CAAI,EAAE,GAC7C,CACJ,CACJ,CACJ;IACA;GACJ;GAEA,IAAI,EAAI,WAAW,OAAO,CAAC,EAAI,cAAc;IACzC,EAAQ,KAAA,CAAc;IACtB;GACJ;GAEA,IAAI,EAAY,SAAS,kBAAkB,GACvC,IAAI;IACA,EAAQ,EAAO,EAAI,YAAY,CAAM;GACzC,SAAS,GAAK;IACV,EAAO,CAAG;GACd;QAEA,EAAQ,EAAI,YAA4B;EAEhD,GAEA,EAAI,gBAAgB;GAEhB,AADA,GAAQ,oBAAoB,SAAS,CAAW,GAChD,EACI,IAAI,EAAgB;IAChB,QAAQ;IACR,QAAQ;IACR,WAAW,KAAiB,KAAA;GAChC,CAAC,CACL;EACJ,GAEA,EAAI,gBAAgB;GAEhB,AADA,GAAQ,oBAAoB,SAAS,CAAW,GAChD,EAAO,IAAI,aAAa,WAAW,YAAY,CAAC;EACpD,GAEA,EAAI,KAAK,CAAI;CACjB,CAAC;AACL"}
|
|
1
|
+
{"version":3,"file":"upload-with-progress.js","names":["parseErrorBody","raw","uploadWithProgress","options","signal","xhr","method","url","withCredentials","token","getToken","sentRequestId","requestId","randomId","finalHeaders","headers","credentialOrigin","isTrustedCredentialTarget","trustedOrigins","reportSuppressedCredential","csrfHeaders","key","value","onProgress","event","handleAbort","isSuccess","contentType","errorBody","TempestApiError","buildApiError","name","parser","err","reject","body"],"sources":["../../src/http/upload-with-progress.ts"],"sourcesContent":["/**\n * @tempest-limits function-lines — XMLHttpRequest is used instead of fetch precisely\n * because it reports upload progress, and its API is event-based: the body wires\n * load, error, abort, timeout and progress against one request object, plus the\n * AbortSignal bridge.\n */\nimport { randomId } from \"../utils\";\nimport { isTrustedCredentialTarget, reportSuppressedCredential } from \"./credential-scope\";\nimport { csrfHeaders } from \"./csrf\";\nimport type { CsrfOptions } from \"./csrf\";\nimport { buildApiError, TempestApiError } from \"./errors\";\n\nexport interface UploadProgressEvent {\n /** Bytes already uploaded. */\n loaded: number;\n /** Total payload size in bytes — only meaningful when `lengthComputable` is true. */\n total: number;\n /** Fraction between 0 and 1, or null when total is unknown. */\n fraction: number | null;\n lengthComputable: boolean;\n}\n\nexport interface UploadWithProgressOptions {\n url: string;\n body: FormData | Blob | File;\n method?: \"POST\" | \"PUT\" | \"PATCH\";\n headers?: Record<string, string>;\n /** Returns the current bearer token. */\n getToken?: () => string | null | undefined;\n /**\n * Origin the `getToken` credential belongs to, normally the API's.\n *\n * Unlike `createApiClient`, this helper has no base URL to infer a scope\n * from — the caller names the destination on every call. Set this when the\n * `url` can come from somewhere other than your own code (a signed URL the\n * API handed back, a value from a response body) and the token must not\n * follow it off-origin. Left unset, the header goes wherever `url` points,\n * which is the behaviour every version before 0.66.0 had.\n */\n credentialOrigin?: string;\n /**\n * Extra origins allowed to receive the credential, on top of\n * {@link credentialOrigin}. Ignored when that one is unset.\n */\n trustedOrigins?: readonly string[];\n /** Send cookies. Defaults to false. */\n withCredentials?: boolean;\n /**\n * Send a CSRF token with the upload, as `createApiClient`'s `csrf` does.\n * Off by default; `true` reads the `csrf_token` cookie into `X-CSRF-Token`.\n *\n * Scoped to {@link credentialOrigin} plus {@link trustedOrigins} — and,\n * unlike the bearer token, scoped even when `credentialOrigin` is unset:\n * then the scope is the page's own origin. The bearer default stays open\n * only for compatibility with every version before 0.66.0; this option is\n * new, so it starts closed. An API on another origin sets\n * `credentialOrigin` to receive the token.\n */\n csrf?: boolean | CsrfOptions;\n /** Called on every `progress` event from the XHR upload channel. */\n onProgress?: (event: UploadProgressEvent) => void;\n /** Abort the request. */\n signal?: AbortSignal;\n /** Override the JSON parser. Defaults to `JSON.parse`. */\n parser?: (raw: string) => unknown;\n /**\n * Per-request correlation id sent as `X-Request-ID` (Tempest convention).\n * Defaults to a generated id. Return an empty string to disable.\n */\n requestId?: () => string;\n}\n\nfunction parseErrorBody(raw: string): unknown {\n if (!raw) return null;\n try {\n return JSON.parse(raw);\n } catch {\n return raw;\n }\n}\n\n/**\n * Upload a file (or any payload) with byte-level progress reporting.\n *\n * `fetch` cannot report upload progress in browsers, so this helper falls\n * back to `XMLHttpRequest`. It mirrors the error contract used by\n * {@link createApiClient}: non-2xx responses reject with a `TempestApiError`.\n *\n * @returns The parsed JSON response, or the raw text when the response is not JSON.\n */\nexport function uploadWithProgress<T = unknown>(options: UploadWithProgressOptions): Promise<T> {\n const {\n url,\n body,\n method = \"POST\",\n headers = {},\n getToken,\n credentialOrigin,\n trustedOrigins,\n withCredentials = false,\n csrf,\n onProgress,\n signal,\n parser = JSON.parse,\n requestId,\n } = options;\n\n return new Promise<T>((resolve, reject) => {\n if (signal?.aborted) {\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n return;\n }\n\n const xhr = new XMLHttpRequest();\n xhr.open(method, url);\n xhr.withCredentials = withCredentials;\n\n const token = getToken?.();\n const sentRequestId = requestId ? requestId() : randomId();\n const finalHeaders: Record<string, string> = { ...headers };\n if (token && !(\"Authorization\" in finalHeaders)) {\n if (\n credentialOrigin === undefined ||\n isTrustedCredentialTarget(url, credentialOrigin, trustedOrigins)\n ) {\n finalHeaders.Authorization = `Bearer ${token}`;\n } else {\n reportSuppressedCredential(url, credentialOrigin);\n }\n }\n Object.assign(\n finalHeaders,\n csrfHeaders({\n method,\n url,\n reference: credentialOrigin ?? globalThis.location?.origin ?? url,\n csrf,\n trustedOrigins,\n headers,\n }),\n );\n if (sentRequestId && !(\"X-Request-ID\" in finalHeaders)) {\n finalHeaders[\"X-Request-ID\"] = sentRequestId;\n }\n for (const [key, value] of Object.entries(finalHeaders)) {\n xhr.setRequestHeader(key, value);\n }\n\n if (onProgress) {\n xhr.upload.onprogress = (event) => {\n onProgress({\n loaded: event.loaded,\n total: event.total,\n fraction: event.lengthComputable ? event.loaded / event.total : null,\n lengthComputable: event.lengthComputable,\n });\n };\n }\n\n function handleAbort(): void {\n xhr.abort();\n }\n signal?.addEventListener(\"abort\", handleAbort);\n\n xhr.onload = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n const isSuccess = xhr.status >= 200 && xhr.status < 300;\n const contentType = xhr.getResponseHeader(\"content-type\") ?? \"\";\n\n if (!isSuccess) {\n const errorBody = parseErrorBody(xhr.responseText);\n reject(\n new TempestApiError(\n buildApiError(\n xhr.status,\n errorBody,\n { get: (name) => xhr.getResponseHeader(name) },\n sentRequestId,\n ),\n ),\n );\n return;\n }\n\n if (xhr.status === 204 || !xhr.responseText) {\n resolve(undefined as T);\n return;\n }\n\n if (contentType.includes(\"application/json\")) {\n try {\n resolve(parser(xhr.responseText) as T);\n } catch (err) {\n reject(err);\n }\n } else {\n resolve(xhr.responseText as unknown as T);\n }\n };\n\n xhr.onerror = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n reject(\n new TempestApiError({\n status: 0,\n detail: \"Falha de rede no upload.\",\n requestId: sentRequestId || undefined,\n }),\n );\n };\n\n xhr.onabort = () => {\n signal?.removeEventListener(\"abort\", handleAbort);\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n };\n\n xhr.send(body);\n });\n}\n"],"mappings":";;;;;AAwEA,SAASA,EAAe,GAAsB;CAC1C,IAAI,CAACC,GAAK,OAAO;CACjB,IAAI;EACA,OAAO,KAAK,MAAMA,CAAG;CACzB,QAAQ;EACJ,OAAOA;CACX;AACJ;AAWA,SAAgBC,EAAgC,GAAgD;CAC5F,IAAM,EACF,QACA,SACA,YAAS,QACT,aAAU,CAAC,GACX,aACA,qBACA,mBACA,qBAAkB,IAClB,SACA,eACA,WACA,YAAS,KAAK,OACd,iBACAC;CAEJ,OAAO,IAAI,SAAY,GAAS,MAAW;EACvC,IAAIC,GAAQ,SAAS;GACjB,EAAO,IAAI,aAAa,WAAW,YAAY,CAAC;GAChD;EACJ;EAEA,IAAMC,IAAM,IAAI,eAAe;EAE/B,AADAA,EAAI,KAAKC,GAAQC,CAAG,GACpB,EAAI,kBAAkBC;EAEtB,IAAMC,IAAQC,IAAW,GACnBC,IAAgBC,IAAYA,EAAU,IAAIC,EAAS,GACnDC,IAAuC,EAAE,GAAGC,EAAQ;EAsB1D,AArBIN,KAAS,EAAE,mBAAmBK,OAE1BE,MAAqB,KAAA,KACrBC,EAA0BV,GAAKS,GAAkBE,CAAc,IAE/D,EAAa,gBAAgB,UAAUT,MAEvCU,EAA2BZ,GAAKS,CAAgB,IAGxD,OAAO,OACHF,GACAM,EAAY;GACR;GACA;GACA,WAAWJ,KAAoB,WAAW,UAAU,UAAUT;GAC9D;GACA;GACA;EACJ,CAAC,CACL,GACII,KAAiB,EAAE,kBAAkBG,OACrC,EAAa,kBAAkBH;EAEnC,KAAK,IAAM,CAACU,GAAKC,MAAU,OAAO,QAAQR,CAAY,GAClD,EAAI,iBAAiBO,GAAKC,CAAK;EAGnC,AAAIC,MACA,EAAI,OAAO,cAAc,MAAU;GAC/B,EAAW;IACP,QAAQC,EAAM;IACd,OAAOA,EAAM;IACb,UAAUA,EAAM,mBAAmBA,EAAM,SAASA,EAAM,QAAQ;IAChE,kBAAkBA,EAAM;GAC5B,CAAC;EACL;EAGJ,SAASC,IAAoB;GACzB,EAAI,MAAM;EACd;EAuDA,AAtDArB,GAAQ,iBAAiB,SAASqB,CAAW,GAE7C,EAAI,eAAe;GACf,GAAQ,oBAAoB,SAASA,CAAW;GAChD,IAAMC,IAAYrB,EAAI,UAAU,OAAOA,EAAI,SAAS,KAC9CsB,IAActB,EAAI,kBAAkB,cAAc,KAAK;GAE7D,IAAI,CAACqB,GAAW;IACZ,IAAME,IAAY5B,EAAeK,EAAI,YAAY;IACjD,EACI,IAAIwB,EACAC,EACIzB,EAAI,QACJuB,GACA,EAAE,MAAM,MAASvB,EAAI,kBAAkB0B,CAAI,EAAE,GAC7CpB,CACJ,CACJ,CACJ;GAEJ,OAEA,IAAIN,EAAI,WAAW,OAAO,CAACA,EAAI,cAC3B,EAAQ,KAAA,CAAc;QAI1B,IAAIsB,EAAY,SAAS,kBAAkB,GACvC,IAAI;IACA,EAAQK,EAAO3B,EAAI,YAAY,CAAM;GACzC,SAAS4B,GAAK;IACV,EAAOA,CAAG;GACd;QAEA,EAAQ5B,EAAI,YAA4B;EAEhD,GAEA,EAAI,gBAAgB;GAEhB,AADAD,GAAQ,oBAAoB,SAASqB,CAAW,GAChDS,EACI,IAAIL,EAAgB;IAChB,QAAQ;IACR,QAAQ;IACR,WAAWlB,KAAiB,KAAA;GAChC,CAAC,CACL;EACJ,GAEA,EAAI,gBAAgB;GAEhB,AADAP,GAAQ,oBAAoB,SAASqB,CAAW,GAChDS,EAAO,IAAI,aAAa,WAAW,YAAY,CAAC;EACpD,GAEA7B,EAAI,KAAK8B,CAAI;CACjB,CAAC;AACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-describe-api-error.cjs","names":[],"sources":["../../src/http/use-describe-api-error.ts"],"sourcesContent":["import { useCallback } from \"react\";\n\nimport type { I18n } from \"../i18n/create-i18n\";\nimport { useOptionalI18n } from \"../i18n/I18nProvider\";\nimport type { DescribeApiErrorOptions } from \"./describe-api-error\";\nimport {\n API_ERROR_OFFLINE_KEY,\n API_ERROR_VALIDATION_KEY,\n DEFAULT_API_ERROR_STRINGS,\n describeApiError,\n} from \"./describe-api-error\";\n\n/**\n * {@link describeApiError} with its fixed sentences resolved through the active\n * `I18nProvider`.\n *\n * The funnel is not duplicated — this hook only supplies the strings and calls\n * the pure function. Which is also why both exist: the pure one runs in an\n * interceptor or a logger, where there is no React tree to read a context from,\n * and this one runs in a component without every caller passing translations\n * down by hand.\n *\n * Works with no provider at all: i18n is opt-in in this SDK, so a missing\n * provider — or a catalog that never defined `tempest.error.offline` — falls\n * back to the pt-BR default rather than crashing or printing the raw key.\n *\n * The per-call options are the pure function's, so a screen that knows the\n * backend codes it can hit passes them at the call site while the translated\n * sentences keep coming from the provider.\n *\n * @example\n * const describe = useDescribeApiError();\n * const { mutate } = useMutation({\n * mutationFn: save,\n * onError: (error) => toast(describe(error, t(\"orders.saveFailed\"))),\n * });\n *\n * @returns A stable `(error, fallback, options?) => string` function.\n */\n/**\n * Look one sentence up in the active catalog, falling back to the pt-BR default.\n *\n * The miss is the i18n layer's answer, through `t`'s `default`. It used to be\n * re-derived here by comparing the result against the key that had just been\n * passed in, which is wrong for a catalog that maps a key to itself —\n * `{ \"tempest.error.offline\": \"tempest.error.offline\" }`, which is what a\n * machine-generated or placeholder catalog produces. There the app's own\n * translation lost to the pt-BR default. Only the catalog's owner can answer\n * \"was this key defined\", and `lookup()` already knows.\n *\n * @param translate - The active catalog's `t`, if any provider is mounted.\n * @param key - The translation key to look up.\n * @param fallbackKey - Which {@link DEFAULT_API_ERROR_STRINGS} entry to use on a miss.\n * @returns The sentence to hand to `describeApiError`.\n */\nfunction resolve(\n translate: I18n[\"t\"] | undefined,\n key: string,\n fallbackKey: keyof typeof DEFAULT_API_ERROR_STRINGS,\n): string {\n const fallback = DEFAULT_API_ERROR_STRINGS[fallbackKey];\n return translate?.(key, undefined, { default: fallback }) ?? fallback;\n}\n\nexport function useDescribeApiError(): (\n error: unknown,\n fallback: string,\n options?: DescribeApiErrorOptions,\n) => string {\n const i18n = useOptionalI18n();\n const translate = i18n?.t;\n\n return useCallback(\n (error: unknown, fallback: string, options?: DescribeApiErrorOptions) => {\n return describeApiError(error, fallback, {\n offline: resolve(translate, API_ERROR_OFFLINE_KEY, \"offline\"),\n validation: resolve(translate, API_ERROR_VALIDATION_KEY, \"validation\"),\n ...options,\n });\n },\n [translate],\n );\n}\n"],"mappings":"yGAuDA,
|
|
1
|
+
{"version":3,"file":"use-describe-api-error.cjs","names":["DEFAULT_API_ERROR_STRINGS","useOptionalI18n","useCallback","describeApiError","API_ERROR_OFFLINE_KEY","API_ERROR_VALIDATION_KEY","require_describe_api_error","require_I18nProvider","react","resolve","fallback","fallbackKey","translate","key","useDescribeApiError","error","options"],"sources":["../../src/http/use-describe-api-error.ts"],"sourcesContent":["import { useCallback } from \"react\";\n\nimport type { I18n } from \"../i18n/create-i18n\";\nimport { useOptionalI18n } from \"../i18n/I18nProvider\";\nimport type { DescribeApiErrorOptions } from \"./describe-api-error\";\nimport {\n API_ERROR_OFFLINE_KEY,\n API_ERROR_VALIDATION_KEY,\n DEFAULT_API_ERROR_STRINGS,\n describeApiError,\n} from \"./describe-api-error\";\n\n/**\n * {@link describeApiError} with its fixed sentences resolved through the active\n * `I18nProvider`.\n *\n * The funnel is not duplicated — this hook only supplies the strings and calls\n * the pure function. Which is also why both exist: the pure one runs in an\n * interceptor or a logger, where there is no React tree to read a context from,\n * and this one runs in a component without every caller passing translations\n * down by hand.\n *\n * Works with no provider at all: i18n is opt-in in this SDK, so a missing\n * provider — or a catalog that never defined `tempest.error.offline` — falls\n * back to the pt-BR default rather than crashing or printing the raw key.\n *\n * The per-call options are the pure function's, so a screen that knows the\n * backend codes it can hit passes them at the call site while the translated\n * sentences keep coming from the provider.\n *\n * @example\n * const describe = useDescribeApiError();\n * const { mutate } = useMutation({\n * mutationFn: save,\n * onError: (error) => toast(describe(error, t(\"orders.saveFailed\"))),\n * });\n *\n * @returns A stable `(error, fallback, options?) => string` function.\n */\n/**\n * Look one sentence up in the active catalog, falling back to the pt-BR default.\n *\n * The miss is the i18n layer's answer, through `t`'s `default`. It used to be\n * re-derived here by comparing the result against the key that had just been\n * passed in, which is wrong for a catalog that maps a key to itself —\n * `{ \"tempest.error.offline\": \"tempest.error.offline\" }`, which is what a\n * machine-generated or placeholder catalog produces. There the app's own\n * translation lost to the pt-BR default. Only the catalog's owner can answer\n * \"was this key defined\", and `lookup()` already knows.\n *\n * @param translate - The active catalog's `t`, if any provider is mounted.\n * @param key - The translation key to look up.\n * @param fallbackKey - Which {@link DEFAULT_API_ERROR_STRINGS} entry to use on a miss.\n * @returns The sentence to hand to `describeApiError`.\n */\nfunction resolve(\n translate: I18n[\"t\"] | undefined,\n key: string,\n fallbackKey: keyof typeof DEFAULT_API_ERROR_STRINGS,\n): string {\n const fallback = DEFAULT_API_ERROR_STRINGS[fallbackKey];\n return translate?.(key, undefined, { default: fallback }) ?? fallback;\n}\n\nexport function useDescribeApiError(): (\n error: unknown,\n fallback: string,\n options?: DescribeApiErrorOptions,\n) => string {\n const i18n = useOptionalI18n();\n const translate = i18n?.t;\n\n return useCallback(\n (error: unknown, fallback: string, options?: DescribeApiErrorOptions) => {\n return describeApiError(error, fallback, {\n offline: resolve(translate, API_ERROR_OFFLINE_KEY, \"offline\"),\n validation: resolve(translate, API_ERROR_VALIDATION_KEY, \"validation\"),\n ...options,\n });\n },\n [translate],\n );\n}\n"],"mappings":"A,yGAuDA,SAASS,EACL,EACA,EACA,EACM,CACN,IAAMC,EAAWV,EAAAA,0BAA0BW,GAC3C,OAAOC,IAAYC,EAAK,IAAA,GAAW,CAAE,QAASH,CAAS,CAAC,GAAKA,CACjE,CAEA,SAAgBI,GAIJ,CAER,IAAMF,EADOX,EAAAA,gBACK,CAAA,EAAM,EAExB,OAAA,EAAOC,EAAAA,YAAAA,EACF,EAAgB,EAAkB,IACxBC,EAAAA,iBAAiBY,EAAOL,EAAU,CACrC,QAASD,EAAQG,EAAWR,EAAAA,sBAAuB,SAAS,EAC5D,WAAYK,EAAQG,EAAWP,EAAAA,yBAA0B,YAAY,EACrE,GAAGW,CACP,CAAC,EAEL,CAACJ,CAAS,CACd,CACJ,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-describe-api-error.js","names":[],"sources":["../../src/http/use-describe-api-error.ts"],"sourcesContent":["import { useCallback } from \"react\";\n\nimport type { I18n } from \"../i18n/create-i18n\";\nimport { useOptionalI18n } from \"../i18n/I18nProvider\";\nimport type { DescribeApiErrorOptions } from \"./describe-api-error\";\nimport {\n API_ERROR_OFFLINE_KEY,\n API_ERROR_VALIDATION_KEY,\n DEFAULT_API_ERROR_STRINGS,\n describeApiError,\n} from \"./describe-api-error\";\n\n/**\n * {@link describeApiError} with its fixed sentences resolved through the active\n * `I18nProvider`.\n *\n * The funnel is not duplicated — this hook only supplies the strings and calls\n * the pure function. Which is also why both exist: the pure one runs in an\n * interceptor or a logger, where there is no React tree to read a context from,\n * and this one runs in a component without every caller passing translations\n * down by hand.\n *\n * Works with no provider at all: i18n is opt-in in this SDK, so a missing\n * provider — or a catalog that never defined `tempest.error.offline` — falls\n * back to the pt-BR default rather than crashing or printing the raw key.\n *\n * The per-call options are the pure function's, so a screen that knows the\n * backend codes it can hit passes them at the call site while the translated\n * sentences keep coming from the provider.\n *\n * @example\n * const describe = useDescribeApiError();\n * const { mutate } = useMutation({\n * mutationFn: save,\n * onError: (error) => toast(describe(error, t(\"orders.saveFailed\"))),\n * });\n *\n * @returns A stable `(error, fallback, options?) => string` function.\n */\n/**\n * Look one sentence up in the active catalog, falling back to the pt-BR default.\n *\n * The miss is the i18n layer's answer, through `t`'s `default`. It used to be\n * re-derived here by comparing the result against the key that had just been\n * passed in, which is wrong for a catalog that maps a key to itself —\n * `{ \"tempest.error.offline\": \"tempest.error.offline\" }`, which is what a\n * machine-generated or placeholder catalog produces. There the app's own\n * translation lost to the pt-BR default. Only the catalog's owner can answer\n * \"was this key defined\", and `lookup()` already knows.\n *\n * @param translate - The active catalog's `t`, if any provider is mounted.\n * @param key - The translation key to look up.\n * @param fallbackKey - Which {@link DEFAULT_API_ERROR_STRINGS} entry to use on a miss.\n * @returns The sentence to hand to `describeApiError`.\n */\nfunction resolve(\n translate: I18n[\"t\"] | undefined,\n key: string,\n fallbackKey: keyof typeof DEFAULT_API_ERROR_STRINGS,\n): string {\n const fallback = DEFAULT_API_ERROR_STRINGS[fallbackKey];\n return translate?.(key, undefined, { default: fallback }) ?? fallback;\n}\n\nexport function useDescribeApiError(): (\n error: unknown,\n fallback: string,\n options?: DescribeApiErrorOptions,\n) => string {\n const i18n = useOptionalI18n();\n const translate = i18n?.t;\n\n return useCallback(\n (error: unknown, fallback: string, options?: DescribeApiErrorOptions) => {\n return describeApiError(error, fallback, {\n offline: resolve(translate, API_ERROR_OFFLINE_KEY, \"offline\"),\n validation: resolve(translate, API_ERROR_VALIDATION_KEY, \"validation\"),\n ...options,\n });\n },\n [translate],\n );\n}\n"],"mappings":";;;;AAuDA,
|
|
1
|
+
{"version":3,"file":"use-describe-api-error.js","names":["resolve","fallback","DEFAULT_API_ERROR_STRINGS","fallbackKey","translate","key","useDescribeApiError","useOptionalI18n","useCallback","describeApiError","error","API_ERROR_OFFLINE_KEY","API_ERROR_VALIDATION_KEY","options"],"sources":["../../src/http/use-describe-api-error.ts"],"sourcesContent":["import { useCallback } from \"react\";\n\nimport type { I18n } from \"../i18n/create-i18n\";\nimport { useOptionalI18n } from \"../i18n/I18nProvider\";\nimport type { DescribeApiErrorOptions } from \"./describe-api-error\";\nimport {\n API_ERROR_OFFLINE_KEY,\n API_ERROR_VALIDATION_KEY,\n DEFAULT_API_ERROR_STRINGS,\n describeApiError,\n} from \"./describe-api-error\";\n\n/**\n * {@link describeApiError} with its fixed sentences resolved through the active\n * `I18nProvider`.\n *\n * The funnel is not duplicated — this hook only supplies the strings and calls\n * the pure function. Which is also why both exist: the pure one runs in an\n * interceptor or a logger, where there is no React tree to read a context from,\n * and this one runs in a component without every caller passing translations\n * down by hand.\n *\n * Works with no provider at all: i18n is opt-in in this SDK, so a missing\n * provider — or a catalog that never defined `tempest.error.offline` — falls\n * back to the pt-BR default rather than crashing or printing the raw key.\n *\n * The per-call options are the pure function's, so a screen that knows the\n * backend codes it can hit passes them at the call site while the translated\n * sentences keep coming from the provider.\n *\n * @example\n * const describe = useDescribeApiError();\n * const { mutate } = useMutation({\n * mutationFn: save,\n * onError: (error) => toast(describe(error, t(\"orders.saveFailed\"))),\n * });\n *\n * @returns A stable `(error, fallback, options?) => string` function.\n */\n/**\n * Look one sentence up in the active catalog, falling back to the pt-BR default.\n *\n * The miss is the i18n layer's answer, through `t`'s `default`. It used to be\n * re-derived here by comparing the result against the key that had just been\n * passed in, which is wrong for a catalog that maps a key to itself —\n * `{ \"tempest.error.offline\": \"tempest.error.offline\" }`, which is what a\n * machine-generated or placeholder catalog produces. There the app's own\n * translation lost to the pt-BR default. Only the catalog's owner can answer\n * \"was this key defined\", and `lookup()` already knows.\n *\n * @param translate - The active catalog's `t`, if any provider is mounted.\n * @param key - The translation key to look up.\n * @param fallbackKey - Which {@link DEFAULT_API_ERROR_STRINGS} entry to use on a miss.\n * @returns The sentence to hand to `describeApiError`.\n */\nfunction resolve(\n translate: I18n[\"t\"] | undefined,\n key: string,\n fallbackKey: keyof typeof DEFAULT_API_ERROR_STRINGS,\n): string {\n const fallback = DEFAULT_API_ERROR_STRINGS[fallbackKey];\n return translate?.(key, undefined, { default: fallback }) ?? fallback;\n}\n\nexport function useDescribeApiError(): (\n error: unknown,\n fallback: string,\n options?: DescribeApiErrorOptions,\n) => string {\n const i18n = useOptionalI18n();\n const translate = i18n?.t;\n\n return useCallback(\n (error: unknown, fallback: string, options?: DescribeApiErrorOptions) => {\n return describeApiError(error, fallback, {\n offline: resolve(translate, API_ERROR_OFFLINE_KEY, \"offline\"),\n validation: resolve(translate, API_ERROR_VALIDATION_KEY, \"validation\"),\n ...options,\n });\n },\n [translate],\n );\n}\n"],"mappings":";;;;AAuDA,SAASA,EACL,GACA,GACA,GACM;CACN,IAAMC,IAAWC,EAA0BC;CAC3C,OAAOC,IAAYC,GAAK,KAAA,GAAW,EAAE,SAASJ,EAAS,CAAC,KAAKA;AACjE;AAEA,SAAgBK,IAIJ;CAER,IAAMF,IADOG,EACK,CAAA,EAAM;CAExB,OAAOC,GACF,GAAgB,GAAkB,MACxBC,EAAiBC,GAAOT,GAAU;EACrC,SAASD,EAAQI,GAAWO,GAAuB,SAAS;EAC5D,YAAYX,EAAQI,GAAWQ,GAA0B,YAAY;EACrE,GAAGC;CACP,CAAC,GAEL,CAACT,CAAS,CACd;AACJ"}
|
package/dist/http/use-poll.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e=require("react");function t(t,n){let{interval:r,disabled:i=!1,stopWhen:a,onError:o}=n,[s,c]=(0,e.useState)(null),[l,u]=(0,e.useState)(null),[d,f]=(0,e.useState)(!i),p=(0,e.useRef)(i),m=(0,e.useRef)(!1),h=(0,e.useRef)(null);async function g(){if(!(p.current||m.current)){m.current=!0;try{let e=await t();if(p.current)return;c(e),u(null),a?.(e)&&(p.current=!0)}catch(e){p.current||(u(e),o?.(e))}finally{m.current=!1,f(!1),p.current||(h.current=setTimeout(g,r))}}}return(0,e.useEffect)(()=>{if(p.current=i,i)
|
|
1
|
+
let e=require("react");function t(t,n){let{interval:r,disabled:i=!1,stopWhen:a,onError:o}=n,[s,c]=(0,e.useState)(null),[l,u]=(0,e.useState)(null),[d,f]=(0,e.useState)(!i),p=(0,e.useRef)(i),m=(0,e.useRef)(!1),h=(0,e.useRef)(null);async function g(){if(!(p.current||m.current)){m.current=!0;try{let e=await t();if(p.current)return;c(e),u(null),a?.(e)&&(p.current=!0)}catch(e){p.current||(u(e),o?.(e))}finally{m.current=!1,f(!1),p.current||(h.current=setTimeout(g,r))}}}return(0,e.useEffect)(()=>{if(p.current=i,i)h.current&&clearTimeout(h.current);else return f(!0),g(),()=>{p.current=!0,h.current&&clearTimeout(h.current)}},[r,i]),{data:s,error:l,loading:d,stop:()=>{p.current=!0,h.current&&clearTimeout(h.current)},start:()=>{p.current&&(p.current=!1,g())}}}exports.usePoll=t;
|
|
2
2
|
//# sourceMappingURL=use-poll.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-poll.cjs","names":[],"sources":["../../src/http/use-poll.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nexport interface UsePollOptions<T> {\n /** Polling interval in ms. */\n interval: number;\n /** Disable polling without unmounting. Default: false. */\n disabled?: boolean;\n /** Stop polling once the predicate returns true. */\n stopWhen?: (data: T) => boolean;\n /** Called on each error. */\n onError?: (error: unknown) => void;\n}\n\nexport interface UsePollResult<T> {\n data: T | null;\n error: unknown;\n loading: boolean;\n stop: () => void;\n start: () => void;\n}\n\n/**\n * Poll an async factory on a fixed interval. Skips overlapping requests if a\n * prior call has not finished. Pause via `disabled` or `stopWhen`.\n */\nexport function usePoll<T>(\n factory: () => Promise<T>,\n options: UsePollOptions<T>,\n): UsePollResult<T> {\n const { interval, disabled = false, stopWhen, onError } = options;\n const [data, setData] = useState<T | null>(null);\n const [error, setError] = useState<unknown>(null);\n const [loading, setLoading] = useState<boolean>(!disabled);\n const stopped = useRef<boolean>(disabled);\n const inFlight = useRef<boolean>(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n async function tick(): Promise<void> {\n if (stopped.current || inFlight.current) return;\n inFlight.current = true;\n try {\n const next = await factory();\n if (stopped.current) return;\n setData(next);\n setError(null);\n if (stopWhen?.(next)) stopped.current = true;\n } catch (err) {\n if (!stopped.current) {\n setError(err);\n onError?.(err);\n }\n } finally {\n inFlight.current = false;\n setLoading(false);\n if (!stopped.current) {\n timer.current = setTimeout(tick, interval);\n }\n }\n }\n\n useEffect(() => {\n stopped.current = disabled;\n if (disabled) {\n if (timer.current) clearTimeout(timer.current);\n return;\n }\n setLoading(true);\n void tick();\n return () => {\n stopped.current = true;\n if (timer.current) clearTimeout(timer.current);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [interval, disabled]);\n\n return {\n data,\n error,\n loading,\n stop: () => {\n stopped.current = true;\n if (timer.current) clearTimeout(timer.current);\n },\n start: () => {\n if (!stopped.current) return;\n stopped.current = false;\n void tick();\n },\n };\n}\n"],"mappings":"uBAyBA,
|
|
1
|
+
{"version":3,"file":"use-poll.cjs","names":["useState","useRef","react","usePoll","options","data","setData","error","setError","loading","setLoading","disabled","stopped","inFlight","timer","tick","next","factory","stopWhen","err","onError","interval"],"sources":["../../src/http/use-poll.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nexport interface UsePollOptions<T> {\n /** Polling interval in ms. */\n interval: number;\n /** Disable polling without unmounting. Default: false. */\n disabled?: boolean;\n /** Stop polling once the predicate returns true. */\n stopWhen?: (data: T) => boolean;\n /** Called on each error. */\n onError?: (error: unknown) => void;\n}\n\nexport interface UsePollResult<T> {\n data: T | null;\n error: unknown;\n loading: boolean;\n stop: () => void;\n start: () => void;\n}\n\n/**\n * Poll an async factory on a fixed interval. Skips overlapping requests if a\n * prior call has not finished. Pause via `disabled` or `stopWhen`.\n */\nexport function usePoll<T>(\n factory: () => Promise<T>,\n options: UsePollOptions<T>,\n): UsePollResult<T> {\n const { interval, disabled = false, stopWhen, onError } = options;\n const [data, setData] = useState<T | null>(null);\n const [error, setError] = useState<unknown>(null);\n const [loading, setLoading] = useState<boolean>(!disabled);\n const stopped = useRef<boolean>(disabled);\n const inFlight = useRef<boolean>(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n async function tick(): Promise<void> {\n if (stopped.current || inFlight.current) return;\n inFlight.current = true;\n try {\n const next = await factory();\n if (stopped.current) return;\n setData(next);\n setError(null);\n if (stopWhen?.(next)) stopped.current = true;\n } catch (err) {\n if (!stopped.current) {\n setError(err);\n onError?.(err);\n }\n } finally {\n inFlight.current = false;\n setLoading(false);\n if (!stopped.current) {\n timer.current = setTimeout(tick, interval);\n }\n }\n }\n\n useEffect(() => {\n stopped.current = disabled;\n if (disabled) {\n if (timer.current) clearTimeout(timer.current);\n return;\n }\n setLoading(true);\n void tick();\n return () => {\n stopped.current = true;\n if (timer.current) clearTimeout(timer.current);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [interval, disabled]);\n\n return {\n data,\n error,\n loading,\n stop: () => {\n stopped.current = true;\n if (timer.current) clearTimeout(timer.current);\n },\n start: () => {\n if (!stopped.current) return;\n stopped.current = false;\n void tick();\n },\n };\n}\n"],"mappings":"A,uBAyBA,SAAgBG,EACZ,EACA,EACgB,CAChB,GAAM,CAAE,WAAU,WAAW,GAAO,WAAU,WAAYC,EACpD,CAACC,EAAMC,IAAA,EAAWN,EAAAA,SAAAA,CAAmB,IAAI,EACzC,CAACO,EAAOC,IAAA,EAAYR,EAAAA,SAAAA,CAAkB,IAAI,EAC1C,CAACS,EAASC,IAAA,EAAcV,EAAAA,SAAAA,CAAkB,CAACW,CAAQ,EACnDC,GAAA,EAAUX,EAAAA,OAAAA,CAAgBU,CAAQ,EAClCE,GAAA,EAAWZ,EAAAA,OAAAA,CAAgB,EAAK,EAChCa,GAAA,EAAQb,EAAAA,OAAAA,CAA6C,IAAI,EAE/D,eAAec,GAAsB,CACjC,GAAI,IAAQ,SAAWF,EAAS,SAChC,GAAS,QAAU,GACnB,GAAI,CACA,IAAMG,EAAO,MAAMC,EAAQ,EAC3B,GAAIL,EAAQ,QAAS,OACrBN,EAAQU,CAAI,EACZR,EAAS,IAAI,EACTU,IAAWF,CAAI,IAAG,EAAQ,QAAU,GAC5C,OAASG,EAAK,CACLP,EAAQ,UACTJ,EAASW,CAAG,EACZC,IAAUD,CAAG,EAErB,QAAU,CACN,EAAS,QAAU,GACnBT,EAAW,EAAK,EACXE,EAAQ,UACT,EAAM,QAAU,WAAWG,EAAMM,CAAQ,EAEjD,CAlBmB,CAmBvB,CAiBA,OAfA,EAAAnB,EAAA,UAAA,KAAgB,CAEZ,GADA,EAAQ,QAAUS,EACdA,EACIG,EAAM,SAAS,aAAaA,EAAM,OAAO,OAKjD,OAFAJ,EAAW,EAAI,EACfK,EAAU,MACG,CACT,EAAQ,QAAU,GACdD,EAAM,SAAS,aAAaA,EAAM,OAAO,CACjD,CAEJ,EAAG,CAACO,EAAUV,CAAQ,CAAC,EAEhB,CACH,OACA,QACA,UACA,SAAY,CACR,EAAQ,QAAU,GACdG,EAAM,SAAS,aAAaA,EAAM,OAAO,CACjD,EACA,UAAa,CACJF,EAAQ,UACb,EAAQ,QAAU,GAClBG,EAAU,EACd,CACJ,CACJ,C"}
|
package/dist/http/use-poll.js
CHANGED
|
@@ -17,11 +17,8 @@ function r(r, i) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
return e(() => {
|
|
20
|
-
if (h.current = o, o)
|
|
21
|
-
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
return m(!0), v(), () => {
|
|
20
|
+
if (h.current = o, o) _.current && clearTimeout(_.current);
|
|
21
|
+
else return m(!0), v(), () => {
|
|
25
22
|
h.current = !0, _.current && clearTimeout(_.current);
|
|
26
23
|
};
|
|
27
24
|
}, [a, o]), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-poll.js","names":[],"sources":["../../src/http/use-poll.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nexport interface UsePollOptions<T> {\n /** Polling interval in ms. */\n interval: number;\n /** Disable polling without unmounting. Default: false. */\n disabled?: boolean;\n /** Stop polling once the predicate returns true. */\n stopWhen?: (data: T) => boolean;\n /** Called on each error. */\n onError?: (error: unknown) => void;\n}\n\nexport interface UsePollResult<T> {\n data: T | null;\n error: unknown;\n loading: boolean;\n stop: () => void;\n start: () => void;\n}\n\n/**\n * Poll an async factory on a fixed interval. Skips overlapping requests if a\n * prior call has not finished. Pause via `disabled` or `stopWhen`.\n */\nexport function usePoll<T>(\n factory: () => Promise<T>,\n options: UsePollOptions<T>,\n): UsePollResult<T> {\n const { interval, disabled = false, stopWhen, onError } = options;\n const [data, setData] = useState<T | null>(null);\n const [error, setError] = useState<unknown>(null);\n const [loading, setLoading] = useState<boolean>(!disabled);\n const stopped = useRef<boolean>(disabled);\n const inFlight = useRef<boolean>(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n async function tick(): Promise<void> {\n if (stopped.current || inFlight.current) return;\n inFlight.current = true;\n try {\n const next = await factory();\n if (stopped.current) return;\n setData(next);\n setError(null);\n if (stopWhen?.(next)) stopped.current = true;\n } catch (err) {\n if (!stopped.current) {\n setError(err);\n onError?.(err);\n }\n } finally {\n inFlight.current = false;\n setLoading(false);\n if (!stopped.current) {\n timer.current = setTimeout(tick, interval);\n }\n }\n }\n\n useEffect(() => {\n stopped.current = disabled;\n if (disabled) {\n if (timer.current) clearTimeout(timer.current);\n return;\n }\n setLoading(true);\n void tick();\n return () => {\n stopped.current = true;\n if (timer.current) clearTimeout(timer.current);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [interval, disabled]);\n\n return {\n data,\n error,\n loading,\n stop: () => {\n stopped.current = true;\n if (timer.current) clearTimeout(timer.current);\n },\n start: () => {\n if (!stopped.current) return;\n stopped.current = false;\n void tick();\n },\n };\n}\n"],"mappings":";;AAyBA,
|
|
1
|
+
{"version":3,"file":"use-poll.js","names":["usePoll","options","data","setData","useState","error","setError","loading","setLoading","disabled","stopped","useRef","inFlight","timer","tick","next","factory","stopWhen","err","onError","interval","useEffect"],"sources":["../../src/http/use-poll.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nexport interface UsePollOptions<T> {\n /** Polling interval in ms. */\n interval: number;\n /** Disable polling without unmounting. Default: false. */\n disabled?: boolean;\n /** Stop polling once the predicate returns true. */\n stopWhen?: (data: T) => boolean;\n /** Called on each error. */\n onError?: (error: unknown) => void;\n}\n\nexport interface UsePollResult<T> {\n data: T | null;\n error: unknown;\n loading: boolean;\n stop: () => void;\n start: () => void;\n}\n\n/**\n * Poll an async factory on a fixed interval. Skips overlapping requests if a\n * prior call has not finished. Pause via `disabled` or `stopWhen`.\n */\nexport function usePoll<T>(\n factory: () => Promise<T>,\n options: UsePollOptions<T>,\n): UsePollResult<T> {\n const { interval, disabled = false, stopWhen, onError } = options;\n const [data, setData] = useState<T | null>(null);\n const [error, setError] = useState<unknown>(null);\n const [loading, setLoading] = useState<boolean>(!disabled);\n const stopped = useRef<boolean>(disabled);\n const inFlight = useRef<boolean>(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n async function tick(): Promise<void> {\n if (stopped.current || inFlight.current) return;\n inFlight.current = true;\n try {\n const next = await factory();\n if (stopped.current) return;\n setData(next);\n setError(null);\n if (stopWhen?.(next)) stopped.current = true;\n } catch (err) {\n if (!stopped.current) {\n setError(err);\n onError?.(err);\n }\n } finally {\n inFlight.current = false;\n setLoading(false);\n if (!stopped.current) {\n timer.current = setTimeout(tick, interval);\n }\n }\n }\n\n useEffect(() => {\n stopped.current = disabled;\n if (disabled) {\n if (timer.current) clearTimeout(timer.current);\n return;\n }\n setLoading(true);\n void tick();\n return () => {\n stopped.current = true;\n if (timer.current) clearTimeout(timer.current);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [interval, disabled]);\n\n return {\n data,\n error,\n loading,\n stop: () => {\n stopped.current = true;\n if (timer.current) clearTimeout(timer.current);\n },\n start: () => {\n if (!stopped.current) return;\n stopped.current = false;\n void tick();\n },\n };\n}\n"],"mappings":";;AAyBA,SAAgBA,EACZ,GACA,GACgB;CAChB,IAAM,EAAE,aAAU,cAAW,IAAO,aAAU,eAAYC,GACpD,CAACC,GAAMC,KAAWC,EAAmB,IAAI,GACzC,CAACC,GAAOC,KAAYF,EAAkB,IAAI,GAC1C,CAACG,GAASC,KAAcJ,EAAkB,CAACK,CAAQ,GACnDC,IAAUC,EAAgBF,CAAQ,GAClCG,IAAWD,EAAgB,EAAK,GAChCE,IAAQF,EAA6C,IAAI;CAE/D,eAAeG,IAAsB;EACjC,IAAI,IAAQ,WAAWF,EAAS,UAChC;KAAS,UAAU;GACnB,IAAI;IACA,IAAMG,IAAO,MAAMC,EAAQ;IAC3B,IAAIN,EAAQ,SAAS;IAGrB,AAFAP,EAAQY,CAAI,GACZT,EAAS,IAAI,GACTW,IAAWF,CAAI,MAAG,EAAQ,UAAU;GAC5C,SAASG,GAAK;IACV,AAAKR,EAAQ,YACTJ,EAASY,CAAG,GACZC,IAAUD,CAAG;GAErB,UAAU;IAGN,AAFA,EAAS,UAAU,IACnBV,EAAW,EAAK,GACXE,EAAQ,YACT,EAAM,UAAU,WAAWI,GAAMM,CAAQ;GAEjD;EAlBmB;CAmBvB;CAiBA,OAfAC,QAAgB;EAEZ,IADA,EAAQ,UAAUZ,GACdA,GACA,AAAII,EAAM,WAAS,aAAaA,EAAM,OAAO;OAKjD,OAFAL,EAAW,EAAI,GACfM,EAAU,SACG;GAET,AADA,EAAQ,UAAU,IACdD,EAAM,WAAS,aAAaA,EAAM,OAAO;EACjD;CAEJ,GAAG,CAACO,GAAUX,CAAQ,CAAC,GAEhB;EACH;EACA;EACA;EACA,YAAY;GAER,AADA,EAAQ,UAAU,IACdI,EAAM,WAAS,aAAaA,EAAM,OAAO;EACjD;EACA,aAAa;GACT,AAAKH,EAAQ,YACb,EAAQ,UAAU,IAClBI,EAAU;EACd;CACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"I18nProvider.cjs","names":[],"sources":["../../src/i18n/I18nProvider.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useEffect, useMemo, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { createI18n, type Catalog, type I18n } from \"./create-i18n\";\n\nexport interface I18nContextValue extends I18n {\n /** Switch the active locale. Persisted when `storageKey` is set. */\n setLocale: (locale: string) => void;\n /** Locales available in the catalog. */\n availableLocales: string[];\n}\n\nconst I18nContext = createContext<I18nContextValue | null>(null);\n\nexport interface I18nProviderProps {\n children: ReactNode;\n /** Initial locale. */\n locale: string;\n /** Fallback locale used when a key is missing. */\n fallbackLocale?: string;\n /** Translation catalog. */\n messages: Catalog;\n /** localStorage key for persisting the user choice. Pass `null` to disable. Default: `\"tempest-locale\"`. */\n storageKey?: string | null;\n}\n\nfunction readStored(storageKey: string | null, available: string[]): string | null {\n if (!storageKey || typeof window === \"undefined\") return null;\n try {\n const value = window.localStorage.getItem(storageKey);\n if (value && available.includes(value)) return value;\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * React provider for the SDK's lightweight i18n. Exposes the translation\n * helpers and a `setLocale` setter to children.\n *\n * @tempest-limits empty-catch — remembering the chosen locale is best-effort. The\n * switch itself is React state and already happened by the time the write runs, so\n * a storage failure costs the preference on the next load and nothing in this one.\n */\nexport function I18nProvider({\n children,\n locale: initialLocale,\n fallbackLocale,\n messages,\n storageKey = \"tempest-locale\",\n}: I18nProviderProps) {\n const availableLocales = useMemo(() => Object.keys(messages), [messages]);\n const [locale, setLocaleState] = useState<string>(\n () => readStored(storageKey, availableLocales) ?? initialLocale,\n );\n\n useEffect(() => {\n if (typeof document !== \"undefined\") {\n document.documentElement.setAttribute(\"lang\", locale);\n }\n }, [locale]);\n\n const setLocale = useCallback(\n (next: string) => {\n setLocaleState(next);\n if (storageKey && typeof window !== \"undefined\") {\n try {\n window.localStorage.setItem(storageKey, next);\n } catch {\n /* empty */\n }\n }\n },\n [storageKey],\n );\n\n const value = useMemo<I18nContextValue>(() => {\n const i18n = createI18n({ locale, fallbackLocale, messages });\n return { ...i18n, setLocale, availableLocales };\n }, [locale, fallbackLocale, messages, setLocale, availableLocales]);\n\n return <I18nContext.Provider value={value}>{children}</I18nContext.Provider>;\n}\n\n/**\n * Access translation helpers. Must be used inside an {@link I18nProvider}.\n */\nexport function useI18n(): I18nContextValue {\n const ctx = useContext(I18nContext);\n if (!ctx) throw new Error(\"useI18n must be used inside an <I18nProvider>\");\n return ctx;\n}\n\n/**\n * Access translation helpers when there may be no {@link I18nProvider} above.\n *\n * Returns `null` instead of throwing, which is what a piece of the SDK needs\n * when it wants to be translated where a catalog exists and still work where one\n * does not — i18n is opt-in in this SDK, and a helper that demanded a provider\n * would turn \"you did not configure translations\" into a crash.\n *\n * @returns The context value, or `null` outside a provider.\n */\nexport function useOptionalI18n(): I18nContextValue | null {\n return useContext(I18nContext);\n}\n\n/**\n * Shortcut for components that only need the `t` function — avoids destructuring.\n */\nexport function useTranslate(): I18nContextValue[\"t\"] {\n return useI18n().t;\n}\n"],"mappings":"2FAWA,
|
|
1
|
+
{"version":3,"file":"I18nProvider.cjs","names":["createContext","useMemo","useState","useCallback","createI18n","useContext","require_create_i18n","react","react_jsx_runtime","I18nContext","readStored","storageKey","value","available","I18nProvider","initialLocale","availableLocales","messages","locale","setLocaleState","setLocale","next","fallbackLocale","useI18n","ctx","useOptionalI18n","useTranslate"],"sources":["../../src/i18n/I18nProvider.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useEffect, useMemo, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { createI18n, type Catalog, type I18n } from \"./create-i18n\";\n\nexport interface I18nContextValue extends I18n {\n /** Switch the active locale. Persisted when `storageKey` is set. */\n setLocale: (locale: string) => void;\n /** Locales available in the catalog. */\n availableLocales: string[];\n}\n\nconst I18nContext = createContext<I18nContextValue | null>(null);\n\nexport interface I18nProviderProps {\n children: ReactNode;\n /** Initial locale. */\n locale: string;\n /** Fallback locale used when a key is missing. */\n fallbackLocale?: string;\n /** Translation catalog. */\n messages: Catalog;\n /** localStorage key for persisting the user choice. Pass `null` to disable. Default: `\"tempest-locale\"`. */\n storageKey?: string | null;\n}\n\nfunction readStored(storageKey: string | null, available: string[]): string | null {\n if (!storageKey || typeof window === \"undefined\") return null;\n try {\n const value = window.localStorage.getItem(storageKey);\n if (value && available.includes(value)) return value;\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * React provider for the SDK's lightweight i18n. Exposes the translation\n * helpers and a `setLocale` setter to children.\n *\n * @tempest-limits empty-catch — remembering the chosen locale is best-effort. The\n * switch itself is React state and already happened by the time the write runs, so\n * a storage failure costs the preference on the next load and nothing in this one.\n */\nexport function I18nProvider({\n children,\n locale: initialLocale,\n fallbackLocale,\n messages,\n storageKey = \"tempest-locale\",\n}: I18nProviderProps) {\n const availableLocales = useMemo(() => Object.keys(messages), [messages]);\n const [locale, setLocaleState] = useState<string>(\n () => readStored(storageKey, availableLocales) ?? initialLocale,\n );\n\n useEffect(() => {\n if (typeof document !== \"undefined\") {\n document.documentElement.setAttribute(\"lang\", locale);\n }\n }, [locale]);\n\n const setLocale = useCallback(\n (next: string) => {\n setLocaleState(next);\n if (storageKey && typeof window !== \"undefined\") {\n try {\n window.localStorage.setItem(storageKey, next);\n } catch {\n /* empty */\n }\n }\n },\n [storageKey],\n );\n\n const value = useMemo<I18nContextValue>(() => {\n const i18n = createI18n({ locale, fallbackLocale, messages });\n return { ...i18n, setLocale, availableLocales };\n }, [locale, fallbackLocale, messages, setLocale, availableLocales]);\n\n return <I18nContext.Provider value={value}>{children}</I18nContext.Provider>;\n}\n\n/**\n * Access translation helpers. Must be used inside an {@link I18nProvider}.\n */\nexport function useI18n(): I18nContextValue {\n const ctx = useContext(I18nContext);\n if (!ctx) throw new Error(\"useI18n must be used inside an <I18nProvider>\");\n return ctx;\n}\n\n/**\n * Access translation helpers when there may be no {@link I18nProvider} above.\n *\n * Returns `null` instead of throwing, which is what a piece of the SDK needs\n * when it wants to be translated where a catalog exists and still work where one\n * does not — i18n is opt-in in this SDK, and a helper that demanded a provider\n * would turn \"you did not configure translations\" into a crash.\n *\n * @returns The context value, or `null` outside a provider.\n */\nexport function useOptionalI18n(): I18nContextValue | null {\n return useContext(I18nContext);\n}\n\n/**\n * Shortcut for components that only need the `t` function — avoids destructuring.\n */\nexport function useTranslate(): I18nContextValue[\"t\"] {\n return useI18n().t;\n}\n"],"mappings":"A,2FAWA,IAAMS,GAAA,EAAcT,EAAAA,cAAAA,CAAuC,IAAI,EAc/D,SAASU,EAAW,EAA2B,EAAoC,CAC/E,GAAI,CAACC,GAAc,OAAO,OAAW,IAAa,OAAO,KACzD,GAAI,CACA,IAAMC,EAAQ,OAAO,aAAa,QAAQD,CAAU,EAEpD,OADIC,GAASC,EAAU,SAASD,CAAK,EAAUA,EACxC,IACX,MAAQ,CACJ,OAAO,IACX,CACJ,CAUA,SAAgBE,EAAa,CACzB,WACA,OAAQC,EACR,iBACA,WACA,aAAa,kBACK,CAClB,IAAMC,GAAA,EAAmBf,EAAAA,QAAAA,KAAc,OAAO,KAAKgB,CAAQ,EAAG,CAACA,CAAQ,CAAC,EAClE,CAACC,EAAQC,IAAA,EAAkBjB,EAAAA,SAAAA,KACvBQ,EAAWC,EAAYK,CAAgB,GAAKD,CACtD,GAEA,EAAAR,EAAA,UAAA,KAAgB,CACR,OAAO,SAAa,KACpB,SAAS,gBAAgB,aAAa,OAAQW,CAAM,CAE5D,EAAG,CAACA,CAAM,CAAC,EAEX,IAAME,GAAA,EAAYjB,EAAAA,YAAAA,CACb,GAAiB,CAEd,GADAgB,EAAeE,CAAI,EACfV,GAAc,OAAO,OAAW,IAChC,GAAI,CACA,OAAO,aAAa,QAAQA,EAAYU,CAAI,CAChD,MAAQ,CAER,CAER,EACA,CAACV,CAAU,CACf,EAEMC,GAAA,EAAQX,EAAAA,QAAAA,MAEH,CAAE,GADIG,EAAAA,WAAW,CAAE,SAAQ,iBAAgB,UAAS,CAC/C,EAAM,YAAW,kBAAiB,GAC/C,CAACc,EAAQI,EAAgBL,EAAUG,EAAWJ,CAAgB,CAAC,EAElE,OAAO,EAAAR,EAAA,IAAA,CAACC,EAAY,SAAb,CAA6B,QAAQ,UAA+B,CAAA,CAC/E,CAKA,SAAgBc,GAA4B,CACxC,IAAMC,GAAA,EAAMnB,EAAAA,WAAAA,CAAWI,CAAW,EAClC,GAAI,CAACe,EAAK,MAAU,MAAM,+CAA+C,EACzE,OAAOA,CACX,CAYA,SAAgBC,GAA2C,CACvD,OAAA,EAAOpB,EAAAA,WAAAA,CAAWI,CAAW,CACjC,CAKA,SAAgBiB,GAAsC,CAClD,OAAOH,EAAQ,CAAC,CAAC,CACrB,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"I18nProvider.js","names":[],"sources":["../../src/i18n/I18nProvider.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useEffect, useMemo, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { createI18n, type Catalog, type I18n } from \"./create-i18n\";\n\nexport interface I18nContextValue extends I18n {\n /** Switch the active locale. Persisted when `storageKey` is set. */\n setLocale: (locale: string) => void;\n /** Locales available in the catalog. */\n availableLocales: string[];\n}\n\nconst I18nContext = createContext<I18nContextValue | null>(null);\n\nexport interface I18nProviderProps {\n children: ReactNode;\n /** Initial locale. */\n locale: string;\n /** Fallback locale used when a key is missing. */\n fallbackLocale?: string;\n /** Translation catalog. */\n messages: Catalog;\n /** localStorage key for persisting the user choice. Pass `null` to disable. Default: `\"tempest-locale\"`. */\n storageKey?: string | null;\n}\n\nfunction readStored(storageKey: string | null, available: string[]): string | null {\n if (!storageKey || typeof window === \"undefined\") return null;\n try {\n const value = window.localStorage.getItem(storageKey);\n if (value && available.includes(value)) return value;\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * React provider for the SDK's lightweight i18n. Exposes the translation\n * helpers and a `setLocale` setter to children.\n *\n * @tempest-limits empty-catch — remembering the chosen locale is best-effort. The\n * switch itself is React state and already happened by the time the write runs, so\n * a storage failure costs the preference on the next load and nothing in this one.\n */\nexport function I18nProvider({\n children,\n locale: initialLocale,\n fallbackLocale,\n messages,\n storageKey = \"tempest-locale\",\n}: I18nProviderProps) {\n const availableLocales = useMemo(() => Object.keys(messages), [messages]);\n const [locale, setLocaleState] = useState<string>(\n () => readStored(storageKey, availableLocales) ?? initialLocale,\n );\n\n useEffect(() => {\n if (typeof document !== \"undefined\") {\n document.documentElement.setAttribute(\"lang\", locale);\n }\n }, [locale]);\n\n const setLocale = useCallback(\n (next: string) => {\n setLocaleState(next);\n if (storageKey && typeof window !== \"undefined\") {\n try {\n window.localStorage.setItem(storageKey, next);\n } catch {\n /* empty */\n }\n }\n },\n [storageKey],\n );\n\n const value = useMemo<I18nContextValue>(() => {\n const i18n = createI18n({ locale, fallbackLocale, messages });\n return { ...i18n, setLocale, availableLocales };\n }, [locale, fallbackLocale, messages, setLocale, availableLocales]);\n\n return <I18nContext.Provider value={value}>{children}</I18nContext.Provider>;\n}\n\n/**\n * Access translation helpers. Must be used inside an {@link I18nProvider}.\n */\nexport function useI18n(): I18nContextValue {\n const ctx = useContext(I18nContext);\n if (!ctx) throw new Error(\"useI18n must be used inside an <I18nProvider>\");\n return ctx;\n}\n\n/**\n * Access translation helpers when there may be no {@link I18nProvider} above.\n *\n * Returns `null` instead of throwing, which is what a piece of the SDK needs\n * when it wants to be translated where a catalog exists and still work where one\n * does not — i18n is opt-in in this SDK, and a helper that demanded a provider\n * would turn \"you did not configure translations\" into a crash.\n *\n * @returns The context value, or `null` outside a provider.\n */\nexport function useOptionalI18n(): I18nContextValue | null {\n return useContext(I18nContext);\n}\n\n/**\n * Shortcut for components that only need the `t` function — avoids destructuring.\n */\nexport function useTranslate(): I18nContextValue[\"t\"] {\n return useI18n().t;\n}\n"],"mappings":";;;;AAWA,
|
|
1
|
+
{"version":3,"file":"I18nProvider.js","names":["I18nContext","createContext","readStored","storageKey","value","available","I18nProvider","initialLocale","availableLocales","useMemo","messages","locale","setLocaleState","useState","setLocale","useCallback","next","createI18n","fallbackLocale","useI18n","ctx","useContext","useOptionalI18n","useTranslate"],"sources":["../../src/i18n/I18nProvider.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useEffect, useMemo, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { createI18n, type Catalog, type I18n } from \"./create-i18n\";\n\nexport interface I18nContextValue extends I18n {\n /** Switch the active locale. Persisted when `storageKey` is set. */\n setLocale: (locale: string) => void;\n /** Locales available in the catalog. */\n availableLocales: string[];\n}\n\nconst I18nContext = createContext<I18nContextValue | null>(null);\n\nexport interface I18nProviderProps {\n children: ReactNode;\n /** Initial locale. */\n locale: string;\n /** Fallback locale used when a key is missing. */\n fallbackLocale?: string;\n /** Translation catalog. */\n messages: Catalog;\n /** localStorage key for persisting the user choice. Pass `null` to disable. Default: `\"tempest-locale\"`. */\n storageKey?: string | null;\n}\n\nfunction readStored(storageKey: string | null, available: string[]): string | null {\n if (!storageKey || typeof window === \"undefined\") return null;\n try {\n const value = window.localStorage.getItem(storageKey);\n if (value && available.includes(value)) return value;\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * React provider for the SDK's lightweight i18n. Exposes the translation\n * helpers and a `setLocale` setter to children.\n *\n * @tempest-limits empty-catch — remembering the chosen locale is best-effort. The\n * switch itself is React state and already happened by the time the write runs, so\n * a storage failure costs the preference on the next load and nothing in this one.\n */\nexport function I18nProvider({\n children,\n locale: initialLocale,\n fallbackLocale,\n messages,\n storageKey = \"tempest-locale\",\n}: I18nProviderProps) {\n const availableLocales = useMemo(() => Object.keys(messages), [messages]);\n const [locale, setLocaleState] = useState<string>(\n () => readStored(storageKey, availableLocales) ?? initialLocale,\n );\n\n useEffect(() => {\n if (typeof document !== \"undefined\") {\n document.documentElement.setAttribute(\"lang\", locale);\n }\n }, [locale]);\n\n const setLocale = useCallback(\n (next: string) => {\n setLocaleState(next);\n if (storageKey && typeof window !== \"undefined\") {\n try {\n window.localStorage.setItem(storageKey, next);\n } catch {\n /* empty */\n }\n }\n },\n [storageKey],\n );\n\n const value = useMemo<I18nContextValue>(() => {\n const i18n = createI18n({ locale, fallbackLocale, messages });\n return { ...i18n, setLocale, availableLocales };\n }, [locale, fallbackLocale, messages, setLocale, availableLocales]);\n\n return <I18nContext.Provider value={value}>{children}</I18nContext.Provider>;\n}\n\n/**\n * Access translation helpers. Must be used inside an {@link I18nProvider}.\n */\nexport function useI18n(): I18nContextValue {\n const ctx = useContext(I18nContext);\n if (!ctx) throw new Error(\"useI18n must be used inside an <I18nProvider>\");\n return ctx;\n}\n\n/**\n * Access translation helpers when there may be no {@link I18nProvider} above.\n *\n * Returns `null` instead of throwing, which is what a piece of the SDK needs\n * when it wants to be translated where a catalog exists and still work where one\n * does not — i18n is opt-in in this SDK, and a helper that demanded a provider\n * would turn \"you did not configure translations\" into a crash.\n *\n * @returns The context value, or `null` outside a provider.\n */\nexport function useOptionalI18n(): I18nContextValue | null {\n return useContext(I18nContext);\n}\n\n/**\n * Shortcut for components that only need the `t` function — avoids destructuring.\n */\nexport function useTranslate(): I18nContextValue[\"t\"] {\n return useI18n().t;\n}\n"],"mappings":";;;;AAWA,IAAMA,IAAcC,EAAuC,IAAI;AAc/D,SAASC,EAAW,GAA2B,GAAoC;CAC/E,IAAI,CAACC,KAAc,OAAO,SAAW,KAAa,OAAO;CACzD,IAAI;EACA,IAAMC,IAAQ,OAAO,aAAa,QAAQD,CAAU;EAEpD,OADIC,KAASC,EAAU,SAASD,CAAK,IAAUA,IACxC;CACX,QAAQ;EACJ,OAAO;CACX;AACJ;AAUA,SAAgBE,EAAa,EACzB,aACA,QAAQC,GACR,mBACA,aACA,gBAAa,oBACK;CAClB,IAAMC,IAAmBC,QAAc,OAAO,KAAKC,CAAQ,GAAG,CAACA,CAAQ,CAAC,GAClE,CAACC,GAAQC,KAAkBC,QACvBX,EAAWC,GAAYK,CAAgB,KAAKD,CACtD;CAEA,QAAgB;EACZ,AAAI,OAAO,WAAa,OACpB,SAAS,gBAAgB,aAAa,QAAQI,CAAM;CAE5D,GAAG,CAACA,CAAM,CAAC;CAEX,IAAMG,IAAYC,GACb,MAAiB;EAEd,IADAH,EAAeI,CAAI,GACfb,KAAc,OAAO,SAAW,KAChC,IAAI;GACA,OAAO,aAAa,QAAQA,GAAYa,CAAI;EAChD,QAAQ,CAER;CAER,GACA,CAACb,CAAU,CACf,GAEMC,IAAQK,SAEH;EAAE,GADIQ,EAAW;GAAE;GAAQ;GAAgB;EAAS,CAC/C;EAAM;EAAW;CAAiB,IAC/C;EAACN;EAAQO;EAAgBR;EAAUI;EAAWN;CAAgB,CAAC;CAElE,OAAO,kBAACR,EAAY,UAAb;EAA6B;EAAQ;CAA+B,CAAA;AAC/E;AAKA,SAAgBmB,IAA4B;CACxC,IAAMC,IAAMC,EAAWrB,CAAW;CAClC,IAAI,CAACoB,GAAK,MAAU,MAAM,+CAA+C;CACzE,OAAOA;AACX;AAYA,SAAgBE,IAA2C;CACvD,OAAOD,EAAWrB,CAAW;AACjC;AAKA,SAAgBuB,IAAsC;CAClD,OAAOJ,EAAQ,CAAC,CAAC;AACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-i18n.cjs","names":[],"sources":["../../src/i18n/create-i18n.ts"],"sourcesContent":["import { dateTimeFormat, numberFormat } from \"@/utils/intl-cache\";\nexport type Messages = Record<string, string>;\nexport type Catalog = Record<string, Messages>;\nexport type InterpolationValues = Record<string, string | number>;\n\nexport interface CreateI18nOptions {\n /** Initial locale. */\n locale: string;\n /** Fallback locale used when a key is missing in the active locale. */\n fallbackLocale?: string;\n /** Catalog `{ [locale]: { [key]: \"...\" } }`. */\n messages: Catalog;\n}\n\n/** Per-call options for {@link I18n.t} and {@link I18n.plural}. */\nexport interface TranslateOptions {\n /**\n * Text to use when the catalog defines neither the key nor its fallback.\n *\n * Without this, a miss returns the key, and a caller that wants its own text\n * instead has to *detect* the miss — which from the outside means comparing\n * the result against the key it just passed in. That heuristic is wrong for a\n * catalog that legitimately maps a key to itself, and it is what every\n * translatable string the SDK ships would otherwise have to copy.\n *\n * Interpolated like any other message, so a default carries `{placeholders}`\n * too and is not second-class.\n */\n default?: string;\n}\n\nexport interface I18n {\n /** Currently active locale. */\n locale: string;\n /** Fallback locale (or `null` when not configured). */\n fallbackLocale: string | null;\n /**\n * Translate `key`, interpolating `{name}` placeholders from `params`.\n * Falls back to the configured fallback locale, then to `options.default`,\n * then to the key itself.\n */\n t: (key: string, params?: InterpolationValues, options?: TranslateOptions) => string;\n /**\n * Plural-aware translation. Tries `${key}_one` for `count === 1` and\n * `${key}_other` otherwise, with `{count}` available for interpolation.\n * Falls back to `options.default`, then to the key itself.\n */\n plural: (\n key: string,\n count: number,\n params?: InterpolationValues,\n options?: TranslateOptions,\n ) => string;\n /** Format a number using `Intl.NumberFormat` on the active locale. */\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n /** Format a Date using `Intl.DateTimeFormat` on the active locale. */\n formatDate: (value: Date | string, options?: Intl.DateTimeFormatOptions) => string;\n /** Build a new `I18n` instance pointing at a different locale. */\n withLocale: (locale: string) => I18n;\n}\n\nfunction interpolate(template: string, params?: InterpolationValues): string {\n if (!params) return template;\n return template.replace(/\\{(\\w+)\\}/g, (_match, name: string) => {\n const value = params[name];\n return value === undefined ? `{${name}}` : String(value);\n });\n}\n\nfunction lookup(\n catalog: Catalog,\n locale: string,\n fallback: string | null,\n key: string,\n): string | null {\n const direct = catalog[locale]?.[key];\n if (direct !== undefined) return direct;\n if (fallback) {\n const fallbackValue = catalog[fallback]?.[key];\n if (fallbackValue !== undefined) return fallbackValue;\n }\n return null;\n}\n\n/**\n * Create an i18n object with translation, pluralization and Intl helpers.\n *\n * The catalog is a plain `{ [locale]: { [key]: \"...\" } }` map — bring your\n * own keys, namespaces, or nested-key conventions. The SDK does not enforce\n * a schema so you can plug it into any string-loading pipeline.\n *\n * @example\n * const i18n = createI18n({\n * locale: \"pt-BR\",\n * fallbackLocale: \"en\",\n * messages: {\n * \"pt-BR\": {\n * \"greet\": \"Olá, {name}\",\n * \"alos_one\": \"{count} Alô\",\n * \"alos_other\": \"{count} Alôs\",\n * },\n * \"en\": { greet: \"Hi, {name}\", alos_one: \"{count} Alo\", alos_other: \"{count} Alos\" },\n * },\n * });\n * i18n.t(\"greet\", { name: \"Mau\" }); // \"Olá, Mau\"\n * i18n.plural(\"alos\", 3); // \"3 Alôs\"\n *\n * @example\n * // A key the catalog does not define, with text to show instead of the key.\n * i18n.t(\"cart.empty\", undefined, { default: \"Seu carrinho está vazio\" });\n */\nexport function createI18n(options: CreateI18nOptions): I18n {\n const { locale, fallbackLocale = null, messages } = options;\n\n function t(key: string, params?: InterpolationValues, options?: TranslateOptions): string {\n const template = lookup(messages, locale, fallbackLocale, key) ?? options?.default;\n if (template === undefined) return key;\n return interpolate(template, params);\n }\n\n function plural(\n key: string,\n count: number,\n params?: InterpolationValues,\n options?: TranslateOptions,\n ): string {\n const suffix = count === 1 ? \"_one\" : \"_other\";\n const template =\n lookup(messages, locale, fallbackLocale, `${key}${suffix}`) ??\n lookup(messages, locale, fallbackLocale, key) ??\n options?.default;\n if (template === undefined) return key;\n return interpolate(template, { count, ...(params ?? {}) });\n }\n\n function formatNumber(value: number, opts?: Intl.NumberFormatOptions): string {\n return numberFormat(locale, opts).format(value);\n }\n\n function formatDate(value: Date | string, opts?: Intl.DateTimeFormatOptions): string {\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(locale, opts).format(date);\n }\n\n return {\n locale,\n fallbackLocale,\n t,\n plural,\n formatNumber,\n formatDate,\n withLocale: (nextLocale) =>\n createI18n({\n locale: nextLocale,\n fallbackLocale: fallbackLocale ?? undefined,\n messages,\n }),\n };\n}\n"],"mappings":"2CA6DA,
|
|
1
|
+
{"version":3,"file":"create-i18n.cjs","names":["numberFormat","dateTimeFormat","require_intl_cache","interpolate","params","template","value","name","lookup","direct","catalog","locale","key","fallback","fallbackValue","createI18n","options","t","messages","fallbackLocale","plural","count","formatNumber","opts","formatDate","date","nextLocale"],"sources":["../../src/i18n/create-i18n.ts"],"sourcesContent":["import { dateTimeFormat, numberFormat } from \"@/utils/intl-cache\";\nexport type Messages = Record<string, string>;\nexport type Catalog = Record<string, Messages>;\nexport type InterpolationValues = Record<string, string | number>;\n\nexport interface CreateI18nOptions {\n /** Initial locale. */\n locale: string;\n /** Fallback locale used when a key is missing in the active locale. */\n fallbackLocale?: string;\n /** Catalog `{ [locale]: { [key]: \"...\" } }`. */\n messages: Catalog;\n}\n\n/** Per-call options for {@link I18n.t} and {@link I18n.plural}. */\nexport interface TranslateOptions {\n /**\n * Text to use when the catalog defines neither the key nor its fallback.\n *\n * Without this, a miss returns the key, and a caller that wants its own text\n * instead has to *detect* the miss — which from the outside means comparing\n * the result against the key it just passed in. That heuristic is wrong for a\n * catalog that legitimately maps a key to itself, and it is what every\n * translatable string the SDK ships would otherwise have to copy.\n *\n * Interpolated like any other message, so a default carries `{placeholders}`\n * too and is not second-class.\n */\n default?: string;\n}\n\nexport interface I18n {\n /** Currently active locale. */\n locale: string;\n /** Fallback locale (or `null` when not configured). */\n fallbackLocale: string | null;\n /**\n * Translate `key`, interpolating `{name}` placeholders from `params`.\n * Falls back to the configured fallback locale, then to `options.default`,\n * then to the key itself.\n */\n t: (key: string, params?: InterpolationValues, options?: TranslateOptions) => string;\n /**\n * Plural-aware translation. Tries `${key}_one` for `count === 1` and\n * `${key}_other` otherwise, with `{count}` available for interpolation.\n * Falls back to `options.default`, then to the key itself.\n */\n plural: (\n key: string,\n count: number,\n params?: InterpolationValues,\n options?: TranslateOptions,\n ) => string;\n /** Format a number using `Intl.NumberFormat` on the active locale. */\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n /** Format a Date using `Intl.DateTimeFormat` on the active locale. */\n formatDate: (value: Date | string, options?: Intl.DateTimeFormatOptions) => string;\n /** Build a new `I18n` instance pointing at a different locale. */\n withLocale: (locale: string) => I18n;\n}\n\nfunction interpolate(template: string, params?: InterpolationValues): string {\n if (!params) return template;\n return template.replace(/\\{(\\w+)\\}/g, (_match, name: string) => {\n const value = params[name];\n return value === undefined ? `{${name}}` : String(value);\n });\n}\n\nfunction lookup(\n catalog: Catalog,\n locale: string,\n fallback: string | null,\n key: string,\n): string | null {\n const direct = catalog[locale]?.[key];\n if (direct !== undefined) return direct;\n if (fallback) {\n const fallbackValue = catalog[fallback]?.[key];\n if (fallbackValue !== undefined) return fallbackValue;\n }\n return null;\n}\n\n/**\n * Create an i18n object with translation, pluralization and Intl helpers.\n *\n * The catalog is a plain `{ [locale]: { [key]: \"...\" } }` map — bring your\n * own keys, namespaces, or nested-key conventions. The SDK does not enforce\n * a schema so you can plug it into any string-loading pipeline.\n *\n * @example\n * const i18n = createI18n({\n * locale: \"pt-BR\",\n * fallbackLocale: \"en\",\n * messages: {\n * \"pt-BR\": {\n * \"greet\": \"Olá, {name}\",\n * \"alos_one\": \"{count} Alô\",\n * \"alos_other\": \"{count} Alôs\",\n * },\n * \"en\": { greet: \"Hi, {name}\", alos_one: \"{count} Alo\", alos_other: \"{count} Alos\" },\n * },\n * });\n * i18n.t(\"greet\", { name: \"Mau\" }); // \"Olá, Mau\"\n * i18n.plural(\"alos\", 3); // \"3 Alôs\"\n *\n * @example\n * // A key the catalog does not define, with text to show instead of the key.\n * i18n.t(\"cart.empty\", undefined, { default: \"Seu carrinho está vazio\" });\n */\nexport function createI18n(options: CreateI18nOptions): I18n {\n const { locale, fallbackLocale = null, messages } = options;\n\n function t(key: string, params?: InterpolationValues, options?: TranslateOptions): string {\n const template = lookup(messages, locale, fallbackLocale, key) ?? options?.default;\n if (template === undefined) return key;\n return interpolate(template, params);\n }\n\n function plural(\n key: string,\n count: number,\n params?: InterpolationValues,\n options?: TranslateOptions,\n ): string {\n const suffix = count === 1 ? \"_one\" : \"_other\";\n const template =\n lookup(messages, locale, fallbackLocale, `${key}${suffix}`) ??\n lookup(messages, locale, fallbackLocale, key) ??\n options?.default;\n if (template === undefined) return key;\n return interpolate(template, { count, ...(params ?? {}) });\n }\n\n function formatNumber(value: number, opts?: Intl.NumberFormatOptions): string {\n return numberFormat(locale, opts).format(value);\n }\n\n function formatDate(value: Date | string, opts?: Intl.DateTimeFormatOptions): string {\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(locale, opts).format(date);\n }\n\n return {\n locale,\n fallbackLocale,\n t,\n plural,\n formatNumber,\n formatDate,\n withLocale: (nextLocale) =>\n createI18n({\n locale: nextLocale,\n fallbackLocale: fallbackLocale ?? undefined,\n messages,\n }),\n };\n}\n"],"mappings":"A,2CA6DA,SAASG,EAAY,EAAkB,EAAsC,CAEzE,OADKC,EACEC,EAAS,QAAQ,cAAe,EAAQ,IAAiB,CAC5D,IAAMC,EAAQF,EAAOG,GACrB,OAAOD,IAAU,IAAA,GAAY,IAAIC,EAAK,GAAK,OAAOD,CAAK,CAC3D,CAAC,EAJmBD,CAKxB,CAEA,SAASG,EACL,EACA,EACA,EACA,EACa,CACb,IAAMC,EAASC,EAAQC,EAAO,GAAGC,GACjC,GAAIH,IAAW,IAAA,GAAW,OAAOA,EACjC,GAAII,EAAU,CACV,IAAMC,EAAgBJ,EAAQG,EAAS,GAAGD,GAC1C,GAAIE,IAAkB,IAAA,GAAW,OAAOA,CAC5C,CACA,OAAO,IACX,CA6BA,SAAgBC,EAAW,EAAkC,CACzD,GAAM,CAAE,SAAQ,iBAAiB,KAAM,YAAaC,EAEpD,SAASC,EAAE,EAAa,EAA8B,EAAoC,CACtF,IAAMZ,EAAWG,EAAOU,EAAUP,EAAQQ,EAAgBP,CAAG,GAAKI,GAAS,QAE3E,OADIX,IAAa,IAAA,GAAkBO,EAC5BT,EAAYE,EAAUD,CAAM,CACvC,CAEA,SAASgB,EACL,EACA,EACA,EACA,EACM,CAEN,IAAMf,EACFG,EAAOU,EAAUP,EAAQQ,EAAgB,GAAGP,IAFjCS,IAAU,EAAI,OAAS,UAEwB,GAC1Db,EAAOU,EAAUP,EAAQQ,EAAgBP,CAAG,GAC5CI,GAAS,QAEb,OADIX,IAAa,IAAA,GAAkBO,EAC5BT,EAAYE,EAAU,CAAE,QAAO,GAAID,GAAU,CAAC,CAAG,CAAC,CAC7D,CAEA,SAASkB,EAAa,EAAe,EAAyC,CAC1E,OAAOtB,EAAAA,aAAaW,EAAQY,CAAI,CAAC,CAAC,OAAOjB,CAAK,CAClD,CAEA,SAASkB,EAAW,EAAsB,EAA2C,CACjF,IAAMC,EAAO,OAAOnB,GAAU,SAAW,IAAI,KAAKA,CAAK,EAAIA,EAE3D,OADI,OAAO,MAAMmB,EAAK,QAAQ,CAAC,EAAU,GAClCxB,EAAAA,eAAeU,EAAQY,CAAI,CAAC,CAAC,OAAOE,CAAI,CACnD,CAEA,MAAO,CACH,SACA,iBACA,IACA,SACA,eACA,aACA,WAAa,GACTV,EAAW,CACP,OAAQW,EACR,eAAgBP,GAAkB,IAAA,GAClC,UACJ,CAAC,CACT,CACJ,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-i18n.js","names":[],"sources":["../../src/i18n/create-i18n.ts"],"sourcesContent":["import { dateTimeFormat, numberFormat } from \"@/utils/intl-cache\";\nexport type Messages = Record<string, string>;\nexport type Catalog = Record<string, Messages>;\nexport type InterpolationValues = Record<string, string | number>;\n\nexport interface CreateI18nOptions {\n /** Initial locale. */\n locale: string;\n /** Fallback locale used when a key is missing in the active locale. */\n fallbackLocale?: string;\n /** Catalog `{ [locale]: { [key]: \"...\" } }`. */\n messages: Catalog;\n}\n\n/** Per-call options for {@link I18n.t} and {@link I18n.plural}. */\nexport interface TranslateOptions {\n /**\n * Text to use when the catalog defines neither the key nor its fallback.\n *\n * Without this, a miss returns the key, and a caller that wants its own text\n * instead has to *detect* the miss — which from the outside means comparing\n * the result against the key it just passed in. That heuristic is wrong for a\n * catalog that legitimately maps a key to itself, and it is what every\n * translatable string the SDK ships would otherwise have to copy.\n *\n * Interpolated like any other message, so a default carries `{placeholders}`\n * too and is not second-class.\n */\n default?: string;\n}\n\nexport interface I18n {\n /** Currently active locale. */\n locale: string;\n /** Fallback locale (or `null` when not configured). */\n fallbackLocale: string | null;\n /**\n * Translate `key`, interpolating `{name}` placeholders from `params`.\n * Falls back to the configured fallback locale, then to `options.default`,\n * then to the key itself.\n */\n t: (key: string, params?: InterpolationValues, options?: TranslateOptions) => string;\n /**\n * Plural-aware translation. Tries `${key}_one` for `count === 1` and\n * `${key}_other` otherwise, with `{count}` available for interpolation.\n * Falls back to `options.default`, then to the key itself.\n */\n plural: (\n key: string,\n count: number,\n params?: InterpolationValues,\n options?: TranslateOptions,\n ) => string;\n /** Format a number using `Intl.NumberFormat` on the active locale. */\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n /** Format a Date using `Intl.DateTimeFormat` on the active locale. */\n formatDate: (value: Date | string, options?: Intl.DateTimeFormatOptions) => string;\n /** Build a new `I18n` instance pointing at a different locale. */\n withLocale: (locale: string) => I18n;\n}\n\nfunction interpolate(template: string, params?: InterpolationValues): string {\n if (!params) return template;\n return template.replace(/\\{(\\w+)\\}/g, (_match, name: string) => {\n const value = params[name];\n return value === undefined ? `{${name}}` : String(value);\n });\n}\n\nfunction lookup(\n catalog: Catalog,\n locale: string,\n fallback: string | null,\n key: string,\n): string | null {\n const direct = catalog[locale]?.[key];\n if (direct !== undefined) return direct;\n if (fallback) {\n const fallbackValue = catalog[fallback]?.[key];\n if (fallbackValue !== undefined) return fallbackValue;\n }\n return null;\n}\n\n/**\n * Create an i18n object with translation, pluralization and Intl helpers.\n *\n * The catalog is a plain `{ [locale]: { [key]: \"...\" } }` map — bring your\n * own keys, namespaces, or nested-key conventions. The SDK does not enforce\n * a schema so you can plug it into any string-loading pipeline.\n *\n * @example\n * const i18n = createI18n({\n * locale: \"pt-BR\",\n * fallbackLocale: \"en\",\n * messages: {\n * \"pt-BR\": {\n * \"greet\": \"Olá, {name}\",\n * \"alos_one\": \"{count} Alô\",\n * \"alos_other\": \"{count} Alôs\",\n * },\n * \"en\": { greet: \"Hi, {name}\", alos_one: \"{count} Alo\", alos_other: \"{count} Alos\" },\n * },\n * });\n * i18n.t(\"greet\", { name: \"Mau\" }); // \"Olá, Mau\"\n * i18n.plural(\"alos\", 3); // \"3 Alôs\"\n *\n * @example\n * // A key the catalog does not define, with text to show instead of the key.\n * i18n.t(\"cart.empty\", undefined, { default: \"Seu carrinho está vazio\" });\n */\nexport function createI18n(options: CreateI18nOptions): I18n {\n const { locale, fallbackLocale = null, messages } = options;\n\n function t(key: string, params?: InterpolationValues, options?: TranslateOptions): string {\n const template = lookup(messages, locale, fallbackLocale, key) ?? options?.default;\n if (template === undefined) return key;\n return interpolate(template, params);\n }\n\n function plural(\n key: string,\n count: number,\n params?: InterpolationValues,\n options?: TranslateOptions,\n ): string {\n const suffix = count === 1 ? \"_one\" : \"_other\";\n const template =\n lookup(messages, locale, fallbackLocale, `${key}${suffix}`) ??\n lookup(messages, locale, fallbackLocale, key) ??\n options?.default;\n if (template === undefined) return key;\n return interpolate(template, { count, ...(params ?? {}) });\n }\n\n function formatNumber(value: number, opts?: Intl.NumberFormatOptions): string {\n return numberFormat(locale, opts).format(value);\n }\n\n function formatDate(value: Date | string, opts?: Intl.DateTimeFormatOptions): string {\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(locale, opts).format(date);\n }\n\n return {\n locale,\n fallbackLocale,\n t,\n plural,\n formatNumber,\n formatDate,\n withLocale: (nextLocale) =>\n createI18n({\n locale: nextLocale,\n fallbackLocale: fallbackLocale ?? undefined,\n messages,\n }),\n };\n}\n"],"mappings":";;AA6DA,
|
|
1
|
+
{"version":3,"file":"create-i18n.js","names":["interpolate","params","template","value","name","lookup","direct","catalog","locale","key","fallback","fallbackValue","createI18n","options","t","messages","fallbackLocale","plural","count","formatNumber","numberFormat","opts","formatDate","date","dateTimeFormat","nextLocale"],"sources":["../../src/i18n/create-i18n.ts"],"sourcesContent":["import { dateTimeFormat, numberFormat } from \"@/utils/intl-cache\";\nexport type Messages = Record<string, string>;\nexport type Catalog = Record<string, Messages>;\nexport type InterpolationValues = Record<string, string | number>;\n\nexport interface CreateI18nOptions {\n /** Initial locale. */\n locale: string;\n /** Fallback locale used when a key is missing in the active locale. */\n fallbackLocale?: string;\n /** Catalog `{ [locale]: { [key]: \"...\" } }`. */\n messages: Catalog;\n}\n\n/** Per-call options for {@link I18n.t} and {@link I18n.plural}. */\nexport interface TranslateOptions {\n /**\n * Text to use when the catalog defines neither the key nor its fallback.\n *\n * Without this, a miss returns the key, and a caller that wants its own text\n * instead has to *detect* the miss — which from the outside means comparing\n * the result against the key it just passed in. That heuristic is wrong for a\n * catalog that legitimately maps a key to itself, and it is what every\n * translatable string the SDK ships would otherwise have to copy.\n *\n * Interpolated like any other message, so a default carries `{placeholders}`\n * too and is not second-class.\n */\n default?: string;\n}\n\nexport interface I18n {\n /** Currently active locale. */\n locale: string;\n /** Fallback locale (or `null` when not configured). */\n fallbackLocale: string | null;\n /**\n * Translate `key`, interpolating `{name}` placeholders from `params`.\n * Falls back to the configured fallback locale, then to `options.default`,\n * then to the key itself.\n */\n t: (key: string, params?: InterpolationValues, options?: TranslateOptions) => string;\n /**\n * Plural-aware translation. Tries `${key}_one` for `count === 1` and\n * `${key}_other` otherwise, with `{count}` available for interpolation.\n * Falls back to `options.default`, then to the key itself.\n */\n plural: (\n key: string,\n count: number,\n params?: InterpolationValues,\n options?: TranslateOptions,\n ) => string;\n /** Format a number using `Intl.NumberFormat` on the active locale. */\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n /** Format a Date using `Intl.DateTimeFormat` on the active locale. */\n formatDate: (value: Date | string, options?: Intl.DateTimeFormatOptions) => string;\n /** Build a new `I18n` instance pointing at a different locale. */\n withLocale: (locale: string) => I18n;\n}\n\nfunction interpolate(template: string, params?: InterpolationValues): string {\n if (!params) return template;\n return template.replace(/\\{(\\w+)\\}/g, (_match, name: string) => {\n const value = params[name];\n return value === undefined ? `{${name}}` : String(value);\n });\n}\n\nfunction lookup(\n catalog: Catalog,\n locale: string,\n fallback: string | null,\n key: string,\n): string | null {\n const direct = catalog[locale]?.[key];\n if (direct !== undefined) return direct;\n if (fallback) {\n const fallbackValue = catalog[fallback]?.[key];\n if (fallbackValue !== undefined) return fallbackValue;\n }\n return null;\n}\n\n/**\n * Create an i18n object with translation, pluralization and Intl helpers.\n *\n * The catalog is a plain `{ [locale]: { [key]: \"...\" } }` map — bring your\n * own keys, namespaces, or nested-key conventions. The SDK does not enforce\n * a schema so you can plug it into any string-loading pipeline.\n *\n * @example\n * const i18n = createI18n({\n * locale: \"pt-BR\",\n * fallbackLocale: \"en\",\n * messages: {\n * \"pt-BR\": {\n * \"greet\": \"Olá, {name}\",\n * \"alos_one\": \"{count} Alô\",\n * \"alos_other\": \"{count} Alôs\",\n * },\n * \"en\": { greet: \"Hi, {name}\", alos_one: \"{count} Alo\", alos_other: \"{count} Alos\" },\n * },\n * });\n * i18n.t(\"greet\", { name: \"Mau\" }); // \"Olá, Mau\"\n * i18n.plural(\"alos\", 3); // \"3 Alôs\"\n *\n * @example\n * // A key the catalog does not define, with text to show instead of the key.\n * i18n.t(\"cart.empty\", undefined, { default: \"Seu carrinho está vazio\" });\n */\nexport function createI18n(options: CreateI18nOptions): I18n {\n const { locale, fallbackLocale = null, messages } = options;\n\n function t(key: string, params?: InterpolationValues, options?: TranslateOptions): string {\n const template = lookup(messages, locale, fallbackLocale, key) ?? options?.default;\n if (template === undefined) return key;\n return interpolate(template, params);\n }\n\n function plural(\n key: string,\n count: number,\n params?: InterpolationValues,\n options?: TranslateOptions,\n ): string {\n const suffix = count === 1 ? \"_one\" : \"_other\";\n const template =\n lookup(messages, locale, fallbackLocale, `${key}${suffix}`) ??\n lookup(messages, locale, fallbackLocale, key) ??\n options?.default;\n if (template === undefined) return key;\n return interpolate(template, { count, ...(params ?? {}) });\n }\n\n function formatNumber(value: number, opts?: Intl.NumberFormatOptions): string {\n return numberFormat(locale, opts).format(value);\n }\n\n function formatDate(value: Date | string, opts?: Intl.DateTimeFormatOptions): string {\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(locale, opts).format(date);\n }\n\n return {\n locale,\n fallbackLocale,\n t,\n plural,\n formatNumber,\n formatDate,\n withLocale: (nextLocale) =>\n createI18n({\n locale: nextLocale,\n fallbackLocale: fallbackLocale ?? undefined,\n messages,\n }),\n };\n}\n"],"mappings":";;AA6DA,SAASA,EAAY,GAAkB,GAAsC;CAEzE,OADKC,IACEC,EAAS,QAAQ,eAAe,GAAQ,MAAiB;EAC5D,IAAMC,IAAQF,EAAOG;EACrB,OAAOD,MAAU,KAAA,IAAY,IAAIC,EAAK,KAAK,OAAOD,CAAK;CAC3D,CAAC,IAJmBD;AAKxB;AAEA,SAASG,EACL,GACA,GACA,GACA,GACa;CACb,IAAMC,IAASC,EAAQC,EAAO,GAAGC;CACjC,IAAIH,MAAW,KAAA,GAAW,OAAOA;CACjC,IAAII,GAAU;EACV,IAAMC,IAAgBJ,EAAQG,EAAS,GAAGD;EAC1C,IAAIE,MAAkB,KAAA,GAAW,OAAOA;CAC5C;CACA,OAAO;AACX;AA6BA,SAAgBC,EAAW,GAAkC;CACzD,IAAM,EAAE,WAAQ,oBAAiB,MAAM,gBAAaC;CAEpD,SAASC,EAAE,GAAa,GAA8B,GAAoC;EACtF,IAAMZ,IAAWG,EAAOU,GAAUP,GAAQQ,GAAgBP,CAAG,KAAKI,GAAS;EAE3E,OADIX,MAAa,KAAA,IAAkBO,IAC5BT,EAAYE,GAAUD,CAAM;CACvC;CAEA,SAASgB,EACL,GACA,GACA,GACA,GACM;EAEN,IAAMf,IACFG,EAAOU,GAAUP,GAAQQ,GAAgB,GAAGP,IAFjCS,MAAU,IAAI,SAAS,UAEwB,KAC1Db,EAAOU,GAAUP,GAAQQ,GAAgBP,CAAG,KAC5CI,GAAS;EAEb,OADIX,MAAa,KAAA,IAAkBO,IAC5BT,EAAYE,GAAU;GAAE;GAAO,GAAID,KAAU,CAAC;EAAG,CAAC;CAC7D;CAEA,SAASkB,EAAa,GAAe,GAAyC;EAC1E,OAAOC,EAAaZ,GAAQa,CAAI,CAAC,CAAC,OAAOlB,CAAK;CAClD;CAEA,SAASmB,EAAW,GAAsB,GAA2C;EACjF,IAAMC,IAAO,OAAOpB,KAAU,WAAW,IAAI,KAAKA,CAAK,IAAIA;EAE3D,OADI,OAAO,MAAMoB,EAAK,QAAQ,CAAC,IAAU,KAClCC,EAAehB,GAAQa,CAAI,CAAC,CAAC,OAAOE,CAAI;CACnD;CAEA,OAAO;EACH;EACA;EACA;EACA;EACA;EACA;EACA,aAAa,MACTX,EAAW;GACP,QAAQa;GACR,gBAAgBT,KAAkB,KAAA;GAClC;EACJ,CAAC;CACT;AACJ"}
|
package/dist/icons/Icon.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.cjs","names":[],"sources":["../../src/icons/Icon.tsx"],"sourcesContent":["import { createElement, type ReactNode, type SVGProps } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\n\nimport type { IconName } from \"./generated/icon-name\";\nimport { useIconContext } from \"./icon-context\";\nimport { normalizeIconName } from \"./normalize-icon-name\";\nimport { iconStatus } from \"./shard-cache\";\nimport { useIcon } from \"./use-icon\";\nimport { isDevBuild } from \"../utils/dev-mode\";\n\ninterface IconBaseProps extends Omit<SVGProps<SVGSVGElement>, \"ref\" | \"name\"> {\n /** Width and height in px. Defaults to the provider's value, then lucide's `24`. */\n size?: number | string;\n /** Stroke width. Defaults to the provider's value, then lucide's `2`. */\n strokeWidth?: number;\n /**\n * Rendered while the icon's shard is in flight, and for a slug that does not\n * exist at all. Defaults to nothing.\n *\n * Pass a same-sized placeholder when the surrounding layout would otherwise\n * shift. Note that a slug already in the registry or the cache never renders\n * this — it resolves during render.\n */\n fallback?: ReactNode;\n /**\n * Clean up `name` before looking it up. Default `true`.\n *\n * A stored `icon_code` arrives dirty — `shopping_cart`, `\" Save\"`, a slug\n * lucide deprecated two releases ago — and normalizing is what makes those\n * render instead of falling back. `false` asks for a strict lookup, for the\n * case where you want an unexpected spelling to be visible rather than\n * quietly repaired.\n *\n * Ignored when the icon is passed as a component.\n */\n normalize?: boolean;\n}\n\n/**\n * Address the icon by slug — the reason this component exists.\n *\n * The slug is typed as the union of every name lucide ships, so a typo is a\n * compile error, while still accepting a plain `string` for the case that\n * motivates the whole module: a name arriving from an API, a CMS or a config\n * table.\n */\ninterface IconByNameProps extends IconBaseProps {\n name: IconName | (string & {});\n icon?: never;\n}\n\n/**\n * Address the icon by component, for a call site that already imported it.\n *\n * No lookup, no registry, no shard: the component is rendered as passed. It is\n * there so a screen mixing literal icons with data-driven ones can keep using one\n * component instead of alternating between `<Icon name>` and `<Wrench />`, which\n * is what makes the shared `size`/`strokeWidth` defaults apply to both.\n */\ninterface IconByComponentProps extends IconBaseProps {\n icon: LucideIcon;\n name?: never;\n}\n\nexport type IconProps = IconByNameProps | IconByComponentProps;\n\n/**\n * Render a lucide icon by slug.\n *\n * All ~2000 lucide icons are addressable, without the cost that makes\n * `lucide-react`'s own `DynamicIcon` unusable: its icon map holds a dynamic\n * `import()` per icon, so a bundler has to emit ~2000 chunk boundaries and the\n * browser floods with requests. Here a slug the app wrote as a literal is\n * resolved from a static registry, and a slug only known at runtime pulls a\n * single shard covering every icon sharing its initial letter.\n *\n * An unknown slug renders `fallback` (nothing, by default) and warns in dev only\n * — it never throws, because a bad name from an API must not take down the tree.\n *\n * `name` is normalized before the lookup, so a stored `icon_code` renders whether\n * it was written `shopping_cart`, `\" Save\"` or under a slug lucide has since\n * deprecated. Pass `normalize={false}` for a strict lookup.\n *\n * @example\n * <Icon name=\"save\" size={18} />\n * <Icon name={row.iconSlug} fallback={<span className=\"skeleton\" />} />\n * <Icon icon={Wrench} size={18} />\n */\nexport function Icon({\n name,\n icon,\n size,\n strokeWidth,\n fallback = null,\n normalize = true,\n ...rest\n}: IconProps): ReactNode {\n const context = useIconContext();\n const slug = name === undefined ? undefined : normalize ? normalizeIconName(name) : name;\n const fromSlug = useIcon(slug);\n const resolved = icon ?? fromSlug;\n\n if (!resolved) {\n if (isDevBuild() && name !== undefined && slug !== undefined) {\n if (iconStatus(slug) === \"missing\") warnUnknownIcon(name);\n }\n return fallback;\n }\n\n return createElement(resolved, {\n size: size ?? context?.size,\n strokeWidth: strokeWidth ?? context?.strokeWidth,\n ...rest,\n });\n}\n\nconst warnedSlugs = new Set<string>();\n\n/**\n * Warn once per unknown slug.\n *\n * Once, because `<Icon>` re-renders and a warning per render would bury the\n * console; the set is never cleared, since a slug that does not exist will not\n * start existing within the life of the page.\n *\n * Reports the name **as written**, not the normalized slug: the reader is the\n * developer who typed it, and `\"CircleAlert\"` is a far more useful thing to see in\n * the console than the `\"circlealert\"` it normalizes to.\n *\n * @param name - The slug that resolved to nothing, as passed.\n */\nfunction warnUnknownIcon(name: string): void {\n if (warnedSlugs.has(name)) return;\n warnedSlugs.add(name);\n console.warn(\n `[tempest-react-sdk] <Icon name=\"${name}\" /> — no such lucide icon. ` +\n `Slugs are kebab-case (\"circle-alert\", not \"CircleAlert\"); check against \\`iconNames\\`.`,\n );\n}\n"],"mappings":"kMAwFA,
|
|
1
|
+
{"version":3,"file":"Icon.cjs","names":["useIconContext","normalizeIconName","useIcon","isDevBuild","iconStatus","createElement","require_dev_mode","require_icon_context","require_normalize_icon_name","require_shard_cache","require_use_icon","react","Icon","rest","context","slug","name","normalize","fromSlug","resolved","icon","size","strokeWidth","warnUnknownIcon","fallback","warnedSlugs"],"sources":["../../src/icons/Icon.tsx"],"sourcesContent":["import { createElement, type ReactNode, type SVGProps } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\n\nimport type { IconName } from \"./generated/icon-name\";\nimport { useIconContext } from \"./icon-context\";\nimport { normalizeIconName } from \"./normalize-icon-name\";\nimport { iconStatus } from \"./shard-cache\";\nimport { useIcon } from \"./use-icon\";\nimport { isDevBuild } from \"../utils/dev-mode\";\n\ninterface IconBaseProps extends Omit<SVGProps<SVGSVGElement>, \"ref\" | \"name\"> {\n /** Width and height in px. Defaults to the provider's value, then lucide's `24`. */\n size?: number | string;\n /** Stroke width. Defaults to the provider's value, then lucide's `2`. */\n strokeWidth?: number;\n /**\n * Rendered while the icon's shard is in flight, and for a slug that does not\n * exist at all. Defaults to nothing.\n *\n * Pass a same-sized placeholder when the surrounding layout would otherwise\n * shift. Note that a slug already in the registry or the cache never renders\n * this — it resolves during render.\n */\n fallback?: ReactNode;\n /**\n * Clean up `name` before looking it up. Default `true`.\n *\n * A stored `icon_code` arrives dirty — `shopping_cart`, `\" Save\"`, a slug\n * lucide deprecated two releases ago — and normalizing is what makes those\n * render instead of falling back. `false` asks for a strict lookup, for the\n * case where you want an unexpected spelling to be visible rather than\n * quietly repaired.\n *\n * Ignored when the icon is passed as a component.\n */\n normalize?: boolean;\n}\n\n/**\n * Address the icon by slug — the reason this component exists.\n *\n * The slug is typed as the union of every name lucide ships, so a typo is a\n * compile error, while still accepting a plain `string` for the case that\n * motivates the whole module: a name arriving from an API, a CMS or a config\n * table.\n */\ninterface IconByNameProps extends IconBaseProps {\n name: IconName | (string & {});\n icon?: never;\n}\n\n/**\n * Address the icon by component, for a call site that already imported it.\n *\n * No lookup, no registry, no shard: the component is rendered as passed. It is\n * there so a screen mixing literal icons with data-driven ones can keep using one\n * component instead of alternating between `<Icon name>` and `<Wrench />`, which\n * is what makes the shared `size`/`strokeWidth` defaults apply to both.\n */\ninterface IconByComponentProps extends IconBaseProps {\n icon: LucideIcon;\n name?: never;\n}\n\nexport type IconProps = IconByNameProps | IconByComponentProps;\n\n/**\n * Render a lucide icon by slug.\n *\n * All ~2000 lucide icons are addressable, without the cost that makes\n * `lucide-react`'s own `DynamicIcon` unusable: its icon map holds a dynamic\n * `import()` per icon, so a bundler has to emit ~2000 chunk boundaries and the\n * browser floods with requests. Here a slug the app wrote as a literal is\n * resolved from a static registry, and a slug only known at runtime pulls a\n * single shard covering every icon sharing its initial letter.\n *\n * An unknown slug renders `fallback` (nothing, by default) and warns in dev only\n * — it never throws, because a bad name from an API must not take down the tree.\n *\n * `name` is normalized before the lookup, so a stored `icon_code` renders whether\n * it was written `shopping_cart`, `\" Save\"` or under a slug lucide has since\n * deprecated. Pass `normalize={false}` for a strict lookup.\n *\n * @example\n * <Icon name=\"save\" size={18} />\n * <Icon name={row.iconSlug} fallback={<span className=\"skeleton\" />} />\n * <Icon icon={Wrench} size={18} />\n */\nexport function Icon({\n name,\n icon,\n size,\n strokeWidth,\n fallback = null,\n normalize = true,\n ...rest\n}: IconProps): ReactNode {\n const context = useIconContext();\n const slug = name === undefined ? undefined : normalize ? normalizeIconName(name) : name;\n const fromSlug = useIcon(slug);\n const resolved = icon ?? fromSlug;\n\n if (!resolved) {\n if (isDevBuild() && name !== undefined && slug !== undefined) {\n if (iconStatus(slug) === \"missing\") warnUnknownIcon(name);\n }\n return fallback;\n }\n\n return createElement(resolved, {\n size: size ?? context?.size,\n strokeWidth: strokeWidth ?? context?.strokeWidth,\n ...rest,\n });\n}\n\nconst warnedSlugs = new Set<string>();\n\n/**\n * Warn once per unknown slug.\n *\n * Once, because `<Icon>` re-renders and a warning per render would bury the\n * console; the set is never cleared, since a slug that does not exist will not\n * start existing within the life of the page.\n *\n * Reports the name **as written**, not the normalized slug: the reader is the\n * developer who typed it, and `\"CircleAlert\"` is a far more useful thing to see in\n * the console than the `\"circlealert\"` it normalizes to.\n *\n * @param name - The slug that resolved to nothing, as passed.\n */\nfunction warnUnknownIcon(name: string): void {\n if (warnedSlugs.has(name)) return;\n warnedSlugs.add(name);\n console.warn(\n `[tempest-react-sdk] <Icon name=\"${name}\" /> — no such lucide icon. ` +\n `Slugs are kebab-case (\"circle-alert\", not \"CircleAlert\"); check against \\`iconNames\\`.`,\n );\n}\n"],"mappings":"A,kMAwFA,SAAgBY,EAAK,CACjB,OACA,OACA,OACA,cACA,WAAW,KACX,YAAY,GACZ,GAAGC,GACkB,CACrB,IAAMC,EAAUd,EAAAA,eAAe,EACzBe,EAAOC,IAAS,IAAA,GAAY,IAAA,GAAYC,EAAYhB,EAAAA,kBAAkBe,CAAI,EAAIA,EAC9EE,EAAWhB,EAAAA,QAAQa,CAAI,EACvBI,EAAWC,GAAQF,EASzB,OAPKC,GAOL,EAAOd,EAAAA,cAAAA,CAAcc,EAAU,CAC3B,KAAME,GAAQP,GAAS,KACvB,YAAaQ,GAAeR,GAAS,YACrC,GAAGD,CACP,CAAC,GAVOV,EAAAA,WAAW,GAAKa,IAAS,IAAA,IAAaD,IAAS,IAAA,IAC3CX,EAAAA,WAAWW,CAAI,IAAM,WAAWQ,EAAgBP,CAAI,EAErDQ,EAQf,CAEA,IAAMC,EAAc,IAAI,IAexB,SAASF,EAAgB,EAAoB,CACrCE,EAAY,IAAIT,CAAI,IACxBS,EAAY,IAAIT,CAAI,EACpB,QAAQ,KACJ,mCAAmCA,EAAK,mHAE5C,EACJ,C"}
|
package/dist/icons/Icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","names":[],"sources":["../../src/icons/Icon.tsx"],"sourcesContent":["import { createElement, type ReactNode, type SVGProps } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\n\nimport type { IconName } from \"./generated/icon-name\";\nimport { useIconContext } from \"./icon-context\";\nimport { normalizeIconName } from \"./normalize-icon-name\";\nimport { iconStatus } from \"./shard-cache\";\nimport { useIcon } from \"./use-icon\";\nimport { isDevBuild } from \"../utils/dev-mode\";\n\ninterface IconBaseProps extends Omit<SVGProps<SVGSVGElement>, \"ref\" | \"name\"> {\n /** Width and height in px. Defaults to the provider's value, then lucide's `24`. */\n size?: number | string;\n /** Stroke width. Defaults to the provider's value, then lucide's `2`. */\n strokeWidth?: number;\n /**\n * Rendered while the icon's shard is in flight, and for a slug that does not\n * exist at all. Defaults to nothing.\n *\n * Pass a same-sized placeholder when the surrounding layout would otherwise\n * shift. Note that a slug already in the registry or the cache never renders\n * this — it resolves during render.\n */\n fallback?: ReactNode;\n /**\n * Clean up `name` before looking it up. Default `true`.\n *\n * A stored `icon_code` arrives dirty — `shopping_cart`, `\" Save\"`, a slug\n * lucide deprecated two releases ago — and normalizing is what makes those\n * render instead of falling back. `false` asks for a strict lookup, for the\n * case where you want an unexpected spelling to be visible rather than\n * quietly repaired.\n *\n * Ignored when the icon is passed as a component.\n */\n normalize?: boolean;\n}\n\n/**\n * Address the icon by slug — the reason this component exists.\n *\n * The slug is typed as the union of every name lucide ships, so a typo is a\n * compile error, while still accepting a plain `string` for the case that\n * motivates the whole module: a name arriving from an API, a CMS or a config\n * table.\n */\ninterface IconByNameProps extends IconBaseProps {\n name: IconName | (string & {});\n icon?: never;\n}\n\n/**\n * Address the icon by component, for a call site that already imported it.\n *\n * No lookup, no registry, no shard: the component is rendered as passed. It is\n * there so a screen mixing literal icons with data-driven ones can keep using one\n * component instead of alternating between `<Icon name>` and `<Wrench />`, which\n * is what makes the shared `size`/`strokeWidth` defaults apply to both.\n */\ninterface IconByComponentProps extends IconBaseProps {\n icon: LucideIcon;\n name?: never;\n}\n\nexport type IconProps = IconByNameProps | IconByComponentProps;\n\n/**\n * Render a lucide icon by slug.\n *\n * All ~2000 lucide icons are addressable, without the cost that makes\n * `lucide-react`'s own `DynamicIcon` unusable: its icon map holds a dynamic\n * `import()` per icon, so a bundler has to emit ~2000 chunk boundaries and the\n * browser floods with requests. Here a slug the app wrote as a literal is\n * resolved from a static registry, and a slug only known at runtime pulls a\n * single shard covering every icon sharing its initial letter.\n *\n * An unknown slug renders `fallback` (nothing, by default) and warns in dev only\n * — it never throws, because a bad name from an API must not take down the tree.\n *\n * `name` is normalized before the lookup, so a stored `icon_code` renders whether\n * it was written `shopping_cart`, `\" Save\"` or under a slug lucide has since\n * deprecated. Pass `normalize={false}` for a strict lookup.\n *\n * @example\n * <Icon name=\"save\" size={18} />\n * <Icon name={row.iconSlug} fallback={<span className=\"skeleton\" />} />\n * <Icon icon={Wrench} size={18} />\n */\nexport function Icon({\n name,\n icon,\n size,\n strokeWidth,\n fallback = null,\n normalize = true,\n ...rest\n}: IconProps): ReactNode {\n const context = useIconContext();\n const slug = name === undefined ? undefined : normalize ? normalizeIconName(name) : name;\n const fromSlug = useIcon(slug);\n const resolved = icon ?? fromSlug;\n\n if (!resolved) {\n if (isDevBuild() && name !== undefined && slug !== undefined) {\n if (iconStatus(slug) === \"missing\") warnUnknownIcon(name);\n }\n return fallback;\n }\n\n return createElement(resolved, {\n size: size ?? context?.size,\n strokeWidth: strokeWidth ?? context?.strokeWidth,\n ...rest,\n });\n}\n\nconst warnedSlugs = new Set<string>();\n\n/**\n * Warn once per unknown slug.\n *\n * Once, because `<Icon>` re-renders and a warning per render would bury the\n * console; the set is never cleared, since a slug that does not exist will not\n * start existing within the life of the page.\n *\n * Reports the name **as written**, not the normalized slug: the reader is the\n * developer who typed it, and `\"CircleAlert\"` is a far more useful thing to see in\n * the console than the `\"circlealert\"` it normalizes to.\n *\n * @param name - The slug that resolved to nothing, as passed.\n */\nfunction warnUnknownIcon(name: string): void {\n if (warnedSlugs.has(name)) return;\n warnedSlugs.add(name);\n console.warn(\n `[tempest-react-sdk] <Icon name=\"${name}\" /> — no such lucide icon. ` +\n `Slugs are kebab-case (\"circle-alert\", not \"CircleAlert\"); check against \\`iconNames\\`.`,\n );\n}\n"],"mappings":";;;;;;;AAwFA,
|
|
1
|
+
{"version":3,"file":"Icon.js","names":["Icon","rest","context","useIconContext","slug","name","normalize","normalizeIconName","fromSlug","useIcon","resolved","icon","createElement","size","strokeWidth","isDevBuild","iconStatus","warnUnknownIcon","fallback","warnedSlugs"],"sources":["../../src/icons/Icon.tsx"],"sourcesContent":["import { createElement, type ReactNode, type SVGProps } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\n\nimport type { IconName } from \"./generated/icon-name\";\nimport { useIconContext } from \"./icon-context\";\nimport { normalizeIconName } from \"./normalize-icon-name\";\nimport { iconStatus } from \"./shard-cache\";\nimport { useIcon } from \"./use-icon\";\nimport { isDevBuild } from \"../utils/dev-mode\";\n\ninterface IconBaseProps extends Omit<SVGProps<SVGSVGElement>, \"ref\" | \"name\"> {\n /** Width and height in px. Defaults to the provider's value, then lucide's `24`. */\n size?: number | string;\n /** Stroke width. Defaults to the provider's value, then lucide's `2`. */\n strokeWidth?: number;\n /**\n * Rendered while the icon's shard is in flight, and for a slug that does not\n * exist at all. Defaults to nothing.\n *\n * Pass a same-sized placeholder when the surrounding layout would otherwise\n * shift. Note that a slug already in the registry or the cache never renders\n * this — it resolves during render.\n */\n fallback?: ReactNode;\n /**\n * Clean up `name` before looking it up. Default `true`.\n *\n * A stored `icon_code` arrives dirty — `shopping_cart`, `\" Save\"`, a slug\n * lucide deprecated two releases ago — and normalizing is what makes those\n * render instead of falling back. `false` asks for a strict lookup, for the\n * case where you want an unexpected spelling to be visible rather than\n * quietly repaired.\n *\n * Ignored when the icon is passed as a component.\n */\n normalize?: boolean;\n}\n\n/**\n * Address the icon by slug — the reason this component exists.\n *\n * The slug is typed as the union of every name lucide ships, so a typo is a\n * compile error, while still accepting a plain `string` for the case that\n * motivates the whole module: a name arriving from an API, a CMS or a config\n * table.\n */\ninterface IconByNameProps extends IconBaseProps {\n name: IconName | (string & {});\n icon?: never;\n}\n\n/**\n * Address the icon by component, for a call site that already imported it.\n *\n * No lookup, no registry, no shard: the component is rendered as passed. It is\n * there so a screen mixing literal icons with data-driven ones can keep using one\n * component instead of alternating between `<Icon name>` and `<Wrench />`, which\n * is what makes the shared `size`/`strokeWidth` defaults apply to both.\n */\ninterface IconByComponentProps extends IconBaseProps {\n icon: LucideIcon;\n name?: never;\n}\n\nexport type IconProps = IconByNameProps | IconByComponentProps;\n\n/**\n * Render a lucide icon by slug.\n *\n * All ~2000 lucide icons are addressable, without the cost that makes\n * `lucide-react`'s own `DynamicIcon` unusable: its icon map holds a dynamic\n * `import()` per icon, so a bundler has to emit ~2000 chunk boundaries and the\n * browser floods with requests. Here a slug the app wrote as a literal is\n * resolved from a static registry, and a slug only known at runtime pulls a\n * single shard covering every icon sharing its initial letter.\n *\n * An unknown slug renders `fallback` (nothing, by default) and warns in dev only\n * — it never throws, because a bad name from an API must not take down the tree.\n *\n * `name` is normalized before the lookup, so a stored `icon_code` renders whether\n * it was written `shopping_cart`, `\" Save\"` or under a slug lucide has since\n * deprecated. Pass `normalize={false}` for a strict lookup.\n *\n * @example\n * <Icon name=\"save\" size={18} />\n * <Icon name={row.iconSlug} fallback={<span className=\"skeleton\" />} />\n * <Icon icon={Wrench} size={18} />\n */\nexport function Icon({\n name,\n icon,\n size,\n strokeWidth,\n fallback = null,\n normalize = true,\n ...rest\n}: IconProps): ReactNode {\n const context = useIconContext();\n const slug = name === undefined ? undefined : normalize ? normalizeIconName(name) : name;\n const fromSlug = useIcon(slug);\n const resolved = icon ?? fromSlug;\n\n if (!resolved) {\n if (isDevBuild() && name !== undefined && slug !== undefined) {\n if (iconStatus(slug) === \"missing\") warnUnknownIcon(name);\n }\n return fallback;\n }\n\n return createElement(resolved, {\n size: size ?? context?.size,\n strokeWidth: strokeWidth ?? context?.strokeWidth,\n ...rest,\n });\n}\n\nconst warnedSlugs = new Set<string>();\n\n/**\n * Warn once per unknown slug.\n *\n * Once, because `<Icon>` re-renders and a warning per render would bury the\n * console; the set is never cleared, since a slug that does not exist will not\n * start existing within the life of the page.\n *\n * Reports the name **as written**, not the normalized slug: the reader is the\n * developer who typed it, and `\"CircleAlert\"` is a far more useful thing to see in\n * the console than the `\"circlealert\"` it normalizes to.\n *\n * @param name - The slug that resolved to nothing, as passed.\n */\nfunction warnUnknownIcon(name: string): void {\n if (warnedSlugs.has(name)) return;\n warnedSlugs.add(name);\n console.warn(\n `[tempest-react-sdk] <Icon name=\"${name}\" /> — no such lucide icon. ` +\n `Slugs are kebab-case (\"circle-alert\", not \"CircleAlert\"); check against \\`iconNames\\`.`,\n );\n}\n"],"mappings":";;;;;;;AAwFA,SAAgBA,EAAK,EACjB,SACA,SACA,SACA,gBACA,cAAW,MACX,eAAY,IACZ,GAAGC,KACkB;CACrB,IAAMC,IAAUC,EAAe,GACzBC,IAAOC,MAAS,KAAA,IAAY,KAAA,IAAYC,IAAYC,EAAkBF,CAAI,IAAIA,GAC9EG,IAAWC,EAAQL,CAAI,GACvBM,IAAWC,KAAQH;CASzB,OAPKE,IAOEE,EAAcF,GAAU;EAC3B,MAAMG,KAAQX,GAAS;EACvB,aAAaY,KAAeZ,GAAS;EACrC,GAAGD;CACP,CAAC,KAVOc,EAAW,KAAKV,MAAS,KAAA,KAAaD,MAAS,KAAA,KAC3CY,EAAWZ,CAAI,MAAM,aAAWa,EAAgBZ,CAAI,GAErDa;AAQf;AAEA,IAAMC,oBAAc,IAAI,IAAY;AAepC,SAASF,EAAgB,GAAoB;CACzC,AAAIE,EAAY,IAAId,CAAI,MACxBc,EAAY,IAAId,CAAI,GACpB,QAAQ,KACJ,mCAAmCA,EAAK,mHAE5C;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconPicker.cjs","names":[],"sources":["../../src/icons/IconPicker.tsx"],"sourcesContent":["import { useEffect, useId, useMemo, useRef, type InputHTMLAttributes, type ReactNode } from \"react\";\n\nimport { cn } from \"../utils/cn\";\nimport { iconNames } from \"./generated/icon-names\";\nimport { Icon } from \"./Icon\";\nimport { normalizeIconName } from \"./normalize-icon-name\";\nimport { validateIconName } from \"./validate-icon-name\";\nimport styles from \"./IconPicker.module.css\";\n\n/**\n * @tempest-limits props-count — value/onChange are the field, limit/placeholder\n * the suggestion list, and previewSize/invalidMessage the two things a form\n * around it needs to restyle or translate.\n */\nexport interface IconPickerProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"value\" | \"onChange\" | \"list\" | \"type\"\n> {\n /** The chosen slug. Always canonical — see `onChange`. */\n value: string;\n /**\n * Fires with the **canonical** slug on every keystroke.\n *\n * Legacy spellings are normalized on the way out (`Shopping_Cart` →\n * `shopping-cart`, `alert-circle` → `circle-alert`), so what a form stores is\n * what `<Icon>` resolves without further cleanup.\n */\n onChange: (slug: string) => void;\n /**\n * How many suggestions to render. Default `40`.\n *\n * There are 2024 slugs, and building every one as an `<option>` on each\n * keystroke freezes the datalist — which is the reason this prop exists rather\n * than a \"show everything\" default.\n */\n limit?: number;\n /** Size of the preview glyph, in px. Default `20`. */\n previewSize?: number;\n /** Overrides the message shown for a slug that does not exist. */\n invalidMessage?: string;\n /** Rendered in the preview box while nothing valid is chosen. */\n emptyPreview?: ReactNode;\n}\n\n/**\n * An icon field: native autocomplete over every lucide slug, plus a preview.\n *\n * Every panel that lets someone choose an icon was rewriting this — filter the\n * list, cap the suggestions, build the `<datalist>`, and block submit when the\n * typed name does not exist. That last step is the one that matters: without it\n * an invalid value reaches the database and only shows up later as a missing icon\n * on every screen that renders the record.\n *\n * Validation is wired to the **native** form: the input carries a custom validity\n * message, so a plain `<form>` refuses to submit and the browser points at the\n * field. `validateIconName` is exported for react-hook-form and zod.\n *\n * Built on `<datalist>` rather than a custom listbox on purpose: keyboard,\n * screen-reader and mobile behaviour come from the platform, and the component\n * stays small enough that its cost is the slug list it has to import — ~7 KB\n * brotli, which only a picker pays.\n *\n * @example\n * const [icon, setIcon] = useState(\"\");\n *\n * <form onSubmit={save}>\n * <IconPicker value={icon} onChange={setIcon} required />\n * <button type=\"submit\">Salvar</button>\n * </form>\n */\nexport function IconPicker({\n value,\n onChange,\n limit = 40,\n previewSize = 20,\n invalidMessage,\n emptyPreview = null,\n className,\n ...rest\n}: IconPickerProps): ReactNode {\n const listId = useId();\n const input = useRef<HTMLInputElement>(null);\n const error = validateIconName(value, invalidMessage);\n\n const suggestions = useMemo(() => {\n const query = normalizeIconName(value);\n const matches = query === \"\" ? iconNames : iconNames.filter((name) => name.includes(query));\n return matches.slice(0, limit);\n }, [value, limit]);\n\n useEffect(() => {\n input.current?.setCustomValidity(error ?? \"\");\n }, [error]);\n\n return (\n <span className={cn(styles.picker, className)}>\n <span className={styles.preview} aria-hidden=\"true\">\n {error === undefined && value.trim() !== \"\" ? (\n <Icon name={value} size={previewSize} fallback={emptyPreview} />\n ) : (\n emptyPreview\n )}\n </span>\n <input\n {...rest}\n ref={input}\n type=\"text\"\n className={styles.input}\n list={listId}\n value={value}\n aria-invalid={error !== undefined || undefined}\n onChange={(event) => onChange(normalizeIconName(event.target.value))}\n />\n <datalist id={listId}>\n {suggestions.map((name) => (\n <option key={name} value={name} />\n ))}\n </datalist>\n </span>\n );\n}\n"],"mappings":"2QAsEA,
|
|
1
|
+
{"version":3,"file":"IconPicker.cjs","names":["useId","useRef","validateIconName","useMemo","normalizeIconName","iconNames","cn","styles","Icon","require_cn","require_icon_names","require_normalize_icon_name","require_Icon","require_validate_icon_name","require_IconPicker_module","react","react_jsx_runtime","IconPicker","rest","listId","input","error","value","invalidMessage","suggestions","query","name","limit","className","previewSize","emptyPreview","onChange","event"],"sources":["../../src/icons/IconPicker.tsx"],"sourcesContent":["import { useEffect, useId, useMemo, useRef, type InputHTMLAttributes, type ReactNode } from \"react\";\n\nimport { cn } from \"../utils/cn\";\nimport { iconNames } from \"./generated/icon-names\";\nimport { Icon } from \"./Icon\";\nimport { normalizeIconName } from \"./normalize-icon-name\";\nimport { validateIconName } from \"./validate-icon-name\";\nimport styles from \"./IconPicker.module.css\";\n\n/**\n * @tempest-limits props-count — value/onChange are the field, limit/placeholder\n * the suggestion list, and previewSize/invalidMessage the two things a form\n * around it needs to restyle or translate.\n */\nexport interface IconPickerProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"value\" | \"onChange\" | \"list\" | \"type\"\n> {\n /** The chosen slug. Always canonical — see `onChange`. */\n value: string;\n /**\n * Fires with the **canonical** slug on every keystroke.\n *\n * Legacy spellings are normalized on the way out (`Shopping_Cart` →\n * `shopping-cart`, `alert-circle` → `circle-alert`), so what a form stores is\n * what `<Icon>` resolves without further cleanup.\n */\n onChange: (slug: string) => void;\n /**\n * How many suggestions to render. Default `40`.\n *\n * There are 2024 slugs, and building every one as an `<option>` on each\n * keystroke freezes the datalist — which is the reason this prop exists rather\n * than a \"show everything\" default.\n */\n limit?: number;\n /** Size of the preview glyph, in px. Default `20`. */\n previewSize?: number;\n /** Overrides the message shown for a slug that does not exist. */\n invalidMessage?: string;\n /** Rendered in the preview box while nothing valid is chosen. */\n emptyPreview?: ReactNode;\n}\n\n/**\n * An icon field: native autocomplete over every lucide slug, plus a preview.\n *\n * Every panel that lets someone choose an icon was rewriting this — filter the\n * list, cap the suggestions, build the `<datalist>`, and block submit when the\n * typed name does not exist. That last step is the one that matters: without it\n * an invalid value reaches the database and only shows up later as a missing icon\n * on every screen that renders the record.\n *\n * Validation is wired to the **native** form: the input carries a custom validity\n * message, so a plain `<form>` refuses to submit and the browser points at the\n * field. `validateIconName` is exported for react-hook-form and zod.\n *\n * Built on `<datalist>` rather than a custom listbox on purpose: keyboard,\n * screen-reader and mobile behaviour come from the platform, and the component\n * stays small enough that its cost is the slug list it has to import — ~7 KB\n * brotli, which only a picker pays.\n *\n * @example\n * const [icon, setIcon] = useState(\"\");\n *\n * <form onSubmit={save}>\n * <IconPicker value={icon} onChange={setIcon} required />\n * <button type=\"submit\">Salvar</button>\n * </form>\n */\nexport function IconPicker({\n value,\n onChange,\n limit = 40,\n previewSize = 20,\n invalidMessage,\n emptyPreview = null,\n className,\n ...rest\n}: IconPickerProps): ReactNode {\n const listId = useId();\n const input = useRef<HTMLInputElement>(null);\n const error = validateIconName(value, invalidMessage);\n\n const suggestions = useMemo(() => {\n const query = normalizeIconName(value);\n const matches = query === \"\" ? iconNames : iconNames.filter((name) => name.includes(query));\n return matches.slice(0, limit);\n }, [value, limit]);\n\n useEffect(() => {\n input.current?.setCustomValidity(error ?? \"\");\n }, [error]);\n\n return (\n <span className={cn(styles.picker, className)}>\n <span className={styles.preview} aria-hidden=\"true\">\n {error === undefined && value.trim() !== \"\" ? (\n <Icon name={value} size={previewSize} fallback={emptyPreview} />\n ) : (\n emptyPreview\n )}\n </span>\n <input\n {...rest}\n ref={input}\n type=\"text\"\n className={styles.input}\n list={listId}\n value={value}\n aria-invalid={error !== undefined || undefined}\n onChange={(event) => onChange(normalizeIconName(event.target.value))}\n />\n <datalist id={listId}>\n {suggestions.map((name) => (\n <option key={name} value={name} />\n ))}\n </datalist>\n </span>\n );\n}\n"],"mappings":"A,2QAsEA,SAAgBiB,EAAW,CACvB,QACA,WACA,QAAQ,GACR,cAAc,GACd,iBACA,eAAe,KACf,YACA,GAAGC,GACwB,CAC3B,IAAMC,GAAA,EAASnB,EAAAA,MAAAA,CAAM,EACfoB,GAAA,EAAQnB,EAAAA,OAAAA,CAAyB,IAAI,EACrCoB,EAAQnB,EAAAA,iBAAiBoB,EAAOC,CAAc,EAE9CC,GAAA,EAAcrB,EAAAA,QAAAA,KAAc,CAC9B,IAAMsB,EAAQrB,EAAAA,kBAAkBkB,CAAK,EAErC,OADgBG,IAAU,GAAKpB,EAAAA,UAAYA,EAAAA,UAAU,OAAQ,GAASqB,EAAK,SAASD,CAAK,CAAC,EAAA,CAC3E,MAAM,EAAGE,CAAK,CACjC,EAAG,CAACL,EAAOK,CAAK,CAAC,EAMjB,OAJA,EAAAZ,EAAA,UAAA,KAAgB,CACZK,EAAM,SAAS,kBAAkBC,GAAS,EAAE,CAChD,EAAG,CAACA,CAAK,CAAC,GAGN,EAAAL,EAAA,KAAA,CAAC,OAAD,CAAM,UAAWV,EAAAA,GAAGC,EAAAA,QAAO,OAAQqB,CAAS,EAA5C,SAAA,EACI,EAAAZ,EAAA,IAAA,CAAC,OAAD,CAAM,UAAWT,EAAAA,QAAO,QAAS,cAAY,OACxC,SAAAc,IAAU,IAAA,IAAaC,EAAM,KAAK,IAAM,IACrC,EAAAN,EAAA,IAAA,CAACR,EAAAA,KAAD,CAAM,KAAMc,EAAO,KAAMO,EAAa,SAAUC,CAAe,CAAA,EAE/DA,CAEF,CAAA,GACN,EAAAd,EAAA,IAAA,CAAC,QAAD,CACI,GAAIE,EACJ,IAAKE,EACL,KAAK,OACL,UAAWb,EAAAA,QAAO,MAClB,KAAMY,EACC,QACP,eAAcE,IAAU,IAAA,IAAa,IAAA,GACrC,SAAW,GAAUU,EAAS3B,EAAAA,kBAAkB4B,EAAM,OAAO,KAAK,CAAC,CACtE,CAAA,GACD,EAAAhB,EAAA,IAAA,CAAC,WAAD,CAAU,GAAIG,EACT,SAAAK,EAAY,IAAK,IACd,EAAAR,EAAA,IAAA,CAAC,SAAD,CAAmB,MAAOU,CAAO,EAApBA,CAAoB,CACpC,CACK,CAAA,CACR,C,EAEd,C"}
|