@timardex/cluemart-shared 1.5.753 → 1.5.755
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/{ad-DQV7gLkZ.d.mts → ad-QbxQEG6o.d.mts} +1 -1
- package/dist/{ad-D3RF-B6B.d.ts → ad-pLZUkF7z.d.ts} +1 -1
- package/dist/{contactUs-nkrkwqAR.d.mts → contactUs-Bn14BhYR.d.mts} +1 -1
- package/dist/{contactUs-Cx5VP74u.d.ts → contactUs-CbgB8N5m.d.ts} +1 -1
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/{global-DugYyRyU.d.ts → global-CMZCDnUT.d.ts} +1 -1
- package/dist/{global-BqC8u5sn.d.mts → global-DwcLiMf-.d.mts} +1 -1
- package/dist/graphql/index.d.mts +3 -3
- package/dist/graphql/index.d.ts +3 -3
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.mjs +1 -1
- package/dist/map/index.cjs +197 -0
- package/dist/map/index.cjs.map +1 -0
- package/dist/map/index.d.mts +73 -0
- package/dist/map/index.d.ts +73 -0
- package/dist/map/index.mjs +153 -0
- package/dist/map/index.mjs.map +1 -0
- package/dist/{resourceActivities-CEixbvCy.d.ts → resourceActivities-BiIFWxSA.d.ts} +1 -1
- package/dist/{resourceActivities-BA_feTbb.d.mts → resourceActivities-qSbrOsu_.d.mts} +1 -1
- package/dist/sharing/index.d.mts +1 -1
- package/dist/sharing/index.d.ts +1 -1
- package/dist/types/index.d.mts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +6 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnumOSPlatform, EnumUserRole, EnumReward, EnumSubscriptionStatus, EnumUserLicence, EnumResourceType, EnumPartnerType } from './enums/index.mjs';
|
|
2
|
-
import { au as ResourceImageType, L as LocationType, ay as TermsAgreement, A as AssociateType, i as UserLicenceType,
|
|
2
|
+
import { au as ResourceImageType, L as LocationType, ay as TermsAgreement, A as AssociateType, i as UserLicenceType, aj as PromoCodeType, K as DateTimeType, H as CreateFormData, D as BaseResourceType, B as BaseResourceTypeFormData, as as ResourceContactDetailsType, av as SocialMediaType, a6 as OwnerType } from './global-DwcLiMf-.mjs';
|
|
3
3
|
import { PosterAssetId } from './images/index.mjs';
|
|
4
4
|
|
|
5
5
|
type UserFormData = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnumOSPlatform, EnumUserRole, EnumReward, EnumSubscriptionStatus, EnumUserLicence, EnumResourceType, EnumPartnerType } from './enums/index.js';
|
|
2
|
-
import { au as ResourceImageType, L as LocationType, ay as TermsAgreement, A as AssociateType, i as UserLicenceType,
|
|
2
|
+
import { au as ResourceImageType, L as LocationType, ay as TermsAgreement, A as AssociateType, i as UserLicenceType, aj as PromoCodeType, K as DateTimeType, H as CreateFormData, D as BaseResourceType, B as BaseResourceTypeFormData, as as ResourceContactDetailsType, av as SocialMediaType, a6 as OwnerType } from './global-CMZCDnUT.js';
|
|
3
3
|
import { PosterAssetId } from './images/index.js';
|
|
4
4
|
|
|
5
5
|
type UserFormData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OptionItem, F as FormField, a as FormDateField, R as RefundPolicy, b as Requirement, S as StallType, C as Category } from '../global-
|
|
1
|
+
import { O as OptionItem, F as FormField, a as FormDateField, R as RefundPolicy, b as Requirement, S as StallType, C as Category } from '../global-DwcLiMf-.mjs';
|
|
2
2
|
import 'react-hook-form';
|
|
3
3
|
import '../enums/index.mjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OptionItem, F as FormField, a as FormDateField, R as RefundPolicy, b as Requirement, S as StallType, C as Category } from '../global-
|
|
1
|
+
import { O as OptionItem, F as FormField, a as FormDateField, R as RefundPolicy, b as Requirement, S as StallType, C as Category } from '../global-CMZCDnUT.js';
|
|
2
2
|
import 'react-hook-form';
|
|
3
3
|
import '../enums/index.js';
|
|
4
4
|
|
|
@@ -680,4 +680,4 @@ interface UseGetResourcesByRegionOptions {
|
|
|
680
680
|
offset?: number;
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
-
export { type
|
|
683
|
+
export { type GamePlacementClue as $, type AssociateType as A, type BaseResourceTypeFormData as B, type Category as C, type BaseResourceType as D, type EventType as E, type FormField as F, type GameDocType as G, type CreateFormData as H, type DailyClueBaseGame as I, type DailyClueGameData as J, type DateTimeType as K, type LocationType as L, type DateTimeWithPriceType as M, type DeviceInfo as N, type OptionItem as O, type PostType as P, EnumGameStatus as Q, type RefundPolicy as R, type StallType as S, EnumGameType as T, type UseGetResourcesByRegionOptions as U, type VendorType as V, EnumPostContentType as W, type EventStatusType as X, type GameDate as Y, type GameHistory as Z, type GamePlacement as _, type FormDateField as a, type GameType as a0, type GeocodeLocation as a1, type GlobalGameData as a2, type ImageObjectType as a3, type LocationGeoType as a4, type Nullable as a5, type OwnerType as a6, PROMO_CODE_PREFIX as a7, type PaymentInfoType as a8, type PostContentData as a9, type VendorAttributes as aA, type VendorCalendarData as aB, type VendorProductList as aC, gameScreenIdentifierList as aD, gameTypeToDisplayName as aE, type PostContentFormData as aa, type PostContentGame as ab, type PostContentImage as ac, type PostContentList as ad, type PostContentTextarea as ae, type PostContentType as af, type PostContentVideo as ag, type PostFileInput as ah, type PosterUsageType as ai, type PromoCodeType as aj, type PuzzleAnswer as ak, type PuzzleAnsweredQuestion as al, type PuzzleBaseGame as am, type PuzzleGameData as an, type PuzzleQuestion as ao, type RelatedPostType as ap, type RelationDate as aq, type RelationInputType as ar, type ResourceContactDetailsType as as, type ResourceDetails as at, type ResourceImageType as au, type SocialMediaType as av, type Subcategory as aw, type SubcategoryItems as ax, type TermsAgreement as ay, type UnregisteredVendorInvitationType as az, type Requirement as b, type EventListItemType as c, type EventInfoType as d, type RelationType as e, type ResourceConnectionsType as f, type UnregisteredVendorType as g, type VendorInfoType as h, type UserLicenceType as i, EnumPostType as j, type GameLeaderboard as k, type VendorFormData as l, type CreateVendorFormData as m, type VendorInfoFormData as n, type CreateVendorInfoFormData as o, type UnregisteredVendorFormData as p, type CreateUnregisteredVendorFormData as q, type EventFormData as r, type CreateEventFormData as s, type EventInfoFormData as t, type CreateEventInfoFormData as u, type PostFormData as v, type CreatePostFormData as w, type Region as x, type BaseGameMap as y, type BaseGameType as z };
|
|
@@ -680,4 +680,4 @@ interface UseGetResourcesByRegionOptions {
|
|
|
680
680
|
offset?: number;
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
-
export { type
|
|
683
|
+
export { type GamePlacementClue as $, type AssociateType as A, type BaseResourceTypeFormData as B, type Category as C, type BaseResourceType as D, type EventType as E, type FormField as F, type GameDocType as G, type CreateFormData as H, type DailyClueBaseGame as I, type DailyClueGameData as J, type DateTimeType as K, type LocationType as L, type DateTimeWithPriceType as M, type DeviceInfo as N, type OptionItem as O, type PostType as P, EnumGameStatus as Q, type RefundPolicy as R, type StallType as S, EnumGameType as T, type UseGetResourcesByRegionOptions as U, type VendorType as V, EnumPostContentType as W, type EventStatusType as X, type GameDate as Y, type GameHistory as Z, type GamePlacement as _, type FormDateField as a, type GameType as a0, type GeocodeLocation as a1, type GlobalGameData as a2, type ImageObjectType as a3, type LocationGeoType as a4, type Nullable as a5, type OwnerType as a6, PROMO_CODE_PREFIX as a7, type PaymentInfoType as a8, type PostContentData as a9, type VendorAttributes as aA, type VendorCalendarData as aB, type VendorProductList as aC, gameScreenIdentifierList as aD, gameTypeToDisplayName as aE, type PostContentFormData as aa, type PostContentGame as ab, type PostContentImage as ac, type PostContentList as ad, type PostContentTextarea as ae, type PostContentType as af, type PostContentVideo as ag, type PostFileInput as ah, type PosterUsageType as ai, type PromoCodeType as aj, type PuzzleAnswer as ak, type PuzzleAnsweredQuestion as al, type PuzzleBaseGame as am, type PuzzleGameData as an, type PuzzleQuestion as ao, type RelatedPostType as ap, type RelationDate as aq, type RelationInputType as ar, type ResourceContactDetailsType as as, type ResourceDetails as at, type ResourceImageType as au, type SocialMediaType as av, type Subcategory as aw, type SubcategoryItems as ax, type TermsAgreement as ay, type UnregisteredVendorInvitationType as az, type Requirement as b, type EventListItemType as c, type EventInfoType as d, type RelationType as e, type ResourceConnectionsType as f, type UnregisteredVendorType as g, type VendorInfoType as h, type UserLicenceType as i, EnumPostType as j, type GameLeaderboard as k, type VendorFormData as l, type CreateVendorFormData as m, type VendorInfoFormData as n, type CreateVendorInfoFormData as o, type UnregisteredVendorFormData as p, type CreateUnregisteredVendorFormData as q, type EventFormData as r, type CreateEventFormData as s, type EventInfoFormData as t, type CreateEventInfoFormData as u, type PostFormData as v, type CreatePostFormData as w, type Region as x, type BaseGameMap as y, type BaseGameType as z };
|
package/dist/graphql/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _apollo_client from '@apollo/client';
|
|
2
2
|
import { DocumentNode } from 'graphql';
|
|
3
3
|
import { EnumResourceType, EnumEventDateStatus } from '../enums/index.mjs';
|
|
4
|
-
import { A as AuthPayloadType, R as RefreshTokenPayloadType, S as SafeUserType, a as RedeemRewardResponse, P as PartnerType, b as ResourceByUser, c as AdType, E as EnumAdStatus, d as SubscriptionPlansResponse, e as SubscriptionStatusData, f as AppSettingsType, g as SchoolReturnType, h as SchoolType } from '../ad-
|
|
5
|
-
import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-
|
|
6
|
-
import { E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, e as RelationType, f as ResourceConnectionsType, g as UnregisteredVendorType, V as VendorType, h as VendorInfoType, i as UserLicenceType, P as PostType, j as EnumPostType, G as GameDocType, k as GameLeaderboard } from '../global-
|
|
4
|
+
import { A as AuthPayloadType, R as RefreshTokenPayloadType, S as SafeUserType, a as RedeemRewardResponse, P as PartnerType, b as ResourceByUser, c as AdType, E as EnumAdStatus, d as SubscriptionPlansResponse, e as SubscriptionStatusData, f as AppSettingsType, g as SchoolReturnType, h as SchoolType } from '../ad-QbxQEG6o.mjs';
|
|
5
|
+
import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-qSbrOsu_.mjs';
|
|
6
|
+
import { E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, e as RelationType, f as ResourceConnectionsType, g as UnregisteredVendorType, V as VendorType, h as VendorInfoType, i as UserLicenceType, P as PostType, j as EnumPostType, G as GameDocType, k as GameLeaderboard } from '../global-DwcLiMf-.mjs';
|
|
7
7
|
import '../images/index.mjs';
|
|
8
8
|
import 'react-hook-form';
|
|
9
9
|
|
package/dist/graphql/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _apollo_client from '@apollo/client';
|
|
2
2
|
import { DocumentNode } from 'graphql';
|
|
3
3
|
import { EnumResourceType, EnumEventDateStatus } from '../enums/index.js';
|
|
4
|
-
import { A as AuthPayloadType, R as RefreshTokenPayloadType, S as SafeUserType, a as RedeemRewardResponse, P as PartnerType, b as ResourceByUser, c as AdType, E as EnumAdStatus, d as SubscriptionPlansResponse, e as SubscriptionStatusData, f as AppSettingsType, g as SchoolReturnType, h as SchoolType } from '../ad-
|
|
5
|
-
import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-
|
|
6
|
-
import { E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, e as RelationType, f as ResourceConnectionsType, g as UnregisteredVendorType, V as VendorType, h as VendorInfoType, i as UserLicenceType, P as PostType, j as EnumPostType, G as GameDocType, k as GameLeaderboard } from '../global-
|
|
4
|
+
import { A as AuthPayloadType, R as RefreshTokenPayloadType, S as SafeUserType, a as RedeemRewardResponse, P as PartnerType, b as ResourceByUser, c as AdType, E as EnumAdStatus, d as SubscriptionPlansResponse, e as SubscriptionStatusData, f as AppSettingsType, g as SchoolReturnType, h as SchoolType } from '../ad-pLZUkF7z.js';
|
|
5
|
+
import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-BiIFWxSA.js';
|
|
6
|
+
import { E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, e as RelationType, f as ResourceConnectionsType, g as UnregisteredVendorType, V as VendorType, h as VendorInfoType, i as UserLicenceType, P as PostType, j as EnumPostType, G as GameDocType, k as GameLeaderboard } from '../global-CMZCDnUT.js';
|
|
7
7
|
import '../images/index.js';
|
|
8
8
|
import 'react-hook-form';
|
|
9
9
|
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as LocationType, l as VendorFormData, m as CreateVendorFormData, n as VendorInfoFormData, o as CreateVendorInfoFormData, p as UnregisteredVendorFormData, q as CreateUnregisteredVendorFormData, r as EventFormData, s as CreateEventFormData, t as EventInfoFormData, u as CreateEventInfoFormData, B as BaseResourceTypeFormData, v as PostFormData, w as CreatePostFormData } from '../global-
|
|
2
|
-
import { U as UserFormData, C as CreateUserFormData, i as CreateLoginFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, l as CreateValidateVerificationTokenFormData, m as CreateResetPasswordFormData, n as PartnerFormData, o as AdFormData, p as CreateAdFormState, q as CreatePartnerFormData, r as AppSettingsFormData, s as CreateAppSettingsFormData, t as SchoolFormData, u as CreateSchoolFormData } from '../ad-
|
|
3
|
-
import { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-
|
|
1
|
+
import { L as LocationType, l as VendorFormData, m as CreateVendorFormData, n as VendorInfoFormData, o as CreateVendorInfoFormData, p as UnregisteredVendorFormData, q as CreateUnregisteredVendorFormData, r as EventFormData, s as CreateEventFormData, t as EventInfoFormData, u as CreateEventInfoFormData, B as BaseResourceTypeFormData, v as PostFormData, w as CreatePostFormData } from '../global-DwcLiMf-.mjs';
|
|
2
|
+
import { U as UserFormData, C as CreateUserFormData, i as CreateLoginFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, l as CreateValidateVerificationTokenFormData, m as CreateResetPasswordFormData, n as PartnerFormData, o as AdFormData, p as CreateAdFormState, q as CreatePartnerFormData, r as AppSettingsFormData, s as CreateAppSettingsFormData, t as SchoolFormData, u as CreateSchoolFormData } from '../ad-QbxQEG6o.mjs';
|
|
3
|
+
import { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-Bn14BhYR.mjs';
|
|
4
4
|
import 'react-hook-form';
|
|
5
5
|
import '../enums/index.mjs';
|
|
6
6
|
import '../images/index.mjs';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as LocationType, l as VendorFormData, m as CreateVendorFormData, n as VendorInfoFormData, o as CreateVendorInfoFormData, p as UnregisteredVendorFormData, q as CreateUnregisteredVendorFormData, r as EventFormData, s as CreateEventFormData, t as EventInfoFormData, u as CreateEventInfoFormData, B as BaseResourceTypeFormData, v as PostFormData, w as CreatePostFormData } from '../global-
|
|
2
|
-
import { U as UserFormData, C as CreateUserFormData, i as CreateLoginFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, l as CreateValidateVerificationTokenFormData, m as CreateResetPasswordFormData, n as PartnerFormData, o as AdFormData, p as CreateAdFormState, q as CreatePartnerFormData, r as AppSettingsFormData, s as CreateAppSettingsFormData, t as SchoolFormData, u as CreateSchoolFormData } from '../ad-
|
|
3
|
-
import { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-
|
|
1
|
+
import { L as LocationType, l as VendorFormData, m as CreateVendorFormData, n as VendorInfoFormData, o as CreateVendorInfoFormData, p as UnregisteredVendorFormData, q as CreateUnregisteredVendorFormData, r as EventFormData, s as CreateEventFormData, t as EventInfoFormData, u as CreateEventInfoFormData, B as BaseResourceTypeFormData, v as PostFormData, w as CreatePostFormData } from '../global-CMZCDnUT.js';
|
|
2
|
+
import { U as UserFormData, C as CreateUserFormData, i as CreateLoginFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, l as CreateValidateVerificationTokenFormData, m as CreateResetPasswordFormData, n as PartnerFormData, o as AdFormData, p as CreateAdFormState, q as CreatePartnerFormData, r as AppSettingsFormData, s as CreateAppSettingsFormData, t as SchoolFormData, u as CreateSchoolFormData } from '../ad-pLZUkF7z.js';
|
|
3
|
+
import { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-CbgB8N5m.js';
|
|
4
4
|
import 'react-hook-form';
|
|
5
5
|
import '../enums/index.js';
|
|
6
6
|
import '../images/index.js';
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../chunk-VA5YN2K3.mjs";
|
|
1
2
|
import "../chunk-IMQU3E2F.mjs";
|
|
2
3
|
import "../chunk-WBJDMRUC.mjs";
|
|
3
4
|
import "../chunk-NPFJ2CN2.mjs";
|
|
@@ -29,7 +30,6 @@ import {
|
|
|
29
30
|
EnumVendorType
|
|
30
31
|
} from "../chunk-4SNW63TJ.mjs";
|
|
31
32
|
import "../chunk-DWO35OY4.mjs";
|
|
32
|
-
import "../chunk-VA5YN2K3.mjs";
|
|
33
33
|
|
|
34
34
|
// src/hooks/useLocationSearch.ts
|
|
35
35
|
var handleApiError = (error, message) => {
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/map/index.ts
|
|
21
|
+
var map_exports = {};
|
|
22
|
+
__export(map_exports, {
|
|
23
|
+
BOUNDS_PADDING: () => BOUNDS_PADDING,
|
|
24
|
+
DEFAULT_NZ_CENTER: () => DEFAULT_NZ_CENTER,
|
|
25
|
+
DEFAULT_NZ_REGION: () => DEFAULT_NZ_REGION,
|
|
26
|
+
DEFAULT_NZ_REGION_SPAN: () => DEFAULT_NZ_REGION_SPAN,
|
|
27
|
+
MIN_REGION_SPAN: () => MIN_REGION_SPAN,
|
|
28
|
+
NZ_MAP_BOUNDARIES: () => NZ_MAP_BOUNDARIES,
|
|
29
|
+
SINGLE_MARKER_DELTA: () => SINGLE_MARKER_DELTA,
|
|
30
|
+
boundsForSingleMarker: () => boundsForSingleMarker,
|
|
31
|
+
boundsFromMapCoordinates: () => boundsFromMapCoordinates,
|
|
32
|
+
boundsToRegion: () => boundsToRegion,
|
|
33
|
+
clampBoundsToNZ: () => clampBoundsToNZ,
|
|
34
|
+
clampRegionToNZ: () => clampRegionToNZ,
|
|
35
|
+
hasValidMapCoordinate: () => hasValidMapCoordinate,
|
|
36
|
+
isSameRegion: () => isSameRegion,
|
|
37
|
+
isValidRegion: () => isValidRegion,
|
|
38
|
+
regionForSingleMarker: () => regionForSingleMarker,
|
|
39
|
+
regionFromCoordinates: () => regionFromCoordinates,
|
|
40
|
+
regionToBounds: () => regionToBounds
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(map_exports);
|
|
43
|
+
|
|
44
|
+
// src/map/constants.ts
|
|
45
|
+
var DEFAULT_NZ_REGION = {
|
|
46
|
+
latitude: -41.2865,
|
|
47
|
+
latitudeDelta: 5,
|
|
48
|
+
longitude: 174.7762,
|
|
49
|
+
longitudeDelta: 5
|
|
50
|
+
};
|
|
51
|
+
var DEFAULT_NZ_CENTER = {
|
|
52
|
+
latitude: DEFAULT_NZ_REGION.latitude,
|
|
53
|
+
longitude: DEFAULT_NZ_REGION.longitude
|
|
54
|
+
};
|
|
55
|
+
var DEFAULT_NZ_REGION_SPAN = DEFAULT_NZ_REGION.latitudeDelta;
|
|
56
|
+
var SINGLE_MARKER_DELTA = 2;
|
|
57
|
+
var NZ_MAP_BOUNDARIES = {
|
|
58
|
+
northEast: { latitude: -33.9, longitude: 178.6 },
|
|
59
|
+
southWest: { latitude: -47.5, longitude: 166.4 }
|
|
60
|
+
};
|
|
61
|
+
var BOUNDS_PADDING = 0.15;
|
|
62
|
+
var MIN_REGION_SPAN = 0.5;
|
|
63
|
+
|
|
64
|
+
// src/map/coordinates.ts
|
|
65
|
+
function hasValidMapCoordinate(location) {
|
|
66
|
+
if (!location) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return typeof location.latitude === "number" && typeof location.longitude === "number" && Number.isFinite(location.latitude) && Number.isFinite(location.longitude);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// src/map/region.ts
|
|
73
|
+
function isValidRegion(region) {
|
|
74
|
+
return !!region && typeof region.latitude === "number" && typeof region.longitude === "number" && Number.isFinite(region.latitude) && Number.isFinite(region.longitude) && typeof region.latitudeDelta === "number" && typeof region.longitudeDelta === "number" && Number.isFinite(region.latitudeDelta) && Number.isFinite(region.longitudeDelta) && region.latitude >= -85 && region.latitude <= 85 && region.longitude >= -180 && region.longitude <= 180 && region.latitudeDelta > 0 && region.longitudeDelta > 0 && region.latitudeDelta <= 180 && region.longitudeDelta <= 360;
|
|
75
|
+
}
|
|
76
|
+
function isSameRegion(next, current) {
|
|
77
|
+
const epsilon = 1e-4;
|
|
78
|
+
return Math.abs(next.latitude - current.latitude) < epsilon && Math.abs(next.longitude - current.longitude) < epsilon && Math.abs(next.latitudeDelta - current.latitudeDelta) < epsilon && Math.abs(next.longitudeDelta - current.longitudeDelta) < epsilon;
|
|
79
|
+
}
|
|
80
|
+
function regionFromCoordinates(coords, maxLatitudeDelta = DEFAULT_NZ_REGION.latitudeDelta, maxLongitudeDelta = DEFAULT_NZ_REGION.longitudeDelta) {
|
|
81
|
+
const lats = coords.map((coord) => coord.latitude);
|
|
82
|
+
const lngs = coords.map((coord) => coord.longitude);
|
|
83
|
+
const minLat = Math.min(...lats);
|
|
84
|
+
const maxLat = Math.max(...lats);
|
|
85
|
+
const minLng = Math.min(...lngs);
|
|
86
|
+
const maxLng = Math.max(...lngs);
|
|
87
|
+
let latDelta = maxLat - minLat + BOUNDS_PADDING;
|
|
88
|
+
let lngDelta = maxLng - minLng + BOUNDS_PADDING;
|
|
89
|
+
latDelta = Math.max(MIN_REGION_SPAN, latDelta);
|
|
90
|
+
lngDelta = Math.max(MIN_REGION_SPAN, lngDelta);
|
|
91
|
+
latDelta = Math.min(latDelta, maxLatitudeDelta);
|
|
92
|
+
lngDelta = Math.min(lngDelta, maxLongitudeDelta);
|
|
93
|
+
return {
|
|
94
|
+
latitude: (minLat + maxLat) / 2,
|
|
95
|
+
latitudeDelta: latDelta,
|
|
96
|
+
longitude: (minLng + maxLng) / 2,
|
|
97
|
+
longitudeDelta: lngDelta
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function clampRegionToNZ(region) {
|
|
101
|
+
const { northEast, southWest } = NZ_MAP_BOUNDARIES;
|
|
102
|
+
const maxLatDelta = DEFAULT_NZ_REGION.latitudeDelta;
|
|
103
|
+
const maxLngDelta = DEFAULT_NZ_REGION.longitudeDelta;
|
|
104
|
+
const latDelta = Math.min(region.latitudeDelta, maxLatDelta);
|
|
105
|
+
const lngDelta = Math.min(region.longitudeDelta, maxLngDelta);
|
|
106
|
+
const halfLat = latDelta / 2;
|
|
107
|
+
const halfLng = lngDelta / 2;
|
|
108
|
+
const minLat = southWest.latitude + halfLat;
|
|
109
|
+
const maxLat = northEast.latitude - halfLat;
|
|
110
|
+
const minLng = southWest.longitude + halfLng;
|
|
111
|
+
const maxLng = northEast.longitude - halfLng;
|
|
112
|
+
const latitude = Math.max(minLat, Math.min(maxLat, region.latitude));
|
|
113
|
+
const longitude = Math.max(minLng, Math.min(maxLng, region.longitude));
|
|
114
|
+
return {
|
|
115
|
+
latitude,
|
|
116
|
+
latitudeDelta: latDelta,
|
|
117
|
+
longitude,
|
|
118
|
+
longitudeDelta: lngDelta
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function regionForSingleMarker(coord) {
|
|
122
|
+
return clampRegionToNZ({
|
|
123
|
+
latitude: coord.latitude,
|
|
124
|
+
latitudeDelta: SINGLE_MARKER_DELTA,
|
|
125
|
+
longitude: coord.longitude,
|
|
126
|
+
longitudeDelta: SINGLE_MARKER_DELTA
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// src/map/bounds.ts
|
|
131
|
+
function regionToBounds(region) {
|
|
132
|
+
const halfLat = region.latitudeDelta / 2;
|
|
133
|
+
const halfLng = region.longitudeDelta / 2;
|
|
134
|
+
return {
|
|
135
|
+
east: region.longitude + halfLng,
|
|
136
|
+
north: region.latitude + halfLat,
|
|
137
|
+
south: region.latitude - halfLat,
|
|
138
|
+
west: region.longitude - halfLng
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function boundsToRegion(bounds) {
|
|
142
|
+
return {
|
|
143
|
+
latitude: (bounds.north + bounds.south) / 2,
|
|
144
|
+
latitudeDelta: bounds.north - bounds.south,
|
|
145
|
+
longitude: (bounds.east + bounds.west) / 2,
|
|
146
|
+
longitudeDelta: bounds.east - bounds.west
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function clampBoundsToNZ(bounds) {
|
|
150
|
+
return regionToBounds(clampRegionToNZ(boundsToRegion(bounds)));
|
|
151
|
+
}
|
|
152
|
+
function boundsFromCenterAndSpan(center, span) {
|
|
153
|
+
return clampBoundsToNZ({
|
|
154
|
+
east: center.longitude + span / 2,
|
|
155
|
+
north: center.latitude + span / 2,
|
|
156
|
+
south: center.latitude - span / 2,
|
|
157
|
+
west: center.longitude - span / 2
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function boundsFromMapCoordinates(coords) {
|
|
161
|
+
if (coords.length === 0) {
|
|
162
|
+
return boundsFromCenterAndSpan(DEFAULT_NZ_CENTER, DEFAULT_NZ_REGION_SPAN);
|
|
163
|
+
}
|
|
164
|
+
const region = clampRegionToNZ(
|
|
165
|
+
regionFromCoordinates(
|
|
166
|
+
coords,
|
|
167
|
+
DEFAULT_NZ_REGION.latitudeDelta,
|
|
168
|
+
DEFAULT_NZ_REGION.longitudeDelta
|
|
169
|
+
)
|
|
170
|
+
);
|
|
171
|
+
return regionToBounds(region);
|
|
172
|
+
}
|
|
173
|
+
function boundsForSingleMarker(coord) {
|
|
174
|
+
return regionToBounds(regionForSingleMarker(coord));
|
|
175
|
+
}
|
|
176
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
177
|
+
0 && (module.exports = {
|
|
178
|
+
BOUNDS_PADDING,
|
|
179
|
+
DEFAULT_NZ_CENTER,
|
|
180
|
+
DEFAULT_NZ_REGION,
|
|
181
|
+
DEFAULT_NZ_REGION_SPAN,
|
|
182
|
+
MIN_REGION_SPAN,
|
|
183
|
+
NZ_MAP_BOUNDARIES,
|
|
184
|
+
SINGLE_MARKER_DELTA,
|
|
185
|
+
boundsForSingleMarker,
|
|
186
|
+
boundsFromMapCoordinates,
|
|
187
|
+
boundsToRegion,
|
|
188
|
+
clampBoundsToNZ,
|
|
189
|
+
clampRegionToNZ,
|
|
190
|
+
hasValidMapCoordinate,
|
|
191
|
+
isSameRegion,
|
|
192
|
+
isValidRegion,
|
|
193
|
+
regionForSingleMarker,
|
|
194
|
+
regionFromCoordinates,
|
|
195
|
+
regionToBounds
|
|
196
|
+
});
|
|
197
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/map/index.ts","../../src/map/constants.ts","../../src/map/coordinates.ts","../../src/map/region.ts","../../src/map/bounds.ts"],"sourcesContent":["export {\n BOUNDS_PADDING,\n DEFAULT_NZ_CENTER,\n DEFAULT_NZ_REGION,\n DEFAULT_NZ_REGION_SPAN,\n MIN_REGION_SPAN,\n NZ_MAP_BOUNDARIES,\n SINGLE_MARKER_DELTA,\n} from \"./constants\";\nexport { hasValidMapCoordinate } from \"./coordinates\";\nexport {\n boundsForSingleMarker,\n boundsFromMapCoordinates,\n boundsToRegion,\n clampBoundsToNZ,\n regionToBounds,\n} from \"./bounds\";\nexport {\n clampRegionToNZ,\n isSameRegion,\n isValidRegion,\n regionForSingleMarker,\n regionFromCoordinates,\n} from \"./region\";\nexport type { MapBoundsLiteral, MapCoordinate } from \"./types\";\n","import type { Region } from \"../types/global\";\n\n/** Default region (NZ) used when no markers or for max zoom-out. */\nexport const DEFAULT_NZ_REGION: Region = {\n latitude: -41.2865,\n latitudeDelta: 5,\n longitude: 174.7762,\n longitudeDelta: 5,\n};\n\n/** Center of the default NZ region. */\nexport const DEFAULT_NZ_CENTER = {\n latitude: DEFAULT_NZ_REGION.latitude,\n longitude: DEFAULT_NZ_REGION.longitude,\n} as const;\n\n/** Max zoom-out span (degrees), matching `DEFAULT_NZ_REGION` deltas. */\nexport const DEFAULT_NZ_REGION_SPAN = DEFAULT_NZ_REGION.latitudeDelta;\n\n/** Region span for a single-marker map view. */\nexport const SINGLE_MARKER_DELTA = 2;\n\n/** NZ map boundaries for clamping. */\nexport const NZ_MAP_BOUNDARIES = {\n northEast: { latitude: -33.9, longitude: 178.6 },\n southWest: { latitude: -47.5, longitude: 166.4 },\n} as const;\n\n/** Padding added when fitting coordinates into a region or bounds. */\nexport const BOUNDS_PADDING = 0.15;\n\n/** Minimum lat/lng span when fitting coordinates. */\nexport const MIN_REGION_SPAN = 0.5;\n","import type { MapCoordinate } from \"./types\";\n\nexport function hasValidMapCoordinate(\n location:\n | { latitude?: number | null; longitude?: number | null }\n | null\n | undefined,\n): location is MapCoordinate {\n if (!location) {\n return false;\n }\n\n return (\n typeof location.latitude === \"number\" &&\n typeof location.longitude === \"number\" &&\n Number.isFinite(location.latitude) &&\n Number.isFinite(location.longitude)\n );\n}\n","import type { Region } from \"../types/global\";\n\nimport {\n BOUNDS_PADDING,\n DEFAULT_NZ_REGION,\n MIN_REGION_SPAN,\n NZ_MAP_BOUNDARIES,\n SINGLE_MARKER_DELTA,\n} from \"./constants\";\nimport type { MapCoordinate } from \"./types\";\n\nexport function isValidRegion(region: Region | undefined): region is Region {\n return (\n !!region &&\n typeof region.latitude === \"number\" &&\n typeof region.longitude === \"number\" &&\n Number.isFinite(region.latitude) &&\n Number.isFinite(region.longitude) &&\n typeof region.latitudeDelta === \"number\" &&\n typeof region.longitudeDelta === \"number\" &&\n Number.isFinite(region.latitudeDelta) &&\n Number.isFinite(region.longitudeDelta) &&\n region.latitude >= -85 &&\n region.latitude <= 85 &&\n region.longitude >= -180 &&\n region.longitude <= 180 &&\n region.latitudeDelta > 0 &&\n region.longitudeDelta > 0 &&\n region.latitudeDelta <= 180 &&\n region.longitudeDelta <= 360\n );\n}\n\nexport function isSameRegion(next: Region, current: Region): boolean {\n const epsilon = 0.0001;\n return (\n Math.abs(next.latitude - current.latitude) < epsilon &&\n Math.abs(next.longitude - current.longitude) < epsilon &&\n Math.abs(next.latitudeDelta - current.latitudeDelta) < epsilon &&\n Math.abs(next.longitudeDelta - current.longitudeDelta) < epsilon\n );\n}\n\n/**\n * Region that fits all coordinates with padding; deltas are clamped between a minimum\n * and maxLatitudeDelta / maxLongitudeDelta (e.g. DEFAULT_NZ_REGION deltas).\n * Caller must pass a non-empty coords array.\n */\nexport function regionFromCoordinates(\n coords: readonly MapCoordinate[],\n maxLatitudeDelta: number = DEFAULT_NZ_REGION.latitudeDelta,\n maxLongitudeDelta: number = DEFAULT_NZ_REGION.longitudeDelta,\n): Region {\n const lats = coords.map((coord) => coord.latitude);\n const lngs = coords.map((coord) => coord.longitude);\n const minLat = Math.min(...lats);\n const maxLat = Math.max(...lats);\n const minLng = Math.min(...lngs);\n const maxLng = Math.max(...lngs);\n\n let latDelta = maxLat - minLat + BOUNDS_PADDING;\n let lngDelta = maxLng - minLng + BOUNDS_PADDING;\n latDelta = Math.max(MIN_REGION_SPAN, latDelta);\n lngDelta = Math.max(MIN_REGION_SPAN, lngDelta);\n latDelta = Math.min(latDelta, maxLatitudeDelta);\n lngDelta = Math.min(lngDelta, maxLongitudeDelta);\n\n return {\n latitude: (minLat + maxLat) / 2,\n latitudeDelta: latDelta,\n longitude: (minLng + maxLng) / 2,\n longitudeDelta: lngDelta,\n };\n}\n\n/** Clamp region to NZ: pan inside boundaries, zoom out at most to DEFAULT_NZ_REGION. */\nexport function clampRegionToNZ(region: Region): Region {\n const { northEast, southWest } = NZ_MAP_BOUNDARIES;\n const maxLatDelta = DEFAULT_NZ_REGION.latitudeDelta;\n const maxLngDelta = DEFAULT_NZ_REGION.longitudeDelta;\n\n const latDelta = Math.min(region.latitudeDelta, maxLatDelta);\n const lngDelta = Math.min(region.longitudeDelta, maxLngDelta);\n\n const halfLat = latDelta / 2;\n const halfLng = lngDelta / 2;\n const minLat = southWest.latitude + halfLat;\n const maxLat = northEast.latitude - halfLat;\n const minLng = southWest.longitude + halfLng;\n const maxLng = northEast.longitude - halfLng;\n\n const latitude = Math.max(minLat, Math.min(maxLat, region.latitude));\n const longitude = Math.max(minLng, Math.min(maxLng, region.longitude));\n\n return {\n latitude,\n latitudeDelta: latDelta,\n longitude,\n longitudeDelta: lngDelta,\n };\n}\n\n/** Region centered on one coordinate with the standard single-marker zoom level. */\nexport function regionForSingleMarker(coord: MapCoordinate): Region {\n return clampRegionToNZ({\n latitude: coord.latitude,\n latitudeDelta: SINGLE_MARKER_DELTA,\n longitude: coord.longitude,\n longitudeDelta: SINGLE_MARKER_DELTA,\n });\n}\n","import type { Region } from \"../types/global\";\n\nimport {\n DEFAULT_NZ_CENTER,\n DEFAULT_NZ_REGION,\n DEFAULT_NZ_REGION_SPAN,\n} from \"./constants\";\nimport {\n clampRegionToNZ,\n regionForSingleMarker,\n regionFromCoordinates,\n} from \"./region\";\nimport type { MapBoundsLiteral, MapCoordinate } from \"./types\";\n\nexport function regionToBounds(region: Region): MapBoundsLiteral {\n const halfLat = region.latitudeDelta / 2;\n const halfLng = region.longitudeDelta / 2;\n\n return {\n east: region.longitude + halfLng,\n north: region.latitude + halfLat,\n south: region.latitude - halfLat,\n west: region.longitude - halfLng,\n };\n}\n\nexport function boundsToRegion(bounds: MapBoundsLiteral): Region {\n return {\n latitude: (bounds.north + bounds.south) / 2,\n latitudeDelta: bounds.north - bounds.south,\n longitude: (bounds.east + bounds.west) / 2,\n longitudeDelta: bounds.east - bounds.west,\n };\n}\n\n/** Clamp map bounds to NZ, matching `clampRegionToNZ` behavior. */\nexport function clampBoundsToNZ(bounds: MapBoundsLiteral): MapBoundsLiteral {\n return regionToBounds(clampRegionToNZ(boundsToRegion(bounds)));\n}\n\nfunction boundsFromCenterAndSpan(\n center: MapCoordinate,\n span: number,\n): MapBoundsLiteral {\n return clampBoundsToNZ({\n east: center.longitude + span / 2,\n north: center.latitude + span / 2,\n south: center.latitude - span / 2,\n west: center.longitude - span / 2,\n });\n}\n\n/**\n * Bounds that fit marker coordinates with padding, derived from\n * `regionFromCoordinates` + `clampRegionToNZ`.\n */\nexport function boundsFromMapCoordinates(\n coords: readonly MapCoordinate[],\n): MapBoundsLiteral {\n if (coords.length === 0) {\n return boundsFromCenterAndSpan(DEFAULT_NZ_CENTER, DEFAULT_NZ_REGION_SPAN);\n }\n\n const region = clampRegionToNZ(\n regionFromCoordinates(\n coords,\n DEFAULT_NZ_REGION.latitudeDelta,\n DEFAULT_NZ_REGION.longitudeDelta,\n ),\n );\n\n return regionToBounds(region);\n}\n\n/** Bounds for a single-marker map view. */\nexport function boundsForSingleMarker(coord: MapCoordinate): MapBoundsLiteral {\n return regionToBounds(regionForSingleMarker(coord));\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { x as Region } from '../global-DwcLiMf-.mjs';
|
|
2
|
+
import 'react-hook-form';
|
|
3
|
+
import '../enums/index.mjs';
|
|
4
|
+
|
|
5
|
+
/** Default region (NZ) used when no markers or for max zoom-out. */
|
|
6
|
+
declare const DEFAULT_NZ_REGION: Region;
|
|
7
|
+
/** Center of the default NZ region. */
|
|
8
|
+
declare const DEFAULT_NZ_CENTER: {
|
|
9
|
+
readonly latitude: number;
|
|
10
|
+
readonly longitude: number;
|
|
11
|
+
};
|
|
12
|
+
/** Max zoom-out span (degrees), matching `DEFAULT_NZ_REGION` deltas. */
|
|
13
|
+
declare const DEFAULT_NZ_REGION_SPAN: number;
|
|
14
|
+
/** Region span for a single-marker map view. */
|
|
15
|
+
declare const SINGLE_MARKER_DELTA = 2;
|
|
16
|
+
/** NZ map boundaries for clamping. */
|
|
17
|
+
declare const NZ_MAP_BOUNDARIES: {
|
|
18
|
+
readonly northEast: {
|
|
19
|
+
readonly latitude: -33.9;
|
|
20
|
+
readonly longitude: 178.6;
|
|
21
|
+
};
|
|
22
|
+
readonly southWest: {
|
|
23
|
+
readonly latitude: -47.5;
|
|
24
|
+
readonly longitude: 166.4;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/** Padding added when fitting coordinates into a region or bounds. */
|
|
28
|
+
declare const BOUNDS_PADDING = 0.15;
|
|
29
|
+
/** Minimum lat/lng span when fitting coordinates. */
|
|
30
|
+
declare const MIN_REGION_SPAN = 0.5;
|
|
31
|
+
|
|
32
|
+
type MapCoordinate = {
|
|
33
|
+
latitude: number;
|
|
34
|
+
longitude: number;
|
|
35
|
+
};
|
|
36
|
+
type MapBoundsLiteral = {
|
|
37
|
+
east: number;
|
|
38
|
+
north: number;
|
|
39
|
+
south: number;
|
|
40
|
+
west: number;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
declare function hasValidMapCoordinate(location: {
|
|
44
|
+
latitude?: number | null;
|
|
45
|
+
longitude?: number | null;
|
|
46
|
+
} | null | undefined): location is MapCoordinate;
|
|
47
|
+
|
|
48
|
+
declare function regionToBounds(region: Region): MapBoundsLiteral;
|
|
49
|
+
declare function boundsToRegion(bounds: MapBoundsLiteral): Region;
|
|
50
|
+
/** Clamp map bounds to NZ, matching `clampRegionToNZ` behavior. */
|
|
51
|
+
declare function clampBoundsToNZ(bounds: MapBoundsLiteral): MapBoundsLiteral;
|
|
52
|
+
/**
|
|
53
|
+
* Bounds that fit marker coordinates with padding, derived from
|
|
54
|
+
* `regionFromCoordinates` + `clampRegionToNZ`.
|
|
55
|
+
*/
|
|
56
|
+
declare function boundsFromMapCoordinates(coords: readonly MapCoordinate[]): MapBoundsLiteral;
|
|
57
|
+
/** Bounds for a single-marker map view. */
|
|
58
|
+
declare function boundsForSingleMarker(coord: MapCoordinate): MapBoundsLiteral;
|
|
59
|
+
|
|
60
|
+
declare function isValidRegion(region: Region | undefined): region is Region;
|
|
61
|
+
declare function isSameRegion(next: Region, current: Region): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Region that fits all coordinates with padding; deltas are clamped between a minimum
|
|
64
|
+
* and maxLatitudeDelta / maxLongitudeDelta (e.g. DEFAULT_NZ_REGION deltas).
|
|
65
|
+
* Caller must pass a non-empty coords array.
|
|
66
|
+
*/
|
|
67
|
+
declare function regionFromCoordinates(coords: readonly MapCoordinate[], maxLatitudeDelta?: number, maxLongitudeDelta?: number): Region;
|
|
68
|
+
/** Clamp region to NZ: pan inside boundaries, zoom out at most to DEFAULT_NZ_REGION. */
|
|
69
|
+
declare function clampRegionToNZ(region: Region): Region;
|
|
70
|
+
/** Region centered on one coordinate with the standard single-marker zoom level. */
|
|
71
|
+
declare function regionForSingleMarker(coord: MapCoordinate): Region;
|
|
72
|
+
|
|
73
|
+
export { BOUNDS_PADDING, DEFAULT_NZ_CENTER, DEFAULT_NZ_REGION, DEFAULT_NZ_REGION_SPAN, MIN_REGION_SPAN, type MapBoundsLiteral, type MapCoordinate, NZ_MAP_BOUNDARIES, SINGLE_MARKER_DELTA, boundsForSingleMarker, boundsFromMapCoordinates, boundsToRegion, clampBoundsToNZ, clampRegionToNZ, hasValidMapCoordinate, isSameRegion, isValidRegion, regionForSingleMarker, regionFromCoordinates, regionToBounds };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { x as Region } from '../global-CMZCDnUT.js';
|
|
2
|
+
import 'react-hook-form';
|
|
3
|
+
import '../enums/index.js';
|
|
4
|
+
|
|
5
|
+
/** Default region (NZ) used when no markers or for max zoom-out. */
|
|
6
|
+
declare const DEFAULT_NZ_REGION: Region;
|
|
7
|
+
/** Center of the default NZ region. */
|
|
8
|
+
declare const DEFAULT_NZ_CENTER: {
|
|
9
|
+
readonly latitude: number;
|
|
10
|
+
readonly longitude: number;
|
|
11
|
+
};
|
|
12
|
+
/** Max zoom-out span (degrees), matching `DEFAULT_NZ_REGION` deltas. */
|
|
13
|
+
declare const DEFAULT_NZ_REGION_SPAN: number;
|
|
14
|
+
/** Region span for a single-marker map view. */
|
|
15
|
+
declare const SINGLE_MARKER_DELTA = 2;
|
|
16
|
+
/** NZ map boundaries for clamping. */
|
|
17
|
+
declare const NZ_MAP_BOUNDARIES: {
|
|
18
|
+
readonly northEast: {
|
|
19
|
+
readonly latitude: -33.9;
|
|
20
|
+
readonly longitude: 178.6;
|
|
21
|
+
};
|
|
22
|
+
readonly southWest: {
|
|
23
|
+
readonly latitude: -47.5;
|
|
24
|
+
readonly longitude: 166.4;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/** Padding added when fitting coordinates into a region or bounds. */
|
|
28
|
+
declare const BOUNDS_PADDING = 0.15;
|
|
29
|
+
/** Minimum lat/lng span when fitting coordinates. */
|
|
30
|
+
declare const MIN_REGION_SPAN = 0.5;
|
|
31
|
+
|
|
32
|
+
type MapCoordinate = {
|
|
33
|
+
latitude: number;
|
|
34
|
+
longitude: number;
|
|
35
|
+
};
|
|
36
|
+
type MapBoundsLiteral = {
|
|
37
|
+
east: number;
|
|
38
|
+
north: number;
|
|
39
|
+
south: number;
|
|
40
|
+
west: number;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
declare function hasValidMapCoordinate(location: {
|
|
44
|
+
latitude?: number | null;
|
|
45
|
+
longitude?: number | null;
|
|
46
|
+
} | null | undefined): location is MapCoordinate;
|
|
47
|
+
|
|
48
|
+
declare function regionToBounds(region: Region): MapBoundsLiteral;
|
|
49
|
+
declare function boundsToRegion(bounds: MapBoundsLiteral): Region;
|
|
50
|
+
/** Clamp map bounds to NZ, matching `clampRegionToNZ` behavior. */
|
|
51
|
+
declare function clampBoundsToNZ(bounds: MapBoundsLiteral): MapBoundsLiteral;
|
|
52
|
+
/**
|
|
53
|
+
* Bounds that fit marker coordinates with padding, derived from
|
|
54
|
+
* `regionFromCoordinates` + `clampRegionToNZ`.
|
|
55
|
+
*/
|
|
56
|
+
declare function boundsFromMapCoordinates(coords: readonly MapCoordinate[]): MapBoundsLiteral;
|
|
57
|
+
/** Bounds for a single-marker map view. */
|
|
58
|
+
declare function boundsForSingleMarker(coord: MapCoordinate): MapBoundsLiteral;
|
|
59
|
+
|
|
60
|
+
declare function isValidRegion(region: Region | undefined): region is Region;
|
|
61
|
+
declare function isSameRegion(next: Region, current: Region): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Region that fits all coordinates with padding; deltas are clamped between a minimum
|
|
64
|
+
* and maxLatitudeDelta / maxLongitudeDelta (e.g. DEFAULT_NZ_REGION deltas).
|
|
65
|
+
* Caller must pass a non-empty coords array.
|
|
66
|
+
*/
|
|
67
|
+
declare function regionFromCoordinates(coords: readonly MapCoordinate[], maxLatitudeDelta?: number, maxLongitudeDelta?: number): Region;
|
|
68
|
+
/** Clamp region to NZ: pan inside boundaries, zoom out at most to DEFAULT_NZ_REGION. */
|
|
69
|
+
declare function clampRegionToNZ(region: Region): Region;
|
|
70
|
+
/** Region centered on one coordinate with the standard single-marker zoom level. */
|
|
71
|
+
declare function regionForSingleMarker(coord: MapCoordinate): Region;
|
|
72
|
+
|
|
73
|
+
export { BOUNDS_PADDING, DEFAULT_NZ_CENTER, DEFAULT_NZ_REGION, DEFAULT_NZ_REGION_SPAN, MIN_REGION_SPAN, type MapBoundsLiteral, type MapCoordinate, NZ_MAP_BOUNDARIES, SINGLE_MARKER_DELTA, boundsForSingleMarker, boundsFromMapCoordinates, boundsToRegion, clampBoundsToNZ, clampRegionToNZ, hasValidMapCoordinate, isSameRegion, isValidRegion, regionForSingleMarker, regionFromCoordinates, regionToBounds };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// src/map/constants.ts
|
|
2
|
+
var DEFAULT_NZ_REGION = {
|
|
3
|
+
latitude: -41.2865,
|
|
4
|
+
latitudeDelta: 5,
|
|
5
|
+
longitude: 174.7762,
|
|
6
|
+
longitudeDelta: 5
|
|
7
|
+
};
|
|
8
|
+
var DEFAULT_NZ_CENTER = {
|
|
9
|
+
latitude: DEFAULT_NZ_REGION.latitude,
|
|
10
|
+
longitude: DEFAULT_NZ_REGION.longitude
|
|
11
|
+
};
|
|
12
|
+
var DEFAULT_NZ_REGION_SPAN = DEFAULT_NZ_REGION.latitudeDelta;
|
|
13
|
+
var SINGLE_MARKER_DELTA = 2;
|
|
14
|
+
var NZ_MAP_BOUNDARIES = {
|
|
15
|
+
northEast: { latitude: -33.9, longitude: 178.6 },
|
|
16
|
+
southWest: { latitude: -47.5, longitude: 166.4 }
|
|
17
|
+
};
|
|
18
|
+
var BOUNDS_PADDING = 0.15;
|
|
19
|
+
var MIN_REGION_SPAN = 0.5;
|
|
20
|
+
|
|
21
|
+
// src/map/coordinates.ts
|
|
22
|
+
function hasValidMapCoordinate(location) {
|
|
23
|
+
if (!location) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return typeof location.latitude === "number" && typeof location.longitude === "number" && Number.isFinite(location.latitude) && Number.isFinite(location.longitude);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/map/region.ts
|
|
30
|
+
function isValidRegion(region) {
|
|
31
|
+
return !!region && typeof region.latitude === "number" && typeof region.longitude === "number" && Number.isFinite(region.latitude) && Number.isFinite(region.longitude) && typeof region.latitudeDelta === "number" && typeof region.longitudeDelta === "number" && Number.isFinite(region.latitudeDelta) && Number.isFinite(region.longitudeDelta) && region.latitude >= -85 && region.latitude <= 85 && region.longitude >= -180 && region.longitude <= 180 && region.latitudeDelta > 0 && region.longitudeDelta > 0 && region.latitudeDelta <= 180 && region.longitudeDelta <= 360;
|
|
32
|
+
}
|
|
33
|
+
function isSameRegion(next, current) {
|
|
34
|
+
const epsilon = 1e-4;
|
|
35
|
+
return Math.abs(next.latitude - current.latitude) < epsilon && Math.abs(next.longitude - current.longitude) < epsilon && Math.abs(next.latitudeDelta - current.latitudeDelta) < epsilon && Math.abs(next.longitudeDelta - current.longitudeDelta) < epsilon;
|
|
36
|
+
}
|
|
37
|
+
function regionFromCoordinates(coords, maxLatitudeDelta = DEFAULT_NZ_REGION.latitudeDelta, maxLongitudeDelta = DEFAULT_NZ_REGION.longitudeDelta) {
|
|
38
|
+
const lats = coords.map((coord) => coord.latitude);
|
|
39
|
+
const lngs = coords.map((coord) => coord.longitude);
|
|
40
|
+
const minLat = Math.min(...lats);
|
|
41
|
+
const maxLat = Math.max(...lats);
|
|
42
|
+
const minLng = Math.min(...lngs);
|
|
43
|
+
const maxLng = Math.max(...lngs);
|
|
44
|
+
let latDelta = maxLat - minLat + BOUNDS_PADDING;
|
|
45
|
+
let lngDelta = maxLng - minLng + BOUNDS_PADDING;
|
|
46
|
+
latDelta = Math.max(MIN_REGION_SPAN, latDelta);
|
|
47
|
+
lngDelta = Math.max(MIN_REGION_SPAN, lngDelta);
|
|
48
|
+
latDelta = Math.min(latDelta, maxLatitudeDelta);
|
|
49
|
+
lngDelta = Math.min(lngDelta, maxLongitudeDelta);
|
|
50
|
+
return {
|
|
51
|
+
latitude: (minLat + maxLat) / 2,
|
|
52
|
+
latitudeDelta: latDelta,
|
|
53
|
+
longitude: (minLng + maxLng) / 2,
|
|
54
|
+
longitudeDelta: lngDelta
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function clampRegionToNZ(region) {
|
|
58
|
+
const { northEast, southWest } = NZ_MAP_BOUNDARIES;
|
|
59
|
+
const maxLatDelta = DEFAULT_NZ_REGION.latitudeDelta;
|
|
60
|
+
const maxLngDelta = DEFAULT_NZ_REGION.longitudeDelta;
|
|
61
|
+
const latDelta = Math.min(region.latitudeDelta, maxLatDelta);
|
|
62
|
+
const lngDelta = Math.min(region.longitudeDelta, maxLngDelta);
|
|
63
|
+
const halfLat = latDelta / 2;
|
|
64
|
+
const halfLng = lngDelta / 2;
|
|
65
|
+
const minLat = southWest.latitude + halfLat;
|
|
66
|
+
const maxLat = northEast.latitude - halfLat;
|
|
67
|
+
const minLng = southWest.longitude + halfLng;
|
|
68
|
+
const maxLng = northEast.longitude - halfLng;
|
|
69
|
+
const latitude = Math.max(minLat, Math.min(maxLat, region.latitude));
|
|
70
|
+
const longitude = Math.max(minLng, Math.min(maxLng, region.longitude));
|
|
71
|
+
return {
|
|
72
|
+
latitude,
|
|
73
|
+
latitudeDelta: latDelta,
|
|
74
|
+
longitude,
|
|
75
|
+
longitudeDelta: lngDelta
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function regionForSingleMarker(coord) {
|
|
79
|
+
return clampRegionToNZ({
|
|
80
|
+
latitude: coord.latitude,
|
|
81
|
+
latitudeDelta: SINGLE_MARKER_DELTA,
|
|
82
|
+
longitude: coord.longitude,
|
|
83
|
+
longitudeDelta: SINGLE_MARKER_DELTA
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// src/map/bounds.ts
|
|
88
|
+
function regionToBounds(region) {
|
|
89
|
+
const halfLat = region.latitudeDelta / 2;
|
|
90
|
+
const halfLng = region.longitudeDelta / 2;
|
|
91
|
+
return {
|
|
92
|
+
east: region.longitude + halfLng,
|
|
93
|
+
north: region.latitude + halfLat,
|
|
94
|
+
south: region.latitude - halfLat,
|
|
95
|
+
west: region.longitude - halfLng
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function boundsToRegion(bounds) {
|
|
99
|
+
return {
|
|
100
|
+
latitude: (bounds.north + bounds.south) / 2,
|
|
101
|
+
latitudeDelta: bounds.north - bounds.south,
|
|
102
|
+
longitude: (bounds.east + bounds.west) / 2,
|
|
103
|
+
longitudeDelta: bounds.east - bounds.west
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function clampBoundsToNZ(bounds) {
|
|
107
|
+
return regionToBounds(clampRegionToNZ(boundsToRegion(bounds)));
|
|
108
|
+
}
|
|
109
|
+
function boundsFromCenterAndSpan(center, span) {
|
|
110
|
+
return clampBoundsToNZ({
|
|
111
|
+
east: center.longitude + span / 2,
|
|
112
|
+
north: center.latitude + span / 2,
|
|
113
|
+
south: center.latitude - span / 2,
|
|
114
|
+
west: center.longitude - span / 2
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function boundsFromMapCoordinates(coords) {
|
|
118
|
+
if (coords.length === 0) {
|
|
119
|
+
return boundsFromCenterAndSpan(DEFAULT_NZ_CENTER, DEFAULT_NZ_REGION_SPAN);
|
|
120
|
+
}
|
|
121
|
+
const region = clampRegionToNZ(
|
|
122
|
+
regionFromCoordinates(
|
|
123
|
+
coords,
|
|
124
|
+
DEFAULT_NZ_REGION.latitudeDelta,
|
|
125
|
+
DEFAULT_NZ_REGION.longitudeDelta
|
|
126
|
+
)
|
|
127
|
+
);
|
|
128
|
+
return regionToBounds(region);
|
|
129
|
+
}
|
|
130
|
+
function boundsForSingleMarker(coord) {
|
|
131
|
+
return regionToBounds(regionForSingleMarker(coord));
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
BOUNDS_PADDING,
|
|
135
|
+
DEFAULT_NZ_CENTER,
|
|
136
|
+
DEFAULT_NZ_REGION,
|
|
137
|
+
DEFAULT_NZ_REGION_SPAN,
|
|
138
|
+
MIN_REGION_SPAN,
|
|
139
|
+
NZ_MAP_BOUNDARIES,
|
|
140
|
+
SINGLE_MARKER_DELTA,
|
|
141
|
+
boundsForSingleMarker,
|
|
142
|
+
boundsFromMapCoordinates,
|
|
143
|
+
boundsToRegion,
|
|
144
|
+
clampBoundsToNZ,
|
|
145
|
+
clampRegionToNZ,
|
|
146
|
+
hasValidMapCoordinate,
|
|
147
|
+
isSameRegion,
|
|
148
|
+
isValidRegion,
|
|
149
|
+
regionForSingleMarker,
|
|
150
|
+
regionFromCoordinates,
|
|
151
|
+
regionToBounds
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/map/constants.ts","../../src/map/coordinates.ts","../../src/map/region.ts","../../src/map/bounds.ts"],"sourcesContent":["import type { Region } from \"../types/global\";\n\n/** Default region (NZ) used when no markers or for max zoom-out. */\nexport const DEFAULT_NZ_REGION: Region = {\n latitude: -41.2865,\n latitudeDelta: 5,\n longitude: 174.7762,\n longitudeDelta: 5,\n};\n\n/** Center of the default NZ region. */\nexport const DEFAULT_NZ_CENTER = {\n latitude: DEFAULT_NZ_REGION.latitude,\n longitude: DEFAULT_NZ_REGION.longitude,\n} as const;\n\n/** Max zoom-out span (degrees), matching `DEFAULT_NZ_REGION` deltas. */\nexport const DEFAULT_NZ_REGION_SPAN = DEFAULT_NZ_REGION.latitudeDelta;\n\n/** Region span for a single-marker map view. */\nexport const SINGLE_MARKER_DELTA = 2;\n\n/** NZ map boundaries for clamping. */\nexport const NZ_MAP_BOUNDARIES = {\n northEast: { latitude: -33.9, longitude: 178.6 },\n southWest: { latitude: -47.5, longitude: 166.4 },\n} as const;\n\n/** Padding added when fitting coordinates into a region or bounds. */\nexport const BOUNDS_PADDING = 0.15;\n\n/** Minimum lat/lng span when fitting coordinates. */\nexport const MIN_REGION_SPAN = 0.5;\n","import type { MapCoordinate } from \"./types\";\n\nexport function hasValidMapCoordinate(\n location:\n | { latitude?: number | null; longitude?: number | null }\n | null\n | undefined,\n): location is MapCoordinate {\n if (!location) {\n return false;\n }\n\n return (\n typeof location.latitude === \"number\" &&\n typeof location.longitude === \"number\" &&\n Number.isFinite(location.latitude) &&\n Number.isFinite(location.longitude)\n );\n}\n","import type { Region } from \"../types/global\";\n\nimport {\n BOUNDS_PADDING,\n DEFAULT_NZ_REGION,\n MIN_REGION_SPAN,\n NZ_MAP_BOUNDARIES,\n SINGLE_MARKER_DELTA,\n} from \"./constants\";\nimport type { MapCoordinate } from \"./types\";\n\nexport function isValidRegion(region: Region | undefined): region is Region {\n return (\n !!region &&\n typeof region.latitude === \"number\" &&\n typeof region.longitude === \"number\" &&\n Number.isFinite(region.latitude) &&\n Number.isFinite(region.longitude) &&\n typeof region.latitudeDelta === \"number\" &&\n typeof region.longitudeDelta === \"number\" &&\n Number.isFinite(region.latitudeDelta) &&\n Number.isFinite(region.longitudeDelta) &&\n region.latitude >= -85 &&\n region.latitude <= 85 &&\n region.longitude >= -180 &&\n region.longitude <= 180 &&\n region.latitudeDelta > 0 &&\n region.longitudeDelta > 0 &&\n region.latitudeDelta <= 180 &&\n region.longitudeDelta <= 360\n );\n}\n\nexport function isSameRegion(next: Region, current: Region): boolean {\n const epsilon = 0.0001;\n return (\n Math.abs(next.latitude - current.latitude) < epsilon &&\n Math.abs(next.longitude - current.longitude) < epsilon &&\n Math.abs(next.latitudeDelta - current.latitudeDelta) < epsilon &&\n Math.abs(next.longitudeDelta - current.longitudeDelta) < epsilon\n );\n}\n\n/**\n * Region that fits all coordinates with padding; deltas are clamped between a minimum\n * and maxLatitudeDelta / maxLongitudeDelta (e.g. DEFAULT_NZ_REGION deltas).\n * Caller must pass a non-empty coords array.\n */\nexport function regionFromCoordinates(\n coords: readonly MapCoordinate[],\n maxLatitudeDelta: number = DEFAULT_NZ_REGION.latitudeDelta,\n maxLongitudeDelta: number = DEFAULT_NZ_REGION.longitudeDelta,\n): Region {\n const lats = coords.map((coord) => coord.latitude);\n const lngs = coords.map((coord) => coord.longitude);\n const minLat = Math.min(...lats);\n const maxLat = Math.max(...lats);\n const minLng = Math.min(...lngs);\n const maxLng = Math.max(...lngs);\n\n let latDelta = maxLat - minLat + BOUNDS_PADDING;\n let lngDelta = maxLng - minLng + BOUNDS_PADDING;\n latDelta = Math.max(MIN_REGION_SPAN, latDelta);\n lngDelta = Math.max(MIN_REGION_SPAN, lngDelta);\n latDelta = Math.min(latDelta, maxLatitudeDelta);\n lngDelta = Math.min(lngDelta, maxLongitudeDelta);\n\n return {\n latitude: (minLat + maxLat) / 2,\n latitudeDelta: latDelta,\n longitude: (minLng + maxLng) / 2,\n longitudeDelta: lngDelta,\n };\n}\n\n/** Clamp region to NZ: pan inside boundaries, zoom out at most to DEFAULT_NZ_REGION. */\nexport function clampRegionToNZ(region: Region): Region {\n const { northEast, southWest } = NZ_MAP_BOUNDARIES;\n const maxLatDelta = DEFAULT_NZ_REGION.latitudeDelta;\n const maxLngDelta = DEFAULT_NZ_REGION.longitudeDelta;\n\n const latDelta = Math.min(region.latitudeDelta, maxLatDelta);\n const lngDelta = Math.min(region.longitudeDelta, maxLngDelta);\n\n const halfLat = latDelta / 2;\n const halfLng = lngDelta / 2;\n const minLat = southWest.latitude + halfLat;\n const maxLat = northEast.latitude - halfLat;\n const minLng = southWest.longitude + halfLng;\n const maxLng = northEast.longitude - halfLng;\n\n const latitude = Math.max(minLat, Math.min(maxLat, region.latitude));\n const longitude = Math.max(minLng, Math.min(maxLng, region.longitude));\n\n return {\n latitude,\n latitudeDelta: latDelta,\n longitude,\n longitudeDelta: lngDelta,\n };\n}\n\n/** Region centered on one coordinate with the standard single-marker zoom level. */\nexport function regionForSingleMarker(coord: MapCoordinate): Region {\n return clampRegionToNZ({\n latitude: coord.latitude,\n latitudeDelta: SINGLE_MARKER_DELTA,\n longitude: coord.longitude,\n longitudeDelta: SINGLE_MARKER_DELTA,\n });\n}\n","import type { Region } from \"../types/global\";\n\nimport {\n DEFAULT_NZ_CENTER,\n DEFAULT_NZ_REGION,\n DEFAULT_NZ_REGION_SPAN,\n} from \"./constants\";\nimport {\n clampRegionToNZ,\n regionForSingleMarker,\n regionFromCoordinates,\n} from \"./region\";\nimport type { MapBoundsLiteral, MapCoordinate } from \"./types\";\n\nexport function regionToBounds(region: Region): MapBoundsLiteral {\n const halfLat = region.latitudeDelta / 2;\n const halfLng = region.longitudeDelta / 2;\n\n return {\n east: region.longitude + halfLng,\n north: region.latitude + halfLat,\n south: region.latitude - halfLat,\n west: region.longitude - halfLng,\n };\n}\n\nexport function boundsToRegion(bounds: MapBoundsLiteral): Region {\n return {\n latitude: (bounds.north + bounds.south) / 2,\n latitudeDelta: bounds.north - bounds.south,\n longitude: (bounds.east + bounds.west) / 2,\n longitudeDelta: bounds.east - bounds.west,\n };\n}\n\n/** Clamp map bounds to NZ, matching `clampRegionToNZ` behavior. */\nexport function clampBoundsToNZ(bounds: MapBoundsLiteral): MapBoundsLiteral {\n return regionToBounds(clampRegionToNZ(boundsToRegion(bounds)));\n}\n\nfunction boundsFromCenterAndSpan(\n center: MapCoordinate,\n span: number,\n): MapBoundsLiteral {\n return clampBoundsToNZ({\n east: center.longitude + span / 2,\n north: center.latitude + span / 2,\n south: center.latitude - span / 2,\n west: center.longitude - span / 2,\n });\n}\n\n/**\n * Bounds that fit marker coordinates with padding, derived from\n * `regionFromCoordinates` + `clampRegionToNZ`.\n */\nexport function boundsFromMapCoordinates(\n coords: readonly MapCoordinate[],\n): MapBoundsLiteral {\n if (coords.length === 0) {\n return boundsFromCenterAndSpan(DEFAULT_NZ_CENTER, DEFAULT_NZ_REGION_SPAN);\n }\n\n const region = clampRegionToNZ(\n regionFromCoordinates(\n coords,\n DEFAULT_NZ_REGION.latitudeDelta,\n DEFAULT_NZ_REGION.longitudeDelta,\n ),\n );\n\n return regionToBounds(region);\n}\n\n/** Bounds for a single-marker map view. */\nexport function boundsForSingleMarker(coord: MapCoordinate): MapBoundsLiteral {\n return regionToBounds(regionForSingleMarker(coord));\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnumChatType, EnumChatReportReason, EnumNotificationType, EnumNotificationResourceType, EnumResourceType, EnumEventDateStatus, EnumOSPlatform } from './enums/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { a4 as LocationGeoType } from './global-CMZCDnUT.js';
|
|
3
3
|
|
|
4
4
|
type ParticipantType = {
|
|
5
5
|
active: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnumChatType, EnumChatReportReason, EnumNotificationType, EnumNotificationResourceType, EnumResourceType, EnumEventDateStatus, EnumOSPlatform } from './enums/index.mjs';
|
|
2
|
-
import {
|
|
2
|
+
import { a4 as LocationGeoType } from './global-DwcLiMf-.mjs';
|
|
3
3
|
|
|
4
4
|
type ParticipantType = {
|
|
5
5
|
active: boolean;
|
package/dist/sharing/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EventType, t as EventInfoFormData, V as VendorType, n as VendorInfoFormData, S as StallType, C as Category } from '../global-
|
|
1
|
+
import { E as EventType, t as EventInfoFormData, V as VendorType, n as VendorInfoFormData, S as StallType, C as Category } from '../global-DwcLiMf-.mjs';
|
|
2
2
|
import 'react-hook-form';
|
|
3
3
|
import '../enums/index.mjs';
|
|
4
4
|
|
package/dist/sharing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EventType, t as EventInfoFormData, V as VendorType, n as VendorInfoFormData, S as StallType, C as Category } from '../global-
|
|
1
|
+
import { E as EventType, t as EventInfoFormData, V as VendorType, n as VendorInfoFormData, S as StallType, C as Category } from '../global-CMZCDnUT.js';
|
|
2
2
|
import 'react-hook-form';
|
|
3
3
|
import '../enums/index.js';
|
|
4
4
|
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EnumResourceType, EnumOSPlatform, EnumUserLicence } from '../enums/index.mjs';
|
|
2
|
-
export { o as AdFormData, v as AdFormState, w as AdResource, c as AdType, r as AppSettingsFormData, f as AppSettingsType, A as AuthPayloadType, x as CreateAdFormData, p as CreateAdFormState, s as CreateAppSettingsFormData, i as CreateLoginFormData, q as CreatePartnerFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, m as CreateResetPasswordFormData, u as CreateSchoolFormData, C as CreateUserFormData, l as CreateValidateVerificationTokenFormData, y as EnumAdShowOn, E as EnumAdStatus, z as EnumAdStyle, B as EnumAdType, D as EnumVerificationType, L as LoginFormData, M as MarketingMaterialRequestInputType, n as PartnerFormData, P as PartnerType, F as PosterInputType, G as RedeemRewardInput, a as RedeemRewardResponse, H as RedeemedReward, R as RefreshTokenPayloadType, I as RegisterFormData, J as RequestPasswordResetFormData, K as ResetPasswordFormData, b as ResourceByUser, S as SafeUserType, N as SchoolCampaignType, t as SchoolFormData, O as SchoolRegisteredUserType, g as SchoolReturnType, h as SchoolType, Q as StripeSubscription, T as SubscriptionPlanData, d as SubscriptionPlansResponse, V as SubscriptionPricingData, e as SubscriptionStatusData, W as UserActivity, X as UserActivityEvent, U as UserFormData, Y as UserType, Z as ValidateVerificationTokenFormData } from '../ad-
|
|
3
|
-
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, N as NotificationCount, i as NotificationDataType, a as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-
|
|
4
|
-
export { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-
|
|
5
|
-
import { c as EventListItemType } from '../global-
|
|
6
|
-
export { A as AssociateType,
|
|
2
|
+
export { o as AdFormData, v as AdFormState, w as AdResource, c as AdType, r as AppSettingsFormData, f as AppSettingsType, A as AuthPayloadType, x as CreateAdFormData, p as CreateAdFormState, s as CreateAppSettingsFormData, i as CreateLoginFormData, q as CreatePartnerFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, m as CreateResetPasswordFormData, u as CreateSchoolFormData, C as CreateUserFormData, l as CreateValidateVerificationTokenFormData, y as EnumAdShowOn, E as EnumAdStatus, z as EnumAdStyle, B as EnumAdType, D as EnumVerificationType, L as LoginFormData, M as MarketingMaterialRequestInputType, n as PartnerFormData, P as PartnerType, F as PosterInputType, G as RedeemRewardInput, a as RedeemRewardResponse, H as RedeemedReward, R as RefreshTokenPayloadType, I as RegisterFormData, J as RequestPasswordResetFormData, K as ResetPasswordFormData, b as ResourceByUser, S as SafeUserType, N as SchoolCampaignType, t as SchoolFormData, O as SchoolRegisteredUserType, g as SchoolReturnType, h as SchoolType, Q as StripeSubscription, T as SubscriptionPlanData, d as SubscriptionPlansResponse, V as SubscriptionPricingData, e as SubscriptionStatusData, W as UserActivity, X as UserActivityEvent, U as UserFormData, Y as UserType, Z as ValidateVerificationTokenFormData } from '../ad-QbxQEG6o.mjs';
|
|
3
|
+
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, N as NotificationCount, i as NotificationDataType, a as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-qSbrOsu_.mjs';
|
|
4
|
+
export { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-Bn14BhYR.mjs';
|
|
5
|
+
import { c as EventListItemType } from '../global-DwcLiMf-.mjs';
|
|
6
|
+
export { A as AssociateType, y as BaseGameMap, z as BaseGameType, D as BaseResourceType, B as BaseResourceTypeFormData, C as Category, s as CreateEventFormData, u as CreateEventInfoFormData, H as CreateFormData, w as CreatePostFormData, q as CreateUnregisteredVendorFormData, m as CreateVendorFormData, o as CreateVendorInfoFormData, I as DailyClueBaseGame, J as DailyClueGameData, K as DateTimeType, M as DateTimeWithPriceType, N as DeviceInfo, Q as EnumGameStatus, T as EnumGameType, W as EnumPostContentType, j as EnumPostType, r as EventFormData, t as EventInfoFormData, d as EventInfoType, X as EventStatusType, E as EventType, a as FormDateField, F as FormField, Y as GameDate, G as GameDocType, Z as GameHistory, k as GameLeaderboard, _ as GamePlacement, $ as GamePlacementClue, a0 as GameType, a1 as GeocodeLocation, a2 as GlobalGameData, a3 as ImageObjectType, a4 as LocationGeoType, L as LocationType, a5 as Nullable, O as OptionItem, a6 as OwnerType, a7 as PROMO_CODE_PREFIX, a8 as PaymentInfoType, a9 as PostContentData, aa as PostContentFormData, ab as PostContentGame, ac as PostContentImage, ad as PostContentList, ae as PostContentTextarea, af as PostContentType, ag as PostContentVideo, ah as PostFileInput, v as PostFormData, P as PostType, ai as PosterUsageType, aj as PromoCodeType, ak as PuzzleAnswer, al as PuzzleAnsweredQuestion, am as PuzzleBaseGame, an as PuzzleGameData, ao as PuzzleQuestion, R as RefundPolicy, x as Region, ap as RelatedPostType, aq as RelationDate, ar as RelationInputType, e as RelationType, b as Requirement, f as ResourceConnectionsType, as as ResourceContactDetailsType, at as ResourceDetails, au as ResourceImageType, av as SocialMediaType, S as StallType, aw as Subcategory, ax as SubcategoryItems, ay as TermsAgreement, p as UnregisteredVendorFormData, az as UnregisteredVendorInvitationType, g as UnregisteredVendorType, U as UseGetResourcesByRegionOptions, i as UserLicenceType, aA as VendorAttributes, aB as VendorCalendarData, l as VendorFormData, n as VendorInfoFormData, h as VendorInfoType, aC as VendorProductList, V as VendorType, aD as gameScreenIdentifierList, aE as gameTypeToDisplayName } from '../global-DwcLiMf-.mjs';
|
|
7
7
|
import '../images/index.mjs';
|
|
8
8
|
import 'react-hook-form';
|
|
9
9
|
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EnumResourceType, EnumOSPlatform, EnumUserLicence } from '../enums/index.js';
|
|
2
|
-
export { o as AdFormData, v as AdFormState, w as AdResource, c as AdType, r as AppSettingsFormData, f as AppSettingsType, A as AuthPayloadType, x as CreateAdFormData, p as CreateAdFormState, s as CreateAppSettingsFormData, i as CreateLoginFormData, q as CreatePartnerFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, m as CreateResetPasswordFormData, u as CreateSchoolFormData, C as CreateUserFormData, l as CreateValidateVerificationTokenFormData, y as EnumAdShowOn, E as EnumAdStatus, z as EnumAdStyle, B as EnumAdType, D as EnumVerificationType, L as LoginFormData, M as MarketingMaterialRequestInputType, n as PartnerFormData, P as PartnerType, F as PosterInputType, G as RedeemRewardInput, a as RedeemRewardResponse, H as RedeemedReward, R as RefreshTokenPayloadType, I as RegisterFormData, J as RequestPasswordResetFormData, K as ResetPasswordFormData, b as ResourceByUser, S as SafeUserType, N as SchoolCampaignType, t as SchoolFormData, O as SchoolRegisteredUserType, g as SchoolReturnType, h as SchoolType, Q as StripeSubscription, T as SubscriptionPlanData, d as SubscriptionPlansResponse, V as SubscriptionPricingData, e as SubscriptionStatusData, W as UserActivity, X as UserActivityEvent, U as UserFormData, Y as UserType, Z as ValidateVerificationTokenFormData } from '../ad-
|
|
3
|
-
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, N as NotificationCount, i as NotificationDataType, a as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-
|
|
4
|
-
export { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-
|
|
5
|
-
import { c as EventListItemType } from '../global-
|
|
6
|
-
export { A as AssociateType,
|
|
2
|
+
export { o as AdFormData, v as AdFormState, w as AdResource, c as AdType, r as AppSettingsFormData, f as AppSettingsType, A as AuthPayloadType, x as CreateAdFormData, p as CreateAdFormState, s as CreateAppSettingsFormData, i as CreateLoginFormData, q as CreatePartnerFormData, j as CreateRegisterFormData, k as CreateRequestPasswordResetFormData, m as CreateResetPasswordFormData, u as CreateSchoolFormData, C as CreateUserFormData, l as CreateValidateVerificationTokenFormData, y as EnumAdShowOn, E as EnumAdStatus, z as EnumAdStyle, B as EnumAdType, D as EnumVerificationType, L as LoginFormData, M as MarketingMaterialRequestInputType, n as PartnerFormData, P as PartnerType, F as PosterInputType, G as RedeemRewardInput, a as RedeemRewardResponse, H as RedeemedReward, R as RefreshTokenPayloadType, I as RegisterFormData, J as RequestPasswordResetFormData, K as ResetPasswordFormData, b as ResourceByUser, S as SafeUserType, N as SchoolCampaignType, t as SchoolFormData, O as SchoolRegisteredUserType, g as SchoolReturnType, h as SchoolType, Q as StripeSubscription, T as SubscriptionPlanData, d as SubscriptionPlansResponse, V as SubscriptionPricingData, e as SubscriptionStatusData, W as UserActivity, X as UserActivityEvent, U as UserFormData, Y as UserType, Z as ValidateVerificationTokenFormData } from '../ad-pLZUkF7z.js';
|
|
3
|
+
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, N as NotificationCount, i as NotificationDataType, a as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-BiIFWxSA.js';
|
|
4
|
+
export { C as ContactUsFormData, a as CreateContactUsFormData } from '../contactUs-CbgB8N5m.js';
|
|
5
|
+
import { c as EventListItemType } from '../global-CMZCDnUT.js';
|
|
6
|
+
export { A as AssociateType, y as BaseGameMap, z as BaseGameType, D as BaseResourceType, B as BaseResourceTypeFormData, C as Category, s as CreateEventFormData, u as CreateEventInfoFormData, H as CreateFormData, w as CreatePostFormData, q as CreateUnregisteredVendorFormData, m as CreateVendorFormData, o as CreateVendorInfoFormData, I as DailyClueBaseGame, J as DailyClueGameData, K as DateTimeType, M as DateTimeWithPriceType, N as DeviceInfo, Q as EnumGameStatus, T as EnumGameType, W as EnumPostContentType, j as EnumPostType, r as EventFormData, t as EventInfoFormData, d as EventInfoType, X as EventStatusType, E as EventType, a as FormDateField, F as FormField, Y as GameDate, G as GameDocType, Z as GameHistory, k as GameLeaderboard, _ as GamePlacement, $ as GamePlacementClue, a0 as GameType, a1 as GeocodeLocation, a2 as GlobalGameData, a3 as ImageObjectType, a4 as LocationGeoType, L as LocationType, a5 as Nullable, O as OptionItem, a6 as OwnerType, a7 as PROMO_CODE_PREFIX, a8 as PaymentInfoType, a9 as PostContentData, aa as PostContentFormData, ab as PostContentGame, ac as PostContentImage, ad as PostContentList, ae as PostContentTextarea, af as PostContentType, ag as PostContentVideo, ah as PostFileInput, v as PostFormData, P as PostType, ai as PosterUsageType, aj as PromoCodeType, ak as PuzzleAnswer, al as PuzzleAnsweredQuestion, am as PuzzleBaseGame, an as PuzzleGameData, ao as PuzzleQuestion, R as RefundPolicy, x as Region, ap as RelatedPostType, aq as RelationDate, ar as RelationInputType, e as RelationType, b as Requirement, f as ResourceConnectionsType, as as ResourceContactDetailsType, at as ResourceDetails, au as ResourceImageType, av as SocialMediaType, S as StallType, aw as Subcategory, ax as SubcategoryItems, ay as TermsAgreement, p as UnregisteredVendorFormData, az as UnregisteredVendorInvitationType, g as UnregisteredVendorType, U as UseGetResourcesByRegionOptions, i as UserLicenceType, aA as VendorAttributes, aB as VendorCalendarData, l as VendorFormData, n as VendorInfoFormData, h as VendorInfoType, aC as VendorProductList, V as VendorType, aD as gameScreenIdentifierList, aE as gameTypeToDisplayName } from '../global-CMZCDnUT.js';
|
|
7
7
|
import '../images/index.js';
|
|
8
8
|
import 'react-hook-form';
|
|
9
9
|
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as DailyClueGameData, $ as GamePlacementClue, _ as GamePlacement, j as EnumPostType, O as OptionItem, av as SocialMediaType, K as DateTimeType } from '../global-DwcLiMf-.mjs';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import { EnumRegions, EnumUserLicence, EnumReward, EnumInviteStatus, EnumEventDateStatus } from '../enums/index.mjs';
|
|
4
4
|
import 'react-hook-form';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as DailyClueGameData, $ as GamePlacementClue, _ as GamePlacement, j as EnumPostType, O as OptionItem, av as SocialMediaType, K as DateTimeType } from '../global-CMZCDnUT.js';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import { EnumRegions, EnumUserLicence, EnumReward, EnumInviteStatus, EnumEventDateStatus } from '../enums/index.js';
|
|
4
4
|
import 'react-hook-form';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timardex/cluemart-shared",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.755",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -41,6 +41,11 @@
|
|
|
41
41
|
"import": "./dist/hooks/index.mjs",
|
|
42
42
|
"require": "./dist/hooks/index.cjs"
|
|
43
43
|
},
|
|
44
|
+
"./map": {
|
|
45
|
+
"types": "./dist/map/index.d.ts",
|
|
46
|
+
"import": "./dist/map/index.mjs",
|
|
47
|
+
"require": "./dist/map/index.cjs"
|
|
48
|
+
},
|
|
44
49
|
"./graphql": {
|
|
45
50
|
"types": "./dist/graphql/index.d.ts",
|
|
46
51
|
"import": "./dist/graphql/index.mjs",
|