@esposter/shared 3.7.0 → 3.9.0
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/index.d.ts +3 -0
- package/dist/index.js +33 -1
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -2047,6 +2047,9 @@ export declare const getEndOfDay: (date: Date) => Date;
|
|
|
2047
2047
|
//#region src/util/date/getZonedDateTime.d.ts
|
|
2048
2048
|
export declare const getZonedDateTime: (date: Date) => Temporal.ZonedDateTime;
|
|
2049
2049
|
//#endregion
|
|
2050
|
+
//#region src/util/dom/checkIsNestedInteraction.d.ts
|
|
2051
|
+
export declare const checkIsNestedInteraction: (event: MouseEvent) => boolean;
|
|
2052
|
+
//#endregion
|
|
2050
2053
|
//#region src/util/environment/checkIsServer.d.ts
|
|
2051
2054
|
export declare const checkIsServer: () => boolean;
|
|
2052
2055
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -435,6 +435,38 @@ const getZonedDateTime = (date) => Temporal.Instant.fromEpochMilliseconds(date.g
|
|
|
435
435
|
//#region src/util/date/getEndOfDay.ts
|
|
436
436
|
const getEndOfDay = (date) => /* @__PURE__ */ new Date(getZonedDateTime(date).startOfDay().add({ days: 1 }).epochMilliseconds - 1);
|
|
437
437
|
//#endregion
|
|
438
|
+
//#region src/util/dom/checkIsNestedInteraction.ts
|
|
439
|
+
const NESTED_INTERACTION_SELECTOR = [
|
|
440
|
+
"a[href]",
|
|
441
|
+
"button",
|
|
442
|
+
"dialog",
|
|
443
|
+
"input",
|
|
444
|
+
"label",
|
|
445
|
+
"select",
|
|
446
|
+
"summary",
|
|
447
|
+
"textarea",
|
|
448
|
+
"[contenteditable='']",
|
|
449
|
+
"[contenteditable='plaintext-only']",
|
|
450
|
+
"[contenteditable='true']",
|
|
451
|
+
"[data-nested-interaction]",
|
|
452
|
+
"[role='button']",
|
|
453
|
+
"[role='checkbox']",
|
|
454
|
+
"[role='dialog']",
|
|
455
|
+
"[role='link']",
|
|
456
|
+
"[role='menu']",
|
|
457
|
+
"[role='menuitem']",
|
|
458
|
+
"[role='option']",
|
|
459
|
+
"[role='switch']",
|
|
460
|
+
"[role='tab']"
|
|
461
|
+
].join(", ");
|
|
462
|
+
const checkIsNestedInteraction = (event) => {
|
|
463
|
+
const { currentTarget, target } = event;
|
|
464
|
+
if (!(currentTarget instanceof Element) || !(target instanceof Element)) return false;
|
|
465
|
+
const interactiveElement = target.closest(NESTED_INTERACTION_SELECTOR);
|
|
466
|
+
if (interactiveElement && interactiveElement !== currentTarget && currentTarget.contains(interactiveElement)) return true;
|
|
467
|
+
return Boolean(window.getSelection()?.toString());
|
|
468
|
+
};
|
|
469
|
+
//#endregion
|
|
438
470
|
//#region src/util/environment/checkIsServer.ts
|
|
439
471
|
const checkIsServer = () => typeof window === "undefined";
|
|
440
472
|
//#endregion
|
|
@@ -577,4 +609,4 @@ const exhaustiveGuard = (value) => {
|
|
|
577
609
|
throw new InvalidOperationError("Read", exhaustiveGuard.name, JSON.stringify(value));
|
|
578
610
|
};
|
|
579
611
|
//#endregion
|
|
580
|
-
export { ALL_SPECIAL_VALUES, CUSTOM_EMOJI_ID_ATTRIBUTE, CUSTOM_EMOJI_NAME_ATTRIBUTE, DEFAULT_COMPRESSION_LEVEL, ForbiddenError, GIBIBYTE, ID_SEPARATOR, InvalidOperationError, ItemMetadata, KIBIBYTE, MAX_READ_LIMIT, MAX_WINDOW_LOG, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_ITEM_TYPE_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_SELECTOR, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MIN_WINDOW_LOG, MentionType, NotFoundError, NotInitializedError, Operation, RoutePath, SITE_NAME, Serializable, UUIDV4_REGEX, WordFilteredError, applyItemMetadataMixin, capitalize, checkIsPlainObject, checkIsServer, chunk, chunkBySerializedSize, createItemEntityTypeSchema, createNormalizedStringSchema, createUniqueArraySchema, css, encodeUrlSubDelimiters, exhaustiveGuard, getDecodedUriComponent, getEndOfDay, getMentions, getOrCreate, getPropertyNames, getRawData, getResult, getResultAsync, getSynchronizedFunction, getWindowLog, getZonedDateTime, hrtime, html, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, sanitizeHtml, sanitizeTextHtml, settleAll, sleep, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, waitForSynchronizedFunctions, withFinalizer, withFinalizerAsync };
|
|
612
|
+
export { ALL_SPECIAL_VALUES, CUSTOM_EMOJI_ID_ATTRIBUTE, CUSTOM_EMOJI_NAME_ATTRIBUTE, DEFAULT_COMPRESSION_LEVEL, ForbiddenError, GIBIBYTE, ID_SEPARATOR, InvalidOperationError, ItemMetadata, KIBIBYTE, MAX_READ_LIMIT, MAX_WINDOW_LOG, MENTION_EVERYONE_ID, MENTION_HERE_ID, MENTION_ID_ATTRIBUTE, MENTION_ITEM_TYPE_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_SELECTOR, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MIN_WINDOW_LOG, MentionType, NotFoundError, NotInitializedError, Operation, RoutePath, SITE_NAME, Serializable, UUIDV4_REGEX, WordFilteredError, applyItemMetadataMixin, capitalize, checkIsNestedInteraction, checkIsPlainObject, checkIsServer, chunk, chunkBySerializedSize, createItemEntityTypeSchema, createNormalizedStringSchema, createUniqueArraySchema, css, encodeUrlSubDelimiters, exhaustiveGuard, getDecodedUriComponent, getEndOfDay, getMentions, getOrCreate, getPropertyNames, getRawData, getResult, getResultAsync, getSynchronizedFunction, getWindowLog, getZonedDateTime, hrtime, html, jsonDateParse, mergeObjectsStrict, noop, normalizeString, now, sanitizeHtml, sanitizeTextHtml, settleAll, sleep, streamToText, takeOne, toAppError, toKebabCase, toRawDeep, truncate, uncapitalize, waitForSynchronizedFunctions, withFinalizer, withFinalizerAsync };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esposter/shared",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "A library that contains shared typescript code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"error-handling",
|
|
@@ -50,18 +50,19 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"neverthrow": "^8.2.0",
|
|
52
52
|
"node-html-parser": "^9.0.4",
|
|
53
|
-
"sanitize-html": "^2.
|
|
53
|
+
"sanitize-html": "^2.18.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@arethetypeswrong/core": "^0.18.5",
|
|
57
57
|
"@azure/data-tables": "^13.3.2",
|
|
58
|
-
"@esposter/configuration": "3.
|
|
59
|
-
"@types/node": "^26.6.
|
|
58
|
+
"@esposter/configuration": "3.9.0",
|
|
59
|
+
"@types/node": "^26.6.4",
|
|
60
60
|
"@types/sanitize-html": "^2.16.2",
|
|
61
|
-
"
|
|
61
|
+
"happy-dom": "^20.14.5",
|
|
62
|
+
"publint": "^0.3.25",
|
|
62
63
|
"tsdown": "^0.23.0",
|
|
63
64
|
"type-fest": "^5.10.0",
|
|
64
|
-
"vitest": "^5.0.
|
|
65
|
+
"vitest": "^5.0.3",
|
|
65
66
|
"vue": "^3.5.43"
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
@@ -70,5 +71,5 @@
|
|
|
70
71
|
"inlinedDependencies": {
|
|
71
72
|
"type-fest": "5.10.0"
|
|
72
73
|
},
|
|
73
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "f9f6208c35e6cff4ed33910623c798cd88f09301"
|
|
74
75
|
}
|