dirk-cfx-react 1.1.7 → 1.1.8

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.js CHANGED
@@ -2,7 +2,7 @@ import React3, { createContext, useEffect, useRef, useState, useContext, useMemo
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, Box, Code, useMantineTheme, alpha, Progress, RingProgress, Button, MantineProvider, BackgroundImage } from '@mantine/core';
5
+ import { Flex, Text, Image as Image$1, createTheme, Box, Code, useMantineTheme, Progress, RingProgress, Button, MantineProvider, BackgroundImage } from '@mantine/core';
6
6
  import { jsxs, jsx } from 'react/jsx-runtime';
7
7
  import { motion, AnimatePresence, useMotionValue } from 'framer-motion';
8
8
  import clickSoundUrl from './click_sound-PNCRRTM4.mp3';
@@ -802,7 +802,6 @@ async function getImageShape(file) {
802
802
  });
803
803
  }
804
804
  var useSettings = create(() => ({
805
- hydrated: false,
806
805
  game: "fivem",
807
806
  primaryColor: "dirk",
808
807
  primaryShade: 9,
@@ -822,11 +821,10 @@ var useSettings = create(() => ({
822
821
  }));
823
822
  registerInitialFetch("GET_SETTINGS").then((data) => {
824
823
  useSettings.setState({
825
- ...data,
826
- hydrated: true
824
+ ...data
827
825
  });
828
- }).catch(() => {
829
- useSettings.setState({ hydrated: true });
826
+ }).catch((err) => {
827
+ console.error("Failed to fetch initial settings within dirk-cfx-react:", err);
830
828
  });
831
829
  function BorderedIcon(props) {
832
830
  const theme2 = useMantineTheme();
@@ -1146,7 +1144,7 @@ function InputContainer(props) {
1146
1144
  direction: "column",
1147
1145
  h: props.h,
1148
1146
  gap: props.title ? "xs" : 0,
1149
- bg: props.bg || alpha("var(--mantine-color-dark-9)", 0.65),
1147
+ bg: props.bg || colorWithAlpha("var(--mantine-color-dark-9)", 0.65),
1150
1148
  p: props.p || "sm",
1151
1149
  style: {
1152
1150
  borderRadius: theme2.radius.xs,
@@ -1314,7 +1312,7 @@ function Segment(props) {
1314
1312
  direction: "column",
1315
1313
  align: "center",
1316
1314
  h: "100%",
1317
- bg: props.selected ? props.color ? alpha(props.color, 0.2) : colorWithAlpha(theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.2) : "transparent",
1315
+ bg: props.selected ? props.color ? colorWithAlpha(props.color, 0.2) : colorWithAlpha(theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.2) : "transparent",
1318
1316
  pos: "relative",
1319
1317
  style: {
1320
1318
  // position: "relative",
@@ -1708,7 +1706,7 @@ function LevelPanel(props) {
1708
1706
  size: 190,
1709
1707
  roundCaps: true,
1710
1708
  thickness: 10,
1711
- sections: [{ value: props.progressToLevel, color: alpha(props.color || theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.9) }],
1709
+ sections: [{ value: props.progressToLevel, color: colorWithAlpha(props.color || theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.9) }],
1712
1710
  label: /* @__PURE__ */ jsx(
1713
1711
  Flex,
1714
1712
  {
@@ -1719,10 +1717,10 @@ function LevelPanel(props) {
1719
1717
  Text,
1720
1718
  {
1721
1719
  size: "6vh",
1722
- c: alpha(props.color || theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.9),
1720
+ c: colorWithAlpha(props.color || theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.9),
1723
1721
  style: {
1724
1722
  fontFamily: "Akrobat Black",
1725
- textShadow: `0 0 10px ${alpha(props.color || theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.7)}`
1723
+ textShadow: `0 0 10px ${colorWithAlpha(props.color || theme2.colors[theme2.primaryColor][theme2.primaryShade], 0.7)}`
1726
1724
  },
1727
1725
  children: props.level
1728
1726
  }
@@ -2431,7 +2429,6 @@ var DirkErrorBoundary = class extends React3.Component {
2431
2429
  library.add(fas, far, fab);
2432
2430
  function DirkProvider({ children, themeOverride }) {
2433
2431
  const {
2434
- hydrated,
2435
2432
  primaryColor,
2436
2433
  primaryShade,
2437
2434
  customTheme,