@manyducks.co/dolla 2.0.0-alpha.11 → 2.0.0-alpha.13
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/index.d.ts +1 -1
- package/dist/index.js +722 -615
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/modules/i18n.d.ts +21 -5
- package/dist/{passthrough-Bu7iYKPr.js → passthrough-Bz5ZF4jn.js} +21 -20
- package/dist/{passthrough-Bu7iYKPr.js.map → passthrough-Bz5ZF4jn.js.map} +1 -1
- package/docs/http.md +5 -0
- package/docs/i18n.md +5 -0
- package/docs/router.md +5 -0
- package/docs/states.md +5 -0
- package/docs/views.md +5 -0
- package/package.json +1 -1
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as m } from "./passthrough-
|
|
1
|
+
import { r as s } from "./passthrough-Bz5ZF4jn.js";
|
|
2
|
+
import { P as m } from "./passthrough-Bz5ZF4jn.js";
|
|
3
3
|
function d(n, r, t, e, a, l) {
|
|
4
4
|
const i = { ...o(["children", "key"], r) }, c = Array.isArray(r.children) ? r.children : [r.children];
|
|
5
5
|
return s(n, i, ...c);
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as l } from "./passthrough-
|
|
1
|
+
import { r as t } from "./passthrough-Bz5ZF4jn.js";
|
|
2
|
+
import { P as l } from "./passthrough-Bz5ZF4jn.js";
|
|
3
3
|
function d(n, e, r) {
|
|
4
4
|
return t(n, e ? { ...u(["children", "key"], e) } : void 0, e.children);
|
|
5
5
|
}
|
package/dist/modules/i18n.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MaybeState, type State } from "../state.js";
|
|
1
|
+
import { type MaybeState, type State } from "../state.js";
|
|
2
2
|
import type { Dolla } from "./dolla.js";
|
|
3
3
|
/**
|
|
4
4
|
* An object where values are either a translated string or another nested Translation object.
|
|
@@ -36,6 +36,7 @@ export type TOptions = {
|
|
|
36
36
|
context?: MaybeState<string>;
|
|
37
37
|
[value: string]: MaybeState<any>;
|
|
38
38
|
};
|
|
39
|
+
export type Formatter = (locale: string, value: unknown, options: Record<string, any>) => string;
|
|
39
40
|
/**
|
|
40
41
|
* Dolla's I(nternationalizatio)n module. Manages language translations and locale-based formatting.
|
|
41
42
|
*/
|
|
@@ -49,13 +50,28 @@ export declare class I18n {
|
|
|
49
50
|
/**
|
|
50
51
|
* Returns a State containing the value at `key`.
|
|
51
52
|
|
|
52
|
-
* @param
|
|
53
|
-
* @param options - A map of {{placeholder}} names and the values to replace them with.
|
|
53
|
+
* @param selector - Key to the translated value.
|
|
54
|
+
* @param options - A map of `{{placeholder}}` names and the values to replace them with.
|
|
54
55
|
*
|
|
55
56
|
* @example
|
|
56
|
-
* const $value = t("your.key.here");
|
|
57
|
+
* const $value = t("your.key.here", { count: 5 });
|
|
57
58
|
*/
|
|
58
|
-
t(
|
|
59
|
+
t(selector: string, options?: TOptions): State<string>;
|
|
60
|
+
/**
|
|
61
|
+
* Add a custom format callback.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* Dolla.i18n.addFormat("uppercase", (locale, value, options) => {
|
|
65
|
+
* return value.toUpperCase();
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* {
|
|
69
|
+
* "greeting": "Hello, {{name|uppercase}}!"
|
|
70
|
+
* }
|
|
71
|
+
*
|
|
72
|
+
* t("greeting", {name: "world"}); // State<"Hello, WORLD!">
|
|
73
|
+
*/
|
|
74
|
+
addFormat(name: string, callback: (locale: string, value: unknown, options: Record<string, any>) => string): void;
|
|
59
75
|
/**
|
|
60
76
|
* Creates an `Intl.Collator` configured for the current locale.
|
|
61
77
|
* NOTE: The Collator remains bound to the locale it was created with, even when the app's locale changes.
|
|
@@ -1244,35 +1244,36 @@ function ze(t, e) {
|
|
|
1244
1244
|
return e.outlet();
|
|
1245
1245
|
}
|
|
1246
1246
|
export {
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1247
|
+
S as A,
|
|
1248
|
+
_e as B,
|
|
1249
|
+
We as C,
|
|
1250
|
+
Ke as D,
|
|
1250
1251
|
ze as P,
|
|
1251
1252
|
I as a,
|
|
1252
1253
|
A as b,
|
|
1253
1254
|
Re as c,
|
|
1254
1255
|
ge as d,
|
|
1255
1256
|
O as e,
|
|
1256
|
-
|
|
1257
|
-
|
|
1257
|
+
_ as f,
|
|
1258
|
+
V as g,
|
|
1258
1259
|
Be as h,
|
|
1259
1260
|
L as i,
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1261
|
+
Pe as j,
|
|
1262
|
+
Fe as k,
|
|
1263
|
+
Le as l,
|
|
1264
|
+
qe as m,
|
|
1265
|
+
Ge as n,
|
|
1266
|
+
He as o,
|
|
1267
|
+
ne as p,
|
|
1268
|
+
je as q,
|
|
1269
|
+
x as r,
|
|
1270
|
+
Ue as s,
|
|
1270
1271
|
q as t,
|
|
1271
|
-
|
|
1272
|
+
pe as u,
|
|
1272
1273
|
T as v,
|
|
1273
1274
|
G as w,
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1275
|
+
Ie as x,
|
|
1276
|
+
K as y,
|
|
1277
|
+
M as z
|
|
1277
1278
|
};
|
|
1278
|
-
//# sourceMappingURL=passthrough-
|
|
1279
|
+
//# sourceMappingURL=passthrough-Bz5ZF4jn.js.map
|