react-i18next 16.6.6 → 17.0.0
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 +13 -0
- package/dist/amd/react-i18next.js +114 -87
- package/dist/amd/react-i18next.min.js +1 -1
- package/dist/commonjs/TransWithoutContext.js +3 -2
- package/dist/es/TransWithoutContext.js +3 -2
- package/dist/es/package.json +1 -1
- package/dist/umd/react-i18next.js +114 -87
- package/dist/umd/react-i18next.min.js +1 -1
- package/package.json +17 -17
- package/react-i18next.js +114 -87
- package/react-i18next.min.js +1 -1
- package/src/TransWithoutContext.js +5 -2
- package/vitest.workspace.typescript.mts +47 -48
|
@@ -1711,6 +1711,7 @@
|
|
|
1711
1711
|
const getSupportNoticeShown = () => {
|
|
1712
1712
|
if (typeof globalThis !== 'undefined' && !!globalThis[SUPPORT_NOTICE_KEY]) return true;
|
|
1713
1713
|
if (typeof process !== 'undefined' && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE) return true;
|
|
1714
|
+
if (typeof process !== 'undefined' && process.env && "development" === 'production') ;
|
|
1714
1715
|
return false;
|
|
1715
1716
|
};
|
|
1716
1717
|
const setSupportNoticeShown = () => {
|
|
@@ -2252,24 +2253,33 @@
|
|
|
2252
2253
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2253
2254
|
}
|
|
2254
2255
|
|
|
2255
|
-
var voidElements
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2256
|
+
var voidElements;
|
|
2257
|
+
var hasRequiredVoidElements;
|
|
2258
|
+
|
|
2259
|
+
function requireVoidElements () {
|
|
2260
|
+
if (hasRequiredVoidElements) return voidElements;
|
|
2261
|
+
hasRequiredVoidElements = 1;
|
|
2262
|
+
voidElements = {
|
|
2263
|
+
"area": true,
|
|
2264
|
+
"base": true,
|
|
2265
|
+
"br": true,
|
|
2266
|
+
"col": true,
|
|
2267
|
+
"embed": true,
|
|
2268
|
+
"hr": true,
|
|
2269
|
+
"img": true,
|
|
2270
|
+
"input": true,
|
|
2271
|
+
"link": true,
|
|
2272
|
+
"meta": true,
|
|
2273
|
+
"param": true,
|
|
2274
|
+
"source": true,
|
|
2275
|
+
"track": true,
|
|
2276
|
+
"wbr": true
|
|
2277
|
+
};
|
|
2278
|
+
return voidElements;
|
|
2279
|
+
}
|
|
2271
2280
|
|
|
2272
|
-
var
|
|
2281
|
+
var voidElementsExports = requireVoidElements();
|
|
2282
|
+
var e = /*@__PURE__*/getDefaultExportFromCjs(voidElementsExports);
|
|
2273
2283
|
|
|
2274
2284
|
var t = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;
|
|
2275
2285
|
function n(n) {
|
|
@@ -2538,8 +2548,9 @@
|
|
|
2538
2548
|
stringNode += `<${childIndex}></${childIndex}>`;
|
|
2539
2549
|
return;
|
|
2540
2550
|
}
|
|
2541
|
-
if (shouldKeepChild && childPropsCount
|
|
2542
|
-
|
|
2551
|
+
if (shouldKeepChild && childPropsCount <= 1) {
|
|
2552
|
+
const cnt = isString(childChildren) ? childChildren : nodesToString(childChildren, i18nOptions, i18n, i18nKey);
|
|
2553
|
+
stringNode += `<${type}>${cnt}</${type}>`;
|
|
2543
2554
|
return;
|
|
2544
2555
|
}
|
|
2545
2556
|
const content = nodesToString(childChildren, i18nOptions, i18n, i18nKey);
|
|
@@ -3444,77 +3455,93 @@
|
|
|
3444
3455
|
* LICENSE file in the root directory of this source tree.
|
|
3445
3456
|
*/
|
|
3446
3457
|
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3458
|
+
var hasRequiredUseSyncExternalStoreShim_development;
|
|
3459
|
+
|
|
3460
|
+
function requireUseSyncExternalStoreShim_development () {
|
|
3461
|
+
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
3462
|
+
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
3463
|
+
|
|
3464
|
+
(function () {
|
|
3465
|
+
function is(x, y) {
|
|
3466
|
+
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
3467
|
+
}
|
|
3468
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
3469
|
+
didWarnOld18Alpha || void 0 === React$1.startTransition || (didWarnOld18Alpha = true, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
3470
|
+
var value = getSnapshot();
|
|
3471
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
3472
|
+
var cachedValue = getSnapshot();
|
|
3473
|
+
objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true);
|
|
3474
|
+
}
|
|
3475
|
+
cachedValue = useState({
|
|
3476
|
+
inst: {
|
|
3477
|
+
value: value,
|
|
3478
|
+
getSnapshot: getSnapshot
|
|
3479
|
+
}
|
|
3480
|
+
});
|
|
3481
|
+
var inst = cachedValue[0].inst,
|
|
3482
|
+
forceUpdate = cachedValue[1];
|
|
3483
|
+
useLayoutEffect(function () {
|
|
3484
|
+
inst.value = value;
|
|
3485
|
+
inst.getSnapshot = getSnapshot;
|
|
3486
|
+
checkIfSnapshotChanged(inst) && forceUpdate({
|
|
3487
|
+
inst: inst
|
|
3488
|
+
});
|
|
3489
|
+
}, [subscribe, value, getSnapshot]);
|
|
3490
|
+
useEffect(function () {
|
|
3491
|
+
checkIfSnapshotChanged(inst) && forceUpdate({
|
|
3492
|
+
inst: inst
|
|
3493
|
+
});
|
|
3494
|
+
return subscribe(function () {
|
|
3495
|
+
checkIfSnapshotChanged(inst) && forceUpdate({
|
|
3496
|
+
inst: inst
|
|
3497
|
+
});
|
|
3498
|
+
});
|
|
3499
|
+
}, [subscribe]);
|
|
3500
|
+
useDebugValue(value);
|
|
3501
|
+
return value;
|
|
3502
|
+
}
|
|
3503
|
+
function checkIfSnapshotChanged(inst) {
|
|
3504
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
3505
|
+
inst = inst.value;
|
|
3506
|
+
try {
|
|
3507
|
+
var nextValue = latestGetSnapshot();
|
|
3508
|
+
return !objectIs(inst, nextValue);
|
|
3509
|
+
} catch (error) {
|
|
3510
|
+
return true;
|
|
3511
|
+
}
|
|
3512
|
+
}
|
|
3513
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
3514
|
+
return getSnapshot();
|
|
3515
|
+
}
|
|
3516
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
3517
|
+
var React$1 = React,
|
|
3518
|
+
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
3519
|
+
useState = React$1.useState,
|
|
3520
|
+
useEffect = React$1.useEffect,
|
|
3521
|
+
useLayoutEffect = React$1.useLayoutEffect,
|
|
3522
|
+
useDebugValue = React$1.useDebugValue,
|
|
3523
|
+
didWarnOld18Alpha = false,
|
|
3524
|
+
didWarnUncachedGetSnapshot = false,
|
|
3525
|
+
shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
3526
|
+
useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
|
|
3527
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
3528
|
+
})();
|
|
3529
|
+
return useSyncExternalStoreShim_development;
|
|
3530
|
+
}
|
|
3531
|
+
|
|
3532
|
+
var hasRequiredShim;
|
|
3533
|
+
|
|
3534
|
+
function requireShim () {
|
|
3535
|
+
if (hasRequiredShim) return shim.exports;
|
|
3536
|
+
hasRequiredShim = 1;
|
|
3512
3537
|
|
|
3513
|
-
|
|
3514
|
-
|
|
3538
|
+
{
|
|
3539
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
3540
|
+
}
|
|
3541
|
+
return shim.exports;
|
|
3515
3542
|
}
|
|
3516
3543
|
|
|
3517
|
-
var shimExports =
|
|
3544
|
+
var shimExports = requireShim();
|
|
3518
3545
|
|
|
3519
3546
|
const notReadyT = (k, optsOrDefaultValue) => {
|
|
3520
3547
|
if (isString(optsOrDefaultValue)) return optsOrDefaultValue;
|