@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.
- package/buttons/button/Button.css +16 -16
- package/buttons/button/Button.js +1 -1
- package/buttons/button/Button.sty.js +4 -4
- package/buttons/button/Label.js +2 -2
- package/buttons/intent-button/IntentButton.js +1 -1
- package/content/progress/ProgressBar.css +71 -71
- package/content/progress/ProgressBar.sty.js +5 -5
- package/content/progress/ProgressBarIcon.css +2 -2
- package/content/progress/ProgressBarIcon.sty.js +1 -1
- package/content/progress/ProgressBarLabel.css +3 -3
- package/content/progress/ProgressBarLabel.js +2 -2
- package/content/progress/ProgressBarLabel.sty.js +1 -1
- package/content/progress/ProgressBarValue.css +5 -5
- package/content/progress/ProgressBarValue.js +2 -2
- package/content/progress/ProgressBarValue.sty.js +1 -1
- package/content/progress/ProgressCircle.css +40 -40
- package/content/progress/ProgressCircle.sty.js +5 -5
- package/content/skeleton/Skeleton.css +6 -6
- package/content/skeleton/Skeleton.sty.js +1 -1
- package/core/components/focus-scope/FocusScope.js +1 -1
- package/core/contexts/FocusContext.d.ts +1 -0
- package/core/contexts/FocusContext.js +2 -1
- package/core/index.d.ts +1 -4
- package/core/index.js +2 -8
- package/core/providers/FocusProvider.js +30 -4
- package/core/styles/focusRing.css +66 -66
- package/core/styles/focusRing.sty.js +2 -2
- package/core/utils/can-receive-default-text-format.d.ts +9 -0
- package/core/utils/{_is-string-children.js → can-receive-default-text-format.js} +6 -10
- package/core/utils/colorUtils.css +60 -60
- package/core/utils/colorUtils.sty.js +2 -2
- package/core/utils/get-inert-value.d.ts +8 -0
- package/core/{hooks/useId.js → utils/get-inert-value.js} +11 -13
- package/core/utils/isBrowser.js +1 -1
- package/esm/buttons/button/Button.css +16 -16
- package/esm/buttons/button/Button.js +1 -1
- package/esm/buttons/button/Button.js.map +2 -2
- package/esm/buttons/button/Button.sty.js +4 -4
- package/esm/buttons/button/Button.sty.js.map +1 -1
- package/esm/buttons/button/Label.js +2 -2
- package/esm/buttons/button/Label.js.map +2 -2
- package/esm/buttons/intent-button/IntentButton.js +1 -1
- package/esm/buttons/intent-button/IntentButton.js.map +1 -1
- package/esm/content/progress/ProgressBar.css +71 -71
- package/esm/content/progress/ProgressBar.js.map +2 -2
- package/esm/content/progress/ProgressBar.sty.js +5 -5
- package/esm/content/progress/ProgressBar.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarIcon.css +2 -2
- package/esm/content/progress/ProgressBarIcon.js.map +2 -2
- package/esm/content/progress/ProgressBarIcon.sty.js +1 -1
- package/esm/content/progress/ProgressBarIcon.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarLabel.css +3 -3
- package/esm/content/progress/ProgressBarLabel.js +2 -2
- package/esm/content/progress/ProgressBarLabel.js.map +2 -2
- package/esm/content/progress/ProgressBarLabel.sty.js +1 -1
- package/esm/content/progress/ProgressBarLabel.sty.js.map +1 -1
- package/esm/content/progress/ProgressBarValue.css +5 -5
- package/esm/content/progress/ProgressBarValue.js +2 -2
- package/esm/content/progress/ProgressBarValue.js.map +2 -2
- package/esm/content/progress/ProgressBarValue.sty.js +1 -1
- package/esm/content/progress/ProgressBarValue.sty.js.map +1 -1
- package/esm/content/progress/ProgressCircle.css +40 -40
- package/esm/content/progress/ProgressCircle.js.map +2 -2
- package/esm/content/progress/ProgressCircle.sty.js +5 -5
- package/esm/content/progress/ProgressCircle.sty.js.map +1 -1
- package/esm/content/progress/contexts/SharedProgressBarPropsContext.js.map +2 -2
- package/esm/content/skeleton/Skeleton.css +6 -6
- package/esm/content/skeleton/Skeleton.sty.js +1 -1
- package/esm/content/skeleton/Skeleton.sty.js.map +1 -1
- package/esm/core/components/focus-scope/FocusScope.js +1 -1
- package/esm/core/components/focus-scope/FocusScope.js.map +2 -2
- package/esm/core/contexts/FocusContext.js +2 -1
- package/esm/core/contexts/FocusContext.js.map +2 -2
- package/esm/core/index.js +2 -8
- package/esm/core/index.js.map +2 -2
- package/esm/core/providers/FocusProvider.js +31 -5
- package/esm/core/providers/FocusProvider.js.map +2 -2
- package/esm/core/styles/focusRing.css +66 -66
- package/esm/core/styles/focusRing.sty.js +2 -2
- package/esm/core/styles/focusRing.sty.js.map +1 -1
- package/esm/core/utils/can-receive-default-text-format.js +15 -0
- package/esm/core/utils/can-receive-default-text-format.js.map +7 -0
- package/esm/core/utils/colorUtils.css +60 -60
- package/esm/core/utils/colorUtils.sty.js +2 -2
- package/esm/core/utils/colorUtils.sty.js.map +1 -1
- package/esm/core/utils/get-inert-value.js +12 -0
- package/esm/core/utils/get-inert-value.js.map +7 -0
- package/esm/core/utils/isBrowser.js +1 -1
- package/esm/core/utils/isBrowser.js.map +1 -1
- package/esm/core/utils/merge-props.js.map +2 -2
- package/esm/layouts/container/Container.css +4 -4
- package/esm/layouts/container/Container.sty.js +1 -1
- package/esm/layouts/container/Container.sty.js.map +1 -1
- package/esm/layouts/divider/Divider.css +6 -6
- package/esm/layouts/divider/Divider.sty.js +1 -1
- package/esm/layouts/divider/Divider.sty.js.map +1 -1
- package/esm/layouts/surface/Surface.css +39 -39
- package/esm/layouts/surface/Surface.sty.js +2 -2
- package/esm/layouts/surface/Surface.sty.js.map +1 -1
- package/esm/layouts/surface/variables.sty.js +1 -1
- package/esm/layouts/surface/variables.sty.js.map +1 -1
- package/esm/styles/colorUtils.css +60 -60
- package/esm/styles/colorUtils.sty.js +2 -2
- package/esm/styles/colorUtils.sty.js.map +1 -1
- package/esm/styles/container.css +47 -47
- package/esm/styles/container.sty.js +2 -2
- package/esm/styles/container.sty.js.map +1 -1
- package/esm/styles/ellipsis.css +1 -1
- package/esm/styles/ellipsis.sty.js +1 -1
- package/esm/styles/ellipsis.sty.js.map +1 -1
- package/esm/styles/field.css +153 -153
- package/esm/styles/field.sty.js +2 -2
- package/esm/styles/field.sty.js.map +1 -1
- package/esm/styles/sprinkles.css +262 -262
- package/esm/styles/sprinkles.sty.js +1 -1
- package/esm/styles/sprinkles.sty.js.map +1 -1
- package/esm/styles/textStyle.css +8 -8
- package/esm/styles/textStyle.sty.js +1 -1
- package/esm/styles/textStyle.sty.js.map +1 -1
- package/esm/typography/block-quote/Blockquote.css +2 -2
- package/esm/typography/block-quote/Blockquote.sty.js +1 -1
- package/esm/typography/block-quote/Blockquote.sty.js.map +1 -1
- package/esm/typography/code/Code.css +1 -1
- package/esm/typography/code/Code.sty.js +1 -1
- package/esm/typography/code/Code.sty.js.map +1 -1
- package/esm/typography/emphasis/Emphasis.css +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js +1 -1
- package/esm/typography/emphasis/Emphasis.sty.js.map +1 -1
- package/esm/typography/external-link/ExternalLink.css +6 -6
- package/esm/typography/external-link/ExternalLink.sty.js +1 -1
- package/esm/typography/external-link/ExternalLink.sty.js.map +1 -1
- package/esm/typography/heading/Heading.css +7 -7
- package/esm/typography/heading/Heading.sty.js +1 -1
- package/esm/typography/heading/Heading.sty.js.map +1 -1
- package/esm/typography/highlight/Highlight.css +1 -1
- package/esm/typography/highlight/Highlight.js +1 -1
- package/esm/typography/highlight/Highlight.js.map +2 -2
- package/esm/typography/highlight/Highlight.sty.js +1 -1
- package/esm/typography/highlight/Highlight.sty.js.map +1 -1
- package/esm/typography/index.js.map +1 -1
- package/esm/typography/link/Link.css +4 -4
- package/esm/typography/link/Link.sty.js +1 -1
- package/esm/typography/link/Link.sty.js.map +1 -1
- package/esm/typography/list/List.css +4 -4
- package/esm/typography/list/List.sty.js +2 -2
- package/esm/typography/list/List.sty.js.map +1 -1
- package/esm/typography/paragraph/Paragraph.css +3 -3
- package/esm/typography/paragraph/Paragraph.sty.js +1 -1
- package/esm/typography/paragraph/Paragraph.sty.js.map +1 -1
- package/esm/typography/strikethrough/Strikethrough.css +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/esm/typography/strikethrough/Strikethrough.sty.js.map +1 -1
- package/esm/typography/strong/Strong.css +1 -1
- package/esm/typography/strong/Strong.sty.js +1 -1
- package/esm/typography/strong/Strong.sty.js.map +1 -1
- package/esm/typography/text/Text.css +3 -3
- package/esm/typography/text/Text.sty.js +1 -1
- package/esm/typography/text/Text.sty.js.map +1 -1
- package/esm/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/esm/typography/text-ellipsis/TextEllipsis.js +1 -9
- package/esm/typography/text-ellipsis/TextEllipsis.js.map +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
- package/esm/typography/text-ellipsis/TextEllipsis.sty.js.map +1 -1
- package/esm/typography/utils.js +16 -4
- package/esm/typography/utils.js.map +2 -2
- package/layouts/container/Container.css +4 -4
- package/layouts/container/Container.sty.js +1 -1
- package/layouts/divider/Divider.css +6 -6
- package/layouts/divider/Divider.sty.js +1 -1
- package/layouts/surface/Surface.css +39 -39
- package/layouts/surface/Surface.sty.js +2 -2
- package/layouts/surface/variables.sty.js +1 -1
- package/package.json +3 -3
- package/styles/colorUtils.css +60 -60
- package/styles/colorUtils.sty.js +2 -2
- package/styles/container.css +47 -47
- package/styles/container.sty.js +2 -2
- package/styles/ellipsis.css +1 -1
- package/styles/ellipsis.sty.js +1 -1
- package/styles/field.css +153 -153
- package/styles/field.sty.js +2 -2
- package/styles/sprinkles.css +262 -262
- package/styles/sprinkles.sty.js +1 -1
- package/styles/textStyle.css +8 -8
- package/styles/textStyle.sty.js +1 -1
- package/typography/block-quote/Blockquote.css +2 -2
- package/typography/block-quote/Blockquote.sty.js +1 -1
- package/typography/code/Code.css +1 -1
- package/typography/code/Code.sty.js +1 -1
- package/typography/emphasis/Emphasis.css +1 -1
- package/typography/emphasis/Emphasis.sty.js +1 -1
- package/typography/external-link/ExternalLink.css +6 -6
- package/typography/external-link/ExternalLink.sty.js +1 -1
- package/typography/heading/Heading.css +7 -7
- package/typography/heading/Heading.sty.js +1 -1
- package/typography/highlight/Highlight.css +1 -1
- package/typography/highlight/Highlight.js +1 -1
- package/typography/highlight/Highlight.sty.js +1 -1
- package/typography/index.d.ts +1 -1
- package/typography/link/Link.css +4 -4
- package/typography/link/Link.sty.js +1 -1
- package/typography/list/List.css +4 -4
- package/typography/list/List.sty.js +2 -2
- package/typography/paragraph/Paragraph.css +3 -3
- package/typography/paragraph/Paragraph.sty.js +1 -1
- package/typography/strikethrough/Strikethrough.css +1 -1
- package/typography/strikethrough/Strikethrough.sty.js +1 -1
- package/typography/strong/Strong.css +1 -1
- package/typography/strong/Strong.sty.js +1 -1
- package/typography/text/Text.css +3 -3
- package/typography/text/Text.sty.js +1 -1
- package/typography/text-ellipsis/TextEllipsis.css +6 -6
- package/typography/text-ellipsis/TextEllipsis.d.ts +2 -2
- package/typography/text-ellipsis/TextEllipsis.js +1 -9
- package/typography/text-ellipsis/TextEllipsis.sty.js +2 -2
- package/typography/utils.js +16 -4
- package/core/hooks/useId.d.ts +0 -12
- package/core/utils/_is-string-children.d.ts +0 -6
- package/core/utils/seed-random.d.ts +0 -5
- package/core/utils/seed-random.js +0 -35
- package/core/utils/uuidv4.d.ts +0 -5
- package/core/utils/uuidv4.js +0 -32
- package/esm/core/hooks/useId.js +0 -14
- package/esm/core/hooks/useId.js.map +0 -7
- package/esm/core/utils/_is-string-children.js +0 -16
- package/esm/core/utils/_is-string-children.js.map +0 -7
- package/esm/core/utils/seed-random.js +0 -16
- package/esm/core/utils/seed-random.js.map +0 -7
- package/esm/core/utils/uuidv4.js +0 -13
- package/esm/core/utils/uuidv4.js.map +0 -7
package/typography/utils.js
CHANGED
|
@@ -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 =
|
|
75
|
-
suffix =
|
|
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 =
|
|
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
|
|
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";
|
package/core/hooks/useId.d.ts
DELETED
|
@@ -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,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
|
-
}
|
package/core/utils/uuidv4.d.ts
DELETED
package/core/utils/uuidv4.js
DELETED
|
@@ -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
|
-
}
|
package/esm/core/hooks/useId.js
DELETED
|
@@ -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
|
-
}
|
package/esm/core/utils/uuidv4.js
DELETED
|
@@ -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
|
-
}
|