hazo_ui 6.11.2 → 6.12.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.
- package/CHANGE_LOG.md +18 -0
- package/dist/index.cjs +5 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -42
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
4
4
|
import * as React27 from 'react';
|
|
5
5
|
import React27__default, { lazy, useRef, useState, useCallback, useEffect, useMemo, Fragment, Suspense, useSyncExternalStore } from 'react';
|
|
6
6
|
import { generateRequestId } from 'hazo_core';
|
|
7
|
-
import {
|
|
7
|
+
import { withContext, setBrowserCorrelationId } from 'hazo_core/client';
|
|
8
8
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
9
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
10
|
import { cva } from 'class-variance-authority';
|
|
@@ -15,6 +15,7 @@ import * as SelectPrimitive from '@radix-ui/react-select';
|
|
|
15
15
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
16
16
|
import { DayPicker } from 'react-day-picker';
|
|
17
17
|
import { format } from 'date-fns';
|
|
18
|
+
import { createPackageT, resolvePackageLocale } from 'hazo_core/i18n';
|
|
18
19
|
import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter, pointerWithin, rectIntersection, closestCorners, DragOverlay, useDroppable } from '@dnd-kit/core';
|
|
19
20
|
import { sortableKeyboardCoordinates, SortableContext, verticalListSortingStrategy, arrayMove, useSortable } from '@dnd-kit/sortable';
|
|
20
21
|
import { CSS } from '@dnd-kit/utilities';
|
|
@@ -642,47 +643,6 @@ function Calendar({
|
|
|
642
643
|
);
|
|
643
644
|
}
|
|
644
645
|
Calendar.displayName = "Calendar";
|
|
645
|
-
var hazo_i18n_module = null;
|
|
646
|
-
void optional_import("hazo_i18n").then((mod) => {
|
|
647
|
-
hazo_i18n_module = mod;
|
|
648
|
-
}).catch(() => {
|
|
649
|
-
hazo_i18n_module = null;
|
|
650
|
-
});
|
|
651
|
-
function interpolate(template, vars) {
|
|
652
|
-
if (!vars) return template;
|
|
653
|
-
return template.replace(
|
|
654
|
-
/\{\{\s*(\w+)\s*\}\}/g,
|
|
655
|
-
(whole, name) => Object.prototype.hasOwnProperty.call(vars, name) ? vars[name] : whole
|
|
656
|
-
);
|
|
657
|
-
}
|
|
658
|
-
function createPackageT(namespace, fallbackCatalog) {
|
|
659
|
-
return function t4(key, vars) {
|
|
660
|
-
const mod = hazo_i18n_module;
|
|
661
|
-
if (mod && typeof mod.t === "function") {
|
|
662
|
-
try {
|
|
663
|
-
const translated = mod.t(`${namespace}.${key}`, vars);
|
|
664
|
-
if (typeof translated === "string" && translated.length > 0) {
|
|
665
|
-
return translated;
|
|
666
|
-
}
|
|
667
|
-
} catch {
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
const template = fallbackCatalog[key];
|
|
671
|
-
if (template === void 0) return key;
|
|
672
|
-
return interpolate(template, vars);
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
function resolvePackageLocale(defaultLocale) {
|
|
676
|
-
const mod = hazo_i18n_module;
|
|
677
|
-
if (mod && typeof mod.getStaticLocale === "function") {
|
|
678
|
-
try {
|
|
679
|
-
const locale = mod.getStaticLocale();
|
|
680
|
-
if (typeof locale === "string" && locale.length > 0) return locale;
|
|
681
|
-
} catch {
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
return defaultLocale;
|
|
685
|
-
}
|
|
686
646
|
|
|
687
647
|
// src/locales/en.json
|
|
688
648
|
var en_default = {
|