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