@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.
@@ -6,10 +6,10 @@ import { isEmpty, prop, fromPairs, assoc, not, last } from 'ramda';
6
6
  import { A as ALL_PROTOCOL_URL_REGEXP, E as EDITOR_OPTIONS, b as URL_VALIDATORS } from './chunk-DDwycKmK.js';
7
7
  import i18n, { t as t$1 } from 'i18next';
8
8
  import * as yup from 'yup';
9
- import { Megaphone, Info, AlertTriangle, AlertOctagon, CheckCircle2, AtSign, Flag, Smile, Baseline, Check, X, RotateCw, Heading1, Heading2, Heading3, Pilcrow, Undo, Redo, Paperclip, ImageUp, Video, List, ListOrdered, Quote, Code, SquareCode, Bold, Italic, Underline, Link, Strikethrough, Highlighter, ChevronDown, Table, Ellipsis, FileText, Heading4, Heading5, ListChecks } from 'lucide-react';
9
+ import { Megaphone, Info, AlertTriangle, AlertOctagon, CheckCircle2, AtSign, Flag, Smile, Check, X, RotateCw, Baseline, Heading1, Heading2, Heading3, Pilcrow, Undo, Redo, Paperclip, ImageUp, Video, List, ListOrdered, Quote, Code, SquareCode, Bold, Italic, Underline, Link, Strikethrough, Highlighter, ChevronDown, Table, Ellipsis, FileText, Heading4, Heading5, ListChecks } from 'lucide-react';
10
10
  import { e as emojiPickerApi, u as useEditorStore, g as generateFocusProps, B as BubbleMenu } from './chunk-BLXUWWgi.js';
11
11
  import classnames from 'classnames';
12
- import { isNotEmpty, hyphenate, findBy, isNotPresent, noop, filterBy } from '@bigbinary/neeto-cist';
12
+ import { isNotEmpty, findBy, isNotPresent, noop, hyphenate, filterBy } from '@bigbinary/neeto-cist';
13
13
  import { roundArrow } from 'tippy.js';
14
14
  import 'tippy.js/dist/svg-arrow.css';
15
15
  import { DropdownMenu, Avatar, Button as Button$1, Input, Label, Typography, Tooltip, Dialog, Tabs, Toastr, Checkbox } from '@bigbinary/neeto-atoms';
@@ -138,22 +138,26 @@ var CALLOUT_TYPES = [{
138
138
  type: "info",
139
139
  label: t$1("neetoEditor.menu.calloutInfo"),
140
140
  icon: Info,
141
- bgColor: "--neeto-editor-info-100"
141
+ bgColor: "--neeto-editor-info-100",
142
+ iconColor: "var(--ne-editor-content-callout-info-foreground-color)"
142
143
  }, {
143
144
  type: "warning",
144
145
  label: t$1("neetoEditor.menu.calloutWarning"),
145
146
  icon: AlertTriangle,
146
- bgColor: "--neeto-editor-warning-100"
147
+ bgColor: "--neeto-editor-warning-100",
148
+ iconColor: "var(--ne-editor-content-callout-warning-foreground-color)"
147
149
  }, {
148
150
  type: "error",
149
151
  label: t$1("neetoEditor.menu.calloutError"),
150
152
  icon: AlertOctagon,
151
- bgColor: "--neeto-editor-error-100"
153
+ bgColor: "--neeto-editor-error-100",
154
+ iconColor: "var(--ne-editor-content-callout-error-foreground-color)"
152
155
  }, {
153
156
  type: "success",
154
157
  label: t$1("neetoEditor.menu.calloutSuccess"),
155
158
  icon: CheckCircle2,
156
- bgColor: "--neeto-editor-success-100"
159
+ bgColor: "--neeto-editor-success-100",
160
+ iconColor: "var(--ne-editor-content-callout-success-foreground-color)"
157
161
  }];
158
162
 
159
163
  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; }
@@ -251,19 +255,6 @@ var validateUrl = function validateUrl(url) {
251
255
  return false;
252
256
  };
253
257
 
254
- var MenuItem$4 = DropdownMenu.MenuItem;
255
- var SecondaryMenuTarget = function SecondaryMenuTarget(_ref) {
256
- var Icon = _ref.icon,
257
- label = _ref.label;
258
- return /*#__PURE__*/jsx(MenuItem$4, {
259
- "data-testid": "neeto-editor-fixed-menu-".concat(hyphenate(label), "-option"),
260
- prefix: /*#__PURE__*/jsx(Icon, {
261
- size: 16
262
- }),
263
- children: label
264
- });
265
- };
266
-
267
258
  var Menu$4 = DropdownMenu.Menu,
268
259
  MenuItem$3 = DropdownMenu.MenuItem;
269
260
  var Mentions = function Mentions(_ref) {
@@ -274,13 +265,48 @@ var Mentions = function Mentions(_ref) {
274
265
  isSecondaryMenu = _ref$isSecondaryMenu === void 0 ? false : _ref$isSecondaryMenu,
275
266
  label = _ref.label;
276
267
  if (isEmpty(mentions)) return null;
268
+ var renderItems = mentions.map(function (_ref2) {
269
+ var key = _ref2.key,
270
+ name = _ref2.name,
271
+ imageUrl = _ref2.imageUrl;
272
+ return /*#__PURE__*/jsx(MenuItem$3, {
273
+ "data-testid": "neeto-editor-mention-option-".concat(key),
274
+ prefix: /*#__PURE__*/jsx(Avatar, {
275
+ size: "sm",
276
+ user: {
277
+ name: name,
278
+ imageUrl: imageUrl
279
+ }
280
+ }),
281
+ onClick: function onClick() {
282
+ return editor.commands.setMention({
283
+ id: key,
284
+ label: name
285
+ });
286
+ },
287
+ children: name
288
+ }, key);
289
+ });
290
+ if (isSecondaryMenu) {
291
+ return /*#__PURE__*/jsx(DropdownMenu.SubMenu, {
292
+ label: label,
293
+ contentProps: {
294
+ className: "ne-editor-dropdown min-w-56"
295
+ },
296
+ icon: AtSign,
297
+ triggerProps: {
298
+ "data-testid": "neeto-editor-mention-option"
299
+ },
300
+ children: renderItems
301
+ });
302
+ }
277
303
  return /*#__PURE__*/jsx(DropdownMenu, {
278
304
  "data-testid": "neeto-editor-mention-option",
279
305
  dropdownProps: {
280
306
  className: "ne-editor-dropdown min-w-56"
281
307
  },
282
308
  icon: AtSign,
283
- position: isSecondaryMenu ? "left-start" : "bottom-start",
309
+ position: "bottom-start",
284
310
  buttonProps: {
285
311
  variant: "ghost",
286
312
  size: "sm",
@@ -290,33 +316,8 @@ var Mentions = function Mentions(_ref) {
290
316
  },
291
317
  className: "ne-toolbar-item ne-toolbar-dropdown"
292
318
  },
293
- customTarget: isSecondaryMenu && /*#__PURE__*/jsx(SecondaryMenuTarget, {
294
- label: label,
295
- icon: AtSign
296
- }),
297
319
  children: /*#__PURE__*/jsx(Menu$4, {
298
- children: mentions.map(function (_ref2) {
299
- var key = _ref2.key,
300
- name = _ref2.name,
301
- imageUrl = _ref2.imageUrl;
302
- return /*#__PURE__*/jsx(MenuItem$3, {
303
- "data-testid": "neeto-editor-mention-option-".concat(key),
304
- prefix: /*#__PURE__*/jsx(Avatar, {
305
- size: "sm",
306
- user: {
307
- name: name,
308
- imageUrl: imageUrl
309
- }
310
- }),
311
- onClick: function onClick() {
312
- return editor.commands.setMention({
313
- id: key,
314
- label: name
315
- });
316
- },
317
- children: name
318
- }, key);
319
- })
320
+ children: renderItems
320
321
  })
321
322
  });
322
323
  };
@@ -359,17 +360,10 @@ var MenuButton = function MenuButton(_ref) {
359
360
  var MenuButton$1 = /*#__PURE__*/memo(MenuButton);
360
361
 
361
362
  var CalloutIcon = function CalloutIcon(_ref) {
363
+ var _currentType$icon;
362
364
  var currentType = _ref.currentType;
363
- if (currentType !== null && currentType !== void 0 && currentType.icon) {
364
- var Icon = currentType.icon;
365
- return /*#__PURE__*/jsx("span", {
366
- className: "neeto-editor-callout-dropdown__current-emoji",
367
- children: /*#__PURE__*/jsx(Icon, {
368
- size: 22
369
- })
370
- });
371
- }
372
- return /*#__PURE__*/jsx(Flag, {
365
+ var Icon = (_currentType$icon = currentType === null || currentType === void 0 ? void 0 : currentType.icon) !== null && _currentType$icon !== void 0 ? _currentType$icon : Flag;
366
+ return /*#__PURE__*/jsx(Icon, {
373
367
  size: 16
374
368
  });
375
369
  };
@@ -385,7 +379,10 @@ var CalloutTypeOption = function CalloutTypeOption(_ref) {
385
379
  "data-testid": "callout-type-option",
386
380
  isActive: isSelected,
387
381
  prefix: /*#__PURE__*/jsx(Icon, {
388
- size: 16
382
+ size: 16,
383
+ style: {
384
+ stroke: calloutType.iconColor
385
+ }
389
386
  }),
390
387
  children: calloutType.label
391
388
  });
@@ -410,7 +407,9 @@ var RenderCalloutOptions = function RenderCalloutOptions(_ref) {
410
407
  var CalloutDropdown = function CalloutDropdown(_ref) {
411
408
  var editor = _ref.editor,
412
409
  label = _ref.label,
413
- tooltipContent = _ref.tooltipContent;
410
+ tooltipContent = _ref.tooltipContent,
411
+ _ref$isSecondaryMenu = _ref.isSecondaryMenu,
412
+ isSecondaryMenu = _ref$isSecondaryMenu === void 0 ? false : _ref$isSecondaryMenu;
414
413
  var _useTranslation = useTranslation(),
415
414
  t = _useTranslation.t;
416
415
  var dropdownRef = useRef(null);
@@ -436,6 +435,28 @@ var CalloutDropdown = function CalloutDropdown(_ref) {
436
435
  }).run();
437
436
  }
438
437
  };
438
+ var renderOptions = /*#__PURE__*/jsxs(Fragment$1, {
439
+ children: [/*#__PURE__*/jsx(DropdownMenu.Label, {
440
+ children: t("neetoEditor.menu.selectCalloutType")
441
+ }), /*#__PURE__*/jsx(RenderCalloutOptions, {
442
+ currentCalloutAttrs: currentCalloutAttrs,
443
+ handleCalloutTypeClick: handleCalloutTypeClick,
444
+ isInCallout: isInCallout
445
+ })]
446
+ });
447
+ if (isSecondaryMenu) {
448
+ return /*#__PURE__*/jsx(DropdownMenu.SubMenu, {
449
+ label: label,
450
+ contentProps: {
451
+ className: "ne-editor-dropdown w-[200px] p-2"
452
+ },
453
+ icon: isInCallout ? currentType.icon : Flag,
454
+ triggerProps: {
455
+ "data-testid": "neeto-editor-fixed-menu-callout-option"
456
+ },
457
+ children: renderOptions
458
+ });
459
+ }
439
460
  return /*#__PURE__*/jsx(DropdownMenu, {
440
461
  dropdownProps: {
441
462
  className: "ne-editor-dropdown w-[200px] p-2"
@@ -458,14 +479,8 @@ var CalloutDropdown = function CalloutDropdown(_ref) {
458
479
  variant: isInCallout ? "secondary" : "ghost",
459
480
  className: "ne-toolbar-item ne-toolbar-dropdown"
460
481
  },
461
- children: /*#__PURE__*/jsxs(DropdownMenu.Menu, {
462
- children: [/*#__PURE__*/jsx(DropdownMenu.Label, {
463
- children: t("neetoEditor.menu.selectCalloutType")
464
- }), /*#__PURE__*/jsx(RenderCalloutOptions, {
465
- currentCalloutAttrs: currentCalloutAttrs,
466
- handleCalloutTypeClick: handleCalloutTypeClick,
467
- isInCallout: isInCallout
468
- })]
482
+ children: /*#__PURE__*/jsx(DropdownMenu.Menu, {
483
+ children: renderOptions
469
484
  })
470
485
  });
471
486
  };
@@ -491,10 +506,26 @@ var EmojiOption = function EmojiOption(_ref) {
491
506
  return k + 1;
492
507
  });
493
508
  };
509
+ if (isSecondaryMenu) {
510
+ return /*#__PURE__*/createElement(DropdownMenu.SubMenu, {
511
+ label: label,
512
+ icon: Smile,
513
+ key: resetKey,
514
+ contentProps: {
515
+ className: "ne-editor-dropdown neeto-editor-fixed-menu__emoji-dropdown min-w-[350px] p-0"
516
+ },
517
+ triggerProps: {
518
+ "data-testid": "neeto-editor-fixed-menu-emoji-option"
519
+ }
520
+ }, /*#__PURE__*/jsx(EmojiPickerMenu, {
521
+ editor: editor,
522
+ setActive: handlePicked
523
+ }));
524
+ }
494
525
  return /*#__PURE__*/jsx(DropdownMenu, {
495
526
  closeOnSelect: false,
496
527
  icon: Smile,
497
- position: isSecondaryMenu ? "left-start" : "bottom-start",
528
+ position: "bottom-start",
498
529
  buttonProps: {
499
530
  variant: "ghost",
500
531
  tabIndex: -1,
@@ -505,15 +536,8 @@ var EmojiOption = function EmojiOption(_ref) {
505
536
  className: "ne-toolbar-item ne-toolbar-dropdown",
506
537
  "data-testid": "neeto-editor-fixed-menu-emoji-option"
507
538
  },
508
- customTarget: isSecondaryMenu && /*#__PURE__*/jsx(SecondaryMenuTarget, {
509
- label: label,
510
- icon: Smile
511
- }),
512
539
  dropdownProps: {
513
- className: "ne-editor-dropdown neeto-editor-fixed-menu__emoji-dropdown min-w-[350px] p-0",
514
- onClick: function onClick(e) {
515
- return isSecondaryMenu && e.stopPropagation();
516
- }
540
+ className: "ne-editor-dropdown neeto-editor-fixed-menu__emoji-dropdown min-w-[350px] p-0"
517
541
  },
518
542
  onClose: function onClose() {
519
543
  return setActive(false);
@@ -562,13 +586,72 @@ var TextColorOption = function TextColorOption(_ref) {
562
586
  useEffect(function () {
563
587
  setColor(editor.getAttributes("textStyle").color);
564
588
  }, [resetKey, editor.getAttributes("textStyle").color]);
589
+ var pickerContent = /*#__PURE__*/jsxs("div", {
590
+ style: {
591
+ minWidth: "236px"
592
+ },
593
+ onClick: function onClick(e) {
594
+ e.stopPropagation();
595
+ },
596
+ children: [/*#__PURE__*/jsx(HexColorPicker, {
597
+ color: color || "#000000",
598
+ onChange: setColor
599
+ }), /*#__PURE__*/jsxs("div", {
600
+ className: "neeto-editor-text-color-option__options-group",
601
+ children: [/*#__PURE__*/jsx(Input, {
602
+ autoFocus: true,
603
+ className: "neeto-editor-text-color-option__options-group__input",
604
+ placeholder: t("neetoEditor.placeholders.pickColor"),
605
+ size: "small",
606
+ value: color,
607
+ onChange: withEventTargetValue(setColor),
608
+ onClick: function onClick(event) {
609
+ return event.stopPropagation();
610
+ }
611
+ }), /*#__PURE__*/jsx(Button$1, {
612
+ icon: Check,
613
+ size: "sm",
614
+ onClick: handleSave
615
+ }), /*#__PURE__*/jsx(Button$1, {
616
+ icon: X,
617
+ size: "sm",
618
+ variant: "ghost",
619
+ onClick: function onClick() {
620
+ editor.commands.focus();
621
+ closeMenu();
622
+ }
623
+ }), /*#__PURE__*/jsx(Button$1, {
624
+ icon: RotateCw,
625
+ size: "sm",
626
+ variant: "ghost",
627
+ tooltipProps: {
628
+ content: t("neetoEditor.common.resetToDefault"),
629
+ position: "top"
630
+ },
631
+ onClick: handleUnset
632
+ })]
633
+ })]
634
+ });
635
+ if (isSecondaryMenu) {
636
+ return /*#__PURE__*/createElement(DropdownMenu.SubMenu, {
637
+ label: label,
638
+ contentProps: {
639
+ className: "ne-editor-dropdown w-[260px] p-2"
640
+ },
641
+ icon: Baseline,
642
+ key: resetKey,
643
+ triggerProps: {
644
+ "data-testid": "neeto-editor-fixed-menu-text-color-option"
645
+ }
646
+ }, pickerContent);
647
+ }
565
648
  return /*#__PURE__*/jsx(DropdownMenu, {
566
649
  closeOnSelect: false,
567
650
  dropdownProps: {
568
651
  className: "ne-editor-dropdown w-[260px] p-2"
569
652
  },
570
653
  icon: Baseline,
571
- position: isSecondaryMenu ? "left-start" : "bottom-start",
654
+ position: "bottom-start",
572
655
  buttonProps: {
573
656
  variant: color ? "secondary" : "ghost",
574
657
  tabIndex: -1,
@@ -578,56 +661,7 @@ var TextColorOption = function TextColorOption(_ref) {
578
661
  },
579
662
  className: "ne-toolbar-item ne-toolbar-dropdown neeto-editor-text-color-option"
580
663
  },
581
- customTarget: isSecondaryMenu && /*#__PURE__*/jsx(SecondaryMenuTarget, {
582
- label: label,
583
- icon: Baseline
584
- }),
585
- children: /*#__PURE__*/jsxs("div", {
586
- style: {
587
- "min-width": "236px"
588
- },
589
- onClick: function onClick(e) {
590
- e.stopPropagation();
591
- },
592
- children: [/*#__PURE__*/jsx(HexColorPicker, {
593
- color: color || "#000000",
594
- onChange: setColor
595
- }), /*#__PURE__*/jsxs("div", {
596
- className: "neeto-editor-text-color-option__options-group",
597
- children: [/*#__PURE__*/jsx(Input, {
598
- autoFocus: true,
599
- className: "neeto-editor-text-color-option__options-group__input",
600
- placeholder: t("neetoEditor.placeholders.pickColor"),
601
- size: "small",
602
- value: color,
603
- onChange: withEventTargetValue(setColor),
604
- onClick: function onClick(event) {
605
- return event.stopPropagation();
606
- }
607
- }), /*#__PURE__*/jsx(Button$1, {
608
- icon: Check,
609
- size: "sm",
610
- onClick: handleSave
611
- }), /*#__PURE__*/jsx(Button$1, {
612
- icon: X,
613
- size: "sm",
614
- variant: "ghost",
615
- onClick: function onClick() {
616
- editor.commands.focus();
617
- closeMenu();
618
- }
619
- }), /*#__PURE__*/jsx(Button$1, {
620
- icon: RotateCw,
621
- size: "sm",
622
- variant: "ghost",
623
- tooltipProps: {
624
- content: t("neetoEditor.common.resetToDefault"),
625
- position: "top"
626
- },
627
- onClick: handleUnset
628
- })]
629
- })]
630
- })
664
+ children: pickerContent
631
665
  }, resetKey);
632
666
  };
633
667
 
@@ -2565,7 +2599,9 @@ var FontSizeOption = function FontSizeOption(_ref) {
2565
2599
  tooltipContent = _ref.tooltipContent,
2566
2600
  label = _ref.label,
2567
2601
  _ref$options = _ref.options,
2568
- options = _ref$options === void 0 ? [] : _ref$options;
2602
+ options = _ref$options === void 0 ? [] : _ref$options,
2603
+ _ref$isSecondaryMenu = _ref.isSecondaryMenu,
2604
+ isSecondaryMenu = _ref$isSecondaryMenu === void 0 ? false : _ref$isSecondaryMenu;
2569
2605
  var dropdownRef = useRef(null);
2570
2606
  var lastOption = last(FONT_SIZE_OPTIONS);
2571
2607
  var _useEditorStore = useEditorStore(function (store) {
@@ -2590,6 +2626,36 @@ var FontSizeOption = function FontSizeOption(_ref) {
2590
2626
  return options.includes(_key);
2591
2627
  }
2592
2628
  }, FONT_SIZE_OPTIONS)), [FONT_SIZE_OPTIONS[FONT_SIZE_OPTIONS.length - 1]]);
2629
+ var renderItems = menuOptions.map(function (_ref2) {
2630
+ var itemLabel = _ref2.label,
2631
+ Icon = _ref2.icon,
2632
+ value = _ref2.value,
2633
+ key = _ref2.key;
2634
+ return /*#__PURE__*/jsx(MenuItem, {
2635
+ "data-testid": "neeto-editor-fixed-menu-font-size-option-".concat(key),
2636
+ isActive: (activeOption === null || activeOption === void 0 ? void 0 : activeOption.value) === value,
2637
+ prefix: /*#__PURE__*/jsx(Icon, {
2638
+ size: 16
2639
+ }),
2640
+ onClick: function onClick() {
2641
+ return handleClick(value);
2642
+ },
2643
+ children: itemLabel
2644
+ }, value);
2645
+ });
2646
+ if (isSecondaryMenu) {
2647
+ return /*#__PURE__*/jsx(DropdownMenu.SubMenu, {
2648
+ label: label,
2649
+ contentProps: {
2650
+ className: "ne-editor-dropdown"
2651
+ },
2652
+ icon: activeOption === null || activeOption === void 0 ? void 0 : activeOption.icon,
2653
+ triggerProps: {
2654
+ "data-testid": "neeto-editor-fixed-menu-font-size-option"
2655
+ },
2656
+ children: renderItems
2657
+ });
2658
+ }
2593
2659
  return /*#__PURE__*/jsx(DropdownMenu, {
2594
2660
  dropdownProps: {
2595
2661
  className: "ne-editor-dropdown"
@@ -2611,23 +2677,7 @@ var FontSizeOption = function FontSizeOption(_ref) {
2611
2677
  className: "ne-toolbar-item ne-toolbar-dropdown neeto-editor-font-size__wrapper"
2612
2678
  },
2613
2679
  children: /*#__PURE__*/jsx(Menu$2, {
2614
- children: menuOptions.map(function (_ref2) {
2615
- var label = _ref2.label,
2616
- Icon = _ref2.icon,
2617
- value = _ref2.value,
2618
- key = _ref2.key;
2619
- return /*#__PURE__*/jsx(MenuItem, {
2620
- "data-testid": "neeto-editor-fixed-menu-font-size-option-".concat(key),
2621
- isActive: (activeOption === null || activeOption === void 0 ? void 0 : activeOption.value) === value,
2622
- prefix: /*#__PURE__*/jsx(Icon, {
2623
- size: 16
2624
- }),
2625
- onClick: function onClick() {
2626
- return handleClick(value);
2627
- },
2628
- children: label
2629
- }, value);
2630
- })
2680
+ children: renderItems
2631
2681
  })
2632
2682
  });
2633
2683
  };
@@ -2672,7 +2722,9 @@ var HighlightDropdown = function HighlightDropdown(_ref) {
2672
2722
  var editor = _ref.editor,
2673
2723
  label = _ref.label,
2674
2724
  tooltipContent = _ref.tooltipContent,
2675
- runEditorCommand = _ref.runEditorCommand;
2725
+ runEditorCommand = _ref.runEditorCommand,
2726
+ _ref$isSecondaryMenu = _ref.isSecondaryMenu,
2727
+ isSecondaryMenu = _ref$isSecondaryMenu === void 0 ? false : _ref$isSecondaryMenu;
2676
2728
  var dropdownRef = useRef(null);
2677
2729
  var textColor = editor.getAttributes("textStyle").color;
2678
2730
  var backgroundColor = editor.getAttributes("textStyle").backgroundColor;
@@ -2713,6 +2765,37 @@ var HighlightDropdown = function HighlightDropdown(_ref) {
2713
2765
  });
2714
2766
  });
2715
2767
  };
2768
+ var renderSections = colorSections.map(function (_ref2) {
2769
+ var title = _ref2.title,
2770
+ colors = _ref2.colors,
2771
+ isTextColor = _ref2.isTextColor;
2772
+ return /*#__PURE__*/jsxs("div", {
2773
+ className: "neeto-editor-highlight-dropdown__section",
2774
+ children: [/*#__PURE__*/jsx(Typography, {
2775
+ className: "neeto-editor-highlight-dropdown__section-title",
2776
+ variant: "body2",
2777
+ weight: "medium",
2778
+ children: title
2779
+ }), /*#__PURE__*/jsx("div", {
2780
+ className: "neeto-editor-highlight-dropdown__color-grid",
2781
+ "data-testid": "neeto-editor-highlight-".concat(hyphenize(title), "-grid"),
2782
+ children: renderColorDots(colors, isTextColor)
2783
+ })]
2784
+ }, title);
2785
+ });
2786
+ if (isSecondaryMenu) {
2787
+ return /*#__PURE__*/jsx(DropdownMenu.SubMenu, {
2788
+ label: label,
2789
+ icon: Highlighter,
2790
+ contentProps: {
2791
+ className: "ne-editor-dropdown neeto-editor-highlight-dropdown w-[280px] p-3"
2792
+ },
2793
+ triggerProps: {
2794
+ "data-testid": "neeto-editor-fixed-menu-highlight-option"
2795
+ },
2796
+ children: renderSections
2797
+ });
2798
+ }
2716
2799
  return /*#__PURE__*/jsx(DropdownMenu, {
2717
2800
  dropdownProps: {
2718
2801
  className: "ne-editor-dropdown w-[280px] p-3"
@@ -2735,24 +2818,7 @@ var HighlightDropdown = function HighlightDropdown(_ref) {
2735
2818
  },
2736
2819
  children: /*#__PURE__*/jsx(DropdownMenu.Menu, {
2737
2820
  className: "neeto-editor-highlight-dropdown",
2738
- children: colorSections.map(function (_ref2) {
2739
- var title = _ref2.title,
2740
- colors = _ref2.colors,
2741
- isTextColor = _ref2.isTextColor;
2742
- return /*#__PURE__*/jsxs("div", {
2743
- className: "neeto-editor-highlight-dropdown__section",
2744
- children: [/*#__PURE__*/jsx(Typography, {
2745
- className: "neeto-editor-highlight-dropdown__section-title",
2746
- variant: "body2",
2747
- weight: "medium",
2748
- children: title
2749
- }), /*#__PURE__*/jsx("div", {
2750
- className: "neeto-editor-highlight-dropdown__color-grid",
2751
- "data-testid": "neeto-editor-highlight-".concat(hyphenize(title), "-grid"),
2752
- children: renderColorDots(colors, isTextColor)
2753
- })]
2754
- }, title);
2755
- })
2821
+ children: renderSections
2756
2822
  })
2757
2823
  });
2758
2824
  };
@@ -2799,13 +2865,57 @@ var TableOption = function TableOption(_ref) {
2799
2865
  return k + 1;
2800
2866
  });
2801
2867
  };
2868
+ var formContent = /*#__PURE__*/jsxs(Fragment$1, {
2869
+ children: [/*#__PURE__*/jsx(Input, {
2870
+ autoFocus: true,
2871
+ "data-testid": "neeto-editor-fixed-menu-table-rows-input",
2872
+ label: t("neetoEditor.menu.rows"),
2873
+ min: "1",
2874
+ placeholder: t("neetoEditor.placeholders.rows"),
2875
+ size: "small",
2876
+ type: "number",
2877
+ value: rows,
2878
+ onChange: withEventTargetValue(setRows)
2879
+ }), /*#__PURE__*/jsx(Input, {
2880
+ "data-testid": "neeto-editor-fixed-menu-table-columns-input",
2881
+ label: t("neetoEditor.menu.columns"),
2882
+ min: "1",
2883
+ placeholder: t("neetoEditor.placeholders.columns"),
2884
+ size: "small",
2885
+ type: "number",
2886
+ value: columns,
2887
+ onChange: withEventTargetValue(setColumns)
2888
+ }), /*#__PURE__*/jsx("div", {
2889
+ className: "neeto-editor-table-menu__button",
2890
+ children: /*#__PURE__*/jsx(Button$1, {
2891
+ className: "mt-auto",
2892
+ "data-testid": "neeto-editor-fixed-menu-table-option-create-button",
2893
+ label: t("neetoEditor.common.create"),
2894
+ size: "sm",
2895
+ onClick: handleSubmit
2896
+ })
2897
+ })]
2898
+ });
2899
+ if (isSecondaryMenu) {
2900
+ return /*#__PURE__*/createElement(DropdownMenu.SubMenu, {
2901
+ label: label,
2902
+ icon: Table,
2903
+ key: resetKey,
2904
+ contentProps: {
2905
+ className: "ne-editor-dropdown neeto-editor-table__item w-auto p-2 flex flex-col"
2906
+ },
2907
+ triggerProps: {
2908
+ "data-testid": "neeto-editor-fixed-menu-table-option"
2909
+ }
2910
+ }, formContent);
2911
+ }
2802
2912
  return /*#__PURE__*/jsx(DropdownMenu, {
2803
2913
  closeOnSelect: false,
2804
2914
  dropdownProps: {
2805
2915
  className: "ne-editor-dropdown w-auto p-2"
2806
2916
  },
2807
2917
  icon: Table,
2808
- position: isSecondaryMenu ? "left-start" : "bottom",
2918
+ position: "bottom",
2809
2919
  buttonProps: {
2810
2920
  tabIndex: -1,
2811
2921
  tooltipProps: {
@@ -2816,42 +2926,10 @@ var TableOption = function TableOption(_ref) {
2816
2926
  className: "ne-toolbar-item ne-toolbar-dropdown",
2817
2927
  "data-testid": "neeto-editor-fixed-menu-table-option"
2818
2928
  },
2819
- customTarget: isSecondaryMenu && /*#__PURE__*/jsx(SecondaryMenuTarget, {
2820
- label: label,
2821
- icon: Table
2822
- }),
2823
2929
  onClose: handleClose,
2824
- children: /*#__PURE__*/jsxs(Menu$1, {
2930
+ children: /*#__PURE__*/jsx(Menu$1, {
2825
2931
  className: "neeto-editor-table__item",
2826
- children: [/*#__PURE__*/jsx(Input, {
2827
- autoFocus: true,
2828
- "data-testid": "neeto-editor-fixed-menu-table-rows-input",
2829
- label: t("neetoEditor.menu.rows"),
2830
- min: "1",
2831
- placeholder: t("neetoEditor.placeholders.rows"),
2832
- size: "small",
2833
- type: "number",
2834
- value: rows,
2835
- onChange: withEventTargetValue(setRows)
2836
- }), /*#__PURE__*/jsx(Input, {
2837
- "data-testid": "neeto-editor-fixed-menu-table-columns-input",
2838
- label: t("neetoEditor.menu.columns"),
2839
- min: "1",
2840
- placeholder: t("neetoEditor.placeholders.rows"),
2841
- size: "small",
2842
- type: "number",
2843
- value: columns,
2844
- onChange: withEventTargetValue(setColumns)
2845
- }), /*#__PURE__*/jsx("div", {
2846
- className: "neeto-editor-table-menu__button",
2847
- children: /*#__PURE__*/jsx(Button$1, {
2848
- className: "mt-auto",
2849
- "data-testid": "neeto-editor-fixed-menu-table-option-create-button",
2850
- label: t("neetoEditor.common.create"),
2851
- size: "sm",
2852
- onClick: handleSubmit
2853
- })
2854
- })]
2932
+ children: formContent
2855
2933
  })
2856
2934
  }, resetKey);
2857
2935
  };
@@ -3345,4 +3423,4 @@ var Menu = function Menu(props) {
3345
3423
  };
3346
3424
 
3347
3425
  export { CALLOUT_TYPES as C, DEFAULT_EDITOR_OPTIONS as D, EmojiPickerMenu as E, LINK_VALIDATION_SCHEMA as L, Menu as M, isEmojiSuggestionsMenuActive as a, buildLevelsFromOptions as b, validateAndFormatUrl as c, getEditorStyles as d, MenuDynamicVariables as e, MediaUploader as f, getLinkPopoverPosition as g, LinkAddPopOver as h, isEditorOverlaysActive as i, transformPastedHTML as j, clipboardTextParser as k, setInitialPosition as s, transformEditorContent as t, validateUrl as v };
3348
- //# sourceMappingURL=chunk-C9Hjlrrk.js.map
3426
+ //# sourceMappingURL=chunk-BziexhfV.js.map