dirk-cfx-react 1.0.51 → 1.0.53

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.d.cts CHANGED
@@ -1,5 +1,5 @@
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, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, Title, TitleProps, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.cjs';
2
- export { InitialFetch, InternalEvent, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, fetchNui, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, locale, localeStore, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useProfanityStore } from './utils/index.cjs';
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';
3
3
  export { FormProvider, FormState, TornEdgeSVGFilter, ValidationRules, createFormStore, useForm, useNuiEvent, useTornEdges } from './hooks/index.cjs';
4
4
  export { DirkProvider, DirkProviderProps, useSettings } from './providers/index.cjs';
5
5
  import 'react/jsx-runtime';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, Title, TitleProps, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.js';
2
- export { InitialFetch, InternalEvent, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, fetchNui, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, locale, localeStore, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useProfanityStore } from './utils/index.js';
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';
3
3
  export { FormProvider, FormState, TornEdgeSVGFilter, ValidationRules, createFormStore, useForm, useNuiEvent, useTornEdges } from './hooks/index.js';
4
4
  export { DirkProvider, DirkProviderProps, useSettings } from './providers/index.js';
5
5
  import 'react/jsx-runtime';
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { createContext, useEffect, useRef, useState, useContext, useMemo } from
2
2
  import { create, useStore, createStore } from 'zustand';
3
3
  import axios from 'axios';
4
4
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
- import { Flex, Text, Image as Image$1, createTheme, useMantineTheme, alpha, Progress, RingProgress, MantineProvider, BackgroundImage } from '@mantine/core';
5
+ import { Flex, Text, Image as Image$1, createTheme, useMantineTheme, alpha, Progress, RingProgress, Button, MantineProvider, BackgroundImage } from '@mantine/core';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import { motion, AnimatePresence, useMotionValue } from 'framer-motion';
8
8
  import clickSoundUrl from './click_sound-PNCRRTM4.mp3';
@@ -298,6 +298,24 @@ var locale = localeStore.getState().locale;
298
298
  registerInitialFetch("GET_LOCALES", void 0).then((data) => {
299
299
  localeStore.setState({ locales: data });
300
300
  });
301
+
302
+ // src/utils/map.ts
303
+ var mapCenter = [-119.43, 58.84];
304
+ var latPr100 = 1.421;
305
+ function gameToMap(x, y) {
306
+ return [
307
+ mapCenter[0] + latPr100 / 100 * y,
308
+ // lng
309
+ mapCenter[1] + latPr100 / 100 * x
310
+ // lat
311
+ ];
312
+ }
313
+ function mapToGame(lat, lng) {
314
+ return [
315
+ (lng - mapCenter[1]) * 100 / latPr100,
316
+ (lat - mapCenter[0]) * 100 / latPr100
317
+ ];
318
+ }
301
319
  var useProfanityStore = create(() => [
302
320
  "ars3",
303
321
  "a55",
@@ -1862,6 +1880,53 @@ function Modal() {
1862
1880
  }
1863
1881
  ) });
1864
1882
  }
1883
+ function PromptModal(props) {
1884
+ const theme2 = useMantineTheme();
1885
+ return /* @__PURE__ */ jsxs(
1886
+ MotionFlex,
1887
+ {
1888
+ gap: "sm",
1889
+ direction: "column",
1890
+ flex: 1,
1891
+ children: [
1892
+ /* @__PURE__ */ jsx(
1893
+ Text,
1894
+ {
1895
+ size: "xs",
1896
+ c: "rgba(255, 255, 255, 0.8)",
1897
+ children: props.message
1898
+ }
1899
+ ),
1900
+ /* @__PURE__ */ jsx(
1901
+ Flex,
1902
+ {
1903
+ gap: "sm",
1904
+ children: props.buttons.map((button, index) => /* @__PURE__ */ jsx(
1905
+ Button,
1906
+ {
1907
+ variant: button.variant,
1908
+ color: button.color,
1909
+ flex: 0.5,
1910
+ onClick: button.onClick,
1911
+ leftSection: button.icon ? /* @__PURE__ */ jsx(
1912
+ FontAwesomeIcon,
1913
+ {
1914
+ icon: button.icon,
1915
+ style: {
1916
+ fontSize: theme2.fontSizes.xs
1917
+ }
1918
+ }
1919
+ ) : void 0,
1920
+ children: button.text
1921
+ },
1922
+ index
1923
+ ))
1924
+ }
1925
+ )
1926
+ ]
1927
+ }
1928
+ );
1929
+ }
1865
1930
  var useNuiEvent = (action, handler) => {
1866
1931
  const savedHandler = useRef(noop);
1867
1932
  useEffect(() => {
@@ -2329,6 +2394,6 @@ function TornEdgeSVGFilter() {
2329
2394
  );
2330
2395
  }
2331
2396
 
2332
- export { BorderedIcon, Counter, DirkProvider, FloatingParticles, FormProvider, InfoBox, InputContainer, LevelBanner, LevelPanel, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, SegmentedControl, SegmentedProgress, Title, TornEdgeSVGFilter, colorWithAlpha, copyToClipboard, createFormStore, createSkill, fetchNui, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, locale, localeStore, noop, numberToRoman, openLink, registerInitialFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useForm, useModal, useModalActions, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useSettings, useTornEdges };
2397
+ 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, 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 };
2333
2398
  //# sourceMappingURL=index.js.map
2334
2399
  //# sourceMappingURL=index.js.map