@timardex/cluemart-shared 1.5.603 → 1.5.607
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-XSJXK4NT.mjs → chunk-EPWJ2WJR.mjs} +26 -37
- package/dist/chunk-EPWJ2WJR.mjs.map +1 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.cjs +28 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.mjs +25 -36
- package/dist/index.mjs.map +1 -1
- package/dist/sharing/index.cjs +28 -40
- package/dist/sharing/index.cjs.map +1 -1
- package/dist/sharing/index.d.mts +17 -17
- package/dist/sharing/index.d.ts +17 -17
- package/dist/sharing/index.mjs +7 -9
- package/package.json +1 -1
- package/dist/chunk-XSJXK4NT.mjs.map +0 -1
package/dist/hooks/index.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -74,7 +74,6 @@ __export(index_exports, {
|
|
|
74
74
|
RELATION_SHARE_INVITATION: () => RELATION_SHARE_INVITATION,
|
|
75
75
|
RELATION_SHARE_RESOURCE_TYPES: () => RELATION_SHARE_RESOURCE_TYPES,
|
|
76
76
|
RESOURCE_SHARE_TYPES: () => RESOURCE_SHARE_TYPES,
|
|
77
|
-
RESOURCE_SHARE_TYPES_FOR_URL: () => RESOURCE_SHARE_TYPES_FOR_URL,
|
|
78
77
|
SAVED_EMAIL_KEY: () => SAVED_EMAIL_KEY,
|
|
79
78
|
SAVED_PASSWORD_KEY: () => SAVED_PASSWORD_KEY,
|
|
80
79
|
SAVED_REFRESH_TOKEN_KEY: () => SAVED_REFRESH_TOKEN_KEY,
|
|
@@ -86,7 +85,6 @@ __export(index_exports, {
|
|
|
86
85
|
SHARE_CATEGORY_ICON: () => SHARE_CATEGORY_ICON,
|
|
87
86
|
SHARE_CHECKMARK_ICON: () => SHARE_CHECKMARK_ICON,
|
|
88
87
|
SHARE_DESCRIPTION_SECTION_BREAK: () => SHARE_DESCRIPTION_SECTION_BREAK,
|
|
89
|
-
SHARE_DESCRIPTION_SECTION_SEPARATOR: () => SHARE_DESCRIPTION_SECTION_SEPARATOR,
|
|
90
88
|
SHARE_MARKET_DATES_SECTION_HEADING: () => SHARE_MARKET_DATES_SECTION_HEADING,
|
|
91
89
|
SHARE_MORE_INFO_LINE: () => SHARE_MORE_INFO_LINE,
|
|
92
90
|
SHARE_REQUIREMENTS_SECTION_HEADING: () => SHARE_REQUIREMENTS_SECTION_HEADING,
|
|
@@ -105,6 +103,7 @@ __export(index_exports, {
|
|
|
105
103
|
buildApplicationShareDescription: () => buildApplicationShareDescription,
|
|
106
104
|
buildFacebookShareQuote: () => buildFacebookShareQuote,
|
|
107
105
|
buildInvitationShareDescription: () => buildInvitationShareDescription,
|
|
106
|
+
buildShareMessageSections: () => buildShareMessageSections,
|
|
108
107
|
buildShareOgDescription: () => buildShareOgDescription,
|
|
109
108
|
buildShareOgDescriptionFromSections: () => buildShareOgDescriptionFromSections,
|
|
110
109
|
buildSharePagePath: () => buildSharePagePath,
|
|
@@ -141,8 +140,6 @@ __export(index_exports, {
|
|
|
141
140
|
formatShareInvitationMarketDatesSection: () => formatShareInvitationMarketDatesSection,
|
|
142
141
|
formatShareInvitationRequirementsSection: () => formatShareInvitationRequirementsSection,
|
|
143
142
|
formatShareMarketDate: () => formatShareMarketDate,
|
|
144
|
-
formatShareSectionsForCompactDisplay: () => formatShareSectionsForCompactDisplay,
|
|
145
|
-
formatShareSectionsForMultilineDisplay: () => formatShareSectionsForMultilineDisplay,
|
|
146
143
|
formatStallCapacityLabel: () => formatStallCapacityLabel,
|
|
147
144
|
formatTimestamp: () => formatTimestamp,
|
|
148
145
|
gameScreenIdentifierList: () => gameScreenIdentifierList,
|
|
@@ -168,6 +165,7 @@ __export(index_exports, {
|
|
|
168
165
|
mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
|
|
169
166
|
normalizeShareOgDescription: () => normalizeShareOgDescription,
|
|
170
167
|
normalizeShareRouteId: () => normalizeShareRouteId,
|
|
168
|
+
normalizeShareText: () => normalizeShareText,
|
|
171
169
|
normalizeUrl: () => normalizeUrl,
|
|
172
170
|
nzStartOfDay: () => nzStartOfDay,
|
|
173
171
|
otherImages: () => otherImages,
|
|
@@ -190,6 +188,7 @@ __export(index_exports, {
|
|
|
190
188
|
requirementsOptions: () => requirementsOptions,
|
|
191
189
|
resetPasswordFields: () => resetPasswordFields,
|
|
192
190
|
seededShuffle: () => seededShuffle,
|
|
191
|
+
shareMessageFooterPlacementForType: () => shareMessageFooterPlacementForType,
|
|
193
192
|
socialMediaFields: () => socialMediaFields,
|
|
194
193
|
sortDatesChronologically: () => sortDatesChronologically,
|
|
195
194
|
splitShareDescriptionSections: () => splitShareDescriptionSections,
|
|
@@ -8904,7 +8903,6 @@ function formatCategoryLabel(category) {
|
|
|
8904
8903
|
}
|
|
8905
8904
|
|
|
8906
8905
|
// src/sharing/joinShareDescriptionSections.ts
|
|
8907
|
-
var SHARE_DESCRIPTION_SECTION_SEPARATOR = " \xB7 ";
|
|
8908
8906
|
var SHARE_DESCRIPTION_SECTION_BREAK = "\n\n";
|
|
8909
8907
|
var OG_DESCRIPTION_LINE_BREAK = " ";
|
|
8910
8908
|
function joinShareOgDescriptionSections(sections) {
|
|
@@ -8995,7 +8993,6 @@ var PUBLIC_SHARE_PATH_TYPES = [
|
|
|
8995
8993
|
...RESOURCE_SHARE_TYPES,
|
|
8996
8994
|
...POST_SHARE_RESOURCE_TYPES
|
|
8997
8995
|
];
|
|
8998
|
-
var RESOURCE_SHARE_TYPES_FOR_URL = PUBLIC_SHARE_PATH_TYPES;
|
|
8999
8996
|
var SHARE_TYPE_PATH_REGEX = [
|
|
9000
8997
|
...PUBLIC_SHARE_PATH_TYPES,
|
|
9001
8998
|
RELATION_SHARE_APPLICATION,
|
|
@@ -9006,8 +9003,7 @@ function buildShareUrl(type, id) {
|
|
|
9006
9003
|
}
|
|
9007
9004
|
|
|
9008
9005
|
// src/sharing/normalizeShareDescription.ts
|
|
9009
|
-
|
|
9010
|
-
function normalizeShareSection(value) {
|
|
9006
|
+
function normalizeShareText(value) {
|
|
9011
9007
|
if (value == null) {
|
|
9012
9008
|
return "";
|
|
9013
9009
|
}
|
|
@@ -9020,47 +9016,40 @@ function normalizeShareSection(value) {
|
|
|
9020
9016
|
return leading + rest.trim().replace(/[ \t]{2,}/g, " ");
|
|
9021
9017
|
}).join("\n").replace(/\n{3,}/g, "\n\n");
|
|
9022
9018
|
}
|
|
9023
|
-
function
|
|
9024
|
-
return
|
|
9019
|
+
function shareMessageFooterPlacementForType(shareType) {
|
|
9020
|
+
return isPostShareResourceType(shareType) ? "after-body" : "before-body";
|
|
9021
|
+
}
|
|
9022
|
+
function buildShareMessageSections(input) {
|
|
9023
|
+
const title = normalizeShareText(input.title);
|
|
9024
|
+
const description = normalizeShareText(input.description);
|
|
9025
|
+
const placement = input.shareType ? shareMessageFooterPlacementForType(input.shareType) : "before-body";
|
|
9026
|
+
if (placement === "after-body") {
|
|
9027
|
+
return [title, description, SHARE_MORE_INFO_LINE].filter(
|
|
9028
|
+
(section) => section.length > 0
|
|
9029
|
+
);
|
|
9030
|
+
}
|
|
9031
|
+
return [title, SHARE_MORE_INFO_LINE, description].filter(
|
|
9032
|
+
(section) => section.length > 0
|
|
9033
|
+
);
|
|
9025
9034
|
}
|
|
9026
9035
|
function splitShareDescriptionSections(value) {
|
|
9027
|
-
const trimmed = value
|
|
9036
|
+
const trimmed = normalizeShareText(value);
|
|
9028
9037
|
if (!trimmed) {
|
|
9029
9038
|
return [];
|
|
9030
9039
|
}
|
|
9031
|
-
if (trimmed.includes(SHARE_DESCRIPTION_SECTION_SEPARATOR)) {
|
|
9032
|
-
return trimmed.split(SHARE_DESCRIPTION_SECTION_SEPARATOR).map((section) => stripLegacyBulletPrefix(normalizeShareSection(section))).filter((section) => section.length > 0);
|
|
9033
|
-
}
|
|
9034
9040
|
if (/\n\n/.test(trimmed)) {
|
|
9035
|
-
return trimmed.split(/\n\n+/).map((section) =>
|
|
9041
|
+
return trimmed.split(/\n\n+/).map((section) => normalizeShareText(section)).filter((section) => section.length > 0);
|
|
9036
9042
|
}
|
|
9037
9043
|
if (/\n/.test(trimmed)) {
|
|
9038
|
-
return trimmed.split(/\n+/).map((section) =>
|
|
9044
|
+
return trimmed.split(/\n+/).map((section) => normalizeShareText(section)).filter((section) => section.length > 0);
|
|
9039
9045
|
}
|
|
9040
|
-
return [
|
|
9041
|
-
}
|
|
9042
|
-
function collapseExcessiveBlankLines(value) {
|
|
9043
|
-
return value.replace(/\n{4,}/g, "\n\n\n").trim();
|
|
9044
|
-
}
|
|
9045
|
-
function formatShareSectionsForMultilineDisplay(value) {
|
|
9046
|
-
return collapseExcessiveBlankLines(
|
|
9047
|
-
splitShareDescriptionSections(value).join(SHARE_DESCRIPTION_SECTION_BREAK)
|
|
9048
|
-
);
|
|
9049
|
-
}
|
|
9050
|
-
function formatShareSectionsForCompactDisplay(value) {
|
|
9051
|
-
return splitShareDescriptionSections(value).join(
|
|
9052
|
-
SHARE_DESCRIPTION_SECTION_SEPARATOR
|
|
9053
|
-
);
|
|
9046
|
+
return [trimmed];
|
|
9054
9047
|
}
|
|
9055
9048
|
function normalizeShareOgDescription(value) {
|
|
9056
9049
|
return joinShareOgDescriptionSections(splitShareDescriptionSections(value));
|
|
9057
9050
|
}
|
|
9058
|
-
function buildFacebookShareQuote(title, description) {
|
|
9059
|
-
const
|
|
9060
|
-
const body = formatShareSectionsForMultilineDisplay(
|
|
9061
|
-
appendShareMoreInfoLine(normalizeShareSection(description))
|
|
9062
|
-
);
|
|
9063
|
-
const sections = [titleSection, body].filter((section) => section.length > 0);
|
|
9051
|
+
function buildFacebookShareQuote(title, description, shareType) {
|
|
9052
|
+
const sections = buildShareMessageSections({ title, description, shareType });
|
|
9064
9053
|
const quote = sections.join(SHARE_DESCRIPTION_SECTION_BREAK).trim();
|
|
9065
9054
|
return quote.length > 0 ? quote : void 0;
|
|
9066
9055
|
}
|
|
@@ -9219,7 +9208,6 @@ var gameTypeToDisplayName = {
|
|
|
9219
9208
|
RELATION_SHARE_INVITATION,
|
|
9220
9209
|
RELATION_SHARE_RESOURCE_TYPES,
|
|
9221
9210
|
RESOURCE_SHARE_TYPES,
|
|
9222
|
-
RESOURCE_SHARE_TYPES_FOR_URL,
|
|
9223
9211
|
SAVED_EMAIL_KEY,
|
|
9224
9212
|
SAVED_PASSWORD_KEY,
|
|
9225
9213
|
SAVED_REFRESH_TOKEN_KEY,
|
|
@@ -9231,7 +9219,6 @@ var gameTypeToDisplayName = {
|
|
|
9231
9219
|
SHARE_CATEGORY_ICON,
|
|
9232
9220
|
SHARE_CHECKMARK_ICON,
|
|
9233
9221
|
SHARE_DESCRIPTION_SECTION_BREAK,
|
|
9234
|
-
SHARE_DESCRIPTION_SECTION_SEPARATOR,
|
|
9235
9222
|
SHARE_MARKET_DATES_SECTION_HEADING,
|
|
9236
9223
|
SHARE_MORE_INFO_LINE,
|
|
9237
9224
|
SHARE_REQUIREMENTS_SECTION_HEADING,
|
|
@@ -9250,6 +9237,7 @@ var gameTypeToDisplayName = {
|
|
|
9250
9237
|
buildApplicationShareDescription,
|
|
9251
9238
|
buildFacebookShareQuote,
|
|
9252
9239
|
buildInvitationShareDescription,
|
|
9240
|
+
buildShareMessageSections,
|
|
9253
9241
|
buildShareOgDescription,
|
|
9254
9242
|
buildShareOgDescriptionFromSections,
|
|
9255
9243
|
buildSharePagePath,
|
|
@@ -9286,8 +9274,6 @@ var gameTypeToDisplayName = {
|
|
|
9286
9274
|
formatShareInvitationMarketDatesSection,
|
|
9287
9275
|
formatShareInvitationRequirementsSection,
|
|
9288
9276
|
formatShareMarketDate,
|
|
9289
|
-
formatShareSectionsForCompactDisplay,
|
|
9290
|
-
formatShareSectionsForMultilineDisplay,
|
|
9291
9277
|
formatStallCapacityLabel,
|
|
9292
9278
|
formatTimestamp,
|
|
9293
9279
|
gameScreenIdentifierList,
|
|
@@ -9313,6 +9299,7 @@ var gameTypeToDisplayName = {
|
|
|
9313
9299
|
mapBaseResourceTypeToFormData,
|
|
9314
9300
|
normalizeShareOgDescription,
|
|
9315
9301
|
normalizeShareRouteId,
|
|
9302
|
+
normalizeShareText,
|
|
9316
9303
|
normalizeUrl,
|
|
9317
9304
|
nzStartOfDay,
|
|
9318
9305
|
otherImages,
|
|
@@ -9335,6 +9322,7 @@ var gameTypeToDisplayName = {
|
|
|
9335
9322
|
requirementsOptions,
|
|
9336
9323
|
resetPasswordFields,
|
|
9337
9324
|
seededShuffle,
|
|
9325
|
+
shareMessageFooterPlacementForType,
|
|
9338
9326
|
socialMediaFields,
|
|
9339
9327
|
sortDatesChronologically,
|
|
9340
9328
|
splitShareDescriptionSections,
|