@wordpress/i18n 6.4.1-next.f56bd8138.0 → 6.5.1-next.47f435fc9.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.
@@ -1,158 +1,61 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var default_i18n_exports = {};
20
+ __export(default_i18n_exports, {
21
+ __: () => __,
22
+ _n: () => _n,
23
+ _nx: () => _nx,
24
+ _x: () => _x,
25
+ default: () => default_i18n_default,
26
+ getLocaleData: () => getLocaleData,
27
+ hasTranslation: () => hasTranslation,
28
+ isRTL: () => isRTL,
29
+ resetLocaleData: () => resetLocaleData,
30
+ setLocaleData: () => setLocaleData,
31
+ subscribe: () => subscribe
5
32
  });
6
- exports.subscribe = exports.setLocaleData = exports.resetLocaleData = exports.isRTL = exports.hasTranslation = exports.getLocaleData = exports.default = exports._x = exports._nx = exports._n = exports.__ = void 0;
7
- var _createI18n = require("./create-i18n");
8
- var _hooks = require("@wordpress/hooks");
9
- /**
10
- * Internal dependencies
11
- */
12
-
13
- /**
14
- * WordPress dependencies
15
- */
16
-
17
- const i18n = (0, _createI18n.createI18n)(undefined, undefined, _hooks.defaultHooks);
18
-
19
- /**
20
- * Default, singleton instance of `I18n`.
21
- */
22
- var _default = exports.default = i18n;
23
- /*
24
- * Comments in this file are duplicated from ./i18n due to
25
- * https://github.com/WordPress/gutenberg/pull/20318#issuecomment-590837722
26
- */
27
- /**
28
- * Returns locale data by domain in a Jed-formatted JSON object shape.
29
- *
30
- * @see http://messageformat.github.io/Jed/
31
- *
32
- * @param { string | undefined } [domain] Domain for which to get the data.
33
- * @return { LocaleData } Locale data.
34
- */
35
- const getLocaleData = exports.getLocaleData = i18n.getLocaleData.bind(i18n);
36
-
37
- /**
38
- * Merges locale data into the Tannin instance by domain. Accepts data in a
39
- * Jed-formatted JSON object shape.
40
- *
41
- * @see http://messageformat.github.io/Jed/
42
- *
43
- * @param {LocaleData } [data] Locale data configuration.
44
- * @param {string | undefined} [domain] Domain for which configuration applies.
45
- */
46
- const setLocaleData = exports.setLocaleData = i18n.setLocaleData.bind(i18n);
47
-
48
- /**
49
- * Resets all current Tannin instance locale data and sets the specified
50
- * locale data for the domain. Accepts data in a Jed-formatted JSON object shape.
51
- *
52
- * @see http://messageformat.github.io/Jed/
53
- *
54
- * @param {LocaleData} [data] Locale data configuration.
55
- * @param {string | undefined} [domain] Domain for which configuration applies.
56
- */
57
- const resetLocaleData = exports.resetLocaleData = i18n.resetLocaleData.bind(i18n);
58
-
59
- /**
60
- * Subscribes to changes of locale data
61
- *
62
- * @param {SubscribeCallback} callback Subscription callback
63
- * @return {UnsubscribeCallback} Unsubscribe callback
64
- */
65
- const subscribe = exports.subscribe = i18n.subscribe.bind(i18n);
66
-
67
- /**
68
- * Retrieve the translation of text.
69
- *
70
- * @see https://developer.wordpress.org/reference/functions/__/
71
- *
72
- * @template {string} Text
73
- *
74
- * @param {Text} text Text to translate.
75
- * @param {string | undefined} domain Domain to retrieve the translated text.
76
- *
77
- * @return {TranslatableText<Text>} Translated text.
78
- */
79
- const __ = exports.__ = i18n.__.bind(i18n);
80
-
81
- /**
82
- * Retrieve translated string with gettext context.
83
- *
84
- * @see https://developer.wordpress.org/reference/functions/_x/
85
- *
86
- * @template {string} Text
87
- *
88
- * @param {Text} text Text to translate.
89
- * @param {string} context Context information for the translators.
90
- * @param {string | undefined} domain Domain to retrieve the translated text.
91
- *
92
- * @return {TranslatableText<Text>} Translated context string without pipe.
93
- */
94
- const _x = exports._x = i18n._x.bind(i18n);
95
-
96
- /**
97
- * Translates and retrieves the singular or plural form based on the supplied
98
- * number.
99
- *
100
- * @see https://developer.wordpress.org/reference/functions/_n/
101
- *
102
- * @template {string} Single
103
- * @template {string} Plural
104
- *
105
- * @param {Single} single The text to be used if the number is singular.
106
- * @param {Plural} plural The text to be used if the number is plural.
107
- * @param {number} number The number to compare against to use either the
108
- * singular or plural form.
109
- * @param {string | undefined} domain Domain to retrieve the translated text.
110
- *
111
- * @return {TranslatableText<Single | Plural>} The translated singular or plural form.
112
- */
113
- const _n = exports._n = i18n._n.bind(i18n);
114
-
115
- /**
116
- * Translates and retrieves the singular or plural form based on the supplied
117
- * number, with gettext context.
118
- *
119
- * @see https://developer.wordpress.org/reference/functions/_nx/
120
- *
121
- * @template {string} Single
122
- * @template {string} Plural
123
- * @param {Single} single The text to be used if the number is singular.
124
- *
125
- * @param {Single} single The text to be used if the number is singular.
126
- * @param {Plural} plural The text to be used if the number is plural.
127
- * @param {number} number The number to compare against to use either the
128
- * singular or plural form.
129
- * @param {string} context Context information for the translators.
130
- * @param {string | undefined} [domain] Domain to retrieve the translated text.
131
- *
132
- * @return {TranslatableText<Single | Plural>} The translated singular or plural form.
133
- */
134
- const _nx = exports._nx = i18n._nx.bind(i18n);
135
-
136
- /**
137
- * Check if current locale is RTL.
138
- *
139
- * **RTL (Right To Left)** is a locale property indicating that text is written from right to left.
140
- * For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common
141
- * language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,
142
- * including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).
143
- *
144
- * @return {boolean} Whether locale is RTL.
145
- */
146
- const isRTL = exports.isRTL = i18n.isRTL.bind(i18n);
147
-
148
- /**
149
- * Check if there is a translation for a given string (in singular form).
150
- *
151
- * @param {string} single Singular form of the string to look up.
152
- * @param {string} context Context information for the translators.
153
- * @param {string} domain Domain to retrieve the translated text.
154
- *
155
- * @return {boolean} Whether the translation exists or not.
156
- */
157
- const hasTranslation = exports.hasTranslation = i18n.hasTranslation.bind(i18n);
158
- //# sourceMappingURL=default-i18n.js.map
33
+ module.exports = __toCommonJS(default_i18n_exports);
34
+ var import_create_i18n = require("./create-i18n");
35
+ var import_hooks = require("@wordpress/hooks");
36
+ const i18n = (0, import_create_i18n.createI18n)(void 0, void 0, import_hooks.defaultHooks);
37
+ var default_i18n_default = i18n;
38
+ const getLocaleData = i18n.getLocaleData.bind(i18n);
39
+ const setLocaleData = i18n.setLocaleData.bind(i18n);
40
+ const resetLocaleData = i18n.resetLocaleData.bind(i18n);
41
+ const subscribe = i18n.subscribe.bind(i18n);
42
+ const __ = i18n.__.bind(i18n);
43
+ const _x = i18n._x.bind(i18n);
44
+ const _n = i18n._n.bind(i18n);
45
+ const _nx = i18n._nx.bind(i18n);
46
+ const isRTL = i18n.isRTL.bind(i18n);
47
+ const hasTranslation = i18n.hasTranslation.bind(i18n);
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ __,
51
+ _n,
52
+ _nx,
53
+ _x,
54
+ getLocaleData,
55
+ hasTranslation,
56
+ isRTL,
57
+ resetLocaleData,
58
+ setLocaleData,
59
+ subscribe
60
+ });
61
+ //# sourceMappingURL=default-i18n.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_createI18n","require","_hooks","i18n","createI18n","undefined","defaultHooks","_default","exports","default","getLocaleData","bind","setLocaleData","resetLocaleData","subscribe","__","_x","_n","_nx","isRTL","hasTranslation"],"sources":["@wordpress/i18n/src/default-i18n.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { createI18n } from './create-i18n';\n\n/**\n * WordPress dependencies\n */\nimport { defaultHooks } from '@wordpress/hooks';\nimport {\n\tLocaleData,\n\tSubscribeCallback,\n\tTranslatableText,\n\tUnsubscribeCallback,\n} from './types';\n\nconst i18n = createI18n( undefined, undefined, defaultHooks );\n\n/**\n * Default, singleton instance of `I18n`.\n */\nexport default i18n;\n\n/*\n * Comments in this file are duplicated from ./i18n due to\n * https://github.com/WordPress/gutenberg/pull/20318#issuecomment-590837722\n */\n\n/**\n * Returns locale data by domain in a Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param { string | undefined } [domain] Domain for which to get the data.\n * @return { LocaleData } Locale data.\n */\nexport const getLocaleData = i18n.getLocaleData.bind( i18n );\n\n/**\n * Merges locale data into the Tannin instance by domain. Accepts data in a\n * Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {LocaleData } [data] Locale data configuration.\n * @param {string | undefined} [domain] Domain for which configuration applies.\n */\nexport const setLocaleData = i18n.setLocaleData.bind( i18n );\n\n/**\n * Resets all current Tannin instance locale data and sets the specified\n * locale data for the domain. Accepts data in a Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {LocaleData} [data] Locale data configuration.\n * @param {string | undefined} [domain] Domain for which configuration applies.\n */\nexport const resetLocaleData = i18n.resetLocaleData.bind( i18n );\n\n/**\n * Subscribes to changes of locale data\n *\n * @param {SubscribeCallback} callback Subscription callback\n * @return {UnsubscribeCallback} Unsubscribe callback\n */\nexport const subscribe = i18n.subscribe.bind( i18n );\n\n/**\n * Retrieve the translation of text.\n *\n * @see https://developer.wordpress.org/reference/functions/__/\n *\n * @template {string} Text\n *\n * @param {Text} text Text to translate.\n * @param {string | undefined} domain Domain to retrieve the translated text.\n *\n * @return {TranslatableText<Text>} Translated text.\n */\nexport const __ = i18n.__.bind( i18n );\n\n/**\n * Retrieve translated string with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_x/\n *\n * @template {string} Text\n *\n * @param {Text} text Text to translate.\n * @param {string} context Context information for the translators.\n * @param {string | undefined} domain Domain to retrieve the translated text.\n *\n * @return {TranslatableText<Text>} Translated context string without pipe.\n */\nexport const _x = i18n._x.bind( i18n );\n\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number.\n *\n * @see https://developer.wordpress.org/reference/functions/_n/\n *\n * @template {string} Single\n * @template {string} Plural\n *\n * @param {Single} single The text to be used if the number is singular.\n * @param {Plural} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {string | undefined} domain Domain to retrieve the translated text.\n *\n * @return {TranslatableText<Single | Plural>} The translated singular or plural form.\n */\nexport const _n = i18n._n.bind( i18n );\n\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number, with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_nx/\n *\n * @template {string} Single\n * @template {string} Plural\n * @param {Single} single The text to be used if the number is singular.\n *\n * @param {Single} single The text to be used if the number is singular.\n * @param {Plural} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {string} context Context information for the translators.\n * @param {string | undefined} [domain] Domain to retrieve the translated text.\n *\n * @return {TranslatableText<Single | Plural>} The translated singular or plural form.\n */\nexport const _nx = i18n._nx.bind( i18n );\n\n/**\n * Check if current locale is RTL.\n *\n * **RTL (Right To Left)** is a locale property indicating that text is written from right to left.\n * For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common\n * language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,\n * including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).\n *\n * @return {boolean} Whether locale is RTL.\n */\nexport const isRTL = i18n.isRTL.bind( i18n );\n\n/**\n * Check if there is a translation for a given string (in singular form).\n *\n * @param {string} single Singular form of the string to look up.\n * @param {string} context Context information for the translators.\n * @param {string} domain Domain to retrieve the translated text.\n *\n * @return {boolean} Whether the translation exists or not.\n */\nexport const hasTranslation = i18n.hasTranslation.bind( i18n );\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AASA,MAAME,IAAI,GAAG,IAAAC,sBAAU,EAAEC,SAAS,EAAEA,SAAS,EAAEC,mBAAa,CAAC;;AAE7D;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGeN,IAAI;AAEnB;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO,aAAa,GAAAF,OAAA,CAAAE,aAAA,GAAGP,IAAI,CAACO,aAAa,CAACC,IAAI,CAAER,IAAK,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,aAAa,GAAAJ,OAAA,CAAAI,aAAA,GAAGT,IAAI,CAACS,aAAa,CAACD,IAAI,CAAER,IAAK,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMU,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAGV,IAAI,CAACU,eAAe,CAACF,IAAI,CAAER,IAAK,CAAC;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAGX,IAAI,CAACW,SAAS,CAACH,IAAI,CAAER,IAAK,CAAC;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMY,EAAE,GAAAP,OAAA,CAAAO,EAAA,GAAGZ,IAAI,CAACY,EAAE,CAACJ,IAAI,CAAER,IAAK,CAAC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMa,EAAE,GAAAR,OAAA,CAAAQ,EAAA,GAAGb,IAAI,CAACa,EAAE,CAACL,IAAI,CAAER,IAAK,CAAC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMc,EAAE,GAAAT,OAAA,CAAAS,EAAA,GAAGd,IAAI,CAACc,EAAE,CAACN,IAAI,CAAER,IAAK,CAAC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMe,GAAG,GAAAV,OAAA,CAAAU,GAAA,GAAGf,IAAI,CAACe,GAAG,CAACP,IAAI,CAAER,IAAK,CAAC;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMgB,KAAK,GAAAX,OAAA,CAAAW,KAAA,GAAGhB,IAAI,CAACgB,KAAK,CAACR,IAAI,CAAER,IAAK,CAAC;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMiB,cAAc,GAAAZ,OAAA,CAAAY,cAAA,GAAGjB,IAAI,CAACiB,cAAc,CAACT,IAAI,CAAER,IAAK,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/default-i18n.ts"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { createI18n } from './create-i18n';\n\n/**\n * WordPress dependencies\n */\nimport { defaultHooks } from '@wordpress/hooks';\nimport {\n\tLocaleData,\n\tSubscribeCallback,\n\tTranslatableText,\n\tUnsubscribeCallback,\n} from './types';\n\nconst i18n = createI18n( undefined, undefined, defaultHooks );\n\n/**\n * Default, singleton instance of `I18n`.\n */\nexport default i18n;\n\n/*\n * Comments in this file are duplicated from ./i18n due to\n * https://github.com/WordPress/gutenberg/pull/20318#issuecomment-590837722\n */\n\n/**\n * Returns locale data by domain in a Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param { string | undefined } [domain] Domain for which to get the data.\n * @return { LocaleData } Locale data.\n */\nexport const getLocaleData = i18n.getLocaleData.bind( i18n );\n\n/**\n * Merges locale data into the Tannin instance by domain. Accepts data in a\n * Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {LocaleData } [data] Locale data configuration.\n * @param {string | undefined} [domain] Domain for which configuration applies.\n */\nexport const setLocaleData = i18n.setLocaleData.bind( i18n );\n\n/**\n * Resets all current Tannin instance locale data and sets the specified\n * locale data for the domain. Accepts data in a Jed-formatted JSON object shape.\n *\n * @see http://messageformat.github.io/Jed/\n *\n * @param {LocaleData} [data] Locale data configuration.\n * @param {string | undefined} [domain] Domain for which configuration applies.\n */\nexport const resetLocaleData = i18n.resetLocaleData.bind( i18n );\n\n/**\n * Subscribes to changes of locale data\n *\n * @param {SubscribeCallback} callback Subscription callback\n * @return {UnsubscribeCallback} Unsubscribe callback\n */\nexport const subscribe = i18n.subscribe.bind( i18n );\n\n/**\n * Retrieve the translation of text.\n *\n * @see https://developer.wordpress.org/reference/functions/__/\n *\n * @template {string} Text\n *\n * @param {Text} text Text to translate.\n * @param {string | undefined} domain Domain to retrieve the translated text.\n *\n * @return {TranslatableText<Text>} Translated text.\n */\nexport const __ = i18n.__.bind( i18n );\n\n/**\n * Retrieve translated string with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_x/\n *\n * @template {string} Text\n *\n * @param {Text} text Text to translate.\n * @param {string} context Context information for the translators.\n * @param {string | undefined} domain Domain to retrieve the translated text.\n *\n * @return {TranslatableText<Text>} Translated context string without pipe.\n */\nexport const _x = i18n._x.bind( i18n );\n\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number.\n *\n * @see https://developer.wordpress.org/reference/functions/_n/\n *\n * @template {string} Single\n * @template {string} Plural\n *\n * @param {Single} single The text to be used if the number is singular.\n * @param {Plural} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {string | undefined} domain Domain to retrieve the translated text.\n *\n * @return {TranslatableText<Single | Plural>} The translated singular or plural form.\n */\nexport const _n = i18n._n.bind( i18n );\n\n/**\n * Translates and retrieves the singular or plural form based on the supplied\n * number, with gettext context.\n *\n * @see https://developer.wordpress.org/reference/functions/_nx/\n *\n * @template {string} Single\n * @template {string} Plural\n * @param {Single} single The text to be used if the number is singular.\n *\n * @param {Single} single The text to be used if the number is singular.\n * @param {Plural} plural The text to be used if the number is plural.\n * @param {number} number The number to compare against to use either the\n * singular or plural form.\n * @param {string} context Context information for the translators.\n * @param {string | undefined} [domain] Domain to retrieve the translated text.\n *\n * @return {TranslatableText<Single | Plural>} The translated singular or plural form.\n */\nexport const _nx = i18n._nx.bind( i18n );\n\n/**\n * Check if current locale is RTL.\n *\n * **RTL (Right To Left)** is a locale property indicating that text is written from right to left.\n * For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common\n * language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,\n * including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).\n *\n * @return {boolean} Whether locale is RTL.\n */\nexport const isRTL = i18n.isRTL.bind( i18n );\n\n/**\n * Check if there is a translation for a given string (in singular form).\n *\n * @param {string} single Singular form of the string to look up.\n * @param {string} context Context information for the translators.\n * @param {string} domain Domain to retrieve the translated text.\n *\n * @return {boolean} Whether the translation exists or not.\n */\nexport const hasTranslation = i18n.hasTranslation.bind( i18n );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,yBAA2B;AAK3B,mBAA6B;AAQ7B,MAAM,WAAO,+BAAY,QAAW,QAAW,yBAAa;AAK5D,IAAO,uBAAQ;AAeR,MAAM,gBAAgB,KAAK,cAAc,KAAM,IAAK;AAWpD,MAAM,gBAAgB,KAAK,cAAc,KAAM,IAAK;AAWpD,MAAM,kBAAkB,KAAK,gBAAgB,KAAM,IAAK;AAQxD,MAAM,YAAY,KAAK,UAAU,KAAM,IAAK;AAc5C,MAAM,KAAK,KAAK,GAAG,KAAM,IAAK;AAe9B,MAAM,KAAK,KAAK,GAAG,KAAM,IAAK;AAmB9B,MAAM,KAAK,KAAK,GAAG,KAAM,IAAK;AAqB9B,MAAM,MAAM,KAAK,IAAI,KAAM,IAAK;AAYhC,MAAM,QAAQ,KAAK,MAAM,KAAM,IAAK;AAWpC,MAAM,iBAAiB,KAAK,eAAe,KAAM,IAAK;",
6
+ "names": []
7
+ }
package/build/index.js CHANGED
@@ -1,108 +1,65 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- sprintf: true,
8
- defaultI18n: true,
9
- setLocaleData: true,
10
- resetLocaleData: true,
11
- getLocaleData: true,
12
- subscribe: true,
13
- __: true,
14
- _x: true,
15
- _n: true,
16
- _nx: true,
17
- isRTL: true,
18
- hasTranslation: true
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
19
11
  };
20
- Object.defineProperty(exports, "__", {
21
- enumerable: true,
22
- get: function () {
23
- return _defaultI18n.__;
24
- }
25
- });
26
- Object.defineProperty(exports, "_n", {
27
- enumerable: true,
28
- get: function () {
29
- return _defaultI18n._n;
30
- }
31
- });
32
- Object.defineProperty(exports, "_nx", {
33
- enumerable: true,
34
- get: function () {
35
- return _defaultI18n._nx;
36
- }
37
- });
38
- Object.defineProperty(exports, "_x", {
39
- enumerable: true,
40
- get: function () {
41
- return _defaultI18n._x;
42
- }
43
- });
44
- Object.defineProperty(exports, "defaultI18n", {
45
- enumerable: true,
46
- get: function () {
47
- return _defaultI18n.default;
48
- }
49
- });
50
- Object.defineProperty(exports, "getLocaleData", {
51
- enumerable: true,
52
- get: function () {
53
- return _defaultI18n.getLocaleData;
54
- }
55
- });
56
- Object.defineProperty(exports, "hasTranslation", {
57
- enumerable: true,
58
- get: function () {
59
- return _defaultI18n.hasTranslation;
60
- }
61
- });
62
- Object.defineProperty(exports, "isRTL", {
63
- enumerable: true,
64
- get: function () {
65
- return _defaultI18n.isRTL;
66
- }
67
- });
68
- Object.defineProperty(exports, "resetLocaleData", {
69
- enumerable: true,
70
- get: function () {
71
- return _defaultI18n.resetLocaleData;
72
- }
73
- });
74
- Object.defineProperty(exports, "setLocaleData", {
75
- enumerable: true,
76
- get: function () {
77
- return _defaultI18n.setLocaleData;
78
- }
79
- });
80
- Object.defineProperty(exports, "sprintf", {
81
- enumerable: true,
82
- get: function () {
83
- return _sprintf.sprintf;
84
- }
85
- });
86
- Object.defineProperty(exports, "subscribe", {
87
- enumerable: true,
88
- get: function () {
89
- return _defaultI18n.subscribe;
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
90
17
  }
18
+ return to;
19
+ };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var index_exports = {};
31
+ __export(index_exports, {
32
+ __: () => import_default_i18n.__,
33
+ _n: () => import_default_i18n._n,
34
+ _nx: () => import_default_i18n._nx,
35
+ _x: () => import_default_i18n._x,
36
+ defaultI18n: () => import_default_i18n.default,
37
+ getLocaleData: () => import_default_i18n.getLocaleData,
38
+ hasTranslation: () => import_default_i18n.hasTranslation,
39
+ isRTL: () => import_default_i18n.isRTL,
40
+ resetLocaleData: () => import_default_i18n.resetLocaleData,
41
+ setLocaleData: () => import_default_i18n.setLocaleData,
42
+ sprintf: () => import_sprintf.sprintf,
43
+ subscribe: () => import_default_i18n.subscribe
91
44
  });
92
- var _sprintf = require("./sprintf");
93
- var _createI18n = require("./create-i18n");
94
- Object.keys(_createI18n).forEach(function (key) {
95
- if (key === "default" || key === "__esModule") return;
96
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
97
- if (key in exports && exports[key] === _createI18n[key]) return;
98
- Object.defineProperty(exports, key, {
99
- enumerable: true,
100
- get: function () {
101
- return _createI18n[key];
102
- }
103
- });
45
+ module.exports = __toCommonJS(index_exports);
46
+ var import_sprintf = require("./sprintf");
47
+ __reExport(index_exports, require("./create-i18n"), module.exports);
48
+ var import_default_i18n = __toESM(require("./default-i18n"));
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ __,
52
+ _n,
53
+ _nx,
54
+ _x,
55
+ defaultI18n,
56
+ getLocaleData,
57
+ hasTranslation,
58
+ isRTL,
59
+ resetLocaleData,
60
+ setLocaleData,
61
+ sprintf,
62
+ subscribe,
63
+ ...require("./create-i18n")
104
64
  });
105
- var _defaultI18n = _interopRequireWildcard(require("./default-i18n"));
106
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
107
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
108
- //# sourceMappingURL=index.js.map
65
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_sprintf","require","_createI18n","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_defaultI18n","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set"],"sources":["@wordpress/i18n/src/index.ts"],"sourcesContent":["export { sprintf } from './sprintf';\nexport * from './create-i18n';\nexport type * from './types';\nexport {\n\tdefault as defaultI18n,\n\tsetLocaleData,\n\tresetLocaleData,\n\tgetLocaleData,\n\tsubscribe,\n\t__,\n\t_x,\n\t_n,\n\t_nx,\n\tisRTL,\n\thasTranslation,\n} from './default-i18n';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,WAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,WAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,WAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAEA,IAAAS,YAAA,GAAAC,uBAAA,CAAAf,OAAA;AAYwB,SAAAgB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAP,GAAA,CAAAI,CAAA,OAAAO,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAxB,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAyB,wBAAA,WAAAC,CAAA,IAAAX,CAAA,oBAAAW,CAAA,OAAArB,cAAA,CAAAC,IAAA,CAAAS,CAAA,EAAAW,CAAA,SAAAC,CAAA,GAAAH,CAAA,GAAAxB,MAAA,CAAAyB,wBAAA,CAAAV,CAAA,EAAAW,CAAA,UAAAC,CAAA,KAAAA,CAAA,CAAAhB,GAAA,IAAAgB,CAAA,CAAAC,GAAA,IAAA5B,MAAA,CAAAS,cAAA,CAAAa,CAAA,EAAAI,CAAA,EAAAC,CAAA,IAAAL,CAAA,CAAAI,CAAA,IAAAX,CAAA,CAAAW,CAAA,YAAAJ,CAAA,CAAAF,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,EAAAO,CAAA,GAAAA,CAAA","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["export { sprintf } from './sprintf';\nexport * from './create-i18n';\nexport type * from './types';\nexport {\n\tdefault as defaultI18n,\n\tsetLocaleData,\n\tresetLocaleData,\n\tgetLocaleData,\n\tsubscribe,\n\t__,\n\t_x,\n\t_n,\n\t_nx,\n\tisRTL,\n\thasTranslation,\n} from './default-i18n';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,0BAAc,0BADd;AAGA,0BAYO;",
6
+ "names": []
7
+ }
package/build/sprintf.js CHANGED
@@ -1,32 +1,42 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var sprintf_exports = {};
30
+ __export(sprintf_exports, {
31
+ sprintf: () => sprintf
6
32
  });
7
- exports.sprintf = sprintf;
8
- var _sprintf2 = _interopRequireDefault(require("@tannin/sprintf"));
9
- /**
10
- * External dependencies
11
- */
12
- // Disable reason: `eslint-plugin-import` doesn't support `exports` (https://github.com/import-js/eslint-plugin-import/issues/1810)
13
- // eslint-disable-next-line import/no-unresolved
14
-
15
- /**
16
- * Internal dependencies
17
- */
18
-
19
- /**
20
- * Returns a formatted string.
21
- *
22
- * @param format The format of the string to generate.
23
- * @param args Arguments to apply to the format.
24
- *
25
- * @see https://www.npmjs.com/package/@tannin/sprintf
26
- *
27
- * @return The formatted string.
28
- */
33
+ module.exports = __toCommonJS(sprintf_exports);
34
+ var import_sprintf = __toESM(require("@tannin/sprintf"));
29
35
  function sprintf(format, ...args) {
30
- return (0, _sprintf2.default)(format, ...args);
36
+ return (0, import_sprintf.default)(format, ...args);
31
37
  }
32
- //# sourceMappingURL=sprintf.js.map
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ sprintf
41
+ });
42
+ //# sourceMappingURL=sprintf.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_sprintf2","_interopRequireDefault","require","sprintf","format","args","_sprintf"],"sources":["@wordpress/i18n/src/sprintf.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// Disable reason: `eslint-plugin-import` doesn't support `exports` (https://github.com/import-js/eslint-plugin-import/issues/1810)\n// eslint-disable-next-line import/no-unresolved\nimport _sprintf from '@tannin/sprintf';\n\n/**\n * Internal dependencies\n */\nimport type { DistributeSprintfArgs, TranslatableText } from './types';\n\nexport function sprintf< T extends string >(\n\tformat: T | TranslatableText< T >,\n\t...args: DistributeSprintfArgs< T >\n): string;\nexport function sprintf< T extends string >(\n\tformat: T | TranslatableText< T >,\n\targs: DistributeSprintfArgs< T >\n): string;\n\n/**\n * Returns a formatted string.\n *\n * @param format The format of the string to generate.\n * @param args Arguments to apply to the format.\n *\n * @see https://www.npmjs.com/package/@tannin/sprintf\n *\n * @return The formatted string.\n */\nexport function sprintf< T extends string >(\n\tformat: T | TranslatableText< T >,\n\t...args: DistributeSprintfArgs< T >\n): string {\n\treturn _sprintf( format as T, ...( args as DistributeSprintfArgs< T > ) );\n}\n"],"mappings":";;;;;;;AAKA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AALA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CACtBC,MAAiC,EACjC,GAAGC,IAAgC,EAC1B;EACT,OAAO,IAAAC,iBAAQ,EAAEF,MAAM,EAAO,GAAKC,IAAqC,CAAC;AAC1E","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/sprintf.ts"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\n// Disable reason: `eslint-plugin-import` doesn't support `exports` (https://github.com/import-js/eslint-plugin-import/issues/1810)\n// eslint-disable-next-line import/no-unresolved\nimport _sprintf from '@tannin/sprintf';\n\n/**\n * Internal dependencies\n */\nimport type { DistributeSprintfArgs, TranslatableText } from './types';\n\nexport function sprintf< T extends string >(\n\tformat: T | TranslatableText< T >,\n\t...args: DistributeSprintfArgs< T >\n): string;\nexport function sprintf< T extends string >(\n\tformat: T | TranslatableText< T >,\n\targs: DistributeSprintfArgs< T >\n): string;\n\n/**\n * Returns a formatted string.\n *\n * @param format The format of the string to generate.\n * @param args Arguments to apply to the format.\n *\n * @see https://www.npmjs.com/package/@tannin/sprintf\n *\n * @return The formatted string.\n */\nexport function sprintf< T extends string >(\n\tformat: T | TranslatableText< T >,\n\t...args: DistributeSprintfArgs< T >\n): string {\n\treturn _sprintf( format as T, ...( args as DistributeSprintfArgs< T > ) );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,qBAAqB;AA0Bd,SAAS,QACf,WACG,MACM;AACT,aAAO,eAAAA,SAAU,QAAa,GAAK,IAAqC;AACzE;",
6
+ "names": ["_sprintf"]
7
+ }
package/build/types.js CHANGED
@@ -1,6 +1,17 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=types.js.map
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":[],"sources":["@wordpress/i18n/src/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type sprintf from '@tannin/sprintf';\nimport { type TanninDomainMetadata } from 'tannin';\n\n/**\n * Return type for string translation functions.\n *\n * This type should be treated as if it were `string`.\n */\nexport type TranslatableText< T extends string > = string & {\n\t/**\n\t * DO NOT USE! This property _does not exist_.\n\t * @private\n\t */\n\treadonly __translatableText: T;\n};\n\n/**\n * Type to extends TanninDomainMetadata to support additional properties.\n */\nexport type I18nDomainMetadata< TextDomain extends string > =\n\tTanninDomainMetadata & {\n\t\tdomain?: TextDomain;\n\t\t[ key: string ]: unknown;\n\t};\n\n/**\n * Locale data is a record of domain names to their metadata or translations.\n */\nexport type LocaleData< TextDomain extends string = string > = Record<\n\tstring,\n\tI18nDomainMetadata< TextDomain > | string[]\n>;\n\nexport type SubscribeCallback = () => void;\nexport type UnsubscribeCallback = () => void;\n\n/**\n * Retrieve the domain to use when calling domain-specific filters.\n */\nexport type getFilterDomain = ( domain?: string ) => string;\n\n/**\n * An i18n instance\n */\nexport interface I18n< TextDomain extends string = string > {\n\t/**\n\t * Returns locale data by domain in a\n\t * Jed-formatted JSON object shape.\n\t *\n\t * @see http://messageformat.github.io/Jed/\n\t */\n\tgetLocaleData: ( domain?: TextDomain ) => LocaleData< TextDomain >;\n\n\t/**\n\t * Merges locale data into the Tannin instance by domain. Note that this\n\t * function will overwrite the domain configuration. Accepts data in a\n\t * Jed-formatted JSON object shape.\n\t *\n\t * @see http://messageformat.github.io/Jed/\n\t */\n\tsetLocaleData: (\n\t\tdata?: LocaleData< TextDomain >,\n\t\tdomain?: TextDomain\n\t) => void;\n\n\t/**\n\t * Merges locale data into the Tannin instance by domain. Note that this\n\t * function will also merge the domain configuration. Accepts data in a\n\t * Jed-formatted JSON object shape.\n\t *\n\t * @see http://messageformat.github.io/Jed/\n\t */\n\taddLocaleData: (\n\t\tdata?: LocaleData< TextDomain >,\n\t\tdomain?: TextDomain\n\t) => void;\n\n\t/**\n\t * Resets all current Tannin instance locale data and sets the specified\n\t * locale data for the domain. Accepts data in a Jed-formatted JSON object shape.\n\t *\n\t * @see http://messageformat.github.io/Jed/\n\t */\n\tresetLocaleData: (\n\t\tdata?: LocaleData< TextDomain >,\n\t\tdomain?: TextDomain\n\t) => void;\n\n\t/**\n\t * Subscribes to changes of locale data\n\t */\n\tsubscribe: ( callback: SubscribeCallback ) => UnsubscribeCallback;\n\n\t/**\n\t * Retrieve the translation of text.\n\t *\n\t * @see https://developer.wordpress.org/reference/functions/__/\n\t */\n\t__: < Text extends string >(\n\t\ttext: Text,\n\t\tdomain?: TextDomain\n\t) => TranslatableText< Text >;\n\n\t/**\n\t * Retrieve translated string with gettext context.\n\t *\n\t * @see https://developer.wordpress.org/reference/functions/_x/\n\t */\n\t_x: < Text extends string >(\n\t\ttext: Text,\n\t\tcontext: string,\n\t\tdomain?: TextDomain\n\t) => TranslatableText< Text >;\n\n\t/**\n\t * Translates and retrieves the singular or plural form based on the supplied\n\t * number.\n\t *\n\t * @see https://developer.wordpress.org/reference/functions/_n/\n\t */\n\t_n: < Single extends string, Plural extends string >(\n\t\tsingle: Single,\n\t\tplural: Plural,\n\t\tnumber: number,\n\t\tdomain?: TextDomain\n\t) => TranslatableText< Single | Plural >;\n\n\t/**\n\t * Translates and retrieves the singular or plural form based on the supplied\n\t * number, with gettext context.\n\t *\n\t * @see https://developer.wordpress.org/reference/functions/_nx/\n\t */\n\t_nx: < Single extends string, Plural extends string >(\n\t\tsingle: Single,\n\t\tplural: Plural,\n\t\tnumber: number,\n\t\tcontext: string,\n\t\tdomain?: TextDomain\n\t) => TranslatableText< Single | Plural >;\n\n\t/**\n\t * Check if current locale is RTL.\n\t *\n\t * **RTL (Right To Left)** is a locale property indicating that text is written from right to left.\n\t * For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common\n\t * language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,\n\t * including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).\n\t */\n\tisRTL: () => boolean;\n\n\t/**\n\t * Check if there is a translation for a given string in singular form.\n\t */\n\thasTranslation: (\n\t\tsingle: string,\n\t\tcontext?: string,\n\t\tdomain?: TextDomain\n\t) => boolean;\n}\n\nexport type DistributeSprintfArgs< T extends string > = T extends any\n\t? Parameters< typeof sprintf< T > >[ 1 ]\n\t: never;\n"],"mappings":"","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/types.ts"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport type sprintf from '@tannin/sprintf';\nimport { type TanninDomainMetadata } from 'tannin';\n\n/**\n * Return type for string translation functions.\n *\n * This type should be treated as if it were `string`.\n */\nexport type TranslatableText< T extends string > = string & {\n\t/**\n\t * DO NOT USE! This property _does not exist_.\n\t * @private\n\t */\n\treadonly __translatableText: T;\n};\n\n/**\n * Type to extends TanninDomainMetadata to support additional properties.\n */\nexport type I18nDomainMetadata< TextDomain extends string > =\n\tTanninDomainMetadata & {\n\t\tdomain?: TextDomain;\n\t\t[ key: string ]: unknown;\n\t};\n\n/**\n * Locale data is a record of domain names to their metadata or translations.\n */\nexport type LocaleData< TextDomain extends string = string > = Record<\n\tstring,\n\tI18nDomainMetadata< TextDomain > | string[]\n>;\n\nexport type SubscribeCallback = () => void;\nexport type UnsubscribeCallback = () => void;\n\n/**\n * Retrieve the domain to use when calling domain-specific filters.\n */\nexport type getFilterDomain = ( domain?: string ) => string;\n\n/**\n * An i18n instance\n */\nexport interface I18n< TextDomain extends string = string > {\n\t/**\n\t * Returns locale data by domain in a\n\t * Jed-formatted JSON object shape.\n\t *\n\t * @see http://messageformat.github.io/Jed/\n\t */\n\tgetLocaleData: ( domain?: TextDomain ) => LocaleData< TextDomain >;\n\n\t/**\n\t * Merges locale data into the Tannin instance by domain. Note that this\n\t * function will overwrite the domain configuration. Accepts data in a\n\t * Jed-formatted JSON object shape.\n\t *\n\t * @see http://messageformat.github.io/Jed/\n\t */\n\tsetLocaleData: (\n\t\tdata?: LocaleData< TextDomain >,\n\t\tdomain?: TextDomain\n\t) => void;\n\n\t/**\n\t * Merges locale data into the Tannin instance by domain. Note that this\n\t * function will also merge the domain configuration. Accepts data in a\n\t * Jed-formatted JSON object shape.\n\t *\n\t * @see http://messageformat.github.io/Jed/\n\t */\n\taddLocaleData: (\n\t\tdata?: LocaleData< TextDomain >,\n\t\tdomain?: TextDomain\n\t) => void;\n\n\t/**\n\t * Resets all current Tannin instance locale data and sets the specified\n\t * locale data for the domain. Accepts data in a Jed-formatted JSON object shape.\n\t *\n\t * @see http://messageformat.github.io/Jed/\n\t */\n\tresetLocaleData: (\n\t\tdata?: LocaleData< TextDomain >,\n\t\tdomain?: TextDomain\n\t) => void;\n\n\t/**\n\t * Subscribes to changes of locale data\n\t */\n\tsubscribe: ( callback: SubscribeCallback ) => UnsubscribeCallback;\n\n\t/**\n\t * Retrieve the translation of text.\n\t *\n\t * @see https://developer.wordpress.org/reference/functions/__/\n\t */\n\t__: < Text extends string >(\n\t\ttext: Text,\n\t\tdomain?: TextDomain\n\t) => TranslatableText< Text >;\n\n\t/**\n\t * Retrieve translated string with gettext context.\n\t *\n\t * @see https://developer.wordpress.org/reference/functions/_x/\n\t */\n\t_x: < Text extends string >(\n\t\ttext: Text,\n\t\tcontext: string,\n\t\tdomain?: TextDomain\n\t) => TranslatableText< Text >;\n\n\t/**\n\t * Translates and retrieves the singular or plural form based on the supplied\n\t * number.\n\t *\n\t * @see https://developer.wordpress.org/reference/functions/_n/\n\t */\n\t_n: < Single extends string, Plural extends string >(\n\t\tsingle: Single,\n\t\tplural: Plural,\n\t\tnumber: number,\n\t\tdomain?: TextDomain\n\t) => TranslatableText< Single | Plural >;\n\n\t/**\n\t * Translates and retrieves the singular or plural form based on the supplied\n\t * number, with gettext context.\n\t *\n\t * @see https://developer.wordpress.org/reference/functions/_nx/\n\t */\n\t_nx: < Single extends string, Plural extends string >(\n\t\tsingle: Single,\n\t\tplural: Plural,\n\t\tnumber: number,\n\t\tcontext: string,\n\t\tdomain?: TextDomain\n\t) => TranslatableText< Single | Plural >;\n\n\t/**\n\t * Check if current locale is RTL.\n\t *\n\t * **RTL (Right To Left)** is a locale property indicating that text is written from right to left.\n\t * For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common\n\t * language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,\n\t * including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).\n\t */\n\tisRTL: () => boolean;\n\n\t/**\n\t * Check if there is a translation for a given string in singular form.\n\t */\n\thasTranslation: (\n\t\tsingle: string,\n\t\tcontext?: string,\n\t\tdomain?: TextDomain\n\t) => boolean;\n}\n\nexport type DistributeSprintfArgs< T extends string > = T extends any\n\t? Parameters< typeof sprintf< T > >[ 1 ]\n\t: never;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }