@timardex/cluemart-shared 1.5.603 → 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-XSJXK4NT.mjs → chunk-A5HI7DTW.mjs} +9 -36
- 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 +9 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -17
- package/dist/index.d.ts +4 -17
- package/dist/index.mjs +8 -35
- package/dist/index.mjs.map +1 -1
- package/dist/sharing/index.cjs +9 -39
- package/dist/sharing/index.cjs.map +1 -1
- package/dist/sharing/index.d.mts +4 -17
- package/dist/sharing/index.d.ts +4 -17
- package/dist/sharing/index.mjs +3 -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,
|
|
@@ -141,8 +139,6 @@ __export(index_exports, {
|
|
|
141
139
|
formatShareInvitationMarketDatesSection: () => formatShareInvitationMarketDatesSection,
|
|
142
140
|
formatShareInvitationRequirementsSection: () => formatShareInvitationRequirementsSection,
|
|
143
141
|
formatShareMarketDate: () => formatShareMarketDate,
|
|
144
|
-
formatShareSectionsForCompactDisplay: () => formatShareSectionsForCompactDisplay,
|
|
145
|
-
formatShareSectionsForMultilineDisplay: () => formatShareSectionsForMultilineDisplay,
|
|
146
142
|
formatStallCapacityLabel: () => formatStallCapacityLabel,
|
|
147
143
|
formatTimestamp: () => formatTimestamp,
|
|
148
144
|
gameScreenIdentifierList: () => gameScreenIdentifierList,
|
|
@@ -168,6 +164,7 @@ __export(index_exports, {
|
|
|
168
164
|
mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
|
|
169
165
|
normalizeShareOgDescription: () => normalizeShareOgDescription,
|
|
170
166
|
normalizeShareRouteId: () => normalizeShareRouteId,
|
|
167
|
+
normalizeShareText: () => normalizeShareText,
|
|
171
168
|
normalizeUrl: () => normalizeUrl,
|
|
172
169
|
nzStartOfDay: () => nzStartOfDay,
|
|
173
170
|
otherImages: () => otherImages,
|
|
@@ -8904,7 +8901,6 @@ function formatCategoryLabel(category) {
|
|
|
8904
8901
|
}
|
|
8905
8902
|
|
|
8906
8903
|
// src/sharing/joinShareDescriptionSections.ts
|
|
8907
|
-
var SHARE_DESCRIPTION_SECTION_SEPARATOR = " \xB7 ";
|
|
8908
8904
|
var SHARE_DESCRIPTION_SECTION_BREAK = "\n\n";
|
|
8909
8905
|
var OG_DESCRIPTION_LINE_BREAK = " ";
|
|
8910
8906
|
function joinShareOgDescriptionSections(sections) {
|
|
@@ -8995,7 +8991,6 @@ var PUBLIC_SHARE_PATH_TYPES = [
|
|
|
8995
8991
|
...RESOURCE_SHARE_TYPES,
|
|
8996
8992
|
...POST_SHARE_RESOURCE_TYPES
|
|
8997
8993
|
];
|
|
8998
|
-
var RESOURCE_SHARE_TYPES_FOR_URL = PUBLIC_SHARE_PATH_TYPES;
|
|
8999
8994
|
var SHARE_TYPE_PATH_REGEX = [
|
|
9000
8995
|
...PUBLIC_SHARE_PATH_TYPES,
|
|
9001
8996
|
RELATION_SHARE_APPLICATION,
|
|
@@ -9006,8 +9001,7 @@ function buildShareUrl(type, id) {
|
|
|
9006
9001
|
}
|
|
9007
9002
|
|
|
9008
9003
|
// src/sharing/normalizeShareDescription.ts
|
|
9009
|
-
|
|
9010
|
-
function normalizeShareSection(value) {
|
|
9004
|
+
function normalizeShareText(value) {
|
|
9011
9005
|
if (value == null) {
|
|
9012
9006
|
return "";
|
|
9013
9007
|
}
|
|
@@ -9020,46 +9014,25 @@ function normalizeShareSection(value) {
|
|
|
9020
9014
|
return leading + rest.trim().replace(/[ \t]{2,}/g, " ");
|
|
9021
9015
|
}).join("\n").replace(/\n{3,}/g, "\n\n");
|
|
9022
9016
|
}
|
|
9023
|
-
function stripLegacyBulletPrefix(section) {
|
|
9024
|
-
return section.startsWith(LEGACY_BULLET_PREFIX) ? section.slice(LEGACY_BULLET_PREFIX.length) : section;
|
|
9025
|
-
}
|
|
9026
9017
|
function splitShareDescriptionSections(value) {
|
|
9027
|
-
const trimmed = value
|
|
9018
|
+
const trimmed = normalizeShareText(value);
|
|
9028
9019
|
if (!trimmed) {
|
|
9029
9020
|
return [];
|
|
9030
9021
|
}
|
|
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
9022
|
if (/\n\n/.test(trimmed)) {
|
|
9035
|
-
return trimmed.split(/\n\n+/).map((section) =>
|
|
9023
|
+
return trimmed.split(/\n\n+/).map((section) => normalizeShareText(section)).filter((section) => section.length > 0);
|
|
9036
9024
|
}
|
|
9037
9025
|
if (/\n/.test(trimmed)) {
|
|
9038
|
-
return trimmed.split(/\n+/).map((section) =>
|
|
9026
|
+
return trimmed.split(/\n+/).map((section) => normalizeShareText(section)).filter((section) => section.length > 0);
|
|
9039
9027
|
}
|
|
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
|
-
);
|
|
9028
|
+
return [trimmed];
|
|
9054
9029
|
}
|
|
9055
9030
|
function normalizeShareOgDescription(value) {
|
|
9056
9031
|
return joinShareOgDescriptionSections(splitShareDescriptionSections(value));
|
|
9057
9032
|
}
|
|
9058
9033
|
function buildFacebookShareQuote(title, description) {
|
|
9059
|
-
const titleSection =
|
|
9060
|
-
const body =
|
|
9061
|
-
appendShareMoreInfoLine(normalizeShareSection(description))
|
|
9062
|
-
);
|
|
9034
|
+
const titleSection = normalizeShareText(title);
|
|
9035
|
+
const body = appendShareMoreInfoLine(normalizeShareText(description));
|
|
9063
9036
|
const sections = [titleSection, body].filter((section) => section.length > 0);
|
|
9064
9037
|
const quote = sections.join(SHARE_DESCRIPTION_SECTION_BREAK).trim();
|
|
9065
9038
|
return quote.length > 0 ? quote : void 0;
|
|
@@ -9219,7 +9192,6 @@ var gameTypeToDisplayName = {
|
|
|
9219
9192
|
RELATION_SHARE_INVITATION,
|
|
9220
9193
|
RELATION_SHARE_RESOURCE_TYPES,
|
|
9221
9194
|
RESOURCE_SHARE_TYPES,
|
|
9222
|
-
RESOURCE_SHARE_TYPES_FOR_URL,
|
|
9223
9195
|
SAVED_EMAIL_KEY,
|
|
9224
9196
|
SAVED_PASSWORD_KEY,
|
|
9225
9197
|
SAVED_REFRESH_TOKEN_KEY,
|
|
@@ -9231,7 +9203,6 @@ var gameTypeToDisplayName = {
|
|
|
9231
9203
|
SHARE_CATEGORY_ICON,
|
|
9232
9204
|
SHARE_CHECKMARK_ICON,
|
|
9233
9205
|
SHARE_DESCRIPTION_SECTION_BREAK,
|
|
9234
|
-
SHARE_DESCRIPTION_SECTION_SEPARATOR,
|
|
9235
9206
|
SHARE_MARKET_DATES_SECTION_HEADING,
|
|
9236
9207
|
SHARE_MORE_INFO_LINE,
|
|
9237
9208
|
SHARE_REQUIREMENTS_SECTION_HEADING,
|
|
@@ -9286,8 +9257,6 @@ var gameTypeToDisplayName = {
|
|
|
9286
9257
|
formatShareInvitationMarketDatesSection,
|
|
9287
9258
|
formatShareInvitationRequirementsSection,
|
|
9288
9259
|
formatShareMarketDate,
|
|
9289
|
-
formatShareSectionsForCompactDisplay,
|
|
9290
|
-
formatShareSectionsForMultilineDisplay,
|
|
9291
9260
|
formatStallCapacityLabel,
|
|
9292
9261
|
formatTimestamp,
|
|
9293
9262
|
gameScreenIdentifierList,
|
|
@@ -9313,6 +9282,7 @@ var gameTypeToDisplayName = {
|
|
|
9313
9282
|
mapBaseResourceTypeToFormData,
|
|
9314
9283
|
normalizeShareOgDescription,
|
|
9315
9284
|
normalizeShareRouteId,
|
|
9285
|
+
normalizeShareText,
|
|
9316
9286
|
normalizeUrl,
|
|
9317
9287
|
nzStartOfDay,
|
|
9318
9288
|
otherImages,
|