@open-pioneer/test-utils 3.0.0-dev.20250221111321 → 3.1.0-dev-rich-text.20250408112706
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/CHANGELOG.md +12 -3
- package/package.json +4 -3
- package/vanilla.js +5 -18
- package/vanilla.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
# @open-pioneer/test-utils
|
|
2
2
|
|
|
3
|
-
## 3.
|
|
3
|
+
## 3.1.0-dev-rich-text.20250408112706
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [5d758c7]
|
|
8
|
+
- @open-pioneer/runtime@3.1.0-dev-rich-text.20250408112706
|
|
9
|
+
- @open-pioneer/runtime-react-support@3.1.0-dev-rich-text.20250408112706
|
|
10
|
+
- @open-pioneer/chakra-integration@3.1.0-dev-rich-text.20250408112706
|
|
11
|
+
|
|
12
|
+
## 3.0.0
|
|
4
13
|
|
|
5
14
|
### Major Changes
|
|
6
15
|
|
|
@@ -17,8 +26,8 @@
|
|
|
17
26
|
### Patch Changes
|
|
18
27
|
|
|
19
28
|
- Updated dependencies [9477e54]
|
|
20
|
-
- @open-pioneer/chakra-integration@3.0.0
|
|
21
|
-
- @open-pioneer/runtime-react-support@3.0.0
|
|
29
|
+
- @open-pioneer/chakra-integration@3.0.0
|
|
30
|
+
- @open-pioneer/runtime-react-support@3.0.0
|
|
22
31
|
|
|
23
32
|
## 2.4.0
|
|
24
33
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/test-utils",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1.0-dev-rich-text.20250408112706",
|
|
5
5
|
"description": "Contains test utilities that make it easier to test parts of an Open Pioneer Trails application.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
"react-dom": "^19.0.0",
|
|
20
20
|
"@testing-library/dom": "^10.4.0",
|
|
21
21
|
"@formatjs/intl": "^3.1.4",
|
|
22
|
-
"@open-pioneer/runtime
|
|
23
|
-
"@open-pioneer/
|
|
22
|
+
"@open-pioneer/runtime": "^3.1.0-dev-rich-text.20250408112706",
|
|
23
|
+
"@open-pioneer/runtime-react-support": "^3.1.0-dev-rich-text.20250408112706",
|
|
24
|
+
"@open-pioneer/chakra-integration": "^3.1.0-dev-rich-text.20250408112706"
|
|
24
25
|
},
|
|
25
26
|
"exports": {
|
|
26
27
|
"./package.json": "./package.json",
|
package/vanilla.js
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createPackageIntl } from '@open-pioneer/runtime/test-support';
|
|
2
2
|
|
|
3
3
|
function createIntl(options) {
|
|
4
4
|
const messages = options?.messages ?? {};
|
|
5
5
|
const locale = options?.locale ?? "en";
|
|
6
6
|
const defaultMessageLocale = options?.defaultMessageLocale ?? "en";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
defaultLocale: defaultMessageLocale,
|
|
12
|
-
messages,
|
|
13
|
-
onError: INTL_ERROR_HANDLER
|
|
14
|
-
},
|
|
15
|
-
cache
|
|
16
|
-
);
|
|
17
|
-
return intl;
|
|
7
|
+
return createPackageIntl(locale, messages, {
|
|
8
|
+
defaultLocale: defaultMessageLocale,
|
|
9
|
+
suppressNotFoundError: true
|
|
10
|
+
});
|
|
18
11
|
}
|
|
19
|
-
const INTL_ERROR_HANDLER = (err) => {
|
|
20
|
-
if (err.code === IntlErrorCode.MISSING_TRANSLATION) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
console.error(err);
|
|
24
|
-
};
|
|
25
12
|
|
|
26
13
|
export { createIntl };
|
|
27
14
|
//# sourceMappingURL=vanilla.js.map
|
package/vanilla.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vanilla.js","sources":["vanilla.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport {
|
|
1
|
+
{"version":3,"file":"vanilla.js","sources":["vanilla.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { PackageIntl } from \"@open-pioneer/runtime\";\nimport { createPackageIntl } from \"@open-pioneer/runtime/test-support\";\n\n/** Options for `createIntl`. */\nexport interface I18nOptions {\n /**\n * The locale for i18n messages and formatting.\n *\n * @default \"en\"\n */\n locale?: string;\n\n /**\n * The locale for embedded default messages (e.g. `defaultMessage` property in `intl.formatMessage(...)`).\n * It is usually not necessary to specify this option.\n *\n * See also https://formatjs.io/docs/intl#message-descriptor\n *\n * @default \"en\"\n */\n defaultMessageLocale?: string;\n\n /**\n * I18n messages as (messageId, message) entries.\n *\n * @default {}\n */\n messages?: Record<string, string>;\n}\n\n/**\n * Creates an `intl` instance that can be used for testing.\n *\n * Other than the default implementation provided by `@formatjs/intl`, this\n * `intl` object will not warn if a message is not defined.\n * Instead, it will simply render the fallback message.\n * This behavior makes testing easier.\n *\n * Note that messages can still be defined by using the `messages` parameter.\n */\nexport function createIntl(options?: I18nOptions): PackageIntl {\n const messages = options?.messages ?? {};\n const locale = options?.locale ?? \"en\";\n const defaultMessageLocale = options?.defaultMessageLocale ?? \"en\";\n return createPackageIntl(locale, messages, {\n defaultLocale: defaultMessageLocale,\n suppressNotFoundError: true\n });\n}\n"],"names":[],"mappings":";;AA0CO,SAAS,WAAW,OAAoC,EAAA;AAC3D,EAAM,MAAA,QAAA,GAAW,OAAS,EAAA,QAAA,IAAY,EAAC;AACvC,EAAM,MAAA,MAAA,GAAS,SAAS,MAAU,IAAA,IAAA;AAClC,EAAM,MAAA,oBAAA,GAAuB,SAAS,oBAAwB,IAAA,IAAA;AAC9D,EAAO,OAAA,iBAAA,CAAkB,QAAQ,QAAU,EAAA;AAAA,IACvC,aAAe,EAAA,oBAAA;AAAA,IACf,qBAAuB,EAAA;AAAA,GAC1B,CAAA;AACL;;;;"}
|