@geekron/strapi 0.3.0 → 0.3.2
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/admin/index.js
CHANGED
|
@@ -19307,7 +19307,7 @@ var init_ApiErrorAlert = __esm(() => {
|
|
|
19307
19307
|
});
|
|
19308
19308
|
|
|
19309
19309
|
// admin/src/components/DashboardStats.tsx
|
|
19310
|
-
var import_design_system10, import_admin7,
|
|
19310
|
+
var import_design_system10, import_admin7, import_react12, jsx_dev_runtime28, DashboardStats = ({
|
|
19311
19311
|
showLoading = true,
|
|
19312
19312
|
data: externalData,
|
|
19313
19313
|
onError,
|
|
@@ -19315,15 +19315,15 @@ var import_design_system10, import_admin7, import_react11, jsx_dev_runtime28, Da
|
|
|
19315
19315
|
}) => {
|
|
19316
19316
|
const fetchClient = import_admin7.useFetchClient();
|
|
19317
19317
|
const { toggleNotification } = import_admin7.useNotification();
|
|
19318
|
-
const [isLoading, setIsLoading] =
|
|
19319
|
-
const [error, setError] =
|
|
19320
|
-
const [stats, setStats] =
|
|
19318
|
+
const [isLoading, setIsLoading] = import_react12.useState(!externalData);
|
|
19319
|
+
const [error, setError] = import_react12.useState(null);
|
|
19320
|
+
const [stats, setStats] = import_react12.useState(externalData || {
|
|
19321
19321
|
totalVisitor: 0,
|
|
19322
19322
|
todayVisitor: 0,
|
|
19323
19323
|
totalInquiry: 0,
|
|
19324
19324
|
unreadInquiry: 0
|
|
19325
19325
|
});
|
|
19326
|
-
|
|
19326
|
+
import_react12.useEffect(() => {
|
|
19327
19327
|
if (externalData) {
|
|
19328
19328
|
setStats(externalData);
|
|
19329
19329
|
setIsLoading(false);
|
|
@@ -19352,7 +19352,7 @@ var import_design_system10, import_admin7, import_react11, jsx_dev_runtime28, Da
|
|
|
19352
19352
|
};
|
|
19353
19353
|
fetchStats();
|
|
19354
19354
|
}, [externalData, fetchClient, toggleNotification, onError, onLoaded]);
|
|
19355
|
-
|
|
19355
|
+
import_react12.useEffect(() => {
|
|
19356
19356
|
if (externalData) {
|
|
19357
19357
|
setStats(externalData);
|
|
19358
19358
|
}
|
|
@@ -19481,7 +19481,7 @@ var init_DashboardStats = __esm(() => {
|
|
|
19481
19481
|
init_ApiErrorAlert();
|
|
19482
19482
|
import_design_system10 = require("@strapi/design-system");
|
|
19483
19483
|
import_admin7 = require("@strapi/strapi/admin");
|
|
19484
|
-
|
|
19484
|
+
import_react12 = require("react");
|
|
19485
19485
|
jsx_dev_runtime28 = require("react/jsx-dev-runtime");
|
|
19486
19486
|
DashboardStats_default = DashboardStats;
|
|
19487
19487
|
});
|
|
@@ -19538,19 +19538,19 @@ var init_Dashboard = __esm(() => {
|
|
|
19538
19538
|
});
|
|
19539
19539
|
|
|
19540
19540
|
// admin/src/pages/Inquiry.tsx
|
|
19541
|
-
var import_design_system13, import_icons14, import_symbols, import_admin10,
|
|
19541
|
+
var import_design_system13, import_icons14, import_symbols, import_admin10, import_react14, import_react_router_dom, jsx_dev_runtime31, Inquiry = () => {
|
|
19542
19542
|
const navigate = import_react_router_dom.useNavigate();
|
|
19543
19543
|
const fetchClient = import_admin10.useFetchClient();
|
|
19544
19544
|
const { toggleNotification } = import_admin10.useNotification();
|
|
19545
|
-
const [isLoading, setIsLoading] =
|
|
19546
|
-
const [error, setError] =
|
|
19547
|
-
const [data, setData] =
|
|
19548
|
-
const [pagination, setPagination] =
|
|
19545
|
+
const [isLoading, setIsLoading] = import_react14.useState(true);
|
|
19546
|
+
const [error, setError] = import_react14.useState(null);
|
|
19547
|
+
const [data, setData] = import_react14.useState([]);
|
|
19548
|
+
const [pagination, setPagination] = import_react14.useState({
|
|
19549
19549
|
page: 1,
|
|
19550
19550
|
pageSize: 10,
|
|
19551
19551
|
total: 0
|
|
19552
19552
|
});
|
|
19553
|
-
const fetchInquiries =
|
|
19553
|
+
const fetchInquiries = import_react14.useCallback(async (page = 1, pageSize = 10) => {
|
|
19554
19554
|
setIsLoading(true);
|
|
19555
19555
|
setError(null);
|
|
19556
19556
|
try {
|
|
@@ -19581,10 +19581,10 @@ var import_design_system13, import_icons14, import_symbols, import_admin10, impo
|
|
|
19581
19581
|
setIsLoading(false);
|
|
19582
19582
|
}
|
|
19583
19583
|
}, [fetchClient.get, toggleNotification]);
|
|
19584
|
-
|
|
19584
|
+
import_react14.useEffect(() => {
|
|
19585
19585
|
fetchInquiries(pagination.page, pagination.pageSize);
|
|
19586
19586
|
}, [fetchInquiries, pagination.page, pagination.pageSize]);
|
|
19587
|
-
|
|
19587
|
+
import_react14.useEffect(() => {
|
|
19588
19588
|
const handleVisibilityChange = () => {
|
|
19589
19589
|
if (document.visibilityState === "visible") {
|
|
19590
19590
|
fetchInquiries(pagination.page, pagination.pageSize);
|
|
@@ -19754,22 +19754,22 @@ var init_Inquiry = __esm(() => {
|
|
|
19754
19754
|
import_icons14 = require("@strapi/icons");
|
|
19755
19755
|
import_symbols = require("@strapi/icons/symbols");
|
|
19756
19756
|
import_admin10 = require("@strapi/strapi/admin");
|
|
19757
|
-
|
|
19757
|
+
import_react14 = require("react");
|
|
19758
19758
|
import_react_router_dom = require("react-router-dom");
|
|
19759
19759
|
jsx_dev_runtime31 = require("react/jsx-dev-runtime");
|
|
19760
19760
|
Inquiry_default = Inquiry;
|
|
19761
19761
|
});
|
|
19762
19762
|
|
|
19763
19763
|
// admin/src/pages/InquiryDetail.tsx
|
|
19764
|
-
var import_design_system14, import_admin11,
|
|
19764
|
+
var import_design_system14, import_admin11, import_react15, import_react_router_dom2, import_styled_components15, jsx_dev_runtime32, DetailTable, InquiryDetail = () => {
|
|
19765
19765
|
const { id } = import_react_router_dom2.useParams();
|
|
19766
19766
|
const navigate = import_react_router_dom2.useNavigate();
|
|
19767
19767
|
const fetchClient = import_admin11.useFetchClient();
|
|
19768
19768
|
const { toggleNotification } = import_admin11.useNotification();
|
|
19769
|
-
const [isLoading, setIsLoading] =
|
|
19770
|
-
const [isMarking, setIsMarking] =
|
|
19771
|
-
const [data, setData] =
|
|
19772
|
-
|
|
19769
|
+
const [isLoading, setIsLoading] = import_react15.useState(true);
|
|
19770
|
+
const [isMarking, setIsMarking] = import_react15.useState(false);
|
|
19771
|
+
const [data, setData] = import_react15.useState(null);
|
|
19772
|
+
import_react15.useEffect(() => {
|
|
19773
19773
|
const fetchDetail = async () => {
|
|
19774
19774
|
if (!id) {
|
|
19775
19775
|
toggleNotification({
|
|
@@ -20051,7 +20051,7 @@ var import_design_system14, import_admin11, import_react14, import_react_router_
|
|
|
20051
20051
|
var init_InquiryDetail = __esm(() => {
|
|
20052
20052
|
import_design_system14 = require("@strapi/design-system");
|
|
20053
20053
|
import_admin11 = require("@strapi/strapi/admin");
|
|
20054
|
-
|
|
20054
|
+
import_react15 = require("react");
|
|
20055
20055
|
import_react_router_dom2 = require("react-router-dom");
|
|
20056
20056
|
import_styled_components15 = __toESM(require("styled-components"));
|
|
20057
20057
|
jsx_dev_runtime32 = require("react/jsx-dev-runtime");
|
|
@@ -20098,19 +20098,19 @@ var init_InquiryDetail = __esm(() => {
|
|
|
20098
20098
|
});
|
|
20099
20099
|
|
|
20100
20100
|
// admin/src/pages/Visitor.tsx
|
|
20101
|
-
var import_design_system15, import_symbols2, import_admin12,
|
|
20101
|
+
var import_design_system15, import_symbols2, import_admin12, import_react16, jsx_dev_runtime33, Visitor = () => {
|
|
20102
20102
|
const fetchClient = import_admin12.useFetchClient();
|
|
20103
20103
|
const { toggleNotification } = import_admin12.useNotification();
|
|
20104
|
-
const [isLoading, setIsLoading] =
|
|
20105
|
-
const [error, setError] =
|
|
20106
|
-
const [activeTab, setActiveTab] =
|
|
20107
|
-
const [data, setData] =
|
|
20108
|
-
const [pagination, setPagination] =
|
|
20104
|
+
const [isLoading, setIsLoading] = import_react16.useState(true);
|
|
20105
|
+
const [error, setError] = import_react16.useState(null);
|
|
20106
|
+
const [activeTab, setActiveTab] = import_react16.useState("dailyStats");
|
|
20107
|
+
const [data, setData] = import_react16.useState([]);
|
|
20108
|
+
const [pagination, setPagination] = import_react16.useState({
|
|
20109
20109
|
page: 1,
|
|
20110
20110
|
pageSize: 10,
|
|
20111
20111
|
total: 0
|
|
20112
20112
|
});
|
|
20113
|
-
const fetchVisitorData =
|
|
20113
|
+
const fetchVisitorData = import_react16.useCallback(async (tab, page = 1, pageSize = 10) => {
|
|
20114
20114
|
setIsLoading(true);
|
|
20115
20115
|
setError(null);
|
|
20116
20116
|
try {
|
|
@@ -20157,7 +20157,7 @@ var import_design_system15, import_symbols2, import_admin12, import_react15, jsx
|
|
|
20157
20157
|
setIsLoading(false);
|
|
20158
20158
|
}
|
|
20159
20159
|
}, [fetchClient.get, toggleNotification]);
|
|
20160
|
-
|
|
20160
|
+
import_react16.useEffect(() => {
|
|
20161
20161
|
fetchVisitorData(activeTab, 1, pagination.pageSize);
|
|
20162
20162
|
}, [activeTab, pagination.pageSize, fetchVisitorData]);
|
|
20163
20163
|
const handleTabChange = (tabKey) => {
|
|
@@ -20449,7 +20449,7 @@ var init_Visitor = __esm(() => {
|
|
|
20449
20449
|
import_design_system15 = require("@strapi/design-system");
|
|
20450
20450
|
import_symbols2 = require("@strapi/icons/symbols");
|
|
20451
20451
|
import_admin12 = require("@strapi/strapi/admin");
|
|
20452
|
-
|
|
20452
|
+
import_react16 = require("react");
|
|
20453
20453
|
jsx_dev_runtime33 = require("react/jsx-dev-runtime");
|
|
20454
20454
|
Visitor_default = Visitor;
|
|
20455
20455
|
});
|
|
@@ -20459,7 +20459,7 @@ var exports_App = {};
|
|
|
20459
20459
|
__export(exports_App, {
|
|
20460
20460
|
default: () => App_default
|
|
20461
20461
|
});
|
|
20462
|
-
var import_strapi_admin, import_design_system16,
|
|
20462
|
+
var import_strapi_admin, import_design_system16, import_react17, import_react_router_dom3, import_styled_components16, jsx_dev_runtime34, LayoutContainer, Sidebar, MainContent, StyledNavLink, SidebarNav = () => {
|
|
20463
20463
|
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Sidebar, {
|
|
20464
20464
|
children: [
|
|
20465
20465
|
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Box, {
|
|
@@ -20502,9 +20502,9 @@ var import_strapi_admin, import_design_system16, import_react16, import_react_ro
|
|
|
20502
20502
|
}, undefined, true, undefined, this);
|
|
20503
20503
|
}, App = () => {
|
|
20504
20504
|
const client = import_strapi_admin.useFetchClient();
|
|
20505
|
-
const [isConnected, setIsConnected] =
|
|
20506
|
-
const [checking, setChecking] =
|
|
20507
|
-
|
|
20505
|
+
const [isConnected, setIsConnected] = import_react17.default.useState(null);
|
|
20506
|
+
const [checking, setChecking] = import_react17.default.useState(true);
|
|
20507
|
+
import_react17.default.useEffect(() => {
|
|
20508
20508
|
client.get("/website/check").then((response) => {
|
|
20509
20509
|
if (response?.data?.message) {
|
|
20510
20510
|
setIsConnected(true);
|
|
@@ -20591,7 +20591,7 @@ var init_App = __esm(() => {
|
|
|
20591
20591
|
init_Visitor();
|
|
20592
20592
|
import_strapi_admin = require("@strapi/admin/strapi-admin");
|
|
20593
20593
|
import_design_system16 = require("@strapi/design-system");
|
|
20594
|
-
|
|
20594
|
+
import_react17 = __toESM(require("react"));
|
|
20595
20595
|
import_react_router_dom3 = require("react-router-dom");
|
|
20596
20596
|
import_styled_components16 = __toESM(require("styled-components"));
|
|
20597
20597
|
jsx_dev_runtime34 = require("react/jsx-dev-runtime");
|
|
@@ -45540,6 +45540,7 @@ var registerColorPicker = (app) => {
|
|
|
45540
45540
|
// admin/src/fields/DataNested.tsx
|
|
45541
45541
|
var import_design_system5 = require("@strapi/design-system");
|
|
45542
45542
|
var import_admin3 = require("@strapi/strapi/admin");
|
|
45543
|
+
var import_react9 = require("react");
|
|
45543
45544
|
|
|
45544
45545
|
// admin/src/fields/DataNested/SortableTree.tsx
|
|
45545
45546
|
var import_core2 = __toESM(require_dist3(), 1);
|
|
@@ -47125,7 +47126,17 @@ var adjustTranslate = ({ transform }) => {
|
|
|
47125
47126
|
// admin/src/fields/DataNested/hooks/useTreeItems.ts
|
|
47126
47127
|
var import_react7 = require("react");
|
|
47127
47128
|
function useTreeItems(defaultItems, maxDepth) {
|
|
47128
|
-
const [items, setItems] = import_react7.useState(
|
|
47129
|
+
const [items, setItems] = import_react7.useState(defaultItems);
|
|
47130
|
+
const hasUserEditedRef = import_react7.useRef(false);
|
|
47131
|
+
const prevDefaultItemsRef = import_react7.useRef(JSON.stringify(defaultItems));
|
|
47132
|
+
import_react7.useEffect(() => {
|
|
47133
|
+
const currentDefaultItemsStr = JSON.stringify(defaultItems);
|
|
47134
|
+
if (currentDefaultItemsStr !== prevDefaultItemsRef.current || defaultItems.length > 0 && items.length === 0) {
|
|
47135
|
+
prevDefaultItemsRef.current = currentDefaultItemsStr;
|
|
47136
|
+
setItems(defaultItems);
|
|
47137
|
+
hasUserEditedRef.current = false;
|
|
47138
|
+
}
|
|
47139
|
+
}, [defaultItems, items.length]);
|
|
47129
47140
|
const [modalState, setModalState] = import_react7.useState({
|
|
47130
47141
|
isOpen: false,
|
|
47131
47142
|
mode: null,
|
|
@@ -47484,15 +47495,20 @@ function SortableTree({
|
|
|
47484
47495
|
};
|
|
47485
47496
|
}, [flattenedItems, offsetLeft]);
|
|
47486
47497
|
const isInitialMount = import_react8.useRef(true);
|
|
47498
|
+
const prevItemsRef = import_react8.useRef(JSON.stringify(items));
|
|
47487
47499
|
import_react8.useEffect(() => {
|
|
47488
47500
|
if (isInitialMount.current) {
|
|
47489
47501
|
isInitialMount.current = false;
|
|
47502
|
+
prevItemsRef.current = JSON.stringify(items);
|
|
47490
47503
|
return;
|
|
47491
47504
|
}
|
|
47492
|
-
|
|
47505
|
+
const currentItemsStr = JSON.stringify(items);
|
|
47506
|
+
const defaultItemsStr = JSON.stringify(defaultItems);
|
|
47507
|
+
if (onChange && currentItemsStr !== prevItemsRef.current && currentItemsStr !== defaultItemsStr) {
|
|
47493
47508
|
onChange(items);
|
|
47494
47509
|
}
|
|
47495
|
-
|
|
47510
|
+
prevItemsRef.current = currentItemsStr;
|
|
47511
|
+
}, [items, onChange, defaultItems]);
|
|
47496
47512
|
const announcements = useAnnouncements(items, indicator, indentationWidth);
|
|
47497
47513
|
const handleDragEnd = ({ active, over }) => {
|
|
47498
47514
|
handleDragCancel();
|
|
@@ -47589,6 +47605,7 @@ var DataNested = ({
|
|
|
47589
47605
|
const handleChange = (value) => {
|
|
47590
47606
|
field.onChange(name, value);
|
|
47591
47607
|
};
|
|
47608
|
+
const treeKey = import_react9.useMemo(() => JSON.stringify(field.value || []), [field.value]);
|
|
47592
47609
|
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_design_system5.Field.Root, {
|
|
47593
47610
|
name,
|
|
47594
47611
|
id: name,
|
|
@@ -47606,7 +47623,7 @@ var DataNested = ({
|
|
|
47606
47623
|
defaultItems: field.value || [],
|
|
47607
47624
|
maxDepth: attribute.options?.depth,
|
|
47608
47625
|
onChange: handleChange
|
|
47609
|
-
},
|
|
47626
|
+
}, treeKey, false, undefined, this),
|
|
47610
47627
|
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_design_system5.Field.Hint, {}, undefined, false, undefined, this),
|
|
47611
47628
|
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(import_design_system5.Field.Error, {}, undefined, false, undefined, this)
|
|
47612
47629
|
]
|
|
@@ -47730,7 +47747,7 @@ var registerDataSelect = (app) => {
|
|
|
47730
47747
|
};
|
|
47731
47748
|
|
|
47732
47749
|
// node_modules/@iconify/react/dist/iconify.js
|
|
47733
|
-
var
|
|
47750
|
+
var import_react10 = require("react");
|
|
47734
47751
|
"use client";
|
|
47735
47752
|
function getIconsTree(data, names) {
|
|
47736
47753
|
const icons = data.icons;
|
|
@@ -49074,7 +49091,7 @@ var render = (icon, props, name) => {
|
|
|
49074
49091
|
componentProps.dangerouslySetInnerHTML = {
|
|
49075
49092
|
__html: cleanUpInnerHTML(replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifyReact"))
|
|
49076
49093
|
};
|
|
49077
|
-
return
|
|
49094
|
+
return import_react10.createElement("svg", componentProps);
|
|
49078
49095
|
}
|
|
49079
49096
|
const { body, width, height } = icon;
|
|
49080
49097
|
const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
|
|
@@ -49092,7 +49109,7 @@ var render = (icon, props, name) => {
|
|
|
49092
49109
|
...useMask ? monotoneProps : coloredProps,
|
|
49093
49110
|
...customStyle
|
|
49094
49111
|
};
|
|
49095
|
-
return
|
|
49112
|
+
return import_react10.createElement("span", componentProps);
|
|
49096
49113
|
};
|
|
49097
49114
|
allowSimpleNames(true);
|
|
49098
49115
|
setAPIModule("", fetchAPIModule);
|
|
@@ -49134,8 +49151,8 @@ if (typeof document !== "undefined" && typeof window !== "undefined") {
|
|
|
49134
49151
|
}
|
|
49135
49152
|
}
|
|
49136
49153
|
function IconComponent(props) {
|
|
49137
|
-
const [mounted, setMounted] =
|
|
49138
|
-
const [abort, setAbort] =
|
|
49154
|
+
const [mounted, setMounted] = import_react10.useState(!!props.ssr);
|
|
49155
|
+
const [abort, setAbort] = import_react10.useState({});
|
|
49139
49156
|
function getInitialState(mounted2) {
|
|
49140
49157
|
if (mounted2) {
|
|
49141
49158
|
const name2 = props.icon;
|
|
@@ -49157,7 +49174,7 @@ function IconComponent(props) {
|
|
|
49157
49174
|
name: ""
|
|
49158
49175
|
};
|
|
49159
49176
|
}
|
|
49160
|
-
const [state, setState] =
|
|
49177
|
+
const [state, setState] = import_react10.useState(getInitialState(!!props.ssr));
|
|
49161
49178
|
function cleanup() {
|
|
49162
49179
|
const callback = abort.callback;
|
|
49163
49180
|
if (callback) {
|
|
@@ -49197,29 +49214,29 @@ function IconComponent(props) {
|
|
|
49197
49214
|
}
|
|
49198
49215
|
}
|
|
49199
49216
|
}
|
|
49200
|
-
|
|
49217
|
+
import_react10.useEffect(() => {
|
|
49201
49218
|
setMounted(true);
|
|
49202
49219
|
return cleanup;
|
|
49203
49220
|
}, []);
|
|
49204
|
-
|
|
49221
|
+
import_react10.useEffect(() => {
|
|
49205
49222
|
if (mounted) {
|
|
49206
49223
|
updateState();
|
|
49207
49224
|
}
|
|
49208
49225
|
}, [props.icon, mounted]);
|
|
49209
49226
|
const { name, data } = state;
|
|
49210
49227
|
if (!data) {
|
|
49211
|
-
return props.children ? props.children : props.fallback ? props.fallback :
|
|
49228
|
+
return props.children ? props.children : props.fallback ? props.fallback : import_react10.createElement("span", {});
|
|
49212
49229
|
}
|
|
49213
49230
|
return render({
|
|
49214
49231
|
...defaultIconProps,
|
|
49215
49232
|
...data
|
|
49216
49233
|
}, props, name);
|
|
49217
49234
|
}
|
|
49218
|
-
var Icon =
|
|
49235
|
+
var Icon = import_react10.forwardRef((props, ref) => IconComponent({
|
|
49219
49236
|
...props,
|
|
49220
49237
|
_ref: ref
|
|
49221
49238
|
}));
|
|
49222
|
-
var InlineIcon =
|
|
49239
|
+
var InlineIcon = import_react10.forwardRef((props, ref) => IconComponent({
|
|
49223
49240
|
inline: true,
|
|
49224
49241
|
...props,
|
|
49225
49242
|
_ref: ref
|
|
@@ -49996,10 +50013,10 @@ var import_icons12 = require("@strapi/icons");
|
|
|
49996
50013
|
init_DashboardStats();
|
|
49997
50014
|
var import_design_system11 = require("@strapi/design-system");
|
|
49998
50015
|
var import_admin8 = require("@strapi/strapi/admin");
|
|
49999
|
-
var
|
|
50016
|
+
var import_react13 = __toESM(require("react"));
|
|
50000
50017
|
var jsx_dev_runtime29 = require("react/jsx-dev-runtime");
|
|
50001
50018
|
var WelcomeWidget = () => {
|
|
50002
|
-
const [refresh, setRefresh] =
|
|
50019
|
+
const [refresh, setRefresh] = import_react13.default.useState(false);
|
|
50003
50020
|
const fetchClient = import_admin8.useFetchClient();
|
|
50004
50021
|
const { toggleNotification } = import_admin8.useNotification();
|
|
50005
50022
|
const handleRefresh = async () => {
|
package/dist/admin/index.mjs
CHANGED
|
@@ -19317,7 +19317,7 @@ var init_ApiErrorAlert = __esm(() => {
|
|
|
19317
19317
|
// admin/src/components/DashboardStats.tsx
|
|
19318
19318
|
import { Box as Box6, Grid as Grid2, Typography as Typography8 } from "@strapi/design-system";
|
|
19319
19319
|
import { useFetchClient as useFetchClient3, useNotification as useNotification3 } from "@strapi/strapi/admin";
|
|
19320
|
-
import { useEffect as
|
|
19320
|
+
import { useEffect as useEffect8, useState as useState12 } from "react";
|
|
19321
19321
|
import { jsxDEV as jsxDEV28 } from "react/jsx-dev-runtime";
|
|
19322
19322
|
var DashboardStats = ({
|
|
19323
19323
|
showLoading = true,
|
|
@@ -19335,7 +19335,7 @@ var DashboardStats = ({
|
|
|
19335
19335
|
totalInquiry: 0,
|
|
19336
19336
|
unreadInquiry: 0
|
|
19337
19337
|
});
|
|
19338
|
-
|
|
19338
|
+
useEffect8(() => {
|
|
19339
19339
|
if (externalData) {
|
|
19340
19340
|
setStats(externalData);
|
|
19341
19341
|
setIsLoading(false);
|
|
@@ -19364,7 +19364,7 @@ var DashboardStats = ({
|
|
|
19364
19364
|
};
|
|
19365
19365
|
fetchStats();
|
|
19366
19366
|
}, [externalData, fetchClient, toggleNotification, onError, onLoaded]);
|
|
19367
|
-
|
|
19367
|
+
useEffect8(() => {
|
|
19368
19368
|
if (externalData) {
|
|
19369
19369
|
setStats(externalData);
|
|
19370
19370
|
}
|
|
@@ -19563,7 +19563,7 @@ import {
|
|
|
19563
19563
|
useFetchClient as useFetchClient5,
|
|
19564
19564
|
useNotification as useNotification5
|
|
19565
19565
|
} from "@strapi/strapi/admin";
|
|
19566
|
-
import { useCallback as useCallback6, useEffect as
|
|
19566
|
+
import { useCallback as useCallback6, useEffect as useEffect9, useState as useState13 } from "react";
|
|
19567
19567
|
import { useNavigate } from "react-router-dom";
|
|
19568
19568
|
import { jsxDEV as jsxDEV31 } from "react/jsx-dev-runtime";
|
|
19569
19569
|
var Inquiry = () => {
|
|
@@ -19609,10 +19609,10 @@ var Inquiry = () => {
|
|
|
19609
19609
|
setIsLoading(false);
|
|
19610
19610
|
}
|
|
19611
19611
|
}, [fetchClient.get, toggleNotification]);
|
|
19612
|
-
|
|
19612
|
+
useEffect9(() => {
|
|
19613
19613
|
fetchInquiries(pagination.page, pagination.pageSize);
|
|
19614
19614
|
}, [fetchInquiries, pagination.page, pagination.pageSize]);
|
|
19615
|
-
|
|
19615
|
+
useEffect9(() => {
|
|
19616
19616
|
const handleVisibilityChange = () => {
|
|
19617
19617
|
if (document.visibilityState === "visible") {
|
|
19618
19618
|
fetchInquiries(pagination.page, pagination.pageSize);
|
|
@@ -19790,7 +19790,7 @@ import {
|
|
|
19790
19790
|
useFetchClient as useFetchClient6,
|
|
19791
19791
|
useNotification as useNotification6
|
|
19792
19792
|
} from "@strapi/strapi/admin";
|
|
19793
|
-
import { useEffect as
|
|
19793
|
+
import { useEffect as useEffect10, useState as useState14 } from "react";
|
|
19794
19794
|
import { useNavigate as useNavigate2, useParams } from "react-router-dom";
|
|
19795
19795
|
import styled14 from "styled-components";
|
|
19796
19796
|
import { jsxDEV as jsxDEV32, Fragment as Fragment4 } from "react/jsx-dev-runtime";
|
|
@@ -19802,7 +19802,7 @@ var DetailTable, InquiryDetail = () => {
|
|
|
19802
19802
|
const [isLoading, setIsLoading] = useState14(true);
|
|
19803
19803
|
const [isMarking, setIsMarking] = useState14(false);
|
|
19804
19804
|
const [data, setData] = useState14(null);
|
|
19805
|
-
|
|
19805
|
+
useEffect10(() => {
|
|
19806
19806
|
const fetchDetail = async () => {
|
|
19807
19807
|
if (!id) {
|
|
19808
19808
|
toggleNotification({
|
|
@@ -20141,7 +20141,7 @@ import {
|
|
|
20141
20141
|
useFetchClient as useFetchClient7,
|
|
20142
20142
|
useNotification as useNotification7
|
|
20143
20143
|
} from "@strapi/strapi/admin";
|
|
20144
|
-
import { useCallback as useCallback7, useEffect as
|
|
20144
|
+
import { useCallback as useCallback7, useEffect as useEffect11, useState as useState15 } from "react";
|
|
20145
20145
|
import { jsxDEV as jsxDEV33, Fragment as Fragment5 } from "react/jsx-dev-runtime";
|
|
20146
20146
|
var Visitor = () => {
|
|
20147
20147
|
const fetchClient = useFetchClient7();
|
|
@@ -20202,7 +20202,7 @@ var Visitor = () => {
|
|
|
20202
20202
|
setIsLoading(false);
|
|
20203
20203
|
}
|
|
20204
20204
|
}, [fetchClient.get, toggleNotification]);
|
|
20205
|
-
|
|
20205
|
+
useEffect11(() => {
|
|
20206
20206
|
fetchVisitorData(activeTab, 1, pagination.pageSize);
|
|
20207
20207
|
}, [activeTab, pagination.pageSize, fetchVisitorData]);
|
|
20208
20208
|
const handleTabChange = (tabKey) => {
|
|
@@ -45580,11 +45580,12 @@ var registerColorPicker = (app) => {
|
|
|
45580
45580
|
// admin/src/fields/DataNested.tsx
|
|
45581
45581
|
import { Field as Field2 } from "@strapi/design-system";
|
|
45582
45582
|
import { useField as useField2 } from "@strapi/strapi/admin";
|
|
45583
|
+
import { useMemo as useMemo4 } from "react";
|
|
45583
45584
|
|
|
45584
45585
|
// admin/src/fields/DataNested/SortableTree.tsx
|
|
45585
45586
|
var import_core2 = __toESM(require_dist3(), 1);
|
|
45586
45587
|
var import_sortable5 = __toESM(require_dist4(), 1);
|
|
45587
|
-
import { useEffect as
|
|
45588
|
+
import { useEffect as useEffect3, useMemo as useMemo3, useRef as useRef3, useState as useState7 } from "react";
|
|
45588
45589
|
import { createPortal } from "react-dom";
|
|
45589
45590
|
|
|
45590
45591
|
// admin/src/fields/DataNested/components/Action.tsx
|
|
@@ -47167,9 +47168,19 @@ var adjustTranslate = ({ transform }) => {
|
|
|
47167
47168
|
};
|
|
47168
47169
|
};
|
|
47169
47170
|
// admin/src/fields/DataNested/hooks/useTreeItems.ts
|
|
47170
|
-
import { useState as useState6 } from "react";
|
|
47171
|
+
import { useEffect as useEffect2, useRef as useRef2, useState as useState6 } from "react";
|
|
47171
47172
|
function useTreeItems(defaultItems, maxDepth) {
|
|
47172
|
-
const [items, setItems] = useState6(
|
|
47173
|
+
const [items, setItems] = useState6(defaultItems);
|
|
47174
|
+
const hasUserEditedRef = useRef2(false);
|
|
47175
|
+
const prevDefaultItemsRef = useRef2(JSON.stringify(defaultItems));
|
|
47176
|
+
useEffect2(() => {
|
|
47177
|
+
const currentDefaultItemsStr = JSON.stringify(defaultItems);
|
|
47178
|
+
if (currentDefaultItemsStr !== prevDefaultItemsRef.current || defaultItems.length > 0 && items.length === 0) {
|
|
47179
|
+
prevDefaultItemsRef.current = currentDefaultItemsStr;
|
|
47180
|
+
setItems(defaultItems);
|
|
47181
|
+
hasUserEditedRef.current = false;
|
|
47182
|
+
}
|
|
47183
|
+
}, [defaultItems, items.length]);
|
|
47173
47184
|
const [modalState, setModalState] = useState6({
|
|
47174
47185
|
isOpen: false,
|
|
47175
47186
|
mode: null,
|
|
@@ -47511,7 +47522,7 @@ function SortableTree({
|
|
|
47511
47522
|
handleDragCancel
|
|
47512
47523
|
} = useDragState(flattenedItems, setActiveId);
|
|
47513
47524
|
const projected = activeId && overId ? getProjection(flattenedItems, activeId, overId, offsetLeft, indentationWidth, maxDepth) : null;
|
|
47514
|
-
const sensorContext =
|
|
47525
|
+
const sensorContext = useRef3({
|
|
47515
47526
|
items: flattenedItems,
|
|
47516
47527
|
offset: offsetLeft
|
|
47517
47528
|
});
|
|
@@ -47521,22 +47532,27 @@ function SortableTree({
|
|
|
47521
47532
|
}));
|
|
47522
47533
|
const sortedIds = useMemo3(() => flattenedItems.map(({ id }) => id), [flattenedItems]);
|
|
47523
47534
|
const activeItem = activeId ? flattenedItems.find(({ id }) => id === activeId) : null;
|
|
47524
|
-
|
|
47535
|
+
useEffect3(() => {
|
|
47525
47536
|
sensorContext.current = {
|
|
47526
47537
|
items: flattenedItems,
|
|
47527
47538
|
offset: offsetLeft
|
|
47528
47539
|
};
|
|
47529
47540
|
}, [flattenedItems, offsetLeft]);
|
|
47530
|
-
const isInitialMount =
|
|
47531
|
-
|
|
47541
|
+
const isInitialMount = useRef3(true);
|
|
47542
|
+
const prevItemsRef = useRef3(JSON.stringify(items));
|
|
47543
|
+
useEffect3(() => {
|
|
47532
47544
|
if (isInitialMount.current) {
|
|
47533
47545
|
isInitialMount.current = false;
|
|
47546
|
+
prevItemsRef.current = JSON.stringify(items);
|
|
47534
47547
|
return;
|
|
47535
47548
|
}
|
|
47536
|
-
|
|
47549
|
+
const currentItemsStr = JSON.stringify(items);
|
|
47550
|
+
const defaultItemsStr = JSON.stringify(defaultItems);
|
|
47551
|
+
if (onChange && currentItemsStr !== prevItemsRef.current && currentItemsStr !== defaultItemsStr) {
|
|
47537
47552
|
onChange(items);
|
|
47538
47553
|
}
|
|
47539
|
-
|
|
47554
|
+
prevItemsRef.current = currentItemsStr;
|
|
47555
|
+
}, [items, onChange, defaultItems]);
|
|
47540
47556
|
const announcements = useAnnouncements(items, indicator, indentationWidth);
|
|
47541
47557
|
const handleDragEnd = ({ active, over }) => {
|
|
47542
47558
|
handleDragCancel();
|
|
@@ -47633,6 +47649,7 @@ var DataNested = ({
|
|
|
47633
47649
|
const handleChange = (value) => {
|
|
47634
47650
|
field.onChange(name, value);
|
|
47635
47651
|
};
|
|
47652
|
+
const treeKey = useMemo4(() => JSON.stringify(field.value || []), [field.value]);
|
|
47636
47653
|
return /* @__PURE__ */ jsxDEV23(Field2.Root, {
|
|
47637
47654
|
name,
|
|
47638
47655
|
id: name,
|
|
@@ -47650,7 +47667,7 @@ var DataNested = ({
|
|
|
47650
47667
|
defaultItems: field.value || [],
|
|
47651
47668
|
maxDepth: attribute.options?.depth,
|
|
47652
47669
|
onChange: handleChange
|
|
47653
|
-
},
|
|
47670
|
+
}, treeKey, false, undefined, this),
|
|
47654
47671
|
/* @__PURE__ */ jsxDEV23(Field2.Hint, {}, undefined, false, undefined, this),
|
|
47655
47672
|
/* @__PURE__ */ jsxDEV23(Field2.Error, {}, undefined, false, undefined, this)
|
|
47656
47673
|
]
|
|
@@ -47774,7 +47791,7 @@ var registerDataSelect = (app) => {
|
|
|
47774
47791
|
};
|
|
47775
47792
|
|
|
47776
47793
|
// node_modules/@iconify/react/dist/iconify.js
|
|
47777
|
-
import { createElement, forwardRef as forwardRef6, useState as useState8, useEffect as
|
|
47794
|
+
import { createElement, forwardRef as forwardRef6, useState as useState8, useEffect as useEffect4 } from "react";
|
|
47778
47795
|
"use client";
|
|
47779
47796
|
function getIconsTree(data, names) {
|
|
47780
47797
|
const icons = data.icons;
|
|
@@ -49241,11 +49258,11 @@ function IconComponent(props) {
|
|
|
49241
49258
|
}
|
|
49242
49259
|
}
|
|
49243
49260
|
}
|
|
49244
|
-
|
|
49261
|
+
useEffect4(() => {
|
|
49245
49262
|
setMounted(true);
|
|
49246
49263
|
return cleanup;
|
|
49247
49264
|
}, []);
|
|
49248
|
-
|
|
49265
|
+
useEffect4(() => {
|
|
49249
49266
|
if (mounted) {
|
|
49250
49267
|
updateState();
|
|
49251
49268
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortableTree.d.ts","sourceRoot":"","sources":["../../../../../admin/src/fields/DataNested/SortableTree.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAgC,SAAS,EAAE,MAAM,SAAS,CAAA;AAStE,UAAU,KAAK;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;CACrC;AAED,wBAAgB,YAAY,CAAC,EAC5B,WAAW,EACX,YAA4B,EAC5B,SAAiB,EACjB,gBAA4C,EAC5C,SAAS,EACT,QAAQ,EACR,QAAQ,GACR,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"SortableTree.d.ts","sourceRoot":"","sources":["../../../../../admin/src/fields/DataNested/SortableTree.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAgC,SAAS,EAAE,MAAM,SAAS,CAAA;AAStE,UAAU,KAAK;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;CACrC;AAED,wBAAgB,YAAY,CAAC,EAC5B,WAAW,EACX,YAA4B,EAC5B,SAAiB,EACjB,gBAA4C,EAC5C,SAAS,EACT,QAAQ,EACR,QAAQ,GACR,EAAE,KAAK,2CAgOP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTreeItems.d.ts","sourceRoot":"","sources":["../../../../../../admin/src/fields/DataNested/hooks/useTreeItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAGrD,OAAO,KAAK,EAAY,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AASjE,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACjC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;CACjC;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM;;;;
|
|
1
|
+
{"version":3,"file":"useTreeItems.d.ts","sourceRoot":"","sources":["../../../../../../admin/src/fields/DataNested/hooks/useTreeItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAGrD,OAAO,KAAK,EAAY,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AASjE,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACjC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;CACjC;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM;;;;uBA+B5C,gBAAgB;yBAId,gBAAgB;;2BAed,gBAAgB;yBASlB,gBAAgB;qBAkBpB,gBAAgB;;8BAkBP,YAAY;0BAyBlB,YAAY;EAsBvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataNested.d.ts","sourceRoot":"","sources":["../../../../admin/src/fields/DataNested.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"DataNested.d.ts","sourceRoot":"","sources":["../../../../admin/src/fields/DataNested.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,sBAAsB,CAAA;AA8DjE,eAAO,MAAM,kBAAkB,GAAI,KAAK,SAAS,SA+ChD,CAAA"}
|