dirk-cfx-react 1.1.47 → 1.1.48

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,6 +1,6 @@
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
2
  export { InitialFetch, InternalEvent, SettingsState, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, fetchLuaTable, fetchNui, gameToMap, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, registerInitialLuaTableFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useProfanityStore, useSettings } from './utils/index.cjs';
3
- export { FormProvider, FormState, NuiHandlerSignature, NuiMessageData, TornEdgeSVGFilter, ValidationRules, ValidatorFn, _dispatchScriptSettingsUpdate, createFormStore, createScriptSettings, useForm, useFormActions, useFormError, useFormErrors, useFormField, useFormFields, useNuiEvent, useTornEdges } from './hooks/index.cjs';
3
+ export { FormProvider, FormState, NuiHandlerSignature, NuiMessageData, TornEdgeSVGFilter, ValidationRules, ValidatorFn, createFormStore, createScriptSettings, useForm, useFormActions, useFormError, useFormErrors, useFormField, useFormFields, useNuiEvent, useTornEdges } from './hooks/index.cjs';
4
4
  export { DirkProvider, DirkProviderProps } from './providers/index.cjs';
5
5
  import 'react/jsx-runtime';
6
6
  import 'react';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
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
2
  export { InitialFetch, InternalEvent, SettingsState, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, fetchLuaTable, fetchNui, gameToMap, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, registerInitialLuaTableFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useProfanityStore, useSettings } from './utils/index.js';
3
- export { FormProvider, FormState, NuiHandlerSignature, NuiMessageData, TornEdgeSVGFilter, ValidationRules, ValidatorFn, _dispatchScriptSettingsUpdate, createFormStore, createScriptSettings, useForm, useFormActions, useFormError, useFormErrors, useFormField, useFormFields, useNuiEvent, useTornEdges } from './hooks/index.js';
3
+ export { FormProvider, FormState, NuiHandlerSignature, NuiMessageData, TornEdgeSVGFilter, ValidationRules, ValidatorFn, createFormStore, createScriptSettings, useForm, useFormActions, useFormError, useFormErrors, useFormField, useFormFields, useNuiEvent, useTornEdges } from './hooks/index.js';
4
4
  export { DirkProvider, DirkProviderProps } from './providers/index.js';
5
5
  import 'react/jsx-runtime';
6
6
  import 'react';
package/dist/index.js CHANGED
@@ -2307,15 +2307,16 @@ function TornEdgeSVGFilter() {
2307
2307
  }
2308
2308
  );
2309
2309
  }
2310
- var _scriptSettingsUpdaters = [];
2311
- function _dispatchScriptSettingsUpdate(data) {
2312
- _scriptSettingsUpdaters.forEach((fn) => fn(data));
2313
- }
2314
2310
  function createScriptSettings(defaultValue) {
2315
2311
  const store = create(() => defaultValue);
2316
- _scriptSettingsUpdaters.push((data) => {
2317
- store.setState((prev) => ({ ...prev, ...data }));
2318
- });
2312
+ if (typeof window !== "undefined") {
2313
+ window.addEventListener("message", (event) => {
2314
+ if (event.data?.action === "UPDATE_SCRIPT_SETTINGS" && event.data?.data) {
2315
+ console.log("[scriptSettings] UPDATE_SCRIPT_SETTINGS received", event.data.data);
2316
+ store.setState((prev) => ({ ...prev, ...event.data.data }));
2317
+ }
2318
+ });
2319
+ }
2319
2320
  const useScriptSettingHooks = () => {
2320
2321
  };
2321
2322
  const updateScriptSettings = async (newSettings) => {
@@ -2540,7 +2541,6 @@ function DirkProvider({ children, overideResourceName, themeOverride }) {
2540
2541
  console.error("Failed to fetch initial settings within dirk-cfx-react:", err);
2541
2542
  });
2542
2543
  }, []);
2543
- useNuiEvent("UPDATE_SCRIPT_SETTINGS", _dispatchScriptSettingsUpdate);
2544
2544
  const mergedTheme = useMemo(
2545
2545
  () => mergeMantineThemeSafe(
2546
2546
  { ...theme_default, primaryColor, primaryShade },
@@ -2564,6 +2564,6 @@ function DirkProvider({ children, overideResourceName, themeOverride }) {
2564
2564
  return /* @__PURE__ */ jsx(MantineProvider, { theme: mergedTheme, defaultColorScheme: "dark", children: /* @__PURE__ */ jsx(DirkErrorBoundary, { children: content }) });
2565
2565
  }
2566
2566
 
2567
- export { BorderedIcon, Counter, DirkProvider, FloatingParticles, FormProvider, InfoBox, InputContainer, LevelBanner, LevelPanel, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, PromptModal, SegmentedControl, SegmentedProgress, Title, TornEdgeSVGFilter, _dispatchScriptSettingsUpdate, colorWithAlpha, copyToClipboard, createFormStore, createScriptSettings, createSkill, fetchLuaTable, fetchNui, gameToMap, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, registerInitialLuaTableFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useForm, useFormActions, useFormError, useFormErrors, useFormField, useFormFields, useModal, useModalActions, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useSettings, useTornEdges };
2567
+ 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, fetchLuaTable, fetchNui, gameToMap, getImageShape, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, registerInitialLuaTableFetch, runFetches, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useForm, useFormActions, useFormError, useFormErrors, useFormField, useFormFields, useModal, useModalActions, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useSettings, useTornEdges };
2568
2568
  //# sourceMappingURL=index.js.map
2569
2569
  //# sourceMappingURL=index.js.map