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