@atlaskit/editor-core 150.0.1 → 151.1.0

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 (248) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/cjs/actions/index.js +5 -23
  3. package/dist/cjs/create-editor/ErrorBoundary.js +113 -79
  4. package/dist/cjs/create-editor/ReactEditorView.js +145 -31
  5. package/dist/cjs/create-editor/create-plugins-list.js +8 -2
  6. package/dist/cjs/editor.js +101 -40
  7. package/dist/cjs/labs/next/presets/cxhtml.js +2 -1
  8. package/dist/cjs/plugins/analytics/types/enums.js +3 -1
  9. package/dist/cjs/plugins/base/index.js +4 -3
  10. package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +66 -36
  11. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
  12. package/dist/cjs/plugins/card/index.js +13 -2
  13. package/dist/cjs/plugins/card/nodeviews/embedCard.js +1 -0
  14. package/dist/cjs/plugins/card/pm-plugins/main.js +7 -2
  15. package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +10 -3
  16. package/dist/cjs/plugins/code-bidi-warning/index.js +25 -0
  17. package/dist/cjs/plugins/code-bidi-warning/plugin-key.js +11 -0
  18. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +43 -0
  19. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +118 -0
  20. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/reducer.js +12 -0
  21. package/dist/cjs/plugins/code-bidi-warning/pm-plugins/types.js +5 -0
  22. package/dist/cjs/plugins/code-block/index.js +10 -6
  23. package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +16 -5
  24. package/dist/cjs/plugins/code-block/pm-plugins/main.js +12 -3
  25. package/dist/cjs/plugins/code-block/toolbar.js +1 -1
  26. package/dist/cjs/plugins/collab-edit/ui/to-avatar.js +4 -8
  27. package/dist/cjs/plugins/emoji/styles.js +1 -1
  28. package/dist/cjs/plugins/extension/pm-plugins/main.js +1 -4
  29. package/dist/cjs/plugins/extension/toolbar.js +28 -23
  30. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +9 -3
  31. package/dist/cjs/plugins/find-replace/ui/Find.js +27 -7
  32. package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +3 -3
  33. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  34. package/dist/cjs/plugins/hyperlink/utils.js +6 -69
  35. package/dist/cjs/plugins/index.js +8 -0
  36. package/dist/cjs/plugins/media/index.js +14 -3
  37. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +24 -10
  38. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +179 -0
  39. package/dist/cjs/plugins/media/pm-plugins/main.js +18 -9
  40. package/dist/cjs/plugins/media/toolbar/index.js +49 -17
  41. package/dist/cjs/plugins/media/toolbar/utils.js +20 -2
  42. package/dist/cjs/plugins/media/utils/media-files.js +67 -1
  43. package/dist/cjs/plugins/mentions/type-ahead/index.js +39 -3
  44. package/dist/cjs/plugins/panel/index.js +2 -3
  45. package/dist/cjs/plugins/panel/message.js +47 -0
  46. package/dist/cjs/plugins/panel/toolbar.js +64 -84
  47. package/dist/cjs/plugins/panel/utils.js +2 -2
  48. package/dist/cjs/plugins/paste/linkify-md-plugin.js +3 -3
  49. package/dist/cjs/plugins/rank.js +1 -1
  50. package/dist/cjs/plugins/status/styles.js +1 -1
  51. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  52. package/dist/cjs/profiler/render-count.js +82 -0
  53. package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -5
  54. package/dist/cjs/utils/react-hooks/use-component-renderer-tracking/index.js +55 -19
  55. package/dist/cjs/version-wrapper.js +1 -1
  56. package/dist/cjs/version.json +1 -1
  57. package/dist/es2019/actions/index.js +6 -28
  58. package/dist/es2019/create-editor/ErrorBoundary.js +73 -60
  59. package/dist/es2019/create-editor/ReactEditorView.js +130 -23
  60. package/dist/es2019/create-editor/create-plugins-list.js +9 -3
  61. package/dist/es2019/editor.js +74 -35
  62. package/dist/es2019/labs/next/presets/cxhtml.js +2 -1
  63. package/dist/es2019/plugins/analytics/types/enums.js +3 -1
  64. package/dist/es2019/plugins/base/index.js +4 -3
  65. package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +63 -35
  66. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +2 -1
  67. package/dist/es2019/plugins/card/index.js +7 -2
  68. package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -0
  69. package/dist/es2019/plugins/card/pm-plugins/main.js +9 -2
  70. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +12 -5
  71. package/dist/es2019/plugins/code-bidi-warning/index.js +15 -0
  72. package/dist/es2019/plugins/code-bidi-warning/plugin-key.js +2 -0
  73. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +31 -0
  74. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +88 -0
  75. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/reducer.js +3 -0
  76. package/dist/es2019/plugins/code-bidi-warning/pm-plugins/types.js +1 -0
  77. package/dist/es2019/plugins/code-block/index.js +6 -1
  78. package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +16 -4
  79. package/dist/es2019/plugins/code-block/pm-plugins/main.js +50 -39
  80. package/dist/es2019/plugins/code-block/toolbar.js +1 -1
  81. package/dist/es2019/plugins/collab-edit/ui/to-avatar.js +2 -6
  82. package/dist/es2019/plugins/emoji/styles.js +2 -0
  83. package/dist/es2019/plugins/extension/pm-plugins/main.js +1 -4
  84. package/dist/es2019/plugins/extension/toolbar.js +30 -25
  85. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +9 -4
  86. package/dist/es2019/plugins/find-replace/ui/Find.js +27 -6
  87. package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -1
  88. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  89. package/dist/es2019/plugins/hyperlink/utils.js +3 -59
  90. package/dist/es2019/plugins/index.js +2 -1
  91. package/dist/es2019/plugins/media/index.js +13 -4
  92. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +16 -7
  93. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +88 -0
  94. package/dist/es2019/plugins/media/pm-plugins/main.js +20 -11
  95. package/dist/es2019/plugins/media/toolbar/index.js +44 -15
  96. package/dist/es2019/plugins/media/toolbar/utils.js +16 -0
  97. package/dist/es2019/plugins/media/utils/media-files.js +68 -2
  98. package/dist/es2019/plugins/mentions/type-ahead/index.js +21 -2
  99. package/dist/es2019/plugins/panel/index.js +3 -4
  100. package/dist/es2019/plugins/panel/message.js +38 -0
  101. package/dist/es2019/plugins/panel/toolbar.js +52 -71
  102. package/dist/es2019/plugins/panel/utils.js +2 -2
  103. package/dist/es2019/plugins/paste/linkify-md-plugin.js +2 -2
  104. package/dist/es2019/plugins/rank.js +1 -1
  105. package/dist/es2019/plugins/status/styles.js +2 -0
  106. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  107. package/dist/es2019/profiler/render-count.js +60 -0
  108. package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -2
  109. package/dist/es2019/utils/react-hooks/use-component-renderer-tracking/index.js +51 -18
  110. package/dist/es2019/version-wrapper.js +1 -1
  111. package/dist/es2019/version.json +1 -1
  112. package/dist/esm/actions/index.js +6 -24
  113. package/dist/esm/create-editor/ErrorBoundary.js +113 -78
  114. package/dist/esm/create-editor/ReactEditorView.js +146 -31
  115. package/dist/esm/create-editor/create-plugins-list.js +9 -3
  116. package/dist/esm/editor.js +100 -40
  117. package/dist/esm/labs/next/presets/cxhtml.js +2 -1
  118. package/dist/esm/plugins/analytics/types/enums.js +3 -1
  119. package/dist/esm/plugins/base/index.js +4 -3
  120. package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +64 -36
  121. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
  122. package/dist/esm/plugins/card/index.js +13 -2
  123. package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -0
  124. package/dist/esm/plugins/card/pm-plugins/main.js +7 -2
  125. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +12 -5
  126. package/dist/esm/plugins/code-bidi-warning/index.js +17 -0
  127. package/dist/esm/plugins/code-bidi-warning/plugin-key.js +2 -0
  128. package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +30 -0
  129. package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +96 -0
  130. package/dist/esm/plugins/code-bidi-warning/pm-plugins/reducer.js +3 -0
  131. package/dist/esm/plugins/code-bidi-warning/pm-plugins/types.js +1 -0
  132. package/dist/esm/plugins/code-block/index.js +10 -6
  133. package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +16 -5
  134. package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
  135. package/dist/esm/plugins/code-block/toolbar.js +1 -1
  136. package/dist/esm/plugins/collab-edit/ui/to-avatar.js +4 -8
  137. package/dist/esm/plugins/emoji/styles.js +1 -1
  138. package/dist/esm/plugins/extension/pm-plugins/main.js +1 -4
  139. package/dist/esm/plugins/extension/toolbar.js +28 -23
  140. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +9 -4
  141. package/dist/esm/plugins/find-replace/ui/Find.js +27 -7
  142. package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -1
  143. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
  144. package/dist/esm/plugins/hyperlink/utils.js +3 -59
  145. package/dist/esm/plugins/index.js +2 -1
  146. package/dist/esm/plugins/media/index.js +14 -4
  147. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +24 -10
  148. package/dist/esm/plugins/media/nodeviews/mediaInline.js +147 -0
  149. package/dist/esm/plugins/media/pm-plugins/main.js +19 -11
  150. package/dist/esm/plugins/media/toolbar/index.js +47 -19
  151. package/dist/esm/plugins/media/toolbar/utils.js +15 -1
  152. package/dist/esm/plugins/media/utils/media-files.js +60 -2
  153. package/dist/esm/plugins/mentions/type-ahead/index.js +39 -3
  154. package/dist/esm/plugins/panel/index.js +3 -4
  155. package/dist/esm/plugins/panel/message.js +38 -0
  156. package/dist/esm/plugins/panel/toolbar.js +57 -77
  157. package/dist/esm/plugins/panel/utils.js +2 -2
  158. package/dist/esm/plugins/paste/linkify-md-plugin.js +2 -2
  159. package/dist/esm/plugins/rank.js +1 -1
  160. package/dist/esm/plugins/status/styles.js +1 -1
  161. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
  162. package/dist/esm/profiler/render-count.js +57 -0
  163. package/dist/esm/ui/Appearance/Comment/Comment.js +6 -5
  164. package/dist/esm/utils/react-hooks/use-component-renderer-tracking/index.js +53 -20
  165. package/dist/esm/version-wrapper.js +1 -1
  166. package/dist/esm/version.json +1 -1
  167. package/dist/types/create-editor/ErrorBoundary.d.ts +6 -6
  168. package/dist/types/create-editor/ReactEditorView.d.ts +15 -3
  169. package/dist/types/editor.d.ts +3 -1
  170. package/dist/types/plugins/analytics/analytics-queue.d.ts +1 -1
  171. package/dist/types/plugins/analytics/index.d.ts +1 -1
  172. package/dist/types/plugins/analytics/types/enums.d.ts +4 -2
  173. package/dist/types/plugins/analytics/types/events.d.ts +7 -2
  174. package/dist/types/plugins/analytics/types/general-events.d.ts +4 -1
  175. package/dist/types/plugins/analytics/types/index.d.ts +1 -1
  176. package/dist/types/plugins/analytics/types/insert-events.d.ts +6 -1
  177. package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -0
  178. package/dist/types/plugins/base/index.d.ts +1 -0
  179. package/dist/types/plugins/base/pm-plugins/frozen-editor.d.ts +3 -2
  180. package/dist/types/plugins/card/pm-plugins/main.d.ts +2 -3
  181. package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +2 -1
  182. package/dist/types/plugins/card/types.d.ts +6 -0
  183. package/dist/types/plugins/code-bidi-warning/index.d.ts +3 -0
  184. package/dist/types/plugins/code-bidi-warning/plugin-key.d.ts +2 -0
  185. package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +3 -0
  186. package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +7 -0
  187. package/dist/types/plugins/code-bidi-warning/pm-plugins/reducer.d.ts +3 -0
  188. package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +5 -0
  189. package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +11 -2
  190. package/dist/types/plugins/code-block/pm-plugins/main.d.ts +5 -1
  191. package/dist/types/plugins/collab-edit/ui/to-avatar.d.ts +1 -1
  192. package/dist/types/plugins/extension/types.d.ts +0 -2
  193. package/dist/types/plugins/extension/ui/Extension/ExtensionComponent.d.ts +2 -2
  194. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
  195. package/dist/types/plugins/floating-toolbar/types.d.ts +1 -1
  196. package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -1
  197. package/dist/types/plugins/hyperlink/utils.d.ts +0 -21
  198. package/dist/types/plugins/index.d.ts +1 -0
  199. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
  200. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +27 -0
  201. package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -2
  202. package/dist/types/plugins/media/toolbar/utils.d.ts +2 -0
  203. package/dist/types/plugins/media/utils/media-files.d.ts +8 -0
  204. package/dist/types/plugins/panel/message.d.ts +37 -0
  205. package/dist/types/plugins/panel/toolbar.d.ts +4 -37
  206. package/dist/types/plugins/panel/types.d.ts +1 -0
  207. package/dist/types/plugins/quick-insert/index.d.ts +1 -1
  208. package/dist/types/profiler/render-count.d.ts +14 -0
  209. package/dist/types/types/feature-flags.d.ts +17 -0
  210. package/dist/types/ui/LinkSearch/types.d.ts +1 -0
  211. package/dist/types/utils/react-hooks/use-component-renderer-tracking/index.d.ts +17 -1
  212. package/package.json +22 -19
  213. package/dist/cjs/plugins/caption/nodeviews/index.test.js +0 -135
  214. package/dist/cjs/plugins/caption/pm-plugins/keymap.test.js +0 -203
  215. package/dist/cjs/plugins/caption/pm-plugins/main.test.js +0 -141
  216. package/dist/cjs/plugins/code-block/language-list.test.js +0 -74
  217. package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -101
  218. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -98
  219. package/dist/cjs/plugins/media/commands/captions.test.js +0 -149
  220. package/dist/cjs/plugins/media/commands/linking.test.js +0 -296
  221. package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -50
  222. package/dist/cjs/plugins/panel/toolbar.test.js +0 -250
  223. package/dist/cjs/ui/ColorPickerButton/index.test.js +0 -123
  224. package/dist/cjs/ui/PortalProvider/index.test.js +0 -139
  225. package/dist/es2019/plugins/caption/nodeviews/index.test.js +0 -122
  226. package/dist/es2019/plugins/caption/pm-plugins/keymap.test.js +0 -193
  227. package/dist/es2019/plugins/caption/pm-plugins/main.test.js +0 -132
  228. package/dist/es2019/plugins/code-block/language-list.test.js +0 -69
  229. package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -83
  230. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
  231. package/dist/es2019/plugins/media/commands/captions.test.js +0 -126
  232. package/dist/es2019/plugins/media/commands/linking.test.js +0 -208
  233. package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
  234. package/dist/es2019/plugins/panel/toolbar.test.js +0 -200
  235. package/dist/es2019/ui/ColorPickerButton/index.test.js +0 -88
  236. package/dist/es2019/ui/PortalProvider/index.test.js +0 -115
  237. package/dist/esm/plugins/caption/nodeviews/index.test.js +0 -125
  238. package/dist/esm/plugins/caption/pm-plugins/keymap.test.js +0 -195
  239. package/dist/esm/plugins/caption/pm-plugins/main.test.js +0 -124
  240. package/dist/esm/plugins/code-block/language-list.test.js +0 -71
  241. package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -92
  242. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
  243. package/dist/esm/plugins/media/commands/captions.test.js +0 -135
  244. package/dist/esm/plugins/media/commands/linking.test.js +0 -268
  245. package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
  246. package/dist/esm/plugins/panel/toolbar.test.js +0 -230
  247. package/dist/esm/ui/ColorPickerButton/index.test.js +0 -107
  248. package/dist/esm/ui/PortalProvider/index.test.js +0 -129
@@ -11,6 +11,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
 
12
12
  var _prosemirrorState = require("prosemirror-state");
13
13
 
14
+ var _messages = require("@atlaskit/editor-common/messages");
15
+
14
16
  var _codeBlock = require("../nodeviews/code-block");
15
17
 
16
18
  var _highlightingCodeBlock = require("../nodeviews/highlighting-code-block");
@@ -31,8 +33,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
31
33
 
32
34
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
33
35
 
34
- var createPlugin = function createPlugin() {
35
- var useLongPressSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
36
+ var createPlugin = function createPlugin(_ref) {
37
+ var _ref$useLongPressSele = _ref.useLongPressSelection,
38
+ useLongPressSelection = _ref$useLongPressSele === void 0 ? false : _ref$useLongPressSele,
39
+ reactContext = _ref.reactContext;
40
+ var intl = reactContext().intl;
41
+ var codeBidiWarningLabel = intl.formatMessage(_messages.codeBidiWarningMessages.label);
36
42
  return new _prosemirrorState.Plugin({
37
43
  state: {
38
44
  init: function init(_, state) {
@@ -71,7 +77,10 @@ var createPlugin = function createPlugin() {
71
77
  nodeViews: {
72
78
  codeBlock: function codeBlock(node, view, getPos) {
73
79
  var featureFlags = (0, _featureFlagsContext.getFeatureFlags)(view.state);
74
- var createCodeBlockNodeView = featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? (0, _highlightingCodeBlock.highlightingCodeBlockNodeView)() : (0, _codeBlock.codeBlockNodeView)();
80
+ var createCodeBlockNodeView = featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? (0, _highlightingCodeBlock.highlightingCodeBlockNodeView)({
81
+ codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
82
+ codeBidiWarningLabel: codeBidiWarningLabel
83
+ }) : (0, _codeBlock.codeBlockNodeView)();
75
84
  return createCodeBlockNodeView(node, view, getPos);
76
85
  }
77
86
  },
@@ -70,7 +70,7 @@ var getToolbarConfig = function getToolbarConfig() {
70
70
  return option.value === language;
71
71
  }) || options.find(function (option) {
72
72
  return option.alias.includes(language);
73
- }) : undefined;
73
+ }) : null;
74
74
  var languageSelect = {
75
75
  id: 'editor.codeBlock.languageOptions',
76
76
  type: 'select',
@@ -27,18 +27,14 @@ var toAvatar = function toAvatar(participant) {
27
27
  };
28
28
  };
29
29
 
30
- var participantEquals = function participantEquals(_ref, _ref2) {
30
+ var _default = (0, _memoizeOne.default)(toAvatar, function participantEquals(_ref, _ref2) {
31
31
  var _ref3 = (0, _slicedToArray2.default)(_ref, 1),
32
- aRaw = _ref3[0];
32
+ a = _ref3[0];
33
33
 
34
34
  var _ref4 = (0, _slicedToArray2.default)(_ref2, 1),
35
- bRaw = _ref4[0];
35
+ b = _ref4[0];
36
36
 
37
- var a = aRaw;
38
- var b = bRaw;
39
37
  return a.name === b.name && a.avatar === b.avatar && a.sessionId === b.sessionId;
40
- };
41
-
42
- var _default = (0, _memoizeOne.default)(toAvatar, participantEquals);
38
+ });
43
39
 
44
40
  exports.default = _default;
@@ -21,7 +21,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
21
21
 
22
22
  var _templateObject, _templateObject2;
23
23
 
24
- var emojiStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n .", " {\n cursor: pointer;\n\n &.", " > span {\n /** needed for selection style to cover custom emoji image properly */\n display: flex;\n }\n }\n\n &.", " {\n .", ",\n .", "\n > span {\n border-radius: 2px;\n ", "\n }\n }\n }\n"])), _editorCommon.EmojiSharedCssClassName.EMOJI_CONTAINER, _editorCommon.EmojiSharedCssClassName.EMOJI_NODE, _editorCommon.EmojiSharedCssClassName.EMOJI_IMAGE, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.EmojiSharedCssClassName.EMOJI_SPRITE, _editorCommon.EmojiSharedCssClassName.EMOJI_IMAGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.BoxShadow]));
24
+ var emojiStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n display: inline-block;\n\n .", " {\n cursor: pointer;\n\n &.", " > span {\n /** needed for selection style to cover custom emoji image properly */\n display: flex;\n }\n }\n\n &.", " {\n .", ",\n .", "\n > span {\n border-radius: 2px;\n ", "\n }\n }\n }\n"])), _editorCommon.EmojiSharedCssClassName.EMOJI_CONTAINER, _editorCommon.EmojiSharedCssClassName.EMOJI_NODE, _editorCommon.EmojiSharedCssClassName.EMOJI_IMAGE, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.EmojiSharedCssClassName.EMOJI_SPRITE, _editorCommon.EmojiSharedCssClassName.EMOJI_IMAGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.BoxShadow]));
25
25
  exports.emojiStyles = emojiStyles;
26
26
  var grid = (0, _constants.gridSize)() / 2;
27
27
  var fontSize = (0, _constants.fontSizeSmall)();
@@ -295,7 +295,6 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
295
295
  var useLongPressSelection = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
296
296
  var options = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
297
297
  var state = (0, _pluginFactory.createPluginState)(dispatch, {
298
- layout: 'default',
299
298
  showEditButton: false,
300
299
  showContextPanel: false
301
300
  });
@@ -348,14 +347,12 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
348
347
  var showEditButton = shouldShowEditButton(extensionHandler, extensionProvider);
349
348
  var updateExtension = getUpdateExtensionPromise(view, extensionHandler, extensionProvider).catch(function () {// do nothing;
350
349
  });
351
- var layout = selectedExtension ? node.attrs.layout : 'default';
352
350
  (0, _commands.updateState)({
353
351
  localId: node.attrs.localId,
354
352
  showContextPanel: false,
355
353
  element: newElement,
356
354
  showEditButton: showEditButton,
357
- updateExtension: updateExtension,
358
- layout: layout
355
+ updateExtension: updateExtension
359
356
  })(state, dispatch);
360
357
  } // New DOM element doesn't necessarily mean it's a new Node
361
358
  else if (element !== newElement) {
@@ -62,28 +62,33 @@ var isLayoutSupported = function isLayoutSupported(state, selectedExtNode) {
62
62
  return !!((selectedExtNode.node.type === bodiedExtension || selectedExtNode.node.type === extension && !(0, _prosemirrorUtils.hasParentNodeOfType)([bodiedExtension, table, expand].filter(Boolean))(selection)) && !(0, _prosemirrorUtils.hasParentNodeOfType)([layoutSection])(selection));
63
63
  };
64
64
 
65
- var breakoutOptions = function breakoutOptions(state, formatMessage, extensionState, breakoutEnabled) {
66
- var nodeWithPos = (0, _utils.getSelectedExtension)(state, true);
67
- var layout = extensionState.layout;
68
- return nodeWithPos && breakoutEnabled && isLayoutSupported(state, nodeWithPos) ? [{
69
- type: 'button',
70
- icon: _mediaCenter.default,
71
- onClick: (0, _commands.updateExtensionLayout)('default'),
72
- selected: layout === 'default',
73
- title: formatMessage(_messages.default.layoutFixedWidth)
74
- }, {
75
- type: 'button',
76
- icon: _mediaWide.default,
77
- onClick: (0, _commands.updateExtensionLayout)('wide'),
78
- selected: layout === 'wide',
79
- title: formatMessage(_messages.default.layoutWide)
80
- }, {
81
- type: 'button',
82
- icon: _mediaFullWidth.default,
83
- onClick: (0, _commands.updateExtensionLayout)('full-width'),
84
- selected: layout === 'full-width',
85
- title: formatMessage(_messages.default.layoutFullWidth)
86
- }] : [];
65
+ var breakoutOptions = function breakoutOptions(state, formatMessage, breakoutEnabled) {
66
+ var nodeWithPos = (0, _utils.getSelectedExtension)(state, true); // we should only return breakout options when breakouts are enabled and the node supports them
67
+
68
+ if (nodeWithPos && breakoutEnabled && isLayoutSupported(state, nodeWithPos)) {
69
+ var layout = nodeWithPos.node.attrs.layout;
70
+ return [{
71
+ type: 'button',
72
+ icon: _mediaCenter.default,
73
+ onClick: (0, _commands.updateExtensionLayout)('default'),
74
+ selected: layout === 'default',
75
+ title: formatMessage(_messages.default.layoutFixedWidth)
76
+ }, {
77
+ type: 'button',
78
+ icon: _mediaWide.default,
79
+ onClick: (0, _commands.updateExtensionLayout)('wide'),
80
+ selected: layout === 'wide',
81
+ title: formatMessage(_messages.default.layoutWide)
82
+ }, {
83
+ type: 'button',
84
+ icon: _mediaFullWidth.default,
85
+ onClick: (0, _commands.updateExtensionLayout)('full-width'),
86
+ selected: layout === 'full-width',
87
+ title: formatMessage(_messages.default.layoutFullWidth)
88
+ }];
89
+ }
90
+
91
+ return [];
87
92
  };
88
93
 
89
94
  var editButton = function editButton(formatMessage, extensionState) {
@@ -119,7 +124,7 @@ var getToolbarConfig = function getToolbarConfig() {
119
124
  if (extensionState && !extensionState.showContextPanel && extensionState.element) {
120
125
  var nodeType = [state.schema.nodes.extension, state.schema.nodes.inlineExtension, state.schema.nodes.bodiedExtension];
121
126
  var editButtonArray = editButton(formatMessage, extensionState);
122
- var breakoutButtonArray = breakoutOptions(state, formatMessage, extensionState, breakoutEnabled);
127
+ var breakoutButtonArray = breakoutOptions(state, formatMessage, breakoutEnabled);
123
128
  return {
124
129
  title: 'Extension floating controls',
125
130
  getDomRef: function getDomRef() {
@@ -13,6 +13,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
13
13
 
14
14
  var _normalizeFeatureFlags = require("@atlaskit/editor-common/normalize-feature-flags");
15
15
 
16
+ var _editorCommon = require("@atlaskit/editor-common");
17
+
16
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
17
19
 
18
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -22,9 +24,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
22
24
  * which is used by both current and archv3 editors.
23
25
  */
24
26
  function createFeatureFlagsFromProps(props) {
25
- var _props$allowTextColor, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25;
27
+ var _props$allowTextColor, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29;
26
28
 
27
- return _objectSpread(_objectSpread({}, (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags)), {}, {
29
+ var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
30
+ return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
28
31
  newInsertionBehaviour: props.allowNewInsertionBehaviour,
29
32
  interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
30
33
  placeholderBracketHint: !!props.placeholderBracketHint,
@@ -49,6 +52,9 @@ function createFeatureFlagsFromProps(props) {
49
52
  errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.useErrorBoundaryDocStructure) : false),
50
53
  synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.synchronyErrorDocStructure) : false),
51
54
  enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.enableViewUpdateSubscription) : false),
52
- collabAvatarScroll: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.collabAvatarScroll) : false)
55
+ collabAvatarScroll: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.collabAvatarScroll) : false),
56
+ ufo: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.ufo) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.ufo) : false),
57
+ codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !_editorCommon.browser.safari : false),
58
+ codeBidiWarnings: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.codeBidiWarnings) : true)
53
59
  });
54
60
  }
@@ -110,12 +110,16 @@ var Find = /*#__PURE__*/function (_React$Component) {
110
110
  }
111
111
  });
112
112
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleFindChange", function (event) {
113
- return _this.skipWhileComposing(function () {
114
- _this.updateFindValue(event.target.value);
115
- });
113
+ _this.updateFindValue(event.target.value);
116
114
  });
117
115
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateFindValue", function (value) {
118
- _this.props.onFind(value);
116
+ _this.setState({
117
+ localFindText: value
118
+ });
119
+
120
+ _this.skipWhileComposing(function () {
121
+ _this.props.onFind(value);
122
+ });
119
123
  });
120
124
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleFindKeyDown", function (event) {
121
125
  return _this.skipWhileComposing(function () {
@@ -187,7 +191,13 @@ var Find = /*#__PURE__*/function (_React$Component) {
187
191
  });
188
192
  _this.closeIcon = /*#__PURE__*/_react.default.createElement(_close.default, {
189
193
  label: _this.closeFindReplaceDialog
190
- });
194
+ }); // We locally manage the value of the input inside this component in order to support compositions.
195
+ // This requires some additional work inside componentDidUpdate to ensure we support changes that
196
+ // occur to this value which do not originate from this component.
197
+
198
+ _this.state = {
199
+ localFindText: _this.props.findText || ''
200
+ };
191
201
  return _this;
192
202
  }
193
203
 
@@ -200,7 +210,17 @@ var Find = /*#__PURE__*/function (_React$Component) {
200
210
  }, {
201
211
  key: "componentDidUpdate",
202
212
  value: function componentDidUpdate() {
203
- this.focusFindTextfield();
213
+ this.focusFindTextfield(); // If the external prop findText changes and we aren't in a composition we should update to the
214
+ // use the external prop value.
215
+ //
216
+ // An example of where this may happen is when a find occurs through the user selecting some text
217
+ // and pressing Mod-f.
218
+
219
+ if (!this.isComposing && this.props.findText !== this.state.localFindText) {
220
+ this.setState({
221
+ localFindText: this.props.findText || ''
222
+ });
223
+ }
204
224
  }
205
225
  }, {
206
226
  key: "render",
@@ -219,7 +239,7 @@ var Find = /*#__PURE__*/function (_React$Component) {
219
239
  name: "find",
220
240
  appearance: "none",
221
241
  placeholder: this.find,
222
- value: findText,
242
+ value: this.state.localFindText,
223
243
  ref: this.findTextfieldRef,
224
244
  autoComplete: "off",
225
245
  onChange: this.handleFindChange,
@@ -10,9 +10,9 @@ exports.default = void 0;
10
10
 
11
11
  var _prosemirrorKeymap = require("prosemirror-keymap");
12
12
 
13
- var keymaps = _interopRequireWildcard(require("../../../keymaps"));
13
+ var _adfSchema = require("@atlaskit/adf-schema");
14
14
 
15
- var _utils = require("../utils");
15
+ var keymaps = _interopRequireWildcard(require("../../../keymaps"));
16
16
 
17
17
  var _main = require("../pm-plugins/main");
18
18
 
@@ -62,7 +62,7 @@ var mayConvertLastWordToHyperlink = function mayConvertLastWordToHyperlink(skipA
62
62
 
63
63
  var words = nodeBefore.text.split(' ');
64
64
  var lastWord = words[words.length - 1];
65
- var match = (0, _utils.getLinkMatch)(lastWord);
65
+ var match = (0, _adfSchema.getLinkMatch)(lastWord);
66
66
 
67
67
  if (match) {
68
68
  var hyperlinkedText = match.raw;
@@ -144,7 +144,8 @@ var mapActivityProviderResultToLinkSearchItemData = function mapActivityProvider
144
144
  container: container,
145
145
  iconUrl: iconUrl,
146
146
  url: url,
147
- lastViewedDate: viewedTimestamp ? new Date(viewedTimestamp) : undefined
147
+ lastViewedDate: viewedTimestamp ? new Date(viewedTimestamp) : undefined,
148
+ prefetch: true
148
149
  };
149
150
  };
150
151
 
@@ -161,7 +162,8 @@ var mapSearchProviderResultToLinkSearchItemData = function mapSearchProviderResu
161
162
  name: title,
162
163
  url: url,
163
164
  lastUpdatedDate: updatedTimestamp ? new Date(updatedTimestamp) : undefined,
164
- icon: contentType && _utils2.mapContentTypeToIcon[contentType] || defaultIcon
165
+ icon: contentType && _utils2.mapContentTypeToIcon[contentType] || defaultIcon,
166
+ prefetch: false
165
167
  };
166
168
  };
167
169
 
@@ -502,7 +504,7 @@ var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
502
504
  }
503
505
 
504
506
  if (interaction === 'click' || _this.isUrlPopulatedWithSelectedItem()) {
505
- var _pluginState$searchSe3;
507
+ var _pluginState$searchSe3, _selectedItem$prefetc;
506
508
 
507
509
  /**
508
510
  * When it's a mouse click even or the selectedItem.url matches displayUrl, we think
@@ -520,7 +522,8 @@ var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
520
522
  trigger: interaction,
521
523
  resultCount: items.length,
522
524
  selectedResultId: selectedItem.objectId,
523
- selectedRelativePosition: selectedIndex
525
+ selectedRelativePosition: selectedIndex,
526
+ prefetch: (_selectedItem$prefetc = selectedItem.prefetch) !== null && _selectedItem$prefetc !== void 0 ? _selectedItem$prefetc : false
524
527
  },
525
528
  eventType: _analytics.EVENT_TYPE.UI
526
529
  });
@@ -5,52 +5,25 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.getLinkMatch = getLinkMatch;
9
8
  exports.normalizeUrl = normalizeUrl;
10
9
  exports.linkifyContent = linkifyContent;
11
10
  exports.getLinkDomain = getLinkDomain;
12
11
  exports.isFromCurrentDomain = isFromCurrentDomain;
13
- exports.linkifyMatch = exports.LinkMatcher = exports.LINK_REGEXP = void 0;
12
+ exports.LinkMatcher = void 0;
14
13
 
15
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
16
15
 
17
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
18
17
 
19
- var _linkifyIt = _interopRequireDefault(require("linkify-it"));
20
-
21
18
  var _slice = require("../../utils/slice");
22
19
 
23
20
  var _adfSchema = require("@atlaskit/adf-schema");
24
21
 
25
- var LINK_REGEXP = /(https?|ftp):\/\/[^\s]+/;
26
- exports.LINK_REGEXP = LINK_REGEXP;
27
- var linkify = (0, _linkifyIt.default)();
28
- linkify.add('sourcetree:', 'http:');
29
- var tlds = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
30
- var tlds2Char = 'a[cdefgilmnoqrtuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrtuvwxyz]|n[acefgilopruz]|om|p[aefghkmnrtw]|qa|r[eosuw]|s[abcdegijklmnrtuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
31
- tlds.push(tlds2Char);
32
- linkify.tlds(tlds, false);
33
-
34
- function getLinkMatch(str) {
35
- if (!str) {
36
- return null;
37
- }
38
-
39
- var match = linkifyMatch(str);
40
-
41
- if (!match.length) {
42
- match = linkify.match(str);
43
- }
44
-
45
- return match && match[0];
46
- }
47
22
  /**
48
23
  * Instance of class LinkMatcher are used in autoformatting in place of Regex.
49
24
  * Hence it has been made similar to regex with an exec method.
50
25
  * Extending it directly from class Regex was introducing some issues, thus that has been avoided.
51
26
  */
52
-
53
-
54
27
  var LinkMatcher = /*#__PURE__*/function () {
55
28
  function LinkMatcher() {
56
29
  (0, _classCallCheck2.default)(this, LinkMatcher);
@@ -75,7 +48,7 @@ var LinkMatcher = /*#__PURE__*/function () {
75
48
  return null;
76
49
  }
77
50
 
78
- var links = linkify.match(lastStringBeforeSpace);
51
+ var links = _adfSchema.linkify.match(lastStringBeforeSpace);
79
52
 
80
53
  if (!links || links.length === 0) {
81
54
  return null;
@@ -122,8 +95,7 @@ function normalizeUrl(url) {
122
95
  return url;
123
96
  }
124
97
 
125
- var match = getLinkMatch(url);
126
- return match && match.url || '';
98
+ return (0, _adfSchema.normalizeUrl)(url);
127
99
  }
128
100
 
129
101
  function linkifyContent(schema) {
@@ -180,7 +152,8 @@ function isFromCurrentDomain(url) {
180
152
 
181
153
  function findLinkMatches(text) {
182
154
  var matches = [];
183
- var linkMatches = text && linkify.match(text);
155
+
156
+ var linkMatches = text && _adfSchema.linkify.match(text);
184
157
 
185
158
  if (linkMatches && linkMatches.length > 0) {
186
159
  linkMatches.forEach(function (match) {
@@ -194,40 +167,4 @@ function findLinkMatches(text) {
194
167
  }
195
168
 
196
169
  return matches;
197
- }
198
-
199
- var linkifyMatch = function linkifyMatch(text) {
200
- var matches = [];
201
-
202
- if (!LINK_REGEXP.test(text)) {
203
- return matches;
204
- }
205
-
206
- var startpos = 0;
207
- var substr;
208
-
209
- while (substr = text.substr(startpos)) {
210
- var link = (substr.match(LINK_REGEXP) || [''])[0];
211
-
212
- if (link) {
213
- var index = substr.search(LINK_REGEXP);
214
- var start = index >= 0 ? index + startpos : index;
215
- var end = start + link.length;
216
- matches.push({
217
- index: start,
218
- lastIndex: end,
219
- raw: link,
220
- url: link,
221
- text: link,
222
- schema: ''
223
- });
224
- startpos += end;
225
- } else {
226
- break;
227
- }
228
- }
229
-
230
- return matches;
231
- };
232
-
233
- exports.linkifyMatch = linkifyMatch;
170
+ }
@@ -391,6 +391,12 @@ Object.defineProperty(exports, "viewUpdateSubscriptionPlugin", {
391
391
  return _viewUpdateSubscription.default;
392
392
  }
393
393
  });
394
+ Object.defineProperty(exports, "codeBidiWarningPlugin", {
395
+ enumerable: true,
396
+ get: function get() {
397
+ return _codeBidiWarning.default;
398
+ }
399
+ });
394
400
 
395
401
  var _base = _interopRequireDefault(require("./base"));
396
402
 
@@ -516,6 +522,8 @@ var _avatarGroup = _interopRequireDefault(require("./avatar-group"));
516
522
 
517
523
  var _viewUpdateSubscription = _interopRequireDefault(require("./view-update-subscription"));
518
524
 
525
+ var _codeBidiWarning = _interopRequireDefault(require("./code-bidi-warning"));
526
+
519
527
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
520
528
 
521
529
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -59,6 +59,8 @@ var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
59
59
 
60
60
  var _mediaNodeView = require("./nodeviews/mediaNodeView");
61
61
 
62
+ var _mediaInline = require("./nodeviews/mediaInline");
63
+
62
64
  var _mediaSingle2 = require("./utils/media-single");
63
65
 
64
66
  var mediaPlugin = function mediaPlugin(options) {
@@ -70,6 +72,8 @@ var mediaPlugin = function mediaPlugin(options) {
70
72
  allowMediaGroup = _ref$allowMediaGroup === void 0 ? true : _ref$allowMediaGroup,
71
73
  _ref$allowMediaSingle = _ref.allowMediaSingle,
72
74
  allowMediaSingle = _ref$allowMediaSingle === void 0 ? false : _ref$allowMediaSingle,
75
+ _ref$allowMediaInline = _ref.allowMediaInline,
76
+ allowMediaInline = _ref$allowMediaInline === void 0 ? false : _ref$allowMediaInline,
73
77
  featureFlags = _ref.featureFlags;
74
78
 
75
79
  var captions = (0, _mediaCommon.getMediaFeatureFlag)('captions', featureFlags);
@@ -83,6 +87,9 @@ var mediaPlugin = function mediaPlugin(options) {
83
87
  }, {
84
88
  name: 'media',
85
89
  node: _adfSchema.media
90
+ }, {
91
+ name: 'mediaInline',
92
+ node: _adfSchema.mediaInline
86
93
  }].filter(function (node) {
87
94
  if (node.name === 'mediaGroup') {
88
95
  return allowMediaGroup;
@@ -92,6 +99,10 @@ var mediaPlugin = function mediaPlugin(options) {
92
99
  return allowMediaSingle;
93
100
  }
94
101
 
102
+ if (node.name === 'mediaInline') {
103
+ return allowMediaInline;
104
+ }
105
+
95
106
  return true;
96
107
  });
97
108
  },
@@ -112,7 +123,8 @@ var mediaPlugin = function mediaPlugin(options) {
112
123
  nodeViews: {
113
124
  mediaGroup: (0, _mediaGroup.ReactMediaGroupNode)(portalProviderAPI, eventDispatcher, providerFactory, options),
114
125
  mediaSingle: (0, _mediaSingle.ReactMediaSingleNode)(portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent, options),
115
- media: (0, _mediaNodeView.ReactMediaNode)(portalProviderAPI, eventDispatcher, providerFactory, options)
126
+ media: (0, _mediaNodeView.ReactMediaNode)(portalProviderAPI, eventDispatcher, providerFactory, options),
127
+ mediaInline: (0, _mediaInline.ReactMediaInlineNode)(portalProviderAPI, eventDispatcher, providerFactory)
116
128
  },
117
129
  errorReporter: errorReporter,
118
130
  uploadErrorHandler: options && options.uploadErrorHandler,
@@ -242,8 +254,7 @@ var mediaPlugin = function mediaPlugin(options) {
242
254
  var pluginState = _main.stateKey.getState(state);
243
255
 
244
256
  pluginState.showMediaPicker();
245
- var tr = insert('');
246
- return (0, _analytics.addAnalytics)(state, tr, {
257
+ return (0, _analytics.addAnalytics)(state, insert(''), {
247
258
  action: _analytics.ACTION.OPENED,
248
259
  actionSubject: _analytics.ACTION_SUBJECT.PICKER,
249
260
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.PICKER_CLOUD,
@@ -49,6 +49,10 @@ var _pluginKey = require("../pm-plugins/plugin-key");
49
49
 
50
50
  var _mediaNodeUpdater = require("./mediaNodeUpdater");
51
51
 
52
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
53
+
54
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
55
+
52
56
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
53
57
 
54
58
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
@@ -151,23 +155,33 @@ var MediaGroup = /*#__PURE__*/function (_React$Component) {
151
155
  // We declared this to get a fresh position every time
152
156
  var getNodePos = function getNodePos() {
153
157
  return getPos() + idx + 1;
158
+ }; // Media Inline creates a floating toolbar with the same options, excludes these options if enabled
159
+
160
+
161
+ var mediaInlineOptions = function mediaInlineOptions() {
162
+ var allowMediaInline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
163
+
164
+ if (!allowMediaInline) {
165
+ return {
166
+ shouldEnableDownloadButton: mediaOptions.enableDownloadButton,
167
+ actions: [{
168
+ handler: disabled ? function () {} : _this.mediaPluginState.handleMediaNodeRemoval.bind(null, undefined, getNodePos),
169
+ icon: /*#__PURE__*/_react.default.createElement(_close.default, {
170
+ label: "delete"
171
+ })
172
+ }]
173
+ };
174
+ }
154
175
  };
155
176
 
156
- return {
177
+ return _objectSpread({
157
178
  identifier: _this.getIdentifier(item),
158
179
  isLazy: allowLazyLoading,
159
180
  selected: _this.isNodeSelected(getNodePos()),
160
181
  onClick: function onClick() {
161
182
  (0, _utils.setNodeSelection)(_this.props.view, getNodePos());
162
- },
163
- shouldEnableDownloadButton: mediaOptions.enableDownloadButton,
164
- actions: [{
165
- handler: disabled ? function () {} : _this.mediaPluginState.handleMediaNodeRemoval.bind(null, undefined, getNodePos),
166
- icon: /*#__PURE__*/_react.default.createElement(_close.default, {
167
- label: "delete"
168
- })
169
- }]
170
- };
183
+ }
184
+ }, mediaInlineOptions(mediaOptions.allowMediaInline));
171
185
  });
172
186
 
173
187
  return /*#__PURE__*/_react.default.createElement(_mediaFilmstrip.Filmstrip, {