dirk-cfx-react 1.1.83 → 1.1.85
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 +71 -34
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +72 -35
- package/dist/components/index.js.map +1 -1
- package/dist/index.cjs +71 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +72 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createContext, useContext, useRef, useState, useEffect, useCallback, us
|
|
|
4
4
|
import { create, useStore, createStore } from 'zustand';
|
|
5
5
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
6
|
import { motion, AnimatePresence, useMotionValue } from 'framer-motion';
|
|
7
|
-
import { Info, X, AlertTriangle, Trash2, RefreshCw, ChevronDown, Check, Copy, MapPin, Crosshair, EyeOff, Eye, RotateCcw, FlaskConical, ChevronUp, Palette, ArrowLeft, Undo2, Redo2, Save, History, XCircle, Code2,
|
|
7
|
+
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';
|
|
8
8
|
import clickSoundUrl from '../click_sound-PNCRRTM4.mp3';
|
|
9
9
|
import hoverSoundUrl from '../hover_sound-NBUA222C.mp3';
|
|
10
10
|
import { notifications } from '@mantine/notifications';
|
|
@@ -3084,11 +3084,11 @@ function ConfirmModal({
|
|
|
3084
3084
|
placeholder: confirmText,
|
|
3085
3085
|
value: typed,
|
|
3086
3086
|
onChange: (e) => setTyped(e.currentTarget.value),
|
|
3087
|
-
styles: (
|
|
3087
|
+
styles: (t2) => ({
|
|
3088
3088
|
input: {
|
|
3089
|
-
backgroundColor: alpha(
|
|
3089
|
+
backgroundColor: alpha(t2.colors.dark[7], 0.5),
|
|
3090
3090
|
border: `0.1vh solid ${alpha(
|
|
3091
|
-
typed === confirmText ? "#ef4444" :
|
|
3091
|
+
typed === confirmText ? "#ef4444" : t2.colors.dark[5],
|
|
3092
3092
|
0.5
|
|
3093
3093
|
)}`,
|
|
3094
3094
|
color: "rgba(255,255,255,0.85)",
|
|
@@ -6197,6 +6197,10 @@ function ScenarioSelect({
|
|
|
6197
6197
|
}
|
|
6198
6198
|
);
|
|
6199
6199
|
}
|
|
6200
|
+
var t = (key, fallback) => {
|
|
6201
|
+
const v = locale(key);
|
|
6202
|
+
return v === key ? fallback : v;
|
|
6203
|
+
};
|
|
6200
6204
|
function decimalToHex(color) {
|
|
6201
6205
|
if (!color || color === 0) return null;
|
|
6202
6206
|
return "#" + color.toString(16).padStart(6, "0");
|
|
@@ -6220,30 +6224,8 @@ function RoleOption({ role }) {
|
|
|
6220
6224
|
/* @__PURE__ */ jsx(Text, { size: "xs", c: "rgba(255,255,255,0.9)", children: role.name })
|
|
6221
6225
|
] });
|
|
6222
6226
|
}
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "xxs", children: [
|
|
6226
|
-
label && /* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xxs", tt: "uppercase", lts: "0.05em", c: "rgba(255,255,255,0.55)", children: label }),
|
|
6227
|
-
/* @__PURE__ */ jsxs(
|
|
6228
|
-
Flex,
|
|
6229
|
-
{
|
|
6230
|
-
align: "center",
|
|
6231
|
-
gap: "xs",
|
|
6232
|
-
px: "xs",
|
|
6233
|
-
py: "xxs",
|
|
6234
|
-
style: {
|
|
6235
|
-
background: "rgba(0,0,0,0.3)",
|
|
6236
|
-
border: "0.1vh dashed rgba(255,255,255,0.12)",
|
|
6237
|
-
borderRadius: theme.radius.xs
|
|
6238
|
-
},
|
|
6239
|
-
children: [
|
|
6240
|
-
/* @__PURE__ */ jsx(ExternalLink, { size: "1.4vh", color: "rgba(255,255,255,0.4)" }),
|
|
6241
|
-
/* @__PURE__ */ jsx(Text, { ff: "Akrobat Bold", size: "xxs", c: "rgba(255,255,255,0.55)", style: { flex: 1 }, children: locale("DiscordNotConfigured") || "Discord bot not configured \u2014 run /dirk_lib and set a bot token + guild ID." })
|
|
6242
|
-
]
|
|
6243
|
-
}
|
|
6244
|
-
)
|
|
6245
|
-
] });
|
|
6246
|
-
}
|
|
6227
|
+
var NOT_CONFIGURED_TINT = "rgba(255,184,0,0.35)";
|
|
6228
|
+
var NOT_CONFIGURED_FILL = "rgba(255,184,0,0.05)";
|
|
6247
6229
|
function DiscordRoleSelect(props) {
|
|
6248
6230
|
const { endpoint, label, size = "xs", placeholder, disabled, style, styles } = props;
|
|
6249
6231
|
const [roles, setRoles] = useState(null);
|
|
@@ -6283,7 +6265,53 @@ function DiscordRoleSelect(props) {
|
|
|
6283
6265
|
return map;
|
|
6284
6266
|
}, [roles]);
|
|
6285
6267
|
if (errorCode === "NotConfigured") {
|
|
6286
|
-
|
|
6268
|
+
const notConfiguredPlaceholder = t(
|
|
6269
|
+
"DiscordNotConfigured",
|
|
6270
|
+
"Not configured \u2014 set in /dirk_lib"
|
|
6271
|
+
);
|
|
6272
|
+
const notConfiguredStyles = {
|
|
6273
|
+
...styles,
|
|
6274
|
+
input: {
|
|
6275
|
+
...styles?.input ?? {},
|
|
6276
|
+
borderColor: NOT_CONFIGURED_TINT,
|
|
6277
|
+
backgroundColor: NOT_CONFIGURED_FILL
|
|
6278
|
+
}
|
|
6279
|
+
};
|
|
6280
|
+
const warnIcon = /* @__PURE__ */ jsx(AlertTriangle, { size: "1.2vh", color: NOT_CONFIGURED_TINT.replace(/0\.35\)$/, "0.85)") });
|
|
6281
|
+
if (props.multi) {
|
|
6282
|
+
return /* @__PURE__ */ jsx(
|
|
6283
|
+
MultiSelect,
|
|
6284
|
+
{
|
|
6285
|
+
label,
|
|
6286
|
+
size,
|
|
6287
|
+
placeholder: notConfiguredPlaceholder,
|
|
6288
|
+
data: [],
|
|
6289
|
+
value: [],
|
|
6290
|
+
onChange: () => {
|
|
6291
|
+
},
|
|
6292
|
+
disabled: true,
|
|
6293
|
+
rightSection: warnIcon,
|
|
6294
|
+
style,
|
|
6295
|
+
styles: notConfiguredStyles
|
|
6296
|
+
}
|
|
6297
|
+
);
|
|
6298
|
+
}
|
|
6299
|
+
return /* @__PURE__ */ jsx(
|
|
6300
|
+
Select,
|
|
6301
|
+
{
|
|
6302
|
+
label,
|
|
6303
|
+
size,
|
|
6304
|
+
placeholder: notConfiguredPlaceholder,
|
|
6305
|
+
data: [],
|
|
6306
|
+
value: null,
|
|
6307
|
+
onChange: () => {
|
|
6308
|
+
},
|
|
6309
|
+
disabled: true,
|
|
6310
|
+
rightSection: warnIcon,
|
|
6311
|
+
style,
|
|
6312
|
+
styles: notConfiguredStyles
|
|
6313
|
+
}
|
|
6314
|
+
);
|
|
6287
6315
|
}
|
|
6288
6316
|
const data = (roles ?? []).map((r) => ({
|
|
6289
6317
|
value: r.id,
|
|
@@ -6298,9 +6326,16 @@ function DiscordRoleSelect(props) {
|
|
|
6298
6326
|
{
|
|
6299
6327
|
size: "xs",
|
|
6300
6328
|
variant: "subtle",
|
|
6301
|
-
|
|
6302
|
-
|
|
6329
|
+
onMouseDown: (e) => {
|
|
6330
|
+
e.stopPropagation();
|
|
6331
|
+
},
|
|
6332
|
+
onClick: (e) => {
|
|
6333
|
+
e.stopPropagation();
|
|
6334
|
+
refresh();
|
|
6335
|
+
},
|
|
6336
|
+
title: t("Refresh", "Refresh"),
|
|
6303
6337
|
loading,
|
|
6338
|
+
"aria-label": t("Refresh", "Refresh"),
|
|
6304
6339
|
children: /* @__PURE__ */ jsx(RefreshCw, { size: "1.2vh" })
|
|
6305
6340
|
}
|
|
6306
6341
|
);
|
|
@@ -6310,7 +6345,7 @@ function DiscordRoleSelect(props) {
|
|
|
6310
6345
|
{
|
|
6311
6346
|
label,
|
|
6312
6347
|
size,
|
|
6313
|
-
placeholder: placeholder ||
|
|
6348
|
+
placeholder: placeholder || t("PickRoles", "Pick roles..."),
|
|
6314
6349
|
data,
|
|
6315
6350
|
value: props.value || [],
|
|
6316
6351
|
onChange: (ids) => props.onChange(ids),
|
|
@@ -6319,9 +6354,10 @@ function DiscordRoleSelect(props) {
|
|
|
6319
6354
|
clearable: true,
|
|
6320
6355
|
disabled: disabled || loading && !roles,
|
|
6321
6356
|
rightSection: refreshButton,
|
|
6357
|
+
rightSectionPointerEvents: "all",
|
|
6322
6358
|
style,
|
|
6323
6359
|
styles,
|
|
6324
|
-
nothingFoundMessage: errorCode ? `${
|
|
6360
|
+
nothingFoundMessage: errorCode ? `${t("Error", "Error")} (${errorCode})` : t("NoRoles", "No roles found")
|
|
6325
6361
|
}
|
|
6326
6362
|
);
|
|
6327
6363
|
}
|
|
@@ -6330,7 +6366,7 @@ function DiscordRoleSelect(props) {
|
|
|
6330
6366
|
{
|
|
6331
6367
|
label,
|
|
6332
6368
|
size,
|
|
6333
|
-
placeholder: placeholder ||
|
|
6369
|
+
placeholder: placeholder || t("PickRole", "Pick a role..."),
|
|
6334
6370
|
data,
|
|
6335
6371
|
value: props.value || null,
|
|
6336
6372
|
onChange: (id) => props.onChange(id),
|
|
@@ -6339,9 +6375,10 @@ function DiscordRoleSelect(props) {
|
|
|
6339
6375
|
clearable: true,
|
|
6340
6376
|
disabled: disabled || loading && !roles,
|
|
6341
6377
|
rightSection: refreshButton,
|
|
6378
|
+
rightSectionPointerEvents: "all",
|
|
6342
6379
|
style,
|
|
6343
6380
|
styles,
|
|
6344
|
-
nothingFoundMessage: errorCode ? `${
|
|
6381
|
+
nothingFoundMessage: errorCode ? `${t("Error", "Error")} (${errorCode})` : t("NoRoles", "No roles found")
|
|
6345
6382
|
}
|
|
6346
6383
|
);
|
|
6347
6384
|
}
|