hazo_ui 6.12.5 → 6.13.1
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 +56 -0
- package/README.md +18 -1
- package/dist/index.cjs +290 -241
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -5
- package/dist/index.d.ts +37 -5
- package/dist/index.js +289 -243
- package/dist/index.js.map +1 -1
- package/dist/index.locale-picker.cjs +18 -1
- package/dist/index.locale-picker.cjs.map +1 -1
- package/dist/index.locale-picker.js +19 -1
- package/dist/index.locale-picker.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -182,8 +182,8 @@ var require_extends = __commonJS({
|
|
|
182
182
|
function _extends11() {
|
|
183
183
|
return module.exports = _extends11 = Object.assign ? Object.assign.bind() : function(n) {
|
|
184
184
|
for (var e = 1; e < arguments.length; e++) {
|
|
185
|
-
var
|
|
186
|
-
for (var r in
|
|
185
|
+
var t = arguments[e];
|
|
186
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
187
187
|
}
|
|
188
188
|
return n;
|
|
189
189
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends11.apply(null, arguments);
|
|
@@ -197,12 +197,12 @@ var require_objectWithoutPropertiesLoose = __commonJS({
|
|
|
197
197
|
"../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"(exports, module) {
|
|
198
198
|
function _objectWithoutPropertiesLoose10(r, e) {
|
|
199
199
|
if (null == r) return {};
|
|
200
|
-
var
|
|
200
|
+
var t = {};
|
|
201
201
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
202
202
|
if (-1 !== e.indexOf(n)) continue;
|
|
203
|
-
|
|
203
|
+
t[n] = r[n];
|
|
204
204
|
}
|
|
205
|
-
return
|
|
205
|
+
return t;
|
|
206
206
|
}
|
|
207
207
|
module.exports = _objectWithoutPropertiesLoose10, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
208
208
|
}
|
|
@@ -753,6 +753,11 @@ var en_default = {
|
|
|
753
753
|
"rte.horizontal_rule": "Horizontal rule",
|
|
754
754
|
"rte.insert_image": "Insert image",
|
|
755
755
|
"rte.table": "Table",
|
|
756
|
+
"rte.tab_html": "HTML",
|
|
757
|
+
"rte.tab_plain_text": "Plain Text",
|
|
758
|
+
"rte.tab_raw_html": "Raw HTML",
|
|
759
|
+
"rte.empty_content": "(empty)",
|
|
760
|
+
"rte.link_placeholder": "https://example.com",
|
|
756
761
|
"rte.insert_variable": "Insert variable",
|
|
757
762
|
"rte.attach_file": "Attach file",
|
|
758
763
|
"rte.block_type.paragraph": "Paragraph",
|
|
@@ -801,6 +806,9 @@ var en_default = {
|
|
|
801
806
|
"canvas_toolbar.align_right": "Align right",
|
|
802
807
|
"canvas_toolbar.text_color": "Text color",
|
|
803
808
|
"canvas_toolbar.font_family": "Font family",
|
|
809
|
+
"canvas_toolbar.font_sans": "Sans",
|
|
810
|
+
"canvas_toolbar.font_serif": "Serif",
|
|
811
|
+
"canvas_toolbar.font_mono": "Mono",
|
|
804
812
|
"canvas_toolbar.align_top": "Align top",
|
|
805
813
|
"canvas_toolbar.align_middle": "Align middle",
|
|
806
814
|
"canvas_toolbar.align_bottom": "Align bottom",
|
|
@@ -813,6 +821,8 @@ var en_default = {
|
|
|
813
821
|
"notification.loading": "Loading notifications",
|
|
814
822
|
"notification.mark_all_read": "Mark all as read",
|
|
815
823
|
"notification.unread": "Unread",
|
|
824
|
+
"notification.unread_count": "{{count}} unread",
|
|
825
|
+
"browser_tab.close_aria": "Close {{label}}",
|
|
816
826
|
"confirm.cancel": "Cancel",
|
|
817
827
|
"icon_picker.search_placeholder": "Search icons...",
|
|
818
828
|
"common.loading": "Loading...",
|
|
@@ -832,10 +842,12 @@ var en_default = {
|
|
|
832
842
|
"kanban.select_placeholder": "Select {{label}}\u2026",
|
|
833
843
|
"kanban.select_priority": "Select priority\u2026",
|
|
834
844
|
"kanban.select_status": "Select status\u2026",
|
|
845
|
+
"kanban.clear": "Clear",
|
|
835
846
|
"markdown.placeholder": "Write in Markdown\u2026",
|
|
836
847
|
"markdown.upload_failed": "Upload failed.",
|
|
837
848
|
"markdown.loading_editor": "Loading editor\u2026",
|
|
838
849
|
"markdown.uploading_image": "Uploading image\u2026",
|
|
850
|
+
"markdown.upload_placeholder": "uploading\u2026",
|
|
839
851
|
"cropper.title": "Crop photo",
|
|
840
852
|
"cropper.save": "Save",
|
|
841
853
|
"cropper.cancel": "Cancel",
|
|
@@ -924,7 +936,26 @@ var en_default = {
|
|
|
924
936
|
"charts.dropoff": "Drop-off: \u2212{{value}}",
|
|
925
937
|
"toast.missing_prefix": "Missing: {{items}}"
|
|
926
938
|
};
|
|
927
|
-
var
|
|
939
|
+
var default_t = i18n.createPackageT("hazo_ui", en_default);
|
|
940
|
+
var defaultHazoUiT = default_t;
|
|
941
|
+
var HazoUiI18nContext = React27.createContext(default_t);
|
|
942
|
+
function HazoUiI18nProvider({ t, children }) {
|
|
943
|
+
const safe_t = React27.useMemo(
|
|
944
|
+
() => (key, values) => {
|
|
945
|
+
try {
|
|
946
|
+
return t(key, values);
|
|
947
|
+
} catch {
|
|
948
|
+
get_logger().warn("i18n_missing_key_fallback", { key });
|
|
949
|
+
return default_t(key, values);
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
[t]
|
|
953
|
+
);
|
|
954
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HazoUiI18nContext.Provider, { value: safe_t, children });
|
|
955
|
+
}
|
|
956
|
+
function useHazoUiT() {
|
|
957
|
+
return React27.useContext(HazoUiI18nContext);
|
|
958
|
+
}
|
|
928
959
|
function FilterFieldItem({
|
|
929
960
|
filterConfig,
|
|
930
961
|
fieldConfig,
|
|
@@ -932,6 +963,7 @@ function FilterFieldItem({
|
|
|
932
963
|
onOperatorChange,
|
|
933
964
|
onDelete
|
|
934
965
|
}) {
|
|
966
|
+
const t = useHazoUiT();
|
|
935
967
|
const [isCalendarOpen, setIsCalendarOpen] = React27.useState(false);
|
|
936
968
|
const renderInput = () => {
|
|
937
969
|
switch (fieldConfig.type) {
|
|
@@ -1117,8 +1149,8 @@ function HazoUiMultiFilterDialog({
|
|
|
1117
1149
|
availableFields,
|
|
1118
1150
|
onFilterChange,
|
|
1119
1151
|
initialFilters = [],
|
|
1120
|
-
title
|
|
1121
|
-
description
|
|
1152
|
+
title: titleProp,
|
|
1153
|
+
description: descriptionProp,
|
|
1122
1154
|
headerBackgroundColor,
|
|
1123
1155
|
headerTextColor,
|
|
1124
1156
|
submitButtonBackgroundColor,
|
|
@@ -1130,6 +1162,9 @@ function HazoUiMultiFilterDialog({
|
|
|
1130
1162
|
clearButtonTextColor,
|
|
1131
1163
|
clearButtonBorderColor
|
|
1132
1164
|
}) {
|
|
1165
|
+
const t = useHazoUiT();
|
|
1166
|
+
const description = descriptionProp ?? t("filter.description");
|
|
1167
|
+
const title = titleProp ?? t("filter.title");
|
|
1133
1168
|
const config = get_hazo_ui_config();
|
|
1134
1169
|
const finalSubmitBgColor = submitButtonBackgroundColor ?? config.submit_button_background_color;
|
|
1135
1170
|
const finalSubmitTextColor = submitButtonTextColor ?? config.submit_button_text_color;
|
|
@@ -1371,7 +1406,6 @@ function HazoUiMultiFilterDialog({
|
|
|
1371
1406
|
] })
|
|
1372
1407
|
] });
|
|
1373
1408
|
}
|
|
1374
|
-
var t2 = i18n.createPackageT("hazo_ui", en_default);
|
|
1375
1409
|
function SortableSortFieldItem({
|
|
1376
1410
|
sortConfig,
|
|
1377
1411
|
fieldLabel,
|
|
@@ -1379,6 +1413,7 @@ function SortableSortFieldItem({
|
|
|
1379
1413
|
onDirectionChange,
|
|
1380
1414
|
onDelete
|
|
1381
1415
|
}) {
|
|
1416
|
+
const t = useHazoUiT();
|
|
1382
1417
|
const {
|
|
1383
1418
|
attributes,
|
|
1384
1419
|
listeners,
|
|
@@ -1410,7 +1445,7 @@ function SortableSortFieldItem({
|
|
|
1410
1445
|
...attributes,
|
|
1411
1446
|
...listeners,
|
|
1412
1447
|
className: "cls_drag_handle flex h-7 w-5 shrink-0 cursor-grab items-center justify-center rounded text-muted-foreground/60 hover:text-foreground active:cursor-grabbing",
|
|
1413
|
-
"aria-label":
|
|
1448
|
+
"aria-label": t("sort.reorder_aria", { field: fieldLabel }),
|
|
1414
1449
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GripVertical, { className: "cls_drag_icon h-4 w-4" })
|
|
1415
1450
|
}
|
|
1416
1451
|
),
|
|
@@ -1418,7 +1453,7 @@ function SortableSortFieldItem({
|
|
|
1418
1453
|
"span",
|
|
1419
1454
|
{
|
|
1420
1455
|
className: "cls_priority_badge inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold tabular-nums text-muted-foreground",
|
|
1421
|
-
"aria-label":
|
|
1456
|
+
"aria-label": t("sort.priority_aria", { n: priority }),
|
|
1422
1457
|
children: priority
|
|
1423
1458
|
}
|
|
1424
1459
|
),
|
|
@@ -1427,7 +1462,7 @@ function SortableSortFieldItem({
|
|
|
1427
1462
|
"div",
|
|
1428
1463
|
{
|
|
1429
1464
|
role: "radiogroup",
|
|
1430
|
-
"aria-label":
|
|
1465
|
+
"aria-label": t("sort.direction_aria", { field: fieldLabel }),
|
|
1431
1466
|
className: "cls_direction_control inline-flex shrink-0 items-center rounded-md border border-border/70 bg-muted/40 p-0.5",
|
|
1432
1467
|
children: [
|
|
1433
1468
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1441,7 +1476,7 @@ function SortableSortFieldItem({
|
|
|
1441
1476
|
className: "cls_dir_asc inline-flex items-center gap-1 rounded px-2 py-1 text-xs font-medium text-muted-foreground transition-colors data-[active=true]:bg-background data-[active=true]:text-foreground data-[active=true]:shadow-sm hover:text-foreground",
|
|
1442
1477
|
children: [
|
|
1443
1478
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUp, { className: "h-3 w-3" }),
|
|
1444
|
-
|
|
1479
|
+
t("sort.asc")
|
|
1445
1480
|
]
|
|
1446
1481
|
}
|
|
1447
1482
|
),
|
|
@@ -1456,7 +1491,7 @@ function SortableSortFieldItem({
|
|
|
1456
1491
|
className: "cls_dir_desc inline-flex items-center gap-1 rounded px-2 py-1 text-xs font-medium text-muted-foreground transition-colors data-[active=true]:bg-background data-[active=true]:text-foreground data-[active=true]:shadow-sm hover:text-foreground",
|
|
1457
1492
|
children: [
|
|
1458
1493
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { className: "h-3 w-3" }),
|
|
1459
|
-
|
|
1494
|
+
t("sort.desc")
|
|
1460
1495
|
]
|
|
1461
1496
|
}
|
|
1462
1497
|
)
|
|
@@ -1470,7 +1505,7 @@ function SortableSortFieldItem({
|
|
|
1470
1505
|
size: "sm",
|
|
1471
1506
|
onClick: onDelete,
|
|
1472
1507
|
className: "cls_delete_btn h-7 w-7 shrink-0 p-0 text-muted-foreground/60 hover:bg-destructive/10 hover:text-destructive",
|
|
1473
|
-
"aria-label":
|
|
1508
|
+
"aria-label": t("sort.remove_aria", { field: fieldLabel }),
|
|
1474
1509
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "cls_delete_icon h-3.5 w-3.5" })
|
|
1475
1510
|
}
|
|
1476
1511
|
)
|
|
@@ -1482,8 +1517,8 @@ function HazoUiMultiSortDialog({
|
|
|
1482
1517
|
availableFields,
|
|
1483
1518
|
onSortChange,
|
|
1484
1519
|
initialSortFields = [],
|
|
1485
|
-
title
|
|
1486
|
-
description
|
|
1520
|
+
title: titleProp,
|
|
1521
|
+
description: descriptionProp,
|
|
1487
1522
|
headerBackgroundColor,
|
|
1488
1523
|
headerTextColor,
|
|
1489
1524
|
submitButtonBackgroundColor,
|
|
@@ -1495,6 +1530,9 @@ function HazoUiMultiSortDialog({
|
|
|
1495
1530
|
clearButtonTextColor,
|
|
1496
1531
|
clearButtonBorderColor
|
|
1497
1532
|
}) {
|
|
1533
|
+
const t = useHazoUiT();
|
|
1534
|
+
const description = descriptionProp ?? t("sort.description");
|
|
1535
|
+
const title = titleProp ?? t("sort.title");
|
|
1498
1536
|
const config = get_hazo_ui_config();
|
|
1499
1537
|
const finalSubmitBgColor = submitButtonBackgroundColor ?? config.submit_button_background_color;
|
|
1500
1538
|
const finalSubmitTextColor = submitButtonTextColor ?? config.submit_button_text_color;
|
|
@@ -1583,16 +1621,16 @@ function HazoUiMultiSortDialog({
|
|
|
1583
1621
|
};
|
|
1584
1622
|
const hasActiveSorts = initialSortFields.length > 0;
|
|
1585
1623
|
const tooltipContent = hasActiveSorts ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_sort_tooltip_content space-y-1", children: [
|
|
1586
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_tooltip_title text-xs font-semibold mb-1", children:
|
|
1624
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_tooltip_title text-xs font-semibold mb-1", children: t("sort.active_sorts") }),
|
|
1587
1625
|
initialSortFields.map((sortConfig, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_tooltip_item text-xs", children: [
|
|
1588
1626
|
index + 1,
|
|
1589
1627
|
". ",
|
|
1590
1628
|
getFieldLabel(sortConfig.field),
|
|
1591
1629
|
" (",
|
|
1592
|
-
sortConfig.direction === "asc" ?
|
|
1630
|
+
sortConfig.direction === "asc" ? t("sort.asc") : t("sort.desc"),
|
|
1593
1631
|
")"
|
|
1594
1632
|
] }, sortConfig.field))
|
|
1595
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_sort_tooltip_content text-xs", children:
|
|
1633
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_sort_tooltip_content text-xs", children: t("sort.no_active_sorts") });
|
|
1596
1634
|
return /* @__PURE__ */ jsxRuntime.jsxs(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
1597
1635
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
1598
1636
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1601,7 +1639,7 @@ function HazoUiMultiSortDialog({
|
|
|
1601
1639
|
variant: "outline",
|
|
1602
1640
|
size: "sm",
|
|
1603
1641
|
className: "cls_sort_button",
|
|
1604
|
-
"aria-label":
|
|
1642
|
+
"aria-label": t("sort.open_dialog_aria"),
|
|
1605
1643
|
children: [
|
|
1606
1644
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1607
1645
|
lucideReact.ArrowUpDown,
|
|
@@ -1612,7 +1650,7 @@ function HazoUiMultiSortDialog({
|
|
|
1612
1650
|
)
|
|
1613
1651
|
}
|
|
1614
1652
|
),
|
|
1615
|
-
|
|
1653
|
+
t("sort.button_label"),
|
|
1616
1654
|
hasActiveSorts && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_sort_count ml-2 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-blue-600 px-1 text-[10px] font-semibold text-white", children: initialSortFields.length })
|
|
1617
1655
|
]
|
|
1618
1656
|
}
|
|
@@ -1657,7 +1695,7 @@ function HazoUiMultiSortDialog({
|
|
|
1657
1695
|
}
|
|
1658
1696
|
)
|
|
1659
1697
|
}
|
|
1660
|
-
) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_empty_sort_fields rounded-lg border border-dashed border-border/70 bg-muted/20 px-4 py-6 text-center text-xs text-muted-foreground", children:
|
|
1698
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_empty_sort_fields rounded-lg border border-dashed border-border/70 bg-muted/20 px-4 py-6 text-center text-xs text-muted-foreground", children: t("sort.empty_message") }),
|
|
1661
1699
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_add_field_section", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: isComboboxOpen, onOpenChange: setIsComboboxOpen, children: [
|
|
1662
1700
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1663
1701
|
Button,
|
|
@@ -1669,13 +1707,13 @@ function HazoUiMultiSortDialog({
|
|
|
1669
1707
|
className: "cls_add_field_combobox w-full justify-start gap-2 border border-dashed border-border/70 text-sm font-medium text-muted-foreground hover:border-border hover:bg-muted/40 hover:text-foreground",
|
|
1670
1708
|
children: [
|
|
1671
1709
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "cls_plus_icon h-4 w-4" }),
|
|
1672
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: availableFieldsToAdd.length === 0 ?
|
|
1710
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: availableFieldsToAdd.length === 0 ? t("sort.all_fields_added") : t("sort.add_sort_field") })
|
|
1673
1711
|
]
|
|
1674
1712
|
}
|
|
1675
1713
|
) }),
|
|
1676
1714
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "cls_combobox_popover w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
|
|
1677
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder:
|
|
1678
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: availableFieldsToAdd.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children:
|
|
1715
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: t("sort.search_fields"), className: "cls_command_input" }),
|
|
1716
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: availableFieldsToAdd.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: t("sort.no_fields_available") }) : /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: availableFieldsToAdd.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1679
1717
|
CommandItem,
|
|
1680
1718
|
{
|
|
1681
1719
|
value: field.label,
|
|
@@ -1697,7 +1735,7 @@ function HazoUiMultiSortDialog({
|
|
|
1697
1735
|
onClick: handleClearAll,
|
|
1698
1736
|
className: "cls_clear_all_btn text-muted-foreground hover:text-foreground",
|
|
1699
1737
|
style: clearButtonStyles,
|
|
1700
|
-
children:
|
|
1738
|
+
children: t("sort.clear_all")
|
|
1701
1739
|
}
|
|
1702
1740
|
) }),
|
|
1703
1741
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_footer_right flex items-center gap-2", children: [
|
|
@@ -1709,7 +1747,7 @@ function HazoUiMultiSortDialog({
|
|
|
1709
1747
|
onClick: handleCancel,
|
|
1710
1748
|
className: "cls_cancel_btn",
|
|
1711
1749
|
style: cancelButtonStyles,
|
|
1712
|
-
children:
|
|
1750
|
+
children: t("sort.cancel")
|
|
1713
1751
|
}
|
|
1714
1752
|
),
|
|
1715
1753
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1719,7 +1757,7 @@ function HazoUiMultiSortDialog({
|
|
|
1719
1757
|
onClick: handleApply,
|
|
1720
1758
|
className: "cls_apply_btn",
|
|
1721
1759
|
style: submitButtonStyles,
|
|
1722
|
-
children:
|
|
1760
|
+
children: t("sort.apply")
|
|
1723
1761
|
}
|
|
1724
1762
|
)
|
|
1725
1763
|
] })
|
|
@@ -2138,7 +2176,6 @@ var TabsContent = React27__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
2138
2176
|
}
|
|
2139
2177
|
));
|
|
2140
2178
|
TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
|
|
2141
|
-
var t3 = i18n.createPackageT("hazo_ui", en_default);
|
|
2142
2179
|
function isLucideValue(value) {
|
|
2143
2180
|
return value.startsWith("lucide:");
|
|
2144
2181
|
}
|
|
@@ -2357,6 +2394,7 @@ function HazoUiIconPicker({
|
|
|
2357
2394
|
triggerClassName,
|
|
2358
2395
|
align = "start"
|
|
2359
2396
|
}) {
|
|
2397
|
+
const t = useHazoUiT();
|
|
2360
2398
|
const [open, set_open] = React27__namespace.useState(false);
|
|
2361
2399
|
const [search, set_search] = React27__namespace.useState("");
|
|
2362
2400
|
const handle_select = React27__namespace.useCallback(
|
|
@@ -2404,7 +2442,7 @@ function HazoUiIconPicker({
|
|
|
2404
2442
|
type: "text",
|
|
2405
2443
|
value: search,
|
|
2406
2444
|
onChange: (e) => set_search(e.target.value),
|
|
2407
|
-
placeholder:
|
|
2445
|
+
placeholder: t("icon_picker.search_placeholder"),
|
|
2408
2446
|
className: cn(
|
|
2409
2447
|
"cls_hazo_ui_icon_picker_search",
|
|
2410
2448
|
"mb-2 flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm",
|
|
@@ -2428,11 +2466,11 @@ function HazoUiIconPicker({
|
|
|
2428
2466
|
name
|
|
2429
2467
|
);
|
|
2430
2468
|
}),
|
|
2431
|
-
filtered_search_results.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "col-span-8 py-4 text-center text-sm text-muted-foreground", children:
|
|
2469
|
+
filtered_search_results.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "col-span-8 py-4 text-center text-sm text-muted-foreground", children: t("icon_picker.no_results") })
|
|
2432
2470
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(Tabs, { defaultValue: "emoji", children: [
|
|
2433
2471
|
/* @__PURE__ */ jsxRuntime.jsxs(TabsList, { className: "grid w-full grid-cols-6", children: [
|
|
2434
|
-
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "emoji", children:
|
|
2435
|
-
LUCIDE_GROUPS.map((group) => /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: group.key, children:
|
|
2472
|
+
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "emoji", children: t("icon_picker.emoji_tab") }),
|
|
2473
|
+
LUCIDE_GROUPS.map((group) => /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: group.key, children: t(group.label_key) }, group.key))
|
|
2436
2474
|
] }),
|
|
2437
2475
|
/* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "emoji", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid max-h-56 grid-cols-8 gap-1 overflow-y-auto", children: EMOJI_ITEMS.map((emoji, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2438
2476
|
"button",
|
|
@@ -2464,8 +2502,7 @@ function HazoUiIconPicker({
|
|
|
2464
2502
|
}
|
|
2465
2503
|
) });
|
|
2466
2504
|
}
|
|
2467
|
-
|
|
2468
|
-
function validateInput(value, input_type, text_len_min, text_len_max, num_min, num_max, regex, num_decimals) {
|
|
2505
|
+
function validateInput(value, input_type, text_len_min, text_len_max, num_min, num_max, regex, num_decimals, t) {
|
|
2469
2506
|
if (value === "") {
|
|
2470
2507
|
return { isValid: true };
|
|
2471
2508
|
}
|
|
@@ -2473,36 +2510,36 @@ function validateInput(value, input_type, text_len_min, text_len_max, num_min, n
|
|
|
2473
2510
|
case "numeric": {
|
|
2474
2511
|
const numValue = parseFloat(value);
|
|
2475
2512
|
if (isNaN(numValue)) {
|
|
2476
|
-
return { isValid: false, errorMessage:
|
|
2513
|
+
return { isValid: false, errorMessage: t("flex_input.must_be_valid_number") };
|
|
2477
2514
|
}
|
|
2478
2515
|
if (num_decimals !== void 0) {
|
|
2479
2516
|
const decimalPlaces = value.split(".")[1]?.length || 0;
|
|
2480
2517
|
if (decimalPlaces > num_decimals) {
|
|
2481
2518
|
return {
|
|
2482
2519
|
isValid: false,
|
|
2483
|
-
errorMessage:
|
|
2520
|
+
errorMessage: t("flex_input.max_decimals", { count: num_decimals })
|
|
2484
2521
|
};
|
|
2485
2522
|
}
|
|
2486
2523
|
}
|
|
2487
2524
|
if (num_min !== void 0 && numValue < num_min) {
|
|
2488
|
-
return { isValid: false, errorMessage:
|
|
2525
|
+
return { isValid: false, errorMessage: t("flex_input.min_value", { min: num_min }) };
|
|
2489
2526
|
}
|
|
2490
2527
|
if (num_max !== void 0 && numValue > num_max) {
|
|
2491
|
-
return { isValid: false, errorMessage:
|
|
2528
|
+
return { isValid: false, errorMessage: t("flex_input.max_value", { max: num_max }) };
|
|
2492
2529
|
}
|
|
2493
2530
|
break;
|
|
2494
2531
|
}
|
|
2495
2532
|
case "alpha": {
|
|
2496
2533
|
const alphaRegex = /^[A-Za-z0-9\s]*$/;
|
|
2497
2534
|
if (!alphaRegex.test(value)) {
|
|
2498
|
-
return { isValid: false, errorMessage:
|
|
2535
|
+
return { isValid: false, errorMessage: t("flex_input.alpha_only") };
|
|
2499
2536
|
}
|
|
2500
2537
|
break;
|
|
2501
2538
|
}
|
|
2502
2539
|
case "email": {
|
|
2503
2540
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
2504
2541
|
if (!emailRegex.test(value)) {
|
|
2505
|
-
return { isValid: false, errorMessage:
|
|
2542
|
+
return { isValid: false, errorMessage: t("flex_input.must_be_valid_email") };
|
|
2506
2543
|
}
|
|
2507
2544
|
break;
|
|
2508
2545
|
}
|
|
@@ -2510,13 +2547,13 @@ function validateInput(value, input_type, text_len_min, text_len_max, num_min, n
|
|
|
2510
2547
|
if (text_len_min !== void 0 && value.length < text_len_min) {
|
|
2511
2548
|
return {
|
|
2512
2549
|
isValid: false,
|
|
2513
|
-
errorMessage:
|
|
2550
|
+
errorMessage: t("flex_input.min_characters", { min: text_len_min })
|
|
2514
2551
|
};
|
|
2515
2552
|
}
|
|
2516
2553
|
if (text_len_max !== void 0 && value.length > text_len_max) {
|
|
2517
2554
|
return {
|
|
2518
2555
|
isValid: false,
|
|
2519
|
-
errorMessage:
|
|
2556
|
+
errorMessage: t("flex_input.max_characters", { max: text_len_max })
|
|
2520
2557
|
};
|
|
2521
2558
|
}
|
|
2522
2559
|
break;
|
|
@@ -2525,7 +2562,7 @@ function validateInput(value, input_type, text_len_min, text_len_max, num_min, n
|
|
|
2525
2562
|
if (regex) {
|
|
2526
2563
|
const regexPattern = typeof regex === "string" ? new RegExp(regex) : regex;
|
|
2527
2564
|
if (!regexPattern.test(value)) {
|
|
2528
|
-
return { isValid: false, errorMessage:
|
|
2565
|
+
return { isValid: false, errorMessage: t("flex_input.invalid_format") };
|
|
2529
2566
|
}
|
|
2530
2567
|
}
|
|
2531
2568
|
return { isValid: true };
|
|
@@ -2576,6 +2613,7 @@ var HazoUiFlexInput = React27__namespace.forwardRef(
|
|
|
2576
2613
|
onBlur,
|
|
2577
2614
|
...props
|
|
2578
2615
|
}, ref) => {
|
|
2616
|
+
const t = useHazoUiT();
|
|
2579
2617
|
const [internalValue, setInternalValue] = React27__namespace.useState(
|
|
2580
2618
|
typeof controlledValue === "string" ? controlledValue : typeof controlledValue === "number" ? String(controlledValue) : ""
|
|
2581
2619
|
);
|
|
@@ -2618,10 +2656,11 @@ var HazoUiFlexInput = React27__namespace.forwardRef(
|
|
|
2618
2656
|
num_min,
|
|
2619
2657
|
num_max,
|
|
2620
2658
|
regex,
|
|
2621
|
-
num_decimals
|
|
2659
|
+
num_decimals,
|
|
2660
|
+
t
|
|
2622
2661
|
);
|
|
2623
2662
|
if (!validation.isValid) {
|
|
2624
|
-
setErrorMessage(validation.errorMessage || format_guide ||
|
|
2663
|
+
setErrorMessage(validation.errorMessage || format_guide || t("flex_input.invalid_input"));
|
|
2625
2664
|
} else {
|
|
2626
2665
|
setErrorMessage(void 0);
|
|
2627
2666
|
}
|
|
@@ -3851,10 +3890,10 @@ var BLOCK_TYPE_LABEL_KEYS = {
|
|
|
3851
3890
|
"code-block": "rte.block_type.code_block",
|
|
3852
3891
|
blockquote: "rte.block_type.blockquote"
|
|
3853
3892
|
};
|
|
3854
|
-
function get_translated_block_types(
|
|
3893
|
+
function get_translated_block_types(t) {
|
|
3855
3894
|
return BLOCK_TYPES.map((type) => ({
|
|
3856
3895
|
...type,
|
|
3857
|
-
label:
|
|
3896
|
+
label: t(BLOCK_TYPE_LABEL_KEYS[type.value])
|
|
3858
3897
|
}));
|
|
3859
3898
|
}
|
|
3860
3899
|
|
|
@@ -3901,7 +3940,6 @@ function get_file_extension(filename) {
|
|
|
3901
3940
|
function is_image_file(mime_type) {
|
|
3902
3941
|
return mime_type.startsWith("image/");
|
|
3903
3942
|
}
|
|
3904
|
-
var t5 = i18n.createPackageT("hazo_ui", en_default);
|
|
3905
3943
|
var ALL_ON = {
|
|
3906
3944
|
undo_redo: true,
|
|
3907
3945
|
block_type: true,
|
|
@@ -3938,6 +3976,7 @@ var Toolbar = ({
|
|
|
3938
3976
|
toolbar,
|
|
3939
3977
|
font_families
|
|
3940
3978
|
}) => {
|
|
3979
|
+
const t = useHazoUiT();
|
|
3941
3980
|
const [link_url, set_link_url] = React27__namespace.useState("https://");
|
|
3942
3981
|
const [link_popover_open, set_link_popover_open] = React27__namespace.useState(false);
|
|
3943
3982
|
const [text_color_open, set_text_color_open] = React27__namespace.useState(false);
|
|
@@ -3956,7 +3995,7 @@ var Toolbar = ({
|
|
|
3956
3995
|
}
|
|
3957
3996
|
const tb = { ...ALL_ON, ...toolbar };
|
|
3958
3997
|
const font_family_options = font_families && font_families.length > 0 ? font_families : FONT_FAMILIES;
|
|
3959
|
-
const block_type_options = get_translated_block_types(
|
|
3998
|
+
const block_type_options = get_translated_block_types(t);
|
|
3960
3999
|
const get_current_font_size = () => {
|
|
3961
4000
|
const attrs = editor.getAttributes("textStyle");
|
|
3962
4001
|
return attrs.fontSize || FONT_SIZE_CONFIG.default;
|
|
@@ -4100,7 +4139,7 @@ var Toolbar = ({
|
|
|
4100
4139
|
{
|
|
4101
4140
|
onClick: () => editor.chain().focus().undo().run(),
|
|
4102
4141
|
disabled: !editor.can().undo(),
|
|
4103
|
-
tooltip:
|
|
4142
|
+
tooltip: t("rte.undo"),
|
|
4104
4143
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUndo2, { className: "h-4 w-4" })
|
|
4105
4144
|
},
|
|
4106
4145
|
"undo"
|
|
@@ -4110,7 +4149,7 @@ var Toolbar = ({
|
|
|
4110
4149
|
{
|
|
4111
4150
|
onClick: () => editor.chain().focus().redo().run(),
|
|
4112
4151
|
disabled: !editor.can().redo(),
|
|
4113
|
-
tooltip:
|
|
4152
|
+
tooltip: t("rte.redo"),
|
|
4114
4153
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuRedo2, { className: "h-4 w-4" })
|
|
4115
4154
|
},
|
|
4116
4155
|
"redo"
|
|
@@ -4151,7 +4190,7 @@ var Toolbar = ({
|
|
|
4151
4190
|
ToolbarButton,
|
|
4152
4191
|
{
|
|
4153
4192
|
onClick: () => handle_font_size_change(-2),
|
|
4154
|
-
tooltip:
|
|
4193
|
+
tooltip: t("rte.decrease_font_size"),
|
|
4155
4194
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuMinus, { className: "h-3 w-3" })
|
|
4156
4195
|
}
|
|
4157
4196
|
),
|
|
@@ -4160,7 +4199,7 @@ var Toolbar = ({
|
|
|
4160
4199
|
ToolbarButton,
|
|
4161
4200
|
{
|
|
4162
4201
|
onClick: () => handle_font_size_change(FONT_SIZE_CONFIG.step),
|
|
4163
|
-
tooltip:
|
|
4202
|
+
tooltip: t("rte.increase_font_size"),
|
|
4164
4203
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuPlus, { className: "h-3 w-3" })
|
|
4165
4204
|
}
|
|
4166
4205
|
)
|
|
@@ -4178,7 +4217,7 @@ var Toolbar = ({
|
|
|
4178
4217
|
{
|
|
4179
4218
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
4180
4219
|
is_active: editor.isActive("bold"),
|
|
4181
|
-
tooltip:
|
|
4220
|
+
tooltip: t("rte.bold"),
|
|
4182
4221
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuBold, { className: "h-4 w-4" })
|
|
4183
4222
|
},
|
|
4184
4223
|
"bold"
|
|
@@ -4192,7 +4231,7 @@ var Toolbar = ({
|
|
|
4192
4231
|
{
|
|
4193
4232
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
4194
4233
|
is_active: editor.isActive("italic"),
|
|
4195
|
-
tooltip:
|
|
4234
|
+
tooltip: t("rte.italic"),
|
|
4196
4235
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuItalic, { className: "h-4 w-4" })
|
|
4197
4236
|
},
|
|
4198
4237
|
"italic"
|
|
@@ -4206,7 +4245,7 @@ var Toolbar = ({
|
|
|
4206
4245
|
{
|
|
4207
4246
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
4208
4247
|
is_active: editor.isActive("underline"),
|
|
4209
|
-
tooltip:
|
|
4248
|
+
tooltip: t("rte.underline"),
|
|
4210
4249
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUnderline, { className: "h-4 w-4" })
|
|
4211
4250
|
},
|
|
4212
4251
|
"underline"
|
|
@@ -4220,7 +4259,7 @@ var Toolbar = ({
|
|
|
4220
4259
|
{
|
|
4221
4260
|
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
4222
4261
|
is_active: editor.isActive("strike"),
|
|
4223
|
-
tooltip:
|
|
4262
|
+
tooltip: t("rte.strikethrough"),
|
|
4224
4263
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuStrikethrough, { className: "h-4 w-4" })
|
|
4225
4264
|
},
|
|
4226
4265
|
"strike"
|
|
@@ -4234,7 +4273,7 @@ var Toolbar = ({
|
|
|
4234
4273
|
{
|
|
4235
4274
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
4236
4275
|
is_active: editor.isActive("subscript"),
|
|
4237
|
-
tooltip:
|
|
4276
|
+
tooltip: t("rte.subscript"),
|
|
4238
4277
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuSubscript, { className: "h-4 w-4" })
|
|
4239
4278
|
},
|
|
4240
4279
|
"sub"
|
|
@@ -4248,7 +4287,7 @@ var Toolbar = ({
|
|
|
4248
4287
|
{
|
|
4249
4288
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
4250
4289
|
is_active: editor.isActive("superscript"),
|
|
4251
|
-
tooltip:
|
|
4290
|
+
tooltip: t("rte.superscript"),
|
|
4252
4291
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuSuperscript, { className: "h-4 w-4" })
|
|
4253
4292
|
},
|
|
4254
4293
|
"super"
|
|
@@ -4262,26 +4301,26 @@ var Toolbar = ({
|
|
|
4262
4301
|
if (tb.link) {
|
|
4263
4302
|
items.push(
|
|
4264
4303
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: link_popover_open, onOpenChange: set_link_popover_open, children: [
|
|
4265
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: editor.isActive("link"), tooltip:
|
|
4304
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: editor.isActive("link"), tooltip: t("rte.link"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuLink, { className: "h-4 w-4" }) }) }),
|
|
4266
4305
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-80 p-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4267
4306
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4268
4307
|
Input,
|
|
4269
4308
|
{
|
|
4270
4309
|
value: link_url,
|
|
4271
4310
|
onChange: (e) => set_link_url(e.target.value),
|
|
4272
|
-
placeholder: "
|
|
4311
|
+
placeholder: t("rte.link_placeholder"),
|
|
4273
4312
|
className: "h-8 text-sm"
|
|
4274
4313
|
}
|
|
4275
4314
|
),
|
|
4276
4315
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
4277
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: handle_set_link, className: "flex-1", children: editor.isActive("link") ?
|
|
4316
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: handle_set_link, className: "flex-1", children: editor.isActive("link") ? t("rte.update_link") : t("rte.add_link") }),
|
|
4278
4317
|
editor.isActive("link") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4279
4318
|
Button,
|
|
4280
4319
|
{
|
|
4281
4320
|
size: "sm",
|
|
4282
4321
|
variant: "destructive",
|
|
4283
4322
|
onClick: handle_remove_link,
|
|
4284
|
-
children:
|
|
4323
|
+
children: t("rte.remove_link")
|
|
4285
4324
|
}
|
|
4286
4325
|
)
|
|
4287
4326
|
] })
|
|
@@ -4295,7 +4334,7 @@ var Toolbar = ({
|
|
|
4295
4334
|
ToolbarButton,
|
|
4296
4335
|
{
|
|
4297
4336
|
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
4298
|
-
tooltip:
|
|
4337
|
+
tooltip: t("rte.clear_formatting"),
|
|
4299
4338
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuRemoveFormatting, { className: "h-4 w-4" })
|
|
4300
4339
|
},
|
|
4301
4340
|
"clear"
|
|
@@ -4309,7 +4348,7 @@ var Toolbar = ({
|
|
|
4309
4348
|
if (tb.text_color) {
|
|
4310
4349
|
items.push(
|
|
4311
4350
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: text_color_open, onOpenChange: set_text_color_open, children: [
|
|
4312
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip:
|
|
4351
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t("rte.text_color"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
4313
4352
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuPalette, { className: "h-4 w-4" }),
|
|
4314
4353
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4315
4354
|
"div",
|
|
@@ -4352,7 +4391,7 @@ var Toolbar = ({
|
|
|
4352
4391
|
if (tb.highlight_color) {
|
|
4353
4392
|
items.push(
|
|
4354
4393
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: highlight_color_open, onOpenChange: set_highlight_color_open, children: [
|
|
4355
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip:
|
|
4394
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t("rte.highlight_color"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
4356
4395
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuHighlighter, { className: "h-4 w-4" }),
|
|
4357
4396
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4358
4397
|
"div",
|
|
@@ -4395,7 +4434,7 @@ var Toolbar = ({
|
|
|
4395
4434
|
{
|
|
4396
4435
|
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
4397
4436
|
is_active: editor.isActive({ textAlign: "left" }),
|
|
4398
|
-
tooltip:
|
|
4437
|
+
tooltip: t("rte.align_left"),
|
|
4399
4438
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignLeft, { className: "h-4 w-4" })
|
|
4400
4439
|
},
|
|
4401
4440
|
"align-left"
|
|
@@ -4405,7 +4444,7 @@ var Toolbar = ({
|
|
|
4405
4444
|
{
|
|
4406
4445
|
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
4407
4446
|
is_active: editor.isActive({ textAlign: "center" }),
|
|
4408
|
-
tooltip:
|
|
4447
|
+
tooltip: t("rte.align_center"),
|
|
4409
4448
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignCenter, { className: "h-4 w-4" })
|
|
4410
4449
|
},
|
|
4411
4450
|
"align-center"
|
|
@@ -4415,7 +4454,7 @@ var Toolbar = ({
|
|
|
4415
4454
|
{
|
|
4416
4455
|
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
4417
4456
|
is_active: editor.isActive({ textAlign: "right" }),
|
|
4418
|
-
tooltip:
|
|
4457
|
+
tooltip: t("rte.align_right"),
|
|
4419
4458
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignRight, { className: "h-4 w-4" })
|
|
4420
4459
|
},
|
|
4421
4460
|
"align-right"
|
|
@@ -4425,7 +4464,7 @@ var Toolbar = ({
|
|
|
4425
4464
|
{
|
|
4426
4465
|
onClick: () => editor.chain().focus().setTextAlign("justify").run(),
|
|
4427
4466
|
is_active: editor.isActive({ textAlign: "justify" }),
|
|
4428
|
-
tooltip:
|
|
4467
|
+
tooltip: t("rte.justify"),
|
|
4429
4468
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignJustify, { className: "h-4 w-4" })
|
|
4430
4469
|
},
|
|
4431
4470
|
"align-justify"
|
|
@@ -4441,7 +4480,7 @@ var Toolbar = ({
|
|
|
4441
4480
|
{
|
|
4442
4481
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
4443
4482
|
is_active: editor.isActive("bulletList"),
|
|
4444
|
-
tooltip:
|
|
4483
|
+
tooltip: t("rte.bullet_list"),
|
|
4445
4484
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuList, { className: "h-4 w-4" })
|
|
4446
4485
|
},
|
|
4447
4486
|
"bullet"
|
|
@@ -4455,7 +4494,7 @@ var Toolbar = ({
|
|
|
4455
4494
|
{
|
|
4456
4495
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
4457
4496
|
is_active: editor.isActive("orderedList"),
|
|
4458
|
-
tooltip:
|
|
4497
|
+
tooltip: t("rte.ordered_list"),
|
|
4459
4498
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuListOrdered, { className: "h-4 w-4" })
|
|
4460
4499
|
},
|
|
4461
4500
|
"ordered"
|
|
@@ -4469,7 +4508,7 @@ var Toolbar = ({
|
|
|
4469
4508
|
{
|
|
4470
4509
|
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
4471
4510
|
is_active: editor.isActive("taskList"),
|
|
4472
|
-
tooltip:
|
|
4511
|
+
tooltip: t("rte.checklist"),
|
|
4473
4512
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuListChecks, { className: "h-4 w-4" })
|
|
4474
4513
|
},
|
|
4475
4514
|
"task"
|
|
@@ -4491,7 +4530,7 @@ var Toolbar = ({
|
|
|
4491
4530
|
}
|
|
4492
4531
|
},
|
|
4493
4532
|
disabled: !editor.can().liftListItem("listItem") && !editor.can().liftListItem("taskItem"),
|
|
4494
|
-
tooltip:
|
|
4533
|
+
tooltip: t("rte.decrease_indent"),
|
|
4495
4534
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuIndentDecrease, { className: "h-4 w-4" })
|
|
4496
4535
|
},
|
|
4497
4536
|
"indent-dec"
|
|
@@ -4507,7 +4546,7 @@ var Toolbar = ({
|
|
|
4507
4546
|
}
|
|
4508
4547
|
},
|
|
4509
4548
|
disabled: !editor.can().sinkListItem("listItem") && !editor.can().sinkListItem("taskItem"),
|
|
4510
|
-
tooltip:
|
|
4549
|
+
tooltip: t("rte.increase_indent"),
|
|
4511
4550
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuIndentIncrease, { className: "h-4 w-4" })
|
|
4512
4551
|
},
|
|
4513
4552
|
"indent-inc"
|
|
@@ -4518,7 +4557,7 @@ var Toolbar = ({
|
|
|
4518
4557
|
const items = [];
|
|
4519
4558
|
if (tb.horizontal_rule) {
|
|
4520
4559
|
items.push(
|
|
4521
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { onClick: handle_hr_insert, tooltip:
|
|
4560
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { onClick: handle_hr_insert, tooltip: t("rte.horizontal_rule"), children: /* @__PURE__ */ jsxRuntime.jsx(rx.RxDividerHorizontal, { className: "h-4 w-4" }) }, "hr")
|
|
4522
4561
|
);
|
|
4523
4562
|
}
|
|
4524
4563
|
if (tb.image) {
|
|
@@ -4527,7 +4566,7 @@ var Toolbar = ({
|
|
|
4527
4566
|
ToolbarButton,
|
|
4528
4567
|
{
|
|
4529
4568
|
onClick: () => image_input_ref.current?.click(),
|
|
4530
|
-
tooltip:
|
|
4569
|
+
tooltip: t("rte.insert_image"),
|
|
4531
4570
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuImage, { className: "h-4 w-4" })
|
|
4532
4571
|
},
|
|
4533
4572
|
"image"
|
|
@@ -4541,14 +4580,14 @@ var Toolbar = ({
|
|
|
4541
4580
|
ToolbarButton,
|
|
4542
4581
|
{
|
|
4543
4582
|
is_active: editor.isActive("table"),
|
|
4544
|
-
tooltip:
|
|
4583
|
+
tooltip: t("rte.table"),
|
|
4545
4584
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuTable, { className: "h-4 w-4" })
|
|
4546
4585
|
}
|
|
4547
4586
|
) }),
|
|
4548
4587
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-3", align: "start", children: editor.isActive("table") ? (
|
|
4549
4588
|
// Table editing controls when inside a table
|
|
4550
4589
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4551
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children:
|
|
4590
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children: t("rte.table_operations") }),
|
|
4552
4591
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-1", children: [
|
|
4553
4592
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4554
4593
|
Button,
|
|
@@ -4559,7 +4598,7 @@ var Toolbar = ({
|
|
|
4559
4598
|
onClick: handle_add_row_before,
|
|
4560
4599
|
children: [
|
|
4561
4600
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTableRowsSplit, { className: "h-3 w-3 mr-1" }),
|
|
4562
|
-
|
|
4601
|
+
t("rte.add_row_above")
|
|
4563
4602
|
]
|
|
4564
4603
|
}
|
|
4565
4604
|
),
|
|
@@ -4572,7 +4611,7 @@ var Toolbar = ({
|
|
|
4572
4611
|
onClick: handle_add_row_after,
|
|
4573
4612
|
children: [
|
|
4574
4613
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTableRowsSplit, { className: "h-3 w-3 mr-1" }),
|
|
4575
|
-
|
|
4614
|
+
t("rte.add_row_below")
|
|
4576
4615
|
]
|
|
4577
4616
|
}
|
|
4578
4617
|
),
|
|
@@ -4585,7 +4624,7 @@ var Toolbar = ({
|
|
|
4585
4624
|
onClick: handle_add_col_before,
|
|
4586
4625
|
children: [
|
|
4587
4626
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTableColumnsSplit, { className: "h-3 w-3 mr-1" }),
|
|
4588
|
-
|
|
4627
|
+
t("rte.add_col_left")
|
|
4589
4628
|
]
|
|
4590
4629
|
}
|
|
4591
4630
|
),
|
|
@@ -4598,7 +4637,7 @@ var Toolbar = ({
|
|
|
4598
4637
|
onClick: handle_add_col_after,
|
|
4599
4638
|
children: [
|
|
4600
4639
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTableColumnsSplit, { className: "h-3 w-3 mr-1" }),
|
|
4601
|
-
|
|
4640
|
+
t("rte.add_col_right")
|
|
4602
4641
|
]
|
|
4603
4642
|
}
|
|
4604
4643
|
),
|
|
@@ -4611,7 +4650,7 @@ var Toolbar = ({
|
|
|
4611
4650
|
onClick: handle_delete_row,
|
|
4612
4651
|
children: [
|
|
4613
4652
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTrash2, { className: "h-3 w-3 mr-1" }),
|
|
4614
|
-
|
|
4653
|
+
t("rte.delete_row")
|
|
4615
4654
|
]
|
|
4616
4655
|
}
|
|
4617
4656
|
),
|
|
@@ -4624,7 +4663,7 @@ var Toolbar = ({
|
|
|
4624
4663
|
onClick: handle_delete_col,
|
|
4625
4664
|
children: [
|
|
4626
4665
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTrash2, { className: "h-3 w-3 mr-1" }),
|
|
4627
|
-
|
|
4666
|
+
t("rte.delete_col")
|
|
4628
4667
|
]
|
|
4629
4668
|
}
|
|
4630
4669
|
)
|
|
@@ -4638,7 +4677,7 @@ var Toolbar = ({
|
|
|
4638
4677
|
onClick: handle_delete_table,
|
|
4639
4678
|
children: [
|
|
4640
4679
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTrash2, { className: "h-3 w-3 mr-1" }),
|
|
4641
|
-
|
|
4680
|
+
t("rte.delete_table")
|
|
4642
4681
|
]
|
|
4643
4682
|
}
|
|
4644
4683
|
)
|
|
@@ -4646,7 +4685,7 @@ var Toolbar = ({
|
|
|
4646
4685
|
) : (
|
|
4647
4686
|
// Table size picker when not in a table
|
|
4648
4687
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4649
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children:
|
|
4688
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children: t("rte.insert_table_heading") }),
|
|
4650
4689
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-0.5", children: Array.from({ length: 6 }).map((_, row_idx) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-0.5", children: Array.from({ length: 6 }).map((_2, col_idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4651
4690
|
"div",
|
|
4652
4691
|
{
|
|
@@ -4660,9 +4699,9 @@ var Toolbar = ({
|
|
|
4660
4699
|
},
|
|
4661
4700
|
col_idx
|
|
4662
4701
|
)) }, row_idx)) }),
|
|
4663
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-center text-muted-foreground", children: hovered_cell ? `${hovered_cell.col} x ${hovered_cell.row}` :
|
|
4702
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-center text-muted-foreground", children: hovered_cell ? `${hovered_cell.col} x ${hovered_cell.row}` : t("rte.select_size") }),
|
|
4664
4703
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t pt-2 mt-1", children: [
|
|
4665
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground mb-2", children:
|
|
4704
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground mb-2", children: t("rte.custom_size") }),
|
|
4666
4705
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4667
4706
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4668
4707
|
Input,
|
|
@@ -4695,7 +4734,7 @@ var Toolbar = ({
|
|
|
4695
4734
|
onClick: () => handle_table_insert(table_rows, table_cols),
|
|
4696
4735
|
children: [
|
|
4697
4736
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuGrid3X3, { className: "h-3 w-3 mr-1" }),
|
|
4698
|
-
|
|
4737
|
+
t("rte.insert_table")
|
|
4699
4738
|
]
|
|
4700
4739
|
}
|
|
4701
4740
|
)
|
|
@@ -4713,11 +4752,11 @@ var Toolbar = ({
|
|
|
4713
4752
|
if (tb.variables && variables.length > 0) {
|
|
4714
4753
|
items.push(
|
|
4715
4754
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: variables_menu_open, onOpenChange: set_variables_menu_open, children: [
|
|
4716
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip:
|
|
4755
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t("rte.insert_variable"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuVariable, { className: "h-4 w-4" }) }) }),
|
|
4717
4756
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
|
|
4718
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder:
|
|
4757
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: t("rte.search_variables"), className: "h-8 text-xs" }),
|
|
4719
4758
|
/* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
|
|
4720
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children:
|
|
4759
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: t("rte.no_variables") }),
|
|
4721
4760
|
/* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: variables.map((variable) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4722
4761
|
CommandItem,
|
|
4723
4762
|
{
|
|
@@ -4742,7 +4781,7 @@ var Toolbar = ({
|
|
|
4742
4781
|
ToolbarButton,
|
|
4743
4782
|
{
|
|
4744
4783
|
onClick: () => file_input_ref.current?.click(),
|
|
4745
|
-
tooltip:
|
|
4784
|
+
tooltip: t("rte.attach_file"),
|
|
4746
4785
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuPaperclip, { className: "h-4 w-4" })
|
|
4747
4786
|
},
|
|
4748
4787
|
"attach"
|
|
@@ -5014,7 +5053,6 @@ var VariableExtension = core.Node.create({
|
|
|
5014
5053
|
};
|
|
5015
5054
|
}
|
|
5016
5055
|
});
|
|
5017
|
-
var t6 = i18n.createPackageT("hazo_ui", en_default);
|
|
5018
5056
|
function debounce_fn(func, wait) {
|
|
5019
5057
|
let timeout_id = null;
|
|
5020
5058
|
return (output) => {
|
|
@@ -5040,7 +5078,8 @@ var HazoUiRte = ({
|
|
|
5040
5078
|
toolbar,
|
|
5041
5079
|
font_families
|
|
5042
5080
|
}) => {
|
|
5043
|
-
const
|
|
5081
|
+
const t = useHazoUiT();
|
|
5082
|
+
const resolved_placeholder = placeholder ?? t("rte.placeholder");
|
|
5044
5083
|
const [attachments, set_attachments] = React27__namespace.useState(
|
|
5045
5084
|
initial_attachments
|
|
5046
5085
|
);
|
|
@@ -5234,9 +5273,9 @@ var HazoUiRte = ({
|
|
|
5234
5273
|
}
|
|
5235
5274
|
),
|
|
5236
5275
|
show_output_viewer && editor && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_rte_tabs border-b border-border px-2 pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(Tabs, { value: active_tab, onValueChange: (v) => set_active_tab(v), children: /* @__PURE__ */ jsxRuntime.jsxs(TabsList, { className: "h-9", children: [
|
|
5237
|
-
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "html", className: "text-sm", children: "
|
|
5238
|
-
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "plain_text", className: "text-sm", children: "
|
|
5239
|
-
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "raw_html", className: "text-sm", children: "
|
|
5276
|
+
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "html", className: "text-sm", children: t("rte.tab_html") }),
|
|
5277
|
+
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "plain_text", className: "text-sm", children: t("rte.tab_plain_text") }),
|
|
5278
|
+
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "raw_html", className: "text-sm", children: t("rte.tab_raw_html") })
|
|
5240
5279
|
] }) }) }),
|
|
5241
5280
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minHeight: min_height, maxHeight: max_height }, className: "overflow-auto", children: [
|
|
5242
5281
|
active_tab === "html" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5249,8 +5288,8 @@ var HazoUiRte = ({
|
|
|
5249
5288
|
)
|
|
5250
5289
|
}
|
|
5251
5290
|
),
|
|
5252
|
-
active_tab === "plain_text" && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "cls_rte_plain_text p-4 text-sm whitespace-pre-wrap font-mono h-full", children: editor?.getText() || "
|
|
5253
|
-
active_tab === "raw_html" && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "cls_rte_raw_html p-4 text-xs whitespace-pre-wrap font-mono text-muted-foreground h-full", children: format_html(editor?.getHTML() || "") || "
|
|
5291
|
+
active_tab === "plain_text" && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "cls_rte_plain_text p-4 text-sm whitespace-pre-wrap font-mono h-full", children: editor?.getText() || t("rte.empty_content") }),
|
|
5292
|
+
active_tab === "raw_html" && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "cls_rte_raw_html p-4 text-xs whitespace-pre-wrap font-mono text-muted-foreground h-full", children: format_html(editor?.getHTML() || "") || t("rte.empty_content") })
|
|
5254
5293
|
] }),
|
|
5255
5294
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5256
5295
|
AttachmentsList,
|
|
@@ -5265,7 +5304,6 @@ var HazoUiRte = ({
|
|
|
5265
5304
|
);
|
|
5266
5305
|
};
|
|
5267
5306
|
HazoUiRte.displayName = "HazoUiRte";
|
|
5268
|
-
var t7 = i18n.createPackageT("hazo_ui", en_default);
|
|
5269
5307
|
function CanvasTextToolbar({
|
|
5270
5308
|
bold,
|
|
5271
5309
|
italic,
|
|
@@ -5286,6 +5324,7 @@ function CanvasTextToolbar({
|
|
|
5286
5324
|
className,
|
|
5287
5325
|
style
|
|
5288
5326
|
}) {
|
|
5327
|
+
const t = useHazoUiT();
|
|
5289
5328
|
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5290
5329
|
"div",
|
|
5291
5330
|
{
|
|
@@ -5296,14 +5335,14 @@ function CanvasTextToolbar({
|
|
|
5296
5335
|
),
|
|
5297
5336
|
style,
|
|
5298
5337
|
children: [
|
|
5299
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bold, onClick: onBold, tooltip:
|
|
5300
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: italic, onClick: onItalic, tooltip:
|
|
5338
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bold, onClick: onBold, tooltip: t("canvas_toolbar.bold"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuBold, { className: "h-4 w-4" }) }),
|
|
5339
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: italic, onClick: onItalic, tooltip: t("canvas_toolbar.italic"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuItalic, { className: "h-4 w-4" }) }),
|
|
5301
5340
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5302
5341
|
ToolbarButton,
|
|
5303
5342
|
{
|
|
5304
5343
|
is_active: underline,
|
|
5305
5344
|
onClick: onUnderline,
|
|
5306
|
-
tooltip:
|
|
5345
|
+
tooltip: t("canvas_toolbar.underline"),
|
|
5307
5346
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUnderline, { className: "h-4 w-4" })
|
|
5308
5347
|
}
|
|
5309
5348
|
),
|
|
@@ -5313,7 +5352,7 @@ function CanvasTextToolbar({
|
|
|
5313
5352
|
{
|
|
5314
5353
|
is_active: align === "left",
|
|
5315
5354
|
onClick: () => onAlign?.("left"),
|
|
5316
|
-
tooltip:
|
|
5355
|
+
tooltip: t("canvas_toolbar.align_left"),
|
|
5317
5356
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignLeft, { className: "h-4 w-4" })
|
|
5318
5357
|
}
|
|
5319
5358
|
),
|
|
@@ -5322,7 +5361,7 @@ function CanvasTextToolbar({
|
|
|
5322
5361
|
{
|
|
5323
5362
|
is_active: align === "center",
|
|
5324
5363
|
onClick: () => onAlign?.("center"),
|
|
5325
|
-
tooltip:
|
|
5364
|
+
tooltip: t("canvas_toolbar.align_center"),
|
|
5326
5365
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignCenter, { className: "h-4 w-4" })
|
|
5327
5366
|
}
|
|
5328
5367
|
),
|
|
@@ -5331,7 +5370,7 @@ function CanvasTextToolbar({
|
|
|
5331
5370
|
{
|
|
5332
5371
|
is_active: align === "right",
|
|
5333
5372
|
onClick: () => onAlign?.("right"),
|
|
5334
|
-
tooltip:
|
|
5373
|
+
tooltip: t("canvas_toolbar.align_right"),
|
|
5335
5374
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignRight, { className: "h-4 w-4" })
|
|
5336
5375
|
}
|
|
5337
5376
|
),
|
|
@@ -5340,7 +5379,7 @@ function CanvasTextToolbar({
|
|
|
5340
5379
|
"label",
|
|
5341
5380
|
{
|
|
5342
5381
|
className: "relative flex h-8 w-8 cursor-pointer items-center justify-center rounded-md hover:bg-accent",
|
|
5343
|
-
title:
|
|
5382
|
+
title: t("canvas_toolbar.text_color"),
|
|
5344
5383
|
children: [
|
|
5345
5384
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
5346
5385
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold text-muted-foreground", children: "A" }),
|
|
@@ -5370,7 +5409,7 @@ function CanvasTextToolbar({
|
|
|
5370
5409
|
{
|
|
5371
5410
|
is_active: verticalAlign === "top",
|
|
5372
5411
|
onClick: () => onVerticalAlign?.("top"),
|
|
5373
|
-
tooltip:
|
|
5412
|
+
tooltip: t("canvas_toolbar.align_top"),
|
|
5374
5413
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyStart, { className: "h-4 w-4" })
|
|
5375
5414
|
}
|
|
5376
5415
|
),
|
|
@@ -5379,7 +5418,7 @@ function CanvasTextToolbar({
|
|
|
5379
5418
|
{
|
|
5380
5419
|
is_active: verticalAlign === "middle",
|
|
5381
5420
|
onClick: () => onVerticalAlign?.("middle"),
|
|
5382
|
-
tooltip:
|
|
5421
|
+
tooltip: t("canvas_toolbar.align_middle"),
|
|
5383
5422
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyCenter, { className: "h-4 w-4" })
|
|
5384
5423
|
}
|
|
5385
5424
|
),
|
|
@@ -5388,7 +5427,7 @@ function CanvasTextToolbar({
|
|
|
5388
5427
|
{
|
|
5389
5428
|
is_active: verticalAlign === "bottom",
|
|
5390
5429
|
onClick: () => onVerticalAlign?.("bottom"),
|
|
5391
|
-
tooltip:
|
|
5430
|
+
tooltip: t("canvas_toolbar.align_bottom"),
|
|
5392
5431
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyEnd, { className: "h-4 w-4" })
|
|
5393
5432
|
}
|
|
5394
5433
|
),
|
|
@@ -5399,11 +5438,11 @@ function CanvasTextToolbar({
|
|
|
5399
5438
|
value: font,
|
|
5400
5439
|
onChange: (e) => onFont?.(e.target.value),
|
|
5401
5440
|
className: "h-8 text-xs rounded-md border border-border bg-background px-1 text-foreground focus:outline-none",
|
|
5402
|
-
title:
|
|
5441
|
+
title: t("canvas_toolbar.font_family"),
|
|
5403
5442
|
children: [
|
|
5404
|
-
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "sans-serif", children: "
|
|
5405
|
-
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "serif", children: "
|
|
5406
|
-
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "monospace", children: "
|
|
5443
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "sans-serif", children: t("canvas_toolbar.font_sans") }),
|
|
5444
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "serif", children: t("canvas_toolbar.font_serif") }),
|
|
5445
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "monospace", children: t("canvas_toolbar.font_mono") }),
|
|
5407
5446
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "Arial", children: "Arial" }),
|
|
5408
5447
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "Georgia", children: "Georgia" }),
|
|
5409
5448
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "Courier New", children: "Courier" })
|
|
@@ -5411,12 +5450,11 @@ function CanvasTextToolbar({
|
|
|
5411
5450
|
}
|
|
5412
5451
|
),
|
|
5413
5452
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-1 h-6 w-px bg-border" }),
|
|
5414
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bullet, onClick: onBullet, tooltip:
|
|
5453
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bullet, onClick: onBullet, tooltip: t("canvas_toolbar.bullet_list"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuList, { className: "h-4 w-4" }) })
|
|
5415
5454
|
]
|
|
5416
5455
|
}
|
|
5417
5456
|
) });
|
|
5418
5457
|
}
|
|
5419
|
-
var t8 = i18n.createPackageT("hazo_ui", en_default);
|
|
5420
5458
|
var MdEditorLazy = React27.lazy(() => import('@uiw/react-md-editor'));
|
|
5421
5459
|
var EDITOR_TEXTAREA_SELECTOR = ".w-md-editor-text-input";
|
|
5422
5460
|
function MarkdownEditor({
|
|
@@ -5433,6 +5471,7 @@ function MarkdownEditor({
|
|
|
5433
5471
|
renderPreview,
|
|
5434
5472
|
showPreview = true
|
|
5435
5473
|
}) {
|
|
5474
|
+
const t = useHazoUiT();
|
|
5436
5475
|
const [mounted, setMounted] = React27.useState(false);
|
|
5437
5476
|
React27.useEffect(() => setMounted(true), []);
|
|
5438
5477
|
const valueRef = React27.useRef(value);
|
|
@@ -5500,19 +5539,19 @@ function MarkdownEditor({
|
|
|
5500
5539
|
const current = valueRef.current;
|
|
5501
5540
|
const before = current.slice(0, start);
|
|
5502
5541
|
const after = current.slice(end);
|
|
5503
|
-
onChange(before + "![
|
|
5542
|
+
onChange(before + "![" + t("markdown.upload_placeholder") + "]()" + after);
|
|
5504
5543
|
setUploading(true);
|
|
5505
5544
|
setError("");
|
|
5506
5545
|
try {
|
|
5507
5546
|
const url = await onImageUpload(file);
|
|
5508
5547
|
if (!url) {
|
|
5509
|
-
setError(
|
|
5548
|
+
setError(t("markdown.upload_failed"));
|
|
5510
5549
|
onChange(before + after);
|
|
5511
5550
|
return;
|
|
5512
5551
|
}
|
|
5513
5552
|
onChange(before + `` + after);
|
|
5514
5553
|
} catch {
|
|
5515
|
-
setError(
|
|
5554
|
+
setError(t("markdown.upload_failed"));
|
|
5516
5555
|
onChange(before + after);
|
|
5517
5556
|
} finally {
|
|
5518
5557
|
setUploading(false);
|
|
@@ -5536,7 +5575,7 @@ function MarkdownEditor({
|
|
|
5536
5575
|
{
|
|
5537
5576
|
className: "flex items-center justify-center rounded-md border border-border bg-muted/30 text-sm text-muted-foreground",
|
|
5538
5577
|
style: { height },
|
|
5539
|
-
children:
|
|
5578
|
+
children: t("markdown.loading_editor")
|
|
5540
5579
|
}
|
|
5541
5580
|
),
|
|
5542
5581
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5548,7 +5587,7 @@ function MarkdownEditor({
|
|
|
5548
5587
|
preview: effectivePreview,
|
|
5549
5588
|
visibleDragbar: false,
|
|
5550
5589
|
commands: editorCommands,
|
|
5551
|
-
textareaProps: { placeholder: placeholder ??
|
|
5590
|
+
textareaProps: { placeholder: placeholder ?? t("markdown.placeholder"), onPaste: handlePaste }
|
|
5552
5591
|
}
|
|
5553
5592
|
)
|
|
5554
5593
|
}
|
|
@@ -5557,7 +5596,7 @@ function MarkdownEditor({
|
|
|
5557
5596
|
{
|
|
5558
5597
|
className: "flex items-center justify-center rounded-md border border-border bg-muted/30 text-sm text-muted-foreground",
|
|
5559
5598
|
style: { height },
|
|
5560
|
-
children:
|
|
5599
|
+
children: t("markdown.loading_editor")
|
|
5561
5600
|
}
|
|
5562
5601
|
) }),
|
|
5563
5602
|
useCustomPreview && showPreview && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5571,7 +5610,7 @@ function MarkdownEditor({
|
|
|
5571
5610
|
]
|
|
5572
5611
|
}
|
|
5573
5612
|
),
|
|
5574
|
-
uploading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-muted-foreground", children:
|
|
5613
|
+
uploading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: t("markdown.uploading_image") }),
|
|
5575
5614
|
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-destructive", children: error })
|
|
5576
5615
|
] });
|
|
5577
5616
|
}
|
|
@@ -6270,7 +6309,6 @@ var Text = core.Node.create({
|
|
|
6270
6309
|
renderMarkdown: (node) => node.text || ""
|
|
6271
6310
|
});
|
|
6272
6311
|
var index_default3 = Text;
|
|
6273
|
-
var t9 = i18n.createPackageT("hazo_ui", en_default);
|
|
6274
6312
|
var SingleLineDocument = index_default.extend({
|
|
6275
6313
|
content: "paragraph"
|
|
6276
6314
|
});
|
|
@@ -6319,7 +6357,8 @@ var HazoUiTextbox = ({
|
|
|
6319
6357
|
on_command_change,
|
|
6320
6358
|
on_command_remove
|
|
6321
6359
|
}) => {
|
|
6322
|
-
const
|
|
6360
|
+
const t = useHazoUiT();
|
|
6361
|
+
const resolved_placeholder = placeholder ?? t("textbox.placeholder");
|
|
6323
6362
|
const generated_instance_id = React27__namespace.useId();
|
|
6324
6363
|
const instance_id = provided_instance_id || generated_instance_id;
|
|
6325
6364
|
const [suggestion_state, set_suggestion_state] = React27__namespace.useState(null);
|
|
@@ -6731,7 +6770,7 @@ var HazoUiTextbox = ({
|
|
|
6731
6770
|
edit_selected_index === edit_commands.length && "bg-destructive/10"
|
|
6732
6771
|
),
|
|
6733
6772
|
onClick: handle_command_remove,
|
|
6734
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
6773
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("common.remove") })
|
|
6735
6774
|
}
|
|
6736
6775
|
)
|
|
6737
6776
|
] })
|
|
@@ -6809,7 +6848,6 @@ var HardBreak = core.Node.create({
|
|
|
6809
6848
|
}
|
|
6810
6849
|
});
|
|
6811
6850
|
var index_default4 = HardBreak;
|
|
6812
|
-
var t10 = i18n.createPackageT("hazo_ui", en_default);
|
|
6813
6851
|
var get_editor_output2 = (editor) => {
|
|
6814
6852
|
if (!editor) {
|
|
6815
6853
|
return { plain_text: "", display_text: "", commands: [] };
|
|
@@ -6878,7 +6916,8 @@ var HazoUiTextarea = ({
|
|
|
6878
6916
|
on_command_change,
|
|
6879
6917
|
on_command_remove
|
|
6880
6918
|
}) => {
|
|
6881
|
-
const
|
|
6919
|
+
const t = useHazoUiT();
|
|
6920
|
+
const resolved_placeholder = placeholder ?? t("textarea.placeholder");
|
|
6882
6921
|
const generated_instance_id = React27__namespace.useId();
|
|
6883
6922
|
const instance_id = provided_instance_id || generated_instance_id;
|
|
6884
6923
|
const [suggestion_state, set_suggestion_state] = React27__namespace.useState(null);
|
|
@@ -7303,7 +7342,7 @@ var HazoUiTextarea = ({
|
|
|
7303
7342
|
backgroundColor: edit_selected_index === edit_commands.length ? "rgba(239, 68, 68, 0.1)" : "inherit"
|
|
7304
7343
|
},
|
|
7305
7344
|
onClick: handle_command_remove,
|
|
7306
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
7345
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("common.remove") })
|
|
7307
7346
|
}
|
|
7308
7347
|
)
|
|
7309
7348
|
] })
|
|
@@ -7363,7 +7402,6 @@ function resolve_animation_classes(open_anim = "zoom", close_anim = "zoom") {
|
|
|
7363
7402
|
const close_classes = close_anim in ANIMATION_PRESETS ? ANIMATION_PRESETS[close_anim].close : close_anim;
|
|
7364
7403
|
return `${open_classes} ${close_classes}`;
|
|
7365
7404
|
}
|
|
7366
|
-
var t11 = i18n.createPackageT("hazo_ui", en_default);
|
|
7367
7405
|
var VARIANT_PRESETS = {
|
|
7368
7406
|
info: {
|
|
7369
7407
|
header_background_color: "var(--dialog-info-bg)",
|
|
@@ -7450,6 +7488,7 @@ function HazoUiDialog({
|
|
|
7450
7488
|
showCloseButton = true,
|
|
7451
7489
|
kind
|
|
7452
7490
|
}) {
|
|
7491
|
+
const t = useHazoUiT();
|
|
7453
7492
|
const config = get_hazo_ui_config();
|
|
7454
7493
|
const is_confirm_kind = kind === "confirm";
|
|
7455
7494
|
const is_status_kind = kind === "status";
|
|
@@ -7457,11 +7496,11 @@ function HazoUiDialog({
|
|
|
7457
7496
|
const cancel_ref = React27__namespace.useRef(null);
|
|
7458
7497
|
const variant_preset = variant !== "default" ? VARIANT_PRESETS[variant] : is_status_kind || is_confirm_kind ? NEUTRAL_VARIANT_PRESET : void 0;
|
|
7459
7498
|
const resolved_action_button_variant = actionButtonVariant ?? variant_preset?.action_button_variant ?? "default";
|
|
7460
|
-
const resolved_title = title ??
|
|
7461
|
-
const resolved_cancel_text = cancelButtonText ??
|
|
7499
|
+
const resolved_title = title ?? t("dialog.default_title");
|
|
7500
|
+
const resolved_cancel_text = cancelButtonText ?? t("dialog.cancel");
|
|
7462
7501
|
const showCancelButton = showCancelButtonProp ?? (is_status_kind ? false : true);
|
|
7463
7502
|
const closeOnConfirm = closeOnConfirmProp ?? (is_status_kind || is_confirm_kind ? true : false);
|
|
7464
|
-
const actionButtonText = actionButtonTextProp ?? (is_status_kind ?
|
|
7503
|
+
const actionButtonText = actionButtonTextProp ?? (is_status_kind ? t("dialog.ok") : is_confirm_kind ? showCancelButton ? t("dialog.confirm") : t("dialog.ok") : t("dialog.confirm"));
|
|
7465
7504
|
const actionButtonLoading = actionButtonLoadingProp ?? (is_confirm_kind ? internal_confirm_loading : false);
|
|
7466
7505
|
const handleConfirm = () => {
|
|
7467
7506
|
if (is_confirm_kind) {
|
|
@@ -7788,7 +7827,7 @@ function HazoUiDialog({
|
|
|
7788
7827
|
style: headerBar ? { color: "var(--dialog-header-bar-fg)" } : finalHeaderTextColor ? { color: finalHeaderTextColor } : void 0,
|
|
7789
7828
|
children: [
|
|
7790
7829
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
|
|
7791
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children:
|
|
7830
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: t("dialog.close") })
|
|
7792
7831
|
]
|
|
7793
7832
|
}
|
|
7794
7833
|
)
|
|
@@ -7797,7 +7836,6 @@ function HazoUiDialog({
|
|
|
7797
7836
|
)
|
|
7798
7837
|
] }) });
|
|
7799
7838
|
}
|
|
7800
|
-
var t12 = i18n.createPackageT("hazo_ui", en_default);
|
|
7801
7839
|
function HazoUiConfirmDialog({
|
|
7802
7840
|
open,
|
|
7803
7841
|
onOpenChange,
|
|
@@ -7806,7 +7844,7 @@ function HazoUiConfirmDialog({
|
|
|
7806
7844
|
children,
|
|
7807
7845
|
variant = "default",
|
|
7808
7846
|
confirmLabel,
|
|
7809
|
-
cancelLabel
|
|
7847
|
+
cancelLabel: cancelLabelProp,
|
|
7810
7848
|
showCancelButton = true,
|
|
7811
7849
|
onConfirm,
|
|
7812
7850
|
onCancel,
|
|
@@ -7817,6 +7855,8 @@ function HazoUiConfirmDialog({
|
|
|
7817
7855
|
openAnimation = "zoom",
|
|
7818
7856
|
closeAnimation = "zoom"
|
|
7819
7857
|
}) {
|
|
7858
|
+
const t = useHazoUiT();
|
|
7859
|
+
const cancelLabel = cancelLabelProp ?? t("confirm.cancel");
|
|
7820
7860
|
const resolved_accent_color = confirmButtonColor ?? accentColor;
|
|
7821
7861
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7822
7862
|
HazoUiDialog,
|
|
@@ -7855,7 +7895,6 @@ var Slider = React27__namespace.forwardRef(({ className, ...props }, ref) => /*
|
|
|
7855
7895
|
}
|
|
7856
7896
|
));
|
|
7857
7897
|
Slider.displayName = SliderPrimitive__namespace.Root.displayName;
|
|
7858
|
-
var t13 = i18n.createPackageT("hazo_ui", en_default);
|
|
7859
7898
|
async function getCroppedImg(imageSrc, areaPixels, outputSize, quality) {
|
|
7860
7899
|
const img = await new Promise((resolve, reject) => {
|
|
7861
7900
|
const image = new Image();
|
|
@@ -7904,12 +7943,13 @@ var HazoUiImageCropper = React27__namespace.forwardRef(function HazoUiImageCropp
|
|
|
7904
7943
|
zoomLabel,
|
|
7905
7944
|
className
|
|
7906
7945
|
}, ref) {
|
|
7946
|
+
const t = useHazoUiT();
|
|
7907
7947
|
const [crop, set_crop] = React27__namespace.useState({
|
|
7908
7948
|
x: 0,
|
|
7909
7949
|
y: 0
|
|
7910
7950
|
});
|
|
7911
7951
|
const [zoom, set_zoom] = React27__namespace.useState(1);
|
|
7912
|
-
const resolved_zoom_label = zoomLabel ??
|
|
7952
|
+
const resolved_zoom_label = zoomLabel ?? t("cropper.zoom");
|
|
7913
7953
|
const cropped_area_pixels_ref = React27__namespace.useRef(null);
|
|
7914
7954
|
const handle_crop_complete = React27__namespace.useCallback(
|
|
7915
7955
|
(_croppedArea, croppedAreaPixels) => {
|
|
@@ -7984,7 +8024,6 @@ var HazoUiImageCropper = React27__namespace.forwardRef(function HazoUiImageCropp
|
|
|
7984
8024
|
] });
|
|
7985
8025
|
});
|
|
7986
8026
|
HazoUiImageCropper.displayName = "HazoUiImageCropper";
|
|
7987
|
-
var t14 = i18n.createPackageT("hazo_ui", en_default);
|
|
7988
8027
|
function HazoUiImageCropperDialog({
|
|
7989
8028
|
open,
|
|
7990
8029
|
onOpenChange,
|
|
@@ -7998,10 +8037,11 @@ function HazoUiImageCropperDialog({
|
|
|
7998
8037
|
outputSize = 512,
|
|
7999
8038
|
quality = 0.9
|
|
8000
8039
|
}) {
|
|
8001
|
-
const
|
|
8002
|
-
const
|
|
8003
|
-
const
|
|
8004
|
-
const
|
|
8040
|
+
const t = useHazoUiT();
|
|
8041
|
+
const resolved_title = title ?? t("cropper.title");
|
|
8042
|
+
const resolved_confirm_label = confirmLabel ?? t("cropper.save");
|
|
8043
|
+
const resolved_cancel_label = cancelLabel ?? t("cropper.cancel");
|
|
8044
|
+
const resolved_zoom_label = zoomLabel ?? t("cropper.zoom");
|
|
8005
8045
|
const cropper_ref = React27__namespace.useRef(null);
|
|
8006
8046
|
const [image_src, set_image_src] = React27__namespace.useState(null);
|
|
8007
8047
|
const [is_confirming, set_is_confirming] = React27__namespace.useState(false);
|
|
@@ -8487,16 +8527,16 @@ var CardFooter = React27__namespace.forwardRef(
|
|
|
8487
8527
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center p-6 pt-0", className), ...props })
|
|
8488
8528
|
);
|
|
8489
8529
|
CardFooter.displayName = "CardFooter";
|
|
8490
|
-
var t15 = i18n.createPackageT("hazo_ui", en_default);
|
|
8491
8530
|
function Spinner({ className, size = "md" }) {
|
|
8531
|
+
const t = useHazoUiT();
|
|
8492
8532
|
const sizeClasses = { sm: "h-4 w-4", md: "h-8 w-8", lg: "h-12 w-12" };
|
|
8493
8533
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8494
8534
|
"div",
|
|
8495
8535
|
{
|
|
8496
8536
|
className: cn("animate-spin rounded-full border-2 border-current border-t-transparent text-primary", sizeClasses[size], className),
|
|
8497
8537
|
role: "status",
|
|
8498
|
-
"aria-label":
|
|
8499
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children:
|
|
8538
|
+
"aria-label": t("spinner.loading"),
|
|
8539
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: t("spinner.loading_text") })
|
|
8500
8540
|
}
|
|
8501
8541
|
);
|
|
8502
8542
|
}
|
|
@@ -8632,7 +8672,6 @@ var InputAffix = React27__namespace.forwardRef(
|
|
|
8632
8672
|
}
|
|
8633
8673
|
);
|
|
8634
8674
|
InputAffix.displayName = "InputAffix";
|
|
8635
|
-
var t16 = i18n.createPackageT("hazo_ui", en_default);
|
|
8636
8675
|
var SkeletonBase = React27__namespace.forwardRef(
|
|
8637
8676
|
({ className, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8638
8677
|
"div",
|
|
@@ -8675,7 +8714,8 @@ function SkeletonRect({ width = "100%", height = 96, radius = 6, className }) {
|
|
|
8675
8714
|
);
|
|
8676
8715
|
}
|
|
8677
8716
|
function SkeletonGroup({ label, children, className, ...rest }) {
|
|
8678
|
-
const
|
|
8717
|
+
const t = useHazoUiT();
|
|
8718
|
+
const resolved_label = label ?? t("skeleton.loading_content");
|
|
8679
8719
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8680
8720
|
"div",
|
|
8681
8721
|
{
|
|
@@ -8721,7 +8761,6 @@ function EmptyState({
|
|
|
8721
8761
|
}
|
|
8722
8762
|
);
|
|
8723
8763
|
}
|
|
8724
|
-
var t17 = i18n.createPackageT("hazo_ui", en_default);
|
|
8725
8764
|
function ErrorBanner({
|
|
8726
8765
|
severity = "error",
|
|
8727
8766
|
title,
|
|
@@ -8731,6 +8770,7 @@ function ErrorBanner({
|
|
|
8731
8770
|
onDismiss,
|
|
8732
8771
|
className
|
|
8733
8772
|
}) {
|
|
8773
|
+
const t = useHazoUiT();
|
|
8734
8774
|
const palette = severity === "warning" ? "border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-100" : "border-destructive/40 bg-destructive/10 text-destructive-foreground";
|
|
8735
8775
|
const iconColor = severity === "warning" ? "text-amber-600" : "text-destructive";
|
|
8736
8776
|
const resolvedIcon = icon ?? (severity === "warning" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: cn("h-5 w-5", iconColor), "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.OctagonAlert, { className: cn("h-5 w-5", iconColor), "aria-hidden": "true" }));
|
|
@@ -8756,7 +8796,7 @@ function ErrorBanner({
|
|
|
8756
8796
|
{
|
|
8757
8797
|
type: "button",
|
|
8758
8798
|
onClick: onDismiss,
|
|
8759
|
-
"aria-label":
|
|
8799
|
+
"aria-label": t("error.dismiss"),
|
|
8760
8800
|
className: "flex-shrink-0 rounded p-1 hover:bg-black/5 focus:outline-none focus:ring-2 focus:ring-offset-2 dark:hover:bg-white/5",
|
|
8761
8801
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
8762
8802
|
}
|
|
@@ -8765,7 +8805,6 @@ function ErrorBanner({
|
|
|
8765
8805
|
}
|
|
8766
8806
|
);
|
|
8767
8807
|
}
|
|
8768
|
-
var t18 = i18n.createPackageT("hazo_ui", en_default);
|
|
8769
8808
|
function ErrorPage({
|
|
8770
8809
|
title,
|
|
8771
8810
|
description,
|
|
@@ -8775,7 +8814,8 @@ function ErrorPage({
|
|
|
8775
8814
|
illustration,
|
|
8776
8815
|
className
|
|
8777
8816
|
}) {
|
|
8778
|
-
const
|
|
8817
|
+
const t = useHazoUiT();
|
|
8818
|
+
const resolved_title = title ?? t("error.something_went_wrong");
|
|
8779
8819
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8780
8820
|
"div",
|
|
8781
8821
|
{
|
|
@@ -8791,7 +8831,7 @@ function ErrorPage({
|
|
|
8791
8831
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-semibold text-foreground", children: resolved_title }),
|
|
8792
8832
|
description ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children: description }) : null,
|
|
8793
8833
|
correlationId ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full rounded-md border bg-muted/40 px-3 py-2 text-left", children: [
|
|
8794
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] uppercase tracking-wider text-muted-foreground", children:
|
|
8834
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] uppercase tracking-wider text-muted-foreground", children: t("error.correlation_id") }),
|
|
8795
8835
|
/* @__PURE__ */ jsxRuntime.jsx("code", { className: "break-all text-xs", children: correlationId })
|
|
8796
8836
|
] }) : null,
|
|
8797
8837
|
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex flex-wrap items-center justify-center gap-2", children: actions }) : null
|
|
@@ -8799,7 +8839,6 @@ function ErrorPage({
|
|
|
8799
8839
|
}
|
|
8800
8840
|
);
|
|
8801
8841
|
}
|
|
8802
|
-
var t19 = i18n.createPackageT("hazo_ui", en_default);
|
|
8803
8842
|
function LoadingTimeout({
|
|
8804
8843
|
active,
|
|
8805
8844
|
children,
|
|
@@ -8809,7 +8848,8 @@ function LoadingTimeout({
|
|
|
8809
8848
|
label,
|
|
8810
8849
|
className
|
|
8811
8850
|
}) {
|
|
8812
|
-
const
|
|
8851
|
+
const t = useHazoUiT();
|
|
8852
|
+
const resolved_label = label ?? t("loading.default_label");
|
|
8813
8853
|
const timeouts = {
|
|
8814
8854
|
gentle: thresholds?.gentle ?? 5e3,
|
|
8815
8855
|
firm: thresholds?.firm ?? 15e3,
|
|
@@ -8839,15 +8879,15 @@ function LoadingTimeout({
|
|
|
8839
8879
|
ErrorBanner,
|
|
8840
8880
|
{
|
|
8841
8881
|
severity: "error",
|
|
8842
|
-
title:
|
|
8843
|
-
message:
|
|
8882
|
+
title: t("loading.taking_longer"),
|
|
8883
|
+
message: t("loading.still_loading", { label: resolved_label }),
|
|
8844
8884
|
action: onRetry ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8845
8885
|
"button",
|
|
8846
8886
|
{
|
|
8847
8887
|
type: "button",
|
|
8848
8888
|
onClick: onRetry,
|
|
8849
8889
|
className: "rounded bg-foreground/10 px-3 py-1.5 text-sm font-medium hover:bg-foreground/15",
|
|
8850
|
-
children:
|
|
8890
|
+
children: t("loading.try_again")
|
|
8851
8891
|
}
|
|
8852
8892
|
) : null
|
|
8853
8893
|
}
|
|
@@ -8855,8 +8895,8 @@ function LoadingTimeout({
|
|
|
8855
8895
|
}
|
|
8856
8896
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, role: "status", "aria-busy": "true", "aria-live": "polite", children: [
|
|
8857
8897
|
skeleton,
|
|
8858
|
-
phase === "gentle" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children:
|
|
8859
|
-
phase === "firm" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children:
|
|
8898
|
+
phase === "gentle" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children: t("loading.gentle_message", { label: resolved_label }) }) : null,
|
|
8899
|
+
phase === "firm" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children: t("loading.firm_message") }) : null
|
|
8860
8900
|
] });
|
|
8861
8901
|
}
|
|
8862
8902
|
function ProgressiveImage({
|
|
@@ -8917,13 +8957,14 @@ function NotificationCountBadge({
|
|
|
8917
8957
|
max = 9,
|
|
8918
8958
|
className
|
|
8919
8959
|
}) {
|
|
8960
|
+
const t = useHazoUiT();
|
|
8920
8961
|
if (count <= 0) return null;
|
|
8921
8962
|
const isOverflow = count > max;
|
|
8922
8963
|
const label = isOverflow ? `${max}+` : String(count);
|
|
8923
8964
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8924
8965
|
"span",
|
|
8925
8966
|
{
|
|
8926
|
-
"aria-label":
|
|
8967
|
+
"aria-label": t("notification.unread_count", { count }),
|
|
8927
8968
|
className: cn(
|
|
8928
8969
|
"cls_notification_count_badge",
|
|
8929
8970
|
"inline-flex items-center justify-center",
|
|
@@ -8937,7 +8978,6 @@ function NotificationCountBadge({
|
|
|
8937
8978
|
}
|
|
8938
8979
|
);
|
|
8939
8980
|
}
|
|
8940
|
-
var t20 = i18n.createPackageT("hazo_ui", en_default);
|
|
8941
8981
|
function NotificationItem({
|
|
8942
8982
|
isRead,
|
|
8943
8983
|
timestamp,
|
|
@@ -8948,6 +8988,7 @@ function NotificationItem({
|
|
|
8948
8988
|
onMarkRead,
|
|
8949
8989
|
markReadLabel
|
|
8950
8990
|
}) {
|
|
8991
|
+
const t = useHazoUiT();
|
|
8951
8992
|
const handleMarkRead = (e) => {
|
|
8952
8993
|
e.stopPropagation();
|
|
8953
8994
|
onMarkRead?.();
|
|
@@ -8968,7 +9009,7 @@ function NotificationItem({
|
|
|
8968
9009
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_notification_item_dot_col flex-shrink-0 pt-1.5", children: !isRead ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8969
9010
|
"span",
|
|
8970
9011
|
{
|
|
8971
|
-
"aria-label":
|
|
9012
|
+
"aria-label": t("notification.unread"),
|
|
8972
9013
|
className: "cls_notification_item_dot block w-2 h-2 rounded-full bg-primary"
|
|
8973
9014
|
}
|
|
8974
9015
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block w-2 h-2", "aria-hidden": "true" }) }),
|
|
@@ -8992,13 +9033,13 @@ function NotificationItem({
|
|
|
8992
9033
|
}
|
|
8993
9034
|
);
|
|
8994
9035
|
}
|
|
8995
|
-
var t21 = i18n.createPackageT("hazo_ui", en_default);
|
|
8996
9036
|
function LoadingSkeletons() {
|
|
9037
|
+
const t = useHazoUiT();
|
|
8997
9038
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8998
9039
|
"div",
|
|
8999
9040
|
{
|
|
9000
9041
|
"aria-busy": "true",
|
|
9001
|
-
"aria-label":
|
|
9042
|
+
"aria-label": t("notification.loading"),
|
|
9002
9043
|
className: "cls_notification_panel_loading space-y-0",
|
|
9003
9044
|
children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9004
9045
|
"div",
|
|
@@ -9057,7 +9098,6 @@ function NotificationPanel({
|
|
|
9057
9098
|
}
|
|
9058
9099
|
);
|
|
9059
9100
|
}
|
|
9060
|
-
var t22 = i18n.createPackageT("hazo_ui", en_default);
|
|
9061
9101
|
function HazoUiToaster({
|
|
9062
9102
|
position = "bottom-right",
|
|
9063
9103
|
closeButton = true,
|
|
@@ -9101,16 +9141,17 @@ function permissionToast({
|
|
|
9101
9141
|
missingPermissions,
|
|
9102
9142
|
descriptions,
|
|
9103
9143
|
action,
|
|
9104
|
-
duration = 5e3
|
|
9144
|
+
duration = 5e3,
|
|
9145
|
+
t = defaultHazoUiT
|
|
9105
9146
|
}) {
|
|
9106
|
-
const description = missingPermissions.length === 0 ?
|
|
9147
|
+
const description = missingPermissions.length === 0 ? t("toast.permission_denied_message") : t("toast.missing_prefix", {
|
|
9107
9148
|
items: missingPermissions.map((key) => {
|
|
9108
9149
|
const label = descriptions?.[key];
|
|
9109
9150
|
return label ? `\`${key}\` \u2014 ${label}` : `\`${key}\``;
|
|
9110
9151
|
}).join("; ")
|
|
9111
9152
|
});
|
|
9112
9153
|
return errorToast({
|
|
9113
|
-
title:
|
|
9154
|
+
title: t("toast.permission_required"),
|
|
9114
9155
|
description,
|
|
9115
9156
|
action,
|
|
9116
9157
|
duration
|
|
@@ -9368,7 +9409,6 @@ function use_fullscreen() {
|
|
|
9368
9409
|
const { isFullscreen, toggle } = useFullscreen(ref);
|
|
9369
9410
|
return { is_fullscreen: isFullscreen, toggle, ref };
|
|
9370
9411
|
}
|
|
9371
|
-
var t23 = i18n.createPackageT("hazo_ui", en_default);
|
|
9372
9412
|
function KanbanCard({
|
|
9373
9413
|
item,
|
|
9374
9414
|
renderCard,
|
|
@@ -9377,6 +9417,7 @@ function KanbanCard({
|
|
|
9377
9417
|
showEdit = false,
|
|
9378
9418
|
onEditRequest
|
|
9379
9419
|
}) {
|
|
9420
|
+
const t = useHazoUiT();
|
|
9380
9421
|
const {
|
|
9381
9422
|
attributes,
|
|
9382
9423
|
listeners,
|
|
@@ -9430,7 +9471,7 @@ function KanbanCard({
|
|
|
9430
9471
|
...listeners,
|
|
9431
9472
|
role: "button",
|
|
9432
9473
|
tabIndex: 0,
|
|
9433
|
-
"aria-roledescription":
|
|
9474
|
+
"aria-roledescription": t("kanban.draggable_card"),
|
|
9434
9475
|
"aria-grabbed": isDragging,
|
|
9435
9476
|
onDoubleClick: () => {
|
|
9436
9477
|
if (showEdit && onEditRequest && !dragging) onEditRequest(item);
|
|
@@ -9447,7 +9488,7 @@ function KanbanCard({
|
|
|
9447
9488
|
e.stopPropagation();
|
|
9448
9489
|
onEditRequest(item);
|
|
9449
9490
|
},
|
|
9450
|
-
"aria-label":
|
|
9491
|
+
"aria-label": t("kanban.edit_fallback", { id: item.id }),
|
|
9451
9492
|
className: cn(
|
|
9452
9493
|
"cls_hazo_kanban_card_edit absolute top-1.5 right-1.5",
|
|
9453
9494
|
"p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent",
|
|
@@ -9755,12 +9796,11 @@ function KanbanLaneStrip({
|
|
|
9755
9796
|
}
|
|
9756
9797
|
);
|
|
9757
9798
|
}
|
|
9758
|
-
var t24 = i18n.createPackageT("hazo_ui", en_default);
|
|
9759
9799
|
var DEFAULT_PRIORITIES = ["P0", "P1", "P2", "P3"];
|
|
9760
9800
|
function humanize(key) {
|
|
9761
9801
|
return key.replace(/[_\-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().split(" ").map((w) => w ? w[0].toUpperCase() + w.slice(1) : w).join(" ");
|
|
9762
9802
|
}
|
|
9763
|
-
function auto_detect_fields(item, columns) {
|
|
9803
|
+
function auto_detect_fields(item, columns, t) {
|
|
9764
9804
|
const skip = /* @__PURE__ */ new Set(["id", "columnKey", "priority"]);
|
|
9765
9805
|
const out = [];
|
|
9766
9806
|
for (const [key, value] of Object.entries(item)) {
|
|
@@ -9770,7 +9810,7 @@ function auto_detect_fields(item, columns) {
|
|
|
9770
9810
|
}
|
|
9771
9811
|
}
|
|
9772
9812
|
if (columns.length > 0) {
|
|
9773
|
-
out.push({ key: "columnKey", type: "status", label:
|
|
9813
|
+
out.push({ key: "columnKey", type: "status", label: t("kanban.status_label") });
|
|
9774
9814
|
}
|
|
9775
9815
|
return out;
|
|
9776
9816
|
}
|
|
@@ -9785,6 +9825,7 @@ function KanbanEditor({
|
|
|
9785
9825
|
onSave,
|
|
9786
9826
|
onClose
|
|
9787
9827
|
}) {
|
|
9828
|
+
const t = useHazoUiT();
|
|
9788
9829
|
const [draft, set_draft] = React27__namespace.useState(item);
|
|
9789
9830
|
const [saving, set_saving] = React27__namespace.useState(false);
|
|
9790
9831
|
const [error, set_error] = React27__namespace.useState(null);
|
|
@@ -9799,7 +9840,7 @@ function KanbanEditor({
|
|
|
9799
9840
|
const resolved_fields = React27__namespace.useMemo(() => {
|
|
9800
9841
|
if (fields) return fields;
|
|
9801
9842
|
if (!item) return [];
|
|
9802
|
-
return auto_detect_fields(item, resolved_columns);
|
|
9843
|
+
return auto_detect_fields(item, resolved_columns, t);
|
|
9803
9844
|
}, [fields, item, resolved_columns]);
|
|
9804
9845
|
const required_keys = React27__namespace.useMemo(
|
|
9805
9846
|
() => resolved_fields.filter(
|
|
@@ -9867,7 +9908,7 @@ function KanbanEditor({
|
|
|
9867
9908
|
isDirty: is_dirty
|
|
9868
9909
|
};
|
|
9869
9910
|
const open = item !== null;
|
|
9870
|
-
const title = item && titleFn ? titleFn(item) : item ?
|
|
9911
|
+
const title = item && titleFn ? titleFn(item) : item ? t("kanban.edit_fallback", { id: item.id }) : "";
|
|
9871
9912
|
const priority_var = item?.priority ? `--hazo-kanban-priority-${String(item.priority).toLowerCase()}` : null;
|
|
9872
9913
|
const header_bar_color = priority_var ? `hsl(var(${priority_var}))` : void 0;
|
|
9873
9914
|
const use_default_footer = !(renderBody && hideFooter);
|
|
@@ -9879,18 +9920,18 @@ function KanbanEditor({
|
|
|
9879
9920
|
if (!o && !saving) onClose();
|
|
9880
9921
|
},
|
|
9881
9922
|
title,
|
|
9882
|
-
description:
|
|
9923
|
+
description: t("kanban.update_description"),
|
|
9883
9924
|
sizeWidth: "min(90vw, 480px)",
|
|
9884
9925
|
openAnimation: "none",
|
|
9885
9926
|
closeAnimation: "none",
|
|
9886
9927
|
headerBar: !!priority_var,
|
|
9887
9928
|
headerBarColor: header_bar_color,
|
|
9888
9929
|
contentClassName: cn("cls_hazo_kanban_editor", priority_var && "pt-0"),
|
|
9889
|
-
actionButtonText: saving ?
|
|
9930
|
+
actionButtonText: saving ? t("kanban.saving") : t("kanban.save"),
|
|
9890
9931
|
actionButtonIcon: saving ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4 mr-2" }),
|
|
9891
9932
|
actionButtonLoading: saving,
|
|
9892
9933
|
actionButtonDisabled: !is_dirty || !all_required_filled || saving,
|
|
9893
|
-
cancelButtonText:
|
|
9934
|
+
cancelButtonText: t("kanban.cancel"),
|
|
9894
9935
|
showCancelButton: true,
|
|
9895
9936
|
onConfirm: handle_save,
|
|
9896
9937
|
onCancel: onClose,
|
|
@@ -9928,6 +9969,7 @@ function KanbanEditorFieldRow({
|
|
|
9928
9969
|
priorities,
|
|
9929
9970
|
columns
|
|
9930
9971
|
}) {
|
|
9972
|
+
const t = useHazoUiT();
|
|
9931
9973
|
const id = `kanban-editor-${field.key}`;
|
|
9932
9974
|
const label = field.label ?? humanize(field.key);
|
|
9933
9975
|
const value = draft[field.key];
|
|
@@ -9995,7 +10037,7 @@ function KanbanEditorFieldRow({
|
|
|
9995
10037
|
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9996
10038
|
SelectValue,
|
|
9997
10039
|
{
|
|
9998
|
-
placeholder: field.placeholder ??
|
|
10040
|
+
placeholder: field.placeholder ?? t("kanban.select_placeholder", { label })
|
|
9999
10041
|
}
|
|
10000
10042
|
) }),
|
|
10001
10043
|
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: (field.options ?? []).map((opt) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: opt, children: opt }, opt)) })
|
|
@@ -10011,7 +10053,7 @@ function KanbanEditorFieldRow({
|
|
|
10011
10053
|
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10012
10054
|
SelectValue,
|
|
10013
10055
|
{
|
|
10014
|
-
placeholder: field.placeholder ??
|
|
10056
|
+
placeholder: field.placeholder ?? t("kanban.select_priority")
|
|
10015
10057
|
}
|
|
10016
10058
|
) }),
|
|
10017
10059
|
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: priorities.map((p) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: p, children: p }, p)) })
|
|
@@ -10027,7 +10069,7 @@ function KanbanEditorFieldRow({
|
|
|
10027
10069
|
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10028
10070
|
SelectValue,
|
|
10029
10071
|
{
|
|
10030
|
-
placeholder: field.placeholder ??
|
|
10072
|
+
placeholder: field.placeholder ?? t("kanban.select_status")
|
|
10031
10073
|
}
|
|
10032
10074
|
) }),
|
|
10033
10075
|
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: col.key, children: col.title }, col.key)) })
|
|
@@ -10036,7 +10078,6 @@ function KanbanEditorFieldRow({
|
|
|
10036
10078
|
)
|
|
10037
10079
|
] });
|
|
10038
10080
|
}
|
|
10039
|
-
var t25 = i18n.createPackageT("hazo_ui", en_default);
|
|
10040
10081
|
var EMPTY_FILTER = {
|
|
10041
10082
|
search: "",
|
|
10042
10083
|
categories: [],
|
|
@@ -10052,7 +10093,8 @@ function HazoUiKanbanFilter({
|
|
|
10052
10093
|
onChange,
|
|
10053
10094
|
className
|
|
10054
10095
|
}) {
|
|
10055
|
-
const
|
|
10096
|
+
const t = useHazoUiT();
|
|
10097
|
+
const resolved_search_placeholder = searchPlaceholder ?? t("common.search");
|
|
10056
10098
|
const is_controlled = value !== void 0;
|
|
10057
10099
|
const [internal, set_internal] = React27__namespace.useState(
|
|
10058
10100
|
defaultValue ?? EMPTY_FILTER
|
|
@@ -10133,7 +10175,7 @@ function HazoUiKanbanFilter({
|
|
|
10133
10175
|
className: "cls_hazo_kanban_filter_clear",
|
|
10134
10176
|
children: [
|
|
10135
10177
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4 mr-1" }),
|
|
10136
|
-
"
|
|
10178
|
+
t("kanban.clear")
|
|
10137
10179
|
]
|
|
10138
10180
|
}
|
|
10139
10181
|
)
|
|
@@ -10164,25 +10206,24 @@ function applyKanbanFilter(items, filter) {
|
|
|
10164
10206
|
return true;
|
|
10165
10207
|
});
|
|
10166
10208
|
}
|
|
10167
|
-
var t26 = i18n.createPackageT("hazo_ui", en_default);
|
|
10168
10209
|
var UNMATCHED_LANE_KEY = "__hazo_lane_unmatched__";
|
|
10169
10210
|
function bucket_key(lane_key, column_key) {
|
|
10170
10211
|
return lane_key == null ? column_key : `${lane_key}\0${column_key}`;
|
|
10171
10212
|
}
|
|
10172
|
-
function default_announcements(itemLabel) {
|
|
10213
|
+
function default_announcements(itemLabel, t) {
|
|
10173
10214
|
return {
|
|
10174
|
-
onDragStart: ({ item, fromColumn }) =>
|
|
10175
|
-
onDragOver: ({ item, overColumn }) => overColumn ?
|
|
10176
|
-
onDragEnd: ({ item, fromColumn, toColumn, newIndex }) => fromColumn === toColumn ?
|
|
10215
|
+
onDragStart: ({ item, fromColumn }) => t("kanban.dnd_pickup", { item: itemLabel(item), column: fromColumn }),
|
|
10216
|
+
onDragOver: ({ item, overColumn }) => overColumn ? t("kanban.dnd_over", { item: itemLabel(item), column: overColumn }) : "",
|
|
10217
|
+
onDragEnd: ({ item, fromColumn, toColumn, newIndex }) => fromColumn === toColumn ? t("kanban.dnd_reorder", {
|
|
10177
10218
|
item: itemLabel(item),
|
|
10178
10219
|
pos: newIndex + 1,
|
|
10179
10220
|
column: toColumn
|
|
10180
|
-
}) :
|
|
10221
|
+
}) : t("kanban.dnd_drop", {
|
|
10181
10222
|
item: itemLabel(item),
|
|
10182
10223
|
column: toColumn,
|
|
10183
10224
|
pos: newIndex + 1
|
|
10184
10225
|
}),
|
|
10185
|
-
onDragCancel: ({ item, fromColumn }) =>
|
|
10226
|
+
onDragCancel: ({ item, fromColumn }) => t("kanban.dnd_cancel", { item: itemLabel(item), column: fromColumn })
|
|
10186
10227
|
};
|
|
10187
10228
|
}
|
|
10188
10229
|
function group_items_by_column(items, overlay, columns, lanes) {
|
|
@@ -10249,6 +10290,7 @@ function HazoUiKanban({
|
|
|
10249
10290
|
onCardSave,
|
|
10250
10291
|
disableEdit = false
|
|
10251
10292
|
}) {
|
|
10293
|
+
const t = useHazoUiT();
|
|
10252
10294
|
const label_fn = React27__namespace.useCallback(
|
|
10253
10295
|
(item) => itemLabel ? itemLabel(item) : item.id,
|
|
10254
10296
|
[itemLabel]
|
|
@@ -10306,7 +10348,7 @@ function HazoUiKanban({
|
|
|
10306
10348
|
return core$1.closestCorners(args);
|
|
10307
10349
|
}, []);
|
|
10308
10350
|
const merged_announcements = React27__namespace.useMemo(() => {
|
|
10309
|
-
const defaults = default_announcements(label_fn);
|
|
10351
|
+
const defaults = default_announcements(label_fn, t);
|
|
10310
10352
|
return {
|
|
10311
10353
|
onDragStart: announcements?.onDragStart ?? defaults.onDragStart,
|
|
10312
10354
|
onDragOver: announcements?.onDragOver ?? defaults.onDragOver,
|
|
@@ -10986,8 +11028,8 @@ function serializeFilter(filter) {
|
|
|
10986
11028
|
const fields = (filter.fields ?? []).map((f) => `${f.field}:${f.operator ?? ""}:${String(f.value)}`).join(",");
|
|
10987
11029
|
return `${filter.search ?? ""}|${fields}`;
|
|
10988
11030
|
}
|
|
10989
|
-
var t27 = i18n.createPackageT("hazo_ui", en_default);
|
|
10990
11031
|
function HazoUiTable(props) {
|
|
11032
|
+
const t = useHazoUiT();
|
|
10991
11033
|
const state = useTableState(props);
|
|
10992
11034
|
const { columns, rows, getRowKey, className, caption } = props;
|
|
10993
11035
|
const mobileBreakpoint = props.mobileBreakpoint ?? 768;
|
|
@@ -11018,15 +11060,15 @@ function HazoUiTable(props) {
|
|
|
11018
11060
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBar, { className: "w-1/2" })
|
|
11019
11061
|
] })
|
|
11020
11062
|
] }, `mloader-${i}`)
|
|
11021
|
-
) }) : state.serverError != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_mobile_error py-6", children: renderErrorState(props.error, state.serverError) }) : state.displayed.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_mobile_empty py-6", children: noActiveFilters(state.filter) && rows.length === 0 ? typeof props.empty === "string" || props.empty === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11063
|
+
) }) : state.serverError != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_mobile_error py-6", children: renderErrorState(props.error, state.serverError, t) }) : state.displayed.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_mobile_empty py-6", children: noActiveFilters(state.filter) && rows.length === 0 ? typeof props.empty === "string" || props.empty === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11022
11064
|
EmptyState,
|
|
11023
11065
|
{
|
|
11024
|
-
title: typeof props.empty === "string" && props.empty ||
|
|
11066
|
+
title: typeof props.empty === "string" && props.empty || t("table.empty")
|
|
11025
11067
|
}
|
|
11026
11068
|
) : props.empty : typeof props.noResults === "string" || props.noResults === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11027
11069
|
EmptyState,
|
|
11028
11070
|
{
|
|
11029
|
-
title: typeof props.noResults === "string" && props.noResults ||
|
|
11071
|
+
title: typeof props.noResults === "string" && props.noResults || t("table.no_results")
|
|
11030
11072
|
}
|
|
11031
11073
|
) : props.noResults }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
11032
11074
|
TableMobileCards,
|
|
@@ -11049,7 +11091,7 @@ function HazoUiTable(props) {
|
|
|
11049
11091
|
{
|
|
11050
11092
|
type: "button",
|
|
11051
11093
|
onClick: (e) => state.cycleHeaderSort(c.key, e.shiftKey),
|
|
11052
|
-
title:
|
|
11094
|
+
title: t("table.sort_tooltip"),
|
|
11053
11095
|
className: "cls_hazo_ui_table_sort_btn inline-flex items-center gap-1 hover:text-foreground",
|
|
11054
11096
|
children: [
|
|
11055
11097
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: c.label }),
|
|
@@ -11071,7 +11113,7 @@ function HazoUiTable(props) {
|
|
|
11071
11113
|
{
|
|
11072
11114
|
colSpan: columns.length,
|
|
11073
11115
|
className: "cls_hazo_ui_table_error_cell p-0",
|
|
11074
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_error_wrap py-6", children: renderErrorState(props.error, state.serverError) })
|
|
11116
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_error_wrap py-6", children: renderErrorState(props.error, state.serverError, t) })
|
|
11075
11117
|
}
|
|
11076
11118
|
) }) : state.displayed.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(TableRow2, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11077
11119
|
TableCell2,
|
|
@@ -11081,12 +11123,12 @@ function HazoUiTable(props) {
|
|
|
11081
11123
|
children: noActiveFilters(state.filter) && rows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_empty_wrap py-6", children: typeof props.empty === "string" || props.empty === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11082
11124
|
EmptyState,
|
|
11083
11125
|
{
|
|
11084
|
-
title: typeof props.empty === "string" && props.empty ||
|
|
11126
|
+
title: typeof props.empty === "string" && props.empty || t("table.empty")
|
|
11085
11127
|
}
|
|
11086
11128
|
) : props.empty }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_hazo_ui_table_no_results_wrap py-6", children: typeof props.noResults === "string" || props.noResults === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11087
11129
|
EmptyState,
|
|
11088
11130
|
{
|
|
11089
|
-
title: typeof props.noResults === "string" && props.noResults ||
|
|
11131
|
+
title: typeof props.noResults === "string" && props.noResults || t("table.no_results")
|
|
11090
11132
|
}
|
|
11091
11133
|
) : props.noResults })
|
|
11092
11134
|
}
|
|
@@ -11196,11 +11238,12 @@ function PaginationFooter({
|
|
|
11196
11238
|
total,
|
|
11197
11239
|
onPageChange
|
|
11198
11240
|
}) {
|
|
11241
|
+
const t = useHazoUiT();
|
|
11199
11242
|
const start = total === 0 ? 0 : page * pageSize + 1;
|
|
11200
11243
|
const end = Math.min((page + 1) * pageSize, total);
|
|
11201
11244
|
const lastPage = Math.max(0, Math.ceil(total / pageSize) - 1);
|
|
11202
11245
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_hazo_ui_table_pagination flex items-center justify-between gap-3 pt-2 text-sm", children: [
|
|
11203
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_hazo_ui_table_page_counter text-muted-foreground", children:
|
|
11246
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_hazo_ui_table_page_counter text-muted-foreground", children: t("table.showing", {
|
|
11204
11247
|
start: String(start),
|
|
11205
11248
|
end: String(end),
|
|
11206
11249
|
total: String(total)
|
|
@@ -11213,8 +11256,8 @@ function PaginationFooter({
|
|
|
11213
11256
|
size: "sm",
|
|
11214
11257
|
onClick: () => onPageChange(Math.max(0, page - 1)),
|
|
11215
11258
|
disabled: page === 0,
|
|
11216
|
-
"aria-label":
|
|
11217
|
-
children:
|
|
11259
|
+
"aria-label": t("table.prev_aria"),
|
|
11260
|
+
children: t("table.prev")
|
|
11218
11261
|
}
|
|
11219
11262
|
),
|
|
11220
11263
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11224,14 +11267,15 @@ function PaginationFooter({
|
|
|
11224
11267
|
size: "sm",
|
|
11225
11268
|
onClick: () => onPageChange(Math.min(lastPage, page + 1)),
|
|
11226
11269
|
disabled: page >= lastPage,
|
|
11227
|
-
"aria-label":
|
|
11228
|
-
children:
|
|
11270
|
+
"aria-label": t("table.next_aria"),
|
|
11271
|
+
children: t("table.next")
|
|
11229
11272
|
}
|
|
11230
11273
|
)
|
|
11231
11274
|
] })
|
|
11232
11275
|
] });
|
|
11233
11276
|
}
|
|
11234
11277
|
function Toolbar2(props) {
|
|
11278
|
+
const t = useHazoUiT();
|
|
11235
11279
|
const {
|
|
11236
11280
|
columns,
|
|
11237
11281
|
sort,
|
|
@@ -11269,7 +11313,7 @@ function Toolbar2(props) {
|
|
|
11269
11313
|
setSearchValue(v);
|
|
11270
11314
|
onSearchChange(v);
|
|
11271
11315
|
},
|
|
11272
|
-
placeholder: searchPlaceholder ??
|
|
11316
|
+
placeholder: searchPlaceholder ?? t("table.search_placeholder"),
|
|
11273
11317
|
className: "cls_hazo_ui_table_search w-full sm:max-w-xs"
|
|
11274
11318
|
}
|
|
11275
11319
|
) : /* @__PURE__ */ jsxRuntime.jsx("div", {}),
|
|
@@ -11310,15 +11354,15 @@ function LoadingRows({
|
|
|
11310
11354
|
function noActiveFilters(filter) {
|
|
11311
11355
|
return !filter.search && (!filter.fields || filter.fields.length === 0);
|
|
11312
11356
|
}
|
|
11313
|
-
function renderErrorState(error, serverError) {
|
|
11357
|
+
function renderErrorState(error, serverError, t) {
|
|
11314
11358
|
if (typeof error === "function") return error(serverError);
|
|
11315
11359
|
if (error !== void 0 && error !== null) return error;
|
|
11316
11360
|
const msg = serverError instanceof Error ? serverError.message : String(serverError);
|
|
11317
11361
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11318
11362
|
EmptyState,
|
|
11319
11363
|
{
|
|
11320
|
-
title:
|
|
11321
|
-
description: msg ||
|
|
11364
|
+
title: t("table.error_title"),
|
|
11365
|
+
description: msg || t("table.error_description")
|
|
11322
11366
|
}
|
|
11323
11367
|
);
|
|
11324
11368
|
}
|
|
@@ -11554,7 +11598,6 @@ function StackedBars({
|
|
|
11554
11598
|
}
|
|
11555
11599
|
);
|
|
11556
11600
|
}
|
|
11557
|
-
var t28 = i18n.createPackageT("hazo_ui", en_default);
|
|
11558
11601
|
function DateRangeSelector({
|
|
11559
11602
|
value,
|
|
11560
11603
|
onChange,
|
|
@@ -11562,7 +11605,8 @@ function DateRangeSelector({
|
|
|
11562
11605
|
className,
|
|
11563
11606
|
ariaLabel
|
|
11564
11607
|
}) {
|
|
11565
|
-
const
|
|
11608
|
+
const t = useHazoUiT();
|
|
11609
|
+
const resolved_aria = ariaLabel ?? t("charts.date_range");
|
|
11566
11610
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11567
11611
|
"div",
|
|
11568
11612
|
{
|
|
@@ -11594,7 +11638,6 @@ function DateRangeSelector({
|
|
|
11594
11638
|
}
|
|
11595
11639
|
);
|
|
11596
11640
|
}
|
|
11597
|
-
var t29 = i18n.createPackageT("hazo_ui", en_default);
|
|
11598
11641
|
var PAD_LEFT2 = 80;
|
|
11599
11642
|
var PAD_RIGHT2 = 72;
|
|
11600
11643
|
var PAD_TOP2 = 12;
|
|
@@ -11619,6 +11662,7 @@ function FunnelChart({
|
|
|
11619
11662
|
showTooltip = true,
|
|
11620
11663
|
className
|
|
11621
11664
|
}) {
|
|
11665
|
+
const t = useHazoUiT();
|
|
11622
11666
|
const [hover_idx, set_hover_idx] = React27__namespace.useState(null);
|
|
11623
11667
|
const fmt = valueFormat ?? format_num;
|
|
11624
11668
|
const totals = steps.map(step_total);
|
|
@@ -11745,12 +11789,12 @@ function FunnelChart({
|
|
|
11745
11789
|
const bubble_anchor_y = bar_y + BAR_H / 2;
|
|
11746
11790
|
const lines = [
|
|
11747
11791
|
{ text: step.label, accent: true },
|
|
11748
|
-
{ text:
|
|
11749
|
-
{ text:
|
|
11792
|
+
{ text: t("charts.total", { value: fmt(total) }), accent: false },
|
|
11793
|
+
{ text: t("charts.pct_of_first", { pct: pct_first }), accent: false }
|
|
11750
11794
|
];
|
|
11751
11795
|
if (i > 0) {
|
|
11752
|
-
lines.push({ text:
|
|
11753
|
-
lines.push({ text:
|
|
11796
|
+
lines.push({ text: t("charts.pct_of_prev", { pct: pct_prev }), accent: false });
|
|
11797
|
+
lines.push({ text: t("charts.dropoff", { value: fmt(dropoff) }), accent: false });
|
|
11754
11798
|
}
|
|
11755
11799
|
if (step.segments) {
|
|
11756
11800
|
step.segments.forEach((seg) => {
|
|
@@ -11811,7 +11855,6 @@ function FunnelChart({
|
|
|
11811
11855
|
|
|
11812
11856
|
// src/assets/celebration-chime.mp3
|
|
11813
11857
|
var celebration_chime_default = "data:text/plain;charset=utf-8,";
|
|
11814
|
-
var t30 = i18n.createPackageT("hazo_ui", en_default);
|
|
11815
11858
|
var CELEBRATION_GRADIENT = "linear-gradient(135deg, #667eea 0%, #764ba2 100%)";
|
|
11816
11859
|
var CARD_SIZE = 1080;
|
|
11817
11860
|
var PREVIEW_SIZE = 400;
|
|
@@ -11863,6 +11906,7 @@ function CelebrationModalInner({
|
|
|
11863
11906
|
payload,
|
|
11864
11907
|
onClose
|
|
11865
11908
|
}) {
|
|
11909
|
+
const t = useHazoUiT();
|
|
11866
11910
|
const {
|
|
11867
11911
|
id,
|
|
11868
11912
|
title,
|
|
@@ -12009,7 +12053,7 @@ function CelebrationModalInner({
|
|
|
12009
12053
|
{
|
|
12010
12054
|
className: "cls_celebration_close_btn absolute top-3 right-3 z-10 p-1.5 rounded-full hover:bg-black/10 transition-colors",
|
|
12011
12055
|
onClick: close_modal,
|
|
12012
|
-
"aria-label":
|
|
12056
|
+
"aria-label": t("celebration.close"),
|
|
12013
12057
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4 text-gray-600" })
|
|
12014
12058
|
}
|
|
12015
12059
|
),
|
|
@@ -12072,21 +12116,21 @@ function CelebrationModalInner({
|
|
|
12072
12116
|
disabled: is_downloading,
|
|
12073
12117
|
children: [
|
|
12074
12118
|
is_downloading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 mr-1.5 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
12075
|
-
|
|
12119
|
+
t("celebration.download_png")
|
|
12076
12120
|
]
|
|
12077
12121
|
}
|
|
12078
12122
|
),
|
|
12079
12123
|
can_share && /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: handle_share, children: [
|
|
12080
12124
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Share2, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
12081
|
-
|
|
12125
|
+
t("celebration.share")
|
|
12082
12126
|
] }),
|
|
12083
12127
|
/* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: handle_copy, children: [
|
|
12084
12128
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
12085
|
-
|
|
12129
|
+
t("celebration.copy_image")
|
|
12086
12130
|
] })
|
|
12087
12131
|
] })
|
|
12088
12132
|
] }),
|
|
12089
|
-
!shareableCard && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_celebration_footer pb-8", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: close_modal, children:
|
|
12133
|
+
!shareableCard && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_celebration_footer pb-8", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: close_modal, children: t("celebration.dismiss") }) })
|
|
12090
12134
|
]
|
|
12091
12135
|
}
|
|
12092
12136
|
)
|
|
@@ -12108,8 +12152,8 @@ function computeEta(durationWindow, unitCount, concurrency = 1, fallbackUnitMs =
|
|
|
12108
12152
|
}
|
|
12109
12153
|
function easeToward(elapsed, eta, maxCap = 0.95) {
|
|
12110
12154
|
if (eta <= 0 || elapsed <= 0) return 0;
|
|
12111
|
-
const
|
|
12112
|
-
return maxCap * (1 - Math.exp(-1.5 *
|
|
12155
|
+
const t = elapsed / eta;
|
|
12156
|
+
return maxCap * (1 - Math.exp(-1.5 * t));
|
|
12113
12157
|
}
|
|
12114
12158
|
function HazoUiProgressBar({
|
|
12115
12159
|
value,
|
|
@@ -12285,7 +12329,6 @@ function upsertEntry(entries, entry) {
|
|
|
12285
12329
|
function removeEntry(entries, id) {
|
|
12286
12330
|
return entries.filter((e) => e.id !== id);
|
|
12287
12331
|
}
|
|
12288
|
-
var t31 = i18n.createPackageT("hazo_ui", en_default);
|
|
12289
12332
|
function HazoUiMemoryDropdown({
|
|
12290
12333
|
history_key,
|
|
12291
12334
|
placeholder,
|
|
@@ -12293,8 +12336,9 @@ function HazoUiMemoryDropdown({
|
|
|
12293
12336
|
add_entry,
|
|
12294
12337
|
empty_label
|
|
12295
12338
|
}) {
|
|
12296
|
-
const
|
|
12297
|
-
const
|
|
12339
|
+
const t = useHazoUiT();
|
|
12340
|
+
const resolved_placeholder = placeholder ?? t("memory.search_placeholder");
|
|
12341
|
+
const resolved_empty_label = empty_label ?? t("memory.no_history");
|
|
12298
12342
|
const { value: stored, setValue } = client$2.useHazoState(history_key, {
|
|
12299
12343
|
level: "scope",
|
|
12300
12344
|
fallback: []
|
|
@@ -12380,6 +12424,7 @@ function HazoUiMemoryDropdown({
|
|
|
12380
12424
|
);
|
|
12381
12425
|
}
|
|
12382
12426
|
function EntryRow({ entry, on_select, onDelete }) {
|
|
12427
|
+
const t = useHazoUiT();
|
|
12383
12428
|
const [deleteHovered, setDeleteHovered] = React27__namespace.useState(false);
|
|
12384
12429
|
const [rowHovered, setRowHovered] = React27__namespace.useState(false);
|
|
12385
12430
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -12419,7 +12464,7 @@ function EntryRow({ entry, on_select, onDelete }) {
|
|
|
12419
12464
|
onClick: (e) => onDelete(entry.id, e),
|
|
12420
12465
|
onMouseEnter: () => setDeleteHovered(true),
|
|
12421
12466
|
onMouseLeave: () => setDeleteHovered(false),
|
|
12422
|
-
"aria-label":
|
|
12467
|
+
"aria-label": t("memory.remove_aria", { label: entry.label }),
|
|
12423
12468
|
style: {
|
|
12424
12469
|
flexShrink: 0,
|
|
12425
12470
|
background: "none",
|
|
@@ -12438,7 +12483,6 @@ function EntryRow({ entry, on_select, onDelete }) {
|
|
|
12438
12483
|
}
|
|
12439
12484
|
);
|
|
12440
12485
|
}
|
|
12441
|
-
var t32 = i18n.createPackageT("hazo_ui", en_default);
|
|
12442
12486
|
function Logo({
|
|
12443
12487
|
logoUrl,
|
|
12444
12488
|
logoUrlDark,
|
|
@@ -12448,7 +12492,8 @@ function Logo({
|
|
|
12448
12492
|
className,
|
|
12449
12493
|
imgClassName
|
|
12450
12494
|
}) {
|
|
12451
|
-
const
|
|
12495
|
+
const t = useHazoUiT();
|
|
12496
|
+
const alt = appTitle ?? t("app_logo.alt_fallback");
|
|
12452
12497
|
let content = null;
|
|
12453
12498
|
if (logoUrl) {
|
|
12454
12499
|
content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -12483,12 +12528,12 @@ function Logo({
|
|
|
12483
12528
|
}
|
|
12484
12529
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("inline-flex items-center gap-2", className), children: content });
|
|
12485
12530
|
}
|
|
12486
|
-
var t33 = i18n.createPackageT("hazo_ui", en_default);
|
|
12487
12531
|
function AppHeader({ identity, homeHref, navItems, actions, className }) {
|
|
12532
|
+
const t = useHazoUiT();
|
|
12488
12533
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12489
12534
|
"header",
|
|
12490
12535
|
{
|
|
12491
|
-
"aria-label":
|
|
12536
|
+
"aria-label": t("app_header.aria_label"),
|
|
12492
12537
|
className: cn(
|
|
12493
12538
|
"flex w-full items-center justify-between gap-4 border-b bg-navbar text-navbar-fg border-navbar-border px-4 py-2.5",
|
|
12494
12539
|
className
|
|
@@ -12941,6 +12986,7 @@ function HazoBrowserTab({
|
|
|
12941
12986
|
add_menu,
|
|
12942
12987
|
className
|
|
12943
12988
|
}) {
|
|
12989
|
+
const t = useHazoUiT();
|
|
12944
12990
|
const handle_close = (e, id) => {
|
|
12945
12991
|
e.stopPropagation();
|
|
12946
12992
|
on_close?.(id);
|
|
@@ -12980,7 +13026,7 @@ function HazoBrowserTab({
|
|
|
12980
13026
|
"button",
|
|
12981
13027
|
{
|
|
12982
13028
|
type: "button",
|
|
12983
|
-
"aria-label":
|
|
13029
|
+
"aria-label": t("browser_tab.close_aria", { label: tab.label }),
|
|
12984
13030
|
onClick: (e) => handle_close(e, tab.id),
|
|
12985
13031
|
className: "cls_hazo_browser_tab_close flex-shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-muted hover:text-foreground focus:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
|
|
12986
13032
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3" })
|
|
@@ -12996,7 +13042,6 @@ function HazoBrowserTab({
|
|
|
12996
13042
|
}
|
|
12997
13043
|
);
|
|
12998
13044
|
}
|
|
12999
|
-
var t34 = i18n.createPackageT("hazo_ui", en_default);
|
|
13000
13045
|
var native_name_cache = /* @__PURE__ */ new Map();
|
|
13001
13046
|
function get_native_name(code) {
|
|
13002
13047
|
const cached = native_name_cache.get(code);
|
|
@@ -13071,7 +13116,8 @@ function LocalePicker({
|
|
|
13071
13116
|
triggerLabel,
|
|
13072
13117
|
className
|
|
13073
13118
|
}) {
|
|
13074
|
-
const
|
|
13119
|
+
const t = useHazoUiT();
|
|
13120
|
+
const resolved_trigger_label = triggerLabel ?? t("locale_picker.change_language");
|
|
13075
13121
|
const options = React27__namespace.useMemo(() => {
|
|
13076
13122
|
return Object.entries(alternates ?? {}).map(([code, url]) => {
|
|
13077
13123
|
const href = safeHref(url);
|
|
@@ -13254,6 +13300,7 @@ exports.HazoUiDialogTrigger = DialogTrigger;
|
|
|
13254
13300
|
exports.HazoUiEtaProgress = HazoUiEtaProgress;
|
|
13255
13301
|
exports.HazoUiFlexInput = HazoUiFlexInput;
|
|
13256
13302
|
exports.HazoUiFlexRadio = HazoUiFlexRadio;
|
|
13303
|
+
exports.HazoUiI18nProvider = HazoUiI18nProvider;
|
|
13257
13304
|
exports.HazoUiIcon = HazoUiIcon;
|
|
13258
13305
|
exports.HazoUiIconPicker = HazoUiIconPicker;
|
|
13259
13306
|
exports.HazoUiImageCropper = HazoUiImageCropper;
|
|
@@ -13348,6 +13395,7 @@ exports.celebrate = celebrate;
|
|
|
13348
13395
|
exports.cn = cn;
|
|
13349
13396
|
exports.computeEta = computeEta;
|
|
13350
13397
|
exports.create_command_suggestion_extension = create_command_suggestion_extension;
|
|
13398
|
+
exports.defaultHazoUiT = defaultHazoUiT;
|
|
13351
13399
|
exports.easeToward = easeToward;
|
|
13352
13400
|
exports.errorToast = errorToast;
|
|
13353
13401
|
exports.format_num = format_num;
|
|
@@ -13377,6 +13425,7 @@ exports.useDebounce = useDebounce;
|
|
|
13377
13425
|
exports.useErrorDisplay = useErrorDisplay;
|
|
13378
13426
|
exports.useEtaProgress = useEtaProgress;
|
|
13379
13427
|
exports.useFullscreen = useFullscreen;
|
|
13428
|
+
exports.useHazoUiT = useHazoUiT;
|
|
13380
13429
|
exports.useIsMobile = useIsMobile;
|
|
13381
13430
|
exports.useLoadingState = useLoadingState;
|
|
13382
13431
|
exports.useLocalStorage = useLocalStorage;
|