@cloudvoyant/helical-react 0.19.0 → 0.20.0-rc.202611012026.09e963c
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 +54 -23
- package/dist/index.js +69 -16
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -675,7 +675,7 @@ function useIsMobile() {
|
|
|
675
675
|
return isMobile && isMobileSet;
|
|
676
676
|
}
|
|
677
677
|
function Provider({
|
|
678
|
-
defaultOpen =
|
|
678
|
+
defaultOpen = false,
|
|
679
679
|
open: openProp,
|
|
680
680
|
onOpenChange: setOpenProp,
|
|
681
681
|
className,
|
|
@@ -685,6 +685,8 @@ function Provider({
|
|
|
685
685
|
}) {
|
|
686
686
|
const isMobile = useIsMobile();
|
|
687
687
|
const [openMobile, setOpenMobile] = React2.useState(false);
|
|
688
|
+
const isControlled = openProp !== void 0;
|
|
689
|
+
const usesMobileSheetState = isMobile && !isControlled;
|
|
688
690
|
const [_open, _setOpen] = React2.useState(defaultOpen);
|
|
689
691
|
const open = openProp ?? _open;
|
|
690
692
|
const setOpen = React2.useCallback(
|
|
@@ -702,8 +704,8 @@ function Provider({
|
|
|
702
704
|
[setOpenProp, open]
|
|
703
705
|
);
|
|
704
706
|
const toggleSidebar = React2.useCallback(() => {
|
|
705
|
-
return
|
|
706
|
-
}, [
|
|
707
|
+
return usesMobileSheetState ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
708
|
+
}, [usesMobileSheetState, setOpen, setOpenMobile]);
|
|
707
709
|
React2.useEffect(() => {
|
|
708
710
|
if (openProp !== void 0) return;
|
|
709
711
|
if (typeof document === "undefined") return;
|
|
@@ -731,9 +733,10 @@ function Provider({
|
|
|
731
733
|
isMobile,
|
|
732
734
|
openMobile,
|
|
733
735
|
setOpenMobile,
|
|
734
|
-
toggleSidebar
|
|
736
|
+
toggleSidebar,
|
|
737
|
+
isControlled
|
|
735
738
|
}),
|
|
736
|
-
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
739
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, isControlled]
|
|
737
740
|
);
|
|
738
741
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
739
742
|
Row,
|
|
@@ -763,7 +766,7 @@ function Root({
|
|
|
763
766
|
children,
|
|
764
767
|
...props
|
|
765
768
|
}) {
|
|
766
|
-
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
769
|
+
const { isMobile, state, open, setOpen, openMobile, setOpenMobile, isControlled } = useSidebar();
|
|
767
770
|
if (collapsible === "none") {
|
|
768
771
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
769
772
|
Col,
|
|
@@ -777,27 +780,40 @@ function Root({
|
|
|
777
780
|
);
|
|
778
781
|
}
|
|
779
782
|
if (isMobile) {
|
|
783
|
+
const isBottomWidgetSheet = side === "right";
|
|
784
|
+
const mobileSheetOpen = isControlled ? open : openMobile;
|
|
785
|
+
const setMobileSheetOpen = isControlled ? setOpen : setOpenMobile;
|
|
786
|
+
const bottomSheetSnapProps = isBottomWidgetSheet ? {
|
|
787
|
+
snapPoints: import_helical_ui25.SIDEBAR_WIDGET_SNAP_POINTS,
|
|
788
|
+
defaultSnapPoint: import_helical_ui25.SIDEBAR_WIDGET_DEFAULT_SNAP_POINT,
|
|
789
|
+
snapToSequentialPoints: true
|
|
790
|
+
} : {};
|
|
780
791
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
781
792
|
import_drawer.DrawerRoot,
|
|
782
793
|
{
|
|
783
|
-
open:
|
|
784
|
-
onOpenChange: (details) =>
|
|
794
|
+
open: mobileSheetOpen,
|
|
795
|
+
onOpenChange: (details) => setMobileSheetOpen(details.open),
|
|
796
|
+
swipeDirection: side === "left" ? "start" : "down",
|
|
797
|
+
modal: !isBottomWidgetSheet,
|
|
798
|
+
...bottomSheetSnapProps,
|
|
799
|
+
preventDragOnScroll: false,
|
|
785
800
|
...props,
|
|
786
801
|
children: [
|
|
787
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerBackdrop, {}),
|
|
788
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerPositioner, { className:
|
|
802
|
+
!isBottomWidgetSheet && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerBackdrop, { className: import_helical_ui25.sidebarStyles.mobileBackdropClass }),
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerPositioner, { className: import_helical_ui25.sidebarStyles.mobilePositionerClass, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
789
804
|
import_drawer.DrawerContent,
|
|
790
805
|
{
|
|
791
806
|
"data-sidebar": "sidebar",
|
|
792
807
|
"data-slot": "sidebar",
|
|
793
808
|
"data-mobile": "true",
|
|
794
|
-
className: (0, import_helical_ui25.cn)(
|
|
809
|
+
className: (0, import_helical_ui25.cn)(import_helical_ui25.sidebarStyles.mobileContentClass, className),
|
|
795
810
|
style: { "--sidebar-width": import_helical_ui25.SIDEBAR_WIDTH_MOBILE },
|
|
796
811
|
children: [
|
|
797
812
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerTitle, { className: "sr-only", children: "Sidebar" }),
|
|
798
813
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerDescription, { className: "sr-only", children: "Displays the mobile sidebar." }),
|
|
799
814
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerCloseTrigger, { className: "hidden" }),
|
|
800
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
815
|
+
isBottomWidgetSheet && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerGrabber, { className: import_helical_ui25.sidebarStyles.mobileGrabberClass, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_drawer.DrawerGrabberIndicator, { className: import_helical_ui25.sidebarStyles.mobileGrabberIndicatorClass }) }),
|
|
816
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { "data-no-drag": true, className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Col, { className: "h-full w-full", children }) })
|
|
801
817
|
]
|
|
802
818
|
}
|
|
803
819
|
) })
|
|
@@ -3902,8 +3918,23 @@ function BubbleMenu({ editor }) {
|
|
|
3902
3918
|
|
|
3903
3919
|
// src/editor/SlashMenu.tsx
|
|
3904
3920
|
var import_react23 = require("react");
|
|
3905
|
-
var
|
|
3921
|
+
var import_lucide_react6 = require("lucide-react");
|
|
3906
3922
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3923
|
+
var SLASH_MENU_ICONS = {
|
|
3924
|
+
Heading1: import_lucide_react6.Heading1,
|
|
3925
|
+
Heading2: import_lucide_react6.Heading2,
|
|
3926
|
+
Heading3: import_lucide_react6.Heading3,
|
|
3927
|
+
Heading4: import_lucide_react6.Heading4,
|
|
3928
|
+
Quote: import_lucide_react6.Quote,
|
|
3929
|
+
MessageSquareWarning: import_lucide_react6.MessageSquareWarning,
|
|
3930
|
+
List: import_lucide_react6.List,
|
|
3931
|
+
ListOrdered: import_lucide_react6.ListOrdered,
|
|
3932
|
+
ListTodo: import_lucide_react6.ListTodo,
|
|
3933
|
+
Minus: import_lucide_react6.Minus,
|
|
3934
|
+
Code: import_lucide_react6.Code,
|
|
3935
|
+
Image: import_lucide_react6.Image,
|
|
3936
|
+
Bookmark: import_lucide_react6.Bookmark
|
|
3937
|
+
};
|
|
3907
3938
|
var SlashMenu = (0, import_react23.forwardRef)(function SlashMenu2({ items, command }, ref) {
|
|
3908
3939
|
const [index, setIndex] = (0, import_react23.useState)(0);
|
|
3909
3940
|
const itemRefs = (0, import_react23.useRef)([]);
|
|
@@ -3948,7 +3979,7 @@ var SlashMenu = (0, import_react23.forwardRef)(function SlashMenu2({ items, comm
|
|
|
3948
3979
|
},
|
|
3949
3980
|
loopFocus: false,
|
|
3950
3981
|
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ListboxContent, { "data-slash-menu-scroll": true, children: items.map((item, i) => {
|
|
3951
|
-
const Icon =
|
|
3982
|
+
const Icon = SLASH_MENU_ICONS[item.icon];
|
|
3952
3983
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3953
3984
|
ListboxItem,
|
|
3954
3985
|
{
|
|
@@ -4019,11 +4050,11 @@ var MentionList = (0, import_react24.forwardRef)(function MentionList2({ items,
|
|
|
4019
4050
|
|
|
4020
4051
|
// src/editor/ImageInput.tsx
|
|
4021
4052
|
var import_react25 = require("react");
|
|
4022
|
-
var
|
|
4053
|
+
var import_lucide_react8 = require("lucide-react");
|
|
4023
4054
|
|
|
4024
4055
|
// src/editor/ImageFileUpload.tsx
|
|
4025
4056
|
var import_file_upload = require("@ark-ui/react/file-upload");
|
|
4026
|
-
var
|
|
4057
|
+
var import_lucide_react7 = require("lucide-react");
|
|
4027
4058
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
4028
4059
|
function ImageFileUpload({ file, onFileChange, disabled = false }) {
|
|
4029
4060
|
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
@@ -4036,11 +4067,11 @@ function ImageFileUpload({ file, onFileChange, disabled = false }) {
|
|
|
4036
4067
|
onFileChange: (details) => onFileChange(details.acceptedFiles[0] ?? null),
|
|
4037
4068
|
children: [
|
|
4038
4069
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_file_upload.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: [
|
|
4039
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
4070
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react7.ImagePlus, { className: "size-6 text-muted-foreground", "aria-hidden": "true" }),
|
|
4040
4071
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "text-sm font-medium", children: "Drop an image here" }),
|
|
4041
4072
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "text-xs text-muted-foreground", children: "or" }),
|
|
4042
4073
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_file_upload.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: [
|
|
4043
|
-
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react7.Upload, { className: "size-4", "aria-hidden": "true" }),
|
|
4044
4075
|
"Choose image"
|
|
4045
4076
|
] })
|
|
4046
4077
|
] }),
|
|
@@ -4060,7 +4091,7 @@ function ImageFileUpload({ file, onFileChange, disabled = false }) {
|
|
|
4060
4091
|
{
|
|
4061
4092
|
className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
4062
4093
|
"aria-label": "Remove image",
|
|
4063
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
4094
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react7.Trash2, { className: "size-4" })
|
|
4064
4095
|
}
|
|
4065
4096
|
)
|
|
4066
4097
|
]
|
|
@@ -4140,7 +4171,7 @@ function ImageInput({ editor, position, onClose, onUpload }) {
|
|
|
4140
4171
|
onClick: onClose,
|
|
4141
4172
|
className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
4142
4173
|
"aria-label": "Close image dialog",
|
|
4143
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4174
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react8.X, { className: "size-4" })
|
|
4144
4175
|
}
|
|
4145
4176
|
)
|
|
4146
4177
|
] }),
|
|
@@ -4301,7 +4332,7 @@ function BookmarkInput({ editor, position, onClose, fetchLinkPreview }) {
|
|
|
4301
4332
|
|
|
4302
4333
|
// src/editor/YouTubeInput.tsx
|
|
4303
4334
|
var import_react27 = require("react");
|
|
4304
|
-
var
|
|
4335
|
+
var import_lucide_react9 = require("lucide-react");
|
|
4305
4336
|
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
4306
4337
|
function isYouTubeUrl(value) {
|
|
4307
4338
|
try {
|
|
@@ -4337,7 +4368,7 @@ function YouTubeInput({ editor, position, onClose }) {
|
|
|
4337
4368
|
children: [
|
|
4338
4369
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
4339
4370
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
4340
|
-
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4371
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react9.Play, { className: "size-5 fill-current text-red-600", "aria-hidden": "true", "data-youtube-logo": true }),
|
|
4341
4372
|
"Embed YouTube video"
|
|
4342
4373
|
] }),
|
|
4343
4374
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
@@ -4347,7 +4378,7 @@ function YouTubeInput({ editor, position, onClose }) {
|
|
|
4347
4378
|
onClick: onClose,
|
|
4348
4379
|
"aria-label": "Close YouTube input",
|
|
4349
4380
|
className: "rounded p-1 hover:bg-accent",
|
|
4350
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react9.X, { className: "h-4 w-4" })
|
|
4351
4382
|
}
|
|
4352
4383
|
)
|
|
4353
4384
|
] }),
|
package/dist/index.js
CHANGED
|
@@ -531,7 +531,7 @@ function useIsMobile() {
|
|
|
531
531
|
return isMobile && isMobileSet;
|
|
532
532
|
}
|
|
533
533
|
function Provider({
|
|
534
|
-
defaultOpen =
|
|
534
|
+
defaultOpen = false,
|
|
535
535
|
open: openProp,
|
|
536
536
|
onOpenChange: setOpenProp,
|
|
537
537
|
className,
|
|
@@ -541,6 +541,8 @@ function Provider({
|
|
|
541
541
|
}) {
|
|
542
542
|
const isMobile = useIsMobile();
|
|
543
543
|
const [openMobile, setOpenMobile] = React2.useState(false);
|
|
544
|
+
const isControlled = openProp !== void 0;
|
|
545
|
+
const usesMobileSheetState = isMobile && !isControlled;
|
|
544
546
|
const [_open, _setOpen] = React2.useState(defaultOpen);
|
|
545
547
|
const open = openProp ?? _open;
|
|
546
548
|
const setOpen = React2.useCallback(
|
|
@@ -558,8 +560,8 @@ function Provider({
|
|
|
558
560
|
[setOpenProp, open]
|
|
559
561
|
);
|
|
560
562
|
const toggleSidebar = React2.useCallback(() => {
|
|
561
|
-
return
|
|
562
|
-
}, [
|
|
563
|
+
return usesMobileSheetState ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
564
|
+
}, [usesMobileSheetState, setOpen, setOpenMobile]);
|
|
563
565
|
React2.useEffect(() => {
|
|
564
566
|
if (openProp !== void 0) return;
|
|
565
567
|
if (typeof document === "undefined") return;
|
|
@@ -587,9 +589,10 @@ function Provider({
|
|
|
587
589
|
isMobile,
|
|
588
590
|
openMobile,
|
|
589
591
|
setOpenMobile,
|
|
590
|
-
toggleSidebar
|
|
592
|
+
toggleSidebar,
|
|
593
|
+
isControlled
|
|
591
594
|
}),
|
|
592
|
-
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
595
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar, isControlled]
|
|
593
596
|
);
|
|
594
597
|
return /* @__PURE__ */ jsx24(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx24(
|
|
595
598
|
Row,
|
|
@@ -615,9 +618,17 @@ import {
|
|
|
615
618
|
DrawerContent,
|
|
616
619
|
DrawerTitle,
|
|
617
620
|
DrawerDescription,
|
|
618
|
-
DrawerCloseTrigger
|
|
621
|
+
DrawerCloseTrigger,
|
|
622
|
+
DrawerGrabber,
|
|
623
|
+
DrawerGrabberIndicator
|
|
619
624
|
} from "@ark-ui/react/drawer";
|
|
620
|
-
import {
|
|
625
|
+
import {
|
|
626
|
+
SIDEBAR_WIDTH_MOBILE,
|
|
627
|
+
SIDEBAR_WIDGET_SNAP_POINTS,
|
|
628
|
+
SIDEBAR_WIDGET_DEFAULT_SNAP_POINT,
|
|
629
|
+
sidebarStyles as sidebarStyles2,
|
|
630
|
+
cn as cn25
|
|
631
|
+
} from "@cloudvoyant/helical-ui";
|
|
621
632
|
import { jsx as jsx25, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
622
633
|
function Root({
|
|
623
634
|
side = "left",
|
|
@@ -627,7 +638,7 @@ function Root({
|
|
|
627
638
|
children,
|
|
628
639
|
...props
|
|
629
640
|
}) {
|
|
630
|
-
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
641
|
+
const { isMobile, state, open, setOpen, openMobile, setOpenMobile, isControlled } = useSidebar();
|
|
631
642
|
if (collapsible === "none") {
|
|
632
643
|
return /* @__PURE__ */ jsx25(
|
|
633
644
|
Col,
|
|
@@ -641,27 +652,40 @@ function Root({
|
|
|
641
652
|
);
|
|
642
653
|
}
|
|
643
654
|
if (isMobile) {
|
|
655
|
+
const isBottomWidgetSheet = side === "right";
|
|
656
|
+
const mobileSheetOpen = isControlled ? open : openMobile;
|
|
657
|
+
const setMobileSheetOpen = isControlled ? setOpen : setOpenMobile;
|
|
658
|
+
const bottomSheetSnapProps = isBottomWidgetSheet ? {
|
|
659
|
+
snapPoints: SIDEBAR_WIDGET_SNAP_POINTS,
|
|
660
|
+
defaultSnapPoint: SIDEBAR_WIDGET_DEFAULT_SNAP_POINT,
|
|
661
|
+
snapToSequentialPoints: true
|
|
662
|
+
} : {};
|
|
644
663
|
return /* @__PURE__ */ jsxs5(
|
|
645
664
|
DrawerRoot,
|
|
646
665
|
{
|
|
647
|
-
open:
|
|
648
|
-
onOpenChange: (details) =>
|
|
666
|
+
open: mobileSheetOpen,
|
|
667
|
+
onOpenChange: (details) => setMobileSheetOpen(details.open),
|
|
668
|
+
swipeDirection: side === "left" ? "start" : "down",
|
|
669
|
+
modal: !isBottomWidgetSheet,
|
|
670
|
+
...bottomSheetSnapProps,
|
|
671
|
+
preventDragOnScroll: false,
|
|
649
672
|
...props,
|
|
650
673
|
children: [
|
|
651
|
-
/* @__PURE__ */ jsx25(DrawerBackdrop, {}),
|
|
652
|
-
/* @__PURE__ */ jsx25(DrawerPositioner, { className:
|
|
674
|
+
!isBottomWidgetSheet && /* @__PURE__ */ jsx25(DrawerBackdrop, { className: sidebarStyles2.mobileBackdropClass }),
|
|
675
|
+
/* @__PURE__ */ jsx25(DrawerPositioner, { className: sidebarStyles2.mobilePositionerClass, children: /* @__PURE__ */ jsxs5(
|
|
653
676
|
DrawerContent,
|
|
654
677
|
{
|
|
655
678
|
"data-sidebar": "sidebar",
|
|
656
679
|
"data-slot": "sidebar",
|
|
657
680
|
"data-mobile": "true",
|
|
658
|
-
className: cn25(
|
|
681
|
+
className: cn25(sidebarStyles2.mobileContentClass, className),
|
|
659
682
|
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
660
683
|
children: [
|
|
661
684
|
/* @__PURE__ */ jsx25(DrawerTitle, { className: "sr-only", children: "Sidebar" }),
|
|
662
685
|
/* @__PURE__ */ jsx25(DrawerDescription, { className: "sr-only", children: "Displays the mobile sidebar." }),
|
|
663
686
|
/* @__PURE__ */ jsx25(DrawerCloseTrigger, { className: "hidden" }),
|
|
664
|
-
/* @__PURE__ */ jsx25(
|
|
687
|
+
isBottomWidgetSheet && /* @__PURE__ */ jsx25(DrawerGrabber, { className: sidebarStyles2.mobileGrabberClass, children: /* @__PURE__ */ jsx25(DrawerGrabberIndicator, { className: sidebarStyles2.mobileGrabberIndicatorClass }) }),
|
|
688
|
+
/* @__PURE__ */ jsx25("div", { "data-no-drag": true, className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ jsx25(Col, { className: "h-full w-full", children }) })
|
|
665
689
|
]
|
|
666
690
|
}
|
|
667
691
|
) })
|
|
@@ -4124,8 +4148,37 @@ function BubbleMenu({ editor }) {
|
|
|
4124
4148
|
|
|
4125
4149
|
// src/editor/SlashMenu.tsx
|
|
4126
4150
|
import { forwardRef, useEffect as useEffect11, useImperativeHandle, useRef as useRef4, useState as useState12 } from "react";
|
|
4127
|
-
import
|
|
4151
|
+
import {
|
|
4152
|
+
Bookmark,
|
|
4153
|
+
Code,
|
|
4154
|
+
Heading1,
|
|
4155
|
+
Heading2,
|
|
4156
|
+
Heading3,
|
|
4157
|
+
Heading4,
|
|
4158
|
+
Image,
|
|
4159
|
+
List,
|
|
4160
|
+
ListOrdered,
|
|
4161
|
+
ListTodo,
|
|
4162
|
+
MessageSquareWarning,
|
|
4163
|
+
Minus,
|
|
4164
|
+
Quote
|
|
4165
|
+
} from "lucide-react";
|
|
4128
4166
|
import { jsx as jsx82, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4167
|
+
var SLASH_MENU_ICONS = {
|
|
4168
|
+
Heading1,
|
|
4169
|
+
Heading2,
|
|
4170
|
+
Heading3,
|
|
4171
|
+
Heading4,
|
|
4172
|
+
Quote,
|
|
4173
|
+
MessageSquareWarning,
|
|
4174
|
+
List,
|
|
4175
|
+
ListOrdered,
|
|
4176
|
+
ListTodo,
|
|
4177
|
+
Minus,
|
|
4178
|
+
Code,
|
|
4179
|
+
Image,
|
|
4180
|
+
Bookmark
|
|
4181
|
+
};
|
|
4129
4182
|
var SlashMenu = forwardRef(function SlashMenu2({ items, command }, ref) {
|
|
4130
4183
|
const [index, setIndex] = useState12(0);
|
|
4131
4184
|
const itemRefs = useRef4([]);
|
|
@@ -4170,7 +4223,7 @@ var SlashMenu = forwardRef(function SlashMenu2({ items, command }, ref) {
|
|
|
4170
4223
|
},
|
|
4171
4224
|
loopFocus: false,
|
|
4172
4225
|
children: /* @__PURE__ */ jsx82(ListboxContent, { "data-slash-menu-scroll": true, children: items.map((item, i) => {
|
|
4173
|
-
const Icon =
|
|
4226
|
+
const Icon = SLASH_MENU_ICONS[item.icon];
|
|
4174
4227
|
return /* @__PURE__ */ jsx82(
|
|
4175
4228
|
ListboxItem,
|
|
4176
4229
|
{
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudvoyant/helical-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0-rc.202611012026.09e963c",
|
|
4
4
|
"description": "helical-ui React UI components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
7
8
|
"main": "./dist/index.cjs",
|
|
8
9
|
"module": "./dist/index.js",
|
|
9
10
|
"types": "./dist/index.d.ts",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"@tiptap/react": "^3.31.3",
|
|
47
48
|
"@tiptap/suggestion": "^3.31.3",
|
|
48
49
|
"lucide-react": "^1.32.0",
|
|
49
|
-
"@cloudvoyant/helical-ui": "0.
|
|
50
|
+
"@cloudvoyant/helical-ui": "0.20.0-rc.202611012026.09e963c"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@types/katex": "^0.16.8",
|