react-intl 10.1.9 → 10.1.12
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/package.json +34 -35
- package/react-intl.iife.js +49 -0
package/package.json
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intl",
|
|
3
|
+
"version": "10.1.12",
|
|
3
4
|
"description": "Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.",
|
|
4
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"format",
|
|
7
|
+
"formatting",
|
|
8
|
+
"globalization",
|
|
9
|
+
"i18n",
|
|
10
|
+
"internationalization",
|
|
11
|
+
"intl",
|
|
12
|
+
"locale",
|
|
13
|
+
"localization",
|
|
14
|
+
"react",
|
|
15
|
+
"reactjs",
|
|
16
|
+
"translate",
|
|
17
|
+
"translation"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://formatjs.github.io/docs/react-intl",
|
|
20
|
+
"bugs": "https://github.com/formatjs/formatjs/issues",
|
|
5
21
|
"license": "BSD-3-Clause",
|
|
6
22
|
"author": "Eric Ferraiuolo <edf@ericf.me>",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"sideEffects": false,
|
|
9
|
-
"types": "index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": "./index.js",
|
|
12
|
-
"./server": "./server.js"
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"@formatjs/intl": "4.1.12",
|
|
16
|
-
"intl-messageformat": "11.2.7",
|
|
17
|
-
"@formatjs/icu-messageformat-parser": "3.5.10"
|
|
18
|
-
},
|
|
19
|
-
"peerDependencies": {
|
|
20
|
-
"@types/react": "19",
|
|
21
|
-
"react": "19"
|
|
22
|
-
},
|
|
23
|
-
"bugs": "https://github.com/formatjs/formatjs/issues",
|
|
24
23
|
"contributors": [
|
|
25
24
|
"Aarni Koskela <akx@iki.fi>",
|
|
26
25
|
"Alexis Deveria <adeveria@gmail.com>",
|
|
@@ -119,21 +118,21 @@
|
|
|
119
118
|
"Yang Su <yang@quip.com>",
|
|
120
119
|
"zouxuoz <zouxuoz@gmail.com>"
|
|
121
120
|
],
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"
|
|
137
|
-
|
|
138
|
-
|
|
121
|
+
"repository": "git@github.com:formatjs/formatjs.git",
|
|
122
|
+
"type": "module",
|
|
123
|
+
"sideEffects": false,
|
|
124
|
+
"types": "index.d.ts",
|
|
125
|
+
"exports": {
|
|
126
|
+
".": "./index.js",
|
|
127
|
+
"./server": "./server.js"
|
|
128
|
+
},
|
|
129
|
+
"dependencies": {
|
|
130
|
+
"@formatjs/icu-messageformat-parser": "3.5.11",
|
|
131
|
+
"@formatjs/intl": "4.1.13",
|
|
132
|
+
"intl-messageformat": "11.2.8"
|
|
133
|
+
},
|
|
134
|
+
"peerDependencies": {
|
|
135
|
+
"@types/react": "19",
|
|
136
|
+
"react": "19"
|
|
137
|
+
}
|
|
139
138
|
}
|
package/react-intl.iife.js
CHANGED
|
@@ -1824,6 +1824,37 @@ function matchIdentifierAtIndex(s, index) {
|
|
|
1824
1824
|
IDENTIFIER_PREFIX_RE.lastIndex = index;
|
|
1825
1825
|
return IDENTIFIER_PREFIX_RE.exec(s)[1] ?? "";
|
|
1826
1826
|
}
|
|
1827
|
+
function plainTopLevelEndPosition(message) {
|
|
1828
|
+
if (message.length === 0) return null;
|
|
1829
|
+
let line = 1;
|
|
1830
|
+
let column = 1;
|
|
1831
|
+
for (let offset = 0; offset < message.length;) {
|
|
1832
|
+
const code = message.charCodeAt(offset);
|
|
1833
|
+
switch (code) {
|
|
1834
|
+
case 35:
|
|
1835
|
+
case 39:
|
|
1836
|
+
case 60:
|
|
1837
|
+
case 123:
|
|
1838
|
+
case 125: return null;
|
|
1839
|
+
}
|
|
1840
|
+
if (code === 10) {
|
|
1841
|
+
line++;
|
|
1842
|
+
column = 1;
|
|
1843
|
+
offset++;
|
|
1844
|
+
} else {
|
|
1845
|
+
column++;
|
|
1846
|
+
if (code >= 55296 && code <= 56319 && offset + 1 < message.length) {
|
|
1847
|
+
const next = message.charCodeAt(offset + 1);
|
|
1848
|
+
offset += next >= 56320 && next <= 57343 ? 2 : 1;
|
|
1849
|
+
} else offset++;
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
return {
|
|
1853
|
+
offset: message.length,
|
|
1854
|
+
line,
|
|
1855
|
+
column
|
|
1856
|
+
};
|
|
1857
|
+
}
|
|
1827
1858
|
var Parser = class {
|
|
1828
1859
|
constructor(message, options = {}) {
|
|
1829
1860
|
this.message = message;
|
|
@@ -1839,6 +1870,24 @@ var Parser = class {
|
|
|
1839
1870
|
}
|
|
1840
1871
|
parse() {
|
|
1841
1872
|
if (this.offset() !== 0) throw Error("parser can only be used once");
|
|
1873
|
+
if (this.message.length > 0) {
|
|
1874
|
+
const firstCode = this.message.charCodeAt(0);
|
|
1875
|
+
if (firstCode !== 35 && firstCode !== 39 && firstCode !== 60 && firstCode !== 123 && firstCode !== 125) {
|
|
1876
|
+
const plainEndPosition = plainTopLevelEndPosition(this.message);
|
|
1877
|
+
if (plainEndPosition) {
|
|
1878
|
+
const start = this.clonePosition();
|
|
1879
|
+
this.position = plainEndPosition;
|
|
1880
|
+
return {
|
|
1881
|
+
val: [{
|
|
1882
|
+
type: 0,
|
|
1883
|
+
value: this.message,
|
|
1884
|
+
location: createLocation(start, this.clonePosition())
|
|
1885
|
+
}],
|
|
1886
|
+
err: null
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1842
1891
|
return this.parseMessage(0, "", false);
|
|
1843
1892
|
}
|
|
1844
1893
|
parseMessage(nestingLevel, parentArgType, expectingCloseTag) {
|