@bigbinary/neeto-editor 1.47.68 → 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-BFpvPDMY.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-BFpvPDMY.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
 
@@ -17445,6 +17445,53 @@ var useEditorState = function useEditorState(_ref) {
17445
17445
  }, [editor, neetoKbArticleState === null || neetoKbArticleState === void 0 ? void 0 : neetoKbArticleState.active, handleSelectionUpdate]);
17446
17446
  };
17447
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
+
17448
17495
  var _excluded$2 = ["type"];
17449
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; }
17450
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; }
@@ -17495,8 +17542,6 @@ var Fixed = function Fixed(_ref) {
17495
17542
  }, [editor]);
17496
17543
  var menuRef = React.useRef(null);
17497
17544
  var menuContainerRef = React.useRef(null);
17498
- var _useTranslation = reactI18next.useTranslation(),
17499
- t = _useTranslation.t;
17500
17545
  var runEditorCommand = React.useCallback(function (command) {
17501
17546
  return function () {
17502
17547
  return command(editorRef.current);
@@ -17569,18 +17614,6 @@ var Fixed = function Fixed(_ref) {
17569
17614
  }, [menuContainerRef.current, handleResize, menuGroups]);
17570
17615
  if (!editor) return null;
17571
17616
  var isMediaUploaderActive = options.includes(constants.EDITOR_OPTIONS.IMAGE_UPLOAD) || options.includes(constants.EDITOR_OPTIONS.VIDEO_UPLOAD);
17572
- var handleVariableClick = function handleVariableClick(item) {
17573
- var category = item.category,
17574
- categoryLabel = item.categoryLabel,
17575
- key = item.key,
17576
- label = item.label;
17577
- var variableName = category ? "".concat(category, ".").concat(key) : key;
17578
- var variableLabel = category ? "".concat(categoryLabel || category, ":").concat(label) : label;
17579
- editor.chain().focus().setVariable({
17580
- id: variableName,
17581
- label: variableLabel
17582
- }).run();
17583
- };
17584
17617
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
17585
17618
  ref: menuContainerRef,
17586
17619
  className: classnames("neeto-editor-fixed-menu", _defineProperty({
@@ -17605,22 +17638,9 @@ var Fixed = function Fixed(_ref) {
17605
17638
  editor: editor,
17606
17639
  groups: moreMenuItems
17607
17640
  })]
17608
- }), !ramda.isEmpty(variables) && /*#__PURE__*/jsxRuntime.jsx("div", {
17609
- className: "neeto-editor-fixed-menu__variables",
17610
- "data-cy": "neeto-editor-fixed-menu-variables",
17611
- children: /*#__PURE__*/jsxRuntime.jsx(DynamicVariables, {
17612
- variables: variables,
17613
- dropdownProps: {
17614
- buttonSize: "small",
17615
- buttonProps: {
17616
- tooltipProps: {
17617
- content: t("neetoEditor.menu.dynamicVariables"),
17618
- position: "bottom"
17619
- }
17620
- }
17621
- },
17622
- onVariableClick: handleVariableClick
17623
- })
17641
+ }), /*#__PURE__*/jsxRuntime.jsx(MenuDynamicVariables, {
17642
+ editor: editor,
17643
+ variables: variables
17624
17644
  }), isAddLinkActive && /*#__PURE__*/jsxRuntime.jsx(LinkAddPopOver, {
17625
17645
  editor: editor,
17626
17646
  isAddLinkActive: isAddLinkActive,
@@ -18969,6 +18989,7 @@ exports.LinkAddPopOver = LinkAddPopOver;
18969
18989
  exports.Mark = Mark;
18970
18990
  exports.MediaUploader = MediaUploader;
18971
18991
  exports.Menu = Menu;
18992
+ exports.MenuDynamicVariables = MenuDynamicVariables;
18972
18993
  exports.Node = Node;
18973
18994
  exports.NodeViewContent = NodeViewContent;
18974
18995
  exports.NodeViewWrapper = NodeViewWrapper;
@@ -19007,4 +19028,4 @@ exports.textblockTypeInputRule = textblockTypeInputRule;
19007
19028
  exports.useEditor = useEditor;
19008
19029
  exports.useEditorState = useEditorState$1;
19009
19030
  exports.wrappingInputRule = wrappingInputRule;
19010
- //# sourceMappingURL=chunk-BFpvPDMY.cjs.js.map
19031
+ //# sourceMappingURL=chunk-BwbMuztF.cjs.js.map