@refraction-ui/react 0.2.1 → 0.3.1
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.cjs +21 -489
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -483
- package/dist/index.js.map +1 -1
- package/package.json +17 -18
package/dist/index.cjs
CHANGED
|
@@ -64,23 +64,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
64
64
|
|
|
65
65
|
// ../react-file-tree/dist/index.js
|
|
66
66
|
var require_dist = __commonJS({
|
|
67
|
-
"../react-file-tree/dist/index.js"(exports) {
|
|
67
|
+
"../react-file-tree/dist/index.js"(exports$1) {
|
|
68
68
|
var jsxRuntime = __require("react/jsx-runtime");
|
|
69
69
|
var FileTree = () => {
|
|
70
70
|
return /* @__PURE__ */ jsxRuntime.jsx("div", {});
|
|
71
71
|
};
|
|
72
|
-
exports.FileTree = FileTree;
|
|
72
|
+
exports$1.FileTree = FileTree;
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
// ../react-icon-system/dist/index.js
|
|
77
77
|
var require_dist2 = __commonJS({
|
|
78
|
-
"../react-icon-system/dist/index.js"(exports) {
|
|
78
|
+
"../react-icon-system/dist/index.js"(exports$1) {
|
|
79
79
|
var jsxRuntime = __require("react/jsx-runtime");
|
|
80
80
|
var IconSystem = () => {
|
|
81
81
|
return /* @__PURE__ */ jsxRuntime.jsx("div", {});
|
|
82
82
|
};
|
|
83
|
-
exports.IconSystem = IconSystem;
|
|
83
|
+
exports$1.IconSystem = IconSystem;
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
|
|
@@ -145,7 +145,6 @@ __export(index_exports, {
|
|
|
145
145
|
DialogOverlay: () => DialogOverlay,
|
|
146
146
|
DialogTitle: () => DialogTitle,
|
|
147
147
|
DialogTrigger: () => DialogTrigger,
|
|
148
|
-
DiffViewer: () => DiffViewer,
|
|
149
148
|
DropdownMenu: () => DropdownMenu,
|
|
150
149
|
DropdownMenuContent: () => DropdownMenuContent,
|
|
151
150
|
DropdownMenuItem: () => DropdownMenuItem,
|
|
@@ -268,12 +267,9 @@ __export(index_exports, {
|
|
|
268
267
|
commandVariants: () => commandVariants,
|
|
269
268
|
contentProtectionVariants: () => contentProtectionVariants,
|
|
270
269
|
controlsVariants: () => controlsVariants,
|
|
271
|
-
createDiffViewer: () => createDiffViewer,
|
|
272
270
|
dayVariants: () => dayVariants,
|
|
273
271
|
deviceFrameVariants: () => deviceFrameVariants,
|
|
274
272
|
dialogContentVariants: () => dialogContentVariants,
|
|
275
|
-
diffViewerTokens: () => diffViewerTokens,
|
|
276
|
-
diffViewerVariants: () => diffViewerVariants,
|
|
277
273
|
editorVariants: () => editorVariants,
|
|
278
274
|
emojiPickerContainerStyles: () => emojiPickerContainerStyles,
|
|
279
275
|
emojiPickerEmojiButtonStyles: () => emojiPickerEmojiButtonStyles,
|
|
@@ -346,6 +342,8 @@ __export(index_exports, {
|
|
|
346
342
|
shortcutBadgeStyles: () => shortcutBadgeStyles,
|
|
347
343
|
shortcutKeyStyles: () => shortcutKeyStyles,
|
|
348
344
|
shortcutSeparatorStyles: () => shortcutSeparatorStyles,
|
|
345
|
+
sidebarItemVariants: () => sidebarItemVariants,
|
|
346
|
+
sidebarVariants: () => sidebarVariants,
|
|
349
347
|
skeletonVariants: () => skeletonVariants,
|
|
350
348
|
slideTypeBadgeVariants: () => slideTypeBadgeVariants,
|
|
351
349
|
slideViewerProgressBarVariants: () => progressBarVariants2,
|
|
@@ -353,7 +351,6 @@ __export(index_exports, {
|
|
|
353
351
|
slideViewerVariants: () => slideViewerVariants,
|
|
354
352
|
statCardVariants: () => statCardVariants,
|
|
355
353
|
statsGridVariants: () => statsGridVariants,
|
|
356
|
-
statusBarVariants: () => statusBarVariants,
|
|
357
354
|
statusContainerStyles: () => statusContainerStyles,
|
|
358
355
|
statusDotVariants: () => statusDotVariants,
|
|
359
356
|
statusLabelStyles: () => statusLabelStyles,
|
|
@@ -361,8 +358,6 @@ __export(index_exports, {
|
|
|
361
358
|
switchThumbVariants: () => switchThumbVariants,
|
|
362
359
|
switchTokens: () => switchTokens,
|
|
363
360
|
switchVariants: () => switchVariants,
|
|
364
|
-
tabBarVariants: () => tabBarVariants,
|
|
365
|
-
tabVariants: () => tabVariants,
|
|
366
361
|
tableVariants: () => tableVariants,
|
|
367
362
|
tabsListVariants: () => tabsListVariants,
|
|
368
363
|
tabsTriggerVariants: () => tabsTriggerVariants,
|
|
@@ -891,7 +886,7 @@ AccordionContent.displayName = "AccordionContent";
|
|
|
891
886
|
|
|
892
887
|
// ../animated-text/dist/index.js
|
|
893
888
|
function createAnimatedText(props) {
|
|
894
|
-
const { words} = props;
|
|
889
|
+
const { words } = props;
|
|
895
890
|
const state = {
|
|
896
891
|
currentIndex: 0
|
|
897
892
|
};
|
|
@@ -910,7 +905,7 @@ function createAnimatedText(props) {
|
|
|
910
905
|
};
|
|
911
906
|
}
|
|
912
907
|
function createTypewriter(props) {
|
|
913
|
-
const { text} = props;
|
|
908
|
+
const { text } = props;
|
|
914
909
|
const state = {
|
|
915
910
|
currentIndex: 0
|
|
916
911
|
};
|
|
@@ -1167,7 +1162,7 @@ var AuthContext = React41__namespace.createContext(null);
|
|
|
1167
1162
|
function AuthProvider({ children, ...config }) {
|
|
1168
1163
|
const authRef = React41__namespace.useRef(null);
|
|
1169
1164
|
if (!authRef.current) {
|
|
1170
|
-
if (!config.adapter) {
|
|
1165
|
+
if (!config.adapter && !config.testMode) {
|
|
1171
1166
|
throw new Error("[refraction-ui/react-auth] You must provide an `adapter` to AuthProvider.");
|
|
1172
1167
|
}
|
|
1173
1168
|
authRef.current = createAuth(config.adapter, config);
|
|
@@ -1420,7 +1415,7 @@ Breadcrumbs.displayName = "Breadcrumbs";
|
|
|
1420
1415
|
|
|
1421
1416
|
// ../button/dist/index.js
|
|
1422
1417
|
function createButton(props = {}) {
|
|
1423
|
-
const { disabled = false, loading = false
|
|
1418
|
+
const { disabled = false, loading = false } = props;
|
|
1424
1419
|
const isInteractive = !disabled && !loading;
|
|
1425
1420
|
const ariaProps = {};
|
|
1426
1421
|
if (disabled) {
|
|
@@ -4541,13 +4536,13 @@ function extractComponents(content, components) {
|
|
|
4541
4536
|
if (!components) return [];
|
|
4542
4537
|
const extracted = [];
|
|
4543
4538
|
for (const [name, def] of Object.entries(components)) {
|
|
4544
|
-
const matches = content.matchAll(def.pattern);
|
|
4545
|
-
|
|
4539
|
+
const matches = Array.from(content.matchAll(def.pattern));
|
|
4540
|
+
matches.forEach(() => {
|
|
4546
4541
|
extracted.push({
|
|
4547
4542
|
name,
|
|
4548
4543
|
props: { ...def.props }
|
|
4549
4544
|
});
|
|
4550
|
-
}
|
|
4545
|
+
});
|
|
4551
4546
|
}
|
|
4552
4547
|
return extracted;
|
|
4553
4548
|
}
|
|
@@ -4811,7 +4806,7 @@ MobileNavLink.displayName = "MobileNavLink";
|
|
|
4811
4806
|
|
|
4812
4807
|
// ../navbar/dist/index.js
|
|
4813
4808
|
function createNavbar(props = {}) {
|
|
4814
|
-
const {
|
|
4809
|
+
const { currentPath = "/" } = props;
|
|
4815
4810
|
function isActive(href) {
|
|
4816
4811
|
if (href === "/") return currentPath === "/";
|
|
4817
4812
|
return currentPath.startsWith(href);
|
|
@@ -4862,7 +4857,7 @@ var Navbar = React41__namespace.forwardRef(
|
|
|
4862
4857
|
className,
|
|
4863
4858
|
...props
|
|
4864
4859
|
}, ref) => {
|
|
4865
|
-
const api = createNavbar({
|
|
4860
|
+
const api = createNavbar({ currentPath});
|
|
4866
4861
|
const classes = cn(navbarVariants({ variant }), className);
|
|
4867
4862
|
return /* @__PURE__ */ jsxRuntime.jsx("header", { ref, className: classes, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4868
4863
|
"nav",
|
|
@@ -7357,7 +7352,7 @@ function createResizableLayout(props = {}) {
|
|
|
7357
7352
|
maxSizes = [],
|
|
7358
7353
|
persistKey
|
|
7359
7354
|
} = props;
|
|
7360
|
-
|
|
7355
|
+
const sizes = loadSizes(persistKey) ?? [...defaultSizes];
|
|
7361
7356
|
let resizingIndex = null;
|
|
7362
7357
|
let sizesBeforeResize = [];
|
|
7363
7358
|
function loadSizes(key) {
|
|
@@ -9210,464 +9205,6 @@ function DatePicker({
|
|
|
9210
9205
|
}
|
|
9211
9206
|
DatePicker.displayName = "DatePicker";
|
|
9212
9207
|
|
|
9213
|
-
// ../diff-viewer/dist/index.js
|
|
9214
|
-
var extToLanguage = {
|
|
9215
|
-
ts: "typescript",
|
|
9216
|
-
tsx: "typescript",
|
|
9217
|
-
js: "javascript",
|
|
9218
|
-
jsx: "javascript",
|
|
9219
|
-
py: "python",
|
|
9220
|
-
go: "go",
|
|
9221
|
-
rs: "rust",
|
|
9222
|
-
rb: "ruby",
|
|
9223
|
-
java: "java",
|
|
9224
|
-
swift: "swift",
|
|
9225
|
-
kt: "kotlin",
|
|
9226
|
-
dart: "dart",
|
|
9227
|
-
php: "php",
|
|
9228
|
-
lua: "lua",
|
|
9229
|
-
r: "r",
|
|
9230
|
-
scala: "scala",
|
|
9231
|
-
json: "json",
|
|
9232
|
-
yaml: "yaml",
|
|
9233
|
-
yml: "yaml",
|
|
9234
|
-
md: "markdown",
|
|
9235
|
-
html: "html",
|
|
9236
|
-
css: "css",
|
|
9237
|
-
scss: "scss",
|
|
9238
|
-
sql: "sql",
|
|
9239
|
-
sh: "shell",
|
|
9240
|
-
bash: "shell",
|
|
9241
|
-
zsh: "shell",
|
|
9242
|
-
xml: "xml",
|
|
9243
|
-
toml: "toml",
|
|
9244
|
-
proto: "protobuf",
|
|
9245
|
-
dockerfile: "dockerfile",
|
|
9246
|
-
cpp: "cpp",
|
|
9247
|
-
c: "c"
|
|
9248
|
-
};
|
|
9249
|
-
function getLanguageForFile(filePath) {
|
|
9250
|
-
const ext = filePath.split(".").pop()?.toLowerCase() || "";
|
|
9251
|
-
const basename = filePath.split("/").pop()?.toLowerCase() || "";
|
|
9252
|
-
if (basename === "dockerfile") return "dockerfile";
|
|
9253
|
-
return extToLanguage[ext] || "plaintext";
|
|
9254
|
-
}
|
|
9255
|
-
var statusIcons = {
|
|
9256
|
-
added: "\u{1F7E2}",
|
|
9257
|
-
// green circle
|
|
9258
|
-
modified: "\u{1F7E1}",
|
|
9259
|
-
// yellow circle
|
|
9260
|
-
deleted: "\u{1F534}",
|
|
9261
|
-
// red circle
|
|
9262
|
-
renamed: "\u{1F535}"
|
|
9263
|
-
// blue circle
|
|
9264
|
-
};
|
|
9265
|
-
function createDiffViewer(props = {}) {
|
|
9266
|
-
const {
|
|
9267
|
-
files = [],
|
|
9268
|
-
activeFileIndex = 0,
|
|
9269
|
-
viewMode = "side-by-side",
|
|
9270
|
-
theme = "dark",
|
|
9271
|
-
language,
|
|
9272
|
-
sidebarOpen = true,
|
|
9273
|
-
onFileSelect,
|
|
9274
|
-
onViewModeChange,
|
|
9275
|
-
onSidebarToggle
|
|
9276
|
-
} = props;
|
|
9277
|
-
let currentIndex = Math.min(activeFileIndex, Math.max(0, files.length - 1));
|
|
9278
|
-
let currentViewMode = viewMode;
|
|
9279
|
-
let currentSidebarOpen = sidebarOpen;
|
|
9280
|
-
const state = {
|
|
9281
|
-
activeFileIndex: currentIndex,
|
|
9282
|
-
viewMode: currentViewMode,
|
|
9283
|
-
theme,
|
|
9284
|
-
language: language || (files[currentIndex] ? getLanguageForFile(files[currentIndex].path) : "plaintext"),
|
|
9285
|
-
sidebarOpen: currentSidebarOpen,
|
|
9286
|
-
files
|
|
9287
|
-
};
|
|
9288
|
-
const ariaProps = {
|
|
9289
|
-
role: "region",
|
|
9290
|
-
"aria-label": "Diff viewer"
|
|
9291
|
-
};
|
|
9292
|
-
const dataAttributes = {
|
|
9293
|
-
"data-view-mode": currentViewMode,
|
|
9294
|
-
"data-theme": theme,
|
|
9295
|
-
"data-file-count": String(files.length)
|
|
9296
|
-
};
|
|
9297
|
-
if (!currentSidebarOpen) {
|
|
9298
|
-
dataAttributes["data-sidebar-collapsed"] = "";
|
|
9299
|
-
}
|
|
9300
|
-
function selectFile(index) {
|
|
9301
|
-
if (index >= 0 && index < files.length) {
|
|
9302
|
-
currentIndex = index;
|
|
9303
|
-
state.activeFileIndex = index;
|
|
9304
|
-
state.language = language || getLanguageForFile(files[index].path);
|
|
9305
|
-
onFileSelect?.(index);
|
|
9306
|
-
}
|
|
9307
|
-
}
|
|
9308
|
-
function nextFile() {
|
|
9309
|
-
if (currentIndex < files.length - 1) {
|
|
9310
|
-
selectFile(currentIndex + 1);
|
|
9311
|
-
}
|
|
9312
|
-
}
|
|
9313
|
-
function prevFile() {
|
|
9314
|
-
if (currentIndex > 0) {
|
|
9315
|
-
selectFile(currentIndex - 1);
|
|
9316
|
-
}
|
|
9317
|
-
}
|
|
9318
|
-
function toggleViewMode() {
|
|
9319
|
-
currentViewMode = currentViewMode === "side-by-side" ? "inline" : "side-by-side";
|
|
9320
|
-
state.viewMode = currentViewMode;
|
|
9321
|
-
dataAttributes["data-view-mode"] = currentViewMode;
|
|
9322
|
-
onViewModeChange?.(currentViewMode);
|
|
9323
|
-
}
|
|
9324
|
-
function toggleSidebar() {
|
|
9325
|
-
currentSidebarOpen = !currentSidebarOpen;
|
|
9326
|
-
state.sidebarOpen = currentSidebarOpen;
|
|
9327
|
-
if (currentSidebarOpen) {
|
|
9328
|
-
delete dataAttributes["data-sidebar-collapsed"];
|
|
9329
|
-
} else {
|
|
9330
|
-
dataAttributes["data-sidebar-collapsed"] = "";
|
|
9331
|
-
}
|
|
9332
|
-
onSidebarToggle?.();
|
|
9333
|
-
}
|
|
9334
|
-
function totalAdditions() {
|
|
9335
|
-
return files.reduce((sum, f) => sum + f.additions, 0);
|
|
9336
|
-
}
|
|
9337
|
-
function totalDeletions() {
|
|
9338
|
-
return files.reduce((sum, f) => sum + f.deletions, 0);
|
|
9339
|
-
}
|
|
9340
|
-
return {
|
|
9341
|
-
state,
|
|
9342
|
-
ariaProps,
|
|
9343
|
-
dataAttributes,
|
|
9344
|
-
selectFile,
|
|
9345
|
-
nextFile,
|
|
9346
|
-
prevFile,
|
|
9347
|
-
toggleViewMode,
|
|
9348
|
-
toggleSidebar,
|
|
9349
|
-
getLanguageForFile,
|
|
9350
|
-
getFileStatusIcon: (status) => statusIcons[status] || "\u26AA",
|
|
9351
|
-
totalAdditions,
|
|
9352
|
-
totalDeletions
|
|
9353
|
-
};
|
|
9354
|
-
}
|
|
9355
|
-
var diffViewerTokens = {
|
|
9356
|
-
name: "diff-viewer",
|
|
9357
|
-
tokens: {
|
|
9358
|
-
bg: { variable: "--rfr-diff-bg", fallback: "hsl(var(--background))" },
|
|
9359
|
-
fg: { variable: "--rfr-diff-fg", fallback: "hsl(var(--foreground))" },
|
|
9360
|
-
sidebarBg: { variable: "--rfr-diff-sidebar-bg", fallback: "hsl(var(--muted))" },
|
|
9361
|
-
headerBg: { variable: "--rfr-diff-header-bg", fallback: "hsl(var(--muted))" },
|
|
9362
|
-
border: { variable: "--rfr-diff-border", fallback: "hsl(var(--border))" },
|
|
9363
|
-
addBg: { variable: "--rfr-diff-add-bg", fallback: "rgba(46, 160, 67, 0.15)" },
|
|
9364
|
-
delBg: { variable: "--rfr-diff-del-bg", fallback: "rgba(248, 81, 73, 0.15)" },
|
|
9365
|
-
addFg: { variable: "--rfr-diff-add-fg", fallback: "#3fb950" },
|
|
9366
|
-
delFg: { variable: "--rfr-diff-del-fg", fallback: "#f85149" },
|
|
9367
|
-
statusbar: { variable: "--rfr-diff-statusbar", fallback: "hsl(var(--primary))" },
|
|
9368
|
-
statusbarFg: { variable: "--rfr-diff-statusbar-fg", fallback: "hsl(var(--primary-foreground))" }
|
|
9369
|
-
}
|
|
9370
|
-
};
|
|
9371
|
-
var diffViewerVariants = cva({
|
|
9372
|
-
base: "flex flex-col overflow-hidden font-sans text-sm",
|
|
9373
|
-
variants: {
|
|
9374
|
-
theme: {
|
|
9375
|
-
light: "bg-white text-gray-900",
|
|
9376
|
-
dark: "bg-gray-950 text-gray-100"
|
|
9377
|
-
},
|
|
9378
|
-
fullscreen: {
|
|
9379
|
-
"true": "h-screen",
|
|
9380
|
-
"false": ""
|
|
9381
|
-
}
|
|
9382
|
-
},
|
|
9383
|
-
defaultVariants: {
|
|
9384
|
-
theme: "dark",
|
|
9385
|
-
fullscreen: "true"
|
|
9386
|
-
}
|
|
9387
|
-
});
|
|
9388
|
-
var sidebarVariants2 = cva({
|
|
9389
|
-
base: "border-r overflow-auto flex-shrink-0",
|
|
9390
|
-
variants: {
|
|
9391
|
-
theme: {
|
|
9392
|
-
light: "bg-gray-50 border-gray-200",
|
|
9393
|
-
dark: "bg-gray-900 border-gray-800"
|
|
9394
|
-
}
|
|
9395
|
-
},
|
|
9396
|
-
defaultVariants: {
|
|
9397
|
-
theme: "dark"
|
|
9398
|
-
}
|
|
9399
|
-
});
|
|
9400
|
-
var sidebarItemVariants2 = cva({
|
|
9401
|
-
base: "px-2.5 py-1 cursor-pointer text-xs font-mono transition-colors",
|
|
9402
|
-
variants: {
|
|
9403
|
-
active: {
|
|
9404
|
-
"true": "border-l-2 border-blue-500",
|
|
9405
|
-
"false": "border-l-2 border-transparent"
|
|
9406
|
-
},
|
|
9407
|
-
theme: {
|
|
9408
|
-
light: "",
|
|
9409
|
-
dark: ""
|
|
9410
|
-
}
|
|
9411
|
-
},
|
|
9412
|
-
compoundVariants: [
|
|
9413
|
-
{ active: "true", theme: "dark", class: "bg-gray-800 text-gray-100" },
|
|
9414
|
-
{ active: "false", theme: "dark", class: "text-gray-400 hover:bg-gray-800/50" },
|
|
9415
|
-
{ active: "true", theme: "light", class: "bg-blue-50 text-gray-900" },
|
|
9416
|
-
{ active: "false", theme: "light", class: "text-gray-600 hover:bg-gray-100" }
|
|
9417
|
-
],
|
|
9418
|
-
defaultVariants: {
|
|
9419
|
-
active: "false",
|
|
9420
|
-
theme: "dark"
|
|
9421
|
-
}
|
|
9422
|
-
});
|
|
9423
|
-
var tabBarVariants = cva({
|
|
9424
|
-
base: "flex items-center border-b overflow-auto flex-shrink-0",
|
|
9425
|
-
variants: {
|
|
9426
|
-
theme: {
|
|
9427
|
-
light: "bg-gray-50 border-gray-200",
|
|
9428
|
-
dark: "bg-gray-900 border-gray-800"
|
|
9429
|
-
}
|
|
9430
|
-
},
|
|
9431
|
-
defaultVariants: {
|
|
9432
|
-
theme: "dark"
|
|
9433
|
-
}
|
|
9434
|
-
});
|
|
9435
|
-
var tabVariants = cva({
|
|
9436
|
-
base: "px-3 h-[35px] flex items-center gap-1 cursor-pointer text-xs font-mono border-r shrink-0",
|
|
9437
|
-
variants: {
|
|
9438
|
-
active: {
|
|
9439
|
-
"true": "",
|
|
9440
|
-
"false": ""
|
|
9441
|
-
},
|
|
9442
|
-
theme: {
|
|
9443
|
-
light: "border-gray-200",
|
|
9444
|
-
dark: "border-gray-800"
|
|
9445
|
-
}
|
|
9446
|
-
},
|
|
9447
|
-
compoundVariants: [
|
|
9448
|
-
{ active: "true", theme: "dark", class: "bg-gray-950 text-gray-100 border-b-gray-950 -mb-px" },
|
|
9449
|
-
{ active: "false", theme: "dark", class: "text-gray-400" },
|
|
9450
|
-
{ active: "true", theme: "light", class: "bg-white text-gray-900 border-b-white -mb-px" },
|
|
9451
|
-
{ active: "false", theme: "light", class: "text-gray-500" }
|
|
9452
|
-
],
|
|
9453
|
-
defaultVariants: {
|
|
9454
|
-
active: "false",
|
|
9455
|
-
theme: "dark"
|
|
9456
|
-
}
|
|
9457
|
-
});
|
|
9458
|
-
var statusBarVariants = cva({
|
|
9459
|
-
base: "h-[22px] flex items-center px-2.5 gap-3 text-[11px] font-mono flex-shrink-0",
|
|
9460
|
-
variants: {
|
|
9461
|
-
theme: {
|
|
9462
|
-
light: "bg-blue-600 text-white",
|
|
9463
|
-
dark: "bg-blue-700 text-white"
|
|
9464
|
-
}
|
|
9465
|
-
},
|
|
9466
|
-
defaultVariants: {
|
|
9467
|
-
theme: "dark"
|
|
9468
|
-
}
|
|
9469
|
-
});
|
|
9470
|
-
var MonacoDiffEditor = React41__namespace.lazy(
|
|
9471
|
-
() => import('@monaco-editor/react').then((m) => ({ default: m.DiffEditor }))
|
|
9472
|
-
);
|
|
9473
|
-
var DiffViewer = React41__namespace.forwardRef(
|
|
9474
|
-
({
|
|
9475
|
-
files,
|
|
9476
|
-
original = "",
|
|
9477
|
-
modified = "",
|
|
9478
|
-
language,
|
|
9479
|
-
monacoTheme = "vs-dark",
|
|
9480
|
-
theme = "dark",
|
|
9481
|
-
viewMode: controlledViewMode = "side-by-side",
|
|
9482
|
-
showSidebar = true,
|
|
9483
|
-
showTabs = true,
|
|
9484
|
-
showStatusBar = true,
|
|
9485
|
-
sidebarWidth = 220,
|
|
9486
|
-
activeFileIndex: controlledIndex = 0,
|
|
9487
|
-
onFileSelect,
|
|
9488
|
-
onViewModeChange,
|
|
9489
|
-
statusBarTitle,
|
|
9490
|
-
statusBarStatus,
|
|
9491
|
-
className,
|
|
9492
|
-
editorOptions
|
|
9493
|
-
}, ref) => {
|
|
9494
|
-
const [activeIdx, setActiveIdx] = React41__namespace.useState(controlledIndex);
|
|
9495
|
-
const [sidebarOpen, setSidebarOpen] = React41__namespace.useState(showSidebar);
|
|
9496
|
-
const [viewMode, setViewMode] = React41__namespace.useState(controlledViewMode);
|
|
9497
|
-
React41__namespace.useEffect(() => setActiveIdx(controlledIndex), [controlledIndex]);
|
|
9498
|
-
React41__namespace.useEffect(() => setViewMode(controlledViewMode), [controlledViewMode]);
|
|
9499
|
-
const api = React41__namespace.useMemo(
|
|
9500
|
-
() => createDiffViewer({
|
|
9501
|
-
files,
|
|
9502
|
-
activeFileIndex: activeIdx,
|
|
9503
|
-
viewMode,
|
|
9504
|
-
theme,
|
|
9505
|
-
language,
|
|
9506
|
-
sidebarOpen,
|
|
9507
|
-
onFileSelect: (i) => {
|
|
9508
|
-
setActiveIdx(i);
|
|
9509
|
-
onFileSelect?.(i);
|
|
9510
|
-
},
|
|
9511
|
-
onViewModeChange: (m) => {
|
|
9512
|
-
setViewMode(m);
|
|
9513
|
-
onViewModeChange?.(m);
|
|
9514
|
-
},
|
|
9515
|
-
onSidebarToggle: () => setSidebarOpen((s) => !s)
|
|
9516
|
-
}),
|
|
9517
|
-
[files, activeIdx, viewMode, theme, language, sidebarOpen, onFileSelect, onViewModeChange]
|
|
9518
|
-
);
|
|
9519
|
-
const activeFile = files[activeIdx];
|
|
9520
|
-
const detectedLang = language || (activeFile ? api.getLanguageForFile(activeFile.path) : "plaintext");
|
|
9521
|
-
React41__namespace.useEffect(() => {
|
|
9522
|
-
function onKey(e) {
|
|
9523
|
-
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
|
|
9524
|
-
if (e.key === "j") {
|
|
9525
|
-
setActiveIdx((i) => {
|
|
9526
|
-
const next = Math.min(i + 1, files.length - 1);
|
|
9527
|
-
onFileSelect?.(next);
|
|
9528
|
-
return next;
|
|
9529
|
-
});
|
|
9530
|
-
} else if (e.key === "k") {
|
|
9531
|
-
setActiveIdx((i) => {
|
|
9532
|
-
const prev = Math.max(i - 1, 0);
|
|
9533
|
-
onFileSelect?.(prev);
|
|
9534
|
-
return prev;
|
|
9535
|
-
});
|
|
9536
|
-
} else if (e.key === "b") {
|
|
9537
|
-
setSidebarOpen((s) => !s);
|
|
9538
|
-
}
|
|
9539
|
-
}
|
|
9540
|
-
window.addEventListener("keydown", onKey);
|
|
9541
|
-
return () => window.removeEventListener("keydown", onKey);
|
|
9542
|
-
}, [files.length, onFileSelect]);
|
|
9543
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9544
|
-
"div",
|
|
9545
|
-
{
|
|
9546
|
-
ref,
|
|
9547
|
-
className: cn(diffViewerVariants({ theme, fullscreen: "true" }), className),
|
|
9548
|
-
...api.ariaProps,
|
|
9549
|
-
...api.dataAttributes,
|
|
9550
|
-
children: [
|
|
9551
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, display: "flex", overflow: "hidden" }, children: [
|
|
9552
|
-
sidebarOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: sidebarVariants2({ theme }), style: { width: sidebarWidth }, children: [
|
|
9553
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-2.5 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: [
|
|
9554
|
-
"Files (",
|
|
9555
|
-
files.length,
|
|
9556
|
-
")"
|
|
9557
|
-
] }),
|
|
9558
|
-
files.map((f, i) => {
|
|
9559
|
-
const active = i === activeIdx;
|
|
9560
|
-
const fname = f.path.split("/").pop() || f.path;
|
|
9561
|
-
const dir = f.path.split("/").slice(0, -1).join("/");
|
|
9562
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9563
|
-
"div",
|
|
9564
|
-
{
|
|
9565
|
-
onClick: () => {
|
|
9566
|
-
setActiveIdx(i);
|
|
9567
|
-
onFileSelect?.(i);
|
|
9568
|
-
},
|
|
9569
|
-
className: sidebarItemVariants2({ active: active ? "true" : "false", theme }),
|
|
9570
|
-
children: [
|
|
9571
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
9572
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px]", children: api.getFileStatusIcon(f.status) }),
|
|
9573
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: active ? "" : "opacity-70", children: fname }),
|
|
9574
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ml-auto text-[10px]", children: [
|
|
9575
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-green-500", children: [
|
|
9576
|
-
"+",
|
|
9577
|
-
f.additions
|
|
9578
|
-
] }),
|
|
9579
|
-
f.deletions > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-red-500", children: [
|
|
9580
|
-
"-",
|
|
9581
|
-
f.deletions
|
|
9582
|
-
] })
|
|
9583
|
-
] })
|
|
9584
|
-
] }),
|
|
9585
|
-
dir && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] opacity-50 mt-0.5 pl-4", children: dir })
|
|
9586
|
-
]
|
|
9587
|
-
},
|
|
9588
|
-
f.path
|
|
9589
|
-
);
|
|
9590
|
-
})
|
|
9591
|
-
] }),
|
|
9592
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
|
|
9593
|
-
showTabs && activeFile && /* @__PURE__ */ jsxRuntime.jsx("div", { className: tabBarVariants({ theme }), children: files.map((f, i) => {
|
|
9594
|
-
const active = i === activeIdx;
|
|
9595
|
-
const fname = f.path.split("/").pop() || f.path;
|
|
9596
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9597
|
-
"div",
|
|
9598
|
-
{
|
|
9599
|
-
onClick: () => {
|
|
9600
|
-
setActiveIdx(i);
|
|
9601
|
-
onFileSelect?.(i);
|
|
9602
|
-
},
|
|
9603
|
-
className: tabVariants({ active: active ? "true" : "false", theme }),
|
|
9604
|
-
children: [
|
|
9605
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[9px]", children: api.getFileStatusIcon(f.status) }),
|
|
9606
|
-
fname
|
|
9607
|
-
]
|
|
9608
|
-
},
|
|
9609
|
-
f.path
|
|
9610
|
-
);
|
|
9611
|
-
}) }),
|
|
9612
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9613
|
-
React41__namespace.Suspense,
|
|
9614
|
-
{
|
|
9615
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-full text-xs opacity-50", children: "Loading editor..." }),
|
|
9616
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9617
|
-
MonacoDiffEditor,
|
|
9618
|
-
{
|
|
9619
|
-
original,
|
|
9620
|
-
modified,
|
|
9621
|
-
language: detectedLang,
|
|
9622
|
-
theme: monacoTheme,
|
|
9623
|
-
options: {
|
|
9624
|
-
readOnly: true,
|
|
9625
|
-
renderSideBySide: viewMode === "side-by-side",
|
|
9626
|
-
minimap: { enabled: true, scale: 1, showSlider: "mouseover" },
|
|
9627
|
-
fontSize: 13,
|
|
9628
|
-
lineHeight: 20,
|
|
9629
|
-
fontFamily: "'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",
|
|
9630
|
-
fontLigatures: true,
|
|
9631
|
-
scrollBeyondLastLine: false,
|
|
9632
|
-
renderOverviewRuler: true,
|
|
9633
|
-
scrollbar: { verticalScrollbarSize: 10, horizontalScrollbarSize: 10 },
|
|
9634
|
-
padding: { top: 8, bottom: 8 },
|
|
9635
|
-
renderWhitespace: "selection",
|
|
9636
|
-
bracketPairColorization: { enabled: true },
|
|
9637
|
-
guides: { indentation: true },
|
|
9638
|
-
smoothScrolling: true,
|
|
9639
|
-
cursorBlinking: "smooth",
|
|
9640
|
-
...editorOptions
|
|
9641
|
-
}
|
|
9642
|
-
}
|
|
9643
|
-
)
|
|
9644
|
-
}
|
|
9645
|
-
) })
|
|
9646
|
-
] })
|
|
9647
|
-
] }),
|
|
9648
|
-
showStatusBar && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: statusBarVariants({ theme }), children: [
|
|
9649
|
-
statusBarTitle && /* @__PURE__ */ jsxRuntime.jsx("span", { children: statusBarTitle }),
|
|
9650
|
-
activeFile && /* @__PURE__ */ jsxRuntime.jsx("span", { children: activeFile.path }),
|
|
9651
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { marginLeft: "auto" }, children: [
|
|
9652
|
-
"+",
|
|
9653
|
-
api.totalAdditions(),
|
|
9654
|
-
" -",
|
|
9655
|
-
api.totalDeletions()
|
|
9656
|
-
] }),
|
|
9657
|
-
statusBarStatus && /* @__PURE__ */ jsxRuntime.jsx("span", { children: statusBarStatus }),
|
|
9658
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
9659
|
-
files.length,
|
|
9660
|
-
" ",
|
|
9661
|
-
files.length === 1 ? "file" : "files"
|
|
9662
|
-
] })
|
|
9663
|
-
] })
|
|
9664
|
-
]
|
|
9665
|
-
}
|
|
9666
|
-
);
|
|
9667
|
-
}
|
|
9668
|
-
);
|
|
9669
|
-
DiffViewer.displayName = "DiffViewer";
|
|
9670
|
-
|
|
9671
9208
|
// ../emoji-picker/dist/index.js
|
|
9672
9209
|
var EMOJI_DATA = {
|
|
9673
9210
|
smileys: [
|
|
@@ -11876,7 +11413,7 @@ function createThreadView(props) {
|
|
|
11876
11413
|
"aria-label": `Message from ${message.author.name}${isOwn ? " (you)" : ""} at ${formatTimestamp(message.timestamp)}`
|
|
11877
11414
|
};
|
|
11878
11415
|
}
|
|
11879
|
-
function getReplyButtonAriaProps(
|
|
11416
|
+
function getReplyButtonAriaProps(_messageId) {
|
|
11880
11417
|
return {
|
|
11881
11418
|
role: "button",
|
|
11882
11419
|
"aria-label": `Reply to message`
|
|
@@ -12216,7 +11753,7 @@ var CodeBlock = () => {
|
|
|
12216
11753
|
};
|
|
12217
11754
|
|
|
12218
11755
|
// ../link-card/dist/index.js
|
|
12219
|
-
function createLinkCard(
|
|
11756
|
+
function createLinkCard(_props = {}) {
|
|
12220
11757
|
return {
|
|
12221
11758
|
dataAttributes: { "data-slot": "link-card" }
|
|
12222
11759
|
};
|
|
@@ -12238,7 +11775,7 @@ var LinkCard = React41__namespace.forwardRef(
|
|
|
12238
11775
|
LinkCard.displayName = "LinkCard";
|
|
12239
11776
|
|
|
12240
11777
|
// ../card-grid/dist/index.js
|
|
12241
|
-
function createCardGrid(
|
|
11778
|
+
function createCardGrid(_props = {}) {
|
|
12242
11779
|
return {
|
|
12243
11780
|
dataAttributes: { "data-slot": "card-grid" }
|
|
12244
11781
|
};
|
|
@@ -12380,7 +11917,6 @@ exports.DialogHeader = DialogHeader;
|
|
|
12380
11917
|
exports.DialogOverlay = DialogOverlay;
|
|
12381
11918
|
exports.DialogTitle = DialogTitle;
|
|
12382
11919
|
exports.DialogTrigger = DialogTrigger;
|
|
12383
|
-
exports.DiffViewer = DiffViewer;
|
|
12384
11920
|
exports.DropdownMenu = DropdownMenu;
|
|
12385
11921
|
exports.DropdownMenuContent = DropdownMenuContent;
|
|
12386
11922
|
exports.DropdownMenuItem = DropdownMenuItem;
|
|
@@ -12503,12 +12039,9 @@ exports.commandItemVariants = commandItemVariants;
|
|
|
12503
12039
|
exports.commandVariants = commandVariants;
|
|
12504
12040
|
exports.contentProtectionVariants = contentProtectionVariants;
|
|
12505
12041
|
exports.controlsVariants = controlsVariants;
|
|
12506
|
-
exports.createDiffViewer = createDiffViewer;
|
|
12507
12042
|
exports.dayVariants = dayVariants;
|
|
12508
12043
|
exports.deviceFrameVariants = deviceFrameVariants;
|
|
12509
12044
|
exports.dialogContentVariants = dialogContentVariants;
|
|
12510
|
-
exports.diffViewerTokens = diffViewerTokens;
|
|
12511
|
-
exports.diffViewerVariants = diffViewerVariants;
|
|
12512
12045
|
exports.editorVariants = editorVariants;
|
|
12513
12046
|
exports.emojiPickerContainerStyles = emojiPickerContainerStyles;
|
|
12514
12047
|
exports.emojiPickerEmojiButtonStyles = emojiPickerEmojiButtonStyles;
|
|
@@ -12581,6 +12114,8 @@ exports.selectorVariants = selectorVariants;
|
|
|
12581
12114
|
exports.shortcutBadgeStyles = shortcutBadgeStyles;
|
|
12582
12115
|
exports.shortcutKeyStyles = shortcutKeyStyles;
|
|
12583
12116
|
exports.shortcutSeparatorStyles = shortcutSeparatorStyles;
|
|
12117
|
+
exports.sidebarItemVariants = sidebarItemVariants;
|
|
12118
|
+
exports.sidebarVariants = sidebarVariants;
|
|
12584
12119
|
exports.skeletonVariants = skeletonVariants;
|
|
12585
12120
|
exports.slideTypeBadgeVariants = slideTypeBadgeVariants;
|
|
12586
12121
|
exports.slideViewerProgressBarVariants = progressBarVariants2;
|
|
@@ -12588,7 +12123,6 @@ exports.slideViewerTokens = slideViewerTokens;
|
|
|
12588
12123
|
exports.slideViewerVariants = slideViewerVariants;
|
|
12589
12124
|
exports.statCardVariants = statCardVariants;
|
|
12590
12125
|
exports.statsGridVariants = statsGridVariants;
|
|
12591
|
-
exports.statusBarVariants = statusBarVariants;
|
|
12592
12126
|
exports.statusContainerStyles = statusContainerStyles;
|
|
12593
12127
|
exports.statusDotVariants = statusDotVariants;
|
|
12594
12128
|
exports.statusLabelStyles = statusLabelStyles;
|
|
@@ -12596,8 +12130,6 @@ exports.statusPulseVariants = statusPulseVariants;
|
|
|
12596
12130
|
exports.switchThumbVariants = switchThumbVariants;
|
|
12597
12131
|
exports.switchTokens = switchTokens;
|
|
12598
12132
|
exports.switchVariants = switchVariants;
|
|
12599
|
-
exports.tabBarVariants = tabBarVariants;
|
|
12600
|
-
exports.tabVariants = tabVariants;
|
|
12601
12133
|
exports.tableVariants = tableVariants;
|
|
12602
12134
|
exports.tabsListVariants = tabsListVariants;
|
|
12603
12135
|
exports.tabsTriggerVariants = tabsTriggerVariants;
|