@moontra/moonui-pro 2.25.18 → 2.25.19
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.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.global.js +56 -56
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +95 -64
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1725,32 +1725,6 @@ var require_core = __commonJS({
|
|
|
1725
1725
|
highlight.default = highlight;
|
|
1726
1726
|
}
|
|
1727
1727
|
});
|
|
1728
|
-
|
|
1729
|
-
// #style-inject:#style-inject
|
|
1730
|
-
function styleInject(css2, { insertAt } = {}) {
|
|
1731
|
-
if (!css2 || typeof document === "undefined")
|
|
1732
|
-
return;
|
|
1733
|
-
const head = document.head || document.getElementsByTagName("head")[0];
|
|
1734
|
-
const style2 = document.createElement("style");
|
|
1735
|
-
style2.type = "text/css";
|
|
1736
|
-
if (insertAt === "top") {
|
|
1737
|
-
if (head.firstChild) {
|
|
1738
|
-
head.insertBefore(style2, head.firstChild);
|
|
1739
|
-
} else {
|
|
1740
|
-
head.appendChild(style2);
|
|
1741
|
-
}
|
|
1742
|
-
} else {
|
|
1743
|
-
head.appendChild(style2);
|
|
1744
|
-
}
|
|
1745
|
-
if (style2.styleSheet) {
|
|
1746
|
-
style2.styleSheet.cssText = css2;
|
|
1747
|
-
} else {
|
|
1748
|
-
style2.appendChild(document.createTextNode(css2));
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
// src/styles/components.css
|
|
1753
|
-
styleInject(".moonui-pro-sidebar {\n isolation: isolate;\n}\n.moonui-pro-navbar {\n isolation: isolate;\n}\n");
|
|
1754
1728
|
function cn(...inputs) {
|
|
1755
1729
|
return twMerge(clsx(inputs));
|
|
1756
1730
|
}
|
|
@@ -58114,6 +58088,29 @@ var SlashCommandsExtension = Extension.create({
|
|
|
58114
58088
|
}
|
|
58115
58089
|
});
|
|
58116
58090
|
|
|
58091
|
+
// #style-inject:#style-inject
|
|
58092
|
+
function styleInject(css2, { insertAt } = {}) {
|
|
58093
|
+
if (!css2 || typeof document === "undefined")
|
|
58094
|
+
return;
|
|
58095
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
58096
|
+
const style2 = document.createElement("style");
|
|
58097
|
+
style2.type = "text/css";
|
|
58098
|
+
if (insertAt === "top") {
|
|
58099
|
+
if (head.firstChild) {
|
|
58100
|
+
head.insertBefore(style2, head.firstChild);
|
|
58101
|
+
} else {
|
|
58102
|
+
head.appendChild(style2);
|
|
58103
|
+
}
|
|
58104
|
+
} else {
|
|
58105
|
+
head.appendChild(style2);
|
|
58106
|
+
}
|
|
58107
|
+
if (style2.styleSheet) {
|
|
58108
|
+
style2.styleSheet.cssText = css2;
|
|
58109
|
+
} else {
|
|
58110
|
+
style2.appendChild(document.createTextNode(css2));
|
|
58111
|
+
}
|
|
58112
|
+
}
|
|
58113
|
+
|
|
58117
58114
|
// src/components/rich-text-editor/slash-commands.css
|
|
58118
58115
|
styleInject(".slash-commands-menu {\n border-radius: var(--radius);\n border-width: 1px;\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.slash-commands-menu:is(.dark *) {\n --tw-border-opacity: 1;\n border-color: rgb(55 65 81 / var(--tw-border-opacity, 1));\n --tw-bg-opacity: 1;\n background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1));\n}\n.slash-commands-menu {\n max-height: 20rem;\n min-width: 280px;\n overflow-y: auto;\n padding: 0.5rem;\n}\n.slash-command-item {\n display: flex;\n cursor: pointer;\n align-items: center;\n gap: 0.75rem;\n border-radius: calc(var(--radius) - 2px);\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.slash-command-item:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n.slash-command-item:hover:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));\n}\n.slash-command-item.selected {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n.slash-command-item.selected:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));\n}\n.slash-command-item svg {\n height: 1rem;\n width: 1rem;\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity, 1));\n}\n.slash-command-item svg:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n.slash-command-item > div {\n flex: 1 1 0%;\n}\n.slash-command-item .command-name {\n font-size: 0.875rem;\n line-height: 1.25rem;\n font-weight: 500;\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.slash-command-item .command-name:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(243 244 246 / var(--tw-text-opacity, 1));\n}\n.slash-command-item .command-description {\n margin-top: 0.125rem;\n font-size: 0.75rem;\n line-height: 1rem;\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity, 1));\n}\n.slash-command-item .command-description:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n.dark .slash-commands-menu {\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);\n}\n");
|
|
58119
58116
|
|
|
@@ -75010,7 +75007,7 @@ function SidebarInternal({
|
|
|
75010
75007
|
] });
|
|
75011
75008
|
});
|
|
75012
75009
|
const sidebarClasses = cn(
|
|
75013
|
-
"moonui-pro
|
|
75010
|
+
"moonui-pro flex h-full flex-col bg-background border-r",
|
|
75014
75011
|
glassmorphism && "bg-background/80 backdrop-blur-xl border-white/10",
|
|
75015
75012
|
collapsed && !isMobile && "w-16",
|
|
75016
75013
|
!collapsed && !isMobile && "w-64",
|
|
@@ -75038,7 +75035,7 @@ function SidebarInternal({
|
|
|
75038
75035
|
children: /* @__PURE__ */ jsx(Menu, { className: "h-5 w-5" })
|
|
75039
75036
|
}
|
|
75040
75037
|
),
|
|
75041
|
-
/* @__PURE__ */ jsx(Sheet, { open: isOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsx(SheetContent, { side: "left", className: "w-80 p-0", children: /* @__PURE__ */ jsxs("div", { className: cn(sidebarClasses, "
|
|
75038
|
+
/* @__PURE__ */ jsx(Sheet, { open: isOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsx(SheetContent, { side: "left", className: "w-80 p-0", children: /* @__PURE__ */ jsxs("div", { className: cn(sidebarClasses, "sidebar-container flex flex-col"), children: [
|
|
75042
75039
|
animatedBackground && /* @__PURE__ */ jsx(
|
|
75043
75040
|
motion.div,
|
|
75044
75041
|
{
|
|
@@ -75064,7 +75061,7 @@ function SidebarInternal({
|
|
|
75064
75061
|
] }) }) })
|
|
75065
75062
|
] });
|
|
75066
75063
|
}
|
|
75067
|
-
return /* @__PURE__ */ jsxs("aside", { className: cn(sidebarClasses, "hidden md:flex"), children: [
|
|
75064
|
+
return /* @__PURE__ */ jsxs("aside", { className: cn(sidebarClasses, "sidebar-container hidden md:flex flex-col"), children: [
|
|
75068
75065
|
animatedBackground && /* @__PURE__ */ jsx(
|
|
75069
75066
|
motion.div,
|
|
75070
75067
|
{
|
|
@@ -75111,6 +75108,12 @@ function NavbarInternal({
|
|
|
75111
75108
|
sections,
|
|
75112
75109
|
branding,
|
|
75113
75110
|
showSearch = true,
|
|
75111
|
+
enableCommandAI = false,
|
|
75112
|
+
commandAIShortcut = "\u2318K",
|
|
75113
|
+
commandAIPlaceholder = "Search commands...",
|
|
75114
|
+
onCommandAIOpen,
|
|
75115
|
+
onCommandAIClose,
|
|
75116
|
+
onCommandAISelect,
|
|
75114
75117
|
searchPlaceholder = "Search...",
|
|
75115
75118
|
onSearch,
|
|
75116
75119
|
showThemeToggle = false,
|
|
@@ -75182,17 +75185,20 @@ function NavbarInternal({
|
|
|
75182
75185
|
return () => window.removeEventListener("scroll", handleScroll);
|
|
75183
75186
|
}, [sticky, hideOnScroll, showScrollProgress]);
|
|
75184
75187
|
useEffect(() => {
|
|
75185
|
-
if (!keyboardShortcuts)
|
|
75188
|
+
if (!keyboardShortcuts && !enableCommandAI)
|
|
75186
75189
|
return;
|
|
75187
75190
|
const handleKeyDown3 = (e) => {
|
|
75188
75191
|
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
75189
75192
|
e.preventDefault();
|
|
75190
75193
|
setIsCommandOpen(true);
|
|
75194
|
+
if (enableCommandAI) {
|
|
75195
|
+
onCommandAIOpen?.();
|
|
75196
|
+
}
|
|
75191
75197
|
}
|
|
75192
75198
|
};
|
|
75193
75199
|
document.addEventListener("keydown", handleKeyDown3);
|
|
75194
75200
|
return () => document.removeEventListener("keydown", handleKeyDown3);
|
|
75195
|
-
}, [keyboardShortcuts]);
|
|
75201
|
+
}, [keyboardShortcuts, enableCommandAI, onCommandAIOpen]);
|
|
75196
75202
|
const handleItemClick = useCallback((item) => {
|
|
75197
75203
|
if (item.action) {
|
|
75198
75204
|
item.action();
|
|
@@ -75343,7 +75349,7 @@ function NavbarInternal({
|
|
|
75343
75349
|
className
|
|
75344
75350
|
);
|
|
75345
75351
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75346
|
-
/* @__PURE__ */ jsxs("nav", { ref: navRef, className:
|
|
75352
|
+
/* @__PURE__ */ jsxs("nav", { ref: navRef, className: navClasses, children: [
|
|
75347
75353
|
/* @__PURE__ */ jsxs("div", { className: cn(
|
|
75348
75354
|
"flex items-center",
|
|
75349
75355
|
getHeight(),
|
|
@@ -75434,15 +75440,22 @@ function NavbarInternal({
|
|
|
75434
75440
|
{
|
|
75435
75441
|
type: "search",
|
|
75436
75442
|
placeholder: searchPlaceholder,
|
|
75437
|
-
className: "w-64 pl-9 pr-4 h-9",
|
|
75443
|
+
className: "w-64 pl-9 pr-4 h-9 cursor-pointer",
|
|
75438
75444
|
value: searchValue,
|
|
75439
|
-
onChange: (e) => handleSearch(e.target.value)
|
|
75445
|
+
onChange: (e) => handleSearch(e.target.value),
|
|
75446
|
+
onClick: () => {
|
|
75447
|
+
if (enableCommandAI) {
|
|
75448
|
+
setIsCommandOpen(true);
|
|
75449
|
+
onCommandAIOpen?.();
|
|
75450
|
+
}
|
|
75451
|
+
},
|
|
75452
|
+
readOnly: enableCommandAI
|
|
75440
75453
|
}
|
|
75441
75454
|
),
|
|
75442
|
-
keyboardShortcuts && /* @__PURE__ */
|
|
75455
|
+
(keyboardShortcuts || enableCommandAI) && /* @__PURE__ */ jsx("kbd", { className: "absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 hidden sm:flex", children: enableCommandAI ? commandAIShortcut : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75443
75456
|
/* @__PURE__ */ jsx("span", { className: "text-xs", children: "\u2318" }),
|
|
75444
75457
|
"K"
|
|
75445
|
-
] })
|
|
75458
|
+
] }) })
|
|
75446
75459
|
] }) }),
|
|
75447
75460
|
showThemeToggle && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
75448
75461
|
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "ghost", size: "icon", children: [
|
|
@@ -75560,34 +75573,52 @@ function NavbarInternal({
|
|
|
75560
75573
|
}
|
|
75561
75574
|
) })
|
|
75562
75575
|
] }),
|
|
75563
|
-
/* @__PURE__ */ jsxs(
|
|
75564
|
-
|
|
75565
|
-
|
|
75566
|
-
|
|
75567
|
-
|
|
75568
|
-
|
|
75569
|
-
|
|
75570
|
-
|
|
75571
|
-
|
|
75572
|
-
|
|
75573
|
-
|
|
75574
|
-
|
|
75575
|
-
|
|
75576
|
-
|
|
75577
|
-
|
|
75578
|
-
|
|
75579
|
-
|
|
75580
|
-
|
|
75581
|
-
|
|
75582
|
-
|
|
75583
|
-
|
|
75584
|
-
|
|
75585
|
-
|
|
75586
|
-
|
|
75587
|
-
|
|
75588
|
-
|
|
75589
|
-
|
|
75590
|
-
|
|
75576
|
+
/* @__PURE__ */ jsxs(
|
|
75577
|
+
MoonUICommandDialogPro,
|
|
75578
|
+
{
|
|
75579
|
+
open: isCommandOpen,
|
|
75580
|
+
onOpenChange: (open) => {
|
|
75581
|
+
setIsCommandOpen(open);
|
|
75582
|
+
if (!open) {
|
|
75583
|
+
onCommandAIClose?.();
|
|
75584
|
+
}
|
|
75585
|
+
},
|
|
75586
|
+
children: [
|
|
75587
|
+
/* @__PURE__ */ jsx(
|
|
75588
|
+
MoonUICommandInputPro,
|
|
75589
|
+
{
|
|
75590
|
+
placeholder: enableCommandAI ? commandAIPlaceholder : searchPlaceholder,
|
|
75591
|
+
value: searchValue,
|
|
75592
|
+
onValueChange: handleSearch
|
|
75593
|
+
}
|
|
75594
|
+
),
|
|
75595
|
+
/* @__PURE__ */ jsxs(MoonUICommandListPro, { children: [
|
|
75596
|
+
/* @__PURE__ */ jsx(MoonUICommandEmptyPro, { children: "No results found." }),
|
|
75597
|
+
sections.map((section) => /* @__PURE__ */ jsx(MoonUICommandGroupPro, { heading: enableCommandAI ? "Commands" : void 0, children: section.items.map((item) => /* @__PURE__ */ jsxs(
|
|
75598
|
+
MoonUICommandItemPro,
|
|
75599
|
+
{
|
|
75600
|
+
disabled: item.disabled,
|
|
75601
|
+
onSelect: () => {
|
|
75602
|
+
if (enableCommandAI) {
|
|
75603
|
+
onCommandAISelect?.(item);
|
|
75604
|
+
}
|
|
75605
|
+
handleItemClick(item);
|
|
75606
|
+
setIsCommandOpen(false);
|
|
75607
|
+
},
|
|
75608
|
+
children: [
|
|
75609
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
75610
|
+
item.icon && /* @__PURE__ */ jsx("span", { children: item.icon }),
|
|
75611
|
+
item.title
|
|
75612
|
+
] }),
|
|
75613
|
+
item.description && enableCommandAI && /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: item.description })
|
|
75614
|
+
]
|
|
75615
|
+
},
|
|
75616
|
+
item.id
|
|
75617
|
+
)) }, section.id))
|
|
75618
|
+
] })
|
|
75619
|
+
]
|
|
75620
|
+
}
|
|
75621
|
+
)
|
|
75591
75622
|
] });
|
|
75592
75623
|
}
|
|
75593
75624
|
function Navbar(props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.19",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|