umaki 0.13.1 → 0.13.2

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 (156) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +22 -0
  2. package/dist/index.cjs +137 -127
  3. package/dist/index.es.js +17 -71
  4. package/dist/libs/callback/index.cjs +15 -5
  5. package/dist/libs/callback/index.es.js +12 -4
  6. package/dist/libs/callback/tap-async.cjs +5 -6
  7. package/dist/libs/callback/tap-async.es.js +6 -7
  8. package/dist/libs/callback/tap.cjs +4 -5
  9. package/dist/libs/callback/tap.es.js +5 -6
  10. package/dist/libs/config/_internal.cjs +2 -4
  11. package/dist/libs/config/_internal.es.js +3 -4
  12. package/dist/libs/config/default-config.cjs +2 -5
  13. package/dist/libs/config/default-config.es.js +3 -6
  14. package/dist/libs/config/get-config.cjs +6 -7
  15. package/dist/libs/config/get-config.es.js +6 -8
  16. package/dist/libs/config/index.cjs +18 -8
  17. package/dist/libs/config/index.es.js +12 -6
  18. package/dist/libs/config/set-config.cjs +13 -10
  19. package/dist/libs/config/set-config.es.js +13 -10
  20. package/dist/libs/control/bg-scroll-stop.cjs +6 -7
  21. package/dist/libs/control/bg-scroll-stop.es.js +6 -7
  22. package/dist/libs/control/copy-to-clipboard.cjs +9 -12
  23. package/dist/libs/control/copy-to-clipboard.es.js +10 -13
  24. package/dist/libs/control/index.cjs +21 -11
  25. package/dist/libs/control/index.es.js +12 -7
  26. package/dist/libs/control/pd.cjs +2 -3
  27. package/dist/libs/control/pd.es.js +3 -4
  28. package/dist/libs/control/scroll-to-hash.cjs +28 -35
  29. package/dist/libs/control/scroll-to-hash.es.js +29 -36
  30. package/dist/libs/control/video-play-control.cjs +17 -20
  31. package/dist/libs/control/video-play-control.es.js +17 -20
  32. package/dist/libs/convert/change-date-string-to-specific-format.cjs +13 -12
  33. package/dist/libs/convert/change-date-string-to-specific-format.es.js +5 -8
  34. package/dist/libs/convert/hex-to-rgb.cjs +15 -20
  35. package/dist/libs/convert/hex-to-rgb.es.js +16 -21
  36. package/dist/libs/convert/index.cjs +19 -9
  37. package/dist/libs/convert/index.es.js +12 -6
  38. package/dist/libs/convert/json-string-to-json-object.cjs +7 -8
  39. package/dist/libs/convert/json-string-to-json-object.es.js +8 -9
  40. package/dist/libs/convert/rgb-to-hex.cjs +6 -7
  41. package/dist/libs/convert/rgb-to-hex.es.js +7 -8
  42. package/dist/libs/eventControl/debounce.cjs +11 -14
  43. package/dist/libs/eventControl/debounce.es.js +12 -15
  44. package/dist/libs/eventControl/index.cjs +15 -5
  45. package/dist/libs/eventControl/index.es.js +12 -4
  46. package/dist/libs/eventControl/throttle.cjs +11 -14
  47. package/dist/libs/eventControl/throttle.es.js +12 -15
  48. package/dist/libs/get/get-aspect-ratio.cjs +9 -9
  49. package/dist/libs/get/get-aspect-ratio.es.js +9 -9
  50. package/dist/libs/get/get-class-names.cjs +3 -5
  51. package/dist/libs/get/get-class-names.es.js +4 -6
  52. package/dist/libs/get/get-document-height.cjs +4 -5
  53. package/dist/libs/get/get-document-height.es.js +5 -6
  54. package/dist/libs/get/get-event-paths.cjs +16 -21
  55. package/dist/libs/get/get-event-paths.es.js +17 -22
  56. package/dist/libs/get/get-gcd.cjs +8 -11
  57. package/dist/libs/get/get-gcd.es.js +8 -11
  58. package/dist/libs/get/get-gravatar-url.cjs +8 -10
  59. package/dist/libs/get/get-gravatar-url.es.js +6 -10
  60. package/dist/libs/get/get-orientation.cjs +4 -8
  61. package/dist/libs/get/get-orientation.es.js +5 -9
  62. package/dist/libs/get/get-parent-list.cjs +5 -6
  63. package/dist/libs/get/get-parent-list.es.js +6 -7
  64. package/dist/libs/get/get-query-params.cjs +19 -20
  65. package/dist/libs/get/get-query-params.es.js +18 -21
  66. package/dist/libs/get/get-random-int.cjs +8 -15
  67. package/dist/libs/get/get-random-int.es.js +9 -16
  68. package/dist/libs/get/get-relative-time.cjs +41 -25
  69. package/dist/libs/get/get-relative-time.es.js +42 -26
  70. package/dist/libs/get/get-rem.cjs +4 -8
  71. package/dist/libs/get/get-rem.es.js +5 -9
  72. package/dist/libs/get/get-rendered-line-height.cjs +49 -54
  73. package/dist/libs/get/get-rendered-line-height.es.js +50 -55
  74. package/dist/libs/get/get-scrollbar-width.cjs +4 -5
  75. package/dist/libs/get/get-scrollbar-width.es.js +5 -6
  76. package/dist/libs/get/get-session-storage.cjs +8 -7
  77. package/dist/libs/get/get-session-storage.es.js +6 -7
  78. package/dist/libs/get/get-string-length.cjs +3 -4
  79. package/dist/libs/get/get-string-length.es.js +3 -4
  80. package/dist/libs/get/get-style-property-value-to-number.cjs +3 -4
  81. package/dist/libs/get/get-style-property-value-to-number.es.js +3 -4
  82. package/dist/libs/get/get-style-property-value.cjs +4 -5
  83. package/dist/libs/get/get-style-property-value.es.js +5 -6
  84. package/dist/libs/get/get-ua-data.cjs +20 -21
  85. package/dist/libs/get/get-ua-data.es.js +17 -20
  86. package/dist/libs/get/index.cjs +49 -39
  87. package/dist/libs/get/index.es.js +14 -23
  88. package/dist/libs/is/check-device-size.cjs +6 -9
  89. package/dist/libs/is/check-device-size.es.js +6 -9
  90. package/dist/libs/is/index.cjs +33 -23
  91. package/dist/libs/is/index.es.js +13 -14
  92. package/dist/libs/is/is-after-date-time.cjs +7 -8
  93. package/dist/libs/is/is-after-date-time.es.js +5 -8
  94. package/dist/libs/is/is-between-date-time.cjs +12 -12
  95. package/dist/libs/is/is-between-date-time.es.js +7 -10
  96. package/dist/libs/is/is-exist-all-elements.cjs +3 -4
  97. package/dist/libs/is/is-exist-all-elements.es.js +4 -5
  98. package/dist/libs/is/is-in-viewport.cjs +60 -63
  99. package/dist/libs/is/is-in-viewport.es.js +61 -64
  100. package/dist/libs/is/is-ipad.cjs +8 -11
  101. package/dist/libs/is/is-ipad.es.js +7 -10
  102. package/dist/libs/is/is-key-exists.cjs +3 -4
  103. package/dist/libs/is/is-key-exists.es.js +4 -5
  104. package/dist/libs/is/is-online.cjs +4 -7
  105. package/dist/libs/is/is-online.es.js +5 -8
  106. package/dist/libs/is/is-safari.cjs +6 -9
  107. package/dist/libs/is/is-safari.es.js +6 -9
  108. package/dist/libs/is/is-scrollable.cjs +5 -6
  109. package/dist/libs/is/is-scrollable.es.js +6 -7
  110. package/dist/libs/is/is-touch-support.cjs +7 -9
  111. package/dist/libs/is/is-touch-support.es.js +8 -10
  112. package/dist/libs/remove/index.cjs +19 -9
  113. package/dist/libs/remove/index.es.js +12 -6
  114. package/dist/libs/remove/remove-all-html-tags.cjs +10 -10
  115. package/dist/libs/remove/remove-all-html-tags.es.js +8 -10
  116. package/dist/libs/remove/remove-attribute.cjs +3 -4
  117. package/dist/libs/remove/remove-attribute.es.js +4 -5
  118. package/dist/libs/remove/remove-session-storage.cjs +6 -5
  119. package/dist/libs/remove/remove-session-storage.es.js +4 -5
  120. package/dist/libs/remove/remove-style-property-value.cjs +4 -5
  121. package/dist/libs/remove/remove-style-property-value.es.js +5 -6
  122. package/dist/libs/security/html-sanitize.cjs +15 -11
  123. package/dist/libs/security/html-sanitize.es.js +13 -12
  124. package/dist/libs/security/index.cjs +14 -4
  125. package/dist/libs/security/index.es.js +12 -5
  126. package/dist/libs/set/index.cjs +23 -13
  127. package/dist/libs/set/index.es.js +12 -8
  128. package/dist/libs/set/set-100vh.cjs +5 -6
  129. package/dist/libs/set/set-100vh.es.js +6 -7
  130. package/dist/libs/set/set-100vw.cjs +5 -6
  131. package/dist/libs/set/set-100vw.es.js +6 -7
  132. package/dist/libs/set/set-attribute.cjs +3 -4
  133. package/dist/libs/set/set-attribute.es.js +4 -5
  134. package/dist/libs/set/set-scroll-position-to-center.cjs +9 -8
  135. package/dist/libs/set/set-scroll-position-to-center.es.js +10 -9
  136. package/dist/libs/set/set-session-storage.cjs +6 -5
  137. package/dist/libs/set/set-session-storage.es.js +4 -5
  138. package/dist/libs/set/set-style-property-value.cjs +4 -5
  139. package/dist/libs/set/set-style-property-value.es.js +5 -6
  140. package/dist/libs/to/index.cjs +15 -5
  141. package/dist/libs/to/index.es.js +12 -4
  142. package/dist/libs/to/to-boolean.cjs +3 -4
  143. package/dist/libs/to/to-boolean.es.js +4 -5
  144. package/dist/libs/to/to-positive-number.cjs +2 -3
  145. package/dist/libs/to/to-positive-number.es.js +3 -4
  146. package/dist/libs/transform/index.cjs +13 -3
  147. package/dist/libs/transform/index.es.js +12 -4
  148. package/dist/libs/transform/wrap-text-with-spans.cjs +15 -20
  149. package/dist/libs/transform/wrap-text-with-spans.es.js +15 -20
  150. package/dist/libs/wait/index.cjs +15 -5
  151. package/dist/libs/wait/index.es.js +12 -4
  152. package/dist/libs/wait/sleep.cjs +3 -4
  153. package/dist/libs/wait/sleep.es.js +4 -5
  154. package/dist/libs/wait/wait-for-all-media-loaded.cjs +29 -41
  155. package/dist/libs/wait/wait-for-all-media-loaded.es.js +30 -42
  156. package/package.json +14 -11
@@ -1,23 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const queryString = require("query-string");
4
- const queryStringOptions = {
5
- arrayFormat: "comma",
6
- parseNumbers: true
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ let query_string = require("query-string");
3
+ query_string = require_runtime.__toESM(query_string, 1);
4
+ // src/libs/get/get-query-params.ts
5
+ var queryString = "parse" in query_string.default ? query_string.default : query_string.default.default;
6
+ var queryStringOptions = {
7
+ arrayFormat: "comma",
8
+ parseNumbers: true
7
9
  };
8
- const getQueryParams = (query, options = {}) => {
9
- const {
10
- searchString = typeof window === "undefined" ? "" : window.location.search,
11
- parseOptions
12
- } = options;
13
- const queryOptions = {
14
- ...queryStringOptions,
15
- ...parseOptions
16
- };
17
- const queryParsed = queryString.parse(searchString, queryOptions);
18
- if (!queryParsed) return null;
19
- const params = queryParsed[query];
20
- if (params === null || params === void 0) return null;
21
- return params;
10
+ var getQueryParams = (query, options = {}) => {
11
+ const { searchString = typeof window === "undefined" ? "" : window.location.search, parseOptions } = options;
12
+ const queryOptions = {
13
+ ...queryStringOptions,
14
+ ...parseOptions
15
+ };
16
+ const queryParsed = queryString.parse(searchString, queryOptions);
17
+ if (!queryParsed) return null;
18
+ const params = queryParsed[query];
19
+ if (params === null || params === void 0) return null;
20
+ return params;
22
21
  };
23
22
  exports.getQueryParams = getQueryParams;
@@ -1,23 +1,20 @@
1
- import queryString from "query-string";
2
- const queryStringOptions = {
3
- arrayFormat: "comma",
4
- parseNumbers: true
1
+ import queryStringImport from "query-string";
2
+ // src/libs/get/get-query-params.ts
3
+ var queryString = "parse" in queryStringImport ? queryStringImport : queryStringImport.default;
4
+ var queryStringOptions = {
5
+ arrayFormat: "comma",
6
+ parseNumbers: true
5
7
  };
6
- const getQueryParams = (query, options = {}) => {
7
- const {
8
- searchString = typeof window === "undefined" ? "" : window.location.search,
9
- parseOptions
10
- } = options;
11
- const queryOptions = {
12
- ...queryStringOptions,
13
- ...parseOptions
14
- };
15
- const queryParsed = queryString.parse(searchString, queryOptions);
16
- if (!queryParsed) return null;
17
- const params = queryParsed[query];
18
- if (params === null || params === void 0) return null;
19
- return params;
20
- };
21
- export {
22
- getQueryParams
8
+ var getQueryParams = (query, options = {}) => {
9
+ const { searchString = typeof window === "undefined" ? "" : window.location.search, parseOptions } = options;
10
+ const queryOptions = {
11
+ ...queryStringOptions,
12
+ ...parseOptions
13
+ };
14
+ const queryParsed = queryString.parse(searchString, queryOptions);
15
+ if (!queryParsed) return null;
16
+ const params = queryParsed[query];
17
+ if (params === null || params === void 0) return null;
18
+ return params;
23
19
  };
20
+ export { getQueryParams };
@@ -1,17 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const getRandomInt = (min, max) => {
4
- if (!Number.isFinite(min) || !Number.isFinite(max)) {
5
- throw new Error("min and max must be finite numbers");
6
- }
7
- if (min > max) {
8
- throw new Error("min must be less than or equal to max");
9
- }
10
- const minCeiled = Math.ceil(min);
11
- const maxFloored = Math.floor(max);
12
- if (minCeiled > maxFloored) {
13
- throw new Error("No integer exists between min and max");
14
- }
15
- return Math.floor(Math.random() * (maxFloored - minCeiled + 1)) + minCeiled;
1
+ // src/libs/get/get-random-int.ts
2
+ var getRandomInt = (min, max) => {
3
+ if (!Number.isFinite(min) || !Number.isFinite(max)) throw new Error("min and max must be finite numbers");
4
+ if (min > max) throw new Error("min must be less than or equal to max");
5
+ const minCeiled = Math.ceil(min);
6
+ const maxFloored = Math.floor(max);
7
+ if (minCeiled > maxFloored) throw new Error("No integer exists between min and max");
8
+ return Math.floor(Math.random() * (maxFloored - minCeiled + 1)) + minCeiled;
16
9
  };
17
10
  exports.getRandomInt = getRandomInt;
@@ -1,17 +1,10 @@
1
- const getRandomInt = (min, max) => {
2
- if (!Number.isFinite(min) || !Number.isFinite(max)) {
3
- throw new Error("min and max must be finite numbers");
4
- }
5
- if (min > max) {
6
- throw new Error("min must be less than or equal to max");
7
- }
8
- const minCeiled = Math.ceil(min);
9
- const maxFloored = Math.floor(max);
10
- if (minCeiled > maxFloored) {
11
- throw new Error("No integer exists between min and max");
12
- }
13
- return Math.floor(Math.random() * (maxFloored - minCeiled + 1)) + minCeiled;
14
- };
15
- export {
16
- getRandomInt
1
+ // src/libs/get/get-random-int.ts
2
+ var getRandomInt = (min, max) => {
3
+ if (!Number.isFinite(min) || !Number.isFinite(max)) throw new Error("min and max must be finite numbers");
4
+ if (min > max) throw new Error("min must be less than or equal to max");
5
+ const minCeiled = Math.ceil(min);
6
+ const maxFloored = Math.floor(max);
7
+ if (minCeiled > maxFloored) throw new Error("No integer exists between min and max");
8
+ return Math.floor(Math.random() * (maxFloored - minCeiled + 1)) + minCeiled;
17
9
  };
10
+ export { getRandomInt };
@@ -1,28 +1,44 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const TIME_INTERVALS = [
4
- { unit: "year", seconds: 31536e3 },
5
- { unit: "month", seconds: 2592e3 },
6
- { unit: "week", seconds: 604800 },
7
- { unit: "day", seconds: 86400 },
8
- { unit: "hour", seconds: 3600 },
9
- { unit: "minute", seconds: 60 },
10
- { unit: "second", seconds: 1 }
1
+ // src/libs/get/get-relative-time.ts
2
+ var TIME_INTERVALS = [
3
+ {
4
+ unit: "year",
5
+ seconds: 31536e3
6
+ },
7
+ {
8
+ unit: "month",
9
+ seconds: 2592e3
10
+ },
11
+ {
12
+ unit: "week",
13
+ seconds: 604800
14
+ },
15
+ {
16
+ unit: "day",
17
+ seconds: 86400
18
+ },
19
+ {
20
+ unit: "hour",
21
+ seconds: 3600
22
+ },
23
+ {
24
+ unit: "minute",
25
+ seconds: 60
26
+ },
27
+ {
28
+ unit: "second",
29
+ seconds: 1
30
+ }
11
31
  ];
12
- const getRelativeTime = (date, locale = "ja", baseDate = /* @__PURE__ */ new Date()) => {
13
- const targetDate = date instanceof Date ? date : new Date(date);
14
- const base = baseDate instanceof Date ? baseDate : new Date(baseDate);
15
- const diffInSeconds = Math.floor(
16
- (targetDate.getTime() - base.getTime()) / 1e3
17
- );
18
- const absDiff = Math.abs(diffInSeconds);
19
- const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
20
- for (const interval of TIME_INTERVALS) {
21
- if (absDiff >= interval.seconds) {
22
- const value = Math.floor(absDiff / interval.seconds);
23
- return rtf.format(diffInSeconds >= 0 ? value : -value, interval.unit);
24
- }
25
- }
26
- return rtf.format(diffInSeconds >= 0 ? absDiff : -absDiff, "second");
32
+ var getRelativeTime = (date, locale = "ja", baseDate = /* @__PURE__ */ new Date()) => {
33
+ const targetDate = date instanceof Date ? date : new Date(date);
34
+ const base = baseDate instanceof Date ? baseDate : new Date(baseDate);
35
+ const diffInSeconds = Math.floor((targetDate.getTime() - base.getTime()) / 1e3);
36
+ const absDiff = Math.abs(diffInSeconds);
37
+ const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
38
+ for (const interval of TIME_INTERVALS) if (absDiff >= interval.seconds) {
39
+ const value = Math.floor(absDiff / interval.seconds);
40
+ return rtf.format(diffInSeconds >= 0 ? value : -value, interval.unit);
41
+ }
42
+ return rtf.format(diffInSeconds >= 0 ? absDiff : -absDiff, "second");
27
43
  };
28
44
  exports.getRelativeTime = getRelativeTime;
@@ -1,28 +1,44 @@
1
- const TIME_INTERVALS = [
2
- { unit: "year", seconds: 31536e3 },
3
- { unit: "month", seconds: 2592e3 },
4
- { unit: "week", seconds: 604800 },
5
- { unit: "day", seconds: 86400 },
6
- { unit: "hour", seconds: 3600 },
7
- { unit: "minute", seconds: 60 },
8
- { unit: "second", seconds: 1 }
1
+ // src/libs/get/get-relative-time.ts
2
+ var TIME_INTERVALS = [
3
+ {
4
+ unit: "year",
5
+ seconds: 31536e3
6
+ },
7
+ {
8
+ unit: "month",
9
+ seconds: 2592e3
10
+ },
11
+ {
12
+ unit: "week",
13
+ seconds: 604800
14
+ },
15
+ {
16
+ unit: "day",
17
+ seconds: 86400
18
+ },
19
+ {
20
+ unit: "hour",
21
+ seconds: 3600
22
+ },
23
+ {
24
+ unit: "minute",
25
+ seconds: 60
26
+ },
27
+ {
28
+ unit: "second",
29
+ seconds: 1
30
+ }
9
31
  ];
10
- const getRelativeTime = (date, locale = "ja", baseDate = /* @__PURE__ */ new Date()) => {
11
- const targetDate = date instanceof Date ? date : new Date(date);
12
- const base = baseDate instanceof Date ? baseDate : new Date(baseDate);
13
- const diffInSeconds = Math.floor(
14
- (targetDate.getTime() - base.getTime()) / 1e3
15
- );
16
- const absDiff = Math.abs(diffInSeconds);
17
- const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
18
- for (const interval of TIME_INTERVALS) {
19
- if (absDiff >= interval.seconds) {
20
- const value = Math.floor(absDiff / interval.seconds);
21
- return rtf.format(diffInSeconds >= 0 ? value : -value, interval.unit);
22
- }
23
- }
24
- return rtf.format(diffInSeconds >= 0 ? absDiff : -absDiff, "second");
25
- };
26
- export {
27
- getRelativeTime
32
+ var getRelativeTime = (date, locale = "ja", baseDate = /* @__PURE__ */ new Date()) => {
33
+ const targetDate = date instanceof Date ? date : new Date(date);
34
+ const base = baseDate instanceof Date ? baseDate : new Date(baseDate);
35
+ const diffInSeconds = Math.floor((targetDate.getTime() - base.getTime()) / 1e3);
36
+ const absDiff = Math.abs(diffInSeconds);
37
+ const rtf = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
38
+ for (const interval of TIME_INTERVALS) if (absDiff >= interval.seconds) {
39
+ const value = Math.floor(absDiff / interval.seconds);
40
+ return rtf.format(diffInSeconds >= 0 ? value : -value, interval.unit);
41
+ }
42
+ return rtf.format(diffInSeconds >= 0 ? absDiff : -absDiff, "second");
28
43
  };
44
+ export { getRelativeTime };
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const getRem = (px) => {
4
- if (typeof window === "undefined") return `${px / 16}rem`;
5
- const rootFontSize = parseFloat(
6
- getComputedStyle(document.documentElement).fontSize
7
- );
8
- return `${px / rootFontSize}rem`;
1
+ // src/libs/get/get-rem.ts
2
+ var getRem = (px) => {
3
+ if (typeof window === "undefined") return `${px / 16}rem`;
4
+ return `${px / parseFloat(getComputedStyle(document.documentElement).fontSize)}rem`;
9
5
  };
10
6
  exports.getRem = getRem;
@@ -1,10 +1,6 @@
1
- const getRem = (px) => {
2
- if (typeof window === "undefined") return `${px / 16}rem`;
3
- const rootFontSize = parseFloat(
4
- getComputedStyle(document.documentElement).fontSize
5
- );
6
- return `${px / rootFontSize}rem`;
7
- };
8
- export {
9
- getRem
1
+ // src/libs/get/get-rem.ts
2
+ var getRem = (px) => {
3
+ if (typeof window === "undefined") return `${px / 16}rem`;
4
+ return `${px / parseFloat(getComputedStyle(document.documentElement).fontSize)}rem`;
10
5
  };
6
+ export { getRem };
@@ -1,57 +1,52 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const DEFAULT_SAMPLE_LINES = 20;
4
- const MIN_SAMPLE_LINES = 2;
5
- const MAX_SAMPLE_LINES = 100;
6
- const normalizeSampleLines = (value) => {
7
- const raw = value ?? DEFAULT_SAMPLE_LINES;
8
- if (!Number.isFinite(raw)) return DEFAULT_SAMPLE_LINES;
9
- return Math.min(MAX_SAMPLE_LINES, Math.max(MIN_SAMPLE_LINES, Math.floor(raw)));
1
+ // src/libs/get/get-rendered-line-height.ts
2
+ var DEFAULT_SAMPLE_LINES = 20;
3
+ var MIN_SAMPLE_LINES = 2;
4
+ var MAX_SAMPLE_LINES = 100;
5
+ var normalizeSampleLines = (value) => {
6
+ const raw = value ?? DEFAULT_SAMPLE_LINES;
7
+ if (!Number.isFinite(raw)) return DEFAULT_SAMPLE_LINES;
8
+ return Math.min(MAX_SAMPLE_LINES, Math.max(MIN_SAMPLE_LINES, Math.floor(raw)));
10
9
  };
11
- const getRenderedLineHeight = (element, options) => {
12
- if (typeof window === "undefined") return Number.NaN;
13
- const sampleLines = normalizeSampleLines(options?.sampleLines);
14
- const ownerDocument = element.ownerDocument;
15
- const host = ownerDocument?.body;
16
- const view = ownerDocument?.defaultView;
17
- if (!host || !view) return Number.NaN;
18
- const cs = view.getComputedStyle(element);
19
- const probe = ownerDocument.createElement("div");
20
- const style = probe.style;
21
- style.position = "absolute";
22
- style.left = "-9999px";
23
- style.top = "0";
24
- style.visibility = "hidden";
25
- style.pointerEvents = "none";
26
- style.margin = "0";
27
- style.padding = "0";
28
- style.border = "0";
29
- style.whiteSpace = "pre";
30
- style.fontFamily = cs.fontFamily;
31
- style.fontSize = cs.fontSize;
32
- style.fontWeight = cs.fontWeight;
33
- style.fontStyle = cs.fontStyle;
34
- style.lineHeight = cs.lineHeight;
35
- style.letterSpacing = cs.letterSpacing;
36
- style.fontFeatureSettings = cs.fontFeatureSettings;
37
- if (cs.fontVariationSettings) {
38
- style.fontVariationSettings = cs.fontVariationSettings;
39
- }
40
- for (let i = 0; i < sampleLines; i++) {
41
- if (i > 0) probe.appendChild(ownerDocument.createElement("br"));
42
- probe.appendChild(ownerDocument.createTextNode("X"));
43
- }
44
- host.appendChild(probe);
45
- try {
46
- const probeHeight = probe.getBoundingClientRect().height;
47
- if (probeHeight <= 0) return Number.NaN;
48
- return probeHeight / sampleLines;
49
- } catch {
50
- return Number.NaN;
51
- } finally {
52
- if (probe.parentNode === host) {
53
- host.removeChild(probe);
54
- }
55
- }
10
+ var getRenderedLineHeight = (element, options) => {
11
+ if (typeof window === "undefined") return NaN;
12
+ const sampleLines = normalizeSampleLines(options?.sampleLines);
13
+ const ownerDocument = element.ownerDocument;
14
+ const host = ownerDocument?.body;
15
+ const view = ownerDocument?.defaultView;
16
+ if (!host || !view) return NaN;
17
+ const cs = view.getComputedStyle(element);
18
+ const probe = ownerDocument.createElement("div");
19
+ const style = probe.style;
20
+ style.position = "absolute";
21
+ style.left = "-9999px";
22
+ style.top = "0";
23
+ style.visibility = "hidden";
24
+ style.pointerEvents = "none";
25
+ style.margin = "0";
26
+ style.padding = "0";
27
+ style.border = "0";
28
+ style.whiteSpace = "pre";
29
+ style.fontFamily = cs.fontFamily;
30
+ style.fontSize = cs.fontSize;
31
+ style.fontWeight = cs.fontWeight;
32
+ style.fontStyle = cs.fontStyle;
33
+ style.lineHeight = cs.lineHeight;
34
+ style.letterSpacing = cs.letterSpacing;
35
+ style.fontFeatureSettings = cs.fontFeatureSettings;
36
+ if (cs.fontVariationSettings) style.fontVariationSettings = cs.fontVariationSettings;
37
+ for (let i = 0; i < sampleLines; i++) {
38
+ if (i > 0) probe.appendChild(ownerDocument.createElement("br"));
39
+ probe.appendChild(ownerDocument.createTextNode("X"));
40
+ }
41
+ host.appendChild(probe);
42
+ try {
43
+ const probeHeight = probe.getBoundingClientRect().height;
44
+ if (probeHeight <= 0) return NaN;
45
+ return probeHeight / sampleLines;
46
+ } catch {
47
+ return NaN;
48
+ } finally {
49
+ if (probe.parentNode === host) host.removeChild(probe);
50
+ }
56
51
  };
57
52
  exports.getRenderedLineHeight = getRenderedLineHeight;
@@ -1,57 +1,52 @@
1
- const DEFAULT_SAMPLE_LINES = 20;
2
- const MIN_SAMPLE_LINES = 2;
3
- const MAX_SAMPLE_LINES = 100;
4
- const normalizeSampleLines = (value) => {
5
- const raw = value ?? DEFAULT_SAMPLE_LINES;
6
- if (!Number.isFinite(raw)) return DEFAULT_SAMPLE_LINES;
7
- return Math.min(MAX_SAMPLE_LINES, Math.max(MIN_SAMPLE_LINES, Math.floor(raw)));
1
+ // src/libs/get/get-rendered-line-height.ts
2
+ var DEFAULT_SAMPLE_LINES = 20;
3
+ var MIN_SAMPLE_LINES = 2;
4
+ var MAX_SAMPLE_LINES = 100;
5
+ var normalizeSampleLines = (value) => {
6
+ const raw = value ?? DEFAULT_SAMPLE_LINES;
7
+ if (!Number.isFinite(raw)) return DEFAULT_SAMPLE_LINES;
8
+ return Math.min(MAX_SAMPLE_LINES, Math.max(MIN_SAMPLE_LINES, Math.floor(raw)));
8
9
  };
9
- const getRenderedLineHeight = (element, options) => {
10
- if (typeof window === "undefined") return Number.NaN;
11
- const sampleLines = normalizeSampleLines(options?.sampleLines);
12
- const ownerDocument = element.ownerDocument;
13
- const host = ownerDocument?.body;
14
- const view = ownerDocument?.defaultView;
15
- if (!host || !view) return Number.NaN;
16
- const cs = view.getComputedStyle(element);
17
- const probe = ownerDocument.createElement("div");
18
- const style = probe.style;
19
- style.position = "absolute";
20
- style.left = "-9999px";
21
- style.top = "0";
22
- style.visibility = "hidden";
23
- style.pointerEvents = "none";
24
- style.margin = "0";
25
- style.padding = "0";
26
- style.border = "0";
27
- style.whiteSpace = "pre";
28
- style.fontFamily = cs.fontFamily;
29
- style.fontSize = cs.fontSize;
30
- style.fontWeight = cs.fontWeight;
31
- style.fontStyle = cs.fontStyle;
32
- style.lineHeight = cs.lineHeight;
33
- style.letterSpacing = cs.letterSpacing;
34
- style.fontFeatureSettings = cs.fontFeatureSettings;
35
- if (cs.fontVariationSettings) {
36
- style.fontVariationSettings = cs.fontVariationSettings;
37
- }
38
- for (let i = 0; i < sampleLines; i++) {
39
- if (i > 0) probe.appendChild(ownerDocument.createElement("br"));
40
- probe.appendChild(ownerDocument.createTextNode("X"));
41
- }
42
- host.appendChild(probe);
43
- try {
44
- const probeHeight = probe.getBoundingClientRect().height;
45
- if (probeHeight <= 0) return Number.NaN;
46
- return probeHeight / sampleLines;
47
- } catch {
48
- return Number.NaN;
49
- } finally {
50
- if (probe.parentNode === host) {
51
- host.removeChild(probe);
52
- }
53
- }
54
- };
55
- export {
56
- getRenderedLineHeight
10
+ var getRenderedLineHeight = (element, options) => {
11
+ if (typeof window === "undefined") return NaN;
12
+ const sampleLines = normalizeSampleLines(options?.sampleLines);
13
+ const ownerDocument = element.ownerDocument;
14
+ const host = ownerDocument?.body;
15
+ const view = ownerDocument?.defaultView;
16
+ if (!host || !view) return NaN;
17
+ const cs = view.getComputedStyle(element);
18
+ const probe = ownerDocument.createElement("div");
19
+ const style = probe.style;
20
+ style.position = "absolute";
21
+ style.left = "-9999px";
22
+ style.top = "0";
23
+ style.visibility = "hidden";
24
+ style.pointerEvents = "none";
25
+ style.margin = "0";
26
+ style.padding = "0";
27
+ style.border = "0";
28
+ style.whiteSpace = "pre";
29
+ style.fontFamily = cs.fontFamily;
30
+ style.fontSize = cs.fontSize;
31
+ style.fontWeight = cs.fontWeight;
32
+ style.fontStyle = cs.fontStyle;
33
+ style.lineHeight = cs.lineHeight;
34
+ style.letterSpacing = cs.letterSpacing;
35
+ style.fontFeatureSettings = cs.fontFeatureSettings;
36
+ if (cs.fontVariationSettings) style.fontVariationSettings = cs.fontVariationSettings;
37
+ for (let i = 0; i < sampleLines; i++) {
38
+ if (i > 0) probe.appendChild(ownerDocument.createElement("br"));
39
+ probe.appendChild(ownerDocument.createTextNode("X"));
40
+ }
41
+ host.appendChild(probe);
42
+ try {
43
+ const probeHeight = probe.getBoundingClientRect().height;
44
+ if (probeHeight <= 0) return NaN;
45
+ return probeHeight / sampleLines;
46
+ } catch {
47
+ return NaN;
48
+ } finally {
49
+ if (probe.parentNode === host) host.removeChild(probe);
50
+ }
57
51
  };
52
+ export { getRenderedLineHeight };
@@ -1,7 +1,6 @@
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;
1
+ // src/libs/get/get-scrollbar-width.ts
2
+ var getScrollbarWidth = () => {
3
+ if (typeof window === "undefined") return 0;
4
+ return window.innerWidth - document.documentElement.clientWidth;
6
5
  };
7
6
  exports.getScrollbarWidth = getScrollbarWidth;
@@ -1,7 +1,6 @@
1
- const getScrollbarWidth = () => {
2
- if (typeof window === "undefined") return 0;
3
- return window.innerWidth - document.documentElement.clientWidth;
4
- };
5
- export {
6
- getScrollbarWidth
1
+ // src/libs/get/get-scrollbar-width.ts
2
+ var getScrollbarWidth = () => {
3
+ if (typeof window === "undefined") return 0;
4
+ return window.innerWidth - document.documentElement.clientWidth;
7
5
  };
6
+ export { getScrollbarWidth };
@@ -1,9 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const store = require("store2");
4
- const getSessionStorage = (key) => {
5
- const value = store.session.get(key);
6
- if (value === void 0) return null;
7
- return value;
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ let store2 = require("store2");
3
+ store2 = require_runtime.__toESM(store2, 1);
4
+ // src/libs/get/get-session-storage.ts
5
+ var getSessionStorage = (key) => {
6
+ const value = store2.default.session.get(key);
7
+ if (value === void 0) return null;
8
+ return value;
8
9
  };
9
10
  exports.getSessionStorage = getSessionStorage;
@@ -1,9 +1,8 @@
1
1
  import store from "store2";
2
- const getSessionStorage = (key) => {
3
- const value = store.session.get(key);
4
- if (value === void 0) return null;
5
- return value;
6
- };
7
- export {
8
- getSessionStorage
2
+ // src/libs/get/get-session-storage.ts
3
+ var getSessionStorage = (key) => {
4
+ const value = store.session.get(key);
5
+ if (value === void 0) return null;
6
+ return value;
9
7
  };
8
+ export { getSessionStorage };
@@ -1,5 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const runes2 = require("runes2");
4
- const getStringLength = (str) => runes2.runes(str).length;
1
+ let runes2 = require("runes2");
2
+ // src/libs/get/get-string-length.ts
3
+ var getStringLength = (str) => (0, runes2.runes)(str).length;
5
4
  exports.getStringLength = getStringLength;
@@ -1,5 +1,4 @@
1
1
  import { runes } from "runes2";
2
- const getStringLength = (str) => runes(str).length;
3
- export {
4
- getStringLength
5
- };
2
+ // src/libs/get/get-string-length.ts
3
+ var getStringLength = (str) => runes(str).length;
4
+ export { getStringLength };
@@ -1,5 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const getStylePropertyValue = require("./get-style-property-value.cjs");
4
- const getStylePropertyValueToNumber = (key) => Number.parseFloat(getStylePropertyValue.getStylePropertyValue(key)) || 0;
1
+ const require_get_style_property_value = require("./get-style-property-value.cjs");
2
+ // src/libs/get/get-style-property-value-to-number.ts
3
+ var getStylePropertyValueToNumber = (key) => Number.parseFloat(require_get_style_property_value.getStylePropertyValue(key)) || 0;
5
4
  exports.getStylePropertyValueToNumber = getStylePropertyValueToNumber;