@bigbinary/neeto-editor 1.47.67 → 1.47.69

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.
@@ -8,7 +8,7 @@ import Editor from './Editor.js';
8
8
  import { jsx } from 'react/jsx-runtime';
9
9
  import '@babel/runtime/helpers/toConsumableArray';
10
10
  import '@babel/runtime/helpers/slicedToArray';
11
- import './chunk-BYP78yHy.js';
11
+ import './chunk-Bb0y1lai.js';
12
12
  import './chunk-DmrvuTKK.js';
13
13
  import 'i18next';
14
14
  import '@bigbinary/neeto-icons/TextH1';
@@ -68,7 +68,6 @@ import '@bigbinary/neeto-icons/Customize';
68
68
  import '@bigbinary/neeto-icons/Refresh';
69
69
  import '@bigbinary/neetoui/Input';
70
70
  import 'react-colorful';
71
- import '@bigbinary/neeto-molecules/DynamicVariables';
72
71
  import '@bigbinary/neeto-image-uploader-frontend';
73
72
  import '@bigbinary/neetoui/Modal';
74
73
  import '@bigbinary/neetoui/Tab';
@@ -99,6 +98,7 @@ import '@bigbinary/neeto-icons/misc/Danger';
99
98
  import '@bigbinary/neeto-icons/misc/Megaphone';
100
99
  import '@bigbinary/neeto-icons/misc/Success';
101
100
  import '@bigbinary/neeto-icons/MenuHorizontal';
101
+ import '@bigbinary/neeto-molecules/DynamicVariables';
102
102
  import '@tippyjs/react';
103
103
  import './chunk-BtgLcjAt.js';
104
104
  import '@tanstack/react-query';
package/dist/Menu.js CHANGED
@@ -3,7 +3,7 @@ import '@babel/runtime/helpers/toConsumableArray';
3
3
  import '@babel/runtime/helpers/slicedToArray';
4
4
  import 'react';
5
5
  import 'ramda';
6
- export { M as default } from './chunk-BYP78yHy.js';
6
+ export { M as default } from './chunk-Bb0y1lai.js';
7
7
  import './chunk-BnpU7flF.js';
8
8
  import 'react/jsx-runtime';
9
9
  import './chunk-DmrvuTKK.js';
@@ -65,7 +65,6 @@ import '@bigbinary/neeto-icons/Refresh';
65
65
  import '@bigbinary/neetoui/Input';
66
66
  import 'react-colorful';
67
67
  import '@babel/runtime/helpers/objectWithoutProperties';
68
- import '@bigbinary/neeto-molecules/DynamicVariables';
69
68
  import '@bigbinary/neeto-image-uploader-frontend';
70
69
  import '@bigbinary/neetoui/Modal';
71
70
  import '@bigbinary/neetoui/Tab';
@@ -97,5 +96,6 @@ import '@bigbinary/neeto-icons/misc/Danger';
97
96
  import '@bigbinary/neeto-icons/misc/Megaphone';
98
97
  import '@bigbinary/neeto-icons/misc/Success';
99
98
  import '@bigbinary/neeto-icons/MenuHorizontal';
99
+ import '@bigbinary/neeto-molecules/DynamicVariables';
100
100
  import '@tippyjs/react';
101
101
  //# sourceMappingURL=Menu.js.map
@@ -63,7 +63,6 @@ import Refresh from '@bigbinary/neeto-icons/Refresh';
63
63
  import Input from '@bigbinary/neetoui/Input';
64
64
  import { HexColorPicker } from 'react-colorful';
65
65
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
66
- import DynamicVariables from '@bigbinary/neeto-molecules/DynamicVariables';
67
66
  import { ImageUploader } from '@bigbinary/neeto-image-uploader-frontend';
68
67
  import Modal from '@bigbinary/neetoui/Modal';
69
68
  import Tab from '@bigbinary/neetoui/Tab';
@@ -85,6 +84,7 @@ import Danger from '@bigbinary/neeto-icons/misc/Danger';
85
84
  import Megaphone from '@bigbinary/neeto-icons/misc/Megaphone';
86
85
  import Success from '@bigbinary/neeto-icons/misc/Success';
87
86
  import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
87
+ import DynamicVariables from '@bigbinary/neeto-molecules/DynamicVariables';
88
88
  import Tippy from '@tippyjs/react';
89
89
  import { D as DEFAULT_EDITOR_OPTIONS } from './chunk-BnpU7flF.js';
90
90
 
@@ -15809,6 +15809,7 @@ var CalloutTypeOption = function CalloutTypeOption(_ref) {
15809
15809
  className: optionClass,
15810
15810
  children: [/*#__PURE__*/jsx("span", {
15811
15811
  className: "neeto-editor-callout-dropdown__type-emoji",
15812
+ "data-cy": "callout-type-emoji",
15812
15813
  children: /*#__PURE__*/jsx(Icon, {})
15813
15814
  }), /*#__PURE__*/jsx(Typography, {
15814
15815
  className: "neeto-editor-callout-dropdown__type-label",
@@ -17442,6 +17443,53 @@ var useEditorState = function useEditorState(_ref) {
17442
17443
  }, [editor, neetoKbArticleState === null || neetoKbArticleState === void 0 ? void 0 : neetoKbArticleState.active, handleSelectionUpdate]);
17443
17444
  };
17444
17445
 
17446
+ var MenuDynamicVariables = function MenuDynamicVariables(_ref) {
17447
+ var editor = _ref.editor,
17448
+ _ref$variables = _ref.variables,
17449
+ variables = _ref$variables === void 0 ? [] : _ref$variables,
17450
+ _ref$standalone = _ref.standalone,
17451
+ standalone = _ref$standalone === void 0 ? false : _ref$standalone;
17452
+ var _useTranslation = useTranslation(),
17453
+ t = _useTranslation.t;
17454
+ if (isEmpty(variables)) return null;
17455
+ var handleVariableClick = function handleVariableClick(item) {
17456
+ var category = item.category,
17457
+ categoryLabel = item.categoryLabel,
17458
+ key = item.key,
17459
+ label = item.label;
17460
+ var variableName = category ? "".concat(category, ".").concat(key) : key;
17461
+ var variableLabel = category ? "".concat(categoryLabel || category, ":").concat(label) : label;
17462
+ editor.chain().focus().setVariable({
17463
+ id: variableName,
17464
+ label: variableLabel
17465
+ }).run();
17466
+ };
17467
+ return /*#__PURE__*/jsx("div", {
17468
+ className: "neeto-editor-fixed-menu__variables",
17469
+ "data-cy": "neeto-editor-fixed-menu-variables",
17470
+ style: standalone ? {
17471
+ position: "absolute",
17472
+ right: "0px",
17473
+ top: "8px",
17474
+ bottom: "auto",
17475
+ zIndex: 10
17476
+ } : undefined,
17477
+ children: /*#__PURE__*/jsx(DynamicVariables, {
17478
+ variables: variables,
17479
+ dropdownProps: {
17480
+ buttonSize: "small",
17481
+ buttonProps: {
17482
+ tooltipProps: {
17483
+ content: t("neetoEditor.menu.dynamicVariables"),
17484
+ position: "bottom"
17485
+ }
17486
+ }
17487
+ },
17488
+ onVariableClick: handleVariableClick
17489
+ })
17490
+ });
17491
+ };
17492
+
17445
17493
  var _excluded$2 = ["type"];
17446
17494
  function ownKeys$7(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; }
17447
17495
  function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -17492,8 +17540,6 @@ var Fixed = function Fixed(_ref) {
17492
17540
  }, [editor]);
17493
17541
  var menuRef = useRef(null);
17494
17542
  var menuContainerRef = useRef(null);
17495
- var _useTranslation = useTranslation(),
17496
- t = _useTranslation.t;
17497
17543
  var runEditorCommand = useCallback(function (command) {
17498
17544
  return function () {
17499
17545
  return command(editorRef.current);
@@ -17566,18 +17612,6 @@ var Fixed = function Fixed(_ref) {
17566
17612
  }, [menuContainerRef.current, handleResize, menuGroups]);
17567
17613
  if (!editor) return null;
17568
17614
  var isMediaUploaderActive = options.includes(EDITOR_OPTIONS.IMAGE_UPLOAD) || options.includes(EDITOR_OPTIONS.VIDEO_UPLOAD);
17569
- var handleVariableClick = function handleVariableClick(item) {
17570
- var category = item.category,
17571
- categoryLabel = item.categoryLabel,
17572
- key = item.key,
17573
- label = item.label;
17574
- var variableName = category ? "".concat(category, ".").concat(key) : key;
17575
- var variableLabel = category ? "".concat(categoryLabel || category, ":").concat(label) : label;
17576
- editor.chain().focus().setVariable({
17577
- id: variableName,
17578
- label: variableLabel
17579
- }).run();
17580
- };
17581
17615
  return /*#__PURE__*/jsxs("div", {
17582
17616
  ref: menuContainerRef,
17583
17617
  className: classnames("neeto-editor-fixed-menu", _defineProperty({
@@ -17602,22 +17636,9 @@ var Fixed = function Fixed(_ref) {
17602
17636
  editor: editor,
17603
17637
  groups: moreMenuItems
17604
17638
  })]
17605
- }), !isEmpty(variables) && /*#__PURE__*/jsx("div", {
17606
- className: "neeto-editor-fixed-menu__variables",
17607
- "data-cy": "neeto-editor-fixed-menu-variables",
17608
- children: /*#__PURE__*/jsx(DynamicVariables, {
17609
- variables: variables,
17610
- dropdownProps: {
17611
- buttonSize: "small",
17612
- buttonProps: {
17613
- tooltipProps: {
17614
- content: t("neetoEditor.menu.dynamicVariables"),
17615
- position: "bottom"
17616
- }
17617
- }
17618
- },
17619
- onVariableClick: handleVariableClick
17620
- })
17639
+ }), /*#__PURE__*/jsx(MenuDynamicVariables, {
17640
+ editor: editor,
17641
+ variables: variables
17621
17642
  }), isAddLinkActive && /*#__PURE__*/jsx(LinkAddPopOver, {
17622
17643
  editor: editor,
17623
17644
  isAddLinkActive: isAddLinkActive,
@@ -18953,5 +18974,5 @@ var Menu = function Menu(props) {
18953
18974
  }));
18954
18975
  };
18955
18976
 
18956
- export { getChangedRanges as A, findChildrenInRange as B, CALLOUT_TYPES as C, DecorationSet as D, Extension as E, getMarksBetween as F, getAttributes as G, highlightFocussedNode as H, InputRule as I, resetFocussedNode as J, findParentNodeClosestToPos as K, BubbleMenu as L, Menu as M, Node as N, getLinkPopoverPosition as O, PasteRule as P, getMarkType as Q, ReactNodeViewRenderer as R, getMarkRange as S, useEditor as T, useEditorState$1 as U, EditorContent as V, MediaUploader as W, LinkAddPopOver as X, EditorView as Y, Mark as a, markInputRule as b, markPasteRule as c, Decoration as d, callOrReturn as e, getExtensionField as f, getMarkAttributes as g, getNodeType as h, isNodeSelection as i, getNodeAtPosition as j, keydownHandler as k, isNodeActive as l, mergeAttributes as m, nodeInputRule as n, isAtStartOfNode as o, isAtEndOfNode as p, NodeViewWrapper as q, NodeViewContent as r, findChildren as s, textblockTypeInputRule as t, escapeForRegEx as u, ReactRenderer as v, wrappingInputRule as w, EmojiPickerMenu as x, emojiPickerApi as y, combineTransactionSteps as z };
18957
- //# sourceMappingURL=chunk-BYP78yHy.js.map
18977
+ export { getChangedRanges as A, findChildrenInRange as B, CALLOUT_TYPES as C, DecorationSet as D, Extension as E, getMarksBetween as F, getAttributes as G, highlightFocussedNode as H, InputRule as I, resetFocussedNode as J, findParentNodeClosestToPos as K, BubbleMenu as L, Menu as M, Node as N, getLinkPopoverPosition as O, PasteRule as P, getMarkType as Q, ReactNodeViewRenderer as R, getMarkRange as S, useEditor as T, useEditorState$1 as U, MenuDynamicVariables as V, EditorContent as W, MediaUploader as X, LinkAddPopOver as Y, EditorView as Z, Mark as a, markInputRule as b, markPasteRule as c, Decoration as d, callOrReturn as e, getExtensionField as f, getMarkAttributes as g, getNodeType as h, isNodeSelection as i, getNodeAtPosition as j, keydownHandler as k, isNodeActive as l, mergeAttributes as m, nodeInputRule as n, isAtStartOfNode as o, isAtEndOfNode as p, NodeViewWrapper as q, NodeViewContent as r, findChildren as s, textblockTypeInputRule as t, escapeForRegEx as u, ReactRenderer as v, wrappingInputRule as w, EmojiPickerMenu as x, emojiPickerApi as y, combineTransactionSteps as z };
18978
+ //# sourceMappingURL=chunk-Bb0y1lai.js.map