@herca/r-kit 0.0.69 → 0.0.71
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/clients.cjs +312 -113
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +21 -11
- package/dist/clients.d.ts +21 -11
- package/dist/clients.js +420 -223
- package/dist/clients.js.map +1 -1
- package/package.json +5 -3
package/dist/clients.js
CHANGED
|
@@ -11124,7 +11124,7 @@ var Icon = ({
|
|
|
11124
11124
|
var Icon_default = Icon;
|
|
11125
11125
|
|
|
11126
11126
|
// src/components/sheet/sheet.tsx
|
|
11127
|
-
import "react";
|
|
11127
|
+
import * as React395 from "react";
|
|
11128
11128
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
11129
11129
|
import { jsx as jsx403, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
11130
11130
|
var sheetSizeClasses = {
|
|
@@ -11134,8 +11134,74 @@ var sheetSizeClasses = {
|
|
|
11134
11134
|
xl: "w-2/3 sm:max-w-xl",
|
|
11135
11135
|
full: "w-full"
|
|
11136
11136
|
};
|
|
11137
|
-
|
|
11138
|
-
|
|
11137
|
+
var SHEET_URL_EVENT = "__sheet_url_change__";
|
|
11138
|
+
function readParams() {
|
|
11139
|
+
if (typeof window === "undefined") return new URLSearchParams();
|
|
11140
|
+
return new URLSearchParams(window.location.search);
|
|
11141
|
+
}
|
|
11142
|
+
function useUrlSearchParams() {
|
|
11143
|
+
const [params, setParams] = React395.useState(readParams);
|
|
11144
|
+
React395.useEffect(() => {
|
|
11145
|
+
const sync = () => setParams(readParams());
|
|
11146
|
+
sync();
|
|
11147
|
+
window.addEventListener("popstate", sync);
|
|
11148
|
+
window.addEventListener(SHEET_URL_EVENT, sync);
|
|
11149
|
+
return () => {
|
|
11150
|
+
window.removeEventListener("popstate", sync);
|
|
11151
|
+
window.removeEventListener(SHEET_URL_EVENT, sync);
|
|
11152
|
+
};
|
|
11153
|
+
}, []);
|
|
11154
|
+
const setSearchParams = React395.useCallback(
|
|
11155
|
+
(updater, options) => {
|
|
11156
|
+
const next = updater(readParams());
|
|
11157
|
+
const query = next.toString();
|
|
11158
|
+
const url = `${window.location.pathname}${query ? `?${query}` : ""}${window.location.hash}`;
|
|
11159
|
+
if (options?.replace) {
|
|
11160
|
+
window.history.replaceState(window.history.state, "", url);
|
|
11161
|
+
} else {
|
|
11162
|
+
window.history.pushState(window.history.state, "", url);
|
|
11163
|
+
}
|
|
11164
|
+
window.dispatchEvent(new Event(SHEET_URL_EVENT));
|
|
11165
|
+
},
|
|
11166
|
+
[]
|
|
11167
|
+
);
|
|
11168
|
+
return [params, setSearchParams];
|
|
11169
|
+
}
|
|
11170
|
+
function Sheet({
|
|
11171
|
+
id,
|
|
11172
|
+
urlReplace = false,
|
|
11173
|
+
open: openProp,
|
|
11174
|
+
defaultOpen,
|
|
11175
|
+
onOpenChange,
|
|
11176
|
+
...props
|
|
11177
|
+
}) {
|
|
11178
|
+
const [searchParams, setSearchParams] = useUrlSearchParams();
|
|
11179
|
+
const isControlled = openProp !== void 0;
|
|
11180
|
+
const isUrlSynced = id !== void 0 && !isControlled;
|
|
11181
|
+
const urlParam = id !== void 0 ? `sheet-${id}` : void 0;
|
|
11182
|
+
const open = isControlled ? openProp : isUrlSynced && urlParam !== void 0 ? searchParams.has(urlParam) : void 0;
|
|
11183
|
+
const handleOpenChange = (next) => {
|
|
11184
|
+
if (isUrlSynced && urlParam !== void 0) {
|
|
11185
|
+
setSearchParams(
|
|
11186
|
+
(prev) => {
|
|
11187
|
+
const p = new URLSearchParams(prev);
|
|
11188
|
+
if (next) p.set(urlParam, "1");
|
|
11189
|
+
else p.delete(urlParam);
|
|
11190
|
+
return p;
|
|
11191
|
+
},
|
|
11192
|
+
{ replace: urlReplace }
|
|
11193
|
+
);
|
|
11194
|
+
}
|
|
11195
|
+
onOpenChange?.(next);
|
|
11196
|
+
};
|
|
11197
|
+
const stateProps = isControlled || isUrlSynced ? { open, onOpenChange: handleOpenChange } : { defaultOpen, onOpenChange: handleOpenChange };
|
|
11198
|
+
return /* @__PURE__ */ jsx403(SheetPrimitive.Root, { "data-slot": "sheet", ...stateProps, ...props });
|
|
11199
|
+
}
|
|
11200
|
+
function useSheetHref(id) {
|
|
11201
|
+
const [searchParams] = useUrlSearchParams();
|
|
11202
|
+
const params = new URLSearchParams(searchParams);
|
|
11203
|
+
params.set(`sheet-${id}`, "1");
|
|
11204
|
+
return `?${params.toString()}`;
|
|
11139
11205
|
}
|
|
11140
11206
|
function SheetTrigger({
|
|
11141
11207
|
...props
|
|
@@ -11286,6 +11352,18 @@ var SIDEBAR_WIDTH = "13.75rem";
|
|
|
11286
11352
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
11287
11353
|
var SIDEBAR_WIDTH_ICON = "4.125rem";
|
|
11288
11354
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
11355
|
+
var HOVER_OPEN_DELAY = 150;
|
|
11356
|
+
var HOVER_CLOSE_DELAY = 200;
|
|
11357
|
+
function readSidebarCookie() {
|
|
11358
|
+
if (typeof document === "undefined") return void 0;
|
|
11359
|
+
const match = document.cookie.match(
|
|
11360
|
+
new RegExp("(?:^|; )" + SIDEBAR_COOKIE_NAME + "=([^;]+)")
|
|
11361
|
+
);
|
|
11362
|
+
if (match === null) return void 0;
|
|
11363
|
+
if (match[1] === "true") return true;
|
|
11364
|
+
if (match[1] === "false") return false;
|
|
11365
|
+
return void 0;
|
|
11366
|
+
}
|
|
11289
11367
|
function SidebarProvider({
|
|
11290
11368
|
defaultOpen = true,
|
|
11291
11369
|
open: openProp,
|
|
@@ -11295,26 +11373,33 @@ function SidebarProvider({
|
|
|
11295
11373
|
children,
|
|
11296
11374
|
...props
|
|
11297
11375
|
}) {
|
|
11298
|
-
const isMobile = useIsMobile();
|
|
11376
|
+
const isMobile = Boolean(useIsMobile());
|
|
11299
11377
|
const [openMobile, setOpenMobile] = React397.useState(false);
|
|
11300
|
-
const [
|
|
11301
|
-
const
|
|
11378
|
+
const [isHovered, setIsHovered] = React397.useState(false);
|
|
11379
|
+
const [internalOpen, setInternalOpen] = React397.useState(() => {
|
|
11380
|
+
const stored = readSidebarCookie();
|
|
11381
|
+
return stored ?? defaultOpen;
|
|
11382
|
+
});
|
|
11383
|
+
const open = Boolean(openProp ?? internalOpen);
|
|
11302
11384
|
const setOpen = React397.useCallback(
|
|
11303
11385
|
(value) => {
|
|
11304
|
-
const
|
|
11386
|
+
const next = typeof value === "function" ? value(open) : value;
|
|
11305
11387
|
if (setOpenProp !== void 0) {
|
|
11306
|
-
setOpenProp(
|
|
11388
|
+
setOpenProp(next);
|
|
11307
11389
|
} else {
|
|
11308
|
-
|
|
11390
|
+
setInternalOpen(next);
|
|
11309
11391
|
}
|
|
11310
|
-
document.cookie = `${SIDEBAR_COOKIE_NAME}=${
|
|
11392
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${next}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
11311
11393
|
},
|
|
11312
11394
|
[setOpenProp, open]
|
|
11313
11395
|
);
|
|
11314
|
-
const [isHovered, setIsHovered] = React397.useState(false);
|
|
11315
11396
|
const toggleSidebar = React397.useCallback(() => {
|
|
11316
|
-
|
|
11317
|
-
|
|
11397
|
+
if (isMobile) {
|
|
11398
|
+
setOpenMobile((v3) => !v3);
|
|
11399
|
+
} else {
|
|
11400
|
+
setOpen((v3) => !v3);
|
|
11401
|
+
}
|
|
11402
|
+
}, [isMobile, setOpen]);
|
|
11318
11403
|
React397.useEffect(() => {
|
|
11319
11404
|
const handleKeyDown2 = (event) => {
|
|
11320
11405
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
@@ -11325,7 +11410,7 @@ function SidebarProvider({
|
|
|
11325
11410
|
window.addEventListener("keydown", handleKeyDown2);
|
|
11326
11411
|
return () => window.removeEventListener("keydown", handleKeyDown2);
|
|
11327
11412
|
}, [toggleSidebar]);
|
|
11328
|
-
const state = open
|
|
11413
|
+
const state = open ? "expanded" : "collapsed";
|
|
11329
11414
|
const contextValue = React397.useMemo(
|
|
11330
11415
|
() => ({
|
|
11331
11416
|
state,
|
|
@@ -11338,20 +11423,12 @@ function SidebarProvider({
|
|
|
11338
11423
|
isHovered,
|
|
11339
11424
|
setIsHovered
|
|
11340
11425
|
}),
|
|
11341
|
-
[
|
|
11342
|
-
state,
|
|
11343
|
-
open,
|
|
11344
|
-
setOpen,
|
|
11345
|
-
isMobile,
|
|
11346
|
-
openMobile,
|
|
11347
|
-
setOpenMobile,
|
|
11348
|
-
toggleSidebar,
|
|
11349
|
-
isHovered
|
|
11350
|
-
]
|
|
11426
|
+
[state, open, setOpen, isMobile, openMobile, toggleSidebar, isHovered]
|
|
11351
11427
|
);
|
|
11352
11428
|
return /* @__PURE__ */ jsx404(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx404(
|
|
11353
11429
|
"div",
|
|
11354
11430
|
{
|
|
11431
|
+
"data-slot": "sidebar-wrapper",
|
|
11355
11432
|
style: {
|
|
11356
11433
|
"--sidebar-width": SIDEBAR_WIDTH,
|
|
11357
11434
|
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
@@ -11382,19 +11459,32 @@ function Sidebar({
|
|
|
11382
11459
|
isHovered,
|
|
11383
11460
|
setIsHovered
|
|
11384
11461
|
} = useSidebar();
|
|
11462
|
+
const openTimer = React397.useRef(null);
|
|
11463
|
+
const closeTimer = React397.useRef(null);
|
|
11464
|
+
const clearTimers = React397.useCallback(() => {
|
|
11465
|
+
if (openTimer.current) clearTimeout(openTimer.current);
|
|
11466
|
+
if (closeTimer.current) clearTimeout(closeTimer.current);
|
|
11467
|
+
openTimer.current = null;
|
|
11468
|
+
closeTimer.current = null;
|
|
11469
|
+
}, []);
|
|
11470
|
+
React397.useEffect(() => clearTimers, [clearTimers]);
|
|
11385
11471
|
const handleMouseEnter = React397.useCallback(() => {
|
|
11386
|
-
if (
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
}, [isMobile, state, setIsHovered]);
|
|
11472
|
+
if (isMobile == true || state === "expanded" || collapsible !== "icon") return;
|
|
11473
|
+
clearTimers();
|
|
11474
|
+
openTimer.current = setTimeout(() => setIsHovered(true), HOVER_OPEN_DELAY);
|
|
11475
|
+
}, [isMobile, state, collapsible, clearTimers, setIsHovered]);
|
|
11391
11476
|
const handleMouseLeave = React397.useCallback(() => {
|
|
11392
|
-
|
|
11393
|
-
|
|
11477
|
+
clearTimers();
|
|
11478
|
+
closeTimer.current = setTimeout(
|
|
11479
|
+
() => setIsHovered(false),
|
|
11480
|
+
HOVER_CLOSE_DELAY
|
|
11481
|
+
);
|
|
11482
|
+
}, [clearTimers, setIsHovered]);
|
|
11394
11483
|
if (collapsible === "none") {
|
|
11395
11484
|
return /* @__PURE__ */ jsx404(
|
|
11396
11485
|
"div",
|
|
11397
11486
|
{
|
|
11487
|
+
"data-slot": "sidebar",
|
|
11398
11488
|
className: cn(
|
|
11399
11489
|
"flex h-full w-(--sidebar-width) flex-col bg-white text-gray-900",
|
|
11400
11490
|
className
|
|
@@ -11404,7 +11494,7 @@ function Sidebar({
|
|
|
11404
11494
|
}
|
|
11405
11495
|
);
|
|
11406
11496
|
}
|
|
11407
|
-
if (isMobile
|
|
11497
|
+
if (isMobile == true) {
|
|
11408
11498
|
return /* @__PURE__ */ jsx404(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs71(
|
|
11409
11499
|
SheetContent,
|
|
11410
11500
|
{
|
|
@@ -11412,14 +11502,12 @@ function Sidebar({
|
|
|
11412
11502
|
"data-slot": "sidebar",
|
|
11413
11503
|
"data-mobile": "true",
|
|
11414
11504
|
className: "w-(--sidebar-width) bg-white p-0 text-gray-900 [&>button]:hidden",
|
|
11415
|
-
style: {
|
|
11416
|
-
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
11417
|
-
},
|
|
11505
|
+
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
11418
11506
|
side,
|
|
11419
11507
|
children: [
|
|
11420
11508
|
/* @__PURE__ */ jsxs71(SheetHeader, { className: "sr-only", children: [
|
|
11421
11509
|
/* @__PURE__ */ jsx404(SheetTitle, { children: "Sidebar" }),
|
|
11422
|
-
/* @__PURE__ */ jsx404(SheetDescription, { children: "
|
|
11510
|
+
/* @__PURE__ */ jsx404(SheetDescription, { children: "Menampilkan sidebar mobile." })
|
|
11423
11511
|
] }),
|
|
11424
11512
|
/* @__PURE__ */ jsx404("div", { className: "flex h-full w-full flex-col", children })
|
|
11425
11513
|
]
|
|
@@ -11435,6 +11523,7 @@ function Sidebar({
|
|
|
11435
11523
|
"data-variant": variant,
|
|
11436
11524
|
"data-side": side,
|
|
11437
11525
|
"data-hovered": isHovered,
|
|
11526
|
+
"data-slot": "sidebar",
|
|
11438
11527
|
children: [
|
|
11439
11528
|
/* @__PURE__ */ jsx404(
|
|
11440
11529
|
"div",
|
|
@@ -11451,11 +11540,11 @@ function Sidebar({
|
|
|
11451
11540
|
"div",
|
|
11452
11541
|
{
|
|
11453
11542
|
className: cn(
|
|
11454
|
-
"fixed inset-y-0 z-
|
|
11543
|
+
"fixed inset-y-0 z-21 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
11455
11544
|
side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
11456
|
-
// Adjust the padding for floating and inset variants.
|
|
11457
11545
|
variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=left]:border-gray-200 group-data-[side=right]:border-l group-data-[side=right]:border-gray-200",
|
|
11458
11546
|
"group-data-[collapsible=icon]:group-data-[hovered=true]:w-(--sidebar-width)",
|
|
11547
|
+
"group-data-[collapsible=icon]:group-data-[hovered=true]:shadow-lg",
|
|
11459
11548
|
className
|
|
11460
11549
|
),
|
|
11461
11550
|
onMouseEnter: handleMouseEnter,
|
|
@@ -11480,12 +11569,19 @@ function SidebarTrigger({
|
|
|
11480
11569
|
onClick,
|
|
11481
11570
|
...props
|
|
11482
11571
|
}) {
|
|
11483
|
-
const { toggleSidebar } = useSidebar();
|
|
11572
|
+
const { toggleSidebar, state } = useSidebar();
|
|
11484
11573
|
return /* @__PURE__ */ jsxs71(
|
|
11485
11574
|
"button",
|
|
11486
11575
|
{
|
|
11576
|
+
type: "button",
|
|
11487
11577
|
"data-sidebar": "trigger",
|
|
11488
|
-
|
|
11578
|
+
"aria-label": "Toggle Sidebar",
|
|
11579
|
+
"aria-expanded": state === "expanded",
|
|
11580
|
+
className: cn(
|
|
11581
|
+
"inline-flex size-7 cursor-pointer items-center justify-center rounded-md text-gray-700",
|
|
11582
|
+
"focus-visible:ring-primary-500 hover:bg-gray-100 focus-visible:ring-2 focus-visible:outline-none",
|
|
11583
|
+
className
|
|
11584
|
+
),
|
|
11489
11585
|
onClick: (event) => {
|
|
11490
11586
|
onClick?.(event);
|
|
11491
11587
|
toggleSidebar();
|
|
@@ -11543,7 +11639,8 @@ function SidebarContent({ className, ...props }) {
|
|
|
11543
11639
|
{
|
|
11544
11640
|
"data-sidebar": "content",
|
|
11545
11641
|
className: cn(
|
|
11546
|
-
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-3",
|
|
11642
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-x-hidden overflow-y-auto p-3",
|
|
11643
|
+
"scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent",
|
|
11547
11644
|
className
|
|
11548
11645
|
),
|
|
11549
11646
|
...props
|
|
@@ -11560,64 +11657,66 @@ function SidebarMenu({ className, ...props }) {
|
|
|
11560
11657
|
}
|
|
11561
11658
|
);
|
|
11562
11659
|
}
|
|
11660
|
+
function MenuItemInner({
|
|
11661
|
+
icon,
|
|
11662
|
+
expanded,
|
|
11663
|
+
children
|
|
11664
|
+
}) {
|
|
11665
|
+
return /* @__PURE__ */ jsxs71(Fragment2, { children: [
|
|
11666
|
+
/* @__PURE__ */ jsx404("span", { className: "shrink-0", children: icon ?? /* @__PURE__ */ jsx404(Icon_default, { name: "ellipse", size: 18 }) }),
|
|
11667
|
+
/* @__PURE__ */ jsx404(
|
|
11668
|
+
"span",
|
|
11669
|
+
{
|
|
11670
|
+
className: cn(
|
|
11671
|
+
"flex-1 truncate transition-opacity duration-150",
|
|
11672
|
+
expanded ? "opacity-100" : "pointer-events-none w-0 opacity-0"
|
|
11673
|
+
),
|
|
11674
|
+
children
|
|
11675
|
+
}
|
|
11676
|
+
)
|
|
11677
|
+
] });
|
|
11678
|
+
}
|
|
11563
11679
|
function SidebarMenuItem({
|
|
11564
11680
|
children,
|
|
11565
11681
|
className,
|
|
11566
11682
|
icon,
|
|
11567
|
-
active,
|
|
11683
|
+
active = false,
|
|
11568
11684
|
asChild = true,
|
|
11569
11685
|
...props
|
|
11570
11686
|
}) {
|
|
11571
11687
|
const { state, isHovered } = useSidebar();
|
|
11688
|
+
const expanded = state === "expanded" || isHovered;
|
|
11572
11689
|
const itemClassName = cn(
|
|
11573
11690
|
"flex w-full items-center gap-2 rounded-sm bg-white px-3 py-2.5 text-sm text-gray-800 transition-colors",
|
|
11574
11691
|
"hover:bg-primary-100",
|
|
11575
|
-
|
|
11692
|
+
"focus-visible:ring-primary-500 focus-visible:ring-2 focus-visible:outline-none",
|
|
11693
|
+
active == true && "bg-primary-100 text-primary-1000 before:bg-primary-1000 before:absolute before:top-1/2 before:left-0 before:h-5 before:w-1 before:-translate-y-1/2 before:rounded-r-md"
|
|
11576
11694
|
);
|
|
11577
|
-
|
|
11695
|
+
let body;
|
|
11696
|
+
if (asChild) {
|
|
11697
|
+
const child = React397.Children.only(children);
|
|
11698
|
+
if (!React397.isValidElement(child)) {
|
|
11699
|
+
throw new Error(
|
|
11700
|
+
"SidebarMenuItem with asChild requires a single valid React element as child"
|
|
11701
|
+
);
|
|
11702
|
+
}
|
|
11703
|
+
const childEl = child;
|
|
11704
|
+
body = React397.cloneElement(childEl, {
|
|
11705
|
+
className: cn(itemClassName, childEl.props.className),
|
|
11706
|
+
children: /* @__PURE__ */ jsx404(MenuItemInner, { icon, expanded, children: childEl.props.children })
|
|
11707
|
+
});
|
|
11708
|
+
} else {
|
|
11709
|
+
body = /* @__PURE__ */ jsx404("div", { className: itemClassName, children: /* @__PURE__ */ jsx404(MenuItemInner, { icon, expanded, children }) });
|
|
11710
|
+
}
|
|
11578
11711
|
return /* @__PURE__ */ jsx404(
|
|
11579
11712
|
"li",
|
|
11580
11713
|
{
|
|
11581
11714
|
"data-sidebar": "menu-item",
|
|
11715
|
+
"data-active": active,
|
|
11716
|
+
"aria-current": active ? "page" : void 0,
|
|
11582
11717
|
className: cn("group/menu-item relative", className),
|
|
11583
11718
|
...props,
|
|
11584
|
-
children:
|
|
11585
|
-
const child = React397.Children.only(children);
|
|
11586
|
-
if (React397.isValidElement(child) === false) {
|
|
11587
|
-
throw new Error(
|
|
11588
|
-
"SidebarMenuItem with asChild requires a single valid React element as child"
|
|
11589
|
-
);
|
|
11590
|
-
}
|
|
11591
|
-
const childElement = child;
|
|
11592
|
-
return React397.cloneElement(childElement, {
|
|
11593
|
-
className: cn(itemClassName, childElement.props.className),
|
|
11594
|
-
children: /* @__PURE__ */ jsxs71(Fragment2, { children: [
|
|
11595
|
-
iconElement,
|
|
11596
|
-
/* @__PURE__ */ jsx404(
|
|
11597
|
-
"span",
|
|
11598
|
-
{
|
|
11599
|
-
className: cn(
|
|
11600
|
-
"flex-1",
|
|
11601
|
-
state === "collapsed" && isHovered === false && "hidden"
|
|
11602
|
-
),
|
|
11603
|
-
children: childElement.props.children
|
|
11604
|
-
}
|
|
11605
|
-
)
|
|
11606
|
-
] })
|
|
11607
|
-
});
|
|
11608
|
-
})() : /* @__PURE__ */ jsxs71("div", { className: itemClassName, children: [
|
|
11609
|
-
iconElement,
|
|
11610
|
-
/* @__PURE__ */ jsx404(
|
|
11611
|
-
"span",
|
|
11612
|
-
{
|
|
11613
|
-
className: cn(
|
|
11614
|
-
"flex-1",
|
|
11615
|
-
state === "collapsed" && isHovered === false && "hidden"
|
|
11616
|
-
),
|
|
11617
|
-
children
|
|
11618
|
-
}
|
|
11619
|
-
)
|
|
11620
|
-
] })
|
|
11719
|
+
children: body
|
|
11621
11720
|
}
|
|
11622
11721
|
);
|
|
11623
11722
|
}
|
|
@@ -11630,29 +11729,30 @@ function SidebarMenuGroup({
|
|
|
11630
11729
|
...props
|
|
11631
11730
|
}) {
|
|
11632
11731
|
const { state, isHovered } = useSidebar();
|
|
11732
|
+
const expanded = state === "expanded" || isHovered;
|
|
11633
11733
|
const [isOpen, setIsOpen] = React397.useState(active);
|
|
11634
11734
|
const triggerClassName = cn(
|
|
11635
|
-
"
|
|
11636
|
-
"
|
|
11637
|
-
|
|
11735
|
+
"relative flex w-full cursor-pointer items-center gap-2 rounded-sm bg-white px-3 py-2.5 text-sm text-gray-800 transition-colors",
|
|
11736
|
+
"hover:bg-primary-100",
|
|
11737
|
+
"focus-visible:ring-primary-500 focus-visible:ring-2 focus-visible:outline-none",
|
|
11738
|
+
active && "bg-primary-100 text-primary-1000 before:bg-primary-1000 before:absolute before:top-1/2 before:left-0 before:h-5 before:w-1 before:-translate-y-1/2 before:rounded-r-md"
|
|
11638
11739
|
);
|
|
11639
|
-
const iconElement = icon !== void 0 ? /* @__PURE__ */ jsx404("span", { className: "shrink-0", children: icon }) : /* @__PURE__ */ jsx404("span", { className: "shrink-0", children: /* @__PURE__ */ jsx404(Icon_default, { name: "ellipse", size: 18 }) });
|
|
11640
11740
|
return /* @__PURE__ */ jsxs71(
|
|
11641
11741
|
Collapsible,
|
|
11642
11742
|
{
|
|
11643
|
-
open:
|
|
11743
|
+
open: isOpen && expanded,
|
|
11644
11744
|
onOpenChange: setIsOpen,
|
|
11645
11745
|
className: cn("group/menu-group flex flex-col gap-y-1", className),
|
|
11646
11746
|
...props,
|
|
11647
11747
|
children: [
|
|
11648
11748
|
/* @__PURE__ */ jsxs71(CollapsibleTrigger2, { className: triggerClassName, children: [
|
|
11649
|
-
|
|
11749
|
+
/* @__PURE__ */ jsx404("span", { className: "shrink-0", children: icon ?? /* @__PURE__ */ jsx404(Icon_default, { name: "ellipse", size: 18 }) }),
|
|
11650
11750
|
/* @__PURE__ */ jsx404(
|
|
11651
11751
|
"span",
|
|
11652
11752
|
{
|
|
11653
11753
|
className: cn(
|
|
11654
|
-
"flex-1 text-left",
|
|
11655
|
-
|
|
11754
|
+
"flex-1 truncate text-left transition-opacity duration-150",
|
|
11755
|
+
expanded ? "opacity-100" : "pointer-events-none w-0 opacity-0"
|
|
11656
11756
|
),
|
|
11657
11757
|
children: label
|
|
11658
11758
|
}
|
|
@@ -11664,8 +11764,8 @@ function SidebarMenuGroup({
|
|
|
11664
11764
|
size: 18,
|
|
11665
11765
|
className: cn(
|
|
11666
11766
|
"shrink-0 transition-transform duration-200",
|
|
11667
|
-
|
|
11668
|
-
|
|
11767
|
+
!expanded && "hidden",
|
|
11768
|
+
isOpen && "rotate-180"
|
|
11669
11769
|
)
|
|
11670
11770
|
}
|
|
11671
11771
|
)
|
|
@@ -11735,7 +11835,7 @@ function TooltipContent({
|
|
|
11735
11835
|
}
|
|
11736
11836
|
|
|
11737
11837
|
// src/components/modal/modal.tsx
|
|
11738
|
-
import React399, { useEffect as
|
|
11838
|
+
import React399, { useEffect as useEffect5, useRef as useRef2 } from "react";
|
|
11739
11839
|
|
|
11740
11840
|
// src/components/modal/modal-variants.ts
|
|
11741
11841
|
import { cva as cva4 } from "class-variance-authority";
|
|
@@ -11796,7 +11896,7 @@ var Modal = ({
|
|
|
11796
11896
|
const modalRef = useRef2(null);
|
|
11797
11897
|
const lastFocusedElement = useRef2(null);
|
|
11798
11898
|
const hasHeader = Boolean(title ?? description);
|
|
11799
|
-
|
|
11899
|
+
useEffect5(() => {
|
|
11800
11900
|
if (isOpen === true) {
|
|
11801
11901
|
setIsVisible(true);
|
|
11802
11902
|
setAnimationState("open");
|
|
@@ -11811,12 +11911,12 @@ var Modal = ({
|
|
|
11811
11911
|
return () => clearTimeout(timer);
|
|
11812
11912
|
}
|
|
11813
11913
|
}, [isOpen]);
|
|
11814
|
-
|
|
11914
|
+
useEffect5(() => {
|
|
11815
11915
|
if (isVisible === false && lastFocusedElement.current) {
|
|
11816
11916
|
lastFocusedElement.current.focus();
|
|
11817
11917
|
}
|
|
11818
11918
|
}, [isVisible]);
|
|
11819
|
-
|
|
11919
|
+
useEffect5(() => {
|
|
11820
11920
|
if (isVisible === false || !modalRef.current) return;
|
|
11821
11921
|
const focusableSelector = 'a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])';
|
|
11822
11922
|
const getFocusable = () => Array.from(
|
|
@@ -11969,10 +12069,10 @@ var ModalFooter = ({
|
|
|
11969
12069
|
// src/components/input-file/input-file.tsx
|
|
11970
12070
|
import {
|
|
11971
12071
|
forwardRef as forwardRef2,
|
|
11972
|
-
useEffect as
|
|
12072
|
+
useEffect as useEffect7,
|
|
11973
12073
|
useImperativeHandle,
|
|
11974
12074
|
useRef as useRef3,
|
|
11975
|
-
useState as
|
|
12075
|
+
useState as useState6
|
|
11976
12076
|
} from "react";
|
|
11977
12077
|
|
|
11978
12078
|
// src/components/button/button.tsx
|
|
@@ -12295,10 +12395,10 @@ var inputFileVariants = cva7("", {
|
|
|
12295
12395
|
});
|
|
12296
12396
|
|
|
12297
12397
|
// src/components/input-file/preview-item.tsx
|
|
12298
|
-
import { useState as
|
|
12398
|
+
import { useState as useState5 } from "react";
|
|
12299
12399
|
|
|
12300
12400
|
// src/components/modal/modal-preview-attachment.tsx
|
|
12301
|
-
import { useEffect as
|
|
12401
|
+
import { useEffect as useEffect6, useState as useState4 } from "react";
|
|
12302
12402
|
|
|
12303
12403
|
// src/components/input-file/helpers.ts
|
|
12304
12404
|
var getIconName = ({
|
|
@@ -12341,10 +12441,10 @@ var ModalPreviewAttachment = ({
|
|
|
12341
12441
|
videoProps,
|
|
12342
12442
|
onDownload
|
|
12343
12443
|
}) => {
|
|
12344
|
-
const [zoom, setZoom] =
|
|
12345
|
-
const [isDragging, setIsDragging] =
|
|
12346
|
-
const [position, setPosition] =
|
|
12347
|
-
const [dragStart, setDragStart] =
|
|
12444
|
+
const [zoom, setZoom] = useState4(1);
|
|
12445
|
+
const [isDragging, setIsDragging] = useState4(false);
|
|
12446
|
+
const [position, setPosition] = useState4({ x: 0, y: 0 });
|
|
12447
|
+
const [dragStart, setDragStart] = useState4({ x: 0, y: 0 });
|
|
12348
12448
|
const isImage = type.startsWith("image/");
|
|
12349
12449
|
const isMp3 = type.startsWith("audio/");
|
|
12350
12450
|
const isVideo = type.startsWith("video/");
|
|
@@ -12402,14 +12502,14 @@ var ModalPreviewAttachment = ({
|
|
|
12402
12502
|
window.open(src, "_blank");
|
|
12403
12503
|
}
|
|
12404
12504
|
};
|
|
12405
|
-
|
|
12505
|
+
useEffect6(() => {
|
|
12406
12506
|
if (!open.isOpen) {
|
|
12407
12507
|
setZoom(1);
|
|
12408
12508
|
setPosition({ x: 0, y: 0 });
|
|
12409
12509
|
setIsDragging(false);
|
|
12410
12510
|
}
|
|
12411
12511
|
}, [open.isOpen]);
|
|
12412
|
-
|
|
12512
|
+
useEffect6(() => {
|
|
12413
12513
|
document.body.style.overflow = open.isOpen ? "hidden" : "unset";
|
|
12414
12514
|
}, [open.isOpen]);
|
|
12415
12515
|
if (!open.isOpen) return null;
|
|
@@ -12701,7 +12801,7 @@ var PreviewItem = ({
|
|
|
12701
12801
|
onDownload,
|
|
12702
12802
|
progress
|
|
12703
12803
|
}) => {
|
|
12704
|
-
const [previewShow, setPreviewShow] =
|
|
12804
|
+
const [previewShow, setPreviewShow] = useState5({
|
|
12705
12805
|
isOpen: false,
|
|
12706
12806
|
isVisible: false
|
|
12707
12807
|
});
|
|
@@ -12910,12 +13010,12 @@ var InputFile = forwardRef2(
|
|
|
12910
13010
|
const inputRef = useRef3(null);
|
|
12911
13011
|
const replaceInputRef = useRef3(null);
|
|
12912
13012
|
const uploadedFilesRef = useRef3([]);
|
|
12913
|
-
const [internalFiles, setInternalFiles] =
|
|
12914
|
-
const [replaceIndex, setReplaceIndex] =
|
|
12915
|
-
const [customNames, setCustomNames] =
|
|
12916
|
-
const [isDragging, setIsDragging] =
|
|
12917
|
-
const [internalErrorMessage, setInternalErrorMessage] =
|
|
12918
|
-
const [uploadProgress, setUploadProgress] =
|
|
13013
|
+
const [internalFiles, setInternalFiles] = useState6([]);
|
|
13014
|
+
const [replaceIndex, setReplaceIndex] = useState6(null);
|
|
13015
|
+
const [customNames, setCustomNames] = useState6({});
|
|
13016
|
+
const [isDragging, setIsDragging] = useState6(false);
|
|
13017
|
+
const [internalErrorMessage, setInternalErrorMessage] = useState6(void 0);
|
|
13018
|
+
const [uploadProgress, setUploadProgress] = useState6({});
|
|
12919
13019
|
const files = value ?? internalFiles;
|
|
12920
13020
|
const filesRef = useRef3(files);
|
|
12921
13021
|
filesRef.current = files;
|
|
@@ -13197,12 +13297,12 @@ var InputFile = forwardRef2(
|
|
|
13197
13297
|
return base2;
|
|
13198
13298
|
})
|
|
13199
13299
|
}));
|
|
13200
|
-
|
|
13300
|
+
useEffect7(() => {
|
|
13201
13301
|
return () => {
|
|
13202
13302
|
files.forEach((f2) => URL.revokeObjectURL(f2.preview));
|
|
13203
13303
|
};
|
|
13204
13304
|
}, []);
|
|
13205
|
-
|
|
13305
|
+
useEffect7(() => {
|
|
13206
13306
|
if (errorMessage !== void 0) {
|
|
13207
13307
|
setInternalErrorMessage(errorMessage);
|
|
13208
13308
|
}
|
|
@@ -13364,7 +13464,7 @@ var InputFile = forwardRef2(
|
|
|
13364
13464
|
InputFile.displayName = "InputFile";
|
|
13365
13465
|
|
|
13366
13466
|
// src/components/counter/counter.tsx
|
|
13367
|
-
import { useState as
|
|
13467
|
+
import { useState as useState7 } from "react";
|
|
13368
13468
|
|
|
13369
13469
|
// src/components/counter/counter-variants.ts
|
|
13370
13470
|
import { cva as cva8 } from "class-variance-authority";
|
|
@@ -13480,7 +13580,7 @@ var Counter = ({
|
|
|
13480
13580
|
defaultValue = "0",
|
|
13481
13581
|
onChange
|
|
13482
13582
|
}) => {
|
|
13483
|
-
const [internalValue, setInternalValue] =
|
|
13583
|
+
const [internalValue, setInternalValue] = useState7(defaultValue);
|
|
13484
13584
|
const isControlled = externalValue !== void 0;
|
|
13485
13585
|
const value = isControlled ? externalValue : internalValue;
|
|
13486
13586
|
const updateValue = (newValue) => {
|
|
@@ -13874,9 +13974,9 @@ function DropdownItem({
|
|
|
13874
13974
|
}
|
|
13875
13975
|
|
|
13876
13976
|
// src/hooks/use-copy.ts
|
|
13877
|
-
import { useState as
|
|
13977
|
+
import { useState as useState8 } from "react";
|
|
13878
13978
|
function useCopy() {
|
|
13879
|
-
const [copied, setCopied] =
|
|
13979
|
+
const [copied, setCopied] = useState8(false);
|
|
13880
13980
|
const copy2 = async (text) => {
|
|
13881
13981
|
await navigator.clipboard.writeText(text);
|
|
13882
13982
|
setCopied(true);
|
|
@@ -13887,7 +13987,7 @@ function useCopy() {
|
|
|
13887
13987
|
|
|
13888
13988
|
// src/components/table/table.tsx
|
|
13889
13989
|
import clsx5 from "clsx";
|
|
13890
|
-
import { createContext as createContext3, useContext as useContext3, useState as
|
|
13990
|
+
import { createContext as createContext3, useContext as useContext3, useState as useState9 } from "react";
|
|
13891
13991
|
|
|
13892
13992
|
// src/components/table/table-variants.ts
|
|
13893
13993
|
import { cva as cva9 } from "class-variance-authority";
|
|
@@ -14083,7 +14183,7 @@ function TablePagination({
|
|
|
14083
14183
|
dropdownItemClassName
|
|
14084
14184
|
}) {
|
|
14085
14185
|
const isControlled = selectedPerpage !== void 0;
|
|
14086
|
-
const [internalPerpage, setInternalPerpage] =
|
|
14186
|
+
const [internalPerpage, setInternalPerpage] = useState9(defaultPerpage);
|
|
14087
14187
|
const value = isControlled ? selectedPerpage : internalPerpage;
|
|
14088
14188
|
const handleChange = (val) => {
|
|
14089
14189
|
if (!isControlled) {
|
|
@@ -14233,10 +14333,10 @@ function TablePagination({
|
|
|
14233
14333
|
}
|
|
14234
14334
|
|
|
14235
14335
|
// src/components/date-picker/date-picker.tsx
|
|
14236
|
-
import { useEffect as
|
|
14336
|
+
import { useEffect as useEffect10, useRef as useRef5, useState as useState12 } from "react";
|
|
14237
14337
|
|
|
14238
14338
|
// src/components/calendar/calendar.tsx
|
|
14239
|
-
import { useEffect as
|
|
14339
|
+
import { useEffect as useEffect9, useState as useState11 } from "react";
|
|
14240
14340
|
|
|
14241
14341
|
// src/components/calendar/helpers/create-calendar-helpers.ts
|
|
14242
14342
|
var createCalendarHelpers = ({
|
|
@@ -14621,7 +14721,7 @@ function CalendarDayItem({
|
|
|
14621
14721
|
}
|
|
14622
14722
|
|
|
14623
14723
|
// src/components/calendar/partials/event-bar.tsx
|
|
14624
|
-
import { useState as
|
|
14724
|
+
import { useState as useState10 } from "react";
|
|
14625
14725
|
import clsx7 from "clsx";
|
|
14626
14726
|
import { Fragment as Fragment7, jsx as jsx421, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
14627
14727
|
function EventBar({
|
|
@@ -14631,8 +14731,8 @@ function EventBar({
|
|
|
14631
14731
|
isMouseEventOnChildren = false,
|
|
14632
14732
|
level = 0
|
|
14633
14733
|
}) {
|
|
14634
|
-
const [hovered, setHovered] =
|
|
14635
|
-
const [pos, setPos] =
|
|
14734
|
+
const [hovered, setHovered] = useState10(false);
|
|
14735
|
+
const [pos, setPos] = useState10({ x: 0, y: 0 });
|
|
14636
14736
|
const handleMouseMove = (e, useParentWrap) => {
|
|
14637
14737
|
const rect = useParentWrap !== void 0 && useParentWrap === true ? e.currentTarget.getBoundingClientRect() : {
|
|
14638
14738
|
left: 0,
|
|
@@ -15270,15 +15370,15 @@ var Calendar2 = ({
|
|
|
15270
15370
|
disabledDateClassName
|
|
15271
15371
|
}) => {
|
|
15272
15372
|
const currentDate = /* @__PURE__ */ new Date();
|
|
15273
|
-
const [currentMonth, setCurrentMonth] =
|
|
15274
|
-
const [currentYear, setCurrentYear] =
|
|
15275
|
-
const [isDropdownYearShow, setIsDropdownYearShow] =
|
|
15276
|
-
const [isDropdownMonthShow, setIsDropdownMonthShow] =
|
|
15277
|
-
const [selectedType, setSelectedType] =
|
|
15278
|
-
const [selectedTypeIndex, setSelectedTypeIndex] =
|
|
15373
|
+
const [currentMonth, setCurrentMonth] = useState11(defaultMonth ?? currentDate.getMonth());
|
|
15374
|
+
const [currentYear, setCurrentYear] = useState11(defaultYear ?? currentDate.getFullYear());
|
|
15375
|
+
const [isDropdownYearShow, setIsDropdownYearShow] = useState11(false);
|
|
15376
|
+
const [isDropdownMonthShow, setIsDropdownMonthShow] = useState11(false);
|
|
15377
|
+
const [selectedType, setSelectedType] = useState11(type);
|
|
15378
|
+
const [selectedTypeIndex, setSelectedTypeIndex] = useState11(
|
|
15279
15379
|
null
|
|
15280
15380
|
);
|
|
15281
|
-
const [currentWeekStart, setCurrentWeekStart] =
|
|
15381
|
+
const [currentWeekStart, setCurrentWeekStart] = useState11(() => {
|
|
15282
15382
|
const today = /* @__PURE__ */ new Date();
|
|
15283
15383
|
const day = today.getDay();
|
|
15284
15384
|
const start = new Date(today);
|
|
@@ -15364,7 +15464,7 @@ var Calendar2 = ({
|
|
|
15364
15464
|
}
|
|
15365
15465
|
}
|
|
15366
15466
|
};
|
|
15367
|
-
|
|
15467
|
+
useEffect9(() => {
|
|
15368
15468
|
if (value !== void 0) {
|
|
15369
15469
|
setCurrentMonth(
|
|
15370
15470
|
value?.getMonth() ?? defaultMonth ?? currentDate?.getMonth()
|
|
@@ -15374,7 +15474,7 @@ var Calendar2 = ({
|
|
|
15374
15474
|
);
|
|
15375
15475
|
}
|
|
15376
15476
|
}, [value]);
|
|
15377
|
-
|
|
15477
|
+
useEffect9(() => {
|
|
15378
15478
|
if (type !== void 0) {
|
|
15379
15479
|
setSelectedType(type);
|
|
15380
15480
|
}
|
|
@@ -15680,16 +15780,16 @@ var DatePicker = ({
|
|
|
15680
15780
|
align = "start",
|
|
15681
15781
|
containerClassName
|
|
15682
15782
|
}) => {
|
|
15683
|
-
const [selectedDate, setSelectedDate] =
|
|
15783
|
+
const [selectedDate, setSelectedDate] = useState12(
|
|
15684
15784
|
controlledValue || null
|
|
15685
15785
|
);
|
|
15686
|
-
const [dateRange, setDateRange] =
|
|
15786
|
+
const [dateRange, setDateRange] = useState12(
|
|
15687
15787
|
controlledRangeValue || { start: null, end: null }
|
|
15688
15788
|
);
|
|
15689
|
-
const [inputValue, setInputValue] =
|
|
15690
|
-
const [isMobile, setIsMobile] =
|
|
15691
|
-
const [isCalendarShow, setIsCalendarShow] =
|
|
15692
|
-
const [selectedFilter, setSelectedFilter] =
|
|
15789
|
+
const [inputValue, setInputValue] = useState12("");
|
|
15790
|
+
const [isMobile, setIsMobile] = useState12(false);
|
|
15791
|
+
const [isCalendarShow, setIsCalendarShow] = useState12(false);
|
|
15792
|
+
const [selectedFilter, setSelectedFilter] = useState12([]);
|
|
15693
15793
|
const containerRef = useRef5(null);
|
|
15694
15794
|
const filterCalendar = [
|
|
15695
15795
|
{
|
|
@@ -15879,19 +15979,19 @@ var DatePicker = ({
|
|
|
15879
15979
|
};
|
|
15880
15980
|
};
|
|
15881
15981
|
const nextMonthData = getNextMonth();
|
|
15882
|
-
|
|
15982
|
+
useEffect10(() => {
|
|
15883
15983
|
if (mode === "single" && controlledValue) {
|
|
15884
15984
|
setSelectedDate(controlledValue);
|
|
15885
15985
|
setInputValue(formatDateToString(controlledValue, format));
|
|
15886
15986
|
}
|
|
15887
15987
|
}, [controlledValue, mode]);
|
|
15888
|
-
|
|
15988
|
+
useEffect10(() => {
|
|
15889
15989
|
if (mode === "range" && controlledRangeValue) {
|
|
15890
15990
|
setDateRange(controlledRangeValue);
|
|
15891
15991
|
setInputValue(formatRangeToString(controlledRangeValue));
|
|
15892
15992
|
}
|
|
15893
15993
|
}, [controlledRangeValue, mode, open]);
|
|
15894
|
-
|
|
15994
|
+
useEffect10(() => {
|
|
15895
15995
|
const checkMobile = () => {
|
|
15896
15996
|
setIsMobile(window.innerWidth < 768);
|
|
15897
15997
|
};
|
|
@@ -15899,7 +15999,7 @@ var DatePicker = ({
|
|
|
15899
15999
|
window.addEventListener("resize", checkMobile);
|
|
15900
16000
|
return () => window.removeEventListener("resize", checkMobile);
|
|
15901
16001
|
}, []);
|
|
15902
|
-
|
|
16002
|
+
useEffect10(() => {
|
|
15903
16003
|
if (open !== void 0) {
|
|
15904
16004
|
setIsCalendarShow(open);
|
|
15905
16005
|
}
|
|
@@ -16487,7 +16587,7 @@ function ToastCard({
|
|
|
16487
16587
|
}
|
|
16488
16588
|
|
|
16489
16589
|
// src/components/toast/toast-provider.tsx
|
|
16490
|
-
import { useState as
|
|
16590
|
+
import { useState as useState14, useCallback as useCallback2 } from "react";
|
|
16491
16591
|
import clsx13 from "clsx";
|
|
16492
16592
|
|
|
16493
16593
|
// src/components/toast/toast-context.ts
|
|
@@ -16495,15 +16595,15 @@ import { createContext as createContext4 } from "react";
|
|
|
16495
16595
|
var ToastContext = createContext4(null);
|
|
16496
16596
|
|
|
16497
16597
|
// src/components/toast/toast-item.tsx
|
|
16498
|
-
import { useEffect as
|
|
16598
|
+
import { useEffect as useEffect11, useState as useState13 } from "react";
|
|
16499
16599
|
import { jsx as jsx431 } from "react/jsx-runtime";
|
|
16500
16600
|
function ToastItem({
|
|
16501
16601
|
onRemove,
|
|
16502
16602
|
duration = 4e3,
|
|
16503
16603
|
...props
|
|
16504
16604
|
}) {
|
|
16505
|
-
const [open, setOpen] =
|
|
16506
|
-
|
|
16605
|
+
const [open, setOpen] = useState13(false);
|
|
16606
|
+
useEffect11(() => {
|
|
16507
16607
|
requestAnimationFrame(() => setOpen(true));
|
|
16508
16608
|
const timer = setTimeout(() => close2(), duration);
|
|
16509
16609
|
return () => clearTimeout(timer);
|
|
@@ -16527,11 +16627,11 @@ function ToastProvider({
|
|
|
16527
16627
|
children,
|
|
16528
16628
|
position = "top-right"
|
|
16529
16629
|
}) {
|
|
16530
|
-
const [toasts, setToasts] =
|
|
16630
|
+
const [toasts, setToasts] = useState14([]);
|
|
16531
16631
|
const remove = (id) => {
|
|
16532
16632
|
setToasts((t) => t.filter((x3) => x3.id !== id));
|
|
16533
16633
|
};
|
|
16534
|
-
const show =
|
|
16634
|
+
const show = useCallback2((props) => {
|
|
16535
16635
|
const id = crypto.randomUUID();
|
|
16536
16636
|
setToasts((t) => [...t, { ...props, id }]);
|
|
16537
16637
|
}, []);
|
|
@@ -16574,9 +16674,9 @@ function useToast() {
|
|
|
16574
16674
|
|
|
16575
16675
|
// src/components/select/select.tsx
|
|
16576
16676
|
import React403, {
|
|
16577
|
-
useState as
|
|
16677
|
+
useState as useState15,
|
|
16578
16678
|
useRef as useRef6,
|
|
16579
|
-
useEffect as
|
|
16679
|
+
useEffect as useEffect12
|
|
16580
16680
|
} from "react";
|
|
16581
16681
|
|
|
16582
16682
|
// src/components/loading/rounded-spinner.tsx
|
|
@@ -16685,9 +16785,9 @@ function Select({
|
|
|
16685
16785
|
searchOptions,
|
|
16686
16786
|
searchPlaceholder = "Search..."
|
|
16687
16787
|
}) {
|
|
16688
|
-
const [isOpen, setIsOpen] =
|
|
16689
|
-
const [searchTerm, setSearchTerm] =
|
|
16690
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
16788
|
+
const [isOpen, setIsOpen] = useState15(false);
|
|
16789
|
+
const [searchTerm, setSearchTerm] = useState15("");
|
|
16790
|
+
const [highlightedIndex, setHighlightedIndex] = useState15(0);
|
|
16691
16791
|
const containerRef = useRef6(null);
|
|
16692
16792
|
const searchInputRef = useRef6(null);
|
|
16693
16793
|
const optionRefs = useRef6([]);
|
|
@@ -16778,10 +16878,10 @@ function Select({
|
|
|
16778
16878
|
break;
|
|
16779
16879
|
}
|
|
16780
16880
|
};
|
|
16781
|
-
|
|
16881
|
+
useEffect12(() => {
|
|
16782
16882
|
setHighlightedIndex(0);
|
|
16783
16883
|
}, [searchTerm]);
|
|
16784
|
-
|
|
16884
|
+
useEffect12(() => {
|
|
16785
16885
|
const el = optionRefs.current[highlightedIndex];
|
|
16786
16886
|
if (el) {
|
|
16787
16887
|
el.scrollIntoView({
|
|
@@ -16790,7 +16890,7 @@ function Select({
|
|
|
16790
16890
|
});
|
|
16791
16891
|
}
|
|
16792
16892
|
}, [highlightedIndex]);
|
|
16793
|
-
|
|
16893
|
+
useEffect12(() => {
|
|
16794
16894
|
const handleClickOutside = (e) => {
|
|
16795
16895
|
const target = e.target;
|
|
16796
16896
|
if (target && containerRef.current && !containerRef.current.contains(target)) {
|
|
@@ -16801,23 +16901,23 @@ function Select({
|
|
|
16801
16901
|
document.addEventListener("mousedown", handleClickOutside);
|
|
16802
16902
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
16803
16903
|
}, []);
|
|
16804
|
-
|
|
16904
|
+
useEffect12(() => {
|
|
16805
16905
|
if (isOpen && isSearchable) {
|
|
16806
16906
|
searchInputRef.current?.focus();
|
|
16807
16907
|
}
|
|
16808
16908
|
}, [isOpen, isSearchable]);
|
|
16809
|
-
|
|
16909
|
+
useEffect12(() => {
|
|
16810
16910
|
onOptionsChange?.(filteredOptions);
|
|
16811
16911
|
}, [filteredOptions]);
|
|
16812
|
-
|
|
16912
|
+
useEffect12(() => {
|
|
16813
16913
|
if (isSelectOpen !== void 0) {
|
|
16814
16914
|
setIsOpen(isSelectOpen);
|
|
16815
16915
|
}
|
|
16816
16916
|
}, [isSelectOpen]);
|
|
16817
|
-
|
|
16917
|
+
useEffect12(() => {
|
|
16818
16918
|
onOpenChange?.(isOpen);
|
|
16819
16919
|
}, [isOpen]);
|
|
16820
|
-
|
|
16920
|
+
useEffect12(() => {
|
|
16821
16921
|
if (searchOptions !== void 0) {
|
|
16822
16922
|
setSearchTerm(searchOptions);
|
|
16823
16923
|
}
|
|
@@ -16996,39 +17096,105 @@ function Select({
|
|
|
16996
17096
|
}
|
|
16997
17097
|
|
|
16998
17098
|
// src/components/tabs/tabs.tsx
|
|
16999
|
-
import {
|
|
17099
|
+
import React404, {
|
|
17000
17100
|
createContext as createContext5,
|
|
17001
17101
|
useContext as useContext5,
|
|
17002
|
-
useState as
|
|
17102
|
+
useState as useState16,
|
|
17003
17103
|
useRef as useRef7,
|
|
17004
|
-
useEffect as
|
|
17104
|
+
useEffect as useEffect13
|
|
17005
17105
|
} from "react";
|
|
17006
17106
|
import { jsx as jsx435, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
17007
17107
|
var TabsContext = createContext5(void 0);
|
|
17108
|
+
var TAB_URL_EVENT = "__tab_url_change__";
|
|
17109
|
+
function readParams2() {
|
|
17110
|
+
if (typeof window === "undefined") {
|
|
17111
|
+
return new URLSearchParams();
|
|
17112
|
+
}
|
|
17113
|
+
return new URLSearchParams(window.location.search);
|
|
17114
|
+
}
|
|
17115
|
+
function useUrlSearchParams2() {
|
|
17116
|
+
const [params, setParams] = useState16(readParams2);
|
|
17117
|
+
useEffect13(() => {
|
|
17118
|
+
const sync = () => setParams(readParams2());
|
|
17119
|
+
sync();
|
|
17120
|
+
window.addEventListener("popstate", sync);
|
|
17121
|
+
window.addEventListener(TAB_URL_EVENT, sync);
|
|
17122
|
+
return () => {
|
|
17123
|
+
window.removeEventListener("popstate", sync);
|
|
17124
|
+
window.removeEventListener(TAB_URL_EVENT, sync);
|
|
17125
|
+
};
|
|
17126
|
+
}, []);
|
|
17127
|
+
const setSearchParams = React404.useCallback(
|
|
17128
|
+
(updater, options) => {
|
|
17129
|
+
const next = updater(readParams2());
|
|
17130
|
+
const query = next.toString();
|
|
17131
|
+
const url = `${window.location.pathname}${query ? `?${query}` : ""}${window.location.hash}`;
|
|
17132
|
+
if (options?.replace) {
|
|
17133
|
+
window.history.replaceState(window.history.state, "", url);
|
|
17134
|
+
} else {
|
|
17135
|
+
window.history.pushState(window.history.state, "", url);
|
|
17136
|
+
}
|
|
17137
|
+
window.dispatchEvent(new Event(TAB_URL_EVENT));
|
|
17138
|
+
},
|
|
17139
|
+
[]
|
|
17140
|
+
);
|
|
17141
|
+
return [params, setSearchParams];
|
|
17142
|
+
}
|
|
17008
17143
|
var useTabsContext = () => {
|
|
17009
17144
|
const context = useContext5(TabsContext);
|
|
17010
|
-
if (
|
|
17145
|
+
if (context === void 0) {
|
|
17011
17146
|
throw new Error("Tabs components must be used within Tabs");
|
|
17012
17147
|
}
|
|
17013
17148
|
return context;
|
|
17014
17149
|
};
|
|
17150
|
+
var useTabHref = (value) => {
|
|
17151
|
+
const { buildHref } = useTabsContext();
|
|
17152
|
+
return buildHref?.(value);
|
|
17153
|
+
};
|
|
17015
17154
|
var Tabs = ({
|
|
17016
17155
|
defaultValue,
|
|
17017
17156
|
value: controlledValue,
|
|
17018
17157
|
onValueChange,
|
|
17158
|
+
id,
|
|
17159
|
+
urlReplace = true,
|
|
17019
17160
|
orientation = "horizontal",
|
|
17020
17161
|
unmountOnHide = true,
|
|
17021
17162
|
className,
|
|
17022
17163
|
children
|
|
17023
17164
|
}) => {
|
|
17024
|
-
const [
|
|
17165
|
+
const [searchParams, setSearchParams] = useUrlSearchParams2();
|
|
17166
|
+
const [uncontrolledValue, setUncontrolledValue] = useState16(
|
|
17025
17167
|
defaultValue ?? ""
|
|
17026
17168
|
);
|
|
17027
17169
|
const triggersRef = useRef7(/* @__PURE__ */ new Map());
|
|
17028
17170
|
const isControlled = controlledValue !== void 0;
|
|
17029
|
-
const
|
|
17171
|
+
const urlParam = id !== void 0 ? `tab-${id}` : void 0;
|
|
17172
|
+
const isUrlSynced = urlParam !== void 0 && !isControlled;
|
|
17173
|
+
let value;
|
|
17174
|
+
if (isControlled) {
|
|
17175
|
+
value = controlledValue;
|
|
17176
|
+
} else if (isUrlSynced) {
|
|
17177
|
+
value = searchParams.get(urlParam) ?? defaultValue ?? "";
|
|
17178
|
+
} else {
|
|
17179
|
+
value = uncontrolledValue;
|
|
17180
|
+
}
|
|
17181
|
+
const buildHref = isUrlSynced ? (newValue) => {
|
|
17182
|
+
const next = new URLSearchParams(searchParams);
|
|
17183
|
+
next.set(urlParam, newValue);
|
|
17184
|
+
return `?${next.toString()}`;
|
|
17185
|
+
} : void 0;
|
|
17030
17186
|
const handleValueChange = (newValue) => {
|
|
17031
|
-
if (
|
|
17187
|
+
if (isUrlSynced && urlParam !== void 0) {
|
|
17188
|
+
setSearchParams(
|
|
17189
|
+
(prev) => {
|
|
17190
|
+
const next = new URLSearchParams(prev);
|
|
17191
|
+
next.set(urlParam, newValue);
|
|
17192
|
+
return next;
|
|
17193
|
+
},
|
|
17194
|
+
{ replace: urlReplace }
|
|
17195
|
+
);
|
|
17196
|
+
}
|
|
17197
|
+
if (!isUrlSynced && !isControlled) {
|
|
17032
17198
|
setUncontrolledValue(newValue);
|
|
17033
17199
|
}
|
|
17034
17200
|
onValueChange?.(newValue);
|
|
@@ -17048,7 +17214,9 @@ var Tabs = ({
|
|
|
17048
17214
|
orientation,
|
|
17049
17215
|
unmountOnHide,
|
|
17050
17216
|
registerTrigger,
|
|
17051
|
-
unregisterTrigger
|
|
17217
|
+
unregisterTrigger,
|
|
17218
|
+
buildHref,
|
|
17219
|
+
urlReplace
|
|
17052
17220
|
},
|
|
17053
17221
|
children: /* @__PURE__ */ jsx435("div", { className: cn(className), "data-orientation": orientation, children })
|
|
17054
17222
|
}
|
|
@@ -17057,15 +17225,15 @@ var Tabs = ({
|
|
|
17057
17225
|
var TabsList = ({ className, children }) => {
|
|
17058
17226
|
const { orientation, value } = useTabsContext();
|
|
17059
17227
|
const listRef = useRef7(null);
|
|
17060
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
17061
|
-
const [isInitialized, setIsInitialized] =
|
|
17062
|
-
|
|
17228
|
+
const [indicatorStyle, setIndicatorStyle] = useState16({});
|
|
17229
|
+
const [isInitialized, setIsInitialized] = useState16(false);
|
|
17230
|
+
useEffect13(() => {
|
|
17063
17231
|
const updateIndicator = () => {
|
|
17064
|
-
if (
|
|
17232
|
+
if (listRef.current === null) return;
|
|
17065
17233
|
const activeButton = listRef.current.querySelector(
|
|
17066
|
-
|
|
17234
|
+
'[aria-selected="true"]'
|
|
17067
17235
|
);
|
|
17068
|
-
if (activeButton === null
|
|
17236
|
+
if (activeButton === null) return;
|
|
17069
17237
|
const listRect = listRef.current.getBoundingClientRect();
|
|
17070
17238
|
const buttonRect = activeButton.getBoundingClientRect();
|
|
17071
17239
|
if (orientation === "horizontal") {
|
|
@@ -17138,36 +17306,63 @@ var TabsTrigger = ({
|
|
|
17138
17306
|
className,
|
|
17139
17307
|
children
|
|
17140
17308
|
}) => {
|
|
17141
|
-
const {
|
|
17309
|
+
const {
|
|
17310
|
+
value,
|
|
17311
|
+
onValueChange,
|
|
17312
|
+
buildHref,
|
|
17313
|
+
registerTrigger,
|
|
17314
|
+
unregisterTrigger
|
|
17315
|
+
} = useTabsContext();
|
|
17142
17316
|
const isSelected = value === triggerValue;
|
|
17143
17317
|
const triggerRef = useRef7(null);
|
|
17144
|
-
|
|
17145
|
-
|
|
17318
|
+
const href = buildHref?.(triggerValue);
|
|
17319
|
+
useEffect13(() => {
|
|
17320
|
+
if (triggerRef.current !== null) {
|
|
17146
17321
|
registerTrigger(triggerValue, triggerRef.current);
|
|
17147
17322
|
}
|
|
17148
17323
|
return () => {
|
|
17149
17324
|
unregisterTrigger(triggerValue);
|
|
17150
17325
|
};
|
|
17151
17326
|
}, [triggerValue, registerTrigger, unregisterTrigger]);
|
|
17327
|
+
const sharedClass = cn(
|
|
17328
|
+
"inline-flex cursor-pointer items-center justify-center rounded-md px-4 py-2 whitespace-nowrap",
|
|
17329
|
+
"text-sm font-semibold transition-colors duration-200",
|
|
17330
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 focus-visible:outline-none",
|
|
17331
|
+
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
17332
|
+
isSelected ? "text-white" : "text-gray-700 hover:text-gray-900",
|
|
17333
|
+
className
|
|
17334
|
+
);
|
|
17335
|
+
const sharedA11y = {
|
|
17336
|
+
"role": "tab",
|
|
17337
|
+
"aria-selected": isSelected,
|
|
17338
|
+
"aria-controls": `panel-${triggerValue}`,
|
|
17339
|
+
"id": `tab-${triggerValue}`
|
|
17340
|
+
};
|
|
17341
|
+
if (href !== void 0 && !disabled) {
|
|
17342
|
+
return /* @__PURE__ */ jsx435(
|
|
17343
|
+
"a",
|
|
17344
|
+
{
|
|
17345
|
+
ref: triggerRef,
|
|
17346
|
+
href,
|
|
17347
|
+
onClick: (e) => {
|
|
17348
|
+
e.preventDefault();
|
|
17349
|
+
onValueChange(triggerValue);
|
|
17350
|
+
},
|
|
17351
|
+
className: sharedClass,
|
|
17352
|
+
...sharedA11y,
|
|
17353
|
+
children
|
|
17354
|
+
}
|
|
17355
|
+
);
|
|
17356
|
+
}
|
|
17152
17357
|
return /* @__PURE__ */ jsx435(
|
|
17153
17358
|
"button",
|
|
17154
17359
|
{
|
|
17155
17360
|
ref: triggerRef,
|
|
17156
|
-
role: "tab",
|
|
17157
17361
|
type: "button",
|
|
17158
|
-
"aria-selected": isSelected,
|
|
17159
|
-
"aria-controls": `panel-${triggerValue}`,
|
|
17160
|
-
id: `tab-${triggerValue}`,
|
|
17161
17362
|
disabled,
|
|
17162
17363
|
onClick: () => onValueChange(triggerValue),
|
|
17163
|
-
className:
|
|
17164
|
-
|
|
17165
|
-
"text-sm font-semibold transition-colors duration-200",
|
|
17166
|
-
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 focus-visible:outline-none",
|
|
17167
|
-
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
17168
|
-
isSelected ? "text-white" : "text-gray-700 hover:text-gray-900",
|
|
17169
|
-
className
|
|
17170
|
-
),
|
|
17364
|
+
className: sharedClass,
|
|
17365
|
+
...sharedA11y,
|
|
17171
17366
|
children
|
|
17172
17367
|
}
|
|
17173
17368
|
);
|
|
@@ -17294,7 +17489,7 @@ import StarterKit from "@tiptap/starter-kit";
|
|
|
17294
17489
|
import { dracula } from "@uiw/codemirror-theme-dracula";
|
|
17295
17490
|
import CodeMirror from "@uiw/react-codemirror";
|
|
17296
17491
|
import clsx21 from "clsx";
|
|
17297
|
-
import { useEffect as
|
|
17492
|
+
import { useEffect as useEffect19, useState as useState23 } from "react";
|
|
17298
17493
|
|
|
17299
17494
|
// node_modules/orderedmap/dist/index.js
|
|
17300
17495
|
function OrderedMap(content) {
|
|
@@ -34238,13 +34433,13 @@ function ToolbarGroup({ children }) {
|
|
|
34238
34433
|
}
|
|
34239
34434
|
|
|
34240
34435
|
// src/components/text-editor/partials/advance-group.tsx
|
|
34241
|
-
import { useEffect as
|
|
34436
|
+
import { useEffect as useEffect14, useState as useState17 } from "react";
|
|
34242
34437
|
import { jsx as jsx439 } from "react/jsx-runtime";
|
|
34243
34438
|
function AdvanceGroup({
|
|
34244
34439
|
onModeChange
|
|
34245
34440
|
}) {
|
|
34246
|
-
const [isHtmlMode, setIsHtmlMode] =
|
|
34247
|
-
|
|
34441
|
+
const [isHtmlMode, setIsHtmlMode] = useState17(false);
|
|
34442
|
+
useEffect14(() => {
|
|
34248
34443
|
onModeChange(isHtmlMode);
|
|
34249
34444
|
}, [isHtmlMode]);
|
|
34250
34445
|
return /* @__PURE__ */ jsx439(ToolbarGroup, { children: /* @__PURE__ */ jsx439(
|
|
@@ -34360,7 +34555,7 @@ function AlignmentGroup({
|
|
|
34360
34555
|
// src/components/text-editor/partials/formatting-group.tsx
|
|
34361
34556
|
import { useEditorState as useEditorState2 } from "@tiptap/react";
|
|
34362
34557
|
import clsx18 from "clsx";
|
|
34363
|
-
import { useEffect as
|
|
34558
|
+
import { useEffect as useEffect15, useState as useState18 } from "react";
|
|
34364
34559
|
|
|
34365
34560
|
// src/components/text-editor/partials/color-picker-button.tsx
|
|
34366
34561
|
import clsx17 from "clsx";
|
|
@@ -34422,8 +34617,8 @@ function FormattingGroup({
|
|
|
34422
34617
|
editor,
|
|
34423
34618
|
disabled = false
|
|
34424
34619
|
}) {
|
|
34425
|
-
const [customFontSize, setCustomFontSize] =
|
|
34426
|
-
const [customLineHeight, setCustomLineHeight] =
|
|
34620
|
+
const [customFontSize, setCustomFontSize] = useState18(16);
|
|
34621
|
+
const [customLineHeight, setCustomLineHeight] = useState18(1.5);
|
|
34427
34622
|
const activeState = useEditorState2({
|
|
34428
34623
|
editor,
|
|
34429
34624
|
selector: ({ editor: editor2 }) => ({
|
|
@@ -34447,10 +34642,10 @@ function FormattingGroup({
|
|
|
34447
34642
|
});
|
|
34448
34643
|
const displayFontSize = activeState?.activeFontSize ? parseInt(activeState.activeFontSize) : 16;
|
|
34449
34644
|
const displayLineHeight = activeState?.activeLineHeight ? parseFloat(activeState.activeLineHeight) : 1.5;
|
|
34450
|
-
|
|
34645
|
+
useEffect15(() => {
|
|
34451
34646
|
setCustomFontSize(displayFontSize);
|
|
34452
34647
|
}, [displayFontSize]);
|
|
34453
|
-
|
|
34648
|
+
useEffect15(() => {
|
|
34454
34649
|
setCustomLineHeight(displayLineHeight);
|
|
34455
34650
|
}, [displayLineHeight]);
|
|
34456
34651
|
return /* @__PURE__ */ jsxs97(Fragment13, { children: [
|
|
@@ -34843,7 +35038,7 @@ function IndentGroup({ disabled = false, editor }) {
|
|
|
34843
35038
|
|
|
34844
35039
|
// src/components/text-editor/partials/insert-group.tsx
|
|
34845
35040
|
import { useEditorState as useEditorState4 } from "@tiptap/react";
|
|
34846
|
-
import { useState as
|
|
35041
|
+
import { useState as useState22 } from "react";
|
|
34847
35042
|
|
|
34848
35043
|
// src/components/kbd/kbd.tsx
|
|
34849
35044
|
import "react";
|
|
@@ -35000,11 +35195,11 @@ function toEmbedUrl(url) {
|
|
|
35000
35195
|
var yt_url_to_embed_default = toEmbedUrl;
|
|
35001
35196
|
|
|
35002
35197
|
// src/components/text-editor/hooks/use-link-handler.ts
|
|
35003
|
-
import { useRef as useRef8, useState as
|
|
35198
|
+
import { useRef as useRef8, useState as useState19 } from "react";
|
|
35004
35199
|
import "@tiptap/react";
|
|
35005
35200
|
function useLinkHandler({ editor }) {
|
|
35006
|
-
const [isLinkOpen, setIsLinkOpen] =
|
|
35007
|
-
const [url, setUrl] =
|
|
35201
|
+
const [isLinkOpen, setIsLinkOpen] = useState19(false);
|
|
35202
|
+
const [url, setUrl] = useState19("");
|
|
35008
35203
|
const savedSelection = useRef8(null);
|
|
35009
35204
|
const handleOpen = (open) => {
|
|
35010
35205
|
setIsLinkOpen(open);
|
|
@@ -35046,7 +35241,7 @@ function useLinkHandler({ editor }) {
|
|
|
35046
35241
|
}
|
|
35047
35242
|
|
|
35048
35243
|
// src/components/text-editor/partials/modal-insert-image.tsx
|
|
35049
|
-
import { useEffect as
|
|
35244
|
+
import { useEffect as useEffect16, useState as useState20 } from "react";
|
|
35050
35245
|
|
|
35051
35246
|
// src/components/text-editor/constants/object-fit-options.ts
|
|
35052
35247
|
var objectfitOptions = [
|
|
@@ -35111,13 +35306,13 @@ function ModalInsertImage({
|
|
|
35111
35306
|
},
|
|
35112
35307
|
onDownload
|
|
35113
35308
|
}) {
|
|
35114
|
-
const [currentTabImage, setCurrentTabImage] =
|
|
35115
|
-
const [uploadInputKey, setUploadInputKey] =
|
|
35116
|
-
const [uploadFiles, setUploadFiles] =
|
|
35117
|
-
const [errors, setErrors] =
|
|
35309
|
+
const [currentTabImage, setCurrentTabImage] = useState20("0");
|
|
35310
|
+
const [uploadInputKey, setUploadInputKey] = useState20(0);
|
|
35311
|
+
const [uploadFiles, setUploadFiles] = useState20([]);
|
|
35312
|
+
const [errors, setErrors] = useState20(
|
|
35118
35313
|
{}
|
|
35119
35314
|
);
|
|
35120
|
-
const [imageForm, setImageForm] =
|
|
35315
|
+
const [imageForm, setImageForm] = useState20(
|
|
35121
35316
|
createDefaultImageForm()
|
|
35122
35317
|
);
|
|
35123
35318
|
const resetFormState = () => {
|
|
@@ -35144,7 +35339,7 @@ function ModalInsertImage({
|
|
|
35144
35339
|
setErrors(newErrors);
|
|
35145
35340
|
return Object.keys(newErrors).length === 0;
|
|
35146
35341
|
};
|
|
35147
|
-
|
|
35342
|
+
useEffect16(() => {
|
|
35148
35343
|
if (!isOpen) return;
|
|
35149
35344
|
setErrors({});
|
|
35150
35345
|
setCurrentTabImage("0");
|
|
@@ -35410,7 +35605,7 @@ function ModalInsertImage({
|
|
|
35410
35605
|
}
|
|
35411
35606
|
|
|
35412
35607
|
// src/components/text-editor/partials/modal-insert-youtube.tsx
|
|
35413
|
-
import { useEffect as
|
|
35608
|
+
import { useEffect as useEffect18, useState as useState21 } from "react";
|
|
35414
35609
|
|
|
35415
35610
|
// src/components/text-editor/helpers/is-valid-youtube-url.ts
|
|
35416
35611
|
var isValidYoutubeUrl = (url) => {
|
|
@@ -35429,7 +35624,7 @@ var isValidYoutubeUrl = (url) => {
|
|
|
35429
35624
|
var is_valid_youtube_url_default = isValidYoutubeUrl;
|
|
35430
35625
|
|
|
35431
35626
|
// src/components/text-editor/hooks/use-keyboard-shortcut.ts
|
|
35432
|
-
import { useEffect as
|
|
35627
|
+
import { useEffect as useEffect17 } from "react";
|
|
35433
35628
|
function isMac() {
|
|
35434
35629
|
if (typeof navigator === "undefined") return false;
|
|
35435
35630
|
return /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
@@ -35448,7 +35643,7 @@ function useKeyboardShortcut({
|
|
|
35448
35643
|
disabled = false,
|
|
35449
35644
|
callback
|
|
35450
35645
|
}) {
|
|
35451
|
-
|
|
35646
|
+
useEffect17(() => {
|
|
35452
35647
|
if (disabled) return;
|
|
35453
35648
|
const handler = (e) => {
|
|
35454
35649
|
if (isTypingElement(e.target)) return;
|
|
@@ -35486,9 +35681,9 @@ function ModalInsertYoutube({
|
|
|
35486
35681
|
},
|
|
35487
35682
|
url: ""
|
|
35488
35683
|
};
|
|
35489
|
-
const [youtubeForm, setYoutubeForm] =
|
|
35490
|
-
const [isValid, setIsValid] =
|
|
35491
|
-
|
|
35684
|
+
const [youtubeForm, setYoutubeForm] = useState21(defaultValue);
|
|
35685
|
+
const [isValid, setIsValid] = useState21(true);
|
|
35686
|
+
useEffect18(() => {
|
|
35492
35687
|
if (isOpen) {
|
|
35493
35688
|
setYoutubeForm(initialValues || defaultValue);
|
|
35494
35689
|
}
|
|
@@ -35615,8 +35810,8 @@ function InsertGroup({
|
|
|
35615
35810
|
attachmentField,
|
|
35616
35811
|
onDownload
|
|
35617
35812
|
}) {
|
|
35618
|
-
const [isModalImageOpen, setIsModalImageOpen] =
|
|
35619
|
-
const [isModalYoutubeOpen, setIsModalYoutubeOpen] =
|
|
35813
|
+
const [isModalImageOpen, setIsModalImageOpen] = useState22(false);
|
|
35814
|
+
const [isModalYoutubeOpen, setIsModalYoutubeOpen] = useState22(false);
|
|
35620
35815
|
const { isLink, isInYoutube, isInImage } = useEditorState4({
|
|
35621
35816
|
editor,
|
|
35622
35817
|
selector: ({ editor: editor2 }) => ({
|
|
@@ -36006,8 +36201,8 @@ function TextEditor({
|
|
|
36006
36201
|
indent = true,
|
|
36007
36202
|
advance = true
|
|
36008
36203
|
} = toolbar ?? {};
|
|
36009
|
-
const [isHtmlMode, setIsHtmlMode] =
|
|
36010
|
-
const [htmlValue, setHtmlValue] =
|
|
36204
|
+
const [isHtmlMode, setIsHtmlMode] = useState23(false);
|
|
36205
|
+
const [htmlValue, setHtmlValue] = useState23("");
|
|
36011
36206
|
const editor = useEditor({
|
|
36012
36207
|
content: void 0,
|
|
36013
36208
|
editable: !disabled,
|
|
@@ -36075,7 +36270,7 @@ function TextEditor({
|
|
|
36075
36270
|
});
|
|
36076
36271
|
setIsHtmlMode(false);
|
|
36077
36272
|
};
|
|
36078
|
-
|
|
36273
|
+
useEffect19(() => {
|
|
36079
36274
|
if (editor === null) return;
|
|
36080
36275
|
if (value === void 0) return;
|
|
36081
36276
|
if (editor.getHTML() === value) return;
|
|
@@ -36515,7 +36710,9 @@ export {
|
|
|
36515
36710
|
toDateOnly,
|
|
36516
36711
|
useCopy,
|
|
36517
36712
|
useIsMobile,
|
|
36713
|
+
useSheetHref,
|
|
36518
36714
|
useSidebar,
|
|
36715
|
+
useTabHref,
|
|
36519
36716
|
useToast
|
|
36520
36717
|
};
|
|
36521
36718
|
//# sourceMappingURL=clients.js.map
|