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.
@@ -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
- "area": true,
2257
- "base": true,
2258
- "br": true,
2259
- "col": true,
2260
- "embed": true,
2261
- "hr": true,
2262
- "img": true,
2263
- "input": true,
2264
- "link": true,
2265
- "meta": true,
2266
- "param": true,
2267
- "source": true,
2268
- "track": true,
2269
- "wbr": true
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 e = /*@__PURE__*/getDefaultExportFromCjs(voidElements);
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 === 1 && isString(childChildren)) {
2542
- stringNode += `<${type}>${childChildren}</${type}>`;
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
- (function () {
3448
- function is(x, y) {
3449
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
3450
- }
3451
- function useSyncExternalStore$2(subscribe, getSnapshot) {
3452
- 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."));
3453
- var value = getSnapshot();
3454
- if (!didWarnUncachedGetSnapshot) {
3455
- var cachedValue = getSnapshot();
3456
- objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = true);
3457
- }
3458
- cachedValue = useState({
3459
- inst: {
3460
- value: value,
3461
- getSnapshot: getSnapshot
3462
- }
3463
- });
3464
- var inst = cachedValue[0].inst,
3465
- forceUpdate = cachedValue[1];
3466
- useLayoutEffect(function () {
3467
- inst.value = value;
3468
- inst.getSnapshot = getSnapshot;
3469
- checkIfSnapshotChanged(inst) && forceUpdate({
3470
- inst: inst
3471
- });
3472
- }, [subscribe, value, getSnapshot]);
3473
- useEffect(function () {
3474
- checkIfSnapshotChanged(inst) && forceUpdate({
3475
- inst: inst
3476
- });
3477
- return subscribe(function () {
3478
- checkIfSnapshotChanged(inst) && forceUpdate({
3479
- inst: inst
3480
- });
3481
- });
3482
- }, [subscribe]);
3483
- useDebugValue(value);
3484
- return value;
3485
- }
3486
- function checkIfSnapshotChanged(inst) {
3487
- var latestGetSnapshot = inst.getSnapshot;
3488
- inst = inst.value;
3489
- try {
3490
- var nextValue = latestGetSnapshot();
3491
- return !objectIs(inst, nextValue);
3492
- } catch (error) {
3493
- return true;
3494
- }
3495
- }
3496
- function useSyncExternalStore$1(subscribe, getSnapshot) {
3497
- return getSnapshot();
3498
- }
3499
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
3500
- var React$1 = React,
3501
- objectIs = "function" === typeof Object.is ? Object.is : is,
3502
- useState = React$1.useState,
3503
- useEffect = React$1.useEffect,
3504
- useLayoutEffect = React$1.useLayoutEffect,
3505
- useDebugValue = React$1.useDebugValue,
3506
- didWarnOld18Alpha = false,
3507
- didWarnUncachedGetSnapshot = false,
3508
- shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
3509
- useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
3510
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
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
- shim.exports = useSyncExternalStoreShim_development;
3538
+ {
3539
+ shim.exports = requireUseSyncExternalStoreShim_development();
3540
+ }
3541
+ return shim.exports;
3515
3542
  }
3516
3543
 
3517
- var shimExports = shim.exports;
3544
+ var shimExports = requireShim();
3518
3545
 
3519
3546
  const notReadyT = (k, optsOrDefaultValue) => {
3520
3547
  if (isString(optsOrDefaultValue)) return optsOrDefaultValue;