@bigbinary/neeto-editor 1.43.32 → 1.43.33

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.
package/dist/Editor.js CHANGED
@@ -4,7 +4,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
5
  import * as React from 'react';
6
6
  import React__default, { memo, useEffect, useState, useRef, useCallback, createElement, forwardRef, useImperativeHandle } from 'react';
7
- import { E as Extension, a as Mark, m as mergeAttributes, b as markInputRule, c as markPasteRule, D as DecorationSet, d as Decoration, g as getMarkAttributes, N as Node, w as wrappingInputRule, t as textblockTypeInputRule, k as keydownHandler, e as callOrReturn, f as getExtensionField, i as isNodeSelection, n as nodeInputRule, h as findChildren, j as NodeViewWrapper, l as NodeViewContent, R as ReactNodeViewRenderer, P as PasteRule, v as validateUrl, o as escapeForRegEx, p as ReactRenderer, q as EmojiPickerMenu, r as emojiPickerApi, s as liftTarget, u as combineTransactionSteps, x as getChangedRanges, y as findChildrenInRange, z as getMarksBetween, A as getAttributes, I as InputRule, B as highlightFocussedNode, C as resetFocussedNode, F as findParentNodeClosestToPos, G as BubbleMenu, H as getLinkPopoverPosition, J as getMarkType, K as getMarkRange, L as useEditor, O as useEditorState, M as Menu$3, Q as EditorContent, S as MediaUploader, T as EmbedOption, U as EditorView } from './chunk-BnTGH3g0.js';
7
+ import { E as Extension, a as Mark, m as mergeAttributes, b as markInputRule, c as markPasteRule, D as DecorationSet, d as Decoration, g as getMarkAttributes, N as Node, w as wrappingInputRule, t as textblockTypeInputRule, k as keydownHandler, e as callOrReturn, f as getExtensionField, i as isNodeSelection, n as nodeInputRule, h as findChildren, j as NodeViewWrapper, l as NodeViewContent, R as ReactNodeViewRenderer, P as PasteRule, v as validateUrl, o as escapeForRegEx, p as ReactRenderer, q as EmojiPickerMenu, r as emojiPickerApi, s as liftTarget, u as combineTransactionSteps, x as getChangedRanges, y as findChildrenInRange, z as getMarksBetween, A as getAttributes, I as InputRule, B as highlightFocussedNode, C as resetFocussedNode, F as findParentNodeClosestToPos, G as BubbleMenu, H as getLinkPopoverPosition, J as getMarkType, K as getMarkRange, L as useEditor, O as useEditorState, M as Menu$3, Q as EditorContent, S as MediaUploader, T as EmbedOption, U as EditorView } from './chunk-CWeT8E0d.js';
8
8
  import classnames from 'classnames';
9
9
  import { C as COMBINED_REGEX, D as DIRECT_UPLOAD_ENDPOINT, a as EDITOR_OPTIONS, E as EDITOR_SIZES } from './chunk-Bxks2B7X.js';
10
10
  import { isNotPresent, isNotEmpty, isPresent, noop as noop$1, slugify } from '@bigbinary/neeto-cist';
@@ -7,7 +7,7 @@ import Editor from './Editor.js';
7
7
  import { jsx } from 'react/jsx-runtime';
8
8
  import '@babel/runtime/helpers/toConsumableArray';
9
9
  import '@babel/runtime/helpers/slicedToArray';
10
- import './chunk-BnTGH3g0.js';
10
+ import './chunk-CWeT8E0d.js';
11
11
  import 'ramda';
12
12
  import './chunk-DmrvuTKK.js';
13
13
  import 'i18next';
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-BnTGH3g0.js';
6
+ export { M as default } from './chunk-CWeT8E0d.js';
7
7
  import './chunk-CaJ2_Km6.js';
8
8
  import 'react/jsx-runtime';
9
9
  import './chunk-DmrvuTKK.js';
@@ -16164,8 +16164,9 @@ var buildBubbleMenuOptions = function buildBubbleMenuOptions(_ref2) {
16164
16164
  }));
16165
16165
  };
16166
16166
  var getTextMenuDropdownOptions = function getTextMenuDropdownOptions(_ref3) {
16167
- var editor = _ref3.editor;
16168
- return [{
16167
+ var editor = _ref3.editor,
16168
+ options = _ref3.options;
16169
+ var textOptions = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, EDITOR_OPTIONS.H1, {
16169
16170
  optionName: "Heading 1",
16170
16171
  active: editor.isActive("heading", {
16171
16172
  level: 1
@@ -16175,7 +16176,7 @@ var getTextMenuDropdownOptions = function getTextMenuDropdownOptions(_ref3) {
16175
16176
  level: 1
16176
16177
  }).run();
16177
16178
  }
16178
- }, {
16179
+ }), EDITOR_OPTIONS.H2, {
16179
16180
  optionName: "Heading 2",
16180
16181
  active: editor.isActive("heading", {
16181
16182
  level: 2
@@ -16185,7 +16186,7 @@ var getTextMenuDropdownOptions = function getTextMenuDropdownOptions(_ref3) {
16185
16186
  level: 2
16186
16187
  }).run();
16187
16188
  }
16188
- }, {
16189
+ }), EDITOR_OPTIONS.H3, {
16189
16190
  optionName: "Heading 3",
16190
16191
  active: editor.isActive("heading", {
16191
16192
  level: 3
@@ -16195,25 +16196,31 @@ var getTextMenuDropdownOptions = function getTextMenuDropdownOptions(_ref3) {
16195
16196
  level: 3
16196
16197
  }).run();
16197
16198
  }
16198
- }, {
16199
+ }), EDITOR_OPTIONS.LIST_ORDERED, {
16199
16200
  optionName: "Ordered List",
16200
16201
  active: editor.isActive("orderedList"),
16201
16202
  command: function command() {
16202
16203
  return editor.chain().focus().toggleOrderedList().run();
16203
16204
  }
16204
- }, {
16205
+ }), EDITOR_OPTIONS.LIST_BULLETS, {
16205
16206
  optionName: "Bulleted List",
16206
16207
  active: editor.isActive("bulletList"),
16207
16208
  command: function command() {
16208
16209
  return editor.chain().focus().toggleBulletList().run();
16209
16210
  }
16210
- }, {
16211
+ }), EDITOR_OPTIONS.PARAGRAPH, {
16211
16212
  optionName: "Text",
16212
16213
  active: editor.isActive("paragraph"),
16213
16214
  command: function command() {
16214
16215
  return editor.chain().focus().setNode("paragraph").run();
16215
16216
  }
16216
- }];
16217
+ });
16218
+ var result = [];
16219
+ options.forEach(function (option) {
16220
+ if (!textOptions[option]) return;
16221
+ result.push(textOptions[option]);
16222
+ });
16223
+ return result;
16217
16224
  };
16218
16225
  var getNodeType = function getNodeType(options) {
16219
16226
  var _options$find;
@@ -16422,14 +16429,14 @@ var Options = function Options(_ref) {
16422
16429
  attachmentProps = _ref.attachmentProps,
16423
16430
  isEmojiPickerActive = _ref.isEmojiPickerActive,
16424
16431
  setIsEmojiPickerActive = _ref.setIsEmojiPickerActive,
16425
- setIsEmbedModalOpen = _ref.setIsEmbedModalOpen,
16426
- children = _ref.children;
16432
+ setIsEmbedModalOpen = _ref.setIsEmbedModalOpen;
16427
16433
  var _useTranslation = useTranslation(),
16428
16434
  t = _useTranslation.t;
16429
16435
  var Menu = Dropdown$1.Menu,
16430
16436
  MenuItem = Dropdown$1.MenuItem;
16431
16437
  var dropdownOptions = getTextMenuDropdownOptions({
16432
- editor: editor
16438
+ editor: editor,
16439
+ options: options
16433
16440
  });
16434
16441
  var nodeType = getNodeType(dropdownOptions);
16435
16442
  var isEmojiActive = options.includes(EDITOR_OPTIONS.EMOJI);
@@ -16517,7 +16524,7 @@ var Options = function Options(_ref) {
16517
16524
  editor: editor,
16518
16525
  mentions: mentions,
16519
16526
  tooltipContent: tooltips.mention || t("neetoEditor.menu.mention")
16520
- }), children]
16527
+ })]
16521
16528
  });
16522
16529
  };
16523
16530
 
@@ -16532,8 +16539,7 @@ var Bubble = function Bubble(_ref) {
16532
16539
  attachmentProps = _ref.attachmentProps,
16533
16540
  isEmojiPickerActive = _ref.isEmojiPickerActive,
16534
16541
  setIsEmojiPickerActive = _ref.setIsEmojiPickerActive,
16535
- setIsEmbedModalOpen = _ref.setIsEmbedModalOpen,
16536
- children = _ref.children;
16542
+ setIsEmbedModalOpen = _ref.setIsEmbedModalOpen;
16537
16543
  var _useState = useState(false),
16538
16544
  _useState2 = _slicedToArray(_useState, 2),
16539
16545
  isInvalidLink = _useState2[0],
@@ -16585,8 +16591,7 @@ var Bubble = function Bubble(_ref) {
16585
16591
  setIsTableOptionActive: setIsTableOptionActive,
16586
16592
  setMediaUploader: setMediaUploader,
16587
16593
  tooltips: tooltips,
16588
- options: textOptions,
16589
- children: children
16594
+ options: textOptions
16590
16595
  })
16591
16596
  })
16592
16597
  });
@@ -18168,7 +18173,6 @@ var Fixed = function Fixed(_ref) {
18168
18173
  attachmentProps = _ref.attachmentProps,
18169
18174
  isEmojiPickerActive = _ref.isEmojiPickerActive,
18170
18175
  setIsEmojiPickerActive = _ref.setIsEmojiPickerActive,
18171
- children = _ref.children,
18172
18176
  openLinkInNewTab = _ref.openLinkInNewTab;
18173
18177
  var _useState = useState(0),
18174
18178
  _useState2 = _slicedToArray(_useState, 2),
@@ -18307,7 +18311,7 @@ var Fixed = function Fixed(_ref) {
18307
18311
  }), isNotEmpty(moreMenuItems) && /*#__PURE__*/jsx(MoreMenu, {
18308
18312
  editor: editor,
18309
18313
  groups: moreMenuItems
18310
- }), children]
18314
+ })]
18311
18315
  }), !isEmpty(variables) && /*#__PURE__*/jsx("div", {
18312
18316
  className: "neeto-editor-fixed-menu__variables",
18313
18317
  "data-cy": "neeto-editor-fixed-menu-variables",
@@ -18742,7 +18746,6 @@ var Headless = function Headless(_ref) {
18742
18746
  unsplashApiKey = _ref.unsplashApiKey,
18743
18747
  _ref$addonCommands = _ref.addonCommands,
18744
18748
  addonCommands = _ref$addonCommands === void 0 ? [] : _ref$addonCommands,
18745
- children = _ref.children,
18746
18749
  className = _ref.className,
18747
18750
  attachmentProps = _ref.attachmentProps,
18748
18751
  isEmojiPickerActive = _ref.isEmojiPickerActive,
@@ -18774,7 +18777,7 @@ var Headless = function Headless(_ref) {
18774
18777
  editor: editor,
18775
18778
  key: option.optionName
18776
18779
  }, option));
18777
- }), children, isMediaUploaderActive && /*#__PURE__*/jsx(MediaUploader, {
18780
+ }), isMediaUploaderActive && /*#__PURE__*/jsx(MediaUploader, {
18778
18781
  editor: editor,
18779
18782
  mediaUploader: mediaUploader,
18780
18783
  unsplashApiKey: unsplashApiKey,
@@ -19406,4 +19409,4 @@ var Menu = function Menu(props) {
19406
19409
  };
19407
19410
 
19408
19411
  export { getAttributes as A, highlightFocussedNode as B, resetFocussedNode as C, DecorationSet as D, Extension as E, findParentNodeClosestToPos as F, BubbleMenu as G, getLinkPopoverPosition as H, InputRule as I, getMarkType as J, getMarkRange as K, useEditor as L, Menu as M, Node as N, useEditorState$1 as O, PasteRule as P, EditorContent as Q, ReactNodeViewRenderer as R, MediaUploader as S, EmbedOption as T, EditorView as U, Mark as a, markInputRule as b, markPasteRule as c, Decoration as d, callOrReturn as e, getExtensionField as f, getMarkAttributes as g, findChildren as h, isNodeSelection as i, NodeViewWrapper as j, keydownHandler as k, NodeViewContent as l, mergeAttributes as m, nodeInputRule as n, escapeForRegEx as o, ReactRenderer as p, EmojiPickerMenu as q, emojiPickerApi as r, liftTarget$1 as s, textblockTypeInputRule as t, combineTransactionSteps as u, validateUrl as v, wrappingInputRule as w, getChangedRanges as x, findChildrenInRange as y, getMarksBetween as z };
19409
- //# sourceMappingURL=chunk-BnTGH3g0.js.map
19412
+ //# sourceMappingURL=chunk-CWeT8E0d.js.map