@next-degree/pickle-shared-js 0.12.7 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{company_service_sanity-2J1ZuUnu.d.cts → company_service_sanity-ByIKe90u.d.cts} +560 -560
- package/dist/{company_service_sanity-KaAGfnNV.d.ts → company_service_sanity-DbYwWmnS.d.ts} +560 -560
- package/dist/components/buttons/BackButton.cjs +5 -8
- package/dist/components/buttons/BackButton.cjs.map +1 -1
- package/dist/components/buttons/BackButton.d.cts +2 -2
- package/dist/components/buttons/BackButton.d.ts +2 -2
- package/dist/components/buttons/BackButton.js +5 -8
- package/dist/components/buttons/BackButton.js.map +1 -1
- package/dist/components/company/CompanyBenefits.cjs +1 -5
- package/dist/components/company/CompanyBenefits.cjs.map +1 -1
- package/dist/components/company/CompanyBenefits.d.cts +2 -2
- package/dist/components/company/CompanyBenefits.d.ts +2 -2
- package/dist/components/company/CompanyBenefits.js +1 -5
- package/dist/components/company/CompanyBenefits.js.map +1 -1
- package/dist/components/company/CompanyInformation.cjs +23 -44
- package/dist/components/company/CompanyInformation.cjs.map +1 -1
- package/dist/components/company/CompanyInformation.d.cts +2 -2
- package/dist/components/company/CompanyInformation.d.ts +2 -2
- package/dist/components/company/CompanyInformation.js +23 -44
- package/dist/components/company/CompanyInformation.js.map +1 -1
- package/dist/components/company/CompanyTake.cjs +12 -26
- package/dist/components/company/CompanyTake.cjs.map +1 -1
- package/dist/components/company/CompanyTake.d.cts +2 -2
- package/dist/components/company/CompanyTake.d.ts +2 -2
- package/dist/components/company/CompanyTake.js +12 -26
- package/dist/components/company/CompanyTake.js.map +1 -1
- package/dist/components/jobCard/JobLocation.cjs +23 -34
- package/dist/components/jobCard/JobLocation.cjs.map +1 -1
- package/dist/components/jobCard/JobLocation.d.cts +3 -3
- package/dist/components/jobCard/JobLocation.d.ts +3 -3
- package/dist/components/jobCard/JobLocation.js +23 -34
- package/dist/components/jobCard/JobLocation.js.map +1 -1
- package/dist/components/jobPost/JobDescription.cjs +164 -30
- package/dist/components/jobPost/JobDescription.cjs.map +1 -1
- package/dist/components/jobPost/JobDescription.d.cts +2 -2
- package/dist/components/jobPost/JobDescription.d.ts +2 -2
- package/dist/components/jobPost/JobDescription.js +164 -30
- package/dist/components/jobPost/JobDescription.js.map +1 -1
- package/dist/components/jobPost/JobHeader.cjs +110 -138
- package/dist/components/jobPost/JobHeader.cjs.map +1 -1
- package/dist/components/jobPost/JobHeader.d.cts +2 -2
- package/dist/components/jobPost/JobHeader.d.ts +2 -2
- package/dist/components/jobPost/JobHeader.js +110 -138
- package/dist/components/jobPost/JobHeader.js.map +1 -1
- package/dist/components/jobPost/JobPost.cjs +382 -318
- package/dist/components/jobPost/JobPost.cjs.map +1 -1
- package/dist/components/jobPost/JobPost.d.cts +3 -3
- package/dist/components/jobPost/JobPost.d.ts +3 -3
- package/dist/components/jobPost/JobPost.js +344 -280
- package/dist/components/jobPost/JobPost.js.map +1 -1
- package/dist/components/primitives/avatar.cjs +3 -4
- package/dist/components/primitives/avatar.cjs.map +1 -1
- package/dist/components/primitives/avatar.js +3 -4
- package/dist/components/primitives/avatar.js.map +1 -1
- package/dist/components/primitives/command.cjs +37 -50
- package/dist/components/primitives/command.cjs.map +1 -1
- package/dist/components/primitives/command.d.cts +5 -6
- package/dist/components/primitives/command.d.ts +5 -6
- package/dist/components/primitives/command.js +37 -50
- package/dist/components/primitives/command.js.map +1 -1
- package/dist/components/primitives/dialog.cjs +18 -27
- package/dist/components/primitives/dialog.cjs.map +1 -1
- package/dist/components/primitives/dialog.d.cts +2 -3
- package/dist/components/primitives/dialog.d.ts +2 -3
- package/dist/components/primitives/dialog.js +18 -27
- package/dist/components/primitives/dialog.js.map +1 -1
- package/dist/components/primitives/input-otp.cjs +8 -11
- package/dist/components/primitives/input-otp.cjs.map +1 -1
- package/dist/components/primitives/input-otp.d.cts +2 -2
- package/dist/components/primitives/input-otp.d.ts +2 -2
- package/dist/components/primitives/input-otp.js +8 -11
- package/dist/components/primitives/input-otp.js.map +1 -1
- package/dist/components/primitives/popover.cjs +2 -3
- package/dist/components/primitives/popover.cjs.map +1 -1
- package/dist/components/primitives/popover.js +2 -3
- package/dist/components/primitives/popover.js.map +1 -1
- package/dist/components/primitives/radio-group.cjs +12 -16
- package/dist/components/primitives/radio-group.cjs.map +1 -1
- package/dist/components/primitives/radio-group.js +12 -16
- package/dist/components/primitives/radio-group.js.map +1 -1
- package/dist/components/primitives/separator.cjs +1 -2
- package/dist/components/primitives/separator.cjs.map +1 -1
- package/dist/components/primitives/separator.js +1 -2
- package/dist/components/primitives/separator.js.map +1 -1
- package/dist/components/primitives/tooltip.cjs +1 -2
- package/dist/components/primitives/tooltip.cjs.map +1 -1
- package/dist/components/primitives/tooltip.js +1 -2
- package/dist/components/primitives/tooltip.js.map +1 -1
- package/dist/components/ui/Avatar.cjs +6 -11
- package/dist/components/ui/Avatar.cjs.map +1 -1
- package/dist/components/ui/Avatar.d.cts +3 -3
- package/dist/components/ui/Avatar.d.ts +3 -3
- package/dist/components/ui/Avatar.js +6 -11
- package/dist/components/ui/Avatar.js.map +1 -1
- package/dist/components/ui/Badge.cjs +12 -2
- package/dist/components/ui/Badge.cjs.map +1 -1
- package/dist/components/ui/Badge.d.cts +1 -2
- package/dist/components/ui/Badge.d.ts +1 -2
- package/dist/components/ui/Badge.js +2 -2
- package/dist/components/ui/Badge.js.map +1 -1
- package/dist/components/ui/Button.cjs +163 -8
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.cts +4 -8
- package/dist/components/ui/Button.d.ts +4 -8
- package/dist/components/ui/Button.js +153 -8
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs +18 -28
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.js +18 -28
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/Chip.cjs +12 -2
- package/dist/components/ui/Chip.cjs.map +1 -1
- package/dist/components/ui/Chip.d.cts +1 -2
- package/dist/components/ui/Chip.d.ts +1 -2
- package/dist/components/ui/Chip.js +2 -2
- package/dist/components/ui/Chip.js.map +1 -1
- package/dist/components/ui/Combobox.cjs +171 -233
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.js +171 -233
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/Counter.cjs +56 -74
- package/dist/components/ui/Counter.cjs.map +1 -1
- package/dist/components/ui/Counter.js +56 -74
- package/dist/components/ui/Counter.js.map +1 -1
- package/dist/components/ui/DatePicker.cjs +44 -68
- package/dist/components/ui/DatePicker.cjs.map +1 -1
- package/dist/components/ui/DatePicker.js +44 -68
- package/dist/components/ui/DatePicker.js.map +1 -1
- package/dist/components/ui/DismissibleBanner.cjs +13 -16
- package/dist/components/ui/DismissibleBanner.cjs.map +1 -1
- package/dist/components/ui/DismissibleBanner.d.cts +2 -2
- package/dist/components/ui/DismissibleBanner.d.ts +2 -2
- package/dist/components/ui/DismissibleBanner.js +13 -16
- package/dist/components/ui/DismissibleBanner.js.map +1 -1
- package/dist/components/ui/ErrorMessage.cjs +1 -2
- package/dist/components/ui/ErrorMessage.cjs.map +1 -1
- package/dist/components/ui/ErrorMessage.d.cts +2 -2
- package/dist/components/ui/ErrorMessage.d.ts +2 -2
- package/dist/components/ui/ErrorMessage.js +1 -2
- package/dist/components/ui/ErrorMessage.js.map +1 -1
- package/dist/components/ui/Icon.cjs +1 -2
- package/dist/components/ui/Icon.cjs.map +1 -1
- package/dist/components/ui/Icon.js +1 -2
- package/dist/components/ui/Icon.js.map +1 -1
- package/dist/components/ui/Input.cjs +48 -68
- package/dist/components/ui/Input.cjs.map +1 -1
- package/dist/components/ui/Input.js +48 -68
- package/dist/components/ui/Input.js.map +1 -1
- package/dist/components/ui/InputOtp.cjs +56 -73
- package/dist/components/ui/InputOtp.cjs.map +1 -1
- package/dist/components/ui/InputOtp.js +56 -73
- package/dist/components/ui/InputOtp.js.map +1 -1
- package/dist/components/ui/Label.cjs +14 -24
- package/dist/components/ui/Label.cjs.map +1 -1
- package/dist/components/ui/Label.d.cts +2 -2
- package/dist/components/ui/Label.d.ts +2 -2
- package/dist/components/ui/Label.js +14 -24
- package/dist/components/ui/Label.js.map +1 -1
- package/dist/components/ui/LinkButton.cjs +5 -5
- package/dist/components/ui/LinkButton.cjs.map +1 -1
- package/dist/components/ui/LinkButton.d.cts +1 -2
- package/dist/components/ui/LinkButton.d.ts +1 -2
- package/dist/components/ui/LinkButton.js +5 -5
- package/dist/components/ui/LinkButton.js.map +1 -1
- package/dist/components/ui/ListItem.cjs +32 -48
- package/dist/components/ui/ListItem.cjs.map +1 -1
- package/dist/components/ui/ListItem.d.cts +2 -2
- package/dist/components/ui/ListItem.d.ts +2 -2
- package/dist/components/ui/ListItem.js +32 -48
- package/dist/components/ui/ListItem.js.map +1 -1
- package/dist/components/ui/Map/ClusterMarker.cjs +80 -0
- package/dist/components/ui/Map/ClusterMarker.cjs.map +1 -0
- package/dist/components/ui/Map/ClusterMarker.d.cts +6 -0
- package/dist/components/ui/Map/ClusterMarker.d.ts +6 -0
- package/dist/components/ui/Map/ClusterMarker.js +56 -0
- package/dist/components/ui/Map/ClusterMarker.js.map +1 -0
- package/dist/components/ui/Map/FocusCircle.cjs +86 -0
- package/dist/components/ui/Map/FocusCircle.cjs.map +1 -0
- package/dist/components/ui/Map/FocusCircle.d.cts +5 -0
- package/dist/components/ui/Map/FocusCircle.d.ts +5 -0
- package/dist/components/ui/Map/FocusCircle.js +62 -0
- package/dist/components/ui/Map/FocusCircle.js.map +1 -0
- package/dist/components/ui/Map/IndividualMarker.cjs +60 -0
- package/dist/components/ui/Map/IndividualMarker.cjs.map +1 -0
- package/dist/components/ui/Map/IndividualMarker.d.cts +6 -0
- package/dist/components/ui/Map/IndividualMarker.d.ts +6 -0
- package/dist/components/ui/Map/IndividualMarker.js +36 -0
- package/dist/components/ui/Map/IndividualMarker.js.map +1 -0
- package/dist/components/ui/Map/MapComponent.cjs +401 -0
- package/dist/components/ui/Map/MapComponent.cjs.map +1 -0
- package/dist/components/ui/Map/MapComponent.d.cts +6 -0
- package/dist/components/ui/Map/MapComponent.d.ts +6 -0
- package/dist/components/ui/Map/MapComponent.js +367 -0
- package/dist/components/ui/Map/MapComponent.js.map +1 -0
- package/dist/components/ui/Map/MapContent.cjs +279 -0
- package/dist/components/ui/Map/MapContent.cjs.map +1 -0
- package/dist/components/ui/Map/MapContent.d.cts +6 -0
- package/dist/components/ui/Map/MapContent.d.ts +6 -0
- package/dist/components/ui/Map/MapContent.js +255 -0
- package/dist/components/ui/Map/MapContent.js.map +1 -0
- package/dist/components/ui/Map/clustering.cjs +105 -0
- package/dist/components/ui/Map/clustering.cjs.map +1 -0
- package/dist/components/ui/Map/clustering.d.cts +17 -0
- package/dist/components/ui/Map/clustering.d.ts +17 -0
- package/dist/components/ui/Map/clustering.js +77 -0
- package/dist/components/ui/Map/clustering.js.map +1 -0
- package/dist/components/ui/Map/constants.cjs +65 -0
- package/dist/components/ui/Map/constants.cjs.map +1 -0
- package/dist/components/ui/Map/constants.d.cts +28 -0
- package/dist/components/ui/Map/constants.d.ts +28 -0
- package/dist/components/ui/Map/constants.js +34 -0
- package/dist/components/ui/Map/constants.js.map +1 -0
- package/dist/components/ui/Map/hooks.cjs +96 -0
- package/dist/components/ui/Map/hooks.cjs.map +1 -0
- package/dist/components/ui/Map/hooks.d.cts +17 -0
- package/dist/components/ui/Map/hooks.d.ts +17 -0
- package/dist/components/ui/Map/hooks.js +59 -0
- package/dist/components/ui/Map/hooks.js.map +1 -0
- package/dist/components/ui/Map/index.cjs +402 -0
- package/dist/components/ui/Map/index.cjs.map +1 -0
- package/dist/components/ui/Map/index.d.cts +3 -0
- package/dist/components/ui/Map/index.d.ts +3 -0
- package/dist/components/ui/Map/index.js +365 -0
- package/dist/components/ui/Map/index.js.map +1 -0
- package/dist/components/ui/Map/types.cjs +19 -0
- package/dist/components/ui/Map/types.cjs.map +1 -0
- package/dist/components/ui/Map/types.d.cts +82 -0
- package/dist/components/ui/Map/types.d.ts +82 -0
- package/dist/components/ui/Map/types.js +1 -0
- package/dist/components/ui/Map/types.js.map +1 -0
- package/dist/components/ui/Map/utils.cjs +80 -0
- package/dist/components/ui/Map/utils.cjs.map +1 -0
- package/dist/components/ui/Map/utils.d.cts +9 -0
- package/dist/components/ui/Map/utils.d.ts +9 -0
- package/dist/components/ui/Map/utils.js +49 -0
- package/dist/components/ui/Map/utils.js.map +1 -0
- package/dist/components/ui/PlacesQueryInput.cjs +71 -94
- package/dist/components/ui/PlacesQueryInput.cjs.map +1 -1
- package/dist/components/ui/PlacesQueryInput.d.cts +2 -2
- package/dist/components/ui/PlacesQueryInput.d.ts +2 -2
- package/dist/components/ui/PlacesQueryInput.js +71 -94
- package/dist/components/ui/PlacesQueryInput.js.map +1 -1
- package/dist/components/ui/Radio.cjs +49 -69
- package/dist/components/ui/Radio.cjs.map +1 -1
- package/dist/components/ui/Radio.js +49 -69
- package/dist/components/ui/Radio.js.map +1 -1
- package/dist/components/ui/ReadMore.cjs +163 -25
- package/dist/components/ui/ReadMore.cjs.map +1 -1
- package/dist/components/ui/ReadMore.d.cts +2 -2
- package/dist/components/ui/ReadMore.d.ts +2 -2
- package/dist/components/ui/ReadMore.js +163 -25
- package/dist/components/ui/ReadMore.js.map +1 -1
- package/dist/components/ui/Select.cjs +138 -172
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.js +132 -166
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/StepTabs.cjs +24 -27
- package/dist/components/ui/StepTabs.cjs.map +1 -1
- package/dist/components/ui/StepTabs.d.cts +3 -3
- package/dist/components/ui/StepTabs.d.ts +3 -3
- package/dist/components/ui/StepTabs.js +24 -27
- package/dist/components/ui/StepTabs.js.map +1 -1
- package/dist/components/ui/Switch.cjs +13 -21
- package/dist/components/ui/Switch.cjs.map +1 -1
- package/dist/components/ui/Switch.js +13 -21
- package/dist/components/ui/Switch.js.map +1 -1
- package/dist/components/ui/buttonShadcn.cjs +1 -2
- package/dist/components/ui/buttonShadcn.cjs.map +1 -1
- package/dist/components/ui/buttonShadcn.d.cts +1 -1
- package/dist/components/ui/buttonShadcn.d.ts +1 -1
- package/dist/components/ui/buttonShadcn.js +1 -2
- package/dist/components/ui/buttonShadcn.js.map +1 -1
- package/dist/components/ui/calendar.cjs +5 -6
- package/dist/components/ui/calendar.cjs.map +1 -1
- package/dist/components/ui/calendar.d.cts +1 -2
- package/dist/components/ui/calendar.d.ts +1 -2
- package/dist/components/ui/calendar.js +5 -6
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/contexts/WindowHistoryProvider.cjs +1 -2
- package/dist/contexts/WindowHistoryProvider.cjs.map +1 -1
- package/dist/contexts/WindowHistoryProvider.d.cts +1 -2
- package/dist/contexts/WindowHistoryProvider.d.ts +1 -2
- package/dist/contexts/WindowHistoryProvider.js +1 -2
- package/dist/contexts/WindowHistoryProvider.js.map +1 -1
- package/dist/{displayText-DahwdHdi.d.ts → displayText-Ce_aqgGP.d.ts} +2 -2
- package/dist/{displayText-DW0qiJqh.d.cts → displayText-Cm8PqS6s.d.cts} +2 -2
- package/dist/hooks/useDisplayText.d.cts +3 -3
- package/dist/hooks/useDisplayText.d.ts +3 -3
- package/dist/hooks/useWindowHistory.cjs +0 -1
- package/dist/hooks/useWindowHistory.cjs.map +1 -1
- package/dist/hooks/useWindowHistory.d.cts +0 -1
- package/dist/hooks/useWindowHistory.d.ts +0 -1
- package/dist/hooks/useWindowHistory.js +0 -1
- package/dist/hooks/useWindowHistory.js.map +1 -1
- package/dist/index.cjs +1343 -1111
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1293 -1061
- package/dist/index.js.map +1 -1
- package/dist/{job_posting_service_sanity-BKo9TBDT.d.ts → job_posting_service_sanity-1eG3Jh9_.d.ts} +496 -496
- package/dist/{job_posting_service_sanity-BNq-Am9N.d.cts → job_posting_service_sanity-DKYye6oH.d.cts} +496 -496
- package/dist/lib/locations.d.cts +3 -3
- package/dist/lib/locations.d.ts +3 -3
- package/dist/lib/mappings.d.cts +3 -3
- package/dist/lib/mappings.d.ts +3 -3
- package/dist/lib/salaryRange.d.cts +1 -1
- package/dist/lib/salaryRange.d.ts +1 -1
- package/dist/services/displayText.d.cts +3 -3
- package/dist/services/displayText.d.ts +3 -3
- package/dist/styles/globals.css +179 -6
- package/dist/styles/globals.css.map +1 -1
- package/dist/types/data/company_service_latest.d.cts +1 -1
- package/dist/types/data/company_service_latest.d.ts +1 -1
- package/dist/types/data/job_posting_service_latest.d.cts +1 -1
- package/dist/types/data/job_posting_service_latest.d.ts +1 -1
- package/dist/types/data/shared_pickle_output_latest.d.cts +1 -1
- package/dist/types/data/shared_pickle_output_latest.d.ts +1 -1
- package/dist/types/index.d.cts +6 -6
- package/dist/types/index.d.ts +6 -6
- package/dist/types/latest/company_service_latest.d.cts +1 -1
- package/dist/types/latest/company_service_latest.d.ts +1 -1
- package/dist/types/latest/custom/company_service_sanity.d.cts +3 -3
- package/dist/types/latest/custom/company_service_sanity.d.ts +3 -3
- package/dist/types/latest/custom/job_posting_service_sanity.d.cts +3 -3
- package/dist/types/latest/custom/job_posting_service_sanity.d.ts +3 -3
- package/dist/types/latest/job_posting_service_latest.d.cts +1 -1
- package/dist/types/latest/job_posting_service_latest.d.ts +1 -1
- package/dist/types/latest/shared_pickle_output_latest.d.cts +1 -1
- package/dist/types/latest/shared_pickle_output_latest.d.ts +1 -1
- package/package.json +5 -3
- package/dist/components/ui/MapComponent.cjs +0 -61
- package/dist/components/ui/MapComponent.cjs.map +0 -1
- package/dist/components/ui/MapComponent.d.cts +0 -15
- package/dist/components/ui/MapComponent.d.ts +0 -15
- package/dist/components/ui/MapComponent.js +0 -41
- package/dist/components/ui/MapComponent.js.map +0 -1
- package/dist/{company_service_latest-CITz7F53.d.cts → company_service_latest-BjyG4KCB.d.cts} +319 -319
- package/dist/{company_service_latest-CITz7F53.d.ts → company_service_latest-BjyG4KCB.d.ts} +319 -319
- package/dist/{company_service_latest-C7Moeufo.d.cts → company_service_latest-KJi2W9Ij.d.cts} +319 -319
- package/dist/{company_service_latest-C7Moeufo.d.ts → company_service_latest-KJi2W9Ij.d.ts} +319 -319
- package/dist/{job_posting_service_latest-DdgK8Nnz.d.cts → job_posting_service_latest-82DHqOGu.d.cts} +274 -274
- package/dist/{job_posting_service_latest-DdgK8Nnz.d.ts → job_posting_service_latest-82DHqOGu.d.ts} +274 -274
- package/dist/{job_posting_service_latest-C_TEBzCf.d.cts → job_posting_service_latest-D9I5NE7l.d.cts} +274 -274
- package/dist/{job_posting_service_latest-C_TEBzCf.d.ts → job_posting_service_latest-D9I5NE7l.d.ts} +274 -274
- package/dist/{shared_pickle_output_latest-CtvHTPeX.d.cts → shared_pickle_output_latest-YbRs_xtC.d.cts} +22 -22
- package/dist/{shared_pickle_output_latest-CtvHTPeX.d.ts → shared_pickle_output_latest-YbRs_xtC.d.ts} +22 -22
- package/dist/{shared_pickle_output_latest-CXBCG04N.d.cts → shared_pickle_output_latest-dO-t8iZx.d.cts} +22 -22
- package/dist/{shared_pickle_output_latest-CXBCG04N.d.ts → shared_pickle_output_latest-dO-t8iZx.d.ts} +22 -22
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const DEFAULT_POSITION: {
|
|
2
|
+
lat: number;
|
|
3
|
+
lng: number;
|
|
4
|
+
};
|
|
5
|
+
declare const DEFAULT_ZOOM = 10;
|
|
6
|
+
declare const CLUSTER_PIN_SCALE = 1.5;
|
|
7
|
+
declare const CLUSTER_DISTANCE_THRESHOLD = 0.001;
|
|
8
|
+
declare const PIN_COLORS: {
|
|
9
|
+
readonly background: "#0B5441";
|
|
10
|
+
readonly borderColor: "#EBFDF1";
|
|
11
|
+
readonly glyphColor: "#D4F500";
|
|
12
|
+
};
|
|
13
|
+
declare const FOCUS_CIRCLE_STYLES: {
|
|
14
|
+
readonly strokeColor: "#0B5441";
|
|
15
|
+
readonly strokeOpacity: 0.8;
|
|
16
|
+
readonly strokeWeight: 2;
|
|
17
|
+
readonly fillColor: "#0B5441";
|
|
18
|
+
readonly fillOpacity: 0.1;
|
|
19
|
+
readonly clickable: false;
|
|
20
|
+
readonly zIndex: 1;
|
|
21
|
+
};
|
|
22
|
+
declare const CLUSTERING_CONFIG: {
|
|
23
|
+
readonly radius: 60;
|
|
24
|
+
readonly maxZoom: 16;
|
|
25
|
+
readonly minPoints: 2;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { CLUSTERING_CONFIG, CLUSTER_DISTANCE_THRESHOLD, CLUSTER_PIN_SCALE, DEFAULT_POSITION, DEFAULT_ZOOM, FOCUS_CIRCLE_STYLES, PIN_COLORS };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const DEFAULT_POSITION: {
|
|
2
|
+
lat: number;
|
|
3
|
+
lng: number;
|
|
4
|
+
};
|
|
5
|
+
declare const DEFAULT_ZOOM = 10;
|
|
6
|
+
declare const CLUSTER_PIN_SCALE = 1.5;
|
|
7
|
+
declare const CLUSTER_DISTANCE_THRESHOLD = 0.001;
|
|
8
|
+
declare const PIN_COLORS: {
|
|
9
|
+
readonly background: "#0B5441";
|
|
10
|
+
readonly borderColor: "#EBFDF1";
|
|
11
|
+
readonly glyphColor: "#D4F500";
|
|
12
|
+
};
|
|
13
|
+
declare const FOCUS_CIRCLE_STYLES: {
|
|
14
|
+
readonly strokeColor: "#0B5441";
|
|
15
|
+
readonly strokeOpacity: 0.8;
|
|
16
|
+
readonly strokeWeight: 2;
|
|
17
|
+
readonly fillColor: "#0B5441";
|
|
18
|
+
readonly fillOpacity: 0.1;
|
|
19
|
+
readonly clickable: false;
|
|
20
|
+
readonly zIndex: 1;
|
|
21
|
+
};
|
|
22
|
+
declare const CLUSTERING_CONFIG: {
|
|
23
|
+
readonly radius: 60;
|
|
24
|
+
readonly maxZoom: 16;
|
|
25
|
+
readonly minPoints: 2;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { CLUSTERING_CONFIG, CLUSTER_DISTANCE_THRESHOLD, CLUSTER_PIN_SCALE, DEFAULT_POSITION, DEFAULT_ZOOM, FOCUS_CIRCLE_STYLES, PIN_COLORS };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// src/components/ui/Map/constants.ts
|
|
2
|
+
var DEFAULT_POSITION = { lat: 40.715021, lng: -74.00459 };
|
|
3
|
+
var DEFAULT_ZOOM = 10;
|
|
4
|
+
var CLUSTER_PIN_SCALE = 1.5;
|
|
5
|
+
var CLUSTER_DISTANCE_THRESHOLD = 1e-3;
|
|
6
|
+
var PIN_COLORS = {
|
|
7
|
+
background: "#0B5441",
|
|
8
|
+
borderColor: "#EBFDF1",
|
|
9
|
+
glyphColor: "#D4F500"
|
|
10
|
+
};
|
|
11
|
+
var FOCUS_CIRCLE_STYLES = {
|
|
12
|
+
strokeColor: "#0B5441",
|
|
13
|
+
strokeOpacity: 0.8,
|
|
14
|
+
strokeWeight: 2,
|
|
15
|
+
fillColor: "#0B5441",
|
|
16
|
+
fillOpacity: 0.1,
|
|
17
|
+
clickable: false,
|
|
18
|
+
zIndex: 1
|
|
19
|
+
};
|
|
20
|
+
var CLUSTERING_CONFIG = {
|
|
21
|
+
radius: 60,
|
|
22
|
+
maxZoom: 16,
|
|
23
|
+
minPoints: 2
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
CLUSTERING_CONFIG,
|
|
27
|
+
CLUSTER_DISTANCE_THRESHOLD,
|
|
28
|
+
CLUSTER_PIN_SCALE,
|
|
29
|
+
DEFAULT_POSITION,
|
|
30
|
+
DEFAULT_ZOOM,
|
|
31
|
+
FOCUS_CIRCLE_STYLES,
|
|
32
|
+
PIN_COLORS
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/Map/constants.ts"],"sourcesContent":["export const DEFAULT_POSITION = { lat: 40.715021, lng: -74.00459 }\nexport const DEFAULT_ZOOM = 10\nexport const CLUSTER_PIN_SCALE = 1.5\nexport const CLUSTER_DISTANCE_THRESHOLD = 0.001\n\nexport const PIN_COLORS = {\n background: '#0B5441',\n borderColor: '#EBFDF1',\n glyphColor: '#D4F500',\n} as const\n\nexport const FOCUS_CIRCLE_STYLES = {\n strokeColor: '#0B5441',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: '#0B5441',\n fillOpacity: 0.1,\n clickable: false,\n zIndex: 1,\n} as const\n\nexport const CLUSTERING_CONFIG = {\n radius: 60,\n maxZoom: 16,\n minPoints: 2,\n} as const\n"],"mappings":";AAAO,IAAM,mBAAmB,EAAE,KAAK,WAAW,KAAK,UAAU;AAC1D,IAAM,eAAe;AACrB,IAAM,oBAAoB;AAC1B,IAAM,6BAA6B;AAEnC,IAAM,aAAa;AAAA,EACxB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,YAAY;AACd;AAEO,IAAM,sBAAsB;AAAA,EACjC,aAAa;AAAA,EACb,eAAe;AAAA,EACf,cAAc;AAAA,EACd,WAAW;AAAA,EACX,aAAa;AAAA,EACb,WAAW;AAAA,EACX,QAAQ;AACV;AAEO,IAAM,oBAAoB;AAAA,EAC/B,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AACb;","names":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/components/ui/Map/hooks.ts
|
|
31
|
+
var hooks_exports = {};
|
|
32
|
+
__export(hooks_exports, {
|
|
33
|
+
useClusters: () => useClusters,
|
|
34
|
+
useMapBounds: () => useMapBounds,
|
|
35
|
+
useZoomLevel: () => useZoomLevel
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
38
|
+
var import_react = require("react");
|
|
39
|
+
var import_use_supercluster = __toESM(require("use-supercluster"), 1);
|
|
40
|
+
|
|
41
|
+
// src/components/ui/Map/constants.ts
|
|
42
|
+
var CLUSTERING_CONFIG = {
|
|
43
|
+
radius: 60,
|
|
44
|
+
maxZoom: 16,
|
|
45
|
+
minPoints: 2
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// src/components/ui/Map/clustering.ts
|
|
49
|
+
function convertCoordinatesToGeoJSON(coordinates) {
|
|
50
|
+
return coordinates.map((coord, index) => ({
|
|
51
|
+
type: "Feature",
|
|
52
|
+
properties: {
|
|
53
|
+
cluster: false,
|
|
54
|
+
pointId: index,
|
|
55
|
+
data: coord.data
|
|
56
|
+
},
|
|
57
|
+
geometry: {
|
|
58
|
+
type: "Point",
|
|
59
|
+
coordinates: [coord.lng, coord.lat]
|
|
60
|
+
}
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/components/ui/Map/hooks.ts
|
|
65
|
+
function useMapBounds(_coordinates) {
|
|
66
|
+
const [bounds, setBounds] = (0, import_react.useState)([
|
|
67
|
+
[-180, -85],
|
|
68
|
+
[180, 85]
|
|
69
|
+
]);
|
|
70
|
+
return { bounds, setBounds };
|
|
71
|
+
}
|
|
72
|
+
function useZoomLevel(initialZoom) {
|
|
73
|
+
const [zoomLevel, setZoomLevel] = (0, import_react.useState)(initialZoom);
|
|
74
|
+
return { zoomLevel, setZoomLevel };
|
|
75
|
+
}
|
|
76
|
+
function useClusters(coordinates, bounds, zoomLevel) {
|
|
77
|
+
const points = (0, import_react.useMemo)(() => {
|
|
78
|
+
if (!coordinates) return [];
|
|
79
|
+
return convertCoordinatesToGeoJSON(coordinates);
|
|
80
|
+
}, [coordinates]);
|
|
81
|
+
const { clusters, supercluster } = (0, import_use_supercluster.default)({
|
|
82
|
+
points,
|
|
83
|
+
bounds: [-180, -85, 180, 85],
|
|
84
|
+
// Use global bounds for consistency
|
|
85
|
+
zoom: zoomLevel || 10,
|
|
86
|
+
options: CLUSTERING_CONFIG
|
|
87
|
+
});
|
|
88
|
+
return { clusters, supercluster };
|
|
89
|
+
}
|
|
90
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
+
0 && (module.exports = {
|
|
92
|
+
useClusters,
|
|
93
|
+
useMapBounds,
|
|
94
|
+
useZoomLevel
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=hooks.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/Map/hooks.ts","../../../../src/components/ui/Map/constants.ts","../../../../src/components/ui/Map/clustering.ts"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport useSupercluster from 'use-supercluster'\n\nimport { convertCoordinatesToGeoJSON } from '@/components/ui/Map/clustering'\nimport { CLUSTERING_CONFIG } from '@/components/ui/Map/constants'\nimport type { Coordinate, PinData } from '@/components/ui/Map/types'\n\nexport function useMapBounds<T = PinData>(_coordinates?: Coordinate<T>[]) {\n const [bounds, setBounds] = useState<[[number, number], [number, number]]>([\n [-180, -85],\n [180, 85],\n ])\n\n // Use global bounds for stability - let the map handle the actual bounds\n // This prevents constant recalculation that causes clustering instability\n return { bounds, setBounds }\n}\n\nexport function useZoomLevel(initialZoom: number) {\n const [zoomLevel, setZoomLevel] = useState(initialZoom)\n return { zoomLevel, setZoomLevel }\n}\n\nexport function useClusters<T = PinData>(\n coordinates?: Coordinate<T>[],\n bounds?: [[number, number], [number, number]],\n zoomLevel?: number\n) {\n const points = useMemo(() => {\n if (!coordinates) return []\n return convertCoordinatesToGeoJSON<T>(coordinates)\n }, [coordinates])\n\n const { clusters, supercluster } = useSupercluster({\n points,\n bounds: [-180, -85, 180, 85], // Use global bounds for consistency\n zoom: zoomLevel || 10,\n options: CLUSTERING_CONFIG,\n })\n\n return { clusters, supercluster }\n}\n","export const DEFAULT_POSITION = { lat: 40.715021, lng: -74.00459 }\nexport const DEFAULT_ZOOM = 10\nexport const CLUSTER_PIN_SCALE = 1.5\nexport const CLUSTER_DISTANCE_THRESHOLD = 0.001\n\nexport const PIN_COLORS = {\n background: '#0B5441',\n borderColor: '#EBFDF1',\n glyphColor: '#D4F500',\n} as const\n\nexport const FOCUS_CIRCLE_STYLES = {\n strokeColor: '#0B5441',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: '#0B5441',\n fillOpacity: 0.1,\n clickable: false,\n zIndex: 1,\n} as const\n\nexport const CLUSTERING_CONFIG = {\n radius: 60,\n maxZoom: 16,\n minPoints: 2,\n} as const\n","import { CLUSTER_DISTANCE_THRESHOLD } from '@/components/ui/Map/constants'\nimport type { ClusterFeature, Coordinate, PinData } from '@/components/ui/Map/types'\nimport { calculateDistance } from '@/components/ui/Map/utils'\n\nexport function convertCoordinatesToGeoJSON<T = PinData>(coordinates: Coordinate<T>[]) {\n return coordinates.map((coord, index) => ({\n type: 'Feature' as const,\n properties: {\n cluster: false,\n pointId: index,\n data: coord.data,\n },\n geometry: {\n type: 'Point' as const,\n coordinates: [coord.lng, coord.lat],\n },\n }))\n}\n\nexport function createManualClusters<T = PinData>(\n coordinates: Coordinate<T>[]\n): ClusterFeature<T>[] {\n if (!coordinates || coordinates.length === 0) return []\n\n const clusters: ClusterFeature<T>[] = []\n const processed = new Set<number>()\n\n coordinates.forEach((coord, index) => {\n if (processed.has(index)) return\n\n const nearby: number[] = [index]\n coordinates.forEach((otherCoord, otherIndex) => {\n if (otherIndex === index || processed.has(otherIndex)) return\n\n const distance = calculateDistance(coord, otherCoord)\n\n if (distance < CLUSTER_DISTANCE_THRESHOLD) {\n nearby.push(otherIndex)\n }\n })\n\n if (nearby.length >= 2) {\n clusters.push({\n type: 'Feature' as const,\n properties: {\n cluster: true,\n point_count: nearby.length,\n },\n geometry: {\n type: 'Point' as const,\n coordinates: [coord.lng, coord.lat],\n },\n id: clusters.length,\n })\n\n nearby.forEach((i) => processed.add(i))\n } else {\n clusters.push({\n type: 'Feature' as const,\n properties: {\n cluster: false,\n pointId: index,\n data: coord.data,\n },\n geometry: {\n type: 'Point' as const,\n coordinates: [coord.lng, coord.lat],\n },\n id: clusters.length,\n })\n processed.add(index)\n }\n })\n\n return clusters\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkC;AAClC,8BAA4B;;;ACoBrB,IAAM,oBAAoB;AAAA,EAC/B,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AACb;;;ACrBO,SAAS,4BAAyC,aAA8B;AACrF,SAAO,YAAY,IAAI,CAAC,OAAO,WAAW;AAAA,IACxC,MAAM;AAAA,IACN,YAAY;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,MACT,MAAM,MAAM;AAAA,IACd;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,aAAa,CAAC,MAAM,KAAK,MAAM,GAAG;AAAA,IACpC;AAAA,EACF,EAAE;AACJ;;;AFVO,SAAS,aAA0B,cAAgC;AACxE,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAA+C;AAAA,IACzE,CAAC,MAAM,GAAG;AAAA,IACV,CAAC,KAAK,EAAE;AAAA,EACV,CAAC;AAID,SAAO,EAAE,QAAQ,UAAU;AAC7B;AAEO,SAAS,aAAa,aAAqB;AAChD,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAS,WAAW;AACtD,SAAO,EAAE,WAAW,aAAa;AACnC;AAEO,SAAS,YACd,aACA,QACA,WACA;AACA,QAAM,aAAS,sBAAQ,MAAM;AAC3B,QAAI,CAAC,YAAa,QAAO,CAAC;AAC1B,WAAO,4BAA+B,WAAW;AAAA,EACnD,GAAG,CAAC,WAAW,CAAC;AAEhB,QAAM,EAAE,UAAU,aAAa,QAAI,wBAAAA,SAAgB;AAAA,IACjD;AAAA,IACA,QAAQ,CAAC,MAAM,KAAK,KAAK,EAAE;AAAA;AAAA,IAC3B,MAAM,aAAa;AAAA,IACnB,SAAS;AAAA,EACX,CAAC;AAED,SAAO,EAAE,UAAU,aAAa;AAClC;","names":["useSupercluster"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PinData, Coordinate } from './types.cjs';
|
|
3
|
+
|
|
4
|
+
declare function useMapBounds<T = PinData>(_coordinates?: Coordinate<T>[]): {
|
|
5
|
+
bounds: [[number, number], [number, number]];
|
|
6
|
+
setBounds: React.Dispatch<React.SetStateAction<[[number, number], [number, number]]>>;
|
|
7
|
+
};
|
|
8
|
+
declare function useZoomLevel(initialZoom: number): {
|
|
9
|
+
zoomLevel: number;
|
|
10
|
+
setZoomLevel: React.Dispatch<React.SetStateAction<number>>;
|
|
11
|
+
};
|
|
12
|
+
declare function useClusters<T = PinData>(coordinates?: Coordinate<T>[], bounds?: [[number, number], [number, number]], zoomLevel?: number): {
|
|
13
|
+
clusters: any[];
|
|
14
|
+
supercluster: any;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { useClusters, useMapBounds, useZoomLevel };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PinData, Coordinate } from './types.js';
|
|
3
|
+
|
|
4
|
+
declare function useMapBounds<T = PinData>(_coordinates?: Coordinate<T>[]): {
|
|
5
|
+
bounds: [[number, number], [number, number]];
|
|
6
|
+
setBounds: React.Dispatch<React.SetStateAction<[[number, number], [number, number]]>>;
|
|
7
|
+
};
|
|
8
|
+
declare function useZoomLevel(initialZoom: number): {
|
|
9
|
+
zoomLevel: number;
|
|
10
|
+
setZoomLevel: React.Dispatch<React.SetStateAction<number>>;
|
|
11
|
+
};
|
|
12
|
+
declare function useClusters<T = PinData>(coordinates?: Coordinate<T>[], bounds?: [[number, number], [number, number]], zoomLevel?: number): {
|
|
13
|
+
clusters: any[];
|
|
14
|
+
supercluster: any;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { useClusters, useMapBounds, useZoomLevel };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/components/ui/Map/hooks.ts
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import useSupercluster from "use-supercluster";
|
|
4
|
+
|
|
5
|
+
// src/components/ui/Map/constants.ts
|
|
6
|
+
var CLUSTERING_CONFIG = {
|
|
7
|
+
radius: 60,
|
|
8
|
+
maxZoom: 16,
|
|
9
|
+
minPoints: 2
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/components/ui/Map/clustering.ts
|
|
13
|
+
function convertCoordinatesToGeoJSON(coordinates) {
|
|
14
|
+
return coordinates.map((coord, index) => ({
|
|
15
|
+
type: "Feature",
|
|
16
|
+
properties: {
|
|
17
|
+
cluster: false,
|
|
18
|
+
pointId: index,
|
|
19
|
+
data: coord.data
|
|
20
|
+
},
|
|
21
|
+
geometry: {
|
|
22
|
+
type: "Point",
|
|
23
|
+
coordinates: [coord.lng, coord.lat]
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/components/ui/Map/hooks.ts
|
|
29
|
+
function useMapBounds(_coordinates) {
|
|
30
|
+
const [bounds, setBounds] = useState([
|
|
31
|
+
[-180, -85],
|
|
32
|
+
[180, 85]
|
|
33
|
+
]);
|
|
34
|
+
return { bounds, setBounds };
|
|
35
|
+
}
|
|
36
|
+
function useZoomLevel(initialZoom) {
|
|
37
|
+
const [zoomLevel, setZoomLevel] = useState(initialZoom);
|
|
38
|
+
return { zoomLevel, setZoomLevel };
|
|
39
|
+
}
|
|
40
|
+
function useClusters(coordinates, bounds, zoomLevel) {
|
|
41
|
+
const points = useMemo(() => {
|
|
42
|
+
if (!coordinates) return [];
|
|
43
|
+
return convertCoordinatesToGeoJSON(coordinates);
|
|
44
|
+
}, [coordinates]);
|
|
45
|
+
const { clusters, supercluster } = useSupercluster({
|
|
46
|
+
points,
|
|
47
|
+
bounds: [-180, -85, 180, 85],
|
|
48
|
+
// Use global bounds for consistency
|
|
49
|
+
zoom: zoomLevel || 10,
|
|
50
|
+
options: CLUSTERING_CONFIG
|
|
51
|
+
});
|
|
52
|
+
return { clusters, supercluster };
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
useClusters,
|
|
56
|
+
useMapBounds,
|
|
57
|
+
useZoomLevel
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/ui/Map/hooks.ts","../../../../src/components/ui/Map/constants.ts","../../../../src/components/ui/Map/clustering.ts"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport useSupercluster from 'use-supercluster'\n\nimport { convertCoordinatesToGeoJSON } from '@/components/ui/Map/clustering'\nimport { CLUSTERING_CONFIG } from '@/components/ui/Map/constants'\nimport type { Coordinate, PinData } from '@/components/ui/Map/types'\n\nexport function useMapBounds<T = PinData>(_coordinates?: Coordinate<T>[]) {\n const [bounds, setBounds] = useState<[[number, number], [number, number]]>([\n [-180, -85],\n [180, 85],\n ])\n\n // Use global bounds for stability - let the map handle the actual bounds\n // This prevents constant recalculation that causes clustering instability\n return { bounds, setBounds }\n}\n\nexport function useZoomLevel(initialZoom: number) {\n const [zoomLevel, setZoomLevel] = useState(initialZoom)\n return { zoomLevel, setZoomLevel }\n}\n\nexport function useClusters<T = PinData>(\n coordinates?: Coordinate<T>[],\n bounds?: [[number, number], [number, number]],\n zoomLevel?: number\n) {\n const points = useMemo(() => {\n if (!coordinates) return []\n return convertCoordinatesToGeoJSON<T>(coordinates)\n }, [coordinates])\n\n const { clusters, supercluster } = useSupercluster({\n points,\n bounds: [-180, -85, 180, 85], // Use global bounds for consistency\n zoom: zoomLevel || 10,\n options: CLUSTERING_CONFIG,\n })\n\n return { clusters, supercluster }\n}\n","export const DEFAULT_POSITION = { lat: 40.715021, lng: -74.00459 }\nexport const DEFAULT_ZOOM = 10\nexport const CLUSTER_PIN_SCALE = 1.5\nexport const CLUSTER_DISTANCE_THRESHOLD = 0.001\n\nexport const PIN_COLORS = {\n background: '#0B5441',\n borderColor: '#EBFDF1',\n glyphColor: '#D4F500',\n} as const\n\nexport const FOCUS_CIRCLE_STYLES = {\n strokeColor: '#0B5441',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: '#0B5441',\n fillOpacity: 0.1,\n clickable: false,\n zIndex: 1,\n} as const\n\nexport const CLUSTERING_CONFIG = {\n radius: 60,\n maxZoom: 16,\n minPoints: 2,\n} as const\n","import { CLUSTER_DISTANCE_THRESHOLD } from '@/components/ui/Map/constants'\nimport type { ClusterFeature, Coordinate, PinData } from '@/components/ui/Map/types'\nimport { calculateDistance } from '@/components/ui/Map/utils'\n\nexport function convertCoordinatesToGeoJSON<T = PinData>(coordinates: Coordinate<T>[]) {\n return coordinates.map((coord, index) => ({\n type: 'Feature' as const,\n properties: {\n cluster: false,\n pointId: index,\n data: coord.data,\n },\n geometry: {\n type: 'Point' as const,\n coordinates: [coord.lng, coord.lat],\n },\n }))\n}\n\nexport function createManualClusters<T = PinData>(\n coordinates: Coordinate<T>[]\n): ClusterFeature<T>[] {\n if (!coordinates || coordinates.length === 0) return []\n\n const clusters: ClusterFeature<T>[] = []\n const processed = new Set<number>()\n\n coordinates.forEach((coord, index) => {\n if (processed.has(index)) return\n\n const nearby: number[] = [index]\n coordinates.forEach((otherCoord, otherIndex) => {\n if (otherIndex === index || processed.has(otherIndex)) return\n\n const distance = calculateDistance(coord, otherCoord)\n\n if (distance < CLUSTER_DISTANCE_THRESHOLD) {\n nearby.push(otherIndex)\n }\n })\n\n if (nearby.length >= 2) {\n clusters.push({\n type: 'Feature' as const,\n properties: {\n cluster: true,\n point_count: nearby.length,\n },\n geometry: {\n type: 'Point' as const,\n coordinates: [coord.lng, coord.lat],\n },\n id: clusters.length,\n })\n\n nearby.forEach((i) => processed.add(i))\n } else {\n clusters.push({\n type: 'Feature' as const,\n properties: {\n cluster: false,\n pointId: index,\n data: coord.data,\n },\n geometry: {\n type: 'Point' as const,\n coordinates: [coord.lng, coord.lat],\n },\n id: clusters.length,\n })\n processed.add(index)\n }\n })\n\n return clusters\n}\n"],"mappings":";AAAA,SAAS,SAAS,gBAAgB;AAClC,OAAO,qBAAqB;;;ACoBrB,IAAM,oBAAoB;AAAA,EAC/B,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AACb;;;ACrBO,SAAS,4BAAyC,aAA8B;AACrF,SAAO,YAAY,IAAI,CAAC,OAAO,WAAW;AAAA,IACxC,MAAM;AAAA,IACN,YAAY;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,MACT,MAAM,MAAM;AAAA,IACd;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,aAAa,CAAC,MAAM,KAAK,MAAM,GAAG;AAAA,IACpC;AAAA,EACF,EAAE;AACJ;;;AFVO,SAAS,aAA0B,cAAgC;AACxE,QAAM,CAAC,QAAQ,SAAS,IAAI,SAA+C;AAAA,IACzE,CAAC,MAAM,GAAG;AAAA,IACV,CAAC,KAAK,EAAE;AAAA,EACV,CAAC;AAID,SAAO,EAAE,QAAQ,UAAU;AAC7B;AAEO,SAAS,aAAa,aAAqB;AAChD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,WAAW;AACtD,SAAO,EAAE,WAAW,aAAa;AACnC;AAEO,SAAS,YACd,aACA,QACA,WACA;AACA,QAAM,SAAS,QAAQ,MAAM;AAC3B,QAAI,CAAC,YAAa,QAAO,CAAC;AAC1B,WAAO,4BAA+B,WAAW;AAAA,EACnD,GAAG,CAAC,WAAW,CAAC;AAEhB,QAAM,EAAE,UAAU,aAAa,IAAI,gBAAgB;AAAA,IACjD;AAAA,IACA,QAAQ,CAAC,MAAM,KAAK,KAAK,EAAE;AAAA;AAAA,IAC3B,MAAM,aAAa;AAAA,IACnB,SAAS;AAAA,EACX,CAAC;AAED,SAAO,EAAE,UAAU,aAAa;AAClC;","names":[]}
|