@bigbinary/neeto-editor 1.47.126 → 1.47.130

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.
@@ -18,7 +18,7 @@ var ramda = require('ramda');
18
18
  var ReactDOM = require('react-dom/server');
19
19
  var common = require('../chunk-BKvkHB8E.cjs.js');
20
20
  var jsxRuntime = require('react/jsx-runtime');
21
- var v2_Menu = require('../chunk-DoYRXWHQ.cjs.js');
21
+ var v2_Menu = require('../chunk-DRJy8PFC.cjs.js');
22
22
  var Megaphone = require('@bigbinary/neeto-icons/misc/Megaphone');
23
23
  var index = require('../chunk-NqciyXN3.cjs.js');
24
24
  var lucideReact = require('lucide-react');
@@ -814,16 +814,19 @@ var EditorContainer = useEditorStore.Extension.create({
814
814
  name: "editorContainer",
815
815
  addOptions: function addOptions() {
816
816
  return {
817
- containerRef: null
817
+ containerRef: null,
818
+ appendSuggestionsToBody: false
818
819
  };
819
820
  },
820
821
  addStorage: function addStorage() {
821
822
  return {
822
- containerRef: null
823
+ containerRef: null,
824
+ appendSuggestionsToBody: false
823
825
  };
824
826
  },
825
827
  onBeforeCreate: function onBeforeCreate() {
826
828
  this.storage.containerRef = this.options.containerRef;
829
+ this.storage.appendSuggestionsToBody = this.options.appendSuggestionsToBody;
827
830
  }
828
831
  });
829
832
 
@@ -857,10 +860,7 @@ var EmojiPicker = useEditorStore.Node3.create({
857
860
  popup = tippy__default.default("body", {
858
861
  theme: "light",
859
862
  getReferenceClientRect: props.clientRect,
860
- appendTo: function appendTo() {
861
- var _props$editor$storage, _props$editor;
862
- return (_props$editor$storage = (_props$editor = props.editor) === null || _props$editor === void 0 || (_props$editor = _props$editor.storage) === null || _props$editor === void 0 || (_props$editor = _props$editor.editorContainer) === null || _props$editor === void 0 || (_props$editor = _props$editor.containerRef) === null || _props$editor === void 0 ? void 0 : _props$editor.current) !== null && _props$editor$storage !== void 0 ? _props$editor$storage : document.body;
863
- },
863
+ appendTo: v2_Menu.getSuggestionAppendTo(props.editor),
864
864
  content: reactRenderer.element,
865
865
  showOnCreate: true,
866
866
  interactive: true,
@@ -1223,10 +1223,7 @@ var suggestionConfig = {
1223
1223
  popup = tippy__default.default("body", {
1224
1224
  theme: "light",
1225
1225
  getReferenceClientRect: props.clientRect,
1226
- appendTo: function appendTo() {
1227
- var _props$editor$storage, _props$editor;
1228
- return (_props$editor$storage = (_props$editor = props.editor) === null || _props$editor === void 0 || (_props$editor = _props$editor.storage) === null || _props$editor === void 0 || (_props$editor = _props$editor.editorContainer) === null || _props$editor === void 0 || (_props$editor = _props$editor.containerRef) === null || _props$editor === void 0 ? void 0 : _props$editor.current) !== null && _props$editor$storage !== void 0 ? _props$editor$storage : document.body;
1229
- },
1226
+ appendTo: v2_Menu.getSuggestionAppendTo(props.editor),
1230
1227
  content: reactRenderer.element,
1231
1228
  showOnCreate: true,
1232
1229
  interactive: true,
@@ -2206,10 +2203,7 @@ var suggestion$1 = {
2206
2203
  popup = tippy__default.default("body", {
2207
2204
  theme: "light neeto-editor-mentions-tooltip",
2208
2205
  getReferenceClientRect: props.clientRect,
2209
- appendTo: function appendTo() {
2210
- var _props$editor$storage, _props$editor;
2211
- return (_props$editor$storage = (_props$editor = props.editor) === null || _props$editor === void 0 || (_props$editor = _props$editor.storage) === null || _props$editor === void 0 || (_props$editor = _props$editor.editorContainer) === null || _props$editor === void 0 || (_props$editor = _props$editor.containerRef) === null || _props$editor === void 0 ? void 0 : _props$editor.current) !== null && _props$editor$storage !== void 0 ? _props$editor$storage : document.body;
2212
- },
2206
+ appendTo: v2_Menu.getSuggestionAppendTo(props.editor),
2213
2207
  content: reactRenderer.element,
2214
2208
  showOnCreate: true,
2215
2209
  interactive: true,
@@ -3060,10 +3054,7 @@ var SlashCommands = {
3060
3054
  });
3061
3055
  popup = tippy__default.default("body", {
3062
3056
  getReferenceClientRect: props.clientRect,
3063
- appendTo: function appendTo() {
3064
- var _props$editor$storage, _props$editor;
3065
- return (_props$editor$storage = (_props$editor = props.editor) === null || _props$editor === void 0 || (_props$editor = _props$editor.storage) === null || _props$editor === void 0 || (_props$editor = _props$editor.editorContainer) === null || _props$editor === void 0 || (_props$editor = _props$editor.containerRef) === null || _props$editor === void 0 ? void 0 : _props$editor.current) !== null && _props$editor$storage !== void 0 ? _props$editor$storage : document.body;
3066
- },
3057
+ appendTo: v2_Menu.getSuggestionAppendTo(props.editor),
3067
3058
  content: reactRenderer.element,
3068
3059
  showOnCreate: true,
3069
3060
  interactive: true,
@@ -3138,10 +3129,7 @@ var suggestion = {
3138
3129
  popup = tippy__default.default("body", {
3139
3130
  theme: "light neeto-editor-mentions-tooltip",
3140
3131
  getReferenceClientRect: props.clientRect,
3141
- appendTo: function appendTo() {
3142
- var _props$editor$storage, _props$editor;
3143
- return (_props$editor$storage = (_props$editor = props.editor) === null || _props$editor === void 0 || (_props$editor = _props$editor.storage) === null || _props$editor === void 0 || (_props$editor = _props$editor.editorContainer) === null || _props$editor === void 0 || (_props$editor = _props$editor.containerRef) === null || _props$editor === void 0 ? void 0 : _props$editor.current) !== null && _props$editor$storage !== void 0 ? _props$editor$storage : document.body;
3144
- },
3132
+ appendTo: v2_Menu.getSuggestionAppendTo(props.editor),
3145
3133
  content: reactRenderer.element,
3146
3134
  showOnCreate: true,
3147
3135
  interactive: true,
@@ -3825,6 +3813,13 @@ var getEmbedAttributes = function getEmbedAttributes() {
3825
3813
  title: {
3826
3814
  "default": null
3827
3815
  },
3816
+ originalUrl: {
3817
+ "default": "",
3818
+ parseHTML: function parseHTML(element) {
3819
+ var iframe = element.querySelector(".neeto-editor__video-iframe");
3820
+ return (iframe === null || iframe === void 0 ? void 0 : iframe.getAttribute("data-original-url")) || "";
3821
+ }
3822
+ },
3828
3823
  frameBorder: "0",
3829
3824
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",
3830
3825
  allowfullscreen: true
@@ -3836,7 +3831,8 @@ var renderEmbedHTML = function renderEmbedHTML(node, HTMLAttributes, options) {
3836
3831
  figheight = _node$attrs.figheight,
3837
3832
  figwidth = _node$attrs.figwidth,
3838
3833
  border = _node$attrs.border,
3839
- aspectRatio = _node$attrs.aspectRatio;
3834
+ aspectRatio = _node$attrs.aspectRatio,
3835
+ originalUrl = _node$attrs.originalUrl;
3840
3836
  return ["div", {
3841
3837
  "class": classnames__default.default("neeto-editor__video-wrapper", "neeto-editor__video--".concat(align), {
3842
3838
  "neeto-editor__video--bordered": border
@@ -3853,7 +3849,8 @@ var renderEmbedHTML = function renderEmbedHTML(node, HTMLAttributes, options) {
3853
3849
  "data-aspect-ratio": aspectRatio
3854
3850
  }, ["iframe", useEditorStore.mergeAttributes(options.HTMLAttributes, _objectSpread$4(_objectSpread$4({}, HTMLAttributes), {}, {
3855
3851
  allowfullscreen: true,
3856
- "data-border": border
3852
+ "data-border": border,
3853
+ "data-original-url": originalUrl
3857
3854
  }))]]];
3858
3855
  };
3859
3856
  var renderUploadHTML = function renderUploadHTML(node, HTMLAttributes, options) {
@@ -3896,7 +3893,8 @@ var handleVideoPaste = function handleVideoPaste(_ref) {
3896
3893
  if (validatedUrl) {
3897
3894
  var node = state.schema.nodes["unified-video"].create({
3898
3895
  src: validatedUrl,
3899
- videoType: "embed"
3896
+ videoType: "embed",
3897
+ originalUrl: match[0]
3900
3898
  });
3901
3899
  state.tr.insert(range.from, node);
3902
3900
  state.tr.insert(range.from + node.nodeSize + 1, state.schema.nodes.paragraph.create());
@@ -4019,9 +4017,11 @@ var useCustomExtensions = function useCustomExtensions(_ref) {
4019
4017
  enableReactNodeViewOptimization = _ref.enableReactNodeViewOptimization,
4020
4018
  collaborationProvider = _ref.collaborationProvider,
4021
4019
  setIsNeetoKbArticleActive = _ref.setIsNeetoKbArticleActive,
4022
- containerRef = _ref.containerRef;
4020
+ containerRef = _ref.containerRef,
4021
+ appendSuggestionsToBody = _ref.appendSuggestionsToBody;
4023
4022
  var customExtensions = [EditorContainer.configure({
4024
- containerRef: containerRef
4023
+ containerRef: containerRef,
4024
+ appendSuggestionsToBody: appendSuggestionsToBody
4025
4025
  }), fuzzySearch.CharacterCount, fuzzySearch.index_default$5, CodeBlock.configure({
4026
4026
  enableReactNodeViewOptimization: enableReactNodeViewOptimization
4027
4027
  }), CustomCommands, fuzzySearch.index_default$4, FigCaption, HighlightInternal, SelectionDecoration, fuzzySearch.Focus.configure({
@@ -5228,7 +5228,7 @@ var LinkPopOver = function LinkPopOver(_ref) {
5228
5228
  });
5229
5229
  };
5230
5230
 
5231
- var _excluded = ["addonCommands", "addons", "attachments", "attachmentsConfig", "autoFocus", "className", "contentClassName", "contentWrapperClassName", "errorWrapperClassName", "contentAttributes", "menuClassName", "attachmentsClassName", "isMenuIndependent", "defaults", "editorSecrets", "error", "extensions", "hideSlashCommands", "initialValue", "isCharacterCountActive", "keyboardShortcuts", "label", "mentions", "menuType", "placeholder", "required", "rows", "tooltips", "variables", "disableTrimOnBlur", "onChange", "onFocus", "onBlur", "onSubmit", "onChangeAttachments", "children", "openImageInNewTab", "openLinkInNewTab", "showAssetLibrary", "collaborationProvider", "enableReactNodeViewOptimization", "size", "otherAttachmentProps"];
5231
+ var _excluded = ["addonCommands", "addons", "attachments", "attachmentsConfig", "autoFocus", "className", "contentClassName", "contentWrapperClassName", "errorWrapperClassName", "contentAttributes", "menuClassName", "attachmentsClassName", "isMenuIndependent", "defaults", "editorSecrets", "error", "extensions", "hideSlashCommands", "appendSuggestionsToBody", "initialValue", "isCharacterCountActive", "keyboardShortcuts", "label", "mentions", "menuType", "placeholder", "required", "rows", "tooltips", "variables", "disableTrimOnBlur", "onChange", "onFocus", "onBlur", "onSubmit", "onChangeAttachments", "children", "openImageInNewTab", "openLinkInNewTab", "showAssetLibrary", "collaborationProvider", "enableReactNodeViewOptimization", "size", "otherAttachmentProps"];
5232
5232
  function ownKeys(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; }
5233
5233
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty__default.default(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5234
5234
  var Editor$1 = function Editor(_ref, ref) {
@@ -5263,6 +5263,8 @@ var Editor$1 = function Editor(_ref, ref) {
5263
5263
  extensions = _ref$extensions === void 0 ? [] : _ref$extensions,
5264
5264
  _ref$hideSlashCommand = _ref.hideSlashCommands,
5265
5265
  hideSlashCommands = _ref$hideSlashCommand === void 0 ? true : _ref$hideSlashCommand,
5266
+ _ref$appendSuggestion = _ref.appendSuggestionsToBody,
5267
+ appendSuggestionsToBody = _ref$appendSuggestion === void 0 ? false : _ref$appendSuggestion,
5266
5268
  _ref$initialValue = _ref.initialValue,
5267
5269
  initialValue = _ref$initialValue === void 0 ? "" : _ref$initialValue,
5268
5270
  _ref$isCharacterCount = _ref.isCharacterCountActive,
@@ -5383,7 +5385,8 @@ var Editor$1 = function Editor(_ref, ref) {
5383
5385
  enableReactNodeViewOptimization: enableReactNodeViewOptimization,
5384
5386
  collaborationProvider: collaborationProvider,
5385
5387
  setIsNeetoKbArticleActive: setNeetoKbArticleState,
5386
- containerRef: wrapperRef
5388
+ containerRef: wrapperRef,
5389
+ appendSuggestionsToBody: appendSuggestionsToBody
5387
5390
  });
5388
5391
  fuzzySearch.useEditorWarnings({
5389
5392
  initialValue: initialValue