dirk-cfx-react 1.1.73 → 1.1.75
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 +299 -0
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +21 -1
- package/dist/components/index.d.ts +21 -1
- package/dist/components/index.js +301 -3
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +298 -0
- 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 +300 -3
- package/dist/index.js.map +1 -1
- package/dist/providers/index.cjs +6 -0
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.js +6 -0
- package/dist/providers/index.js.map +1 -1
- 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.map +1 -1
- package/package.json +3 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AdminPageTitle, AdminPageTitleProps, AsyncSaveButton, BlipColorSelect, BlipColorSelectProps, BlipDisplaySelect, BlipDisplaySelectProps, BlipIconSelect, BlipIconSelectProps, BorderedIcon, BorderedIconProps, ButtonProps, ConfigPanel, ConfigPanelProps, ConfirmModal, ConfirmModalProps, ControlMultiSelect, ControlMultiSelectProps, ControlSelect, ControlSelectProps, Counter, FiveMControls, FiveMKeyBindInput, FloatingParticles, FloatingParticlesProps, GroupName, GroupNameProps, GroupRank, GroupRankProps, GroupSelect, GroupSelectProps, GroupType, GroupValue, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, ModalProps, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavItem, NavigationContext, NavigationProvider, NavigationStore, ParticleState, PositionPicker, PositionPickerProps, ProgressProps, Prompt, PromptButton, PromptModal, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, SelectItem, SelectItemProps, StoreModalProps, TestBed, TestBedItem, TestBedPlacement, TestBedProps, Title, TitleProps, TitleSize, Vector4DeleteButton, Vector4Display, Vector4Value, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.cjs';
|
|
1
|
+
export { AdminPageTitle, AdminPageTitleProps, AsyncSaveButton, BlipColorSelect, BlipColorSelectProps, BlipDisplaySelect, BlipDisplaySelectProps, BlipIconSelect, BlipIconSelectProps, BorderedIcon, BorderedIconProps, ButtonProps, ConfigPanel, ConfigPanelProps, ConfirmModal, ConfirmModalProps, ControlMultiSelect, ControlMultiSelectProps, ControlSelect, ControlSelectProps, Counter, FiveMControls, FiveMKeyBindInput, FloatingParticles, FloatingParticlesProps, GroupName, GroupNameProps, GroupRank, GroupRankProps, GroupSelect, GroupSelectProps, GroupType, GroupValue, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, ModalProps, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavItem, NavigationContext, NavigationProvider, NavigationStore, ParticleState, PositionPicker, PositionPickerProps, ProgressProps, Prompt, PromptButton, PromptModal, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, SelectItem, SelectItemProps, StoreModalProps, TestBed, TestBedItem, TestBedPlacement, TestBedProps, ThemeOverrideSection, ThemeOverrideSectionProps, ThemeOverrideValue, Title, TitleProps, TitleSize, Vector4DeleteButton, Vector4Display, Vector4Value, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.cjs';
|
|
2
2
|
export { FrameworkGrade, FrameworkGroup, GTA_CONTROLS, GTA_CONTROL_GROUP_ORDER, GtaControl, GtaControlGroup, INPUT_MAPPER_KEYS_BY_PRIMARY, INPUT_MAPPER_PRIMARY_OPTIONS, InitialFetch, InternalEvent, InventoryItem, InventoryItems, SettingsState, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, extractDefaults, fetchLuaTable, fetchNui, formatGtaControl, gameToMap, getGtaControl, getImageShape, getItemImageUrl, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, registerInitialLuaTableFetch, runFetches, selectAllGroups, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useFrameworkGroups, useItems, useItemsList, useProfanityStore, useSettings } from './utils/index.cjs';
|
|
3
3
|
export { FormProvider, FormState, NuiHandlerSignature, NuiMessageData, ScriptConfigHistoryChange, ScriptConfigHistoryEntry, ScriptConfigHistoryRequest, ScriptConfigHistoryResponse, ScriptConfigInstance, TornEdgeSVGFilter, ValidationRules, ValidatorFn, createFormStore, createScriptConfig, getScriptConfigInstance, useAudio, useForm, useFormActions, useFormError, useFormErrors, useFormField, useFormFields, useNuiEvent, useTornEdges } from './hooks/index.cjs';
|
|
4
4
|
export { DirkProvider, DirkProviderProps } from './providers/index.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AdminPageTitle, AdminPageTitleProps, AsyncSaveButton, BlipColorSelect, BlipColorSelectProps, BlipDisplaySelect, BlipDisplaySelectProps, BlipIconSelect, BlipIconSelectProps, BorderedIcon, BorderedIconProps, ButtonProps, ConfigPanel, ConfigPanelProps, ConfirmModal, ConfirmModalProps, ControlMultiSelect, ControlMultiSelectProps, ControlSelect, ControlSelectProps, Counter, FiveMControls, FiveMKeyBindInput, FloatingParticles, FloatingParticlesProps, GroupName, GroupNameProps, GroupRank, GroupRankProps, GroupSelect, GroupSelectProps, GroupType, GroupValue, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, ModalProps, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavItem, NavigationContext, NavigationProvider, NavigationStore, ParticleState, PositionPicker, PositionPickerProps, ProgressProps, Prompt, PromptButton, PromptModal, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, SelectItem, SelectItemProps, StoreModalProps, TestBed, TestBedItem, TestBedPlacement, TestBedProps, Title, TitleProps, TitleSize, Vector4DeleteButton, Vector4Display, Vector4Value, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.js';
|
|
1
|
+
export { AdminPageTitle, AdminPageTitleProps, AsyncSaveButton, BlipColorSelect, BlipColorSelectProps, BlipDisplaySelect, BlipDisplaySelectProps, BlipIconSelect, BlipIconSelectProps, BorderedIcon, BorderedIconProps, ButtonProps, ConfigPanel, ConfigPanelProps, ConfirmModal, ConfirmModalProps, ControlMultiSelect, ControlMultiSelectProps, ControlSelect, ControlSelectProps, Counter, FiveMControls, FiveMKeyBindInput, FloatingParticles, FloatingParticlesProps, GroupName, GroupNameProps, GroupRank, GroupRankProps, GroupSelect, GroupSelectProps, GroupType, GroupValue, InfoBox, InfoBoxProps, InputContainer, InputContainerProps, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, ModalProps, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavItem, NavigationContext, NavigationProvider, NavigationStore, ParticleState, PositionPicker, PositionPickerProps, ProgressProps, Prompt, PromptButton, PromptModal, SegmentProps, SegmentedControl, SegmentedControlProps, SegmentedProgress, SelectItem, SelectItemProps, StoreModalProps, TestBed, TestBedItem, TestBedPlacement, TestBedProps, ThemeOverrideSection, ThemeOverrideSectionProps, ThemeOverrideValue, Title, TitleProps, TitleSize, Vector4DeleteButton, Vector4Display, Vector4Value, WorldPositionGotoButton, WorldPositionSetButton, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore } from './components/index.js';
|
|
2
2
|
export { FrameworkGrade, FrameworkGroup, GTA_CONTROLS, GTA_CONTROL_GROUP_ORDER, GtaControl, GtaControlGroup, INPUT_MAPPER_KEYS_BY_PRIMARY, INPUT_MAPPER_PRIMARY_OPTIONS, InitialFetch, InternalEvent, InventoryItem, InventoryItems, SettingsState, SkillSettings, UploadImageProps, colorWithAlpha, copyToClipboard, createSkill, extractDefaults, fetchLuaTable, fetchNui, formatGtaControl, gameToMap, getGtaControl, getImageShape, getItemImageUrl, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, registerInitialLuaTableFetch, runFetches, selectAllGroups, splitFAString, updatePresignedURL, uploadImage, useAutoFetcher, useFrameworkGroups, useItems, useItemsList, useProfanityStore, useSettings } from './utils/index.js';
|
|
3
3
|
export { FormProvider, FormState, NuiHandlerSignature, NuiMessageData, ScriptConfigHistoryChange, ScriptConfigHistoryEntry, ScriptConfigHistoryRequest, ScriptConfigHistoryResponse, ScriptConfigInstance, TornEdgeSVGFilter, ValidationRules, ValidatorFn, createFormStore, createScriptConfig, getScriptConfigInstance, useAudio, useForm, useFormActions, useFormError, useFormErrors, useFormField, useFormFields, useNuiEvent, useTornEdges } from './hooks/index.js';
|
|
4
4
|
export { DirkProvider, DirkProviderProps } from './providers/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { Flex, Text, Image as Image$1, createTheme, Box, Stack, Title as Title$1, Code, TextInput, Select, useMantineTheme, Tooltip, alpha, Progress, RingProgress, Portal, Button, NumberInput, MultiSelect, Loader, ActionIcon, MantineProvider, BackgroundImage, Group, JsonInput } from '@mantine/core';
|
|
1
|
+
import { Flex, Text, Image as Image$1, createTheme, Box, Stack, Title as Title$1, Code, TextInput, Select, useMantineTheme, Tooltip, alpha, Progress, RingProgress, Portal, Button, NumberInput, MultiSelect, Loader, ActionIcon, Switch, ColorInput, Popover, MantineProvider, BackgroundImage, Group, JsonInput } from '@mantine/core';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import React6, { createContext, useContext, useEffect, useRef, useState, useCallback, useMemo, useLayoutEffect } from 'react';
|
|
4
4
|
import { create, useStore, createStore } from 'zustand';
|
|
5
5
|
import axios from 'axios';
|
|
6
6
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
7
|
import { motion, AnimatePresence, useMotionValue } from 'framer-motion';
|
|
8
|
-
import { Info, X, AlertTriangle, Trash2, RefreshCw, ChevronDown, Check, Copy, MapPin, Crosshair, EyeOff, Eye, RotateCcw, FlaskConical, ChevronUp, ArrowLeft, Undo2, Redo2, Save, History, XCircle, Code2, Search, Filter, User } from 'lucide-react';
|
|
8
|
+
import { Info, X, AlertTriangle, Trash2, RefreshCw, ChevronDown, Check, Copy, MapPin, Crosshair, EyeOff, Eye, RotateCcw, FlaskConical, ChevronUp, Palette, ArrowLeft, Undo2, Redo2, Save, History, XCircle, Code2, Search, Filter, User } from 'lucide-react';
|
|
9
9
|
import clickSoundUrl from './click_sound-PNCRRTM4.mp3';
|
|
10
10
|
import hoverSoundUrl from './hover_sound-NBUA222C.mp3';
|
|
11
11
|
import { notifications } from '@mantine/notifications';
|
|
12
12
|
import { QueryClient, QueryClientProvider, useInfiniteQuery } from '@tanstack/react-query';
|
|
13
|
+
import { generateColors } from '@mantine/colors-generator';
|
|
13
14
|
import '@mantine/core/styles.css';
|
|
14
15
|
import '@mantine/notifications/styles.css';
|
|
15
16
|
import './styles/fonts.css';
|
|
@@ -4826,7 +4827,22 @@ function ConfigPanelInner({
|
|
|
4826
4827
|
if (result?.success) {
|
|
4827
4828
|
const { store } = getScriptConfigInstance();
|
|
4828
4829
|
form.reinitialize(cloneConfig(store.getState()));
|
|
4830
|
+
notifications.show({
|
|
4831
|
+
color: "green",
|
|
4832
|
+
title: locale("ConfigResetSuccessTitle"),
|
|
4833
|
+
message: locale("ConfigResetSuccessBody"),
|
|
4834
|
+
autoClose: 3e3
|
|
4835
|
+
});
|
|
4836
|
+
return;
|
|
4829
4837
|
}
|
|
4838
|
+
const err = result?._error || "Unknown";
|
|
4839
|
+
console.warn(`[ConfigPanel] config reset failed: ${err}`);
|
|
4840
|
+
notifications.show({
|
|
4841
|
+
color: "red",
|
|
4842
|
+
title: locale("ConfigResetFailedTitle"),
|
|
4843
|
+
message: locale("ConfigResetFailedBody", err),
|
|
4844
|
+
autoClose: 6e3
|
|
4845
|
+
});
|
|
4830
4846
|
},
|
|
4831
4847
|
onClose: () => setResetOpen(false),
|
|
4832
4848
|
zIndex: 300
|
|
@@ -6001,6 +6017,281 @@ function TestBed({
|
|
|
6001
6017
|
}
|
|
6002
6018
|
);
|
|
6003
6019
|
}
|
|
6020
|
+
var MANTINE_COLOR_OPTIONS = [
|
|
6021
|
+
"dirk",
|
|
6022
|
+
"red",
|
|
6023
|
+
"pink",
|
|
6024
|
+
"grape",
|
|
6025
|
+
"violet",
|
|
6026
|
+
"indigo",
|
|
6027
|
+
"blue",
|
|
6028
|
+
"cyan",
|
|
6029
|
+
"teal",
|
|
6030
|
+
"green",
|
|
6031
|
+
"lime",
|
|
6032
|
+
"yellow",
|
|
6033
|
+
"orange"
|
|
6034
|
+
].map((value) => ({ value, label: value }));
|
|
6035
|
+
var DEFAULT_PALETTE = [
|
|
6036
|
+
"#f0f4ff",
|
|
6037
|
+
"#d9e3ff",
|
|
6038
|
+
"#bfcfff",
|
|
6039
|
+
"#a6bbff",
|
|
6040
|
+
"#8ca7ff",
|
|
6041
|
+
"#7393ff",
|
|
6042
|
+
"#5a7fff",
|
|
6043
|
+
"#406bff",
|
|
6044
|
+
"#2547ff",
|
|
6045
|
+
"#0b33ff"
|
|
6046
|
+
];
|
|
6047
|
+
var DEFAULT_VALUE = {
|
|
6048
|
+
useOverride: false,
|
|
6049
|
+
primaryColor: "dirk",
|
|
6050
|
+
primaryShade: 5,
|
|
6051
|
+
customTheme: DEFAULT_PALETTE
|
|
6052
|
+
};
|
|
6053
|
+
function GroupLabel({ label: label2 }) {
|
|
6054
|
+
return /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "xs", mt: "xxs", children: [
|
|
6055
|
+
/* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xxs", tt: "uppercase", lts: "0.07em", c: "rgba(255,255,255,0.2)", children: label2 }),
|
|
6056
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, height: "0.05vh", background: "rgba(255,255,255,0.06)" } })
|
|
6057
|
+
] });
|
|
6058
|
+
}
|
|
6059
|
+
function ThemeOverrideSection({
|
|
6060
|
+
schemaKey = "theme",
|
|
6061
|
+
title
|
|
6062
|
+
}) {
|
|
6063
|
+
const mantineTheme = useMantineTheme();
|
|
6064
|
+
const color = mantineTheme.colors[mantineTheme.primaryColor][5];
|
|
6065
|
+
const raw = useFormField(schemaKey);
|
|
6066
|
+
const value = {
|
|
6067
|
+
useOverride: raw?.useOverride ?? DEFAULT_VALUE.useOverride,
|
|
6068
|
+
primaryColor: raw?.primaryColor ?? DEFAULT_VALUE.primaryColor,
|
|
6069
|
+
primaryShade: raw?.primaryShade ?? DEFAULT_VALUE.primaryShade,
|
|
6070
|
+
customTheme: Array.isArray(raw?.customTheme) && raw.customTheme.length === 10 ? raw.customTheme : DEFAULT_VALUE.customTheme
|
|
6071
|
+
};
|
|
6072
|
+
const { setValue } = useFormActions();
|
|
6073
|
+
const set = (key, val) => setValue(schemaKey, { ...value, [key]: val });
|
|
6074
|
+
const useCustom = value.primaryColor === "custom";
|
|
6075
|
+
const editable = value.useOverride;
|
|
6076
|
+
const setSwatch = (index, hex) => {
|
|
6077
|
+
const next = [...value.customTheme];
|
|
6078
|
+
next[index] = hex;
|
|
6079
|
+
set("customTheme", next);
|
|
6080
|
+
};
|
|
6081
|
+
const generateFromBase = (hex) => {
|
|
6082
|
+
try {
|
|
6083
|
+
const generated = generateColors(hex);
|
|
6084
|
+
set("customTheme", generated);
|
|
6085
|
+
} catch {
|
|
6086
|
+
}
|
|
6087
|
+
};
|
|
6088
|
+
const resetPalette = () => set("customTheme", DEFAULT_PALETTE);
|
|
6089
|
+
return /* @__PURE__ */ jsxs(
|
|
6090
|
+
Flex,
|
|
6091
|
+
{
|
|
6092
|
+
direction: "column",
|
|
6093
|
+
gap: "xs",
|
|
6094
|
+
p: "sm",
|
|
6095
|
+
style: { flex: 1, minHeight: 0, overflowY: "auto" },
|
|
6096
|
+
children: [
|
|
6097
|
+
/* @__PURE__ */ jsx(
|
|
6098
|
+
AdminPageTitle,
|
|
6099
|
+
{
|
|
6100
|
+
icon: Palette,
|
|
6101
|
+
title: title || locale("Theme") || "Theme",
|
|
6102
|
+
color
|
|
6103
|
+
}
|
|
6104
|
+
),
|
|
6105
|
+
/* @__PURE__ */ jsxs(
|
|
6106
|
+
Flex,
|
|
6107
|
+
{
|
|
6108
|
+
align: "center",
|
|
6109
|
+
justify: "space-between",
|
|
6110
|
+
p: "xs",
|
|
6111
|
+
style: {
|
|
6112
|
+
background: `rgba(255,255,255,${editable ? 0.04 : 0.02})`,
|
|
6113
|
+
border: `0.1vh solid ${editable ? color : "rgba(255,255,255,0.08)"}`,
|
|
6114
|
+
borderRadius: mantineTheme.radius.xs,
|
|
6115
|
+
transition: "background 0.15s, border-color 0.15s"
|
|
6116
|
+
},
|
|
6117
|
+
children: [
|
|
6118
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "xxs", style: { flex: 1, minWidth: 0 }, children: [
|
|
6119
|
+
/* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xs", c: "rgba(255,255,255,0.9)", children: locale("OverrideGlobalTheme") || "Override global theme" }),
|
|
6120
|
+
/* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xxs", c: "rgba(255,255,255,0.4)", children: locale("OverrideGlobalThemeDesc") || "When on, this resource uses its own primary colour and palette instead of dirk_lib's. Turn off to fall back to the global theme \u2014 your custom palette is kept." })
|
|
6121
|
+
] }),
|
|
6122
|
+
/* @__PURE__ */ jsx(
|
|
6123
|
+
Switch,
|
|
6124
|
+
{
|
|
6125
|
+
size: "md",
|
|
6126
|
+
checked: value.useOverride,
|
|
6127
|
+
onChange: (e) => set("useOverride", e.currentTarget.checked)
|
|
6128
|
+
}
|
|
6129
|
+
)
|
|
6130
|
+
]
|
|
6131
|
+
}
|
|
6132
|
+
),
|
|
6133
|
+
/* @__PURE__ */ jsxs(
|
|
6134
|
+
"div",
|
|
6135
|
+
{
|
|
6136
|
+
style: {
|
|
6137
|
+
opacity: editable ? 1 : 0.4,
|
|
6138
|
+
pointerEvents: editable ? "auto" : "none",
|
|
6139
|
+
transition: "opacity 0.15s"
|
|
6140
|
+
},
|
|
6141
|
+
children: [
|
|
6142
|
+
/* @__PURE__ */ jsx(GroupLabel, { label: locale("PrimaryColor") || "Primary Colour" }),
|
|
6143
|
+
/* @__PURE__ */ jsx(
|
|
6144
|
+
Switch,
|
|
6145
|
+
{
|
|
6146
|
+
label: locale("UseCustomPalette") || "Use custom palette",
|
|
6147
|
+
size: "md",
|
|
6148
|
+
checked: useCustom,
|
|
6149
|
+
onChange: (e) => set("primaryColor", e.currentTarget.checked ? "custom" : "dirk"),
|
|
6150
|
+
styles: {
|
|
6151
|
+
label: {
|
|
6152
|
+
fontFamily: "Akrobat Bold",
|
|
6153
|
+
fontSize: "0.65em",
|
|
6154
|
+
letterSpacing: "0.06em",
|
|
6155
|
+
textTransform: "uppercase",
|
|
6156
|
+
color: "rgba(255,255,255,0.35)"
|
|
6157
|
+
}
|
|
6158
|
+
}
|
|
6159
|
+
}
|
|
6160
|
+
),
|
|
6161
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "xs", mt: "xs", children: [
|
|
6162
|
+
!useCustom && /* @__PURE__ */ jsx(
|
|
6163
|
+
Select,
|
|
6164
|
+
{
|
|
6165
|
+
label: locale("MantinePalette") || "Mantine palette",
|
|
6166
|
+
size: "xs",
|
|
6167
|
+
style: { flex: 1 },
|
|
6168
|
+
value: value.primaryColor,
|
|
6169
|
+
data: MANTINE_COLOR_OPTIONS,
|
|
6170
|
+
allowDeselect: false,
|
|
6171
|
+
onChange: (v) => v && set("primaryColor", v)
|
|
6172
|
+
}
|
|
6173
|
+
),
|
|
6174
|
+
/* @__PURE__ */ jsx(
|
|
6175
|
+
NumberInput,
|
|
6176
|
+
{
|
|
6177
|
+
label: locale("Shade") || "Shade",
|
|
6178
|
+
size: "xs",
|
|
6179
|
+
style: { flex: 1 },
|
|
6180
|
+
min: 0,
|
|
6181
|
+
max: 9,
|
|
6182
|
+
value: value.primaryShade,
|
|
6183
|
+
onChange: (v) => set("primaryShade", Number(v))
|
|
6184
|
+
}
|
|
6185
|
+
)
|
|
6186
|
+
] }),
|
|
6187
|
+
useCustom && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6188
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", justify: "space-between", mt: "sm", children: [
|
|
6189
|
+
/* @__PURE__ */ jsx(
|
|
6190
|
+
Text,
|
|
6191
|
+
{
|
|
6192
|
+
ff: "Akrobat Bold",
|
|
6193
|
+
size: "xxs",
|
|
6194
|
+
tt: "uppercase",
|
|
6195
|
+
lts: "0.07em",
|
|
6196
|
+
c: "rgba(255,255,255,0.2)",
|
|
6197
|
+
children: locale("CustomPalette") || "Custom palette"
|
|
6198
|
+
}
|
|
6199
|
+
),
|
|
6200
|
+
/* @__PURE__ */ jsx(
|
|
6201
|
+
ActionIcon,
|
|
6202
|
+
{
|
|
6203
|
+
size: "sm",
|
|
6204
|
+
variant: "subtle",
|
|
6205
|
+
onClick: resetPalette,
|
|
6206
|
+
title: locale("ResetPalette") || "Reset palette",
|
|
6207
|
+
children: /* @__PURE__ */ jsx(RotateCcw, { size: "1.4vh" })
|
|
6208
|
+
}
|
|
6209
|
+
)
|
|
6210
|
+
] }),
|
|
6211
|
+
/* @__PURE__ */ jsx(
|
|
6212
|
+
ColorInput,
|
|
6213
|
+
{
|
|
6214
|
+
label: locale("BaseColor") || "Base colour",
|
|
6215
|
+
size: "xs",
|
|
6216
|
+
value: value.customTheme[value.primaryShade] ?? value.customTheme[5] ?? "#000000",
|
|
6217
|
+
onChange: generateFromBase,
|
|
6218
|
+
eyeDropperIcon: /* @__PURE__ */ jsx(Fragment, {})
|
|
6219
|
+
}
|
|
6220
|
+
),
|
|
6221
|
+
/* @__PURE__ */ jsx(Flex, { gap: "xxs", mt: "xxs", children: value.customTheme.map((swatch, i) => /* @__PURE__ */ jsx(
|
|
6222
|
+
SwatchTile,
|
|
6223
|
+
{
|
|
6224
|
+
index: i,
|
|
6225
|
+
value: swatch,
|
|
6226
|
+
isPrimary: i === value.primaryShade,
|
|
6227
|
+
onChange: (v) => setSwatch(i, v)
|
|
6228
|
+
},
|
|
6229
|
+
i
|
|
6230
|
+
)) })
|
|
6231
|
+
] })
|
|
6232
|
+
]
|
|
6233
|
+
}
|
|
6234
|
+
)
|
|
6235
|
+
]
|
|
6236
|
+
}
|
|
6237
|
+
);
|
|
6238
|
+
}
|
|
6239
|
+
function SwatchTile({
|
|
6240
|
+
index,
|
|
6241
|
+
value,
|
|
6242
|
+
isPrimary,
|
|
6243
|
+
onChange
|
|
6244
|
+
}) {
|
|
6245
|
+
const [opened, setOpened] = useState(false);
|
|
6246
|
+
return /* @__PURE__ */ jsxs(Popover, { opened, onChange: setOpened, position: "bottom", withArrow: true, zIndex: 1e4, children: [
|
|
6247
|
+
/* @__PURE__ */ jsx(Popover.Target, { children: /* @__PURE__ */ jsx(
|
|
6248
|
+
"button",
|
|
6249
|
+
{
|
|
6250
|
+
onClick: () => setOpened((o) => !o),
|
|
6251
|
+
title: `${index} \xB7 ${value}`,
|
|
6252
|
+
style: {
|
|
6253
|
+
flex: 1,
|
|
6254
|
+
aspectRatio: "1 / 1",
|
|
6255
|
+
background: value,
|
|
6256
|
+
border: isPrimary ? "0.2vh solid rgba(255,255,255,0.85)" : "0.1vh solid rgba(255,255,255,0.15)",
|
|
6257
|
+
borderRadius: "0.4vh",
|
|
6258
|
+
cursor: "pointer",
|
|
6259
|
+
padding: 0,
|
|
6260
|
+
display: "flex",
|
|
6261
|
+
alignItems: "flex-end",
|
|
6262
|
+
justifyContent: "flex-end",
|
|
6263
|
+
position: "relative"
|
|
6264
|
+
},
|
|
6265
|
+
children: /* @__PURE__ */ jsx(
|
|
6266
|
+
"span",
|
|
6267
|
+
{
|
|
6268
|
+
style: {
|
|
6269
|
+
fontFamily: "Akrobat Bold",
|
|
6270
|
+
fontSize: "0.9vh",
|
|
6271
|
+
lineHeight: 1,
|
|
6272
|
+
padding: "0.2vh 0.3vh",
|
|
6273
|
+
color: "rgba(0,0,0,0.55)",
|
|
6274
|
+
background: "rgba(255,255,255,0.55)",
|
|
6275
|
+
borderRadius: "0.25vh",
|
|
6276
|
+
margin: "0.2vh"
|
|
6277
|
+
},
|
|
6278
|
+
children: index
|
|
6279
|
+
}
|
|
6280
|
+
)
|
|
6281
|
+
}
|
|
6282
|
+
) }),
|
|
6283
|
+
/* @__PURE__ */ jsx(Popover.Dropdown, { p: "xs", children: /* @__PURE__ */ jsx(
|
|
6284
|
+
ColorInput,
|
|
6285
|
+
{
|
|
6286
|
+
size: "xs",
|
|
6287
|
+
value,
|
|
6288
|
+
onChange,
|
|
6289
|
+
format: "hex",
|
|
6290
|
+
eyeDropperIcon: /* @__PURE__ */ jsx(Fragment, {})
|
|
6291
|
+
}
|
|
6292
|
+
) })
|
|
6293
|
+
] });
|
|
6294
|
+
}
|
|
6004
6295
|
function useTornEdges() {
|
|
6005
6296
|
const game = useSettings((state) => state.game);
|
|
6006
6297
|
return game === "rdr3" ? "torn-edge-wrapper" : "";
|
|
@@ -6282,6 +6573,12 @@ function DirkProvider({ children, overideResourceName, themeOverride }) {
|
|
|
6282
6573
|
}, []);
|
|
6283
6574
|
useNuiEvent("UPDATE_DIRK_LIB_SETTINGS", (data) => {
|
|
6284
6575
|
if (!data || typeof data !== "object") return;
|
|
6576
|
+
const current = useSettings.getState();
|
|
6577
|
+
if (current.themeOverride) {
|
|
6578
|
+
const { primaryColor: _pc, primaryShade: _ps, customTheme: _ct, ...rest } = data;
|
|
6579
|
+
useSettings.setState(rest);
|
|
6580
|
+
return;
|
|
6581
|
+
}
|
|
6285
6582
|
useSettings.setState(data);
|
|
6286
6583
|
});
|
|
6287
6584
|
const mergedTheme = useMemo(
|
|
@@ -6322,6 +6619,6 @@ var Vector4Schema = z.object({
|
|
|
6322
6619
|
w: z.number()
|
|
6323
6620
|
});
|
|
6324
6621
|
|
|
6325
|
-
export { AdminPageTitle, AsyncSaveButton, BlipColorSelect, BlipDisplaySelect, BlipIconSelect, BorderedIcon, ConfigPanel, ConfirmModal, ControlMultiSelect, ControlSelect, Counter, DirkProvider, FiveMKeyBindInput, FloatingParticles, FormProvider, GTA_CONTROLS, GTA_CONTROL_GROUP_ORDER, GroupName, GroupRank, GroupSelect, INPUT_MAPPER_KEYS_BY_PRIMARY, INPUT_MAPPER_PRIMARY_OPTIONS, InfoBox, InputContainer, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, PositionPicker, PromptModal, SegmentedControl, SegmentedProgress, SelectItem, TestBed, Title, TornEdgeSVGFilter, Vector2Schema, Vector3Schema, Vector4DeleteButton, Vector4Display, Vector4Schema, WorldPositionGotoButton, WorldPositionSetButton, colorWithAlpha, copyToClipboard, createFormStore, createScriptConfig, createSkill, extractDefaults, fetchLuaTable, fetchNui, formatGtaControl, gameToMap, getGtaControl, getImageShape, getItemImageUrl, getScriptConfigInstance, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, registerInitialLuaTableFetch, runFetches, selectAllGroups, splitFAString, updatePresignedURL, uploadImage, useAudio, useAutoFetcher, useForm, useFormActions, useFormError, useFormErrors, useFormField, useFormFields, useFrameworkGroups, useItems, useItemsList, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useSettings, useTornEdges };
|
|
6622
|
+
export { AdminPageTitle, AsyncSaveButton, BlipColorSelect, BlipDisplaySelect, BlipIconSelect, BorderedIcon, ConfigPanel, ConfirmModal, ControlMultiSelect, ControlSelect, Counter, DirkProvider, FiveMKeyBindInput, FloatingParticles, FormProvider, GTA_CONTROLS, GTA_CONTROL_GROUP_ORDER, GroupName, GroupRank, GroupSelect, INPUT_MAPPER_KEYS_BY_PRIMARY, INPUT_MAPPER_PRIMARY_OPTIONS, InfoBox, InputContainer, LevelBanner, LevelPanel, MissingItemsBanner, Modal, ModalContext, ModalProvider, MotionFlex, MotionIcon, MotionImage, MotionText, NavBar, NavigationContext, NavigationProvider, PositionPicker, PromptModal, SegmentedControl, SegmentedProgress, SelectItem, TestBed, ThemeOverrideSection, Title, TornEdgeSVGFilter, Vector2Schema, Vector3Schema, Vector4DeleteButton, Vector4Display, Vector4Schema, WorldPositionGotoButton, WorldPositionSetButton, colorWithAlpha, copyToClipboard, createFormStore, createScriptConfig, createSkill, extractDefaults, fetchLuaTable, fetchNui, formatGtaControl, gameToMap, getGtaControl, getImageShape, getItemImageUrl, getScriptConfigInstance, initialFetches, internalEvent, isEnvBrowser, isProfanity, latPr100, locale, localeStore, mapCenter, mapToGame, noop, numberToRoman, openLink, registerInitialFetch, registerInitialLuaTableFetch, runFetches, selectAllGroups, splitFAString, updatePresignedURL, uploadImage, useAudio, useAutoFetcher, useForm, useFormActions, useFormError, useFormErrors, useFormField, useFormFields, useFrameworkGroups, useItems, useItemsList, useMissingItemsAudit, useModal, useModalActions, useNavigation, useNavigationStore, useNuiEvent, useProfanityStore, useSettings, useTornEdges };
|
|
6326
6623
|
//# sourceMappingURL=index.js.map
|
|
6327
6624
|
//# sourceMappingURL=index.js.map
|