hazo_ui 6.12.4 → 6.12.5
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 +28 -0
- package/README.md +1 -1
- package/dist/index.cjs +313 -215
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +313 -215
- package/dist/index.js.map +1 -1
- package/dist/index.locale-picker.cjs +217 -3
- package/dist/index.locale-picker.cjs.map +1 -1
- package/dist/index.locale-picker.d.cts +1 -1
- package/dist/index.locale-picker.d.ts +1 -1
- package/dist/index.locale-picker.js +217 -3
- 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 t35 = arguments[e];
|
|
186
|
+
for (var r in t35) ({}).hasOwnProperty.call(t35, r) && (n[r] = t35[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 t35 = {};
|
|
201
201
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
202
202
|
if (-1 !== e.indexOf(n)) continue;
|
|
203
|
-
|
|
203
|
+
t35[n] = r[n];
|
|
204
204
|
}
|
|
205
|
-
return
|
|
205
|
+
return t35;
|
|
206
206
|
}
|
|
207
207
|
module.exports = _objectWithoutPropertiesLoose10, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
208
208
|
}
|
|
@@ -848,7 +848,81 @@ var en_default = {
|
|
|
848
848
|
"celebration.share": "Share",
|
|
849
849
|
"celebration.copy_image": "Copy image",
|
|
850
850
|
"celebration.dismiss": "Dismiss",
|
|
851
|
-
"charts.date_range": "Date range"
|
|
851
|
+
"charts.date_range": "Date range",
|
|
852
|
+
"flex_input.must_be_valid_number": "Must be a valid number",
|
|
853
|
+
"flex_input.max_decimals": "Maximum {{count}} decimal places allowed",
|
|
854
|
+
"flex_input.min_value": "Must be at least {{min}}",
|
|
855
|
+
"flex_input.max_value": "Must be at most {{max}}",
|
|
856
|
+
"flex_input.alpha_only": "Only letters, numbers, and spaces are allowed",
|
|
857
|
+
"flex_input.must_be_valid_email": "Must be a valid email address",
|
|
858
|
+
"flex_input.min_characters": "Must be at least {{min}} characters",
|
|
859
|
+
"flex_input.max_characters": "Must be at most {{max}} characters",
|
|
860
|
+
"flex_input.invalid_format": "Invalid format",
|
|
861
|
+
"flex_input.invalid_input": "Invalid input",
|
|
862
|
+
"textbox.placeholder": "Type here...",
|
|
863
|
+
"textarea.placeholder": "Type here...",
|
|
864
|
+
"common.remove": "Remove",
|
|
865
|
+
"locale_picker.change_language": "Change language",
|
|
866
|
+
"app_logo.alt_fallback": "Logo",
|
|
867
|
+
"app_header.aria_label": "Application header",
|
|
868
|
+
"skeleton.loading_content": "Loading content",
|
|
869
|
+
"spinner.loading": "Loading",
|
|
870
|
+
"spinner.loading_text": "Loading...",
|
|
871
|
+
"rte.update_link": "Update Link",
|
|
872
|
+
"rte.add_link": "Add Link",
|
|
873
|
+
"rte.remove_link": "Remove",
|
|
874
|
+
"rte.select_size": "Select size",
|
|
875
|
+
"rte.custom_size": "Custom size",
|
|
876
|
+
"rte.insert_table": "Insert",
|
|
877
|
+
"rte.search_variables": "Search variables...",
|
|
878
|
+
"rte.no_variables": "No variables found.",
|
|
879
|
+
"rte.table_operations": "Table Operations",
|
|
880
|
+
"rte.add_row_above": "Add row above",
|
|
881
|
+
"rte.add_row_below": "Add row below",
|
|
882
|
+
"rte.add_col_left": "Add col left",
|
|
883
|
+
"rte.add_col_right": "Add col right",
|
|
884
|
+
"rte.delete_row": "Delete row",
|
|
885
|
+
"rte.delete_col": "Delete col",
|
|
886
|
+
"rte.delete_table": "Delete table",
|
|
887
|
+
"rte.insert_table_heading": "Insert Table",
|
|
888
|
+
"rte.placeholder": "Start typing...",
|
|
889
|
+
"sort.asc": "Asc",
|
|
890
|
+
"sort.desc": "Desc",
|
|
891
|
+
"sort.reorder_aria": "Reorder {{field}}",
|
|
892
|
+
"sort.priority_aria": "Sort priority {{n}}",
|
|
893
|
+
"sort.direction_aria": "Sort direction for {{field}}",
|
|
894
|
+
"sort.remove_aria": "Remove {{field}} from sort",
|
|
895
|
+
"sort.active_sorts": "Active sorts",
|
|
896
|
+
"sort.no_active_sorts": "No active sorts",
|
|
897
|
+
"sort.button_label": "Sort",
|
|
898
|
+
"sort.empty_message": "No sort fields yet. Add one below to start ordering rows.",
|
|
899
|
+
"sort.all_fields_added": "All fields added",
|
|
900
|
+
"sort.add_sort_field": "Add sort field",
|
|
901
|
+
"sort.no_fields_available": "No fields available.",
|
|
902
|
+
"kanban.dnd_pickup": "Picked up {{item}}. Currently in {{column}}. Use arrow keys to choose a different column. Press space to drop, escape to cancel.",
|
|
903
|
+
"kanban.dnd_over": "{{item}} over {{column}}.",
|
|
904
|
+
"kanban.dnd_drop": "{{item}} dropped in {{column}}, position {{pos}}.",
|
|
905
|
+
"kanban.dnd_reorder": "{{item}} reordered to position {{pos}} in {{column}}.",
|
|
906
|
+
"kanban.dnd_cancel": "Movement cancelled. {{item}} returned to {{column}}.",
|
|
907
|
+
"kanban.draggable_card": "draggable card",
|
|
908
|
+
"loading.still_loading": "We're still trying to load the {{label}}. The connection may be slow.",
|
|
909
|
+
"loading.try_again": "Try again",
|
|
910
|
+
"loading.gentle_message": "Loading {{label}}\u2026",
|
|
911
|
+
"loading.default_label": "content",
|
|
912
|
+
"loading.firm_message": "Still working on it \u2014 almost there.",
|
|
913
|
+
"icon_picker.emoji_tab": "Emoji",
|
|
914
|
+
"icon_picker.tools_group": "Tools",
|
|
915
|
+
"icon_picker.home_group": "Home",
|
|
916
|
+
"icon_picker.weather_group": "Weather",
|
|
917
|
+
"icon_picker.nature_group": "Nature",
|
|
918
|
+
"icon_picker.symbols_group": "Symbols",
|
|
919
|
+
"icon_picker.no_results": "No icons found",
|
|
920
|
+
"error.correlation_id": "Correlation ID",
|
|
921
|
+
"charts.total": "Total: {{value}}",
|
|
922
|
+
"charts.pct_of_first": "% of first: {{pct}}%",
|
|
923
|
+
"charts.pct_of_prev": "% of prev: {{pct}}%",
|
|
924
|
+
"charts.dropoff": "Drop-off: \u2212{{value}}",
|
|
925
|
+
"toast.missing_prefix": "Missing: {{items}}"
|
|
852
926
|
};
|
|
853
927
|
var t = i18n.createPackageT("hazo_ui", en_default);
|
|
854
928
|
function FilterFieldItem({
|
|
@@ -1336,7 +1410,7 @@ function SortableSortFieldItem({
|
|
|
1336
1410
|
...attributes,
|
|
1337
1411
|
...listeners,
|
|
1338
1412
|
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",
|
|
1339
|
-
"aria-label":
|
|
1413
|
+
"aria-label": t2("sort.reorder_aria", { field: fieldLabel }),
|
|
1340
1414
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GripVertical, { className: "cls_drag_icon h-4 w-4" })
|
|
1341
1415
|
}
|
|
1342
1416
|
),
|
|
@@ -1344,7 +1418,7 @@ function SortableSortFieldItem({
|
|
|
1344
1418
|
"span",
|
|
1345
1419
|
{
|
|
1346
1420
|
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",
|
|
1347
|
-
"aria-label":
|
|
1421
|
+
"aria-label": t2("sort.priority_aria", { n: priority }),
|
|
1348
1422
|
children: priority
|
|
1349
1423
|
}
|
|
1350
1424
|
),
|
|
@@ -1353,7 +1427,7 @@ function SortableSortFieldItem({
|
|
|
1353
1427
|
"div",
|
|
1354
1428
|
{
|
|
1355
1429
|
role: "radiogroup",
|
|
1356
|
-
"aria-label":
|
|
1430
|
+
"aria-label": t2("sort.direction_aria", { field: fieldLabel }),
|
|
1357
1431
|
className: "cls_direction_control inline-flex shrink-0 items-center rounded-md border border-border/70 bg-muted/40 p-0.5",
|
|
1358
1432
|
children: [
|
|
1359
1433
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1367,7 +1441,7 @@ function SortableSortFieldItem({
|
|
|
1367
1441
|
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",
|
|
1368
1442
|
children: [
|
|
1369
1443
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUp, { className: "h-3 w-3" }),
|
|
1370
|
-
"
|
|
1444
|
+
t2("sort.asc")
|
|
1371
1445
|
]
|
|
1372
1446
|
}
|
|
1373
1447
|
),
|
|
@@ -1382,7 +1456,7 @@ function SortableSortFieldItem({
|
|
|
1382
1456
|
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",
|
|
1383
1457
|
children: [
|
|
1384
1458
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { className: "h-3 w-3" }),
|
|
1385
|
-
"
|
|
1459
|
+
t2("sort.desc")
|
|
1386
1460
|
]
|
|
1387
1461
|
}
|
|
1388
1462
|
)
|
|
@@ -1396,7 +1470,7 @@ function SortableSortFieldItem({
|
|
|
1396
1470
|
size: "sm",
|
|
1397
1471
|
onClick: onDelete,
|
|
1398
1472
|
className: "cls_delete_btn h-7 w-7 shrink-0 p-0 text-muted-foreground/60 hover:bg-destructive/10 hover:text-destructive",
|
|
1399
|
-
"aria-label":
|
|
1473
|
+
"aria-label": t2("sort.remove_aria", { field: fieldLabel }),
|
|
1400
1474
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "cls_delete_icon h-3.5 w-3.5" })
|
|
1401
1475
|
}
|
|
1402
1476
|
)
|
|
@@ -1509,16 +1583,16 @@ function HazoUiMultiSortDialog({
|
|
|
1509
1583
|
};
|
|
1510
1584
|
const hasActiveSorts = initialSortFields.length > 0;
|
|
1511
1585
|
const tooltipContent = hasActiveSorts ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_sort_tooltip_content space-y-1", children: [
|
|
1512
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_tooltip_title text-xs font-semibold mb-1", children: "
|
|
1586
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_tooltip_title text-xs font-semibold mb-1", children: t2("sort.active_sorts") }),
|
|
1513
1587
|
initialSortFields.map((sortConfig, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_tooltip_item text-xs", children: [
|
|
1514
1588
|
index + 1,
|
|
1515
1589
|
". ",
|
|
1516
1590
|
getFieldLabel(sortConfig.field),
|
|
1517
1591
|
" (",
|
|
1518
|
-
sortConfig.direction === "asc" ? "
|
|
1592
|
+
sortConfig.direction === "asc" ? t2("sort.asc") : t2("sort.desc"),
|
|
1519
1593
|
")"
|
|
1520
1594
|
] }, sortConfig.field))
|
|
1521
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_sort_tooltip_content text-xs", children: "
|
|
1595
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_sort_tooltip_content text-xs", children: t2("sort.no_active_sorts") });
|
|
1522
1596
|
return /* @__PURE__ */ jsxRuntime.jsxs(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
1523
1597
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
1524
1598
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1538,7 +1612,7 @@ function HazoUiMultiSortDialog({
|
|
|
1538
1612
|
)
|
|
1539
1613
|
}
|
|
1540
1614
|
),
|
|
1541
|
-
"
|
|
1615
|
+
t2("sort.button_label"),
|
|
1542
1616
|
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 })
|
|
1543
1617
|
]
|
|
1544
1618
|
}
|
|
@@ -1583,7 +1657,7 @@ function HazoUiMultiSortDialog({
|
|
|
1583
1657
|
}
|
|
1584
1658
|
)
|
|
1585
1659
|
}
|
|
1586
|
-
) }) : /* @__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: "
|
|
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: t2("sort.empty_message") }),
|
|
1587
1661
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_add_field_section", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: isComboboxOpen, onOpenChange: setIsComboboxOpen, children: [
|
|
1588
1662
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1589
1663
|
Button,
|
|
@@ -1595,13 +1669,13 @@ function HazoUiMultiSortDialog({
|
|
|
1595
1669
|
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",
|
|
1596
1670
|
children: [
|
|
1597
1671
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "cls_plus_icon h-4 w-4" }),
|
|
1598
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: availableFieldsToAdd.length === 0 ? "
|
|
1672
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: availableFieldsToAdd.length === 0 ? t2("sort.all_fields_added") : t2("sort.add_sort_field") })
|
|
1599
1673
|
]
|
|
1600
1674
|
}
|
|
1601
1675
|
) }),
|
|
1602
1676
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "cls_combobox_popover w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
|
|
1603
1677
|
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: t2("sort.search_fields"), className: "cls_command_input" }),
|
|
1604
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: availableFieldsToAdd.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: "
|
|
1678
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: availableFieldsToAdd.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: t2("sort.no_fields_available") }) : /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: availableFieldsToAdd.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1605
1679
|
CommandItem,
|
|
1606
1680
|
{
|
|
1607
1681
|
value: field.label,
|
|
@@ -2137,11 +2211,11 @@ var SYMBOLS_ICONS = [
|
|
|
2137
2211
|
"Wrench"
|
|
2138
2212
|
];
|
|
2139
2213
|
var LUCIDE_GROUPS = [
|
|
2140
|
-
{ key: "tools",
|
|
2141
|
-
{ key: "home",
|
|
2142
|
-
{ key: "weather",
|
|
2143
|
-
{ key: "nature",
|
|
2144
|
-
{ key: "symbols",
|
|
2214
|
+
{ key: "tools", label_key: "icon_picker.tools_group", icons: TOOLS_ICONS },
|
|
2215
|
+
{ key: "home", label_key: "icon_picker.home_group", icons: HOME_ICONS },
|
|
2216
|
+
{ key: "weather", label_key: "icon_picker.weather_group", icons: WEATHER_ICONS },
|
|
2217
|
+
{ key: "nature", label_key: "icon_picker.nature_group", icons: NATURE_ICONS },
|
|
2218
|
+
{ key: "symbols", label_key: "icon_picker.symbols_group", icons: SYMBOLS_ICONS }
|
|
2145
2219
|
];
|
|
2146
2220
|
var EMOJI_ITEMS = [
|
|
2147
2221
|
// Faces
|
|
@@ -2354,11 +2428,11 @@ function HazoUiIconPicker({
|
|
|
2354
2428
|
name
|
|
2355
2429
|
);
|
|
2356
2430
|
}),
|
|
2357
|
-
filtered_search_results.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "col-span-8 py-4 text-center text-sm text-muted-foreground", children: "
|
|
2431
|
+
filtered_search_results.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "col-span-8 py-4 text-center text-sm text-muted-foreground", children: t3("icon_picker.no_results") })
|
|
2358
2432
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(Tabs, { defaultValue: "emoji", children: [
|
|
2359
2433
|
/* @__PURE__ */ jsxRuntime.jsxs(TabsList, { className: "grid w-full grid-cols-6", children: [
|
|
2360
|
-
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "emoji", children: "
|
|
2361
|
-
LUCIDE_GROUPS.map((group) => /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: group.key, children: group.
|
|
2434
|
+
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "emoji", children: t3("icon_picker.emoji_tab") }),
|
|
2435
|
+
LUCIDE_GROUPS.map((group) => /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: group.key, children: t3(group.label_key) }, group.key))
|
|
2362
2436
|
] }),
|
|
2363
2437
|
/* @__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(
|
|
2364
2438
|
"button",
|
|
@@ -2390,6 +2464,7 @@ function HazoUiIconPicker({
|
|
|
2390
2464
|
}
|
|
2391
2465
|
) });
|
|
2392
2466
|
}
|
|
2467
|
+
var t4 = i18n.createPackageT("hazo_ui", en_default);
|
|
2393
2468
|
function validateInput(value, input_type, text_len_min, text_len_max, num_min, num_max, regex, num_decimals) {
|
|
2394
2469
|
if (value === "") {
|
|
2395
2470
|
return { isValid: true };
|
|
@@ -2398,36 +2473,36 @@ function validateInput(value, input_type, text_len_min, text_len_max, num_min, n
|
|
|
2398
2473
|
case "numeric": {
|
|
2399
2474
|
const numValue = parseFloat(value);
|
|
2400
2475
|
if (isNaN(numValue)) {
|
|
2401
|
-
return { isValid: false, errorMessage: "
|
|
2476
|
+
return { isValid: false, errorMessage: t4("flex_input.must_be_valid_number") };
|
|
2402
2477
|
}
|
|
2403
2478
|
if (num_decimals !== void 0) {
|
|
2404
2479
|
const decimalPlaces = value.split(".")[1]?.length || 0;
|
|
2405
2480
|
if (decimalPlaces > num_decimals) {
|
|
2406
2481
|
return {
|
|
2407
2482
|
isValid: false,
|
|
2408
|
-
errorMessage:
|
|
2483
|
+
errorMessage: t4("flex_input.max_decimals", { count: num_decimals })
|
|
2409
2484
|
};
|
|
2410
2485
|
}
|
|
2411
2486
|
}
|
|
2412
2487
|
if (num_min !== void 0 && numValue < num_min) {
|
|
2413
|
-
return { isValid: false, errorMessage:
|
|
2488
|
+
return { isValid: false, errorMessage: t4("flex_input.min_value", { min: num_min }) };
|
|
2414
2489
|
}
|
|
2415
2490
|
if (num_max !== void 0 && numValue > num_max) {
|
|
2416
|
-
return { isValid: false, errorMessage:
|
|
2491
|
+
return { isValid: false, errorMessage: t4("flex_input.max_value", { max: num_max }) };
|
|
2417
2492
|
}
|
|
2418
2493
|
break;
|
|
2419
2494
|
}
|
|
2420
2495
|
case "alpha": {
|
|
2421
2496
|
const alphaRegex = /^[A-Za-z0-9\s]*$/;
|
|
2422
2497
|
if (!alphaRegex.test(value)) {
|
|
2423
|
-
return { isValid: false, errorMessage: "
|
|
2498
|
+
return { isValid: false, errorMessage: t4("flex_input.alpha_only") };
|
|
2424
2499
|
}
|
|
2425
2500
|
break;
|
|
2426
2501
|
}
|
|
2427
2502
|
case "email": {
|
|
2428
2503
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
2429
2504
|
if (!emailRegex.test(value)) {
|
|
2430
|
-
return { isValid: false, errorMessage: "
|
|
2505
|
+
return { isValid: false, errorMessage: t4("flex_input.must_be_valid_email") };
|
|
2431
2506
|
}
|
|
2432
2507
|
break;
|
|
2433
2508
|
}
|
|
@@ -2435,13 +2510,13 @@ function validateInput(value, input_type, text_len_min, text_len_max, num_min, n
|
|
|
2435
2510
|
if (text_len_min !== void 0 && value.length < text_len_min) {
|
|
2436
2511
|
return {
|
|
2437
2512
|
isValid: false,
|
|
2438
|
-
errorMessage:
|
|
2513
|
+
errorMessage: t4("flex_input.min_characters", { min: text_len_min })
|
|
2439
2514
|
};
|
|
2440
2515
|
}
|
|
2441
2516
|
if (text_len_max !== void 0 && value.length > text_len_max) {
|
|
2442
2517
|
return {
|
|
2443
2518
|
isValid: false,
|
|
2444
|
-
errorMessage:
|
|
2519
|
+
errorMessage: t4("flex_input.max_characters", { max: text_len_max })
|
|
2445
2520
|
};
|
|
2446
2521
|
}
|
|
2447
2522
|
break;
|
|
@@ -2450,7 +2525,7 @@ function validateInput(value, input_type, text_len_min, text_len_max, num_min, n
|
|
|
2450
2525
|
if (regex) {
|
|
2451
2526
|
const regexPattern = typeof regex === "string" ? new RegExp(regex) : regex;
|
|
2452
2527
|
if (!regexPattern.test(value)) {
|
|
2453
|
-
return { isValid: false, errorMessage: "
|
|
2528
|
+
return { isValid: false, errorMessage: t4("flex_input.invalid_format") };
|
|
2454
2529
|
}
|
|
2455
2530
|
}
|
|
2456
2531
|
return { isValid: true };
|
|
@@ -2546,7 +2621,7 @@ var HazoUiFlexInput = React27__namespace.forwardRef(
|
|
|
2546
2621
|
num_decimals
|
|
2547
2622
|
);
|
|
2548
2623
|
if (!validation.isValid) {
|
|
2549
|
-
setErrorMessage(validation.errorMessage || format_guide || "
|
|
2624
|
+
setErrorMessage(validation.errorMessage || format_guide || t4("flex_input.invalid_input"));
|
|
2550
2625
|
} else {
|
|
2551
2626
|
setErrorMessage(void 0);
|
|
2552
2627
|
}
|
|
@@ -3776,10 +3851,10 @@ var BLOCK_TYPE_LABEL_KEYS = {
|
|
|
3776
3851
|
"code-block": "rte.block_type.code_block",
|
|
3777
3852
|
blockquote: "rte.block_type.blockquote"
|
|
3778
3853
|
};
|
|
3779
|
-
function get_translated_block_types(
|
|
3854
|
+
function get_translated_block_types(t35) {
|
|
3780
3855
|
return BLOCK_TYPES.map((type) => ({
|
|
3781
3856
|
...type,
|
|
3782
|
-
label:
|
|
3857
|
+
label: t35(BLOCK_TYPE_LABEL_KEYS[type.value])
|
|
3783
3858
|
}));
|
|
3784
3859
|
}
|
|
3785
3860
|
|
|
@@ -3826,7 +3901,7 @@ function get_file_extension(filename) {
|
|
|
3826
3901
|
function is_image_file(mime_type) {
|
|
3827
3902
|
return mime_type.startsWith("image/");
|
|
3828
3903
|
}
|
|
3829
|
-
var
|
|
3904
|
+
var t5 = i18n.createPackageT("hazo_ui", en_default);
|
|
3830
3905
|
var ALL_ON = {
|
|
3831
3906
|
undo_redo: true,
|
|
3832
3907
|
block_type: true,
|
|
@@ -3881,7 +3956,7 @@ var Toolbar = ({
|
|
|
3881
3956
|
}
|
|
3882
3957
|
const tb = { ...ALL_ON, ...toolbar };
|
|
3883
3958
|
const font_family_options = font_families && font_families.length > 0 ? font_families : FONT_FAMILIES;
|
|
3884
|
-
const block_type_options = get_translated_block_types(
|
|
3959
|
+
const block_type_options = get_translated_block_types(t5);
|
|
3885
3960
|
const get_current_font_size = () => {
|
|
3886
3961
|
const attrs = editor.getAttributes("textStyle");
|
|
3887
3962
|
return attrs.fontSize || FONT_SIZE_CONFIG.default;
|
|
@@ -4025,7 +4100,7 @@ var Toolbar = ({
|
|
|
4025
4100
|
{
|
|
4026
4101
|
onClick: () => editor.chain().focus().undo().run(),
|
|
4027
4102
|
disabled: !editor.can().undo(),
|
|
4028
|
-
tooltip:
|
|
4103
|
+
tooltip: t5("rte.undo"),
|
|
4029
4104
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUndo2, { className: "h-4 w-4" })
|
|
4030
4105
|
},
|
|
4031
4106
|
"undo"
|
|
@@ -4035,7 +4110,7 @@ var Toolbar = ({
|
|
|
4035
4110
|
{
|
|
4036
4111
|
onClick: () => editor.chain().focus().redo().run(),
|
|
4037
4112
|
disabled: !editor.can().redo(),
|
|
4038
|
-
tooltip:
|
|
4113
|
+
tooltip: t5("rte.redo"),
|
|
4039
4114
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuRedo2, { className: "h-4 w-4" })
|
|
4040
4115
|
},
|
|
4041
4116
|
"redo"
|
|
@@ -4076,7 +4151,7 @@ var Toolbar = ({
|
|
|
4076
4151
|
ToolbarButton,
|
|
4077
4152
|
{
|
|
4078
4153
|
onClick: () => handle_font_size_change(-2),
|
|
4079
|
-
tooltip:
|
|
4154
|
+
tooltip: t5("rte.decrease_font_size"),
|
|
4080
4155
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuMinus, { className: "h-3 w-3" })
|
|
4081
4156
|
}
|
|
4082
4157
|
),
|
|
@@ -4085,7 +4160,7 @@ var Toolbar = ({
|
|
|
4085
4160
|
ToolbarButton,
|
|
4086
4161
|
{
|
|
4087
4162
|
onClick: () => handle_font_size_change(FONT_SIZE_CONFIG.step),
|
|
4088
|
-
tooltip:
|
|
4163
|
+
tooltip: t5("rte.increase_font_size"),
|
|
4089
4164
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuPlus, { className: "h-3 w-3" })
|
|
4090
4165
|
}
|
|
4091
4166
|
)
|
|
@@ -4103,7 +4178,7 @@ var Toolbar = ({
|
|
|
4103
4178
|
{
|
|
4104
4179
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
4105
4180
|
is_active: editor.isActive("bold"),
|
|
4106
|
-
tooltip:
|
|
4181
|
+
tooltip: t5("rte.bold"),
|
|
4107
4182
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuBold, { className: "h-4 w-4" })
|
|
4108
4183
|
},
|
|
4109
4184
|
"bold"
|
|
@@ -4117,7 +4192,7 @@ var Toolbar = ({
|
|
|
4117
4192
|
{
|
|
4118
4193
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
4119
4194
|
is_active: editor.isActive("italic"),
|
|
4120
|
-
tooltip:
|
|
4195
|
+
tooltip: t5("rte.italic"),
|
|
4121
4196
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuItalic, { className: "h-4 w-4" })
|
|
4122
4197
|
},
|
|
4123
4198
|
"italic"
|
|
@@ -4131,7 +4206,7 @@ var Toolbar = ({
|
|
|
4131
4206
|
{
|
|
4132
4207
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
4133
4208
|
is_active: editor.isActive("underline"),
|
|
4134
|
-
tooltip:
|
|
4209
|
+
tooltip: t5("rte.underline"),
|
|
4135
4210
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUnderline, { className: "h-4 w-4" })
|
|
4136
4211
|
},
|
|
4137
4212
|
"underline"
|
|
@@ -4145,7 +4220,7 @@ var Toolbar = ({
|
|
|
4145
4220
|
{
|
|
4146
4221
|
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
4147
4222
|
is_active: editor.isActive("strike"),
|
|
4148
|
-
tooltip:
|
|
4223
|
+
tooltip: t5("rte.strikethrough"),
|
|
4149
4224
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuStrikethrough, { className: "h-4 w-4" })
|
|
4150
4225
|
},
|
|
4151
4226
|
"strike"
|
|
@@ -4159,7 +4234,7 @@ var Toolbar = ({
|
|
|
4159
4234
|
{
|
|
4160
4235
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
4161
4236
|
is_active: editor.isActive("subscript"),
|
|
4162
|
-
tooltip:
|
|
4237
|
+
tooltip: t5("rte.subscript"),
|
|
4163
4238
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuSubscript, { className: "h-4 w-4" })
|
|
4164
4239
|
},
|
|
4165
4240
|
"sub"
|
|
@@ -4173,7 +4248,7 @@ var Toolbar = ({
|
|
|
4173
4248
|
{
|
|
4174
4249
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
4175
4250
|
is_active: editor.isActive("superscript"),
|
|
4176
|
-
tooltip:
|
|
4251
|
+
tooltip: t5("rte.superscript"),
|
|
4177
4252
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuSuperscript, { className: "h-4 w-4" })
|
|
4178
4253
|
},
|
|
4179
4254
|
"super"
|
|
@@ -4187,7 +4262,7 @@ var Toolbar = ({
|
|
|
4187
4262
|
if (tb.link) {
|
|
4188
4263
|
items.push(
|
|
4189
4264
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: link_popover_open, onOpenChange: set_link_popover_open, children: [
|
|
4190
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: editor.isActive("link"), tooltip:
|
|
4265
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: editor.isActive("link"), tooltip: t5("rte.link"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuLink, { className: "h-4 w-4" }) }) }),
|
|
4191
4266
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-80 p-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4192
4267
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4193
4268
|
Input,
|
|
@@ -4199,17 +4274,14 @@ var Toolbar = ({
|
|
|
4199
4274
|
}
|
|
4200
4275
|
),
|
|
4201
4276
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
4202
|
-
/* @__PURE__ */ jsxRuntime.
|
|
4203
|
-
editor.isActive("link") ? "Update" : "Add",
|
|
4204
|
-
" Link"
|
|
4205
|
-
] }),
|
|
4277
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: handle_set_link, className: "flex-1", children: editor.isActive("link") ? t5("rte.update_link") : t5("rte.add_link") }),
|
|
4206
4278
|
editor.isActive("link") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4207
4279
|
Button,
|
|
4208
4280
|
{
|
|
4209
4281
|
size: "sm",
|
|
4210
4282
|
variant: "destructive",
|
|
4211
4283
|
onClick: handle_remove_link,
|
|
4212
|
-
children: "
|
|
4284
|
+
children: t5("rte.remove_link")
|
|
4213
4285
|
}
|
|
4214
4286
|
)
|
|
4215
4287
|
] })
|
|
@@ -4223,7 +4295,7 @@ var Toolbar = ({
|
|
|
4223
4295
|
ToolbarButton,
|
|
4224
4296
|
{
|
|
4225
4297
|
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
4226
|
-
tooltip:
|
|
4298
|
+
tooltip: t5("rte.clear_formatting"),
|
|
4227
4299
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuRemoveFormatting, { className: "h-4 w-4" })
|
|
4228
4300
|
},
|
|
4229
4301
|
"clear"
|
|
@@ -4237,7 +4309,7 @@ var Toolbar = ({
|
|
|
4237
4309
|
if (tb.text_color) {
|
|
4238
4310
|
items.push(
|
|
4239
4311
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: text_color_open, onOpenChange: set_text_color_open, children: [
|
|
4240
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip:
|
|
4312
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t5("rte.text_color"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
4241
4313
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuPalette, { className: "h-4 w-4" }),
|
|
4242
4314
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4243
4315
|
"div",
|
|
@@ -4280,7 +4352,7 @@ var Toolbar = ({
|
|
|
4280
4352
|
if (tb.highlight_color) {
|
|
4281
4353
|
items.push(
|
|
4282
4354
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: highlight_color_open, onOpenChange: set_highlight_color_open, children: [
|
|
4283
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip:
|
|
4355
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t5("rte.highlight_color"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
4284
4356
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuHighlighter, { className: "h-4 w-4" }),
|
|
4285
4357
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4286
4358
|
"div",
|
|
@@ -4323,7 +4395,7 @@ var Toolbar = ({
|
|
|
4323
4395
|
{
|
|
4324
4396
|
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
4325
4397
|
is_active: editor.isActive({ textAlign: "left" }),
|
|
4326
|
-
tooltip:
|
|
4398
|
+
tooltip: t5("rte.align_left"),
|
|
4327
4399
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignLeft, { className: "h-4 w-4" })
|
|
4328
4400
|
},
|
|
4329
4401
|
"align-left"
|
|
@@ -4333,7 +4405,7 @@ var Toolbar = ({
|
|
|
4333
4405
|
{
|
|
4334
4406
|
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
4335
4407
|
is_active: editor.isActive({ textAlign: "center" }),
|
|
4336
|
-
tooltip:
|
|
4408
|
+
tooltip: t5("rte.align_center"),
|
|
4337
4409
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignCenter, { className: "h-4 w-4" })
|
|
4338
4410
|
},
|
|
4339
4411
|
"align-center"
|
|
@@ -4343,7 +4415,7 @@ var Toolbar = ({
|
|
|
4343
4415
|
{
|
|
4344
4416
|
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
4345
4417
|
is_active: editor.isActive({ textAlign: "right" }),
|
|
4346
|
-
tooltip:
|
|
4418
|
+
tooltip: t5("rte.align_right"),
|
|
4347
4419
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignRight, { className: "h-4 w-4" })
|
|
4348
4420
|
},
|
|
4349
4421
|
"align-right"
|
|
@@ -4353,7 +4425,7 @@ var Toolbar = ({
|
|
|
4353
4425
|
{
|
|
4354
4426
|
onClick: () => editor.chain().focus().setTextAlign("justify").run(),
|
|
4355
4427
|
is_active: editor.isActive({ textAlign: "justify" }),
|
|
4356
|
-
tooltip:
|
|
4428
|
+
tooltip: t5("rte.justify"),
|
|
4357
4429
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignJustify, { className: "h-4 w-4" })
|
|
4358
4430
|
},
|
|
4359
4431
|
"align-justify"
|
|
@@ -4369,7 +4441,7 @@ var Toolbar = ({
|
|
|
4369
4441
|
{
|
|
4370
4442
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
4371
4443
|
is_active: editor.isActive("bulletList"),
|
|
4372
|
-
tooltip:
|
|
4444
|
+
tooltip: t5("rte.bullet_list"),
|
|
4373
4445
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuList, { className: "h-4 w-4" })
|
|
4374
4446
|
},
|
|
4375
4447
|
"bullet"
|
|
@@ -4383,7 +4455,7 @@ var Toolbar = ({
|
|
|
4383
4455
|
{
|
|
4384
4456
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
4385
4457
|
is_active: editor.isActive("orderedList"),
|
|
4386
|
-
tooltip:
|
|
4458
|
+
tooltip: t5("rte.ordered_list"),
|
|
4387
4459
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuListOrdered, { className: "h-4 w-4" })
|
|
4388
4460
|
},
|
|
4389
4461
|
"ordered"
|
|
@@ -4397,7 +4469,7 @@ var Toolbar = ({
|
|
|
4397
4469
|
{
|
|
4398
4470
|
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
4399
4471
|
is_active: editor.isActive("taskList"),
|
|
4400
|
-
tooltip:
|
|
4472
|
+
tooltip: t5("rte.checklist"),
|
|
4401
4473
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuListChecks, { className: "h-4 w-4" })
|
|
4402
4474
|
},
|
|
4403
4475
|
"task"
|
|
@@ -4419,7 +4491,7 @@ var Toolbar = ({
|
|
|
4419
4491
|
}
|
|
4420
4492
|
},
|
|
4421
4493
|
disabled: !editor.can().liftListItem("listItem") && !editor.can().liftListItem("taskItem"),
|
|
4422
|
-
tooltip:
|
|
4494
|
+
tooltip: t5("rte.decrease_indent"),
|
|
4423
4495
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuIndentDecrease, { className: "h-4 w-4" })
|
|
4424
4496
|
},
|
|
4425
4497
|
"indent-dec"
|
|
@@ -4435,7 +4507,7 @@ var Toolbar = ({
|
|
|
4435
4507
|
}
|
|
4436
4508
|
},
|
|
4437
4509
|
disabled: !editor.can().sinkListItem("listItem") && !editor.can().sinkListItem("taskItem"),
|
|
4438
|
-
tooltip:
|
|
4510
|
+
tooltip: t5("rte.increase_indent"),
|
|
4439
4511
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuIndentIncrease, { className: "h-4 w-4" })
|
|
4440
4512
|
},
|
|
4441
4513
|
"indent-inc"
|
|
@@ -4446,7 +4518,7 @@ var Toolbar = ({
|
|
|
4446
4518
|
const items = [];
|
|
4447
4519
|
if (tb.horizontal_rule) {
|
|
4448
4520
|
items.push(
|
|
4449
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { onClick: handle_hr_insert, tooltip:
|
|
4521
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { onClick: handle_hr_insert, tooltip: t5("rte.horizontal_rule"), children: /* @__PURE__ */ jsxRuntime.jsx(rx.RxDividerHorizontal, { className: "h-4 w-4" }) }, "hr")
|
|
4450
4522
|
);
|
|
4451
4523
|
}
|
|
4452
4524
|
if (tb.image) {
|
|
@@ -4455,7 +4527,7 @@ var Toolbar = ({
|
|
|
4455
4527
|
ToolbarButton,
|
|
4456
4528
|
{
|
|
4457
4529
|
onClick: () => image_input_ref.current?.click(),
|
|
4458
|
-
tooltip:
|
|
4530
|
+
tooltip: t5("rte.insert_image"),
|
|
4459
4531
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuImage, { className: "h-4 w-4" })
|
|
4460
4532
|
},
|
|
4461
4533
|
"image"
|
|
@@ -4469,14 +4541,14 @@ var Toolbar = ({
|
|
|
4469
4541
|
ToolbarButton,
|
|
4470
4542
|
{
|
|
4471
4543
|
is_active: editor.isActive("table"),
|
|
4472
|
-
tooltip:
|
|
4544
|
+
tooltip: t5("rte.table"),
|
|
4473
4545
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuTable, { className: "h-4 w-4" })
|
|
4474
4546
|
}
|
|
4475
4547
|
) }),
|
|
4476
4548
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-3", align: "start", children: editor.isActive("table") ? (
|
|
4477
4549
|
// Table editing controls when inside a table
|
|
4478
4550
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4479
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children: "
|
|
4551
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children: t5("rte.table_operations") }),
|
|
4480
4552
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-1", children: [
|
|
4481
4553
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4482
4554
|
Button,
|
|
@@ -4487,7 +4559,7 @@ var Toolbar = ({
|
|
|
4487
4559
|
onClick: handle_add_row_before,
|
|
4488
4560
|
children: [
|
|
4489
4561
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTableRowsSplit, { className: "h-3 w-3 mr-1" }),
|
|
4490
|
-
"
|
|
4562
|
+
t5("rte.add_row_above")
|
|
4491
4563
|
]
|
|
4492
4564
|
}
|
|
4493
4565
|
),
|
|
@@ -4500,7 +4572,7 @@ var Toolbar = ({
|
|
|
4500
4572
|
onClick: handle_add_row_after,
|
|
4501
4573
|
children: [
|
|
4502
4574
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTableRowsSplit, { className: "h-3 w-3 mr-1" }),
|
|
4503
|
-
"
|
|
4575
|
+
t5("rte.add_row_below")
|
|
4504
4576
|
]
|
|
4505
4577
|
}
|
|
4506
4578
|
),
|
|
@@ -4513,7 +4585,7 @@ var Toolbar = ({
|
|
|
4513
4585
|
onClick: handle_add_col_before,
|
|
4514
4586
|
children: [
|
|
4515
4587
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTableColumnsSplit, { className: "h-3 w-3 mr-1" }),
|
|
4516
|
-
"
|
|
4588
|
+
t5("rte.add_col_left")
|
|
4517
4589
|
]
|
|
4518
4590
|
}
|
|
4519
4591
|
),
|
|
@@ -4526,7 +4598,7 @@ var Toolbar = ({
|
|
|
4526
4598
|
onClick: handle_add_col_after,
|
|
4527
4599
|
children: [
|
|
4528
4600
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTableColumnsSplit, { className: "h-3 w-3 mr-1" }),
|
|
4529
|
-
"
|
|
4601
|
+
t5("rte.add_col_right")
|
|
4530
4602
|
]
|
|
4531
4603
|
}
|
|
4532
4604
|
),
|
|
@@ -4539,7 +4611,7 @@ var Toolbar = ({
|
|
|
4539
4611
|
onClick: handle_delete_row,
|
|
4540
4612
|
children: [
|
|
4541
4613
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTrash2, { className: "h-3 w-3 mr-1" }),
|
|
4542
|
-
"
|
|
4614
|
+
t5("rte.delete_row")
|
|
4543
4615
|
]
|
|
4544
4616
|
}
|
|
4545
4617
|
),
|
|
@@ -4552,7 +4624,7 @@ var Toolbar = ({
|
|
|
4552
4624
|
onClick: handle_delete_col,
|
|
4553
4625
|
children: [
|
|
4554
4626
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTrash2, { className: "h-3 w-3 mr-1" }),
|
|
4555
|
-
"
|
|
4627
|
+
t5("rte.delete_col")
|
|
4556
4628
|
]
|
|
4557
4629
|
}
|
|
4558
4630
|
)
|
|
@@ -4566,7 +4638,7 @@ var Toolbar = ({
|
|
|
4566
4638
|
onClick: handle_delete_table,
|
|
4567
4639
|
children: [
|
|
4568
4640
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuTrash2, { className: "h-3 w-3 mr-1" }),
|
|
4569
|
-
"
|
|
4641
|
+
t5("rte.delete_table")
|
|
4570
4642
|
]
|
|
4571
4643
|
}
|
|
4572
4644
|
)
|
|
@@ -4574,7 +4646,7 @@ var Toolbar = ({
|
|
|
4574
4646
|
) : (
|
|
4575
4647
|
// Table size picker when not in a table
|
|
4576
4648
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4577
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children: "
|
|
4649
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium mb-1", children: t5("rte.insert_table_heading") }),
|
|
4578
4650
|
/* @__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(
|
|
4579
4651
|
"div",
|
|
4580
4652
|
{
|
|
@@ -4588,9 +4660,9 @@ var Toolbar = ({
|
|
|
4588
4660
|
},
|
|
4589
4661
|
col_idx
|
|
4590
4662
|
)) }, row_idx)) }),
|
|
4591
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-center text-muted-foreground", children: hovered_cell ? `${hovered_cell.col} x ${hovered_cell.row}` : "
|
|
4663
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-center text-muted-foreground", children: hovered_cell ? `${hovered_cell.col} x ${hovered_cell.row}` : t5("rte.select_size") }),
|
|
4592
4664
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t pt-2 mt-1", children: [
|
|
4593
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground mb-2", children: "
|
|
4665
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground mb-2", children: t5("rte.custom_size") }),
|
|
4594
4666
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4595
4667
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4596
4668
|
Input,
|
|
@@ -4623,7 +4695,7 @@ var Toolbar = ({
|
|
|
4623
4695
|
onClick: () => handle_table_insert(table_rows, table_cols),
|
|
4624
4696
|
children: [
|
|
4625
4697
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuGrid3X3, { className: "h-3 w-3 mr-1" }),
|
|
4626
|
-
"
|
|
4698
|
+
t5("rte.insert_table")
|
|
4627
4699
|
]
|
|
4628
4700
|
}
|
|
4629
4701
|
)
|
|
@@ -4641,11 +4713,11 @@ var Toolbar = ({
|
|
|
4641
4713
|
if (tb.variables && variables.length > 0) {
|
|
4642
4714
|
items.push(
|
|
4643
4715
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: variables_menu_open, onOpenChange: set_variables_menu_open, children: [
|
|
4644
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip:
|
|
4716
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t5("rte.insert_variable"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuVariable, { className: "h-4 w-4" }) }) }),
|
|
4645
4717
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
|
|
4646
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: "
|
|
4718
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: t5("rte.search_variables"), className: "h-8 text-xs" }),
|
|
4647
4719
|
/* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
|
|
4648
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: "
|
|
4720
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: t5("rte.no_variables") }),
|
|
4649
4721
|
/* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: variables.map((variable) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4650
4722
|
CommandItem,
|
|
4651
4723
|
{
|
|
@@ -4670,7 +4742,7 @@ var Toolbar = ({
|
|
|
4670
4742
|
ToolbarButton,
|
|
4671
4743
|
{
|
|
4672
4744
|
onClick: () => file_input_ref.current?.click(),
|
|
4673
|
-
tooltip:
|
|
4745
|
+
tooltip: t5("rte.attach_file"),
|
|
4674
4746
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuPaperclip, { className: "h-4 w-4" })
|
|
4675
4747
|
},
|
|
4676
4748
|
"attach"
|
|
@@ -4942,6 +5014,7 @@ var VariableExtension = core.Node.create({
|
|
|
4942
5014
|
};
|
|
4943
5015
|
}
|
|
4944
5016
|
});
|
|
5017
|
+
var t6 = i18n.createPackageT("hazo_ui", en_default);
|
|
4945
5018
|
function debounce_fn(func, wait) {
|
|
4946
5019
|
let timeout_id = null;
|
|
4947
5020
|
return (output) => {
|
|
@@ -4958,7 +5031,7 @@ var HazoUiRte = ({
|
|
|
4958
5031
|
attachments: initial_attachments = [],
|
|
4959
5032
|
variables = [],
|
|
4960
5033
|
on_change,
|
|
4961
|
-
placeholder
|
|
5034
|
+
placeholder,
|
|
4962
5035
|
min_height = "200px",
|
|
4963
5036
|
max_height = "400px",
|
|
4964
5037
|
disabled = false,
|
|
@@ -4967,6 +5040,7 @@ var HazoUiRte = ({
|
|
|
4967
5040
|
toolbar,
|
|
4968
5041
|
font_families
|
|
4969
5042
|
}) => {
|
|
5043
|
+
const resolved_placeholder = placeholder ?? t6("rte.placeholder");
|
|
4970
5044
|
const [attachments, set_attachments] = React27__namespace.useState(
|
|
4971
5045
|
initial_attachments
|
|
4972
5046
|
);
|
|
@@ -5016,7 +5090,7 @@ var HazoUiRte = ({
|
|
|
5016
5090
|
}
|
|
5017
5091
|
}),
|
|
5018
5092
|
Placeholder__default.default.configure({
|
|
5019
|
-
placeholder
|
|
5093
|
+
placeholder: resolved_placeholder
|
|
5020
5094
|
}),
|
|
5021
5095
|
HorizontalRule__default.default,
|
|
5022
5096
|
extensionTable.Table.configure({
|
|
@@ -5191,7 +5265,7 @@ var HazoUiRte = ({
|
|
|
5191
5265
|
);
|
|
5192
5266
|
};
|
|
5193
5267
|
HazoUiRte.displayName = "HazoUiRte";
|
|
5194
|
-
var
|
|
5268
|
+
var t7 = i18n.createPackageT("hazo_ui", en_default);
|
|
5195
5269
|
function CanvasTextToolbar({
|
|
5196
5270
|
bold,
|
|
5197
5271
|
italic,
|
|
@@ -5222,14 +5296,14 @@ function CanvasTextToolbar({
|
|
|
5222
5296
|
),
|
|
5223
5297
|
style,
|
|
5224
5298
|
children: [
|
|
5225
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bold, onClick: onBold, tooltip:
|
|
5226
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: italic, onClick: onItalic, tooltip:
|
|
5299
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bold, onClick: onBold, tooltip: t7("canvas_toolbar.bold"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuBold, { className: "h-4 w-4" }) }),
|
|
5300
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: italic, onClick: onItalic, tooltip: t7("canvas_toolbar.italic"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuItalic, { className: "h-4 w-4" }) }),
|
|
5227
5301
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5228
5302
|
ToolbarButton,
|
|
5229
5303
|
{
|
|
5230
5304
|
is_active: underline,
|
|
5231
5305
|
onClick: onUnderline,
|
|
5232
|
-
tooltip:
|
|
5306
|
+
tooltip: t7("canvas_toolbar.underline"),
|
|
5233
5307
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUnderline, { className: "h-4 w-4" })
|
|
5234
5308
|
}
|
|
5235
5309
|
),
|
|
@@ -5239,7 +5313,7 @@ function CanvasTextToolbar({
|
|
|
5239
5313
|
{
|
|
5240
5314
|
is_active: align === "left",
|
|
5241
5315
|
onClick: () => onAlign?.("left"),
|
|
5242
|
-
tooltip:
|
|
5316
|
+
tooltip: t7("canvas_toolbar.align_left"),
|
|
5243
5317
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignLeft, { className: "h-4 w-4" })
|
|
5244
5318
|
}
|
|
5245
5319
|
),
|
|
@@ -5248,7 +5322,7 @@ function CanvasTextToolbar({
|
|
|
5248
5322
|
{
|
|
5249
5323
|
is_active: align === "center",
|
|
5250
5324
|
onClick: () => onAlign?.("center"),
|
|
5251
|
-
tooltip:
|
|
5325
|
+
tooltip: t7("canvas_toolbar.align_center"),
|
|
5252
5326
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignCenter, { className: "h-4 w-4" })
|
|
5253
5327
|
}
|
|
5254
5328
|
),
|
|
@@ -5257,7 +5331,7 @@ function CanvasTextToolbar({
|
|
|
5257
5331
|
{
|
|
5258
5332
|
is_active: align === "right",
|
|
5259
5333
|
onClick: () => onAlign?.("right"),
|
|
5260
|
-
tooltip:
|
|
5334
|
+
tooltip: t7("canvas_toolbar.align_right"),
|
|
5261
5335
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignRight, { className: "h-4 w-4" })
|
|
5262
5336
|
}
|
|
5263
5337
|
),
|
|
@@ -5266,7 +5340,7 @@ function CanvasTextToolbar({
|
|
|
5266
5340
|
"label",
|
|
5267
5341
|
{
|
|
5268
5342
|
className: "relative flex h-8 w-8 cursor-pointer items-center justify-center rounded-md hover:bg-accent",
|
|
5269
|
-
title:
|
|
5343
|
+
title: t7("canvas_toolbar.text_color"),
|
|
5270
5344
|
children: [
|
|
5271
5345
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
5272
5346
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold text-muted-foreground", children: "A" }),
|
|
@@ -5296,7 +5370,7 @@ function CanvasTextToolbar({
|
|
|
5296
5370
|
{
|
|
5297
5371
|
is_active: verticalAlign === "top",
|
|
5298
5372
|
onClick: () => onVerticalAlign?.("top"),
|
|
5299
|
-
tooltip:
|
|
5373
|
+
tooltip: t7("canvas_toolbar.align_top"),
|
|
5300
5374
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyStart, { className: "h-4 w-4" })
|
|
5301
5375
|
}
|
|
5302
5376
|
),
|
|
@@ -5305,7 +5379,7 @@ function CanvasTextToolbar({
|
|
|
5305
5379
|
{
|
|
5306
5380
|
is_active: verticalAlign === "middle",
|
|
5307
5381
|
onClick: () => onVerticalAlign?.("middle"),
|
|
5308
|
-
tooltip:
|
|
5382
|
+
tooltip: t7("canvas_toolbar.align_middle"),
|
|
5309
5383
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyCenter, { className: "h-4 w-4" })
|
|
5310
5384
|
}
|
|
5311
5385
|
),
|
|
@@ -5314,7 +5388,7 @@ function CanvasTextToolbar({
|
|
|
5314
5388
|
{
|
|
5315
5389
|
is_active: verticalAlign === "bottom",
|
|
5316
5390
|
onClick: () => onVerticalAlign?.("bottom"),
|
|
5317
|
-
tooltip:
|
|
5391
|
+
tooltip: t7("canvas_toolbar.align_bottom"),
|
|
5318
5392
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyEnd, { className: "h-4 w-4" })
|
|
5319
5393
|
}
|
|
5320
5394
|
),
|
|
@@ -5325,7 +5399,7 @@ function CanvasTextToolbar({
|
|
|
5325
5399
|
value: font,
|
|
5326
5400
|
onChange: (e) => onFont?.(e.target.value),
|
|
5327
5401
|
className: "h-8 text-xs rounded-md border border-border bg-background px-1 text-foreground focus:outline-none",
|
|
5328
|
-
title:
|
|
5402
|
+
title: t7("canvas_toolbar.font_family"),
|
|
5329
5403
|
children: [
|
|
5330
5404
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "sans-serif", children: "Sans" }),
|
|
5331
5405
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "serif", children: "Serif" }),
|
|
@@ -5337,12 +5411,12 @@ function CanvasTextToolbar({
|
|
|
5337
5411
|
}
|
|
5338
5412
|
),
|
|
5339
5413
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-1 h-6 w-px bg-border" }),
|
|
5340
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bullet, onClick: onBullet, tooltip:
|
|
5414
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bullet, onClick: onBullet, tooltip: t7("canvas_toolbar.bullet_list"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuList, { className: "h-4 w-4" }) })
|
|
5341
5415
|
]
|
|
5342
5416
|
}
|
|
5343
5417
|
) });
|
|
5344
5418
|
}
|
|
5345
|
-
var
|
|
5419
|
+
var t8 = i18n.createPackageT("hazo_ui", en_default);
|
|
5346
5420
|
var MdEditorLazy = React27.lazy(() => import('@uiw/react-md-editor'));
|
|
5347
5421
|
var EDITOR_TEXTAREA_SELECTOR = ".w-md-editor-text-input";
|
|
5348
5422
|
function MarkdownEditor({
|
|
@@ -5432,13 +5506,13 @@ function MarkdownEditor({
|
|
|
5432
5506
|
try {
|
|
5433
5507
|
const url = await onImageUpload(file);
|
|
5434
5508
|
if (!url) {
|
|
5435
|
-
setError(
|
|
5509
|
+
setError(t8("markdown.upload_failed"));
|
|
5436
5510
|
onChange(before + after);
|
|
5437
5511
|
return;
|
|
5438
5512
|
}
|
|
5439
5513
|
onChange(before + `` + after);
|
|
5440
5514
|
} catch {
|
|
5441
|
-
setError(
|
|
5515
|
+
setError(t8("markdown.upload_failed"));
|
|
5442
5516
|
onChange(before + after);
|
|
5443
5517
|
} finally {
|
|
5444
5518
|
setUploading(false);
|
|
@@ -5462,7 +5536,7 @@ function MarkdownEditor({
|
|
|
5462
5536
|
{
|
|
5463
5537
|
className: "flex items-center justify-center rounded-md border border-border bg-muted/30 text-sm text-muted-foreground",
|
|
5464
5538
|
style: { height },
|
|
5465
|
-
children:
|
|
5539
|
+
children: t8("markdown.loading_editor")
|
|
5466
5540
|
}
|
|
5467
5541
|
),
|
|
5468
5542
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5474,7 +5548,7 @@ function MarkdownEditor({
|
|
|
5474
5548
|
preview: effectivePreview,
|
|
5475
5549
|
visibleDragbar: false,
|
|
5476
5550
|
commands: editorCommands,
|
|
5477
|
-
textareaProps: { placeholder: placeholder ??
|
|
5551
|
+
textareaProps: { placeholder: placeholder ?? t8("markdown.placeholder"), onPaste: handlePaste }
|
|
5478
5552
|
}
|
|
5479
5553
|
)
|
|
5480
5554
|
}
|
|
@@ -5483,7 +5557,7 @@ function MarkdownEditor({
|
|
|
5483
5557
|
{
|
|
5484
5558
|
className: "flex items-center justify-center rounded-md border border-border bg-muted/30 text-sm text-muted-foreground",
|
|
5485
5559
|
style: { height },
|
|
5486
|
-
children:
|
|
5560
|
+
children: t8("markdown.loading_editor")
|
|
5487
5561
|
}
|
|
5488
5562
|
) }),
|
|
5489
5563
|
useCustomPreview && showPreview && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5497,7 +5571,7 @@ function MarkdownEditor({
|
|
|
5497
5571
|
]
|
|
5498
5572
|
}
|
|
5499
5573
|
),
|
|
5500
|
-
uploading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-muted-foreground", children:
|
|
5574
|
+
uploading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: t8("markdown.uploading_image") }),
|
|
5501
5575
|
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs text-destructive", children: error })
|
|
5502
5576
|
] });
|
|
5503
5577
|
}
|
|
@@ -6196,6 +6270,7 @@ var Text = core.Node.create({
|
|
|
6196
6270
|
renderMarkdown: (node) => node.text || ""
|
|
6197
6271
|
});
|
|
6198
6272
|
var index_default3 = Text;
|
|
6273
|
+
var t9 = i18n.createPackageT("hazo_ui", en_default);
|
|
6199
6274
|
var SingleLineDocument = index_default.extend({
|
|
6200
6275
|
content: "paragraph"
|
|
6201
6276
|
});
|
|
@@ -6233,7 +6308,7 @@ var HazoUiTextbox = ({
|
|
|
6233
6308
|
value,
|
|
6234
6309
|
default_value,
|
|
6235
6310
|
prefixes,
|
|
6236
|
-
placeholder
|
|
6311
|
+
placeholder,
|
|
6237
6312
|
disabled = false,
|
|
6238
6313
|
className,
|
|
6239
6314
|
pill_variant = "default",
|
|
@@ -6244,6 +6319,7 @@ var HazoUiTextbox = ({
|
|
|
6244
6319
|
on_command_change,
|
|
6245
6320
|
on_command_remove
|
|
6246
6321
|
}) => {
|
|
6322
|
+
const resolved_placeholder = placeholder ?? t9("textbox.placeholder");
|
|
6247
6323
|
const generated_instance_id = React27__namespace.useId();
|
|
6248
6324
|
const instance_id = provided_instance_id || generated_instance_id;
|
|
6249
6325
|
const [suggestion_state, set_suggestion_state] = React27__namespace.useState(null);
|
|
@@ -6276,7 +6352,7 @@ var HazoUiTextbox = ({
|
|
|
6276
6352
|
index_default2,
|
|
6277
6353
|
index_default3,
|
|
6278
6354
|
Placeholder__default.default.configure({
|
|
6279
|
-
placeholder
|
|
6355
|
+
placeholder: resolved_placeholder
|
|
6280
6356
|
}),
|
|
6281
6357
|
CommandNodeExtension.configure({}),
|
|
6282
6358
|
...suggestion_extensions
|
|
@@ -6655,7 +6731,7 @@ var HazoUiTextbox = ({
|
|
|
6655
6731
|
edit_selected_index === edit_commands.length && "bg-destructive/10"
|
|
6656
6732
|
),
|
|
6657
6733
|
onClick: handle_command_remove,
|
|
6658
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "
|
|
6734
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: t9("common.remove") })
|
|
6659
6735
|
}
|
|
6660
6736
|
)
|
|
6661
6737
|
] })
|
|
@@ -6733,6 +6809,7 @@ var HardBreak = core.Node.create({
|
|
|
6733
6809
|
}
|
|
6734
6810
|
});
|
|
6735
6811
|
var index_default4 = HardBreak;
|
|
6812
|
+
var t10 = i18n.createPackageT("hazo_ui", en_default);
|
|
6736
6813
|
var get_editor_output2 = (editor) => {
|
|
6737
6814
|
if (!editor) {
|
|
6738
6815
|
return { plain_text: "", display_text: "", commands: [] };
|
|
@@ -6787,7 +6864,7 @@ var HazoUiTextarea = ({
|
|
|
6787
6864
|
value,
|
|
6788
6865
|
default_value,
|
|
6789
6866
|
prefixes,
|
|
6790
|
-
placeholder
|
|
6867
|
+
placeholder,
|
|
6791
6868
|
disabled = false,
|
|
6792
6869
|
className,
|
|
6793
6870
|
pill_variant = "default",
|
|
@@ -6801,6 +6878,7 @@ var HazoUiTextarea = ({
|
|
|
6801
6878
|
on_command_change,
|
|
6802
6879
|
on_command_remove
|
|
6803
6880
|
}) => {
|
|
6881
|
+
const resolved_placeholder = placeholder ?? t10("textarea.placeholder");
|
|
6804
6882
|
const generated_instance_id = React27__namespace.useId();
|
|
6805
6883
|
const instance_id = provided_instance_id || generated_instance_id;
|
|
6806
6884
|
const [suggestion_state, set_suggestion_state] = React27__namespace.useState(null);
|
|
@@ -6835,7 +6913,7 @@ var HazoUiTextarea = ({
|
|
|
6835
6913
|
index_default3,
|
|
6836
6914
|
index_default4,
|
|
6837
6915
|
Placeholder__default.default.configure({
|
|
6838
|
-
placeholder
|
|
6916
|
+
placeholder: resolved_placeholder
|
|
6839
6917
|
}),
|
|
6840
6918
|
CommandNodeExtension.configure({}),
|
|
6841
6919
|
...suggestion_extensions
|
|
@@ -7225,7 +7303,7 @@ var HazoUiTextarea = ({
|
|
|
7225
7303
|
backgroundColor: edit_selected_index === edit_commands.length ? "rgba(239, 68, 68, 0.1)" : "inherit"
|
|
7226
7304
|
},
|
|
7227
7305
|
onClick: handle_command_remove,
|
|
7228
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "
|
|
7306
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: t10("common.remove") })
|
|
7229
7307
|
}
|
|
7230
7308
|
)
|
|
7231
7309
|
] })
|
|
@@ -7285,7 +7363,7 @@ function resolve_animation_classes(open_anim = "zoom", close_anim = "zoom") {
|
|
|
7285
7363
|
const close_classes = close_anim in ANIMATION_PRESETS ? ANIMATION_PRESETS[close_anim].close : close_anim;
|
|
7286
7364
|
return `${open_classes} ${close_classes}`;
|
|
7287
7365
|
}
|
|
7288
|
-
var
|
|
7366
|
+
var t11 = i18n.createPackageT("hazo_ui", en_default);
|
|
7289
7367
|
var VARIANT_PRESETS = {
|
|
7290
7368
|
info: {
|
|
7291
7369
|
header_background_color: "var(--dialog-info-bg)",
|
|
@@ -7379,11 +7457,11 @@ function HazoUiDialog({
|
|
|
7379
7457
|
const cancel_ref = React27__namespace.useRef(null);
|
|
7380
7458
|
const variant_preset = variant !== "default" ? VARIANT_PRESETS[variant] : is_status_kind || is_confirm_kind ? NEUTRAL_VARIANT_PRESET : void 0;
|
|
7381
7459
|
const resolved_action_button_variant = actionButtonVariant ?? variant_preset?.action_button_variant ?? "default";
|
|
7382
|
-
const resolved_title = title ??
|
|
7383
|
-
const resolved_cancel_text = cancelButtonText ??
|
|
7460
|
+
const resolved_title = title ?? t11("dialog.default_title");
|
|
7461
|
+
const resolved_cancel_text = cancelButtonText ?? t11("dialog.cancel");
|
|
7384
7462
|
const showCancelButton = showCancelButtonProp ?? (is_status_kind ? false : true);
|
|
7385
7463
|
const closeOnConfirm = closeOnConfirmProp ?? (is_status_kind || is_confirm_kind ? true : false);
|
|
7386
|
-
const actionButtonText = actionButtonTextProp ?? (is_status_kind ?
|
|
7464
|
+
const actionButtonText = actionButtonTextProp ?? (is_status_kind ? t11("dialog.ok") : is_confirm_kind ? showCancelButton ? t11("dialog.confirm") : t11("dialog.ok") : t11("dialog.confirm"));
|
|
7387
7465
|
const actionButtonLoading = actionButtonLoadingProp ?? (is_confirm_kind ? internal_confirm_loading : false);
|
|
7388
7466
|
const handleConfirm = () => {
|
|
7389
7467
|
if (is_confirm_kind) {
|
|
@@ -7710,7 +7788,7 @@ function HazoUiDialog({
|
|
|
7710
7788
|
style: headerBar ? { color: "var(--dialog-header-bar-fg)" } : finalHeaderTextColor ? { color: finalHeaderTextColor } : void 0,
|
|
7711
7789
|
children: [
|
|
7712
7790
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
|
|
7713
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children:
|
|
7791
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: t11("dialog.close") })
|
|
7714
7792
|
]
|
|
7715
7793
|
}
|
|
7716
7794
|
)
|
|
@@ -7719,7 +7797,7 @@ function HazoUiDialog({
|
|
|
7719
7797
|
)
|
|
7720
7798
|
] }) });
|
|
7721
7799
|
}
|
|
7722
|
-
var
|
|
7800
|
+
var t12 = i18n.createPackageT("hazo_ui", en_default);
|
|
7723
7801
|
function HazoUiConfirmDialog({
|
|
7724
7802
|
open,
|
|
7725
7803
|
onOpenChange,
|
|
@@ -7728,7 +7806,7 @@ function HazoUiConfirmDialog({
|
|
|
7728
7806
|
children,
|
|
7729
7807
|
variant = "default",
|
|
7730
7808
|
confirmLabel,
|
|
7731
|
-
cancelLabel =
|
|
7809
|
+
cancelLabel = t12("confirm.cancel"),
|
|
7732
7810
|
showCancelButton = true,
|
|
7733
7811
|
onConfirm,
|
|
7734
7812
|
onCancel,
|
|
@@ -7777,7 +7855,7 @@ var Slider = React27__namespace.forwardRef(({ className, ...props }, ref) => /*
|
|
|
7777
7855
|
}
|
|
7778
7856
|
));
|
|
7779
7857
|
Slider.displayName = SliderPrimitive__namespace.Root.displayName;
|
|
7780
|
-
var
|
|
7858
|
+
var t13 = i18n.createPackageT("hazo_ui", en_default);
|
|
7781
7859
|
async function getCroppedImg(imageSrc, areaPixels, outputSize, quality) {
|
|
7782
7860
|
const img = await new Promise((resolve, reject) => {
|
|
7783
7861
|
const image = new Image();
|
|
@@ -7831,7 +7909,7 @@ var HazoUiImageCropper = React27__namespace.forwardRef(function HazoUiImageCropp
|
|
|
7831
7909
|
y: 0
|
|
7832
7910
|
});
|
|
7833
7911
|
const [zoom, set_zoom] = React27__namespace.useState(1);
|
|
7834
|
-
const resolved_zoom_label = zoomLabel ??
|
|
7912
|
+
const resolved_zoom_label = zoomLabel ?? t13("cropper.zoom");
|
|
7835
7913
|
const cropped_area_pixels_ref = React27__namespace.useRef(null);
|
|
7836
7914
|
const handle_crop_complete = React27__namespace.useCallback(
|
|
7837
7915
|
(_croppedArea, croppedAreaPixels) => {
|
|
@@ -7906,7 +7984,7 @@ var HazoUiImageCropper = React27__namespace.forwardRef(function HazoUiImageCropp
|
|
|
7906
7984
|
] });
|
|
7907
7985
|
});
|
|
7908
7986
|
HazoUiImageCropper.displayName = "HazoUiImageCropper";
|
|
7909
|
-
var
|
|
7987
|
+
var t14 = i18n.createPackageT("hazo_ui", en_default);
|
|
7910
7988
|
function HazoUiImageCropperDialog({
|
|
7911
7989
|
open,
|
|
7912
7990
|
onOpenChange,
|
|
@@ -7920,10 +7998,10 @@ function HazoUiImageCropperDialog({
|
|
|
7920
7998
|
outputSize = 512,
|
|
7921
7999
|
quality = 0.9
|
|
7922
8000
|
}) {
|
|
7923
|
-
const resolved_title = title ??
|
|
7924
|
-
const resolved_confirm_label = confirmLabel ??
|
|
7925
|
-
const resolved_cancel_label = cancelLabel ??
|
|
7926
|
-
const resolved_zoom_label = zoomLabel ??
|
|
8001
|
+
const resolved_title = title ?? t14("cropper.title");
|
|
8002
|
+
const resolved_confirm_label = confirmLabel ?? t14("cropper.save");
|
|
8003
|
+
const resolved_cancel_label = cancelLabel ?? t14("cropper.cancel");
|
|
8004
|
+
const resolved_zoom_label = zoomLabel ?? t14("cropper.zoom");
|
|
7927
8005
|
const cropper_ref = React27__namespace.useRef(null);
|
|
7928
8006
|
const [image_src, set_image_src] = React27__namespace.useState(null);
|
|
7929
8007
|
const [is_confirming, set_is_confirming] = React27__namespace.useState(false);
|
|
@@ -8409,6 +8487,7 @@ var CardFooter = React27__namespace.forwardRef(
|
|
|
8409
8487
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center p-6 pt-0", className), ...props })
|
|
8410
8488
|
);
|
|
8411
8489
|
CardFooter.displayName = "CardFooter";
|
|
8490
|
+
var t15 = i18n.createPackageT("hazo_ui", en_default);
|
|
8412
8491
|
function Spinner({ className, size = "md" }) {
|
|
8413
8492
|
const sizeClasses = { sm: "h-4 w-4", md: "h-8 w-8", lg: "h-12 w-12" };
|
|
8414
8493
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8416,8 +8495,8 @@ function Spinner({ className, size = "md" }) {
|
|
|
8416
8495
|
{
|
|
8417
8496
|
className: cn("animate-spin rounded-full border-2 border-current border-t-transparent text-primary", sizeClasses[size], className),
|
|
8418
8497
|
role: "status",
|
|
8419
|
-
"aria-label": "
|
|
8420
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "
|
|
8498
|
+
"aria-label": t15("spinner.loading"),
|
|
8499
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: t15("spinner.loading_text") })
|
|
8421
8500
|
}
|
|
8422
8501
|
);
|
|
8423
8502
|
}
|
|
@@ -8553,6 +8632,7 @@ var InputAffix = React27__namespace.forwardRef(
|
|
|
8553
8632
|
}
|
|
8554
8633
|
);
|
|
8555
8634
|
InputAffix.displayName = "InputAffix";
|
|
8635
|
+
var t16 = i18n.createPackageT("hazo_ui", en_default);
|
|
8556
8636
|
var SkeletonBase = React27__namespace.forwardRef(
|
|
8557
8637
|
({ className, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8558
8638
|
"div",
|
|
@@ -8594,18 +8674,19 @@ function SkeletonRect({ width = "100%", height = 96, radius = 6, className }) {
|
|
|
8594
8674
|
}
|
|
8595
8675
|
);
|
|
8596
8676
|
}
|
|
8597
|
-
function SkeletonGroup({ label
|
|
8677
|
+
function SkeletonGroup({ label, children, className, ...rest }) {
|
|
8678
|
+
const resolved_label = label ?? t16("skeleton.loading_content");
|
|
8598
8679
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8599
8680
|
"div",
|
|
8600
8681
|
{
|
|
8601
8682
|
role: "status",
|
|
8602
8683
|
"aria-busy": "true",
|
|
8603
|
-
"aria-label":
|
|
8684
|
+
"aria-label": resolved_label,
|
|
8604
8685
|
className: cn("space-y-2", className),
|
|
8605
8686
|
...rest,
|
|
8606
8687
|
children: [
|
|
8607
8688
|
children,
|
|
8608
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children:
|
|
8689
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: resolved_label })
|
|
8609
8690
|
]
|
|
8610
8691
|
}
|
|
8611
8692
|
);
|
|
@@ -8640,7 +8721,7 @@ function EmptyState({
|
|
|
8640
8721
|
}
|
|
8641
8722
|
);
|
|
8642
8723
|
}
|
|
8643
|
-
var
|
|
8724
|
+
var t17 = i18n.createPackageT("hazo_ui", en_default);
|
|
8644
8725
|
function ErrorBanner({
|
|
8645
8726
|
severity = "error",
|
|
8646
8727
|
title,
|
|
@@ -8675,7 +8756,7 @@ function ErrorBanner({
|
|
|
8675
8756
|
{
|
|
8676
8757
|
type: "button",
|
|
8677
8758
|
onClick: onDismiss,
|
|
8678
|
-
"aria-label":
|
|
8759
|
+
"aria-label": t17("error.dismiss"),
|
|
8679
8760
|
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",
|
|
8680
8761
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
8681
8762
|
}
|
|
@@ -8684,9 +8765,9 @@ function ErrorBanner({
|
|
|
8684
8765
|
}
|
|
8685
8766
|
);
|
|
8686
8767
|
}
|
|
8687
|
-
var
|
|
8768
|
+
var t18 = i18n.createPackageT("hazo_ui", en_default);
|
|
8688
8769
|
function ErrorPage({
|
|
8689
|
-
title
|
|
8770
|
+
title,
|
|
8690
8771
|
description,
|
|
8691
8772
|
errorCode,
|
|
8692
8773
|
correlationId,
|
|
@@ -8694,6 +8775,7 @@ function ErrorPage({
|
|
|
8694
8775
|
illustration,
|
|
8695
8776
|
className
|
|
8696
8777
|
}) {
|
|
8778
|
+
const resolved_title = title ?? t18("error.something_went_wrong");
|
|
8697
8779
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8698
8780
|
"div",
|
|
8699
8781
|
{
|
|
@@ -8706,10 +8788,10 @@ function ErrorPage({
|
|
|
8706
8788
|
children: [
|
|
8707
8789
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-destructive", children: illustration ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.OctagonAlert, { className: "h-16 w-16", "aria-hidden": "true" }) }),
|
|
8708
8790
|
errorCode ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-full bg-muted px-3 py-1 text-xs font-mono uppercase tracking-wider text-muted-foreground", children: errorCode }) : null,
|
|
8709
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-semibold text-foreground", children:
|
|
8791
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-semibold text-foreground", children: resolved_title }),
|
|
8710
8792
|
description ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children: description }) : null,
|
|
8711
8793
|
correlationId ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full rounded-md border bg-muted/40 px-3 py-2 text-left", children: [
|
|
8712
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] uppercase tracking-wider text-muted-foreground", children: "
|
|
8794
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] uppercase tracking-wider text-muted-foreground", children: t18("error.correlation_id") }),
|
|
8713
8795
|
/* @__PURE__ */ jsxRuntime.jsx("code", { className: "break-all text-xs", children: correlationId })
|
|
8714
8796
|
] }) : null,
|
|
8715
8797
|
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex flex-wrap items-center justify-center gap-2", children: actions }) : null
|
|
@@ -8717,16 +8799,17 @@ function ErrorPage({
|
|
|
8717
8799
|
}
|
|
8718
8800
|
);
|
|
8719
8801
|
}
|
|
8720
|
-
var
|
|
8802
|
+
var t19 = i18n.createPackageT("hazo_ui", en_default);
|
|
8721
8803
|
function LoadingTimeout({
|
|
8722
8804
|
active,
|
|
8723
8805
|
children,
|
|
8724
8806
|
skeleton,
|
|
8725
8807
|
onRetry,
|
|
8726
8808
|
thresholds,
|
|
8727
|
-
label
|
|
8809
|
+
label,
|
|
8728
8810
|
className
|
|
8729
8811
|
}) {
|
|
8812
|
+
const resolved_label = label ?? t19("loading.default_label");
|
|
8730
8813
|
const timeouts = {
|
|
8731
8814
|
gentle: thresholds?.gentle ?? 5e3,
|
|
8732
8815
|
firm: thresholds?.firm ?? 15e3,
|
|
@@ -8756,15 +8839,15 @@ function LoadingTimeout({
|
|
|
8756
8839
|
ErrorBanner,
|
|
8757
8840
|
{
|
|
8758
8841
|
severity: "error",
|
|
8759
|
-
title:
|
|
8760
|
-
message:
|
|
8842
|
+
title: t19("loading.taking_longer"),
|
|
8843
|
+
message: t19("loading.still_loading", { label: resolved_label }),
|
|
8761
8844
|
action: onRetry ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8762
8845
|
"button",
|
|
8763
8846
|
{
|
|
8764
8847
|
type: "button",
|
|
8765
8848
|
onClick: onRetry,
|
|
8766
8849
|
className: "rounded bg-foreground/10 px-3 py-1.5 text-sm font-medium hover:bg-foreground/15",
|
|
8767
|
-
children: "
|
|
8850
|
+
children: t19("loading.try_again")
|
|
8768
8851
|
}
|
|
8769
8852
|
) : null
|
|
8770
8853
|
}
|
|
@@ -8772,12 +8855,8 @@ function LoadingTimeout({
|
|
|
8772
8855
|
}
|
|
8773
8856
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, role: "status", "aria-busy": "true", "aria-live": "polite", children: [
|
|
8774
8857
|
skeleton,
|
|
8775
|
-
phase === "gentle" ? /* @__PURE__ */ jsxRuntime.
|
|
8776
|
-
|
|
8777
|
-
label,
|
|
8778
|
-
"\u2026"
|
|
8779
|
-
] }) : null,
|
|
8780
|
-
phase === "firm" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children: "Still working on it \u2014 almost there." }) : null
|
|
8858
|
+
phase === "gentle" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children: t19("loading.gentle_message", { label: resolved_label }) }) : null,
|
|
8859
|
+
phase === "firm" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 text-center text-sm text-muted-foreground", children: t19("loading.firm_message") }) : null
|
|
8781
8860
|
] });
|
|
8782
8861
|
}
|
|
8783
8862
|
function ProgressiveImage({
|
|
@@ -8858,7 +8937,7 @@ function NotificationCountBadge({
|
|
|
8858
8937
|
}
|
|
8859
8938
|
);
|
|
8860
8939
|
}
|
|
8861
|
-
var
|
|
8940
|
+
var t20 = i18n.createPackageT("hazo_ui", en_default);
|
|
8862
8941
|
function NotificationItem({
|
|
8863
8942
|
isRead,
|
|
8864
8943
|
timestamp,
|
|
@@ -8889,7 +8968,7 @@ function NotificationItem({
|
|
|
8889
8968
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_notification_item_dot_col flex-shrink-0 pt-1.5", children: !isRead ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8890
8969
|
"span",
|
|
8891
8970
|
{
|
|
8892
|
-
"aria-label":
|
|
8971
|
+
"aria-label": t20("notification.unread"),
|
|
8893
8972
|
className: "cls_notification_item_dot block w-2 h-2 rounded-full bg-primary"
|
|
8894
8973
|
}
|
|
8895
8974
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block w-2 h-2", "aria-hidden": "true" }) }),
|
|
@@ -8913,13 +8992,13 @@ function NotificationItem({
|
|
|
8913
8992
|
}
|
|
8914
8993
|
);
|
|
8915
8994
|
}
|
|
8916
|
-
var
|
|
8995
|
+
var t21 = i18n.createPackageT("hazo_ui", en_default);
|
|
8917
8996
|
function LoadingSkeletons() {
|
|
8918
8997
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8919
8998
|
"div",
|
|
8920
8999
|
{
|
|
8921
9000
|
"aria-busy": "true",
|
|
8922
|
-
"aria-label":
|
|
9001
|
+
"aria-label": t21("notification.loading"),
|
|
8923
9002
|
className: "cls_notification_panel_loading space-y-0",
|
|
8924
9003
|
children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8925
9004
|
"div",
|
|
@@ -8978,7 +9057,7 @@ function NotificationPanel({
|
|
|
8978
9057
|
}
|
|
8979
9058
|
);
|
|
8980
9059
|
}
|
|
8981
|
-
var
|
|
9060
|
+
var t22 = i18n.createPackageT("hazo_ui", en_default);
|
|
8982
9061
|
function HazoUiToaster({
|
|
8983
9062
|
position = "bottom-right",
|
|
8984
9063
|
closeButton = true,
|
|
@@ -9024,12 +9103,14 @@ function permissionToast({
|
|
|
9024
9103
|
action,
|
|
9025
9104
|
duration = 5e3
|
|
9026
9105
|
}) {
|
|
9027
|
-
const description = missingPermissions.length === 0 ?
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
9106
|
+
const description = missingPermissions.length === 0 ? t22("toast.permission_denied_message") : t22("toast.missing_prefix", {
|
|
9107
|
+
items: missingPermissions.map((key) => {
|
|
9108
|
+
const label = descriptions?.[key];
|
|
9109
|
+
return label ? `\`${key}\` \u2014 ${label}` : `\`${key}\``;
|
|
9110
|
+
}).join("; ")
|
|
9111
|
+
});
|
|
9031
9112
|
return errorToast({
|
|
9032
|
-
title:
|
|
9113
|
+
title: t22("toast.permission_required"),
|
|
9033
9114
|
description,
|
|
9034
9115
|
action,
|
|
9035
9116
|
duration
|
|
@@ -9287,6 +9368,7 @@ function use_fullscreen() {
|
|
|
9287
9368
|
const { isFullscreen, toggle } = useFullscreen(ref);
|
|
9288
9369
|
return { is_fullscreen: isFullscreen, toggle, ref };
|
|
9289
9370
|
}
|
|
9371
|
+
var t23 = i18n.createPackageT("hazo_ui", en_default);
|
|
9290
9372
|
function KanbanCard({
|
|
9291
9373
|
item,
|
|
9292
9374
|
renderCard,
|
|
@@ -9348,7 +9430,7 @@ function KanbanCard({
|
|
|
9348
9430
|
...listeners,
|
|
9349
9431
|
role: "button",
|
|
9350
9432
|
tabIndex: 0,
|
|
9351
|
-
"aria-roledescription": "
|
|
9433
|
+
"aria-roledescription": t23("kanban.draggable_card"),
|
|
9352
9434
|
"aria-grabbed": isDragging,
|
|
9353
9435
|
onDoubleClick: () => {
|
|
9354
9436
|
if (showEdit && onEditRequest && !dragging) onEditRequest(item);
|
|
@@ -9673,7 +9755,7 @@ function KanbanLaneStrip({
|
|
|
9673
9755
|
}
|
|
9674
9756
|
);
|
|
9675
9757
|
}
|
|
9676
|
-
var
|
|
9758
|
+
var t24 = i18n.createPackageT("hazo_ui", en_default);
|
|
9677
9759
|
var DEFAULT_PRIORITIES = ["P0", "P1", "P2", "P3"];
|
|
9678
9760
|
function humanize(key) {
|
|
9679
9761
|
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(" ");
|
|
@@ -9688,7 +9770,7 @@ function auto_detect_fields(item, columns) {
|
|
|
9688
9770
|
}
|
|
9689
9771
|
}
|
|
9690
9772
|
if (columns.length > 0) {
|
|
9691
|
-
out.push({ key: "columnKey", type: "status", label:
|
|
9773
|
+
out.push({ key: "columnKey", type: "status", label: t24("kanban.status_label") });
|
|
9692
9774
|
}
|
|
9693
9775
|
return out;
|
|
9694
9776
|
}
|
|
@@ -9785,7 +9867,7 @@ function KanbanEditor({
|
|
|
9785
9867
|
isDirty: is_dirty
|
|
9786
9868
|
};
|
|
9787
9869
|
const open = item !== null;
|
|
9788
|
-
const title = item && titleFn ? titleFn(item) : item ?
|
|
9870
|
+
const title = item && titleFn ? titleFn(item) : item ? t24("kanban.edit_fallback", { id: item.id }) : "";
|
|
9789
9871
|
const priority_var = item?.priority ? `--hazo-kanban-priority-${String(item.priority).toLowerCase()}` : null;
|
|
9790
9872
|
const header_bar_color = priority_var ? `hsl(var(${priority_var}))` : void 0;
|
|
9791
9873
|
const use_default_footer = !(renderBody && hideFooter);
|
|
@@ -9797,18 +9879,18 @@ function KanbanEditor({
|
|
|
9797
9879
|
if (!o && !saving) onClose();
|
|
9798
9880
|
},
|
|
9799
9881
|
title,
|
|
9800
|
-
description:
|
|
9882
|
+
description: t24("kanban.update_description"),
|
|
9801
9883
|
sizeWidth: "min(90vw, 480px)",
|
|
9802
9884
|
openAnimation: "none",
|
|
9803
9885
|
closeAnimation: "none",
|
|
9804
9886
|
headerBar: !!priority_var,
|
|
9805
9887
|
headerBarColor: header_bar_color,
|
|
9806
9888
|
contentClassName: cn("cls_hazo_kanban_editor", priority_var && "pt-0"),
|
|
9807
|
-
actionButtonText: saving ?
|
|
9889
|
+
actionButtonText: saving ? t24("kanban.saving") : t24("kanban.save"),
|
|
9808
9890
|
actionButtonIcon: saving ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4 mr-2" }),
|
|
9809
9891
|
actionButtonLoading: saving,
|
|
9810
9892
|
actionButtonDisabled: !is_dirty || !all_required_filled || saving,
|
|
9811
|
-
cancelButtonText:
|
|
9893
|
+
cancelButtonText: t24("kanban.cancel"),
|
|
9812
9894
|
showCancelButton: true,
|
|
9813
9895
|
onConfirm: handle_save,
|
|
9814
9896
|
onCancel: onClose,
|
|
@@ -9913,7 +9995,7 @@ function KanbanEditorFieldRow({
|
|
|
9913
9995
|
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9914
9996
|
SelectValue,
|
|
9915
9997
|
{
|
|
9916
|
-
placeholder: field.placeholder ??
|
|
9998
|
+
placeholder: field.placeholder ?? t24("kanban.select_placeholder", { label })
|
|
9917
9999
|
}
|
|
9918
10000
|
) }),
|
|
9919
10001
|
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: (field.options ?? []).map((opt) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: opt, children: opt }, opt)) })
|
|
@@ -9929,7 +10011,7 @@ function KanbanEditorFieldRow({
|
|
|
9929
10011
|
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9930
10012
|
SelectValue,
|
|
9931
10013
|
{
|
|
9932
|
-
placeholder: field.placeholder ??
|
|
10014
|
+
placeholder: field.placeholder ?? t24("kanban.select_priority")
|
|
9933
10015
|
}
|
|
9934
10016
|
) }),
|
|
9935
10017
|
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: priorities.map((p) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: p, children: p }, p)) })
|
|
@@ -9945,7 +10027,7 @@ function KanbanEditorFieldRow({
|
|
|
9945
10027
|
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9946
10028
|
SelectValue,
|
|
9947
10029
|
{
|
|
9948
|
-
placeholder: field.placeholder ??
|
|
10030
|
+
placeholder: field.placeholder ?? t24("kanban.select_status")
|
|
9949
10031
|
}
|
|
9950
10032
|
) }),
|
|
9951
10033
|
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: col.key, children: col.title }, col.key)) })
|
|
@@ -9954,6 +10036,7 @@ function KanbanEditorFieldRow({
|
|
|
9954
10036
|
)
|
|
9955
10037
|
] });
|
|
9956
10038
|
}
|
|
10039
|
+
var t25 = i18n.createPackageT("hazo_ui", en_default);
|
|
9957
10040
|
var EMPTY_FILTER = {
|
|
9958
10041
|
search: "",
|
|
9959
10042
|
categories: [],
|
|
@@ -9961,7 +10044,7 @@ var EMPTY_FILTER = {
|
|
|
9961
10044
|
};
|
|
9962
10045
|
function HazoUiKanbanFilter({
|
|
9963
10046
|
search = true,
|
|
9964
|
-
searchPlaceholder
|
|
10047
|
+
searchPlaceholder,
|
|
9965
10048
|
categories,
|
|
9966
10049
|
priorities,
|
|
9967
10050
|
value,
|
|
@@ -9969,6 +10052,7 @@ function HazoUiKanbanFilter({
|
|
|
9969
10052
|
onChange,
|
|
9970
10053
|
className
|
|
9971
10054
|
}) {
|
|
10055
|
+
const resolved_search_placeholder = searchPlaceholder ?? t25("common.search");
|
|
9972
10056
|
const is_controlled = value !== void 0;
|
|
9973
10057
|
const [internal, set_internal] = React27__namespace.useState(
|
|
9974
10058
|
defaultValue ?? EMPTY_FILTER
|
|
@@ -9995,7 +10079,7 @@ function HazoUiKanbanFilter({
|
|
|
9995
10079
|
{
|
|
9996
10080
|
value: current.search,
|
|
9997
10081
|
onChange: (e) => update({ ...current, search: e.target.value }),
|
|
9998
|
-
placeholder:
|
|
10082
|
+
placeholder: resolved_search_placeholder,
|
|
9999
10083
|
className: "cls_hazo_kanban_filter_search w-full sm:w-64"
|
|
10000
10084
|
}
|
|
10001
10085
|
),
|
|
@@ -10080,16 +10164,25 @@ function applyKanbanFilter(items, filter) {
|
|
|
10080
10164
|
return true;
|
|
10081
10165
|
});
|
|
10082
10166
|
}
|
|
10167
|
+
var t26 = i18n.createPackageT("hazo_ui", en_default);
|
|
10083
10168
|
var UNMATCHED_LANE_KEY = "__hazo_lane_unmatched__";
|
|
10084
10169
|
function bucket_key(lane_key, column_key) {
|
|
10085
10170
|
return lane_key == null ? column_key : `${lane_key}\0${column_key}`;
|
|
10086
10171
|
}
|
|
10087
10172
|
function default_announcements(itemLabel) {
|
|
10088
10173
|
return {
|
|
10089
|
-
onDragStart: ({ item, fromColumn }) =>
|
|
10090
|
-
onDragOver: ({ item, overColumn }) => overColumn ?
|
|
10091
|
-
onDragEnd: ({ item, fromColumn, toColumn, newIndex }) => fromColumn === toColumn ?
|
|
10092
|
-
|
|
10174
|
+
onDragStart: ({ item, fromColumn }) => t26("kanban.dnd_pickup", { item: itemLabel(item), column: fromColumn }),
|
|
10175
|
+
onDragOver: ({ item, overColumn }) => overColumn ? t26("kanban.dnd_over", { item: itemLabel(item), column: overColumn }) : "",
|
|
10176
|
+
onDragEnd: ({ item, fromColumn, toColumn, newIndex }) => fromColumn === toColumn ? t26("kanban.dnd_reorder", {
|
|
10177
|
+
item: itemLabel(item),
|
|
10178
|
+
pos: newIndex + 1,
|
|
10179
|
+
column: toColumn
|
|
10180
|
+
}) : t26("kanban.dnd_drop", {
|
|
10181
|
+
item: itemLabel(item),
|
|
10182
|
+
column: toColumn,
|
|
10183
|
+
pos: newIndex + 1
|
|
10184
|
+
}),
|
|
10185
|
+
onDragCancel: ({ item, fromColumn }) => t26("kanban.dnd_cancel", { item: itemLabel(item), column: fromColumn })
|
|
10093
10186
|
};
|
|
10094
10187
|
}
|
|
10095
10188
|
function group_items_by_column(items, overlay, columns, lanes) {
|
|
@@ -10893,7 +10986,7 @@ function serializeFilter(filter) {
|
|
|
10893
10986
|
const fields = (filter.fields ?? []).map((f) => `${f.field}:${f.operator ?? ""}:${String(f.value)}`).join(",");
|
|
10894
10987
|
return `${filter.search ?? ""}|${fields}`;
|
|
10895
10988
|
}
|
|
10896
|
-
var
|
|
10989
|
+
var t27 = i18n.createPackageT("hazo_ui", en_default);
|
|
10897
10990
|
function HazoUiTable(props) {
|
|
10898
10991
|
const state = useTableState(props);
|
|
10899
10992
|
const { columns, rows, getRowKey, className, caption } = props;
|
|
@@ -10928,12 +11021,12 @@ function HazoUiTable(props) {
|
|
|
10928
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(
|
|
10929
11022
|
EmptyState,
|
|
10930
11023
|
{
|
|
10931
|
-
title: typeof props.empty === "string" && props.empty ||
|
|
11024
|
+
title: typeof props.empty === "string" && props.empty || t27("table.empty")
|
|
10932
11025
|
}
|
|
10933
11026
|
) : props.empty : typeof props.noResults === "string" || props.noResults === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10934
11027
|
EmptyState,
|
|
10935
11028
|
{
|
|
10936
|
-
title: typeof props.noResults === "string" && props.noResults ||
|
|
11029
|
+
title: typeof props.noResults === "string" && props.noResults || t27("table.no_results")
|
|
10937
11030
|
}
|
|
10938
11031
|
) : props.noResults }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
10939
11032
|
TableMobileCards,
|
|
@@ -10956,7 +11049,7 @@ function HazoUiTable(props) {
|
|
|
10956
11049
|
{
|
|
10957
11050
|
type: "button",
|
|
10958
11051
|
onClick: (e) => state.cycleHeaderSort(c.key, e.shiftKey),
|
|
10959
|
-
title:
|
|
11052
|
+
title: t27("table.sort_tooltip"),
|
|
10960
11053
|
className: "cls_hazo_ui_table_sort_btn inline-flex items-center gap-1 hover:text-foreground",
|
|
10961
11054
|
children: [
|
|
10962
11055
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: c.label }),
|
|
@@ -10988,12 +11081,12 @@ function HazoUiTable(props) {
|
|
|
10988
11081
|
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(
|
|
10989
11082
|
EmptyState,
|
|
10990
11083
|
{
|
|
10991
|
-
title: typeof props.empty === "string" && props.empty ||
|
|
11084
|
+
title: typeof props.empty === "string" && props.empty || t27("table.empty")
|
|
10992
11085
|
}
|
|
10993
11086
|
) : 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(
|
|
10994
11087
|
EmptyState,
|
|
10995
11088
|
{
|
|
10996
|
-
title: typeof props.noResults === "string" && props.noResults ||
|
|
11089
|
+
title: typeof props.noResults === "string" && props.noResults || t27("table.no_results")
|
|
10997
11090
|
}
|
|
10998
11091
|
) : props.noResults })
|
|
10999
11092
|
}
|
|
@@ -11107,7 +11200,7 @@ function PaginationFooter({
|
|
|
11107
11200
|
const end = Math.min((page + 1) * pageSize, total);
|
|
11108
11201
|
const lastPage = Math.max(0, Math.ceil(total / pageSize) - 1);
|
|
11109
11202
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_hazo_ui_table_pagination flex items-center justify-between gap-3 pt-2 text-sm", children: [
|
|
11110
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_hazo_ui_table_page_counter text-muted-foreground", children:
|
|
11203
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_hazo_ui_table_page_counter text-muted-foreground", children: t27("table.showing", {
|
|
11111
11204
|
start: String(start),
|
|
11112
11205
|
end: String(end),
|
|
11113
11206
|
total: String(total)
|
|
@@ -11120,8 +11213,8 @@ function PaginationFooter({
|
|
|
11120
11213
|
size: "sm",
|
|
11121
11214
|
onClick: () => onPageChange(Math.max(0, page - 1)),
|
|
11122
11215
|
disabled: page === 0,
|
|
11123
|
-
"aria-label":
|
|
11124
|
-
children:
|
|
11216
|
+
"aria-label": t27("table.prev_aria"),
|
|
11217
|
+
children: t27("table.prev")
|
|
11125
11218
|
}
|
|
11126
11219
|
),
|
|
11127
11220
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11131,8 +11224,8 @@ function PaginationFooter({
|
|
|
11131
11224
|
size: "sm",
|
|
11132
11225
|
onClick: () => onPageChange(Math.min(lastPage, page + 1)),
|
|
11133
11226
|
disabled: page >= lastPage,
|
|
11134
|
-
"aria-label":
|
|
11135
|
-
children:
|
|
11227
|
+
"aria-label": t27("table.next_aria"),
|
|
11228
|
+
children: t27("table.next")
|
|
11136
11229
|
}
|
|
11137
11230
|
)
|
|
11138
11231
|
] })
|
|
@@ -11176,7 +11269,7 @@ function Toolbar2(props) {
|
|
|
11176
11269
|
setSearchValue(v);
|
|
11177
11270
|
onSearchChange(v);
|
|
11178
11271
|
},
|
|
11179
|
-
placeholder: searchPlaceholder ??
|
|
11272
|
+
placeholder: searchPlaceholder ?? t27("table.search_placeholder"),
|
|
11180
11273
|
className: "cls_hazo_ui_table_search w-full sm:max-w-xs"
|
|
11181
11274
|
}
|
|
11182
11275
|
) : /* @__PURE__ */ jsxRuntime.jsx("div", {}),
|
|
@@ -11224,8 +11317,8 @@ function renderErrorState(error, serverError) {
|
|
|
11224
11317
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11225
11318
|
EmptyState,
|
|
11226
11319
|
{
|
|
11227
|
-
title:
|
|
11228
|
-
description: msg ||
|
|
11320
|
+
title: t27("table.error_title"),
|
|
11321
|
+
description: msg || t27("table.error_description")
|
|
11229
11322
|
}
|
|
11230
11323
|
);
|
|
11231
11324
|
}
|
|
@@ -11461,7 +11554,7 @@ function StackedBars({
|
|
|
11461
11554
|
}
|
|
11462
11555
|
);
|
|
11463
11556
|
}
|
|
11464
|
-
var
|
|
11557
|
+
var t28 = i18n.createPackageT("hazo_ui", en_default);
|
|
11465
11558
|
function DateRangeSelector({
|
|
11466
11559
|
value,
|
|
11467
11560
|
onChange,
|
|
@@ -11469,7 +11562,7 @@ function DateRangeSelector({
|
|
|
11469
11562
|
className,
|
|
11470
11563
|
ariaLabel
|
|
11471
11564
|
}) {
|
|
11472
|
-
const resolved_aria = ariaLabel ??
|
|
11565
|
+
const resolved_aria = ariaLabel ?? t28("charts.date_range");
|
|
11473
11566
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11474
11567
|
"div",
|
|
11475
11568
|
{
|
|
@@ -11501,6 +11594,7 @@ function DateRangeSelector({
|
|
|
11501
11594
|
}
|
|
11502
11595
|
);
|
|
11503
11596
|
}
|
|
11597
|
+
var t29 = i18n.createPackageT("hazo_ui", en_default);
|
|
11504
11598
|
var PAD_LEFT2 = 80;
|
|
11505
11599
|
var PAD_RIGHT2 = 72;
|
|
11506
11600
|
var PAD_TOP2 = 12;
|
|
@@ -11651,12 +11745,12 @@ function FunnelChart({
|
|
|
11651
11745
|
const bubble_anchor_y = bar_y + BAR_H / 2;
|
|
11652
11746
|
const lines = [
|
|
11653
11747
|
{ text: step.label, accent: true },
|
|
11654
|
-
{ text:
|
|
11655
|
-
{ text:
|
|
11748
|
+
{ text: t29("charts.total", { value: fmt(total) }), accent: false },
|
|
11749
|
+
{ text: t29("charts.pct_of_first", { pct: pct_first }), accent: false }
|
|
11656
11750
|
];
|
|
11657
11751
|
if (i > 0) {
|
|
11658
|
-
lines.push({ text:
|
|
11659
|
-
lines.push({ text:
|
|
11752
|
+
lines.push({ text: t29("charts.pct_of_prev", { pct: pct_prev }), accent: false });
|
|
11753
|
+
lines.push({ text: t29("charts.dropoff", { value: fmt(dropoff) }), accent: false });
|
|
11660
11754
|
}
|
|
11661
11755
|
if (step.segments) {
|
|
11662
11756
|
step.segments.forEach((seg) => {
|
|
@@ -11717,7 +11811,7 @@ function FunnelChart({
|
|
|
11717
11811
|
|
|
11718
11812
|
// src/assets/celebration-chime.mp3
|
|
11719
11813
|
var celebration_chime_default = "data:text/plain;charset=utf-8,";
|
|
11720
|
-
var
|
|
11814
|
+
var t30 = i18n.createPackageT("hazo_ui", en_default);
|
|
11721
11815
|
var CELEBRATION_GRADIENT = "linear-gradient(135deg, #667eea 0%, #764ba2 100%)";
|
|
11722
11816
|
var CARD_SIZE = 1080;
|
|
11723
11817
|
var PREVIEW_SIZE = 400;
|
|
@@ -11915,7 +12009,7 @@ function CelebrationModalInner({
|
|
|
11915
12009
|
{
|
|
11916
12010
|
className: "cls_celebration_close_btn absolute top-3 right-3 z-10 p-1.5 rounded-full hover:bg-black/10 transition-colors",
|
|
11917
12011
|
onClick: close_modal,
|
|
11918
|
-
"aria-label":
|
|
12012
|
+
"aria-label": t30("celebration.close"),
|
|
11919
12013
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4 text-gray-600" })
|
|
11920
12014
|
}
|
|
11921
12015
|
),
|
|
@@ -11978,21 +12072,21 @@ function CelebrationModalInner({
|
|
|
11978
12072
|
disabled: is_downloading,
|
|
11979
12073
|
children: [
|
|
11980
12074
|
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" }),
|
|
11981
|
-
|
|
12075
|
+
t30("celebration.download_png")
|
|
11982
12076
|
]
|
|
11983
12077
|
}
|
|
11984
12078
|
),
|
|
11985
12079
|
can_share && /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: handle_share, children: [
|
|
11986
12080
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Share2, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
11987
|
-
|
|
12081
|
+
t30("celebration.share")
|
|
11988
12082
|
] }),
|
|
11989
12083
|
/* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: handle_copy, children: [
|
|
11990
12084
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
11991
|
-
|
|
12085
|
+
t30("celebration.copy_image")
|
|
11992
12086
|
] })
|
|
11993
12087
|
] })
|
|
11994
12088
|
] }),
|
|
11995
|
-
!shareableCard && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_celebration_footer pb-8", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: close_modal, children:
|
|
12089
|
+
!shareableCard && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_celebration_footer pb-8", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: close_modal, children: t30("celebration.dismiss") }) })
|
|
11996
12090
|
]
|
|
11997
12091
|
}
|
|
11998
12092
|
)
|
|
@@ -12014,8 +12108,8 @@ function computeEta(durationWindow, unitCount, concurrency = 1, fallbackUnitMs =
|
|
|
12014
12108
|
}
|
|
12015
12109
|
function easeToward(elapsed, eta, maxCap = 0.95) {
|
|
12016
12110
|
if (eta <= 0 || elapsed <= 0) return 0;
|
|
12017
|
-
const
|
|
12018
|
-
return maxCap * (1 - Math.exp(-1.5 *
|
|
12111
|
+
const t35 = elapsed / eta;
|
|
12112
|
+
return maxCap * (1 - Math.exp(-1.5 * t35));
|
|
12019
12113
|
}
|
|
12020
12114
|
function HazoUiProgressBar({
|
|
12021
12115
|
value,
|
|
@@ -12191,7 +12285,7 @@ function upsertEntry(entries, entry) {
|
|
|
12191
12285
|
function removeEntry(entries, id) {
|
|
12192
12286
|
return entries.filter((e) => e.id !== id);
|
|
12193
12287
|
}
|
|
12194
|
-
var
|
|
12288
|
+
var t31 = i18n.createPackageT("hazo_ui", en_default);
|
|
12195
12289
|
function HazoUiMemoryDropdown({
|
|
12196
12290
|
history_key,
|
|
12197
12291
|
placeholder,
|
|
@@ -12199,8 +12293,8 @@ function HazoUiMemoryDropdown({
|
|
|
12199
12293
|
add_entry,
|
|
12200
12294
|
empty_label
|
|
12201
12295
|
}) {
|
|
12202
|
-
const resolved_placeholder = placeholder ??
|
|
12203
|
-
const resolved_empty_label = empty_label ??
|
|
12296
|
+
const resolved_placeholder = placeholder ?? t31("memory.search_placeholder");
|
|
12297
|
+
const resolved_empty_label = empty_label ?? t31("memory.no_history");
|
|
12204
12298
|
const { value: stored, setValue } = client$2.useHazoState(history_key, {
|
|
12205
12299
|
level: "scope",
|
|
12206
12300
|
fallback: []
|
|
@@ -12325,7 +12419,7 @@ function EntryRow({ entry, on_select, onDelete }) {
|
|
|
12325
12419
|
onClick: (e) => onDelete(entry.id, e),
|
|
12326
12420
|
onMouseEnter: () => setDeleteHovered(true),
|
|
12327
12421
|
onMouseLeave: () => setDeleteHovered(false),
|
|
12328
|
-
"aria-label":
|
|
12422
|
+
"aria-label": t31("memory.remove_aria", { label: entry.label }),
|
|
12329
12423
|
style: {
|
|
12330
12424
|
flexShrink: 0,
|
|
12331
12425
|
background: "none",
|
|
@@ -12344,6 +12438,7 @@ function EntryRow({ entry, on_select, onDelete }) {
|
|
|
12344
12438
|
}
|
|
12345
12439
|
);
|
|
12346
12440
|
}
|
|
12441
|
+
var t32 = i18n.createPackageT("hazo_ui", en_default);
|
|
12347
12442
|
function Logo({
|
|
12348
12443
|
logoUrl,
|
|
12349
12444
|
logoUrlDark,
|
|
@@ -12353,7 +12448,7 @@ function Logo({
|
|
|
12353
12448
|
className,
|
|
12354
12449
|
imgClassName
|
|
12355
12450
|
}) {
|
|
12356
|
-
const alt = appTitle ?? "
|
|
12451
|
+
const alt = appTitle ?? t32("app_logo.alt_fallback");
|
|
12357
12452
|
let content = null;
|
|
12358
12453
|
if (logoUrl) {
|
|
12359
12454
|
content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -12388,11 +12483,12 @@ function Logo({
|
|
|
12388
12483
|
}
|
|
12389
12484
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("inline-flex items-center gap-2", className), children: content });
|
|
12390
12485
|
}
|
|
12486
|
+
var t33 = i18n.createPackageT("hazo_ui", en_default);
|
|
12391
12487
|
function AppHeader({ identity, homeHref, navItems, actions, className }) {
|
|
12392
12488
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12393
12489
|
"header",
|
|
12394
12490
|
{
|
|
12395
|
-
"aria-label": "
|
|
12491
|
+
"aria-label": t33("app_header.aria_label"),
|
|
12396
12492
|
className: cn(
|
|
12397
12493
|
"flex w-full items-center justify-between gap-4 border-b bg-navbar text-navbar-fg border-navbar-border px-4 py-2.5",
|
|
12398
12494
|
className
|
|
@@ -12900,6 +12996,7 @@ function HazoBrowserTab({
|
|
|
12900
12996
|
}
|
|
12901
12997
|
);
|
|
12902
12998
|
}
|
|
12999
|
+
var t34 = i18n.createPackageT("hazo_ui", en_default);
|
|
12903
13000
|
var native_name_cache = /* @__PURE__ */ new Map();
|
|
12904
13001
|
function get_native_name(code) {
|
|
12905
13002
|
const cached = native_name_cache.get(code);
|
|
@@ -12971,9 +13068,10 @@ function LocalePicker({
|
|
|
12971
13068
|
flags = false,
|
|
12972
13069
|
alternates,
|
|
12973
13070
|
activeLocale,
|
|
12974
|
-
triggerLabel
|
|
13071
|
+
triggerLabel,
|
|
12975
13072
|
className
|
|
12976
13073
|
}) {
|
|
13074
|
+
const resolved_trigger_label = triggerLabel ?? t34("locale_picker.change_language");
|
|
12977
13075
|
const options = React27__namespace.useMemo(() => {
|
|
12978
13076
|
return Object.entries(alternates ?? {}).map(([code, url]) => {
|
|
12979
13077
|
const href = safeHref(url);
|
|
@@ -12988,7 +13086,7 @@ function LocalePicker({
|
|
|
12988
13086
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12989
13087
|
"nav",
|
|
12990
13088
|
{
|
|
12991
|
-
"aria-label":
|
|
13089
|
+
"aria-label": resolved_trigger_label,
|
|
12992
13090
|
className: cn("cls_locale_picker_inline flex items-center gap-1", className),
|
|
12993
13091
|
children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12994
13092
|
"a",
|
|
@@ -13018,7 +13116,7 @@ function LocalePicker({
|
|
|
13018
13116
|
variant: "outline",
|
|
13019
13117
|
size: "sm",
|
|
13020
13118
|
lang: activeLocale,
|
|
13021
|
-
"aria-label":
|
|
13119
|
+
"aria-label": resolved_trigger_label,
|
|
13022
13120
|
className: cn("cls_locale_picker_trigger gap-1.5", className),
|
|
13023
13121
|
children: [
|
|
13024
13122
|
flags && /* @__PURE__ */ jsxRuntime.jsx(FlagIcon, { code: active_option?.code ?? options[0].code }),
|