@krizaka/ui 3.30.0 → 3.31.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 +4 -8
- package/dist/action-bar.js +3 -3
- package/dist/action-bar.js.map +1 -1
- package/dist/argument-card.d.ts +1 -1
- package/dist/argument-card.js +2 -2
- package/dist/argument-card.js.map +1 -1
- package/dist/blocks.css +19 -60
- package/dist/{button-BmCrLCq7.d.ts → button-Cm9pFH3P.d.ts} +10 -9
- package/dist/button.d.ts +11 -10
- package/dist/button.js +1 -1
- package/dist/captcha.js +1 -1
- package/dist/card-grid.d.ts +5 -12
- package/dist/card-grid.js +4 -12
- package/dist/card-grid.js.map +1 -1
- package/dist/card.d.ts +7 -7
- package/dist/card.js +2 -2
- package/dist/card.js.map +1 -1
- package/dist/{chunk-GYKQ52HX.js → chunk-2AJ4NJUF.js} +2 -2
- package/dist/{chunk-MQPC3P4T.js → chunk-2DGLWTPS.js} +3 -3
- package/dist/chunk-2DGLWTPS.js.map +1 -0
- package/dist/{chunk-DZU6RMYD.js → chunk-3DHNN5V7.js} +15 -9
- package/dist/chunk-3DHNN5V7.js.map +1 -0
- package/dist/{chunk-TFJDIOFK.js → chunk-4E5IUZHR.js} +3 -3
- package/dist/chunk-4E5IUZHR.js.map +1 -0
- package/dist/{chunk-HAQWKORZ.js → chunk-4JO5GSSD.js} +1 -37
- package/dist/chunk-4JO5GSSD.js.map +1 -0
- package/dist/{chunk-APNIVNIX.js → chunk-IBDTAMPF.js} +3 -4
- package/dist/chunk-IBDTAMPF.js.map +1 -0
- package/dist/{chunk-LYOPPBMC.js → chunk-KIBICUZK.js} +2 -2
- package/dist/{chunk-HBZPJ3EP.js → chunk-NJFCSVPT.js} +2 -2
- package/dist/{chunk-KM6VAKIE.js → chunk-RE5WJ4QP.js} +2 -2
- package/dist/chunk-RE5WJ4QP.js.map +1 -0
- package/dist/{chunk-CHOJUCVE.js → chunk-SJS6RJIT.js} +15 -9
- package/dist/chunk-SJS6RJIT.js.map +1 -0
- package/dist/{chunk-6ZYRUOTA.js → chunk-UV4HBVH7.js} +15 -9
- package/dist/chunk-UV4HBVH7.js.map +1 -0
- package/dist/command.js +2 -2
- package/dist/confirm-button.d.ts +1 -1
- package/dist/confirm-button.js +1 -1
- package/dist/continue-prompt.js +14 -8
- package/dist/continue-prompt.js.map +1 -1
- package/dist/data-table.js +2 -2
- package/dist/dialog.js +2 -2
- package/dist/engine-flow.d.ts +25 -2
- package/dist/engine-flow.js +27 -6
- package/dist/engine-flow.js.map +1 -1
- package/dist/force-update-screen.js +2 -2
- package/dist/force-update-screen.js.map +1 -1
- package/dist/genui.js +3 -3
- package/dist/glow-card.d.ts +5 -4
- package/dist/glow-card.js +2 -8
- package/dist/glow-card.js.map +1 -1
- package/dist/image-cropper.js +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/iso.d.ts +1 -1
- package/dist/iso.js.map +1 -1
- package/dist/landscape.js +4 -4
- package/dist/landscape.js.map +1 -1
- package/dist/link-card.d.ts +3 -6
- package/dist/link-card.js +1 -1
- package/dist/maintenance-screen.js +1 -1
- package/dist/map.d.ts +50 -5
- package/dist/map.js +202 -66
- package/dist/map.js.map +1 -1
- package/dist/match-dialog.js +1 -1
- package/dist/media-gallery.js +1 -1
- package/dist/media-gallery.js.map +1 -1
- package/dist/media-grid.js +2 -2
- package/dist/motion.css +52 -122
- package/dist/motion.d.ts +2 -2
- package/dist/motion.js +1 -1
- package/dist/native/map.js +64 -64
- package/dist/native/map.js.map +1 -1
- package/dist/native.js +30 -30
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.js +2 -2
- package/dist/pointer-light.d.ts +6 -9
- package/dist/pointer-light.js +9 -5
- package/dist/pointer-light.js.map +1 -1
- package/dist/radio-group.js +2 -2
- package/dist/radio-group.js.map +1 -1
- package/dist/service-card.js +1 -1
- package/dist/service-card.js.map +1 -1
- package/dist/site-footer.js +2 -2
- package/dist/slider.js +1 -1
- package/dist/slider.js.map +1 -1
- package/dist/story.css +5 -12
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +1 -1
- package/dist/update-prompt.js +2 -2
- package/dist/update-prompt.js.map +1 -1
- package/dist/vertical-video.js +1 -1
- package/dist/video-player.js +2 -2
- package/dist/video-player.js.map +1 -1
- package/package.json +7 -7
- package/registry/action-bar.json +1 -1
- package/registry/app-shell.json +4 -4
- package/registry/argument-card.json +7 -16
- package/registry/auth-layout.json +4 -4
- package/registry/button.json +20 -20
- package/registry/card-grid.json +21 -24
- package/registry/card.json +7 -7
- package/registry/component-page.json +2 -2
- package/registry/confirm-button.json +6 -6
- package/registry/contact-page.json +2 -2
- package/registry/cover-hero.json +3 -3
- package/registry/dashboard-layout.json +2 -2
- package/registry/detail-layout.json +4 -4
- package/registry/docs-hub-page.json +2 -2
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +74 -3
- package/registry/examples/app-shell/admin-console.js +1 -1
- package/registry/examples/app-shell/admin-console.tsx +1 -1
- package/registry/examples/app-shell/basic.js +1 -1
- package/registry/examples/app-shell/basic.tsx +1 -1
- package/registry/examples/app-shell/desktop.js +1 -1
- package/registry/examples/app-shell/desktop.tsx +1 -1
- package/registry/examples/app-shell/orochia-studio.js +1 -1
- package/registry/examples/app-shell/orochia-studio.tsx +1 -1
- package/registry/examples/argument-card/hover-quiet.js +1 -1
- package/registry/examples/argument-card/hover-quiet.tsx +1 -1
- package/registry/examples/auth-layout/onboarding.js +2 -2
- package/registry/examples/auth-layout/onboarding.tsx +2 -2
- package/registry/examples/auth-layout/sign-in.js +2 -2
- package/registry/examples/auth-layout/sign-in.tsx +2 -2
- package/registry/examples/auth-layout/verify.js +1 -1
- package/registry/examples/auth-layout/verify.tsx +1 -1
- package/registry/examples/avatar/native/presence.dark.png +0 -0
- package/registry/examples/avatar/native/presence.light.png +0 -0
- package/registry/examples/badge/native/tones.dark.png +0 -0
- package/registry/examples/badge/native/tones.light.png +0 -0
- package/registry/examples/button/native/disabled.dark.png +0 -0
- package/registry/examples/button/native/disabled.light.png +0 -0
- package/registry/examples/button/native/gradient.dark.png +0 -0
- package/registry/examples/button/native/gradient.light.png +0 -0
- package/registry/examples/button/native/icon-only.dark.png +0 -0
- package/registry/examples/button/native/icon-only.light.png +0 -0
- package/registry/examples/button/native/icon.dark.png +0 -0
- package/registry/examples/button/native/icon.light.png +0 -0
- package/registry/examples/button/native/loading.dark.png +0 -0
- package/registry/examples/button/native/loading.light.png +0 -0
- package/registry/examples/button/native/primary.dark.png +0 -0
- package/registry/examples/button/native/primary.light.png +0 -0
- package/registry/examples/button/native/sizes.dark.png +0 -0
- package/registry/examples/button/native/sizes.light.png +0 -0
- package/registry/examples/button/signature.js +2 -2
- package/registry/examples/button/signature.tsx +4 -4
- package/registry/examples/card/interactive-link.tsx +1 -1
- package/registry/examples/card/native/body.dark.png +0 -0
- package/registry/examples/card/native/body.light.png +0 -0
- package/registry/examples/card/native/default.dark.png +0 -0
- package/registry/examples/card/native/default.light.png +0 -0
- package/registry/examples/card/native/elevated.dark.png +0 -0
- package/registry/examples/card/native/elevated.light.png +0 -0
- package/registry/examples/card-grid/hover-quiet.js +1 -1
- package/registry/examples/card-grid/hover-quiet.tsx +1 -1
- package/registry/examples/chat/native/assistant.dark.png +0 -0
- package/registry/examples/chat/native/assistant.light.png +0 -0
- package/registry/examples/chat/native/conversation.dark.png +0 -0
- package/registry/examples/chat/native/conversation.light.png +0 -0
- package/registry/examples/chat/native/inbox.dark.png +0 -0
- package/registry/examples/chat/native/inbox.light.png +0 -0
- package/registry/examples/checkbox/native/terms.dark.png +0 -0
- package/registry/examples/checkbox/native/terms.light.png +0 -0
- package/registry/examples/chip/native/multiple.dark.png +0 -0
- package/registry/examples/chip/native/multiple.light.png +0 -0
- package/registry/examples/chip/native/single.dark.png +0 -0
- package/registry/examples/chip/native/single.light.png +0 -0
- package/registry/examples/chip/native/toggle.dark.png +0 -0
- package/registry/examples/chip/native/toggle.light.png +0 -0
- package/registry/examples/component-page/button.js +2 -2
- package/registry/examples/component-page/button.tsx +2 -2
- package/registry/examples/contact-page/team.js +1 -1
- package/registry/examples/contact-page/team.tsx +1 -1
- package/registry/examples/cover-hero/plain.js +1 -1
- package/registry/examples/cover-hero/plain.tsx +1 -1
- package/registry/examples/cover-hero/shop.js +1 -1
- package/registry/examples/cover-hero/shop.tsx +1 -1
- package/registry/examples/dashboard-layout/orazaka-eric.js +2 -2
- package/registry/examples/dashboard-layout/orazaka-eric.tsx +2 -2
- package/registry/examples/date-picker/native/calendar.dark.png +0 -0
- package/registry/examples/date-picker/native/calendar.light.png +0 -0
- package/registry/examples/date-picker/native/day-strip.dark.png +0 -0
- package/registry/examples/date-picker/native/day-strip.light.png +0 -0
- package/registry/examples/date-picker/native/month-year.dark.png +0 -0
- package/registry/examples/date-picker/native/month-year.light.png +0 -0
- package/registry/examples/date-picker/native/time-slots.dark.png +0 -0
- package/registry/examples/date-picker/native/time-slots.light.png +0 -0
- package/registry/examples/description-list/native/job-details.dark.png +0 -0
- package/registry/examples/description-list/native/job-details.light.png +0 -0
- package/registry/examples/detail-layout/checkout.js +1 -1
- package/registry/examples/detail-layout/checkout.tsx +1 -1
- package/registry/examples/detail-layout/job.js +1 -1
- package/registry/examples/detail-layout/job.tsx +1 -1
- package/registry/examples/detail-layout/video.js +2 -2
- package/registry/examples/detail-layout/video.tsx +2 -2
- package/registry/examples/dialog/native/sheet.dark.png +0 -0
- package/registry/examples/dialog/native/sheet.light.png +0 -0
- package/registry/examples/docs-hub-page/krizaka.js +1 -1
- package/registry/examples/docs-hub-page/krizaka.tsx +1 -1
- package/registry/examples/empty-state/library.js +1 -1
- package/registry/examples/empty-state/library.tsx +1 -1
- package/registry/examples/empty-state/native/default.dark.png +0 -0
- package/registry/examples/empty-state/native/default.light.png +0 -0
- package/registry/examples/fab/native/extended.dark.png +0 -0
- package/registry/examples/fab/native/extended.light.png +0 -0
- package/registry/examples/force-update-screen/native/default.dark.png +0 -0
- package/registry/examples/force-update-screen/native/default.light.png +0 -0
- package/registry/examples/form/native/amount.dark.png +0 -0
- package/registry/examples/form/native/amount.light.png +0 -0
- package/registry/examples/form/native/audience.dark.png +0 -0
- package/registry/examples/form/native/audience.light.png +0 -0
- package/registry/examples/form/native/profile.dark.png +0 -0
- package/registry/examples/form/native/profile.light.png +0 -0
- package/registry/examples/form/native/settings.dark.png +0 -0
- package/registry/examples/form/native/settings.light.png +0 -0
- package/registry/examples/form/native/sign-up.dark.png +0 -0
- package/registry/examples/form/native/sign-up.light.png +0 -0
- package/registry/examples/form/native/upload.dark.png +0 -0
- package/registry/examples/form/native/upload.light.png +0 -0
- package/registry/examples/glow-card/spotlight.tsx +1 -1
- package/registry/examples/goal-gauge/native/default.dark.png +0 -0
- package/registry/examples/goal-gauge/native/default.light.png +0 -0
- package/registry/examples/landing-page/krizaka.js +3 -3
- package/registry/examples/landing-page/krizaka.tsx +3 -3
- package/registry/examples/link-card/hover-quiet.js +1 -1
- package/registry/examples/link-card/hover-quiet.tsx +1 -1
- package/registry/examples/loader/native/block.dark.png +0 -0
- package/registry/examples/loader/native/block.light.png +0 -0
- package/registry/examples/map/native/location-picker.dark.png +0 -0
- package/registry/examples/map/native/location-picker.light.png +0 -0
- package/registry/examples/map/route.js +36 -0
- package/registry/examples/map/route.tsx +35 -0
- package/registry/examples/marketing-layout/pricing.js +1 -1
- package/registry/examples/marketing-layout/pricing.tsx +1 -1
- package/registry/examples/marketing-layout/product-page.js +1 -1
- package/registry/examples/marketing-layout/product-page.tsx +2 -2
- package/registry/examples/mascot-state/native/default.dark.png +0 -0
- package/registry/examples/mascot-state/native/default.light.png +0 -0
- package/registry/examples/mascots/native/crane.dark.png +0 -0
- package/registry/examples/mascots/native/crane.light.png +0 -0
- package/registry/examples/mascots/native/default.dark.png +0 -0
- package/registry/examples/mascots/native/default.light.png +0 -0
- package/registry/examples/mascots/native/lovebird.dark.png +0 -0
- package/registry/examples/mascots/native/lovebird.light.png +0 -0
- package/registry/examples/mascots/native/phoenix.dark.png +0 -0
- package/registry/examples/mascots/native/phoenix.light.png +0 -0
- package/registry/examples/match-dialog/native/its-a-match.dark.png +0 -0
- package/registry/examples/match-dialog/native/its-a-match.light.png +0 -0
- package/registry/examples/media-capture/native/photo.dark.png +0 -0
- package/registry/examples/media-capture/native/photo.light.png +0 -0
- package/registry/examples/meta-row/native/video.dark.png +0 -0
- package/registry/examples/meta-row/native/video.light.png +0 -0
- package/registry/examples/meter/native/credits.dark.png +0 -0
- package/registry/examples/meter/native/credits.light.png +0 -0
- package/registry/examples/meter/native/split-ring.dark.png +0 -0
- package/registry/examples/meter/native/split-ring.light.png +0 -0
- package/registry/examples/nav-bar/family-product.js +1 -1
- package/registry/examples/nav-bar/family-product.tsx +1 -1
- package/registry/examples/onboarding/native/first-launch.dark.png +0 -0
- package/registry/examples/onboarding/native/first-launch.light.png +0 -0
- package/registry/examples/permission-prompt/native/blocked.dark.png +0 -0
- package/registry/examples/permission-prompt/native/blocked.light.png +0 -0
- package/registry/examples/permission-prompt/native/camera.dark.png +0 -0
- package/registry/examples/permission-prompt/native/camera.light.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.dark.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.light.png +0 -0
- package/registry/examples/pricing-page/credits.js +3 -3
- package/registry/examples/pricing-page/credits.tsx +3 -3
- package/registry/examples/product-page/orazaka.js +2 -2
- package/registry/examples/product-page/orazaka.tsx +2 -2
- package/registry/examples/profile-card/native/default.dark.png +0 -0
- package/registry/examples/profile-card/native/default.light.png +0 -0
- package/registry/examples/progress/native/bar.dark.png +0 -0
- package/registry/examples/progress/native/bar.light.png +0 -0
- package/registry/examples/progress/native/indeterminate.dark.png +0 -0
- package/registry/examples/progress/native/indeterminate.light.png +0 -0
- package/registry/examples/progress/native/ring.dark.png +0 -0
- package/registry/examples/progress/native/ring.light.png +0 -0
- package/registry/examples/radio-group/native/buttons.dark.png +0 -0
- package/registry/examples/radio-group/native/buttons.light.png +0 -0
- package/registry/examples/radio-group/native/cards.dark.png +0 -0
- package/registry/examples/radio-group/native/cards.light.png +0 -0
- package/registry/examples/radio-group/native/list.dark.png +0 -0
- package/registry/examples/radio-group/native/list.light.png +0 -0
- package/registry/examples/screen/native/auth.dark.png +0 -0
- package/registry/examples/screen/native/auth.light.png +0 -0
- package/registry/examples/screen/native/chat.dark.png +0 -0
- package/registry/examples/screen/native/chat.light.png +0 -0
- package/registry/examples/screen/native/profile.dark.png +0 -0
- package/registry/examples/screen/native/profile.light.png +0 -0
- package/registry/examples/screen/native/settings.dark.png +0 -0
- package/registry/examples/screen/native/settings.light.png +0 -0
- package/registry/examples/search-field/native/cancel.dark.png +0 -0
- package/registry/examples/search-field/native/cancel.light.png +0 -0
- package/registry/examples/settings-layout/account.js +1 -1
- package/registry/examples/settings-layout/account.tsx +1 -1
- package/registry/examples/settings-layout/native/account.dark.png +0 -0
- package/registry/examples/settings-layout/native/account.light.png +0 -0
- package/registry/examples/settings-layout/sections.js +1 -1
- package/registry/examples/settings-layout/sections.tsx +1 -1
- package/registry/examples/showcase/native/slides.dark.png +0 -0
- package/registry/examples/showcase/native/slides.light.png +0 -0
- package/registry/examples/slider/native/default.dark.png +0 -0
- package/registry/examples/slider/native/default.light.png +0 -0
- package/registry/examples/slider/native/range.dark.png +0 -0
- package/registry/examples/slider/native/range.light.png +0 -0
- package/registry/examples/slider/native/stepped.dark.png +0 -0
- package/registry/examples/slider/native/stepped.light.png +0 -0
- package/registry/examples/slider/native/vertical.dark.png +0 -0
- package/registry/examples/slider/native/vertical.light.png +0 -0
- package/registry/examples/spinner/native/sizes.dark.png +0 -0
- package/registry/examples/spinner/native/sizes.light.png +0 -0
- package/registry/examples/split-view/messages.js +1 -1
- package/registry/examples/split-view/messages.tsx +1 -1
- package/registry/examples/status-page/building.js +1 -1
- package/registry/examples/status-page/building.tsx +1 -1
- package/registry/examples/step-progress/native/sign-up.dark.png +0 -0
- package/registry/examples/step-progress/native/sign-up.light.png +0 -0
- package/registry/examples/stepper/native/run.dark.png +0 -0
- package/registry/examples/stepper/native/run.light.png +0 -0
- package/registry/examples/sticky-action/phone.js +1 -1
- package/registry/examples/sticky-action/phone.tsx +1 -1
- package/registry/examples/switch/native/default.dark.png +0 -0
- package/registry/examples/switch/native/default.light.png +0 -0
- package/registry/examples/switch/native/settings.dark.png +0 -0
- package/registry/examples/switch/native/settings.light.png +0 -0
- package/registry/examples/tab-bar/native/main-sections.dark.png +0 -0
- package/registry/examples/tab-bar/native/main-sections.light.png +0 -0
- package/registry/examples/tabs/native/sections.dark.png +0 -0
- package/registry/examples/tabs/native/sections.light.png +0 -0
- package/registry/examples/tag-selector/native/interests.dark.png +0 -0
- package/registry/examples/tag-selector/native/interests.light.png +0 -0
- package/registry/examples/toast/native/snackbar.dark.png +0 -0
- package/registry/examples/toast/native/snackbar.light.png +0 -0
- package/registry/examples/toast/native/tones.dark.png +0 -0
- package/registry/examples/toast/native/tones.light.png +0 -0
- package/registry/examples/txt/native/tones.dark.png +0 -0
- package/registry/examples/txt/native/tones.light.png +0 -0
- package/registry/examples/update-prompt/native/default.dark.png +0 -0
- package/registry/examples/update-prompt/native/default.light.png +0 -0
- package/registry/examples/verified-badge/native/verified.dark.png +0 -0
- package/registry/examples/verified-badge/native/verified.light.png +0 -0
- package/registry/examples/vertical-video/native/rail.dark.png +0 -0
- package/registry/examples/vertical-video/native/rail.light.png +0 -0
- package/registry/examples/waveform/native/card.dark.png +0 -0
- package/registry/examples/waveform/native/card.light.png +0 -0
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +6 -6
- package/registry/glow-card.json +19 -19
- package/registry/index.json +20 -21
- package/registry/iso.json +7 -7
- package/registry/landing-page.json +2 -2
- package/registry/landscape.json +1 -1
- package/registry/link-card.json +15 -24
- package/registry/map.json +235 -6
- package/registry/marketing-layout.json +3 -3
- package/registry/media-gallery.json +1 -1
- package/registry/nav-bar.json +3 -3
- package/registry/pointer-light.json +17 -22
- package/registry/pricing-page.json +2 -2
- package/registry/product-page.json +2 -2
- package/registry/progress.json +2 -2
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +3 -3
- package/registry/site-footer.json +2 -2
- package/registry/slider.json +1 -1
- package/registry/split-view.json +2 -2
- package/registry/status-page.json +1 -1
- package/registry/sticky-action.json +2 -2
- package/registry/update-prompt.json +1 -1
- package/registry/video-player.json +1 -1
- package/dist/chunk-6ZYRUOTA.js.map +0 -1
- package/dist/chunk-AB5D3KBG.js +0 -37
- package/dist/chunk-AB5D3KBG.js.map +0 -1
- package/dist/chunk-APNIVNIX.js.map +0 -1
- package/dist/chunk-CHOJUCVE.js.map +0 -1
- package/dist/chunk-DZU6RMYD.js.map +0 -1
- package/dist/chunk-HAQWKORZ.js.map +0 -1
- package/dist/chunk-KM6VAKIE.js.map +0 -1
- package/dist/chunk-MQPC3P4T.js.map +0 -1
- package/dist/chunk-TFJDIOFK.js.map +0 -1
- package/registry/examples/argument-card/hover-light.js +0 -17
- package/registry/examples/argument-card/hover-light.tsx +0 -19
- package/registry/examples/link-card/hover-light.d.ts +0 -4
- package/registry/examples/link-card/hover-light.js +0 -18
- package/registry/examples/link-card/hover-light.tsx +0 -20
- /package/dist/{chunk-GYKQ52HX.js.map → chunk-2AJ4NJUF.js.map} +0 -0
- /package/dist/{chunk-LYOPPBMC.js.map → chunk-KIBICUZK.js.map} +0 -0
- /package/dist/{chunk-HBZPJ3EP.js.map → chunk-NJFCSVPT.js.map} +0 -0
- /package/registry/examples/{argument-card/hover-light.d.ts → map/route.d.ts} +0 -0
package/dist/map.js
CHANGED
|
@@ -47,6 +47,50 @@ function formatDistance(meters, locale) {
|
|
|
47
47
|
if (meters < 1e3) return new Intl.NumberFormat(locale, { style: "unit", unit: "meter", maximumFractionDigits: 0 }).format(Math.round(meters / 10) * 10);
|
|
48
48
|
return new Intl.NumberFormat(locale, { style: "unit", unit: "kilometer", maximumFractionDigits: meters < 1e4 ? 1 : 0 }).format(meters / 1e3);
|
|
49
49
|
}
|
|
50
|
+
function pathLength(path) {
|
|
51
|
+
let total = 0;
|
|
52
|
+
for (let i = 1; i < path.length; i++) total += distanceMeters(path[i - 1], path[i]);
|
|
53
|
+
return total;
|
|
54
|
+
}
|
|
55
|
+
function pointAlong(path, fraction) {
|
|
56
|
+
const first = path[0] ?? [0, 0];
|
|
57
|
+
if (path.length < 2) return { position: first, heading: 0 };
|
|
58
|
+
const target = Math.max(0, Math.min(1, fraction)) * pathLength(path);
|
|
59
|
+
let walked = 0;
|
|
60
|
+
for (let i = 1; i < path.length; i++) {
|
|
61
|
+
const a = path[i - 1];
|
|
62
|
+
const b = path[i];
|
|
63
|
+
const leg = distanceMeters(a, b);
|
|
64
|
+
if (walked + leg >= target || i === path.length - 1) {
|
|
65
|
+
const t = leg === 0 ? 0 : Math.max(0, Math.min(1, (target - walked) / leg));
|
|
66
|
+
const heading = Math.atan2(b[0] - a[0], b[1] - a[1]) * 180 / Math.PI;
|
|
67
|
+
return { position: [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t], heading: (heading + 360) % 360 };
|
|
68
|
+
}
|
|
69
|
+
walked += leg;
|
|
70
|
+
}
|
|
71
|
+
return { position: first, heading: 0 };
|
|
72
|
+
}
|
|
73
|
+
function sliceLine(path, fraction) {
|
|
74
|
+
const f = Math.max(0, Math.min(1, fraction));
|
|
75
|
+
const total = pathLength(path);
|
|
76
|
+
const coordinates = [];
|
|
77
|
+
if (path.length) coordinates.push([...path[0]]);
|
|
78
|
+
let walked = 0;
|
|
79
|
+
for (let i = 1; i < path.length && f > 0; i++) {
|
|
80
|
+
const a = path[i - 1];
|
|
81
|
+
const b = path[i];
|
|
82
|
+
const leg = distanceMeters(a, b);
|
|
83
|
+
if (walked + leg <= f * total) coordinates.push([...b]);
|
|
84
|
+
else {
|
|
85
|
+
const t = leg === 0 ? 0 : (f * total - walked) / leg;
|
|
86
|
+
coordinates.push([a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t]);
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
walked += leg;
|
|
90
|
+
}
|
|
91
|
+
if (coordinates.length === 1) coordinates.push([...coordinates[0]]);
|
|
92
|
+
return { type: "Feature", properties: {}, geometry: { type: "LineString", coordinates } };
|
|
93
|
+
}
|
|
50
94
|
|
|
51
95
|
// src/map/location-picker.tsx
|
|
52
96
|
import * as React3 from "react";
|
|
@@ -105,15 +149,15 @@ var themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze
|
|
|
105
149
|
"textSecondary": "#a0a0a7",
|
|
106
150
|
"textMuted": "#92929b",
|
|
107
151
|
"textOnMedia": "#ffffff",
|
|
108
|
-
"accent": "#
|
|
109
|
-
"accentHover": "#
|
|
110
|
-
"accentSoft": "rgba(
|
|
111
|
-
"accentText": "#
|
|
112
|
-
"accent2": "#
|
|
152
|
+
"accent": "#3e76a8",
|
|
153
|
+
"accentHover": "#346793",
|
|
154
|
+
"accentSoft": "rgba(62,118,168,0.12)",
|
|
155
|
+
"accentText": "#8ebde1",
|
|
156
|
+
"accent2": "#3e76a8",
|
|
113
157
|
"onAccent": "#ffffff",
|
|
114
|
-
"ring": "#
|
|
115
|
-
"brandGradientFrom": "#
|
|
116
|
-
"brandGradientVia": "#
|
|
158
|
+
"ring": "#3e76a8",
|
|
159
|
+
"brandGradientFrom": "#121a21",
|
|
160
|
+
"brandGradientVia": "#0f1114",
|
|
117
161
|
"brandGradientTo": "#0c0c0e",
|
|
118
162
|
"success": "#10b77f",
|
|
119
163
|
"successText": "#36d399",
|
|
@@ -124,8 +168,8 @@ var themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze
|
|
|
124
168
|
"danger": "#ef4343",
|
|
125
169
|
"dangerText": "#f87272",
|
|
126
170
|
"dangerSoft": "rgba(239,67,67,0.14)",
|
|
127
|
-
"info": "#
|
|
128
|
-
"infoText": "#
|
|
171
|
+
"info": "#3e76a8",
|
|
172
|
+
"infoText": "#8ebde1",
|
|
129
173
|
"scrim": "rgba(0,0,0,0.6)",
|
|
130
174
|
"scrimStrong": "rgba(0,0,0,0.8)",
|
|
131
175
|
"overlay": "rgba(0,0,0,0.7)",
|
|
@@ -149,15 +193,15 @@ var themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze
|
|
|
149
193
|
"textSecondary": "#56565d",
|
|
150
194
|
"textMuted": "#64646d",
|
|
151
195
|
"textOnMedia": "#ffffff",
|
|
152
|
-
"accent": "#
|
|
153
|
-
"accentHover": "#
|
|
154
|
-
"accentSoft": "rgba(
|
|
155
|
-
"accentText": "#
|
|
156
|
-
"accent2": "#
|
|
196
|
+
"accent": "#2a5f8d",
|
|
197
|
+
"accentHover": "#1f4d75",
|
|
198
|
+
"accentSoft": "rgba(42,95,141,0.08)",
|
|
199
|
+
"accentText": "#275782",
|
|
200
|
+
"accent2": "#2a5f8d",
|
|
157
201
|
"onAccent": "#ffffff",
|
|
158
|
-
"ring": "#
|
|
159
|
-
"brandGradientFrom": "#
|
|
160
|
-
"brandGradientVia": "#
|
|
202
|
+
"ring": "#2a5f8d",
|
|
203
|
+
"brandGradientFrom": "#e7eef4",
|
|
204
|
+
"brandGradientVia": "#f5f7fa",
|
|
161
205
|
"brandGradientTo": "#fafafa",
|
|
162
206
|
"success": "#10b77f",
|
|
163
207
|
"successText": "#0a714e",
|
|
@@ -168,8 +212,8 @@ var themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze
|
|
|
168
212
|
"danger": "#ef4343",
|
|
169
213
|
"dangerText": "#af1d1d",
|
|
170
214
|
"dangerSoft": "rgba(239,67,67,0.1)",
|
|
171
|
-
"info": "#
|
|
172
|
-
"infoText": "#
|
|
215
|
+
"info": "#2a5f8d",
|
|
216
|
+
"infoText": "#275782",
|
|
173
217
|
"scrim": "rgba(0,0,0,0.6)",
|
|
174
218
|
"scrimStrong": "rgba(0,0,0,0.8)",
|
|
175
219
|
"overlay": "rgba(0,0,0,0.7)",
|
|
@@ -184,31 +228,31 @@ var themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze
|
|
|
184
228
|
var brands = /* @__PURE__ */ Object.freeze({
|
|
185
229
|
"krizaka": {
|
|
186
230
|
"dark": {
|
|
187
|
-
"accent": "#
|
|
188
|
-
"accentHover": "#
|
|
189
|
-
"accentSoft": "rgba(
|
|
190
|
-
"accentText": "#
|
|
191
|
-
"accent2": "#
|
|
231
|
+
"accent": "#3e76a8",
|
|
232
|
+
"accentHover": "#346793",
|
|
233
|
+
"accentSoft": "rgba(62,118,168,0.12)",
|
|
234
|
+
"accentText": "#8ebde1",
|
|
235
|
+
"accent2": "#3e76a8",
|
|
192
236
|
"onAccent": "#ffffff",
|
|
193
|
-
"ring": "#
|
|
194
|
-
"info": "#
|
|
195
|
-
"infoText": "#
|
|
196
|
-
"brandGradientFrom": "#
|
|
197
|
-
"brandGradientVia": "#
|
|
237
|
+
"ring": "#3e76a8",
|
|
238
|
+
"info": "#3e76a8",
|
|
239
|
+
"infoText": "#8ebde1",
|
|
240
|
+
"brandGradientFrom": "#121a21",
|
|
241
|
+
"brandGradientVia": "#0f1114",
|
|
198
242
|
"brandGradientTo": "#0c0c0e"
|
|
199
243
|
},
|
|
200
244
|
"light": {
|
|
201
|
-
"accent": "#
|
|
202
|
-
"accentHover": "#
|
|
203
|
-
"accentSoft": "rgba(
|
|
204
|
-
"accentText": "#
|
|
205
|
-
"accent2": "#
|
|
245
|
+
"accent": "#2a5f8d",
|
|
246
|
+
"accentHover": "#1f4d75",
|
|
247
|
+
"accentSoft": "rgba(42,95,141,0.08)",
|
|
248
|
+
"accentText": "#275782",
|
|
249
|
+
"accent2": "#2a5f8d",
|
|
206
250
|
"onAccent": "#ffffff",
|
|
207
|
-
"ring": "#
|
|
208
|
-
"info": "#
|
|
209
|
-
"infoText": "#
|
|
210
|
-
"brandGradientFrom": "#
|
|
211
|
-
"brandGradientVia": "#
|
|
251
|
+
"ring": "#2a5f8d",
|
|
252
|
+
"info": "#2a5f8d",
|
|
253
|
+
"infoText": "#275782",
|
|
254
|
+
"brandGradientFrom": "#e7eef4",
|
|
255
|
+
"brandGradientVia": "#f5f7fa",
|
|
212
256
|
"brandGradientTo": "#fafafa"
|
|
213
257
|
}
|
|
214
258
|
},
|
|
@@ -221,8 +265,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
221
265
|
"accent2": "#f59e0b",
|
|
222
266
|
"onAccent": "#0c0c0e",
|
|
223
267
|
"ring": "#f67e23",
|
|
224
|
-
"info": "#
|
|
225
|
-
"infoText": "#
|
|
268
|
+
"info": "#5e99c9",
|
|
269
|
+
"infoText": "#8ebde1",
|
|
226
270
|
"brandGradientFrom": "#28170b",
|
|
227
271
|
"brandGradientVia": "#17130c",
|
|
228
272
|
"brandGradientTo": "#0c0c0e"
|
|
@@ -235,8 +279,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
235
279
|
"accent2": "#a45904",
|
|
236
280
|
"onAccent": "#ffffff",
|
|
237
281
|
"ring": "#b45309",
|
|
238
|
-
"info": "#
|
|
239
|
-
"infoText": "#
|
|
282
|
+
"info": "#2a5f8d",
|
|
283
|
+
"infoText": "#275782",
|
|
240
284
|
"brandGradientFrom": "#ffebd6",
|
|
241
285
|
"brandGradientVia": "#fdf7ed",
|
|
242
286
|
"brandGradientTo": "#fafafa"
|
|
@@ -281,8 +325,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
281
325
|
"accent2": "#22c378",
|
|
282
326
|
"onAccent": "#0c0c0e",
|
|
283
327
|
"ring": "#24dbc9",
|
|
284
|
-
"info": "#
|
|
285
|
-
"infoText": "#
|
|
328
|
+
"info": "#5e99c9",
|
|
329
|
+
"infoText": "#8ebde1",
|
|
286
330
|
"brandGradientFrom": "#0a241e",
|
|
287
331
|
"brandGradientVia": "#0c1818",
|
|
288
332
|
"brandGradientTo": "#0c0c0e"
|
|
@@ -295,8 +339,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
295
339
|
"accent2": "#107546",
|
|
296
340
|
"onAccent": "#ffffff",
|
|
297
341
|
"ring": "#097169",
|
|
298
|
-
"info": "#
|
|
299
|
-
"infoText": "#
|
|
342
|
+
"info": "#2a5f8d",
|
|
343
|
+
"infoText": "#275782",
|
|
300
344
|
"brandGradientFrom": "#e1faf1",
|
|
301
345
|
"brandGradientVia": "#e9fbfa",
|
|
302
346
|
"brandGradientTo": "#fafafa"
|
|
@@ -311,8 +355,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
311
355
|
"accent2": "#c3a579",
|
|
312
356
|
"onAccent": "#0c0c0e",
|
|
313
357
|
"ring": "#98b587",
|
|
314
|
-
"info": "#
|
|
315
|
-
"infoText": "#
|
|
358
|
+
"info": "#5e99c9",
|
|
359
|
+
"infoText": "#8ebde1",
|
|
316
360
|
"brandGradientFrom": "#1c1812",
|
|
317
361
|
"brandGradientVia": "#11140f",
|
|
318
362
|
"brandGradientTo": "#0c0c0e"
|
|
@@ -325,8 +369,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
325
369
|
"accent2": "#745834",
|
|
326
370
|
"onAccent": "#ffffff",
|
|
327
371
|
"ring": "#456237",
|
|
328
|
-
"info": "#
|
|
329
|
-
"infoText": "#
|
|
372
|
+
"info": "#2a5f8d",
|
|
373
|
+
"infoText": "#275782",
|
|
330
374
|
"brandGradientFrom": "#f5efe5",
|
|
331
375
|
"brandGradientVia": "#f1f6ee",
|
|
332
376
|
"brandGradientTo": "#fafafa"
|
|
@@ -341,8 +385,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
341
385
|
"accent2": "#8d9aec",
|
|
342
386
|
"onAccent": "#0c0c0e",
|
|
343
387
|
"ring": "#8888f2",
|
|
344
|
-
"info": "#
|
|
345
|
-
"infoText": "#
|
|
388
|
+
"info": "#5e99c9",
|
|
389
|
+
"infoText": "#8ebde1",
|
|
346
390
|
"brandGradientFrom": "#121321",
|
|
347
391
|
"brandGradientVia": "#111019",
|
|
348
392
|
"brandGradientTo": "#0c0c0e"
|
|
@@ -355,8 +399,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
355
399
|
"accent2": "#2d3c9f",
|
|
356
400
|
"onAccent": "#ffffff",
|
|
357
401
|
"ring": "#3c38b2",
|
|
358
|
-
"info": "#
|
|
359
|
-
"infoText": "#
|
|
402
|
+
"info": "#2a5f8d",
|
|
403
|
+
"infoText": "#275782",
|
|
360
404
|
"brandGradientFrom": "#ebecfa",
|
|
361
405
|
"brandGradientVia": "#f0f0fa",
|
|
362
406
|
"brandGradientTo": "#fafafa"
|
|
@@ -371,8 +415,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
371
415
|
"accent2": "#7695f9",
|
|
372
416
|
"onAccent": "#0c0e17",
|
|
373
417
|
"ring": "#fbcf23",
|
|
374
|
-
"info": "#
|
|
375
|
-
"infoText": "#
|
|
418
|
+
"info": "#5e99c9",
|
|
419
|
+
"infoText": "#8ebde1",
|
|
376
420
|
"brandGradientFrom": "#101628",
|
|
377
421
|
"brandGradientVia": "#0f111a",
|
|
378
422
|
"brandGradientTo": "#0c0c0e"
|
|
@@ -385,8 +429,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
385
429
|
"accent2": "#6285f8",
|
|
386
430
|
"onAccent": "#0c0e17",
|
|
387
431
|
"ring": "#1743d3",
|
|
388
|
-
"info": "#
|
|
389
|
-
"infoText": "#
|
|
432
|
+
"info": "#2a5f8d",
|
|
433
|
+
"infoText": "#275782",
|
|
390
434
|
"brandGradientFrom": "#e8edfc",
|
|
391
435
|
"brandGradientVia": "#fcf8e8",
|
|
392
436
|
"brandGradientTo": "#fafafa"
|
|
@@ -401,8 +445,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
401
445
|
"accent2": "#dc946a",
|
|
402
446
|
"onAccent": "#0a0f0c",
|
|
403
447
|
"ring": "#65c374",
|
|
404
|
-
"info": "#
|
|
405
|
-
"infoText": "#
|
|
448
|
+
"info": "#5e99c9",
|
|
449
|
+
"infoText": "#8ebde1",
|
|
406
450
|
"brandGradientFrom": "#111d15",
|
|
407
451
|
"brandGradientVia": "#181410",
|
|
408
452
|
"brandGradientTo": "#0c0c0e"
|
|
@@ -415,8 +459,8 @@ var brands = /* @__PURE__ */ Object.freeze({
|
|
|
415
459
|
"accent2": "#954923",
|
|
416
460
|
"onAccent": "#ffffff",
|
|
417
461
|
"ring": "#21692f",
|
|
418
|
-
"info": "#
|
|
419
|
-
"infoText": "#
|
|
462
|
+
"info": "#2a5f8d",
|
|
463
|
+
"infoText": "#275782",
|
|
420
464
|
"brandGradientFrom": "#e9f7eb",
|
|
421
465
|
"brandGradientVia": "#faf1eb",
|
|
422
466
|
"brandGradientTo": "#fafafa"
|
|
@@ -764,7 +808,7 @@ function Map({
|
|
|
764
808
|
) });
|
|
765
809
|
}
|
|
766
810
|
var noSubscription = () => () => void 0;
|
|
767
|
-
function Marker({ position, label, onPress, selected, size = 18, children }) {
|
|
811
|
+
function Marker({ position, label, onPress, selected, size = 18, children, drop }) {
|
|
768
812
|
const { map: m, lib, places } = useMap();
|
|
769
813
|
const s = map();
|
|
770
814
|
const id = React2.useId();
|
|
@@ -795,8 +839,9 @@ function Marker({ position, label, onPress, selected, size = 18, children }) {
|
|
|
795
839
|
"aria-hidden": onPress ? void 0 : true,
|
|
796
840
|
"aria-pressed": onPress && selected !== void 0 ? selected : void 0,
|
|
797
841
|
"data-selected": selected ? "" : void 0,
|
|
842
|
+
"data-drop": drop === void 0 ? void 0 : "",
|
|
798
843
|
className: s.marker(),
|
|
799
|
-
style: children ?
|
|
844
|
+
style: { ...children ? null : { width: size, height: size }, ...drop === void 0 ? null : { "--kz-map-drop-delay": `${drop}ms` } },
|
|
800
845
|
onClick: onPress,
|
|
801
846
|
children: [
|
|
802
847
|
children,
|
|
@@ -824,6 +869,92 @@ function UserPosition({ position, label, accuracy }) {
|
|
|
824
869
|
}, [m, lib, position[0], position[1]]);
|
|
825
870
|
return accuracy ? /* @__PURE__ */ jsx(RadiusCircle, { center: position, radius: accuracy, tone: "soft" }) : null;
|
|
826
871
|
}
|
|
872
|
+
function Pulse({ position, label, size = 56, tone = "accent" }) {
|
|
873
|
+
const { map: m, lib, places } = useMap();
|
|
874
|
+
const id = React2.useId();
|
|
875
|
+
React2.useEffect(() => {
|
|
876
|
+
places.add(id, label);
|
|
877
|
+
return () => places.remove(id);
|
|
878
|
+
}, [id, label, places]);
|
|
879
|
+
React2.useEffect(() => {
|
|
880
|
+
if (!m || !lib) return;
|
|
881
|
+
const el = document.createElement("div");
|
|
882
|
+
el.className = "kz-map-pulse";
|
|
883
|
+
el.setAttribute("data-tone", tone);
|
|
884
|
+
el.setAttribute("aria-hidden", "true");
|
|
885
|
+
el.style.setProperty("--kz-map-pulse-size", `${size}px`);
|
|
886
|
+
const marker = new lib.Marker({ element: el, anchor: "center" }).setLngLat([...position]).addTo(m);
|
|
887
|
+
return () => void marker.remove();
|
|
888
|
+
}, [m, lib, tone, size, position[0], position[1]]);
|
|
889
|
+
return null;
|
|
890
|
+
}
|
|
891
|
+
function Route({ path, label, draw = true, duration = 1400, courier, tripDuration = 3200, repeatAfter, replayKey, tone = "accent" }) {
|
|
892
|
+
const { map: m, lib, ready, reduce, places } = useMap();
|
|
893
|
+
const id = `kz-route-${React2.useId().replace(/[^a-zA-Z0-9]/g, "")}`;
|
|
894
|
+
const animated = draw && !reduce;
|
|
895
|
+
const token = replayKey ?? 0;
|
|
896
|
+
const [doneFor, setDoneFor] = React2.useState(null);
|
|
897
|
+
const drawn = !animated || doneFor === token;
|
|
898
|
+
const whole = React2.useMemo(() => sliceLine(path, 1), [path]);
|
|
899
|
+
const start = React2.useMemo(() => sliceLine(path, 0), [path]);
|
|
900
|
+
React2.useEffect(() => {
|
|
901
|
+
places.add(id, label);
|
|
902
|
+
return () => places.remove(id);
|
|
903
|
+
}, [id, label, places]);
|
|
904
|
+
useGeoLayer(id, drawn ? whole : start, (c) => [
|
|
905
|
+
{ id: `${id}-casing`, type: "line", source: id, layout: { "line-cap": "round", "line-join": "round" }, paint: { "line-color": c.accent, "line-width": 9, "line-opacity": tone === "soft" ? 0.08 : 0.16, "line-blur": 3 } },
|
|
906
|
+
{ id: `${id}-line`, type: "line", source: id, layout: { "line-cap": "round", "line-join": "round" }, paint: { "line-color": c.accent, "line-width": tone === "soft" ? 2 : 3.5, "line-opacity": tone === "soft" ? 0.6 : 1 } }
|
|
907
|
+
]);
|
|
908
|
+
const [visible, setVisible] = React2.useState(() => typeof IntersectionObserver === "undefined");
|
|
909
|
+
React2.useEffect(() => {
|
|
910
|
+
const el = m?.getContainer?.();
|
|
911
|
+
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
912
|
+
const io = new IntersectionObserver(([entry]) => setVisible(!!entry?.isIntersecting), { threshold: 0.25 });
|
|
913
|
+
io.observe(el);
|
|
914
|
+
return () => io.disconnect();
|
|
915
|
+
}, [m]);
|
|
916
|
+
React2.useEffect(() => {
|
|
917
|
+
if (!m || !ready || !animated || drawn || !visible) return;
|
|
918
|
+
const source = m.getSource(id);
|
|
919
|
+
let frame = 0;
|
|
920
|
+
const began = performance.now();
|
|
921
|
+
const step = (now) => {
|
|
922
|
+
const t = Math.min(1, (now - began) / Math.max(1, duration));
|
|
923
|
+
source?.setData?.(sliceLine(path, 1 - (1 - t) ** 3));
|
|
924
|
+
if (t < 1) frame = requestAnimationFrame(step);
|
|
925
|
+
else setDoneFor(token);
|
|
926
|
+
};
|
|
927
|
+
frame = requestAnimationFrame(step);
|
|
928
|
+
return () => cancelAnimationFrame(frame);
|
|
929
|
+
}, [m, ready, animated, drawn, visible, id, path, duration, token]);
|
|
930
|
+
const [trip, setTrip] = React2.useState(0);
|
|
931
|
+
React2.useEffect(() => {
|
|
932
|
+
if (!courier || !m || !lib || !ready || !drawn) return;
|
|
933
|
+
const el = document.createElement("div");
|
|
934
|
+
el.className = "kz-map-courier";
|
|
935
|
+
el.setAttribute("aria-hidden", "true");
|
|
936
|
+
const marker = new lib.Marker({ element: el, anchor: "center" }).setLngLat([...path[reduce ? path.length - 1 : 0] ?? [0, 0]]).addTo(m);
|
|
937
|
+
let frame = 0;
|
|
938
|
+
let timer;
|
|
939
|
+
if (!reduce && visible) {
|
|
940
|
+
const began = performance.now();
|
|
941
|
+
const step = (now) => {
|
|
942
|
+
const t = Math.min(1, (now - began) / Math.max(1, tripDuration));
|
|
943
|
+
const eased = t < 0.5 ? 2 * t * t : 1 - (-2 * t + 2) ** 2 / 2;
|
|
944
|
+
marker.setLngLat([...pointAlong(path, eased).position]);
|
|
945
|
+
if (t < 1) frame = requestAnimationFrame(step);
|
|
946
|
+
else if (repeatAfter !== void 0) timer = setTimeout(() => setTrip((n) => n + 1), repeatAfter);
|
|
947
|
+
};
|
|
948
|
+
frame = requestAnimationFrame(step);
|
|
949
|
+
} else if (!reduce) marker.setLngLat([...path[path.length - 1] ?? [0, 0]]);
|
|
950
|
+
return () => {
|
|
951
|
+
cancelAnimationFrame(frame);
|
|
952
|
+
clearTimeout(timer);
|
|
953
|
+
marker.remove();
|
|
954
|
+
};
|
|
955
|
+
}, [courier, m, lib, ready, drawn, visible, reduce, path, tripDuration, repeatAfter, trip, token]);
|
|
956
|
+
return null;
|
|
957
|
+
}
|
|
827
958
|
function useGeoLayer(id, data, layers2, source = {}) {
|
|
828
959
|
const { map: m, ready } = useMap();
|
|
829
960
|
const dataRef = React2.useRef(data);
|
|
@@ -1023,8 +1154,10 @@ export {
|
|
|
1023
1154
|
MAP_TILES,
|
|
1024
1155
|
Map,
|
|
1025
1156
|
Marker,
|
|
1157
|
+
Pulse,
|
|
1026
1158
|
REGION_FROM_ZOOM,
|
|
1027
1159
|
RadiusCircle,
|
|
1160
|
+
Route,
|
|
1028
1161
|
StaticMap,
|
|
1029
1162
|
UserPosition,
|
|
1030
1163
|
circlePolygon,
|
|
@@ -1040,8 +1173,11 @@ export {
|
|
|
1040
1173
|
mapPalette,
|
|
1041
1174
|
mapStyle,
|
|
1042
1175
|
mix,
|
|
1176
|
+
pathLength,
|
|
1177
|
+
pointAlong,
|
|
1043
1178
|
project,
|
|
1044
1179
|
setMapAssetsBase,
|
|
1180
|
+
sliceLine,
|
|
1045
1181
|
staticMap,
|
|
1046
1182
|
useMap
|
|
1047
1183
|
};
|