@timardex/cluemart-shared 1.5.587 → 1.5.590
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/{chunk-IMTMBZI7.mjs → chunk-2NQUR2AV.mjs} +2 -2
- package/dist/chunk-36TVNR7V.mjs +204 -0
- package/dist/chunk-36TVNR7V.mjs.map +1 -0
- package/dist/{chunk-L74HNX7U.mjs → chunk-YV2JDG4R.mjs} +4 -4
- package/dist/formFields/index.mjs +3 -3
- package/dist/hooks/index.cjs +39 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +12 -11
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +226 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +117 -1
- package/dist/index.d.ts +117 -1
- package/dist/index.mjs +201 -0
- package/dist/index.mjs.map +1 -1
- package/dist/sharing/index.cjs +254 -0
- package/dist/sharing/index.cjs.map +1 -0
- package/dist/sharing/index.d.mts +117 -0
- package/dist/sharing/index.d.ts +117 -0
- package/dist/sharing/index.mjs +55 -0
- package/dist/sharing/index.mjs.map +1 -0
- package/dist/utils/index.mjs +2 -2
- package/package.json +6 -1
- /package/dist/{chunk-IMTMBZI7.mjs.map → chunk-2NQUR2AV.mjs.map} +0 -0
- /package/dist/{chunk-L74HNX7U.mjs.map → chunk-YV2JDG4R.mjs.map} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -2627,6 +2627,122 @@ declare function useAppSettingsForm(data?: AppSettingsFormData): CreateAppSettin
|
|
|
2627
2627
|
|
|
2628
2628
|
declare function useSchoolForm(data?: SchoolFormData): CreateSchoolFormData;
|
|
2629
2629
|
|
|
2630
|
+
type ShareEventDateTime = {
|
|
2631
|
+
startDate: string;
|
|
2632
|
+
endDate?: string | null;
|
|
2633
|
+
};
|
|
2634
|
+
/** Minimal event fields used by invitation share copy (GraphQL share queries). */
|
|
2635
|
+
type ShareEventForInvitation = {
|
|
2636
|
+
dateTime: ShareEventDateTime[];
|
|
2637
|
+
description: string | null;
|
|
2638
|
+
location: {
|
|
2639
|
+
fullAddress: string;
|
|
2640
|
+
};
|
|
2641
|
+
};
|
|
2642
|
+
type ShareVendorCategory = {
|
|
2643
|
+
name: string;
|
|
2644
|
+
subcategories: Array<{
|
|
2645
|
+
name: string;
|
|
2646
|
+
}>;
|
|
2647
|
+
};
|
|
2648
|
+
/** Minimal vendor fields used by application share copy (GraphQL share queries). */
|
|
2649
|
+
type ShareVendorForApplication = {
|
|
2650
|
+
categories: ShareVendorCategory[];
|
|
2651
|
+
description: string | null;
|
|
2652
|
+
};
|
|
2653
|
+
type ShareStallType = {
|
|
2654
|
+
label: string;
|
|
2655
|
+
price: number;
|
|
2656
|
+
stallCapacity: number;
|
|
2657
|
+
};
|
|
2658
|
+
/** Minimal event info fields for invitation share copy (GraphQL share queries). */
|
|
2659
|
+
type ShareEventInfoForInvitation = {
|
|
2660
|
+
applicationDeadlineHours: number;
|
|
2661
|
+
dateTime: Array<{
|
|
2662
|
+
stallTypes: ShareStallType[];
|
|
2663
|
+
}>;
|
|
2664
|
+
requirements?: Array<{
|
|
2665
|
+
label: string;
|
|
2666
|
+
value: boolean;
|
|
2667
|
+
}> | null;
|
|
2668
|
+
};
|
|
2669
|
+
/** Minimal vendor info fields for application share copy (GraphQL share queries). */
|
|
2670
|
+
type ShareVendorInfoForApplication = {
|
|
2671
|
+
compliance?: {
|
|
2672
|
+
liabilityInsurance: boolean;
|
|
2673
|
+
foodBeverageLicense: boolean;
|
|
2674
|
+
} | null;
|
|
2675
|
+
product: {
|
|
2676
|
+
priceRange: {
|
|
2677
|
+
min: string;
|
|
2678
|
+
max: string;
|
|
2679
|
+
};
|
|
2680
|
+
};
|
|
2681
|
+
stallInfo: {
|
|
2682
|
+
size: {
|
|
2683
|
+
width: string;
|
|
2684
|
+
depth: string;
|
|
2685
|
+
};
|
|
2686
|
+
};
|
|
2687
|
+
};
|
|
2688
|
+
|
|
2689
|
+
declare function buildInvitationShareDescription(event: ShareEventForInvitation, eventInfo: ShareEventInfoForInvitation | null | undefined): string;
|
|
2690
|
+
declare function buildApplicationShareDescription(vendor: ShareVendorForApplication, vendorInfo: ShareVendorInfoForApplication | null | undefined): string;
|
|
2691
|
+
|
|
2692
|
+
/** Path segments for relation share URLs — must match mobile `RelationTitle` values. */
|
|
2693
|
+
declare const RELATION_SHARE_INVITATION: "invitation";
|
|
2694
|
+
declare const RELATION_SHARE_APPLICATION: "application";
|
|
2695
|
+
declare const RELATION_SHARE_RESOURCE_TYPES: readonly ["invitation", "application"];
|
|
2696
|
+
type RelationShareResourceType = (typeof RELATION_SHARE_RESOURCE_TYPES)[number];
|
|
2697
|
+
declare function isRelationShareResourceType(resourceType: string): resourceType is RelationShareResourceType;
|
|
2698
|
+
|
|
2699
|
+
/** Path segments for public resource share URLs (markets, posts, etc.). */
|
|
2700
|
+
declare const PUBLIC_SHARE_PATH_TYPES: readonly ["market", "stallholder", "partner", "daily_meets", "daily_tips", "daily_games"];
|
|
2701
|
+
type PublicSharePathType = (typeof PUBLIC_SHARE_PATH_TYPES)[number];
|
|
2702
|
+
/** @deprecated Use {@link PUBLIC_SHARE_PATH_TYPES} — kept for mobile deep-link helpers. */
|
|
2703
|
+
declare const RESOURCE_SHARE_TYPES_FOR_URL: readonly ["market", "stallholder", "partner", "daily_meets", "daily_tips", "daily_games"];
|
|
2704
|
+
type RelationSharePathType = typeof RELATION_SHARE_INVITATION | typeof RELATION_SHARE_APPLICATION;
|
|
2705
|
+
type ShareType = PublicSharePathType | RelationSharePathType;
|
|
2706
|
+
/** Alternation for deep-link regexes — keep in sync with {@link ShareType}. */
|
|
2707
|
+
declare const SHARE_TYPE_PATH_REGEX: string;
|
|
2708
|
+
declare function buildShareUrl(type: ShareType, id: string): string;
|
|
2709
|
+
|
|
2710
|
+
declare const SHARE_SITE_URL = "https://cluemart.co.nz";
|
|
2711
|
+
declare const DEFAULT_SHARE_OG_IMAGE = "https://cluemart.co.nz/assets/logo.webp";
|
|
2712
|
+
declare const RESOURCE_SHARE_TYPES: readonly ["market", "stallholder", "partner"];
|
|
2713
|
+
type ResourceShareType = (typeof RESOURCE_SHARE_TYPES)[number];
|
|
2714
|
+
declare const POST_SHARE_RESOURCE_TYPES: readonly ["daily_meets", "daily_tips", "daily_games"];
|
|
2715
|
+
type PostShareResourceType = (typeof POST_SHARE_RESOURCE_TYPES)[number];
|
|
2716
|
+
type ShareResourceType = ResourceShareType | PostShareResourceType | RelationShareResourceType;
|
|
2717
|
+
declare const SHARE_RESOURCE_LABEL: Record<ShareResourceType, string>;
|
|
2718
|
+
declare function isPostShareResourceType(resourceType: ShareResourceType): resourceType is PostShareResourceType;
|
|
2719
|
+
|
|
2720
|
+
declare function formatCategoryLabel(category: ShareVendorCategory): string;
|
|
2721
|
+
|
|
2722
|
+
/** Visible separator for multi-block share text (OG, Facebook quote, crawlers collapse newlines). */
|
|
2723
|
+
declare const SHARE_DESCRIPTION_SECTION_SEPARATOR = " \u00B7 ";
|
|
2724
|
+
/** @deprecated Use {@link SHARE_DESCRIPTION_SECTION_SEPARATOR}. */
|
|
2725
|
+
declare const SHARE_COMPACT_SECTION_SEPARATOR = " \u00B7 ";
|
|
2726
|
+
declare function joinShareDescriptionSections(sections: ReadonlyArray<string | false | null | undefined>): string;
|
|
2727
|
+
|
|
2728
|
+
/**
|
|
2729
|
+
* Formats share descriptions for Open Graph / Twitter meta tags.
|
|
2730
|
+
* Legacy `\n\n` sections are joined with {@link SHARE_DESCRIPTION_SECTION_SEPARATOR}
|
|
2731
|
+
* because Facebook and others collapse line breaks into spaces.
|
|
2732
|
+
*/
|
|
2733
|
+
declare function normalizeShareOgDescription(value: string): string;
|
|
2734
|
+
/**
|
|
2735
|
+
* Formats multiline share copy for UIs that strip line breaks (Facebook SDK quote).
|
|
2736
|
+
*/
|
|
2737
|
+
declare function formatShareSectionsForCompactDisplay(value: string): string;
|
|
2738
|
+
/**
|
|
2739
|
+
* Quote text for Facebook ShareDialog — avoids `\n\n` which Meta renders as a single space.
|
|
2740
|
+
*/
|
|
2741
|
+
declare function buildFacebookShareQuote(title: string, description: string): string | undefined;
|
|
2742
|
+
|
|
2743
|
+
declare function normalizeShareRouteId(id: string): string;
|
|
2744
|
+
declare function buildSharePagePath(resourceType: ShareResourceType, rawId: string): string;
|
|
2745
|
+
|
|
2630
2746
|
declare const SAVED_PASSWORD_KEY = "savedPassword";
|
|
2631
2747
|
declare const SAVED_EMAIL_KEY = "savedEmail";
|
|
2632
2748
|
declare const SAVED_TOKEN_KEY = "savedToken";
|
|
@@ -2743,4 +2859,4 @@ declare const ANDROID_URL = "https://play.google.com/store/apps/details?id=com.t
|
|
|
2743
2859
|
declare const SCHOOL_MIN_STUDENT_COUNT = 300;
|
|
2744
2860
|
declare const SCHOOL_MAX_STUDENT_COUNT = 0;
|
|
2745
2861
|
|
|
2746
|
-
export { ANDROID_URL, type AdFormData, type AdResource, type AdType, type AdminUpdateResourceType, type AppSettingsFormData, type AppSettingsType, type AssociateType, type BadgeBasename, type BadgeId, type BaseGameMap, type BaseGameType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageReaction, type ChatMessageReplyPreview, type ChatMessageSeen, type ChatMessageType, type ChatType, type CluiImageBasename, type CluiImageId, type ContactUsFormData, type CreateAdFormData, type CreateAppSettingsFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreatePostFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateSchoolFormData, type CreateUnregisteredVendorFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DailyClueBaseGame, type DailyClueGameData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumBillingPeriod, EnumChatReportReason, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumGameStatus, EnumGameType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumPostContentType, EnumPostType, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, EnumVerificationType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventListItemType, type EventStatusType, type EventType, type FormDateField, type FormField, type GameDate, type GameDocType, type GameHistory, type GameLeaderboard, type GamePlacement, type GamePlacementClue, type GameType, type GeocodeLocation, type GlobalGameData, type GoogleAddressComponent, type GoogleImportedMarket, IMAGE_EXTENSION, IOS_URL, type IconBasename, type IconId, type ImageObjectType, ImageTypeEnum, type LocationGeoType, type LocationType, type LoginFormData, type LogoBasename, type LogoId, type MarketingMaterialRequestInputType, type MiniQuizAnswer, type MiniQuizAnsweredQuestion, type MiniQuizBaseGame, type MiniQuizGameData, type MiniQuizQuestion, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, type OtherImagesBasename, type OtherImagesId, type OwnerType, PROMO_CODE_PREFIX, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PostContentData, type PostContentFormData, type PostContentGame, type PostContentImage, type PostContentList, type PostContentTextarea, type PostContentType, type PostContentVideo, type PostFileInput, type PostFormData, type PostType, type PosterAssetId, type PosterImageBasename, type PosterInputType, type PosterUsageType, type PromoCodeType, type RefundPolicy, type Region, type RegisterFormData, type RelationDate, type RelationType, type ReportChatUser, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceByUser, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceDetails, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, SCHOOL_MAX_STUDENT_COUNT, SCHOOL_MIN_STUDENT_COUNT, type SchoolCampaignType, type SchoolFormData, type SchoolRegisteredUserType, type SchoolReturnType, type SchoolType, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionPlanData, type SubscriptionPlansResponse, type SubscriptionPricingData, type SubscriptionStatusData, type TermsAgreement, USER_STORAGE_KEY, type UnregisteredVendorFormData, type UnregisteredVendorInvitationType, type UnregisteredVendorType, type UseGetEventsByRegionOptions, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorCalendarData, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorProductList, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, badgeFiles, badgeIds, badges, capitalizeFirstLetter, categoryColors, cluemartSocialMedia, cluiFiles, cluiIds, cluiImages, companyContactFields, computeDailyClueState, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultLocation, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, gameScreenIdentifierList, gameTypeToDisplayName, getCurrentAndFutureDates, globalDefaultValues, iconFiles, iconIds, icons, isFutureDatesBeforeThreshold, isIsoDateString, licenseNiceNames, lightColors, loginFields, logoFiles, logoIds, logos, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, nzStartOfDay, otherImages, otherImagesFiles, otherImagesIds, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, posterFiles, posterIds, posters, priceUnits, producedIngOptions, productLabelGroups, profileFields, refundPolicyOptions, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, seededShuffle, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminPermanentlyDeleteResource, useAdminResendUserVerificationEmail, useAdminUpdateResourceType, useAppSettingsForm, useCancelSubscription, useContactUs, useContactUsForm, useCrawlGoogleMarkets, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateCustomerPortal, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePost, useCreatePoster, useCreatePrivateChat, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateSchool, useCreateUnregisteredVendor, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeletePost, useDeleteRelation, useDeleteSchool, useDeleteUnregisteredVendor, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetAppSettings, useGetChat, useGetChatSubscription, useGetChatsByRegion, useGetEvent, useGetEventByPlaceId, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetGame, useGetGameLeaderboard, useGetGames, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetPost, useGetPosts, useGetPostsByType, useGetRelation, useGetRelationByEventAndVendor, useGetReportedChatUsers, useGetResourceActivity, useGetResourceConnections, useGetSchool, useGetSchools, useGetSubscriptionPlans, useGetSubscriptionStatus, useGetUnregisteredVendor, useGetUnregisteredVendors, useGetUnregisteredVendorsByInviterId, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserPartners, useGetUserResources, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLeaveGame, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkChatMessagesSeen, useMarkNotificationRead, usePartnerForm, usePostForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useReportChatUser, useRequestMarketingMaterial, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSchoolForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSelectStandardPackage, useSendChatMessage, useStartGame, useToggleChatMessageLike, useUnlinkUnregisteredVendorByInviterId, useUnregisteredVendorForm, useUpdateAd, useUpdateAppSettings, useUpdateDailyClueGame, useUpdateEvent, useUpdateEventInfo, useUpdateGoogleImportedMarkets, useUpdateMiniQuizGame, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSchool, useUpdateSubscriptionPlan, useUpdateUnregisteredVendor, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
|
|
2862
|
+
export { ANDROID_URL, type AdFormData, type AdResource, type AdType, type AdminUpdateResourceType, type AppSettingsFormData, type AppSettingsType, type AssociateType, type BadgeBasename, type BadgeId, type BaseGameMap, type BaseGameType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageReaction, type ChatMessageReplyPreview, type ChatMessageSeen, type ChatMessageType, type ChatType, type CluiImageBasename, type CluiImageId, type ContactUsFormData, type CreateAdFormData, type CreateAppSettingsFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreatePostFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateSchoolFormData, type CreateUnregisteredVendorFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, DEFAULT_SHARE_OG_IMAGE, type DailyClueBaseGame, type DailyClueGameData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumBillingPeriod, EnumChatReportReason, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumGameStatus, EnumGameType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumPostContentType, EnumPostType, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, EnumVerificationType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventListItemType, type EventStatusType, type EventType, type FormDateField, type FormField, type GameDate, type GameDocType, type GameHistory, type GameLeaderboard, type GamePlacement, type GamePlacementClue, type GameType, type GeocodeLocation, type GlobalGameData, type GoogleAddressComponent, type GoogleImportedMarket, IMAGE_EXTENSION, IOS_URL, type IconBasename, type IconId, type ImageObjectType, ImageTypeEnum, type LocationGeoType, type LocationType, type LoginFormData, type LogoBasename, type LogoId, type MarketingMaterialRequestInputType, type MiniQuizAnswer, type MiniQuizAnsweredQuestion, type MiniQuizBaseGame, type MiniQuizGameData, type MiniQuizQuestion, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, type OtherImagesBasename, type OtherImagesId, type OwnerType, POST_SHARE_RESOURCE_TYPES, PROMO_CODE_PREFIX, PUBLIC_SHARE_PATH_TYPES, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PostContentData, type PostContentFormData, type PostContentGame, type PostContentImage, type PostContentList, type PostContentTextarea, type PostContentType, type PostContentVideo, type PostFileInput, type PostFormData, type PostShareResourceType, type PostType, type PosterAssetId, type PosterImageBasename, type PosterInputType, type PosterUsageType, type PromoCodeType, type PublicSharePathType, RELATION_SHARE_APPLICATION, RELATION_SHARE_INVITATION, RELATION_SHARE_RESOURCE_TYPES, RESOURCE_SHARE_TYPES, RESOURCE_SHARE_TYPES_FOR_URL, type RefundPolicy, type Region, type RegisterFormData, type RelationDate, type RelationSharePathType, type RelationShareResourceType, type RelationType, type ReportChatUser, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceByUser, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceDetails, type ResourceImageType, type ResourceShareType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, SCHOOL_MAX_STUDENT_COUNT, SCHOOL_MIN_STUDENT_COUNT, SHARE_COMPACT_SECTION_SEPARATOR, SHARE_DESCRIPTION_SECTION_SEPARATOR, SHARE_RESOURCE_LABEL, SHARE_SITE_URL, SHARE_TYPE_PATH_REGEX, type SchoolCampaignType, type SchoolFormData, type SchoolRegisteredUserType, type SchoolReturnType, type SchoolType, type ShareEventDateTime, type ShareEventForInvitation, type ShareEventInfoForInvitation, type ShareResourceType, type ShareStallType, type ShareType, type ShareVendorCategory, type ShareVendorForApplication, type ShareVendorInfoForApplication, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionPlanData, type SubscriptionPlansResponse, type SubscriptionPricingData, type SubscriptionStatusData, type TermsAgreement, USER_STORAGE_KEY, type UnregisteredVendorFormData, type UnregisteredVendorInvitationType, type UnregisteredVendorType, type UseGetEventsByRegionOptions, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorCalendarData, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorProductList, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, badgeFiles, badgeIds, badges, buildApplicationShareDescription, buildFacebookShareQuote, buildInvitationShareDescription, buildSharePagePath, buildShareUrl, capitalizeFirstLetter, categoryColors, cluemartSocialMedia, cluiFiles, cluiIds, cluiImages, companyContactFields, computeDailyClueState, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultLocation, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatCategoryLabel, formatDate, formatShareSectionsForCompactDisplay, formatTimestamp, gameScreenIdentifierList, gameTypeToDisplayName, getCurrentAndFutureDates, globalDefaultValues, iconFiles, iconIds, icons, isFutureDatesBeforeThreshold, isIsoDateString, isPostShareResourceType, isRelationShareResourceType, joinShareDescriptionSections, licenseNiceNames, lightColors, loginFields, logoFiles, logoIds, logos, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeShareOgDescription, normalizeShareRouteId, normalizeUrl, nzStartOfDay, otherImages, otherImagesFiles, otherImagesIds, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, posterFiles, posterIds, posters, priceUnits, producedIngOptions, productLabelGroups, profileFields, refundPolicyOptions, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, seededShuffle, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminPermanentlyDeleteResource, useAdminResendUserVerificationEmail, useAdminUpdateResourceType, useAppSettingsForm, useCancelSubscription, useContactUs, useContactUsForm, useCrawlGoogleMarkets, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateCustomerPortal, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePost, useCreatePoster, useCreatePrivateChat, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateSchool, useCreateUnregisteredVendor, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeletePost, useDeleteRelation, useDeleteSchool, useDeleteUnregisteredVendor, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetAppSettings, useGetChat, useGetChatSubscription, useGetChatsByRegion, useGetEvent, useGetEventByPlaceId, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetGame, useGetGameLeaderboard, useGetGames, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetPost, useGetPosts, useGetPostsByType, useGetRelation, useGetRelationByEventAndVendor, useGetReportedChatUsers, useGetResourceActivity, useGetResourceConnections, useGetSchool, useGetSchools, useGetSubscriptionPlans, useGetSubscriptionStatus, useGetUnregisteredVendor, useGetUnregisteredVendors, useGetUnregisteredVendorsByInviterId, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserPartners, useGetUserResources, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLeaveGame, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkChatMessagesSeen, useMarkNotificationRead, usePartnerForm, usePostForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useReportChatUser, useRequestMarketingMaterial, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSchoolForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSelectStandardPackage, useSendChatMessage, useStartGame, useToggleChatMessageLike, useUnlinkUnregisteredVendorByInviterId, useUnregisteredVendorForm, useUpdateAd, useUpdateAppSettings, useUpdateDailyClueGame, useUpdateEvent, useUpdateEventInfo, useUpdateGoogleImportedMarkets, useUpdateMiniQuizGame, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSchool, useUpdateSubscriptionPlan, useUpdateUnregisteredVendor, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
|
package/dist/index.d.ts
CHANGED
|
@@ -2627,6 +2627,122 @@ declare function useAppSettingsForm(data?: AppSettingsFormData): CreateAppSettin
|
|
|
2627
2627
|
|
|
2628
2628
|
declare function useSchoolForm(data?: SchoolFormData): CreateSchoolFormData;
|
|
2629
2629
|
|
|
2630
|
+
type ShareEventDateTime = {
|
|
2631
|
+
startDate: string;
|
|
2632
|
+
endDate?: string | null;
|
|
2633
|
+
};
|
|
2634
|
+
/** Minimal event fields used by invitation share copy (GraphQL share queries). */
|
|
2635
|
+
type ShareEventForInvitation = {
|
|
2636
|
+
dateTime: ShareEventDateTime[];
|
|
2637
|
+
description: string | null;
|
|
2638
|
+
location: {
|
|
2639
|
+
fullAddress: string;
|
|
2640
|
+
};
|
|
2641
|
+
};
|
|
2642
|
+
type ShareVendorCategory = {
|
|
2643
|
+
name: string;
|
|
2644
|
+
subcategories: Array<{
|
|
2645
|
+
name: string;
|
|
2646
|
+
}>;
|
|
2647
|
+
};
|
|
2648
|
+
/** Minimal vendor fields used by application share copy (GraphQL share queries). */
|
|
2649
|
+
type ShareVendorForApplication = {
|
|
2650
|
+
categories: ShareVendorCategory[];
|
|
2651
|
+
description: string | null;
|
|
2652
|
+
};
|
|
2653
|
+
type ShareStallType = {
|
|
2654
|
+
label: string;
|
|
2655
|
+
price: number;
|
|
2656
|
+
stallCapacity: number;
|
|
2657
|
+
};
|
|
2658
|
+
/** Minimal event info fields for invitation share copy (GraphQL share queries). */
|
|
2659
|
+
type ShareEventInfoForInvitation = {
|
|
2660
|
+
applicationDeadlineHours: number;
|
|
2661
|
+
dateTime: Array<{
|
|
2662
|
+
stallTypes: ShareStallType[];
|
|
2663
|
+
}>;
|
|
2664
|
+
requirements?: Array<{
|
|
2665
|
+
label: string;
|
|
2666
|
+
value: boolean;
|
|
2667
|
+
}> | null;
|
|
2668
|
+
};
|
|
2669
|
+
/** Minimal vendor info fields for application share copy (GraphQL share queries). */
|
|
2670
|
+
type ShareVendorInfoForApplication = {
|
|
2671
|
+
compliance?: {
|
|
2672
|
+
liabilityInsurance: boolean;
|
|
2673
|
+
foodBeverageLicense: boolean;
|
|
2674
|
+
} | null;
|
|
2675
|
+
product: {
|
|
2676
|
+
priceRange: {
|
|
2677
|
+
min: string;
|
|
2678
|
+
max: string;
|
|
2679
|
+
};
|
|
2680
|
+
};
|
|
2681
|
+
stallInfo: {
|
|
2682
|
+
size: {
|
|
2683
|
+
width: string;
|
|
2684
|
+
depth: string;
|
|
2685
|
+
};
|
|
2686
|
+
};
|
|
2687
|
+
};
|
|
2688
|
+
|
|
2689
|
+
declare function buildInvitationShareDescription(event: ShareEventForInvitation, eventInfo: ShareEventInfoForInvitation | null | undefined): string;
|
|
2690
|
+
declare function buildApplicationShareDescription(vendor: ShareVendorForApplication, vendorInfo: ShareVendorInfoForApplication | null | undefined): string;
|
|
2691
|
+
|
|
2692
|
+
/** Path segments for relation share URLs — must match mobile `RelationTitle` values. */
|
|
2693
|
+
declare const RELATION_SHARE_INVITATION: "invitation";
|
|
2694
|
+
declare const RELATION_SHARE_APPLICATION: "application";
|
|
2695
|
+
declare const RELATION_SHARE_RESOURCE_TYPES: readonly ["invitation", "application"];
|
|
2696
|
+
type RelationShareResourceType = (typeof RELATION_SHARE_RESOURCE_TYPES)[number];
|
|
2697
|
+
declare function isRelationShareResourceType(resourceType: string): resourceType is RelationShareResourceType;
|
|
2698
|
+
|
|
2699
|
+
/** Path segments for public resource share URLs (markets, posts, etc.). */
|
|
2700
|
+
declare const PUBLIC_SHARE_PATH_TYPES: readonly ["market", "stallholder", "partner", "daily_meets", "daily_tips", "daily_games"];
|
|
2701
|
+
type PublicSharePathType = (typeof PUBLIC_SHARE_PATH_TYPES)[number];
|
|
2702
|
+
/** @deprecated Use {@link PUBLIC_SHARE_PATH_TYPES} — kept for mobile deep-link helpers. */
|
|
2703
|
+
declare const RESOURCE_SHARE_TYPES_FOR_URL: readonly ["market", "stallholder", "partner", "daily_meets", "daily_tips", "daily_games"];
|
|
2704
|
+
type RelationSharePathType = typeof RELATION_SHARE_INVITATION | typeof RELATION_SHARE_APPLICATION;
|
|
2705
|
+
type ShareType = PublicSharePathType | RelationSharePathType;
|
|
2706
|
+
/** Alternation for deep-link regexes — keep in sync with {@link ShareType}. */
|
|
2707
|
+
declare const SHARE_TYPE_PATH_REGEX: string;
|
|
2708
|
+
declare function buildShareUrl(type: ShareType, id: string): string;
|
|
2709
|
+
|
|
2710
|
+
declare const SHARE_SITE_URL = "https://cluemart.co.nz";
|
|
2711
|
+
declare const DEFAULT_SHARE_OG_IMAGE = "https://cluemart.co.nz/assets/logo.webp";
|
|
2712
|
+
declare const RESOURCE_SHARE_TYPES: readonly ["market", "stallholder", "partner"];
|
|
2713
|
+
type ResourceShareType = (typeof RESOURCE_SHARE_TYPES)[number];
|
|
2714
|
+
declare const POST_SHARE_RESOURCE_TYPES: readonly ["daily_meets", "daily_tips", "daily_games"];
|
|
2715
|
+
type PostShareResourceType = (typeof POST_SHARE_RESOURCE_TYPES)[number];
|
|
2716
|
+
type ShareResourceType = ResourceShareType | PostShareResourceType | RelationShareResourceType;
|
|
2717
|
+
declare const SHARE_RESOURCE_LABEL: Record<ShareResourceType, string>;
|
|
2718
|
+
declare function isPostShareResourceType(resourceType: ShareResourceType): resourceType is PostShareResourceType;
|
|
2719
|
+
|
|
2720
|
+
declare function formatCategoryLabel(category: ShareVendorCategory): string;
|
|
2721
|
+
|
|
2722
|
+
/** Visible separator for multi-block share text (OG, Facebook quote, crawlers collapse newlines). */
|
|
2723
|
+
declare const SHARE_DESCRIPTION_SECTION_SEPARATOR = " \u00B7 ";
|
|
2724
|
+
/** @deprecated Use {@link SHARE_DESCRIPTION_SECTION_SEPARATOR}. */
|
|
2725
|
+
declare const SHARE_COMPACT_SECTION_SEPARATOR = " \u00B7 ";
|
|
2726
|
+
declare function joinShareDescriptionSections(sections: ReadonlyArray<string | false | null | undefined>): string;
|
|
2727
|
+
|
|
2728
|
+
/**
|
|
2729
|
+
* Formats share descriptions for Open Graph / Twitter meta tags.
|
|
2730
|
+
* Legacy `\n\n` sections are joined with {@link SHARE_DESCRIPTION_SECTION_SEPARATOR}
|
|
2731
|
+
* because Facebook and others collapse line breaks into spaces.
|
|
2732
|
+
*/
|
|
2733
|
+
declare function normalizeShareOgDescription(value: string): string;
|
|
2734
|
+
/**
|
|
2735
|
+
* Formats multiline share copy for UIs that strip line breaks (Facebook SDK quote).
|
|
2736
|
+
*/
|
|
2737
|
+
declare function formatShareSectionsForCompactDisplay(value: string): string;
|
|
2738
|
+
/**
|
|
2739
|
+
* Quote text for Facebook ShareDialog — avoids `\n\n` which Meta renders as a single space.
|
|
2740
|
+
*/
|
|
2741
|
+
declare function buildFacebookShareQuote(title: string, description: string): string | undefined;
|
|
2742
|
+
|
|
2743
|
+
declare function normalizeShareRouteId(id: string): string;
|
|
2744
|
+
declare function buildSharePagePath(resourceType: ShareResourceType, rawId: string): string;
|
|
2745
|
+
|
|
2630
2746
|
declare const SAVED_PASSWORD_KEY = "savedPassword";
|
|
2631
2747
|
declare const SAVED_EMAIL_KEY = "savedEmail";
|
|
2632
2748
|
declare const SAVED_TOKEN_KEY = "savedToken";
|
|
@@ -2743,4 +2859,4 @@ declare const ANDROID_URL = "https://play.google.com/store/apps/details?id=com.t
|
|
|
2743
2859
|
declare const SCHOOL_MIN_STUDENT_COUNT = 300;
|
|
2744
2860
|
declare const SCHOOL_MAX_STUDENT_COUNT = 0;
|
|
2745
2861
|
|
|
2746
|
-
export { ANDROID_URL, type AdFormData, type AdResource, type AdType, type AdminUpdateResourceType, type AppSettingsFormData, type AppSettingsType, type AssociateType, type BadgeBasename, type BadgeId, type BaseGameMap, type BaseGameType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageReaction, type ChatMessageReplyPreview, type ChatMessageSeen, type ChatMessageType, type ChatType, type CluiImageBasename, type CluiImageId, type ContactUsFormData, type CreateAdFormData, type CreateAppSettingsFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreatePostFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateSchoolFormData, type CreateUnregisteredVendorFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DailyClueBaseGame, type DailyClueGameData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumBillingPeriod, EnumChatReportReason, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumGameStatus, EnumGameType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumPostContentType, EnumPostType, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, EnumVerificationType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventListItemType, type EventStatusType, type EventType, type FormDateField, type FormField, type GameDate, type GameDocType, type GameHistory, type GameLeaderboard, type GamePlacement, type GamePlacementClue, type GameType, type GeocodeLocation, type GlobalGameData, type GoogleAddressComponent, type GoogleImportedMarket, IMAGE_EXTENSION, IOS_URL, type IconBasename, type IconId, type ImageObjectType, ImageTypeEnum, type LocationGeoType, type LocationType, type LoginFormData, type LogoBasename, type LogoId, type MarketingMaterialRequestInputType, type MiniQuizAnswer, type MiniQuizAnsweredQuestion, type MiniQuizBaseGame, type MiniQuizGameData, type MiniQuizQuestion, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, type OtherImagesBasename, type OtherImagesId, type OwnerType, PROMO_CODE_PREFIX, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PostContentData, type PostContentFormData, type PostContentGame, type PostContentImage, type PostContentList, type PostContentTextarea, type PostContentType, type PostContentVideo, type PostFileInput, type PostFormData, type PostType, type PosterAssetId, type PosterImageBasename, type PosterInputType, type PosterUsageType, type PromoCodeType, type RefundPolicy, type Region, type RegisterFormData, type RelationDate, type RelationType, type ReportChatUser, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceByUser, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceDetails, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, SCHOOL_MAX_STUDENT_COUNT, SCHOOL_MIN_STUDENT_COUNT, type SchoolCampaignType, type SchoolFormData, type SchoolRegisteredUserType, type SchoolReturnType, type SchoolType, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionPlanData, type SubscriptionPlansResponse, type SubscriptionPricingData, type SubscriptionStatusData, type TermsAgreement, USER_STORAGE_KEY, type UnregisteredVendorFormData, type UnregisteredVendorInvitationType, type UnregisteredVendorType, type UseGetEventsByRegionOptions, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorCalendarData, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorProductList, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, badgeFiles, badgeIds, badges, capitalizeFirstLetter, categoryColors, cluemartSocialMedia, cluiFiles, cluiIds, cluiImages, companyContactFields, computeDailyClueState, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultLocation, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, gameScreenIdentifierList, gameTypeToDisplayName, getCurrentAndFutureDates, globalDefaultValues, iconFiles, iconIds, icons, isFutureDatesBeforeThreshold, isIsoDateString, licenseNiceNames, lightColors, loginFields, logoFiles, logoIds, logos, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, nzStartOfDay, otherImages, otherImagesFiles, otherImagesIds, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, posterFiles, posterIds, posters, priceUnits, producedIngOptions, productLabelGroups, profileFields, refundPolicyOptions, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, seededShuffle, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminPermanentlyDeleteResource, useAdminResendUserVerificationEmail, useAdminUpdateResourceType, useAppSettingsForm, useCancelSubscription, useContactUs, useContactUsForm, useCrawlGoogleMarkets, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateCustomerPortal, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePost, useCreatePoster, useCreatePrivateChat, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateSchool, useCreateUnregisteredVendor, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeletePost, useDeleteRelation, useDeleteSchool, useDeleteUnregisteredVendor, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetAppSettings, useGetChat, useGetChatSubscription, useGetChatsByRegion, useGetEvent, useGetEventByPlaceId, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetGame, useGetGameLeaderboard, useGetGames, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetPost, useGetPosts, useGetPostsByType, useGetRelation, useGetRelationByEventAndVendor, useGetReportedChatUsers, useGetResourceActivity, useGetResourceConnections, useGetSchool, useGetSchools, useGetSubscriptionPlans, useGetSubscriptionStatus, useGetUnregisteredVendor, useGetUnregisteredVendors, useGetUnregisteredVendorsByInviterId, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserPartners, useGetUserResources, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLeaveGame, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkChatMessagesSeen, useMarkNotificationRead, usePartnerForm, usePostForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useReportChatUser, useRequestMarketingMaterial, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSchoolForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSelectStandardPackage, useSendChatMessage, useStartGame, useToggleChatMessageLike, useUnlinkUnregisteredVendorByInviterId, useUnregisteredVendorForm, useUpdateAd, useUpdateAppSettings, useUpdateDailyClueGame, useUpdateEvent, useUpdateEventInfo, useUpdateGoogleImportedMarkets, useUpdateMiniQuizGame, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSchool, useUpdateSubscriptionPlan, useUpdateUnregisteredVendor, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
|
|
2862
|
+
export { ANDROID_URL, type AdFormData, type AdResource, type AdType, type AdminUpdateResourceType, type AppSettingsFormData, type AppSettingsType, type AssociateType, type BadgeBasename, type BadgeId, type BaseGameMap, type BaseGameType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageReaction, type ChatMessageReplyPreview, type ChatMessageSeen, type ChatMessageType, type ChatType, type CluiImageBasename, type CluiImageId, type ContactUsFormData, type CreateAdFormData, type CreateAppSettingsFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreatePostFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateSchoolFormData, type CreateUnregisteredVendorFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, DEFAULT_SHARE_OG_IMAGE, type DailyClueBaseGame, type DailyClueGameData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumBillingPeriod, EnumChatReportReason, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumGameStatus, EnumGameType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumPostContentType, EnumPostType, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, EnumVerificationType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventListItemType, type EventStatusType, type EventType, type FormDateField, type FormField, type GameDate, type GameDocType, type GameHistory, type GameLeaderboard, type GamePlacement, type GamePlacementClue, type GameType, type GeocodeLocation, type GlobalGameData, type GoogleAddressComponent, type GoogleImportedMarket, IMAGE_EXTENSION, IOS_URL, type IconBasename, type IconId, type ImageObjectType, ImageTypeEnum, type LocationGeoType, type LocationType, type LoginFormData, type LogoBasename, type LogoId, type MarketingMaterialRequestInputType, type MiniQuizAnswer, type MiniQuizAnsweredQuestion, type MiniQuizBaseGame, type MiniQuizGameData, type MiniQuizQuestion, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, type OtherImagesBasename, type OtherImagesId, type OwnerType, POST_SHARE_RESOURCE_TYPES, PROMO_CODE_PREFIX, PUBLIC_SHARE_PATH_TYPES, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PostContentData, type PostContentFormData, type PostContentGame, type PostContentImage, type PostContentList, type PostContentTextarea, type PostContentType, type PostContentVideo, type PostFileInput, type PostFormData, type PostShareResourceType, type PostType, type PosterAssetId, type PosterImageBasename, type PosterInputType, type PosterUsageType, type PromoCodeType, type PublicSharePathType, RELATION_SHARE_APPLICATION, RELATION_SHARE_INVITATION, RELATION_SHARE_RESOURCE_TYPES, RESOURCE_SHARE_TYPES, RESOURCE_SHARE_TYPES_FOR_URL, type RefundPolicy, type Region, type RegisterFormData, type RelationDate, type RelationSharePathType, type RelationShareResourceType, type RelationType, type ReportChatUser, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceByUser, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceDetails, type ResourceImageType, type ResourceShareType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, SCHOOL_MAX_STUDENT_COUNT, SCHOOL_MIN_STUDENT_COUNT, SHARE_COMPACT_SECTION_SEPARATOR, SHARE_DESCRIPTION_SECTION_SEPARATOR, SHARE_RESOURCE_LABEL, SHARE_SITE_URL, SHARE_TYPE_PATH_REGEX, type SchoolCampaignType, type SchoolFormData, type SchoolRegisteredUserType, type SchoolReturnType, type SchoolType, type ShareEventDateTime, type ShareEventForInvitation, type ShareEventInfoForInvitation, type ShareResourceType, type ShareStallType, type ShareType, type ShareVendorCategory, type ShareVendorForApplication, type ShareVendorInfoForApplication, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionPlanData, type SubscriptionPlansResponse, type SubscriptionPricingData, type SubscriptionStatusData, type TermsAgreement, USER_STORAGE_KEY, type UnregisteredVendorFormData, type UnregisteredVendorInvitationType, type UnregisteredVendorType, type UseGetEventsByRegionOptions, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorCalendarData, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorProductList, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, badgeFiles, badgeIds, badges, buildApplicationShareDescription, buildFacebookShareQuote, buildInvitationShareDescription, buildSharePagePath, buildShareUrl, capitalizeFirstLetter, categoryColors, cluemartSocialMedia, cluiFiles, cluiIds, cluiImages, companyContactFields, computeDailyClueState, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultLocation, defaultPartnerFormValues, defaultUnregisteredVendorFormValues, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatCategoryLabel, formatDate, formatShareSectionsForCompactDisplay, formatTimestamp, gameScreenIdentifierList, gameTypeToDisplayName, getCurrentAndFutureDates, globalDefaultValues, iconFiles, iconIds, icons, isFutureDatesBeforeThreshold, isIsoDateString, isPostShareResourceType, isRelationShareResourceType, joinShareDescriptionSections, licenseNiceNames, lightColors, loginFields, logoFiles, logoIds, logos, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeShareOgDescription, normalizeShareRouteId, normalizeUrl, nzStartOfDay, otherImages, otherImagesFiles, otherImagesIds, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, posterFiles, posterIds, posters, priceUnits, producedIngOptions, productLabelGroups, profileFields, refundPolicyOptions, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, seededShuffle, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminPermanentlyDeleteResource, useAdminResendUserVerificationEmail, useAdminUpdateResourceType, useAppSettingsForm, useCancelSubscription, useContactUs, useContactUsForm, useCrawlGoogleMarkets, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateCustomerPortal, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePost, useCreatePoster, useCreatePrivateChat, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateSchool, useCreateUnregisteredVendor, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeletePost, useDeleteRelation, useDeleteSchool, useDeleteUnregisteredVendor, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, useGetAd, useGetAds, useGetAdsByRegion, useGetAppSettings, useGetChat, useGetChatSubscription, useGetChatsByRegion, useGetEvent, useGetEventByPlaceId, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetGame, useGetGameLeaderboard, useGetGames, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetPost, useGetPosts, useGetPostsByType, useGetRelation, useGetRelationByEventAndVendor, useGetReportedChatUsers, useGetResourceActivity, useGetResourceConnections, useGetSchool, useGetSchools, useGetSubscriptionPlans, useGetSubscriptionStatus, useGetUnregisteredVendor, useGetUnregisteredVendors, useGetUnregisteredVendorsByInviterId, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserPartners, useGetUserResources, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLeaveGame, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkChatMessagesSeen, useMarkNotificationRead, usePartnerForm, usePostForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useReportChatUser, useRequestMarketingMaterial, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSchoolForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSelectStandardPackage, useSendChatMessage, useStartGame, useToggleChatMessageLike, useUnlinkUnregisteredVendorByInviterId, useUnregisteredVendorForm, useUpdateAd, useUpdateAppSettings, useUpdateDailyClueGame, useUpdateEvent, useUpdateEventInfo, useUpdateGoogleImportedMarkets, useUpdateMiniQuizGame, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSchool, useUpdateSubscriptionPlan, useUpdateUnregisteredVendor, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
|
package/dist/index.mjs
CHANGED
|
@@ -8470,6 +8470,182 @@ var otherImages = Object.fromEntries(
|
|
|
8470
8470
|
Object.entries(otherImagesFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
|
|
8471
8471
|
);
|
|
8472
8472
|
|
|
8473
|
+
// src/sharing/formatCategoryLabel.ts
|
|
8474
|
+
function formatCategoryLabel(category) {
|
|
8475
|
+
const subcategoryNames = category.subcategories.map((subcategory) => subcategory.name).filter(Boolean);
|
|
8476
|
+
if (subcategoryNames.length === 0) {
|
|
8477
|
+
return category.name;
|
|
8478
|
+
}
|
|
8479
|
+
return `${category.name} (${subcategoryNames.join(", ")})`;
|
|
8480
|
+
}
|
|
8481
|
+
|
|
8482
|
+
// src/sharing/joinShareDescriptionSections.ts
|
|
8483
|
+
var SHARE_DESCRIPTION_SECTION_SEPARATOR = " \xB7 ";
|
|
8484
|
+
var SHARE_COMPACT_SECTION_SEPARATOR = SHARE_DESCRIPTION_SECTION_SEPARATOR;
|
|
8485
|
+
function joinShareDescriptionSections(sections) {
|
|
8486
|
+
return sections.filter((section) => Boolean(section)).join(SHARE_DESCRIPTION_SECTION_SEPARATOR);
|
|
8487
|
+
}
|
|
8488
|
+
|
|
8489
|
+
// src/sharing/buildRelationShareDescription.ts
|
|
8490
|
+
function formatShareDate(isoDate) {
|
|
8491
|
+
try {
|
|
8492
|
+
return new Intl.DateTimeFormat("en-NZ", {
|
|
8493
|
+
day: "numeric",
|
|
8494
|
+
month: "short",
|
|
8495
|
+
year: "numeric"
|
|
8496
|
+
}).format(new Date(isoDate));
|
|
8497
|
+
} catch {
|
|
8498
|
+
return isoDate;
|
|
8499
|
+
}
|
|
8500
|
+
}
|
|
8501
|
+
function buildInvitationShareDescription(event, eventInfo2) {
|
|
8502
|
+
const stallTypes2 = eventInfo2?.dateTime?.flatMap((date3) => date3.stallTypes) ?? [];
|
|
8503
|
+
if (!eventInfo2 || stallTypes2.length === 0) {
|
|
8504
|
+
return event.description?.trim() || "";
|
|
8505
|
+
}
|
|
8506
|
+
const requirementLabels = (eventInfo2.requirements ?? []).filter((item) => item.value).map((item) => item.label);
|
|
8507
|
+
const sections = [
|
|
8508
|
+
event.location.fullAddress,
|
|
8509
|
+
...event.dateTime.map((date3) => {
|
|
8510
|
+
const start = formatShareDate(date3.startDate);
|
|
8511
|
+
const end = date3.endDate ? ` \u2013 ${formatShareDate(date3.endDate)}` : "";
|
|
8512
|
+
return `Market date: ${start}${end}`;
|
|
8513
|
+
}),
|
|
8514
|
+
`Application deadline: vendors must apply at least ${eventInfo2.applicationDeadlineHours} hours before each market date.`,
|
|
8515
|
+
...stallTypes2.map(
|
|
8516
|
+
(stall) => `Stall: ${stall.label} \u2014 $${stall.price} (${stall.stallCapacity} spaces)`
|
|
8517
|
+
),
|
|
8518
|
+
requirementLabels.length > 0 && `Requirements: ${requirementLabels.join(", ")}`
|
|
8519
|
+
];
|
|
8520
|
+
return joinShareDescriptionSections(sections);
|
|
8521
|
+
}
|
|
8522
|
+
function buildApplicationShareDescription(vendor, vendorInfo) {
|
|
8523
|
+
const categoryLabels = vendor.categories.map(
|
|
8524
|
+
(category) => formatCategoryLabel(category)
|
|
8525
|
+
);
|
|
8526
|
+
if (!vendorInfo) {
|
|
8527
|
+
return vendor.description?.trim() || "";
|
|
8528
|
+
}
|
|
8529
|
+
const compliance = vendorInfo.compliance;
|
|
8530
|
+
const complianceLabels = [
|
|
8531
|
+
compliance?.liabilityInsurance && "Liability insurance",
|
|
8532
|
+
compliance?.foodBeverageLicense && "Food & beverage licence"
|
|
8533
|
+
].filter(Boolean);
|
|
8534
|
+
const profileDescription = vendor.description?.trim();
|
|
8535
|
+
const sections = [
|
|
8536
|
+
categoryLabels.length > 0 && `Categories: ${categoryLabels.join(", ")}`,
|
|
8537
|
+
`Stall size: ${vendorInfo.stallInfo.size.width}m \xD7 ${vendorInfo.stallInfo.size.depth}m`,
|
|
8538
|
+
`Compliance: ${complianceLabels.length > 0 ? complianceLabels.join(", ") : "Not specified"}`,
|
|
8539
|
+
`Price range: $${vendorInfo.product.priceRange.min} \u2013 $${vendorInfo.product.priceRange.max}`,
|
|
8540
|
+
profileDescription
|
|
8541
|
+
];
|
|
8542
|
+
return joinShareDescriptionSections(sections);
|
|
8543
|
+
}
|
|
8544
|
+
|
|
8545
|
+
// src/sharing/relationShareTypes.ts
|
|
8546
|
+
var RELATION_SHARE_INVITATION = "invitation";
|
|
8547
|
+
var RELATION_SHARE_APPLICATION = "application";
|
|
8548
|
+
var RELATION_SHARE_RESOURCE_TYPES = [
|
|
8549
|
+
RELATION_SHARE_INVITATION,
|
|
8550
|
+
RELATION_SHARE_APPLICATION
|
|
8551
|
+
];
|
|
8552
|
+
function isRelationShareResourceType(resourceType) {
|
|
8553
|
+
return RELATION_SHARE_RESOURCE_TYPES.includes(
|
|
8554
|
+
resourceType
|
|
8555
|
+
);
|
|
8556
|
+
}
|
|
8557
|
+
|
|
8558
|
+
// src/sharing/constants.ts
|
|
8559
|
+
var SHARE_SITE_URL = "https://cluemart.co.nz";
|
|
8560
|
+
var DEFAULT_SHARE_OG_IMAGE = `${SHARE_SITE_URL}/assets/logo.webp`;
|
|
8561
|
+
var RESOURCE_SHARE_TYPES = [
|
|
8562
|
+
"market",
|
|
8563
|
+
"stallholder",
|
|
8564
|
+
"partner"
|
|
8565
|
+
];
|
|
8566
|
+
var POST_SHARE_RESOURCE_TYPES = [
|
|
8567
|
+
"daily_meets",
|
|
8568
|
+
"daily_tips",
|
|
8569
|
+
"daily_games"
|
|
8570
|
+
];
|
|
8571
|
+
var SHARE_RESOURCE_LABEL = {
|
|
8572
|
+
[RELATION_SHARE_APPLICATION]: "Application",
|
|
8573
|
+
[RELATION_SHARE_INVITATION]: "Invitation",
|
|
8574
|
+
daily_games: "Daily Game",
|
|
8575
|
+
daily_meets: "Daily Meet",
|
|
8576
|
+
daily_tips: "Daily Tip",
|
|
8577
|
+
market: "Market",
|
|
8578
|
+
partner: "Partner",
|
|
8579
|
+
stallholder: "Stallholder"
|
|
8580
|
+
};
|
|
8581
|
+
function isPostShareResourceType(resourceType) {
|
|
8582
|
+
return POST_SHARE_RESOURCE_TYPES.includes(
|
|
8583
|
+
resourceType
|
|
8584
|
+
);
|
|
8585
|
+
}
|
|
8586
|
+
|
|
8587
|
+
// src/sharing/buildShareUrl.ts
|
|
8588
|
+
var PUBLIC_SHARE_PATH_TYPES = [
|
|
8589
|
+
...RESOURCE_SHARE_TYPES,
|
|
8590
|
+
...POST_SHARE_RESOURCE_TYPES
|
|
8591
|
+
];
|
|
8592
|
+
var RESOURCE_SHARE_TYPES_FOR_URL = PUBLIC_SHARE_PATH_TYPES;
|
|
8593
|
+
var SHARE_TYPE_PATH_REGEX = [
|
|
8594
|
+
...PUBLIC_SHARE_PATH_TYPES,
|
|
8595
|
+
RELATION_SHARE_APPLICATION,
|
|
8596
|
+
RELATION_SHARE_INVITATION
|
|
8597
|
+
].join("|");
|
|
8598
|
+
function buildShareUrl(type, id) {
|
|
8599
|
+
return `${SHARE_SITE_URL}/share/${type}/${encodeURIComponent(id)}`;
|
|
8600
|
+
}
|
|
8601
|
+
|
|
8602
|
+
// src/sharing/normalizeShareDescription.ts
|
|
8603
|
+
function normalizeShareSection(value) {
|
|
8604
|
+
if (value == null) {
|
|
8605
|
+
return "";
|
|
8606
|
+
}
|
|
8607
|
+
return value.trim().split("\n").map((line) => line.trim().replace(/[ \t]+/g, " ")).join("\n").replace(/\n{3,}/g, "\n\n");
|
|
8608
|
+
}
|
|
8609
|
+
function normalizeShareOgDescription(value) {
|
|
8610
|
+
const trimmed = value.trim();
|
|
8611
|
+
if (!trimmed) {
|
|
8612
|
+
return "";
|
|
8613
|
+
}
|
|
8614
|
+
if (/\n\n/.test(trimmed)) {
|
|
8615
|
+
return trimmed.split(/\n\n+/).map((section) => section.replace(/\s+/g, " ").trim()).filter(Boolean).join(SHARE_DESCRIPTION_SECTION_SEPARATOR);
|
|
8616
|
+
}
|
|
8617
|
+
return trimmed.replace(/\s+/g, " ").trim();
|
|
8618
|
+
}
|
|
8619
|
+
function formatShareSectionsForCompactDisplay(value) {
|
|
8620
|
+
const trimmed = value.trim();
|
|
8621
|
+
if (!trimmed) {
|
|
8622
|
+
return "";
|
|
8623
|
+
}
|
|
8624
|
+
if (!/\n\n/.test(trimmed)) {
|
|
8625
|
+
return normalizeShareSection(trimmed);
|
|
8626
|
+
}
|
|
8627
|
+
return trimmed.split(/\n\n+/).map((section) => normalizeShareSection(section)).filter((section) => section.length > 0).join(SHARE_DESCRIPTION_SECTION_SEPARATOR);
|
|
8628
|
+
}
|
|
8629
|
+
function buildFacebookShareQuote(title, description) {
|
|
8630
|
+
const titlePart = normalizeShareSection(title);
|
|
8631
|
+
const descriptionPart = normalizeShareSection(description);
|
|
8632
|
+
const bodyPart = descriptionPart ? formatShareSectionsForCompactDisplay(descriptionPart) : "";
|
|
8633
|
+
const parts = [titlePart, bodyPart].filter((part) => part.length > 0);
|
|
8634
|
+
return parts.length > 0 ? parts.join(SHARE_DESCRIPTION_SECTION_SEPARATOR) : void 0;
|
|
8635
|
+
}
|
|
8636
|
+
|
|
8637
|
+
// src/sharing/normalizeShareRouteId.ts
|
|
8638
|
+
function normalizeShareRouteId(id) {
|
|
8639
|
+
try {
|
|
8640
|
+
return decodeURIComponent(id);
|
|
8641
|
+
} catch {
|
|
8642
|
+
return id;
|
|
8643
|
+
}
|
|
8644
|
+
}
|
|
8645
|
+
function buildSharePagePath(resourceType, rawId) {
|
|
8646
|
+
return `/share/${resourceType}/${encodeURIComponent(normalizeShareRouteId(rawId))}`;
|
|
8647
|
+
}
|
|
8648
|
+
|
|
8473
8649
|
// src/storage/index.ts
|
|
8474
8650
|
var SAVED_PASSWORD_KEY = "savedPassword";
|
|
8475
8651
|
var SAVED_EMAIL_KEY = "savedEmail";
|
|
@@ -8560,6 +8736,7 @@ var gameTypeToDisplayName = {
|
|
|
8560
8736
|
};
|
|
8561
8737
|
export {
|
|
8562
8738
|
ANDROID_URL,
|
|
8739
|
+
DEFAULT_SHARE_OG_IMAGE,
|
|
8563
8740
|
EnumActivity,
|
|
8564
8741
|
EnumAdShowOn,
|
|
8565
8742
|
EnumAdStatus,
|
|
@@ -8594,13 +8771,25 @@ export {
|
|
|
8594
8771
|
IMAGE_EXTENSION,
|
|
8595
8772
|
IOS_URL,
|
|
8596
8773
|
ImageTypeEnum,
|
|
8774
|
+
POST_SHARE_RESOURCE_TYPES,
|
|
8597
8775
|
PROMO_CODE_PREFIX,
|
|
8776
|
+
PUBLIC_SHARE_PATH_TYPES,
|
|
8777
|
+
RELATION_SHARE_APPLICATION,
|
|
8778
|
+
RELATION_SHARE_INVITATION,
|
|
8779
|
+
RELATION_SHARE_RESOURCE_TYPES,
|
|
8780
|
+
RESOURCE_SHARE_TYPES,
|
|
8781
|
+
RESOURCE_SHARE_TYPES_FOR_URL,
|
|
8598
8782
|
SAVED_EMAIL_KEY,
|
|
8599
8783
|
SAVED_PASSWORD_KEY,
|
|
8600
8784
|
SAVED_REFRESH_TOKEN_KEY,
|
|
8601
8785
|
SAVED_TOKEN_KEY,
|
|
8602
8786
|
SCHOOL_MAX_STUDENT_COUNT,
|
|
8603
8787
|
SCHOOL_MIN_STUDENT_COUNT,
|
|
8788
|
+
SHARE_COMPACT_SECTION_SEPARATOR,
|
|
8789
|
+
SHARE_DESCRIPTION_SECTION_SEPARATOR,
|
|
8790
|
+
SHARE_RESOURCE_LABEL,
|
|
8791
|
+
SHARE_SITE_URL,
|
|
8792
|
+
SHARE_TYPE_PATH_REGEX,
|
|
8604
8793
|
USER_STORAGE_KEY,
|
|
8605
8794
|
availableCategories,
|
|
8606
8795
|
availableRegionOptions,
|
|
@@ -8609,6 +8798,11 @@ export {
|
|
|
8609
8798
|
badgeFiles,
|
|
8610
8799
|
badgeIds,
|
|
8611
8800
|
badges,
|
|
8801
|
+
buildApplicationShareDescription,
|
|
8802
|
+
buildFacebookShareQuote,
|
|
8803
|
+
buildInvitationShareDescription,
|
|
8804
|
+
buildSharePagePath,
|
|
8805
|
+
buildShareUrl,
|
|
8612
8806
|
capitalizeFirstLetter,
|
|
8613
8807
|
categoryColors,
|
|
8614
8808
|
cluemartSocialMedia,
|
|
@@ -8635,7 +8829,9 @@ export {
|
|
|
8635
8829
|
eventStartDateFields,
|
|
8636
8830
|
fonts,
|
|
8637
8831
|
foodFlavourOptions,
|
|
8832
|
+
formatCategoryLabel,
|
|
8638
8833
|
formatDate,
|
|
8834
|
+
formatShareSectionsForCompactDisplay,
|
|
8639
8835
|
formatTimestamp,
|
|
8640
8836
|
gameScreenIdentifierList,
|
|
8641
8837
|
gameTypeToDisplayName,
|
|
@@ -8646,6 +8842,9 @@ export {
|
|
|
8646
8842
|
icons,
|
|
8647
8843
|
isFutureDatesBeforeThreshold,
|
|
8648
8844
|
isIsoDateString,
|
|
8845
|
+
isPostShareResourceType,
|
|
8846
|
+
isRelationShareResourceType,
|
|
8847
|
+
joinShareDescriptionSections,
|
|
8649
8848
|
licenseNiceNames,
|
|
8650
8849
|
lightColors,
|
|
8651
8850
|
loginFields,
|
|
@@ -8654,6 +8853,8 @@ export {
|
|
|
8654
8853
|
logos,
|
|
8655
8854
|
mapArrayToOptions,
|
|
8656
8855
|
mapBaseResourceTypeToFormData,
|
|
8856
|
+
normalizeShareOgDescription,
|
|
8857
|
+
normalizeShareRouteId,
|
|
8657
8858
|
normalizeUrl,
|
|
8658
8859
|
nzStartOfDay,
|
|
8659
8860
|
otherImages,
|