wcz-test 4.6.8 → 4.6.10
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 +26 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1158,7 +1158,7 @@ import { useState as useState5 } from "react";
|
|
|
1158
1158
|
import MoreVert from "@mui/icons-material/MoreVert";
|
|
1159
1159
|
import { Box as Box3, IconButton, ImageListItem, ImageListItemBar, Stack as Stack4, Tooltip } from "@mui/material";
|
|
1160
1160
|
import { grey } from "@mui/material/colors";
|
|
1161
|
-
import { Fragment, useEffect as
|
|
1161
|
+
import { Fragment, useEffect as useEffect3, useState as useState3 } from "react";
|
|
1162
1162
|
|
|
1163
1163
|
// src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
1164
1164
|
import Delete from "@mui/icons-material/Delete";
|
|
@@ -1179,7 +1179,7 @@ var useFile = () => {
|
|
|
1179
1179
|
|
|
1180
1180
|
// src/hooks/DialogsHooks.tsx
|
|
1181
1181
|
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, useEventCallback } from "@mui/material";
|
|
1182
|
-
import { useContext as useContext2, useMemo } from "react";
|
|
1182
|
+
import { useContext as useContext2, useEffect as useEffect2, useMemo, useRef as useRef2 } from "react";
|
|
1183
1183
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
1184
1184
|
|
|
1185
1185
|
// src/contexts/DialogsContext.ts
|
|
@@ -1190,20 +1190,31 @@ var DialogsContext = createContext2({});
|
|
|
1190
1190
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1191
1191
|
function AlertDialog({ open, payload, onClose }) {
|
|
1192
1192
|
const { t: t2 } = useTranslation2();
|
|
1193
|
+
const buttonRef = useRef2(null);
|
|
1194
|
+
useEffect2(() => {
|
|
1195
|
+
if (open && buttonRef.current) {
|
|
1196
|
+
buttonRef.current.focus();
|
|
1197
|
+
}
|
|
1198
|
+
}, [open]);
|
|
1193
1199
|
return /* @__PURE__ */ jsxs4(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), children: [
|
|
1194
1200
|
/* @__PURE__ */ jsx5(DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Alert") }),
|
|
1195
1201
|
/* @__PURE__ */ jsx5(DialogContent, { children: payload.message }),
|
|
1196
|
-
/* @__PURE__ */ jsx5(DialogActions, { children: /* @__PURE__ */ jsx5(Button, {
|
|
1202
|
+
/* @__PURE__ */ jsx5(DialogActions, { children: /* @__PURE__ */ jsx5(Button, { ref: buttonRef, onClick: () => onClose(), children: t2("Layout.Dialog.Confirm") }) })
|
|
1197
1203
|
] });
|
|
1198
1204
|
}
|
|
1199
1205
|
function ConfirmDialog({ open, payload, onClose }) {
|
|
1200
1206
|
const { t: t2 } = useTranslation2();
|
|
1207
|
+
const buttonRef = useRef2(null);
|
|
1208
|
+
useEffect2(() => {
|
|
1209
|
+
if (open && buttonRef.current)
|
|
1210
|
+
buttonRef.current.focus();
|
|
1211
|
+
}, [open]);
|
|
1201
1212
|
return /* @__PURE__ */ jsxs4(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), children: [
|
|
1202
1213
|
/* @__PURE__ */ jsx5(DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Confirm") }),
|
|
1203
1214
|
/* @__PURE__ */ jsx5(DialogContent, { children: payload.message }),
|
|
1204
1215
|
/* @__PURE__ */ jsxs4(DialogActions, { children: [
|
|
1205
|
-
/* @__PURE__ */ jsx5(Button, {
|
|
1206
|
-
/* @__PURE__ */ jsx5(Button, {
|
|
1216
|
+
/* @__PURE__ */ jsx5(Button, { onClick: () => onClose(false), children: payload.cancelText ?? t2("Layout.Dialog.Cancel") }),
|
|
1217
|
+
/* @__PURE__ */ jsx5(Button, { ref: buttonRef, onClick: () => onClose(true), children: t2("Layout.Dialog.Confirm") })
|
|
1207
1218
|
] })
|
|
1208
1219
|
] });
|
|
1209
1220
|
}
|
|
@@ -1511,7 +1522,7 @@ var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
|
1511
1522
|
const { setImageId, actions } = useFile();
|
|
1512
1523
|
const [showItemBar, setShowItemBar] = useState3(itemBar === "always");
|
|
1513
1524
|
const [menu, setMenu] = useState3(null);
|
|
1514
|
-
|
|
1525
|
+
useEffect3(() => {
|
|
1515
1526
|
setShowItemBar(itemBar === "always");
|
|
1516
1527
|
}, [itemBar]);
|
|
1517
1528
|
const { data: source } = useGetFileThumbnail(meta);
|
|
@@ -1635,13 +1646,13 @@ var ListFileViewerItem = ({ meta }) => {
|
|
|
1635
1646
|
// src/components/file/fileViewer/ImageViewer.tsx
|
|
1636
1647
|
import Close from "@mui/icons-material/Close";
|
|
1637
1648
|
import { Box as Box4, Dialog as Dialog2, Fab } from "@mui/material";
|
|
1638
|
-
import { useEffect as
|
|
1649
|
+
import { useEffect as useEffect4 } from "react";
|
|
1639
1650
|
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1640
1651
|
var ImageViewer = ({ metaId }) => {
|
|
1641
1652
|
const { fileMetas, setImageId } = useFile();
|
|
1642
1653
|
const meta = fileMetas.find((m) => m.id === metaId);
|
|
1643
1654
|
const { data: source } = useGetFile(meta);
|
|
1644
|
-
|
|
1655
|
+
useEffect4(() => {
|
|
1645
1656
|
if (metaId)
|
|
1646
1657
|
globalThis.addEventListener("keydown", handleOnKeydown);
|
|
1647
1658
|
return () => {
|
|
@@ -2590,18 +2601,18 @@ var AdapterDayjs = class {
|
|
|
2590
2601
|
};
|
|
2591
2602
|
|
|
2592
2603
|
// src/providers/LayoutProvider.tsx
|
|
2593
|
-
import { useEffect as
|
|
2604
|
+
import { useEffect as useEffect7 } from "react";
|
|
2594
2605
|
import * as z from "zod";
|
|
2595
2606
|
import { cs, en } from "zod/locales";
|
|
2596
2607
|
|
|
2597
2608
|
// src/providers/DialogsProvider.tsx
|
|
2598
|
-
import { useCallback, useId, useMemo as useMemo3, useRef as
|
|
2609
|
+
import { useCallback, useId, useMemo as useMemo3, useRef as useRef4, useState as useState6 } from "react";
|
|
2599
2610
|
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2600
2611
|
function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
2601
2612
|
const [stack, setStack] = useState6([]);
|
|
2602
2613
|
const keyPrefix = useId();
|
|
2603
|
-
const nextId =
|
|
2604
|
-
const dialogMetadata =
|
|
2614
|
+
const nextId = useRef4(0);
|
|
2615
|
+
const dialogMetadata = useRef4(/* @__PURE__ */ new WeakMap());
|
|
2605
2616
|
const requestDialog = useEventCallback_default(function open(Component7, payload, options = {}) {
|
|
2606
2617
|
const { onClose = async () => {
|
|
2607
2618
|
} } = options;
|
|
@@ -2698,7 +2709,7 @@ import { useNavigate, useRouterState as useRouterState2 } from "@tanstack/react-
|
|
|
2698
2709
|
import Divider3 from "@mui/material/Divider";
|
|
2699
2710
|
import List3 from "@mui/material/List";
|
|
2700
2711
|
import ListSubheader from "@mui/material/ListSubheader";
|
|
2701
|
-
import { Fragment as Fragment5, useEffect as
|
|
2712
|
+
import { Fragment as Fragment5, useEffect as useEffect6, useState as useState8 } from "react";
|
|
2702
2713
|
|
|
2703
2714
|
// src/components/core/navigation/NavigationListItem.tsx
|
|
2704
2715
|
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|
@@ -2895,7 +2906,7 @@ var isDivider = (item) => "kind" in item && item.kind === "divider";
|
|
|
2895
2906
|
var isHeader = (item) => "kind" in item && item.kind === "header";
|
|
2896
2907
|
var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, expandedWidth, renderItem, activePath, onNavigate, onClose }) => {
|
|
2897
2908
|
const [openKeys, setOpenKeys] = useState8([]);
|
|
2898
|
-
|
|
2909
|
+
useEffect6(() => {
|
|
2899
2910
|
if (collapsed) setOpenKeys([]);
|
|
2900
2911
|
}, [collapsed]);
|
|
2901
2912
|
const toggleKey = (key) => setOpenKeys((previous) => previous.includes(key) ? previous.filter((k) => k !== key) : [...previous, key]);
|
|
@@ -3975,7 +3986,7 @@ var useGetTheme = (theme) => {
|
|
|
3975
3986
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
3976
3987
|
var LayoutProvider = ({ navigation, theme, children }) => {
|
|
3977
3988
|
const createdTheme = useGetTheme(theme);
|
|
3978
|
-
|
|
3989
|
+
useEffect7(() => {
|
|
3979
3990
|
const handler = () => {
|
|
3980
3991
|
z.config(default2.resolvedLanguage === "cs" ? cs() : en());
|
|
3981
3992
|
};
|