dirk-cfx-react 1.1.38 → 1.1.40
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/components/index.cjs +13 -5
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +13 -5
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/index.cjs +35 -22
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +35 -22
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +11 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/providers/index.cjs +40 -26
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.js +40 -26
- package/dist/providers/index.js.map +1 -1
- package/dist/styles/notify.css +0 -118
- package/dist/utils/index.cjs +10 -3
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +10 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/styles/notify.css +0 -118
package/dist/index.js
CHANGED
|
@@ -220,6 +220,7 @@ var openLink = (url) => {
|
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
222
|
var useSettings = create(() => ({
|
|
223
|
+
currency: "$",
|
|
223
224
|
game: "fivem",
|
|
224
225
|
primaryColor: "dirk",
|
|
225
226
|
primaryShade: 9,
|
|
@@ -237,6 +238,15 @@ var useSettings = create(() => ({
|
|
|
237
238
|
"#0b33ff"
|
|
238
239
|
]
|
|
239
240
|
}));
|
|
241
|
+
registerInitialFetch("GET_SETTINGS", void 0).then((data) => {
|
|
242
|
+
if (!data) {
|
|
243
|
+
console.warn("No settings data received from GET_SETTINGS fetch.");
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
useSettings.setState({
|
|
247
|
+
...data
|
|
248
|
+
});
|
|
249
|
+
});
|
|
240
250
|
|
|
241
251
|
// src/utils/fetchNui.ts
|
|
242
252
|
async function fetchNui(eventName, data, mockData) {
|
|
@@ -256,9 +266,7 @@ async function fetchNui(eventName, data, mockData) {
|
|
|
256
266
|
}
|
|
257
267
|
const overrideResourceName = useSettings.getState().overideResourceName;
|
|
258
268
|
const resourceName = window.GetParentResourceName ? window.GetParentResourceName() : overrideResourceName ? overrideResourceName : "dirk-cfx-react";
|
|
259
|
-
console.log(`[fetchNui] Sending event "${eventName}" to resource "${resourceName}" with data:`, data);
|
|
260
269
|
const resp = await fetch(`https://${resourceName}/${eventName}`, options);
|
|
261
|
-
console.log(`[fetchNui] Received response for event "${eventName}":`, resp);
|
|
262
270
|
return await resp.json();
|
|
263
271
|
}
|
|
264
272
|
var initialFetches = {};
|
|
@@ -325,7 +333,6 @@ var localeStore = create((set, get) => {
|
|
|
325
333
|
});
|
|
326
334
|
var locale = localeStore.getState().locale;
|
|
327
335
|
registerInitialFetch("GET_LOCALES", void 0).then((data) => {
|
|
328
|
-
console.log("Fetched locales:", data);
|
|
329
336
|
localeStore.setState({ locales: data });
|
|
330
337
|
});
|
|
331
338
|
|
|
@@ -1513,8 +1520,7 @@ function SegmentedProgress(props) {
|
|
|
1513
1520
|
{
|
|
1514
1521
|
variants: itemVariants,
|
|
1515
1522
|
style: {
|
|
1516
|
-
|
|
1517
|
-
// Ensures equal width distribution
|
|
1523
|
+
flex: 1,
|
|
1518
1524
|
height: "100%",
|
|
1519
1525
|
background: isFilled ? "rgba(255, 255, 255, 0.8)" : isPartial ? `linear-gradient(to right, rgba(255, 255, 255, 0.8) ${partialFill * 100}%, rgba(255, 255, 255, 0.2) ${partialFill * 100}%)` : "rgba(255, 255, 255, 0.2)",
|
|
1520
1526
|
transition: "background 0.3s ease"
|
|
@@ -2318,7 +2324,6 @@ function createScriptSettings(defaultValue) {
|
|
|
2318
2324
|
});
|
|
2319
2325
|
};
|
|
2320
2326
|
const updateScriptSettings = async (newSettings) => {
|
|
2321
|
-
console.log("Updating script settings:", JSON.stringify(newSettings, null, 2));
|
|
2322
2327
|
store.setState((prev) => ({ ...prev, ...newSettings }));
|
|
2323
2328
|
return await fetchNui("UPDATE_SCRIPT_SETTINGS", newSettings);
|
|
2324
2329
|
};
|