umaki 0.13.0 → 0.13.1

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.
Files changed (141) hide show
  1. package/README.md +15 -0
  2. package/dist/LICENSE.txt +1 -32
  3. package/dist/{index.cjs.js → index.cjs} +62 -62
  4. package/dist/libs/callback/{index.cjs.js → index.cjs} +2 -2
  5. package/dist/libs/config/{_internal.cjs.js → _internal.cjs} +1 -1
  6. package/dist/libs/config/{get-config.cjs.js → get-config.cjs} +1 -1
  7. package/dist/libs/config/{index.cjs.js → index.cjs} +3 -3
  8. package/dist/libs/config/set-config.cjs +12 -0
  9. package/dist/libs/config/set-config.d.ts +1 -0
  10. package/dist/libs/config/set-config.es.js +5 -1
  11. package/dist/libs/control/{bg-scroll-stop.cjs.js → bg-scroll-stop.cjs} +2 -1
  12. package/dist/libs/control/bg-scroll-stop.d.ts +1 -0
  13. package/dist/libs/control/bg-scroll-stop.es.js +1 -0
  14. package/dist/libs/control/{index.cjs.js → index.cjs} +5 -5
  15. package/dist/libs/control/{scroll-to-hash.cjs.js → scroll-to-hash.cjs} +1 -0
  16. package/dist/libs/control/scroll-to-hash.d.ts +1 -0
  17. package/dist/libs/control/scroll-to-hash.es.js +1 -0
  18. package/dist/libs/control/{video-play-control.cjs.js → video-play-control.cjs} +1 -1
  19. package/dist/libs/convert/{change-date-string-to-specific-format.cjs.js → change-date-string-to-specific-format.cjs} +4 -4
  20. package/dist/libs/convert/change-date-string-to-specific-format.es.js +2 -2
  21. package/dist/libs/convert/{index.cjs.js → index.cjs} +4 -4
  22. package/dist/libs/eventControl/{index.cjs.js → index.cjs} +2 -2
  23. package/dist/libs/get/{get-aspect-ratio.cjs.js → get-aspect-ratio.cjs} +1 -1
  24. package/dist/libs/get/get-document-height.cjs +7 -0
  25. package/dist/libs/get/get-document-height.d.ts +1 -0
  26. package/dist/libs/get/get-document-height.es.js +4 -1
  27. package/dist/libs/get/{get-gcd.cjs.js → get-gcd.cjs} +4 -1
  28. package/dist/libs/get/get-gcd.d.ts +1 -0
  29. package/dist/libs/get/get-gcd.es.js +3 -0
  30. package/dist/libs/get/{get-gravatar-url.cjs.js → get-gravatar-url.cjs} +3 -0
  31. package/dist/libs/get/get-gravatar-url.d.ts +4 -0
  32. package/dist/libs/get/get-gravatar-url.es.js +3 -0
  33. package/dist/libs/get/{get-query-params.cjs.js → get-query-params.cjs} +4 -1
  34. package/dist/libs/get/get-query-params.d.ts +1 -0
  35. package/dist/libs/get/get-query-params.es.js +4 -1
  36. package/dist/libs/get/{get-random-int.cjs.js → get-random-int.cjs} +6 -0
  37. package/dist/libs/get/get-random-int.d.ts +5 -1
  38. package/dist/libs/get/get-random-int.es.js +6 -0
  39. package/dist/libs/get/{get-rem.cjs.js → get-rem.cjs} +1 -0
  40. package/dist/libs/get/get-rem.d.ts +1 -0
  41. package/dist/libs/get/get-rem.es.js +1 -0
  42. package/dist/libs/get/get-scrollbar-width.cjs +7 -0
  43. package/dist/libs/get/get-scrollbar-width.d.ts +1 -0
  44. package/dist/libs/get/get-scrollbar-width.es.js +4 -1
  45. package/dist/libs/get/{get-style-property-value-to-number.cjs.js → get-style-property-value-to-number.cjs} +1 -1
  46. package/dist/libs/get/get-style-property-value.cjs +7 -0
  47. package/dist/libs/get/get-style-property-value.d.ts +1 -0
  48. package/dist/libs/get/get-style-property-value.es.js +4 -1
  49. package/dist/libs/get/{get-ua-data.cjs.js → get-ua-data.cjs} +1 -1
  50. package/dist/libs/get/{index.cjs.js → index.cjs} +19 -19
  51. package/dist/libs/is/{check-device-size.cjs.js → check-device-size.cjs} +1 -1
  52. package/dist/libs/is/{index.cjs.js → index.cjs} +11 -11
  53. package/dist/libs/is/{is-between-date-time.cjs.js → is-between-date-time.cjs} +2 -2
  54. package/dist/libs/is/is-between-date-time.es.js +1 -1
  55. package/dist/libs/is/{is-ipad.cjs.js → is-ipad.cjs} +2 -2
  56. package/dist/libs/is/{is-safari.cjs.js → is-safari.cjs} +1 -1
  57. package/dist/libs/remove/{index.cjs.js → index.cjs} +4 -4
  58. package/dist/libs/remove/remove-all-html-tags.d.ts +7 -1
  59. package/dist/libs/remove/{remove-style-property-value.cjs.js → remove-style-property-value.cjs} +1 -0
  60. package/dist/libs/remove/remove-style-property-value.d.ts +1 -0
  61. package/dist/libs/remove/remove-style-property-value.es.js +1 -0
  62. package/dist/libs/security/{html-sanitize.cjs.js → html-sanitize.cjs} +7 -1
  63. package/dist/libs/security/html-sanitize.d.ts +8 -0
  64. package/dist/libs/security/html-sanitize.es.js +7 -1
  65. package/dist/libs/security/{index.cjs.js → index.cjs} +1 -1
  66. package/dist/libs/set/{index.cjs.js → index.cjs} +6 -6
  67. package/dist/libs/set/{set-100vh.cjs.js → set-100vh.cjs} +1 -0
  68. package/dist/libs/set/set-100vh.d.ts +1 -0
  69. package/dist/libs/set/set-100vh.es.js +1 -0
  70. package/dist/libs/set/{set-100vw.cjs.js → set-100vw.cjs} +1 -0
  71. package/dist/libs/set/set-100vw.d.ts +1 -0
  72. package/dist/libs/set/set-100vw.es.js +1 -0
  73. package/dist/libs/set/{set-style-property-value.cjs.js → set-style-property-value.cjs} +1 -0
  74. package/dist/libs/set/set-style-property-value.d.ts +1 -0
  75. package/dist/libs/set/set-style-property-value.es.js +1 -0
  76. package/dist/libs/to/{index.cjs.js → index.cjs} +2 -2
  77. package/dist/libs/transform/{index.cjs.js → index.cjs} +1 -1
  78. package/dist/libs/wait/{index.cjs.js → index.cjs} +2 -2
  79. package/dist/libs/wait/{wait-for-all-media-loaded.cjs.js → wait-for-all-media-loaded.cjs} +2 -3
  80. package/dist/libs/wait/wait-for-all-media-loaded.d.ts +1 -0
  81. package/dist/libs/wait/wait-for-all-media-loaded.es.js +2 -3
  82. package/package.json +30 -31
  83. package/dist/_virtual/_commonjsHelpers.cjs.js +0 -6
  84. package/dist/_virtual/_commonjsHelpers.es.js +0 -6
  85. package/dist/_virtual/isBetween.cjs.js +0 -7
  86. package/dist/_virtual/isBetween.cjs2.js +0 -4
  87. package/dist/_virtual/isBetween.es.js +0 -7
  88. package/dist/_virtual/isBetween.es2.js +0 -4
  89. package/dist/_virtual/timezone.cjs.js +0 -7
  90. package/dist/_virtual/timezone.cjs2.js +0 -4
  91. package/dist/_virtual/timezone.es.js +0 -7
  92. package/dist/_virtual/timezone.es2.js +0 -4
  93. package/dist/_virtual/utc.cjs.js +0 -7
  94. package/dist/_virtual/utc.cjs2.js +0 -4
  95. package/dist/_virtual/utc.es.js +0 -7
  96. package/dist/_virtual/utc.es2.js +0 -4
  97. package/dist/libs/config/set-config.cjs.js +0 -8
  98. package/dist/libs/get/get-document-height.cjs.js +0 -4
  99. package/dist/libs/get/get-scrollbar-width.cjs.js +0 -4
  100. package/dist/libs/get/get-style-property-value.cjs.js +0 -4
  101. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isBetween.cjs.js +0 -23
  102. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isBetween.es.js +0 -23
  103. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.cjs.js +0 -71
  104. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.es.js +0 -71
  105. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.cjs.js +0 -83
  106. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.es.js +0 -83
  107. /package/dist/libs/callback/{tap-async.cjs.js → tap-async.cjs} +0 -0
  108. /package/dist/libs/callback/{tap.cjs.js → tap.cjs} +0 -0
  109. /package/dist/libs/config/{default-config.cjs.js → default-config.cjs} +0 -0
  110. /package/dist/libs/control/{copy-to-clipboard.cjs.js → copy-to-clipboard.cjs} +0 -0
  111. /package/dist/libs/control/{pd.cjs.js → pd.cjs} +0 -0
  112. /package/dist/libs/convert/{hex-to-rgb.cjs.js → hex-to-rgb.cjs} +0 -0
  113. /package/dist/libs/convert/{json-string-to-json-object.cjs.js → json-string-to-json-object.cjs} +0 -0
  114. /package/dist/libs/convert/{rgb-to-hex.cjs.js → rgb-to-hex.cjs} +0 -0
  115. /package/dist/libs/eventControl/{debounce.cjs.js → debounce.cjs} +0 -0
  116. /package/dist/libs/eventControl/{throttle.cjs.js → throttle.cjs} +0 -0
  117. /package/dist/libs/get/{get-class-names.cjs.js → get-class-names.cjs} +0 -0
  118. /package/dist/libs/get/{get-event-paths.cjs.js → get-event-paths.cjs} +0 -0
  119. /package/dist/libs/get/{get-orientation.cjs.js → get-orientation.cjs} +0 -0
  120. /package/dist/libs/get/{get-parent-list.cjs.js → get-parent-list.cjs} +0 -0
  121. /package/dist/libs/get/{get-relative-time.cjs.js → get-relative-time.cjs} +0 -0
  122. /package/dist/libs/get/{get-rendered-line-height.cjs.js → get-rendered-line-height.cjs} +0 -0
  123. /package/dist/libs/get/{get-session-storage.cjs.js → get-session-storage.cjs} +0 -0
  124. /package/dist/libs/get/{get-string-length.cjs.js → get-string-length.cjs} +0 -0
  125. /package/dist/libs/is/{is-after-date-time.cjs.js → is-after-date-time.cjs} +0 -0
  126. /package/dist/libs/is/{is-exist-all-elements.cjs.js → is-exist-all-elements.cjs} +0 -0
  127. /package/dist/libs/is/{is-in-viewport.cjs.js → is-in-viewport.cjs} +0 -0
  128. /package/dist/libs/is/{is-key-exists.cjs.js → is-key-exists.cjs} +0 -0
  129. /package/dist/libs/is/{is-online.cjs.js → is-online.cjs} +0 -0
  130. /package/dist/libs/is/{is-scrollable.cjs.js → is-scrollable.cjs} +0 -0
  131. /package/dist/libs/is/{is-touch-support.cjs.js → is-touch-support.cjs} +0 -0
  132. /package/dist/libs/remove/{remove-all-html-tags.cjs.js → remove-all-html-tags.cjs} +0 -0
  133. /package/dist/libs/remove/{remove-attribute.cjs.js → remove-attribute.cjs} +0 -0
  134. /package/dist/libs/remove/{remove-session-storage.cjs.js → remove-session-storage.cjs} +0 -0
  135. /package/dist/libs/set/{set-attribute.cjs.js → set-attribute.cjs} +0 -0
  136. /package/dist/libs/set/{set-scroll-position-to-center.cjs.js → set-scroll-position-to-center.cjs} +0 -0
  137. /package/dist/libs/set/{set-session-storage.cjs.js → set-session-storage.cjs} +0 -0
  138. /package/dist/libs/to/{to-boolean.cjs.js → to-boolean.cjs} +0 -0
  139. /package/dist/libs/to/{to-positive-number.cjs.js → to-positive-number.cjs} +0 -0
  140. /package/dist/libs/transform/{wrap-text-with-spans.cjs.js → wrap-text-with-spans.cjs} +0 -0
  141. /package/dist/libs/wait/{sleep.cjs.js → sleep.cjs} +0 -0
@@ -1,4 +1,5 @@
1
1
  const getRem = (px) => {
2
+ if (typeof window === "undefined") return `${px / 16}rem`;
2
3
  const rootFontSize = parseFloat(
3
4
  getComputedStyle(document.documentElement).fontSize
4
5
  );
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const getScrollbarWidth = () => {
4
+ if (typeof window === "undefined") return 0;
5
+ return window.innerWidth - document.documentElement.clientWidth;
6
+ };
7
+ exports.getScrollbarWidth = getScrollbarWidth;
@@ -5,5 +5,6 @@
5
5
  * to ensure accurate measurement regardless of body element styling (e.g., max-width, margin).
6
6
  *
7
7
  * @returns {number} The width of the scrollbar in pixels.
8
+ * Returns 0 in SSR environments where window is undefined.
8
9
  */
9
10
  export declare const getScrollbarWidth: () => number;
@@ -1,4 +1,7 @@
1
- const getScrollbarWidth = () => window.innerWidth - document.documentElement.clientWidth;
1
+ const getScrollbarWidth = () => {
2
+ if (typeof window === "undefined") return 0;
3
+ return window.innerWidth - document.documentElement.clientWidth;
4
+ };
2
5
  export {
3
6
  getScrollbarWidth
4
7
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const getStylePropertyValue = require("./get-style-property-value.cjs.js");
3
+ const getStylePropertyValue = require("./get-style-property-value.cjs");
4
4
  const getStylePropertyValueToNumber = (key) => Number.parseFloat(getStylePropertyValue.getStylePropertyValue(key)) || 0;
5
5
  exports.getStylePropertyValueToNumber = getStylePropertyValueToNumber;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const getStylePropertyValue = (key) => {
4
+ if (typeof window === "undefined") return "";
5
+ return getComputedStyle(document.documentElement).getPropertyValue(key);
6
+ };
7
+ exports.getStylePropertyValue = getStylePropertyValue;
@@ -3,5 +3,6 @@
3
3
  *
4
4
  * @param key - The name of the CSS custom property to retrieve.
5
5
  * @returns The value of the specified CSS custom property.
6
+ * Returns an empty string in SSR environments where window is undefined.
6
7
  */
7
8
  export declare const getStylePropertyValue: (key: string) => string;
@@ -1,4 +1,7 @@
1
- const getStylePropertyValue = (key) => getComputedStyle(document.documentElement).getPropertyValue(key);
1
+ const getStylePropertyValue = (key) => {
2
+ if (typeof window === "undefined") return "";
3
+ return getComputedStyle(document.documentElement).getPropertyValue(key);
4
+ };
2
5
  export {
3
6
  getStylePropertyValue
4
7
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const isTouchSupport = require("../is/is-touch-support.cjs.js");
3
+ const isTouchSupport = require("../is/is-touch-support.cjs");
4
4
  const UAParser = require("ua-parser-js");
5
5
  const getUaData = () => {
6
6
  const parser = new UAParser();
@@ -1,24 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const getAspectRatio = require("./get-aspect-ratio.cjs.js");
4
- const getClassNames = require("./get-class-names.cjs.js");
5
- const getDocumentHeight = require("./get-document-height.cjs.js");
6
- const getEventPaths = require("./get-event-paths.cjs.js");
7
- const getGcd = require("./get-gcd.cjs.js");
8
- const getGravatarUrl = require("./get-gravatar-url.cjs.js");
9
- const getOrientation = require("./get-orientation.cjs.js");
10
- const getParentList = require("./get-parent-list.cjs.js");
11
- const getQueryParams = require("./get-query-params.cjs.js");
12
- const getRandomInt = require("./get-random-int.cjs.js");
13
- const getRelativeTime = require("./get-relative-time.cjs.js");
14
- const getRem = require("./get-rem.cjs.js");
15
- const getRenderedLineHeight = require("./get-rendered-line-height.cjs.js");
16
- const getScrollbarWidth = require("./get-scrollbar-width.cjs.js");
17
- const getSessionStorage = require("./get-session-storage.cjs.js");
18
- const getStringLength = require("./get-string-length.cjs.js");
19
- const getStylePropertyValue = require("./get-style-property-value.cjs.js");
20
- const getStylePropertyValueToNumber = require("./get-style-property-value-to-number.cjs.js");
21
- const getUaData = require("./get-ua-data.cjs.js");
3
+ const getAspectRatio = require("./get-aspect-ratio.cjs");
4
+ const getClassNames = require("./get-class-names.cjs");
5
+ const getDocumentHeight = require("./get-document-height.cjs");
6
+ const getEventPaths = require("./get-event-paths.cjs");
7
+ const getGcd = require("./get-gcd.cjs");
8
+ const getGravatarUrl = require("./get-gravatar-url.cjs");
9
+ const getOrientation = require("./get-orientation.cjs");
10
+ const getParentList = require("./get-parent-list.cjs");
11
+ const getQueryParams = require("./get-query-params.cjs");
12
+ const getRandomInt = require("./get-random-int.cjs");
13
+ const getRelativeTime = require("./get-relative-time.cjs");
14
+ const getRem = require("./get-rem.cjs");
15
+ const getRenderedLineHeight = require("./get-rendered-line-height.cjs");
16
+ const getScrollbarWidth = require("./get-scrollbar-width.cjs");
17
+ const getSessionStorage = require("./get-session-storage.cjs");
18
+ const getStringLength = require("./get-string-length.cjs");
19
+ const getStylePropertyValue = require("./get-style-property-value.cjs");
20
+ const getStylePropertyValueToNumber = require("./get-style-property-value-to-number.cjs");
21
+ const getUaData = require("./get-ua-data.cjs");
22
22
  exports.getAspectRatio = getAspectRatio.getAspectRatio;
23
23
  exports.getClassNames = getClassNames.getClassNames;
24
24
  exports.getDocumentHeight = getDocumentHeight.getDocumentHeight;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const getConfig = require("../config/get-config.cjs.js");
3
+ const getConfig = require("../config/get-config.cjs");
4
4
  const checkDeviceSize = () => {
5
5
  const breakpoint = getConfig.getConfigValue("BREAKPOINT");
6
6
  if (typeof window !== "undefined") {
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const checkDeviceSize = require("./check-device-size.cjs.js");
4
- const isAfterDateTime = require("./is-after-date-time.cjs.js");
5
- const isBetweenDateTime = require("./is-between-date-time.cjs.js");
6
- const isExistAllElements = require("./is-exist-all-elements.cjs.js");
7
- const isInViewport = require("./is-in-viewport.cjs.js");
8
- const isIpad = require("./is-ipad.cjs.js");
9
- const isKeyExists = require("./is-key-exists.cjs.js");
10
- const isOnline = require("./is-online.cjs.js");
11
- const isSafari = require("./is-safari.cjs.js");
12
- const isScrollable = require("./is-scrollable.cjs.js");
13
- const isTouchSupport = require("./is-touch-support.cjs.js");
3
+ const checkDeviceSize = require("./check-device-size.cjs");
4
+ const isAfterDateTime = require("./is-after-date-time.cjs");
5
+ const isBetweenDateTime = require("./is-between-date-time.cjs");
6
+ const isExistAllElements = require("./is-exist-all-elements.cjs");
7
+ const isInViewport = require("./is-in-viewport.cjs");
8
+ const isIpad = require("./is-ipad.cjs");
9
+ const isKeyExists = require("./is-key-exists.cjs");
10
+ const isOnline = require("./is-online.cjs");
11
+ const isSafari = require("./is-safari.cjs");
12
+ const isScrollable = require("./is-scrollable.cjs");
13
+ const isTouchSupport = require("./is-touch-support.cjs");
14
14
  exports.checkDeviceSize = checkDeviceSize.checkDeviceSize;
15
15
  exports.isAfterDateTime = isAfterDateTime.isAfterDateTime;
16
16
  exports.isBetweenDateTime = isBetweenDateTime.isBetweenDateTime;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const dayjs = require("dayjs");
4
- const isBetween = require("../../_virtual/isBetween.cjs.js");
5
- dayjs.extend(isBetween.default);
4
+ const isBetween = require("dayjs/plugin/isBetween.js");
5
+ dayjs.extend(isBetween);
6
6
  const isBetweenDateTime = (dateA, dateB, now = dayjs()) => {
7
7
  if (!dayjs(dateA).isValid() || !dayjs(dateB).isValid()) {
8
8
  throw new Error("dateA or dateB is not valid date");
@@ -1,5 +1,5 @@
1
1
  import dayjs from "dayjs";
2
- import isBetween from "../../_virtual/isBetween.es.js";
2
+ import isBetween from "dayjs/plugin/isBetween.js";
3
3
  dayjs.extend(isBetween);
4
4
  const isBetweenDateTime = (dateA, dateB, now = dayjs()) => {
5
5
  if (!dayjs(dateA).isValid() || !dayjs(dateB).isValid()) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const getOrientation = require("../get/get-orientation.cjs.js");
4
- const getUaData = require("../get/get-ua-data.cjs.js");
3
+ const getOrientation = require("../get/get-orientation.cjs");
4
+ const getUaData = require("../get/get-ua-data.cjs");
5
5
  const isIpad = (orientation = "portrait") => {
6
6
  if (typeof window === "undefined" || typeof navigator === "undefined") {
7
7
  return false;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const getUaData = require("../get/get-ua-data.cjs.js");
3
+ const getUaData = require("../get/get-ua-data.cjs");
4
4
  const isSafari = (includeMobileSafari = true) => {
5
5
  const clientData = getUaData.getUaData();
6
6
  if (includeMobileSafari) {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const removeAllHtmlTags = require("./remove-all-html-tags.cjs.js");
4
- const removeAttribute = require("./remove-attribute.cjs.js");
5
- const removeSessionStorage = require("./remove-session-storage.cjs.js");
6
- const removeStylePropertyValue = require("./remove-style-property-value.cjs.js");
3
+ const removeAllHtmlTags = require("./remove-all-html-tags.cjs");
4
+ const removeAttribute = require("./remove-attribute.cjs");
5
+ const removeSessionStorage = require("./remove-session-storage.cjs");
6
+ const removeStylePropertyValue = require("./remove-style-property-value.cjs");
7
7
  exports.removeAllHtmlTags = removeAllHtmlTags.removeAllHtmlTags;
8
8
  exports.removeAttribute = removeAttribute.removeAttribute;
9
9
  exports.removeSessionStorage = removeSessionStorage.removeSessionStorage;
@@ -1,7 +1,13 @@
1
1
  /**
2
2
  * Removes all HTML tags from the given string.
3
3
  *
4
+ * The result is an HTML string, not plain text: when the input contains `<`,
5
+ * special characters are escaped (e.g. `&` becomes `&amp;`); otherwise the input is returned as is.
6
+ * It is safe to insert as HTML (e.g. `innerHTML`), but entities may appear when assigned to `textContent`.
7
+ * Do not decode the result and then insert it as HTML.
8
+ * To keep safe markup instead of removing it, use `sanitizeHtml`.
9
+ *
4
10
  * @param string - The input string from which HTML tags should be removed.
5
- * @returns The sanitized string with all HTML tags removed.
11
+ * @returns The HTML string with all HTML tags removed.
6
12
  */
7
13
  export declare const removeAllHtmlTags: (string: string) => string;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const removeStylePropertyValue = (key) => {
4
+ if (typeof window === "undefined") return;
4
5
  document.documentElement.style.removeProperty(key);
5
6
  };
6
7
  exports.removeStylePropertyValue = removeStylePropertyValue;
@@ -2,5 +2,6 @@
2
2
  * Removes a CSS custom property from the root element.
3
3
  *
4
4
  * @param key - The name of the CSS custom property to remove.
5
+ * Does nothing in SSR environments where window is undefined.
5
6
  */
6
7
  export declare const removeStylePropertyValue: (key: string) => void;
@@ -1,4 +1,5 @@
1
1
  const removeStylePropertyValue = (key) => {
2
+ if (typeof window === "undefined") return;
2
3
  document.documentElement.style.removeProperty(key);
3
4
  };
4
5
  export {
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const DOMPurify = require("isomorphic-dompurify");
4
+ const STRING_OUTPUT_CONFIG = {
5
+ RETURN_DOM: false,
6
+ RETURN_DOM_FRAGMENT: false,
7
+ RETURN_TRUSTED_TYPE: false,
8
+ IN_PLACE: false
9
+ };
4
10
  const htmlSanitize = (html, config = {}) => {
5
- return DOMPurify.sanitize(html, config);
11
+ return DOMPurify.sanitize(html, { ...config, ...STRING_OUTPUT_CONFIG });
6
12
  };
7
13
  const sanitizeHtml = htmlSanitize;
8
14
  exports.htmlSanitize = htmlSanitize;
@@ -2,6 +2,14 @@ import { default as DOMPurify } from 'isomorphic-dompurify';
2
2
  /**
3
3
  * Sanitizes the given HTML string to prevent XSS attacks.
4
4
  *
5
+ * The result is safe to insert as HTML element content (e.g. `innerHTML`).
6
+ * It is NOT safe for other contexts such as attribute values, URLs, `<script>` or CSS.
7
+ *
8
+ * Options that weaken the default protection (e.g. `ALLOWED_URI_REGEXP`, `ADD_TAGS`,
9
+ * `ALLOW_UNKNOWN_PROTOCOLS`, `SAFE_FOR_TEMPLATES: false`) are passed through to DOMPurify as is.
10
+ * `RETURN_DOM`, `RETURN_DOM_FRAGMENT`, `RETURN_TRUSTED_TYPE` and `IN_PLACE` are ignored,
11
+ * so the return value is always a string.
12
+ *
5
13
  * @param html - The HTML string to sanitize.
6
14
  * @param config - Optional configuration for DOMPurify.
7
15
  * @returns The sanitized HTML string.
@@ -1,6 +1,12 @@
1
1
  import DOMPurify from "isomorphic-dompurify";
2
+ const STRING_OUTPUT_CONFIG = {
3
+ RETURN_DOM: false,
4
+ RETURN_DOM_FRAGMENT: false,
5
+ RETURN_TRUSTED_TYPE: false,
6
+ IN_PLACE: false
7
+ };
2
8
  const htmlSanitize = (html, config = {}) => {
3
- return DOMPurify.sanitize(html, config);
9
+ return DOMPurify.sanitize(html, { ...config, ...STRING_OUTPUT_CONFIG });
4
10
  };
5
11
  const sanitizeHtml = htmlSanitize;
6
12
  export {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const htmlSanitize = require("./html-sanitize.cjs.js");
3
+ const htmlSanitize = require("./html-sanitize.cjs");
4
4
  exports.htmlSanitize = htmlSanitize.htmlSanitize;
5
5
  exports.sanitizeHtml = htmlSanitize.sanitizeHtml;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const set100vh = require("./set-100vh.cjs.js");
4
- const set100vw = require("./set-100vw.cjs.js");
5
- const setAttribute = require("./set-attribute.cjs.js");
6
- const setScrollPositionToCenter = require("./set-scroll-position-to-center.cjs.js");
7
- const setSessionStorage = require("./set-session-storage.cjs.js");
8
- const setStylePropertyValue = require("./set-style-property-value.cjs.js");
3
+ const set100vh = require("./set-100vh.cjs");
4
+ const set100vw = require("./set-100vw.cjs");
5
+ const setAttribute = require("./set-attribute.cjs");
6
+ const setScrollPositionToCenter = require("./set-scroll-position-to-center.cjs");
7
+ const setSessionStorage = require("./set-session-storage.cjs");
8
+ const setStylePropertyValue = require("./set-style-property-value.cjs");
9
9
  exports.set100vh = set100vh.set100vh;
10
10
  exports.set100vw = set100vw.set100vw;
11
11
  exports.setAttribute = setAttribute.setAttribute;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const set100vh = (setProperty = "--vh") => {
4
+ if (typeof window === "undefined") return;
4
5
  const vh = window.innerHeight * 0.01;
5
6
  document.documentElement.style.setProperty(setProperty, `${vh}px`);
6
7
  };
@@ -7,5 +7,6 @@
7
7
  * @param {string} [setProperty='--vh'] - The name of the CSS variable to set.
8
8
  *
9
9
  * @link https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
10
+ * Does nothing in SSR environments where window is undefined.
10
11
  */
11
12
  export declare const set100vh: (setProperty?: string) => void;
@@ -1,4 +1,5 @@
1
1
  const set100vh = (setProperty = "--vh") => {
2
+ if (typeof window === "undefined") return;
2
3
  const vh = window.innerHeight * 0.01;
3
4
  document.documentElement.style.setProperty(setProperty, `${vh}px`);
4
5
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const set100vw = (setProperty = "--vw") => {
4
+ if (typeof window === "undefined") return;
4
5
  const vw = document.documentElement.clientWidth;
5
6
  document.documentElement.style.setProperty(setProperty, `${vw}px`);
6
7
  };
@@ -2,5 +2,6 @@
2
2
  * Sets a CSS variable to the value of 100vw (excluding the scrollbar width).
3
3
  *
4
4
  * @param setProperty - The name of the CSS variable to set. Defaults to '--vw'.
5
+ * Does nothing in SSR environments where window is undefined.
5
6
  */
6
7
  export declare const set100vw: (setProperty?: string) => void;
@@ -1,4 +1,5 @@
1
1
  const set100vw = (setProperty = "--vw") => {
2
+ if (typeof window === "undefined") return;
2
3
  const vw = document.documentElement.clientWidth;
3
4
  document.documentElement.style.setProperty(setProperty, `${vw}px`);
4
5
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const setStylePropertyValue = (key, value) => {
4
+ if (typeof window === "undefined") return;
4
5
  document.documentElement.style.setProperty(key, value);
5
6
  };
6
7
  exports.setStylePropertyValue = setStylePropertyValue;
@@ -3,5 +3,6 @@
3
3
  *
4
4
  * @param key - The name of the CSS custom property to set.
5
5
  * @param value - The value to set for the CSS custom property.
6
+ * Does nothing in SSR environments where window is undefined.
6
7
  */
7
8
  export declare const setStylePropertyValue: (key: string, value: string) => void;
@@ -1,4 +1,5 @@
1
1
  const setStylePropertyValue = (key, value) => {
2
+ if (typeof window === "undefined") return;
2
3
  document.documentElement.style.setProperty(key, value);
3
4
  };
4
5
  export {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const toBoolean = require("./to-boolean.cjs.js");
4
- const toPositiveNumber = require("./to-positive-number.cjs.js");
3
+ const toBoolean = require("./to-boolean.cjs");
4
+ const toPositiveNumber = require("./to-positive-number.cjs");
5
5
  exports.toBoolean = toBoolean.toBoolean;
6
6
  exports.toPositiveNumber = toPositiveNumber.toPositiveNumber;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const wrapTextWithSpans = require("./wrap-text-with-spans.cjs.js");
3
+ const wrapTextWithSpans = require("./wrap-text-with-spans.cjs");
4
4
  exports.wrapTextWithSpans = wrapTextWithSpans.wrapTextWithSpans;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sleep = require("./sleep.cjs.js");
4
- const waitForAllMediaLoaded = require("./wait-for-all-media-loaded.cjs.js");
3
+ const sleep = require("./sleep.cjs");
4
+ const waitForAllMediaLoaded = require("./wait-for-all-media-loaded.cjs");
5
5
  exports.sleep = sleep.sleep;
6
6
  exports.waitForAllMediaLoaded = waitForAllMediaLoaded.waitForAllMediaLoaded;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const waitForAllMediaLoaded = async (firstViewOnly = false) => {
4
- if (!document.images) return true;
5
- if (document.images.length === 0) return true;
6
- const images = Array.from(document.images).filter(
4
+ if (typeof window === "undefined") return true;
5
+ const images = Array.from(document.getElementsByTagName("img")).filter(
7
6
  (img) => img.getAttribute("loading") !== "lazy"
8
7
  );
9
8
  const videos = Array.from(
@@ -3,5 +3,6 @@
3
3
  *
4
4
  * @param firstViewOnly - If true, only considers media elements within the first view (viewport height).
5
5
  * @returns A promise that resolves to true when all media elements are loaded.
6
+ * Resolves to true immediately in SSR environments where window is undefined.
6
7
  */
7
8
  export declare const waitForAllMediaLoaded: (firstViewOnly?: boolean) => Promise<boolean>;
@@ -1,7 +1,6 @@
1
1
  const waitForAllMediaLoaded = async (firstViewOnly = false) => {
2
- if (!document.images) return true;
3
- if (document.images.length === 0) return true;
4
- const images = Array.from(document.images).filter(
2
+ if (typeof window === "undefined") return true;
3
+ const images = Array.from(document.getElementsByTagName("img")).filter(
5
4
  (img) => img.getAttribute("loading") !== "lazy"
6
5
  );
7
6
  const videos = Array.from(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umaki",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "A utility that is often used in web production.",
5
5
  "author": "TsubasaHiga",
6
6
  "homepage": "https://github.com/TsubasaHiga/umaki",
@@ -19,79 +19,79 @@
19
19
  "dist"
20
20
  ],
21
21
  "sideEffects": false,
22
- "main": "./dist/index.cjs.js",
22
+ "main": "./dist/index.cjs",
23
23
  "module": "./dist/index.es.js",
24
24
  "types": "./dist/index.d.ts",
25
25
  "exports": {
26
26
  ".": {
27
27
  "types": "./dist/index.d.ts",
28
28
  "import": "./dist/index.es.js",
29
- "require": "./dist/index.cjs.js"
29
+ "require": "./dist/index.cjs"
30
30
  },
31
31
  "./callback": {
32
32
  "types": "./dist/libs/callback/index.d.ts",
33
33
  "import": "./dist/libs/callback/index.es.js",
34
- "require": "./dist/libs/callback/index.cjs.js"
34
+ "require": "./dist/libs/callback/index.cjs"
35
35
  },
36
36
  "./config": {
37
37
  "types": "./dist/libs/config/index.d.ts",
38
38
  "import": "./dist/libs/config/index.es.js",
39
- "require": "./dist/libs/config/index.cjs.js"
39
+ "require": "./dist/libs/config/index.cjs"
40
40
  },
41
41
  "./control": {
42
42
  "types": "./dist/libs/control/index.d.ts",
43
43
  "import": "./dist/libs/control/index.es.js",
44
- "require": "./dist/libs/control/index.cjs.js"
44
+ "require": "./dist/libs/control/index.cjs"
45
45
  },
46
46
  "./convert": {
47
47
  "types": "./dist/libs/convert/index.d.ts",
48
48
  "import": "./dist/libs/convert/index.es.js",
49
- "require": "./dist/libs/convert/index.cjs.js"
49
+ "require": "./dist/libs/convert/index.cjs"
50
50
  },
51
51
  "./eventControl": {
52
52
  "types": "./dist/libs/eventControl/index.d.ts",
53
53
  "import": "./dist/libs/eventControl/index.es.js",
54
- "require": "./dist/libs/eventControl/index.cjs.js"
54
+ "require": "./dist/libs/eventControl/index.cjs"
55
55
  },
56
56
  "./get": {
57
57
  "types": "./dist/libs/get/index.d.ts",
58
58
  "import": "./dist/libs/get/index.es.js",
59
- "require": "./dist/libs/get/index.cjs.js"
59
+ "require": "./dist/libs/get/index.cjs"
60
60
  },
61
61
  "./is": {
62
62
  "types": "./dist/libs/is/index.d.ts",
63
63
  "import": "./dist/libs/is/index.es.js",
64
- "require": "./dist/libs/is/index.cjs.js"
64
+ "require": "./dist/libs/is/index.cjs"
65
65
  },
66
66
  "./remove": {
67
67
  "types": "./dist/libs/remove/index.d.ts",
68
68
  "import": "./dist/libs/remove/index.es.js",
69
- "require": "./dist/libs/remove/index.cjs.js"
69
+ "require": "./dist/libs/remove/index.cjs"
70
70
  },
71
71
  "./security": {
72
72
  "types": "./dist/libs/security/index.d.ts",
73
73
  "import": "./dist/libs/security/index.es.js",
74
- "require": "./dist/libs/security/index.cjs.js"
74
+ "require": "./dist/libs/security/index.cjs"
75
75
  },
76
76
  "./set": {
77
77
  "types": "./dist/libs/set/index.d.ts",
78
78
  "import": "./dist/libs/set/index.es.js",
79
- "require": "./dist/libs/set/index.cjs.js"
79
+ "require": "./dist/libs/set/index.cjs"
80
80
  },
81
81
  "./to": {
82
82
  "types": "./dist/libs/to/index.d.ts",
83
83
  "import": "./dist/libs/to/index.es.js",
84
- "require": "./dist/libs/to/index.cjs.js"
84
+ "require": "./dist/libs/to/index.cjs"
85
85
  },
86
86
  "./transform": {
87
87
  "types": "./dist/libs/transform/index.d.ts",
88
88
  "import": "./dist/libs/transform/index.es.js",
89
- "require": "./dist/libs/transform/index.cjs.js"
89
+ "require": "./dist/libs/transform/index.cjs"
90
90
  },
91
91
  "./wait": {
92
92
  "types": "./dist/libs/wait/index.d.ts",
93
93
  "import": "./dist/libs/wait/index.es.js",
94
- "require": "./dist/libs/wait/index.cjs.js"
94
+ "require": "./dist/libs/wait/index.cjs"
95
95
  }
96
96
  },
97
97
  "scripts": {
@@ -106,29 +106,28 @@
106
106
  "format": "biome format"
107
107
  },
108
108
  "dependencies": {
109
- "@types/md5": "^2.3.6",
110
- "dayjs": "^1.11.19",
111
- "image-size": "^1.1.1",
112
- "isomorphic-dompurify": "^2.33.0",
109
+ "dayjs": "^1.11.23",
110
+ "isomorphic-dompurify": "^2.36.0",
113
111
  "md5": "^2.3.0",
114
- "query-string": "^9.3.1",
115
- "runes2": "^1.1.4",
112
+ "query-string": "^9.5.1",
113
+ "runes2": "^1.1.10",
116
114
  "store2": "^2.14.4",
117
- "ua-parser-js": "^1.0.39"
115
+ "ua-parser-js": "^1.0.41"
118
116
  },
119
117
  "devDependencies": {
120
118
  "@biomejs/biome": "2.3.8",
121
- "@types/node": "^24.10.1",
119
+ "@types/md5": "^2.3.6",
120
+ "@types/node": "^24.19.2",
122
121
  "@types/ua-parser-js": "^0.7.39",
123
- "@vitest/coverage-v8": "4.0.15",
124
- "happy-dom": "^20.0.11",
125
- "jsdom": "^26.0.0",
126
- "rollup-plugin-license": "^3.6.0",
127
- "rollup-plugin-visualizer": "^6.0.5",
122
+ "@vitest/coverage-v8": "^4.1.12",
123
+ "happy-dom": "^21.0.4",
124
+ "jsdom": "^26.1.0",
125
+ "rollup-plugin-license": "^3.7.1",
126
+ "rollup-plugin-visualizer": "^6.0.11",
128
127
  "typescript": "~5.9.3",
129
- "vite": "^7.2.6",
128
+ "vite": "^7.3.7",
130
129
  "vite-plugin-dts": "^4.5.4",
131
130
  "vite-tsconfig-paths": "^5.1.4",
132
- "vitest": "^4.0.15"
131
+ "vitest": "^4.1.12"
133
132
  }
134
133
  }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- function getDefaultExportFromCjs(x) {
4
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5
- }
6
- exports.getDefaultExportFromCjs = getDefaultExportFromCjs;