dirk-cfx-react 1.1.5 → 1.1.7
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 +27 -16
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +27 -16
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/index.cjs +12 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +12 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +41 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +41 -25
- package/dist/index.js.map +1 -1
- package/dist/providers/index.cjs +25 -9
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.d.cts +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +25 -9
- package/dist/providers/index.js.map +1 -1
- package/dist/utils/index.cjs +28 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +12 -1
- package/dist/utils/index.d.ts +12 -1
- package/dist/utils/index.js +28 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { BorderedIcon, BorderedIconProps, ButtonProps, Counter, FloatingParticles, FloatingParticlesProps, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, LevelBanner, LevelPanel, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, NavigationStore, ParticleState, ProgressProps, Prompt, PromptButton, PromptModal, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, Title, TitleProps, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.cjs';
|
|
2
|
-
export { InitialFetch, InternalEvent, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, fetchNui, gameToMap, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useProfanityStore } from './utils/index.cjs';
|
|
2
|
+
export { InitialFetch, InternalEvent, SettingsState, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, fetchNui, gameToMap, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useProfanityStore, useSettings } from './utils/index.cjs';
|
|
3
3
|
export { FormProvider, FormState, NuiHandlerSignature, NuiMessageData, TornEdgeSVGFilter, ValidationRules, createFormStore, createScriptSettings, useForm, useNuiEvent, useTornEdges } from './hooks/index.cjs';
|
|
4
4
|
export { DirkProvider, DirkProviderProps } from './providers/index.cjs';
|
|
5
5
|
import 'react/jsx-runtime';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { BorderedIcon, BorderedIconProps, ButtonProps, Counter, FloatingParticles, FloatingParticlesProps, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, LevelBanner, LevelPanel, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, NavigationStore, ParticleState, ProgressProps, Prompt, PromptButton, PromptModal, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, Title, TitleProps, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.js';
|
|
2
|
-
export { InitialFetch, InternalEvent, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, fetchNui, gameToMap, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useProfanityStore } from './utils/index.js';
|
|
2
|
+
export { InitialFetch, InternalEvent, SettingsState, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, fetchNui, gameToMap, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useProfanityStore, useSettings } from './utils/index.js';
|
|
3
3
|
export { FormProvider, FormState, NuiHandlerSignature, NuiMessageData, TornEdgeSVGFilter, ValidationRules, createFormStore, createScriptSettings, useForm, useNuiEvent, useTornEdges } from './hooks/index.js';
|
|
4
4
|
export { DirkProvider, DirkProviderProps } from './providers/index.js';
|
|
5
5
|
import 'react/jsx-runtime';
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,14 @@ import hoverSoundUrl from './hover_sound-NBUA222C.mp3';
|
|
|
10
10
|
import { useClickOutside } from '@mantine/hooks';
|
|
11
11
|
import '@mantine/core/styles.css';
|
|
12
12
|
import '@mantine/notifications/styles.css';
|
|
13
|
+
import './styles/notify.css';
|
|
14
|
+
import './styles/fonts.css';
|
|
15
|
+
import './styles/scrollBar.css';
|
|
16
|
+
import './styles/tornEdge.css';
|
|
17
|
+
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
18
|
+
import { fab } from '@fortawesome/free-brands-svg-icons';
|
|
19
|
+
import { far } from '@fortawesome/free-regular-svg-icons';
|
|
20
|
+
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
13
21
|
|
|
14
22
|
var __defProp = Object.defineProperty;
|
|
15
23
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -793,6 +801,33 @@ async function getImageShape(file) {
|
|
|
793
801
|
img.src = typeof file === "string" ? file : URL.createObjectURL(file);
|
|
794
802
|
});
|
|
795
803
|
}
|
|
804
|
+
var useSettings = create(() => ({
|
|
805
|
+
hydrated: false,
|
|
806
|
+
game: "fivem",
|
|
807
|
+
primaryColor: "dirk",
|
|
808
|
+
primaryShade: 9,
|
|
809
|
+
itemImgPath: "",
|
|
810
|
+
customTheme: [
|
|
811
|
+
"#f0f4ff",
|
|
812
|
+
"#d9e3ff",
|
|
813
|
+
"#bfcfff",
|
|
814
|
+
"#a6bbff",
|
|
815
|
+
"#8ca7ff",
|
|
816
|
+
"#7393ff",
|
|
817
|
+
"#5a7fff",
|
|
818
|
+
"#406bff",
|
|
819
|
+
"#2547ff",
|
|
820
|
+
"#0b33ff"
|
|
821
|
+
]
|
|
822
|
+
}));
|
|
823
|
+
registerInitialFetch("GET_SETTINGS").then((data) => {
|
|
824
|
+
useSettings.setState({
|
|
825
|
+
...data,
|
|
826
|
+
hydrated: true
|
|
827
|
+
});
|
|
828
|
+
}).catch(() => {
|
|
829
|
+
useSettings.setState({ hydrated: true });
|
|
830
|
+
});
|
|
796
831
|
function BorderedIcon(props) {
|
|
797
832
|
const theme2 = useMantineTheme();
|
|
798
833
|
return /* @__PURE__ */ jsx(
|
|
@@ -1483,22 +1518,6 @@ function SegmentedProgress(props) {
|
|
|
1483
1518
|
}
|
|
1484
1519
|
);
|
|
1485
1520
|
}
|
|
1486
|
-
var useSettings = create(() => ({
|
|
1487
|
-
hydrated: false,
|
|
1488
|
-
game: "fivem",
|
|
1489
|
-
primaryColor: "dirk",
|
|
1490
|
-
primaryShade: 9,
|
|
1491
|
-
itemImgPath: "",
|
|
1492
|
-
customTheme: {}
|
|
1493
|
-
}));
|
|
1494
|
-
registerInitialFetch("GET_SETTINGS").then((data) => {
|
|
1495
|
-
useSettings.setState({
|
|
1496
|
-
...data,
|
|
1497
|
-
hydrated: true
|
|
1498
|
-
});
|
|
1499
|
-
}).catch(() => {
|
|
1500
|
-
useSettings.setState({ hydrated: true });
|
|
1501
|
-
});
|
|
1502
1521
|
function Title(props) {
|
|
1503
1522
|
const game = useSettings((state) => state.game);
|
|
1504
1523
|
const theme2 = useMantineTheme();
|
|
@@ -2372,15 +2391,11 @@ var theme = createTheme({
|
|
|
2372
2391
|
var theme_default = theme;
|
|
2373
2392
|
|
|
2374
2393
|
// src/utils/mergeMantineTheme.ts
|
|
2375
|
-
var isValidColorScale = (v) => Array.isArray(v) && v.length
|
|
2394
|
+
var isValidColorScale = (v) => Array.isArray(v) && v.length === 10 && v.every((shade) => typeof shade === "string");
|
|
2376
2395
|
function mergeMantineThemeSafe(base, custom, override) {
|
|
2377
2396
|
const colors = { ...base.colors };
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
colors[key] = value;
|
|
2381
|
-
} else {
|
|
2382
|
-
console.warn(`[theme] invalid color ignored: ${key}`, value);
|
|
2383
|
-
}
|
|
2397
|
+
if (custom && isValidColorScale(custom)) {
|
|
2398
|
+
colors["custom"] = custom;
|
|
2384
2399
|
}
|
|
2385
2400
|
return {
|
|
2386
2401
|
...base,
|
|
@@ -2413,6 +2428,7 @@ var DirkErrorBoundary = class extends React3.Component {
|
|
|
2413
2428
|
] });
|
|
2414
2429
|
}
|
|
2415
2430
|
};
|
|
2431
|
+
library.add(fas, far, fab);
|
|
2416
2432
|
function DirkProvider({ children, themeOverride }) {
|
|
2417
2433
|
const {
|
|
2418
2434
|
hydrated,
|
|
@@ -2421,7 +2437,6 @@ function DirkProvider({ children, themeOverride }) {
|
|
|
2421
2437
|
customTheme,
|
|
2422
2438
|
game
|
|
2423
2439
|
} = useSettings();
|
|
2424
|
-
if (!hydrated) return null;
|
|
2425
2440
|
const mergedTheme = useMemo(
|
|
2426
2441
|
() => mergeMantineThemeSafe(
|
|
2427
2442
|
{ ...theme_default, primaryColor, primaryShade },
|
|
@@ -2432,6 +2447,7 @@ function DirkProvider({ children, themeOverride }) {
|
|
|
2432
2447
|
);
|
|
2433
2448
|
useEffect(() => {
|
|
2434
2449
|
document.body.style.fontFamily = game === "rdr3" ? '"Red Dead", sans-serif' : '"Akrobat Regular", sans-serif';
|
|
2450
|
+
console.log(`%cNew Font Applied: ${document.body.style.fontFamily}`, "font-family: " + document.body.style.fontFamily);
|
|
2435
2451
|
}, [game]);
|
|
2436
2452
|
const content = isEnvBrowser() ? /* @__PURE__ */ jsx(
|
|
2437
2453
|
BackgroundImage,
|
|
@@ -2445,6 +2461,6 @@ function DirkProvider({ children, themeOverride }) {
|
|
|
2445
2461
|
return /* @__PURE__ */ jsx(DirkErrorBoundary, { children: /* @__PURE__ */ jsx(MantineProvider, { theme: mergedTheme, defaultColorScheme: "dark", children: content }) });
|
|
2446
2462
|
}
|
|
2447
2463
|
|
|
2448
|
-
export { BorderedIcon, Counter, DirkProvider, FloatingParticles, FormProvider, InfoBox, InputContainer, LevelBanner, LevelPanel, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, PromptModal, SegmentedControl, SegmentedProgress, Title, TornEdgeSVGFilter, colorWithAlpha, copyToClipboard, createFormStore, createScriptSettings, createSkill, fetchNui, gameToMap, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useForm, useModal, useModalActions, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useTornEdges };
|
|
2464
|
+
export { BorderedIcon, Counter, DirkProvider, FloatingParticles, FormProvider, InfoBox, InputContainer, LevelBanner, LevelPanel, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, PromptModal, SegmentedControl, SegmentedProgress, Title, TornEdgeSVGFilter, colorWithAlpha, copyToClipboard, createFormStore, createScriptSettings, createSkill, fetchNui, gameToMap, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useForm, useModal, useModalActions, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useSettings, useTornEdges };
|
|
2449
2465
|
//# sourceMappingURL=index.js.map
|
|
2450
2466
|
//# sourceMappingURL=index.js.map
|