@cocoar/vue-localization 0.1.0-beta.23

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.
Files changed (2) hide show
  1. package/dist/index.js +628 -0
  2. package/package.json +29 -0
package/dist/index.js ADDED
@@ -0,0 +1,628 @@
1
+ import { ref as y, computed as d, inject as p } from "vue";
2
+ class L {
3
+ data = /* @__PURE__ */ new Map();
4
+ _version = y(0);
5
+ /** Reactive version counter — watch this to react to data changes */
6
+ version = this._version;
7
+ setLocaleData(t, n) {
8
+ this.data.set(t, n), this._version.value++;
9
+ }
10
+ getLocaleData(t) {
11
+ return this._version.value, this.data.get(t);
12
+ }
13
+ hasLocaleData(t) {
14
+ return this._version.value, this.data.has(t);
15
+ }
16
+ removeLocaleData(t) {
17
+ this.data.delete(t), this._version.value++;
18
+ }
19
+ clear() {
20
+ this.data.clear(), this._version.value++;
21
+ }
22
+ }
23
+ class I {
24
+ async load(t) {
25
+ return {
26
+ code: t,
27
+ date: _(t),
28
+ number: P(t),
29
+ currency: U(t),
30
+ percent: b(t)
31
+ };
32
+ }
33
+ }
34
+ function _(r) {
35
+ const t = [], n = [], e = [], a = [], o = new Intl.DateTimeFormat(r, { month: "long" }), s = new Intl.DateTimeFormat(r, { month: "short" });
36
+ for (let u = 0; u < 12; u++) {
37
+ const f = new Date(2024, u, 1);
38
+ t.push(o.format(f)), n.push(s.format(f));
39
+ }
40
+ const i = new Intl.DateTimeFormat(r, { weekday: "long" }), c = new Intl.DateTimeFormat(r, { weekday: "short" });
41
+ for (let u = 0; u < 7; u++) {
42
+ const f = new Date(2024, 0, 7 + u);
43
+ e.push(i.format(f)), a.push(c.format(f));
44
+ }
45
+ const l = R(r), m = $(r), h = F(r);
46
+ return {
47
+ pattern: l,
48
+ firstDayOfWeek: m,
49
+ monthNames: t,
50
+ monthNamesShort: n,
51
+ dayNames: e,
52
+ dayNamesShort: a,
53
+ amPm: h
54
+ };
55
+ }
56
+ function R(r) {
57
+ const n = new Intl.DateTimeFormat(r, {
58
+ year: "numeric",
59
+ month: "2-digit",
60
+ day: "2-digit"
61
+ }).formatToParts(new Date(2024, 11, 25)), e = n.filter((o) => o.type === "month" || o.type === "day" || o.type === "year").map((o) => o.type), a = n.find((o) => o.type === "literal")?.value ?? "/";
62
+ return e[0] === "year" ? "yyyy-mm-dd" : e[0] === "month" ? "mm/dd/yyyy" : a === "." ? "dd.mm.yyyy" : "dd/mm/yyyy";
63
+ }
64
+ function $(r) {
65
+ try {
66
+ const e = new Intl.Locale(r), a = e.getWeekInfo?.() ?? e.weekInfo;
67
+ if (a?.firstDay != null)
68
+ return a.firstDay === 7 ? 0 : a.firstDay;
69
+ } catch {
70
+ }
71
+ const t = w(r);
72
+ return ["US", "CA", "JP", "KR", "TW", "PH", "IL"].includes(t) ? 0 : 1;
73
+ }
74
+ function w(r) {
75
+ const t = r.split("-");
76
+ if (t.length > 1)
77
+ return t[t.length - 1].toUpperCase();
78
+ try {
79
+ return new Intl.Locale(r).maximize().region?.toUpperCase() ?? "";
80
+ } catch {
81
+ return "";
82
+ }
83
+ }
84
+ function F(r) {
85
+ try {
86
+ const t = new Intl.DateTimeFormat(r, { hour: "numeric", hour12: !0 }), n = t.formatToParts(new Date(2024, 0, 1, 9)), e = t.formatToParts(new Date(2024, 0, 1, 15)), a = n.find((s) => s.type === "dayPeriod")?.value ?? "AM", o = e.find((s) => s.type === "dayPeriod")?.value ?? "PM";
87
+ return [a, o];
88
+ } catch {
89
+ return ["AM", "PM"];
90
+ }
91
+ }
92
+ function P(r) {
93
+ const n = new Intl.NumberFormat(r, { useGrouping: !0 }).formatToParts(123456789e-2), e = n.find((o) => o.type === "decimal")?.value ?? ".", a = n.find((o) => o.type === "group")?.value ?? ",";
94
+ return { decimal: e, group: a, grouping: [3] };
95
+ }
96
+ function U(r) {
97
+ const t = w(r), n = z(t);
98
+ try {
99
+ const a = new Intl.NumberFormat(r, {
100
+ style: "currency",
101
+ currency: n
102
+ }).formatToParts(1234.56), s = a.find((u) => u.type === "currency")?.value ?? n, i = a.findIndex((u) => u.type === "currency"), c = a.findIndex((u) => u.type === "integer"), l = i < c ? "before" : "after", h = (l === "before" ? a.slice(i + 1, c) : a.slice(c, i)).some((u) => u.type === "literal" && /\s/.test(u.value));
103
+ return {
104
+ default: n,
105
+ symbols: { [n]: s },
106
+ position: l,
107
+ spacing: h,
108
+ decimals: 2
109
+ };
110
+ } catch {
111
+ return {
112
+ default: n,
113
+ symbols: {},
114
+ position: "before",
115
+ spacing: !1,
116
+ decimals: 2
117
+ };
118
+ }
119
+ }
120
+ function b(r) {
121
+ try {
122
+ const n = new Intl.NumberFormat(r, { style: "percent" }).formatToParts(0.25), e = n.find((c) => c.type === "percentSign")?.value ?? "%", a = n.findIndex((c) => c.type === "percentSign"), o = n.findIndex((c) => c.type === "integer"), i = (a > o ? n.slice(o + 1, a) : n.slice(a + 1, o)).some((c) => c.type === "literal" && /\s/.test(c.value));
123
+ return { symbol: e, spacing: i, decimals: 0 };
124
+ } catch {
125
+ return { symbol: "%", spacing: !1, decimals: 0 };
126
+ }
127
+ }
128
+ function z(r) {
129
+ return {
130
+ US: "USD",
131
+ GB: "GBP",
132
+ EU: "EUR",
133
+ DE: "EUR",
134
+ FR: "EUR",
135
+ IT: "EUR",
136
+ ES: "EUR",
137
+ NL: "EUR",
138
+ AT: "EUR",
139
+ BE: "EUR",
140
+ FI: "EUR",
141
+ IE: "EUR",
142
+ PT: "EUR",
143
+ GR: "EUR",
144
+ LU: "EUR",
145
+ JP: "JPY",
146
+ CN: "CNY",
147
+ KR: "KRW",
148
+ CA: "CAD",
149
+ AU: "AUD",
150
+ CH: "CHF",
151
+ SE: "SEK",
152
+ NO: "NOK",
153
+ DK: "DKK",
154
+ PL: "PLN",
155
+ CZ: "CZK",
156
+ HU: "HUF",
157
+ RO: "RON",
158
+ BG: "BGN",
159
+ HR: "EUR",
160
+ IN: "INR",
161
+ BR: "BRL",
162
+ MX: "MXN",
163
+ RU: "RUB",
164
+ TR: "TRY",
165
+ ZA: "ZAR",
166
+ IL: "ILS",
167
+ TW: "TWD",
168
+ SG: "SGD",
169
+ HK: "HKD",
170
+ NZ: "NZD",
171
+ PH: "PHP",
172
+ TH: "THB",
173
+ MY: "MYR",
174
+ ID: "IDR",
175
+ VN: "VND",
176
+ AE: "AED",
177
+ SA: "SAR"
178
+ }[r] ?? "USD";
179
+ }
180
+ function T(r, t) {
181
+ return {
182
+ code: t.code ?? r.code,
183
+ date: t.date ? { ...r.date, ...t.date } : r.date,
184
+ number: t.number ? { ...r.number, ...t.number } : r.number,
185
+ currency: t.currency ? {
186
+ ...r.currency,
187
+ ...t.currency,
188
+ symbols: { ...r.currency.symbols, ...t.currency.symbols }
189
+ } : r.currency,
190
+ percent: t.percent ? { ...r.percent, ...t.percent } : r.percent
191
+ };
192
+ }
193
+ class N {
194
+ data = /* @__PURE__ */ new Map();
195
+ _version = y(0);
196
+ /** Reactive version counter — use in computed() to react to changes */
197
+ version = this._version;
198
+ /** Reactive set of loaded language codes */
199
+ loadedLanguages = d(() => (this._version.value, new Set(this.data.keys())));
200
+ /**
201
+ * Set translations for a language. Replaces any existing translations.
202
+ * Nested objects are flattened to dot-separated keys.
203
+ */
204
+ setTranslations(t, n) {
205
+ const e = /* @__PURE__ */ new Map();
206
+ v(n, "", e), this.data.set(t, e), this._version.value++;
207
+ }
208
+ /**
209
+ * Merge additional translations into existing ones for a language.
210
+ */
211
+ updateTranslations(t, n) {
212
+ const e = this.data.get(t) ?? /* @__PURE__ */ new Map();
213
+ v(n, "", e), this.data.set(t, e), this._version.value++;
214
+ }
215
+ /**
216
+ * Get a single translation by key.
217
+ */
218
+ getTranslation(t, n) {
219
+ return this._version.value, this.data.get(t)?.get(n);
220
+ }
221
+ /**
222
+ * Get all translations for a language.
223
+ */
224
+ getTranslations(t) {
225
+ return this._version.value, this.data.get(t);
226
+ }
227
+ /**
228
+ * Set a single translation.
229
+ */
230
+ setTranslation(t, n, e) {
231
+ let a = this.data.get(t);
232
+ a || (a = /* @__PURE__ */ new Map(), this.data.set(t, a)), a.set(n, e), this._version.value++;
233
+ }
234
+ hasLanguage(t) {
235
+ return this._version.value, this.data.has(t);
236
+ }
237
+ /**
238
+ * Remove all translations for a specific language.
239
+ */
240
+ clearLanguage(t) {
241
+ this.data.delete(t), this._version.value++;
242
+ }
243
+ /**
244
+ * Bump version to trigger reactivity without changing data.
245
+ * Useful after external data updates.
246
+ */
247
+ touch() {
248
+ this._version.value++;
249
+ }
250
+ clear() {
251
+ this.data.clear(), this._version.value++;
252
+ }
253
+ }
254
+ function v(r, t, n) {
255
+ for (const [e, a] of Object.entries(r)) {
256
+ const o = t ? `${t}.${e}` : e;
257
+ typeof a == "string" ? n.set(o, a) : v(a, o, n);
258
+ }
259
+ }
260
+ function x(r, t) {
261
+ return t ? r.replace(/\{(\w+)\}/g, (n, e) => {
262
+ const a = t[e];
263
+ return a == null ? "" : String(a);
264
+ }) : r;
265
+ }
266
+ function Z(r, t) {
267
+ return t == null || t.trim() === "" ? !0 : r === t;
268
+ }
269
+ class C {
270
+ async load(t) {
271
+ const n = {};
272
+ try {
273
+ const e = new Intl.RelativeTimeFormat(t, { numeric: "auto" });
274
+ n["common.today"] = e.format(0, "day"), n["common.yesterday"] = e.format(-1, "day"), n["common.tomorrow"] = e.format(1, "day");
275
+ } catch {
276
+ }
277
+ try {
278
+ const e = new Intl.DateTimeFormat(t, { month: "long" }), a = new Intl.DateTimeFormat(t, { month: "short" });
279
+ for (let o = 0; o < 12; o++) {
280
+ const s = new Date(2024, o, 1);
281
+ n[`common.month.${o + 1}`] = e.format(s), n[`common.month.short.${o + 1}`] = a.format(s);
282
+ }
283
+ } catch {
284
+ }
285
+ try {
286
+ const e = new Intl.DateTimeFormat(t, { weekday: "long" }), a = new Intl.DateTimeFormat(t, { weekday: "short" });
287
+ for (let o = 0; o < 7; o++) {
288
+ const s = new Date(2024, 0, 8 + o);
289
+ n[`common.weekday.${o + 1}`] = e.format(s), n[`common.weekday.short.${o + 1}`] = a.format(s);
290
+ }
291
+ } catch {
292
+ }
293
+ return n;
294
+ }
295
+ }
296
+ class E {
297
+ getTimezone() {
298
+ try {
299
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
300
+ } catch {
301
+ return null;
302
+ }
303
+ }
304
+ }
305
+ class A {
306
+ providers;
307
+ _timezone;
308
+ /** Reactive current timezone (IANA identifier) */
309
+ get timezone() {
310
+ return this._timezone;
311
+ }
312
+ constructor(t = []) {
313
+ this.providers = [...t, new E()], this._timezone = y(this.resolve());
314
+ }
315
+ /** Re-resolve the timezone from providers and update the reactive value */
316
+ refresh() {
317
+ this._timezone.value = this.resolve();
318
+ }
319
+ resolve() {
320
+ for (const t of this.providers) {
321
+ const n = t.getTimezone();
322
+ if (n) return n;
323
+ }
324
+ return "UTC";
325
+ }
326
+ }
327
+ class M {
328
+ defaultLanguage;
329
+ _language;
330
+ _loading;
331
+ l10nStore;
332
+ i18nStore;
333
+ timezoneService;
334
+ l10nSources;
335
+ i18nSources;
336
+ /** Reactive current language */
337
+ get language() {
338
+ return this._language;
339
+ }
340
+ /** Reactive loading state */
341
+ get loading() {
342
+ return this._loading;
343
+ }
344
+ /** Computed current locale data — reactive, updates on language change */
345
+ localeData;
346
+ constructor(t = {}) {
347
+ this.defaultLanguage = t.defaultLanguage ?? "en", this._language = y(this.defaultLanguage), this._loading = y(!1), this.l10nStore = new L(), this.i18nStore = new N(), this.timezoneService = new A(t.timezoneProviders);
348
+ const n = new I();
349
+ this.l10nSources = [n];
350
+ const e = new C();
351
+ this.i18nSources = [e], t.l10nUrl && this.l10nSources.push(new D(t.l10nUrl)), t.i18nUrl && this.i18nSources.push(new k(t.i18nUrl)), this.localeData = d(() => this.l10nStore.getLocaleData(this._language.value));
352
+ }
353
+ /** Get the configured default language */
354
+ getDefaultLanguage() {
355
+ return this.defaultLanguage;
356
+ }
357
+ /**
358
+ * Change the current language.
359
+ * Loads locale data and translations if not already cached.
360
+ */
361
+ async setLanguage(t) {
362
+ this._loading.value = !0;
363
+ try {
364
+ await this.loadDataForLanguage(t), this._language.value = t;
365
+ } finally {
366
+ this._loading.value = !1;
367
+ }
368
+ }
369
+ /**
370
+ * Preload data for a language without switching to it.
371
+ */
372
+ async preloadLanguage(t) {
373
+ await this.loadDataForLanguage(t);
374
+ }
375
+ /**
376
+ * Force reload data for a language from all sources, clearing the cache.
377
+ * Useful when external data changes at runtime (e.g. SignalR push, user profile update).
378
+ * If no language is specified, reloads the current language.
379
+ */
380
+ async reloadLanguage(t) {
381
+ const n = t ?? this._language.value;
382
+ this._loading.value = !0;
383
+ try {
384
+ this.l10nStore.removeLocaleData(n), this.i18nStore.clearLanguage(n), await this.loadDataForLanguage(n), this.i18nStore.touch();
385
+ } finally {
386
+ this._loading.value = !1;
387
+ }
388
+ }
389
+ /**
390
+ * Translate a key using the current language.
391
+ * For regional locales (e.g. de-AT), falls back to the base language (de).
392
+ * Returns the key itself if no translation is found.
393
+ */
394
+ t(t, n, e) {
395
+ const a = this._language.value;
396
+ let o = this.i18nStore.getTranslation(a, t);
397
+ if (o === void 0 && a.includes("-")) {
398
+ const i = a.split("-")[0];
399
+ o = this.i18nStore.getTranslation(i, t);
400
+ }
401
+ return x(o ?? e ?? t, n);
402
+ }
403
+ /**
404
+ * Add a custom locale data source (loaded after Intl, before HTTP).
405
+ */
406
+ addLocaleDataSource(t) {
407
+ const n = this.l10nSources.findIndex((e) => e instanceof D);
408
+ n >= 0 ? this.l10nSources.splice(n, 0, t) : this.l10nSources.push(t);
409
+ }
410
+ /**
411
+ * Add a custom translation source.
412
+ */
413
+ addTranslationSource(t) {
414
+ this.i18nSources.push(t);
415
+ }
416
+ async loadDataForLanguage(t) {
417
+ const n = [];
418
+ this.l10nStore.hasLocaleData(t) || n.push(this.loadLocaleData(t)), this.i18nStore.hasLanguage(t) || n.push(this.loadTranslations(t)), await Promise.all(n);
419
+ }
420
+ async loadLocaleData(t) {
421
+ let n = null;
422
+ for (const e of this.l10nSources)
423
+ try {
424
+ const a = await e.load(t);
425
+ a && (n ? n = T(n, a) : n = a);
426
+ } catch {
427
+ }
428
+ n && this.l10nStore.setLocaleData(t, n);
429
+ }
430
+ async loadTranslations(t) {
431
+ for (const n of this.i18nSources)
432
+ try {
433
+ const e = await n.load(t);
434
+ e && (this.i18nStore.hasLanguage(t) ? this.i18nStore.updateTranslations(t, e) : this.i18nStore.setTranslations(t, e));
435
+ } catch {
436
+ }
437
+ this.i18nStore.hasLanguage(t) || this.i18nStore.setTranslations(t, {});
438
+ }
439
+ }
440
+ class D {
441
+ constructor(t) {
442
+ this.urlBuilder = t;
443
+ }
444
+ async load(t) {
445
+ const n = t.includes("-") ? t.split("-")[0] : null;
446
+ let e = null;
447
+ if (n)
448
+ try {
449
+ const a = await fetch(this.urlBuilder(n));
450
+ a.ok && (e = await a.json());
451
+ } catch {
452
+ }
453
+ try {
454
+ const a = await fetch(this.urlBuilder(t));
455
+ if (a.ok) {
456
+ const o = await a.json();
457
+ e ? e = T(e, o) : e = o;
458
+ }
459
+ } catch {
460
+ }
461
+ return e;
462
+ }
463
+ }
464
+ class k {
465
+ constructor(t) {
466
+ this.urlBuilder = t;
467
+ }
468
+ async load(t) {
469
+ const n = t.includes("-") ? t.split("-")[0] : null;
470
+ let e = null;
471
+ if (n)
472
+ try {
473
+ const a = await fetch(this.urlBuilder(n));
474
+ a.ok && (e = await a.json());
475
+ } catch {
476
+ }
477
+ try {
478
+ const a = await fetch(this.urlBuilder(t));
479
+ if (a.ok) {
480
+ const o = await a.json();
481
+ e ? e = { ...e, ...o } : e = o;
482
+ }
483
+ } catch {
484
+ }
485
+ return e;
486
+ }
487
+ }
488
+ function S(r, t, n) {
489
+ const e = n ?? 2, a = Math.abs(r).toFixed(e), [o, s] = a.split(".");
490
+ let i = "";
491
+ const c = o, l = t.grouping[0] ?? 3;
492
+ let m = c.length;
493
+ for (; m > 0; ) {
494
+ const u = Math.max(0, m - l);
495
+ i = c.slice(u, m) + (i ? t.group + i : ""), m = u;
496
+ }
497
+ const h = r < 0 ? "-" : "";
498
+ return e > 0 && s ? `${h}${i}${t.decimal}${s}` : `${h}${i}`;
499
+ }
500
+ function B(r, t, n) {
501
+ const e = t.currency, a = n ?? e.default, o = e.symbols[a] ?? a, s = S(r, t.number, e.decimals), i = e.spacing ? " " : "";
502
+ return e.position === "before" ? `${o}${i}${s}` : `${s}${i}${o}`;
503
+ }
504
+ function H(r, t, n) {
505
+ const e = t.percent, a = n ?? e.decimals, o = S(r * 100, t.number, a), s = e.spacing ? " " : "";
506
+ return `${o}${s}${e.symbol}`;
507
+ }
508
+ function K(r, t, n = !1) {
509
+ const e = typeof r == "string" ? new Date(r) : r;
510
+ if (isNaN(e.getTime())) return String(r);
511
+ const a = String(e.getDate()).padStart(2, "0"), o = String(e.getMonth() + 1).padStart(2, "0"), s = String(e.getFullYear());
512
+ let i;
513
+ switch (t.pattern) {
514
+ case "mm/dd/yyyy":
515
+ i = `${o}/${a}/${s}`;
516
+ break;
517
+ case "yyyy-mm-dd":
518
+ i = `${s}-${o}-${a}`;
519
+ break;
520
+ case "dd/mm/yyyy":
521
+ i = `${a}/${o}/${s}`;
522
+ break;
523
+ default:
524
+ i = `${a}.${o}.${s}`;
525
+ break;
526
+ }
527
+ if (n) {
528
+ const c = String(e.getHours()).padStart(2, "0"), l = String(e.getMinutes()).padStart(2, "0");
529
+ i += ` ${c}:${l}`;
530
+ }
531
+ return i;
532
+ }
533
+ const g = /* @__PURE__ */ Symbol("coar-localization");
534
+ function G(r = {}) {
535
+ const t = new M(r);
536
+ return {
537
+ service: t,
538
+ install(e) {
539
+ e.provide(g, t);
540
+ }
541
+ };
542
+ }
543
+ function W() {
544
+ return p(g, null);
545
+ }
546
+ function Y() {
547
+ const r = p(g, null), t = r ? r.language : d(() => navigator.language || "en"), n = r ? r.localeData : d(() => {
548
+ });
549
+ return {
550
+ /** Current language (reactive) */
551
+ language: t,
552
+ /** Current locale data (reactive) */
553
+ localeData: n,
554
+ /** Format a number */
555
+ fmtNumber: (e, a) => {
556
+ const o = n.value;
557
+ return o ? S(e, o.number, a) : e.toFixed(a ?? 2);
558
+ },
559
+ /** Format a currency value */
560
+ fmtCurrency: (e, a) => {
561
+ const o = n.value;
562
+ return o ? B(e, o, a) : e.toFixed(2);
563
+ },
564
+ /** Format a percentage (0.25 → "25%") */
565
+ fmtPercent: (e, a) => {
566
+ const o = n.value;
567
+ return o ? H(e, o, a) : `${(e * 100).toFixed(a ?? 0)}%`;
568
+ },
569
+ /** Format a date */
570
+ fmtDate: (e, a = !1) => {
571
+ const o = n.value;
572
+ return o ? K(e, o.date, a) : String(e);
573
+ }
574
+ };
575
+ }
576
+ function j() {
577
+ const r = p(g, null);
578
+ return {
579
+ /** Current language (reactive) */
580
+ language: r ? r.language : d(() => navigator.language || "en"),
581
+ /**
582
+ * Translate a key. Returns the key if no translation found.
583
+ * Reactive — updates when language changes.
584
+ */
585
+ t: (t, n, e) => r ? r.t(t, n, e) : e ?? t,
586
+ /**
587
+ * Create a computed translation ref that reacts to language changes.
588
+ */
589
+ tRef: (t, n, e) => r ? d(() => r.t(t, n, e)) : d(() => e ?? t)
590
+ };
591
+ }
592
+ function J() {
593
+ const r = p(g, null);
594
+ return {
595
+ /** Current timezone (reactive IANA identifier) */
596
+ timezone: r ? r.timezoneService.timezone : d(() => {
597
+ try {
598
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
599
+ } catch {
600
+ return "UTC";
601
+ }
602
+ }),
603
+ /** Re-resolve timezone from providers */
604
+ refresh: () => r?.timezoneService.refresh()
605
+ };
606
+ }
607
+ export {
608
+ E as BrowserTimezoneProvider,
609
+ g as COAR_LOCALIZATION_KEY,
610
+ L as CoarLocalizationDataStore,
611
+ M as CoarLocalizationService,
612
+ A as CoarTimezoneService,
613
+ N as CoarTranslationStore,
614
+ I as IntlLocaleDataSource,
615
+ C as IntlTranslationSource,
616
+ G as createCoarLocalization,
617
+ B as formatCurrency,
618
+ K as formatDate,
619
+ S as formatNumber,
620
+ H as formatPercent,
621
+ x as interpolate,
622
+ Z as isMissingTranslation,
623
+ T as mergeLocalizationData,
624
+ j as useI18n,
625
+ Y as useL10n,
626
+ W as useLocalization,
627
+ J as useTimezone
628
+ };
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@cocoar/vue-localization",
3
+ "version": "0.1.0-beta.23",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "vite build",
20
+ "test": "vitest run",
21
+ "lint": "eslint src/"
22
+ },
23
+ "peerDependencies": {
24
+ "vue": "^3.5.0"
25
+ },
26
+ "devDependencies": {
27
+ "vue": "^3.5.0"
28
+ }
29
+ }