@propknot/shared-ui 1.0.25 → 1.0.26
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/dist/index.js +402 -66
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +454 -142
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -0
- package/package.json +21 -5
- package/src/styles/globals.css +59 -0
package/dist/index.mjs
CHANGED
|
@@ -173,6 +173,13 @@ var require_notificationTypes = __commonJS({
|
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
175
|
|
|
176
|
+
// src/lib/utils.js
|
|
177
|
+
import { clsx } from "clsx";
|
|
178
|
+
import { twMerge } from "tailwind-merge";
|
|
179
|
+
function cn(...inputs) {
|
|
180
|
+
return twMerge(clsx(inputs));
|
|
181
|
+
}
|
|
182
|
+
|
|
176
183
|
// src/components/Navigation/Navbar.js
|
|
177
184
|
import React5, { useState as useState4, useEffect as useEffect3 } from "react";
|
|
178
185
|
import {
|
|
@@ -1554,10 +1561,8 @@ var CustomThemeProvider = ({ children }) => {
|
|
|
1554
1561
|
if (isEmbedded) return;
|
|
1555
1562
|
if (user && canModifyTheme) {
|
|
1556
1563
|
const themeToUse = user.themePreference || "light";
|
|
1557
|
-
console.log("[ThemeContext] Loading user theme preference:", themeToUse, "User:", user);
|
|
1558
1564
|
setCurrentTheme(themeToUse);
|
|
1559
1565
|
} else {
|
|
1560
|
-
console.log("[ThemeContext] No user or cannot modify theme, using light. User:", user, "canModifyTheme:", canModifyTheme);
|
|
1561
1566
|
setCurrentTheme("light");
|
|
1562
1567
|
}
|
|
1563
1568
|
}, [user, canModifyTheme, isEmbedded]);
|
|
@@ -3182,15 +3187,290 @@ var ModernCardContent = ({ children, sx = {}, ...props }) => {
|
|
|
3182
3187
|
ModernCard.Content = ModernCardContent;
|
|
3183
3188
|
var ModernCard_default = ModernCard;
|
|
3184
3189
|
|
|
3190
|
+
// src/components/UI/button.jsx
|
|
3191
|
+
import * as React13 from "react";
|
|
3192
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3193
|
+
import { cva } from "class-variance-authority";
|
|
3194
|
+
var buttonVariants = cva(
|
|
3195
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
3196
|
+
{
|
|
3197
|
+
variants: {
|
|
3198
|
+
variant: {
|
|
3199
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
3200
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
3201
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
3202
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
3203
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
3204
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
3205
|
+
},
|
|
3206
|
+
size: {
|
|
3207
|
+
default: "h-10 px-4 py-2",
|
|
3208
|
+
sm: "h-9 rounded-md px-3",
|
|
3209
|
+
lg: "h-11 rounded-md px-8",
|
|
3210
|
+
icon: "h-10 w-10"
|
|
3211
|
+
}
|
|
3212
|
+
},
|
|
3213
|
+
defaultVariants: {
|
|
3214
|
+
variant: "default",
|
|
3215
|
+
size: "default"
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3218
|
+
);
|
|
3219
|
+
var Button2 = React13.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
3220
|
+
const Comp = asChild ? Slot : "button";
|
|
3221
|
+
return /* @__PURE__ */ React13.createElement(
|
|
3222
|
+
Comp,
|
|
3223
|
+
{
|
|
3224
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
3225
|
+
ref,
|
|
3226
|
+
...props
|
|
3227
|
+
}
|
|
3228
|
+
);
|
|
3229
|
+
});
|
|
3230
|
+
Button2.displayName = "Button";
|
|
3231
|
+
|
|
3232
|
+
// src/components/UI/card.jsx
|
|
3233
|
+
import * as React14 from "react";
|
|
3234
|
+
var Card2 = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
3235
|
+
"div",
|
|
3236
|
+
{
|
|
3237
|
+
ref,
|
|
3238
|
+
className: cn(
|
|
3239
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
3240
|
+
className
|
|
3241
|
+
),
|
|
3242
|
+
...props
|
|
3243
|
+
}
|
|
3244
|
+
));
|
|
3245
|
+
Card2.displayName = "Card";
|
|
3246
|
+
var CardHeader = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
3247
|
+
"div",
|
|
3248
|
+
{
|
|
3249
|
+
ref,
|
|
3250
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
3251
|
+
...props
|
|
3252
|
+
}
|
|
3253
|
+
));
|
|
3254
|
+
CardHeader.displayName = "CardHeader";
|
|
3255
|
+
var CardTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
3256
|
+
"h3",
|
|
3257
|
+
{
|
|
3258
|
+
ref,
|
|
3259
|
+
className: cn(
|
|
3260
|
+
"text-2xl font-semibold leading-none tracking-tight",
|
|
3261
|
+
className
|
|
3262
|
+
),
|
|
3263
|
+
...props
|
|
3264
|
+
}
|
|
3265
|
+
));
|
|
3266
|
+
CardTitle.displayName = "CardTitle";
|
|
3267
|
+
var CardDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
3268
|
+
"p",
|
|
3269
|
+
{
|
|
3270
|
+
ref,
|
|
3271
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
3272
|
+
...props
|
|
3273
|
+
}
|
|
3274
|
+
));
|
|
3275
|
+
CardDescription.displayName = "CardDescription";
|
|
3276
|
+
var CardContent2 = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
3277
|
+
CardContent2.displayName = "CardContent";
|
|
3278
|
+
var CardFooter = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
3279
|
+
"div",
|
|
3280
|
+
{
|
|
3281
|
+
ref,
|
|
3282
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
3283
|
+
...props
|
|
3284
|
+
}
|
|
3285
|
+
));
|
|
3286
|
+
CardFooter.displayName = "CardFooter";
|
|
3287
|
+
|
|
3288
|
+
// src/components/UI/input.jsx
|
|
3289
|
+
import * as React15 from "react";
|
|
3290
|
+
var Input = React15.forwardRef(({ className, type, ...props }, ref) => {
|
|
3291
|
+
return /* @__PURE__ */ React15.createElement(
|
|
3292
|
+
"input",
|
|
3293
|
+
{
|
|
3294
|
+
type,
|
|
3295
|
+
className: cn(
|
|
3296
|
+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
3297
|
+
className
|
|
3298
|
+
),
|
|
3299
|
+
ref,
|
|
3300
|
+
...props
|
|
3301
|
+
}
|
|
3302
|
+
);
|
|
3303
|
+
});
|
|
3304
|
+
Input.displayName = "Input";
|
|
3305
|
+
|
|
3306
|
+
// src/components/UI/label.jsx
|
|
3307
|
+
import * as React16 from "react";
|
|
3308
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3309
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
3310
|
+
var labelVariants = cva2(
|
|
3311
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
3312
|
+
);
|
|
3313
|
+
var Label = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React16.createElement(
|
|
3314
|
+
LabelPrimitive.Root,
|
|
3315
|
+
{
|
|
3316
|
+
ref,
|
|
3317
|
+
className: cn(labelVariants(), className),
|
|
3318
|
+
...props
|
|
3319
|
+
}
|
|
3320
|
+
));
|
|
3321
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
3322
|
+
|
|
3323
|
+
// src/components/UI/typography.jsx
|
|
3324
|
+
import * as React17 from "react";
|
|
3325
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
3326
|
+
var headingVariants = cva3("scroll-m-20 tracking-tight", {
|
|
3327
|
+
variants: {
|
|
3328
|
+
level: {
|
|
3329
|
+
h1: "text-4xl font-extrabold lg:text-5xl",
|
|
3330
|
+
h2: "text-3xl font-semibold",
|
|
3331
|
+
h3: "text-2xl font-semibold",
|
|
3332
|
+
h4: "text-xl font-semibold",
|
|
3333
|
+
h5: "text-lg font-semibold",
|
|
3334
|
+
h6: "text-base font-semibold"
|
|
3335
|
+
}
|
|
3336
|
+
},
|
|
3337
|
+
defaultVariants: {
|
|
3338
|
+
level: "h2"
|
|
3339
|
+
}
|
|
3340
|
+
});
|
|
3341
|
+
var Heading = React17.forwardRef(({ className, level = "h2", ...props }, ref) => {
|
|
3342
|
+
const Comp = level;
|
|
3343
|
+
return /* @__PURE__ */ React17.createElement(
|
|
3344
|
+
Comp,
|
|
3345
|
+
{
|
|
3346
|
+
ref,
|
|
3347
|
+
className: cn(headingVariants({ level, className })),
|
|
3348
|
+
...props
|
|
3349
|
+
}
|
|
3350
|
+
);
|
|
3351
|
+
});
|
|
3352
|
+
Heading.displayName = "Heading";
|
|
3353
|
+
var H1 = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3354
|
+
"h1",
|
|
3355
|
+
{
|
|
3356
|
+
ref,
|
|
3357
|
+
className: cn("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl", className),
|
|
3358
|
+
...props
|
|
3359
|
+
}
|
|
3360
|
+
));
|
|
3361
|
+
H1.displayName = "H1";
|
|
3362
|
+
var H2 = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3363
|
+
"h2",
|
|
3364
|
+
{
|
|
3365
|
+
ref,
|
|
3366
|
+
className: cn("scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0", className),
|
|
3367
|
+
...props
|
|
3368
|
+
}
|
|
3369
|
+
));
|
|
3370
|
+
H2.displayName = "H2";
|
|
3371
|
+
var H3 = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3372
|
+
"h3",
|
|
3373
|
+
{
|
|
3374
|
+
ref,
|
|
3375
|
+
className: cn("scroll-m-20 text-2xl font-semibold tracking-tight", className),
|
|
3376
|
+
...props
|
|
3377
|
+
}
|
|
3378
|
+
));
|
|
3379
|
+
H3.displayName = "H3";
|
|
3380
|
+
var H4 = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3381
|
+
"h4",
|
|
3382
|
+
{
|
|
3383
|
+
ref,
|
|
3384
|
+
className: cn("scroll-m-20 text-xl font-semibold tracking-tight", className),
|
|
3385
|
+
...props
|
|
3386
|
+
}
|
|
3387
|
+
));
|
|
3388
|
+
H4.displayName = "H4";
|
|
3389
|
+
var P = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3390
|
+
"p",
|
|
3391
|
+
{
|
|
3392
|
+
ref,
|
|
3393
|
+
className: cn("leading-7 [&:not(:first-child)]:mt-6", className),
|
|
3394
|
+
...props
|
|
3395
|
+
}
|
|
3396
|
+
));
|
|
3397
|
+
P.displayName = "P";
|
|
3398
|
+
var Blockquote = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3399
|
+
"blockquote",
|
|
3400
|
+
{
|
|
3401
|
+
ref,
|
|
3402
|
+
className: cn("mt-6 border-l-2 pl-6 italic", className),
|
|
3403
|
+
...props
|
|
3404
|
+
}
|
|
3405
|
+
));
|
|
3406
|
+
Blockquote.displayName = "Blockquote";
|
|
3407
|
+
var List2 = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3408
|
+
"ul",
|
|
3409
|
+
{
|
|
3410
|
+
ref,
|
|
3411
|
+
className: cn("my-6 ml-6 list-disc [&>li]:mt-2", className),
|
|
3412
|
+
...props
|
|
3413
|
+
}
|
|
3414
|
+
));
|
|
3415
|
+
List2.displayName = "List";
|
|
3416
|
+
var InlineCode = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3417
|
+
"code",
|
|
3418
|
+
{
|
|
3419
|
+
ref,
|
|
3420
|
+
className: cn(
|
|
3421
|
+
"relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",
|
|
3422
|
+
className
|
|
3423
|
+
),
|
|
3424
|
+
...props
|
|
3425
|
+
}
|
|
3426
|
+
));
|
|
3427
|
+
InlineCode.displayName = "InlineCode";
|
|
3428
|
+
var Lead = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3429
|
+
"p",
|
|
3430
|
+
{
|
|
3431
|
+
ref,
|
|
3432
|
+
className: cn("text-xl text-muted-foreground", className),
|
|
3433
|
+
...props
|
|
3434
|
+
}
|
|
3435
|
+
));
|
|
3436
|
+
Lead.displayName = "Lead";
|
|
3437
|
+
var Large = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3438
|
+
"div",
|
|
3439
|
+
{
|
|
3440
|
+
ref,
|
|
3441
|
+
className: cn("text-lg font-semibold", className),
|
|
3442
|
+
...props
|
|
3443
|
+
}
|
|
3444
|
+
));
|
|
3445
|
+
Large.displayName = "Large";
|
|
3446
|
+
var Small = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3447
|
+
"small",
|
|
3448
|
+
{
|
|
3449
|
+
ref,
|
|
3450
|
+
className: cn("text-sm font-medium leading-none", className),
|
|
3451
|
+
...props
|
|
3452
|
+
}
|
|
3453
|
+
));
|
|
3454
|
+
Small.displayName = "Small";
|
|
3455
|
+
var Muted = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React17.createElement(
|
|
3456
|
+
"p",
|
|
3457
|
+
{
|
|
3458
|
+
ref,
|
|
3459
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
3460
|
+
...props
|
|
3461
|
+
}
|
|
3462
|
+
));
|
|
3463
|
+
Muted.displayName = "Muted";
|
|
3464
|
+
|
|
3185
3465
|
// src/components/Notifications/NotificationManager.js
|
|
3186
|
-
import
|
|
3466
|
+
import React18 from "react";
|
|
3187
3467
|
import {
|
|
3188
3468
|
Box as Box8,
|
|
3189
3469
|
Snackbar,
|
|
3190
3470
|
Alert,
|
|
3191
3471
|
AlertTitle,
|
|
3192
3472
|
IconButton as IconButton2,
|
|
3193
|
-
Button as
|
|
3473
|
+
Button as Button3,
|
|
3194
3474
|
LinearProgress,
|
|
3195
3475
|
Typography as Typography6,
|
|
3196
3476
|
Slide,
|
|
@@ -3216,12 +3496,12 @@ var NotificationItem = ({ notification, onClose, onAction }) => {
|
|
|
3216
3496
|
}
|
|
3217
3497
|
const getSeverityIcon = (type) => {
|
|
3218
3498
|
const icons = {
|
|
3219
|
-
success: /* @__PURE__ */
|
|
3220
|
-
error: /* @__PURE__ */
|
|
3221
|
-
warning: /* @__PURE__ */
|
|
3222
|
-
info: /* @__PURE__ */
|
|
3499
|
+
success: /* @__PURE__ */ React18.createElement(CheckCircle, null),
|
|
3500
|
+
error: /* @__PURE__ */ React18.createElement(Error2, null),
|
|
3501
|
+
warning: /* @__PURE__ */ React18.createElement(Warning, null),
|
|
3502
|
+
info: /* @__PURE__ */ React18.createElement(Info, null)
|
|
3223
3503
|
};
|
|
3224
|
-
return icons[type] || /* @__PURE__ */
|
|
3504
|
+
return icons[type] || /* @__PURE__ */ React18.createElement(Info, null);
|
|
3225
3505
|
};
|
|
3226
3506
|
const handleActionClick = (action) => {
|
|
3227
3507
|
if (action && action.onClick) {
|
|
@@ -3236,13 +3516,13 @@ var NotificationItem = ({ notification, onClose, onAction }) => {
|
|
|
3236
3516
|
onClose();
|
|
3237
3517
|
}
|
|
3238
3518
|
};
|
|
3239
|
-
return /* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ React18.createElement(
|
|
3240
3520
|
Alert,
|
|
3241
3521
|
{
|
|
3242
3522
|
severity: notification.type,
|
|
3243
3523
|
icon: getSeverityIcon(notification.type),
|
|
3244
|
-
action: /* @__PURE__ */
|
|
3245
|
-
|
|
3524
|
+
action: /* @__PURE__ */ React18.createElement(Box8, { display: "flex", alignItems: "center", gap: 1 }, (_a = notification.actions) == null ? void 0 : _a.map((action, index) => /* @__PURE__ */ React18.createElement(
|
|
3525
|
+
Button3,
|
|
3246
3526
|
{
|
|
3247
3527
|
key: index,
|
|
3248
3528
|
size: "small",
|
|
@@ -3257,14 +3537,14 @@ var NotificationItem = ({ notification, onClose, onAction }) => {
|
|
|
3257
3537
|
}
|
|
3258
3538
|
},
|
|
3259
3539
|
action.label
|
|
3260
|
-
)), typeof notification.progress === "number" && /* @__PURE__ */
|
|
3540
|
+
)), typeof notification.progress === "number" && /* @__PURE__ */ React18.createElement(Box8, { sx: { minWidth: 120 } }, /* @__PURE__ */ React18.createElement(
|
|
3261
3541
|
LinearProgress,
|
|
3262
3542
|
{
|
|
3263
3543
|
variant: "determinate",
|
|
3264
3544
|
value: notification.progress,
|
|
3265
3545
|
sx: { height: 6, borderRadius: 3 }
|
|
3266
3546
|
}
|
|
3267
|
-
), /* @__PURE__ */
|
|
3547
|
+
), /* @__PURE__ */ React18.createElement(Typography6, { variant: "caption", sx: { fontSize: "0.7rem" } }, Math.round(notification.progress), "%")), notification.timestamp && /* @__PURE__ */ React18.createElement(
|
|
3268
3548
|
Chip,
|
|
3269
3549
|
{
|
|
3270
3550
|
label: (() => {
|
|
@@ -3282,14 +3562,14 @@ var NotificationItem = ({ notification, onClose, onAction }) => {
|
|
|
3282
3562
|
opacity: 0.7
|
|
3283
3563
|
}
|
|
3284
3564
|
}
|
|
3285
|
-
), notification.dismissible && /* @__PURE__ */
|
|
3565
|
+
), notification.dismissible && /* @__PURE__ */ React18.createElement(
|
|
3286
3566
|
IconButton2,
|
|
3287
3567
|
{
|
|
3288
3568
|
size: "small",
|
|
3289
3569
|
onClick: safeOnClose,
|
|
3290
3570
|
sx: { ml: 1 }
|
|
3291
3571
|
},
|
|
3292
|
-
/* @__PURE__ */
|
|
3572
|
+
/* @__PURE__ */ React18.createElement(Close, { fontSize: "small" })
|
|
3293
3573
|
)),
|
|
3294
3574
|
sx: {
|
|
3295
3575
|
mb: 1,
|
|
@@ -3299,8 +3579,8 @@ var NotificationItem = ({ notification, onClose, onAction }) => {
|
|
|
3299
3579
|
}
|
|
3300
3580
|
}
|
|
3301
3581
|
},
|
|
3302
|
-
notification.title && /* @__PURE__ */
|
|
3303
|
-
/* @__PURE__ */
|
|
3582
|
+
notification.title && /* @__PURE__ */ React18.createElement(AlertTitle, { sx: { fontSize: "0.875rem", mb: 0.5 } }, notification.title),
|
|
3583
|
+
/* @__PURE__ */ React18.createElement(Typography6, { variant: "body2", sx: { fontSize: "0.8rem" } }, notification.message)
|
|
3304
3584
|
);
|
|
3305
3585
|
};
|
|
3306
3586
|
var NotificationManager = () => {
|
|
@@ -3311,7 +3591,7 @@ var NotificationManager = () => {
|
|
|
3311
3591
|
if (notifications.length === 0) {
|
|
3312
3592
|
return null;
|
|
3313
3593
|
}
|
|
3314
|
-
return /* @__PURE__ */
|
|
3594
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, persistentNotifications.length > 0 && /* @__PURE__ */ React18.createElement(
|
|
3315
3595
|
Box8,
|
|
3316
3596
|
{
|
|
3317
3597
|
sx: {
|
|
@@ -3325,8 +3605,8 @@ var NotificationManager = () => {
|
|
|
3325
3605
|
overflow: "auto"
|
|
3326
3606
|
}
|
|
3327
3607
|
},
|
|
3328
|
-
/* @__PURE__ */
|
|
3329
|
-
|
|
3608
|
+
/* @__PURE__ */ React18.createElement(Stack5, { spacing: 1 }, persistentNotifications.length > 1 && /* @__PURE__ */ React18.createElement(Box8, { display: "flex", justifyContent: "flex-end", mb: 1 }, /* @__PURE__ */ React18.createElement(
|
|
3609
|
+
Button3,
|
|
3330
3610
|
{
|
|
3331
3611
|
size: "small",
|
|
3332
3612
|
variant: "outlined",
|
|
@@ -3338,7 +3618,7 @@ var NotificationManager = () => {
|
|
|
3338
3618
|
")"
|
|
3339
3619
|
)), persistentNotifications.map((notification) => {
|
|
3340
3620
|
if (!notification || !notification.id) return null;
|
|
3341
|
-
return /* @__PURE__ */
|
|
3621
|
+
return /* @__PURE__ */ React18.createElement(Fade, { key: `notification-${notification.id}`, in: true, timeout: 300 }, /* @__PURE__ */ React18.createElement(Box8, null, /* @__PURE__ */ React18.createElement(
|
|
3342
3622
|
NotificationItem,
|
|
3343
3623
|
{
|
|
3344
3624
|
notification,
|
|
@@ -3346,7 +3626,7 @@ var NotificationManager = () => {
|
|
|
3346
3626
|
}
|
|
3347
3627
|
)));
|
|
3348
3628
|
}))
|
|
3349
|
-
), latestTemporary && /* @__PURE__ */
|
|
3629
|
+
), latestTemporary && /* @__PURE__ */ React18.createElement(
|
|
3350
3630
|
Snackbar,
|
|
3351
3631
|
{
|
|
3352
3632
|
key: `temp-notification-${latestTemporary.id}`,
|
|
@@ -3362,7 +3642,7 @@ var NotificationManager = () => {
|
|
|
3362
3642
|
}
|
|
3363
3643
|
}
|
|
3364
3644
|
},
|
|
3365
|
-
/* @__PURE__ */
|
|
3645
|
+
/* @__PURE__ */ React18.createElement(Box8, null, /* @__PURE__ */ React18.createElement(
|
|
3366
3646
|
NotificationItem,
|
|
3367
3647
|
{
|
|
3368
3648
|
notification: latestTemporary,
|
|
@@ -3374,7 +3654,7 @@ var NotificationManager = () => {
|
|
|
3374
3654
|
var NotificationManager_default = NotificationManager;
|
|
3375
3655
|
|
|
3376
3656
|
// src/components/Notifications/NotificationBell.js
|
|
3377
|
-
import
|
|
3657
|
+
import React19, { useState as useState6, useEffect as useEffect5, useCallback as useCallback2 } from "react";
|
|
3378
3658
|
import {
|
|
3379
3659
|
IconButton as IconButton3,
|
|
3380
3660
|
Badge as Badge2,
|
|
@@ -3386,9 +3666,9 @@ import {
|
|
|
3386
3666
|
Avatar as Avatar2,
|
|
3387
3667
|
ListItemText as ListItemText2,
|
|
3388
3668
|
ListItemAvatar,
|
|
3389
|
-
List as
|
|
3669
|
+
List as List3,
|
|
3390
3670
|
ListItem as ListItem2,
|
|
3391
|
-
Button as
|
|
3671
|
+
Button as Button4,
|
|
3392
3672
|
Chip as Chip2,
|
|
3393
3673
|
CircularProgress as CircularProgress3,
|
|
3394
3674
|
Alert as Alert2
|
|
@@ -3469,7 +3749,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3469
3749
|
};
|
|
3470
3750
|
const handleNotificationRead = (notificationId) => {
|
|
3471
3751
|
setNotifications(
|
|
3472
|
-
(prev) => prev.map((n) => n._id === notificationId ? { ...n, read: true } : n)
|
|
3752
|
+
(prev) => prev.map((n) => (n.id || n._id) === notificationId ? { ...n, is_read: true, read: true } : n)
|
|
3473
3753
|
);
|
|
3474
3754
|
setUnreadCount((prev) => Math.max(0, prev - 1));
|
|
3475
3755
|
};
|
|
@@ -3494,7 +3774,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3494
3774
|
try {
|
|
3495
3775
|
await api2.put(`/notifications/${notificationId}/read`);
|
|
3496
3776
|
setNotifications(
|
|
3497
|
-
(prev) => prev.map((n) => n._id === notificationId ? { ...n, read: true, readAt: /* @__PURE__ */ new Date() } : n)
|
|
3777
|
+
(prev) => prev.map((n) => (n.id || n._id) === notificationId ? { ...n, is_read: true, read: true, read_at: /* @__PURE__ */ new Date(), readAt: /* @__PURE__ */ new Date() } : n)
|
|
3498
3778
|
);
|
|
3499
3779
|
setUnreadCount((prev) => Math.max(0, prev - 1));
|
|
3500
3780
|
} catch (err) {
|
|
@@ -3506,7 +3786,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3506
3786
|
try {
|
|
3507
3787
|
await api2.put("/notifications/mark-all-read");
|
|
3508
3788
|
setNotifications(
|
|
3509
|
-
(prev) => prev.map((n) => ({ ...n, read: true, readAt: /* @__PURE__ */ new Date() }))
|
|
3789
|
+
(prev) => prev.map((n) => ({ ...n, is_read: true, read: true, read_at: /* @__PURE__ */ new Date(), readAt: /* @__PURE__ */ new Date() }))
|
|
3510
3790
|
);
|
|
3511
3791
|
setUnreadCount(0);
|
|
3512
3792
|
} catch (err) {
|
|
@@ -3514,11 +3794,14 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3514
3794
|
}
|
|
3515
3795
|
};
|
|
3516
3796
|
const handleNotificationClick = async (notification) => {
|
|
3517
|
-
|
|
3518
|
-
|
|
3797
|
+
const isRead = notification.is_read || notification.read;
|
|
3798
|
+
const notifId = notification.id || notification._id;
|
|
3799
|
+
if (!isRead) {
|
|
3800
|
+
await handleMarkAsRead(notifId);
|
|
3519
3801
|
}
|
|
3520
|
-
|
|
3521
|
-
|
|
3802
|
+
const actionUrl = notification.action_url || notification.actionUrl;
|
|
3803
|
+
if (actionUrl) {
|
|
3804
|
+
window.location.href = actionUrl;
|
|
3522
3805
|
}
|
|
3523
3806
|
handleClose();
|
|
3524
3807
|
};
|
|
@@ -3536,30 +3819,30 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3536
3819
|
case "TICKET_RESOLVED":
|
|
3537
3820
|
case "TICKET_COMMENTED":
|
|
3538
3821
|
case "TICKET_STATUS_CHANGED":
|
|
3539
|
-
return /* @__PURE__ */
|
|
3822
|
+
return /* @__PURE__ */ React19.createElement(Assignment, { ...iconProps });
|
|
3540
3823
|
case "MESSAGE_RECEIVED":
|
|
3541
3824
|
case "MENTION_RECEIVED":
|
|
3542
|
-
return /* @__PURE__ */
|
|
3825
|
+
return /* @__PURE__ */ React19.createElement(Message, { ...iconProps });
|
|
3543
3826
|
case "PAYMENT_DUE":
|
|
3544
3827
|
case "PAYMENT_OVERDUE":
|
|
3545
|
-
return /* @__PURE__ */
|
|
3828
|
+
return /* @__PURE__ */ React19.createElement(Payment, { ...iconProps });
|
|
3546
3829
|
case "PROPERTY_UPDATED":
|
|
3547
3830
|
case "LEASE_EXPIRING":
|
|
3548
|
-
return /* @__PURE__ */
|
|
3831
|
+
return /* @__PURE__ */ React19.createElement(Home, { ...iconProps });
|
|
3549
3832
|
case "APPLIANCE_MAINTENANCE_DUE":
|
|
3550
3833
|
case "MAINTENANCE_SCHEDULED":
|
|
3551
|
-
return /* @__PURE__ */
|
|
3834
|
+
return /* @__PURE__ */ React19.createElement(Build, { ...iconProps });
|
|
3552
3835
|
case "SYSTEM_ALERT":
|
|
3553
|
-
return /* @__PURE__ */
|
|
3836
|
+
return /* @__PURE__ */ React19.createElement(Warning2, { ...iconProps });
|
|
3554
3837
|
case "SUCCESS":
|
|
3555
|
-
return /* @__PURE__ */
|
|
3838
|
+
return /* @__PURE__ */ React19.createElement(CheckCircle2, { ...iconProps });
|
|
3556
3839
|
case "ERROR":
|
|
3557
|
-
return /* @__PURE__ */
|
|
3840
|
+
return /* @__PURE__ */ React19.createElement(ErrorIcon, { ...iconProps });
|
|
3558
3841
|
case "WARNING":
|
|
3559
|
-
return /* @__PURE__ */
|
|
3842
|
+
return /* @__PURE__ */ React19.createElement(Warning2, { ...iconProps });
|
|
3560
3843
|
case "INFO":
|
|
3561
3844
|
default:
|
|
3562
|
-
return /* @__PURE__ */
|
|
3845
|
+
return /* @__PURE__ */ React19.createElement(Info2, { ...iconProps });
|
|
3563
3846
|
}
|
|
3564
3847
|
};
|
|
3565
3848
|
const getNotificationColor = (type) => {
|
|
@@ -3574,7 +3857,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3574
3857
|
HIGH: "warning",
|
|
3575
3858
|
URGENT: "error"
|
|
3576
3859
|
};
|
|
3577
|
-
return /* @__PURE__ */
|
|
3860
|
+
return /* @__PURE__ */ React19.createElement(
|
|
3578
3861
|
Chip2,
|
|
3579
3862
|
{
|
|
3580
3863
|
label: priority,
|
|
@@ -3584,7 +3867,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3584
3867
|
}
|
|
3585
3868
|
);
|
|
3586
3869
|
};
|
|
3587
|
-
return /* @__PURE__ */
|
|
3870
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
|
|
3588
3871
|
IconButton3,
|
|
3589
3872
|
{
|
|
3590
3873
|
color: "inherit",
|
|
@@ -3596,16 +3879,16 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3596
3879
|
}
|
|
3597
3880
|
}
|
|
3598
3881
|
},
|
|
3599
|
-
/* @__PURE__ */
|
|
3882
|
+
/* @__PURE__ */ React19.createElement(
|
|
3600
3883
|
Badge2,
|
|
3601
3884
|
{
|
|
3602
3885
|
badgeContent: unreadCount,
|
|
3603
3886
|
color: "error",
|
|
3604
3887
|
max: 99
|
|
3605
3888
|
},
|
|
3606
|
-
unreadCount > 0 ? /* @__PURE__ */
|
|
3889
|
+
unreadCount > 0 ? /* @__PURE__ */ React19.createElement(NotificationsIcon, null) : /* @__PURE__ */ React19.createElement(NotificationsNone, null)
|
|
3607
3890
|
)
|
|
3608
|
-
), /* @__PURE__ */
|
|
3891
|
+
), /* @__PURE__ */ React19.createElement(
|
|
3609
3892
|
Menu2,
|
|
3610
3893
|
{
|
|
3611
3894
|
anchorEl,
|
|
@@ -3623,7 +3906,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3623
3906
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
3624
3907
|
anchorOrigin: { horizontal: "right", vertical: "bottom" }
|
|
3625
3908
|
},
|
|
3626
|
-
/* @__PURE__ */
|
|
3909
|
+
/* @__PURE__ */ React19.createElement(
|
|
3627
3910
|
Box9,
|
|
3628
3911
|
{
|
|
3629
3912
|
sx: {
|
|
@@ -3636,7 +3919,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3636
3919
|
borderColor: "divider"
|
|
3637
3920
|
}
|
|
3638
3921
|
},
|
|
3639
|
-
/* @__PURE__ */
|
|
3922
|
+
/* @__PURE__ */ React19.createElement(Box9, { sx: { display: "flex", alignItems: "center", gap: 1 } }, /* @__PURE__ */ React19.createElement(NotificationsIcon, { color: "primary" }), /* @__PURE__ */ React19.createElement(Typography7, { variant: "h6", sx: { fontWeight: 600 } }, "Notifications"), unreadCount > 0 && /* @__PURE__ */ React19.createElement(
|
|
3640
3923
|
Chip2,
|
|
3641
3924
|
{
|
|
3642
3925
|
label: unreadCount,
|
|
@@ -3645,19 +3928,19 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3645
3928
|
sx: { height: 22, fontSize: "0.75rem" }
|
|
3646
3929
|
}
|
|
3647
3930
|
)),
|
|
3648
|
-
/* @__PURE__ */
|
|
3649
|
-
|
|
3931
|
+
/* @__PURE__ */ React19.createElement(Box9, null, unreadCount > 0 && /* @__PURE__ */ React19.createElement(
|
|
3932
|
+
Button4,
|
|
3650
3933
|
{
|
|
3651
3934
|
size: "small",
|
|
3652
|
-
startIcon: /* @__PURE__ */
|
|
3935
|
+
startIcon: /* @__PURE__ */ React19.createElement(DoneAll, null),
|
|
3653
3936
|
onClick: handleMarkAllAsRead,
|
|
3654
3937
|
sx: { textTransform: "none", fontSize: "0.75rem" }
|
|
3655
3938
|
},
|
|
3656
3939
|
"Mark all read"
|
|
3657
|
-
), /* @__PURE__ */
|
|
3940
|
+
), /* @__PURE__ */ React19.createElement(IconButton3, { size: "small", onClick: handleClose }, /* @__PURE__ */ React19.createElement(Close2, { fontSize: "small" })))
|
|
3658
3941
|
),
|
|
3659
|
-
error && /* @__PURE__ */
|
|
3660
|
-
/* @__PURE__ */
|
|
3942
|
+
error && /* @__PURE__ */ React19.createElement(Alert2, { severity: "error", sx: { m: 2 } }, error),
|
|
3943
|
+
/* @__PURE__ */ React19.createElement(
|
|
3661
3944
|
Box9,
|
|
3662
3945
|
{
|
|
3663
3946
|
sx: {
|
|
@@ -3666,7 +3949,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3666
3949
|
maxHeight: 450
|
|
3667
3950
|
}
|
|
3668
3951
|
},
|
|
3669
|
-
loading && notifications.length === 0 ? /* @__PURE__ */
|
|
3952
|
+
loading && notifications.length === 0 ? /* @__PURE__ */ React19.createElement(Box9, { sx: { display: "flex", justifyContent: "center", p: 4 } }, /* @__PURE__ */ React19.createElement(CircularProgress3, { size: 32 })) : notifications.length === 0 ? /* @__PURE__ */ React19.createElement(
|
|
3670
3953
|
Box9,
|
|
3671
3954
|
{
|
|
3672
3955
|
sx: {
|
|
@@ -3678,71 +3961,76 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3678
3961
|
textAlign: "center"
|
|
3679
3962
|
}
|
|
3680
3963
|
},
|
|
3681
|
-
/* @__PURE__ */
|
|
3682
|
-
/* @__PURE__ */
|
|
3683
|
-
/* @__PURE__ */
|
|
3684
|
-
) : /* @__PURE__ */
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
py: 1.5,
|
|
3691
|
-
px: 2,
|
|
3692
|
-
bgcolor: notification.read ? "transparent" : "action.hover",
|
|
3693
|
-
"&:hover": {
|
|
3694
|
-
bgcolor: notification.read ? "action.hover" : "action.selected"
|
|
3695
|
-
},
|
|
3696
|
-
borderLeft: notification.read ? "none" : "3px solid",
|
|
3697
|
-
borderLeftColor: getNotificationColor(notification.type),
|
|
3698
|
-
transition: "all 0.2s"
|
|
3699
|
-
}
|
|
3700
|
-
},
|
|
3701
|
-
/* @__PURE__ */ React14.createElement(ListItemAvatar, null, /* @__PURE__ */ React14.createElement(
|
|
3702
|
-
Avatar2,
|
|
3964
|
+
/* @__PURE__ */ React19.createElement(NotificationsNone, { sx: { fontSize: 64, color: "text.secondary", mb: 2 } }),
|
|
3965
|
+
/* @__PURE__ */ React19.createElement(Typography7, { variant: "body1", color: "text.secondary", sx: { fontWeight: 500 } }, "No notifications yet"),
|
|
3966
|
+
/* @__PURE__ */ React19.createElement(Typography7, { variant: "body2", color: "text.secondary" }, "You're all caught up!")
|
|
3967
|
+
) : /* @__PURE__ */ React19.createElement(List3, { sx: { p: 0 } }, notifications.map((notification, index) => {
|
|
3968
|
+
const isRead = notification.is_read || notification.read;
|
|
3969
|
+
const notifId = notification.id || notification._id;
|
|
3970
|
+
const createdAt = notification.created_at || notification.createdAt;
|
|
3971
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, { key: notifId }, /* @__PURE__ */ React19.createElement(
|
|
3972
|
+
ListItem2,
|
|
3703
3973
|
{
|
|
3974
|
+
button: true,
|
|
3975
|
+
onClick: () => handleNotificationClick(notification),
|
|
3704
3976
|
sx: {
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3977
|
+
py: 1.5,
|
|
3978
|
+
px: 2,
|
|
3979
|
+
bgcolor: isRead ? "transparent" : "action.hover",
|
|
3980
|
+
"&:hover": {
|
|
3981
|
+
bgcolor: isRead ? "action.hover" : "action.selected"
|
|
3982
|
+
},
|
|
3983
|
+
borderLeft: isRead ? "none" : "3px solid",
|
|
3984
|
+
borderLeftColor: getNotificationColor(notification.type),
|
|
3985
|
+
transition: "all 0.2s"
|
|
3708
3986
|
}
|
|
3709
3987
|
},
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3988
|
+
/* @__PURE__ */ React19.createElement(ListItemAvatar, null, /* @__PURE__ */ React19.createElement(
|
|
3989
|
+
Avatar2,
|
|
3990
|
+
{
|
|
3991
|
+
sx: {
|
|
3992
|
+
bgcolor: isRead ? "grey.300" : getNotificationColor(notification.type),
|
|
3993
|
+
width: 40,
|
|
3994
|
+
height: 40
|
|
3995
|
+
}
|
|
3996
|
+
},
|
|
3997
|
+
getNotificationIcon(notification.type)
|
|
3998
|
+
)),
|
|
3999
|
+
/* @__PURE__ */ React19.createElement(
|
|
4000
|
+
ListItemText2,
|
|
4001
|
+
{
|
|
4002
|
+
primary: /* @__PURE__ */ React19.createElement(Box9, { sx: { display: "flex", alignItems: "center", mb: 0.5 } }, /* @__PURE__ */ React19.createElement(
|
|
4003
|
+
Typography7,
|
|
4004
|
+
{
|
|
4005
|
+
variant: "body2",
|
|
4006
|
+
sx: {
|
|
4007
|
+
fontWeight: isRead ? 400 : 600,
|
|
4008
|
+
flex: 1
|
|
4009
|
+
}
|
|
4010
|
+
},
|
|
4011
|
+
notification.title
|
|
4012
|
+
), getPriorityChip(notification.priority)),
|
|
4013
|
+
secondary: /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
|
|
4014
|
+
Typography7,
|
|
4015
|
+
{
|
|
4016
|
+
variant: "body2",
|
|
4017
|
+
color: "text.secondary",
|
|
4018
|
+
sx: {
|
|
4019
|
+
display: "-webkit-box",
|
|
4020
|
+
WebkitLineClamp: 2,
|
|
4021
|
+
WebkitBoxOrient: "vertical",
|
|
4022
|
+
overflow: "hidden",
|
|
4023
|
+
mb: 0.5
|
|
4024
|
+
}
|
|
4025
|
+
},
|
|
4026
|
+
notification.message
|
|
4027
|
+
), /* @__PURE__ */ React19.createElement(Typography7, { variant: "caption", color: "text.secondary" }, formatDistanceToNow(new Date(createdAt), { addSuffix: true })))
|
|
4028
|
+
}
|
|
4029
|
+
)
|
|
4030
|
+
), index < notifications.length - 1 && /* @__PURE__ */ React19.createElement(Divider2, null));
|
|
4031
|
+
})),
|
|
4032
|
+
hasMore && notifications.length > 0 && /* @__PURE__ */ React19.createElement(Box9, { sx: { p: 2, textAlign: "center", borderTop: "1px solid", borderColor: "divider" } }, /* @__PURE__ */ React19.createElement(
|
|
4033
|
+
Button4,
|
|
3746
4034
|
{
|
|
3747
4035
|
onClick: handleLoadMore,
|
|
3748
4036
|
disabled: loading,
|
|
@@ -3752,7 +4040,7 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3752
4040
|
loading ? "Loading..." : "Load more"
|
|
3753
4041
|
))
|
|
3754
4042
|
),
|
|
3755
|
-
/* @__PURE__ */
|
|
4043
|
+
/* @__PURE__ */ React19.createElement(
|
|
3756
4044
|
Box9,
|
|
3757
4045
|
{
|
|
3758
4046
|
sx: {
|
|
@@ -3762,11 +4050,11 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3762
4050
|
textAlign: "center"
|
|
3763
4051
|
}
|
|
3764
4052
|
},
|
|
3765
|
-
/* @__PURE__ */
|
|
3766
|
-
|
|
4053
|
+
/* @__PURE__ */ React19.createElement(
|
|
4054
|
+
Button4,
|
|
3767
4055
|
{
|
|
3768
4056
|
size: "small",
|
|
3769
|
-
startIcon: /* @__PURE__ */
|
|
4057
|
+
startIcon: /* @__PURE__ */ React19.createElement(SettingsIcon, null),
|
|
3770
4058
|
onClick: () => {
|
|
3771
4059
|
window.location.href = "/settings?tab=general";
|
|
3772
4060
|
handleClose();
|
|
@@ -3781,13 +4069,13 @@ var NotificationBell = ({ api: api2, useSocket: useSocket2, useAuth: useAuth2 })
|
|
|
3781
4069
|
var NotificationBell_default = NotificationBell;
|
|
3782
4070
|
|
|
3783
4071
|
// src/components/ErrorBoundary/ErrorBoundary.js
|
|
3784
|
-
import
|
|
4072
|
+
import React20 from "react";
|
|
3785
4073
|
import {
|
|
3786
4074
|
Box as Box10,
|
|
3787
4075
|
Typography as Typography8,
|
|
3788
|
-
Button as
|
|
3789
|
-
Card as
|
|
3790
|
-
CardContent as
|
|
4076
|
+
Button as Button5,
|
|
4077
|
+
Card as Card3,
|
|
4078
|
+
CardContent as CardContent3,
|
|
3791
4079
|
Alert as Alert3,
|
|
3792
4080
|
Stack as Stack6
|
|
3793
4081
|
} from "@mui/material";
|
|
@@ -3796,7 +4084,7 @@ import {
|
|
|
3796
4084
|
BugReport,
|
|
3797
4085
|
Home as Home2
|
|
3798
4086
|
} from "@mui/icons-material";
|
|
3799
|
-
var ErrorBoundary = class extends
|
|
4087
|
+
var ErrorBoundary = class extends React20.Component {
|
|
3800
4088
|
constructor(props) {
|
|
3801
4089
|
super(props);
|
|
3802
4090
|
this.state = {
|
|
@@ -3837,7 +4125,7 @@ var ErrorBoundary = class extends React15.Component {
|
|
|
3837
4125
|
if (this.state.hasError) {
|
|
3838
4126
|
const isNavigationError = (_b = (_a = this.state.error) == null ? void 0 : _a.message) == null ? void 0 : _b.includes("getBoundingClientRect");
|
|
3839
4127
|
const isDOMError = ((_d = (_c = this.state.error) == null ? void 0 : _c.message) == null ? void 0 : _d.includes("null")) || ((_f = (_e = this.state.error) == null ? void 0 : _e.message) == null ? void 0 : _f.includes("undefined"));
|
|
3840
|
-
return /* @__PURE__ */
|
|
4128
|
+
return /* @__PURE__ */ React20.createElement(
|
|
3841
4129
|
Box10,
|
|
3842
4130
|
{
|
|
3843
4131
|
sx: {
|
|
@@ -3849,32 +4137,32 @@ var ErrorBoundary = class extends React15.Component {
|
|
|
3849
4137
|
p: 3
|
|
3850
4138
|
}
|
|
3851
4139
|
},
|
|
3852
|
-
/* @__PURE__ */
|
|
3853
|
-
|
|
4140
|
+
/* @__PURE__ */ React20.createElement(Card3, { sx: { maxWidth: 600, width: "100%" } }, /* @__PURE__ */ React20.createElement(CardContent3, null, /* @__PURE__ */ React20.createElement(Stack6, { spacing: 3, alignItems: "center" }, /* @__PURE__ */ React20.createElement(BugReport, { sx: { fontSize: 64, color: "error.main" } }), /* @__PURE__ */ React20.createElement(Typography8, { variant: "h5", component: "h2", textAlign: "center" }, "Oops! Something went wrong"), /* @__PURE__ */ React20.createElement(Alert3, { severity: "error", sx: { width: "100%" } }, /* @__PURE__ */ React20.createElement(Typography8, { variant: "body2" }, isNavigationError && /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("strong", null, "UI Component Error:"), " A component tried to access an element before it was ready. This is usually temporary."), isDOMError && !isNavigationError && /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("strong", null, "DOM Error:"), " A component couldn't find an expected element. This might be due to rapid state changes."), !isNavigationError && !isDOMError && /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("strong", null, "Application Error:"), " An unexpected error occurred while rendering the component."))), process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */ React20.createElement(Alert3, { severity: "warning", sx: { width: "100%" } }, /* @__PURE__ */ React20.createElement(Typography8, { variant: "body2", component: "div" }, /* @__PURE__ */ React20.createElement("strong", null, "Debug Info:"), /* @__PURE__ */ React20.createElement("br", null), /* @__PURE__ */ React20.createElement("code", { style: { fontSize: "0.75rem", wordBreak: "break-word" } }, this.state.error.toString()))), /* @__PURE__ */ React20.createElement(Stack6, { direction: "row", spacing: 2 }, /* @__PURE__ */ React20.createElement(
|
|
4141
|
+
Button5,
|
|
3854
4142
|
{
|
|
3855
4143
|
variant: "contained",
|
|
3856
|
-
startIcon: /* @__PURE__ */
|
|
4144
|
+
startIcon: /* @__PURE__ */ React20.createElement(Refresh2, null),
|
|
3857
4145
|
onClick: this.handleRetry,
|
|
3858
4146
|
color: "primary"
|
|
3859
4147
|
},
|
|
3860
4148
|
"Try Again"
|
|
3861
|
-
), /* @__PURE__ */
|
|
3862
|
-
|
|
4149
|
+
), /* @__PURE__ */ React20.createElement(
|
|
4150
|
+
Button5,
|
|
3863
4151
|
{
|
|
3864
4152
|
variant: "outlined",
|
|
3865
|
-
startIcon: /* @__PURE__ */
|
|
4153
|
+
startIcon: /* @__PURE__ */ React20.createElement(Refresh2, null),
|
|
3866
4154
|
onClick: this.handleReload
|
|
3867
4155
|
},
|
|
3868
4156
|
"Reload Page"
|
|
3869
|
-
), this.props.onNavigateHome && /* @__PURE__ */
|
|
3870
|
-
|
|
4157
|
+
), this.props.onNavigateHome && /* @__PURE__ */ React20.createElement(
|
|
4158
|
+
Button5,
|
|
3871
4159
|
{
|
|
3872
4160
|
variant: "outlined",
|
|
3873
|
-
startIcon: /* @__PURE__ */
|
|
4161
|
+
startIcon: /* @__PURE__ */ React20.createElement(Home2, null),
|
|
3874
4162
|
onClick: this.props.onNavigateHome
|
|
3875
4163
|
},
|
|
3876
4164
|
"Go Home"
|
|
3877
|
-
)), /* @__PURE__ */
|
|
4165
|
+
)), /* @__PURE__ */ React20.createElement(Typography8, { variant: "body2", color: "text.secondary", textAlign: "center" }, "If this problem persists, try refreshing the page or clearing your browser cache. The error has been logged for debugging."))))
|
|
3878
4166
|
);
|
|
3879
4167
|
}
|
|
3880
4168
|
return this.props.children;
|
|
@@ -3883,7 +4171,7 @@ var ErrorBoundary = class extends React15.Component {
|
|
|
3883
4171
|
var ErrorBoundary_default = ErrorBoundary;
|
|
3884
4172
|
|
|
3885
4173
|
// src/contexts/SocketContext.js
|
|
3886
|
-
import
|
|
4174
|
+
import React21, { createContext as createContext5, useContext as useContext5, useEffect as useEffect6, useState as useState7 } from "react";
|
|
3887
4175
|
import { io } from "socket.io-client";
|
|
3888
4176
|
var SocketContext = createContext5();
|
|
3889
4177
|
var useSocket = () => {
|
|
@@ -3906,7 +4194,7 @@ var SocketProvider = ({ children }) => {
|
|
|
3906
4194
|
if (user || tenantToken) {
|
|
3907
4195
|
const userType = user ? "property_manager" : "tenant";
|
|
3908
4196
|
const authToken = user ? localStorage.getItem("token") : tenantToken;
|
|
3909
|
-
const socketUrl = process.env.REACT_APP_API_URL ? process.env.REACT_APP_API_URL.replace("/api", "") :
|
|
4197
|
+
const socketUrl = process.env.REACT_APP_API_URL ? process.env.REACT_APP_API_URL.replace("/api", "") : `${window.location.protocol}//${window.location.hostname}:5000`;
|
|
3910
4198
|
const newSocket = io(socketUrl, {
|
|
3911
4199
|
auth: {
|
|
3912
4200
|
token: authToken,
|
|
@@ -3929,7 +4217,7 @@ var SocketProvider = ({ children }) => {
|
|
|
3929
4217
|
socket,
|
|
3930
4218
|
isConnected
|
|
3931
4219
|
};
|
|
3932
|
-
return /* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ React21.createElement(SocketContext.Provider, { value }, children);
|
|
3933
4221
|
};
|
|
3934
4222
|
|
|
3935
4223
|
// src/hooks/useNotifications.js
|
|
@@ -5399,10 +5687,30 @@ var isTenantAuthenticated = () => {
|
|
|
5399
5687
|
export {
|
|
5400
5688
|
AuthLayout_default as AuthLayout,
|
|
5401
5689
|
AuthProvider,
|
|
5690
|
+
Blockquote,
|
|
5691
|
+
Button2 as Button,
|
|
5692
|
+
Card2 as Card,
|
|
5693
|
+
CardContent2 as CardContent,
|
|
5694
|
+
CardDescription,
|
|
5695
|
+
CardFooter,
|
|
5696
|
+
CardHeader,
|
|
5697
|
+
CardTitle,
|
|
5402
5698
|
CustomThemeProvider,
|
|
5403
5699
|
ErrorBoundary_default as ErrorBoundary,
|
|
5700
|
+
H1,
|
|
5701
|
+
H2,
|
|
5702
|
+
H3,
|
|
5703
|
+
H4,
|
|
5704
|
+
Heading,
|
|
5705
|
+
InlineCode,
|
|
5706
|
+
Input,
|
|
5707
|
+
Label,
|
|
5708
|
+
Large,
|
|
5709
|
+
Lead,
|
|
5710
|
+
List2 as List,
|
|
5404
5711
|
LoadingSpinner_default as LoadingSpinner,
|
|
5405
5712
|
ModernCard_default as ModernCard,
|
|
5713
|
+
Muted,
|
|
5406
5714
|
NOTIFICATION_CHANNELS,
|
|
5407
5715
|
NOTIFICATION_TYPES,
|
|
5408
5716
|
Navbar_default as Navbar,
|
|
@@ -5410,13 +5718,17 @@ export {
|
|
|
5410
5718
|
NotificationManager_default as NotificationManager,
|
|
5411
5719
|
NotificationPatterns,
|
|
5412
5720
|
NotificationProvider,
|
|
5721
|
+
P,
|
|
5413
5722
|
PageHeader_default as PageHeader,
|
|
5414
5723
|
PageLayout_default as PageLayout,
|
|
5724
|
+
Small,
|
|
5415
5725
|
SocketProvider,
|
|
5416
5726
|
TenantLayout_default as TenantLayout,
|
|
5417
5727
|
TenantThemeProvider,
|
|
5418
5728
|
api,
|
|
5419
5729
|
auditNotifications,
|
|
5730
|
+
buttonVariants,
|
|
5731
|
+
cn,
|
|
5420
5732
|
createContrastEnhancedComponents,
|
|
5421
5733
|
createNotificationAwareAPI,
|
|
5422
5734
|
darkenColor,
|