hazo_ui 6.12.0 → 6.12.3
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 +60 -0
- package/SETUP_CHECKLIST.md +2 -2
- package/dist/index.cjs +154 -94
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +154 -94
- package/dist/index.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 t14 = arguments[e];
|
|
186
|
+
for (var r in t14) ({}).hasOwnProperty.call(t14, r) && (n[r] = t14[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 t14 = {};
|
|
201
201
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
202
202
|
if (-1 !== e.indexOf(n)) continue;
|
|
203
|
-
|
|
203
|
+
t14[n] = r[n];
|
|
204
204
|
}
|
|
205
|
-
return
|
|
205
|
+
return t14;
|
|
206
206
|
}
|
|
207
207
|
module.exports = _objectWithoutPropertiesLoose10, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
208
208
|
}
|
|
@@ -785,7 +785,39 @@ var en_default = {
|
|
|
785
785
|
"filter.no_fields_available": "No fields available.",
|
|
786
786
|
"filter.clear_all": "Clear all",
|
|
787
787
|
"filter.cancel": "Cancel",
|
|
788
|
-
"filter.apply": "Apply"
|
|
788
|
+
"filter.apply": "Apply",
|
|
789
|
+
"sort.title": "Sort",
|
|
790
|
+
"sort.description": "Add fields to sort by, drag to reorder, toggle ascending or descending.",
|
|
791
|
+
"sort.search_fields": "Search fields...",
|
|
792
|
+
"sort.open_dialog_aria": "Open sort dialog",
|
|
793
|
+
"sort.clear_all": "Clear all",
|
|
794
|
+
"sort.cancel": "Cancel",
|
|
795
|
+
"sort.apply": "Apply",
|
|
796
|
+
"canvas_toolbar.bold": "Bold",
|
|
797
|
+
"canvas_toolbar.italic": "Italic",
|
|
798
|
+
"canvas_toolbar.underline": "Underline",
|
|
799
|
+
"canvas_toolbar.align_left": "Align left",
|
|
800
|
+
"canvas_toolbar.align_center": "Align center",
|
|
801
|
+
"canvas_toolbar.align_right": "Align right",
|
|
802
|
+
"canvas_toolbar.text_color": "Text color",
|
|
803
|
+
"canvas_toolbar.font_family": "Font family",
|
|
804
|
+
"canvas_toolbar.align_top": "Align top",
|
|
805
|
+
"canvas_toolbar.align_middle": "Align middle",
|
|
806
|
+
"canvas_toolbar.align_bottom": "Align bottom",
|
|
807
|
+
"canvas_toolbar.bullet_list": "Bullet list",
|
|
808
|
+
"toast.permission_required": "Permission required",
|
|
809
|
+
"toast.permission_denied_message": "You do not have permission to perform this action.",
|
|
810
|
+
"error.something_went_wrong": "Something went wrong",
|
|
811
|
+
"error.dismiss": "Dismiss",
|
|
812
|
+
"loading.taking_longer": "This is taking longer than expected",
|
|
813
|
+
"notification.loading": "Loading notifications",
|
|
814
|
+
"notification.mark_all_read": "Mark all as read",
|
|
815
|
+
"notification.unread": "Unread",
|
|
816
|
+
"confirm.cancel": "Cancel",
|
|
817
|
+
"icon_picker.search_placeholder": "Search icons...",
|
|
818
|
+
"common.loading": "Loading...",
|
|
819
|
+
"common.cancel": "Cancel",
|
|
820
|
+
"common.search": "Search..."
|
|
789
821
|
};
|
|
790
822
|
var t = i18n.createPackageT("hazo_ui", en_default);
|
|
791
823
|
function FilterFieldItem({
|
|
@@ -1234,6 +1266,7 @@ function HazoUiMultiFilterDialog({
|
|
|
1234
1266
|
] })
|
|
1235
1267
|
] });
|
|
1236
1268
|
}
|
|
1269
|
+
var t2 = i18n.createPackageT("hazo_ui", en_default);
|
|
1237
1270
|
function SortableSortFieldItem({
|
|
1238
1271
|
sortConfig,
|
|
1239
1272
|
fieldLabel,
|
|
@@ -1344,8 +1377,8 @@ function HazoUiMultiSortDialog({
|
|
|
1344
1377
|
availableFields,
|
|
1345
1378
|
onSortChange,
|
|
1346
1379
|
initialSortFields = [],
|
|
1347
|
-
title = "
|
|
1348
|
-
description = "
|
|
1380
|
+
title = t2("sort.title"),
|
|
1381
|
+
description = t2("sort.description"),
|
|
1349
1382
|
headerBackgroundColor,
|
|
1350
1383
|
headerTextColor,
|
|
1351
1384
|
submitButtonBackgroundColor,
|
|
@@ -1463,7 +1496,7 @@ function HazoUiMultiSortDialog({
|
|
|
1463
1496
|
variant: "outline",
|
|
1464
1497
|
size: "sm",
|
|
1465
1498
|
className: "cls_sort_button",
|
|
1466
|
-
"aria-label": "
|
|
1499
|
+
"aria-label": t2("sort.open_dialog_aria"),
|
|
1467
1500
|
children: [
|
|
1468
1501
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1469
1502
|
lucideReact.ArrowUpDown,
|
|
@@ -1536,7 +1569,7 @@ function HazoUiMultiSortDialog({
|
|
|
1536
1569
|
}
|
|
1537
1570
|
) }),
|
|
1538
1571
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "cls_combobox_popover w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
|
|
1539
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: "
|
|
1572
|
+
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: t2("sort.search_fields"), className: "cls_command_input" }),
|
|
1540
1573
|
/* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: availableFieldsToAdd.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: "No fields available." }) : /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: availableFieldsToAdd.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1541
1574
|
CommandItem,
|
|
1542
1575
|
{
|
|
@@ -1559,7 +1592,7 @@ function HazoUiMultiSortDialog({
|
|
|
1559
1592
|
onClick: handleClearAll,
|
|
1560
1593
|
className: "cls_clear_all_btn text-muted-foreground hover:text-foreground",
|
|
1561
1594
|
style: clearButtonStyles,
|
|
1562
|
-
children: "
|
|
1595
|
+
children: t2("sort.clear_all")
|
|
1563
1596
|
}
|
|
1564
1597
|
) }),
|
|
1565
1598
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_footer_right flex items-center gap-2", children: [
|
|
@@ -1571,7 +1604,7 @@ function HazoUiMultiSortDialog({
|
|
|
1571
1604
|
onClick: handleCancel,
|
|
1572
1605
|
className: "cls_cancel_btn",
|
|
1573
1606
|
style: cancelButtonStyles,
|
|
1574
|
-
children: "
|
|
1607
|
+
children: t2("sort.cancel")
|
|
1575
1608
|
}
|
|
1576
1609
|
),
|
|
1577
1610
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1581,7 +1614,7 @@ function HazoUiMultiSortDialog({
|
|
|
1581
1614
|
onClick: handleApply,
|
|
1582
1615
|
className: "cls_apply_btn",
|
|
1583
1616
|
style: submitButtonStyles,
|
|
1584
|
-
children: "
|
|
1617
|
+
children: t2("sort.apply")
|
|
1585
1618
|
}
|
|
1586
1619
|
)
|
|
1587
1620
|
] })
|
|
@@ -2000,6 +2033,7 @@ var TabsContent = React27__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
2000
2033
|
}
|
|
2001
2034
|
));
|
|
2002
2035
|
TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
|
|
2036
|
+
var t3 = i18n.createPackageT("hazo_ui", en_default);
|
|
2003
2037
|
function isLucideValue(value) {
|
|
2004
2038
|
return value.startsWith("lucide:");
|
|
2005
2039
|
}
|
|
@@ -2265,7 +2299,7 @@ function HazoUiIconPicker({
|
|
|
2265
2299
|
type: "text",
|
|
2266
2300
|
value: search,
|
|
2267
2301
|
onChange: (e) => set_search(e.target.value),
|
|
2268
|
-
placeholder: "
|
|
2302
|
+
placeholder: t3("icon_picker.search_placeholder"),
|
|
2269
2303
|
className: cn(
|
|
2270
2304
|
"cls_hazo_ui_icon_picker_search",
|
|
2271
2305
|
"mb-2 flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm",
|
|
@@ -3711,10 +3745,10 @@ var BLOCK_TYPE_LABEL_KEYS = {
|
|
|
3711
3745
|
"code-block": "rte.block_type.code_block",
|
|
3712
3746
|
blockquote: "rte.block_type.blockquote"
|
|
3713
3747
|
};
|
|
3714
|
-
function get_translated_block_types(
|
|
3748
|
+
function get_translated_block_types(t14) {
|
|
3715
3749
|
return BLOCK_TYPES.map((type) => ({
|
|
3716
3750
|
...type,
|
|
3717
|
-
label:
|
|
3751
|
+
label: t14(BLOCK_TYPE_LABEL_KEYS[type.value])
|
|
3718
3752
|
}));
|
|
3719
3753
|
}
|
|
3720
3754
|
|
|
@@ -3761,7 +3795,7 @@ function get_file_extension(filename) {
|
|
|
3761
3795
|
function is_image_file(mime_type) {
|
|
3762
3796
|
return mime_type.startsWith("image/");
|
|
3763
3797
|
}
|
|
3764
|
-
var
|
|
3798
|
+
var t4 = i18n.createPackageT("hazo_ui", en_default);
|
|
3765
3799
|
var ALL_ON = {
|
|
3766
3800
|
undo_redo: true,
|
|
3767
3801
|
block_type: true,
|
|
@@ -3816,7 +3850,7 @@ var Toolbar = ({
|
|
|
3816
3850
|
}
|
|
3817
3851
|
const tb = { ...ALL_ON, ...toolbar };
|
|
3818
3852
|
const font_family_options = font_families && font_families.length > 0 ? font_families : FONT_FAMILIES;
|
|
3819
|
-
const block_type_options = get_translated_block_types(
|
|
3853
|
+
const block_type_options = get_translated_block_types(t4);
|
|
3820
3854
|
const get_current_font_size = () => {
|
|
3821
3855
|
const attrs = editor.getAttributes("textStyle");
|
|
3822
3856
|
return attrs.fontSize || FONT_SIZE_CONFIG.default;
|
|
@@ -3960,7 +3994,7 @@ var Toolbar = ({
|
|
|
3960
3994
|
{
|
|
3961
3995
|
onClick: () => editor.chain().focus().undo().run(),
|
|
3962
3996
|
disabled: !editor.can().undo(),
|
|
3963
|
-
tooltip:
|
|
3997
|
+
tooltip: t4("rte.undo"),
|
|
3964
3998
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUndo2, { className: "h-4 w-4" })
|
|
3965
3999
|
},
|
|
3966
4000
|
"undo"
|
|
@@ -3970,7 +4004,7 @@ var Toolbar = ({
|
|
|
3970
4004
|
{
|
|
3971
4005
|
onClick: () => editor.chain().focus().redo().run(),
|
|
3972
4006
|
disabled: !editor.can().redo(),
|
|
3973
|
-
tooltip:
|
|
4007
|
+
tooltip: t4("rte.redo"),
|
|
3974
4008
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuRedo2, { className: "h-4 w-4" })
|
|
3975
4009
|
},
|
|
3976
4010
|
"redo"
|
|
@@ -4011,7 +4045,7 @@ var Toolbar = ({
|
|
|
4011
4045
|
ToolbarButton,
|
|
4012
4046
|
{
|
|
4013
4047
|
onClick: () => handle_font_size_change(-2),
|
|
4014
|
-
tooltip:
|
|
4048
|
+
tooltip: t4("rte.decrease_font_size"),
|
|
4015
4049
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuMinus, { className: "h-3 w-3" })
|
|
4016
4050
|
}
|
|
4017
4051
|
),
|
|
@@ -4020,7 +4054,7 @@ var Toolbar = ({
|
|
|
4020
4054
|
ToolbarButton,
|
|
4021
4055
|
{
|
|
4022
4056
|
onClick: () => handle_font_size_change(FONT_SIZE_CONFIG.step),
|
|
4023
|
-
tooltip:
|
|
4057
|
+
tooltip: t4("rte.increase_font_size"),
|
|
4024
4058
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuPlus, { className: "h-3 w-3" })
|
|
4025
4059
|
}
|
|
4026
4060
|
)
|
|
@@ -4038,7 +4072,7 @@ var Toolbar = ({
|
|
|
4038
4072
|
{
|
|
4039
4073
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
4040
4074
|
is_active: editor.isActive("bold"),
|
|
4041
|
-
tooltip:
|
|
4075
|
+
tooltip: t4("rte.bold"),
|
|
4042
4076
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuBold, { className: "h-4 w-4" })
|
|
4043
4077
|
},
|
|
4044
4078
|
"bold"
|
|
@@ -4052,7 +4086,7 @@ var Toolbar = ({
|
|
|
4052
4086
|
{
|
|
4053
4087
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
4054
4088
|
is_active: editor.isActive("italic"),
|
|
4055
|
-
tooltip:
|
|
4089
|
+
tooltip: t4("rte.italic"),
|
|
4056
4090
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuItalic, { className: "h-4 w-4" })
|
|
4057
4091
|
},
|
|
4058
4092
|
"italic"
|
|
@@ -4066,7 +4100,7 @@ var Toolbar = ({
|
|
|
4066
4100
|
{
|
|
4067
4101
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
4068
4102
|
is_active: editor.isActive("underline"),
|
|
4069
|
-
tooltip:
|
|
4103
|
+
tooltip: t4("rte.underline"),
|
|
4070
4104
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUnderline, { className: "h-4 w-4" })
|
|
4071
4105
|
},
|
|
4072
4106
|
"underline"
|
|
@@ -4080,7 +4114,7 @@ var Toolbar = ({
|
|
|
4080
4114
|
{
|
|
4081
4115
|
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
4082
4116
|
is_active: editor.isActive("strike"),
|
|
4083
|
-
tooltip:
|
|
4117
|
+
tooltip: t4("rte.strikethrough"),
|
|
4084
4118
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuStrikethrough, { className: "h-4 w-4" })
|
|
4085
4119
|
},
|
|
4086
4120
|
"strike"
|
|
@@ -4094,7 +4128,7 @@ var Toolbar = ({
|
|
|
4094
4128
|
{
|
|
4095
4129
|
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
4096
4130
|
is_active: editor.isActive("subscript"),
|
|
4097
|
-
tooltip:
|
|
4131
|
+
tooltip: t4("rte.subscript"),
|
|
4098
4132
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuSubscript, { className: "h-4 w-4" })
|
|
4099
4133
|
},
|
|
4100
4134
|
"sub"
|
|
@@ -4108,7 +4142,7 @@ var Toolbar = ({
|
|
|
4108
4142
|
{
|
|
4109
4143
|
onClick: () => editor.chain().focus().toggleSuperscript().run(),
|
|
4110
4144
|
is_active: editor.isActive("superscript"),
|
|
4111
|
-
tooltip:
|
|
4145
|
+
tooltip: t4("rte.superscript"),
|
|
4112
4146
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuSuperscript, { className: "h-4 w-4" })
|
|
4113
4147
|
},
|
|
4114
4148
|
"super"
|
|
@@ -4122,7 +4156,7 @@ var Toolbar = ({
|
|
|
4122
4156
|
if (tb.link) {
|
|
4123
4157
|
items.push(
|
|
4124
4158
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: link_popover_open, onOpenChange: set_link_popover_open, children: [
|
|
4125
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: editor.isActive("link"), tooltip:
|
|
4159
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: editor.isActive("link"), tooltip: t4("rte.link"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuLink, { className: "h-4 w-4" }) }) }),
|
|
4126
4160
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-80 p-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4127
4161
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4128
4162
|
Input,
|
|
@@ -4158,7 +4192,7 @@ var Toolbar = ({
|
|
|
4158
4192
|
ToolbarButton,
|
|
4159
4193
|
{
|
|
4160
4194
|
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
4161
|
-
tooltip:
|
|
4195
|
+
tooltip: t4("rte.clear_formatting"),
|
|
4162
4196
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuRemoveFormatting, { className: "h-4 w-4" })
|
|
4163
4197
|
},
|
|
4164
4198
|
"clear"
|
|
@@ -4172,7 +4206,7 @@ var Toolbar = ({
|
|
|
4172
4206
|
if (tb.text_color) {
|
|
4173
4207
|
items.push(
|
|
4174
4208
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: text_color_open, onOpenChange: set_text_color_open, children: [
|
|
4175
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip:
|
|
4209
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t4("rte.text_color"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
4176
4210
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuPalette, { className: "h-4 w-4" }),
|
|
4177
4211
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4178
4212
|
"div",
|
|
@@ -4215,7 +4249,7 @@ var Toolbar = ({
|
|
|
4215
4249
|
if (tb.highlight_color) {
|
|
4216
4250
|
items.push(
|
|
4217
4251
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: highlight_color_open, onOpenChange: set_highlight_color_open, children: [
|
|
4218
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip:
|
|
4252
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t4("rte.highlight_color"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
4219
4253
|
/* @__PURE__ */ jsxRuntime.jsx(lu.LuHighlighter, { className: "h-4 w-4" }),
|
|
4220
4254
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4221
4255
|
"div",
|
|
@@ -4258,7 +4292,7 @@ var Toolbar = ({
|
|
|
4258
4292
|
{
|
|
4259
4293
|
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
4260
4294
|
is_active: editor.isActive({ textAlign: "left" }),
|
|
4261
|
-
tooltip:
|
|
4295
|
+
tooltip: t4("rte.align_left"),
|
|
4262
4296
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignLeft, { className: "h-4 w-4" })
|
|
4263
4297
|
},
|
|
4264
4298
|
"align-left"
|
|
@@ -4268,7 +4302,7 @@ var Toolbar = ({
|
|
|
4268
4302
|
{
|
|
4269
4303
|
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
4270
4304
|
is_active: editor.isActive({ textAlign: "center" }),
|
|
4271
|
-
tooltip:
|
|
4305
|
+
tooltip: t4("rte.align_center"),
|
|
4272
4306
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignCenter, { className: "h-4 w-4" })
|
|
4273
4307
|
},
|
|
4274
4308
|
"align-center"
|
|
@@ -4278,7 +4312,7 @@ var Toolbar = ({
|
|
|
4278
4312
|
{
|
|
4279
4313
|
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
4280
4314
|
is_active: editor.isActive({ textAlign: "right" }),
|
|
4281
|
-
tooltip:
|
|
4315
|
+
tooltip: t4("rte.align_right"),
|
|
4282
4316
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignRight, { className: "h-4 w-4" })
|
|
4283
4317
|
},
|
|
4284
4318
|
"align-right"
|
|
@@ -4288,7 +4322,7 @@ var Toolbar = ({
|
|
|
4288
4322
|
{
|
|
4289
4323
|
onClick: () => editor.chain().focus().setTextAlign("justify").run(),
|
|
4290
4324
|
is_active: editor.isActive({ textAlign: "justify" }),
|
|
4291
|
-
tooltip:
|
|
4325
|
+
tooltip: t4("rte.justify"),
|
|
4292
4326
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignJustify, { className: "h-4 w-4" })
|
|
4293
4327
|
},
|
|
4294
4328
|
"align-justify"
|
|
@@ -4304,7 +4338,7 @@ var Toolbar = ({
|
|
|
4304
4338
|
{
|
|
4305
4339
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
4306
4340
|
is_active: editor.isActive("bulletList"),
|
|
4307
|
-
tooltip:
|
|
4341
|
+
tooltip: t4("rte.bullet_list"),
|
|
4308
4342
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuList, { className: "h-4 w-4" })
|
|
4309
4343
|
},
|
|
4310
4344
|
"bullet"
|
|
@@ -4318,7 +4352,7 @@ var Toolbar = ({
|
|
|
4318
4352
|
{
|
|
4319
4353
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
4320
4354
|
is_active: editor.isActive("orderedList"),
|
|
4321
|
-
tooltip:
|
|
4355
|
+
tooltip: t4("rte.ordered_list"),
|
|
4322
4356
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuListOrdered, { className: "h-4 w-4" })
|
|
4323
4357
|
},
|
|
4324
4358
|
"ordered"
|
|
@@ -4332,7 +4366,7 @@ var Toolbar = ({
|
|
|
4332
4366
|
{
|
|
4333
4367
|
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
4334
4368
|
is_active: editor.isActive("taskList"),
|
|
4335
|
-
tooltip:
|
|
4369
|
+
tooltip: t4("rte.checklist"),
|
|
4336
4370
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuListChecks, { className: "h-4 w-4" })
|
|
4337
4371
|
},
|
|
4338
4372
|
"task"
|
|
@@ -4354,7 +4388,7 @@ var Toolbar = ({
|
|
|
4354
4388
|
}
|
|
4355
4389
|
},
|
|
4356
4390
|
disabled: !editor.can().liftListItem("listItem") && !editor.can().liftListItem("taskItem"),
|
|
4357
|
-
tooltip:
|
|
4391
|
+
tooltip: t4("rte.decrease_indent"),
|
|
4358
4392
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuIndentDecrease, { className: "h-4 w-4" })
|
|
4359
4393
|
},
|
|
4360
4394
|
"indent-dec"
|
|
@@ -4370,7 +4404,7 @@ var Toolbar = ({
|
|
|
4370
4404
|
}
|
|
4371
4405
|
},
|
|
4372
4406
|
disabled: !editor.can().sinkListItem("listItem") && !editor.can().sinkListItem("taskItem"),
|
|
4373
|
-
tooltip:
|
|
4407
|
+
tooltip: t4("rte.increase_indent"),
|
|
4374
4408
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuIndentIncrease, { className: "h-4 w-4" })
|
|
4375
4409
|
},
|
|
4376
4410
|
"indent-inc"
|
|
@@ -4381,7 +4415,7 @@ var Toolbar = ({
|
|
|
4381
4415
|
const items = [];
|
|
4382
4416
|
if (tb.horizontal_rule) {
|
|
4383
4417
|
items.push(
|
|
4384
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { onClick: handle_hr_insert, tooltip:
|
|
4418
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { onClick: handle_hr_insert, tooltip: t4("rte.horizontal_rule"), children: /* @__PURE__ */ jsxRuntime.jsx(rx.RxDividerHorizontal, { className: "h-4 w-4" }) }, "hr")
|
|
4385
4419
|
);
|
|
4386
4420
|
}
|
|
4387
4421
|
if (tb.image) {
|
|
@@ -4390,7 +4424,7 @@ var Toolbar = ({
|
|
|
4390
4424
|
ToolbarButton,
|
|
4391
4425
|
{
|
|
4392
4426
|
onClick: () => image_input_ref.current?.click(),
|
|
4393
|
-
tooltip:
|
|
4427
|
+
tooltip: t4("rte.insert_image"),
|
|
4394
4428
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuImage, { className: "h-4 w-4" })
|
|
4395
4429
|
},
|
|
4396
4430
|
"image"
|
|
@@ -4404,7 +4438,7 @@ var Toolbar = ({
|
|
|
4404
4438
|
ToolbarButton,
|
|
4405
4439
|
{
|
|
4406
4440
|
is_active: editor.isActive("table"),
|
|
4407
|
-
tooltip:
|
|
4441
|
+
tooltip: t4("rte.table"),
|
|
4408
4442
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuTable, { className: "h-4 w-4" })
|
|
4409
4443
|
}
|
|
4410
4444
|
) }),
|
|
@@ -4576,7 +4610,7 @@ var Toolbar = ({
|
|
|
4576
4610
|
if (tb.variables && variables.length > 0) {
|
|
4577
4611
|
items.push(
|
|
4578
4612
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: variables_menu_open, onOpenChange: set_variables_menu_open, children: [
|
|
4579
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip:
|
|
4613
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { tooltip: t4("rte.insert_variable"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuVariable, { className: "h-4 w-4" }) }) }),
|
|
4580
4614
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
|
|
4581
4615
|
/* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: "Search variables...", className: "h-8 text-xs" }),
|
|
4582
4616
|
/* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
|
|
@@ -4605,7 +4639,7 @@ var Toolbar = ({
|
|
|
4605
4639
|
ToolbarButton,
|
|
4606
4640
|
{
|
|
4607
4641
|
onClick: () => file_input_ref.current?.click(),
|
|
4608
|
-
tooltip:
|
|
4642
|
+
tooltip: t4("rte.attach_file"),
|
|
4609
4643
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuPaperclip, { className: "h-4 w-4" })
|
|
4610
4644
|
},
|
|
4611
4645
|
"attach"
|
|
@@ -5126,6 +5160,7 @@ var HazoUiRte = ({
|
|
|
5126
5160
|
);
|
|
5127
5161
|
};
|
|
5128
5162
|
HazoUiRte.displayName = "HazoUiRte";
|
|
5163
|
+
var t5 = i18n.createPackageT("hazo_ui", en_default);
|
|
5129
5164
|
function CanvasTextToolbar({
|
|
5130
5165
|
bold,
|
|
5131
5166
|
italic,
|
|
@@ -5156,14 +5191,14 @@ function CanvasTextToolbar({
|
|
|
5156
5191
|
),
|
|
5157
5192
|
style,
|
|
5158
5193
|
children: [
|
|
5159
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bold, onClick: onBold, tooltip: "
|
|
5160
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: italic, onClick: onItalic, tooltip: "
|
|
5194
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bold, onClick: onBold, tooltip: t5("canvas_toolbar.bold"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuBold, { className: "h-4 w-4" }) }),
|
|
5195
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: italic, onClick: onItalic, tooltip: t5("canvas_toolbar.italic"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuItalic, { className: "h-4 w-4" }) }),
|
|
5161
5196
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5162
5197
|
ToolbarButton,
|
|
5163
5198
|
{
|
|
5164
5199
|
is_active: underline,
|
|
5165
5200
|
onClick: onUnderline,
|
|
5166
|
-
tooltip: "
|
|
5201
|
+
tooltip: t5("canvas_toolbar.underline"),
|
|
5167
5202
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuUnderline, { className: "h-4 w-4" })
|
|
5168
5203
|
}
|
|
5169
5204
|
),
|
|
@@ -5173,7 +5208,7 @@ function CanvasTextToolbar({
|
|
|
5173
5208
|
{
|
|
5174
5209
|
is_active: align === "left",
|
|
5175
5210
|
onClick: () => onAlign?.("left"),
|
|
5176
|
-
tooltip: "
|
|
5211
|
+
tooltip: t5("canvas_toolbar.align_left"),
|
|
5177
5212
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignLeft, { className: "h-4 w-4" })
|
|
5178
5213
|
}
|
|
5179
5214
|
),
|
|
@@ -5182,7 +5217,7 @@ function CanvasTextToolbar({
|
|
|
5182
5217
|
{
|
|
5183
5218
|
is_active: align === "center",
|
|
5184
5219
|
onClick: () => onAlign?.("center"),
|
|
5185
|
-
tooltip: "
|
|
5220
|
+
tooltip: t5("canvas_toolbar.align_center"),
|
|
5186
5221
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignCenter, { className: "h-4 w-4" })
|
|
5187
5222
|
}
|
|
5188
5223
|
),
|
|
@@ -5191,7 +5226,7 @@ function CanvasTextToolbar({
|
|
|
5191
5226
|
{
|
|
5192
5227
|
is_active: align === "right",
|
|
5193
5228
|
onClick: () => onAlign?.("right"),
|
|
5194
|
-
tooltip: "
|
|
5229
|
+
tooltip: t5("canvas_toolbar.align_right"),
|
|
5195
5230
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignRight, { className: "h-4 w-4" })
|
|
5196
5231
|
}
|
|
5197
5232
|
),
|
|
@@ -5200,7 +5235,7 @@ function CanvasTextToolbar({
|
|
|
5200
5235
|
"label",
|
|
5201
5236
|
{
|
|
5202
5237
|
className: "relative flex h-8 w-8 cursor-pointer items-center justify-center rounded-md hover:bg-accent",
|
|
5203
|
-
title: "
|
|
5238
|
+
title: t5("canvas_toolbar.text_color"),
|
|
5204
5239
|
children: [
|
|
5205
5240
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
5206
5241
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold text-muted-foreground", children: "A" }),
|
|
@@ -5230,7 +5265,7 @@ function CanvasTextToolbar({
|
|
|
5230
5265
|
{
|
|
5231
5266
|
is_active: verticalAlign === "top",
|
|
5232
5267
|
onClick: () => onVerticalAlign?.("top"),
|
|
5233
|
-
tooltip: "
|
|
5268
|
+
tooltip: t5("canvas_toolbar.align_top"),
|
|
5234
5269
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyStart, { className: "h-4 w-4" })
|
|
5235
5270
|
}
|
|
5236
5271
|
),
|
|
@@ -5239,7 +5274,7 @@ function CanvasTextToolbar({
|
|
|
5239
5274
|
{
|
|
5240
5275
|
is_active: verticalAlign === "middle",
|
|
5241
5276
|
onClick: () => onVerticalAlign?.("middle"),
|
|
5242
|
-
tooltip: "
|
|
5277
|
+
tooltip: t5("canvas_toolbar.align_middle"),
|
|
5243
5278
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyCenter, { className: "h-4 w-4" })
|
|
5244
5279
|
}
|
|
5245
5280
|
),
|
|
@@ -5248,7 +5283,7 @@ function CanvasTextToolbar({
|
|
|
5248
5283
|
{
|
|
5249
5284
|
is_active: verticalAlign === "bottom",
|
|
5250
5285
|
onClick: () => onVerticalAlign?.("bottom"),
|
|
5251
|
-
tooltip: "
|
|
5286
|
+
tooltip: t5("canvas_toolbar.align_bottom"),
|
|
5252
5287
|
children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuAlignVerticalJustifyEnd, { className: "h-4 w-4" })
|
|
5253
5288
|
}
|
|
5254
5289
|
),
|
|
@@ -5259,7 +5294,7 @@ function CanvasTextToolbar({
|
|
|
5259
5294
|
value: font,
|
|
5260
5295
|
onChange: (e) => onFont?.(e.target.value),
|
|
5261
5296
|
className: "h-8 text-xs rounded-md border border-border bg-background px-1 text-foreground focus:outline-none",
|
|
5262
|
-
title: "
|
|
5297
|
+
title: t5("canvas_toolbar.font_family"),
|
|
5263
5298
|
children: [
|
|
5264
5299
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "sans-serif", children: "Sans" }),
|
|
5265
5300
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "serif", children: "Serif" }),
|
|
@@ -5271,7 +5306,7 @@ function CanvasTextToolbar({
|
|
|
5271
5306
|
}
|
|
5272
5307
|
),
|
|
5273
5308
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-1 h-6 w-px bg-border" }),
|
|
5274
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bullet, onClick: onBullet, tooltip: "
|
|
5309
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { is_active: bullet, onClick: onBullet, tooltip: t5("canvas_toolbar.bullet_list"), children: /* @__PURE__ */ jsxRuntime.jsx(lu.LuList, { className: "h-4 w-4" }) })
|
|
5275
5310
|
]
|
|
5276
5311
|
}
|
|
5277
5312
|
) });
|
|
@@ -7649,6 +7684,7 @@ function HazoUiDialog({
|
|
|
7649
7684
|
)
|
|
7650
7685
|
] }) });
|
|
7651
7686
|
}
|
|
7687
|
+
var t6 = i18n.createPackageT("hazo_ui", en_default);
|
|
7652
7688
|
function HazoUiConfirmDialog({
|
|
7653
7689
|
open,
|
|
7654
7690
|
onOpenChange,
|
|
@@ -7657,7 +7693,7 @@ function HazoUiConfirmDialog({
|
|
|
7657
7693
|
children,
|
|
7658
7694
|
variant = "default",
|
|
7659
7695
|
confirmLabel,
|
|
7660
|
-
cancelLabel = "
|
|
7696
|
+
cancelLabel = t6("confirm.cancel"),
|
|
7661
7697
|
showCancelButton = true,
|
|
7662
7698
|
onConfirm,
|
|
7663
7699
|
onCancel,
|
|
@@ -8562,6 +8598,7 @@ function EmptyState({
|
|
|
8562
8598
|
}
|
|
8563
8599
|
);
|
|
8564
8600
|
}
|
|
8601
|
+
var t7 = i18n.createPackageT("hazo_ui", en_default);
|
|
8565
8602
|
function ErrorBanner({
|
|
8566
8603
|
severity = "error",
|
|
8567
8604
|
title,
|
|
@@ -8596,7 +8633,7 @@ function ErrorBanner({
|
|
|
8596
8633
|
{
|
|
8597
8634
|
type: "button",
|
|
8598
8635
|
onClick: onDismiss,
|
|
8599
|
-
"aria-label": "
|
|
8636
|
+
"aria-label": t7("error.dismiss"),
|
|
8600
8637
|
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",
|
|
8601
8638
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
8602
8639
|
}
|
|
@@ -8605,8 +8642,9 @@ function ErrorBanner({
|
|
|
8605
8642
|
}
|
|
8606
8643
|
);
|
|
8607
8644
|
}
|
|
8645
|
+
var t8 = i18n.createPackageT("hazo_ui", en_default);
|
|
8608
8646
|
function ErrorPage({
|
|
8609
|
-
title = "
|
|
8647
|
+
title = t8("error.something_went_wrong"),
|
|
8610
8648
|
description,
|
|
8611
8649
|
errorCode,
|
|
8612
8650
|
correlationId,
|
|
@@ -8637,6 +8675,7 @@ function ErrorPage({
|
|
|
8637
8675
|
}
|
|
8638
8676
|
);
|
|
8639
8677
|
}
|
|
8678
|
+
var t9 = i18n.createPackageT("hazo_ui", en_default);
|
|
8640
8679
|
function LoadingTimeout({
|
|
8641
8680
|
active,
|
|
8642
8681
|
children,
|
|
@@ -8646,7 +8685,7 @@ function LoadingTimeout({
|
|
|
8646
8685
|
label = "content",
|
|
8647
8686
|
className
|
|
8648
8687
|
}) {
|
|
8649
|
-
const
|
|
8688
|
+
const timeouts = {
|
|
8650
8689
|
gentle: thresholds?.gentle ?? 5e3,
|
|
8651
8690
|
firm: thresholds?.firm ?? 15e3,
|
|
8652
8691
|
expired: thresholds?.expired ?? 3e4
|
|
@@ -8658,15 +8697,15 @@ function LoadingTimeout({
|
|
|
8658
8697
|
return;
|
|
8659
8698
|
}
|
|
8660
8699
|
setPhase("silent");
|
|
8661
|
-
const gentleTimer = window.setTimeout(() => setPhase("gentle"),
|
|
8662
|
-
const firmTimer = window.setTimeout(() => setPhase("firm"),
|
|
8663
|
-
const expiredTimer = window.setTimeout(() => setPhase("expired"),
|
|
8700
|
+
const gentleTimer = window.setTimeout(() => setPhase("gentle"), timeouts.gentle);
|
|
8701
|
+
const firmTimer = window.setTimeout(() => setPhase("firm"), timeouts.firm);
|
|
8702
|
+
const expiredTimer = window.setTimeout(() => setPhase("expired"), timeouts.expired);
|
|
8664
8703
|
return () => {
|
|
8665
8704
|
window.clearTimeout(gentleTimer);
|
|
8666
8705
|
window.clearTimeout(firmTimer);
|
|
8667
8706
|
window.clearTimeout(expiredTimer);
|
|
8668
8707
|
};
|
|
8669
|
-
}, [active,
|
|
8708
|
+
}, [active, timeouts.gentle, timeouts.firm, timeouts.expired]);
|
|
8670
8709
|
if (!active) {
|
|
8671
8710
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
8672
8711
|
}
|
|
@@ -8675,7 +8714,7 @@ function LoadingTimeout({
|
|
|
8675
8714
|
ErrorBanner,
|
|
8676
8715
|
{
|
|
8677
8716
|
severity: "error",
|
|
8678
|
-
title: "
|
|
8717
|
+
title: t9("loading.taking_longer"),
|
|
8679
8718
|
message: `We're still trying to load the ${label}. The connection may be slow.`,
|
|
8680
8719
|
action: onRetry ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8681
8720
|
"button",
|
|
@@ -8777,6 +8816,7 @@ function NotificationCountBadge({
|
|
|
8777
8816
|
}
|
|
8778
8817
|
);
|
|
8779
8818
|
}
|
|
8819
|
+
var t10 = i18n.createPackageT("hazo_ui", en_default);
|
|
8780
8820
|
function NotificationItem({
|
|
8781
8821
|
isRead,
|
|
8782
8822
|
timestamp,
|
|
@@ -8807,7 +8847,7 @@ function NotificationItem({
|
|
|
8807
8847
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_notification_item_dot_col flex-shrink-0 pt-1.5", children: !isRead ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8808
8848
|
"span",
|
|
8809
8849
|
{
|
|
8810
|
-
"aria-label": "
|
|
8850
|
+
"aria-label": t10("notification.unread"),
|
|
8811
8851
|
className: "cls_notification_item_dot block w-2 h-2 rounded-full bg-primary"
|
|
8812
8852
|
}
|
|
8813
8853
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block w-2 h-2", "aria-hidden": "true" }) }),
|
|
@@ -8831,12 +8871,13 @@ function NotificationItem({
|
|
|
8831
8871
|
}
|
|
8832
8872
|
);
|
|
8833
8873
|
}
|
|
8874
|
+
var t11 = i18n.createPackageT("hazo_ui", en_default);
|
|
8834
8875
|
function LoadingSkeletons() {
|
|
8835
8876
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8836
8877
|
"div",
|
|
8837
8878
|
{
|
|
8838
8879
|
"aria-busy": "true",
|
|
8839
|
-
"aria-label": "
|
|
8880
|
+
"aria-label": t11("notification.loading"),
|
|
8840
8881
|
className: "cls_notification_panel_loading space-y-0",
|
|
8841
8882
|
children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8842
8883
|
"div",
|
|
@@ -8895,6 +8936,7 @@ function NotificationPanel({
|
|
|
8895
8936
|
}
|
|
8896
8937
|
);
|
|
8897
8938
|
}
|
|
8939
|
+
var t12 = i18n.createPackageT("hazo_ui", en_default);
|
|
8898
8940
|
function HazoUiToaster({
|
|
8899
8941
|
position = "bottom-right",
|
|
8900
8942
|
closeButton = true,
|
|
@@ -8940,12 +8982,12 @@ function permissionToast({
|
|
|
8940
8982
|
action,
|
|
8941
8983
|
duration = 5e3
|
|
8942
8984
|
}) {
|
|
8943
|
-
const description = missingPermissions.length === 0 ? "
|
|
8985
|
+
const description = missingPermissions.length === 0 ? t12("toast.permission_denied_message") : `Missing: ${missingPermissions.map((key) => {
|
|
8944
8986
|
const label = descriptions?.[key];
|
|
8945
8987
|
return label ? `\`${key}\` \u2014 ${label}` : `\`${key}\``;
|
|
8946
8988
|
}).join("; ")}`;
|
|
8947
8989
|
return errorToast({
|
|
8948
|
-
title: "
|
|
8990
|
+
title: t12("toast.permission_required"),
|
|
8949
8991
|
description,
|
|
8950
8992
|
action,
|
|
8951
8993
|
duration
|
|
@@ -9140,41 +9182,55 @@ function useWakeLock() {
|
|
|
9140
9182
|
}
|
|
9141
9183
|
function useFullscreen(elementRef) {
|
|
9142
9184
|
const [is_fullscreen, set_is_fullscreen] = React27.useState(false);
|
|
9185
|
+
const supported = typeof document !== "undefined" && typeof document.documentElement.requestFullscreen === "function";
|
|
9143
9186
|
React27.useEffect(() => {
|
|
9144
|
-
if (typeof document === "undefined") return;
|
|
9187
|
+
if (typeof document === "undefined" || !supported) return;
|
|
9145
9188
|
const handle_change = () => {
|
|
9146
9189
|
set_is_fullscreen(!!document.fullscreenElement);
|
|
9147
9190
|
};
|
|
9148
9191
|
document.addEventListener("fullscreenchange", handle_change);
|
|
9149
9192
|
set_is_fullscreen(!!document.fullscreenElement);
|
|
9150
9193
|
return () => document.removeEventListener("fullscreenchange", handle_change);
|
|
9151
|
-
}, []);
|
|
9194
|
+
}, [supported]);
|
|
9152
9195
|
const get_target = React27.useCallback(() => {
|
|
9153
9196
|
return elementRef?.current ?? document.documentElement;
|
|
9154
9197
|
}, [elementRef]);
|
|
9155
9198
|
const enter = React27.useCallback(async () => {
|
|
9156
|
-
if (typeof document === "undefined"
|
|
9199
|
+
if (typeof document === "undefined") return;
|
|
9200
|
+
if (!supported) {
|
|
9201
|
+
set_is_fullscreen(true);
|
|
9202
|
+
return;
|
|
9203
|
+
}
|
|
9157
9204
|
if (document.fullscreenElement) return;
|
|
9158
9205
|
try {
|
|
9159
9206
|
await get_target().requestFullscreen();
|
|
9160
9207
|
} catch {
|
|
9161
9208
|
}
|
|
9162
|
-
}, [get_target]);
|
|
9209
|
+
}, [supported, get_target]);
|
|
9163
9210
|
const exit = React27.useCallback(async () => {
|
|
9164
9211
|
if (typeof document === "undefined") return;
|
|
9212
|
+
if (!supported) {
|
|
9213
|
+
set_is_fullscreen(false);
|
|
9214
|
+
return;
|
|
9215
|
+
}
|
|
9165
9216
|
if (!document.fullscreenElement) return;
|
|
9166
9217
|
try {
|
|
9167
9218
|
await document.exitFullscreen();
|
|
9168
9219
|
} catch {
|
|
9169
9220
|
}
|
|
9170
|
-
}, []);
|
|
9221
|
+
}, [supported]);
|
|
9171
9222
|
const toggle = React27.useCallback(async () => {
|
|
9223
|
+
if (!supported) {
|
|
9224
|
+
if (is_fullscreen) await exit();
|
|
9225
|
+
else await enter();
|
|
9226
|
+
return;
|
|
9227
|
+
}
|
|
9172
9228
|
if (document.fullscreenElement) {
|
|
9173
9229
|
await exit();
|
|
9174
9230
|
} else {
|
|
9175
9231
|
await enter();
|
|
9176
9232
|
}
|
|
9177
|
-
}, [enter, exit]);
|
|
9233
|
+
}, [supported, is_fullscreen, enter, exit]);
|
|
9178
9234
|
return { isFullscreen: is_fullscreen, enter, exit, toggle };
|
|
9179
9235
|
}
|
|
9180
9236
|
function use_wake_lock(active) {
|
|
@@ -10794,7 +10850,7 @@ function serializeFilter(filter) {
|
|
|
10794
10850
|
const fields = (filter.fields ?? []).map((f) => `${f.field}:${f.operator ?? ""}:${String(f.value)}`).join(",");
|
|
10795
10851
|
return `${filter.search ?? ""}|${fields}`;
|
|
10796
10852
|
}
|
|
10797
|
-
var
|
|
10853
|
+
var t13 = i18n.createPackageT("hazo_ui", en_default);
|
|
10798
10854
|
function HazoUiTable(props) {
|
|
10799
10855
|
const state = useTableState(props);
|
|
10800
10856
|
const { columns, rows, getRowKey, className, caption } = props;
|
|
@@ -10829,12 +10885,12 @@ function HazoUiTable(props) {
|
|
|
10829
10885
|
) }) : 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(
|
|
10830
10886
|
EmptyState,
|
|
10831
10887
|
{
|
|
10832
|
-
title: typeof props.empty === "string" && props.empty ||
|
|
10888
|
+
title: typeof props.empty === "string" && props.empty || t13("table.empty")
|
|
10833
10889
|
}
|
|
10834
10890
|
) : props.empty : typeof props.noResults === "string" || props.noResults === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10835
10891
|
EmptyState,
|
|
10836
10892
|
{
|
|
10837
|
-
title: typeof props.noResults === "string" && props.noResults ||
|
|
10893
|
+
title: typeof props.noResults === "string" && props.noResults || t13("table.no_results")
|
|
10838
10894
|
}
|
|
10839
10895
|
) : props.noResults }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
10840
10896
|
TableMobileCards,
|
|
@@ -10857,7 +10913,7 @@ function HazoUiTable(props) {
|
|
|
10857
10913
|
{
|
|
10858
10914
|
type: "button",
|
|
10859
10915
|
onClick: (e) => state.cycleHeaderSort(c.key, e.shiftKey),
|
|
10860
|
-
title:
|
|
10916
|
+
title: t13("table.sort_tooltip"),
|
|
10861
10917
|
className: "cls_hazo_ui_table_sort_btn inline-flex items-center gap-1 hover:text-foreground",
|
|
10862
10918
|
children: [
|
|
10863
10919
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: c.label }),
|
|
@@ -10889,12 +10945,12 @@ function HazoUiTable(props) {
|
|
|
10889
10945
|
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(
|
|
10890
10946
|
EmptyState,
|
|
10891
10947
|
{
|
|
10892
|
-
title: typeof props.empty === "string" && props.empty ||
|
|
10948
|
+
title: typeof props.empty === "string" && props.empty || t13("table.empty")
|
|
10893
10949
|
}
|
|
10894
10950
|
) : 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(
|
|
10895
10951
|
EmptyState,
|
|
10896
10952
|
{
|
|
10897
|
-
title: typeof props.noResults === "string" && props.noResults ||
|
|
10953
|
+
title: typeof props.noResults === "string" && props.noResults || t13("table.no_results")
|
|
10898
10954
|
}
|
|
10899
10955
|
) : props.noResults })
|
|
10900
10956
|
}
|
|
@@ -11008,7 +11064,7 @@ function PaginationFooter({
|
|
|
11008
11064
|
const end = Math.min((page + 1) * pageSize, total);
|
|
11009
11065
|
const lastPage = Math.max(0, Math.ceil(total / pageSize) - 1);
|
|
11010
11066
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_hazo_ui_table_pagination flex items-center justify-between gap-3 pt-2 text-sm", children: [
|
|
11011
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_hazo_ui_table_page_counter text-muted-foreground", children:
|
|
11067
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "cls_hazo_ui_table_page_counter text-muted-foreground", children: t13("table.showing", {
|
|
11012
11068
|
start: String(start),
|
|
11013
11069
|
end: String(end),
|
|
11014
11070
|
total: String(total)
|
|
@@ -11021,8 +11077,8 @@ function PaginationFooter({
|
|
|
11021
11077
|
size: "sm",
|
|
11022
11078
|
onClick: () => onPageChange(Math.max(0, page - 1)),
|
|
11023
11079
|
disabled: page === 0,
|
|
11024
|
-
"aria-label":
|
|
11025
|
-
children:
|
|
11080
|
+
"aria-label": t13("table.prev_aria"),
|
|
11081
|
+
children: t13("table.prev")
|
|
11026
11082
|
}
|
|
11027
11083
|
),
|
|
11028
11084
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11032,8 +11088,8 @@ function PaginationFooter({
|
|
|
11032
11088
|
size: "sm",
|
|
11033
11089
|
onClick: () => onPageChange(Math.min(lastPage, page + 1)),
|
|
11034
11090
|
disabled: page >= lastPage,
|
|
11035
|
-
"aria-label":
|
|
11036
|
-
children:
|
|
11091
|
+
"aria-label": t13("table.next_aria"),
|
|
11092
|
+
children: t13("table.next")
|
|
11037
11093
|
}
|
|
11038
11094
|
)
|
|
11039
11095
|
] })
|
|
@@ -11077,7 +11133,7 @@ function Toolbar2(props) {
|
|
|
11077
11133
|
setSearchValue(v);
|
|
11078
11134
|
onSearchChange(v);
|
|
11079
11135
|
},
|
|
11080
|
-
placeholder: searchPlaceholder ??
|
|
11136
|
+
placeholder: searchPlaceholder ?? t13("table.search_placeholder"),
|
|
11081
11137
|
className: "cls_hazo_ui_table_search w-full sm:max-w-xs"
|
|
11082
11138
|
}
|
|
11083
11139
|
) : /* @__PURE__ */ jsxRuntime.jsx("div", {}),
|
|
@@ -11125,8 +11181,8 @@ function renderErrorState(error, serverError) {
|
|
|
11125
11181
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11126
11182
|
EmptyState,
|
|
11127
11183
|
{
|
|
11128
|
-
title:
|
|
11129
|
-
description: msg ||
|
|
11184
|
+
title: t13("table.error_title"),
|
|
11185
|
+
description: msg || t13("table.error_description")
|
|
11130
11186
|
}
|
|
11131
11187
|
);
|
|
11132
11188
|
}
|
|
@@ -11912,8 +11968,8 @@ function computeEta(durationWindow, unitCount, concurrency = 1, fallbackUnitMs =
|
|
|
11912
11968
|
}
|
|
11913
11969
|
function easeToward(elapsed, eta, maxCap = 0.95) {
|
|
11914
11970
|
if (eta <= 0 || elapsed <= 0) return 0;
|
|
11915
|
-
const
|
|
11916
|
-
return maxCap * (1 - Math.exp(-1.5 *
|
|
11971
|
+
const t14 = elapsed / eta;
|
|
11972
|
+
return maxCap * (1 - Math.exp(-1.5 * t14));
|
|
11917
11973
|
}
|
|
11918
11974
|
function HazoUiProgressBar({
|
|
11919
11975
|
value,
|
|
@@ -11944,7 +12000,7 @@ function HazoUiProgressBar({
|
|
|
11944
12000
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11945
12001
|
"div",
|
|
11946
12002
|
{
|
|
11947
|
-
className: "h-full rounded-full bg-
|
|
12003
|
+
className: "h-full rounded-full bg-primary transition-[width] duration-200 ease-out motion-reduce:transition-none",
|
|
11948
12004
|
style: { width: `${pct}%` }
|
|
11949
12005
|
}
|
|
11950
12006
|
)
|
|
@@ -12031,6 +12087,8 @@ function HazoUiEtaProgress({
|
|
|
12031
12087
|
fallbackUnitMs = 5e3,
|
|
12032
12088
|
level = "global",
|
|
12033
12089
|
label,
|
|
12090
|
+
showPercent,
|
|
12091
|
+
size,
|
|
12034
12092
|
endpoint,
|
|
12035
12093
|
handleRef,
|
|
12036
12094
|
className
|
|
@@ -12065,6 +12123,8 @@ function HazoUiEtaProgress({
|
|
|
12065
12123
|
{
|
|
12066
12124
|
value: handle.value,
|
|
12067
12125
|
label,
|
|
12126
|
+
showPercent,
|
|
12127
|
+
size,
|
|
12068
12128
|
className
|
|
12069
12129
|
}
|
|
12070
12130
|
);
|