@timardex/cluemart-shared 1.5.602 → 1.5.605
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-Z2A5VC6X.mjs → chunk-A5HI7DTW.mjs} +25 -37
- package/dist/chunk-A5HI7DTW.mjs.map +1 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.cjs +27 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +8 -17
- package/dist/index.d.ts +8 -17
- package/dist/index.mjs +24 -36
- package/dist/index.mjs.map +1 -1
- package/dist/sharing/index.cjs +27 -40
- package/dist/sharing/index.cjs.map +1 -1
- package/dist/sharing/index.d.mts +8 -17
- package/dist/sharing/index.d.ts +8 -17
- package/dist/sharing/index.mjs +7 -9
- package/package.json +1 -1
- package/dist/chunk-Z2A5VC6X.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,13 +85,14 @@ __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,
|
|
89
|
+
SHARE_MORE_INFO_LINE: () => SHARE_MORE_INFO_LINE,
|
|
91
90
|
SHARE_REQUIREMENTS_SECTION_HEADING: () => SHARE_REQUIREMENTS_SECTION_HEADING,
|
|
92
91
|
SHARE_RESOURCE_LABEL: () => SHARE_RESOURCE_LABEL,
|
|
93
92
|
SHARE_SITE_URL: () => SHARE_SITE_URL,
|
|
94
93
|
SHARE_TYPE_PATH_REGEX: () => SHARE_TYPE_PATH_REGEX,
|
|
95
94
|
USER_STORAGE_KEY: () => USER_STORAGE_KEY,
|
|
95
|
+
appendShareMoreInfoLine: () => appendShareMoreInfoLine,
|
|
96
96
|
availableCategories: () => availableCategories,
|
|
97
97
|
availableRegionOptions: () => availableRegionOptions,
|
|
98
98
|
availableRegionTypes: () => availableRegionTypes,
|
|
@@ -139,8 +139,6 @@ __export(index_exports, {
|
|
|
139
139
|
formatShareInvitationMarketDatesSection: () => formatShareInvitationMarketDatesSection,
|
|
140
140
|
formatShareInvitationRequirementsSection: () => formatShareInvitationRequirementsSection,
|
|
141
141
|
formatShareMarketDate: () => formatShareMarketDate,
|
|
142
|
-
formatShareSectionsForCompactDisplay: () => formatShareSectionsForCompactDisplay,
|
|
143
|
-
formatShareSectionsForMultilineDisplay: () => formatShareSectionsForMultilineDisplay,
|
|
144
142
|
formatStallCapacityLabel: () => formatStallCapacityLabel,
|
|
145
143
|
formatTimestamp: () => formatTimestamp,
|
|
146
144
|
gameScreenIdentifierList: () => gameScreenIdentifierList,
|
|
@@ -166,6 +164,7 @@ __export(index_exports, {
|
|
|
166
164
|
mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
|
|
167
165
|
normalizeShareOgDescription: () => normalizeShareOgDescription,
|
|
168
166
|
normalizeShareRouteId: () => normalizeShareRouteId,
|
|
167
|
+
normalizeShareText: () => normalizeShareText,
|
|
169
168
|
normalizeUrl: () => normalizeUrl,
|
|
170
169
|
nzStartOfDay: () => nzStartOfDay,
|
|
171
170
|
otherImages: () => otherImages,
|
|
@@ -8864,6 +8863,7 @@ var SHARE_CHECKMARK_ICON = "\u2705";
|
|
|
8864
8863
|
var SHARE_REQUIREMENTS_SECTION_HEADING = `${SHARE_CHECKMARK_ICON} Requirements:`;
|
|
8865
8864
|
var SHARE_CATEGORY_ICON = "\u{1F3F7}\uFE0F";
|
|
8866
8865
|
var SHARE_CATEGORIES_SECTION_HEADING = `${SHARE_CATEGORY_ICON} Categories:`;
|
|
8866
|
+
var SHARE_MORE_INFO_LINE = "More info in the ClueMart app";
|
|
8867
8867
|
var DEFAULT_SHARE_OG_IMAGE = `${SHARE_SITE_URL}/assets/logo.webp`;
|
|
8868
8868
|
var RESOURCE_SHARE_TYPES = [
|
|
8869
8869
|
"market",
|
|
@@ -8901,7 +8901,6 @@ function formatCategoryLabel(category) {
|
|
|
8901
8901
|
}
|
|
8902
8902
|
|
|
8903
8903
|
// src/sharing/joinShareDescriptionSections.ts
|
|
8904
|
-
var SHARE_DESCRIPTION_SECTION_SEPARATOR = " \xB7 ";
|
|
8905
8904
|
var SHARE_DESCRIPTION_SECTION_BREAK = "\n\n";
|
|
8906
8905
|
var OG_DESCRIPTION_LINE_BREAK = " ";
|
|
8907
8906
|
function joinShareOgDescriptionSections(sections) {
|
|
@@ -8910,6 +8909,16 @@ function joinShareOgDescriptionSections(sections) {
|
|
|
8910
8909
|
function joinShareDescriptionSections(sections) {
|
|
8911
8910
|
return sections.filter((section) => Boolean(section)).join(SHARE_DESCRIPTION_SECTION_BREAK);
|
|
8912
8911
|
}
|
|
8912
|
+
function appendShareMoreInfoLine(description) {
|
|
8913
|
+
const trimmed = description.trim();
|
|
8914
|
+
if (trimmed.endsWith(SHARE_MORE_INFO_LINE)) {
|
|
8915
|
+
return trimmed;
|
|
8916
|
+
}
|
|
8917
|
+
if (trimmed.length === 0) {
|
|
8918
|
+
return SHARE_MORE_INFO_LINE;
|
|
8919
|
+
}
|
|
8920
|
+
return joinShareDescriptionSections([trimmed, SHARE_MORE_INFO_LINE]);
|
|
8921
|
+
}
|
|
8913
8922
|
|
|
8914
8923
|
// src/sharing/buildRelationShareDescription.ts
|
|
8915
8924
|
function formatShareMarketDate(dateStr) {
|
|
@@ -8982,7 +8991,6 @@ var PUBLIC_SHARE_PATH_TYPES = [
|
|
|
8982
8991
|
...RESOURCE_SHARE_TYPES,
|
|
8983
8992
|
...POST_SHARE_RESOURCE_TYPES
|
|
8984
8993
|
];
|
|
8985
|
-
var RESOURCE_SHARE_TYPES_FOR_URL = PUBLIC_SHARE_PATH_TYPES;
|
|
8986
8994
|
var SHARE_TYPE_PATH_REGEX = [
|
|
8987
8995
|
...PUBLIC_SHARE_PATH_TYPES,
|
|
8988
8996
|
RELATION_SHARE_APPLICATION,
|
|
@@ -8993,8 +9001,7 @@ function buildShareUrl(type, id) {
|
|
|
8993
9001
|
}
|
|
8994
9002
|
|
|
8995
9003
|
// src/sharing/normalizeShareDescription.ts
|
|
8996
|
-
|
|
8997
|
-
function normalizeShareSection(value) {
|
|
9004
|
+
function normalizeShareText(value) {
|
|
8998
9005
|
if (value == null) {
|
|
8999
9006
|
return "";
|
|
9000
9007
|
}
|
|
@@ -9007,46 +9014,25 @@ function normalizeShareSection(value) {
|
|
|
9007
9014
|
return leading + rest.trim().replace(/[ \t]{2,}/g, " ");
|
|
9008
9015
|
}).join("\n").replace(/\n{3,}/g, "\n\n");
|
|
9009
9016
|
}
|
|
9010
|
-
function stripLegacyBulletPrefix(section) {
|
|
9011
|
-
return section.startsWith(LEGACY_BULLET_PREFIX) ? section.slice(LEGACY_BULLET_PREFIX.length) : section;
|
|
9012
|
-
}
|
|
9013
9017
|
function splitShareDescriptionSections(value) {
|
|
9014
|
-
const trimmed = value
|
|
9018
|
+
const trimmed = normalizeShareText(value);
|
|
9015
9019
|
if (!trimmed) {
|
|
9016
9020
|
return [];
|
|
9017
9021
|
}
|
|
9018
|
-
if (trimmed.includes(SHARE_DESCRIPTION_SECTION_SEPARATOR)) {
|
|
9019
|
-
return trimmed.split(SHARE_DESCRIPTION_SECTION_SEPARATOR).map((section) => stripLegacyBulletPrefix(normalizeShareSection(section))).filter((section) => section.length > 0);
|
|
9020
|
-
}
|
|
9021
9022
|
if (/\n\n/.test(trimmed)) {
|
|
9022
|
-
return trimmed.split(/\n\n+/).map((section) =>
|
|
9023
|
+
return trimmed.split(/\n\n+/).map((section) => normalizeShareText(section)).filter((section) => section.length > 0);
|
|
9023
9024
|
}
|
|
9024
9025
|
if (/\n/.test(trimmed)) {
|
|
9025
|
-
return trimmed.split(/\n+/).map((section) =>
|
|
9026
|
+
return trimmed.split(/\n+/).map((section) => normalizeShareText(section)).filter((section) => section.length > 0);
|
|
9026
9027
|
}
|
|
9027
|
-
return [
|
|
9028
|
-
}
|
|
9029
|
-
function collapseExcessiveBlankLines(value) {
|
|
9030
|
-
return value.replace(/\n{4,}/g, "\n\n\n").trim();
|
|
9031
|
-
}
|
|
9032
|
-
function formatShareSectionsForMultilineDisplay(value) {
|
|
9033
|
-
return collapseExcessiveBlankLines(
|
|
9034
|
-
splitShareDescriptionSections(value).join(SHARE_DESCRIPTION_SECTION_BREAK)
|
|
9035
|
-
);
|
|
9036
|
-
}
|
|
9037
|
-
function formatShareSectionsForCompactDisplay(value) {
|
|
9038
|
-
return splitShareDescriptionSections(value).join(
|
|
9039
|
-
SHARE_DESCRIPTION_SECTION_SEPARATOR
|
|
9040
|
-
);
|
|
9028
|
+
return [trimmed];
|
|
9041
9029
|
}
|
|
9042
9030
|
function normalizeShareOgDescription(value) {
|
|
9043
9031
|
return joinShareOgDescriptionSections(splitShareDescriptionSections(value));
|
|
9044
9032
|
}
|
|
9045
9033
|
function buildFacebookShareQuote(title, description) {
|
|
9046
|
-
const titleSection =
|
|
9047
|
-
const body =
|
|
9048
|
-
normalizeShareSection(description)
|
|
9049
|
-
);
|
|
9034
|
+
const titleSection = normalizeShareText(title);
|
|
9035
|
+
const body = appendShareMoreInfoLine(normalizeShareText(description));
|
|
9050
9036
|
const sections = [titleSection, body].filter((section) => section.length > 0);
|
|
9051
9037
|
const quote = sections.join(SHARE_DESCRIPTION_SECTION_BREAK).trim();
|
|
9052
9038
|
return quote.length > 0 ? quote : void 0;
|
|
@@ -9055,7 +9041,9 @@ function buildShareOgDescriptionFromSections(sections) {
|
|
|
9055
9041
|
return joinShareOgDescriptionSections(sections);
|
|
9056
9042
|
}
|
|
9057
9043
|
function buildShareOgDescription(_title, description) {
|
|
9058
|
-
return joinShareOgDescriptionSections(
|
|
9044
|
+
return joinShareOgDescriptionSections(
|
|
9045
|
+
splitShareDescriptionSections(description)
|
|
9046
|
+
);
|
|
9059
9047
|
}
|
|
9060
9048
|
|
|
9061
9049
|
// src/sharing/normalizeShareRouteId.ts
|
|
@@ -9204,7 +9192,6 @@ var gameTypeToDisplayName = {
|
|
|
9204
9192
|
RELATION_SHARE_INVITATION,
|
|
9205
9193
|
RELATION_SHARE_RESOURCE_TYPES,
|
|
9206
9194
|
RESOURCE_SHARE_TYPES,
|
|
9207
|
-
RESOURCE_SHARE_TYPES_FOR_URL,
|
|
9208
9195
|
SAVED_EMAIL_KEY,
|
|
9209
9196
|
SAVED_PASSWORD_KEY,
|
|
9210
9197
|
SAVED_REFRESH_TOKEN_KEY,
|
|
@@ -9216,13 +9203,14 @@ var gameTypeToDisplayName = {
|
|
|
9216
9203
|
SHARE_CATEGORY_ICON,
|
|
9217
9204
|
SHARE_CHECKMARK_ICON,
|
|
9218
9205
|
SHARE_DESCRIPTION_SECTION_BREAK,
|
|
9219
|
-
SHARE_DESCRIPTION_SECTION_SEPARATOR,
|
|
9220
9206
|
SHARE_MARKET_DATES_SECTION_HEADING,
|
|
9207
|
+
SHARE_MORE_INFO_LINE,
|
|
9221
9208
|
SHARE_REQUIREMENTS_SECTION_HEADING,
|
|
9222
9209
|
SHARE_RESOURCE_LABEL,
|
|
9223
9210
|
SHARE_SITE_URL,
|
|
9224
9211
|
SHARE_TYPE_PATH_REGEX,
|
|
9225
9212
|
USER_STORAGE_KEY,
|
|
9213
|
+
appendShareMoreInfoLine,
|
|
9226
9214
|
availableCategories,
|
|
9227
9215
|
availableRegionOptions,
|
|
9228
9216
|
availableRegionTypes,
|
|
@@ -9269,8 +9257,6 @@ var gameTypeToDisplayName = {
|
|
|
9269
9257
|
formatShareInvitationMarketDatesSection,
|
|
9270
9258
|
formatShareInvitationRequirementsSection,
|
|
9271
9259
|
formatShareMarketDate,
|
|
9272
|
-
formatShareSectionsForCompactDisplay,
|
|
9273
|
-
formatShareSectionsForMultilineDisplay,
|
|
9274
9260
|
formatStallCapacityLabel,
|
|
9275
9261
|
formatTimestamp,
|
|
9276
9262
|
gameScreenIdentifierList,
|
|
@@ -9296,6 +9282,7 @@ var gameTypeToDisplayName = {
|
|
|
9296
9282
|
mapBaseResourceTypeToFormData,
|
|
9297
9283
|
normalizeShareOgDescription,
|
|
9298
9284
|
normalizeShareRouteId,
|
|
9285
|
+
normalizeShareText,
|
|
9299
9286
|
normalizeUrl,
|
|
9300
9287
|
nzStartOfDay,
|
|
9301
9288
|
otherImages,
|