@nice2dev/i18n 1.1.7 → 1.1.10
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/dist/calendar-systems.cjs +1 -0
- package/dist/calendar-systems.mjs +412 -0
- package/dist/dictionaries/ar.cjs +1 -0
- package/dist/dictionaries/ar.mjs +375 -0
- package/dist/dictionaries/bg.cjs +1 -0
- package/dist/dictionaries/bg.mjs +67 -0
- package/dist/dictionaries/bn.cjs +1 -0
- package/dist/dictionaries/bn.mjs +23 -0
- package/dist/dictionaries/cs.cjs +1 -0
- package/dist/dictionaries/cs.mjs +375 -0
- package/dist/dictionaries/da.cjs +1 -0
- package/dist/dictionaries/da.mjs +75 -0
- package/dist/dictionaries/de.cjs +1 -0
- package/dist/dictionaries/de.mjs +3398 -0
- package/dist/dictionaries/en.cjs +1 -0
- package/dist/dictionaries/en.mjs +3443 -0
- package/dist/dictionaries/es.cjs +1 -0
- package/dist/dictionaries/es.mjs +3396 -0
- package/dist/dictionaries/fi.cjs +1 -0
- package/dist/dictionaries/fi.mjs +75 -0
- package/dist/dictionaries/fil.cjs +1 -0
- package/dist/dictionaries/fil.mjs +19 -0
- package/dist/dictionaries/fr.cjs +1 -0
- package/dist/dictionaries/fr.mjs +3398 -0
- package/dist/dictionaries/hi.cjs +1 -0
- package/dist/dictionaries/hi.mjs +23 -0
- package/dist/dictionaries/hu.cjs +1 -0
- package/dist/dictionaries/hu.mjs +75 -0
- package/dist/dictionaries/id.cjs +1 -0
- package/dist/dictionaries/id.mjs +23 -0
- package/dist/dictionaries/index.cjs +1 -0
- package/dist/dictionaries/index.mjs +95 -0
- package/dist/dictionaries/it.cjs +1 -0
- package/dist/dictionaries/it.mjs +297 -0
- package/dist/dictionaries/ja.cjs +1 -0
- package/dist/dictionaries/ja.mjs +375 -0
- package/dist/dictionaries/ko.cjs +1 -0
- package/dist/dictionaries/ko.mjs +375 -0
- package/dist/dictionaries/ms.cjs +1 -0
- package/dist/dictionaries/ms.mjs +23 -0
- package/dist/dictionaries/nl.cjs +1 -0
- package/dist/dictionaries/nl.mjs +97 -0
- package/dist/dictionaries/no.cjs +1 -0
- package/dist/dictionaries/no.mjs +75 -0
- package/dist/dictionaries/pl.cjs +1 -0
- package/dist/dictionaries/pl.mjs +3404 -0
- package/dist/dictionaries/pt.cjs +1 -0
- package/dist/dictionaries/pt.mjs +375 -0
- package/dist/dictionaries/ro.cjs +1 -0
- package/dist/dictionaries/ro.mjs +67 -0
- package/dist/dictionaries/sk.cjs +1 -0
- package/dist/dictionaries/sk.mjs +75 -0
- package/dist/dictionaries/sv.cjs +1 -0
- package/dist/dictionaries/sv.mjs +82 -0
- package/dist/dictionaries/sw.cjs +1 -0
- package/dist/dictionaries/sw.mjs +23 -0
- package/dist/dictionaries/th.cjs +1 -0
- package/dist/dictionaries/th.mjs +23 -0
- package/dist/dictionaries/uk.cjs +1 -0
- package/dist/dictionaries/uk.mjs +3396 -0
- package/dist/dictionaries/vi.cjs +1 -0
- package/dist/dictionaries/vi.mjs +23 -0
- package/dist/dictionaries/zh.cjs +1 -0
- package/dist/dictionaries/zh.mjs +375 -0
- package/dist/dynamic-loading.cjs +1 -0
- package/dist/dynamic-loading.mjs +274 -0
- package/dist/i18n.cjs +1 -0
- package/dist/i18n.mjs +57 -0
- package/dist/i18nContext.cjs +1 -0
- package/dist/i18nContext.mjs +11 -0
- package/dist/i18nDictionaries.cjs +1 -0
- package/dist/i18nDictionaries.mjs +61 -0
- package/dist/icu.cjs +1 -0
- package/dist/icu.mjs +242 -0
- package/dist/index.cjs +1 -24
- package/dist/index.d.ts +72 -2
- package/dist/index.mjs +128 -12616
- package/dist/languages.cjs +1 -0
- package/dist/languages.mjs +44 -0
- package/dist/lazyDictionaries.cjs +1 -0
- package/dist/lazyDictionaries.mjs +95 -0
- package/dist/locale.cjs +1 -0
- package/dist/locale.mjs +94 -0
- package/dist/pseudo-localization.cjs +1 -0
- package/dist/pseudo-localization.mjs +272 -0
- package/dist/rtl.cjs +1 -0
- package/dist/rtl.mjs +155 -0
- package/dist/timezone.cjs +1 -0
- package/dist/timezone.mjs +195 -0
- package/dist/translate-pipeline.cjs +24 -0
- package/dist/translate-pipeline.mjs +79 -0
- package/dist/translationMemory.cjs +1 -0
- package/dist/translationMemory.mjs +207 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["en","pl","de","fr","es","it","pt","nl","sv","no","da","fi","cs","sk","hu","ro","bg","uk","ja","ko","zh","ar","hi","bn","th","vi","id","sw","fil","ms"];exports.NICE_SUPPORTED_LANGS=e;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const s = [
|
|
2
|
+
"en",
|
|
3
|
+
"pl",
|
|
4
|
+
"de",
|
|
5
|
+
"fr",
|
|
6
|
+
"es",
|
|
7
|
+
"it",
|
|
8
|
+
"pt",
|
|
9
|
+
"nl",
|
|
10
|
+
"sv",
|
|
11
|
+
"no",
|
|
12
|
+
"da",
|
|
13
|
+
"fi",
|
|
14
|
+
"cs",
|
|
15
|
+
"sk",
|
|
16
|
+
"hu",
|
|
17
|
+
"ro",
|
|
18
|
+
"bg",
|
|
19
|
+
"uk",
|
|
20
|
+
"ja",
|
|
21
|
+
"ko",
|
|
22
|
+
"zh",
|
|
23
|
+
"ar",
|
|
24
|
+
// ── Added in v1.0.10 (G4.1 — 30+ languages) ──
|
|
25
|
+
"hi",
|
|
26
|
+
// Hindi
|
|
27
|
+
"bn",
|
|
28
|
+
// Bengali
|
|
29
|
+
"th",
|
|
30
|
+
// Thai
|
|
31
|
+
"vi",
|
|
32
|
+
// Vietnamese
|
|
33
|
+
"id",
|
|
34
|
+
// Indonesian
|
|
35
|
+
"sw",
|
|
36
|
+
// Swahili
|
|
37
|
+
"fil",
|
|
38
|
+
// Filipino
|
|
39
|
+
"ms"
|
|
40
|
+
// Malay
|
|
41
|
+
];
|
|
42
|
+
export {
|
|
43
|
+
s as NICE_SUPPORTED_LANGS
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),q=require("react"),j=require("./i18nContext.cjs"),e=r=>Object.freeze(Object.defineProperty({__proto__:null,default:r},Symbol.toStringTag,{value:"Module"})),x={en:()=>Promise.resolve().then(()=>e(require("./dictionaries/en.cjs"))),pl:()=>Promise.resolve().then(()=>e(require("./dictionaries/pl.cjs"))),de:()=>Promise.resolve().then(()=>e(require("./dictionaries/de.cjs"))),fr:()=>Promise.resolve().then(()=>e(require("./dictionaries/fr.cjs"))),es:()=>Promise.resolve().then(()=>e(require("./dictionaries/es.cjs"))),it:()=>Promise.resolve().then(()=>e(require("./dictionaries/it.cjs"))),pt:()=>Promise.resolve().then(()=>e(require("./dictionaries/pt.cjs"))),nl:()=>Promise.resolve().then(()=>e(require("./dictionaries/nl.cjs"))),sv:()=>Promise.resolve().then(()=>e(require("./dictionaries/sv.cjs"))),no:()=>Promise.resolve().then(()=>e(require("./dictionaries/no.cjs"))),da:()=>Promise.resolve().then(()=>e(require("./dictionaries/da.cjs"))),fi:()=>Promise.resolve().then(()=>e(require("./dictionaries/fi.cjs"))),cs:()=>Promise.resolve().then(()=>e(require("./dictionaries/cs.cjs"))),sk:()=>Promise.resolve().then(()=>e(require("./dictionaries/sk.cjs"))),hu:()=>Promise.resolve().then(()=>e(require("./dictionaries/hu.cjs"))),ro:()=>Promise.resolve().then(()=>e(require("./dictionaries/ro.cjs"))),bg:()=>Promise.resolve().then(()=>e(require("./dictionaries/bg.cjs"))),uk:()=>Promise.resolve().then(()=>e(require("./dictionaries/uk.cjs"))),ja:()=>Promise.resolve().then(()=>e(require("./dictionaries/ja.cjs"))),ko:()=>Promise.resolve().then(()=>e(require("./dictionaries/ko.cjs"))),zh:()=>Promise.resolve().then(()=>e(require("./dictionaries/zh.cjs"))),ar:()=>Promise.resolve().then(()=>e(require("./dictionaries/ar.cjs"))),hi:()=>Promise.resolve().then(()=>e(require("./dictionaries/hi.cjs"))),bn:()=>Promise.resolve().then(()=>e(require("./dictionaries/bn.cjs"))),th:()=>Promise.resolve().then(()=>e(require("./dictionaries/th.cjs"))),vi:()=>Promise.resolve().then(()=>e(require("./dictionaries/vi.cjs"))),id:()=>Promise.resolve().then(()=>e(require("./dictionaries/id.cjs"))),sw:()=>Promise.resolve().then(()=>e(require("./dictionaries/sw.cjs"))),fil:()=>Promise.resolve().then(()=>e(require("./dictionaries/fil.cjs"))),ms:()=>Promise.resolve().then(()=>e(require("./dictionaries/ms.cjs")))},h=new Map,v=new Map;function L(r){return h.get(r)}function D(r){const t=h.get(r);if(t)return Promise.resolve(t);let o=v.get(r);return o||(o=(x[r]??x.en)().then(s=>(h.set(r,s.default),v.delete(r),s.default),s=>{throw v.delete(r),s}),v.set(r,o)),o}const S=({t:r,lang:t="en",overrides:o,fallback:d,onError:s,children:a})=>{const[n,f]=q.useState(null),P=q.useRef(s);P.current=s;const y=h.get(t),b=y?t:n==null?void 0:n.lang,l=y??(n==null?void 0:n.dict);q.useEffect(()=>{if(r)return;const c=h.get(t);if(c){f(i=>(i==null?void 0:i.lang)===t?i:{lang:t,dict:c});return}let u=!0;return D(t).then(i=>{u&&f({lang:t,dict:i})},i=>{var N;u&&((N=P.current)==null||N.call(P,i))}),()=>{u=!1}},[t,r]);const w=q.useMemo(()=>{const c=l&&o?{...l,...o}:l??o;return c?(u,i)=>c[u]??i:(u,i)=>i},[l,o]);return r?m.jsx(j.NiceI18nContextProvider,{t:r,lang:t,children:a}):!l&&d!==void 0?m.jsx(m.Fragment,{children:d}):m.jsx(j.NiceI18nContextProvider,{t:w,lang:b??"en",children:a})};exports.NiceI18nLazyProvider=S;exports.getLoadedNiceDictionary=L;exports.loadNiceDictionary=D;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx as h, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { useState as M, useRef as P, useEffect as j, useMemo as z } from "react";
|
|
3
|
+
import { NiceI18nContextProvider as D } from "./i18nContext.mjs";
|
|
4
|
+
const L = {
|
|
5
|
+
en: () => import("./dictionaries/en.mjs"),
|
|
6
|
+
pl: () => import("./dictionaries/pl.mjs"),
|
|
7
|
+
de: () => import("./dictionaries/de.mjs"),
|
|
8
|
+
fr: () => import("./dictionaries/fr.mjs"),
|
|
9
|
+
es: () => import("./dictionaries/es.mjs"),
|
|
10
|
+
it: () => import("./dictionaries/it.mjs"),
|
|
11
|
+
pt: () => import("./dictionaries/pt.mjs"),
|
|
12
|
+
nl: () => import("./dictionaries/nl.mjs"),
|
|
13
|
+
sv: () => import("./dictionaries/sv.mjs"),
|
|
14
|
+
no: () => import("./dictionaries/no.mjs"),
|
|
15
|
+
da: () => import("./dictionaries/da.mjs"),
|
|
16
|
+
fi: () => import("./dictionaries/fi.mjs"),
|
|
17
|
+
cs: () => import("./dictionaries/cs.mjs"),
|
|
18
|
+
sk: () => import("./dictionaries/sk.mjs"),
|
|
19
|
+
hu: () => import("./dictionaries/hu.mjs"),
|
|
20
|
+
ro: () => import("./dictionaries/ro.mjs"),
|
|
21
|
+
bg: () => import("./dictionaries/bg.mjs"),
|
|
22
|
+
uk: () => import("./dictionaries/uk.mjs"),
|
|
23
|
+
ja: () => import("./dictionaries/ja.mjs"),
|
|
24
|
+
ko: () => import("./dictionaries/ko.mjs"),
|
|
25
|
+
zh: () => import("./dictionaries/zh.mjs"),
|
|
26
|
+
ar: () => import("./dictionaries/ar.mjs"),
|
|
27
|
+
hi: () => import("./dictionaries/hi.mjs"),
|
|
28
|
+
bn: () => import("./dictionaries/bn.mjs"),
|
|
29
|
+
th: () => import("./dictionaries/th.mjs"),
|
|
30
|
+
vi: () => import("./dictionaries/vi.mjs"),
|
|
31
|
+
id: () => import("./dictionaries/id.mjs"),
|
|
32
|
+
sw: () => import("./dictionaries/sw.mjs"),
|
|
33
|
+
fil: () => import("./dictionaries/fil.mjs"),
|
|
34
|
+
ms: () => import("./dictionaries/ms.mjs")
|
|
35
|
+
}, c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
36
|
+
function q(t) {
|
|
37
|
+
return c.get(t);
|
|
38
|
+
}
|
|
39
|
+
function A(t) {
|
|
40
|
+
const o = c.get(t);
|
|
41
|
+
if (o)
|
|
42
|
+
return Promise.resolve(o);
|
|
43
|
+
let i = u.get(t);
|
|
44
|
+
return i || (i = (L[t] ?? L.en)().then(
|
|
45
|
+
(e) => (c.set(t, e.default), u.delete(t), e.default),
|
|
46
|
+
(e) => {
|
|
47
|
+
throw u.delete(t), e;
|
|
48
|
+
}
|
|
49
|
+
), u.set(t, i)), i;
|
|
50
|
+
}
|
|
51
|
+
const C = ({
|
|
52
|
+
t,
|
|
53
|
+
lang: o = "en",
|
|
54
|
+
overrides: i,
|
|
55
|
+
fallback: f,
|
|
56
|
+
onError: e,
|
|
57
|
+
children: a
|
|
58
|
+
}) => {
|
|
59
|
+
const [n, w] = M(
|
|
60
|
+
null
|
|
61
|
+
), d = P(e);
|
|
62
|
+
d.current = e;
|
|
63
|
+
const l = c.get(o), N = l ? o : n == null ? void 0 : n.lang, p = l ?? (n == null ? void 0 : n.dict);
|
|
64
|
+
j(() => {
|
|
65
|
+
if (t)
|
|
66
|
+
return;
|
|
67
|
+
const s = c.get(o);
|
|
68
|
+
if (s) {
|
|
69
|
+
w((r) => (r == null ? void 0 : r.lang) === o ? r : { lang: o, dict: s });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
let m = !0;
|
|
73
|
+
return A(o).then(
|
|
74
|
+
(r) => {
|
|
75
|
+
m && w({ lang: o, dict: r });
|
|
76
|
+
},
|
|
77
|
+
(r) => {
|
|
78
|
+
var y;
|
|
79
|
+
m && ((y = d.current) == null || y.call(d, r));
|
|
80
|
+
}
|
|
81
|
+
), () => {
|
|
82
|
+
m = !1;
|
|
83
|
+
};
|
|
84
|
+
}, [o, t]);
|
|
85
|
+
const k = z(() => {
|
|
86
|
+
const s = p && i ? { ...p, ...i } : p ?? i;
|
|
87
|
+
return s ? (m, r) => s[m] ?? r : (m, r) => r;
|
|
88
|
+
}, [p, i]);
|
|
89
|
+
return t ? /* @__PURE__ */ h(D, { t, lang: o, children: a }) : !p && f !== void 0 ? /* @__PURE__ */ h(x, { children: f }) : /* @__PURE__ */ h(D, { t: k, lang: N ?? "en", children: a });
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
C as NiceI18nLazyProvider,
|
|
93
|
+
q as getLoadedNiceDictionary,
|
|
94
|
+
A as loadNiceDictionary
|
|
95
|
+
};
|
package/dist/locale.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),D={en:"en-US",pl:"pl-PL",de:"de-DE",fr:"fr-FR",es:"es-ES",it:"it-IT",pt:"pt-BR",nl:"nl-NL",sv:"sv-SE",no:"nb-NO",da:"da-DK",fi:"fi-FI",cs:"cs-CZ",sk:"sk-SK",hu:"hu-HU",ro:"ro-RO",bg:"bg-BG",uk:"uk-UA",ja:"ja-JP",ko:"ko-KR",zh:"zh-CN",ar:"ar-SA",hi:"hi-IN",bn:"bn-BD",th:"th-TH",vi:"vi-VN",id:"id-ID",sw:"sw-KE",fil:"fil-PH",ms:"ms-MY"};function m(e){return D[e]??"en-US"}function c(e,r="medium"){const o=m(e),n=new Intl.DateTimeFormat(o,{dateStyle:r});return{format:t=>n.format(t instanceof Date?t:new Date(t)),formatRange:(t,a)=>{const l=t instanceof Date?t:new Date(t),F=a instanceof Date?a:new Date(a);return n.formatRange(l,F)},formatRelative:t=>M(t instanceof Date?t:new Date(t),o)}}function N(e,r="medium"){return u.useMemo(()=>c(e,r),[e,r])}function i(e,r="short"){const o=m(e),n=new Intl.DateTimeFormat(o,{timeStyle:r});return{format:t=>n.format(t instanceof Date?t:new Date(t))}}function h(e,r="short"){return u.useMemo(()=>i(e,r),[e,r])}function f(e){const r=m(e);return{format:o=>new Intl.NumberFormat(r).format(o),formatCompact:o=>new Intl.NumberFormat(r,{notation:"compact"}).format(o),formatPercent:o=>new Intl.NumberFormat(r,{style:"percent",maximumFractionDigits:1}).format(o)}}function b(e){return u.useMemo(()=>f(e),[e])}function s(e,r="USD"){const o=m(e),n=new Intl.NumberFormat(o,{style:"currency",currency:r});return{format:t=>n.format(t)}}function w(e,r="USD"){return u.useMemo(()=>s(e,r),[e,r])}function M(e,r){const o=Date.now(),n=e.getTime()-o,t=Math.abs(n),a=new Intl.RelativeTimeFormat(r,{numeric:"auto"});return t<6e4?a.format(Math.round(n/1e3),"second"):t<36e5?a.format(Math.round(n/6e4),"minute"):t<864e5?a.format(Math.round(n/36e5),"hour"):t<2592e6?a.format(Math.round(n/864e5),"day"):t<31536e6?a.format(Math.round(n/2592e6),"month"):a.format(Math.round(n/31536e6),"year")}exports.createCurrencyFormatter=s;exports.createDateFormatter=c;exports.createNumberFormatter=f;exports.createTimeFormatter=i;exports.getLocaleTag=m;exports.useNiceCurrencyFormat=w;exports.useNiceDateFormat=N;exports.useNiceNumberFormat=b;exports.useNiceTimeFormat=h;
|
package/dist/locale.mjs
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { useMemo as m } from "react";
|
|
2
|
+
const c = {
|
|
3
|
+
en: "en-US",
|
|
4
|
+
pl: "pl-PL",
|
|
5
|
+
de: "de-DE",
|
|
6
|
+
fr: "fr-FR",
|
|
7
|
+
es: "es-ES",
|
|
8
|
+
it: "it-IT",
|
|
9
|
+
pt: "pt-BR",
|
|
10
|
+
nl: "nl-NL",
|
|
11
|
+
sv: "sv-SE",
|
|
12
|
+
no: "nb-NO",
|
|
13
|
+
da: "da-DK",
|
|
14
|
+
fi: "fi-FI",
|
|
15
|
+
cs: "cs-CZ",
|
|
16
|
+
sk: "sk-SK",
|
|
17
|
+
hu: "hu-HU",
|
|
18
|
+
ro: "ro-RO",
|
|
19
|
+
bg: "bg-BG",
|
|
20
|
+
uk: "uk-UA",
|
|
21
|
+
ja: "ja-JP",
|
|
22
|
+
ko: "ko-KR",
|
|
23
|
+
zh: "zh-CN",
|
|
24
|
+
ar: "ar-SA",
|
|
25
|
+
hi: "hi-IN",
|
|
26
|
+
bn: "bn-BD",
|
|
27
|
+
th: "th-TH",
|
|
28
|
+
vi: "vi-VN",
|
|
29
|
+
id: "id-ID",
|
|
30
|
+
sw: "sw-KE",
|
|
31
|
+
fil: "fil-PH",
|
|
32
|
+
ms: "ms-MY"
|
|
33
|
+
};
|
|
34
|
+
function i(t) {
|
|
35
|
+
return c[t] ?? "en-US";
|
|
36
|
+
}
|
|
37
|
+
function s(t, r = "medium") {
|
|
38
|
+
const n = i(t), o = new Intl.DateTimeFormat(n, { dateStyle: r });
|
|
39
|
+
return {
|
|
40
|
+
format: (e) => o.format(e instanceof Date ? e : new Date(e)),
|
|
41
|
+
formatRange: (e, a) => {
|
|
42
|
+
const f = e instanceof Date ? e : new Date(e), u = a instanceof Date ? a : new Date(a);
|
|
43
|
+
return o.formatRange(f, u);
|
|
44
|
+
},
|
|
45
|
+
formatRelative: (e) => F(e instanceof Date ? e : new Date(e), n)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function N(t, r = "medium") {
|
|
49
|
+
return m(() => s(t, r), [t, r]);
|
|
50
|
+
}
|
|
51
|
+
function l(t, r = "short") {
|
|
52
|
+
const n = i(t), o = new Intl.DateTimeFormat(n, { timeStyle: r });
|
|
53
|
+
return {
|
|
54
|
+
format: (e) => o.format(e instanceof Date ? e : new Date(e))
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function b(t, r = "short") {
|
|
58
|
+
return m(() => l(t, r), [t, r]);
|
|
59
|
+
}
|
|
60
|
+
function D(t) {
|
|
61
|
+
const r = i(t);
|
|
62
|
+
return {
|
|
63
|
+
format: (n) => new Intl.NumberFormat(r).format(n),
|
|
64
|
+
formatCompact: (n) => new Intl.NumberFormat(r, { notation: "compact" }).format(n),
|
|
65
|
+
formatPercent: (n) => new Intl.NumberFormat(r, { style: "percent", maximumFractionDigits: 1 }).format(n)
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function d(t) {
|
|
69
|
+
return m(() => D(t), [t]);
|
|
70
|
+
}
|
|
71
|
+
function h(t, r = "USD") {
|
|
72
|
+
const n = i(t), o = new Intl.NumberFormat(n, { style: "currency", currency: r });
|
|
73
|
+
return {
|
|
74
|
+
format: (e) => o.format(e)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function I(t, r = "USD") {
|
|
78
|
+
return m(() => h(t, r), [t, r]);
|
|
79
|
+
}
|
|
80
|
+
function F(t, r) {
|
|
81
|
+
const n = Date.now(), o = t.getTime() - n, e = Math.abs(o), a = new Intl.RelativeTimeFormat(r, { numeric: "auto" });
|
|
82
|
+
return e < 6e4 ? a.format(Math.round(o / 1e3), "second") : e < 36e5 ? a.format(Math.round(o / 6e4), "minute") : e < 864e5 ? a.format(Math.round(o / 36e5), "hour") : e < 2592e6 ? a.format(Math.round(o / 864e5), "day") : e < 31536e6 ? a.format(Math.round(o / 2592e6), "month") : a.format(Math.round(o / 31536e6), "year");
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
h as createCurrencyFormatter,
|
|
86
|
+
s as createDateFormatter,
|
|
87
|
+
D as createNumberFormatter,
|
|
88
|
+
l as createTimeFormatter,
|
|
89
|
+
i as getLocaleTag,
|
|
90
|
+
I as useNiceCurrencyFormat,
|
|
91
|
+
N as useNiceDateFormat,
|
|
92
|
+
d as useNiceNumberFormat,
|
|
93
|
+
b as useNiceTimeFormat
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),l=require("react"),P={a:"ą",b:"ɓ",c:"ç",d:"ð",e:"ë",f:"ƒ",g:"ğ",h:"ĥ",i:"ï",j:"ĵ",k:"ķ",l:"ľ",m:"ɱ",n:"ñ",o:"ő",p:"þ",q:"ǫ",r:"ř",s:"š",t:"ŧ",u:"ü",v:"ṽ",w:"ŵ",x:"χ",y:"ÿ",z:"ž",A:"Ą",B:"Ɓ",C:"Ç",D:"Ð",E:"Ë",F:"Ƒ",G:"Ğ",H:"Ĥ",I:"Ï",J:"Ĵ",K:"Ķ",L:"Ľ",M:"Ṁ",N:"Ñ",O:"Ő",P:"Þ",Q:"Ǫ",R:"Ř",S:"Š",T:"Ŧ",U:"Ü",V:"Ṽ",W:"Ŵ",X:"Χ",Y:"Ÿ",Z:"Ž"},I={...P,a:"ặ",e:"ệ",i:"ị",o:"ộ",u:"ụ",y:"ỵ",A:"Ặ",E:"Ệ",I:"Ị",O:"Ộ",U:"Ụ",Y:"Ỵ"},z="",D="",M="",T="~∼~≈";function y(e,n=!1){const t=n?I:P;return e.split("").map(s=>t[s]||s).join("")}function F(e,n="[",t="]"){return`${n}${e}${t}`}function x(e,n=.3,t=!1){if(t)return N(e);const r=Math.ceil(e.length*(1+n))-e.length;if(r<=0)return e;const o=T[0].repeat(r);return e+o}function N(e){const n=new Set(["a","e","i","o","u","A","E","I","O","U"]);return e.split("").map(t=>n.has(t)?t+t:t).join("")}function B(e,n=!1){return n?`${D}${e}${M}`:`${z}${e}${M}`}function A(e,n={}){const{addBrackets:t=!0,expansionFactor:s=.3,addAccents:r=!0,addBidiMarkers:o=!1,useVowelDoubling:p=!1,preservePlaceholders:i=!0,preserveHtml:d=!0,prefix:c="[",suffix:m="]"}=n,k=new Map;let a=e,h=0;i&&(a=a.replace(/\{[^}]+\}/g,g=>{const u=`__PH${h++}__`;return k.set(u,g),u})),d&&(a=a.replace(/<[^>]+>/g,g=>{const u=`__PH${h++}__`;return k.set(u,g),u})),r&&(a=_(a,k)),s>0&&(a=x(a,s,p)),o&&(a=B(a)),t&&(a=`${c}${a}${m}`);for(const[g,u]of k.entries())a=a.replace(g,u);return a}function _(e,n){const t=new Set(n.keys());return e.split("").map(s=>{for(const r of t)if(e.includes(r)&&r.includes(s))return s;return P[s]||s}).join("")}function f(e){switch(e){case"accented":return{addBrackets:!0,addAccents:!0,expansionFactor:0,addBidiMarkers:!1};case"bidi":return{addBrackets:!0,addAccents:!1,expansionFactor:0,addBidiMarkers:!0};case"expansion":return{addBrackets:!0,addAccents:!1,expansionFactor:.4,addBidiMarkers:!1};case"full":default:return{addBrackets:!0,addAccents:!0,expansionFactor:.3,addBidiMarkers:!1,useVowelDoubling:!0}}}function C(e,n){const t={};for(const[s,r]of Object.entries(e))t[s]=A(r,n);return t}function L(e){return/[^\x00-\x7F]/.test(e)}function S(e){if(!e||/^[\d.,-]+$/.test(e)||e.startsWith("["))return!1;const n=/[a-zA-Z]{2,}/.test(e),t=L(e);return n&&!t}function v(e,n){const t={totalKeys:Object.keys(e).length,hardcodedStrings:[],emptyValues:[],placeholderMismatches:[],potentialIssues:0};for(const[s,r]of Object.entries(e)){if(!r||r.trim()===""){t.emptyValues.push(s),t.potentialIssues++;continue}if(S(r)&&t.hardcodedStrings.push(s),n&&n[s]){const o=E(r),p=E(n[s]),i=o.filter(c=>!p.includes(c)),d=p.filter(c=>!o.includes(c));(i.length>0||d.length>0)&&(t.placeholderMismatches.push({key:s,placeholders:[...i.map(c=>`-${c}`),...d.map(c=>`+${c}`)]}),t.potentialIssues++)}}return t}function E(e){return(e.match(/\{([^}]+)\}/g)||[]).map(t=>t.replace(/[{}]/g,"").split(",")[0].trim())}const $=l.createContext(null);function j({children:e,initialEnabled:n=!1,initialMode:t="full"}){const[s,r]=l.useState(n),[o,p]=l.useState(t),i=l.useMemo(()=>f(o),[o]),d=l.useMemo(()=>m=>s?A(m,i):m,[s,i]),c=l.useMemo(()=>({enabled:s,mode:o,options:i,toggle:()=>r(m=>!m),setMode:p,transform:d}),[s,o,i,d]);return b.jsx($.Provider,{value:c,children:e})}function w(){const e=l.useContext($);return e||{enabled:!1,mode:"full",options:f("full"),toggle:()=>{},setMode:()=>{},transform:n=>n}}const O={MINIMAL:{addBrackets:!0,addAccents:!1,expansionFactor:0},ACCENTED:f("accented"),EXPANDED:f("expansion"),BIDI:f("bidi"),FULL:f("full"),FINNISH:{addBrackets:!0,addAccents:!0,expansionFactor:.4},GERMAN:{addBrackets:!0,addAccents:!0,expansionFactor:.35},CJK:{addBrackets:!0,addAccents:!1,expansionFactor:-.1}};exports.PSEUDO_PRESETS=O;exports.PseudoLocalizationProvider=j;exports.addAccents=y;exports.addBidiMarkers=B;exports.addBrackets=F;exports.analyzeDictionary=v;exports.containsNonAscii=L;exports.detectHardcodedText=S;exports.expandText=x;exports.getPseudoLocalizationPreset=f;exports.pseudoLocalize=A;exports.pseudoLocalizeDictionary=C;exports.usePseudoLocalization=w;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { jsx as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useState as P, useMemo as k, useContext as I, createContext as b } from "react";
|
|
3
|
+
const A = {
|
|
4
|
+
// Lowercase
|
|
5
|
+
a: "ą",
|
|
6
|
+
b: "ɓ",
|
|
7
|
+
c: "ç",
|
|
8
|
+
d: "ð",
|
|
9
|
+
e: "ë",
|
|
10
|
+
f: "ƒ",
|
|
11
|
+
g: "ğ",
|
|
12
|
+
h: "ĥ",
|
|
13
|
+
i: "ï",
|
|
14
|
+
j: "ĵ",
|
|
15
|
+
k: "ķ",
|
|
16
|
+
l: "ľ",
|
|
17
|
+
m: "ɱ",
|
|
18
|
+
n: "ñ",
|
|
19
|
+
o: "ő",
|
|
20
|
+
p: "þ",
|
|
21
|
+
q: "ǫ",
|
|
22
|
+
r: "ř",
|
|
23
|
+
s: "š",
|
|
24
|
+
t: "ŧ",
|
|
25
|
+
u: "ü",
|
|
26
|
+
v: "ṽ",
|
|
27
|
+
w: "ŵ",
|
|
28
|
+
x: "χ",
|
|
29
|
+
y: "ÿ",
|
|
30
|
+
z: "ž",
|
|
31
|
+
// Uppercase
|
|
32
|
+
A: "Ą",
|
|
33
|
+
B: "Ɓ",
|
|
34
|
+
C: "Ç",
|
|
35
|
+
D: "Ð",
|
|
36
|
+
E: "Ë",
|
|
37
|
+
F: "Ƒ",
|
|
38
|
+
G: "Ğ",
|
|
39
|
+
H: "Ĥ",
|
|
40
|
+
I: "Ï",
|
|
41
|
+
J: "Ĵ",
|
|
42
|
+
K: "Ķ",
|
|
43
|
+
L: "Ľ",
|
|
44
|
+
M: "Ṁ",
|
|
45
|
+
N: "Ñ",
|
|
46
|
+
O: "Ő",
|
|
47
|
+
P: "Þ",
|
|
48
|
+
Q: "Ǫ",
|
|
49
|
+
R: "Ř",
|
|
50
|
+
S: "Š",
|
|
51
|
+
T: "Ŧ",
|
|
52
|
+
U: "Ü",
|
|
53
|
+
V: "Ṽ",
|
|
54
|
+
W: "Ŵ",
|
|
55
|
+
X: "Χ",
|
|
56
|
+
Y: "Ÿ",
|
|
57
|
+
Z: "Ž"
|
|
58
|
+
}, F = {
|
|
59
|
+
...A,
|
|
60
|
+
// Additional mappings
|
|
61
|
+
a: "ặ",
|
|
62
|
+
e: "ệ",
|
|
63
|
+
i: "ị",
|
|
64
|
+
o: "ộ",
|
|
65
|
+
u: "ụ",
|
|
66
|
+
y: "ỵ",
|
|
67
|
+
A: "Ặ",
|
|
68
|
+
E: "Ệ",
|
|
69
|
+
I: "Ị",
|
|
70
|
+
O: "Ộ",
|
|
71
|
+
U: "Ụ",
|
|
72
|
+
Y: "Ỵ"
|
|
73
|
+
}, L = "", N = "", M = "", _ = "~∼~≈";
|
|
74
|
+
function j(e, n = !1) {
|
|
75
|
+
const t = n ? F : A;
|
|
76
|
+
return e.split("").map((s) => t[s] || s).join("");
|
|
77
|
+
}
|
|
78
|
+
function H(e, n = "[", t = "]") {
|
|
79
|
+
return `${n}${e}${t}`;
|
|
80
|
+
}
|
|
81
|
+
function C(e, n = 0.3, t = !1) {
|
|
82
|
+
if (t)
|
|
83
|
+
return D(e);
|
|
84
|
+
const r = Math.ceil(e.length * (1 + n)) - e.length;
|
|
85
|
+
if (r <= 0)
|
|
86
|
+
return e;
|
|
87
|
+
const o = _[0].repeat(r);
|
|
88
|
+
return e + o;
|
|
89
|
+
}
|
|
90
|
+
function D(e) {
|
|
91
|
+
const n = /* @__PURE__ */ new Set(["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]);
|
|
92
|
+
return e.split("").map((t) => n.has(t) ? t + t : t).join("");
|
|
93
|
+
}
|
|
94
|
+
function S(e, n = !1) {
|
|
95
|
+
return n ? `${N}${e}${M}` : `${L}${e}${M}`;
|
|
96
|
+
}
|
|
97
|
+
function x(e, n = {}) {
|
|
98
|
+
const {
|
|
99
|
+
addBrackets: t = !0,
|
|
100
|
+
expansionFactor: s = 0.3,
|
|
101
|
+
addAccents: r = !0,
|
|
102
|
+
addBidiMarkers: o = !1,
|
|
103
|
+
useVowelDoubling: l = !1,
|
|
104
|
+
preservePlaceholders: i = !0,
|
|
105
|
+
preserveHtml: d = !0,
|
|
106
|
+
prefix: c = "[",
|
|
107
|
+
suffix: f = "]"
|
|
108
|
+
} = n, g = /* @__PURE__ */ new Map();
|
|
109
|
+
let a = e, h = 0;
|
|
110
|
+
i && (a = a.replace(/\{[^}]+\}/g, (m) => {
|
|
111
|
+
const u = `__PH${h++}__`;
|
|
112
|
+
return g.set(u, m), u;
|
|
113
|
+
})), d && (a = a.replace(/<[^>]+>/g, (m) => {
|
|
114
|
+
const u = `__PH${h++}__`;
|
|
115
|
+
return g.set(u, m), u;
|
|
116
|
+
})), r && (a = T(a, g)), s > 0 && (a = C(a, s, l)), o && (a = S(a)), t && (a = `${c}${a}${f}`);
|
|
117
|
+
for (const [m, u] of g.entries())
|
|
118
|
+
a = a.replace(m, u);
|
|
119
|
+
return a;
|
|
120
|
+
}
|
|
121
|
+
function T(e, n) {
|
|
122
|
+
const t = new Set(n.keys());
|
|
123
|
+
return e.split("").map((s) => {
|
|
124
|
+
for (const r of t)
|
|
125
|
+
if (e.includes(r) && r.includes(s))
|
|
126
|
+
return s;
|
|
127
|
+
return A[s] || s;
|
|
128
|
+
}).join("");
|
|
129
|
+
}
|
|
130
|
+
function p(e) {
|
|
131
|
+
switch (e) {
|
|
132
|
+
case "accented":
|
|
133
|
+
return {
|
|
134
|
+
addBrackets: !0,
|
|
135
|
+
addAccents: !0,
|
|
136
|
+
expansionFactor: 0,
|
|
137
|
+
addBidiMarkers: !1
|
|
138
|
+
};
|
|
139
|
+
case "bidi":
|
|
140
|
+
return {
|
|
141
|
+
addBrackets: !0,
|
|
142
|
+
addAccents: !1,
|
|
143
|
+
expansionFactor: 0,
|
|
144
|
+
addBidiMarkers: !0
|
|
145
|
+
};
|
|
146
|
+
case "expansion":
|
|
147
|
+
return {
|
|
148
|
+
addBrackets: !0,
|
|
149
|
+
addAccents: !1,
|
|
150
|
+
expansionFactor: 0.4,
|
|
151
|
+
addBidiMarkers: !1
|
|
152
|
+
};
|
|
153
|
+
case "full":
|
|
154
|
+
default:
|
|
155
|
+
return {
|
|
156
|
+
addBrackets: !0,
|
|
157
|
+
addAccents: !0,
|
|
158
|
+
expansionFactor: 0.3,
|
|
159
|
+
addBidiMarkers: !1,
|
|
160
|
+
useVowelDoubling: !0
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function O(e, n) {
|
|
165
|
+
const t = {};
|
|
166
|
+
for (const [s, r] of Object.entries(e))
|
|
167
|
+
t[s] = x(r, n);
|
|
168
|
+
return t;
|
|
169
|
+
}
|
|
170
|
+
function v(e) {
|
|
171
|
+
return /[^\x00-\x7F]/.test(e);
|
|
172
|
+
}
|
|
173
|
+
function w(e) {
|
|
174
|
+
if (!e || /^[\d.,-]+$/.test(e) || e.startsWith("["))
|
|
175
|
+
return !1;
|
|
176
|
+
const n = /[a-zA-Z]{2,}/.test(e), t = v(e);
|
|
177
|
+
return n && !t;
|
|
178
|
+
}
|
|
179
|
+
function V(e, n) {
|
|
180
|
+
const t = {
|
|
181
|
+
totalKeys: Object.keys(e).length,
|
|
182
|
+
hardcodedStrings: [],
|
|
183
|
+
emptyValues: [],
|
|
184
|
+
placeholderMismatches: [],
|
|
185
|
+
potentialIssues: 0
|
|
186
|
+
};
|
|
187
|
+
for (const [s, r] of Object.entries(e)) {
|
|
188
|
+
if (!r || r.trim() === "") {
|
|
189
|
+
t.emptyValues.push(s), t.potentialIssues++;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
if (w(r) && t.hardcodedStrings.push(s), n && n[s]) {
|
|
193
|
+
const o = E(r), l = E(n[s]), i = o.filter((c) => !l.includes(c)), d = l.filter((c) => !o.includes(c));
|
|
194
|
+
(i.length > 0 || d.length > 0) && (t.placeholderMismatches.push({
|
|
195
|
+
key: s,
|
|
196
|
+
placeholders: [
|
|
197
|
+
...i.map((c) => `-${c}`),
|
|
198
|
+
...d.map((c) => `+${c}`)
|
|
199
|
+
]
|
|
200
|
+
}), t.potentialIssues++);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return t;
|
|
204
|
+
}
|
|
205
|
+
function E(e) {
|
|
206
|
+
return (e.match(/\{([^}]+)\}/g) || []).map((t) => t.replace(/[{}]/g, "").split(",")[0].trim());
|
|
207
|
+
}
|
|
208
|
+
const B = b(null);
|
|
209
|
+
function R({
|
|
210
|
+
children: e,
|
|
211
|
+
initialEnabled: n = !1,
|
|
212
|
+
initialMode: t = "full"
|
|
213
|
+
}) {
|
|
214
|
+
const [s, r] = P(n), [o, l] = P(t), i = k(() => p(o), [o]), d = k(() => (f) => s ? x(f, i) : f, [s, i]), c = k(
|
|
215
|
+
() => ({
|
|
216
|
+
enabled: s,
|
|
217
|
+
mode: o,
|
|
218
|
+
options: i,
|
|
219
|
+
toggle: () => r((f) => !f),
|
|
220
|
+
setMode: l,
|
|
221
|
+
transform: d
|
|
222
|
+
}),
|
|
223
|
+
[s, o, i, d]
|
|
224
|
+
);
|
|
225
|
+
return /* @__PURE__ */ $(B.Provider, { value: c, children: e });
|
|
226
|
+
}
|
|
227
|
+
function U() {
|
|
228
|
+
const e = I(B);
|
|
229
|
+
return e || {
|
|
230
|
+
enabled: !1,
|
|
231
|
+
mode: "full",
|
|
232
|
+
options: p("full"),
|
|
233
|
+
toggle: () => {
|
|
234
|
+
},
|
|
235
|
+
setMode: () => {
|
|
236
|
+
},
|
|
237
|
+
transform: (n) => n
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
const G = {
|
|
241
|
+
/** Minimal: brackets only */
|
|
242
|
+
MINIMAL: { addBrackets: !0, addAccents: !1, expansionFactor: 0 },
|
|
243
|
+
/** Accented: brackets + accents */
|
|
244
|
+
ACCENTED: p("accented"),
|
|
245
|
+
/** Expanded: brackets + 30% expansion */
|
|
246
|
+
EXPANDED: p("expansion"),
|
|
247
|
+
/** Bidi: brackets + RTL markers */
|
|
248
|
+
BIDI: p("bidi"),
|
|
249
|
+
/** Full: brackets + accents + expansion */
|
|
250
|
+
FULL: p("full"),
|
|
251
|
+
/** Finnish: 40% expansion (Finnish is very long) */
|
|
252
|
+
FINNISH: { addBrackets: !0, addAccents: !0, expansionFactor: 0.4 },
|
|
253
|
+
/** German: 35% expansion */
|
|
254
|
+
GERMAN: { addBrackets: !0, addAccents: !0, expansionFactor: 0.35 },
|
|
255
|
+
/** CJK: Short expansion, no accents (CJK often shorter) */
|
|
256
|
+
CJK: { addBrackets: !0, addAccents: !1, expansionFactor: -0.1 }
|
|
257
|
+
};
|
|
258
|
+
export {
|
|
259
|
+
G as PSEUDO_PRESETS,
|
|
260
|
+
R as PseudoLocalizationProvider,
|
|
261
|
+
j as addAccents,
|
|
262
|
+
S as addBidiMarkers,
|
|
263
|
+
H as addBrackets,
|
|
264
|
+
V as analyzeDictionary,
|
|
265
|
+
v as containsNonAscii,
|
|
266
|
+
w as detectHardcodedText,
|
|
267
|
+
C as expandText,
|
|
268
|
+
p as getPseudoLocalizationPreset,
|
|
269
|
+
x as pseudoLocalize,
|
|
270
|
+
O as pseudoLocalizeDictionary,
|
|
271
|
+
U as usePseudoLocalization
|
|
272
|
+
};
|
package/dist/rtl.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),n=require("react"),a=["ar","he","fa","ur","yi","ps"];function s(t){return a.includes(t)}function f(t){return s(t)?"rtl":"ltr"}function c(t){if(typeof document>"u")return;const e=f(t);document.documentElement.setAttribute("dir",e),document.documentElement.setAttribute("lang",t)}function L(){return typeof document>"u"?"ltr":document.documentElement.getAttribute("dir")||"ltr"}function g(t,e){return e?t.rtl:t.ltr}function R(t){return t==="left"?"right":"left"}function p(t,e){return e&&{left:"right",right:"left",start:"end",end:"start","flex-start":"flex-end","flex-end":"flex-start"}[t]||t}function b(t){return{"margin-left":"margin-inline-start","margin-right":"margin-inline-end","padding-left":"padding-inline-start","padding-right":"padding-inline-end",left:"inset-inline-start",right:"inset-inline-end","border-left":"border-inline-start","border-right":"border-inline-end","border-left-width":"border-inline-start-width","border-right-width":"border-inline-end-width","border-left-color":"border-inline-start-color","border-right-color":"border-inline-end-color","border-left-style":"border-inline-start-style","border-right-style":"border-inline-end-style","border-top-left-radius":"border-start-start-radius","border-top-right-radius":"border-start-end-radius","border-bottom-left-radius":"border-end-start-radius","border-bottom-right-radius":"border-end-end-radius","text-align: left":"text-align: start","text-align: right":"text-align: end"}[t]||t}const u=n.createContext({dir:"ltr",isRTL:!1,flip:t=>t,value:t=>t.ltr}),T=({lang:t,autoSetDocument:e=!0,children:o})=>{const r=s(t),i=r?"rtl":"ltr";n.useEffect(()=>{e&&c(t)},[t,e]);const m=n.useMemo(()=>({dir:i,isRTL:r,flip:d=>p(d,r),value:d=>g(d,r)}),[i,r]);return h.jsx(u.Provider,{value:m,children:o})};function x(){return n.useContext(u)}function S(){return n.useContext(u).isRTL}function y(t){const e=[],o=["left","right","margin-left","margin-right","padding-left","padding-right","border-left","border-right"];for(const[r,i]of Object.entries(t))o.includes(r)&&e.push(`Use logical property instead of '${r}' → '${b(r)}'`),r==="text-align"&&(i==="left"||i==="right")&&e.push(`Use 'text-align: start/end' instead of 'text-align: ${i}'`),r==="float"&&(i==="left"||i==="right")&&e.push(`Use flexbox or grid instead of 'float: ${i}' for RTL support`);return e}const l={dirMultiplier:"--nice-dir-multiplier",inlineStart:"--nice-inline-start",inlineEnd:"--nice-inline-end"};function A(t){return{[l.dirMultiplier]:t?"-1":"1",[l.inlineStart]:t?"right":"left",[l.inlineEnd]:t?"left":"right"}}exports.RTLProvider=T;exports.RTL_CSS_VARS=l;exports.RTL_LANGUAGES=a;exports.analyzeStylesForRTL=y;exports.flipAlignment=p;exports.flipHorizontal=R;exports.getDocumentDirection=L;exports.getLogicalProperty=b;exports.getRTLCSSVars=A;exports.getTextDirection=f;exports.isRTLLanguage=s;exports.rtlValue=g;exports.setDocumentDirection=c;exports.useIsRTL=S;exports.useRTL=x;
|