@bigbinary/neeto-editor 1.47.13 → 1.47.14

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, i as isNodeActive, e as isAtStartOfNode, f as isAtEndOfNode, h as getNodeType, j as getNodeAtPosition, w as wrappingInputRule, t as textblockTypeInputRule, k as keydownHandler, l as callOrReturn, n as getExtensionField, o as isNodeSelection, p as nodeInputRule, q as NodeViewWrapper, r as NodeViewContent, R as ReactNodeViewRenderer, s as findChildren, P as PasteRule, v as validateUrl, u as escapeForRegEx, x as ReactRenderer, y as EmojiPickerMenu, z as emojiPickerApi, A as combineTransactionSteps, B as getChangedRanges, C as findChildrenInRange, F as getMarksBetween, G as getAttributes, I as InputRule, H as highlightFocussedNode, J as resetFocussedNode, K as findParentNodeClosestToPos, L as BubbleMenu, O as getLinkPopoverPosition, Q as getMarkType, S as getMarkRange, T as useEditor, U as useEditorState, M as Menu$3, V as EditorContent, W as MediaUploader, X as EmbedOption, Y as EditorView } from './chunk-DpvlQ94X.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, i as isNodeActive, e as isAtStartOfNode, f as isAtEndOfNode, h as getNodeType, j as getNodeAtPosition, w as wrappingInputRule, t as textblockTypeInputRule, k as keydownHandler, l as callOrReturn, n as getExtensionField, o as isNodeSelection, p as nodeInputRule, q as NodeViewWrapper, r as NodeViewContent, R as ReactNodeViewRenderer, s as findChildren, P as PasteRule, v as validateUrl, u as escapeForRegEx, x as ReactRenderer, y as EmojiPickerMenu, z as emojiPickerApi, A as combineTransactionSteps, B as getChangedRanges, C as findChildrenInRange, F as getMarksBetween, G as getAttributes, I as InputRule, H as highlightFocussedNode, J as resetFocussedNode, K as findParentNodeClosestToPos, L as BubbleMenu, O as getLinkPopoverPosition, Q as getMarkType, S as getMarkRange, T as useEditor, U as useEditorState, M as Menu$3, V as EditorContent, W as MediaUploader, X as EmbedOption, Y as LinkAddPopOver, Z as EditorView } from './chunk-DmstYxyh.js';
8
8
  import classnames from 'classnames';
9
9
  import { C as COMBINED_REGEX, D as DIRECT_UPLOAD_ENDPOINT, E as EDITOR_OPTIONS, a as EDITOR_SIZES } from './chunk-CJu3yusL.js';
10
10
  import { isNotPresent, isNotEmpty, isPresent, noop as noop$1, slugify } from '@bigbinary/neeto-cist';
@@ -65,6 +65,12 @@ import Video from '@bigbinary/neeto-icons/Video';
65
65
  import Notes from '@bigbinary/neeto-icons/Notes';
66
66
  import MediaVideo from '@bigbinary/neeto-icons/MediaVideo';
67
67
  import Column from '@bigbinary/neeto-icons/Column';
68
+ import TextBold from '@bigbinary/neeto-icons/TextBold';
69
+ import TextItalic from '@bigbinary/neeto-icons/TextItalic';
70
+ import Underline$1 from '@bigbinary/neeto-icons/Underline';
71
+ import Link$2 from '@bigbinary/neeto-icons/Link';
72
+ import Attachment from '@bigbinary/neeto-icons/Attachment';
73
+ import MessageSquare from '@bigbinary/neeto-icons/MessageSquare';
68
74
  import Tooltip from '@bigbinary/neetoui/Tooltip';
69
75
  import DeleteRow from '@bigbinary/neeto-icons/DeleteRow';
70
76
  import DeleteColumn from '@bigbinary/neeto-icons/DeleteColumn';
@@ -78,16 +84,11 @@ import Form from '@bigbinary/neetoui/formik/Form';
78
84
  import Input$1 from '@bigbinary/neetoui/formik/Input';
79
85
  import { A as Attachments } from './chunk-CS15pHk7.js';
80
86
  import 'tippy.js/dist/svg-arrow.css';
81
- import '@bigbinary/neeto-icons/Link';
82
87
  import '@bigbinary/neeto-commons-frontend/utils';
83
88
  import '@bigbinary/neeto-icons/Check';
84
89
  import '@bigbinary/neeto-icons/Quote';
85
- import '@bigbinary/neeto-icons/Attachment';
86
90
  import '@bigbinary/neeto-icons/Code';
87
- import '@bigbinary/neeto-icons/TextBold';
88
91
  import '@bigbinary/neeto-icons/TextCross';
89
- import '@bigbinary/neeto-icons/TextItalic';
90
- import '@bigbinary/neeto-icons/Underline';
91
92
  import '@bigbinary/neeto-icons/Undo';
92
93
  import '@bigbinary/neeto-icons/Redo';
93
94
  import '@bigbinary/neeto-icons/Email';
@@ -13928,8 +13929,7 @@ var Menu = /*#__PURE__*/function (_React$Component) {
13928
13929
  range = _this$props.range;
13929
13930
  var selectedItem = items[index];
13930
13931
  var hasCommand = selectedItem && selectedItem.command;
13931
- var isLeafNode = isNotPresent(selectedItem.items);
13932
- if (hasCommand && isLeafNode) selectedItem.command({
13932
+ if (hasCommand) selectedItem.command({
13933
13933
  editor: editor,
13934
13934
  range: range
13935
13935
  });
@@ -14030,7 +14030,7 @@ var Menu = /*#__PURE__*/function (_React$Component) {
14030
14030
  item: item,
14031
14031
  key: item.optionName,
14032
14032
  selectItem: function selectItem() {
14033
- return isLeafNode && _this2.selectItem(index);
14033
+ return _this2.selectItem(index);
14034
14034
  },
14035
14035
  selectedIndex: isCurrentMenuActive ? selectedIndex : -1,
14036
14036
  onHover: function onHover() {
@@ -14043,6 +14043,7 @@ var Menu = /*#__PURE__*/function (_React$Component) {
14043
14043
  return /*#__PURE__*/jsx(Tippy, {
14044
14044
  interactive: true,
14045
14045
  placement: "right",
14046
+ theme: "light neeto-editor-slash-commands-tippy",
14046
14047
  visible: selectedIndex === index,
14047
14048
  content: /*#__PURE__*/jsx(Menu, _objectSpread$7(_objectSpread$7({}, _this2.props), {}, {
14048
14049
  items: item.items,
@@ -14143,14 +14144,44 @@ var MENU_ITEMS = [{
14143
14144
  range = _ref.range;
14144
14145
  editor.chain().focus().deleteRange(range).setNode("paragraph").run();
14145
14146
  }
14147
+ }, {
14148
+ optionName: EDITOR_OPTIONS.BOLD,
14149
+ title: t("neetoEditor.menu.bold"),
14150
+ description: t("neetoEditor.menu.boldDescription"),
14151
+ Icon: TextBold,
14152
+ command: function command(_ref2) {
14153
+ var editor = _ref2.editor,
14154
+ range = _ref2.range;
14155
+ editor.chain().focus().deleteRange(range).toggleBold().run();
14156
+ }
14157
+ }, {
14158
+ optionName: EDITOR_OPTIONS.ITALIC,
14159
+ title: t("neetoEditor.menu.italic"),
14160
+ description: t("neetoEditor.menu.italicDescription"),
14161
+ Icon: TextItalic,
14162
+ command: function command(_ref3) {
14163
+ var editor = _ref3.editor,
14164
+ range = _ref3.range;
14165
+ editor.chain().focus().deleteRange(range).toggleItalic().run();
14166
+ }
14167
+ }, {
14168
+ optionName: EDITOR_OPTIONS.UNDERLINE,
14169
+ title: t("neetoEditor.menu.underline"),
14170
+ description: t("neetoEditor.menu.underlineDescription"),
14171
+ Icon: Underline$1,
14172
+ command: function command(_ref4) {
14173
+ var editor = _ref4.editor,
14174
+ range = _ref4.range;
14175
+ editor.chain().focus().deleteRange(range).toggleUnderline().run();
14176
+ }
14146
14177
  }, {
14147
14178
  optionName: EDITOR_OPTIONS.H1,
14148
14179
  title: t("neetoEditor.menu.heading1"),
14149
14180
  description: t("neetoEditor.menu.h1Description"),
14150
14181
  Icon: TextH1,
14151
- command: function command(_ref2) {
14152
- var editor = _ref2.editor,
14153
- range = _ref2.range;
14182
+ command: function command(_ref5) {
14183
+ var editor = _ref5.editor,
14184
+ range = _ref5.range;
14154
14185
  editor.chain().focus().deleteRange(range).setNode("heading", {
14155
14186
  level: 1
14156
14187
  }).run();
@@ -14160,9 +14191,9 @@ var MENU_ITEMS = [{
14160
14191
  title: t("neetoEditor.menu.heading2"),
14161
14192
  description: t("neetoEditor.menu.h2Description"),
14162
14193
  Icon: TextH2,
14163
- command: function command(_ref3) {
14164
- var editor = _ref3.editor,
14165
- range = _ref3.range;
14194
+ command: function command(_ref6) {
14195
+ var editor = _ref6.editor,
14196
+ range = _ref6.range;
14166
14197
  editor.chain().focus().deleteRange(range).setNode("heading", {
14167
14198
  level: 2
14168
14199
  }).run();
@@ -14172,9 +14203,9 @@ var MENU_ITEMS = [{
14172
14203
  title: t("neetoEditor.menu.heading3"),
14173
14204
  description: t("neetoEditor.menu.h3Description"),
14174
14205
  Icon: TextH3,
14175
- command: function command(_ref4) {
14176
- var editor = _ref4.editor,
14177
- range = _ref4.range;
14206
+ command: function command(_ref7) {
14207
+ var editor = _ref7.editor,
14208
+ range = _ref7.range;
14178
14209
  editor.chain().focus().deleteRange(range).setNode("heading", {
14179
14210
  level: 3
14180
14211
  }).run();
@@ -14184,9 +14215,9 @@ var MENU_ITEMS = [{
14184
14215
  title: t("neetoEditor.menu.heading4"),
14185
14216
  description: t("neetoEditor.menu.h4Description"),
14186
14217
  Icon: TextH4,
14187
- command: function command(_ref5) {
14188
- var editor = _ref5.editor,
14189
- range = _ref5.range;
14218
+ command: function command(_ref8) {
14219
+ var editor = _ref8.editor,
14220
+ range = _ref8.range;
14190
14221
  editor.chain().focus().deleteRange(range).setNode("heading", {
14191
14222
  level: 4
14192
14223
  }).run();
@@ -14196,9 +14227,9 @@ var MENU_ITEMS = [{
14196
14227
  title: t("neetoEditor.menu.heading5"),
14197
14228
  description: t("neetoEditor.menu.h5Description"),
14198
14229
  Icon: TextH5,
14199
- command: function command(_ref6) {
14200
- var editor = _ref6.editor,
14201
- range = _ref6.range;
14230
+ command: function command(_ref9) {
14231
+ var editor = _ref9.editor,
14232
+ range = _ref9.range;
14202
14233
  editor.chain().focus().deleteRange(range).setNode("heading", {
14203
14234
  level: 5
14204
14235
  }).run();
@@ -14208,9 +14239,9 @@ var MENU_ITEMS = [{
14208
14239
  title: t("neetoEditor.menu.numberedList"),
14209
14240
  description: t("neetoEditor.menu.numberedListDescription"),
14210
14241
  Icon: ListNumber,
14211
- command: function command(_ref7) {
14212
- var editor = _ref7.editor,
14213
- range = _ref7.range;
14242
+ command: function command(_ref10) {
14243
+ var editor = _ref10.editor,
14244
+ range = _ref10.range;
14214
14245
  editor.chain().focus().deleteRange(range).toggleOrderedList().run();
14215
14246
  }
14216
14247
  }, {
@@ -14218,19 +14249,31 @@ var MENU_ITEMS = [{
14218
14249
  title: t("neetoEditor.menu.bulletList"),
14219
14250
  description: t("neetoEditor.menu.bulletListDescription"),
14220
14251
  Icon: ListDot,
14221
- command: function command(_ref8) {
14222
- var editor = _ref8.editor,
14223
- range = _ref8.range;
14252
+ command: function command(_ref11) {
14253
+ var editor = _ref11.editor,
14254
+ range = _ref11.range;
14224
14255
  editor.chain().focus().deleteRange(range).toggleBulletList().run();
14225
14256
  }
14257
+ }, {
14258
+ optionName: EDITOR_OPTIONS.LINK,
14259
+ title: t("neetoEditor.menu.link"),
14260
+ description: t("neetoEditor.menu.linkDescription"),
14261
+ Icon: Link$2,
14262
+ command: noop$1
14263
+ }, {
14264
+ optionName: EDITOR_OPTIONS.ATTACHMENTS,
14265
+ title: t("neetoEditor.menu.file"),
14266
+ description: t("neetoEditor.menu.attachmentsDescription"),
14267
+ Icon: Attachment,
14268
+ command: noop$1
14226
14269
  }, {
14227
14270
  optionName: EDITOR_OPTIONS.TODO_LIST,
14228
14271
  title: t("neetoEditor.menu.todoList"),
14229
14272
  description: t("neetoEditor.menu.todoListDescription"),
14230
14273
  Icon: Checkbox,
14231
- command: function command(_ref9) {
14232
- var editor = _ref9.editor,
14233
- range = _ref9.range;
14274
+ command: function command(_ref12) {
14275
+ var editor = _ref12.editor,
14276
+ range = _ref12.range;
14234
14277
  editor.chain().focus().deleteRange(range).toggleTaskList().run();
14235
14278
  }
14236
14279
  }, {
@@ -14250,9 +14293,9 @@ var MENU_ITEMS = [{
14250
14293
  title: t("neetoEditor.menu.blockQuote"),
14251
14294
  description: t("neetoEditor.menu.blockQuoteDescription"),
14252
14295
  Icon: Blockquote$1,
14253
- command: function command(_ref10) {
14254
- var editor = _ref10.editor,
14255
- range = _ref10.range;
14296
+ command: function command(_ref13) {
14297
+ var editor = _ref13.editor,
14298
+ range = _ref13.range;
14256
14299
  editor.chain().focus().deleteRange(range).toggleBlockquote().run();
14257
14300
  }
14258
14301
  }, {
@@ -14260,9 +14303,9 @@ var MENU_ITEMS = [{
14260
14303
  title: t("neetoEditor.menu.codeBlock"),
14261
14304
  description: t("neetoEditor.menu.codeDescription"),
14262
14305
  Icon: CodeBlock$2,
14263
- command: function command(_ref11) {
14264
- var editor = _ref11.editor,
14265
- range = _ref11.range;
14306
+ command: function command(_ref14) {
14307
+ var editor = _ref14.editor,
14308
+ range = _ref14.range;
14266
14309
  editor.chain().focus().deleteRange(range).toggleCodeBlock().run();
14267
14310
  }
14268
14311
  }, {
@@ -14270,9 +14313,9 @@ var MENU_ITEMS = [{
14270
14313
  title: t("neetoEditor.menu.emoji"),
14271
14314
  description: t("neetoEditor.menu.emojiDescription"),
14272
14315
  Icon: Smiley,
14273
- command: function command(_ref12) {
14274
- var editor = _ref12.editor,
14275
- range = _ref12.range;
14316
+ command: function command(_ref15) {
14317
+ var editor = _ref15.editor,
14318
+ range = _ref15.range;
14276
14319
  editor.chain().focus().deleteRange(range).insertContent("::").run();
14277
14320
  }
14278
14321
  }, {
@@ -14280,9 +14323,9 @@ var MENU_ITEMS = [{
14280
14323
  title: t("neetoEditor.menu.divider"),
14281
14324
  description: t("neetoEditor.menu.dividerDescription"),
14282
14325
  Icon: Minus,
14283
- command: function command(_ref13) {
14284
- var editor = _ref13.editor,
14285
- range = _ref13.range;
14326
+ command: function command(_ref16) {
14327
+ var editor = _ref16.editor,
14328
+ range = _ref16.range;
14286
14329
  editor.chain().focus().deleteRange(range).setHorizontalRule().run();
14287
14330
  }
14288
14331
  }, {
@@ -14296,9 +14339,9 @@ var MENU_ITEMS = [{
14296
14339
  title: t("neetoEditor.menu.pasteUnformatted"),
14297
14340
  description: t("neetoEditor.menu.pasteUnformattedDescription"),
14298
14341
  Icon: Notes,
14299
- command: function command(_ref14) {
14300
- var editor = _ref14.editor,
14301
- range = _ref14.range;
14342
+ command: function command(_ref17) {
14343
+ var editor = _ref17.editor,
14344
+ range = _ref17.range;
14302
14345
  return editor.chain().focus().deleteRange(range).pasteUnformatted().run();
14303
14346
  }
14304
14347
  }, {
@@ -14306,21 +14349,95 @@ var MENU_ITEMS = [{
14306
14349
  title: t("neetoEditor.menu.table"),
14307
14350
  description: t("neetoEditor.menu.tableDescription"),
14308
14351
  Icon: Column,
14309
- command: function command(_ref15) {
14310
- var editor = _ref15.editor,
14311
- range = _ref15.range;
14352
+ command: function command(_ref18) {
14353
+ var editor = _ref18.editor,
14354
+ range = _ref18.range;
14312
14355
  return editor.chain().focus().deleteRange(range).insertTable({
14313
14356
  rows: 3,
14314
14357
  cols: 3,
14315
14358
  withHeaderRow: true
14316
14359
  }).run();
14317
14360
  }
14361
+ }, {
14362
+ optionName: EDITOR_OPTIONS.CALLOUT,
14363
+ title: t("neetoEditor.menu.callout"),
14364
+ description: t("neetoEditor.menu.calloutDescription"),
14365
+ Icon: MessageSquare,
14366
+ command: function command(_ref19) {
14367
+ var editor = _ref19.editor,
14368
+ range = _ref19.range;
14369
+ editor.chain().focus().deleteRange(range).setCallout({
14370
+ type: "default",
14371
+ emoji: "💬"
14372
+ }).run();
14373
+ },
14374
+ items: [{
14375
+ optionName: "".concat(EDITOR_OPTIONS.CALLOUT, "_default"),
14376
+ title: t("neetoEditor.menu.calloutDefault"),
14377
+ description: t("neetoEditor.menu.calloutDescription"),
14378
+ command: function command(_ref20) {
14379
+ var editor = _ref20.editor,
14380
+ range = _ref20.range;
14381
+ editor.chain().focus().deleteRange(range).setCallout({
14382
+ type: "default",
14383
+ emoji: "💬"
14384
+ }).run();
14385
+ }
14386
+ }, {
14387
+ optionName: "".concat(EDITOR_OPTIONS.CALLOUT, "_info"),
14388
+ title: t("neetoEditor.menu.calloutInfo"),
14389
+ description: t("neetoEditor.menu.calloutDescription"),
14390
+ command: function command(_ref21) {
14391
+ var editor = _ref21.editor,
14392
+ range = _ref21.range;
14393
+ editor.chain().focus().deleteRange(range).setCallout({
14394
+ type: "info",
14395
+ emoji: "ℹ️"
14396
+ }).run();
14397
+ }
14398
+ }, {
14399
+ optionName: "".concat(EDITOR_OPTIONS.CALLOUT, "_warning"),
14400
+ title: t("neetoEditor.menu.calloutWarning"),
14401
+ description: t("neetoEditor.menu.calloutDescription"),
14402
+ command: function command(_ref22) {
14403
+ var editor = _ref22.editor,
14404
+ range = _ref22.range;
14405
+ editor.chain().focus().deleteRange(range).setCallout({
14406
+ type: "warning",
14407
+ emoji: "⚠️"
14408
+ }).run();
14409
+ }
14410
+ }, {
14411
+ optionName: "".concat(EDITOR_OPTIONS.CALLOUT, "_error"),
14412
+ title: t("neetoEditor.menu.calloutError"),
14413
+ description: t("neetoEditor.menu.calloutDescription"),
14414
+ command: function command(_ref23) {
14415
+ var editor = _ref23.editor,
14416
+ range = _ref23.range;
14417
+ editor.chain().focus().deleteRange(range).setCallout({
14418
+ type: "error",
14419
+ emoji: "❌"
14420
+ }).run();
14421
+ }
14422
+ }, {
14423
+ optionName: "".concat(EDITOR_OPTIONS.CALLOUT, "_success"),
14424
+ title: t("neetoEditor.menu.calloutSuccess"),
14425
+ description: t("neetoEditor.menu.calloutDescription"),
14426
+ command: function command(_ref24) {
14427
+ var editor = _ref24.editor,
14428
+ range = _ref24.range;
14429
+ editor.chain().focus().deleteRange(range).setCallout({
14430
+ type: "success",
14431
+ emoji: "✅"
14432
+ }).run();
14433
+ }
14434
+ }]
14318
14435
  }];
14319
14436
  var NO_RESULT_MENU_ITEM = {
14320
14437
  title: t("neetoEditor.menu.noResults"),
14321
- command: function command(_ref16) {
14322
- var editor = _ref16.editor,
14323
- range = _ref16.range;
14438
+ command: function command(_ref25) {
14439
+ var editor = _ref25.editor,
14440
+ range = _ref25.range;
14324
14441
  editor.chain().focus().deleteRange(range).run();
14325
14442
  }
14326
14443
  };
@@ -14351,11 +14468,29 @@ var videoCommand = function videoCommand(setMediaUploader) {
14351
14468
  editor.chain().focus().deleteRange(range).run();
14352
14469
  };
14353
14470
  };
14354
- var buildCommandItems = function buildCommandItems(_ref4) {
14355
- var options = _ref4.options,
14356
- addonCommands = _ref4.addonCommands,
14357
- setMediaUploader = _ref4.setMediaUploader,
14358
- setIsEmbedModalOpen = _ref4.setIsEmbedModalOpen;
14471
+ var linkCommand = function linkCommand(setIsAddLinkActive) {
14472
+ return function (_ref4) {
14473
+ var editor = _ref4.editor,
14474
+ range = _ref4.range;
14475
+ setIsAddLinkActive(true);
14476
+ editor.chain().focus().deleteRange(range).run();
14477
+ };
14478
+ };
14479
+ var attachmentCommand = function attachmentCommand(attachmentProps) {
14480
+ return function (_ref5) {
14481
+ var editor = _ref5.editor,
14482
+ range = _ref5.range;
14483
+ attachmentProps === null || attachmentProps === void 0 || attachmentProps.handleUploadAttachments();
14484
+ editor.chain().focus().deleteRange(range).run();
14485
+ };
14486
+ };
14487
+ var buildCommandItems = function buildCommandItems(_ref6) {
14488
+ var options = _ref6.options,
14489
+ addonCommands = _ref6.addonCommands,
14490
+ setMediaUploader = _ref6.setMediaUploader,
14491
+ setIsEmbedModalOpen = _ref6.setIsEmbedModalOpen,
14492
+ setIsAddLinkActive = _ref6.setIsAddLinkActive,
14493
+ attachmentProps = _ref6.attachmentProps;
14359
14494
  var commandItems = MENU_ITEMS.map(function (item) {
14360
14495
  if (item.optionName === EDITOR_OPTIONS.IMAGE_UPLOAD) {
14361
14496
  return assoc("command", imageCommand(setMediaUploader), item);
@@ -14363,11 +14498,15 @@ var buildCommandItems = function buildCommandItems(_ref4) {
14363
14498
  return assoc("command", videoCommand(setMediaUploader), item);
14364
14499
  } else if (item.optionName === EDITOR_OPTIONS.VIDEO_EMBED) {
14365
14500
  return assoc("command", embedCommand(setIsEmbedModalOpen), item);
14501
+ } else if (item.optionName === EDITOR_OPTIONS.LINK) {
14502
+ return assoc("command", linkCommand(setIsAddLinkActive), item);
14503
+ } else if (item.optionName === EDITOR_OPTIONS.ATTACHMENTS) {
14504
+ return assoc("command", attachmentCommand(attachmentProps), item);
14366
14505
  }
14367
14506
  return item;
14368
14507
  });
14369
- var permittedCommandItems = commandItems.filter(function (_ref5) {
14370
- var optionName = _ref5.optionName;
14508
+ var permittedCommandItems = commandItems.filter(function (_ref7) {
14509
+ var optionName = _ref7.optionName;
14371
14510
  return options.includes(optionName);
14372
14511
  });
14373
14512
  var adddonCommandItems = addonCommands.map(function (command) {
@@ -14387,12 +14526,16 @@ var SlashCommands = {
14387
14526
  var addonCommands = _ref.addonCommands,
14388
14527
  options = _ref.options,
14389
14528
  setMediaUploader = _ref.setMediaUploader,
14390
- setIsEmbedModalOpen = _ref.setIsEmbedModalOpen;
14529
+ setIsEmbedModalOpen = _ref.setIsEmbedModalOpen,
14530
+ setIsAddLinkActive = _ref.setIsAddLinkActive,
14531
+ attachmentProps = _ref.attachmentProps;
14391
14532
  var commandItems = buildCommandItems({
14392
14533
  options: options,
14393
14534
  addonCommands: addonCommands,
14394
14535
  setMediaUploader: setMediaUploader,
14395
- setIsEmbedModalOpen: setIsEmbedModalOpen
14536
+ setIsEmbedModalOpen: setIsEmbedModalOpen,
14537
+ setIsAddLinkActive: setIsAddLinkActive,
14538
+ attachmentProps: attachmentProps
14396
14539
  });
14397
14540
  return Extension.create({
14398
14541
  name: "slash-commands",
@@ -19838,6 +19981,8 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
19838
19981
  isVideoEmbedActive = _ref.isVideoEmbedActive,
19839
19982
  setMediaUploader = _ref.setMediaUploader,
19840
19983
  setIsEmbedModalOpen = _ref.setIsEmbedModalOpen,
19984
+ setIsAddLinkActive = _ref.setIsAddLinkActive,
19985
+ attachmentProps = _ref.attachmentProps,
19841
19986
  openImageInNewTab = _ref.openImageInNewTab,
19842
19987
  openLinkInNewTab = _ref.openLinkInNewTab,
19843
19988
  enableReactNodeViewOptimization = _ref.enableReactNodeViewOptimization,
@@ -19898,7 +20043,9 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
19898
20043
  options: options,
19899
20044
  addonCommands: addonCommands,
19900
20045
  setMediaUploader: setMediaUploader,
19901
- setIsEmbedModalOpen: setIsEmbedModalOpen
20046
+ setIsEmbedModalOpen: setIsEmbedModalOpen,
20047
+ setIsAddLinkActive: setIsAddLinkActive,
20048
+ attachmentProps: attachmentProps
19902
20049
  }));
19903
20050
  }
19904
20051
  if (!isEmpty$1(mentions)) {
@@ -20314,7 +20461,7 @@ var Editor = function Editor(_ref, ref) {
20314
20461
  _ref$extensions = _ref.extensions,
20315
20462
  extensions = _ref$extensions === void 0 ? [] : _ref$extensions,
20316
20463
  _ref$hideSlashCommand = _ref.hideSlashCommands,
20317
- hideSlashCommands = _ref$hideSlashCommand === void 0 ? true : _ref$hideSlashCommand,
20464
+ hideSlashCommands = _ref$hideSlashCommand === void 0 ? false : _ref$hideSlashCommand,
20318
20465
  _ref$initialValue = _ref.initialValue,
20319
20466
  initialValue = _ref$initialValue === void 0 ? "" : _ref$initialValue,
20320
20467
  _ref$isCharacterCount = _ref.isCharacterCountActive,
@@ -20374,13 +20521,17 @@ var Editor = function Editor(_ref, ref) {
20374
20521
  _useState4 = _slicedToArray(_useState3, 2),
20375
20522
  isEmbedModalOpen = _useState4[0],
20376
20523
  setIsEmbedModalOpen = _useState4[1];
20377
- var _useState5 = useState({
20524
+ var _useState5 = useState(false),
20525
+ _useState6 = _slicedToArray(_useState5, 2),
20526
+ isAddLinkActive = _useState6[0],
20527
+ setIsAddLinkActive = _useState6[1];
20528
+ var _useState7 = useState({
20378
20529
  image: false,
20379
20530
  video: false
20380
20531
  }),
20381
- _useState6 = _slicedToArray(_useState5, 2),
20382
- mediaUploader = _useState6[0],
20383
- setMediaUploader = _useState6[1];
20532
+ _useState8 = _slicedToArray(_useState7, 2),
20533
+ mediaUploader = _useState8[0],
20534
+ setMediaUploader = _useState8[1];
20384
20535
  var addAttachmentsRef = useRef(null);
20385
20536
  var attachmentProps = {
20386
20537
  handleUploadAttachments: function handleUploadAttachments() {
@@ -20413,6 +20564,8 @@ var Editor = function Editor(_ref, ref) {
20413
20564
  isVideoEmbedActive: isVideoEmbedActive,
20414
20565
  setMediaUploader: setMediaUploader,
20415
20566
  setIsEmbedModalOpen: setIsEmbedModalOpen,
20567
+ setIsAddLinkActive: setIsAddLinkActive,
20568
+ attachmentProps: attachmentProps,
20416
20569
  openImageInNewTab: openImageInNewTab,
20417
20570
  openLinkInNewTab: openLinkInNewTab,
20418
20571
  enableReactNodeViewOptimization: enableReactNodeViewOptimization,
@@ -20548,6 +20701,11 @@ var Editor = function Editor(_ref, ref) {
20548
20701
  onChange: onChangeAttachments
20549
20702
  }), (editor === null || editor === void 0 ? void 0 : editor.isActive("link")) && /*#__PURE__*/jsx(LinkPopOver, {
20550
20703
  editor: editor
20704
+ }), isAddLinkActive && /*#__PURE__*/jsx(LinkAddPopOver, {
20705
+ editor: editor,
20706
+ isAddLinkActive: isAddLinkActive,
20707
+ openLinkInNewTab: openLinkInNewTab,
20708
+ setIsAddLinkActive: setIsAddLinkActive
20551
20709
  }), /*#__PURE__*/jsx(TableActionMenu, {
20552
20710
  editor: editor,
20553
20711
  appendTo: wrapperRef