@trackunit/shared-utils 1.16.39 → 1.16.40

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/index.cjs.js CHANGED
@@ -158,9 +158,18 @@ const markNavigatingAway = () => {
158
158
  };
159
159
  /** Returns whether {@link markNavigatingAway} has been called since the last page load. */
160
160
  const isNavigatingAway = () => navigatingAway;
161
+ /**
162
+ * Clears the navigation state when a full page navigation could not be started.
163
+ *
164
+ * Callers that mark an attempted navigation must call this before propagating a failure so the
165
+ * current document can resume ordinary error reporting.
166
+ */
167
+ const clearNavigatingAway = () => {
168
+ navigatingAway = false;
169
+ };
161
170
  /** Test-only helper to reset the module-level flag between test cases. */
162
171
  const resetNavigatingAwayForTests = () => {
163
- navigatingAway = false;
172
+ clearNavigatingAway();
164
173
  };
165
174
 
166
175
  const align = {
@@ -2063,6 +2072,7 @@ exports.arrayNotEmpty = arrayNotEmpty;
2063
2072
  exports.booleanCompare = booleanCompare;
2064
2073
  exports.calculateImageScaleRatio = calculateImageScaleRatio;
2065
2074
  exports.capitalize = capitalize;
2075
+ exports.clearNavigatingAway = clearNavigatingAway;
2066
2076
  exports.colorsFromStyleDeclaration = colorsFromStyleDeclaration;
2067
2077
  exports.convertBlobToBase64 = convertBlobToBase64;
2068
2078
  exports.convertMetersToKilometers = convertMetersToKilometers;
package/index.esm.js CHANGED
@@ -156,9 +156,18 @@ const markNavigatingAway = () => {
156
156
  };
157
157
  /** Returns whether {@link markNavigatingAway} has been called since the last page load. */
158
158
  const isNavigatingAway = () => navigatingAway;
159
+ /**
160
+ * Clears the navigation state when a full page navigation could not be started.
161
+ *
162
+ * Callers that mark an attempted navigation must call this before propagating a failure so the
163
+ * current document can resume ordinary error reporting.
164
+ */
165
+ const clearNavigatingAway = () => {
166
+ navigatingAway = false;
167
+ };
159
168
  /** Test-only helper to reset the module-level flag between test cases. */
160
169
  const resetNavigatingAwayForTests = () => {
161
- navigatingAway = false;
170
+ clearNavigatingAway();
162
171
  };
163
172
 
164
173
  const align = {
@@ -2049,4 +2058,4 @@ const formatUsCustomaryDistance = (value) => {
2049
2058
  }
2050
2059
  };
2051
2060
 
2052
- export { DateTimeFormat, HoursAndMinutesFormat, UnitsOfMeasurementSI, UnitsOfMeasurementUSCustomary, VISIBLE_ONLY_COLUMN_VISIBILITY_KEY, align, alphabeticallySort, arrayLengthCompare, arrayNotEmpty, booleanCompare, calculateImageScaleRatio, capitalize, colorsFromStyleDeclaration, convertBlobToBase64, convertMetersToKilometers, convertMetersToYards, convertYardsToMeters, convertYardsToMiles, dateCompare, deleteUndefinedKeys, difference, doNothing, enumFromValue, enumFromValueTypesafe, enumOrUndefinedFromValue, exhaustiveCheck, fetchImageAsBase64, filterByMultiple, formatAddress, formatCoordinates, formatSiDistance, formatUsCustomaryDistance, fuzzySearch, getAllColors, getCountryName, getDifferenceBetweenDates, getEndOfDay, getFirstLevelObjectPropertyDifferences, getISOStringFromDate, getLoremIpsum, getMimeTypeFromDataURL, getResizedDimensions, getStartOfDay, groupBy, groupTinyDataToOthers, hourIntervals, intersection, isArrayEqual, isNavigatingAway, isSortByProperty, isSorted, isUUID, isValidImage, loadSVGDimensions, markNavigatingAway, nonNullable, numberCompare, numberCompareUnknownAfterHighest, objNotEmpty, objectEntries, objectFromEntries, objectKeys, objectValues, parseTailwindArbitraryValue, pick, preload, readFromStorage, readLocalStorageValue, removeLeftPadding, removeLocalStorageValue, removeProperties, removeProperty, replaceNullableNumbersWithZero, resetNavigatingAwayForTests, resizeBlob, resizeImage, rgb2hex, size, storageSerializer, stringCompare, stringCompareFromKey, stringNaturalCompare, stripHiddenCharacters, svgToPNG, titleCase, toID, toIDs, toPNG, toUUID, trimIds, trimPath, truthy, unionArraysByKey, uuidv3, uuidv4, uuidv5, validateState, writeLocalStorageValue, writeToStorage };
2061
+ export { DateTimeFormat, HoursAndMinutesFormat, UnitsOfMeasurementSI, UnitsOfMeasurementUSCustomary, VISIBLE_ONLY_COLUMN_VISIBILITY_KEY, align, alphabeticallySort, arrayLengthCompare, arrayNotEmpty, booleanCompare, calculateImageScaleRatio, capitalize, clearNavigatingAway, colorsFromStyleDeclaration, convertBlobToBase64, convertMetersToKilometers, convertMetersToYards, convertYardsToMeters, convertYardsToMiles, dateCompare, deleteUndefinedKeys, difference, doNothing, enumFromValue, enumFromValueTypesafe, enumOrUndefinedFromValue, exhaustiveCheck, fetchImageAsBase64, filterByMultiple, formatAddress, formatCoordinates, formatSiDistance, formatUsCustomaryDistance, fuzzySearch, getAllColors, getCountryName, getDifferenceBetweenDates, getEndOfDay, getFirstLevelObjectPropertyDifferences, getISOStringFromDate, getLoremIpsum, getMimeTypeFromDataURL, getResizedDimensions, getStartOfDay, groupBy, groupTinyDataToOthers, hourIntervals, intersection, isArrayEqual, isNavigatingAway, isSortByProperty, isSorted, isUUID, isValidImage, loadSVGDimensions, markNavigatingAway, nonNullable, numberCompare, numberCompareUnknownAfterHighest, objNotEmpty, objectEntries, objectFromEntries, objectKeys, objectValues, parseTailwindArbitraryValue, pick, preload, readFromStorage, readLocalStorageValue, removeLeftPadding, removeLocalStorageValue, removeProperties, removeProperty, replaceNullableNumbersWithZero, resetNavigatingAwayForTests, resizeBlob, resizeImage, rgb2hex, size, storageSerializer, stringCompare, stringCompareFromKey, stringNaturalCompare, stripHiddenCharacters, svgToPNG, titleCase, toID, toIDs, toPNG, toUUID, trimIds, trimPath, truthy, unionArraysByKey, uuidv3, uuidv4, uuidv5, validateState, writeLocalStorageValue, writeToStorage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/shared-utils",
3
- "version": "1.16.39",
3
+ "version": "1.16.40",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "engines": {
6
6
  "node": ">=24.x"
@@ -10,5 +10,12 @@
10
10
  export declare const markNavigatingAway: () => void;
11
11
  /** Returns whether {@link markNavigatingAway} has been called since the last page load. */
12
12
  export declare const isNavigatingAway: () => boolean;
13
+ /**
14
+ * Clears the navigation state when a full page navigation could not be started.
15
+ *
16
+ * Callers that mark an attempted navigation must call this before propagating a failure so the
17
+ * current document can resume ordinary error reporting.
18
+ */
19
+ export declare const clearNavigatingAway: () => void;
13
20
  /** Test-only helper to reset the module-level flag between test cases. */
14
21
  export declare const resetNavigatingAwayForTests: () => void;