@cloudvoyant/helical-react 0.20.1 → 0.21.0
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 +1893 -947
- package/dist/index.d.cts +102 -15
- package/dist/index.d.ts +102 -15
- package/dist/index.js +1653 -672
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -213,76 +213,333 @@ import {
|
|
|
213
213
|
windowResizeTriggerBase,
|
|
214
214
|
cn as cn6
|
|
215
215
|
} from "@cloudvoyant/helical-ui";
|
|
216
|
+
|
|
217
|
+
// src/which-key/context.tsx
|
|
218
|
+
import {
|
|
219
|
+
createContext,
|
|
220
|
+
useCallback,
|
|
221
|
+
useContext,
|
|
222
|
+
useEffect,
|
|
223
|
+
useId,
|
|
224
|
+
useRef,
|
|
225
|
+
useSyncExternalStore
|
|
226
|
+
} from "react";
|
|
227
|
+
import { useEnvironmentContext } from "@ark-ui/react/environment";
|
|
228
|
+
import { HotkeysProvider } from "@tanstack/react-hotkeys";
|
|
229
|
+
import {
|
|
230
|
+
createWhichKeyController,
|
|
231
|
+
getDocumentWhichKeyController,
|
|
232
|
+
subscribeDocumentWhichKeyController
|
|
233
|
+
} from "@cloudvoyant/helical-ui";
|
|
216
234
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
217
|
-
|
|
218
|
-
|
|
235
|
+
var WhichKeyContext = createContext(null);
|
|
236
|
+
function WhichKeyProvider({
|
|
237
|
+
preset,
|
|
238
|
+
defaultMode = "normal",
|
|
239
|
+
leaderKey = "Space",
|
|
240
|
+
jumpAction,
|
|
241
|
+
jumpAlphabet,
|
|
242
|
+
storageKey,
|
|
243
|
+
keymap,
|
|
244
|
+
commands,
|
|
245
|
+
enabled = true,
|
|
246
|
+
disableOnMobile = true,
|
|
247
|
+
scoped = true,
|
|
248
|
+
onPresetChange,
|
|
249
|
+
onModeChange,
|
|
250
|
+
onJumpActionChange,
|
|
251
|
+
onCommand,
|
|
252
|
+
onYank,
|
|
253
|
+
children
|
|
254
|
+
}) {
|
|
255
|
+
const env = useEnvironmentContext();
|
|
256
|
+
const scopeRef = useRef(null);
|
|
257
|
+
const controllerRef = useRef(null);
|
|
258
|
+
if (!controllerRef.current) {
|
|
259
|
+
controllerRef.current = createWhichKeyController({
|
|
260
|
+
preset,
|
|
261
|
+
defaultMode,
|
|
262
|
+
leaderKey,
|
|
263
|
+
jumpAction,
|
|
264
|
+
jumpAlphabet,
|
|
265
|
+
storageKey,
|
|
266
|
+
keymap,
|
|
267
|
+
commands,
|
|
268
|
+
enabled,
|
|
269
|
+
disableOnMobile,
|
|
270
|
+
getDocument: () => env.getDocument(),
|
|
271
|
+
getScopeElement: () => scoped ? scopeRef.current : null,
|
|
272
|
+
onPresetChange,
|
|
273
|
+
onModeChange,
|
|
274
|
+
onJumpActionChange,
|
|
275
|
+
onCommand,
|
|
276
|
+
onYank
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
const controller = controllerRef.current;
|
|
280
|
+
useEffect(() => {
|
|
281
|
+
if (preset !== void 0) {
|
|
282
|
+
controller.setPreset(preset);
|
|
283
|
+
}
|
|
284
|
+
}, [controller, preset]);
|
|
285
|
+
useEffect(() => {
|
|
286
|
+
if (jumpAction !== void 0) {
|
|
287
|
+
controller.setJumpAction(jumpAction);
|
|
288
|
+
}
|
|
289
|
+
}, [controller, jumpAction]);
|
|
290
|
+
useEffect(() => {
|
|
291
|
+
if (!enabled) return;
|
|
292
|
+
const doc = env.getDocument();
|
|
293
|
+
return controller.attach(doc);
|
|
294
|
+
}, [controller, enabled, env]);
|
|
295
|
+
useEffect(() => {
|
|
296
|
+
if (!keymap) return;
|
|
297
|
+
return controller.registerKeymap("__provider_keymap__", keymap, {
|
|
298
|
+
enabled: true
|
|
299
|
+
});
|
|
300
|
+
}, [controller, keymap]);
|
|
301
|
+
useEffect(() => {
|
|
302
|
+
if (!commands) return;
|
|
303
|
+
const cleanups = Object.entries(commands).map(
|
|
304
|
+
([cmdId, handler]) => controller.registerCommand(cmdId, handler)
|
|
305
|
+
);
|
|
306
|
+
return () => {
|
|
307
|
+
cleanups.forEach((fn) => fn());
|
|
308
|
+
};
|
|
309
|
+
}, [controller, commands]);
|
|
310
|
+
return /* @__PURE__ */ jsx6(HotkeysProvider, { children: /* @__PURE__ */ jsx6(WhichKeyContext.Provider, { value: controller, children: scoped ? /* @__PURE__ */ jsx6("div", { ref: scopeRef, "data-which-key-scope": true, className: "contents", children }) : children }) });
|
|
311
|
+
}
|
|
312
|
+
function useOptionalWhichKeyController() {
|
|
313
|
+
const contextController = useContext(WhichKeyContext);
|
|
314
|
+
const docController = useSyncExternalStore(
|
|
315
|
+
(listener) => contextController ? () => {
|
|
316
|
+
} : subscribeDocumentWhichKeyController(
|
|
317
|
+
typeof document !== "undefined" ? document : void 0,
|
|
318
|
+
listener
|
|
319
|
+
),
|
|
320
|
+
() => contextController ? null : getDocumentWhichKeyController(),
|
|
321
|
+
() => null
|
|
322
|
+
);
|
|
323
|
+
return contextController ?? docController;
|
|
324
|
+
}
|
|
325
|
+
function useWhichKeyController() {
|
|
326
|
+
const controller = useOptionalWhichKeyController();
|
|
327
|
+
const fallbackRef = useRef(null);
|
|
328
|
+
if (controller) return controller;
|
|
329
|
+
if (!fallbackRef.current) {
|
|
330
|
+
fallbackRef.current = createWhichKeyController();
|
|
331
|
+
}
|
|
332
|
+
return fallbackRef.current;
|
|
333
|
+
}
|
|
334
|
+
function useWhichKey() {
|
|
335
|
+
const controller = useWhichKeyController();
|
|
336
|
+
const state = useSyncExternalStore(
|
|
337
|
+
controller.subscribe,
|
|
338
|
+
controller.getState,
|
|
339
|
+
controller.getState
|
|
340
|
+
);
|
|
341
|
+
return {
|
|
342
|
+
...state,
|
|
343
|
+
controller,
|
|
344
|
+
setPreset: controller.setPreset,
|
|
345
|
+
setMode: controller.setMode,
|
|
346
|
+
setJumpAction: controller.setJumpAction,
|
|
347
|
+
openExplorer: controller.openExplorer,
|
|
348
|
+
closeExplorer: controller.closeExplorer,
|
|
349
|
+
setExplorerQuery: controller.setExplorerQuery,
|
|
350
|
+
openPrefix: controller.openPrefix,
|
|
351
|
+
closePrefix: controller.closePrefix,
|
|
352
|
+
stepBackPrefix: controller.stepBackPrefix,
|
|
353
|
+
triggerKey: controller.triggerKey,
|
|
354
|
+
focusPane: controller.focusPane,
|
|
355
|
+
startJumpMode: controller.startJumpMode,
|
|
356
|
+
cancelJumpMode: controller.cancelJumpMode,
|
|
357
|
+
jumpBack: controller.jumpBack,
|
|
358
|
+
jumpForward: controller.jumpForward,
|
|
359
|
+
executeCommand: controller.executeCommand
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function useKeymap(nodes, options) {
|
|
363
|
+
const controller = useOptionalWhichKeyController();
|
|
364
|
+
const layerId = useId();
|
|
365
|
+
useEffect(() => {
|
|
366
|
+
if (!controller || options?.enabled === false) return;
|
|
367
|
+
return controller.registerKeymap(layerId, nodes, options);
|
|
368
|
+
}, [controller, layerId, nodes, options]);
|
|
369
|
+
}
|
|
370
|
+
function useKeymapScope(scopeId, nodes, enabled = true) {
|
|
371
|
+
useKeymap(nodes, { scope: scopeId, enabled });
|
|
372
|
+
}
|
|
373
|
+
function useOptionalPaneRegistration(options) {
|
|
374
|
+
const controller = useOptionalWhichKeyController();
|
|
375
|
+
const reactId = useId();
|
|
376
|
+
const resolvedId = options.paneId ?? `pane-${reactId.replace(/:/g, "")}`;
|
|
377
|
+
const resolvedTitle = options.paneTitle ?? options.defaultTitle;
|
|
378
|
+
const elementRef = useRef(null);
|
|
379
|
+
const cleanupRef = useRef(null);
|
|
380
|
+
const activePaneId = useSyncExternalStore(
|
|
381
|
+
controller ? controller.subscribe : () => () => {
|
|
382
|
+
},
|
|
383
|
+
() => controller ? controller.getState().activePaneId : null,
|
|
384
|
+
() => null
|
|
385
|
+
);
|
|
386
|
+
const setRef = useCallback((node) => {
|
|
387
|
+
elementRef.current = node;
|
|
388
|
+
}, []);
|
|
389
|
+
useEffect(() => {
|
|
390
|
+
if (!controller || !elementRef.current || options.paneDisabled) {
|
|
391
|
+
cleanupRef.current?.();
|
|
392
|
+
cleanupRef.current = null;
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
cleanupRef.current?.();
|
|
396
|
+
cleanupRef.current = controller.registerPane({
|
|
397
|
+
id: resolvedId,
|
|
398
|
+
title: resolvedTitle,
|
|
399
|
+
element: elementRef.current,
|
|
400
|
+
disabled: options.paneDisabled,
|
|
401
|
+
order: options.paneOrder
|
|
402
|
+
});
|
|
403
|
+
return () => {
|
|
404
|
+
cleanupRef.current?.();
|
|
405
|
+
cleanupRef.current = null;
|
|
406
|
+
};
|
|
407
|
+
}, [
|
|
408
|
+
controller,
|
|
409
|
+
resolvedId,
|
|
410
|
+
resolvedTitle,
|
|
411
|
+
options.paneDisabled,
|
|
412
|
+
options.paneOrder
|
|
413
|
+
]);
|
|
414
|
+
if (options.paneDisabled) {
|
|
415
|
+
return {
|
|
416
|
+
ref: () => {
|
|
417
|
+
},
|
|
418
|
+
paneId: resolvedId,
|
|
419
|
+
isActive: false,
|
|
420
|
+
dataAttributes: {}
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
if (!controller) {
|
|
424
|
+
return {
|
|
425
|
+
ref: () => {
|
|
426
|
+
},
|
|
427
|
+
paneId: resolvedId,
|
|
428
|
+
isActive: false,
|
|
429
|
+
dataAttributes: options.paneId ? {
|
|
430
|
+
"data-pane-id": options.paneId,
|
|
431
|
+
"data-pane-title": resolvedTitle,
|
|
432
|
+
...options.paneOrder !== void 0 ? { "data-pane-order": String(options.paneOrder) } : {}
|
|
433
|
+
} : {}
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
const isActive = activePaneId === resolvedId;
|
|
437
|
+
return {
|
|
438
|
+
ref: setRef,
|
|
439
|
+
paneId: resolvedId,
|
|
440
|
+
isActive,
|
|
441
|
+
dataAttributes: {
|
|
442
|
+
"data-pane-id": resolvedId,
|
|
443
|
+
"data-pane-title": resolvedTitle,
|
|
444
|
+
...options.paneOrder !== void 0 ? { "data-pane-order": String(options.paneOrder) } : {},
|
|
445
|
+
"data-pane-active": isActive ? "true" : "false"
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// src/window.tsx
|
|
451
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
452
|
+
function Window({
|
|
453
|
+
paneId,
|
|
454
|
+
paneTitle,
|
|
455
|
+
paneDisabled,
|
|
456
|
+
className,
|
|
457
|
+
positionerClassName,
|
|
458
|
+
children,
|
|
459
|
+
...props
|
|
460
|
+
}) {
|
|
461
|
+
const pane = useOptionalPaneRegistration({
|
|
462
|
+
paneId,
|
|
463
|
+
paneTitle,
|
|
464
|
+
paneDisabled: paneDisabled || props.open === false,
|
|
465
|
+
defaultTitle: "Window"
|
|
466
|
+
});
|
|
467
|
+
return /* @__PURE__ */ jsx7(ArkWindowRoot, { ...props, children: /* @__PURE__ */ jsx7(Portal4, { children: /* @__PURE__ */ jsx7(ArkWindowPositioner, { className: cn6(windowPositionerBase, positionerClassName), children: /* @__PURE__ */ jsx7(
|
|
468
|
+
ArkWindowContent,
|
|
469
|
+
{
|
|
470
|
+
ref: pane.ref,
|
|
471
|
+
...pane.dataAttributes,
|
|
472
|
+
className: cn6(windowContentBase, className),
|
|
473
|
+
children
|
|
474
|
+
}
|
|
475
|
+
) }) }) });
|
|
219
476
|
}
|
|
220
477
|
function WindowProvider(props) {
|
|
221
|
-
return /* @__PURE__ */
|
|
478
|
+
return /* @__PURE__ */ jsx7(ArkWindowRootProvider, { ...props });
|
|
222
479
|
}
|
|
223
480
|
function WindowDragTrigger({ className, ...props }) {
|
|
224
|
-
return /* @__PURE__ */
|
|
481
|
+
return /* @__PURE__ */ jsx7(ArkWindowDragTrigger, { className: cn6(windowDragTriggerBase, className), ...props });
|
|
225
482
|
}
|
|
226
483
|
function WindowHeader({ className, ...props }) {
|
|
227
|
-
return /* @__PURE__ */
|
|
484
|
+
return /* @__PURE__ */ jsx7(ArkWindowHeader, { className: cn6(windowHeaderBase, className), ...props });
|
|
228
485
|
}
|
|
229
486
|
function WindowTitle({ className, ...props }) {
|
|
230
|
-
return /* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ jsx7(ArkWindowTitle, { className: cn6(windowTitleBase, className), ...props });
|
|
231
488
|
}
|
|
232
489
|
function WindowControl({ className, ...props }) {
|
|
233
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ jsx7(ArkWindowControl, { className: cn6(windowControlBase, className), ...props });
|
|
234
491
|
}
|
|
235
492
|
function WindowStageTrigger({ className, ...props }) {
|
|
236
|
-
return /* @__PURE__ */
|
|
493
|
+
return /* @__PURE__ */ jsx7(ArkWindowStageTrigger, { className: cn6(windowStageTriggerBase, className), ...props });
|
|
237
494
|
}
|
|
238
495
|
function WindowDismiss({ className, ...props }) {
|
|
239
|
-
return /* @__PURE__ */
|
|
496
|
+
return /* @__PURE__ */ jsx7(ArkWindowCloseTrigger, { "aria-label": "Close", className: cn6(windowCloseTriggerBase, className), ...props });
|
|
240
497
|
}
|
|
241
498
|
function WindowBody({ className, ...props }) {
|
|
242
|
-
return /* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ jsx7(ArkWindowBody, { className: cn6(windowBodyBase, className), ...props });
|
|
243
500
|
}
|
|
244
501
|
function WindowResizeTrigger({ axis = "se", className, ...props }) {
|
|
245
|
-
return /* @__PURE__ */
|
|
502
|
+
return /* @__PURE__ */ jsx7(ArkWindowResizeTrigger, { axis, className: cn6(windowResizeTriggerBase, className), ...props });
|
|
246
503
|
}
|
|
247
504
|
|
|
248
505
|
// src/badge.tsx
|
|
249
506
|
import { ark as ark2 } from "@ark-ui/react/factory";
|
|
250
507
|
import { badgeVariants, cn as cn7 } from "@cloudvoyant/helical-ui";
|
|
251
|
-
import { jsx as
|
|
508
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
252
509
|
function Badge({ className, variant, color, size, ...props }) {
|
|
253
|
-
return /* @__PURE__ */
|
|
510
|
+
return /* @__PURE__ */ jsx8(ark2.span, { className: cn7(badgeVariants({ variant, color, size }), className), ...props });
|
|
254
511
|
}
|
|
255
512
|
|
|
256
513
|
// src/container.tsx
|
|
257
514
|
import { ark as ark3 } from "@ark-ui/react/factory";
|
|
258
515
|
import { containerBase, cn as cn8 } from "@cloudvoyant/helical-ui";
|
|
259
|
-
import { jsx as
|
|
516
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
260
517
|
function Container({ className, ...props }) {
|
|
261
|
-
return /* @__PURE__ */
|
|
518
|
+
return /* @__PURE__ */ jsx9(ark3.div, { className: cn8(containerBase, className), ...props });
|
|
262
519
|
}
|
|
263
520
|
|
|
264
521
|
// src/row.tsx
|
|
265
522
|
import { ark as ark4 } from "@ark-ui/react/factory";
|
|
266
523
|
import { rowBase, cn as cn9 } from "@cloudvoyant/helical-ui";
|
|
267
|
-
import { jsx as
|
|
524
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
268
525
|
function Row({ className, ...props }) {
|
|
269
|
-
return /* @__PURE__ */
|
|
526
|
+
return /* @__PURE__ */ jsx10(ark4.div, { className: cn9(rowBase, className), ...props });
|
|
270
527
|
}
|
|
271
528
|
|
|
272
529
|
// src/col.tsx
|
|
273
530
|
import { ark as ark5 } from "@ark-ui/react/factory";
|
|
274
531
|
import { colBase, cn as cn10 } from "@cloudvoyant/helical-ui";
|
|
275
|
-
import { jsx as
|
|
532
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
276
533
|
function Col({ className, ...props }) {
|
|
277
|
-
return /* @__PURE__ */
|
|
534
|
+
return /* @__PURE__ */ jsx11(ark5.div, { className: cn10(colBase, className), ...props });
|
|
278
535
|
}
|
|
279
536
|
|
|
280
537
|
// src/center.tsx
|
|
281
538
|
import { ark as ark6 } from "@ark-ui/react/factory";
|
|
282
539
|
import { centerBase, cn as cn11 } from "@cloudvoyant/helical-ui";
|
|
283
|
-
import { jsx as
|
|
540
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
284
541
|
function Center({ className, ...props }) {
|
|
285
|
-
return /* @__PURE__ */
|
|
542
|
+
return /* @__PURE__ */ jsx12(ark6.div, { className: cn11(centerBase, className), ...props });
|
|
286
543
|
}
|
|
287
544
|
|
|
288
545
|
// src/portal.tsx
|
|
@@ -291,9 +548,9 @@ import { Portal as Portal5 } from "@ark-ui/react/portal";
|
|
|
291
548
|
// src/item.tsx
|
|
292
549
|
import { ark as ark7 } from "@ark-ui/react/factory";
|
|
293
550
|
import { itemVariants, cn as cn12 } from "@cloudvoyant/helical-ui";
|
|
294
|
-
import { jsx as
|
|
551
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
295
552
|
function Item({ className, variant, ...props }) {
|
|
296
|
-
return /* @__PURE__ */
|
|
553
|
+
return /* @__PURE__ */ jsx13(ark7.div, { className: cn12(itemVariants({ variant }), className), ...props });
|
|
297
554
|
}
|
|
298
555
|
|
|
299
556
|
// src/card/root.tsx
|
|
@@ -301,66 +558,66 @@ import { ark as ark8 } from "@ark-ui/react/factory";
|
|
|
301
558
|
import { cardVariants, cn as cn13 } from "@cloudvoyant/helical-ui";
|
|
302
559
|
|
|
303
560
|
// src/card/context.ts
|
|
304
|
-
import { createContext, useContext } from "react";
|
|
305
|
-
var CardOrientationContext =
|
|
561
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
562
|
+
var CardOrientationContext = createContext2("vertical");
|
|
306
563
|
function useCardOrientation() {
|
|
307
|
-
return
|
|
564
|
+
return useContext2(CardOrientationContext);
|
|
308
565
|
}
|
|
309
566
|
|
|
310
567
|
// src/card/root.tsx
|
|
311
|
-
import { jsx as
|
|
568
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
312
569
|
function Card({ className, variant, size, orientation, children, ...props }) {
|
|
313
570
|
const resolvedOrientation = orientation ?? "vertical";
|
|
314
|
-
return /* @__PURE__ */
|
|
571
|
+
return /* @__PURE__ */ jsx14(CardOrientationContext.Provider, { value: resolvedOrientation, children: /* @__PURE__ */ jsx14(ark8.div, { className: cn13(cardVariants({ variant, size, orientation: resolvedOrientation }), className), ...props, children }) });
|
|
315
572
|
}
|
|
316
573
|
|
|
317
574
|
// src/card/header.tsx
|
|
318
575
|
import { ark as ark9 } from "@ark-ui/react/factory";
|
|
319
576
|
import { cardHeaderBase, cn as cn14 } from "@cloudvoyant/helical-ui";
|
|
320
|
-
import { jsx as
|
|
577
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
321
578
|
function CardHeader({ className, ...props }) {
|
|
322
|
-
return /* @__PURE__ */
|
|
579
|
+
return /* @__PURE__ */ jsx15(ark9.div, { className: cn14(cardHeaderBase, className), ...props });
|
|
323
580
|
}
|
|
324
581
|
|
|
325
582
|
// src/card/body.tsx
|
|
326
583
|
import { ark as ark10 } from "@ark-ui/react/factory";
|
|
327
584
|
import { cardBodyBase, cn as cn15 } from "@cloudvoyant/helical-ui";
|
|
328
|
-
import { jsx as
|
|
585
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
329
586
|
function CardBody({ className, ...props }) {
|
|
330
|
-
return /* @__PURE__ */
|
|
587
|
+
return /* @__PURE__ */ jsx16(ark10.div, { className: cn15(cardBodyBase, className), ...props });
|
|
331
588
|
}
|
|
332
589
|
|
|
333
590
|
// src/card/footer.tsx
|
|
334
591
|
import { ark as ark11 } from "@ark-ui/react/factory";
|
|
335
592
|
import { cardFooterBase, cn as cn16 } from "@cloudvoyant/helical-ui";
|
|
336
|
-
import { jsx as
|
|
593
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
337
594
|
function CardFooter({ className, ...props }) {
|
|
338
|
-
return /* @__PURE__ */
|
|
595
|
+
return /* @__PURE__ */ jsx17(ark11.div, { className: cn16(cardFooterBase, className), ...props });
|
|
339
596
|
}
|
|
340
597
|
|
|
341
598
|
// src/card/title.tsx
|
|
342
599
|
import { ark as ark12 } from "@ark-ui/react/factory";
|
|
343
600
|
import { cardTitleBase, cn as cn17 } from "@cloudvoyant/helical-ui";
|
|
344
|
-
import { jsx as
|
|
601
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
345
602
|
function CardTitle({ className, ...props }) {
|
|
346
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ jsx18(ark12.h3, { className: cn17(cardTitleBase, className), ...props });
|
|
347
604
|
}
|
|
348
605
|
|
|
349
606
|
// src/card/description.tsx
|
|
350
607
|
import { ark as ark13 } from "@ark-ui/react/factory";
|
|
351
608
|
import { cardDescriptionBase, cn as cn18 } from "@cloudvoyant/helical-ui";
|
|
352
|
-
import { jsx as
|
|
609
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
353
610
|
function CardDescription({ className, ...props }) {
|
|
354
|
-
return /* @__PURE__ */
|
|
611
|
+
return /* @__PURE__ */ jsx19(ark13.p, { className: cn18(cardDescriptionBase, className), ...props });
|
|
355
612
|
}
|
|
356
613
|
|
|
357
614
|
// src/card/cover.tsx
|
|
358
615
|
import { ark as ark14 } from "@ark-ui/react/factory";
|
|
359
616
|
import { cardCoverVariants, cn as cn19 } from "@cloudvoyant/helical-ui";
|
|
360
|
-
import { jsx as
|
|
617
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
361
618
|
function CardCover({ className, variant, orientation, ...props }) {
|
|
362
619
|
const contextOrientation = useCardOrientation();
|
|
363
|
-
return /* @__PURE__ */
|
|
620
|
+
return /* @__PURE__ */ jsx20(
|
|
364
621
|
ark14.div,
|
|
365
622
|
{
|
|
366
623
|
className: cn19(cardCoverVariants({ variant, orientation: orientation ?? contextOrientation }), className),
|
|
@@ -372,15 +629,15 @@ function CardCover({ className, variant, orientation, ...props }) {
|
|
|
372
629
|
// src/stack.tsx
|
|
373
630
|
import { ark as ark15 } from "@ark-ui/react/factory";
|
|
374
631
|
import { stackBase, hstackBase, vstackBase, cn as cn20 } from "@cloudvoyant/helical-ui";
|
|
375
|
-
import { jsx as
|
|
632
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
376
633
|
function Stack({ className, ...props }) {
|
|
377
|
-
return /* @__PURE__ */
|
|
634
|
+
return /* @__PURE__ */ jsx21(ark15.div, { className: cn20(stackBase, className), ...props });
|
|
378
635
|
}
|
|
379
636
|
function HStack({ className, ...props }) {
|
|
380
|
-
return /* @__PURE__ */
|
|
637
|
+
return /* @__PURE__ */ jsx21(ark15.div, { className: cn20(hstackBase, className), ...props });
|
|
381
638
|
}
|
|
382
639
|
function VStack({ className, ...props }) {
|
|
383
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ jsx21(ark15.div, { className: cn20(vstackBase, className), ...props });
|
|
384
641
|
}
|
|
385
642
|
|
|
386
643
|
// src/scroll.tsx
|
|
@@ -401,7 +658,7 @@ import {
|
|
|
401
658
|
scrollCornerBase,
|
|
402
659
|
cn as cn21
|
|
403
660
|
} from "@cloudvoyant/helical-ui";
|
|
404
|
-
import { Fragment, jsx as
|
|
661
|
+
import { Fragment, jsx as jsx22, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
405
662
|
function Scroll({
|
|
406
663
|
className,
|
|
407
664
|
orientation = "vertical",
|
|
@@ -413,11 +670,11 @@ function Scroll({
|
|
|
413
670
|
...props
|
|
414
671
|
}) {
|
|
415
672
|
return /* @__PURE__ */ jsxs3(ArkRoot, { className: cn21(scrollRootBase, className), ...props, children: [
|
|
416
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ jsx22(ArkViewport, { className: cn21(scrollViewportBase, viewportClassName), children: /* @__PURE__ */ jsx22(ArkContent, { className: cn21(scrollContentBase, contentClassName), children }) }),
|
|
417
674
|
variant === "hidden" ? null : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
418
|
-
(orientation === "vertical" || orientation === "both") && /* @__PURE__ */
|
|
419
|
-
(orientation === "horizontal" || orientation === "both") && /* @__PURE__ */
|
|
420
|
-
orientation === "both" && /* @__PURE__ */
|
|
675
|
+
(orientation === "vertical" || orientation === "both") && /* @__PURE__ */ jsx22(ArkScrollbar, { orientation: "vertical", className: scrollScrollbarBase, children: /* @__PURE__ */ jsx22(ArkThumb, { className: cn21(scrollThumbBase, thumbClassName) }) }),
|
|
676
|
+
(orientation === "horizontal" || orientation === "both") && /* @__PURE__ */ jsx22(ArkScrollbar, { orientation: "horizontal", className: scrollScrollbarBase, children: /* @__PURE__ */ jsx22(ArkThumb, { className: cn21(scrollThumbBase, thumbClassName) }) }),
|
|
677
|
+
orientation === "both" && /* @__PURE__ */ jsx22(ArkCorner, { className: scrollCornerBase })
|
|
421
678
|
] })
|
|
422
679
|
] });
|
|
423
680
|
}
|
|
@@ -434,28 +691,99 @@ import {
|
|
|
434
691
|
pageSectionBase,
|
|
435
692
|
cn as cn22
|
|
436
693
|
} from "@cloudvoyant/helical-ui";
|
|
437
|
-
import { jsx as
|
|
694
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
438
695
|
function Page({ variant = "default", className, children, ...props }) {
|
|
439
|
-
return /* @__PURE__ */
|
|
696
|
+
return /* @__PURE__ */ jsx23(ark16.div, { "data-slot": "page", className: cn22(pageVariants({ variant }), className), ...props, children });
|
|
440
697
|
}
|
|
441
698
|
function PageGutter({
|
|
442
699
|
side = "left",
|
|
443
700
|
align = "start",
|
|
444
701
|
contentClassName,
|
|
702
|
+
paneId,
|
|
703
|
+
paneTitle,
|
|
704
|
+
paneDisabled,
|
|
705
|
+
paneOrder,
|
|
445
706
|
className,
|
|
446
707
|
children,
|
|
447
708
|
...props
|
|
448
709
|
}) {
|
|
449
|
-
|
|
710
|
+
const pane = useOptionalPaneRegistration({
|
|
711
|
+
paneId,
|
|
712
|
+
paneTitle,
|
|
713
|
+
paneDisabled,
|
|
714
|
+
paneOrder,
|
|
715
|
+
defaultTitle: side === "right" ? "Right Gutter" : "Left Gutter"
|
|
716
|
+
});
|
|
717
|
+
return /* @__PURE__ */ jsx23(ark16.div, { "data-slot": "page-gutter-area", className: cn22(pageGutterAreaBase, side === "right" && "[grid-area:right]"), children: /* @__PURE__ */ jsx23(
|
|
718
|
+
ark16.div,
|
|
719
|
+
{
|
|
720
|
+
ref: pane.ref,
|
|
721
|
+
"data-slot": "page-gutter",
|
|
722
|
+
...pane.dataAttributes,
|
|
723
|
+
className: cn22(pageGutterVariants({ side }), className),
|
|
724
|
+
...props,
|
|
725
|
+
children: /* @__PURE__ */ jsx23(ark16.div, { "data-slot": "page-gutter-content", className: cn22(pageGutterContentVariants({ align }), contentClassName), children })
|
|
726
|
+
}
|
|
727
|
+
) });
|
|
450
728
|
}
|
|
451
|
-
function PageContent({
|
|
452
|
-
|
|
729
|
+
function PageContent({
|
|
730
|
+
paneId,
|
|
731
|
+
paneTitle,
|
|
732
|
+
paneDisabled,
|
|
733
|
+
paneOrder,
|
|
734
|
+
className,
|
|
735
|
+
children,
|
|
736
|
+
...props
|
|
737
|
+
}) {
|
|
738
|
+
const pane = useOptionalPaneRegistration({
|
|
739
|
+
paneId,
|
|
740
|
+
paneTitle,
|
|
741
|
+
paneDisabled,
|
|
742
|
+
paneOrder,
|
|
743
|
+
defaultTitle: "Main Content"
|
|
744
|
+
});
|
|
745
|
+
return /* @__PURE__ */ jsx23(
|
|
746
|
+
ark16.main,
|
|
747
|
+
{
|
|
748
|
+
ref: pane.ref,
|
|
749
|
+
"data-slot": "page-content",
|
|
750
|
+
...pane.dataAttributes,
|
|
751
|
+
className: cn22(pageContentBase, className),
|
|
752
|
+
...props,
|
|
753
|
+
children
|
|
754
|
+
}
|
|
755
|
+
);
|
|
453
756
|
}
|
|
454
757
|
function PageFooter({ className, children, ...props }) {
|
|
455
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ jsx23(ark16.footer, { "data-slot": "page-footer", className: cn22(pageFooterBase, className), ...props, children });
|
|
456
759
|
}
|
|
457
|
-
function PageSection({
|
|
458
|
-
|
|
760
|
+
function PageSection({
|
|
761
|
+
paneId,
|
|
762
|
+
paneTitle,
|
|
763
|
+
paneDisabled,
|
|
764
|
+
paneOrder,
|
|
765
|
+
className,
|
|
766
|
+
children,
|
|
767
|
+
...props
|
|
768
|
+
}) {
|
|
769
|
+
const pane = useOptionalPaneRegistration({
|
|
770
|
+
paneId,
|
|
771
|
+
paneTitle,
|
|
772
|
+
paneDisabled,
|
|
773
|
+
paneOrder,
|
|
774
|
+
defaultTitle: "Section"
|
|
775
|
+
});
|
|
776
|
+
return /* @__PURE__ */ jsx23(
|
|
777
|
+
ark16.section,
|
|
778
|
+
{
|
|
779
|
+
ref: pane.ref,
|
|
780
|
+
"data-slot": "page-section",
|
|
781
|
+
...pane.dataAttributes,
|
|
782
|
+
className: cn22(pageSectionBase, className),
|
|
783
|
+
...props,
|
|
784
|
+
children
|
|
785
|
+
}
|
|
786
|
+
);
|
|
459
787
|
}
|
|
460
788
|
|
|
461
789
|
// src/splitter.tsx
|
|
@@ -473,21 +801,41 @@ import {
|
|
|
473
801
|
splitterResizeTriggerIndicatorBase,
|
|
474
802
|
cn as cn23
|
|
475
803
|
} from "@cloudvoyant/helical-ui";
|
|
476
|
-
import { jsx as
|
|
804
|
+
import { jsx as jsx24, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
477
805
|
function Splitter({ className, ...props }) {
|
|
478
|
-
return /* @__PURE__ */
|
|
806
|
+
return /* @__PURE__ */ jsx24(ArkSplitterRoot, { className: cn23(splitterRootBase, className), ...props });
|
|
479
807
|
}
|
|
480
|
-
function SplitterPanel({
|
|
481
|
-
|
|
808
|
+
function SplitterPanel({
|
|
809
|
+
paneId,
|
|
810
|
+
paneTitle,
|
|
811
|
+
paneDisabled,
|
|
812
|
+
className,
|
|
813
|
+
...props
|
|
814
|
+
}) {
|
|
815
|
+
const pane = useOptionalPaneRegistration({
|
|
816
|
+
paneId: paneId ?? (typeof props.id === "string" ? `splitter-${props.id}` : void 0),
|
|
817
|
+
paneTitle: paneTitle ?? (typeof props.id === "string" ? `Panel ${props.id}` : "Splitter Panel"),
|
|
818
|
+
paneDisabled,
|
|
819
|
+
defaultTitle: "Splitter Panel"
|
|
820
|
+
});
|
|
821
|
+
return /* @__PURE__ */ jsx24(
|
|
822
|
+
ArkSplitterPanel,
|
|
823
|
+
{
|
|
824
|
+
ref: pane.ref,
|
|
825
|
+
...pane.dataAttributes,
|
|
826
|
+
className: cn23(splitterPanelBase, className),
|
|
827
|
+
...props
|
|
828
|
+
}
|
|
829
|
+
);
|
|
482
830
|
}
|
|
483
831
|
function SplitterResizeTrigger({ className, children, ...props }) {
|
|
484
832
|
return /* @__PURE__ */ jsxs4(ArkSplitterResizeTrigger, { className: cn23(splitterResizeTriggerBase, className), ...props, children: [
|
|
485
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ jsx24("span", { "aria-hidden": true, "data-part": "separator", className: splitterResizeTriggerSeparatorBase }),
|
|
486
834
|
children
|
|
487
835
|
] });
|
|
488
836
|
}
|
|
489
837
|
function SplitterResizeTriggerIndicator({ className, ...props }) {
|
|
490
|
-
return /* @__PURE__ */
|
|
838
|
+
return /* @__PURE__ */ jsx24(ArkSplitterResizeTriggerIndicator, { className: cn23(splitterResizeTriggerIndicatorBase, className), ...props });
|
|
491
839
|
}
|
|
492
840
|
|
|
493
841
|
// src/sidebar/Provider.tsx
|
|
@@ -512,7 +860,7 @@ function useSidebar() {
|
|
|
512
860
|
}
|
|
513
861
|
|
|
514
862
|
// src/sidebar/Provider.tsx
|
|
515
|
-
import { jsx as
|
|
863
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
516
864
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
517
865
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
518
866
|
function useIsMobile() {
|
|
@@ -594,7 +942,7 @@ function Provider({
|
|
|
594
942
|
}),
|
|
595
943
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, isControlled]
|
|
596
944
|
);
|
|
597
|
-
return /* @__PURE__ */
|
|
945
|
+
return /* @__PURE__ */ jsx25(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx25(
|
|
598
946
|
Row,
|
|
599
947
|
{
|
|
600
948
|
"data-slot": "sidebar-wrapper",
|
|
@@ -629,22 +977,33 @@ import {
|
|
|
629
977
|
sidebarStyles as sidebarStyles2,
|
|
630
978
|
cn as cn25
|
|
631
979
|
} from "@cloudvoyant/helical-ui";
|
|
632
|
-
import { jsx as
|
|
980
|
+
import { jsx as jsx26, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
633
981
|
function Root({
|
|
634
982
|
side = "left",
|
|
635
983
|
variant = "sidebar",
|
|
636
984
|
collapsible = "offcanvas",
|
|
985
|
+
paneId,
|
|
986
|
+
paneTitle,
|
|
987
|
+
paneDisabled,
|
|
637
988
|
className,
|
|
638
989
|
children,
|
|
639
990
|
...props
|
|
640
991
|
}) {
|
|
641
992
|
const { isMobile, state, open, setOpen, openMobile, setOpenMobile, isControlled } = useSidebar();
|
|
993
|
+
const pane = useOptionalPaneRegistration({
|
|
994
|
+
paneId,
|
|
995
|
+
paneTitle,
|
|
996
|
+
paneDisabled: paneDisabled || state === "collapsed",
|
|
997
|
+
defaultTitle: "Sidebar"
|
|
998
|
+
});
|
|
642
999
|
if (collapsible === "none") {
|
|
643
|
-
return /* @__PURE__ */
|
|
1000
|
+
return /* @__PURE__ */ jsx26(
|
|
644
1001
|
Col,
|
|
645
1002
|
{
|
|
1003
|
+
ref: pane.ref,
|
|
646
1004
|
"data-slot": "sidebar",
|
|
647
1005
|
"data-sidebar": "sidebar",
|
|
1006
|
+
...pane.dataAttributes,
|
|
648
1007
|
className: cn25("h-full w-(--sidebar-width) bg-sidebar text-sidebar-foreground", className),
|
|
649
1008
|
...props,
|
|
650
1009
|
children
|
|
@@ -671,8 +1030,8 @@ function Root({
|
|
|
671
1030
|
preventDragOnScroll: false,
|
|
672
1031
|
...props,
|
|
673
1032
|
children: [
|
|
674
|
-
!isBottomWidgetSheet && /* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
1033
|
+
!isBottomWidgetSheet && /* @__PURE__ */ jsx26(DrawerBackdrop, { className: sidebarStyles2.mobileBackdropClass }),
|
|
1034
|
+
/* @__PURE__ */ jsx26(DrawerPositioner, { className: sidebarStyles2.mobilePositionerClass, children: /* @__PURE__ */ jsxs5(
|
|
676
1035
|
DrawerContent,
|
|
677
1036
|
{
|
|
678
1037
|
"data-sidebar": "sidebar",
|
|
@@ -681,11 +1040,11 @@ function Root({
|
|
|
681
1040
|
className: cn25(sidebarStyles2.mobileContentClass, className),
|
|
682
1041
|
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
683
1042
|
children: [
|
|
684
|
-
/* @__PURE__ */
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
isBottomWidgetSheet && /* @__PURE__ */
|
|
688
|
-
/* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ jsx26(DrawerTitle, { className: "sr-only", children: "Sidebar" }),
|
|
1044
|
+
/* @__PURE__ */ jsx26(DrawerDescription, { className: "sr-only", children: "Displays the mobile sidebar." }),
|
|
1045
|
+
/* @__PURE__ */ jsx26(DrawerCloseTrigger, { className: "hidden" }),
|
|
1046
|
+
isBottomWidgetSheet && /* @__PURE__ */ jsx26(DrawerGrabber, { className: sidebarStyles2.mobileGrabberClass, children: /* @__PURE__ */ jsx26(DrawerGrabberIndicator, { className: sidebarStyles2.mobileGrabberIndicatorClass }) }),
|
|
1047
|
+
/* @__PURE__ */ jsx26("div", { "data-no-drag": true, className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ jsx26(Col, { className: "h-full w-full", children }) })
|
|
689
1048
|
]
|
|
690
1049
|
}
|
|
691
1050
|
) })
|
|
@@ -703,7 +1062,7 @@ function Root({
|
|
|
703
1062
|
"data-side": side,
|
|
704
1063
|
"data-slot": "sidebar",
|
|
705
1064
|
children: [
|
|
706
|
-
/* @__PURE__ */
|
|
1065
|
+
/* @__PURE__ */ jsx26(
|
|
707
1066
|
"div",
|
|
708
1067
|
{
|
|
709
1068
|
"data-slot": "sidebar-gap",
|
|
@@ -714,10 +1073,12 @@ function Root({
|
|
|
714
1073
|
)
|
|
715
1074
|
}
|
|
716
1075
|
),
|
|
717
|
-
/* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ jsx26(
|
|
718
1077
|
"div",
|
|
719
1078
|
{
|
|
1079
|
+
ref: pane.ref,
|
|
720
1080
|
"data-slot": "sidebar-container",
|
|
1081
|
+
...pane.dataAttributes,
|
|
721
1082
|
className: cn25(
|
|
722
1083
|
sidebarStyles2.containerClass,
|
|
723
1084
|
side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
@@ -725,7 +1086,7 @@ function Root({
|
|
|
725
1086
|
className
|
|
726
1087
|
),
|
|
727
1088
|
...props,
|
|
728
|
-
children: /* @__PURE__ */
|
|
1089
|
+
children: /* @__PURE__ */ jsx26(
|
|
729
1090
|
"div",
|
|
730
1091
|
{
|
|
731
1092
|
"data-sidebar": "sidebar",
|
|
@@ -744,9 +1105,9 @@ function Root({
|
|
|
744
1105
|
|
|
745
1106
|
// src/sidebar/Header.tsx
|
|
746
1107
|
import { sidebarStyles as sidebarStyles3, cn as cn26 } from "@cloudvoyant/helical-ui";
|
|
747
|
-
import { jsx as
|
|
1108
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
748
1109
|
function Header({ className, ...props }) {
|
|
749
|
-
return /* @__PURE__ */
|
|
1110
|
+
return /* @__PURE__ */ jsx27(
|
|
750
1111
|
Col,
|
|
751
1112
|
{
|
|
752
1113
|
"data-slot": "sidebar-header",
|
|
@@ -759,9 +1120,9 @@ function Header({ className, ...props }) {
|
|
|
759
1120
|
|
|
760
1121
|
// src/sidebar/Footer.tsx
|
|
761
1122
|
import { sidebarStyles as sidebarStyles4, cn as cn27 } from "@cloudvoyant/helical-ui";
|
|
762
|
-
import { jsx as
|
|
1123
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
763
1124
|
function Footer({ className, ...props }) {
|
|
764
|
-
return /* @__PURE__ */
|
|
1125
|
+
return /* @__PURE__ */ jsx28(
|
|
765
1126
|
Col,
|
|
766
1127
|
{
|
|
767
1128
|
"data-slot": "sidebar-footer",
|
|
@@ -775,9 +1136,9 @@ function Footer({ className, ...props }) {
|
|
|
775
1136
|
// src/sidebar/Separator.tsx
|
|
776
1137
|
import { ark as ark17 } from "@ark-ui/react/factory";
|
|
777
1138
|
import { sidebarStyles as sidebarStyles5, cn as cn28 } from "@cloudvoyant/helical-ui";
|
|
778
|
-
import { jsx as
|
|
1139
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
779
1140
|
function Separator({ className, ...props }) {
|
|
780
|
-
return /* @__PURE__ */
|
|
1141
|
+
return /* @__PURE__ */ jsx29(
|
|
781
1142
|
ark17.div,
|
|
782
1143
|
{
|
|
783
1144
|
"data-slot": "sidebar-separator",
|
|
@@ -791,9 +1152,9 @@ function Separator({ className, ...props }) {
|
|
|
791
1152
|
|
|
792
1153
|
// src/sidebar/Content.tsx
|
|
793
1154
|
import { sidebarStyles as sidebarStyles6, cn as cn29 } from "@cloudvoyant/helical-ui";
|
|
794
|
-
import { jsx as
|
|
1155
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
795
1156
|
function Content({ className, ...props }) {
|
|
796
|
-
return /* @__PURE__ */
|
|
1157
|
+
return /* @__PURE__ */ jsx30(
|
|
797
1158
|
Col,
|
|
798
1159
|
{
|
|
799
1160
|
"data-slot": "sidebar-content",
|
|
@@ -806,11 +1167,11 @@ function Content({ className, ...props }) {
|
|
|
806
1167
|
|
|
807
1168
|
// src/sidebar/Group.tsx
|
|
808
1169
|
import { sidebarStyles as sidebarStyles7, cn as cn30 } from "@cloudvoyant/helical-ui";
|
|
809
|
-
import { jsx as
|
|
1170
|
+
import { jsx as jsx31, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
810
1171
|
function Group({ label, className, children, ...props }) {
|
|
811
1172
|
return /* @__PURE__ */ jsxs6(Col, { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn30(sidebarStyles7.groupClass, className), ...props, children: [
|
|
812
|
-
label && /* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
1173
|
+
label && /* @__PURE__ */ jsx31("div", { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn30(sidebarStyles7.groupLabelClass), children: label }),
|
|
1174
|
+
/* @__PURE__ */ jsx31(
|
|
814
1175
|
"div",
|
|
815
1176
|
{
|
|
816
1177
|
"data-slot": "sidebar-group-content",
|
|
@@ -825,9 +1186,9 @@ function Group({ label, className, children, ...props }) {
|
|
|
825
1186
|
// src/sidebar/GroupAction.tsx
|
|
826
1187
|
import { ark as ark18 } from "@ark-ui/react/factory";
|
|
827
1188
|
import { sidebarStyles as sidebarStyles8, cn as cn31 } from "@cloudvoyant/helical-ui";
|
|
828
|
-
import { jsx as
|
|
1189
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
829
1190
|
function GroupAction({ className, asChild = false, ...props }) {
|
|
830
|
-
return /* @__PURE__ */
|
|
1191
|
+
return /* @__PURE__ */ jsx32(
|
|
831
1192
|
ark18.button,
|
|
832
1193
|
{
|
|
833
1194
|
"data-slot": "sidebar-group-action",
|
|
@@ -843,9 +1204,9 @@ function GroupAction({ className, asChild = false, ...props }) {
|
|
|
843
1204
|
// src/sidebar/Menu.tsx
|
|
844
1205
|
import { ark as ark19 } from "@ark-ui/react/factory";
|
|
845
1206
|
import { sidebarStyles as sidebarStyles9, cn as cn32 } from "@cloudvoyant/helical-ui";
|
|
846
|
-
import { jsx as
|
|
1207
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
847
1208
|
function Menu({ className, ...props }) {
|
|
848
|
-
return /* @__PURE__ */
|
|
1209
|
+
return /* @__PURE__ */ jsx33(
|
|
849
1210
|
ark19.ul,
|
|
850
1211
|
{
|
|
851
1212
|
"data-slot": "sidebar-menu",
|
|
@@ -859,9 +1220,9 @@ function Menu({ className, ...props }) {
|
|
|
859
1220
|
// src/sidebar/MenuItem.tsx
|
|
860
1221
|
import { ark as ark20 } from "@ark-ui/react/factory";
|
|
861
1222
|
import { sidebarStyles as sidebarStyles10, cn as cn33 } from "@cloudvoyant/helical-ui";
|
|
862
|
-
import { jsx as
|
|
1223
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
863
1224
|
function MenuItem({ className, ...props }) {
|
|
864
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ jsx34(
|
|
865
1226
|
ark20.li,
|
|
866
1227
|
{
|
|
867
1228
|
"data-slot": "sidebar-menu-item",
|
|
@@ -881,7 +1242,7 @@ import {
|
|
|
881
1242
|
TooltipContent as ArkTooltipContent2
|
|
882
1243
|
} from "@ark-ui/react/tooltip";
|
|
883
1244
|
import { sidebarMenuButtonVariants, sidebarStyles as sidebarStyles11, cn as cn34 } from "@cloudvoyant/helical-ui";
|
|
884
|
-
import { jsx as
|
|
1245
|
+
import { jsx as jsx35, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
885
1246
|
function MenuButton({
|
|
886
1247
|
asChild = false,
|
|
887
1248
|
isActive = false,
|
|
@@ -893,7 +1254,7 @@ function MenuButton({
|
|
|
893
1254
|
...props
|
|
894
1255
|
}) {
|
|
895
1256
|
const { isMobile, state } = useSidebar();
|
|
896
|
-
const button = /* @__PURE__ */
|
|
1257
|
+
const button = /* @__PURE__ */ jsx35(
|
|
897
1258
|
ark21.button,
|
|
898
1259
|
{
|
|
899
1260
|
"data-slot": "sidebar-menu-button",
|
|
@@ -912,14 +1273,14 @@ function MenuButton({
|
|
|
912
1273
|
}
|
|
913
1274
|
const tooltipContent = typeof tooltip === "string" ? { children: tooltip } : tooltip;
|
|
914
1275
|
return /* @__PURE__ */ jsxs7(TooltipRoot, { openDelay: 0, positioning: { placement: "right", gutter: 8 }, children: [
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
1276
|
+
/* @__PURE__ */ jsx35(TooltipTrigger2, { asChild: true, children: button }),
|
|
1277
|
+
/* @__PURE__ */ jsx35(TooltipPositioner, { children: /* @__PURE__ */ jsx35(ArkTooltipContent2, { className: cn34(sidebarStyles11.tooltipContentClass), ...tooltipContent }) })
|
|
917
1278
|
] });
|
|
918
1279
|
}
|
|
919
1280
|
|
|
920
1281
|
// src/sidebar/MenuLink.tsx
|
|
921
1282
|
import { sidebarStyles as sidebarStyles12, cn as cn35 } from "@cloudvoyant/helical-ui";
|
|
922
|
-
import { Fragment as Fragment2, jsx as
|
|
1283
|
+
import { Fragment as Fragment2, jsx as jsx36, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
923
1284
|
function MenuLink({
|
|
924
1285
|
icon,
|
|
925
1286
|
href,
|
|
@@ -933,9 +1294,9 @@ function MenuLink({
|
|
|
933
1294
|
}) {
|
|
934
1295
|
const content = /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
935
1296
|
icon,
|
|
936
|
-
children != null && /* @__PURE__ */
|
|
1297
|
+
children != null && /* @__PURE__ */ jsx36("span", { children })
|
|
937
1298
|
] });
|
|
938
|
-
return /* @__PURE__ */
|
|
1299
|
+
return /* @__PURE__ */ jsx36("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn35(sidebarStyles12.menuItemClass), children: href == null ? /* @__PURE__ */ jsx36(
|
|
939
1300
|
MenuButton,
|
|
940
1301
|
{
|
|
941
1302
|
isActive,
|
|
@@ -946,20 +1307,20 @@ function MenuLink({
|
|
|
946
1307
|
onClick,
|
|
947
1308
|
children: content
|
|
948
1309
|
}
|
|
949
|
-
) : /* @__PURE__ */
|
|
1310
|
+
) : /* @__PURE__ */ jsx36(MenuButton, { asChild: true, isActive, variant, size, tooltip, className, children: /* @__PURE__ */ jsx36("a", { href, onClick, children: content }) }) });
|
|
950
1311
|
}
|
|
951
1312
|
|
|
952
1313
|
// src/sidebar/MenuAction.tsx
|
|
953
1314
|
import { ark as ark22 } from "@ark-ui/react/factory";
|
|
954
1315
|
import { sidebarStyles as sidebarStyles13, cn as cn36 } from "@cloudvoyant/helical-ui";
|
|
955
|
-
import { jsx as
|
|
1316
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
956
1317
|
function MenuAction({
|
|
957
1318
|
className,
|
|
958
1319
|
asChild = false,
|
|
959
1320
|
showOnHover = false,
|
|
960
1321
|
...props
|
|
961
1322
|
}) {
|
|
962
|
-
return /* @__PURE__ */
|
|
1323
|
+
return /* @__PURE__ */ jsx37(
|
|
963
1324
|
ark22.button,
|
|
964
1325
|
{
|
|
965
1326
|
"data-slot": "sidebar-menu-action",
|
|
@@ -979,9 +1340,9 @@ function MenuAction({
|
|
|
979
1340
|
// src/sidebar/MenuBadge.tsx
|
|
980
1341
|
import { ark as ark23 } from "@ark-ui/react/factory";
|
|
981
1342
|
import { sidebarStyles as sidebarStyles14, cn as cn37 } from "@cloudvoyant/helical-ui";
|
|
982
|
-
import { jsx as
|
|
1343
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
983
1344
|
function MenuBadge({ className, ...props }) {
|
|
984
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ jsx38(
|
|
985
1346
|
ark23.div,
|
|
986
1347
|
{
|
|
987
1348
|
"data-slot": "sidebar-menu-badge",
|
|
@@ -996,7 +1357,7 @@ function MenuBadge({ className, ...props }) {
|
|
|
996
1357
|
import * as React3 from "react";
|
|
997
1358
|
import { ark as ark24 } from "@ark-ui/react/factory";
|
|
998
1359
|
import { sidebarStyles as sidebarStyles15, cn as cn38 } from "@cloudvoyant/helical-ui";
|
|
999
|
-
import { jsx as
|
|
1360
|
+
import { jsx as jsx39, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1000
1361
|
function MenuSkeleton({ className, showIcon = false, ...props }) {
|
|
1001
1362
|
const width = React3.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
1002
1363
|
return /* @__PURE__ */ jsxs9(
|
|
@@ -1007,14 +1368,14 @@ function MenuSkeleton({ className, showIcon = false, ...props }) {
|
|
|
1007
1368
|
className: cn38(sidebarStyles15.menuSkeletonClass, className),
|
|
1008
1369
|
...props,
|
|
1009
1370
|
children: [
|
|
1010
|
-
showIcon && /* @__PURE__ */
|
|
1371
|
+
showIcon && /* @__PURE__ */ jsx39(
|
|
1011
1372
|
ark24.div,
|
|
1012
1373
|
{
|
|
1013
1374
|
className: "size-4 shrink-0 animate-pulse rounded-md bg-sidebar-accent",
|
|
1014
1375
|
"data-sidebar": "menu-skeleton-icon"
|
|
1015
1376
|
}
|
|
1016
1377
|
),
|
|
1017
|
-
/* @__PURE__ */
|
|
1378
|
+
/* @__PURE__ */ jsx39(
|
|
1018
1379
|
ark24.div,
|
|
1019
1380
|
{
|
|
1020
1381
|
className: "h-4 max-w-(--skeleton-width) flex-1 animate-pulse rounded-md bg-sidebar-accent",
|
|
@@ -1030,9 +1391,9 @@ function MenuSkeleton({ className, showIcon = false, ...props }) {
|
|
|
1030
1391
|
// src/sidebar/MenuSub.tsx
|
|
1031
1392
|
import { ark as ark25 } from "@ark-ui/react/factory";
|
|
1032
1393
|
import { sidebarStyles as sidebarStyles16, cn as cn39 } from "@cloudvoyant/helical-ui";
|
|
1033
|
-
import { jsx as
|
|
1394
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1034
1395
|
function MenuSub({ className, ...props }) {
|
|
1035
|
-
return /* @__PURE__ */
|
|
1396
|
+
return /* @__PURE__ */ jsx40(
|
|
1036
1397
|
ark25.ul,
|
|
1037
1398
|
{
|
|
1038
1399
|
"data-slot": "sidebar-menu-sub",
|
|
@@ -1046,9 +1407,9 @@ function MenuSub({ className, ...props }) {
|
|
|
1046
1407
|
// src/sidebar/MenuSubItem.tsx
|
|
1047
1408
|
import { ark as ark26 } from "@ark-ui/react/factory";
|
|
1048
1409
|
import { sidebarStyles as sidebarStyles17, cn as cn40 } from "@cloudvoyant/helical-ui";
|
|
1049
|
-
import { jsx as
|
|
1410
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1050
1411
|
function MenuSubItem({ className, ...props }) {
|
|
1051
|
-
return /* @__PURE__ */
|
|
1412
|
+
return /* @__PURE__ */ jsx41(
|
|
1052
1413
|
ark26.li,
|
|
1053
1414
|
{
|
|
1054
1415
|
"data-slot": "sidebar-menu-sub-item",
|
|
@@ -1062,7 +1423,7 @@ function MenuSubItem({ className, ...props }) {
|
|
|
1062
1423
|
// src/sidebar/MenuSubButton.tsx
|
|
1063
1424
|
import { ark as ark27 } from "@ark-ui/react/factory";
|
|
1064
1425
|
import { sidebarStyles as sidebarStyles18, cn as cn41 } from "@cloudvoyant/helical-ui";
|
|
1065
|
-
import { jsx as
|
|
1426
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1066
1427
|
function MenuSubButton({
|
|
1067
1428
|
asChild = false,
|
|
1068
1429
|
size = "md",
|
|
@@ -1070,7 +1431,7 @@ function MenuSubButton({
|
|
|
1070
1431
|
className,
|
|
1071
1432
|
...props
|
|
1072
1433
|
}) {
|
|
1073
|
-
return /* @__PURE__ */
|
|
1434
|
+
return /* @__PURE__ */ jsx42(
|
|
1074
1435
|
ark27.a,
|
|
1075
1436
|
{
|
|
1076
1437
|
"data-slot": "sidebar-menu-sub-button",
|
|
@@ -1087,10 +1448,10 @@ function MenuSubButton({
|
|
|
1087
1448
|
// src/sidebar/Trigger.tsx
|
|
1088
1449
|
import { ark as ark28 } from "@ark-ui/react/factory";
|
|
1089
1450
|
import { sidebarStyles as sidebarStyles19, cn as cn42 } from "@cloudvoyant/helical-ui";
|
|
1090
|
-
import { jsx as
|
|
1451
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
1091
1452
|
function Trigger({ className, onClick, children, ...props }) {
|
|
1092
1453
|
const { toggleSidebar } = useSidebar();
|
|
1093
|
-
return /* @__PURE__ */
|
|
1454
|
+
return /* @__PURE__ */ jsx43(
|
|
1094
1455
|
ark28.button,
|
|
1095
1456
|
{
|
|
1096
1457
|
"data-sidebar": "trigger",
|
|
@@ -1111,10 +1472,10 @@ function Trigger({ className, onClick, children, ...props }) {
|
|
|
1111
1472
|
// src/sidebar/Rail.tsx
|
|
1112
1473
|
import { ark as ark29 } from "@ark-ui/react/factory";
|
|
1113
1474
|
import { sidebarStyles as sidebarStyles20, cn as cn43 } from "@cloudvoyant/helical-ui";
|
|
1114
|
-
import { jsx as
|
|
1475
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1115
1476
|
function Rail({ className, ...props }) {
|
|
1116
1477
|
const { toggleSidebar } = useSidebar();
|
|
1117
|
-
return /* @__PURE__ */
|
|
1478
|
+
return /* @__PURE__ */ jsx44(
|
|
1118
1479
|
ark29.button,
|
|
1119
1480
|
{
|
|
1120
1481
|
"data-sidebar": "rail",
|
|
@@ -1133,17 +1494,17 @@ function Rail({ className, ...props }) {
|
|
|
1133
1494
|
// src/sidebar/Inset.tsx
|
|
1134
1495
|
import { ark as ark30 } from "@ark-ui/react/factory";
|
|
1135
1496
|
import { sidebarStyles as sidebarStyles21, cn as cn44 } from "@cloudvoyant/helical-ui";
|
|
1136
|
-
import { jsx as
|
|
1497
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
1137
1498
|
function Inset({ className, ...props }) {
|
|
1138
|
-
return /* @__PURE__ */
|
|
1499
|
+
return /* @__PURE__ */ jsx45(ark30.main, { "data-slot": "sidebar-inset", className: cn44(sidebarStyles21.insetClass, className), ...props });
|
|
1139
1500
|
}
|
|
1140
1501
|
|
|
1141
1502
|
// src/sidebar/Input.tsx
|
|
1142
1503
|
import { ark as ark31 } from "@ark-ui/react/factory";
|
|
1143
1504
|
import { sidebarStyles as sidebarStyles22, cn as cn45 } from "@cloudvoyant/helical-ui";
|
|
1144
|
-
import { jsx as
|
|
1505
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
1145
1506
|
function Input({ className, ...props }) {
|
|
1146
|
-
return /* @__PURE__ */
|
|
1507
|
+
return /* @__PURE__ */ jsx46(
|
|
1147
1508
|
ark31.input,
|
|
1148
1509
|
{
|
|
1149
1510
|
"data-slot": "sidebar-input",
|
|
@@ -1173,21 +1534,21 @@ import {
|
|
|
1173
1534
|
tabsContentBase,
|
|
1174
1535
|
cn as cn46
|
|
1175
1536
|
} from "@cloudvoyant/helical-ui";
|
|
1176
|
-
import { jsx as
|
|
1537
|
+
import { jsx as jsx47, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1177
1538
|
function Tabs({ className, lazyMount = true, unmountOnExit = true, ...props }) {
|
|
1178
|
-
return /* @__PURE__ */
|
|
1539
|
+
return /* @__PURE__ */ jsx47(TabsRoot, { lazyMount, unmountOnExit, className: cn46(tabsRootBase, className), ...props });
|
|
1179
1540
|
}
|
|
1180
1541
|
function TabsList({ variant = "default", className, children, ...props }) {
|
|
1181
1542
|
return /* @__PURE__ */ jsxs10(TabList, { className: cn46(tabsListBase, tabsListVariants({ variant }), className), ...props, children: [
|
|
1182
1543
|
children,
|
|
1183
|
-
/* @__PURE__ */
|
|
1544
|
+
/* @__PURE__ */ jsx47(TabIndicator, { className: cn46(tabsIndicatorBase, tabsIndicatorVariants({ variant })) })
|
|
1184
1545
|
] });
|
|
1185
1546
|
}
|
|
1186
1547
|
function TabsTrigger({ className, ...props }) {
|
|
1187
|
-
return /* @__PURE__ */
|
|
1548
|
+
return /* @__PURE__ */ jsx47(TabTrigger, { className: cn46(tabsTriggerBase, className), ...props });
|
|
1188
1549
|
}
|
|
1189
1550
|
function TabsContent({ className, ...props }) {
|
|
1190
|
-
return /* @__PURE__ */
|
|
1551
|
+
return /* @__PURE__ */ jsx47(TabContent, { className: cn46(tabsContentBase, className), ...props });
|
|
1191
1552
|
}
|
|
1192
1553
|
var useTabs = useTabsContext;
|
|
1193
1554
|
|
|
@@ -1208,13 +1569,13 @@ import {
|
|
|
1208
1569
|
paginationEllipsisBase,
|
|
1209
1570
|
cn as cn47
|
|
1210
1571
|
} from "@cloudvoyant/helical-ui";
|
|
1211
|
-
import { jsx as
|
|
1572
|
+
import { jsx as jsx48, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1212
1573
|
function Pagination({ className, ...props }) {
|
|
1213
|
-
return /* @__PURE__ */
|
|
1574
|
+
return /* @__PURE__ */ jsx48(ArkPaginationRoot, { className: cn47(paginationRootBase, className), ...props });
|
|
1214
1575
|
}
|
|
1215
1576
|
function PaginationPrevious(props) {
|
|
1216
|
-
return /* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1577
|
+
return /* @__PURE__ */ jsx48(PaginationPrevTrigger, { asChild: true, ...props, children: /* @__PURE__ */ jsxs11(ark32.button, { className: cn47(paginationTriggerBase), children: [
|
|
1578
|
+
/* @__PURE__ */ jsx48(
|
|
1218
1579
|
"svg",
|
|
1219
1580
|
{
|
|
1220
1581
|
viewBox: "0 0 24 24",
|
|
@@ -1224,16 +1585,16 @@ function PaginationPrevious(props) {
|
|
|
1224
1585
|
strokeLinecap: "round",
|
|
1225
1586
|
strokeLinejoin: "round",
|
|
1226
1587
|
"aria-hidden": "true",
|
|
1227
|
-
children: /* @__PURE__ */
|
|
1588
|
+
children: /* @__PURE__ */ jsx48("path", { d: "m15 18-6-6 6-6" })
|
|
1228
1589
|
}
|
|
1229
1590
|
),
|
|
1230
1591
|
"Previous"
|
|
1231
1592
|
] }) });
|
|
1232
1593
|
}
|
|
1233
1594
|
function PaginationNext(props) {
|
|
1234
|
-
return /* @__PURE__ */
|
|
1595
|
+
return /* @__PURE__ */ jsx48(PaginationNextTrigger, { asChild: true, ...props, children: /* @__PURE__ */ jsxs11(ark32.button, { className: cn47(paginationTriggerBase), children: [
|
|
1235
1596
|
"Next",
|
|
1236
|
-
/* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ jsx48(
|
|
1237
1598
|
"svg",
|
|
1238
1599
|
{
|
|
1239
1600
|
viewBox: "0 0 24 24",
|
|
@@ -1243,21 +1604,21 @@ function PaginationNext(props) {
|
|
|
1243
1604
|
strokeLinecap: "round",
|
|
1244
1605
|
strokeLinejoin: "round",
|
|
1245
1606
|
"aria-hidden": "true",
|
|
1246
|
-
children: /* @__PURE__ */
|
|
1607
|
+
children: /* @__PURE__ */ jsx48("path", { d: "m9 18 6-6-6-6" })
|
|
1247
1608
|
}
|
|
1248
1609
|
)
|
|
1249
1610
|
] }) });
|
|
1250
1611
|
}
|
|
1251
1612
|
function PaginationItem({ className, children, ...rest }) {
|
|
1252
|
-
return /* @__PURE__ */
|
|
1613
|
+
return /* @__PURE__ */ jsx48(ArkPaginationItem, { asChild: true, ...rest, children: /* @__PURE__ */ jsx48(ark32.button, { className: cn47(paginationItemBase, className), children }) });
|
|
1253
1614
|
}
|
|
1254
1615
|
function PaginationItems() {
|
|
1255
|
-
return /* @__PURE__ */
|
|
1256
|
-
(page, index) => page.type === "page" ? /* @__PURE__ */
|
|
1616
|
+
return /* @__PURE__ */ jsx48(ArkPaginationContext, { children: ({ pages }) => pages.map(
|
|
1617
|
+
(page, index) => page.type === "page" ? /* @__PURE__ */ jsx48(PaginationItem, { type: "page", value: page.value, children: page.value }, page.value) : /* @__PURE__ */ jsx48(PaginationEllipsis, { index }, `ellipsis-${index}`)
|
|
1257
1618
|
) });
|
|
1258
1619
|
}
|
|
1259
1620
|
function PaginationEllipsis({ className, ...rest }) {
|
|
1260
|
-
return /* @__PURE__ */
|
|
1621
|
+
return /* @__PURE__ */ jsx48(ArkPaginationEllipsis, { className: cn47(paginationEllipsisBase, className), ...rest, children: /* @__PURE__ */ jsxs11(
|
|
1261
1622
|
"svg",
|
|
1262
1623
|
{
|
|
1263
1624
|
viewBox: "0 0 24 24",
|
|
@@ -1268,9 +1629,9 @@ function PaginationEllipsis({ className, ...rest }) {
|
|
|
1268
1629
|
strokeLinejoin: "round",
|
|
1269
1630
|
"aria-hidden": "true",
|
|
1270
1631
|
children: [
|
|
1271
|
-
/* @__PURE__ */
|
|
1272
|
-
/* @__PURE__ */
|
|
1273
|
-
/* @__PURE__ */
|
|
1632
|
+
/* @__PURE__ */ jsx48("circle", { cx: "12", cy: "12", r: "1" }),
|
|
1633
|
+
/* @__PURE__ */ jsx48("circle", { cx: "19", cy: "12", r: "1" }),
|
|
1634
|
+
/* @__PURE__ */ jsx48("circle", { cx: "5", cy: "12", r: "1" })
|
|
1274
1635
|
]
|
|
1275
1636
|
}
|
|
1276
1637
|
) });
|
|
@@ -1330,7 +1691,7 @@ import {
|
|
|
1330
1691
|
cn as cn48
|
|
1331
1692
|
} from "@cloudvoyant/helical-ui";
|
|
1332
1693
|
import { navbarMenuTriggerStyle as navbarMenuTriggerStyle2 } from "@cloudvoyant/helical-ui";
|
|
1333
|
-
import { Fragment as Fragment3, jsx as
|
|
1694
|
+
import { Fragment as Fragment3, jsx as jsx49, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1334
1695
|
var SCROLL_THRESHOLD = 24;
|
|
1335
1696
|
function resolveScrollContainer(el) {
|
|
1336
1697
|
for (let n = el; n; n = n.parentElement) {
|
|
@@ -1390,7 +1751,7 @@ function NavbarProvider({ defaultOpen = false, children }) {
|
|
|
1390
1751
|
}),
|
|
1391
1752
|
[id, open, scrolled, hovered, slots, setSlot]
|
|
1392
1753
|
);
|
|
1393
|
-
return /* @__PURE__ */
|
|
1754
|
+
return /* @__PURE__ */ jsx49(NavbarContext.Provider, { value: contextValue, children });
|
|
1394
1755
|
}
|
|
1395
1756
|
function Navbar({
|
|
1396
1757
|
variant = "sticky",
|
|
@@ -1426,7 +1787,7 @@ function Navbar({
|
|
|
1426
1787
|
el.style.overflow = prev;
|
|
1427
1788
|
};
|
|
1428
1789
|
}, [base.open]);
|
|
1429
|
-
return /* @__PURE__ */
|
|
1790
|
+
return /* @__PURE__ */ jsx49(NavbarContext.Provider, { value, children: /* @__PURE__ */ jsx49(
|
|
1430
1791
|
"header",
|
|
1431
1792
|
{
|
|
1432
1793
|
ref: headerRef,
|
|
@@ -1450,7 +1811,7 @@ function Navbar({
|
|
|
1450
1811
|
}
|
|
1451
1812
|
function NavbarActivationArea({ className, children, ...props }) {
|
|
1452
1813
|
const { setHovered } = useNavbar();
|
|
1453
|
-
return /* @__PURE__ */
|
|
1814
|
+
return /* @__PURE__ */ jsx49(
|
|
1454
1815
|
ark33.div,
|
|
1455
1816
|
{
|
|
1456
1817
|
"data-slot": "navbar-activation-area",
|
|
@@ -1464,7 +1825,7 @@ function NavbarActivationArea({ className, children, ...props }) {
|
|
|
1464
1825
|
}
|
|
1465
1826
|
function NavbarBrand({ className, children, ...props }) {
|
|
1466
1827
|
useNavbarSlot("brand", children);
|
|
1467
|
-
return /* @__PURE__ */
|
|
1828
|
+
return /* @__PURE__ */ jsx49(ark33.div, { "data-slot": "navbar-brand", className: cn48(navbarBrandBase, className), ...props, children });
|
|
1468
1829
|
}
|
|
1469
1830
|
function NavbarMenu({
|
|
1470
1831
|
placement = "center",
|
|
@@ -1474,7 +1835,7 @@ function NavbarMenu({
|
|
|
1474
1835
|
}) {
|
|
1475
1836
|
const { scrolled, density, variant } = useNavbar();
|
|
1476
1837
|
const menuDensity = density === "compact" || variant === "shrink" && scrolled ? "compact" : "relaxed";
|
|
1477
|
-
return /* @__PURE__ */
|
|
1838
|
+
return /* @__PURE__ */ jsx49(NavbarMenuStyleContext.Provider, { value: { density: menuDensity, variant: "default", inContent: false }, children: /* @__PURE__ */ jsx49(
|
|
1478
1839
|
ark33.div,
|
|
1479
1840
|
{
|
|
1480
1841
|
"data-slot": "navbar-menu",
|
|
@@ -1482,13 +1843,13 @@ function NavbarMenu({
|
|
|
1482
1843
|
className: cn48(navbarMenuBase, navbarMenuPlacementVariants({ placement }), className),
|
|
1483
1844
|
children: /* @__PURE__ */ jsxs12(ArkNavMenuRoot, { "data-density": menuDensity, className: cn48(navbarMenuRootBase), ...props, children: [
|
|
1484
1845
|
children,
|
|
1485
|
-
/* @__PURE__ */
|
|
1846
|
+
/* @__PURE__ */ jsx49(ArkNavMenuViewportPositioner, { className: cn48(navbarMenuViewportPositionerBase), children: /* @__PURE__ */ jsx49(ArkNavMenuViewport, { className: cn48(navbarMenuViewportBase) }) })
|
|
1486
1847
|
] })
|
|
1487
1848
|
}
|
|
1488
1849
|
) });
|
|
1489
1850
|
}
|
|
1490
1851
|
function NavbarMenuList({ className, children, ...props }) {
|
|
1491
|
-
return /* @__PURE__ */
|
|
1852
|
+
return /* @__PURE__ */ jsx49(ArkNavMenuList, { className: cn48(navbarMenuListBase, className), ...props, children });
|
|
1492
1853
|
}
|
|
1493
1854
|
function NavbarMenuItem({
|
|
1494
1855
|
variant = "default",
|
|
@@ -1496,11 +1857,11 @@ function NavbarMenuItem({
|
|
|
1496
1857
|
...props
|
|
1497
1858
|
}) {
|
|
1498
1859
|
const { density } = React4.useContext(NavbarMenuStyleContext);
|
|
1499
|
-
return /* @__PURE__ */
|
|
1860
|
+
return /* @__PURE__ */ jsx49(NavbarMenuStyleContext.Provider, { value: { density, variant, inContent: false }, children: /* @__PURE__ */ jsx49(ArkNavMenuItem, { "data-variant": variant, className: cn48(navbarMenuItemBase, className), ...props }) });
|
|
1500
1861
|
}
|
|
1501
1862
|
function NavbarMenuTrigger({ asChild, className, children, ...props }) {
|
|
1502
1863
|
const { density, variant } = React4.useContext(NavbarMenuStyleContext);
|
|
1503
|
-
const chevron = /* @__PURE__ */
|
|
1864
|
+
const chevron = /* @__PURE__ */ jsx49(
|
|
1504
1865
|
"svg",
|
|
1505
1866
|
{
|
|
1506
1867
|
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
@@ -1511,10 +1872,10 @@ function NavbarMenuTrigger({ asChild, className, children, ...props }) {
|
|
|
1511
1872
|
strokeWidth: "2",
|
|
1512
1873
|
strokeLinecap: "round",
|
|
1513
1874
|
strokeLinejoin: "round",
|
|
1514
|
-
children: /* @__PURE__ */
|
|
1875
|
+
children: /* @__PURE__ */ jsx49("path", { d: "m6 9 6 6 6-6" })
|
|
1515
1876
|
}
|
|
1516
1877
|
);
|
|
1517
|
-
return /* @__PURE__ */
|
|
1878
|
+
return /* @__PURE__ */ jsx49(
|
|
1518
1879
|
ArkNavMenuTrigger,
|
|
1519
1880
|
{
|
|
1520
1881
|
asChild,
|
|
@@ -1528,18 +1889,18 @@ function NavbarMenuTrigger({ asChild, className, children, ...props }) {
|
|
|
1528
1889
|
);
|
|
1529
1890
|
}
|
|
1530
1891
|
function NavbarMenuContent({ className, children, ...props }) {
|
|
1531
|
-
return /* @__PURE__ */
|
|
1892
|
+
return /* @__PURE__ */ jsx49(NavbarMenuStyleContext.Provider, { value: { density: "relaxed", variant: "default", inContent: true }, children: /* @__PURE__ */ jsx49(ArkNavMenuContent, { className: cn48(navbarMenuContentBase, className), ...props, children }) });
|
|
1532
1893
|
}
|
|
1533
1894
|
function NavbarMenuLink({ className, children, ...props }) {
|
|
1534
1895
|
const { density, variant, inContent } = React4.useContext(NavbarMenuStyleContext);
|
|
1535
1896
|
const classes = inContent ? cn48(navbarMenuLinkBase, className) : cn48(navbarMenuTriggerStyle({ density, variant }), className);
|
|
1536
|
-
return /* @__PURE__ */
|
|
1897
|
+
return /* @__PURE__ */ jsx49(ArkNavMenuLink, { className: classes, ...props, children });
|
|
1537
1898
|
}
|
|
1538
1899
|
function NavbarMobileMenu({ className, children, ...props }) {
|
|
1539
|
-
return /* @__PURE__ */
|
|
1900
|
+
return /* @__PURE__ */ jsx49(CollapsibleRoot, { "data-slot": "navbar-mobile-menu", className: cn48("group", className), ...props, children });
|
|
1540
1901
|
}
|
|
1541
1902
|
function NavbarMobileMenuTrigger({ className, children, ...props }) {
|
|
1542
|
-
return /* @__PURE__ */
|
|
1903
|
+
return /* @__PURE__ */ jsx49(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs12(
|
|
1543
1904
|
"button",
|
|
1544
1905
|
{
|
|
1545
1906
|
type: "button",
|
|
@@ -1548,7 +1909,7 @@ function NavbarMobileMenuTrigger({ className, children, ...props }) {
|
|
|
1548
1909
|
...props,
|
|
1549
1910
|
children: [
|
|
1550
1911
|
children,
|
|
1551
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ jsx49(
|
|
1552
1913
|
"svg",
|
|
1553
1914
|
{
|
|
1554
1915
|
className: "size-4 transition-transform duration-200 group-data-[state=open]:rotate-180",
|
|
@@ -1559,7 +1920,7 @@ function NavbarMobileMenuTrigger({ className, children, ...props }) {
|
|
|
1559
1920
|
strokeWidth: "2",
|
|
1560
1921
|
strokeLinecap: "round",
|
|
1561
1922
|
strokeLinejoin: "round",
|
|
1562
|
-
children: /* @__PURE__ */
|
|
1923
|
+
children: /* @__PURE__ */ jsx49("path", { d: "m6 9 6 6 6-6" })
|
|
1563
1924
|
}
|
|
1564
1925
|
)
|
|
1565
1926
|
]
|
|
@@ -1567,17 +1928,17 @@ function NavbarMobileMenuTrigger({ className, children, ...props }) {
|
|
|
1567
1928
|
) });
|
|
1568
1929
|
}
|
|
1569
1930
|
function NavbarMobileMenuContent({ className, children, ...props }) {
|
|
1570
|
-
return /* @__PURE__ */
|
|
1931
|
+
return /* @__PURE__ */ jsx49(CollapsibleContent, { children: /* @__PURE__ */ jsx49("div", { "data-slot": "navbar-mobile-menu-content", className: cn48(navbarMobileMenuContentBase, className), ...props, children }) });
|
|
1571
1932
|
}
|
|
1572
1933
|
function NavbarMenuViewport({ className, ...props }) {
|
|
1573
|
-
return /* @__PURE__ */
|
|
1934
|
+
return /* @__PURE__ */ jsx49(ArkNavMenuViewport, { className: cn48(navbarMenuViewportBase, className), ...props });
|
|
1574
1935
|
}
|
|
1575
1936
|
function NavbarMenuIndicator({ className, ...props }) {
|
|
1576
|
-
return /* @__PURE__ */
|
|
1937
|
+
return /* @__PURE__ */ jsx49(ArkNavMenuIndicator, { className: cn48(navbarMenuIndicatorBase, className), ...props });
|
|
1577
1938
|
}
|
|
1578
1939
|
function NavbarActions({ className, children, ...props }) {
|
|
1579
1940
|
useNavbarSlot("actions", children);
|
|
1580
|
-
return /* @__PURE__ */
|
|
1941
|
+
return /* @__PURE__ */ jsx49(ark33.div, { "data-slot": "navbar-actions", className: cn48(navbarActionsBase, className), ...props, children });
|
|
1581
1942
|
}
|
|
1582
1943
|
function NavbarTrigger({
|
|
1583
1944
|
className,
|
|
@@ -1586,7 +1947,7 @@ function NavbarTrigger({
|
|
|
1586
1947
|
...props
|
|
1587
1948
|
}) {
|
|
1588
1949
|
const { id, open, setOpen, floating } = useNavbar();
|
|
1589
|
-
return /* @__PURE__ */
|
|
1950
|
+
return /* @__PURE__ */ jsx49(
|
|
1590
1951
|
"button",
|
|
1591
1952
|
{
|
|
1592
1953
|
type: "button",
|
|
@@ -1609,9 +1970,9 @@ function NavbarTrigger({
|
|
|
1609
1970
|
strokeLinejoin: "round",
|
|
1610
1971
|
"aria-hidden": "true",
|
|
1611
1972
|
children: [
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
/* @__PURE__ */
|
|
1973
|
+
/* @__PURE__ */ jsx49("line", { x1: "4", x2: "20", y1: "6", y2: "6" }),
|
|
1974
|
+
/* @__PURE__ */ jsx49("line", { x1: "4", x2: "20", y1: "12", y2: "12" }),
|
|
1975
|
+
/* @__PURE__ */ jsx49("line", { x1: "4", x2: "20", y1: "18", y2: "18" })
|
|
1615
1976
|
]
|
|
1616
1977
|
}
|
|
1617
1978
|
)
|
|
@@ -1628,9 +1989,9 @@ function NavbarMobileOverlay({ className, children, ...props }) {
|
|
|
1628
1989
|
document.addEventListener("keydown", onKeydown);
|
|
1629
1990
|
return () => document.removeEventListener("keydown", onKeydown);
|
|
1630
1991
|
}, [open, setOpen]);
|
|
1631
|
-
return /* @__PURE__ */
|
|
1632
|
-
/* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1992
|
+
return /* @__PURE__ */ jsx49(Portal6, { container: portalRef, children: /* @__PURE__ */ jsxs12(DialogRoot, { open, lazyMount: true, unmountOnExit: true, onOpenChange: ({ open: open2 }) => setOpen(open2), preventScroll: false, children: [
|
|
1993
|
+
/* @__PURE__ */ jsx49(DialogBackdrop2, { className: "absolute inset-0 z-[100] bg-background/60 backdrop-blur-sm" }),
|
|
1994
|
+
/* @__PURE__ */ jsx49(DialogPositioner, { className: "absolute inset-0 z-[100]", children: /* @__PURE__ */ jsxs12(
|
|
1634
1995
|
DialogContent2,
|
|
1635
1996
|
{
|
|
1636
1997
|
id,
|
|
@@ -1638,17 +1999,17 @@ function NavbarMobileOverlay({ className, children, ...props }) {
|
|
|
1638
1999
|
className: cn48(navbarMobileContentBase, className),
|
|
1639
2000
|
...props,
|
|
1640
2001
|
children: [
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
2002
|
+
/* @__PURE__ */ jsx49(DialogTitle2, { className: "sr-only", children: "Navigation menu" }),
|
|
2003
|
+
/* @__PURE__ */ jsx49(DialogDescription2, { className: "sr-only", children: "Mobile navigation menu" }),
|
|
1643
2004
|
/* @__PURE__ */ jsxs12("div", { className: navbarMobileHeaderBase, children: [
|
|
1644
2005
|
slots.brand,
|
|
1645
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ jsx49(DialogCloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx49(
|
|
1646
2007
|
"button",
|
|
1647
2008
|
{
|
|
1648
2009
|
type: "button",
|
|
1649
2010
|
"aria-label": "Close navigation menu",
|
|
1650
2011
|
className: cn48(navbarTriggerVariants({ floating })),
|
|
1651
|
-
children: /* @__PURE__ */
|
|
2012
|
+
children: /* @__PURE__ */ jsx49(
|
|
1652
2013
|
"svg",
|
|
1653
2014
|
{
|
|
1654
2015
|
className: "size-4",
|
|
@@ -1659,14 +2020,14 @@ function NavbarMobileOverlay({ className, children, ...props }) {
|
|
|
1659
2020
|
strokeLinecap: "round",
|
|
1660
2021
|
strokeLinejoin: "round",
|
|
1661
2022
|
"aria-hidden": "true",
|
|
1662
|
-
children: /* @__PURE__ */
|
|
2023
|
+
children: /* @__PURE__ */ jsx49("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
1663
2024
|
}
|
|
1664
2025
|
)
|
|
1665
2026
|
}
|
|
1666
2027
|
) })
|
|
1667
2028
|
] }),
|
|
1668
|
-
/* @__PURE__ */
|
|
1669
|
-
slots.actions ? /* @__PURE__ */
|
|
2029
|
+
/* @__PURE__ */ jsx49("div", { className: navbarMobileMenuBase, children }),
|
|
2030
|
+
slots.actions ? /* @__PURE__ */ jsx49("div", { className: navbarMobileActionsBase, children: slots.actions }) : null
|
|
1670
2031
|
]
|
|
1671
2032
|
}
|
|
1672
2033
|
) })
|
|
@@ -1700,50 +2061,50 @@ import {
|
|
|
1700
2061
|
fieldsetErrorBase,
|
|
1701
2062
|
cn as cn49
|
|
1702
2063
|
} from "@cloudvoyant/helical-ui";
|
|
1703
|
-
import { jsx as
|
|
2064
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
1704
2065
|
function Field({ className, ...props }) {
|
|
1705
|
-
return /* @__PURE__ */
|
|
2066
|
+
return /* @__PURE__ */ jsx50(ArkFieldRoot, { className: cn49(fieldRootBase, className), ...props });
|
|
1706
2067
|
}
|
|
1707
2068
|
function FieldLabel({ className, ...props }) {
|
|
1708
|
-
return /* @__PURE__ */
|
|
2069
|
+
return /* @__PURE__ */ jsx50(ArkFieldLabel, { className: cn49(fieldLabelBase, className), ...props });
|
|
1709
2070
|
}
|
|
1710
2071
|
function FieldHelper({ className, ...props }) {
|
|
1711
|
-
return /* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ jsx50(ArkFieldHelperText, { className: cn49(fieldHelperBase, className), ...props });
|
|
1712
2073
|
}
|
|
1713
2074
|
function FieldError({ className, ...props }) {
|
|
1714
|
-
return /* @__PURE__ */
|
|
2075
|
+
return /* @__PURE__ */ jsx50(ArkFieldErrorText, { className: cn49(fieldErrorBase, className), ...props });
|
|
1715
2076
|
}
|
|
1716
2077
|
function FieldRequiredIndicator({ className, ...props }) {
|
|
1717
|
-
return /* @__PURE__ */
|
|
2078
|
+
return /* @__PURE__ */ jsx50(ArkFieldRequiredIndicator, { className: cn49(fieldRequiredIndicatorBase, className), ...props });
|
|
1718
2079
|
}
|
|
1719
2080
|
function FieldSet({ className, ...props }) {
|
|
1720
|
-
return /* @__PURE__ */
|
|
2081
|
+
return /* @__PURE__ */ jsx50(ArkFieldsetRoot, { className: cn49(fieldsetRootBase, className), ...props });
|
|
1721
2082
|
}
|
|
1722
2083
|
function FieldSetLegend({ className, ...props }) {
|
|
1723
|
-
return /* @__PURE__ */
|
|
2084
|
+
return /* @__PURE__ */ jsx50(ArkFieldsetLegend, { className: cn49(fieldsetLegendBase, className), ...props });
|
|
1724
2085
|
}
|
|
1725
2086
|
function FieldSetHelper({ className, ...props }) {
|
|
1726
|
-
return /* @__PURE__ */
|
|
2087
|
+
return /* @__PURE__ */ jsx50(ArkFieldsetHelperText, { className: cn49(fieldsetHelperBase, className), ...props });
|
|
1727
2088
|
}
|
|
1728
2089
|
function FieldSetError({ className, ...props }) {
|
|
1729
|
-
return /* @__PURE__ */
|
|
2090
|
+
return /* @__PURE__ */ jsx50(ArkFieldsetErrorText, { className: cn49(fieldsetErrorBase, className), ...props });
|
|
1730
2091
|
}
|
|
1731
2092
|
var useField = useFieldContext;
|
|
1732
2093
|
|
|
1733
2094
|
// src/input.tsx
|
|
1734
2095
|
import { FieldInput } from "@ark-ui/react/field";
|
|
1735
2096
|
import { inputVariants, cn as cn50 } from "@cloudvoyant/helical-ui";
|
|
1736
|
-
import { jsx as
|
|
2097
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
1737
2098
|
function Input2({ className, size, ...props }) {
|
|
1738
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ jsx51(FieldInput, { className: cn50(inputVariants({ size }), className), ...props });
|
|
1739
2100
|
}
|
|
1740
2101
|
|
|
1741
2102
|
// src/textarea.tsx
|
|
1742
2103
|
import { FieldTextarea } from "@ark-ui/react/field";
|
|
1743
2104
|
import { textareaBase, cn as cn51 } from "@cloudvoyant/helical-ui";
|
|
1744
|
-
import { jsx as
|
|
2105
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
1745
2106
|
function Textarea({ className, ...props }) {
|
|
1746
|
-
return /* @__PURE__ */
|
|
2107
|
+
return /* @__PURE__ */ jsx52(FieldTextarea, { className: cn51(textareaBase, className), ...props });
|
|
1747
2108
|
}
|
|
1748
2109
|
|
|
1749
2110
|
// src/number-input.tsx
|
|
@@ -1762,18 +2123,18 @@ import {
|
|
|
1762
2123
|
numberInputTriggerBase,
|
|
1763
2124
|
cn as cn52
|
|
1764
2125
|
} from "@cloudvoyant/helical-ui";
|
|
1765
|
-
import { jsx as
|
|
2126
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
1766
2127
|
function NumberInput({ className, ...props }) {
|
|
1767
|
-
return /* @__PURE__ */
|
|
2128
|
+
return /* @__PURE__ */ jsx53(ArkNumberInputRoot, { className: cn52(numberInputRootBase, className), ...props });
|
|
1768
2129
|
}
|
|
1769
2130
|
function NumberInputControl({ className, ...props }) {
|
|
1770
|
-
return /* @__PURE__ */
|
|
2131
|
+
return /* @__PURE__ */ jsx53(ArkNumberInputControl, { className: cn52(numberInputControlBase, className), ...props });
|
|
1771
2132
|
}
|
|
1772
2133
|
function NumberInputInput({ className, ...props }) {
|
|
1773
|
-
return /* @__PURE__ */
|
|
2134
|
+
return /* @__PURE__ */ jsx53(ArkNumberInputInput, { className: cn52(numberInputInputBase, className), ...props });
|
|
1774
2135
|
}
|
|
1775
2136
|
function NumberInputDecrement({ className, ...props }) {
|
|
1776
|
-
return /* @__PURE__ */
|
|
2137
|
+
return /* @__PURE__ */ jsx53(
|
|
1777
2138
|
ArkNumberInputDecrementTrigger,
|
|
1778
2139
|
{
|
|
1779
2140
|
"aria-label": "Decrement",
|
|
@@ -1783,7 +2144,7 @@ function NumberInputDecrement({ className, ...props }) {
|
|
|
1783
2144
|
);
|
|
1784
2145
|
}
|
|
1785
2146
|
function NumberInputIncrement({ className, ...props }) {
|
|
1786
|
-
return /* @__PURE__ */
|
|
2147
|
+
return /* @__PURE__ */ jsx53(
|
|
1787
2148
|
ArkNumberInputIncrementTrigger,
|
|
1788
2149
|
{
|
|
1789
2150
|
"aria-label": "Increment",
|
|
@@ -1795,7 +2156,7 @@ function NumberInputIncrement({ className, ...props }) {
|
|
|
1795
2156
|
var useNumberInput = useNumberInputContext;
|
|
1796
2157
|
|
|
1797
2158
|
// src/checkbox.tsx
|
|
1798
|
-
import { createContext as
|
|
2159
|
+
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
1799
2160
|
import {
|
|
1800
2161
|
CheckboxRoot as ArkCheckboxRoot,
|
|
1801
2162
|
CheckboxControl as ArkCheckboxControl,
|
|
@@ -1812,31 +2173,31 @@ import {
|
|
|
1812
2173
|
checkboxGroupBase,
|
|
1813
2174
|
cn as cn53
|
|
1814
2175
|
} from "@cloudvoyant/helical-ui";
|
|
1815
|
-
import { jsx as
|
|
1816
|
-
var CheckboxSizeContext =
|
|
2176
|
+
import { jsx as jsx54, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2177
|
+
var CheckboxSizeContext = createContext5("md");
|
|
1817
2178
|
function Checkbox({ className, size = "md", children, ...props }) {
|
|
1818
|
-
return /* @__PURE__ */
|
|
2179
|
+
return /* @__PURE__ */ jsx54(CheckboxSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxs13(ArkCheckboxRoot, { className: cn53("flex items-center gap-2", className), ...props, children: [
|
|
1819
2180
|
children,
|
|
1820
|
-
/* @__PURE__ */
|
|
2181
|
+
/* @__PURE__ */ jsx54(ArkCheckboxHiddenInput, {})
|
|
1821
2182
|
] }) });
|
|
1822
2183
|
}
|
|
1823
2184
|
function CheckboxControl({ className, ...props }) {
|
|
1824
|
-
const size =
|
|
1825
|
-
return /* @__PURE__ */
|
|
2185
|
+
const size = useContext5(CheckboxSizeContext);
|
|
2186
|
+
return /* @__PURE__ */ jsx54(ArkCheckboxControl, { className: cn53(checkboxVariants({ size }), className), ...props });
|
|
1826
2187
|
}
|
|
1827
2188
|
function CheckboxIndicator({ className, ...props }) {
|
|
1828
|
-
return /* @__PURE__ */
|
|
2189
|
+
return /* @__PURE__ */ jsx54(ArkCheckboxIndicator, { className: cn53(checkboxIndicatorBase, className), ...props });
|
|
1829
2190
|
}
|
|
1830
2191
|
function CheckboxLabel({ className, ...props }) {
|
|
1831
|
-
return /* @__PURE__ */
|
|
2192
|
+
return /* @__PURE__ */ jsx54(ArkCheckboxLabel, { className: cn53(checkboxLabelBase, className), ...props });
|
|
1832
2193
|
}
|
|
1833
2194
|
function CheckboxGroup({ className, ...props }) {
|
|
1834
|
-
return /* @__PURE__ */
|
|
2195
|
+
return /* @__PURE__ */ jsx54(ArkCheckboxGroup, { className: cn53(checkboxGroupBase, className), ...props });
|
|
1835
2196
|
}
|
|
1836
2197
|
var useCheckbox = useCheckboxContext;
|
|
1837
2198
|
|
|
1838
2199
|
// src/switch.tsx
|
|
1839
|
-
import { createContext as
|
|
2200
|
+
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
1840
2201
|
import {
|
|
1841
2202
|
SwitchRoot as ArkSwitchRoot,
|
|
1842
2203
|
SwitchControl as ArkSwitchControl,
|
|
@@ -1846,23 +2207,23 @@ import {
|
|
|
1846
2207
|
useSwitchContext
|
|
1847
2208
|
} from "@ark-ui/react/switch";
|
|
1848
2209
|
import { switchVariants, switchControlBase, switchThumbBase, switchLabelBase, cn as cn54 } from "@cloudvoyant/helical-ui";
|
|
1849
|
-
import { jsx as
|
|
1850
|
-
var SwitchSizeContext =
|
|
2210
|
+
import { jsx as jsx55, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2211
|
+
var SwitchSizeContext = createContext6("md");
|
|
1851
2212
|
function Switch({ className, size = "md", children, ...props }) {
|
|
1852
|
-
return /* @__PURE__ */
|
|
2213
|
+
return /* @__PURE__ */ jsx55(SwitchSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxs14(ArkSwitchRoot, { className: cn54("flex items-center gap-2", className), ...props, children: [
|
|
1853
2214
|
children,
|
|
1854
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ jsx55(ArkSwitchHiddenInput, {})
|
|
1855
2216
|
] }) });
|
|
1856
2217
|
}
|
|
1857
2218
|
function SwitchControl({ className, ...props }) {
|
|
1858
|
-
const size =
|
|
1859
|
-
return /* @__PURE__ */
|
|
2219
|
+
const size = useContext6(SwitchSizeContext);
|
|
2220
|
+
return /* @__PURE__ */ jsx55(ArkSwitchControl, { className: cn54(switchVariants({ size }), switchControlBase, className), ...props });
|
|
1860
2221
|
}
|
|
1861
2222
|
function SwitchThumb({ className, ...props }) {
|
|
1862
|
-
return /* @__PURE__ */
|
|
2223
|
+
return /* @__PURE__ */ jsx55(ArkSwitchThumb, { className: cn54(switchThumbBase, className), ...props });
|
|
1863
2224
|
}
|
|
1864
2225
|
function SwitchLabel({ className, ...props }) {
|
|
1865
|
-
return /* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ jsx55(ArkSwitchLabel, { className: cn54(switchLabelBase, className), ...props });
|
|
1866
2227
|
}
|
|
1867
2228
|
var useSwitch = useSwitchContext;
|
|
1868
2229
|
|
|
@@ -1906,9 +2267,9 @@ import {
|
|
|
1906
2267
|
} from "@cloudvoyant/helical-ui";
|
|
1907
2268
|
|
|
1908
2269
|
// src/use-media-query.ts
|
|
1909
|
-
import { useSyncExternalStore } from "react";
|
|
2270
|
+
import { useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
1910
2271
|
function useMediaQuery(query) {
|
|
1911
|
-
return
|
|
2272
|
+
return useSyncExternalStore2(
|
|
1912
2273
|
(onStoreChange) => {
|
|
1913
2274
|
const mql = window.matchMedia(query);
|
|
1914
2275
|
mql.addEventListener("change", onStoreChange);
|
|
@@ -1920,7 +2281,7 @@ function useMediaQuery(query) {
|
|
|
1920
2281
|
}
|
|
1921
2282
|
|
|
1922
2283
|
// src/select.tsx
|
|
1923
|
-
import { jsx as
|
|
2284
|
+
import { jsx as jsx56, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1924
2285
|
function Select({ items, collection, size, children, ...props }) {
|
|
1925
2286
|
const isCoarse = useMediaQuery("(pointer: coarse)");
|
|
1926
2287
|
const resolvedCollection = useMemo4(
|
|
@@ -1928,7 +2289,7 @@ function Select({ items, collection, size, children, ...props }) {
|
|
|
1928
2289
|
[collection, items]
|
|
1929
2290
|
);
|
|
1930
2291
|
if (isCoarse && items) {
|
|
1931
|
-
return /* @__PURE__ */
|
|
2292
|
+
return /* @__PURE__ */ jsx56(
|
|
1932
2293
|
SelectNative,
|
|
1933
2294
|
{
|
|
1934
2295
|
items,
|
|
@@ -1946,42 +2307,42 @@ function Select({ items, collection, size, children, ...props }) {
|
|
|
1946
2307
|
}
|
|
1947
2308
|
return /* @__PURE__ */ jsxs15(ArkSelectRoot, { collection: resolvedCollection, ...props, children: [
|
|
1948
2309
|
children,
|
|
1949
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ jsx56(ArkSelectHiddenSelect, {})
|
|
1950
2311
|
] });
|
|
1951
2312
|
}
|
|
1952
2313
|
function SelectTrigger({ size = "md", className, ...props }) {
|
|
1953
|
-
return /* @__PURE__ */
|
|
2314
|
+
return /* @__PURE__ */ jsx56(ArkSelectTrigger, { className: cn55(inputVariants2({ size }), selectTriggerBase, className), ...props });
|
|
1954
2315
|
}
|
|
1955
2316
|
function SelectValue({ className, ...props }) {
|
|
1956
|
-
return /* @__PURE__ */
|
|
2317
|
+
return /* @__PURE__ */ jsx56(ArkSelectValueText, { className: cn55(selectValueBase, className), ...props });
|
|
1957
2318
|
}
|
|
1958
2319
|
function SelectIndicator({ className, ...props }) {
|
|
1959
|
-
return /* @__PURE__ */
|
|
2320
|
+
return /* @__PURE__ */ jsx56(ArkSelectIndicator, { className: cn55(selectIndicatorBase, className), ...props });
|
|
1960
2321
|
}
|
|
1961
2322
|
function SelectClearTrigger({ className, ...props }) {
|
|
1962
|
-
return /* @__PURE__ */
|
|
2323
|
+
return /* @__PURE__ */ jsx56(ArkSelectClearTrigger, { "aria-label": "Clear selection", className: cn55(selectClearTriggerBase, className), ...props });
|
|
1963
2324
|
}
|
|
1964
2325
|
function SelectContent({ className, ...props }) {
|
|
1965
|
-
return /* @__PURE__ */
|
|
2326
|
+
return /* @__PURE__ */ jsx56(Portal7, { children: /* @__PURE__ */ jsx56(ArkSelectPositioner, { className: selectPositionerBase, children: /* @__PURE__ */ jsx56(ArkSelectContent, { className: cn55(selectContentBase, className), ...props }) }) });
|
|
1966
2327
|
}
|
|
1967
2328
|
function SelectItemGroup({ className, ...props }) {
|
|
1968
|
-
return /* @__PURE__ */
|
|
2329
|
+
return /* @__PURE__ */ jsx56(ArkSelectItemGroup, { className, ...props });
|
|
1969
2330
|
}
|
|
1970
2331
|
function SelectItemGroupLabel({ className, ...props }) {
|
|
1971
|
-
return /* @__PURE__ */
|
|
2332
|
+
return /* @__PURE__ */ jsx56(ArkSelectItemGroupLabel, { className: cn55(selectItemGroupLabelBase, className), ...props });
|
|
1972
2333
|
}
|
|
1973
2334
|
function SelectItem({ item, className, ...props }) {
|
|
1974
|
-
return /* @__PURE__ */
|
|
2335
|
+
return /* @__PURE__ */ jsx56(ArkSelectItem, { item, className: cn55(selectItemBase, className), ...props });
|
|
1975
2336
|
}
|
|
1976
2337
|
function SelectItemText({ className, ...props }) {
|
|
1977
|
-
return /* @__PURE__ */
|
|
2338
|
+
return /* @__PURE__ */ jsx56(ArkSelectItemText, { className: cn55(selectItemTextBase, className), ...props });
|
|
1978
2339
|
}
|
|
1979
2340
|
function SelectItemIndicator({ className, ...props }) {
|
|
1980
|
-
return /* @__PURE__ */
|
|
2341
|
+
return /* @__PURE__ */ jsx56(ArkSelectItemIndicator, { className: cn55(selectItemIndicatorBase, className), ...props });
|
|
1981
2342
|
}
|
|
1982
2343
|
var useSelect = useSelectContext;
|
|
1983
2344
|
function ChevronDownIcon() {
|
|
1984
|
-
return /* @__PURE__ */
|
|
2345
|
+
return /* @__PURE__ */ jsx56(
|
|
1985
2346
|
"svg",
|
|
1986
2347
|
{
|
|
1987
2348
|
viewBox: "0 0 24 24",
|
|
@@ -1991,7 +2352,7 @@ function ChevronDownIcon() {
|
|
|
1991
2352
|
strokeLinecap: "round",
|
|
1992
2353
|
strokeLinejoin: "round",
|
|
1993
2354
|
"aria-hidden": true,
|
|
1994
|
-
children: /* @__PURE__ */
|
|
2355
|
+
children: /* @__PURE__ */ jsx56("path", { d: "m6 9 6 6 6-6" })
|
|
1995
2356
|
}
|
|
1996
2357
|
);
|
|
1997
2358
|
}
|
|
@@ -2007,7 +2368,7 @@ function SelectNative({
|
|
|
2007
2368
|
...props
|
|
2008
2369
|
}) {
|
|
2009
2370
|
return /* @__PURE__ */ jsxs15(ark34.div, { className: cn55(nativeSelectWrapperBase, className), children: [
|
|
2010
|
-
/* @__PURE__ */
|
|
2371
|
+
/* @__PURE__ */ jsx56(
|
|
2011
2372
|
ark34.select,
|
|
2012
2373
|
{
|
|
2013
2374
|
className: nativeSelectVariants({ size }),
|
|
@@ -2016,10 +2377,10 @@ function SelectNative({
|
|
|
2016
2377
|
onChange: (event) => onValueChange?.(event.currentTarget.value),
|
|
2017
2378
|
"aria-invalid": invalid,
|
|
2018
2379
|
...props,
|
|
2019
|
-
children: items.map((item) => /* @__PURE__ */
|
|
2380
|
+
children: items.map((item) => /* @__PURE__ */ jsx56(ark34.option, { value: item.value, disabled: item.disabled, children: item.label }, item.value))
|
|
2020
2381
|
}
|
|
2021
2382
|
),
|
|
2022
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ jsx56(ark34.span, { className: nativeSelectIconBase, "aria-hidden": true, children: icon ?? /* @__PURE__ */ jsx56(ChevronDownIcon, {}) })
|
|
2023
2384
|
] });
|
|
2024
2385
|
}
|
|
2025
2386
|
|
|
@@ -2059,7 +2420,7 @@ import {
|
|
|
2059
2420
|
comboboxEmptyBase,
|
|
2060
2421
|
cn as cn56
|
|
2061
2422
|
} from "@cloudvoyant/helical-ui";
|
|
2062
|
-
import { jsx as
|
|
2423
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2063
2424
|
function Combobox({
|
|
2064
2425
|
items,
|
|
2065
2426
|
collection,
|
|
@@ -2072,7 +2433,7 @@ function Combobox({
|
|
|
2072
2433
|
() => collection ?? createListCollection2({ items: items ?? [] }),
|
|
2073
2434
|
[collection, items]
|
|
2074
2435
|
);
|
|
2075
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ jsx57(
|
|
2076
2437
|
ArkComboboxRoot,
|
|
2077
2438
|
{
|
|
2078
2439
|
collection: resolvedCollection,
|
|
@@ -2084,28 +2445,28 @@ function Combobox({
|
|
|
2084
2445
|
);
|
|
2085
2446
|
}
|
|
2086
2447
|
function ComboboxControl({ className, ...props }) {
|
|
2087
|
-
return /* @__PURE__ */
|
|
2448
|
+
return /* @__PURE__ */ jsx57(ArkComboboxControl, { className: cn56(comboboxControlBase, className), ...props });
|
|
2088
2449
|
}
|
|
2089
2450
|
function ComboboxInput({ size = "md", className, ...props }) {
|
|
2090
|
-
return /* @__PURE__ */
|
|
2451
|
+
return /* @__PURE__ */ jsx57(ArkComboboxInput, { className: cn56(inputVariants3({ size }), comboboxInputBase, className), ...props });
|
|
2091
2452
|
}
|
|
2092
2453
|
function ComboboxTrigger({ className, ...props }) {
|
|
2093
|
-
return /* @__PURE__ */
|
|
2454
|
+
return /* @__PURE__ */ jsx57(ArkComboboxTrigger, { className: cn56(comboboxTriggerBase, className), ...props });
|
|
2094
2455
|
}
|
|
2095
2456
|
function ComboboxClear({ className, ...props }) {
|
|
2096
|
-
return /* @__PURE__ */
|
|
2457
|
+
return /* @__PURE__ */ jsx57(ArkComboboxClearTrigger, { "aria-label": "Clear", className: cn56(comboboxClearTriggerBase, className), ...props });
|
|
2097
2458
|
}
|
|
2098
2459
|
function ComboboxContent({ className, ...props }) {
|
|
2099
|
-
return /* @__PURE__ */
|
|
2460
|
+
return /* @__PURE__ */ jsx57(Portal8, { children: /* @__PURE__ */ jsx57(ArkComboboxPositioner, { className: comboboxPositionerBase, children: /* @__PURE__ */ jsx57(ArkComboboxContent, { className: cn56(comboboxContentBase, className), ...props }) }) });
|
|
2100
2461
|
}
|
|
2101
2462
|
function ComboboxItemGroup({ className, ...props }) {
|
|
2102
|
-
return /* @__PURE__ */
|
|
2463
|
+
return /* @__PURE__ */ jsx57(ArkComboboxItemGroup, { className, ...props });
|
|
2103
2464
|
}
|
|
2104
2465
|
function ComboboxItemGroupLabel({ className, ...props }) {
|
|
2105
|
-
return /* @__PURE__ */
|
|
2466
|
+
return /* @__PURE__ */ jsx57(ArkComboboxItemGroupLabel, { className: cn56(comboboxItemGroupLabelBase, className), ...props });
|
|
2106
2467
|
}
|
|
2107
2468
|
function ComboboxItem({ item, showIndicator = true, className, ...props }) {
|
|
2108
|
-
return /* @__PURE__ */
|
|
2469
|
+
return /* @__PURE__ */ jsx57(
|
|
2109
2470
|
ArkComboboxItem,
|
|
2110
2471
|
{
|
|
2111
2472
|
item,
|
|
@@ -2116,16 +2477,16 @@ function ComboboxItem({ item, showIndicator = true, className, ...props }) {
|
|
|
2116
2477
|
);
|
|
2117
2478
|
}
|
|
2118
2479
|
function ComboboxItemText({ className, ...props }) {
|
|
2119
|
-
return /* @__PURE__ */
|
|
2480
|
+
return /* @__PURE__ */ jsx57(ArkComboboxItemText, { className, ...props });
|
|
2120
2481
|
}
|
|
2121
2482
|
function ComboboxItemIndicator({ className, ...props }) {
|
|
2122
|
-
return /* @__PURE__ */
|
|
2483
|
+
return /* @__PURE__ */ jsx57(ArkComboboxItemIndicator, { className: cn56(comboboxItemIndicatorBase, className), ...props });
|
|
2123
2484
|
}
|
|
2124
2485
|
function ComboboxList({ className, ...props }) {
|
|
2125
|
-
return /* @__PURE__ */
|
|
2486
|
+
return /* @__PURE__ */ jsx57(ArkComboboxList, { className: cn56(comboboxListBase, className), ...props });
|
|
2126
2487
|
}
|
|
2127
2488
|
function ComboboxEmpty({ className, children, ...props }) {
|
|
2128
|
-
return /* @__PURE__ */
|
|
2489
|
+
return /* @__PURE__ */ jsx57(ArkComboboxEmpty, { className: cn56(comboboxEmptyBase, className), ...props, children: children ?? "No results found." });
|
|
2129
2490
|
}
|
|
2130
2491
|
var useCombobox = useComboboxContext;
|
|
2131
2492
|
|
|
@@ -2155,33 +2516,33 @@ import {
|
|
|
2155
2516
|
tagsInputClearTriggerBase,
|
|
2156
2517
|
cn as cn57
|
|
2157
2518
|
} from "@cloudvoyant/helical-ui";
|
|
2158
|
-
import { jsx as
|
|
2519
|
+
import { jsx as jsx58, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2159
2520
|
function TagInput({ className, editable = false, children, ...props }) {
|
|
2160
2521
|
return /* @__PURE__ */ jsxs16(ArkTagsInputRoot, { className: cn57(tagsInputRootBase, className), editable, ...props, children: [
|
|
2161
2522
|
children,
|
|
2162
|
-
/* @__PURE__ */
|
|
2523
|
+
/* @__PURE__ */ jsx58(ArkTagsInputHiddenInput, {})
|
|
2163
2524
|
] });
|
|
2164
2525
|
}
|
|
2165
2526
|
function TagInputControl({ className, ...props }) {
|
|
2166
|
-
return /* @__PURE__ */
|
|
2527
|
+
return /* @__PURE__ */ jsx58(ArkTagsInputControl, { className: cn57(tagsInputControlBase, className), ...props });
|
|
2167
2528
|
}
|
|
2168
2529
|
function TagInputInput({ className, ...props }) {
|
|
2169
|
-
return /* @__PURE__ */
|
|
2530
|
+
return /* @__PURE__ */ jsx58(ArkTagsInputInput, { className: cn57(tagsInputInputBase, className), ...props });
|
|
2170
2531
|
}
|
|
2171
2532
|
function TagInputItem({ className, ...props }) {
|
|
2172
|
-
return /* @__PURE__ */
|
|
2533
|
+
return /* @__PURE__ */ jsx58(ArkTagsInputItem, { className: cn57(tagsInputItemBase, className), ...props });
|
|
2173
2534
|
}
|
|
2174
2535
|
function TagInputItemPreview({ className, ...props }) {
|
|
2175
|
-
return /* @__PURE__ */
|
|
2536
|
+
return /* @__PURE__ */ jsx58(ArkTagsInputItemPreview, { className, ...props });
|
|
2176
2537
|
}
|
|
2177
2538
|
function TagInputItemText({ className, ...props }) {
|
|
2178
|
-
return /* @__PURE__ */
|
|
2539
|
+
return /* @__PURE__ */ jsx58(ArkTagsInputItemText, { className: cn57(tagsInputItemTextBase, className), ...props });
|
|
2179
2540
|
}
|
|
2180
2541
|
function TagInputItemInput({ className, ...props }) {
|
|
2181
|
-
return /* @__PURE__ */
|
|
2542
|
+
return /* @__PURE__ */ jsx58(ArkTagsInputItemInput, { className: cn57(tagsInputItemInputBase, className), ...props });
|
|
2182
2543
|
}
|
|
2183
2544
|
function TagInputItemDeleteTrigger({ className, ...props }) {
|
|
2184
|
-
return /* @__PURE__ */
|
|
2545
|
+
return /* @__PURE__ */ jsx58(
|
|
2185
2546
|
ArkTagsInputItemDeleteTrigger,
|
|
2186
2547
|
{
|
|
2187
2548
|
"aria-label": "Remove tag",
|
|
@@ -2191,7 +2552,7 @@ function TagInputItemDeleteTrigger({ className, ...props }) {
|
|
|
2191
2552
|
);
|
|
2192
2553
|
}
|
|
2193
2554
|
function TagInputClearTrigger({ className, ...props }) {
|
|
2194
|
-
return /* @__PURE__ */
|
|
2555
|
+
return /* @__PURE__ */ jsx58(
|
|
2195
2556
|
ArkTagsInputClearTrigger,
|
|
2196
2557
|
{
|
|
2197
2558
|
"aria-label": "Clear all tags",
|
|
@@ -2204,7 +2565,7 @@ var TagInputContext = ArkTagsInputContext;
|
|
|
2204
2565
|
var useTagInput = useTagsInputContext;
|
|
2205
2566
|
|
|
2206
2567
|
// src/mermaid.tsx
|
|
2207
|
-
import { useEffect as
|
|
2568
|
+
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
2208
2569
|
import { ark as ark35 } from "@ark-ui/react/factory";
|
|
2209
2570
|
import {
|
|
2210
2571
|
mermaidRootBase,
|
|
@@ -2215,12 +2576,12 @@ import {
|
|
|
2215
2576
|
mermaidSvgAspectRatio,
|
|
2216
2577
|
cn as cn58
|
|
2217
2578
|
} from "@cloudvoyant/helical-ui";
|
|
2218
|
-
import { Fragment as Fragment4, jsx as
|
|
2579
|
+
import { Fragment as Fragment4, jsx as jsx59, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2219
2580
|
function Mermaid({ code, svg, className, ...props }) {
|
|
2220
2581
|
const [status, setStatus] = useState3(svg === void 0 ? "loading" : "done");
|
|
2221
2582
|
const [rendered, setRendered] = useState3(svg ?? null);
|
|
2222
2583
|
const aspectRatio = rendered === null ? void 0 : mermaidSvgAspectRatio(rendered);
|
|
2223
|
-
|
|
2584
|
+
useEffect4(() => {
|
|
2224
2585
|
if (svg !== void 0) return;
|
|
2225
2586
|
let cancelled = false;
|
|
2226
2587
|
setStatus("loading");
|
|
@@ -2237,7 +2598,7 @@ function Mermaid({ code, svg, className, ...props }) {
|
|
|
2237
2598
|
cancelled = true;
|
|
2238
2599
|
};
|
|
2239
2600
|
}, [code, svg]);
|
|
2240
|
-
return /* @__PURE__ */
|
|
2601
|
+
return /* @__PURE__ */ jsx59(
|
|
2241
2602
|
ark35.div,
|
|
2242
2603
|
{
|
|
2243
2604
|
...props,
|
|
@@ -2246,22 +2607,22 @@ function Mermaid({ code, svg, className, ...props }) {
|
|
|
2246
2607
|
"data-mermaid-state": status,
|
|
2247
2608
|
style: aspectRatio === void 0 ? props.style : { ...props.style, aspectRatio },
|
|
2248
2609
|
className: cn58(mermaidRootBase, className),
|
|
2249
|
-
children: rendered === null ? status === "error" ? /* @__PURE__ */
|
|
2610
|
+
children: rendered === null ? status === "error" ? /* @__PURE__ */ jsx59("pre", { className: mermaidSourceBase, children: code }) : /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
2250
2611
|
/* @__PURE__ */ jsxs17("div", { className: mermaidLoadingBase, role: "status", "aria-label": "Rendering diagram", "data-mermaid-loading": true, children: [
|
|
2251
|
-
/* @__PURE__ */
|
|
2612
|
+
/* @__PURE__ */ jsx59(
|
|
2252
2613
|
"span",
|
|
2253
2614
|
{
|
|
2254
2615
|
"aria-hidden": "true",
|
|
2255
2616
|
className: "h-5 w-5 shrink-0 animate-spin rounded-full border-2 border-muted-foreground/25 border-t-muted-foreground"
|
|
2256
2617
|
}
|
|
2257
2618
|
),
|
|
2258
|
-
/* @__PURE__ */
|
|
2619
|
+
/* @__PURE__ */ jsx59("span", { className: "text-sm text-muted-foreground", children: "Rendering diagram" })
|
|
2259
2620
|
] }),
|
|
2260
2621
|
/* @__PURE__ */ jsxs17("noscript", { children: [
|
|
2261
|
-
/* @__PURE__ */
|
|
2262
|
-
/* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ jsx59("style", { children: "[data-mermaid-loading]{display:none}" }),
|
|
2623
|
+
/* @__PURE__ */ jsx59("pre", { className: mermaidSourceBase, children: code })
|
|
2263
2624
|
] })
|
|
2264
|
-
] }) : /* @__PURE__ */
|
|
2625
|
+
] }) : /* @__PURE__ */ jsx59("div", { className: mermaidSvgBase, dangerouslySetInnerHTML: { __html: rendered } })
|
|
2265
2626
|
}
|
|
2266
2627
|
);
|
|
2267
2628
|
}
|
|
@@ -2269,7 +2630,7 @@ function Mermaid({ code, svg, className, ...props }) {
|
|
|
2269
2630
|
// src/clipboard.tsx
|
|
2270
2631
|
import { ClipboardRoot, ClipboardTrigger, ClipboardIndicator } from "@ark-ui/react/clipboard";
|
|
2271
2632
|
import { clipboardTriggerBase, cn as cn59 } from "@cloudvoyant/helical-ui";
|
|
2272
|
-
import { jsx as
|
|
2633
|
+
import { jsx as jsx60, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2273
2634
|
function CopyIcon() {
|
|
2274
2635
|
return /* @__PURE__ */ jsxs18(
|
|
2275
2636
|
"svg",
|
|
@@ -2283,14 +2644,14 @@ function CopyIcon() {
|
|
|
2283
2644
|
strokeLinejoin: "round",
|
|
2284
2645
|
"aria-hidden": "true",
|
|
2285
2646
|
children: [
|
|
2286
|
-
/* @__PURE__ */
|
|
2287
|
-
/* @__PURE__ */
|
|
2647
|
+
/* @__PURE__ */ jsx60("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
2648
|
+
/* @__PURE__ */ jsx60("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
2288
2649
|
]
|
|
2289
2650
|
}
|
|
2290
2651
|
);
|
|
2291
2652
|
}
|
|
2292
2653
|
function CheckIcon() {
|
|
2293
|
-
return /* @__PURE__ */
|
|
2654
|
+
return /* @__PURE__ */ jsx60(
|
|
2294
2655
|
"svg",
|
|
2295
2656
|
{
|
|
2296
2657
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2301,12 +2662,12 @@ function CheckIcon() {
|
|
|
2301
2662
|
strokeLinecap: "round",
|
|
2302
2663
|
strokeLinejoin: "round",
|
|
2303
2664
|
"aria-hidden": "true",
|
|
2304
|
-
children: /* @__PURE__ */
|
|
2665
|
+
children: /* @__PURE__ */ jsx60("path", { d: "M20 6 9 17l-5-5" })
|
|
2305
2666
|
}
|
|
2306
2667
|
);
|
|
2307
2668
|
}
|
|
2308
2669
|
function CopyButton({ value, label = "Copy", className, ...props }) {
|
|
2309
|
-
return /* @__PURE__ */
|
|
2670
|
+
return /* @__PURE__ */ jsx60(ClipboardRoot, { value, ...props, children: /* @__PURE__ */ jsx60(ClipboardTrigger, { className: cn59(clipboardTriggerBase, className), "aria-label": label, children: /* @__PURE__ */ jsx60(ClipboardIndicator, { copied: /* @__PURE__ */ jsx60(CheckIcon, {}), children: /* @__PURE__ */ jsx60(CopyIcon, {}) }) }) });
|
|
2310
2671
|
}
|
|
2311
2672
|
|
|
2312
2673
|
// src/radio-group.tsx
|
|
@@ -2320,15 +2681,15 @@ import {
|
|
|
2320
2681
|
useRadioGroupItemContext
|
|
2321
2682
|
} from "@ark-ui/react/radio-group";
|
|
2322
2683
|
import { radioGroupRootBase, radioGroupItemControlBase, radioGroupItemTextBase, cn as cn60 } from "@cloudvoyant/helical-ui";
|
|
2323
|
-
import { jsx as
|
|
2684
|
+
import { jsx as jsx61, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2324
2685
|
function RadioGroup({ className, ...props }) {
|
|
2325
|
-
return /* @__PURE__ */
|
|
2686
|
+
return /* @__PURE__ */ jsx61(RadioGroupRoot, { className: cn60(radioGroupRootBase, className), ...props });
|
|
2326
2687
|
}
|
|
2327
2688
|
function RadioGroupItem({ className, children, ...props }) {
|
|
2328
2689
|
return /* @__PURE__ */ jsxs19(ArkRadioGroupItem, { className: cn60("flex cursor-pointer items-center gap-2.5", className), ...props, children: [
|
|
2329
|
-
/* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2331
|
-
/* @__PURE__ */
|
|
2690
|
+
/* @__PURE__ */ jsx61(RadioGroupItemControl, { className: radioGroupItemControlBase, children: /* @__PURE__ */ jsx61("span", { className: "size-1.5 rounded-full bg-current hidden [[data-state=checked]>&]:block" }) }),
|
|
2691
|
+
/* @__PURE__ */ jsx61(RadioGroupItemText, { className: radioGroupItemTextBase, children }),
|
|
2692
|
+
/* @__PURE__ */ jsx61(RadioGroupItemHiddenInput, {})
|
|
2332
2693
|
] });
|
|
2333
2694
|
}
|
|
2334
2695
|
var useRadioGroup = useRadioGroupContext;
|
|
@@ -2336,7 +2697,7 @@ var useRadioGroup = useRadioGroupContext;
|
|
|
2336
2697
|
// src/notice.tsx
|
|
2337
2698
|
import { ark as ark36 } from "@ark-ui/react/factory";
|
|
2338
2699
|
import { noticeVariants, noticeTitleBase, noticeDescriptionBase, cn as cn61 } from "@cloudvoyant/helical-ui";
|
|
2339
|
-
import { jsx as
|
|
2700
|
+
import { jsx as jsx62, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2340
2701
|
function InfoIcon() {
|
|
2341
2702
|
return /* @__PURE__ */ jsxs20(
|
|
2342
2703
|
"svg",
|
|
@@ -2350,9 +2711,9 @@ function InfoIcon() {
|
|
|
2350
2711
|
strokeLinejoin: "round",
|
|
2351
2712
|
"aria-hidden": "true",
|
|
2352
2713
|
children: [
|
|
2353
|
-
/* @__PURE__ */
|
|
2354
|
-
/* @__PURE__ */
|
|
2355
|
-
/* @__PURE__ */
|
|
2714
|
+
/* @__PURE__ */ jsx62("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2715
|
+
/* @__PURE__ */ jsx62("path", { d: "M12 16v-4" }),
|
|
2716
|
+
/* @__PURE__ */ jsx62("path", { d: "M12 8h.01" })
|
|
2356
2717
|
]
|
|
2357
2718
|
}
|
|
2358
2719
|
);
|
|
@@ -2370,8 +2731,8 @@ function CheckCircleIcon() {
|
|
|
2370
2731
|
strokeLinejoin: "round",
|
|
2371
2732
|
"aria-hidden": "true",
|
|
2372
2733
|
children: [
|
|
2373
|
-
/* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2734
|
+
/* @__PURE__ */ jsx62("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2735
|
+
/* @__PURE__ */ jsx62("path", { d: "m9 12 2 2 4-4" })
|
|
2375
2736
|
]
|
|
2376
2737
|
}
|
|
2377
2738
|
);
|
|
@@ -2389,9 +2750,9 @@ function TriangleAlertIcon() {
|
|
|
2389
2750
|
strokeLinejoin: "round",
|
|
2390
2751
|
"aria-hidden": "true",
|
|
2391
2752
|
children: [
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
/* @__PURE__ */
|
|
2753
|
+
/* @__PURE__ */ jsx62("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
2754
|
+
/* @__PURE__ */ jsx62("path", { d: "M12 9v4" }),
|
|
2755
|
+
/* @__PURE__ */ jsx62("path", { d: "M12 17h.01" })
|
|
2395
2756
|
]
|
|
2396
2757
|
}
|
|
2397
2758
|
);
|
|
@@ -2409,9 +2770,9 @@ function CircleXIcon() {
|
|
|
2409
2770
|
strokeLinejoin: "round",
|
|
2410
2771
|
"aria-hidden": "true",
|
|
2411
2772
|
children: [
|
|
2412
|
-
/* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */
|
|
2414
|
-
/* @__PURE__ */
|
|
2773
|
+
/* @__PURE__ */ jsx62("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2774
|
+
/* @__PURE__ */ jsx62("path", { d: "m15 9-6 6" }),
|
|
2775
|
+
/* @__PURE__ */ jsx62("path", { d: "m9 9 6 6" })
|
|
2415
2776
|
]
|
|
2416
2777
|
}
|
|
2417
2778
|
);
|
|
@@ -2426,29 +2787,29 @@ function Notice({ variant = "info", title, children, className, ...props }) {
|
|
|
2426
2787
|
const Icon = variant !== null && variant !== void 0 && variant !== "none" ? noticeIcons[variant] : null;
|
|
2427
2788
|
const role = variant === "error" ? "alert" : variant === "none" ? void 0 : "status";
|
|
2428
2789
|
return /* @__PURE__ */ jsxs20(ark36.div, { role, className: cn61(noticeVariants({ variant }), className), ...props, children: [
|
|
2429
|
-
Icon ? /* @__PURE__ */
|
|
2430
|
-
title ? /* @__PURE__ */
|
|
2431
|
-
children ? /* @__PURE__ */
|
|
2790
|
+
Icon ? /* @__PURE__ */ jsx62(Icon, {}) : null,
|
|
2791
|
+
title ? /* @__PURE__ */ jsx62(ark36.div, { className: noticeTitleBase, children: title }) : null,
|
|
2792
|
+
children ? /* @__PURE__ */ jsx62(ark36.div, { className: noticeDescriptionBase, children }) : null
|
|
2432
2793
|
] });
|
|
2433
2794
|
}
|
|
2434
2795
|
|
|
2435
2796
|
// src/figure.tsx
|
|
2436
2797
|
import { ark as ark37 } from "@ark-ui/react/factory";
|
|
2437
2798
|
import { figureRootBase, figureImageBase, figureCaptionBase, cn as cn62 } from "@cloudvoyant/helical-ui";
|
|
2438
|
-
import { jsx as
|
|
2799
|
+
import { jsx as jsx63, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2439
2800
|
function Figure({ src, alt, img, caption, className, ...props }) {
|
|
2440
2801
|
return /* @__PURE__ */ jsxs21(ark37.figure, { className: cn62(figureRootBase, className), ...props, children: [
|
|
2441
|
-
img ?? (src ? /* @__PURE__ */
|
|
2442
|
-
caption ? /* @__PURE__ */
|
|
2802
|
+
img ?? (src ? /* @__PURE__ */ jsx63(ark37.img, { src, alt, loading: "lazy", className: figureImageBase }) : null),
|
|
2803
|
+
caption ? /* @__PURE__ */ jsx63(ark37.figcaption, { className: figureCaptionBase, children: caption }) : null
|
|
2443
2804
|
] });
|
|
2444
2805
|
}
|
|
2445
2806
|
|
|
2446
2807
|
// src/reveal.tsx
|
|
2447
2808
|
import { CollapsibleRoot as CollapsibleRoot2, CollapsibleTrigger as CollapsibleTrigger2, CollapsibleContent as CollapsibleContent2 } from "@ark-ui/react/collapsible";
|
|
2448
2809
|
import { revealRootBase, revealTriggerBase, revealChevronBase, revealContentBase, cn as cn63 } from "@cloudvoyant/helical-ui";
|
|
2449
|
-
import { jsx as
|
|
2810
|
+
import { jsx as jsx64, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2450
2811
|
function ChevronRightIcon({ className }) {
|
|
2451
|
-
return /* @__PURE__ */
|
|
2812
|
+
return /* @__PURE__ */ jsx64(
|
|
2452
2813
|
"svg",
|
|
2453
2814
|
{
|
|
2454
2815
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2460,17 +2821,17 @@ function ChevronRightIcon({ className }) {
|
|
|
2460
2821
|
strokeLinejoin: "round",
|
|
2461
2822
|
"aria-hidden": "true",
|
|
2462
2823
|
className,
|
|
2463
|
-
children: /* @__PURE__ */
|
|
2824
|
+
children: /* @__PURE__ */ jsx64("path", { d: "m9 18 6-6-6-6" })
|
|
2464
2825
|
}
|
|
2465
2826
|
);
|
|
2466
2827
|
}
|
|
2467
2828
|
function Reveal({ question, children, className, ...props }) {
|
|
2468
2829
|
return /* @__PURE__ */ jsxs22(CollapsibleRoot2, { className: cn63(revealRootBase, className), ...props, children: [
|
|
2469
2830
|
/* @__PURE__ */ jsxs22(CollapsibleTrigger2, { className: revealTriggerBase, children: [
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
/* @__PURE__ */
|
|
2831
|
+
/* @__PURE__ */ jsx64(ChevronRightIcon, { className: revealChevronBase }),
|
|
2832
|
+
/* @__PURE__ */ jsx64("span", { children: question })
|
|
2472
2833
|
] }),
|
|
2473
|
-
/* @__PURE__ */
|
|
2834
|
+
/* @__PURE__ */ jsx64(CollapsibleContent2, { className: revealContentBase, children })
|
|
2474
2835
|
] });
|
|
2475
2836
|
}
|
|
2476
2837
|
|
|
@@ -2485,31 +2846,31 @@ import {
|
|
|
2485
2846
|
prevNextSpacerBase,
|
|
2486
2847
|
cn as cn64
|
|
2487
2848
|
} from "@cloudvoyant/helical-ui";
|
|
2488
|
-
import { jsx as
|
|
2849
|
+
import { jsx as jsx65, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2489
2850
|
function PrevNext({ prev, next, className, ...props }) {
|
|
2490
2851
|
if (!prev && !next) return null;
|
|
2491
2852
|
return /* @__PURE__ */ jsxs23(ark38.nav, { className: cn64(prevNextRootBase, className), "aria-label": "Previous and next pages", ...props, children: [
|
|
2492
2853
|
prev ? /* @__PURE__ */ jsxs23(ark38.a, { href: prev.href, className: prevNextLinkBase, children: [
|
|
2493
|
-
/* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ jsx65(ark38.span, { className: prevNextDirectionBase, children: "Previous" }),
|
|
2494
2855
|
/* @__PURE__ */ jsxs23(ark38.span, { className: prevNextTitleBase, children: [
|
|
2495
2856
|
"\u2190 ",
|
|
2496
2857
|
prev.title
|
|
2497
2858
|
] })
|
|
2498
|
-
] }) : /* @__PURE__ */
|
|
2859
|
+
] }) : /* @__PURE__ */ jsx65(ark38.span, { className: prevNextSpacerBase }),
|
|
2499
2860
|
next ? /* @__PURE__ */ jsxs23(ark38.a, { href: next.href, className: cn64(prevNextLinkBase, prevNextLinkNextBase), children: [
|
|
2500
|
-
/* @__PURE__ */
|
|
2861
|
+
/* @__PURE__ */ jsx65(ark38.span, { className: prevNextDirectionBase, children: "Next" }),
|
|
2501
2862
|
/* @__PURE__ */ jsxs23(ark38.span, { className: prevNextTitleBase, children: [
|
|
2502
2863
|
next.title,
|
|
2503
2864
|
" \u2192"
|
|
2504
2865
|
] })
|
|
2505
|
-
] }) : /* @__PURE__ */
|
|
2866
|
+
] }) : /* @__PURE__ */ jsx65(ark38.span, { className: prevNextSpacerBase })
|
|
2506
2867
|
] });
|
|
2507
2868
|
}
|
|
2508
2869
|
|
|
2509
2870
|
// src/latex.tsx
|
|
2510
2871
|
import { ark as ark39 } from "@ark-ui/react/factory";
|
|
2511
2872
|
import { latexRootBase, latexDisplayBase, latexInlineBase, latexErrorBase, toLaTeX, cn as cn65 } from "@cloudvoyant/helical-ui";
|
|
2512
|
-
import { jsx as
|
|
2873
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
2513
2874
|
function LaTeX({ latex, html, className, ...props }) {
|
|
2514
2875
|
let markup;
|
|
2515
2876
|
let error = false;
|
|
@@ -2523,13 +2884,13 @@ function LaTeX({ latex, html, className, ...props }) {
|
|
|
2523
2884
|
} else {
|
|
2524
2885
|
markup = html;
|
|
2525
2886
|
}
|
|
2526
|
-
return /* @__PURE__ */
|
|
2887
|
+
return /* @__PURE__ */ jsx66(
|
|
2527
2888
|
ark39.div,
|
|
2528
2889
|
{
|
|
2529
2890
|
...props,
|
|
2530
2891
|
"data-latex-state": error ? "error" : "done",
|
|
2531
2892
|
className: cn65(latexRootBase, latexDisplayBase, className),
|
|
2532
|
-
children: error ? /* @__PURE__ */
|
|
2893
|
+
children: error ? /* @__PURE__ */ jsx66("code", { className: latexErrorBase, children: latex }) : /* @__PURE__ */ jsx66("span", { dangerouslySetInnerHTML: { __html: markup } })
|
|
2533
2894
|
}
|
|
2534
2895
|
);
|
|
2535
2896
|
}
|
|
@@ -2546,19 +2907,19 @@ function InlineLaTeX({ latex, html, className, ...props }) {
|
|
|
2546
2907
|
} else {
|
|
2547
2908
|
markup = html;
|
|
2548
2909
|
}
|
|
2549
|
-
return /* @__PURE__ */
|
|
2910
|
+
return /* @__PURE__ */ jsx66(
|
|
2550
2911
|
ark39.span,
|
|
2551
2912
|
{
|
|
2552
2913
|
...props,
|
|
2553
2914
|
"data-latex-state": error ? "error" : "done",
|
|
2554
2915
|
className: cn65(latexRootBase, latexInlineBase, className),
|
|
2555
|
-
children: error ? /* @__PURE__ */
|
|
2916
|
+
children: error ? /* @__PURE__ */ jsx66("code", { className: latexErrorBase, children: latex }) : /* @__PURE__ */ jsx66("span", { dangerouslySetInnerHTML: { __html: markup } })
|
|
2556
2917
|
}
|
|
2557
2918
|
);
|
|
2558
2919
|
}
|
|
2559
2920
|
|
|
2560
2921
|
// src/code-block.tsx
|
|
2561
|
-
import { createContext as
|
|
2922
|
+
import { createContext as createContext7, useContext as useContext7, useEffect as useEffect5, useState as useState4 } from "react";
|
|
2562
2923
|
import { ark as ark40 } from "@ark-ui/react/factory";
|
|
2563
2924
|
import {
|
|
2564
2925
|
codeBlockRootBase,
|
|
@@ -2576,10 +2937,10 @@ import {
|
|
|
2576
2937
|
renderCodeToHtml,
|
|
2577
2938
|
cn as cn66
|
|
2578
2939
|
} from "@cloudvoyant/helical-ui";
|
|
2579
|
-
import { Fragment as Fragment5, jsx as
|
|
2580
|
-
var CodeBlockContext =
|
|
2940
|
+
import { Fragment as Fragment5, jsx as jsx67, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2941
|
+
var CodeBlockContext = createContext7(null);
|
|
2581
2942
|
function useCodeBlock() {
|
|
2582
|
-
const ctx =
|
|
2943
|
+
const ctx = useContext7(CodeBlockContext);
|
|
2583
2944
|
if (!ctx) throw new Error("CodeBlock parts must be rendered inside a <CodeBlock>.");
|
|
2584
2945
|
return ctx;
|
|
2585
2946
|
}
|
|
@@ -2593,11 +2954,11 @@ function CodeRenderer({
|
|
|
2593
2954
|
highlightLines
|
|
2594
2955
|
}) {
|
|
2595
2956
|
const [rendered, setRendered] = useState4(html ?? null);
|
|
2596
|
-
|
|
2957
|
+
useEffect5(() => {
|
|
2597
2958
|
injectCodeBlockStyles();
|
|
2598
2959
|
}, []);
|
|
2599
2960
|
const highlightKey = highlightLines?.join(",");
|
|
2600
|
-
|
|
2961
|
+
useEffect5(() => {
|
|
2601
2962
|
if (html !== void 0) return;
|
|
2602
2963
|
let cancelled = false;
|
|
2603
2964
|
setRendered(null);
|
|
@@ -2608,12 +2969,12 @@ function CodeRenderer({
|
|
|
2608
2969
|
cancelled = true;
|
|
2609
2970
|
};
|
|
2610
2971
|
}, [code, language, html, highlightKey]);
|
|
2611
|
-
return /* @__PURE__ */
|
|
2972
|
+
return /* @__PURE__ */ jsx67(
|
|
2612
2973
|
"div",
|
|
2613
2974
|
{
|
|
2614
2975
|
className: cn66(codeBlockBodyBase, scrollable && codeBlockBodyScrollableBase),
|
|
2615
2976
|
style: scrollable ? { maxHeight: `${maxHeight}px` } : void 0,
|
|
2616
|
-
children: rendered === null ? /* @__PURE__ */
|
|
2977
|
+
children: rendered === null ? /* @__PURE__ */ jsx67("div", { className: codeBlockLoadingBase, children: /* @__PURE__ */ jsx67("div", { className: codeBlockSpinnerBase }) }) : /* @__PURE__ */ jsx67(
|
|
2617
2978
|
"div",
|
|
2618
2979
|
{
|
|
2619
2980
|
dangerouslySetInnerHTML: { __html: rendered },
|
|
@@ -2641,27 +3002,27 @@ function CodeBlock({
|
|
|
2641
3002
|
...props
|
|
2642
3003
|
}) {
|
|
2643
3004
|
const ctx = { code, language, html, showLineNumbers, scrollable, maxHeight, highlightLines };
|
|
2644
|
-
return /* @__PURE__ */
|
|
3005
|
+
return /* @__PURE__ */ jsx67(CodeBlockContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx67(ark40.div, { "data-code-block": true, className: cn66(codeBlockRootBase, className), ...props, children: children ?? /* @__PURE__ */ jsxs24(Fragment5, { children: [
|
|
2645
3006
|
/* @__PURE__ */ jsxs24(CodeBlockHeader, { children: [
|
|
2646
|
-
/* @__PURE__ */
|
|
2647
|
-
/* @__PURE__ */
|
|
3007
|
+
/* @__PURE__ */ jsx67(CodeBlockTitle, { children: filename ?? language }),
|
|
3008
|
+
/* @__PURE__ */ jsx67("div", { className: "ml-auto", children: /* @__PURE__ */ jsx67(CodeBlockCopyButton, {}) })
|
|
2648
3009
|
] }),
|
|
2649
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ jsx67(CodeBlockContent, {})
|
|
2650
3011
|
] }) }) });
|
|
2651
3012
|
}
|
|
2652
3013
|
function CodeBlockHeader({ className, children, ...props }) {
|
|
2653
|
-
return /* @__PURE__ */
|
|
3014
|
+
return /* @__PURE__ */ jsx67(ark40.div, { className: cn66(codeBlockHeaderBase, className), ...props, children });
|
|
2654
3015
|
}
|
|
2655
3016
|
function CodeBlockTitle({ className, children, ...props }) {
|
|
2656
|
-
return /* @__PURE__ */
|
|
3017
|
+
return /* @__PURE__ */ jsx67(ark40.span, { className: cn66(codeBlockTitleBase, className), ...props, children });
|
|
2657
3018
|
}
|
|
2658
3019
|
function CodeBlockCopyButton({ label = "Copy code", className, ...props }) {
|
|
2659
3020
|
const { code } = useCodeBlock();
|
|
2660
|
-
return /* @__PURE__ */
|
|
3021
|
+
return /* @__PURE__ */ jsx67(ark40.div, { className, ...props, children: /* @__PURE__ */ jsx67(CopyButton, { value: code, label }) });
|
|
2661
3022
|
}
|
|
2662
3023
|
function CodeBlockContent({ className, html, ...props }) {
|
|
2663
3024
|
const ctx = useCodeBlock();
|
|
2664
|
-
return /* @__PURE__ */
|
|
3025
|
+
return /* @__PURE__ */ jsx67(ark40.div, { className, ...props, children: /* @__PURE__ */ jsx67(CodeRenderer, { ...ctx, html: html ?? ctx.html }) });
|
|
2665
3026
|
}
|
|
2666
3027
|
function MultiFileCodeBlock({
|
|
2667
3028
|
files,
|
|
@@ -2673,14 +3034,14 @@ function MultiFileCodeBlock({
|
|
|
2673
3034
|
}) {
|
|
2674
3035
|
const [active, setActive] = useState4(files[0]?.filename ?? "");
|
|
2675
3036
|
const file = files.find((f) => f.filename === active) ?? files[0];
|
|
2676
|
-
|
|
3037
|
+
useEffect5(() => {
|
|
2677
3038
|
if (!files.some((f) => f.filename === active)) {
|
|
2678
3039
|
setActive(files[0]?.filename ?? "");
|
|
2679
3040
|
}
|
|
2680
3041
|
}, [files, active]);
|
|
2681
3042
|
return /* @__PURE__ */ jsxs24(ark40.div, { "data-code-block": true, className: cn66(codeBlockRootBase, className), ...props, children: [
|
|
2682
3043
|
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between border-b bg-muted/50", children: [
|
|
2683
|
-
/* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ jsx67("div", { role: "tablist", "aria-label": "Files", className: "flex overflow-x-auto no-scrollbar pl-1", children: files.map((f) => /* @__PURE__ */ jsx67(
|
|
2684
3045
|
"button",
|
|
2685
3046
|
{
|
|
2686
3047
|
role: "tab",
|
|
@@ -2694,9 +3055,9 @@ function MultiFileCodeBlock({
|
|
|
2694
3055
|
},
|
|
2695
3056
|
f.filename
|
|
2696
3057
|
)) }),
|
|
2697
|
-
file ? /* @__PURE__ */
|
|
3058
|
+
file ? /* @__PURE__ */ jsx67("div", { className: "shrink-0 pr-3", children: /* @__PURE__ */ jsx67(CopyButton, { value: file.code, label: "Copy code" }) }) : null
|
|
2698
3059
|
] }),
|
|
2699
|
-
file ? /* @__PURE__ */
|
|
3060
|
+
file ? /* @__PURE__ */ jsx67(
|
|
2700
3061
|
CodeRenderer,
|
|
2701
3062
|
{
|
|
2702
3063
|
code: file.code,
|
|
@@ -2719,15 +3080,15 @@ function LanguageTabsCodeBlock({
|
|
|
2719
3080
|
}) {
|
|
2720
3081
|
const [active, setActive] = useState4(tabs[0]?.label ?? "");
|
|
2721
3082
|
const tab = tabs.find((t) => t.label === active) ?? tabs[0];
|
|
2722
|
-
|
|
3083
|
+
useEffect5(() => {
|
|
2723
3084
|
if (!tabs.some((t) => t.label === active)) {
|
|
2724
3085
|
setActive(tabs[0]?.label ?? "");
|
|
2725
3086
|
}
|
|
2726
3087
|
}, [tabs, active]);
|
|
2727
3088
|
return /* @__PURE__ */ jsxs24(ark40.div, { "data-code-block": true, className: cn66(codeBlockRootBase, className), ...props, children: [
|
|
2728
3089
|
/* @__PURE__ */ jsxs24(CodeBlockHeader, { children: [
|
|
2729
|
-
/* @__PURE__ */
|
|
2730
|
-
/* @__PURE__ */
|
|
3090
|
+
/* @__PURE__ */ jsx67(CodeBlockTitle, { children: tab?.filename }),
|
|
3091
|
+
/* @__PURE__ */ jsx67("div", { className: "ml-auto", children: /* @__PURE__ */ jsxs24(
|
|
2731
3092
|
Select,
|
|
2732
3093
|
{
|
|
2733
3094
|
items: tabs.map((t) => ({ value: t.label, label: t.label })),
|
|
@@ -2736,8 +3097,8 @@ function LanguageTabsCodeBlock({
|
|
|
2736
3097
|
"aria-label": "Language",
|
|
2737
3098
|
children: [
|
|
2738
3099
|
/* @__PURE__ */ jsxs24(SelectTrigger, { size: "sm", className: "min-w-28 justify-between font-mono text-xs", children: [
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
/* @__PURE__ */
|
|
3100
|
+
/* @__PURE__ */ jsx67(SelectValue, {}),
|
|
3101
|
+
/* @__PURE__ */ jsx67(SelectIndicator, { children: /* @__PURE__ */ jsx67(
|
|
2741
3102
|
"svg",
|
|
2742
3103
|
{
|
|
2743
3104
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2748,13 +3109,13 @@ function LanguageTabsCodeBlock({
|
|
|
2748
3109
|
strokeLinecap: "round",
|
|
2749
3110
|
strokeLinejoin: "round",
|
|
2750
3111
|
"aria-hidden": "true",
|
|
2751
|
-
children: /* @__PURE__ */
|
|
3112
|
+
children: /* @__PURE__ */ jsx67("path", { d: "m6 9 6 6 6-6" })
|
|
2752
3113
|
}
|
|
2753
3114
|
) })
|
|
2754
3115
|
] }),
|
|
2755
|
-
/* @__PURE__ */
|
|
2756
|
-
/* @__PURE__ */
|
|
2757
|
-
/* @__PURE__ */
|
|
3116
|
+
/* @__PURE__ */ jsx67(SelectContent, { children: tabs.map((t) => /* @__PURE__ */ jsxs24(SelectItem, { item: { value: t.label, label: t.label }, children: [
|
|
3117
|
+
/* @__PURE__ */ jsx67(SelectItemText, { children: t.label }),
|
|
3118
|
+
/* @__PURE__ */ jsx67(SelectItemIndicator, { children: /* @__PURE__ */ jsx67(
|
|
2758
3119
|
"svg",
|
|
2759
3120
|
{
|
|
2760
3121
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2765,7 +3126,7 @@ function LanguageTabsCodeBlock({
|
|
|
2765
3126
|
strokeLinecap: "round",
|
|
2766
3127
|
strokeLinejoin: "round",
|
|
2767
3128
|
"aria-hidden": "true",
|
|
2768
|
-
children: /* @__PURE__ */
|
|
3129
|
+
children: /* @__PURE__ */ jsx67("path", { d: "M20 6 9 17l-5-5" })
|
|
2769
3130
|
}
|
|
2770
3131
|
) })
|
|
2771
3132
|
] }, t.label)) })
|
|
@@ -2774,7 +3135,7 @@ function LanguageTabsCodeBlock({
|
|
|
2774
3135
|
) })
|
|
2775
3136
|
] }),
|
|
2776
3137
|
tab ? /* @__PURE__ */ jsxs24("div", { className: "relative", children: [
|
|
2777
|
-
/* @__PURE__ */
|
|
3138
|
+
/* @__PURE__ */ jsx67(
|
|
2778
3139
|
CodeRenderer,
|
|
2779
3140
|
{
|
|
2780
3141
|
code: tab.code,
|
|
@@ -2785,13 +3146,13 @@ function LanguageTabsCodeBlock({
|
|
|
2785
3146
|
maxHeight
|
|
2786
3147
|
}
|
|
2787
3148
|
),
|
|
2788
|
-
/* @__PURE__ */
|
|
3149
|
+
/* @__PURE__ */ jsx67("div", { className: codeBlockCopyFloatBase, children: /* @__PURE__ */ jsx67(CopyButton, { value: tab.code, label: "Copy code" }) })
|
|
2789
3150
|
] }) : null
|
|
2790
3151
|
] });
|
|
2791
3152
|
}
|
|
2792
3153
|
|
|
2793
3154
|
// src/manim.tsx
|
|
2794
|
-
import { useEffect as
|
|
3155
|
+
import { useEffect as useEffect6, useRef as useRef3, useState as useState5 } from "react";
|
|
2795
3156
|
import { ark as ark41 } from "@ark-ui/react/factory";
|
|
2796
3157
|
import {
|
|
2797
3158
|
manimRootBase,
|
|
@@ -2802,13 +3163,13 @@ import {
|
|
|
2802
3163
|
manimCaptionBase,
|
|
2803
3164
|
cn as cn67
|
|
2804
3165
|
} from "@cloudvoyant/helical-ui";
|
|
2805
|
-
import { jsx as
|
|
3166
|
+
import { jsx as jsx68, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2806
3167
|
function Manim({ build, width = 800, height = 450, caption, className, ...props }) {
|
|
2807
|
-
const wrapperRef =
|
|
2808
|
-
const containerRef =
|
|
3168
|
+
const wrapperRef = useRef3(null);
|
|
3169
|
+
const containerRef = useRef3(null);
|
|
2809
3170
|
const [state, setState] = useState5("loading");
|
|
2810
3171
|
const [errorMsg, setErrorMsg] = useState5("");
|
|
2811
|
-
|
|
3172
|
+
useEffect6(() => {
|
|
2812
3173
|
const wrapper = wrapperRef.current;
|
|
2813
3174
|
if (!wrapper) return;
|
|
2814
3175
|
let disposed = false;
|
|
@@ -2873,16 +3234,16 @@ function Manim({ build, width = 800, height = 450, caption, className, ...props
|
|
|
2873
3234
|
}, [build, width, height]);
|
|
2874
3235
|
return /* @__PURE__ */ jsxs25(ark41.figure, { "data-manim-state": state, className: cn67(manimRootBase, className), ...props, children: [
|
|
2875
3236
|
/* @__PURE__ */ jsxs25("div", { ref: wrapperRef, className: manimContainerBase, children: [
|
|
2876
|
-
/* @__PURE__ */
|
|
2877
|
-
state === "loading" && /* @__PURE__ */
|
|
2878
|
-
state === "error" && /* @__PURE__ */
|
|
3237
|
+
/* @__PURE__ */ jsx68("div", { ref: containerRef, className: "w-full" }),
|
|
3238
|
+
state === "loading" && /* @__PURE__ */ jsx68("div", { className: manimPlaceholderBase, style: { aspectRatio: `${width} / ${height}` }, children: /* @__PURE__ */ jsx68("span", { className: manimPlaceholderLabelBase, children: "Loading animation\u2026" }) }),
|
|
3239
|
+
state === "error" && /* @__PURE__ */ jsx68("div", { className: manimErrorBase, children: errorMsg })
|
|
2879
3240
|
] }),
|
|
2880
|
-
caption ? /* @__PURE__ */
|
|
3241
|
+
caption ? /* @__PURE__ */ jsx68(ark41.figcaption, { className: manimCaptionBase, children: caption }) : null
|
|
2881
3242
|
] });
|
|
2882
3243
|
}
|
|
2883
3244
|
|
|
2884
3245
|
// src/youtube.tsx
|
|
2885
|
-
import { createContext as
|
|
3246
|
+
import { createContext as createContext8, useContext as useContext8, useEffect as useEffect7, useState as useState6 } from "react";
|
|
2886
3247
|
import { ark as ark42 } from "@ark-ui/react/factory";
|
|
2887
3248
|
import { ChevronRight, Play } from "lucide-react";
|
|
2888
3249
|
import {
|
|
@@ -2905,10 +3266,10 @@ import {
|
|
|
2905
3266
|
fetchYouTubeMetadata,
|
|
2906
3267
|
cn as cn68
|
|
2907
3268
|
} from "@cloudvoyant/helical-ui";
|
|
2908
|
-
import { jsx as
|
|
2909
|
-
var YouTubeContext =
|
|
3269
|
+
import { jsx as jsx69, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3270
|
+
var YouTubeContext = createContext8(null);
|
|
2910
3271
|
function useYouTube() {
|
|
2911
|
-
const ctx =
|
|
3272
|
+
const ctx = useContext8(YouTubeContext);
|
|
2912
3273
|
if (!ctx) throw new Error("YoutubeTimestamps must be rendered inside a <YouTube>.");
|
|
2913
3274
|
return ctx;
|
|
2914
3275
|
}
|
|
@@ -2922,9 +3283,9 @@ function YouTube({ url, title, description, poster, className, children, ...prop
|
|
|
2922
3283
|
setPlaying(true);
|
|
2923
3284
|
};
|
|
2924
3285
|
const src = `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=1${startAt == null ? "" : `&start=${startAt}`}`;
|
|
2925
|
-
return /* @__PURE__ */
|
|
2926
|
-
title ? /* @__PURE__ */
|
|
2927
|
-
playing ? /* @__PURE__ */
|
|
3286
|
+
return /* @__PURE__ */ jsx69(YouTubeContext.Provider, { value: { url, videoId, seek }, children: /* @__PURE__ */ jsxs26(ark42.div, { "data-youtube-id": videoId, className: cn68(youtubeRootBase, className), ...props, children: [
|
|
3287
|
+
title ? /* @__PURE__ */ jsx69(ark42.h3, { className: youtubeTitleBase, children: title }) : null,
|
|
3288
|
+
playing ? /* @__PURE__ */ jsx69(
|
|
2928
3289
|
"iframe",
|
|
2929
3290
|
{
|
|
2930
3291
|
src,
|
|
@@ -2941,7 +3302,7 @@ function YouTube({ url, title, description, poster, className, children, ...prop
|
|
|
2941
3302
|
onClick: () => setPlaying(true),
|
|
2942
3303
|
"aria-label": title ? `Play video: ${title}` : "Play video",
|
|
2943
3304
|
children: [
|
|
2944
|
-
/* @__PURE__ */
|
|
3305
|
+
/* @__PURE__ */ jsx69(
|
|
2945
3306
|
ark42.img,
|
|
2946
3307
|
{
|
|
2947
3308
|
src: posterUrl,
|
|
@@ -2950,26 +3311,26 @@ function YouTube({ url, title, description, poster, className, children, ...prop
|
|
|
2950
3311
|
className: "h-full w-full object-cover"
|
|
2951
3312
|
}
|
|
2952
3313
|
),
|
|
2953
|
-
/* @__PURE__ */
|
|
3314
|
+
/* @__PURE__ */ jsx69(ark42.span, { className: youtubePlayButtonBase, "aria-hidden": "true", children: /* @__PURE__ */ jsx69(ark42.span, { className: youtubePlayButtonInnerBase, children: /* @__PURE__ */ jsx69(Play, { className: "size-8 fill-current", "aria-hidden": "true", "data-youtube-logo": true }) }) })
|
|
2954
3315
|
]
|
|
2955
3316
|
}
|
|
2956
3317
|
),
|
|
2957
|
-
description ? /* @__PURE__ */
|
|
3318
|
+
description ? /* @__PURE__ */ jsx69(ark42.p, { className: youtubeDescriptionBase, children: description }) : null,
|
|
2958
3319
|
children
|
|
2959
3320
|
] }) });
|
|
2960
3321
|
}
|
|
2961
3322
|
function YoutubeTimestampAt({ t, children, className, ...props }) {
|
|
2962
3323
|
const { seek } = useYouTube();
|
|
2963
|
-
return /* @__PURE__ */
|
|
2964
|
-
/* @__PURE__ */
|
|
2965
|
-
/* @__PURE__ */
|
|
3324
|
+
return /* @__PURE__ */ jsx69(ark42.li, { className, ...props, children: /* @__PURE__ */ jsxs26(ark42.button, { type: "button", onClick: () => seek(t), className: youtubeChapterButtonBase, children: [
|
|
3325
|
+
/* @__PURE__ */ jsx69(ark42.span, { className: youtubeChapterTimeBase, children: formatTime(t) }),
|
|
3326
|
+
/* @__PURE__ */ jsx69(ark42.span, { className: youtubeChapterLabelBase, children })
|
|
2966
3327
|
] }) });
|
|
2967
3328
|
}
|
|
2968
3329
|
function YoutubeTimestamps({ chapters, children, className, ...props }) {
|
|
2969
3330
|
const { url } = useYouTube();
|
|
2970
3331
|
const [inferred, setInferred] = useState6([]);
|
|
2971
3332
|
const [loading, setLoading] = useState6(chapters === void 0);
|
|
2972
|
-
|
|
3333
|
+
useEffect7(() => {
|
|
2973
3334
|
if (chapters !== void 0) return;
|
|
2974
3335
|
let cancelled = false;
|
|
2975
3336
|
setLoading(true);
|
|
@@ -2988,13 +3349,13 @@ function YoutubeTimestamps({ chapters, children, className, ...props }) {
|
|
|
2988
3349
|
const resolved = chapters ?? inferred;
|
|
2989
3350
|
const hasChildren = children !== void 0 && children !== null;
|
|
2990
3351
|
if (!loading && resolved.length === 0 && !hasChildren) return null;
|
|
2991
|
-
return /* @__PURE__ */
|
|
3352
|
+
return /* @__PURE__ */ jsx69(ark42.div, { className: cn68(youtubeChaptersBase, className), ...props, children: /* @__PURE__ */ jsxs26("details", { className: "group", open: true, children: [
|
|
2992
3353
|
/* @__PURE__ */ jsxs26(ark42.summary, { className: youtubeChaptersSummaryBase, children: [
|
|
2993
|
-
/* @__PURE__ */
|
|
2994
|
-
/* @__PURE__ */
|
|
3354
|
+
/* @__PURE__ */ jsx69(ChevronRight, { className: youtubeChaptersChevronBase, "aria-hidden": "true" }),
|
|
3355
|
+
/* @__PURE__ */ jsx69("span", { children: "Timestamps" })
|
|
2995
3356
|
] }),
|
|
2996
|
-
/* @__PURE__ */
|
|
2997
|
-
resolved.map((ch) => /* @__PURE__ */
|
|
3357
|
+
/* @__PURE__ */ jsx69(ark42.nav, { "aria-label": "Video timestamps", className: youtubeChaptersListBase, children: /* @__PURE__ */ jsxs26(ark42.ul, { className: "space-y-1", children: [
|
|
3358
|
+
resolved.map((ch) => /* @__PURE__ */ jsx69(YoutubeTimestampAt, { t: ch.t, children: ch.label }, ch.t)),
|
|
2998
3359
|
children
|
|
2999
3360
|
] }) })
|
|
3000
3361
|
] }) });
|
|
@@ -3004,18 +3365,18 @@ function YoutubeTimestamps({ chapters, children, className, ...props }) {
|
|
|
3004
3365
|
import { ark as ark43 } from "@ark-ui/react/factory";
|
|
3005
3366
|
import { Chart as TanStackChart } from "@tanstack/charts/react";
|
|
3006
3367
|
import { chartRootBase, buildChartDefinition, cn as cn69 } from "@cloudvoyant/helical-ui";
|
|
3007
|
-
import { jsx as
|
|
3368
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
3008
3369
|
function Chart({ svg, className, ...props }) {
|
|
3009
3370
|
const { type, height = 320 } = props;
|
|
3010
3371
|
if (svg !== void 0) {
|
|
3011
|
-
return /* @__PURE__ */
|
|
3372
|
+
return /* @__PURE__ */ jsx70(ark43.div, { "data-chart-state": "prerendered", "data-chart-type": type, className: cn69(chartRootBase, className), children: /* @__PURE__ */ jsx70("div", { className: "flex w-full justify-center [&>svg]:max-w-full", dangerouslySetInnerHTML: { __html: svg } }) });
|
|
3012
3373
|
}
|
|
3013
3374
|
const definition = buildChartDefinition(props);
|
|
3014
|
-
return /* @__PURE__ */
|
|
3375
|
+
return /* @__PURE__ */ jsx70(ark43.div, { "data-chart-state": "ready", "data-chart-type": type, className: cn69(chartRootBase, className), children: /* @__PURE__ */ jsx70(TanStackChart, { definition, height, ariaLabel: type === "pie" ? "Pie chart" : "Chart" }) });
|
|
3015
3376
|
}
|
|
3016
3377
|
|
|
3017
3378
|
// src/questions.tsx
|
|
3018
|
-
import { useEffect as
|
|
3379
|
+
import { useEffect as useEffect8, useState as useState7 } from "react";
|
|
3019
3380
|
import { ark as ark44 } from "@ark-ui/react/factory";
|
|
3020
3381
|
import {
|
|
3021
3382
|
questionCardBase,
|
|
@@ -3041,7 +3402,7 @@ import {
|
|
|
3041
3402
|
quizResetButtonBase,
|
|
3042
3403
|
cn as cn70
|
|
3043
3404
|
} from "@cloudvoyant/helical-ui";
|
|
3044
|
-
import { Fragment as Fragment6, jsx as
|
|
3405
|
+
import { Fragment as Fragment6, jsx as jsx71, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3045
3406
|
function CheckCircleIcon2() {
|
|
3046
3407
|
return /* @__PURE__ */ jsxs27(
|
|
3047
3408
|
"svg",
|
|
@@ -3056,8 +3417,8 @@ function CheckCircleIcon2() {
|
|
|
3056
3417
|
"aria-hidden": "true",
|
|
3057
3418
|
className: "size-4 shrink-0",
|
|
3058
3419
|
children: [
|
|
3059
|
-
/* @__PURE__ */
|
|
3060
|
-
/* @__PURE__ */
|
|
3420
|
+
/* @__PURE__ */ jsx71("circle", { cx: "12", cy: "12", r: "10" }),
|
|
3421
|
+
/* @__PURE__ */ jsx71("path", { d: "m9 12 2 2 4-4" })
|
|
3061
3422
|
]
|
|
3062
3423
|
}
|
|
3063
3424
|
);
|
|
@@ -3076,15 +3437,15 @@ function CircleXIcon2() {
|
|
|
3076
3437
|
"aria-hidden": "true",
|
|
3077
3438
|
className: "size-4 shrink-0",
|
|
3078
3439
|
children: [
|
|
3079
|
-
/* @__PURE__ */
|
|
3080
|
-
/* @__PURE__ */
|
|
3081
|
-
/* @__PURE__ */
|
|
3440
|
+
/* @__PURE__ */ jsx71("circle", { cx: "12", cy: "12", r: "10" }),
|
|
3441
|
+
/* @__PURE__ */ jsx71("path", { d: "m15 9-6 6" }),
|
|
3442
|
+
/* @__PURE__ */ jsx71("path", { d: "m9 9 6 6" })
|
|
3082
3443
|
]
|
|
3083
3444
|
}
|
|
3084
3445
|
);
|
|
3085
3446
|
}
|
|
3086
3447
|
function CheckIcon2() {
|
|
3087
|
-
return /* @__PURE__ */
|
|
3448
|
+
return /* @__PURE__ */ jsx71(
|
|
3088
3449
|
"svg",
|
|
3089
3450
|
{
|
|
3090
3451
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3095,14 +3456,14 @@ function CheckIcon2() {
|
|
|
3095
3456
|
strokeLinecap: "round",
|
|
3096
3457
|
strokeLinejoin: "round",
|
|
3097
3458
|
"aria-hidden": "true",
|
|
3098
|
-
children: /* @__PURE__ */
|
|
3459
|
+
children: /* @__PURE__ */ jsx71("path", { d: "M20 6 9 17l-5-5" })
|
|
3099
3460
|
}
|
|
3100
3461
|
);
|
|
3101
3462
|
}
|
|
3102
3463
|
function Feedback({ correct, explanation }) {
|
|
3103
3464
|
if (correct === null) return null;
|
|
3104
3465
|
return /* @__PURE__ */ jsxs27("div", { "aria-live": "polite", role: "status", className: "mt-3", children: [
|
|
3105
|
-
/* @__PURE__ */
|
|
3466
|
+
/* @__PURE__ */ jsx71(
|
|
3106
3467
|
"div",
|
|
3107
3468
|
{
|
|
3108
3469
|
className: cn70(
|
|
@@ -3110,15 +3471,15 @@ function Feedback({ correct, explanation }) {
|
|
|
3110
3471
|
correct ? feedbackCorrectBase : feedbackIncorrectBase
|
|
3111
3472
|
),
|
|
3112
3473
|
children: correct ? /* @__PURE__ */ jsxs27(Fragment6, { children: [
|
|
3113
|
-
/* @__PURE__ */
|
|
3114
|
-
/* @__PURE__ */
|
|
3474
|
+
/* @__PURE__ */ jsx71(CheckCircleIcon2, {}),
|
|
3475
|
+
/* @__PURE__ */ jsx71("span", { children: "Correct" })
|
|
3115
3476
|
] }) : /* @__PURE__ */ jsxs27(Fragment6, { children: [
|
|
3116
|
-
/* @__PURE__ */
|
|
3117
|
-
/* @__PURE__ */
|
|
3477
|
+
/* @__PURE__ */ jsx71(CircleXIcon2, {}),
|
|
3478
|
+
/* @__PURE__ */ jsx71("span", { children: "Incorrect" })
|
|
3118
3479
|
] })
|
|
3119
3480
|
}
|
|
3120
3481
|
),
|
|
3121
|
-
explanation ? /* @__PURE__ */
|
|
3482
|
+
explanation ? /* @__PURE__ */ jsx71("p", { className: feedbackExplanationBase, children: explanation }) : null
|
|
3122
3483
|
] });
|
|
3123
3484
|
}
|
|
3124
3485
|
function SingleChoiceRenderer({
|
|
@@ -3135,7 +3496,7 @@ function SingleChoiceRenderer({
|
|
|
3135
3496
|
}) {
|
|
3136
3497
|
const [selected, setSelected] = useState7(null);
|
|
3137
3498
|
const [result, setResult] = useState7(null);
|
|
3138
|
-
|
|
3499
|
+
useEffect8(() => {
|
|
3139
3500
|
if (quiz) {
|
|
3140
3501
|
const isAnswered = selected !== null;
|
|
3141
3502
|
onAnswerChange?.({ answered: isAnswered, correct: isAnswered && selected === correct });
|
|
@@ -3149,8 +3510,8 @@ function SingleChoiceRenderer({
|
|
|
3149
3510
|
onGraded?.(isCorrect);
|
|
3150
3511
|
};
|
|
3151
3512
|
return /* @__PURE__ */ jsxs27("div", { className: cn70(questionCardBase, className), ...rest, children: [
|
|
3152
|
-
/* @__PURE__ */
|
|
3153
|
-
/* @__PURE__ */
|
|
3513
|
+
/* @__PURE__ */ jsx71("p", { className: questionPromptBase, children: prompt }),
|
|
3514
|
+
/* @__PURE__ */ jsx71(
|
|
3154
3515
|
RadioGroup,
|
|
3155
3516
|
{
|
|
3156
3517
|
orientation: "vertical",
|
|
@@ -3161,7 +3522,7 @@ function SingleChoiceRenderer({
|
|
|
3161
3522
|
},
|
|
3162
3523
|
disabled: quiz ? submitted : result !== null,
|
|
3163
3524
|
className: questionGroupBase,
|
|
3164
|
-
children: choices.map((choice, i) => /* @__PURE__ */
|
|
3525
|
+
children: choices.map((choice, i) => /* @__PURE__ */ jsx71(
|
|
3165
3526
|
RadioGroupItem,
|
|
3166
3527
|
{
|
|
3167
3528
|
value: String(i),
|
|
@@ -3176,7 +3537,7 @@ function SingleChoiceRenderer({
|
|
|
3176
3537
|
))
|
|
3177
3538
|
}
|
|
3178
3539
|
),
|
|
3179
|
-
!quiz && result === null && /* @__PURE__ */
|
|
3540
|
+
!quiz && result === null && /* @__PURE__ */ jsx71(
|
|
3180
3541
|
ark44.button,
|
|
3181
3542
|
{
|
|
3182
3543
|
type: "button",
|
|
@@ -3186,7 +3547,7 @@ function SingleChoiceRenderer({
|
|
|
3186
3547
|
children: "Check"
|
|
3187
3548
|
}
|
|
3188
3549
|
),
|
|
3189
|
-
/* @__PURE__ */
|
|
3550
|
+
/* @__PURE__ */ jsx71(Feedback, { correct: displayResult, explanation: displayResult === null ? void 0 : explanation })
|
|
3190
3551
|
] });
|
|
3191
3552
|
}
|
|
3192
3553
|
function MultipleChoiceRenderer({
|
|
@@ -3207,7 +3568,7 @@ function MultipleChoiceRenderer({
|
|
|
3207
3568
|
const correctSet = new Set(correct);
|
|
3208
3569
|
return selected.size === correctSet.size && [...selected].every((v) => correctSet.has(v));
|
|
3209
3570
|
};
|
|
3210
|
-
|
|
3571
|
+
useEffect8(() => {
|
|
3211
3572
|
if (quiz) {
|
|
3212
3573
|
const isAnswered = selected.size > 0;
|
|
3213
3574
|
onAnswerChange?.({ answered: isAnswered, correct: isAnswered && computeCorrect() });
|
|
@@ -3230,8 +3591,8 @@ function MultipleChoiceRenderer({
|
|
|
3230
3591
|
onGraded?.(isCorrect);
|
|
3231
3592
|
};
|
|
3232
3593
|
return /* @__PURE__ */ jsxs27("div", { className: cn70(questionCardBase, className), ...rest, children: [
|
|
3233
|
-
/* @__PURE__ */
|
|
3234
|
-
/* @__PURE__ */
|
|
3594
|
+
/* @__PURE__ */ jsx71("p", { className: questionPromptBase, children: prompt }),
|
|
3595
|
+
/* @__PURE__ */ jsx71("div", { role: "group", className: questionGroupBase, children: choices.map((choice, i) => {
|
|
3235
3596
|
const isCorrectOption = correct.includes(i);
|
|
3236
3597
|
return /* @__PURE__ */ jsxs27(
|
|
3237
3598
|
Checkbox,
|
|
@@ -3245,14 +3606,14 @@ function MultipleChoiceRenderer({
|
|
|
3245
3606
|
displayResult !== null && selected.has(i) && !isCorrectOption && questionOptionIncorrectBase
|
|
3246
3607
|
),
|
|
3247
3608
|
children: [
|
|
3248
|
-
/* @__PURE__ */
|
|
3249
|
-
/* @__PURE__ */
|
|
3609
|
+
/* @__PURE__ */ jsx71(CheckboxControl, { children: /* @__PURE__ */ jsx71(CheckboxIndicator, { children: /* @__PURE__ */ jsx71(CheckIcon2, {}) }) }),
|
|
3610
|
+
/* @__PURE__ */ jsx71(CheckboxLabel, { children: choice })
|
|
3250
3611
|
]
|
|
3251
3612
|
},
|
|
3252
3613
|
i
|
|
3253
3614
|
);
|
|
3254
3615
|
}) }),
|
|
3255
|
-
!quiz && result === null && /* @__PURE__ */
|
|
3616
|
+
!quiz && result === null && /* @__PURE__ */ jsx71(
|
|
3256
3617
|
ark44.button,
|
|
3257
3618
|
{
|
|
3258
3619
|
type: "button",
|
|
@@ -3262,7 +3623,7 @@ function MultipleChoiceRenderer({
|
|
|
3262
3623
|
children: "Check"
|
|
3263
3624
|
}
|
|
3264
3625
|
),
|
|
3265
|
-
/* @__PURE__ */
|
|
3626
|
+
/* @__PURE__ */ jsx71(Feedback, { correct: displayResult, explanation: displayResult === null ? void 0 : explanation })
|
|
3266
3627
|
] });
|
|
3267
3628
|
}
|
|
3268
3629
|
function NumericRenderer({
|
|
@@ -3286,7 +3647,7 @@ function NumericRenderer({
|
|
|
3286
3647
|
const parsed = parseFloat(value);
|
|
3287
3648
|
return !Number.isNaN(parsed) && Math.abs(parsed - answer) <= tolerance;
|
|
3288
3649
|
};
|
|
3289
|
-
|
|
3650
|
+
useEffect8(() => {
|
|
3290
3651
|
if (quiz) {
|
|
3291
3652
|
const parsed = parseFloat(value);
|
|
3292
3653
|
const isAnswered = value.trim() !== "" && !Number.isNaN(parsed);
|
|
@@ -3302,9 +3663,9 @@ function NumericRenderer({
|
|
|
3302
3663
|
onGraded?.(isCorrect);
|
|
3303
3664
|
};
|
|
3304
3665
|
return /* @__PURE__ */ jsxs27("div", { className: cn70(questionCardBase, className), ...rest, children: [
|
|
3305
|
-
/* @__PURE__ */
|
|
3666
|
+
/* @__PURE__ */ jsx71(ark44.label, { htmlFor: inputId, className: questionPromptBase, children: prompt }),
|
|
3306
3667
|
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", children: [
|
|
3307
|
-
/* @__PURE__ */
|
|
3668
|
+
/* @__PURE__ */ jsx71(
|
|
3308
3669
|
ark44.input,
|
|
3309
3670
|
{
|
|
3310
3671
|
id: inputId,
|
|
@@ -3319,9 +3680,9 @@ function NumericRenderer({
|
|
|
3319
3680
|
className: questionInputBase
|
|
3320
3681
|
}
|
|
3321
3682
|
),
|
|
3322
|
-
unit ? /* @__PURE__ */
|
|
3683
|
+
unit ? /* @__PURE__ */ jsx71(ark44.span, { className: questionUnitBase, children: unit }) : null
|
|
3323
3684
|
] }),
|
|
3324
|
-
!quiz && result === null && /* @__PURE__ */
|
|
3685
|
+
!quiz && result === null && /* @__PURE__ */ jsx71(
|
|
3325
3686
|
ark44.button,
|
|
3326
3687
|
{
|
|
3327
3688
|
type: "button",
|
|
@@ -3331,17 +3692,17 @@ function NumericRenderer({
|
|
|
3331
3692
|
children: "Check"
|
|
3332
3693
|
}
|
|
3333
3694
|
),
|
|
3334
|
-
/* @__PURE__ */
|
|
3695
|
+
/* @__PURE__ */ jsx71(Feedback, { correct: displayResult, explanation: displayResult === null ? void 0 : explanation })
|
|
3335
3696
|
] });
|
|
3336
3697
|
}
|
|
3337
3698
|
function SingleChoiceQuestion(props) {
|
|
3338
|
-
return /* @__PURE__ */
|
|
3699
|
+
return /* @__PURE__ */ jsx71(SingleChoiceRenderer, { ...props });
|
|
3339
3700
|
}
|
|
3340
3701
|
function MultipleChoiceQuestion(props) {
|
|
3341
|
-
return /* @__PURE__ */
|
|
3702
|
+
return /* @__PURE__ */ jsx71(MultipleChoiceRenderer, { ...props });
|
|
3342
3703
|
}
|
|
3343
3704
|
function NumericQuestion(props) {
|
|
3344
|
-
return /* @__PURE__ */
|
|
3705
|
+
return /* @__PURE__ */ jsx71(NumericRenderer, { ...props });
|
|
3345
3706
|
}
|
|
3346
3707
|
function Quiz({ id, title, questions, className, ...props }) {
|
|
3347
3708
|
const [answers, setAnswers] = useState7({});
|
|
@@ -3368,7 +3729,7 @@ function Quiz({ id, title, questions, className, ...props }) {
|
|
|
3368
3729
|
};
|
|
3369
3730
|
switch (q.type) {
|
|
3370
3731
|
case "single":
|
|
3371
|
-
return /* @__PURE__ */
|
|
3732
|
+
return /* @__PURE__ */ jsx71(
|
|
3372
3733
|
SingleChoiceRenderer,
|
|
3373
3734
|
{
|
|
3374
3735
|
id: q.id,
|
|
@@ -3381,7 +3742,7 @@ function Quiz({ id, title, questions, className, ...props }) {
|
|
|
3381
3742
|
key
|
|
3382
3743
|
);
|
|
3383
3744
|
case "multiple":
|
|
3384
|
-
return /* @__PURE__ */
|
|
3745
|
+
return /* @__PURE__ */ jsx71(
|
|
3385
3746
|
MultipleChoiceRenderer,
|
|
3386
3747
|
{
|
|
3387
3748
|
id: q.id,
|
|
@@ -3394,7 +3755,7 @@ function Quiz({ id, title, questions, className, ...props }) {
|
|
|
3394
3755
|
key
|
|
3395
3756
|
);
|
|
3396
3757
|
case "numeric":
|
|
3397
|
-
return /* @__PURE__ */
|
|
3758
|
+
return /* @__PURE__ */ jsx71(
|
|
3398
3759
|
NumericRenderer,
|
|
3399
3760
|
{
|
|
3400
3761
|
id: q.id,
|
|
@@ -3412,10 +3773,10 @@ function Quiz({ id, title, questions, className, ...props }) {
|
|
|
3412
3773
|
}
|
|
3413
3774
|
};
|
|
3414
3775
|
return /* @__PURE__ */ jsxs27("div", { "data-quiz-id": id, className: cn70(quizRootBase, className), ...props, children: [
|
|
3415
|
-
/* @__PURE__ */
|
|
3776
|
+
/* @__PURE__ */ jsx71("div", { className: quizHeaderBase, children: title ? /* @__PURE__ */ jsx71(ark44.h3, { className: quizTitleBase, children: title }) : null }),
|
|
3416
3777
|
questions.map(renderQuestion),
|
|
3417
3778
|
/* @__PURE__ */ jsxs27("div", { className: "mt-4 flex items-center gap-3", children: [
|
|
3418
|
-
submitted ? /* @__PURE__ */
|
|
3779
|
+
submitted ? /* @__PURE__ */ jsx71(ark44.button, { type: "button", onClick: handleReset, className: quizResetButtonBase, children: "Reset" }) : /* @__PURE__ */ jsx71(
|
|
3419
3780
|
ark44.button,
|
|
3420
3781
|
{
|
|
3421
3782
|
type: "button",
|
|
@@ -3425,9 +3786,9 @@ function Quiz({ id, title, questions, className, ...props }) {
|
|
|
3425
3786
|
children: "Submit"
|
|
3426
3787
|
}
|
|
3427
3788
|
),
|
|
3428
|
-
/* @__PURE__ */
|
|
3789
|
+
/* @__PURE__ */ jsx71(ark44.span, { role: "status", className: quizScoreBase, children: submitted ? `${score}/${total} (${pct}%)` : `${total} question${total === 1 ? "" : "s"}` })
|
|
3429
3790
|
] }),
|
|
3430
|
-
submitted && /* @__PURE__ */
|
|
3791
|
+
submitted && /* @__PURE__ */ jsx71("div", { className: quizResultBase, children: /* @__PURE__ */ jsxs27("div", { "aria-live": "polite", role: "status", className: "text-center", children: [
|
|
3431
3792
|
/* @__PURE__ */ jsxs27("p", { className: quizResultTitleBase, children: [
|
|
3432
3793
|
score,
|
|
3433
3794
|
"/",
|
|
@@ -3436,16 +3797,16 @@ function Quiz({ id, title, questions, className, ...props }) {
|
|
|
3436
3797
|
pct,
|
|
3437
3798
|
"%)"
|
|
3438
3799
|
] }),
|
|
3439
|
-
/* @__PURE__ */
|
|
3800
|
+
/* @__PURE__ */ jsx71("p", { className: quizResultTextBase, children: pct >= 70 ? "Well done!" : "Keep studying and try again." })
|
|
3440
3801
|
] }) })
|
|
3441
3802
|
] });
|
|
3442
3803
|
}
|
|
3443
3804
|
|
|
3444
3805
|
// src/prose.tsx
|
|
3445
3806
|
import { proseVariants, cn as cn71 } from "@cloudvoyant/helical-ui";
|
|
3446
|
-
import { jsx as
|
|
3807
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
3447
3808
|
function Prose({ as: Tag = "div", size, className, children, ...props }) {
|
|
3448
|
-
return /* @__PURE__ */
|
|
3809
|
+
return /* @__PURE__ */ jsx72(Tag, { className: cn71(proseVariants({ size }), "prose", className), ...props, children });
|
|
3449
3810
|
}
|
|
3450
3811
|
|
|
3451
3812
|
// src/toggle-group.tsx
|
|
@@ -3458,9 +3819,9 @@ import {
|
|
|
3458
3819
|
toggleButtonVariants as toggleButtonVariants2,
|
|
3459
3820
|
cn as cn72
|
|
3460
3821
|
} from "@cloudvoyant/helical-ui";
|
|
3461
|
-
import { jsx as
|
|
3822
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
3462
3823
|
function ToggleGroup({ orientation, attached, className, ...props }) {
|
|
3463
|
-
return /* @__PURE__ */
|
|
3824
|
+
return /* @__PURE__ */ jsx73(
|
|
3464
3825
|
ToggleGroupRoot,
|
|
3465
3826
|
{
|
|
3466
3827
|
orientation: orientation ?? "horizontal",
|
|
@@ -3470,7 +3831,7 @@ function ToggleGroup({ orientation, attached, className, ...props }) {
|
|
|
3470
3831
|
);
|
|
3471
3832
|
}
|
|
3472
3833
|
function ToggleGroupItem({ variant, size, className, ...props }) {
|
|
3473
|
-
return /* @__PURE__ */
|
|
3834
|
+
return /* @__PURE__ */ jsx73(ArkToggleGroupItem, { className: cn72(toggleButtonVariants2({ variant, size }), className), ...props });
|
|
3474
3835
|
}
|
|
3475
3836
|
|
|
3476
3837
|
// src/listbox.tsx
|
|
@@ -3484,6 +3845,8 @@ import {
|
|
|
3484
3845
|
ListboxInput as ArkListboxInput,
|
|
3485
3846
|
ListboxEmpty as ArkListboxEmpty,
|
|
3486
3847
|
ListboxLabel as ArkListboxLabel,
|
|
3848
|
+
ListboxItemGroup as ArkListboxItemGroup,
|
|
3849
|
+
ListboxItemGroupLabel as ArkListboxItemGroupLabel,
|
|
3487
3850
|
createListCollection as createListCollection3,
|
|
3488
3851
|
useListboxContext
|
|
3489
3852
|
} from "@ark-ui/react/listbox";
|
|
@@ -3496,41 +3859,645 @@ import {
|
|
|
3496
3859
|
listboxInputBase,
|
|
3497
3860
|
listboxEmptyBase,
|
|
3498
3861
|
listboxLabelBase,
|
|
3862
|
+
listboxItemGroupBase,
|
|
3863
|
+
listboxItemGroupLabelBase,
|
|
3499
3864
|
cn as cn73
|
|
3500
3865
|
} from "@cloudvoyant/helical-ui";
|
|
3501
|
-
import { jsx as
|
|
3866
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
3502
3867
|
var useListbox = useListboxContext;
|
|
3503
3868
|
function Listbox({ items, collection, className, children, ...rest }) {
|
|
3504
3869
|
const resolvedCollection = useMemo6(
|
|
3505
3870
|
() => collection ?? createListCollection3({ items: items ?? [] }),
|
|
3506
3871
|
[collection, items]
|
|
3507
3872
|
);
|
|
3508
|
-
return /* @__PURE__ */
|
|
3873
|
+
return /* @__PURE__ */ jsx74(ListboxRoot, { collection: resolvedCollection, className: cn73(listboxRootBase, className), ...rest, children });
|
|
3509
3874
|
}
|
|
3510
3875
|
function ListboxContent({ className, children, ...rest }) {
|
|
3511
|
-
return /* @__PURE__ */
|
|
3876
|
+
return /* @__PURE__ */ jsx74(ArkListboxContent, { className: cn73(listboxContentBase, className), ...rest, children });
|
|
3512
3877
|
}
|
|
3513
3878
|
function ListboxItem({ item, className, children, ...rest }) {
|
|
3514
|
-
return /* @__PURE__ */
|
|
3879
|
+
return /* @__PURE__ */ jsx74(ArkListboxItem, { item, className: cn73(listboxItemBase, className), ...rest, children });
|
|
3515
3880
|
}
|
|
3516
3881
|
function ListboxItemText({ className, children, ...rest }) {
|
|
3517
|
-
return /* @__PURE__ */
|
|
3882
|
+
return /* @__PURE__ */ jsx74(ArkListboxItemText, { className: cn73(listboxItemTextBase, className), ...rest, children });
|
|
3518
3883
|
}
|
|
3519
3884
|
function ListboxItemIndicator({ className, children, ...rest }) {
|
|
3520
|
-
return /* @__PURE__ */
|
|
3885
|
+
return /* @__PURE__ */ jsx74(ArkListboxItemIndicator, { className: cn73(listboxItemIndicatorBase, className), ...rest, children });
|
|
3521
3886
|
}
|
|
3522
3887
|
function ListboxInput({ className, ...rest }) {
|
|
3523
|
-
return /* @__PURE__ */
|
|
3888
|
+
return /* @__PURE__ */ jsx74(ArkListboxInput, { className: cn73(listboxInputBase, className), ...rest });
|
|
3524
3889
|
}
|
|
3525
3890
|
function ListboxEmpty({ className, children, ...rest }) {
|
|
3526
|
-
return /* @__PURE__ */
|
|
3891
|
+
return /* @__PURE__ */ jsx74(ArkListboxEmpty, { className: cn73(listboxEmptyBase, className), ...rest, children: children ?? "No results." });
|
|
3527
3892
|
}
|
|
3528
3893
|
function ListboxLabel({ className, children, ...rest }) {
|
|
3529
|
-
return /* @__PURE__ */
|
|
3894
|
+
return /* @__PURE__ */ jsx74(ArkListboxLabel, { className: cn73(listboxLabelBase, className), ...rest, children });
|
|
3895
|
+
}
|
|
3896
|
+
function ListboxItemGroup({ className, children, ...rest }) {
|
|
3897
|
+
return /* @__PURE__ */ jsx74(ArkListboxItemGroup, { className: cn73(listboxItemGroupBase, className), ...rest, children });
|
|
3898
|
+
}
|
|
3899
|
+
function ListboxItemGroupLabel({ className, children, ...rest }) {
|
|
3900
|
+
return /* @__PURE__ */ jsx74(ArkListboxItemGroupLabel, { className: cn73(listboxItemGroupLabelBase, className), ...rest, children });
|
|
3901
|
+
}
|
|
3902
|
+
|
|
3903
|
+
// src/kbd.tsx
|
|
3904
|
+
import { ark as ark45 } from "@ark-ui/react/factory";
|
|
3905
|
+
import {
|
|
3906
|
+
cn as cn74,
|
|
3907
|
+
formatKeyChord,
|
|
3908
|
+
formatKeySequence,
|
|
3909
|
+
kbdGroupBase,
|
|
3910
|
+
kbdVariants
|
|
3911
|
+
} from "@cloudvoyant/helical-ui";
|
|
3912
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
3913
|
+
function Kbd({
|
|
3914
|
+
variant = "outline",
|
|
3915
|
+
size = "md",
|
|
3916
|
+
hotkey,
|
|
3917
|
+
platform,
|
|
3918
|
+
useSymbols = true,
|
|
3919
|
+
className,
|
|
3920
|
+
children,
|
|
3921
|
+
...props
|
|
3922
|
+
}) {
|
|
3923
|
+
if (hotkey && !children) {
|
|
3924
|
+
if (Array.isArray(hotkey) || typeof hotkey === "string" && /\s+/.test(hotkey.trim())) {
|
|
3925
|
+
const steps = formatKeySequence(hotkey, { platform, useSymbols });
|
|
3926
|
+
return /* @__PURE__ */ jsx75("span", { "data-slot": "kbd-sequence", className: cn74(kbdGroupBase, className), children: steps.map((step, idx) => /* @__PURE__ */ jsx75(
|
|
3927
|
+
ark45.kbd,
|
|
3928
|
+
{
|
|
3929
|
+
"data-slot": "kbd",
|
|
3930
|
+
"data-variant": variant,
|
|
3931
|
+
"data-size": size,
|
|
3932
|
+
className: cn74(kbdVariants({ variant, size })),
|
|
3933
|
+
...props,
|
|
3934
|
+
children: step
|
|
3935
|
+
},
|
|
3936
|
+
`${step}-${idx}`
|
|
3937
|
+
)) });
|
|
3938
|
+
}
|
|
3939
|
+
const formatted = formatKeyChord(hotkey, { platform, useSymbols });
|
|
3940
|
+
return /* @__PURE__ */ jsx75(
|
|
3941
|
+
ark45.kbd,
|
|
3942
|
+
{
|
|
3943
|
+
"data-slot": "kbd",
|
|
3944
|
+
"data-variant": variant,
|
|
3945
|
+
"data-size": size,
|
|
3946
|
+
className: cn74(kbdVariants({ variant, size }), className),
|
|
3947
|
+
...props,
|
|
3948
|
+
children: formatted
|
|
3949
|
+
}
|
|
3950
|
+
);
|
|
3951
|
+
}
|
|
3952
|
+
return /* @__PURE__ */ jsx75(
|
|
3953
|
+
ark45.kbd,
|
|
3954
|
+
{
|
|
3955
|
+
"data-slot": "kbd",
|
|
3956
|
+
"data-variant": variant,
|
|
3957
|
+
"data-size": size,
|
|
3958
|
+
className: cn74(kbdVariants({ variant, size }), className),
|
|
3959
|
+
...props,
|
|
3960
|
+
children
|
|
3961
|
+
}
|
|
3962
|
+
);
|
|
3963
|
+
}
|
|
3964
|
+
|
|
3965
|
+
// src/which-key/Pane.tsx
|
|
3966
|
+
import { ark as ark46 } from "@ark-ui/react/factory";
|
|
3967
|
+
import { cn as cn75, paneVariants } from "@cloudvoyant/helical-ui";
|
|
3968
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
3969
|
+
function Pane({
|
|
3970
|
+
paneId,
|
|
3971
|
+
paneTitle = "Pane",
|
|
3972
|
+
paneDisabled = false,
|
|
3973
|
+
paneOrder,
|
|
3974
|
+
className,
|
|
3975
|
+
children,
|
|
3976
|
+
...props
|
|
3977
|
+
}) {
|
|
3978
|
+
const pane = useOptionalPaneRegistration({
|
|
3979
|
+
paneId,
|
|
3980
|
+
paneTitle,
|
|
3981
|
+
paneDisabled,
|
|
3982
|
+
paneOrder,
|
|
3983
|
+
defaultTitle: paneTitle
|
|
3984
|
+
});
|
|
3985
|
+
return /* @__PURE__ */ jsx76(
|
|
3986
|
+
ark46.div,
|
|
3987
|
+
{
|
|
3988
|
+
ref: pane.ref,
|
|
3989
|
+
"data-slot": "pane",
|
|
3990
|
+
...pane.dataAttributes,
|
|
3991
|
+
className: cn75(paneVariants({ active: pane.isActive }), className),
|
|
3992
|
+
...props,
|
|
3993
|
+
children
|
|
3994
|
+
}
|
|
3995
|
+
);
|
|
3996
|
+
}
|
|
3997
|
+
|
|
3998
|
+
// src/which-key/WhichKey.tsx
|
|
3999
|
+
import { useEffect as useEffect10, useRef as useRef4 } from "react";
|
|
4000
|
+
import { Portal as Portal9 } from "@ark-ui/react/portal";
|
|
4001
|
+
import { Presence } from "@ark-ui/react/presence";
|
|
4002
|
+
import {
|
|
4003
|
+
cn as cn78,
|
|
4004
|
+
isGroupNode,
|
|
4005
|
+
jumpBadgeMatchedPrefixBase,
|
|
4006
|
+
jumpBadgeVariants,
|
|
4007
|
+
jumpOverlayRootBase,
|
|
4008
|
+
whichKeyBodyVariants,
|
|
4009
|
+
whichKeyBreadcrumbBase,
|
|
4010
|
+
whichKeyFooterBase,
|
|
4011
|
+
whichKeyHeaderBase,
|
|
4012
|
+
whichKeyItemBase,
|
|
4013
|
+
whichKeyItemLabelBase,
|
|
4014
|
+
whichKeyTitleBase,
|
|
4015
|
+
whichKeyVariants
|
|
4016
|
+
} from "@cloudvoyant/helical-ui";
|
|
4017
|
+
|
|
4018
|
+
// src/which-key/WhichKeyExplorer.tsx
|
|
4019
|
+
import { useEffect as useEffect9, useMemo as useMemo7, useState as useState8 } from "react";
|
|
4020
|
+
import { Highlight } from "@ark-ui/react/highlight";
|
|
4021
|
+
import { createListCollection as createListCollection4 } from "@ark-ui/react/listbox";
|
|
4022
|
+
import {
|
|
4023
|
+
cn as cn76,
|
|
4024
|
+
whichKeyExplorerContentBase,
|
|
4025
|
+
whichKeyExplorerHeaderBase,
|
|
4026
|
+
whichKeyExplorerHighlightMarkBase,
|
|
4027
|
+
whichKeyExplorerInputBase,
|
|
4028
|
+
whichKeyExplorerItemBase,
|
|
4029
|
+
whichKeyExplorerListboxBase,
|
|
4030
|
+
whichKeyExplorerListContentBase,
|
|
4031
|
+
whichKeyModeBadgeVariants
|
|
4032
|
+
} from "@cloudvoyant/helical-ui";
|
|
4033
|
+
import { jsx as jsx77, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4034
|
+
function WhichKeyExplorer({
|
|
4035
|
+
open: controlledOpen,
|
|
4036
|
+
onOpenChange,
|
|
4037
|
+
placeholder = "Search keybindings...",
|
|
4038
|
+
className
|
|
4039
|
+
}) {
|
|
4040
|
+
const controller = useOptionalWhichKeyController();
|
|
4041
|
+
if (!controller) return null;
|
|
4042
|
+
return /* @__PURE__ */ jsx77(
|
|
4043
|
+
WhichKeyExplorerInner,
|
|
4044
|
+
{
|
|
4045
|
+
open: controlledOpen,
|
|
4046
|
+
onOpenChange,
|
|
4047
|
+
placeholder,
|
|
4048
|
+
className
|
|
4049
|
+
}
|
|
4050
|
+
);
|
|
4051
|
+
}
|
|
4052
|
+
function WhichKeyExplorerInner({
|
|
4053
|
+
open: controlledOpen,
|
|
4054
|
+
onOpenChange,
|
|
4055
|
+
placeholder,
|
|
4056
|
+
className
|
|
4057
|
+
}) {
|
|
4058
|
+
const {
|
|
4059
|
+
preset,
|
|
4060
|
+
explorerOpen,
|
|
4061
|
+
explorerQuery,
|
|
4062
|
+
explorerEntries,
|
|
4063
|
+
openExplorer,
|
|
4064
|
+
closeExplorer,
|
|
4065
|
+
setExplorerQuery,
|
|
4066
|
+
controller
|
|
4067
|
+
} = useWhichKey();
|
|
4068
|
+
const isOpen = controlledOpen ?? explorerOpen;
|
|
4069
|
+
const [highlightedId, setHighlightedId] = useState8(null);
|
|
4070
|
+
const handleOpenChange = (nextOpen) => {
|
|
4071
|
+
if (nextOpen) {
|
|
4072
|
+
openExplorer();
|
|
4073
|
+
} else {
|
|
4074
|
+
closeExplorer();
|
|
4075
|
+
}
|
|
4076
|
+
onOpenChange?.(nextOpen);
|
|
4077
|
+
};
|
|
4078
|
+
const groupedEntries = useMemo7(() => {
|
|
4079
|
+
const groups = /* @__PURE__ */ new Map();
|
|
4080
|
+
for (const entry of explorerEntries) {
|
|
4081
|
+
const groupName = entry.group || "General";
|
|
4082
|
+
const list = groups.get(groupName) ?? [];
|
|
4083
|
+
list.push(entry);
|
|
4084
|
+
groups.set(groupName, list);
|
|
4085
|
+
}
|
|
4086
|
+
return Array.from(groups.entries());
|
|
4087
|
+
}, [explorerEntries]);
|
|
4088
|
+
const orderedEntries = useMemo7(
|
|
4089
|
+
() => groupedEntries.flatMap(([, entries]) => entries),
|
|
4090
|
+
[groupedEntries]
|
|
4091
|
+
);
|
|
4092
|
+
const effectiveHighlightedId = useMemo7(() => {
|
|
4093
|
+
if (orderedEntries.length === 0) return null;
|
|
4094
|
+
if (highlightedId && orderedEntries.some((e) => e.id === highlightedId)) {
|
|
4095
|
+
return highlightedId;
|
|
4096
|
+
}
|
|
4097
|
+
return orderedEntries[0].id;
|
|
4098
|
+
}, [highlightedId, orderedEntries]);
|
|
4099
|
+
const collection = useMemo7(
|
|
4100
|
+
() => createListCollection4({
|
|
4101
|
+
items: orderedEntries.map((entry) => ({
|
|
4102
|
+
value: entry.id,
|
|
4103
|
+
label: entry.label,
|
|
4104
|
+
entry
|
|
4105
|
+
}))
|
|
4106
|
+
}),
|
|
4107
|
+
[orderedEntries]
|
|
4108
|
+
);
|
|
4109
|
+
useEffect9(() => {
|
|
4110
|
+
if (!isOpen || typeof document === "undefined") return;
|
|
4111
|
+
const focusInput = () => {
|
|
4112
|
+
const input = document.querySelector(
|
|
4113
|
+
'[data-which-key-explorer] [data-testid="which-key-explorer-input"]'
|
|
4114
|
+
);
|
|
4115
|
+
input?.focus();
|
|
4116
|
+
};
|
|
4117
|
+
focusInput();
|
|
4118
|
+
const raf = requestAnimationFrame(focusInput);
|
|
4119
|
+
return () => cancelAnimationFrame(raf);
|
|
4120
|
+
}, [isOpen]);
|
|
4121
|
+
const scrollItemIntoView = (id) => {
|
|
4122
|
+
requestAnimationFrame(() => {
|
|
4123
|
+
if (typeof document === "undefined") return;
|
|
4124
|
+
const items = Array.from(
|
|
4125
|
+
document.querySelectorAll(
|
|
4126
|
+
'[data-which-key-explorer] [data-part="item"]'
|
|
4127
|
+
)
|
|
4128
|
+
);
|
|
4129
|
+
for (const el of items) {
|
|
4130
|
+
if (el.getAttribute("data-value") === id) {
|
|
4131
|
+
el.scrollIntoView({ block: "nearest" });
|
|
4132
|
+
break;
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
});
|
|
4136
|
+
};
|
|
4137
|
+
if (!isOpen) return null;
|
|
4138
|
+
return /* @__PURE__ */ jsxs28(
|
|
4139
|
+
Dialog,
|
|
4140
|
+
{
|
|
4141
|
+
open: isOpen,
|
|
4142
|
+
lazyMount: true,
|
|
4143
|
+
unmountOnExit: true,
|
|
4144
|
+
initialFocusEl: () => typeof document !== "undefined" ? document.querySelector(
|
|
4145
|
+
'[data-which-key-explorer] [data-testid="which-key-explorer-input"]'
|
|
4146
|
+
) : null,
|
|
4147
|
+
onOpenChange: (details) => handleOpenChange(details.open),
|
|
4148
|
+
children: [
|
|
4149
|
+
/* @__PURE__ */ jsx77(DialogBackdrop, {}),
|
|
4150
|
+
/* @__PURE__ */ jsxs28(
|
|
4151
|
+
DialogContent,
|
|
4152
|
+
{
|
|
4153
|
+
"data-which-key-explorer": "true",
|
|
4154
|
+
"data-testid": "which-key-explorer",
|
|
4155
|
+
className: cn76(whichKeyExplorerContentBase, className),
|
|
4156
|
+
children: [
|
|
4157
|
+
/* @__PURE__ */ jsxs28(DialogHeader, { className: whichKeyExplorerHeaderBase, children: [
|
|
4158
|
+
/* @__PURE__ */ jsxs28(Row, { className: "items-center gap-2", children: [
|
|
4159
|
+
/* @__PURE__ */ jsx77(DialogTitle, { className: "text-sm font-semibold", children: "Keybindings" }),
|
|
4160
|
+
/* @__PURE__ */ jsx77("span", { className: whichKeyModeBadgeVariants({ mode: "normal" }), children: preset })
|
|
4161
|
+
] }),
|
|
4162
|
+
/* @__PURE__ */ jsx77(
|
|
4163
|
+
DialogDismiss,
|
|
4164
|
+
{
|
|
4165
|
+
tabIndex: -1,
|
|
4166
|
+
className: "static opacity-80 hover:opacity-100 focus:ring-0",
|
|
4167
|
+
children: /* @__PURE__ */ jsx77(Kbd, { size: "sm", children: "Esc" })
|
|
4168
|
+
}
|
|
4169
|
+
)
|
|
4170
|
+
] }),
|
|
4171
|
+
/* @__PURE__ */ jsxs28(
|
|
4172
|
+
Listbox,
|
|
4173
|
+
{
|
|
4174
|
+
collection,
|
|
4175
|
+
selectionMode: "single",
|
|
4176
|
+
highlightedValue: effectiveHighlightedId,
|
|
4177
|
+
onHighlightChange: (details) => {
|
|
4178
|
+
if (details.highlightedValue) {
|
|
4179
|
+
setHighlightedId(details.highlightedValue);
|
|
4180
|
+
}
|
|
4181
|
+
},
|
|
4182
|
+
onSelect: (details) => {
|
|
4183
|
+
controller.executeExplorerEntry(details.value);
|
|
4184
|
+
},
|
|
4185
|
+
className: whichKeyExplorerListboxBase,
|
|
4186
|
+
children: [
|
|
4187
|
+
/* @__PURE__ */ jsx77(
|
|
4188
|
+
ListboxInput,
|
|
4189
|
+
{
|
|
4190
|
+
autoFocus: true,
|
|
4191
|
+
autoHighlight: true,
|
|
4192
|
+
"data-testid": "which-key-explorer-input",
|
|
4193
|
+
placeholder,
|
|
4194
|
+
value: explorerQuery,
|
|
4195
|
+
onChange: (e) => setExplorerQuery(e.currentTarget.value),
|
|
4196
|
+
onKeyDown: (e) => {
|
|
4197
|
+
if (orderedEntries.length === 0) return;
|
|
4198
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
4199
|
+
e.preventDefault();
|
|
4200
|
+
e.stopPropagation();
|
|
4201
|
+
const delta = e.key === "ArrowDown" ? 1 : -1;
|
|
4202
|
+
const currentIdx = orderedEntries.findIndex(
|
|
4203
|
+
(item) => item.id === effectiveHighlightedId
|
|
4204
|
+
);
|
|
4205
|
+
const nextIdx = currentIdx === -1 ? 0 : (currentIdx + delta + orderedEntries.length) % orderedEntries.length;
|
|
4206
|
+
const nextId = orderedEntries[nextIdx].id;
|
|
4207
|
+
setHighlightedId(nextId);
|
|
4208
|
+
scrollItemIntoView(nextId);
|
|
4209
|
+
return;
|
|
4210
|
+
}
|
|
4211
|
+
if (e.key === "Enter") {
|
|
4212
|
+
const itemVal = effectiveHighlightedId ?? orderedEntries[0]?.id;
|
|
4213
|
+
if (itemVal) {
|
|
4214
|
+
e.preventDefault();
|
|
4215
|
+
e.stopPropagation();
|
|
4216
|
+
controller.executeExplorerEntry(itemVal);
|
|
4217
|
+
}
|
|
4218
|
+
}
|
|
4219
|
+
},
|
|
4220
|
+
className: whichKeyExplorerInputBase
|
|
4221
|
+
}
|
|
4222
|
+
),
|
|
4223
|
+
/* @__PURE__ */ jsx77(Scroll, { className: "max-h-96 min-h-0 flex-1", viewportClassName: "max-h-96", children: /* @__PURE__ */ jsxs28(
|
|
4224
|
+
ListboxContent,
|
|
4225
|
+
{
|
|
4226
|
+
"data-testid": "which-key-explorer-list",
|
|
4227
|
+
className: whichKeyExplorerListContentBase,
|
|
4228
|
+
children: [
|
|
4229
|
+
groupedEntries.map(([groupName, entries]) => /* @__PURE__ */ jsxs28(ListboxItemGroup, { children: [
|
|
4230
|
+
/* @__PURE__ */ jsx77(ListboxItemGroupLabel, { children: groupName }),
|
|
4231
|
+
entries.map((entry) => /* @__PURE__ */ jsxs28(
|
|
4232
|
+
ListboxItem,
|
|
4233
|
+
{
|
|
4234
|
+
item: {
|
|
4235
|
+
value: entry.id,
|
|
4236
|
+
label: entry.label
|
|
4237
|
+
},
|
|
4238
|
+
"data-testid": "which-key-explorer-item",
|
|
4239
|
+
"data-command-id": entry.commandId,
|
|
4240
|
+
onClick: () => controller.executeExplorerEntry(entry),
|
|
4241
|
+
className: whichKeyExplorerItemBase,
|
|
4242
|
+
children: [
|
|
4243
|
+
/* @__PURE__ */ jsx77(ListboxItemText, { className: "min-w-0 flex-1 truncate font-medium text-foreground", children: /* @__PURE__ */ jsx77(
|
|
4244
|
+
Highlight,
|
|
4245
|
+
{
|
|
4246
|
+
text: entry.label,
|
|
4247
|
+
query: explorerQuery,
|
|
4248
|
+
ignoreCase: true,
|
|
4249
|
+
matchAll: true,
|
|
4250
|
+
className: whichKeyExplorerHighlightMarkBase
|
|
4251
|
+
}
|
|
4252
|
+
) }),
|
|
4253
|
+
/* @__PURE__ */ jsx77(Row, { className: "shrink-0 items-center gap-1", children: /* @__PURE__ */ jsx77(Kbd, { size: "sm", hotkey: entry.chords }) })
|
|
4254
|
+
]
|
|
4255
|
+
},
|
|
4256
|
+
entry.id
|
|
4257
|
+
))
|
|
4258
|
+
] }, groupName)),
|
|
4259
|
+
groupedEntries.length === 0 && /* @__PURE__ */ jsx77(ListboxEmpty, { children: "No matching keybindings found." })
|
|
4260
|
+
]
|
|
4261
|
+
}
|
|
4262
|
+
) })
|
|
4263
|
+
]
|
|
4264
|
+
}
|
|
4265
|
+
)
|
|
4266
|
+
]
|
|
4267
|
+
}
|
|
4268
|
+
)
|
|
4269
|
+
]
|
|
4270
|
+
}
|
|
4271
|
+
);
|
|
4272
|
+
}
|
|
4273
|
+
|
|
4274
|
+
// src/which-key/WhichKeyMode.tsx
|
|
4275
|
+
import { forwardRef } from "react";
|
|
4276
|
+
import {
|
|
4277
|
+
cn as cn77,
|
|
4278
|
+
whichKeyModeBadgeVariants as whichKeyModeBadgeVariants2
|
|
4279
|
+
} from "@cloudvoyant/helical-ui";
|
|
4280
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
4281
|
+
var WhichKeyMode = forwardRef(function WhichKeyMode2({ mode: modeProp, sticky: stickyProp, showPreset = false, size = "sm", className, ...props }, ref) {
|
|
4282
|
+
const ctx = useWhichKey();
|
|
4283
|
+
const resolvedMode = modeProp ?? ctx.mode;
|
|
4284
|
+
const resolvedSticky = stickyProp ?? ctx.sticky;
|
|
4285
|
+
const modeLabel = resolvedSticky ? `${resolvedMode}\xB7lock` : resolvedMode;
|
|
4286
|
+
const label = showPreset ? `${ctx.preset} \xB7 ${modeLabel}` : modeLabel;
|
|
4287
|
+
return /* @__PURE__ */ jsx78(
|
|
4288
|
+
"span",
|
|
4289
|
+
{
|
|
4290
|
+
ref,
|
|
4291
|
+
"data-slot": "which-key-mode",
|
|
4292
|
+
"data-testid": "which-key-mode-badge",
|
|
4293
|
+
"data-mode": resolvedMode,
|
|
4294
|
+
"data-sticky": resolvedSticky ? "true" : "false",
|
|
4295
|
+
"data-preset": ctx.preset,
|
|
4296
|
+
className: cn77(whichKeyModeBadgeVariants2({ mode: resolvedMode, size }), className),
|
|
4297
|
+
...props,
|
|
4298
|
+
children: label
|
|
4299
|
+
}
|
|
4300
|
+
);
|
|
4301
|
+
});
|
|
4302
|
+
|
|
4303
|
+
// src/which-key/WhichKey.tsx
|
|
4304
|
+
import { Fragment as Fragment7, jsx as jsx79, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4305
|
+
function WhichKey(props) {
|
|
4306
|
+
const controller = useOptionalWhichKeyController();
|
|
4307
|
+
if (!controller) return null;
|
|
4308
|
+
return /* @__PURE__ */ jsx79(WhichKeyInner, { ...props });
|
|
4309
|
+
}
|
|
4310
|
+
function WhichKeyInner({
|
|
4311
|
+
variant = "helix",
|
|
4312
|
+
showModeBadge = true,
|
|
4313
|
+
showExplorer = true,
|
|
4314
|
+
className
|
|
4315
|
+
}) {
|
|
4316
|
+
const {
|
|
4317
|
+
preset,
|
|
4318
|
+
mode,
|
|
4319
|
+
breadcrumb,
|
|
4320
|
+
title,
|
|
4321
|
+
items,
|
|
4322
|
+
isOpen,
|
|
4323
|
+
sticky,
|
|
4324
|
+
countBuffer,
|
|
4325
|
+
jumpAction,
|
|
4326
|
+
jumpTargets,
|
|
4327
|
+
triggerKey,
|
|
4328
|
+
stepBackPrefix,
|
|
4329
|
+
closePrefix,
|
|
4330
|
+
controller
|
|
4331
|
+
} = useWhichKey();
|
|
4332
|
+
const panelRef = useRef4(null);
|
|
4333
|
+
const jumpOverlayRef = useRef4(null);
|
|
4334
|
+
useEffect10(() => {
|
|
4335
|
+
if (!isOpen) return;
|
|
4336
|
+
return controller.trackBranchElement(() => panelRef.current);
|
|
4337
|
+
}, [controller, isOpen]);
|
|
4338
|
+
useEffect10(() => {
|
|
4339
|
+
if (mode !== "jump") return;
|
|
4340
|
+
return controller.trackBranchElement(() => jumpOverlayRef.current);
|
|
4341
|
+
}, [controller, mode]);
|
|
4342
|
+
return /* @__PURE__ */ jsxs29(Fragment7, { children: [
|
|
4343
|
+
/* @__PURE__ */ jsx79(Portal9, { children: /* @__PURE__ */ jsx79(Presence, { present: isOpen, lazyMount: true, unmountOnExit: true, children: /* @__PURE__ */ jsxs29(
|
|
4344
|
+
"div",
|
|
4345
|
+
{
|
|
4346
|
+
ref: panelRef,
|
|
4347
|
+
role: "region",
|
|
4348
|
+
"aria-label": title || "WhichKey commands",
|
|
4349
|
+
"data-which-key-root": "true",
|
|
4350
|
+
"data-testid": "which-key-panel",
|
|
4351
|
+
"data-variant": variant,
|
|
4352
|
+
"data-preset": preset,
|
|
4353
|
+
"data-mode": mode,
|
|
4354
|
+
"data-sticky": sticky ? "true" : "false",
|
|
4355
|
+
className: cn78(whichKeyVariants({ variant }), className),
|
|
4356
|
+
children: [
|
|
4357
|
+
/* @__PURE__ */ jsxs29("div", { className: whichKeyHeaderBase, children: [
|
|
4358
|
+
/* @__PURE__ */ jsxs29("div", { className: whichKeyTitleBase, children: [
|
|
4359
|
+
showModeBadge && /* @__PURE__ */ jsx79(WhichKeyMode, { mode, sticky }),
|
|
4360
|
+
/* @__PURE__ */ jsx79("span", { "data-testid": "which-key-title", children: title === "Space" ? "Leader" : title }),
|
|
4361
|
+
countBuffer && /* @__PURE__ */ jsxs29(
|
|
4362
|
+
"span",
|
|
4363
|
+
{
|
|
4364
|
+
"data-testid": "which-key-count",
|
|
4365
|
+
className: "rounded bg-muted px-1 font-mono text-[10px]",
|
|
4366
|
+
children: [
|
|
4367
|
+
countBuffer,
|
|
4368
|
+
"\xD7"
|
|
4369
|
+
]
|
|
4370
|
+
}
|
|
4371
|
+
)
|
|
4372
|
+
] }),
|
|
4373
|
+
/* @__PURE__ */ jsx79(
|
|
4374
|
+
"div",
|
|
4375
|
+
{
|
|
4376
|
+
"data-testid": "which-key-breadcrumb",
|
|
4377
|
+
className: whichKeyBreadcrumbBase,
|
|
4378
|
+
children: /* @__PURE__ */ jsx79("span", { children: breadcrumb.join(" \xBB ") })
|
|
4379
|
+
}
|
|
4380
|
+
)
|
|
4381
|
+
] }),
|
|
4382
|
+
/* @__PURE__ */ jsx79(Scroll, { className: "max-h-72", viewportClassName: "max-h-72", children: /* @__PURE__ */ jsx79(
|
|
4383
|
+
"div",
|
|
4384
|
+
{
|
|
4385
|
+
"data-testid": "which-key-items",
|
|
4386
|
+
className: whichKeyBodyVariants({ variant }),
|
|
4387
|
+
children: items.map((node) => {
|
|
4388
|
+
const isGroup = Boolean(
|
|
4389
|
+
node.children || node.proxy || node.expand || node.label.startsWith("+")
|
|
4390
|
+
);
|
|
4391
|
+
return /* @__PURE__ */ jsxs29(
|
|
4392
|
+
"button",
|
|
4393
|
+
{
|
|
4394
|
+
type: "button",
|
|
4395
|
+
"data-testid": "which-key-item",
|
|
4396
|
+
"data-key": node.key,
|
|
4397
|
+
"data-group": isGroup ? "true" : "false",
|
|
4398
|
+
onClick: (e) => {
|
|
4399
|
+
e.preventDefault();
|
|
4400
|
+
e.stopPropagation();
|
|
4401
|
+
triggerKey(node.key);
|
|
4402
|
+
},
|
|
4403
|
+
className: whichKeyItemBase,
|
|
4404
|
+
children: [
|
|
4405
|
+
/* @__PURE__ */ jsx79(
|
|
4406
|
+
"span",
|
|
4407
|
+
{
|
|
4408
|
+
"data-group": isGroup ? "true" : "false",
|
|
4409
|
+
className: whichKeyItemLabelBase,
|
|
4410
|
+
children: node.label
|
|
4411
|
+
}
|
|
4412
|
+
),
|
|
4413
|
+
/* @__PURE__ */ jsx79(
|
|
4414
|
+
Kbd,
|
|
4415
|
+
{
|
|
4416
|
+
size: "sm",
|
|
4417
|
+
variant: isGroup ? "subtle" : "outline",
|
|
4418
|
+
hotkey: node.key
|
|
4419
|
+
}
|
|
4420
|
+
)
|
|
4421
|
+
]
|
|
4422
|
+
},
|
|
4423
|
+
node.key
|
|
4424
|
+
);
|
|
4425
|
+
})
|
|
4426
|
+
}
|
|
4427
|
+
) }),
|
|
4428
|
+
/* @__PURE__ */ jsxs29("div", { className: whichKeyFooterBase, children: [
|
|
4429
|
+
/* @__PURE__ */ jsxs29(Row, { className: "items-center gap-2", children: [
|
|
4430
|
+
breadcrumb.length > 1 && /* @__PURE__ */ jsxs29(
|
|
4431
|
+
"button",
|
|
4432
|
+
{
|
|
4433
|
+
type: "button",
|
|
4434
|
+
onClick: () => stepBackPrefix(),
|
|
4435
|
+
className: "inline-flex items-center gap-1 hover:text-foreground",
|
|
4436
|
+
children: [
|
|
4437
|
+
/* @__PURE__ */ jsx79(Kbd, { size: "sm", children: "\u232B" }),
|
|
4438
|
+
/* @__PURE__ */ jsx79("span", { children: "Back" })
|
|
4439
|
+
]
|
|
4440
|
+
}
|
|
4441
|
+
),
|
|
4442
|
+
/* @__PURE__ */ jsxs29(
|
|
4443
|
+
"button",
|
|
4444
|
+
{
|
|
4445
|
+
type: "button",
|
|
4446
|
+
onClick: () => closePrefix(),
|
|
4447
|
+
className: "inline-flex items-center gap-1 hover:text-foreground",
|
|
4448
|
+
children: [
|
|
4449
|
+
/* @__PURE__ */ jsx79(Kbd, { size: "sm", children: "Esc" }),
|
|
4450
|
+
/* @__PURE__ */ jsx79("span", { children: "Close" })
|
|
4451
|
+
]
|
|
4452
|
+
}
|
|
4453
|
+
)
|
|
4454
|
+
] }),
|
|
4455
|
+
/* @__PURE__ */ jsx79("span", { className: "font-mono uppercase opacity-75", children: preset })
|
|
4456
|
+
] })
|
|
4457
|
+
]
|
|
4458
|
+
}
|
|
4459
|
+
) }) }),
|
|
4460
|
+
/* @__PURE__ */ jsx79(Portal9, { children: /* @__PURE__ */ jsx79(
|
|
4461
|
+
Presence,
|
|
4462
|
+
{
|
|
4463
|
+
present: mode === "jump" && jumpTargets.length > 0,
|
|
4464
|
+
lazyMount: true,
|
|
4465
|
+
unmountOnExit: true,
|
|
4466
|
+
children: /* @__PURE__ */ jsx79(
|
|
4467
|
+
"div",
|
|
4468
|
+
{
|
|
4469
|
+
ref: jumpOverlayRef,
|
|
4470
|
+
"data-which-key-jump-overlay": "true",
|
|
4471
|
+
"data-testid": "which-key-jump-overlay",
|
|
4472
|
+
"data-jump-action": jumpAction,
|
|
4473
|
+
className: jumpOverlayRootBase,
|
|
4474
|
+
children: jumpTargets.map((target) => /* @__PURE__ */ jsxs29(
|
|
4475
|
+
"span",
|
|
4476
|
+
{
|
|
4477
|
+
"data-testid": "which-key-jump-badge",
|
|
4478
|
+
"data-jump-label": target.label,
|
|
4479
|
+
style: {
|
|
4480
|
+
top: `${Math.max(4, target.rect.top - 4)}px`,
|
|
4481
|
+
left: `${Math.max(4, target.rect.left - 4)}px`
|
|
4482
|
+
},
|
|
4483
|
+
className: jumpBadgeVariants({ action: jumpAction }),
|
|
4484
|
+
children: [
|
|
4485
|
+
target.matchedPrefix && /* @__PURE__ */ jsx79("span", { className: jumpBadgeMatchedPrefixBase, children: target.matchedPrefix }),
|
|
4486
|
+
/* @__PURE__ */ jsx79("span", { children: target.remainingLabel })
|
|
4487
|
+
]
|
|
4488
|
+
},
|
|
4489
|
+
target.id
|
|
4490
|
+
))
|
|
4491
|
+
}
|
|
4492
|
+
)
|
|
4493
|
+
}
|
|
4494
|
+
) }),
|
|
4495
|
+
showExplorer && /* @__PURE__ */ jsx79(WhichKeyExplorer, {})
|
|
4496
|
+
] });
|
|
3530
4497
|
}
|
|
3531
4498
|
|
|
3532
4499
|
// src/editor/Editor.tsx
|
|
3533
|
-
import { forwardRef as
|
|
4500
|
+
import { forwardRef as forwardRef4, useEffect as useEffect19, useImperativeHandle as useImperativeHandle3, useMemo as useMemo8, useRef as useRef11, useState as useState19 } from "react";
|
|
3534
4501
|
import { useEditor, EditorContent, ReactNodeViewRenderer } from "@tiptap/react";
|
|
3535
4502
|
import {
|
|
3536
4503
|
buildExtensions,
|
|
@@ -3544,14 +4511,14 @@ import {
|
|
|
3544
4511
|
} from "@cloudvoyant/helical-ui";
|
|
3545
4512
|
|
|
3546
4513
|
// src/editor/ImageNodeView.tsx
|
|
3547
|
-
import { useState as
|
|
4514
|
+
import { useState as useState9 } from "react";
|
|
3548
4515
|
import { NodeViewWrapper } from "@tiptap/react";
|
|
3549
|
-
import { jsx as
|
|
4516
|
+
import { jsx as jsx80, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3550
4517
|
function ImageNodeView({ node, updateAttributes, selected, editor, getPos }) {
|
|
3551
|
-
const [captionFocused, setCaptionFocused] =
|
|
4518
|
+
const [captionFocused, setCaptionFocused] = useState9(false);
|
|
3552
4519
|
const { src, srcset, alt, caption } = node.attrs;
|
|
3553
|
-
return /* @__PURE__ */
|
|
3554
|
-
/* @__PURE__ */
|
|
4520
|
+
return /* @__PURE__ */ jsxs30(NodeViewWrapper, { as: "figure", "data-type": "image-node", className: "my-6 m-0 relative", children: [
|
|
4521
|
+
/* @__PURE__ */ jsx80(
|
|
3555
4522
|
"img",
|
|
3556
4523
|
{
|
|
3557
4524
|
src,
|
|
@@ -3562,7 +4529,7 @@ function ImageNodeView({ node, updateAttributes, selected, editor, getPos }) {
|
|
|
3562
4529
|
"data-selected": selected ? "" : void 0
|
|
3563
4530
|
}
|
|
3564
4531
|
),
|
|
3565
|
-
/* @__PURE__ */
|
|
4532
|
+
/* @__PURE__ */ jsx80(
|
|
3566
4533
|
"input",
|
|
3567
4534
|
{
|
|
3568
4535
|
className: "caption-input mt-2 w-full bg-transparent text-center text-sm italic text-muted-foreground outline-none",
|
|
@@ -3595,11 +4562,11 @@ function ImageNodeView({ node, updateAttributes, selected, editor, getPos }) {
|
|
|
3595
4562
|
|
|
3596
4563
|
// src/editor/UrlMentionPill.tsx
|
|
3597
4564
|
import { NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
|
|
3598
|
-
import { jsx as
|
|
4565
|
+
import { jsx as jsx81, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3599
4566
|
function UrlMentionPill({ node }) {
|
|
3600
4567
|
const { url, title, favicon } = node.attrs;
|
|
3601
4568
|
const displayTitle = title || url || "";
|
|
3602
|
-
return /* @__PURE__ */
|
|
4569
|
+
return /* @__PURE__ */ jsx81(NodeViewWrapper2, { as: "span", className: "inline", children: /* @__PURE__ */ jsxs31(
|
|
3603
4570
|
"a",
|
|
3604
4571
|
{
|
|
3605
4572
|
href: url || "",
|
|
@@ -3609,7 +4576,7 @@ function UrlMentionPill({ node }) {
|
|
|
3609
4576
|
className: "url-mention-pill url-mention-pill-edit inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 align-text-bottom text-sm leading-tight no-underline",
|
|
3610
4577
|
style: { color: "inherit" },
|
|
3611
4578
|
children: [
|
|
3612
|
-
favicon ? /* @__PURE__ */
|
|
4579
|
+
favicon ? /* @__PURE__ */ jsx81(
|
|
3613
4580
|
"img",
|
|
3614
4581
|
{
|
|
3615
4582
|
src: favicon,
|
|
@@ -3619,8 +4586,8 @@ function UrlMentionPill({ node }) {
|
|
|
3619
4586
|
event.currentTarget.style.display = "none";
|
|
3620
4587
|
}
|
|
3621
4588
|
}
|
|
3622
|
-
) : /* @__PURE__ */
|
|
3623
|
-
/* @__PURE__ */
|
|
4589
|
+
) : /* @__PURE__ */ jsx81("svg", { className: "inline-block h-3.5 w-3.5 shrink-0", fill: "currentColor", viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ jsx81("path", { d: "M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l-3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z" }) }),
|
|
4590
|
+
/* @__PURE__ */ jsx81("span", { children: displayTitle })
|
|
3624
4591
|
]
|
|
3625
4592
|
}
|
|
3626
4593
|
) });
|
|
@@ -3628,7 +4595,7 @@ function UrlMentionPill({ node }) {
|
|
|
3628
4595
|
|
|
3629
4596
|
// src/editor/LinkPreviewCard.tsx
|
|
3630
4597
|
import { NodeViewWrapper as NodeViewWrapper3 } from "@tiptap/react";
|
|
3631
|
-
import { jsx as
|
|
4598
|
+
import { jsx as jsx82, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3632
4599
|
function hostnameOf(url) {
|
|
3633
4600
|
try {
|
|
3634
4601
|
return new URL(url).hostname;
|
|
@@ -3650,10 +4617,10 @@ function LinkPreviewCard({ node }) {
|
|
|
3650
4617
|
const { url, title, description, image, favicon, type } = node.attrs;
|
|
3651
4618
|
if (type === "embed") {
|
|
3652
4619
|
const videoId = url ? youTubeId(url) : null;
|
|
3653
|
-
return /* @__PURE__ */
|
|
4620
|
+
return /* @__PURE__ */ jsx82(NodeViewWrapper3, { as: "div", "data-type": "link-preview", className: "link-preview my-4", children: videoId ? (
|
|
3654
4621
|
// helical YouTube takes the full url and derives the id itself.
|
|
3655
|
-
/* @__PURE__ */
|
|
3656
|
-
) : /* @__PURE__ */
|
|
4622
|
+
/* @__PURE__ */ jsx82(YouTube, { url, title })
|
|
4623
|
+
) : /* @__PURE__ */ jsx82("div", { className: "relative h-0 overflow-hidden rounded-lg pb-[56.25%]", children: /* @__PURE__ */ jsx82(
|
|
3657
4624
|
"iframe",
|
|
3658
4625
|
{
|
|
3659
4626
|
src: url,
|
|
@@ -3664,7 +4631,7 @@ function LinkPreviewCard({ node }) {
|
|
|
3664
4631
|
}
|
|
3665
4632
|
) }) });
|
|
3666
4633
|
}
|
|
3667
|
-
return /* @__PURE__ */
|
|
4634
|
+
return /* @__PURE__ */ jsx82(NodeViewWrapper3, { as: "div", "data-type": "link-preview", className: "link-preview my-4", children: /* @__PURE__ */ jsxs32(
|
|
3668
4635
|
"a",
|
|
3669
4636
|
{
|
|
3670
4637
|
href: url || "",
|
|
@@ -3673,13 +4640,13 @@ function LinkPreviewCard({ node }) {
|
|
|
3673
4640
|
className: "bookmark-link flex overflow-hidden rounded-lg border border-border/70 bg-muted/40 no-underline transition-colors hover:bg-muted",
|
|
3674
4641
|
style: { color: "inherit" },
|
|
3675
4642
|
children: [
|
|
3676
|
-
/* @__PURE__ */
|
|
3677
|
-
/* @__PURE__ */
|
|
3678
|
-
/* @__PURE__ */
|
|
3679
|
-
description ? /* @__PURE__ */
|
|
4643
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex min-w-0 flex-1 flex-col justify-between px-3 py-1.5", children: [
|
|
4644
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
4645
|
+
/* @__PURE__ */ jsx82("div", { className: "mb-1 line-clamp-1 text-base font-semibold", children: title }),
|
|
4646
|
+
description ? /* @__PURE__ */ jsx82("p", { className: "mb-2 line-clamp-2 text-xs leading-snug text-muted-foreground", children: description }) : null
|
|
3680
4647
|
] }),
|
|
3681
|
-
/* @__PURE__ */
|
|
3682
|
-
favicon ? /* @__PURE__ */
|
|
4648
|
+
/* @__PURE__ */ jsxs32("div", { className: "mt-auto flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
4649
|
+
favicon ? /* @__PURE__ */ jsx82(
|
|
3683
4650
|
"img",
|
|
3684
4651
|
{
|
|
3685
4652
|
src: favicon,
|
|
@@ -3689,11 +4656,11 @@ function LinkPreviewCard({ node }) {
|
|
|
3689
4656
|
event.currentTarget.style.display = "none";
|
|
3690
4657
|
}
|
|
3691
4658
|
}
|
|
3692
|
-
) : /* @__PURE__ */
|
|
3693
|
-
/* @__PURE__ */
|
|
4659
|
+
) : /* @__PURE__ */ jsx82("svg", { className: "h-3 w-3 shrink-0", fill: "currentColor", viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ jsx82("path", { d: "M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l-3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z" }) }),
|
|
4660
|
+
/* @__PURE__ */ jsx82("span", { className: "truncate opacity-80", children: url ? hostnameOf(url) : "" })
|
|
3694
4661
|
] })
|
|
3695
4662
|
] }),
|
|
3696
|
-
image ? /* @__PURE__ */
|
|
4663
|
+
image ? /* @__PURE__ */ jsx82("div", { className: "aspect-video w-44 shrink-0 bg-muted", children: /* @__PURE__ */ jsx82(
|
|
3697
4664
|
"img",
|
|
3698
4665
|
{
|
|
3699
4666
|
src: image,
|
|
@@ -3713,8 +4680,8 @@ function LinkPreviewCard({ node }) {
|
|
|
3713
4680
|
// src/editor/CodeBlockComponent.tsx
|
|
3714
4681
|
import { NodeViewWrapper as NodeViewWrapper4, NodeViewContent } from "@tiptap/react";
|
|
3715
4682
|
import { ChevronsUpDown, Check } from "lucide-react";
|
|
3716
|
-
import { cn as
|
|
3717
|
-
import { jsx as
|
|
4683
|
+
import { cn as cn79, codeBlockBodyBase as codeBlockBodyBase2, codeBlockContentBase as codeBlockContentBase2 } from "@cloudvoyant/helical-ui";
|
|
4684
|
+
import { jsx as jsx83, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3718
4685
|
var LANGUAGES = [
|
|
3719
4686
|
{ value: "javascript", label: "JavaScript" },
|
|
3720
4687
|
{ value: "typescript", label: "TypeScript" },
|
|
@@ -3737,11 +4704,11 @@ function CodeBlockComponent({ node, editor, updateAttributes }) {
|
|
|
3737
4704
|
const language = node.attrs.language || "javascript";
|
|
3738
4705
|
const editable = editor.isEditable;
|
|
3739
4706
|
const currentLabel = LANGUAGES.find((item) => item.value === language)?.label ?? "JavaScript";
|
|
3740
|
-
return /* @__PURE__ */
|
|
3741
|
-
/* @__PURE__ */
|
|
3742
|
-
/* @__PURE__ */
|
|
3743
|
-
/* @__PURE__ */
|
|
3744
|
-
editable ? /* @__PURE__ */
|
|
4707
|
+
return /* @__PURE__ */ jsx83(NodeViewWrapper4, { className: "my-4", children: /* @__PURE__ */ jsxs33(CodeBlock, { code: node.textContent, language, className: "my-0", children: [
|
|
4708
|
+
/* @__PURE__ */ jsxs33(CodeBlockHeader, { children: [
|
|
4709
|
+
/* @__PURE__ */ jsx83(CodeBlockTitle, { children: currentLabel }),
|
|
4710
|
+
/* @__PURE__ */ jsxs33("div", { className: "ml-auto flex items-center gap-2", contentEditable: false, children: [
|
|
4711
|
+
editable ? /* @__PURE__ */ jsxs33(
|
|
3745
4712
|
Select,
|
|
3746
4713
|
{
|
|
3747
4714
|
items: LANGUAGES,
|
|
@@ -3752,28 +4719,28 @@ function CodeBlockComponent({ node, editor, updateAttributes }) {
|
|
|
3752
4719
|
},
|
|
3753
4720
|
"aria-label": "Code language",
|
|
3754
4721
|
children: [
|
|
3755
|
-
/* @__PURE__ */
|
|
3756
|
-
/* @__PURE__ */
|
|
3757
|
-
/* @__PURE__ */
|
|
4722
|
+
/* @__PURE__ */ jsxs33(SelectTrigger, { size: "sm", className: "min-w-36 justify-between font-mono text-xs", children: [
|
|
4723
|
+
/* @__PURE__ */ jsx83(SelectValue, {}),
|
|
4724
|
+
/* @__PURE__ */ jsx83(SelectIndicator, { children: /* @__PURE__ */ jsx83(ChevronsUpDown, { className: "size-3 opacity-50" }) })
|
|
3758
4725
|
] }),
|
|
3759
|
-
/* @__PURE__ */
|
|
3760
|
-
/* @__PURE__ */
|
|
3761
|
-
/* @__PURE__ */
|
|
4726
|
+
/* @__PURE__ */ jsx83(SelectContent, { children: LANGUAGES.map((item) => /* @__PURE__ */ jsxs33(SelectItem, { item, children: [
|
|
4727
|
+
/* @__PURE__ */ jsx83(SelectItemText, { children: item.label }),
|
|
4728
|
+
/* @__PURE__ */ jsx83(SelectItemIndicator, { children: /* @__PURE__ */ jsx83(Check, { className: "size-4" }) })
|
|
3762
4729
|
] }, item.value)) })
|
|
3763
4730
|
]
|
|
3764
4731
|
}
|
|
3765
4732
|
) : null,
|
|
3766
|
-
/* @__PURE__ */
|
|
4733
|
+
/* @__PURE__ */ jsx83(CodeBlockCopyButton, {})
|
|
3767
4734
|
] })
|
|
3768
4735
|
] }),
|
|
3769
|
-
/* @__PURE__ */
|
|
4736
|
+
/* @__PURE__ */ jsx83("div", { className: codeBlockBodyBase2, children: /* @__PURE__ */ jsx83(
|
|
3770
4737
|
"pre",
|
|
3771
4738
|
{
|
|
3772
|
-
className:
|
|
4739
|
+
className: cn79(
|
|
3773
4740
|
codeBlockContentBase2,
|
|
3774
4741
|
"editor-code-content m-0 rounded-none border-0 bg-transparent p-4 font-mono [&_code]:bg-transparent [&_code]:p-0"
|
|
3775
4742
|
),
|
|
3776
|
-
children: /* @__PURE__ */
|
|
4743
|
+
children: /* @__PURE__ */ jsx83(NodeViewContent, { as: "code" })
|
|
3777
4744
|
}
|
|
3778
4745
|
) })
|
|
3779
4746
|
] }) });
|
|
@@ -3781,7 +4748,7 @@ function CodeBlockComponent({ node, editor, updateAttributes }) {
|
|
|
3781
4748
|
|
|
3782
4749
|
// src/editor/NoticeNodeView.tsx
|
|
3783
4750
|
import { NodeViewContent as NodeViewContent2, NodeViewWrapper as NodeViewWrapper5 } from "@tiptap/react";
|
|
3784
|
-
import { jsx as
|
|
4751
|
+
import { jsx as jsx84, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3785
4752
|
var VARIANTS = ["info", "success", "warning", "error"];
|
|
3786
4753
|
function NoticeNodeView({ node, editor, getPos, updateAttributes }) {
|
|
3787
4754
|
const variant = node.attrs.variant ?? "info";
|
|
@@ -3794,9 +4761,9 @@ function NoticeNodeView({ node, editor, getPos, updateAttributes }) {
|
|
|
3794
4761
|
const position = bodyStart();
|
|
3795
4762
|
if (position !== null) editor.chain().focus().setTextSelection(position).run();
|
|
3796
4763
|
};
|
|
3797
|
-
return /* @__PURE__ */
|
|
3798
|
-
/* @__PURE__ */
|
|
3799
|
-
/* @__PURE__ */
|
|
4764
|
+
return /* @__PURE__ */ jsx84(NodeViewWrapper5, { children: /* @__PURE__ */ jsxs34(Notice, { variant, className: "editor-notice-node relative my-1 px-2 py-1", children: [
|
|
4765
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2", contentEditable: false, children: [
|
|
4766
|
+
/* @__PURE__ */ jsx84(
|
|
3800
4767
|
"input",
|
|
3801
4768
|
{
|
|
3802
4769
|
"aria-label": "Notice title",
|
|
@@ -3812,23 +4779,23 @@ function NoticeNodeView({ node, editor, getPos, updateAttributes }) {
|
|
|
3812
4779
|
placeholder: "Notice title"
|
|
3813
4780
|
}
|
|
3814
4781
|
),
|
|
3815
|
-
/* @__PURE__ */
|
|
4782
|
+
/* @__PURE__ */ jsx84(
|
|
3816
4783
|
"select",
|
|
3817
4784
|
{
|
|
3818
4785
|
"aria-label": "Notice type",
|
|
3819
4786
|
value: variant,
|
|
3820
4787
|
onChange: (event) => updateAttributes({ variant: event.target.value }),
|
|
3821
4788
|
className: "rounded border border-input bg-background px-1.5 py-0.5 text-xs",
|
|
3822
|
-
children: VARIANTS.map((value) => /* @__PURE__ */
|
|
4789
|
+
children: VARIANTS.map((value) => /* @__PURE__ */ jsx84("option", { value, children: value }, value))
|
|
3823
4790
|
}
|
|
3824
4791
|
)
|
|
3825
4792
|
] }),
|
|
3826
|
-
/* @__PURE__ */
|
|
4793
|
+
/* @__PURE__ */ jsx84(NodeViewContent2, { className: "[&_p]:m-0" })
|
|
3827
4794
|
] }) });
|
|
3828
4795
|
}
|
|
3829
4796
|
|
|
3830
4797
|
// src/editor/BubbleMenu.tsx
|
|
3831
|
-
import { useEffect as
|
|
4798
|
+
import { useEffect as useEffect13, useState as useState12 } from "react";
|
|
3832
4799
|
import { BubbleMenu as TiptapBubbleMenu } from "@tiptap/react/menus";
|
|
3833
4800
|
import {
|
|
3834
4801
|
Bold,
|
|
@@ -3843,10 +4810,10 @@ import {
|
|
|
3843
4810
|
} from "lucide-react";
|
|
3844
4811
|
|
|
3845
4812
|
// src/editor/FontColorPicker.tsx
|
|
3846
|
-
import { useEffect as
|
|
4813
|
+
import { useEffect as useEffect11, useState as useState10 } from "react";
|
|
3847
4814
|
import { Palette, Highlighter } from "lucide-react";
|
|
3848
|
-
import { cn as
|
|
3849
|
-
import { jsx as
|
|
4815
|
+
import { cn as cn80 } from "@cloudvoyant/helical-ui";
|
|
4816
|
+
import { jsx as jsx85, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3850
4817
|
var COLORS = ["yellow", "orange", "red", "fuchsia", "violet", "blue", "cyan", "green", "slate"];
|
|
3851
4818
|
var TEXT_PREVIEW = {
|
|
3852
4819
|
yellow: "#f59e0b",
|
|
@@ -3871,12 +4838,12 @@ var HIGHLIGHT_PREVIEW = {
|
|
|
3871
4838
|
slate: "#e2e8f0"
|
|
3872
4839
|
};
|
|
3873
4840
|
function FontColorPicker({ editor, mode }) {
|
|
3874
|
-
const [open, setOpen] =
|
|
3875
|
-
const [, setRevision] =
|
|
4841
|
+
const [open, setOpen] = useState10(false);
|
|
4842
|
+
const [, setRevision] = useState10(0);
|
|
3876
4843
|
const preview = mode === "highlight" ? HIGHLIGHT_PREVIEW : TEXT_PREVIEW;
|
|
3877
4844
|
const active = editor.isActive(mode === "highlight" ? "highlight" : "textStyle");
|
|
3878
4845
|
const currentColor = editor.getAttributes(mode === "highlight" ? "highlight" : "textStyle").color;
|
|
3879
|
-
|
|
4846
|
+
useEffect11(() => {
|
|
3880
4847
|
const refresh = () => setRevision((revision) => revision + 1);
|
|
3881
4848
|
editor.on("transaction", refresh);
|
|
3882
4849
|
editor.on("selectionUpdate", refresh);
|
|
@@ -3902,39 +4869,39 @@ function FontColorPicker({ editor, mode }) {
|
|
|
3902
4869
|
setOpen(false);
|
|
3903
4870
|
}
|
|
3904
4871
|
const label = mode === "highlight" ? "Highlight color" : "Text color";
|
|
3905
|
-
return /* @__PURE__ */
|
|
3906
|
-
/* @__PURE__ */
|
|
4872
|
+
return /* @__PURE__ */ jsxs35(Popover, { open, onOpenChange: (details) => setOpen(details.open), children: [
|
|
4873
|
+
/* @__PURE__ */ jsx85(
|
|
3907
4874
|
PopoverTrigger,
|
|
3908
4875
|
{
|
|
3909
4876
|
"aria-label": label,
|
|
3910
4877
|
"data-state": active ? "on" : "off",
|
|
3911
|
-
className:
|
|
4878
|
+
className: cn80(
|
|
3912
4879
|
"inline-flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted data-[state=on]:bg-accent data-[state=on]:text-accent-foreground"
|
|
3913
4880
|
),
|
|
3914
|
-
children: mode === "highlight" ? /* @__PURE__ */
|
|
4881
|
+
children: mode === "highlight" ? /* @__PURE__ */ jsx85(Highlighter, { className: "h-4 w-4", style: currentColor ? { color: currentColor } : void 0 }) : /* @__PURE__ */ jsx85(Palette, { className: "h-4 w-4", style: currentColor ? { color: currentColor } : void 0 })
|
|
3915
4882
|
}
|
|
3916
4883
|
),
|
|
3917
|
-
/* @__PURE__ */
|
|
3918
|
-
/* @__PURE__ */
|
|
4884
|
+
/* @__PURE__ */ jsxs35(PopoverContent, { className: "w-auto p-2", children: [
|
|
4885
|
+
/* @__PURE__ */ jsx85("div", { className: "grid grid-cols-5 gap-1", children: COLORS.map((color) => /* @__PURE__ */ jsx85(
|
|
3919
4886
|
"button",
|
|
3920
4887
|
{
|
|
3921
4888
|
type: "button",
|
|
3922
4889
|
"aria-label": color,
|
|
3923
4890
|
onClick: () => selectColor(color),
|
|
3924
|
-
className:
|
|
4891
|
+
className: cn80("h-6 w-6 rounded border border-border transition-transform hover:scale-110"),
|
|
3925
4892
|
style: { backgroundColor: preview[color] }
|
|
3926
4893
|
},
|
|
3927
4894
|
color
|
|
3928
4895
|
)) }),
|
|
3929
|
-
/* @__PURE__ */
|
|
4896
|
+
/* @__PURE__ */ jsx85("button", { type: "button", onClick: clearColor, className: "mt-2 w-full rounded px-2 py-1 text-xs hover:bg-muted", children: "Clear" })
|
|
3930
4897
|
] })
|
|
3931
4898
|
] });
|
|
3932
4899
|
}
|
|
3933
4900
|
|
|
3934
4901
|
// src/editor/LinkEditPopover.tsx
|
|
3935
|
-
import { useEffect as
|
|
4902
|
+
import { useEffect as useEffect12, useRef as useRef5, useState as useState11 } from "react";
|
|
3936
4903
|
import { ExternalLink, Globe, Trash2 } from "lucide-react";
|
|
3937
|
-
import { jsx as
|
|
4904
|
+
import { jsx as jsx86, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3938
4905
|
function safeExternalUrl(value) {
|
|
3939
4906
|
try {
|
|
3940
4907
|
const url = new URL(value);
|
|
@@ -3944,10 +4911,10 @@ function safeExternalUrl(value) {
|
|
|
3944
4911
|
}
|
|
3945
4912
|
}
|
|
3946
4913
|
function LinkEditPopover({ editor, initialUrl = "", onClose }) {
|
|
3947
|
-
const [url, setUrl] =
|
|
3948
|
-
const inputRef =
|
|
4914
|
+
const [url, setUrl] = useState11(initialUrl);
|
|
4915
|
+
const inputRef = useRef5(null);
|
|
3949
4916
|
const externalUrl = safeExternalUrl(url.trim());
|
|
3950
|
-
|
|
4917
|
+
useEffect12(() => {
|
|
3951
4918
|
setUrl(initialUrl);
|
|
3952
4919
|
inputRef.current?.focus();
|
|
3953
4920
|
}, [initialUrl]);
|
|
@@ -3961,7 +4928,7 @@ function LinkEditPopover({ editor, initialUrl = "", onClose }) {
|
|
|
3961
4928
|
editor.chain().focus().unsetLink().run();
|
|
3962
4929
|
onClose();
|
|
3963
4930
|
}
|
|
3964
|
-
return /* @__PURE__ */
|
|
4931
|
+
return /* @__PURE__ */ jsxs36(
|
|
3965
4932
|
"div",
|
|
3966
4933
|
{
|
|
3967
4934
|
role: "dialog",
|
|
@@ -3978,8 +4945,8 @@ function LinkEditPopover({ editor, initialUrl = "", onClose }) {
|
|
|
3978
4945
|
}
|
|
3979
4946
|
},
|
|
3980
4947
|
children: [
|
|
3981
|
-
/* @__PURE__ */
|
|
3982
|
-
/* @__PURE__ */
|
|
4948
|
+
/* @__PURE__ */ jsx86(Globe, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": "true" }),
|
|
4949
|
+
/* @__PURE__ */ jsx86(
|
|
3983
4950
|
"input",
|
|
3984
4951
|
{
|
|
3985
4952
|
ref: inputRef,
|
|
@@ -3990,7 +4957,7 @@ function LinkEditPopover({ editor, initialUrl = "", onClose }) {
|
|
|
3990
4957
|
className: "min-w-0 flex-1 bg-transparent px-1 py-1 text-sm outline-none placeholder:text-muted-foreground"
|
|
3991
4958
|
}
|
|
3992
4959
|
),
|
|
3993
|
-
/* @__PURE__ */
|
|
4960
|
+
/* @__PURE__ */ jsx86(
|
|
3994
4961
|
"button",
|
|
3995
4962
|
{
|
|
3996
4963
|
type: "button",
|
|
@@ -3998,10 +4965,10 @@ function LinkEditPopover({ editor, initialUrl = "", onClose }) {
|
|
|
3998
4965
|
className: "rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
3999
4966
|
"aria-label": "Remove link",
|
|
4000
4967
|
title: "Remove link",
|
|
4001
|
-
children: /* @__PURE__ */
|
|
4968
|
+
children: /* @__PURE__ */ jsx86(Trash2, { className: "size-4" })
|
|
4002
4969
|
}
|
|
4003
4970
|
),
|
|
4004
|
-
externalUrl ? /* @__PURE__ */
|
|
4971
|
+
externalUrl ? /* @__PURE__ */ jsx86(
|
|
4005
4972
|
"a",
|
|
4006
4973
|
{
|
|
4007
4974
|
href: externalUrl,
|
|
@@ -4010,7 +4977,7 @@ function LinkEditPopover({ editor, initialUrl = "", onClose }) {
|
|
|
4010
4977
|
className: "rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
4011
4978
|
"aria-label": "Open link in new tab",
|
|
4012
4979
|
title: "Open link in new tab",
|
|
4013
|
-
children: /* @__PURE__ */
|
|
4980
|
+
children: /* @__PURE__ */ jsx86(ExternalLink, { className: "size-4" })
|
|
4014
4981
|
}
|
|
4015
4982
|
) : null
|
|
4016
4983
|
]
|
|
@@ -4020,13 +4987,13 @@ function LinkEditPopover({ editor, initialUrl = "", onClose }) {
|
|
|
4020
4987
|
|
|
4021
4988
|
// src/editor/BubbleMenu.tsx
|
|
4022
4989
|
import { findEditorScrollContainer } from "@cloudvoyant/helical-ui";
|
|
4023
|
-
import { jsx as
|
|
4990
|
+
import { jsx as jsx87, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4024
4991
|
function BubbleMenu({ editor }) {
|
|
4025
|
-
const [isEditingLink, setIsEditingLink] =
|
|
4026
|
-
const [linkUrl, setLinkUrl] =
|
|
4027
|
-
const [dismissedSelection, setDismissedSelection] =
|
|
4992
|
+
const [isEditingLink, setIsEditingLink] = useState12(false);
|
|
4993
|
+
const [linkUrl, setLinkUrl] = useState12("");
|
|
4994
|
+
const [dismissedSelection, setDismissedSelection] = useState12(null);
|
|
4028
4995
|
const currentAlign = ["left", "center", "right", "justify"].find((a) => editor.isActive({ textAlign: a }));
|
|
4029
|
-
|
|
4996
|
+
useEffect13(() => {
|
|
4030
4997
|
if (!isEditingLink) return;
|
|
4031
4998
|
const container = findEditorScrollContainer(editor.view.dom);
|
|
4032
4999
|
if (!container) return;
|
|
@@ -4034,7 +5001,7 @@ function BubbleMenu({ editor }) {
|
|
|
4034
5001
|
container.addEventListener("wheel", preventWheel, { passive: false });
|
|
4035
5002
|
return () => container.removeEventListener("wheel", preventWheel);
|
|
4036
5003
|
}, [editor, isEditingLink]);
|
|
4037
|
-
|
|
5004
|
+
useEffect13(() => {
|
|
4038
5005
|
const selectionKey = () => `${editor.state.selection.from}:${editor.state.selection.to}`;
|
|
4039
5006
|
const handleEscape = (event) => {
|
|
4040
5007
|
if (event.key === "Escape" && !editor.state.selection.empty) setDismissedSelection(selectionKey());
|
|
@@ -4050,7 +5017,7 @@ function BubbleMenu({ editor }) {
|
|
|
4050
5017
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
4051
5018
|
};
|
|
4052
5019
|
}, [editor]);
|
|
4053
|
-
return /* @__PURE__ */
|
|
5020
|
+
return /* @__PURE__ */ jsxs37(
|
|
4054
5021
|
TiptapBubbleMenu,
|
|
4055
5022
|
{
|
|
4056
5023
|
editor,
|
|
@@ -4061,8 +5028,8 @@ function BubbleMenu({ editor }) {
|
|
|
4061
5028
|
tabIndex: -1,
|
|
4062
5029
|
className: "flex items-center gap-1 rounded-md border border-border bg-popover p-1 shadow-md",
|
|
4063
5030
|
children: [
|
|
4064
|
-
/* @__PURE__ */
|
|
4065
|
-
/* @__PURE__ */
|
|
5031
|
+
/* @__PURE__ */ jsxs37(ToggleGroup, { multiple: true, defaultValue: [], children: [
|
|
5032
|
+
/* @__PURE__ */ jsx87(
|
|
4066
5033
|
ToggleGroupItem,
|
|
4067
5034
|
{
|
|
4068
5035
|
value: "bold",
|
|
@@ -4070,10 +5037,10 @@ function BubbleMenu({ editor }) {
|
|
|
4070
5037
|
"aria-label": "Bold",
|
|
4071
5038
|
"data-state": editor.isActive("bold") ? "on" : "off",
|
|
4072
5039
|
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
4073
|
-
children: /* @__PURE__ */
|
|
5040
|
+
children: /* @__PURE__ */ jsx87(Bold, {})
|
|
4074
5041
|
}
|
|
4075
5042
|
),
|
|
4076
|
-
/* @__PURE__ */
|
|
5043
|
+
/* @__PURE__ */ jsx87(
|
|
4077
5044
|
ToggleGroupItem,
|
|
4078
5045
|
{
|
|
4079
5046
|
value: "italic",
|
|
@@ -4081,10 +5048,10 @@ function BubbleMenu({ editor }) {
|
|
|
4081
5048
|
"aria-label": "Italic",
|
|
4082
5049
|
"data-state": editor.isActive("italic") ? "on" : "off",
|
|
4083
5050
|
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
4084
|
-
children: /* @__PURE__ */
|
|
5051
|
+
children: /* @__PURE__ */ jsx87(Italic, {})
|
|
4085
5052
|
}
|
|
4086
5053
|
),
|
|
4087
|
-
/* @__PURE__ */
|
|
5054
|
+
/* @__PURE__ */ jsx87(
|
|
4088
5055
|
ToggleGroupItem,
|
|
4089
5056
|
{
|
|
4090
5057
|
value: "underline",
|
|
@@ -4092,10 +5059,10 @@ function BubbleMenu({ editor }) {
|
|
|
4092
5059
|
"aria-label": "Underline",
|
|
4093
5060
|
"data-state": editor.isActive("underline") ? "on" : "off",
|
|
4094
5061
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
4095
|
-
children: /* @__PURE__ */
|
|
5062
|
+
children: /* @__PURE__ */ jsx87(UnderlineIcon, {})
|
|
4096
5063
|
}
|
|
4097
5064
|
),
|
|
4098
|
-
/* @__PURE__ */
|
|
5065
|
+
/* @__PURE__ */ jsx87(
|
|
4099
5066
|
ToggleGroupItem,
|
|
4100
5067
|
{
|
|
4101
5068
|
value: "strike",
|
|
@@ -4103,30 +5070,30 @@ function BubbleMenu({ editor }) {
|
|
|
4103
5070
|
"aria-label": "Strikethrough",
|
|
4104
5071
|
"data-state": editor.isActive("strike") ? "on" : "off",
|
|
4105
5072
|
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
4106
|
-
children: /* @__PURE__ */
|
|
5073
|
+
children: /* @__PURE__ */ jsx87(Strikethrough, {})
|
|
4107
5074
|
}
|
|
4108
5075
|
)
|
|
4109
5076
|
] }),
|
|
4110
|
-
/* @__PURE__ */
|
|
4111
|
-
/* @__PURE__ */
|
|
4112
|
-
/* @__PURE__ */
|
|
5077
|
+
/* @__PURE__ */ jsx87(FontColorPicker, { editor, mode: "text" }),
|
|
5078
|
+
/* @__PURE__ */ jsx87(FontColorPicker, { editor, mode: "highlight" }),
|
|
5079
|
+
/* @__PURE__ */ jsx87(ToggleGroup, { defaultValue: currentAlign ? [currentAlign] : [], children: [
|
|
4113
5080
|
["left", AlignLeft],
|
|
4114
5081
|
["center", AlignCenter],
|
|
4115
5082
|
["right", AlignRight],
|
|
4116
5083
|
["justify", AlignJustify]
|
|
4117
|
-
].map(([align, Icon]) => /* @__PURE__ */
|
|
5084
|
+
].map(([align, Icon]) => /* @__PURE__ */ jsx87(
|
|
4118
5085
|
ToggleGroupItem,
|
|
4119
5086
|
{
|
|
4120
5087
|
value: align,
|
|
4121
5088
|
size: "sm",
|
|
4122
5089
|
"aria-label": `Align ${align}`,
|
|
4123
5090
|
onClick: () => editor.chain().focus().setTextAlign(align).run(),
|
|
4124
|
-
children: /* @__PURE__ */
|
|
5091
|
+
children: /* @__PURE__ */ jsx87(Icon, {})
|
|
4125
5092
|
},
|
|
4126
5093
|
align
|
|
4127
5094
|
)) }),
|
|
4128
|
-
/* @__PURE__ */
|
|
4129
|
-
/* @__PURE__ */
|
|
5095
|
+
/* @__PURE__ */ jsxs37("div", { className: "relative", children: [
|
|
5096
|
+
/* @__PURE__ */ jsx87(ToggleGroup, { defaultValue: [], children: /* @__PURE__ */ jsx87(
|
|
4130
5097
|
ToggleGroupItem,
|
|
4131
5098
|
{
|
|
4132
5099
|
value: "link",
|
|
@@ -4136,10 +5103,10 @@ function BubbleMenu({ editor }) {
|
|
|
4136
5103
|
setLinkUrl(editor.getAttributes("link").href ?? "");
|
|
4137
5104
|
setIsEditingLink(true);
|
|
4138
5105
|
},
|
|
4139
|
-
children: /* @__PURE__ */
|
|
5106
|
+
children: /* @__PURE__ */ jsx87(Link2, {})
|
|
4140
5107
|
}
|
|
4141
5108
|
) }),
|
|
4142
|
-
isEditingLink ? /* @__PURE__ */
|
|
5109
|
+
isEditingLink ? /* @__PURE__ */ jsx87(LinkEditPopover, { editor, initialUrl: linkUrl, onClose: () => setIsEditingLink(false) }) : null
|
|
4143
5110
|
] })
|
|
4144
5111
|
]
|
|
4145
5112
|
}
|
|
@@ -4147,7 +5114,7 @@ function BubbleMenu({ editor }) {
|
|
|
4147
5114
|
}
|
|
4148
5115
|
|
|
4149
5116
|
// src/editor/SlashMenu.tsx
|
|
4150
|
-
import { forwardRef, useEffect as
|
|
5117
|
+
import { forwardRef as forwardRef2, useEffect as useEffect14, useImperativeHandle, useRef as useRef6, useState as useState13 } from "react";
|
|
4151
5118
|
import {
|
|
4152
5119
|
Bookmark,
|
|
4153
5120
|
Code,
|
|
@@ -4163,7 +5130,7 @@ import {
|
|
|
4163
5130
|
Minus,
|
|
4164
5131
|
Quote
|
|
4165
5132
|
} from "lucide-react";
|
|
4166
|
-
import { jsx as
|
|
5133
|
+
import { jsx as jsx88, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4167
5134
|
var SLASH_MENU_ICONS = {
|
|
4168
5135
|
Heading1,
|
|
4169
5136
|
Heading2,
|
|
@@ -4179,12 +5146,12 @@ var SLASH_MENU_ICONS = {
|
|
|
4179
5146
|
Image,
|
|
4180
5147
|
Bookmark
|
|
4181
5148
|
};
|
|
4182
|
-
var SlashMenu =
|
|
4183
|
-
const [index, setIndex] =
|
|
4184
|
-
const itemRefs =
|
|
5149
|
+
var SlashMenu = forwardRef2(function SlashMenu2({ items, command }, ref) {
|
|
5150
|
+
const [index, setIndex] = useState13(0);
|
|
5151
|
+
const itemRefs = useRef6([]);
|
|
4185
5152
|
const itemsKey = items.map((item) => item.title).join("\0");
|
|
4186
|
-
|
|
4187
|
-
|
|
5153
|
+
useEffect14(() => setIndex(0), [itemsKey]);
|
|
5154
|
+
useEffect14(() => {
|
|
4188
5155
|
const item = itemRefs.current[index]?.closest('[data-part="item"]');
|
|
4189
5156
|
const viewport = item?.closest("[data-slash-menu-scroll]");
|
|
4190
5157
|
if (!(viewport instanceof HTMLElement) || !(item instanceof HTMLElement)) return;
|
|
@@ -4213,7 +5180,7 @@ var SlashMenu = forwardRef(function SlashMenu2({ items, command }, ref) {
|
|
|
4213
5180
|
}
|
|
4214
5181
|
}));
|
|
4215
5182
|
const listItems = items.map((item) => ({ value: item.title, label: item.title }));
|
|
4216
|
-
return /* @__PURE__ */
|
|
5183
|
+
return /* @__PURE__ */ jsx88(
|
|
4217
5184
|
Listbox,
|
|
4218
5185
|
{
|
|
4219
5186
|
items: listItems,
|
|
@@ -4222,17 +5189,17 @@ var SlashMenu = forwardRef(function SlashMenu2({ items, command }, ref) {
|
|
|
4222
5189
|
if (details.highlightedIndex >= 0) setIndex(details.highlightedIndex);
|
|
4223
5190
|
},
|
|
4224
5191
|
loopFocus: false,
|
|
4225
|
-
children: /* @__PURE__ */
|
|
5192
|
+
children: /* @__PURE__ */ jsx88(ListboxContent, { "data-slash-menu-scroll": true, children: items.map((item, i) => {
|
|
4226
5193
|
const Icon = SLASH_MENU_ICONS[item.icon];
|
|
4227
|
-
return /* @__PURE__ */
|
|
5194
|
+
return /* @__PURE__ */ jsx88(
|
|
4228
5195
|
ListboxItem,
|
|
4229
5196
|
{
|
|
4230
5197
|
item: { value: item.title, label: item.title },
|
|
4231
5198
|
className: i === index ? "bg-accent text-accent-foreground" : void 0,
|
|
4232
5199
|
"data-slash-selected": i === index ? "" : void 0,
|
|
4233
5200
|
onClick: () => command(item),
|
|
4234
|
-
children: /* @__PURE__ */
|
|
4235
|
-
/* @__PURE__ */
|
|
5201
|
+
children: /* @__PURE__ */ jsxs38(ListboxItemText, { children: [
|
|
5202
|
+
/* @__PURE__ */ jsx88(
|
|
4236
5203
|
"span",
|
|
4237
5204
|
{
|
|
4238
5205
|
ref: (node) => {
|
|
@@ -4241,10 +5208,10 @@ var SlashMenu = forwardRef(function SlashMenu2({ items, command }, ref) {
|
|
|
4241
5208
|
className: "inline-flex w-5 justify-center opacity-70",
|
|
4242
5209
|
"data-slash-icon": item.icon,
|
|
4243
5210
|
"aria-hidden": "true",
|
|
4244
|
-
children: item.icon === "YouTube" ? /* @__PURE__ */
|
|
5211
|
+
children: item.icon === "YouTube" ? /* @__PURE__ */ jsx88("svg", { viewBox: "0 0 24 24", className: "size-4", fill: "currentColor", children: /* @__PURE__ */ jsx88("path", { d: "M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.6 12 3.6 12 3.6s-7.5 0-9.4.5A3 3 0 0 0 .5 6.2 31 31 0 0 0 0 12a31 31 0 0 0 .5 5.8 3 3 0 0 0 2.1 2.1c1.9.5 9.4.5 9.4.5s7.5 0 9.4-.5a3 3 0 0 0 2.1-2.1A31 31 0 0 0 24 12a31 31 0 0 0-.5-5.8ZM9.6 15.6V8.4L15.8 12l-6.2 3.6Z" }) }) : Icon ? /* @__PURE__ */ jsx88(Icon, { className: "size-4" }) : null
|
|
4245
5212
|
}
|
|
4246
5213
|
),
|
|
4247
|
-
/* @__PURE__ */
|
|
5214
|
+
/* @__PURE__ */ jsx88("span", { children: item.title })
|
|
4248
5215
|
] })
|
|
4249
5216
|
},
|
|
4250
5217
|
item.title
|
|
@@ -4255,10 +5222,10 @@ var SlashMenu = forwardRef(function SlashMenu2({ items, command }, ref) {
|
|
|
4255
5222
|
});
|
|
4256
5223
|
|
|
4257
5224
|
// src/editor/MentionList.tsx
|
|
4258
|
-
import { forwardRef as
|
|
4259
|
-
import { jsx as
|
|
4260
|
-
var MentionList =
|
|
4261
|
-
const [index, setIndex] =
|
|
5225
|
+
import { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle2, useState as useState14 } from "react";
|
|
5226
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
5227
|
+
var MentionList = forwardRef3(function MentionList2({ items, command }, ref) {
|
|
5228
|
+
const [index, setIndex] = useState14(0);
|
|
4262
5229
|
useImperativeHandle2(ref, () => ({
|
|
4263
5230
|
onKeyDown: ({ event }) => {
|
|
4264
5231
|
if (event.key === "ArrowUp") {
|
|
@@ -4279,21 +5246,21 @@ var MentionList = forwardRef2(function MentionList2({ items, command }, ref) {
|
|
|
4279
5246
|
}));
|
|
4280
5247
|
if (items.length === 0) return null;
|
|
4281
5248
|
const listItems = items.map((item) => ({ value: item.id, label: item.label }));
|
|
4282
|
-
return /* @__PURE__ */
|
|
5249
|
+
return /* @__PURE__ */ jsx89(Listbox, { items: listItems, className: "mention-list", children: /* @__PURE__ */ jsx89(ListboxContent, { children: items.map((item, i) => /* @__PURE__ */ jsx89(
|
|
4283
5250
|
ListboxItem,
|
|
4284
5251
|
{
|
|
4285
5252
|
item: { value: item.id, label: item.label },
|
|
4286
5253
|
className: i === index ? "bg-accent text-accent-foreground" : void 0,
|
|
4287
5254
|
onMouseEnter: () => setIndex(i),
|
|
4288
5255
|
onClick: () => command(item),
|
|
4289
|
-
children: /* @__PURE__ */
|
|
5256
|
+
children: /* @__PURE__ */ jsx89(ListboxItemText, { children: item.label })
|
|
4290
5257
|
},
|
|
4291
5258
|
item.id
|
|
4292
5259
|
)) }) });
|
|
4293
5260
|
});
|
|
4294
5261
|
|
|
4295
5262
|
// src/editor/ImageInput.tsx
|
|
4296
|
-
import { useEffect as
|
|
5263
|
+
import { useEffect as useEffect15, useRef as useRef7, useState as useState15 } from "react";
|
|
4297
5264
|
import { X } from "lucide-react";
|
|
4298
5265
|
|
|
4299
5266
|
// src/editor/ImageFileUpload.tsx
|
|
@@ -4311,9 +5278,9 @@ import {
|
|
|
4311
5278
|
FileUploadItemDeleteTrigger
|
|
4312
5279
|
} from "@ark-ui/react/file-upload";
|
|
4313
5280
|
import { ImagePlus, Trash2 as Trash22, Upload } from "lucide-react";
|
|
4314
|
-
import { jsx as
|
|
5281
|
+
import { jsx as jsx90, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4315
5282
|
function ImageFileUpload({ file, onFileChange, disabled = false }) {
|
|
4316
|
-
return /* @__PURE__ */
|
|
5283
|
+
return /* @__PURE__ */ jsxs39(
|
|
4317
5284
|
FileUploadRoot,
|
|
4318
5285
|
{
|
|
4319
5286
|
accept: "image/*",
|
|
@@ -4322,45 +5289,45 @@ function ImageFileUpload({ file, onFileChange, disabled = false }) {
|
|
|
4322
5289
|
disabled,
|
|
4323
5290
|
onFileChange: (details) => onFileChange(details.acceptedFiles[0] ?? null),
|
|
4324
5291
|
children: [
|
|
4325
|
-
/* @__PURE__ */
|
|
4326
|
-
/* @__PURE__ */
|
|
4327
|
-
/* @__PURE__ */
|
|
4328
|
-
/* @__PURE__ */
|
|
4329
|
-
/* @__PURE__ */
|
|
4330
|
-
/* @__PURE__ */
|
|
5292
|
+
/* @__PURE__ */ jsxs39(FileUploadDropzone, { className: "flex min-h-32 cursor-pointer flex-col items-center justify-center gap-2 rounded-md border border-dashed border-border bg-muted/30 px-4 py-5 text-center transition-colors data-[dragging]:border-primary data-[dragging]:bg-primary/5", children: [
|
|
5293
|
+
/* @__PURE__ */ jsx90(ImagePlus, { className: "size-6 text-muted-foreground", "aria-hidden": "true" }),
|
|
5294
|
+
/* @__PURE__ */ jsx90("div", { className: "text-sm font-medium", children: "Drop an image here" }),
|
|
5295
|
+
/* @__PURE__ */ jsx90("div", { className: "text-xs text-muted-foreground", children: "or" }),
|
|
5296
|
+
/* @__PURE__ */ jsxs39(FileUploadTrigger, { className: "inline-flex items-center gap-2 rounded-md border border-input bg-background px-3 py-1.5 text-sm hover:bg-accent", children: [
|
|
5297
|
+
/* @__PURE__ */ jsx90(Upload, { className: "size-4", "aria-hidden": "true" }),
|
|
4331
5298
|
"Choose image"
|
|
4332
5299
|
] })
|
|
4333
5300
|
] }),
|
|
4334
|
-
/* @__PURE__ */
|
|
5301
|
+
/* @__PURE__ */ jsx90(FileUploadItemGroup, { className: "mt-2", children: file ? /* @__PURE__ */ jsxs39(
|
|
4335
5302
|
FileUploadItem,
|
|
4336
5303
|
{
|
|
4337
5304
|
file,
|
|
4338
5305
|
className: "flex items-center gap-3 rounded-md border border-border bg-background p-2",
|
|
4339
5306
|
children: [
|
|
4340
|
-
/* @__PURE__ */
|
|
4341
|
-
/* @__PURE__ */
|
|
4342
|
-
/* @__PURE__ */
|
|
4343
|
-
/* @__PURE__ */
|
|
5307
|
+
/* @__PURE__ */ jsx90(FileUploadItemPreview, { type: "image/*", className: "size-12 shrink-0 overflow-hidden rounded", children: /* @__PURE__ */ jsx90(FileUploadItemPreviewImage, { className: "size-full object-cover" }) }),
|
|
5308
|
+
/* @__PURE__ */ jsxs39("div", { className: "min-w-0 flex-1", children: [
|
|
5309
|
+
/* @__PURE__ */ jsx90(FileUploadItemName, { className: "truncate text-sm font-medium" }),
|
|
5310
|
+
/* @__PURE__ */ jsx90(FileUploadItemSizeText, { className: "text-xs text-muted-foreground" })
|
|
4344
5311
|
] }),
|
|
4345
|
-
/* @__PURE__ */
|
|
5312
|
+
/* @__PURE__ */ jsx90(
|
|
4346
5313
|
FileUploadItemDeleteTrigger,
|
|
4347
5314
|
{
|
|
4348
5315
|
className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
4349
5316
|
"aria-label": "Remove image",
|
|
4350
|
-
children: /* @__PURE__ */
|
|
5317
|
+
children: /* @__PURE__ */ jsx90(Trash22, { className: "size-4" })
|
|
4351
5318
|
}
|
|
4352
5319
|
)
|
|
4353
5320
|
]
|
|
4354
5321
|
}
|
|
4355
5322
|
) : null }),
|
|
4356
|
-
/* @__PURE__ */
|
|
5323
|
+
/* @__PURE__ */ jsx90(FileUploadHiddenInput, {})
|
|
4357
5324
|
]
|
|
4358
5325
|
}
|
|
4359
5326
|
);
|
|
4360
5327
|
}
|
|
4361
5328
|
|
|
4362
5329
|
// src/editor/ImageInput.tsx
|
|
4363
|
-
import { jsx as
|
|
5330
|
+
import { jsx as jsx91, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4364
5331
|
function fileToDataUrl(file) {
|
|
4365
5332
|
return new Promise((resolve, reject) => {
|
|
4366
5333
|
const reader = new FileReader();
|
|
@@ -4370,14 +5337,14 @@ function fileToDataUrl(file) {
|
|
|
4370
5337
|
});
|
|
4371
5338
|
}
|
|
4372
5339
|
function ImageInput({ editor, position, onClose, onUpload }) {
|
|
4373
|
-
const [tab, setTab] =
|
|
4374
|
-
const [urlValue, setUrlValue] =
|
|
4375
|
-
const [urlError, setUrlError] =
|
|
4376
|
-
const [selectedFile, setSelectedFile] =
|
|
4377
|
-
const [uploading, setUploading] =
|
|
4378
|
-
const [uploadError, setUploadError] =
|
|
4379
|
-
const urlInputRef =
|
|
4380
|
-
|
|
5340
|
+
const [tab, setTab] = useState15("upload");
|
|
5341
|
+
const [urlValue, setUrlValue] = useState15("");
|
|
5342
|
+
const [urlError, setUrlError] = useState15("");
|
|
5343
|
+
const [selectedFile, setSelectedFile] = useState15(null);
|
|
5344
|
+
const [uploading, setUploading] = useState15(false);
|
|
5345
|
+
const [uploadError, setUploadError] = useState15("");
|
|
5346
|
+
const urlInputRef = useRef7(null);
|
|
5347
|
+
useEffect15(() => {
|
|
4381
5348
|
if (tab === "url") urlInputRef.current?.focus();
|
|
4382
5349
|
}, [tab]);
|
|
4383
5350
|
function insertImage(src, srcset) {
|
|
@@ -4407,7 +5374,7 @@ function ImageInput({ editor, position, onClose, onUpload }) {
|
|
|
4407
5374
|
}
|
|
4408
5375
|
insertImage(trimmed);
|
|
4409
5376
|
}
|
|
4410
|
-
return /* @__PURE__ */
|
|
5377
|
+
return /* @__PURE__ */ jsx91(
|
|
4411
5378
|
"div",
|
|
4412
5379
|
{
|
|
4413
5380
|
role: "dialog",
|
|
@@ -4417,21 +5384,21 @@ function ImageInput({ editor, position, onClose, onUpload }) {
|
|
|
4417
5384
|
if (event.key === "Escape") onClose();
|
|
4418
5385
|
},
|
|
4419
5386
|
className: "max-h-[calc(100vh-2rem)] w-80 overflow-y-auto rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-xl",
|
|
4420
|
-
children: /* @__PURE__ */
|
|
4421
|
-
/* @__PURE__ */
|
|
4422
|
-
/* @__PURE__ */
|
|
4423
|
-
/* @__PURE__ */
|
|
5387
|
+
children: /* @__PURE__ */ jsxs40("div", { className: "space-y-3", children: [
|
|
5388
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between", children: [
|
|
5389
|
+
/* @__PURE__ */ jsx91("p", { className: "text-sm font-semibold", children: "Insert Image" }),
|
|
5390
|
+
/* @__PURE__ */ jsx91(
|
|
4424
5391
|
"button",
|
|
4425
5392
|
{
|
|
4426
5393
|
type: "button",
|
|
4427
5394
|
onClick: onClose,
|
|
4428
5395
|
className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
4429
5396
|
"aria-label": "Close image dialog",
|
|
4430
|
-
children: /* @__PURE__ */
|
|
5397
|
+
children: /* @__PURE__ */ jsx91(X, { className: "size-4" })
|
|
4431
5398
|
}
|
|
4432
5399
|
)
|
|
4433
5400
|
] }),
|
|
4434
|
-
/* @__PURE__ */
|
|
5401
|
+
/* @__PURE__ */ jsx91("div", { className: "flex gap-1 rounded-md bg-muted p-1", children: ["upload", "url"].map((value) => /* @__PURE__ */ jsx91(
|
|
4435
5402
|
"button",
|
|
4436
5403
|
{
|
|
4437
5404
|
type: "button",
|
|
@@ -4444,8 +5411,8 @@ function ImageInput({ editor, position, onClose, onUpload }) {
|
|
|
4444
5411
|
},
|
|
4445
5412
|
value
|
|
4446
5413
|
)) }),
|
|
4447
|
-
tab === "upload" ? /* @__PURE__ */
|
|
4448
|
-
/* @__PURE__ */
|
|
5414
|
+
tab === "upload" ? /* @__PURE__ */ jsxs40("div", { className: "space-y-1", children: [
|
|
5415
|
+
/* @__PURE__ */ jsx91(
|
|
4449
5416
|
ImageFileUpload,
|
|
4450
5417
|
{
|
|
4451
5418
|
file: selectedFile,
|
|
@@ -4456,10 +5423,10 @@ function ImageInput({ editor, position, onClose, onUpload }) {
|
|
|
4456
5423
|
}
|
|
4457
5424
|
}
|
|
4458
5425
|
),
|
|
4459
|
-
uploading ? /* @__PURE__ */
|
|
4460
|
-
uploadError ? /* @__PURE__ */
|
|
4461
|
-
] }) : /* @__PURE__ */
|
|
4462
|
-
/* @__PURE__ */
|
|
5426
|
+
uploading ? /* @__PURE__ */ jsx91("p", { className: "text-xs text-muted-foreground", children: "Uploading\u2026" }) : null,
|
|
5427
|
+
uploadError ? /* @__PURE__ */ jsx91("div", { role: "alert", className: "text-xs leading-tight text-destructive", children: uploadError }) : null
|
|
5428
|
+
] }) : /* @__PURE__ */ jsxs40("div", { className: "space-y-1", children: [
|
|
5429
|
+
/* @__PURE__ */ jsx91(
|
|
4463
5430
|
"input",
|
|
4464
5431
|
{
|
|
4465
5432
|
ref: urlInputRef,
|
|
@@ -4477,11 +5444,11 @@ function ImageInput({ editor, position, onClose, onUpload }) {
|
|
|
4477
5444
|
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"
|
|
4478
5445
|
}
|
|
4479
5446
|
),
|
|
4480
|
-
urlError ? /* @__PURE__ */
|
|
5447
|
+
urlError ? /* @__PURE__ */ jsx91("div", { role: "alert", className: "text-xs leading-tight text-destructive", children: urlError }) : null
|
|
4481
5448
|
] }),
|
|
4482
|
-
/* @__PURE__ */
|
|
4483
|
-
/* @__PURE__ */
|
|
4484
|
-
/* @__PURE__ */
|
|
5449
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex justify-end gap-2", children: [
|
|
5450
|
+
/* @__PURE__ */ jsx91("button", { type: "button", onClick: onClose, className: "rounded-md px-3 py-1.5 text-sm hover:bg-muted", children: "Cancel" }),
|
|
5451
|
+
/* @__PURE__ */ jsx91(
|
|
4485
5452
|
"button",
|
|
4486
5453
|
{
|
|
4487
5454
|
type: "button",
|
|
@@ -4498,14 +5465,14 @@ function ImageInput({ editor, position, onClose, onUpload }) {
|
|
|
4498
5465
|
}
|
|
4499
5466
|
|
|
4500
5467
|
// src/editor/BookmarkInput.tsx
|
|
4501
|
-
import { useEffect as
|
|
4502
|
-
import { jsx as
|
|
5468
|
+
import { useEffect as useEffect16, useRef as useRef8, useState as useState16 } from "react";
|
|
5469
|
+
import { jsx as jsx92, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4503
5470
|
function BookmarkInput({ editor, position, onClose, fetchLinkPreview }) {
|
|
4504
|
-
const [url, setUrl] =
|
|
4505
|
-
const [error, setError] =
|
|
4506
|
-
const [loading, setLoading] =
|
|
4507
|
-
const inputRef =
|
|
4508
|
-
|
|
5471
|
+
const [url, setUrl] = useState16("");
|
|
5472
|
+
const [error, setError] = useState16("");
|
|
5473
|
+
const [loading, setLoading] = useState16(false);
|
|
5474
|
+
const inputRef = useRef8(null);
|
|
5475
|
+
useEffect16(() => {
|
|
4509
5476
|
inputRef.current?.focus();
|
|
4510
5477
|
}, []);
|
|
4511
5478
|
async function submit() {
|
|
@@ -4535,7 +5502,7 @@ function BookmarkInput({ editor, position, onClose, fetchLinkPreview }) {
|
|
|
4535
5502
|
setLoading(false);
|
|
4536
5503
|
}
|
|
4537
5504
|
}
|
|
4538
|
-
return /* @__PURE__ */
|
|
5505
|
+
return /* @__PURE__ */ jsxs41(
|
|
4539
5506
|
"div",
|
|
4540
5507
|
{
|
|
4541
5508
|
role: "dialog",
|
|
@@ -4546,9 +5513,9 @@ function BookmarkInput({ editor, position, onClose, fetchLinkPreview }) {
|
|
|
4546
5513
|
},
|
|
4547
5514
|
className: "w-80 space-y-2 rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-xl",
|
|
4548
5515
|
children: [
|
|
4549
|
-
/* @__PURE__ */
|
|
4550
|
-
/* @__PURE__ */
|
|
4551
|
-
/* @__PURE__ */
|
|
5516
|
+
/* @__PURE__ */ jsx92("p", { className: "text-sm font-semibold", children: "Insert Bookmark" }),
|
|
5517
|
+
/* @__PURE__ */ jsxs41("div", { className: "space-y-1", children: [
|
|
5518
|
+
/* @__PURE__ */ jsx92(
|
|
4552
5519
|
"input",
|
|
4553
5520
|
{
|
|
4554
5521
|
ref: inputRef,
|
|
@@ -4566,11 +5533,11 @@ function BookmarkInput({ editor, position, onClose, fetchLinkPreview }) {
|
|
|
4566
5533
|
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"
|
|
4567
5534
|
}
|
|
4568
5535
|
),
|
|
4569
|
-
error ? /* @__PURE__ */
|
|
5536
|
+
error ? /* @__PURE__ */ jsx92("div", { role: "alert", className: "text-xs leading-tight text-destructive", children: error }) : null
|
|
4570
5537
|
] }),
|
|
4571
|
-
/* @__PURE__ */
|
|
4572
|
-
/* @__PURE__ */
|
|
4573
|
-
/* @__PURE__ */
|
|
5538
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex justify-end gap-2", children: [
|
|
5539
|
+
/* @__PURE__ */ jsx92("button", { type: "button", onClick: onClose, className: "rounded-md px-3 py-1.5 text-sm hover:bg-muted", children: "Cancel" }),
|
|
5540
|
+
/* @__PURE__ */ jsx92(
|
|
4574
5541
|
"button",
|
|
4575
5542
|
{
|
|
4576
5543
|
type: "button",
|
|
@@ -4587,9 +5554,9 @@ function BookmarkInput({ editor, position, onClose, fetchLinkPreview }) {
|
|
|
4587
5554
|
}
|
|
4588
5555
|
|
|
4589
5556
|
// src/editor/YouTubeInput.tsx
|
|
4590
|
-
import { useEffect as
|
|
5557
|
+
import { useEffect as useEffect17, useRef as useRef9, useState as useState17 } from "react";
|
|
4591
5558
|
import { Play as Play2, X as X2 } from "lucide-react";
|
|
4592
|
-
import { jsx as
|
|
5559
|
+
import { jsx as jsx93, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4593
5560
|
function isYouTubeUrl(value) {
|
|
4594
5561
|
try {
|
|
4595
5562
|
const host = new URL(value).hostname.replace(/^www\./, "");
|
|
@@ -4599,10 +5566,10 @@ function isYouTubeUrl(value) {
|
|
|
4599
5566
|
}
|
|
4600
5567
|
}
|
|
4601
5568
|
function YouTubeInput({ editor, position, onClose }) {
|
|
4602
|
-
const [url, setUrl] =
|
|
4603
|
-
const [error, setError] =
|
|
4604
|
-
const inputRef =
|
|
4605
|
-
|
|
5569
|
+
const [url, setUrl] = useState17("");
|
|
5570
|
+
const [error, setError] = useState17("");
|
|
5571
|
+
const inputRef = useRef9(null);
|
|
5572
|
+
useEffect17(() => inputRef.current?.focus(), []);
|
|
4606
5573
|
const insert = () => {
|
|
4607
5574
|
const value = url.trim();
|
|
4608
5575
|
if (!isYouTubeUrl(value)) {
|
|
@@ -4615,30 +5582,30 @@ function YouTubeInput({ editor, position, onClose }) {
|
|
|
4615
5582
|
}).run();
|
|
4616
5583
|
onClose();
|
|
4617
5584
|
};
|
|
4618
|
-
return /* @__PURE__ */
|
|
5585
|
+
return /* @__PURE__ */ jsxs42(
|
|
4619
5586
|
"div",
|
|
4620
5587
|
{
|
|
4621
5588
|
role: "dialog",
|
|
4622
5589
|
"aria-label": "Embed YouTube video",
|
|
4623
5590
|
className: "w-80 rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-lg",
|
|
4624
5591
|
children: [
|
|
4625
|
-
/* @__PURE__ */
|
|
4626
|
-
/* @__PURE__ */
|
|
4627
|
-
/* @__PURE__ */
|
|
5592
|
+
/* @__PURE__ */ jsxs42("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
5593
|
+
/* @__PURE__ */ jsxs42("span", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
5594
|
+
/* @__PURE__ */ jsx93(Play2, { className: "size-5 fill-current text-red-600", "aria-hidden": "true", "data-youtube-logo": true }),
|
|
4628
5595
|
"Embed YouTube video"
|
|
4629
5596
|
] }),
|
|
4630
|
-
/* @__PURE__ */
|
|
5597
|
+
/* @__PURE__ */ jsx93(
|
|
4631
5598
|
"button",
|
|
4632
5599
|
{
|
|
4633
5600
|
type: "button",
|
|
4634
5601
|
onClick: onClose,
|
|
4635
5602
|
"aria-label": "Close YouTube input",
|
|
4636
5603
|
className: "rounded p-1 hover:bg-accent",
|
|
4637
|
-
children: /* @__PURE__ */
|
|
5604
|
+
children: /* @__PURE__ */ jsx93(X2, { className: "h-4 w-4" })
|
|
4638
5605
|
}
|
|
4639
5606
|
)
|
|
4640
5607
|
] }),
|
|
4641
|
-
/* @__PURE__ */
|
|
5608
|
+
/* @__PURE__ */ jsx93(
|
|
4642
5609
|
"input",
|
|
4643
5610
|
{
|
|
4644
5611
|
ref: inputRef,
|
|
@@ -4659,9 +5626,9 @@ function YouTubeInput({ editor, position, onClose }) {
|
|
|
4659
5626
|
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring"
|
|
4660
5627
|
}
|
|
4661
5628
|
),
|
|
4662
|
-
error ? /* @__PURE__ */
|
|
4663
|
-
/* @__PURE__ */
|
|
4664
|
-
/* @__PURE__ */
|
|
5629
|
+
error ? /* @__PURE__ */ jsx93("div", { role: "alert", className: "mt-1 text-xs leading-tight text-destructive", children: error }) : null,
|
|
5630
|
+
/* @__PURE__ */ jsxs42("div", { className: "mt-3 flex justify-end gap-2", children: [
|
|
5631
|
+
/* @__PURE__ */ jsx93(
|
|
4665
5632
|
"button",
|
|
4666
5633
|
{
|
|
4667
5634
|
type: "button",
|
|
@@ -4670,7 +5637,7 @@ function YouTubeInput({ editor, position, onClose }) {
|
|
|
4670
5637
|
children: "Cancel"
|
|
4671
5638
|
}
|
|
4672
5639
|
),
|
|
4673
|
-
/* @__PURE__ */
|
|
5640
|
+
/* @__PURE__ */ jsx93(
|
|
4674
5641
|
"button",
|
|
4675
5642
|
{
|
|
4676
5643
|
type: "button",
|
|
@@ -4686,12 +5653,12 @@ function YouTubeInput({ editor, position, onClose }) {
|
|
|
4686
5653
|
}
|
|
4687
5654
|
|
|
4688
5655
|
// src/editor/CursorOverlay.tsx
|
|
4689
|
-
import { useEffect as
|
|
5656
|
+
import { useEffect as useEffect18, useRef as useRef10, useState as useState18 } from "react";
|
|
4690
5657
|
import {
|
|
4691
5658
|
lockEditorOverlayScroll,
|
|
4692
5659
|
placeEditorOverlayAt
|
|
4693
5660
|
} from "@cloudvoyant/helical-ui";
|
|
4694
|
-
import { jsx as
|
|
5661
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
4695
5662
|
function CursorOverlay({
|
|
4696
5663
|
editor,
|
|
4697
5664
|
position,
|
|
@@ -4702,11 +5669,11 @@ function CursorOverlay({
|
|
|
4702
5669
|
lockScroll = true,
|
|
4703
5670
|
children
|
|
4704
5671
|
}) {
|
|
4705
|
-
const surfaceRef =
|
|
4706
|
-
const [coords, setCoords] =
|
|
5672
|
+
const surfaceRef = useRef10(null);
|
|
5673
|
+
const [coords, setCoords] = useState18(
|
|
4707
5674
|
() => placeEditorOverlayAt(editor, position, { width, height, gap, viewportGap })
|
|
4708
5675
|
);
|
|
4709
|
-
|
|
5676
|
+
useEffect18(() => {
|
|
4710
5677
|
const updatePosition = () => setCoords(placeEditorOverlayAt(editor, position, { width, height, gap, viewportGap }));
|
|
4711
5678
|
updatePosition();
|
|
4712
5679
|
window.addEventListener("scroll", updatePosition, true);
|
|
@@ -4716,15 +5683,15 @@ function CursorOverlay({
|
|
|
4716
5683
|
window.removeEventListener("resize", updatePosition);
|
|
4717
5684
|
};
|
|
4718
5685
|
}, [editor, position, width, height, gap, viewportGap]);
|
|
4719
|
-
|
|
5686
|
+
useEffect18(() => {
|
|
4720
5687
|
if (!lockScroll) return;
|
|
4721
5688
|
return lockEditorOverlayScroll(editor.view.dom, surfaceRef.current);
|
|
4722
5689
|
}, [editor, lockScroll]);
|
|
4723
|
-
return /* @__PURE__ */
|
|
5690
|
+
return /* @__PURE__ */ jsx94("div", { ref: surfaceRef, "data-cursor-overlay": true, className: "fixed z-50", style: { left: coords.left, top: coords.top }, children });
|
|
4724
5691
|
}
|
|
4725
5692
|
|
|
4726
5693
|
// src/editor/Editor.tsx
|
|
4727
|
-
import { jsx as
|
|
5694
|
+
import { jsx as jsx95, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4728
5695
|
function extractTitle(json) {
|
|
4729
5696
|
if (json?.content?.[0]?.type === "heading" && json.content[0]?.attrs?.level === 1) {
|
|
4730
5697
|
return json.content[0]?.content?.[0]?.text || "";
|
|
@@ -4745,7 +5712,7 @@ function getEditorCounts(editor) {
|
|
|
4745
5712
|
readDuration: Math.max(1, Math.ceil(words / 250))
|
|
4746
5713
|
};
|
|
4747
5714
|
}
|
|
4748
|
-
var Editor =
|
|
5715
|
+
var Editor = forwardRef4(function Editor2({
|
|
4749
5716
|
content = "",
|
|
4750
5717
|
editable = true,
|
|
4751
5718
|
enforceTitle = true,
|
|
@@ -4755,15 +5722,15 @@ var Editor = forwardRef3(function Editor2({
|
|
|
4755
5722
|
onUpload,
|
|
4756
5723
|
fetchLinkPreview
|
|
4757
5724
|
}, ref) {
|
|
4758
|
-
const [slash, setSlash] =
|
|
4759
|
-
const [mention, setMention] =
|
|
4760
|
-
const [imageInput, setImageInput] =
|
|
4761
|
-
const [bookmarkInput, setBookmarkInput] =
|
|
4762
|
-
const [youTubeInput, setYouTubeInput] =
|
|
4763
|
-
const slashRef =
|
|
4764
|
-
const slashSurfaceRef =
|
|
4765
|
-
const mentionRef =
|
|
4766
|
-
const extensions =
|
|
5725
|
+
const [slash, setSlash] = useState19({ props: null, coords: { left: 0, top: 0 } });
|
|
5726
|
+
const [mention, setMention] = useState19({ props: null, coords: { left: 0, top: 0 } });
|
|
5727
|
+
const [imageInput, setImageInput] = useState19(null);
|
|
5728
|
+
const [bookmarkInput, setBookmarkInput] = useState19(null);
|
|
5729
|
+
const [youTubeInput, setYouTubeInput] = useState19(null);
|
|
5730
|
+
const slashRef = useRef11(null);
|
|
5731
|
+
const slashSurfaceRef = useRef11(null);
|
|
5732
|
+
const mentionRef = useRef11(null);
|
|
5733
|
+
const extensions = useMemo8(
|
|
4767
5734
|
() => buildExtensions({
|
|
4768
5735
|
mentionSource,
|
|
4769
5736
|
hrefBuilder,
|
|
@@ -4791,7 +5758,7 @@ var Editor = forwardRef3(function Editor2({
|
|
|
4791
5758
|
}),
|
|
4792
5759
|
[mentionSource, hrefBuilder, enforceTitle]
|
|
4793
5760
|
);
|
|
4794
|
-
|
|
5761
|
+
useEffect19(() => {
|
|
4795
5762
|
if (!slash.props) return;
|
|
4796
5763
|
const updatePosition = () => setSlash(
|
|
4797
5764
|
(current) => current.props ? slashMenuFrom(current.props, slashSurfaceRef.current) : current
|
|
@@ -4828,11 +5795,11 @@ var Editor = forwardRef3(function Editor2({
|
|
|
4828
5795
|
handlePaste: insertPastedUrlAsLink
|
|
4829
5796
|
}
|
|
4830
5797
|
});
|
|
4831
|
-
|
|
5798
|
+
useEffect19(() => {
|
|
4832
5799
|
if (!editor || !slash.props) return;
|
|
4833
5800
|
return lockEditorOverlayScroll2(editor.view.dom, slashSurfaceRef.current);
|
|
4834
5801
|
}, [editor, slash.props]);
|
|
4835
|
-
|
|
5802
|
+
useEffect19(() => {
|
|
4836
5803
|
if (!editor) return;
|
|
4837
5804
|
const instance = editor;
|
|
4838
5805
|
registerImageInsertCallback(instance, (position) => {
|
|
@@ -4840,7 +5807,7 @@ var Editor = forwardRef3(function Editor2({
|
|
|
4840
5807
|
});
|
|
4841
5808
|
return () => unregisterImageInsertCallback(instance);
|
|
4842
5809
|
}, [editor]);
|
|
4843
|
-
|
|
5810
|
+
useEffect19(() => {
|
|
4844
5811
|
if (!editor) return;
|
|
4845
5812
|
const instance = editor;
|
|
4846
5813
|
registerYouTubeInsertCallback(instance, (position) => {
|
|
@@ -4848,7 +5815,7 @@ var Editor = forwardRef3(function Editor2({
|
|
|
4848
5815
|
});
|
|
4849
5816
|
return () => unregisterYouTubeInsertCallback(instance);
|
|
4850
5817
|
}, [editor]);
|
|
4851
|
-
|
|
5818
|
+
useEffect19(() => {
|
|
4852
5819
|
if (!editor) return;
|
|
4853
5820
|
const sync = () => {
|
|
4854
5821
|
const storage = editor.storage;
|
|
@@ -4882,21 +5849,21 @@ var Editor = forwardRef3(function Editor2({
|
|
|
4882
5849
|
}),
|
|
4883
5850
|
[editor]
|
|
4884
5851
|
);
|
|
4885
|
-
return /* @__PURE__ */
|
|
4886
|
-
/* @__PURE__ */
|
|
4887
|
-
editor ? /* @__PURE__ */
|
|
4888
|
-
editor && slash.props ? /* @__PURE__ */
|
|
5852
|
+
return /* @__PURE__ */ jsxs43("div", { className: "relative", children: [
|
|
5853
|
+
/* @__PURE__ */ jsx95(EditorContent, { editor }),
|
|
5854
|
+
editor ? /* @__PURE__ */ jsx95(BubbleMenu, { editor }) : null,
|
|
5855
|
+
editor && slash.props ? /* @__PURE__ */ jsx95(
|
|
4889
5856
|
"div",
|
|
4890
5857
|
{
|
|
4891
5858
|
ref: slashSurfaceRef,
|
|
4892
5859
|
"data-slash-menu-surface": true,
|
|
4893
5860
|
className: "fixed z-50",
|
|
4894
5861
|
style: { left: slash.coords.left, top: slash.coords.top },
|
|
4895
|
-
children: /* @__PURE__ */
|
|
5862
|
+
children: /* @__PURE__ */ jsx95(SlashMenu, { ref: slashRef, ...slash.props })
|
|
4896
5863
|
}
|
|
4897
5864
|
) : null,
|
|
4898
|
-
editor && mention.props ? /* @__PURE__ */
|
|
4899
|
-
editor && imageInput ? /* @__PURE__ */
|
|
5865
|
+
editor && mention.props ? /* @__PURE__ */ jsx95("div", { className: "fixed z-50", style: { left: mention.coords.left, top: mention.coords.top }, children: /* @__PURE__ */ jsx95(MentionList, { ref: mentionRef, ...mention.props }) }) : null,
|
|
5866
|
+
editor && imageInput ? /* @__PURE__ */ jsx95(CursorOverlay, { editor, position: imageInput.position, ...IMAGE_OVERLAY, children: /* @__PURE__ */ jsx95(
|
|
4900
5867
|
ImageInput,
|
|
4901
5868
|
{
|
|
4902
5869
|
editor,
|
|
@@ -4905,7 +5872,7 @@ var Editor = forwardRef3(function Editor2({
|
|
|
4905
5872
|
onClose: () => setImageInput(null)
|
|
4906
5873
|
}
|
|
4907
5874
|
) }) : null,
|
|
4908
|
-
editor && bookmarkInput ? /* @__PURE__ */
|
|
5875
|
+
editor && bookmarkInput ? /* @__PURE__ */ jsx95(CursorOverlay, { editor, position: bookmarkInput.position, ...BOOKMARK_OVERLAY, children: /* @__PURE__ */ jsx95(
|
|
4909
5876
|
BookmarkInput,
|
|
4910
5877
|
{
|
|
4911
5878
|
editor,
|
|
@@ -4914,7 +5881,7 @@ var Editor = forwardRef3(function Editor2({
|
|
|
4914
5881
|
onClose: () => setBookmarkInput(null)
|
|
4915
5882
|
}
|
|
4916
5883
|
) }) : null,
|
|
4917
|
-
editor && youTubeInput ? /* @__PURE__ */
|
|
5884
|
+
editor && youTubeInput ? /* @__PURE__ */ jsx95(CursorOverlay, { editor, position: youTubeInput.position, ...YOUTUBE_OVERLAY, children: /* @__PURE__ */ jsx95(YouTubeInput, { editor, position: youTubeInput.position, onClose: () => setYouTubeInput(null) }) }) : null
|
|
4918
5885
|
] });
|
|
4919
5886
|
});
|
|
4920
5887
|
function menuFrom(props) {
|
|
@@ -4936,10 +5903,10 @@ function slashMenuFrom(props, surface) {
|
|
|
4936
5903
|
}
|
|
4937
5904
|
|
|
4938
5905
|
// src/editor/Reader.tsx
|
|
4939
|
-
import { useMemo as
|
|
5906
|
+
import { useMemo as useMemo9 } from "react";
|
|
4940
5907
|
import { generateHTML } from "@tiptap/core";
|
|
4941
5908
|
import { buildExtensions as buildExtensions2 } from "@cloudvoyant/helical-ui";
|
|
4942
|
-
import { jsx as
|
|
5909
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
4943
5910
|
var noopNodeView = () => () => ({});
|
|
4944
5911
|
var inertNodeViews = {
|
|
4945
5912
|
image: noopNodeView,
|
|
@@ -4948,7 +5915,7 @@ var inertNodeViews = {
|
|
|
4948
5915
|
codeBlock: noopNodeView
|
|
4949
5916
|
};
|
|
4950
5917
|
function Reader({ content, className }) {
|
|
4951
|
-
const html =
|
|
5918
|
+
const html = useMemo9(() => {
|
|
4952
5919
|
if (!content) return "";
|
|
4953
5920
|
try {
|
|
4954
5921
|
const json = JSON.parse(content);
|
|
@@ -4960,7 +5927,7 @@ function Reader({ content, className }) {
|
|
|
4960
5927
|
return "";
|
|
4961
5928
|
}
|
|
4962
5929
|
}, [content]);
|
|
4963
|
-
return /* @__PURE__ */
|
|
5930
|
+
return /* @__PURE__ */ jsx96(
|
|
4964
5931
|
"div",
|
|
4965
5932
|
{
|
|
4966
5933
|
className: className ?? "prose prose-lg reader-content max-w-none dark:prose-invert",
|
|
@@ -5032,6 +5999,7 @@ export {
|
|
|
5032
5999
|
InlineLaTeX,
|
|
5033
6000
|
Input2 as Input,
|
|
5034
6001
|
Item,
|
|
6002
|
+
Kbd,
|
|
5035
6003
|
LaTeX,
|
|
5036
6004
|
LanguageTabsCodeBlock,
|
|
5037
6005
|
Listbox,
|
|
@@ -5039,6 +6007,8 @@ export {
|
|
|
5039
6007
|
ListboxEmpty,
|
|
5040
6008
|
ListboxInput,
|
|
5041
6009
|
ListboxItem,
|
|
6010
|
+
ListboxItemGroup,
|
|
6011
|
+
ListboxItemGroupLabel,
|
|
5042
6012
|
ListboxItemIndicator,
|
|
5043
6013
|
ListboxItemText,
|
|
5044
6014
|
ListboxLabel,
|
|
@@ -5083,6 +6053,7 @@ export {
|
|
|
5083
6053
|
PaginationItems,
|
|
5084
6054
|
PaginationNext,
|
|
5085
6055
|
PaginationPrevious,
|
|
6056
|
+
Pane,
|
|
5086
6057
|
Popover,
|
|
5087
6058
|
PopoverAnchor,
|
|
5088
6059
|
PopoverContent,
|
|
@@ -5170,6 +6141,10 @@ export {
|
|
|
5170
6141
|
TooltipProvider,
|
|
5171
6142
|
TooltipTrigger,
|
|
5172
6143
|
VStack,
|
|
6144
|
+
WhichKey,
|
|
6145
|
+
WhichKeyExplorer,
|
|
6146
|
+
WhichKeyMode,
|
|
6147
|
+
WhichKeyProvider,
|
|
5173
6148
|
Window,
|
|
5174
6149
|
WindowBody,
|
|
5175
6150
|
WindowControl,
|
|
@@ -5190,10 +6165,14 @@ export {
|
|
|
5190
6165
|
useDialog,
|
|
5191
6166
|
useDialogContext,
|
|
5192
6167
|
useField,
|
|
6168
|
+
useKeymap,
|
|
6169
|
+
useKeymapScope,
|
|
5193
6170
|
useListbox,
|
|
5194
6171
|
useMediaQuery,
|
|
5195
6172
|
useNavbar,
|
|
5196
6173
|
useNumberInput,
|
|
6174
|
+
useOptionalPaneRegistration,
|
|
6175
|
+
useOptionalWhichKeyController,
|
|
5197
6176
|
usePopover,
|
|
5198
6177
|
usePopoverContext,
|
|
5199
6178
|
useRadioGroup,
|
|
@@ -5204,6 +6183,8 @@ export {
|
|
|
5204
6183
|
useTagInput,
|
|
5205
6184
|
useTooltip,
|
|
5206
6185
|
useTooltipContext,
|
|
6186
|
+
useWhichKey,
|
|
6187
|
+
useWhichKeyController,
|
|
5207
6188
|
useWindow,
|
|
5208
6189
|
useWindowContext
|
|
5209
6190
|
};
|