@moontra/moonui-pro 2.25.14 → 2.25.16

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.mjs CHANGED
@@ -8594,8 +8594,6 @@ function toast({ ...props }) {
8594
8594
  update
8595
8595
  };
8596
8596
  }
8597
-
8598
- // ../../node_modules/@radix-ui/primitive/dist/index.mjs
8599
8597
  function composeEventHandlers2(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
8600
8598
  return function handleEvent(event) {
8601
8599
  originalEventHandler?.(event);
@@ -9925,15 +9923,9 @@ function getWindowScrollBarX(element, rect) {
9925
9923
  }
9926
9924
  return rect.left + leftScroll;
9927
9925
  }
9928
- function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
9929
- if (ignoreScrollbarX === void 0) {
9930
- ignoreScrollbarX = false;
9931
- }
9926
+ function getHTMLOffset(documentElement, scroll) {
9932
9927
  const htmlRect = documentElement.getBoundingClientRect();
9933
- const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
9934
- // RTL <body> scrollbar.
9935
- getWindowScrollBarX(documentElement, htmlRect)
9936
- ));
9928
+ const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
9937
9929
  const y = htmlRect.top + scroll.scrollTop;
9938
9930
  return {
9939
9931
  x,
@@ -9971,7 +9963,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
9971
9963
  offsets.y = offsetRect.y + offsetParent.clientTop;
9972
9964
  }
9973
9965
  }
9974
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
9966
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
9975
9967
  return {
9976
9968
  width: rect.width * scale.x,
9977
9969
  height: rect.height * scale.y,
@@ -10000,6 +9992,7 @@ function getDocumentRect(element) {
10000
9992
  y
10001
9993
  };
10002
9994
  }
9995
+ var SCROLLBAR_MAX = 25;
10003
9996
  function getViewportRect(element, strategy) {
10004
9997
  const win = getWindow(element);
10005
9998
  const html = getDocumentElement(element);
@@ -10017,6 +10010,19 @@ function getViewportRect(element, strategy) {
10017
10010
  y = visualViewport.offsetTop;
10018
10011
  }
10019
10012
  }
10013
+ const windowScrollbarX = getWindowScrollBarX(html);
10014
+ if (windowScrollbarX <= 0) {
10015
+ const doc3 = html.ownerDocument;
10016
+ const body = doc3.body;
10017
+ const bodyStyles = getComputedStyle(body);
10018
+ const bodyMarginInline = doc3.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
10019
+ const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
10020
+ if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
10021
+ width -= clippingStableScrollbarWidth;
10022
+ }
10023
+ } else if (windowScrollbarX <= SCROLLBAR_MAX) {
10024
+ width += windowScrollbarX;
10025
+ }
10020
10026
  return {
10021
10027
  width,
10022
10028
  height,
@@ -10759,8 +10765,13 @@ var PopperAnchor = t.forwardRef(
10759
10765
  const context = usePopperContext(ANCHOR_NAME, __scopePopper);
10760
10766
  const ref = t.useRef(null);
10761
10767
  const composedRefs = useComposedRefs2(forwardedRef, ref);
10768
+ const anchorRef = t.useRef(null);
10762
10769
  t.useEffect(() => {
10763
- context.onAnchorChange(virtualRef?.current || ref.current);
10770
+ const previousAnchor = anchorRef.current;
10771
+ anchorRef.current = virtualRef?.current || ref.current;
10772
+ if (previousAnchor !== anchorRef.current) {
10773
+ context.onAnchorChange(anchorRef.current);
10774
+ }
10764
10775
  });
10765
10776
  return virtualRef ? null : /* @__PURE__ */ jsx(Primitive2.div, { ...anchorProps, ref: composedRefs });
10766
10777
  }
@@ -11083,7 +11094,7 @@ function usePresence2(present) {
11083
11094
  const ownerWindow = node.ownerDocument.defaultView ?? window;
11084
11095
  const handleAnimationEnd = (event) => {
11085
11096
  const currentAnimationName = getAnimationName2(stylesRef.current);
11086
- const isCurrentAnimation = currentAnimationName.includes(event.animationName);
11097
+ const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
11087
11098
  if (event.target === node && isCurrentAnimation) {
11088
11099
  send("ANIMATION_END");
11089
11100
  if (!prevPresentRef.current) {
@@ -16543,21 +16554,21 @@ function CalendarInternal({
16543
16554
  return actualDay !== 0 && actualDay !== 6;
16544
16555
  });
16545
16556
  return /* @__PURE__ */ jsxs(Fragment, { children: [
16546
- /* @__PURE__ */ jsxs("div", { className: cn("w-full flex relative", className), style: { height: height ? `${height}px` : void 0 }, children: [
16557
+ /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full", className), style: { height: height ? `${height}px` : "900px" }, children: /* @__PURE__ */ jsxs("div", { className: "flex relative h-full", children: [
16547
16558
  isSidebarOpen && /* @__PURE__ */ jsx(
16548
16559
  "div",
16549
16560
  {
16550
- className: "fixed inset-0 bg-black/50 z-40 lg:hidden",
16561
+ className: "absolute inset-0 bg-black/50 z-40 lg:hidden",
16551
16562
  onClick: () => setIsSidebarOpen(false)
16552
16563
  }
16553
16564
  ),
16554
16565
  /* @__PURE__ */ jsx("aside", { className: cn(
16555
- "bg-card border-r transition-all duration-300 flex-shrink-0 overflow-hidden",
16556
- // Mobile styles
16557
- "fixed inset-y-0 left-0 z-50 lg:relative lg:inset-auto",
16558
- isSidebarOpen ? "translate-x-0" : "-translate-x-full lg:translate-x-0",
16559
- // Desktop styles
16560
- isDesktopSidebarCollapsed ? "lg:w-0" : "lg:w-64"
16566
+ "bg-card border-r transition-all duration-300 flex-shrink-0",
16567
+ // Desktop styles - always visible on desktop
16568
+ isDesktopSidebarCollapsed ? "w-0" : "w-64",
16569
+ // Mobile styles - slide in/out
16570
+ "lg:relative",
16571
+ isSidebarOpen ? "absolute inset-y-0 left-0 z-50 w-64" : "hidden lg:block"
16561
16572
  ), children: /* @__PURE__ */ jsxs("div", { className: "w-64 h-full flex flex-col", children: [
16562
16573
  /* @__PURE__ */ jsx("div", { className: "p-4 border-b", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
16563
16574
  /* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm", children: "Calendar" }),
@@ -16654,7 +16665,7 @@ function CalendarInternal({
16654
16665
  ) })
16655
16666
  ] })
16656
16667
  ] }) }),
16657
- /* @__PURE__ */ jsxs(MoonUICardPro, { className: "flex-1 border-0 rounded-none", children: [
16668
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col min-h-0", children: [
16658
16669
  /* @__PURE__ */ jsx(MoonUICardHeaderPro, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
16659
16670
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
16660
16671
  /* @__PURE__ */ jsx(
@@ -16709,8 +16720,8 @@ function CalendarInternal({
16709
16720
  )
16710
16721
  ] })
16711
16722
  ] }) }),
16712
- /* @__PURE__ */ jsx(MoonUICardContentPro, { children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
16713
- view === "month" && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-7 gap-1 w-full", children: [
16723
+ /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "flex-1 overflow-auto p-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4 h-full", children: [
16724
+ view === "month" && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-7 gap-1 w-full h-full auto-rows-fr", children: [
16714
16725
  visibleDaysOfWeek.map((day) => /* @__PURE__ */ jsx("div", { className: "p-1 text-center text-xs font-medium text-muted-foreground", children: day }, day)),
16715
16726
  filteredDays.map((date, index2) => {
16716
16727
  const dayEvents = getEventsForDate(date);
@@ -16722,7 +16733,7 @@ function CalendarInternal({
16722
16733
  "div",
16723
16734
  {
16724
16735
  className: cn(
16725
- "min-h-[80px] p-1 border border-border/50 cursor-pointer hover:bg-muted/50 transition-colors text-xs flex flex-col",
16736
+ "h-full min-h-[140px] p-2 border border-border/50 cursor-pointer hover:bg-muted/50 transition-colors text-xs flex flex-col",
16726
16737
  !isCurrentMonthDate && "text-muted-foreground bg-muted/20",
16727
16738
  isTodayDate && highlightToday && "bg-primary/10 border-primary/50",
16728
16739
  isSelectedDate && "bg-primary/20 border-primary",
@@ -16744,67 +16755,60 @@ function CalendarInternal({
16744
16755
  ] }),
16745
16756
  dayEvents.length > 0 && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs px-1", children: dayEvents.length })
16746
16757
  ] }),
16747
- /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-1 overflow-hidden", children: [
16748
- dayEvents.slice(0, 3).map((event) => /* @__PURE__ */ jsxs(
16749
- "div",
16750
- {
16751
- className: cn(
16752
- "text-xs p-1 mb-1 rounded text-white cursor-move group relative select-none block w-full truncate",
16753
- event.color || EVENT_COLORS[event.type || "event"],
16754
- event.priority && PRIORITY_COLORS[event.priority],
16755
- event.status && STATUS_STYLES[event.status]
16756
- ),
16757
- draggable: !disabled && enableDragDrop,
16758
- onClick: (e) => handleEventClick(event, e),
16759
- onDragStart: (e) => handleEventDragStart(event, e),
16760
- onDragEnd: handleEventDragEnd,
16761
- style: {
16762
- backgroundColor: event.color || void 0
16763
- },
16764
- children: [
16765
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
16766
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 flex-1 min-w-0", children: [
16767
- event.isPrivate && /* @__PURE__ */ jsx(Lock, { className: "h-3 w-3 flex-shrink-0" }),
16768
- event.recurring && /* @__PURE__ */ jsx(Repeat, { className: "h-3 w-3 flex-shrink-0" }),
16769
- /* @__PURE__ */ jsx("span", { className: "truncate", children: event.title })
16770
- ] }),
16771
- showEventDetails && /* @__PURE__ */ jsxs("div", { className: "hidden group-hover:flex items-center gap-1 ml-1", children: [
16772
- /* @__PURE__ */ jsx(
16773
- MoonUIButtonPro,
16774
- {
16775
- variant: "ghost",
16776
- size: "sm",
16777
- className: "h-4 w-4 p-0 text-white/80 hover:text-white",
16778
- onClick: (e) => handleEventEdit(event, e),
16779
- children: /* @__PURE__ */ jsx(Edit, { className: "h-3 w-3" })
16780
- }
16781
- ),
16782
- /* @__PURE__ */ jsx(
16783
- MoonUIButtonPro,
16784
- {
16785
- variant: "ghost",
16786
- size: "sm",
16787
- className: "h-4 w-4 p-0 text-white/80 hover:text-white",
16788
- onClick: (e) => handleEventDelete(event, e),
16789
- children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
16790
- }
16791
- )
16792
- ] })
16758
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto custom-scrollbar space-y-0.5", children: dayEvents.map((event) => /* @__PURE__ */ jsxs(
16759
+ "div",
16760
+ {
16761
+ className: cn(
16762
+ "text-[11px] px-1.5 py-0.5 rounded text-white cursor-move group relative select-none block w-full truncate",
16763
+ event.color || EVENT_COLORS[event.type || "event"],
16764
+ event.priority && PRIORITY_COLORS[event.priority],
16765
+ event.status && STATUS_STYLES[event.status]
16766
+ ),
16767
+ draggable: !disabled && enableDragDrop,
16768
+ onClick: (e) => handleEventClick(event, e),
16769
+ onDragStart: (e) => handleEventDragStart(event, e),
16770
+ onDragEnd: handleEventDragEnd,
16771
+ style: {
16772
+ backgroundColor: event.color || void 0
16773
+ },
16774
+ children: [
16775
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
16776
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 flex-1 min-w-0", children: [
16777
+ event.isPrivate && /* @__PURE__ */ jsx(Lock, { className: "h-3 w-3 flex-shrink-0" }),
16778
+ event.recurring && /* @__PURE__ */ jsx(Repeat, { className: "h-3 w-3 flex-shrink-0" }),
16779
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: event.title })
16793
16780
  ] }),
16794
- event.startTime && !compactMode && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 mt-1", children: [
16795
- /* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }),
16796
- /* @__PURE__ */ jsx("span", { className: "text-[10px]", children: formatTime2(event.startTime) })
16781
+ showEventDetails && /* @__PURE__ */ jsxs("div", { className: "hidden group-hover:flex items-center gap-1 ml-1", children: [
16782
+ /* @__PURE__ */ jsx(
16783
+ MoonUIButtonPro,
16784
+ {
16785
+ variant: "ghost",
16786
+ size: "sm",
16787
+ className: "h-4 w-4 p-0 text-white/80 hover:text-white",
16788
+ onClick: (e) => handleEventEdit(event, e),
16789
+ children: /* @__PURE__ */ jsx(Edit, { className: "h-3 w-3" })
16790
+ }
16791
+ ),
16792
+ /* @__PURE__ */ jsx(
16793
+ MoonUIButtonPro,
16794
+ {
16795
+ variant: "ghost",
16796
+ size: "sm",
16797
+ className: "h-4 w-4 p-0 text-white/80 hover:text-white",
16798
+ onClick: (e) => handleEventDelete(event, e),
16799
+ children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
16800
+ }
16801
+ )
16797
16802
  ] })
16798
- ]
16799
- },
16800
- event.id
16801
- )),
16802
- dayEvents.length > 3 && /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground text-center", children: [
16803
- "+",
16804
- dayEvents.length - 3,
16805
- " more"
16806
- ] })
16807
- ] })
16803
+ ] }),
16804
+ event.startTime && !compactMode && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 mt-1", children: [
16805
+ /* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }),
16806
+ /* @__PURE__ */ jsx("span", { className: "text-[10px]", children: formatTime2(event.startTime) })
16807
+ ] })
16808
+ ]
16809
+ },
16810
+ event.id
16811
+ )) })
16808
16812
  ]
16809
16813
  },
16810
16814
  index2
@@ -17094,7 +17098,7 @@ function CalendarInternal({
17094
17098
  ] })
17095
17099
  ] }) })
17096
17100
  ] })
17097
- ] }),
17101
+ ] }) }),
17098
17102
  /* @__PURE__ */ jsx(
17099
17103
  EventDialog,
17100
17104
  {
@@ -32986,12 +32990,17 @@ function run2(config) {
32986
32990
  });
32987
32991
  const handlers2 = [];
32988
32992
  state.doc.nodesBetween(from2, to, (node, pos) => {
32989
- if (!node.isTextblock || node.type.spec.code) {
32993
+ var _a2, _b, _c, _d, _e2;
32994
+ if (((_b = (_a2 = node.type) == null ? void 0 : _a2.spec) == null ? void 0 : _b.code) || !(node.isText || node.isTextblock || node.isInline)) {
32990
32995
  return;
32991
32996
  }
32997
+ const contentSize = (_e2 = (_d = (_c = node.content) == null ? void 0 : _c.size) != null ? _d : node.nodeSize) != null ? _e2 : 0;
32992
32998
  const resolvedFrom = Math.max(from2, pos);
32993
- const resolvedTo = Math.min(to, pos + node.content.size);
32994
- const textToMatch = node.textBetween(resolvedFrom - pos, resolvedTo - pos, void 0, "\uFFFC");
32999
+ const resolvedTo = Math.min(to, pos + contentSize);
33000
+ if (resolvedFrom >= resolvedTo) {
33001
+ return;
33002
+ }
33003
+ const textToMatch = node.isText ? node.text || "" : node.textBetween(resolvedFrom - pos, resolvedTo - pos, void 0, "\uFFFC");
32995
33004
  const matches2 = pasteRuleMatcherHandler(textToMatch, rule.find, pasteEvent);
32996
33005
  matches2.forEach((match) => {
32997
33006
  if (match.index === void 0) {
@@ -33206,8 +33215,6 @@ var ExtensionManager = class {
33206
33215
  get plugins() {
33207
33216
  const { editor } = this;
33208
33217
  const extensions = sortExtensions([...this.extensions].reverse());
33209
- const inputRules = [];
33210
- const pasteRules = [];
33211
33218
  const allPlugins = extensions.map((extension) => {
33212
33219
  const context = {
33213
33220
  name: extension.name,
@@ -33238,11 +33245,23 @@ var ExtensionManager = class {
33238
33245
  plugins.push(keyMapPlugin);
33239
33246
  const addInputRules = getExtensionField(extension, "addInputRules", context);
33240
33247
  if (isExtensionRulesEnabled(extension, editor.options.enableInputRules) && addInputRules) {
33241
- inputRules.push(...addInputRules());
33248
+ const rules = addInputRules();
33249
+ if (rules && rules.length) {
33250
+ const inputResult = inputRulesPlugin({
33251
+ editor,
33252
+ rules
33253
+ });
33254
+ const inputPlugins = Array.isArray(inputResult) ? inputResult : [inputResult];
33255
+ plugins.push(...inputPlugins);
33256
+ }
33242
33257
  }
33243
33258
  const addPasteRules = getExtensionField(extension, "addPasteRules", context);
33244
33259
  if (isExtensionRulesEnabled(extension, editor.options.enablePasteRules) && addPasteRules) {
33245
- pasteRules.push(...addPasteRules());
33260
+ const rules = addPasteRules();
33261
+ if (rules && rules.length) {
33262
+ const pasteRules = pasteRulesPlugin({ editor, rules });
33263
+ plugins.push(...pasteRules);
33264
+ }
33246
33265
  }
33247
33266
  const addProseMirrorPlugins = getExtensionField(
33248
33267
  extension,
@@ -33255,17 +33274,7 @@ var ExtensionManager = class {
33255
33274
  }
33256
33275
  return plugins;
33257
33276
  }).flat();
33258
- return [
33259
- inputRulesPlugin({
33260
- editor,
33261
- rules: inputRules
33262
- }),
33263
- ...pasteRulesPlugin({
33264
- editor,
33265
- rules: pasteRules
33266
- }),
33267
- ...allPlugins
33268
- ];
33277
+ return allPlugins;
33269
33278
  }
33270
33279
  /**
33271
33280
  * Get all attributes from the extensions.
@@ -34067,7 +34076,8 @@ function canSetMark(state, tr2, newMarkType) {
34067
34076
  }
34068
34077
  if (cursor) {
34069
34078
  const currentMarks = (_a2 = state.storedMarks) != null ? _a2 : cursor.marks();
34070
- return !!newMarkType.isInSet(currentMarks) || !currentMarks.some((mark) => mark.type.excludes(newMarkType));
34079
+ const parentAllowsMarkType = cursor.parent.type.allowsMarkType(newMarkType);
34080
+ return parentAllowsMarkType && (!!newMarkType.isInSet(currentMarks) || !currentMarks.some((mark) => mark.type.excludes(newMarkType)));
34071
34081
  }
34072
34082
  const { ranges } = selection;
34073
34083
  return ranges.some(({ $from, $to }) => {
@@ -35167,6 +35177,8 @@ var Editor = class extends EventEmitter {
35167
35177
  emitContentError: false,
35168
35178
  onBeforeCreate: () => null,
35169
35179
  onCreate: () => null,
35180
+ onMount: () => null,
35181
+ onUnmount: () => null,
35170
35182
  onUpdate: () => null,
35171
35183
  onSelectionUpdate: () => null,
35172
35184
  onTransaction: () => null,
@@ -35188,6 +35200,8 @@ var Editor = class extends EventEmitter {
35188
35200
  this.createSchema();
35189
35201
  this.on("beforeCreate", this.options.onBeforeCreate);
35190
35202
  this.emit("beforeCreate", { editor: this });
35203
+ this.on("mount", this.options.onMount);
35204
+ this.on("unmount", this.options.onUnmount);
35191
35205
  this.on("contentError", this.options.onContentError);
35192
35206
  this.on("create", this.options.onCreate);
35193
35207
  this.on("update", this.options.onUpdate);
@@ -35220,6 +35234,7 @@ var Editor = class extends EventEmitter {
35220
35234
  );
35221
35235
  }
35222
35236
  this.createView(el);
35237
+ this.emit("mount", { editor: this });
35223
35238
  window.setTimeout(() => {
35224
35239
  if (this.isDestroyed) {
35225
35240
  return;
@@ -35233,7 +35248,6 @@ var Editor = class extends EventEmitter {
35233
35248
  * Remove the editor from the DOM, but still allow remounting at a different point in time
35234
35249
  */
35235
35250
  unmount() {
35236
- var _a2;
35237
35251
  if (this.editorView) {
35238
35252
  const dom = this.editorView.dom;
35239
35253
  if (dom == null ? void 0 : dom.editor) {
@@ -35243,8 +35257,19 @@ var Editor = class extends EventEmitter {
35243
35257
  }
35244
35258
  this.editorView = null;
35245
35259
  this.isInitialized = false;
35246
- (_a2 = this.css) == null ? void 0 : _a2.remove();
35260
+ if (this.css) {
35261
+ try {
35262
+ if (typeof this.css.remove === "function") {
35263
+ this.css.remove();
35264
+ } else if (this.css.parentNode) {
35265
+ this.css.parentNode.removeChild(this.css);
35266
+ }
35267
+ } catch (error) {
35268
+ console.warn("Failed to remove CSS element:", error);
35269
+ }
35270
+ }
35247
35271
  this.css = null;
35272
+ this.emit("unmount", { editor: this });
35248
35273
  }
35249
35274
  /**
35250
35275
  * Returns the editor storage.
@@ -36570,7 +36595,7 @@ var Bold = Mark2.create({
36570
36595
  });
36571
36596
 
36572
36597
  // ../../node_modules/@tiptap/extension-code/dist/index.js
36573
- var inputRegex2 = /(^|[^`])`([^`]+)`(?!`)/;
36598
+ var inputRegex2 = /(^|[^`])`([^`]+)`(?!`)$/;
36574
36599
  var pasteRegex = /(^|[^`])`([^`]+)`(?!`)/g;
36575
36600
  var Code = Mark2.create({
36576
36601
  name: "code",
@@ -36635,6 +36660,8 @@ var CodeBlock = Node3.create({
36635
36660
  exitOnTripleEnter: true,
36636
36661
  exitOnArrowDown: true,
36637
36662
  defaultLanguage: null,
36663
+ enableTabIndentation: false,
36664
+ tabSize: 4,
36638
36665
  HTMLAttributes: {}
36639
36666
  };
36640
36667
  },
@@ -36708,6 +36735,91 @@ var CodeBlock = Node3.create({
36708
36735
  }
36709
36736
  return false;
36710
36737
  },
36738
+ // handle tab indentation
36739
+ Tab: ({ editor }) => {
36740
+ if (!this.options.enableTabIndentation) {
36741
+ return false;
36742
+ }
36743
+ const { state } = editor;
36744
+ const { selection } = state;
36745
+ const { $from, empty: empty2 } = selection;
36746
+ if ($from.parent.type !== this.type) {
36747
+ return false;
36748
+ }
36749
+ const indent = " ".repeat(this.options.tabSize);
36750
+ if (empty2) {
36751
+ return editor.commands.insertContent(indent);
36752
+ }
36753
+ return editor.commands.command(({ tr: tr2 }) => {
36754
+ const { from: from2, to } = selection;
36755
+ const text = state.doc.textBetween(from2, to, "\n", "\n");
36756
+ const lines = text.split("\n");
36757
+ const indentedText = lines.map((line) => indent + line).join("\n");
36758
+ tr2.replaceWith(from2, to, state.schema.text(indentedText));
36759
+ return true;
36760
+ });
36761
+ },
36762
+ // handle shift+tab reverse indentation
36763
+ "Shift-Tab": ({ editor }) => {
36764
+ if (!this.options.enableTabIndentation) {
36765
+ return false;
36766
+ }
36767
+ const { state } = editor;
36768
+ const { selection } = state;
36769
+ const { $from, empty: empty2 } = selection;
36770
+ if ($from.parent.type !== this.type) {
36771
+ return false;
36772
+ }
36773
+ if (empty2) {
36774
+ return editor.commands.command(({ tr: tr2 }) => {
36775
+ var _a2;
36776
+ const { pos } = $from;
36777
+ const codeBlockStart = $from.start();
36778
+ const codeBlockEnd = $from.end();
36779
+ const allText = state.doc.textBetween(codeBlockStart, codeBlockEnd, "\n", "\n");
36780
+ const lines = allText.split("\n");
36781
+ let currentLineIndex = 0;
36782
+ let charCount = 0;
36783
+ const relativeCursorPos = pos - codeBlockStart;
36784
+ for (let i = 0; i < lines.length; i += 1) {
36785
+ if (charCount + lines[i].length >= relativeCursorPos) {
36786
+ currentLineIndex = i;
36787
+ break;
36788
+ }
36789
+ charCount += lines[i].length + 1;
36790
+ }
36791
+ const currentLine = lines[currentLineIndex];
36792
+ const leadingSpaces = ((_a2 = currentLine.match(/^ */)) == null ? void 0 : _a2[0]) || "";
36793
+ const spacesToRemove = Math.min(leadingSpaces.length, this.options.tabSize);
36794
+ if (spacesToRemove === 0) {
36795
+ return true;
36796
+ }
36797
+ let lineStartPos = codeBlockStart;
36798
+ for (let i = 0; i < currentLineIndex; i += 1) {
36799
+ lineStartPos += lines[i].length + 1;
36800
+ }
36801
+ tr2.delete(lineStartPos, lineStartPos + spacesToRemove);
36802
+ const cursorPosInLine = pos - lineStartPos;
36803
+ if (cursorPosInLine <= spacesToRemove) {
36804
+ tr2.setSelection(TextSelection.create(tr2.doc, lineStartPos));
36805
+ }
36806
+ return true;
36807
+ });
36808
+ }
36809
+ return editor.commands.command(({ tr: tr2 }) => {
36810
+ const { from: from2, to } = selection;
36811
+ const text = state.doc.textBetween(from2, to, "\n", "\n");
36812
+ const lines = text.split("\n");
36813
+ const reverseIndentText = lines.map((line) => {
36814
+ var _a2;
36815
+ const leadingSpaces = ((_a2 = line.match(/^ */)) == null ? void 0 : _a2[0]) || "";
36816
+ const spacesToRemove = Math.min(leadingSpaces.length, this.options.tabSize);
36817
+ return line.slice(spacesToRemove);
36818
+ }).join("\n");
36819
+ tr2.replaceWith(from2, to, state.schema.text(reverseIndentText));
36820
+ return true;
36821
+ });
36822
+ },
36711
36823
  // exit node on triple enter
36712
36824
  Enter: ({ editor }) => {
36713
36825
  if (!this.options.exitOnTripleEnter) {
@@ -43708,6 +43820,20 @@ var BackgroundColor = Extension.create({
43708
43820
  default: null,
43709
43821
  parseHTML: (element) => {
43710
43822
  var _a2;
43823
+ const styleAttr = element.getAttribute("style");
43824
+ if (styleAttr) {
43825
+ const decls = styleAttr.split(";").map((s) => s.trim()).filter(Boolean);
43826
+ for (let i = decls.length - 1; i >= 0; i -= 1) {
43827
+ const parts = decls[i].split(":");
43828
+ if (parts.length >= 2) {
43829
+ const prop = parts[0].trim().toLowerCase();
43830
+ const val = parts.slice(1).join(":").trim();
43831
+ if (prop === "background-color") {
43832
+ return val.replace(/['"]+/g, "");
43833
+ }
43834
+ }
43835
+ }
43836
+ }
43711
43837
  return (_a2 = element.style.backgroundColor) == null ? void 0 : _a2.replace(/['"]+/g, "");
43712
43838
  },
43713
43839
  renderHTML: (attributes) => {
@@ -43750,6 +43876,20 @@ var Color = Extension.create({
43750
43876
  default: null,
43751
43877
  parseHTML: (element) => {
43752
43878
  var _a2;
43879
+ const styleAttr = element.getAttribute("style");
43880
+ if (styleAttr) {
43881
+ const decls = styleAttr.split(";").map((s) => s.trim()).filter(Boolean);
43882
+ for (let i = decls.length - 1; i >= 0; i -= 1) {
43883
+ const parts = decls[i].split(":");
43884
+ if (parts.length >= 2) {
43885
+ const prop = parts[0].trim().toLowerCase();
43886
+ const val = parts.slice(1).join(":").trim();
43887
+ if (prop === "color") {
43888
+ return val.replace(/['"]+/g, "");
43889
+ }
43890
+ }
43891
+ }
43892
+ }
43753
43893
  return (_a2 = element.style.color) == null ? void 0 : _a2.replace(/['"]+/g, "");
43754
43894
  },
43755
43895
  renderHTML: (attributes) => {
@@ -44242,6 +44382,8 @@ var CodeBlockLowlight = index_default.extend({
44242
44382
  exitOnTripleEnter: true,
44243
44383
  exitOnArrowDown: true,
44244
44384
  defaultLanguage: null,
44385
+ enableTabIndentation: false,
44386
+ tabSize: 4,
44245
44387
  HTMLAttributes: {}
44246
44388
  };
44247
44389
  },
@@ -62520,7 +62662,8 @@ function AdvancedChartInternal({
62520
62662
  showTooltip && /* @__PURE__ */ jsx(
62521
62663
  Tooltip,
62522
62664
  {
62523
- cursor: { fill: darkMode ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.05)" }
62665
+ cursor: { fill: darkMode ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.05)" },
62666
+ content: customTooltip ? customTooltip : CustomTooltip
62524
62667
  }
62525
62668
  ),
62526
62669
  showLegend && /* @__PURE__ */ jsx(
@@ -62592,7 +62735,12 @@ function AdvancedChartInternal({
62592
62735
  axisLine: { stroke: darkMode ? "#4b5563" : "#d1d5db" }
62593
62736
  }
62594
62737
  ),
62595
- showTooltip && /* @__PURE__ */ jsx(Tooltip, {}),
62738
+ showTooltip && /* @__PURE__ */ jsx(
62739
+ Tooltip,
62740
+ {
62741
+ content: customTooltip ? customTooltip : CustomTooltip
62742
+ }
62743
+ ),
62596
62744
  showLegend && /* @__PURE__ */ jsx(
62597
62745
  Legend,
62598
62746
  {
@@ -62723,7 +62871,12 @@ function AdvancedChartInternal({
62723
62871
  axisLine: { stroke: darkMode ? "#4b5563" : "#d1d5db" }
62724
62872
  }
62725
62873
  ),
62726
- showTooltip && /* @__PURE__ */ jsx(Tooltip, {}),
62874
+ showTooltip && /* @__PURE__ */ jsx(
62875
+ Tooltip,
62876
+ {
62877
+ content: customTooltip ? customTooltip : CustomTooltip
62878
+ }
62879
+ ),
62727
62880
  showLegend && /* @__PURE__ */ jsx(
62728
62881
  Legend,
62729
62882
  {
@@ -78452,10 +78605,10 @@ var cardVariants = cva(
78452
78605
  glass: "border border-white/20 bg-white/10 backdrop-blur-md dark:border-gray-700/30 dark:bg-gray-800/10"
78453
78606
  },
78454
78607
  size: {
78455
- default: "p-6",
78456
- sm: "p-4",
78457
- lg: "p-8",
78458
- xl: "p-10"
78608
+ default: "",
78609
+ sm: "",
78610
+ lg: "",
78611
+ xl: ""
78459
78612
  },
78460
78613
  radius: {
78461
78614
  default: "rounded-lg",
@@ -78508,7 +78661,7 @@ var CardHeader = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
78508
78661
  "div",
78509
78662
  {
78510
78663
  ref,
78511
- className: cn2("moonui-theme", "flex flex-col space-y-1.5", className),
78664
+ className: cn2("moonui-theme", "flex flex-col space-y-1.5 p-6", className),
78512
78665
  ...props
78513
78666
  }
78514
78667
  ));
@@ -78531,13 +78684,13 @@ var CardDescription2 = t.forwardRef(({ className, ...props }, ref) => /* @__PURE
78531
78684
  }
78532
78685
  ));
78533
78686
  CardDescription2.displayName = "CardDescription";
78534
- var CardContent = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn2("moonui-theme", "pt-0", className), ...props }));
78687
+ var CardContent = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn2("moonui-theme", "p-6 pt-0", className), ...props }));
78535
78688
  CardContent.displayName = "CardContent";
78536
78689
  var CardFooter = t.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
78537
78690
  "div",
78538
78691
  {
78539
78692
  ref,
78540
- className: cn2("moonui-theme", "flex items-center pt-4", className),
78693
+ className: cn2("moonui-theme", "flex items-center p-6 pt-0", className),
78541
78694
  ...props
78542
78695
  }
78543
78696
  ));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.25.14",
3
+ "version": "2.25.16",
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",