@bigbinary/neeto-editor 1.47.127 → 1.47.131

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.
Files changed (93) hide show
  1. package/dist/Attachments.js +3 -3
  2. package/dist/Editor.js +51 -38
  3. package/dist/Editor.js.map +1 -1
  4. package/dist/EditorContent.js +2 -2
  5. package/dist/FormikEditor.js +6 -6
  6. package/dist/Menu.js +5 -5
  7. package/dist/{chunk-KiXJWA8i.js → chunk-1vCNA-at.js} +2 -2
  8. package/dist/{chunk-KiXJWA8i.js.map → chunk-1vCNA-at.js.map} +1 -1
  9. package/dist/{chunk-DtQctlVh.js → chunk-BN2ot0eJ.js} +4 -4
  10. package/dist/{chunk-DtQctlVh.js.map → chunk-BN2ot0eJ.js.map} +1 -1
  11. package/dist/{chunk--BjpQHaY.js → chunk-BaRCz8kF.js} +3 -3
  12. package/dist/{chunk--BjpQHaY.js.map → chunk-BaRCz8kF.js.map} +1 -1
  13. package/dist/{chunk-DdxH-PMo.js → chunk-C3QLxTd-.js} +4 -4
  14. package/dist/{chunk-DdxH-PMo.js.map → chunk-C3QLxTd-.js.map} +1 -1
  15. package/dist/{chunk-DSFIk2ef.js → chunk-Cjrs-UjE.js} +4 -4
  16. package/dist/{chunk-DSFIk2ef.js.map → chunk-Cjrs-UjE.js.map} +1 -1
  17. package/dist/{chunk-BwyS6si8.js → chunk-D3UBgQom.js} +3 -3
  18. package/dist/{chunk-BwyS6si8.js.map → chunk-D3UBgQom.js.map} +1 -1
  19. package/dist/{chunk-CF5f8-fy.js → chunk-DDFZ40sK.js} +2 -2
  20. package/dist/{chunk-CF5f8-fy.js.map → chunk-DDFZ40sK.js.map} +1 -1
  21. package/dist/{chunk-DDwycKmK.js → chunk-DrHVV_g1.js} +9 -4
  22. package/dist/chunk-DrHVV_g1.js.map +1 -0
  23. package/dist/{chunk-C8O6gt0z.js → chunk-LieRrhol.js} +18 -4
  24. package/dist/chunk-LieRrhol.js.map +1 -0
  25. package/dist/{chunk-CDPeBjvi.js → chunk-Pu0d3ZId.js} +9 -8
  26. package/dist/chunk-Pu0d3ZId.js.map +1 -0
  27. package/dist/{chunk-xCgPoq9w.js → chunk-QsL6T6V5.js} +2 -2
  28. package/dist/{chunk-xCgPoq9w.js.map → chunk-QsL6T6V5.js.map} +1 -1
  29. package/dist/{chunk-C_jttcYg.js → chunk-vncKwq6q.js} +3 -3
  30. package/dist/{chunk-C_jttcYg.js.map → chunk-vncKwq6q.js.map} +1 -1
  31. package/dist/cjs/Attachments.cjs.js +3 -3
  32. package/dist/cjs/Editor.cjs.js +51 -38
  33. package/dist/cjs/Editor.cjs.js.map +1 -1
  34. package/dist/cjs/EditorContent.cjs.js +2 -2
  35. package/dist/cjs/FormikEditor.cjs.js +6 -6
  36. package/dist/cjs/Menu.cjs.js +5 -5
  37. package/dist/cjs/{chunk-DS2JcxXk.cjs.js → chunk-9Fllxi6z.cjs.js} +3 -3
  38. package/dist/cjs/{chunk-DS2JcxXk.cjs.js.map → chunk-9Fllxi6z.cjs.js.map} +1 -1
  39. package/dist/cjs/{chunk-2HrSPdAV.cjs.js → chunk-Bmjmsp-E.cjs.js} +9 -4
  40. package/dist/cjs/chunk-Bmjmsp-E.cjs.js.map +1 -0
  41. package/dist/cjs/{chunk-n7U2G1az.cjs.js → chunk-CLoLWFsx.cjs.js} +4 -4
  42. package/dist/cjs/{chunk-n7U2G1az.cjs.js.map → chunk-CLoLWFsx.cjs.js.map} +1 -1
  43. package/dist/cjs/{chunk-DkzRRlJ6.cjs.js → chunk-CLrHidij.cjs.js} +18 -3
  44. package/dist/cjs/chunk-CLrHidij.cjs.js.map +1 -0
  45. package/dist/cjs/{chunk-62QG5j0v.cjs.js → chunk-CMN8WDYd.cjs.js} +4 -4
  46. package/dist/cjs/{chunk-62QG5j0v.cjs.js.map → chunk-CMN8WDYd.cjs.js.map} +1 -1
  47. package/dist/cjs/{chunk-Cvxaj__T.cjs.js → chunk-DJosicB7.cjs.js} +3 -3
  48. package/dist/cjs/{chunk-Cvxaj__T.cjs.js.map → chunk-DJosicB7.cjs.js.map} +1 -1
  49. package/dist/cjs/{chunk-D8Uup1eh.cjs.js → chunk-Dyzo4vqK.cjs.js} +4 -4
  50. package/dist/cjs/{chunk-D8Uup1eh.cjs.js.map → chunk-Dyzo4vqK.cjs.js.map} +1 -1
  51. package/dist/cjs/{chunk-CDAiAyof.cjs.js → chunk-LN_Txjhy.cjs.js} +2 -2
  52. package/dist/cjs/{chunk-CDAiAyof.cjs.js.map → chunk-LN_Txjhy.cjs.js.map} +1 -1
  53. package/dist/cjs/{chunk-BGy3NmZC.cjs.js → chunk-hfcF0hnk.cjs.js} +2 -2
  54. package/dist/cjs/{chunk-BGy3NmZC.cjs.js.map → chunk-hfcF0hnk.cjs.js.map} +1 -1
  55. package/dist/cjs/{chunk-Zpn4p-0s.cjs.js → chunk-u9FgmzyG.cjs.js} +9 -8
  56. package/dist/cjs/chunk-u9FgmzyG.cjs.js.map +1 -0
  57. package/dist/cjs/{chunk-B_7qxIrt.cjs.js → chunk-vT9IzHYQ.cjs.js} +3 -3
  58. package/dist/cjs/{chunk-B_7qxIrt.cjs.js.map → chunk-vT9IzHYQ.cjs.js.map} +1 -1
  59. package/dist/cjs/{chunk-yX0BlnxV.cjs.js → chunk-vq1owZ-6.cjs.js} +2 -2
  60. package/dist/cjs/{chunk-yX0BlnxV.cjs.js.map → chunk-vq1owZ-6.cjs.js.map} +1 -1
  61. package/dist/cjs/constants.cjs.js +2 -2
  62. package/dist/cjs/index.cjs.js +6 -6
  63. package/dist/cjs/utils.cjs.js +3 -3
  64. package/dist/cjs/v2/Attachments.cjs.js +3 -3
  65. package/dist/cjs/v2/Editor.cjs.js +24 -31
  66. package/dist/cjs/v2/Editor.cjs.js.map +1 -1
  67. package/dist/cjs/v2/EditorContent.cjs.js +3 -3
  68. package/dist/cjs/v2/FormikEditor.cjs.js +5 -5
  69. package/dist/cjs/v2/Menu.cjs.js +3 -3
  70. package/dist/cjs/v2/constants.cjs.js +2 -2
  71. package/dist/cjs/v2/index.cjs.js +6 -6
  72. package/dist/cjs/v2/utils.cjs.js +3 -3
  73. package/dist/constants.js +2 -2
  74. package/dist/editor-stats.html +2 -2
  75. package/dist/index.js +6 -6
  76. package/dist/utils.js +3 -3
  77. package/dist/v2/Attachments.js +3 -3
  78. package/dist/v2/Editor.js +24 -31
  79. package/dist/v2/Editor.js.map +1 -1
  80. package/dist/v2/EditorContent.js +3 -3
  81. package/dist/v2/FormikEditor.js +5 -5
  82. package/dist/v2/Menu.js +3 -3
  83. package/dist/v2/constants.js +2 -2
  84. package/dist/v2/index.js +6 -6
  85. package/dist/v2/utils.js +3 -3
  86. package/package.json +1 -1
  87. package/types.d.ts +1 -0
  88. package/dist/chunk-C8O6gt0z.js.map +0 -1
  89. package/dist/chunk-CDPeBjvi.js.map +0 -1
  90. package/dist/chunk-DDwycKmK.js.map +0 -1
  91. package/dist/cjs/chunk-2HrSPdAV.cjs.js.map +0 -1
  92. package/dist/cjs/chunk-DkzRRlJ6.cjs.js.map +0 -1
  93. package/dist/cjs/chunk-Zpn4p-0s.cjs.js.map +0 -1
@@ -11,8 +11,8 @@ import '@bigbinary/neetoui/Toastr';
11
11
  import 'ramda';
12
12
  import 'react-i18next';
13
13
  import './chunk-BFKmIsWV.js';
14
- import './chunk-xCgPoq9w.js';
15
- export { A as default } from './chunk-DdxH-PMo.js';
14
+ import './chunk-QsL6T6V5.js';
15
+ export { A as default } from './chunk-C3QLxTd-.js';
16
16
  import 'react/jsx-runtime';
17
17
  import '@bigbinary/neeto-commons-frontend/react-utils';
18
18
  import 'zustand';
@@ -37,7 +37,7 @@ import '@bigbinary/neeto-icons/AspectRatio43';
37
37
  import '@bigbinary/neeto-icons/AspectRatio32';
38
38
  import '@bigbinary/neeto-commons-frontend/initializers';
39
39
  import 'yup';
40
- import './chunk-DDwycKmK.js';
40
+ import './chunk-DrHVV_g1.js';
41
41
  import './chunk-C2dztUxs.js';
42
42
  import '@bigbinary/neeto-commons-frontend/react-utils/useOnClickOutside';
43
43
  import '@bigbinary/neeto-commons-frontend/utils';
package/dist/Editor.js CHANGED
@@ -5,7 +5,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
5
5
  import React__default, { memo, useState, useRef, useCallback, useEffect, createElement, forwardRef, useImperativeHandle } from 'react';
6
6
  import { a as useEditorState, E as Extension, N as NodeViewWrapper, b as NodeViewContent, c as Node3, R as ReactNodeViewRenderer, m as mergeAttributes, D as DecorationSet, d as Decoration, f as ReactRenderer, e as emojiPickerApi, h as markInputRule, I as InputRule, r as resetFocussedNode, i as highlightFocussedNode, P as PasteRule, C as CellSelection, B as BubbleMenu, j as getMarkType, k as getMarkRange, l as useEditor, n as EditorContent, o as EditorView } from './chunk-ChNzXvhJ.js';
7
7
  import classnames from 'classnames';
8
- import { D as DIRECT_UPLOAD_ENDPOINT, E as EDITOR_OPTIONS, C as COMBINED_REGEX, a as EDITOR_SIZES } from './chunk-DDwycKmK.js';
8
+ import { D as DIRECT_UPLOAD_ENDPOINT, E as EDITOR_OPTIONS, C as COMBINED_REGEX, a as EDITOR_SIZES } from './chunk-DrHVV_g1.js';
9
9
  import { isNotPresent, findBy, isNotEmpty, isPresent, noop, slugify } from '@bigbinary/neeto-cist';
10
10
  import { withT, useOnClickOutside, useFuncDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
11
11
  import Label from '@bigbinary/neetoui/Label';
@@ -14,12 +14,12 @@ import { is, intersection, difference, union, isEmpty, isNil, mergeRight, assoc,
14
14
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
15
15
  import { B as BulletList$1, i as index_default, a as index_default$1, R as Resizable, b as index_default$2, L as Link$1, s as scrollHandler, c as index_default$3, O as OrderedList$1, d as index_default$4, f as fuzzySearch, T as Table$2, e as TaskList, g as TaskItem, C as CharacterCount, h as index_default$5, j as index_default$6, k as TextStyle, l as index_default$7, F as Focus, m as index_default$8, n as TableRow, o as TableHeader, p as TableCell, q as Color, r as ListItem, t as index_default$9, u as index_default$a, v as useFetchKbArticles, M as MODE, w as createArticleOptions, x as MODAL_LEFT_OFFSET, y as MODAL_TOP_OFFSET, z as MODAL_TRANSFORM_Y, A as MODAL_TRANSFORM_X, D as MODAL_BOTTOM_MARGIN, E as buildArticleFullUrl, G as useEditorWarnings, H as useDeletedArticles } from './chunk-Be5ikGpm.js';
16
16
  import { n } from './chunk-C2dztUxs.js';
17
- import { b as buildLevelsFromOptions, v as validateAndFormatUrl, g as getEditorStyles, c as transformPastedHTML, h as handlePaste, d as clipboardTextParser, s as setInitialPosition } from './chunk-C_jttcYg.js';
17
+ import { b as buildLevelsFromOptions, v as validateAndFormatUrl, g as getEditorStyles, c as transformPastedHTML, h as handlePaste, d as clipboardTextParser, s as setInitialPosition } from './chunk-vncKwq6q.js';
18
18
  import ReactDOM from 'react-dom/server';
19
19
  import { l as lowlight, d as decodeHtmlEntities, r as removeEmptyTags } from './chunk-Qg4uQqj3.js';
20
- import { L as LINK_VALIDATION_SCHEMA, D as DEFAULT_EDITOR_OPTIONS } from './chunk-CF5f8-fy.js';
20
+ import { L as LINK_VALIDATION_SCHEMA, D as DEFAULT_EDITOR_OPTIONS } from './chunk-DDFZ40sK.js';
21
21
  import Megaphone from '@bigbinary/neeto-icons/misc/Megaphone';
22
- import { C as CALLOUT_TYPES, E as EmojiPickerMenu, v as validateUrl, g as getLinkPopoverPosition, M as Menu$4, a as MenuDynamicVariables, b as MediaUploader, L as LinkAddPopOver } from './chunk-CDPeBjvi.js';
22
+ import { C as CALLOUT_TYPES, E as EmojiPickerMenu, v as validateUrl, g as getLinkPopoverPosition, M as Menu$4, a as MenuDynamicVariables, b as MediaUploader, L as LinkAddPopOver } from './chunk-Pu0d3ZId.js';
23
23
  import Down from '@bigbinary/neeto-icons/Down';
24
24
  import Highlight from '@bigbinary/neeto-icons/Highlight';
25
25
  import CopyToClipboardButton from '@bigbinary/neeto-molecules/CopyToClipboardButton';
@@ -47,7 +47,7 @@ import Modal from '@bigbinary/neetoui/Modal';
47
47
  import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
48
48
  import AspectRatio from '@bigbinary/neeto-icons/AspectRatio';
49
49
  import Tooltip from '@bigbinary/neetoui/Tooltip';
50
- import { d as buildImageOptions, e as DEFAULT_ASPECT_RATIO } from './chunk-xCgPoq9w.js';
50
+ import { d as buildImageOptions, e as DEFAULT_ASPECT_RATIO } from './chunk-QsL6T6V5.js';
51
51
  import Avatar from '@bigbinary/neetoui/Avatar';
52
52
  import Typography from '@bigbinary/neetoui/Typography';
53
53
  import Tippy from '@tippyjs/react';
@@ -92,7 +92,7 @@ import Form from '@bigbinary/neetoui/formik/Form';
92
92
  import Input$1 from '@bigbinary/neetoui/formik/Input';
93
93
  import Edit from '@bigbinary/neeto-icons/Edit';
94
94
  import Articles from '@bigbinary/neeto-icons/Articles';
95
- import { A as Attachments } from './chunk-DdxH-PMo.js';
95
+ import { A as Attachments } from './chunk-C3QLxTd-.js';
96
96
  import 'axios';
97
97
  import 'zustand';
98
98
  import '@tanstack/react-query';
@@ -2028,8 +2028,6 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
2028
2028
  var _this2 = this;
2029
2029
  var selectedIndex = this.state.selectedIndex;
2030
2030
  var items = this.props.items;
2031
- var Menu = Dropdown.Menu,
2032
- MenuItem = Dropdown.MenuItem;
2033
2031
  if (isEmpty(items)) {
2034
2032
  return /*#__PURE__*/jsx("div", {
2035
2033
  className: "neeto-editor-mentions__wrapper",
@@ -2039,40 +2037,45 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
2039
2037
  })
2040
2038
  });
2041
2039
  }
2040
+
2041
+ // Rendered with plain elements instead of neetoUI's Dropdown.Menu. That Menu
2042
+ // auto-focuses its <ul> on mount, which pulls focus out of the editor and
2043
+ // breaks mention typing/arrow navigation (the list is driven entirely by the
2044
+ // editor's keydown). neetoUI's class names are kept so the popup styling is
2045
+ // unchanged.
2042
2046
  return /*#__PURE__*/jsx("div", {
2043
2047
  className: "neeto-ui-dropdown__popup",
2044
- children: /*#__PURE__*/jsx(Menu, {
2045
- className: "neeto-editor-mentions__wrapper",
2048
+ children: /*#__PURE__*/jsx("ul", {
2049
+ className: "neeto-ui-dropdown__popup-menu neeto-editor-mentions__wrapper",
2046
2050
  "data-testid": "neeto-editor-mention-list",
2047
- ref: this.mentionRef
2048
- // Keep the list non-focusable so neetoUI's Menu can't auto-focus its
2049
- // <ul> and steal focus from the editor; mention keystrokes and arrow
2050
- // keys are handled through the editor's own keydown.
2051
- ,
2052
- tabIndex: null,
2051
+ ref: this.mentionRef,
2053
2052
  children: items.map(function (_ref2, index) {
2054
2053
  var key = _ref2.key,
2055
2054
  name = _ref2.name,
2056
2055
  imageUrl = _ref2.imageUrl;
2057
- return /*#__PURE__*/jsxs(MenuItem.Button, {
2058
- "data-testid": "neeto-editor-mention-list-".concat(name),
2059
- type: "button",
2060
- className: classnames("neeto-editor-mentions__item", {
2061
- active: index === selectedIndex
2062
- }),
2063
- onClick: function onClick() {
2064
- return _this2.selectItem(index);
2065
- },
2066
- children: [/*#__PURE__*/jsx(Avatar, {
2067
- size: "small",
2068
- user: {
2069
- name: name,
2070
- imageUrl: imageUrl
2071
- }
2072
- }), /*#__PURE__*/jsx(Typography, {
2073
- style: "body2",
2074
- children: name
2075
- })]
2056
+ return /*#__PURE__*/jsx("li", {
2057
+ className: "neeto-ui-dropdown__popup-menu-item",
2058
+ role: "menuitem",
2059
+ children: /*#__PURE__*/jsxs("button", {
2060
+ "data-testid": "neeto-editor-mention-list-".concat(name),
2061
+ type: "button",
2062
+ className: classnames("neeto-ui-dropdown__popup-menu-item-btn neeto-editor-mentions__item", {
2063
+ active: index === selectedIndex
2064
+ }),
2065
+ onClick: function onClick() {
2066
+ return _this2.selectItem(index);
2067
+ },
2068
+ children: [/*#__PURE__*/jsx(Avatar, {
2069
+ size: "small",
2070
+ user: {
2071
+ name: name,
2072
+ imageUrl: imageUrl
2073
+ }
2074
+ }), /*#__PURE__*/jsx(Typography, {
2075
+ style: "body2",
2076
+ children: name
2077
+ })]
2078
+ })
2076
2079
  }, key);
2077
2080
  })
2078
2081
  })
@@ -3727,6 +3730,13 @@ var getEmbedAttributes = function getEmbedAttributes() {
3727
3730
  title: {
3728
3731
  "default": null
3729
3732
  },
3733
+ originalUrl: {
3734
+ "default": "",
3735
+ parseHTML: function parseHTML(element) {
3736
+ var iframe = element.querySelector(".neeto-editor__video-iframe");
3737
+ return (iframe === null || iframe === void 0 ? void 0 : iframe.getAttribute("data-original-url")) || "";
3738
+ }
3739
+ },
3730
3740
  frameBorder: "0",
3731
3741
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",
3732
3742
  allowfullscreen: true
@@ -3738,7 +3748,8 @@ var renderEmbedHTML = function renderEmbedHTML(node, HTMLAttributes, options) {
3738
3748
  figheight = _node$attrs.figheight,
3739
3749
  figwidth = _node$attrs.figwidth,
3740
3750
  border = _node$attrs.border,
3741
- aspectRatio = _node$attrs.aspectRatio;
3751
+ aspectRatio = _node$attrs.aspectRatio,
3752
+ originalUrl = _node$attrs.originalUrl;
3742
3753
  return ["div", {
3743
3754
  "class": classnames("neeto-editor__video-wrapper", "neeto-editor__video--".concat(align), {
3744
3755
  "neeto-editor__video--bordered": border
@@ -3755,7 +3766,8 @@ var renderEmbedHTML = function renderEmbedHTML(node, HTMLAttributes, options) {
3755
3766
  "data-aspect-ratio": aspectRatio
3756
3767
  }, ["iframe", mergeAttributes(options.HTMLAttributes, _objectSpread$3(_objectSpread$3({}, HTMLAttributes), {}, {
3757
3768
  allowfullscreen: true,
3758
- "data-border": border
3769
+ "data-border": border,
3770
+ "data-original-url": originalUrl
3759
3771
  }))]]];
3760
3772
  };
3761
3773
  var renderUploadHTML = function renderUploadHTML(node, HTMLAttributes, options) {
@@ -3798,7 +3810,8 @@ var handleVideoPaste = function handleVideoPaste(_ref) {
3798
3810
  if (validatedUrl) {
3799
3811
  var node = state.schema.nodes["unified-video"].create({
3800
3812
  src: validatedUrl,
3801
- videoType: "embed"
3813
+ videoType: "embed",
3814
+ originalUrl: match[0]
3802
3815
  });
3803
3816
  state.tr.insert(range.from, node);
3804
3817
  state.tr.insert(range.from + node.nodeSize + 1, state.schema.nodes.paragraph.create());