@bigbinary/neeto-editor 1.47.113 → 1.47.115

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.
@@ -179,22 +179,26 @@ var CALLOUT_TYPES = [{
179
179
  type: "info",
180
180
  label: i18n.t("neetoEditor.menu.calloutInfo"),
181
181
  icon: lucideReact.Info,
182
- bgColor: "--neeto-editor-info-100"
182
+ bgColor: "--neeto-editor-info-100",
183
+ iconColor: "var(--ne-editor-content-callout-info-foreground-color)"
183
184
  }, {
184
185
  type: "warning",
185
186
  label: i18n.t("neetoEditor.menu.calloutWarning"),
186
187
  icon: lucideReact.AlertTriangle,
187
- bgColor: "--neeto-editor-warning-100"
188
+ bgColor: "--neeto-editor-warning-100",
189
+ iconColor: "var(--ne-editor-content-callout-warning-foreground-color)"
188
190
  }, {
189
191
  type: "error",
190
192
  label: i18n.t("neetoEditor.menu.calloutError"),
191
193
  icon: lucideReact.AlertOctagon,
192
- bgColor: "--neeto-editor-error-100"
194
+ bgColor: "--neeto-editor-error-100",
195
+ iconColor: "var(--ne-editor-content-callout-error-foreground-color)"
193
196
  }, {
194
197
  type: "success",
195
198
  label: i18n.t("neetoEditor.menu.calloutSuccess"),
196
199
  icon: lucideReact.CheckCircle2,
197
- bgColor: "--neeto-editor-success-100"
200
+ bgColor: "--neeto-editor-success-100",
201
+ iconColor: "var(--ne-editor-content-callout-success-foreground-color)"
198
202
  }];
199
203
 
200
204
  function ownKeys$b(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -292,19 +296,6 @@ var validateUrl = function validateUrl(url) {
292
296
  return false;
293
297
  };
294
298
 
295
- var MenuItem$4 = neetoAtoms.DropdownMenu.MenuItem;
296
- var SecondaryMenuTarget = function SecondaryMenuTarget(_ref) {
297
- var Icon = _ref.icon,
298
- label = _ref.label;
299
- return /*#__PURE__*/jsxRuntime.jsx(MenuItem$4, {
300
- "data-testid": "neeto-editor-fixed-menu-".concat(neetoCist.hyphenate(label), "-option"),
301
- prefix: /*#__PURE__*/jsxRuntime.jsx(Icon, {
302
- size: 16
303
- }),
304
- children: label
305
- });
306
- };
307
-
308
299
  var Menu$4 = neetoAtoms.DropdownMenu.Menu,
309
300
  MenuItem$3 = neetoAtoms.DropdownMenu.MenuItem;
310
301
  var Mentions$1 = function Mentions(_ref) {
@@ -315,13 +306,48 @@ var Mentions$1 = function Mentions(_ref) {
315
306
  isSecondaryMenu = _ref$isSecondaryMenu === void 0 ? false : _ref$isSecondaryMenu,
316
307
  label = _ref.label;
317
308
  if (ramda.isEmpty(mentions)) return null;
309
+ var renderItems = mentions.map(function (_ref2) {
310
+ var key = _ref2.key,
311
+ name = _ref2.name,
312
+ imageUrl = _ref2.imageUrl;
313
+ return /*#__PURE__*/jsxRuntime.jsx(MenuItem$3, {
314
+ "data-testid": "neeto-editor-mention-option-".concat(key),
315
+ prefix: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Avatar, {
316
+ size: "sm",
317
+ user: {
318
+ name: name,
319
+ imageUrl: imageUrl
320
+ }
321
+ }),
322
+ onClick: function onClick() {
323
+ return editor.commands.setMention({
324
+ id: key,
325
+ label: name
326
+ });
327
+ },
328
+ children: name
329
+ }, key);
330
+ });
331
+ if (isSecondaryMenu) {
332
+ return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.SubMenu, {
333
+ label: label,
334
+ contentProps: {
335
+ className: "ne-editor-dropdown min-w-56"
336
+ },
337
+ icon: lucideReact.AtSign,
338
+ triggerProps: {
339
+ "data-testid": "neeto-editor-mention-option"
340
+ },
341
+ children: renderItems
342
+ });
343
+ }
318
344
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu, {
319
345
  "data-testid": "neeto-editor-mention-option",
320
346
  dropdownProps: {
321
347
  className: "ne-editor-dropdown min-w-56"
322
348
  },
323
349
  icon: lucideReact.AtSign,
324
- position: isSecondaryMenu ? "left-start" : "bottom-start",
350
+ position: "bottom-start",
325
351
  buttonProps: {
326
352
  variant: "ghost",
327
353
  size: "sm",
@@ -331,33 +357,8 @@ var Mentions$1 = function Mentions(_ref) {
331
357
  },
332
358
  className: "ne-toolbar-item ne-toolbar-dropdown"
333
359
  },
334
- customTarget: isSecondaryMenu && /*#__PURE__*/jsxRuntime.jsx(SecondaryMenuTarget, {
335
- label: label,
336
- icon: lucideReact.AtSign
337
- }),
338
360
  children: /*#__PURE__*/jsxRuntime.jsx(Menu$4, {
339
- children: mentions.map(function (_ref2) {
340
- var key = _ref2.key,
341
- name = _ref2.name,
342
- imageUrl = _ref2.imageUrl;
343
- return /*#__PURE__*/jsxRuntime.jsx(MenuItem$3, {
344
- "data-testid": "neeto-editor-mention-option-".concat(key),
345
- prefix: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Avatar, {
346
- size: "sm",
347
- user: {
348
- name: name,
349
- imageUrl: imageUrl
350
- }
351
- }),
352
- onClick: function onClick() {
353
- return editor.commands.setMention({
354
- id: key,
355
- label: name
356
- });
357
- },
358
- children: name
359
- }, key);
360
- })
361
+ children: renderItems
361
362
  })
362
363
  });
363
364
  };
@@ -400,17 +401,10 @@ var MenuButton$1 = function MenuButton(_ref) {
400
401
  var MenuButton = /*#__PURE__*/React.memo(MenuButton$1);
401
402
 
402
403
  var CalloutIcon = function CalloutIcon(_ref) {
404
+ var _currentType$icon;
403
405
  var currentType = _ref.currentType;
404
- if (currentType !== null && currentType !== void 0 && currentType.icon) {
405
- var Icon = currentType.icon;
406
- return /*#__PURE__*/jsxRuntime.jsx("span", {
407
- className: "neeto-editor-callout-dropdown__current-emoji",
408
- children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
409
- size: 22
410
- })
411
- });
412
- }
413
- return /*#__PURE__*/jsxRuntime.jsx(lucideReact.Flag, {
406
+ var Icon = (_currentType$icon = currentType === null || currentType === void 0 ? void 0 : currentType.icon) !== null && _currentType$icon !== void 0 ? _currentType$icon : lucideReact.Flag;
407
+ return /*#__PURE__*/jsxRuntime.jsx(Icon, {
414
408
  size: 16
415
409
  });
416
410
  };
@@ -426,7 +420,10 @@ var CalloutTypeOption = function CalloutTypeOption(_ref) {
426
420
  "data-testid": "callout-type-option",
427
421
  isActive: isSelected,
428
422
  prefix: /*#__PURE__*/jsxRuntime.jsx(Icon, {
429
- size: 16
423
+ size: 16,
424
+ style: {
425
+ stroke: calloutType.iconColor
426
+ }
430
427
  }),
431
428
  children: calloutType.label
432
429
  });
@@ -451,7 +448,9 @@ var RenderCalloutOptions = function RenderCalloutOptions(_ref) {
451
448
  var CalloutDropdown = function CalloutDropdown(_ref) {
452
449
  var editor = _ref.editor,
453
450
  label = _ref.label,
454
- tooltipContent = _ref.tooltipContent;
451
+ tooltipContent = _ref.tooltipContent,
452
+ _ref$isSecondaryMenu = _ref.isSecondaryMenu,
453
+ isSecondaryMenu = _ref$isSecondaryMenu === void 0 ? false : _ref$isSecondaryMenu;
455
454
  var _useTranslation = reactI18next.useTranslation(),
456
455
  t = _useTranslation.t;
457
456
  var dropdownRef = React.useRef(null);
@@ -477,6 +476,28 @@ var CalloutDropdown = function CalloutDropdown(_ref) {
477
476
  }).run();
478
477
  }
479
478
  };
479
+ var renderOptions = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
480
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.Label, {
481
+ children: t("neetoEditor.menu.selectCalloutType")
482
+ }), /*#__PURE__*/jsxRuntime.jsx(RenderCalloutOptions, {
483
+ currentCalloutAttrs: currentCalloutAttrs,
484
+ handleCalloutTypeClick: handleCalloutTypeClick,
485
+ isInCallout: isInCallout
486
+ })]
487
+ });
488
+ if (isSecondaryMenu) {
489
+ return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.SubMenu, {
490
+ label: label,
491
+ contentProps: {
492
+ className: "ne-editor-dropdown w-[200px] p-2"
493
+ },
494
+ icon: isInCallout ? currentType.icon : lucideReact.Flag,
495
+ triggerProps: {
496
+ "data-testid": "neeto-editor-fixed-menu-callout-option"
497
+ },
498
+ children: renderOptions
499
+ });
500
+ }
480
501
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu, {
481
502
  dropdownProps: {
482
503
  className: "ne-editor-dropdown w-[200px] p-2"
@@ -499,14 +520,8 @@ var CalloutDropdown = function CalloutDropdown(_ref) {
499
520
  variant: isInCallout ? "secondary" : "ghost",
500
521
  className: "ne-toolbar-item ne-toolbar-dropdown"
501
522
  },
502
- children: /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.DropdownMenu.Menu, {
503
- children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.Label, {
504
- children: t("neetoEditor.menu.selectCalloutType")
505
- }), /*#__PURE__*/jsxRuntime.jsx(RenderCalloutOptions, {
506
- currentCalloutAttrs: currentCalloutAttrs,
507
- handleCalloutTypeClick: handleCalloutTypeClick,
508
- isInCallout: isInCallout
509
- })]
523
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.Menu, {
524
+ children: renderOptions
510
525
  })
511
526
  });
512
527
  };
@@ -532,10 +547,26 @@ var EmojiOption$1 = function EmojiOption(_ref) {
532
547
  return k + 1;
533
548
  });
534
549
  };
550
+ if (isSecondaryMenu) {
551
+ return /*#__PURE__*/React.createElement(neetoAtoms.DropdownMenu.SubMenu, {
552
+ label: label,
553
+ icon: lucideReact.Smile,
554
+ key: resetKey,
555
+ contentProps: {
556
+ className: "ne-editor-dropdown neeto-editor-fixed-menu__emoji-dropdown min-w-[350px] p-0"
557
+ },
558
+ triggerProps: {
559
+ "data-testid": "neeto-editor-fixed-menu-emoji-option"
560
+ }
561
+ }, /*#__PURE__*/jsxRuntime.jsx(EmojiPickerMenu, {
562
+ editor: editor,
563
+ setActive: handlePicked
564
+ }));
565
+ }
535
566
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu, {
536
567
  closeOnSelect: false,
537
568
  icon: lucideReact.Smile,
538
- position: isSecondaryMenu ? "left-start" : "bottom-start",
569
+ position: "bottom-start",
539
570
  buttonProps: {
540
571
  variant: "ghost",
541
572
  tabIndex: -1,
@@ -546,15 +577,8 @@ var EmojiOption$1 = function EmojiOption(_ref) {
546
577
  className: "ne-toolbar-item ne-toolbar-dropdown",
547
578
  "data-testid": "neeto-editor-fixed-menu-emoji-option"
548
579
  },
549
- customTarget: isSecondaryMenu && /*#__PURE__*/jsxRuntime.jsx(SecondaryMenuTarget, {
550
- label: label,
551
- icon: lucideReact.Smile
552
- }),
553
580
  dropdownProps: {
554
- className: "ne-editor-dropdown neeto-editor-fixed-menu__emoji-dropdown min-w-[350px] p-0",
555
- onClick: function onClick(e) {
556
- return isSecondaryMenu && e.stopPropagation();
557
- }
581
+ className: "ne-editor-dropdown neeto-editor-fixed-menu__emoji-dropdown min-w-[350px] p-0"
558
582
  },
559
583
  onClose: function onClose() {
560
584
  return setActive(false);
@@ -603,13 +627,72 @@ var TextColorOption = function TextColorOption(_ref) {
603
627
  React.useEffect(function () {
604
628
  setColor(editor.getAttributes("textStyle").color);
605
629
  }, [resetKey, editor.getAttributes("textStyle").color]);
630
+ var pickerContent = /*#__PURE__*/jsxRuntime.jsxs("div", {
631
+ style: {
632
+ minWidth: "236px"
633
+ },
634
+ onClick: function onClick(e) {
635
+ e.stopPropagation();
636
+ },
637
+ children: [/*#__PURE__*/jsxRuntime.jsx(reactColorful.HexColorPicker, {
638
+ color: color || "#000000",
639
+ onChange: setColor
640
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
641
+ className: "neeto-editor-text-color-option__options-group",
642
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
643
+ autoFocus: true,
644
+ className: "neeto-editor-text-color-option__options-group__input",
645
+ placeholder: t("neetoEditor.placeholders.pickColor"),
646
+ size: "small",
647
+ value: color,
648
+ onChange: utils.withEventTargetValue(setColor),
649
+ onClick: function onClick(event) {
650
+ return event.stopPropagation();
651
+ }
652
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
653
+ icon: lucideReact.Check,
654
+ size: "sm",
655
+ onClick: handleSave
656
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
657
+ icon: lucideReact.X,
658
+ size: "sm",
659
+ variant: "ghost",
660
+ onClick: function onClick() {
661
+ editor.commands.focus();
662
+ closeMenu();
663
+ }
664
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
665
+ icon: lucideReact.RotateCw,
666
+ size: "sm",
667
+ variant: "ghost",
668
+ tooltipProps: {
669
+ content: t("neetoEditor.common.resetToDefault"),
670
+ position: "top"
671
+ },
672
+ onClick: handleUnset
673
+ })]
674
+ })]
675
+ });
676
+ if (isSecondaryMenu) {
677
+ return /*#__PURE__*/React.createElement(neetoAtoms.DropdownMenu.SubMenu, {
678
+ label: label,
679
+ contentProps: {
680
+ className: "ne-editor-dropdown w-[260px] p-2"
681
+ },
682
+ icon: lucideReact.Baseline,
683
+ key: resetKey,
684
+ triggerProps: {
685
+ "data-testid": "neeto-editor-fixed-menu-text-color-option"
686
+ }
687
+ }, pickerContent);
688
+ }
606
689
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu, {
607
690
  closeOnSelect: false,
608
691
  dropdownProps: {
609
692
  className: "ne-editor-dropdown w-[260px] p-2"
610
693
  },
611
694
  icon: lucideReact.Baseline,
612
- position: isSecondaryMenu ? "left-start" : "bottom-start",
695
+ position: "bottom-start",
613
696
  buttonProps: {
614
697
  variant: color ? "secondary" : "ghost",
615
698
  tabIndex: -1,
@@ -619,56 +702,7 @@ var TextColorOption = function TextColorOption(_ref) {
619
702
  },
620
703
  className: "ne-toolbar-item ne-toolbar-dropdown neeto-editor-text-color-option"
621
704
  },
622
- customTarget: isSecondaryMenu && /*#__PURE__*/jsxRuntime.jsx(SecondaryMenuTarget, {
623
- label: label,
624
- icon: lucideReact.Baseline
625
- }),
626
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
627
- style: {
628
- "min-width": "236px"
629
- },
630
- onClick: function onClick(e) {
631
- e.stopPropagation();
632
- },
633
- children: [/*#__PURE__*/jsxRuntime.jsx(reactColorful.HexColorPicker, {
634
- color: color || "#000000",
635
- onChange: setColor
636
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
637
- className: "neeto-editor-text-color-option__options-group",
638
- children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
639
- autoFocus: true,
640
- className: "neeto-editor-text-color-option__options-group__input",
641
- placeholder: t("neetoEditor.placeholders.pickColor"),
642
- size: "small",
643
- value: color,
644
- onChange: utils.withEventTargetValue(setColor),
645
- onClick: function onClick(event) {
646
- return event.stopPropagation();
647
- }
648
- }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
649
- icon: lucideReact.Check,
650
- size: "sm",
651
- onClick: handleSave
652
- }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
653
- icon: lucideReact.X,
654
- size: "sm",
655
- variant: "ghost",
656
- onClick: function onClick() {
657
- editor.commands.focus();
658
- closeMenu();
659
- }
660
- }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
661
- icon: lucideReact.RotateCw,
662
- size: "sm",
663
- variant: "ghost",
664
- tooltipProps: {
665
- content: t("neetoEditor.common.resetToDefault"),
666
- position: "top"
667
- },
668
- onClick: handleUnset
669
- })]
670
- })]
671
- })
705
+ children: pickerContent
672
706
  }, resetKey);
673
707
  };
674
708
 
@@ -2606,7 +2640,9 @@ var FontSizeOption$1 = function FontSizeOption(_ref) {
2606
2640
  tooltipContent = _ref.tooltipContent,
2607
2641
  label = _ref.label,
2608
2642
  _ref$options = _ref.options,
2609
- options = _ref$options === void 0 ? [] : _ref$options;
2643
+ options = _ref$options === void 0 ? [] : _ref$options,
2644
+ _ref$isSecondaryMenu = _ref.isSecondaryMenu,
2645
+ isSecondaryMenu = _ref$isSecondaryMenu === void 0 ? false : _ref$isSecondaryMenu;
2610
2646
  var dropdownRef = React.useRef(null);
2611
2647
  var lastOption = ramda.last(FONT_SIZE_OPTIONS);
2612
2648
  var _useEditorStore = useEditorStore.useEditorStore(function (store) {
@@ -2631,6 +2667,36 @@ var FontSizeOption$1 = function FontSizeOption(_ref) {
2631
2667
  return options.includes(_key);
2632
2668
  }
2633
2669
  }, FONT_SIZE_OPTIONS)), [FONT_SIZE_OPTIONS[FONT_SIZE_OPTIONS.length - 1]]);
2670
+ var renderItems = menuOptions.map(function (_ref2) {
2671
+ var itemLabel = _ref2.label,
2672
+ Icon = _ref2.icon,
2673
+ value = _ref2.value,
2674
+ key = _ref2.key;
2675
+ return /*#__PURE__*/jsxRuntime.jsx(MenuItem, {
2676
+ "data-testid": "neeto-editor-fixed-menu-font-size-option-".concat(key),
2677
+ isActive: (activeOption === null || activeOption === void 0 ? void 0 : activeOption.value) === value,
2678
+ prefix: /*#__PURE__*/jsxRuntime.jsx(Icon, {
2679
+ size: 16
2680
+ }),
2681
+ onClick: function onClick() {
2682
+ return handleClick(value);
2683
+ },
2684
+ children: itemLabel
2685
+ }, value);
2686
+ });
2687
+ if (isSecondaryMenu) {
2688
+ return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.SubMenu, {
2689
+ label: label,
2690
+ contentProps: {
2691
+ className: "ne-editor-dropdown"
2692
+ },
2693
+ icon: activeOption === null || activeOption === void 0 ? void 0 : activeOption.icon,
2694
+ triggerProps: {
2695
+ "data-testid": "neeto-editor-fixed-menu-font-size-option"
2696
+ },
2697
+ children: renderItems
2698
+ });
2699
+ }
2634
2700
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu, {
2635
2701
  dropdownProps: {
2636
2702
  className: "ne-editor-dropdown"
@@ -2652,23 +2718,7 @@ var FontSizeOption$1 = function FontSizeOption(_ref) {
2652
2718
  className: "ne-toolbar-item ne-toolbar-dropdown neeto-editor-font-size__wrapper"
2653
2719
  },
2654
2720
  children: /*#__PURE__*/jsxRuntime.jsx(Menu$2, {
2655
- children: menuOptions.map(function (_ref2) {
2656
- var label = _ref2.label,
2657
- Icon = _ref2.icon,
2658
- value = _ref2.value,
2659
- key = _ref2.key;
2660
- return /*#__PURE__*/jsxRuntime.jsx(MenuItem, {
2661
- "data-testid": "neeto-editor-fixed-menu-font-size-option-".concat(key),
2662
- isActive: (activeOption === null || activeOption === void 0 ? void 0 : activeOption.value) === value,
2663
- prefix: /*#__PURE__*/jsxRuntime.jsx(Icon, {
2664
- size: 16
2665
- }),
2666
- onClick: function onClick() {
2667
- return handleClick(value);
2668
- },
2669
- children: label
2670
- }, value);
2671
- })
2721
+ children: renderItems
2672
2722
  })
2673
2723
  });
2674
2724
  };
@@ -2713,7 +2763,9 @@ var HighlightDropdown = function HighlightDropdown(_ref) {
2713
2763
  var editor = _ref.editor,
2714
2764
  label = _ref.label,
2715
2765
  tooltipContent = _ref.tooltipContent,
2716
- runEditorCommand = _ref.runEditorCommand;
2766
+ runEditorCommand = _ref.runEditorCommand,
2767
+ _ref$isSecondaryMenu = _ref.isSecondaryMenu,
2768
+ isSecondaryMenu = _ref$isSecondaryMenu === void 0 ? false : _ref$isSecondaryMenu;
2717
2769
  var dropdownRef = React.useRef(null);
2718
2770
  var textColor = editor.getAttributes("textStyle").color;
2719
2771
  var backgroundColor = editor.getAttributes("textStyle").backgroundColor;
@@ -2754,6 +2806,37 @@ var HighlightDropdown = function HighlightDropdown(_ref) {
2754
2806
  });
2755
2807
  });
2756
2808
  };
2809
+ var renderSections = colorSections.map(function (_ref2) {
2810
+ var title = _ref2.title,
2811
+ colors = _ref2.colors,
2812
+ isTextColor = _ref2.isTextColor;
2813
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
2814
+ className: "neeto-editor-highlight-dropdown__section",
2815
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
2816
+ className: "neeto-editor-highlight-dropdown__section-title",
2817
+ variant: "body2",
2818
+ weight: "medium",
2819
+ children: title
2820
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
2821
+ className: "neeto-editor-highlight-dropdown__color-grid",
2822
+ "data-testid": "neeto-editor-highlight-".concat(utils.hyphenize(title), "-grid"),
2823
+ children: renderColorDots(colors, isTextColor)
2824
+ })]
2825
+ }, title);
2826
+ });
2827
+ if (isSecondaryMenu) {
2828
+ return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.SubMenu, {
2829
+ label: label,
2830
+ icon: lucideReact.Highlighter,
2831
+ contentProps: {
2832
+ className: "ne-editor-dropdown neeto-editor-highlight-dropdown w-[280px] p-3"
2833
+ },
2834
+ triggerProps: {
2835
+ "data-testid": "neeto-editor-fixed-menu-highlight-option"
2836
+ },
2837
+ children: renderSections
2838
+ });
2839
+ }
2757
2840
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu, {
2758
2841
  dropdownProps: {
2759
2842
  className: "ne-editor-dropdown w-[280px] p-3"
@@ -2776,24 +2859,7 @@ var HighlightDropdown = function HighlightDropdown(_ref) {
2776
2859
  },
2777
2860
  children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu.Menu, {
2778
2861
  className: "neeto-editor-highlight-dropdown",
2779
- children: colorSections.map(function (_ref2) {
2780
- var title = _ref2.title,
2781
- colors = _ref2.colors,
2782
- isTextColor = _ref2.isTextColor;
2783
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
2784
- className: "neeto-editor-highlight-dropdown__section",
2785
- children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
2786
- className: "neeto-editor-highlight-dropdown__section-title",
2787
- variant: "body2",
2788
- weight: "medium",
2789
- children: title
2790
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
2791
- className: "neeto-editor-highlight-dropdown__color-grid",
2792
- "data-testid": "neeto-editor-highlight-".concat(utils.hyphenize(title), "-grid"),
2793
- children: renderColorDots(colors, isTextColor)
2794
- })]
2795
- }, title);
2796
- })
2862
+ children: renderSections
2797
2863
  })
2798
2864
  });
2799
2865
  };
@@ -2840,13 +2906,57 @@ var TableOption$1 = function TableOption(_ref) {
2840
2906
  return k + 1;
2841
2907
  });
2842
2908
  };
2909
+ var formContent = /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
2910
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
2911
+ autoFocus: true,
2912
+ "data-testid": "neeto-editor-fixed-menu-table-rows-input",
2913
+ label: t("neetoEditor.menu.rows"),
2914
+ min: "1",
2915
+ placeholder: t("neetoEditor.placeholders.rows"),
2916
+ size: "small",
2917
+ type: "number",
2918
+ value: rows,
2919
+ onChange: utils.withEventTargetValue(setRows)
2920
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
2921
+ "data-testid": "neeto-editor-fixed-menu-table-columns-input",
2922
+ label: t("neetoEditor.menu.columns"),
2923
+ min: "1",
2924
+ placeholder: t("neetoEditor.placeholders.columns"),
2925
+ size: "small",
2926
+ type: "number",
2927
+ value: columns,
2928
+ onChange: utils.withEventTargetValue(setColumns)
2929
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
2930
+ className: "neeto-editor-table-menu__button",
2931
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
2932
+ className: "mt-auto",
2933
+ "data-testid": "neeto-editor-fixed-menu-table-option-create-button",
2934
+ label: t("neetoEditor.common.create"),
2935
+ size: "sm",
2936
+ onClick: handleSubmit
2937
+ })
2938
+ })]
2939
+ });
2940
+ if (isSecondaryMenu) {
2941
+ return /*#__PURE__*/React.createElement(neetoAtoms.DropdownMenu.SubMenu, {
2942
+ label: label,
2943
+ icon: lucideReact.Table,
2944
+ key: resetKey,
2945
+ contentProps: {
2946
+ className: "ne-editor-dropdown neeto-editor-table__item w-auto p-2 flex flex-col"
2947
+ },
2948
+ triggerProps: {
2949
+ "data-testid": "neeto-editor-fixed-menu-table-option"
2950
+ }
2951
+ }, formContent);
2952
+ }
2843
2953
  return /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.DropdownMenu, {
2844
2954
  closeOnSelect: false,
2845
2955
  dropdownProps: {
2846
2956
  className: "ne-editor-dropdown w-auto p-2"
2847
2957
  },
2848
2958
  icon: lucideReact.Table,
2849
- position: isSecondaryMenu ? "left-start" : "bottom",
2959
+ position: "bottom",
2850
2960
  buttonProps: {
2851
2961
  tabIndex: -1,
2852
2962
  tooltipProps: {
@@ -2857,42 +2967,10 @@ var TableOption$1 = function TableOption(_ref) {
2857
2967
  className: "ne-toolbar-item ne-toolbar-dropdown",
2858
2968
  "data-testid": "neeto-editor-fixed-menu-table-option"
2859
2969
  },
2860
- customTarget: isSecondaryMenu && /*#__PURE__*/jsxRuntime.jsx(SecondaryMenuTarget, {
2861
- label: label,
2862
- icon: lucideReact.Table
2863
- }),
2864
2970
  onClose: handleClose,
2865
- children: /*#__PURE__*/jsxRuntime.jsxs(Menu$1, {
2971
+ children: /*#__PURE__*/jsxRuntime.jsx(Menu$1, {
2866
2972
  className: "neeto-editor-table__item",
2867
- children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
2868
- autoFocus: true,
2869
- "data-testid": "neeto-editor-fixed-menu-table-rows-input",
2870
- label: t("neetoEditor.menu.rows"),
2871
- min: "1",
2872
- placeholder: t("neetoEditor.placeholders.rows"),
2873
- size: "small",
2874
- type: "number",
2875
- value: rows,
2876
- onChange: utils.withEventTargetValue(setRows)
2877
- }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
2878
- "data-testid": "neeto-editor-fixed-menu-table-columns-input",
2879
- label: t("neetoEditor.menu.columns"),
2880
- min: "1",
2881
- placeholder: t("neetoEditor.placeholders.rows"),
2882
- size: "small",
2883
- type: "number",
2884
- value: columns,
2885
- onChange: utils.withEventTargetValue(setColumns)
2886
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
2887
- className: "neeto-editor-table-menu__button",
2888
- children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
2889
- className: "mt-auto",
2890
- "data-testid": "neeto-editor-fixed-menu-table-option-create-button",
2891
- label: t("neetoEditor.common.create"),
2892
- size: "sm",
2893
- onClick: handleSubmit
2894
- })
2895
- })]
2973
+ children: formContent
2896
2974
  })
2897
2975
  }, resetKey);
2898
2976
  };
@@ -3404,4 +3482,4 @@ exports.transformEditorContent = transformEditorContent;
3404
3482
  exports.transformPastedHTML = transformPastedHTML;
3405
3483
  exports.validateAndFormatUrl = validateAndFormatUrl;
3406
3484
  exports.validateUrl = validateUrl;
3407
- //# sourceMappingURL=chunk-B_ZuTQG9.cjs.js.map
3485
+ //# sourceMappingURL=chunk-BKrsK0Ld.cjs.js.map