@dynatrace/strato-components 1.6.0 → 1.7.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 (230) hide show
  1. package/buttons/button/Button.css +16 -16
  2. package/buttons/button/Button.js +1 -1
  3. package/buttons/button/Button.sty.js +4 -4
  4. package/buttons/button/Label.js +2 -2
  5. package/buttons/intent-button/IntentButton.js +1 -1
  6. package/content/progress/ProgressBar.css +71 -71
  7. package/content/progress/ProgressBar.sty.js +5 -5
  8. package/content/progress/ProgressBarIcon.css +2 -2
  9. package/content/progress/ProgressBarIcon.sty.js +1 -1
  10. package/content/progress/ProgressBarLabel.css +3 -3
  11. package/content/progress/ProgressBarLabel.js +2 -2
  12. package/content/progress/ProgressBarLabel.sty.js +1 -1
  13. package/content/progress/ProgressBarValue.css +5 -5
  14. package/content/progress/ProgressBarValue.js +2 -2
  15. package/content/progress/ProgressBarValue.sty.js +1 -1
  16. package/content/progress/ProgressCircle.css +40 -40
  17. package/content/progress/ProgressCircle.sty.js +5 -5
  18. package/content/skeleton/Skeleton.css +6 -6
  19. package/content/skeleton/Skeleton.sty.js +1 -1
  20. package/core/components/focus-scope/FocusScope.js +1 -1
  21. package/core/contexts/FocusContext.d.ts +1 -0
  22. package/core/contexts/FocusContext.js +2 -1
  23. package/core/index.d.ts +1 -4
  24. package/core/index.js +2 -8
  25. package/core/providers/FocusProvider.js +30 -4
  26. package/core/styles/focusRing.css +66 -66
  27. package/core/styles/focusRing.sty.js +2 -2
  28. package/core/utils/can-receive-default-text-format.d.ts +9 -0
  29. package/core/utils/{_is-string-children.js → can-receive-default-text-format.js} +6 -10
  30. package/core/utils/colorUtils.css +60 -60
  31. package/core/utils/colorUtils.sty.js +2 -2
  32. package/core/utils/get-inert-value.d.ts +8 -0
  33. package/core/{hooks/useId.js → utils/get-inert-value.js} +11 -13
  34. package/core/utils/isBrowser.js +1 -1
  35. package/esm/buttons/button/Button.css +16 -16
  36. package/esm/buttons/button/Button.js +1 -1
  37. package/esm/buttons/button/Button.js.map +2 -2
  38. package/esm/buttons/button/Button.sty.js +4 -4
  39. package/esm/buttons/button/Button.sty.js.map +1 -1
  40. package/esm/buttons/button/Label.js +2 -2
  41. package/esm/buttons/button/Label.js.map +2 -2
  42. package/esm/buttons/intent-button/IntentButton.js +1 -1
  43. package/esm/buttons/intent-button/IntentButton.js.map +1 -1
  44. package/esm/content/progress/ProgressBar.css +71 -71
  45. package/esm/content/progress/ProgressBar.js.map +2 -2
  46. package/esm/content/progress/ProgressBar.sty.js +5 -5
  47. package/esm/content/progress/ProgressBar.sty.js.map +1 -1
  48. package/esm/content/progress/ProgressBarIcon.css +2 -2
  49. package/esm/content/progress/ProgressBarIcon.js.map +2 -2
  50. package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
  51. package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
  52. package/esm/content/progress/ProgressBarLabel.css +3 -3
  53. package/esm/content/progress/ProgressBarLabel.js +2 -2
  54. package/esm/content/progress/ProgressBarLabel.js.map +2 -2
  55. package/esm/content/progress/ProgressBarLabel.sty.js +1 -1
  56. package/esm/content/progress/ProgressBarLabel.sty.js.map +1 -1
  57. package/esm/content/progress/ProgressBarValue.css +5 -5
  58. package/esm/content/progress/ProgressBarValue.js +2 -2
  59. package/esm/content/progress/ProgressBarValue.js.map +2 -2
  60. package/esm/content/progress/ProgressBarValue.sty.js +1 -1
  61. package/esm/content/progress/ProgressBarValue.sty.js.map +1 -1
  62. package/esm/content/progress/ProgressCircle.css +40 -40
  63. package/esm/content/progress/ProgressCircle.js.map +2 -2
  64. package/esm/content/progress/ProgressCircle.sty.js +5 -5
  65. package/esm/content/progress/ProgressCircle.sty.js.map +1 -1
  66. package/esm/content/progress/contexts/SharedProgressBarPropsContext.js.map +2 -2
  67. package/esm/content/skeleton/Skeleton.css +6 -6
  68. package/esm/content/skeleton/Skeleton.sty.js +1 -1
  69. package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
  70. package/esm/core/components/focus-scope/FocusScope.js +1 -1
  71. package/esm/core/components/focus-scope/FocusScope.js.map +2 -2
  72. package/esm/core/contexts/FocusContext.js +2 -1
  73. package/esm/core/contexts/FocusContext.js.map +2 -2
  74. package/esm/core/index.js +2 -8
  75. package/esm/core/index.js.map +2 -2
  76. package/esm/core/providers/FocusProvider.js +31 -5
  77. package/esm/core/providers/FocusProvider.js.map +2 -2
  78. package/esm/core/styles/focusRing.css +66 -66
  79. package/esm/core/styles/focusRing.sty.js +2 -2
  80. package/esm/core/styles/focusRing.sty.js.map +1 -1
  81. package/esm/core/utils/can-receive-default-text-format.js +15 -0
  82. package/esm/core/utils/can-receive-default-text-format.js.map +7 -0
  83. package/esm/core/utils/colorUtils.css +60 -60
  84. package/esm/core/utils/colorUtils.sty.js +2 -2
  85. package/esm/core/utils/colorUtils.sty.js.map +1 -1
  86. package/esm/core/utils/get-inert-value.js +12 -0
  87. package/esm/core/utils/get-inert-value.js.map +7 -0
  88. package/esm/core/utils/isBrowser.js +1 -1
  89. package/esm/core/utils/isBrowser.js.map +1 -1
  90. package/esm/core/utils/merge-props.js.map +2 -2
  91. package/esm/layouts/container/Container.css +4 -4
  92. package/esm/layouts/container/Container.sty.js +1 -1
  93. package/esm/layouts/container/Container.sty.js.map +1 -1
  94. package/esm/layouts/divider/Divider.css +6 -6
  95. package/esm/layouts/divider/Divider.sty.js +1 -1
  96. package/esm/layouts/divider/Divider.sty.js.map +1 -1
  97. package/esm/layouts/surface/Surface.css +39 -39
  98. package/esm/layouts/surface/Surface.sty.js +2 -2
  99. package/esm/layouts/surface/Surface.sty.js.map +1 -1
  100. package/esm/layouts/surface/variables.sty.js +1 -1
  101. package/esm/layouts/surface/variables.sty.js.map +1 -1
  102. package/esm/styles/colorUtils.css +60 -60
  103. package/esm/styles/colorUtils.sty.js +2 -2
  104. package/esm/styles/colorUtils.sty.js.map +1 -1
  105. package/esm/styles/container.css +47 -47
  106. package/esm/styles/container.sty.js +2 -2
  107. package/esm/styles/container.sty.js.map +1 -1
  108. package/esm/styles/ellipsis.css +1 -1
  109. package/esm/styles/ellipsis.sty.js +1 -1
  110. package/esm/styles/ellipsis.sty.js.map +1 -1
  111. package/esm/styles/field.css +153 -153
  112. package/esm/styles/field.sty.js +2 -2
  113. package/esm/styles/field.sty.js.map +1 -1
  114. package/esm/styles/sprinkles.css +262 -262
  115. package/esm/styles/sprinkles.sty.js +1 -1
  116. package/esm/styles/sprinkles.sty.js.map +1 -1
  117. package/esm/styles/textStyle.css +8 -8
  118. package/esm/styles/textStyle.sty.js +1 -1
  119. package/esm/styles/textStyle.sty.js.map +1 -1
  120. package/esm/typography/block-quote/Blockquote.css +2 -2
  121. package/esm/typography/block-quote/Blockquote.sty.js +1 -1
  122. package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
  123. package/esm/typography/code/Code.css +1 -1
  124. package/esm/typography/code/Code.sty.js +1 -1
  125. package/esm/typography/code/Code.sty.js.map +1 -1
  126. package/esm/typography/emphasis/Emphasis.css +1 -1
  127. package/esm/typography/emphasis/Emphasis.sty.js +1 -1
  128. package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
  129. package/esm/typography/external-link/ExternalLink.css +6 -6
  130. package/esm/typography/external-link/ExternalLink.sty.js +1 -1
  131. package/esm/typography/external-link/ExternalLink.sty.js.map +1 -1
  132. package/esm/typography/heading/Heading.css +7 -7
  133. package/esm/typography/heading/Heading.sty.js +1 -1
  134. package/esm/typography/heading/Heading.sty.js.map +1 -1
  135. package/esm/typography/highlight/Highlight.css +1 -1
  136. package/esm/typography/highlight/Highlight.js +1 -1
  137. package/esm/typography/highlight/Highlight.js.map +2 -2
  138. package/esm/typography/highlight/Highlight.sty.js +1 -1
  139. package/esm/typography/highlight/Highlight.sty.js.map +1 -1
  140. package/esm/typography/index.js.map +1 -1
  141. package/esm/typography/link/Link.css +4 -4
  142. package/esm/typography/link/Link.sty.js +1 -1
  143. package/esm/typography/link/Link.sty.js.map +1 -1
  144. package/esm/typography/list/List.css +4 -4
  145. package/esm/typography/list/List.sty.js +2 -2
  146. package/esm/typography/list/List.sty.js.map +1 -1
  147. package/esm/typography/paragraph/Paragraph.css +3 -3
  148. package/esm/typography/paragraph/Paragraph.sty.js +1 -1
  149. package/esm/typography/paragraph/Paragraph.sty.js.map +1 -1
  150. package/esm/typography/strikethrough/Strikethrough.css +1 -1
  151. package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
  152. package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
  153. package/esm/typography/strong/Strong.css +1 -1
  154. package/esm/typography/strong/Strong.sty.js +1 -1
  155. package/esm/typography/strong/Strong.sty.js.map +1 -1
  156. package/esm/typography/text/Text.css +3 -3
  157. package/esm/typography/text/Text.sty.js +1 -1
  158. package/esm/typography/text/Text.sty.js.map +1 -1
  159. package/esm/typography/text-ellipsis/TextEllipsis.css +6 -6
  160. package/esm/typography/text-ellipsis/TextEllipsis.js +1 -9
  161. package/esm/typography/text-ellipsis/TextEllipsis.js.map +2 -2
  162. package/esm/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
  163. package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +1 -1
  164. package/esm/typography/utils.js +16 -4
  165. package/esm/typography/utils.js.map +2 -2
  166. package/layouts/container/Container.css +4 -4
  167. package/layouts/container/Container.sty.js +1 -1
  168. package/layouts/divider/Divider.css +6 -6
  169. package/layouts/divider/Divider.sty.js +1 -1
  170. package/layouts/surface/Surface.css +39 -39
  171. package/layouts/surface/Surface.sty.js +2 -2
  172. package/layouts/surface/variables.sty.js +1 -1
  173. package/package.json +3 -3
  174. package/styles/colorUtils.css +60 -60
  175. package/styles/colorUtils.sty.js +2 -2
  176. package/styles/container.css +47 -47
  177. package/styles/container.sty.js +2 -2
  178. package/styles/ellipsis.css +1 -1
  179. package/styles/ellipsis.sty.js +1 -1
  180. package/styles/field.css +153 -153
  181. package/styles/field.sty.js +2 -2
  182. package/styles/sprinkles.css +262 -262
  183. package/styles/sprinkles.sty.js +1 -1
  184. package/styles/textStyle.css +8 -8
  185. package/styles/textStyle.sty.js +1 -1
  186. package/typography/block-quote/Blockquote.css +2 -2
  187. package/typography/block-quote/Blockquote.sty.js +1 -1
  188. package/typography/code/Code.css +1 -1
  189. package/typography/code/Code.sty.js +1 -1
  190. package/typography/emphasis/Emphasis.css +1 -1
  191. package/typography/emphasis/Emphasis.sty.js +1 -1
  192. package/typography/external-link/ExternalLink.css +6 -6
  193. package/typography/external-link/ExternalLink.sty.js +1 -1
  194. package/typography/heading/Heading.css +7 -7
  195. package/typography/heading/Heading.sty.js +1 -1
  196. package/typography/highlight/Highlight.css +1 -1
  197. package/typography/highlight/Highlight.js +1 -1
  198. package/typography/highlight/Highlight.sty.js +1 -1
  199. package/typography/index.d.ts +1 -1
  200. package/typography/link/Link.css +4 -4
  201. package/typography/link/Link.sty.js +1 -1
  202. package/typography/list/List.css +4 -4
  203. package/typography/list/List.sty.js +2 -2
  204. package/typography/paragraph/Paragraph.css +3 -3
  205. package/typography/paragraph/Paragraph.sty.js +1 -1
  206. package/typography/strikethrough/Strikethrough.css +1 -1
  207. package/typography/strikethrough/Strikethrough.sty.js +1 -1
  208. package/typography/strong/Strong.css +1 -1
  209. package/typography/strong/Strong.sty.js +1 -1
  210. package/typography/text/Text.css +3 -3
  211. package/typography/text/Text.sty.js +1 -1
  212. package/typography/text-ellipsis/TextEllipsis.css +6 -6
  213. package/typography/text-ellipsis/TextEllipsis.d.ts +2 -2
  214. package/typography/text-ellipsis/TextEllipsis.js +1 -9
  215. package/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
  216. package/typography/utils.js +16 -4
  217. package/core/hooks/useId.d.ts +0 -12
  218. package/core/utils/_is-string-children.d.ts +0 -6
  219. package/core/utils/seed-random.d.ts +0 -5
  220. package/core/utils/seed-random.js +0 -35
  221. package/core/utils/uuidv4.d.ts +0 -5
  222. package/core/utils/uuidv4.js +0 -32
  223. package/esm/core/hooks/useId.js +0 -14
  224. package/esm/core/hooks/useId.js.map +0 -7
  225. package/esm/core/utils/_is-string-children.js +0 -16
  226. package/esm/core/utils/_is-string-children.js.map +0 -7
  227. package/esm/core/utils/seed-random.js +0 -16
  228. package/esm/core/utils/seed-random.js.map +0 -7
  229. package/esm/core/utils/uuidv4.js +0 -13
  230. package/esm/core/utils/uuidv4.js.map +0 -7
@@ -26,6 +26,10 @@ __export(utils_exports, {
26
26
  getTextWidth: () => getTextWidth
27
27
  });
28
28
  module.exports = __toCommonJS(utils_exports);
29
+ var import_user_preferences = require("@dynatrace-sdk/user-preferences");
30
+ const localizedSegmenter = new Intl.Segmenter((0, import_user_preferences.getLanguage)(), {
31
+ granularity: "grapheme"
32
+ });
29
33
  const ELLIPSIS_CHARACTER = "\u2026";
30
34
  const ELLIPSIS_APPROXIMATION_THRESHOLD = 15;
31
35
  let inMemContext2d;
@@ -68,11 +72,15 @@ function centerEllipsizeText(originalText, textFont, maxWidthInPx) {
68
72
  let attempt = 1;
69
73
  let prefixLength = initialPrefixSuffixLength;
70
74
  let suffixLength = initialPrefixSuffixLength;
75
+ const originalSegmentedText = Array.from(
76
+ localizedSegmenter.segment(originalText)
77
+ ).map((segment) => segment.segment);
71
78
  do {
79
+ const originalSegmentedTextCopy = [...originalSegmentedText];
72
80
  prefixLength -= attempt % 2 === 1 ? 1 : 0;
73
81
  suffixLength -= attempt % 2 === 0 ? 1 : 0;
74
- prefix = originalText.substring(0, prefixLength);
75
- suffix = originalText.substring(originalText.length - suffixLength);
82
+ prefix = originalSegmentedTextCopy.slice(0, prefixLength).join("");
83
+ suffix = originalSegmentedTextCopy.slice(suffixLength * -1).join("");
76
84
  ellipsizedText = `${prefix}${ELLIPSIS_CHARACTER}${suffix}`;
77
85
  approximatedTextWidth = getTextWidth(ellipsizedText, textFont);
78
86
  attempt++;
@@ -94,7 +102,9 @@ function getFontString(textFont) {
94
102
  ).join(" ");
95
103
  }
96
104
  function calculateEllipsisInfo(originalText, textFont, maxWidthInPx) {
97
- const originalTextLength = originalText.length;
105
+ const originalTextLength = Array.from(
106
+ localizedSegmenter.segment(originalText)
107
+ ).length;
98
108
  if (originalTextLength <= 1) {
99
109
  return null;
100
110
  }
@@ -107,7 +117,9 @@ function calculateEllipsisInfo(originalText, textFont, maxWidthInPx) {
107
117
  }
108
118
  function getCanvasContext2d() {
109
119
  if (!inMemContext2d) {
110
- const context = document.createElement("canvas").getContext("2d");
120
+ const canvas = document.createElement("canvas");
121
+ canvas.hidden = true;
122
+ const context = canvas.getContext("2d", { alpha: false });
111
123
  if (context !== null) {
112
124
  context.imageSmoothingEnabled = false;
113
125
  context.imageSmoothingQuality = "low";
@@ -1,12 +0,0 @@
1
- /**
2
- * Hook used to generate a unique identifier.
3
- * @internal
4
- */
5
- export declare const useId: (props?: {
6
- /** If a prefix is defined, the hook prepends the prefix with a hyphen to the generated id.
7
- * @defaultValue 'strato'
8
- */
9
- prefix?: string;
10
- /** If a seed is defined, the hook uses a seeded random function to generate the id consistently. */
11
- seed?: number;
12
- }) => string;
@@ -1,6 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- /**
3
- * Returns whether children only consist of text nodes.
4
- * @internal
5
- */
6
- export declare function isStringChildren(children: ReactNode): children is string;
@@ -1,5 +0,0 @@
1
- /**
2
- * Generate a random seed function based on the mulberry32 algorithm
3
- * @internal
4
- */
5
- export declare function mulberry32(seed: number): () => number;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var seed_random_exports = {};
20
- __export(seed_random_exports, {
21
- mulberry32: () => mulberry32
22
- });
23
- module.exports = __toCommonJS(seed_random_exports);
24
- const memoizedRandomGenerators = {};
25
- function mulberry32(seed) {
26
- if (memoizedRandomGenerators[seed] === void 0) {
27
- memoizedRandomGenerators[seed] = () => {
28
- let t = seed += 1831565813;
29
- t = Math.imul(t ^ t >>> 15, t | 1);
30
- t ^= t + Math.imul(t ^ t >>> 7, t | 61);
31
- return ((t ^ t >>> 14) >>> 0) / 4294967296;
32
- };
33
- }
34
- return memoizedRandomGenerators[seed];
35
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Generates a uuidv4
3
- * @internal
4
- */
5
- export declare function uuidv4(seed?: number): string;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var uuidv4_exports = {};
20
- __export(uuidv4_exports, {
21
- uuidv4: () => uuidv4
22
- });
23
- module.exports = __toCommonJS(uuidv4_exports);
24
- var import_seed_random = require("./seed-random.js");
25
- function uuidv4(seed) {
26
- const random = seed !== void 0 ? (0, import_seed_random.mulberry32)(seed) : Math.random;
27
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (char) => {
28
- const randomNumber = random() * 16 | 0;
29
- const value = char === "x" ? randomNumber : randomNumber & 3 | 8;
30
- return value.toString(16);
31
- });
32
- }
@@ -1,14 +0,0 @@
1
- import { useMemo } from "react";
2
- import { uuidv4 } from "../utils/uuidv4.js";
3
- const useId = (props = {}) => {
4
- const { prefix = "strato", seed } = props;
5
- const generatedId = useMemo(
6
- () => `${prefix}-${uuidv4(seed)}`,
7
- [prefix, seed]
8
- );
9
- return generatedId;
10
- };
11
- export {
12
- useId
13
- };
14
- //# sourceMappingURL=useId.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/core/hooks/useId.ts"],
4
- "sourcesContent": ["import { useMemo } from 'react';\n\nimport { uuidv4 } from '../utils/uuidv4.js';\n\n/**\n * Hook used to generate a unique identifier.\n * @internal\n */\nexport const useId = (\n props: {\n /** If a prefix is defined, the hook prepends the prefix with a hyphen to the generated id.\n * @defaultValue 'strato'\n */\n prefix?: string;\n /** If a seed is defined, the hook uses a seeded random function to generate the id consistently. */\n seed?: number;\n } = {},\n) => {\n const { prefix = 'strato', seed } = props;\n\n const generatedId = useMemo(\n () => `${prefix}-${uuidv4(seed)}`,\n [prefix, seed],\n );\n\n return generatedId;\n};\n"],
5
- "mappings": "AAAA,SAAS,eAAe;AAExB,SAAS,cAAc;AAMhB,MAAM,QAAQ,CACnB,QAOI,CAAC,MACF;AACH,QAAM,EAAE,SAAS,UAAU,KAAK,IAAI;AAEpC,QAAM,cAAc;AAAA,IAClB,MAAM,GAAG,MAAM,IAAI,OAAO,IAAI,CAAC;AAAA,IAC/B,CAAC,QAAQ,IAAI;AAAA,EACf;AAEA,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,16 +0,0 @@
1
- import { Children } from "react";
2
- import { FormattedMessage } from "react-intl";
3
- import { isElement } from "react-is";
4
- function isStringChildren(children) {
5
- const childrenArray = Children.toArray(children);
6
- if (!childrenArray.some(isElement)) {
7
- return true;
8
- }
9
- return childrenArray.every(
10
- (child) => !isElement(child) || isElement(child) && child.type && child.type === FormattedMessage
11
- );
12
- }
13
- export {
14
- isStringChildren
15
- };
16
- //# sourceMappingURL=_is-string-children.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/core/utils/_is-string-children.ts"],
4
- "sourcesContent": ["import { type ReactNode, Children } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { isElement } from 'react-is';\n\n/**\n * Returns whether children only consist of text nodes.\n * @internal\n */\nexport function isStringChildren(children: ReactNode): children is string {\n const childrenArray = Children.toArray(children);\n\n if (!childrenArray.some(isElement)) {\n return true; // All children are strings\n }\n\n return childrenArray.every(\n (child) =>\n !isElement(child) ||\n (isElement(child) && child.type && child.type === FormattedMessage),\n );\n}\n"],
5
- "mappings": "AAAA,SAAyB,gBAAgB;AACzC,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAMnB,SAAS,iBAAiB,UAAyC;AACxE,QAAM,gBAAgB,SAAS,QAAQ,QAAQ;AAE/C,MAAI,CAAC,cAAc,KAAK,SAAS,GAAG;AAClC,WAAO;AAAA,EACT;AAEA,SAAO,cAAc;AAAA,IACnB,CAAC,UACC,CAAC,UAAU,KAAK,KACf,UAAU,KAAK,KAAK,MAAM,QAAQ,MAAM,SAAS;AAAA,EACtD;AACF;",
6
- "names": []
7
- }
@@ -1,16 +0,0 @@
1
- const memoizedRandomGenerators = {};
2
- function mulberry32(seed) {
3
- if (memoizedRandomGenerators[seed] === void 0) {
4
- memoizedRandomGenerators[seed] = () => {
5
- let t = seed += 1831565813;
6
- t = Math.imul(t ^ t >>> 15, t | 1);
7
- t ^= t + Math.imul(t ^ t >>> 7, t | 61);
8
- return ((t ^ t >>> 14) >>> 0) / 4294967296;
9
- };
10
- }
11
- return memoizedRandomGenerators[seed];
12
- }
13
- export {
14
- mulberry32
15
- };
16
- //# sourceMappingURL=seed-random.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/core/utils/seed-random.ts"],
4
- "sourcesContent": ["/* eslint-disable no-mixed-operators */\n\n/** Memoize currified mulberry32 generators to ensure that sequences are honored for the same seed */\nconst memoizedRandomGenerators: Record<number, () => number> = {};\n\n/**\n * Generate a random seed function based on the mulberry32 algorithm\n * @internal\n */\nexport function mulberry32(seed: number) {\n if (memoizedRandomGenerators[seed] === void 0) {\n memoizedRandomGenerators[seed] = () => {\n let t = (seed += 0x6d2b79f5);\n t = Math.imul(t ^ (t >>> 15), t | 1);\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61);\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n }\n\n return memoizedRandomGenerators[seed];\n}\n"],
5
- "mappings": "AAGA,MAAM,2BAAyD,CAAC;AAMzD,SAAS,WAAW,MAAc;AACvC,MAAI,yBAAyB,IAAI,MAAM,QAAQ;AAC7C,6BAAyB,IAAI,IAAI,MAAM;AACrC,UAAI,IAAK,QAAQ;AACjB,UAAI,KAAK,KAAK,IAAK,MAAM,IAAK,IAAI,CAAC;AACnC,WAAK,IAAI,KAAK,KAAK,IAAK,MAAM,GAAI,IAAI,EAAE;AACxC,eAAS,IAAK,MAAM,QAAS,KAAK;AAAA,IACpC;AAAA,EACF;AAEA,SAAO,yBAAyB,IAAI;AACtC;",
6
- "names": []
7
- }
@@ -1,13 +0,0 @@
1
- import { mulberry32 } from "./seed-random.js";
2
- function uuidv4(seed) {
3
- const random = seed !== void 0 ? mulberry32(seed) : Math.random;
4
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (char) => {
5
- const randomNumber = random() * 16 | 0;
6
- const value = char === "x" ? randomNumber : randomNumber & 3 | 8;
7
- return value.toString(16);
8
- });
9
- }
10
- export {
11
- uuidv4
12
- };
13
- //# sourceMappingURL=uuidv4.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/core/utils/uuidv4.ts"],
4
- "sourcesContent": ["import { mulberry32 } from './seed-random.js';\n\n/**\n * Generates a uuidv4\n * @internal\n */\nexport function uuidv4(seed?: number) {\n // If a seed is given, use a seeded random function to generate the uuid.\n const random = seed !== void 0 ? mulberry32(seed) : Math.random;\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (char) => {\n // eslint-disable-next-line no-mixed-operators\n const randomNumber = (random() * 16) | 0;\n const value = char === 'x' ? randomNumber : (randomNumber & 0x3) | 0x8;\n return value.toString(16);\n });\n}\n"],
5
- "mappings": "AAAA,SAAS,kBAAkB;AAMpB,SAAS,OAAO,MAAe;AAEpC,QAAM,SAAS,SAAS,SAAS,WAAW,IAAI,IAAI,KAAK;AACzD,SAAO,uCAAuC,QAAQ,SAAS,CAAC,SAAS;AAEvE,UAAM,eAAgB,OAAO,IAAI,KAAM;AACvC,UAAM,QAAQ,SAAS,MAAM,eAAgB,eAAe,IAAO;AACnE,WAAO,MAAM,SAAS,EAAE;AAAA,EAC1B,CAAC;AACH;",
6
- "names": []
7
- }