@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.
@@ -10,7 +10,7 @@ var Editor = require('./Editor.cjs.js');
10
10
  var jsxRuntime = require('react/jsx-runtime');
11
11
  require('@babel/runtime/helpers/toConsumableArray');
12
12
  require('@babel/runtime/helpers/slicedToArray');
13
- require('./chunk-TLlmBkfB.cjs.js');
13
+ require('./chunk-BwbMuztF.cjs.js');
14
14
  require('./chunk-vQvjPR2x.cjs.js');
15
15
  require('i18next');
16
16
  require('@bigbinary/neeto-icons/TextH1');
@@ -70,7 +70,6 @@ require('@bigbinary/neeto-icons/Customize');
70
70
  require('@bigbinary/neeto-icons/Refresh');
71
71
  require('@bigbinary/neetoui/Input');
72
72
  require('react-colorful');
73
- require('@bigbinary/neeto-molecules/DynamicVariables');
74
73
  require('@bigbinary/neeto-image-uploader-frontend');
75
74
  require('@bigbinary/neetoui/Modal');
76
75
  require('@bigbinary/neetoui/Tab');
@@ -101,6 +100,7 @@ require('@bigbinary/neeto-icons/misc/Danger');
101
100
  require('@bigbinary/neeto-icons/misc/Megaphone');
102
101
  require('@bigbinary/neeto-icons/misc/Success');
103
102
  require('@bigbinary/neeto-icons/MenuHorizontal');
103
+ require('@bigbinary/neeto-molecules/DynamicVariables');
104
104
  require('@tippyjs/react');
105
105
  require('./chunk-BCWKqDeP.cjs.js');
106
106
  require('@tanstack/react-query');
@@ -5,7 +5,7 @@ require('@babel/runtime/helpers/toConsumableArray');
5
5
  require('@babel/runtime/helpers/slicedToArray');
6
6
  require('react');
7
7
  require('ramda');
8
- var Menu = require('./chunk-TLlmBkfB.cjs.js');
8
+ var Menu = require('./chunk-BwbMuztF.cjs.js');
9
9
  require('./chunk-I_4mZ3Ky.cjs.js');
10
10
  require('react/jsx-runtime');
11
11
  require('./chunk-vQvjPR2x.cjs.js');
@@ -67,7 +67,6 @@ require('@bigbinary/neeto-icons/Refresh');
67
67
  require('@bigbinary/neetoui/Input');
68
68
  require('react-colorful');
69
69
  require('@babel/runtime/helpers/objectWithoutProperties');
70
- require('@bigbinary/neeto-molecules/DynamicVariables');
71
70
  require('@bigbinary/neeto-image-uploader-frontend');
72
71
  require('@bigbinary/neetoui/Modal');
73
72
  require('@bigbinary/neetoui/Tab');
@@ -99,6 +98,7 @@ require('@bigbinary/neeto-icons/misc/Danger');
99
98
  require('@bigbinary/neeto-icons/misc/Megaphone');
100
99
  require('@bigbinary/neeto-icons/misc/Success');
101
100
  require('@bigbinary/neeto-icons/MenuHorizontal');
101
+ require('@bigbinary/neeto-molecules/DynamicVariables');
102
102
  require('@tippyjs/react');
103
103
 
104
104
 
@@ -65,7 +65,6 @@ var Refresh = require('@bigbinary/neeto-icons/Refresh');
65
65
  var Input = require('@bigbinary/neetoui/Input');
66
66
  var reactColorful = require('react-colorful');
67
67
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
68
- var DynamicVariables = require('@bigbinary/neeto-molecules/DynamicVariables');
69
68
  var neetoImageUploaderFrontend = require('@bigbinary/neeto-image-uploader-frontend');
70
69
  var Modal = require('@bigbinary/neetoui/Modal');
71
70
  var Tab = require('@bigbinary/neetoui/Tab');
@@ -87,6 +86,7 @@ var Danger = require('@bigbinary/neeto-icons/misc/Danger');
87
86
  var Megaphone = require('@bigbinary/neeto-icons/misc/Megaphone');
88
87
  var Success = require('@bigbinary/neeto-icons/misc/Success');
89
88
  var MenuHorizontal = require('@bigbinary/neeto-icons/MenuHorizontal');
89
+ var DynamicVariables = require('@bigbinary/neeto-molecules/DynamicVariables');
90
90
  var Tippy = require('@tippyjs/react');
91
91
  var constants$1 = require('./chunk-I_4mZ3Ky.cjs.js');
92
92
 
@@ -15811,6 +15811,7 @@ var CalloutTypeOption = function CalloutTypeOption(_ref) {
15811
15811
  className: optionClass,
15812
15812
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
15813
15813
  className: "neeto-editor-callout-dropdown__type-emoji",
15814
+ "data-cy": "callout-type-emoji",
15814
15815
  children: /*#__PURE__*/jsxRuntime.jsx(Icon, {})
15815
15816
  }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
15816
15817
  className: "neeto-editor-callout-dropdown__type-label",
@@ -17444,6 +17445,53 @@ var useEditorState = function useEditorState(_ref) {
17444
17445
  }, [editor, neetoKbArticleState === null || neetoKbArticleState === void 0 ? void 0 : neetoKbArticleState.active, handleSelectionUpdate]);
17445
17446
  };
17446
17447
 
17448
+ var MenuDynamicVariables = function MenuDynamicVariables(_ref) {
17449
+ var editor = _ref.editor,
17450
+ _ref$variables = _ref.variables,
17451
+ variables = _ref$variables === void 0 ? [] : _ref$variables,
17452
+ _ref$standalone = _ref.standalone,
17453
+ standalone = _ref$standalone === void 0 ? false : _ref$standalone;
17454
+ var _useTranslation = reactI18next.useTranslation(),
17455
+ t = _useTranslation.t;
17456
+ if (ramda.isEmpty(variables)) return null;
17457
+ var handleVariableClick = function handleVariableClick(item) {
17458
+ var category = item.category,
17459
+ categoryLabel = item.categoryLabel,
17460
+ key = item.key,
17461
+ label = item.label;
17462
+ var variableName = category ? "".concat(category, ".").concat(key) : key;
17463
+ var variableLabel = category ? "".concat(categoryLabel || category, ":").concat(label) : label;
17464
+ editor.chain().focus().setVariable({
17465
+ id: variableName,
17466
+ label: variableLabel
17467
+ }).run();
17468
+ };
17469
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
17470
+ className: "neeto-editor-fixed-menu__variables",
17471
+ "data-cy": "neeto-editor-fixed-menu-variables",
17472
+ style: standalone ? {
17473
+ position: "absolute",
17474
+ right: "0px",
17475
+ top: "8px",
17476
+ bottom: "auto",
17477
+ zIndex: 10
17478
+ } : undefined,
17479
+ children: /*#__PURE__*/jsxRuntime.jsx(DynamicVariables, {
17480
+ variables: variables,
17481
+ dropdownProps: {
17482
+ buttonSize: "small",
17483
+ buttonProps: {
17484
+ tooltipProps: {
17485
+ content: t("neetoEditor.menu.dynamicVariables"),
17486
+ position: "bottom"
17487
+ }
17488
+ }
17489
+ },
17490
+ onVariableClick: handleVariableClick
17491
+ })
17492
+ });
17493
+ };
17494
+
17447
17495
  var _excluded$2 = ["type"];
17448
17496
  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; }
17449
17497
  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; }
@@ -17494,8 +17542,6 @@ var Fixed = function Fixed(_ref) {
17494
17542
  }, [editor]);
17495
17543
  var menuRef = React.useRef(null);
17496
17544
  var menuContainerRef = React.useRef(null);
17497
- var _useTranslation = reactI18next.useTranslation(),
17498
- t = _useTranslation.t;
17499
17545
  var runEditorCommand = React.useCallback(function (command) {
17500
17546
  return function () {
17501
17547
  return command(editorRef.current);
@@ -17568,18 +17614,6 @@ var Fixed = function Fixed(_ref) {
17568
17614
  }, [menuContainerRef.current, handleResize, menuGroups]);
17569
17615
  if (!editor) return null;
17570
17616
  var isMediaUploaderActive = options.includes(constants.EDITOR_OPTIONS.IMAGE_UPLOAD) || options.includes(constants.EDITOR_OPTIONS.VIDEO_UPLOAD);
17571
- var handleVariableClick = function handleVariableClick(item) {
17572
- var category = item.category,
17573
- categoryLabel = item.categoryLabel,
17574
- key = item.key,
17575
- label = item.label;
17576
- var variableName = category ? "".concat(category, ".").concat(key) : key;
17577
- var variableLabel = category ? "".concat(categoryLabel || category, ":").concat(label) : label;
17578
- editor.chain().focus().setVariable({
17579
- id: variableName,
17580
- label: variableLabel
17581
- }).run();
17582
- };
17583
17617
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
17584
17618
  ref: menuContainerRef,
17585
17619
  className: classnames("neeto-editor-fixed-menu", _defineProperty({
@@ -17604,22 +17638,9 @@ var Fixed = function Fixed(_ref) {
17604
17638
  editor: editor,
17605
17639
  groups: moreMenuItems
17606
17640
  })]
17607
- }), !ramda.isEmpty(variables) && /*#__PURE__*/jsxRuntime.jsx("div", {
17608
- className: "neeto-editor-fixed-menu__variables",
17609
- "data-cy": "neeto-editor-fixed-menu-variables",
17610
- children: /*#__PURE__*/jsxRuntime.jsx(DynamicVariables, {
17611
- variables: variables,
17612
- dropdownProps: {
17613
- buttonSize: "small",
17614
- buttonProps: {
17615
- tooltipProps: {
17616
- content: t("neetoEditor.menu.dynamicVariables"),
17617
- position: "bottom"
17618
- }
17619
- }
17620
- },
17621
- onVariableClick: handleVariableClick
17622
- })
17641
+ }), /*#__PURE__*/jsxRuntime.jsx(MenuDynamicVariables, {
17642
+ editor: editor,
17643
+ variables: variables
17623
17644
  }), isAddLinkActive && /*#__PURE__*/jsxRuntime.jsx(LinkAddPopOver, {
17624
17645
  editor: editor,
17625
17646
  isAddLinkActive: isAddLinkActive,
@@ -18968,6 +18989,7 @@ exports.LinkAddPopOver = LinkAddPopOver;
18968
18989
  exports.Mark = Mark;
18969
18990
  exports.MediaUploader = MediaUploader;
18970
18991
  exports.Menu = Menu;
18992
+ exports.MenuDynamicVariables = MenuDynamicVariables;
18971
18993
  exports.Node = Node;
18972
18994
  exports.NodeViewContent = NodeViewContent;
18973
18995
  exports.NodeViewWrapper = NodeViewWrapper;
@@ -19006,4 +19028,4 @@ exports.textblockTypeInputRule = textblockTypeInputRule;
19006
19028
  exports.useEditor = useEditor;
19007
19029
  exports.useEditorState = useEditorState$1;
19008
19030
  exports.wrappingInputRule = wrappingInputRule;
19009
- //# sourceMappingURL=chunk-TLlmBkfB.cjs.js.map
19031
+ //# sourceMappingURL=chunk-BwbMuztF.cjs.js.map