@atlaskit/editor-common 63.0.1 → 64.0.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 (50) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/safe-plugin/index.js +42 -0
  3. package/dist/cjs/styles/index.js +0 -8
  4. package/dist/cjs/styles/shared/block-marks.js +1 -1
  5. package/dist/cjs/styles/shared/lists.js +3 -1
  6. package/dist/cjs/types/collab.js +5 -0
  7. package/dist/cjs/ui/MediaSingle/index.js +3 -1
  8. package/dist/cjs/ui/Mention/index.js +1 -3
  9. package/dist/cjs/ui/Mention/mention-with-profilecard.js +33 -194
  10. package/dist/cjs/ui/Mention/mention-with-providers.js +1 -5
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/es2019/safe-plugin/index.js +10 -0
  13. package/dist/es2019/styles/index.js +0 -1
  14. package/dist/es2019/styles/shared/block-marks.js +2 -1
  15. package/dist/es2019/styles/shared/lists.js +16 -0
  16. package/dist/es2019/types/collab.js +1 -0
  17. package/dist/es2019/ui/MediaSingle/index.js +3 -1
  18. package/dist/es2019/ui/Mention/index.js +1 -3
  19. package/dist/es2019/ui/Mention/mention-with-profilecard.js +33 -146
  20. package/dist/es2019/ui/Mention/mention-with-providers.js +1 -5
  21. package/dist/es2019/version.json +1 -1
  22. package/dist/esm/safe-plugin/index.js +27 -0
  23. package/dist/esm/styles/index.js +0 -1
  24. package/dist/esm/styles/shared/block-marks.js +1 -1
  25. package/dist/esm/styles/shared/lists.js +2 -1
  26. package/dist/esm/types/collab.js +1 -0
  27. package/dist/esm/ui/MediaSingle/index.js +3 -1
  28. package/dist/esm/ui/Mention/index.js +1 -3
  29. package/dist/esm/ui/Mention/mention-with-profilecard.js +33 -189
  30. package/dist/esm/ui/Mention/mention-with-providers.js +1 -5
  31. package/dist/esm/version.json +1 -1
  32. package/dist/types/collab/types.d.ts +14 -2
  33. package/dist/types/collab.d.ts +1 -1
  34. package/dist/types/index.d.ts +1 -0
  35. package/dist/types/safe-plugin/index.d.ts +6 -0
  36. package/dist/types/styles/index.d.ts +0 -1
  37. package/dist/types/types/collab.d.ts +8 -0
  38. package/dist/types/types/index.d.ts +1 -0
  39. package/dist/types/ui/MediaSingle/index.d.ts +2 -1
  40. package/dist/types/ui/MediaSingle/styled.d.ts +2 -2
  41. package/dist/types/ui/Mention/index.d.ts +0 -3
  42. package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -25
  43. package/dist/types/ui/Mention/mention-with-providers.d.ts +0 -3
  44. package/dist/types/ui/index.d.ts +1 -1
  45. package/package.json +11 -10
  46. package/safe-plugin/package.json +7 -0
  47. package/dist/cjs/styles/shared/inline-nodes.js +0 -17
  48. package/dist/es2019/styles/shared/inline-nodes.js +0 -7
  49. package/dist/esm/styles/shared/inline-nodes.js +0 -7
  50. package/dist/types/styles/shared/inline-nodes.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 64.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`b32b7a39a70`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b32b7a39a70) - CETI-166 Increase the standard panel icons size to make it consistent with the emojis in the panel content area
8
+
9
+ ### Minor Changes
10
+
11
+ - [`4e234e7fe93`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e234e7fe93) - CETI-240 handle add custom emoji in floating toolbar
12
+ - [`5293a48368e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5293a48368e) - fix image size in layout with ref and width observer
13
+ - [`304351e4b1e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/304351e4b1e) - CETI-241 - Added additional panel ADF attributes (panelIconId, panelIconText) to uniquely identify custom panel emojis. The change has been categorised as major since it is a change to the full-schema ADF. However, the custom panel feature is behind a feature flag, has not yet been released to production, and is only currently planned for release to Confluence. See ADF change #61 for further details.
14
+ - [`9c9557fcdd8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9c9557fcdd8) - AK-279 Moved copy button outside of heading, that made heading accessible
15
+ - [`172ccc62c2a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/172ccc62c2a) - ED-14117 Export SafePlugin definition in new entry point
16
+
17
+ ### Patch Changes
18
+
19
+ - [`97412280671`](https://bitbucket.org/atlassian/atlassian-frontend/commits/97412280671) - [ED-13939] Add analytics event to track "can't syncup with collab service" error
20
+ - [`88ada10af2c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/88ada10af2c) - [ED-14097] Moved getFinalAcknowledgedState control to editor and made the API public
21
+ - [`85648c038a4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/85648c038a4) - ED-13939 Rename newCollabSyncUpError analytics event to newCollabSyncUpErrorNoSteps
22
+ - [`8f0bfd2b1ef`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8f0bfd2b1ef) - Use ProfileCardTrigger to display profile card popup instead of custom popup implementation
23
+ - [`16294b02fd4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/16294b02fd4) - CETI-242 Change the Color palette labels for panel
24
+ - [`86c3cb500c1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/86c3cb500c1) - Placeholder not rendering properly in firefox when empty issue fixed.
25
+ - [`78c6a40ef5e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/78c6a40ef5e) - [ED-13118] Removing dead workaround code that causes tapping after a bullet item with a smart link to select the smart link
26
+ - [`e292f108d4b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e292f108d4b) - Ensure metadata is persisted when it is updated by another participant during an editing session
27
+ - Updated dependencies
28
+
3
29
  ## 63.0.1
4
30
 
5
31
  ### Patch Changes
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.SafePlugin = void 0;
9
+
10
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
+
16
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
17
+
18
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
+
20
+ var _prosemirrorState = require("prosemirror-state");
21
+
22
+ 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); }; }
23
+
24
+ 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; } }
25
+
26
+ var SafePlugin = /*#__PURE__*/function (_Plugin) {
27
+ (0, _inherits2.default)(SafePlugin, _Plugin);
28
+
29
+ var _super = _createSuper(SafePlugin);
30
+
31
+ // This variable isn't (and shouldn't) be used anywhere. Its purpose is
32
+ // to distinguish Plugin from SafePlugin, thus ensuring that an 'unsafe'
33
+ // Plugin cannot be assigned as an item in EditorPlugin → pmPlugins.
34
+ function SafePlugin(spec) {
35
+ (0, _classCallCheck2.default)(this, SafePlugin);
36
+ return _super.call(this, spec);
37
+ }
38
+
39
+ return (0, _createClass2.default)(SafePlugin);
40
+ }(_prosemirrorState.Plugin);
41
+
42
+ exports.SafePlugin = SafePlugin;
@@ -135,12 +135,6 @@ Object.defineProperty(exports, "indentationSharedStyles", {
135
135
  return _indentation.indentationSharedStyles;
136
136
  }
137
137
  });
138
- Object.defineProperty(exports, "inlineNodeSharedStyle", {
139
- enumerable: true,
140
- get: function get() {
141
- return _inlineNodes.inlineNodeSharedStyle;
142
- }
143
- });
144
138
  Object.defineProperty(exports, "linkSharedStyle", {
145
139
  enumerable: true,
146
140
  get: function get() {
@@ -290,8 +284,6 @@ var _whitespace = require("./shared/whitespace");
290
284
 
291
285
  var _paragraph = require("./shared/paragraph");
292
286
 
293
- var _inlineNodes = require("./shared/inline-nodes");
294
-
295
287
  var _link = require("./shared/link");
296
288
 
297
289
  var _lists = require("./shared/lists");
@@ -13,5 +13,5 @@ var _styledComponents = require("styled-components");
13
13
 
14
14
  var _templateObject;
15
15
 
16
- var blockMarksSharedStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /**\n * We need to remove margin-top from first item\n * inside doc, tableCell, tableHeader, blockquote, etc.\n */\n *:not(.fabric-editor-block-mark) >,\n /* For nested block marks */\n *:not(.fabric-editor-block-mark) > div.fabric-editor-block-mark:first-child {\n p,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n &:first-child {\n margin-top: 0;\n }\n }\n }\n"])));
16
+ var blockMarksSharedStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /**\n * We need to remove margin-top from first item\n * inside doc, tableCell, tableHeader, blockquote, etc.\n */\n *:not(.fabric-editor-block-mark) >,\n /* For nested block marks */\n *:not(.fabric-editor-block-mark) > div.fabric-editor-block-mark:first-child {\n p,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n .heading-wrapper {\n &:first-child {\n margin-top: 0;\n }\n }\n }\n"])));
17
17
  exports.blockMarksSharedStyles = blockMarksSharedStyles;
@@ -13,7 +13,9 @@ var _styledComponents = require("styled-components");
13
13
 
14
14
  var _adfSchema = require("@atlaskit/adf-schema");
15
15
 
16
+ var _browser = _interopRequireDefault(require("../../utils/browser"));
17
+
16
18
  var _templateObject;
17
19
 
18
- var listsSharedStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* =============== INDENTATION SPACING ========= */\n\n ul,\n ol {\n box-sizing: border-box;\n padding-left: 24px;\n }\n\n ", ", ", " {\n /*\n Ensures list item content adheres to the list's margin instead\n of filling the entire block row. This is important to allow\n clicking interactive elements which are floated next to a list.\n\n For some history and context on this block, see PRs related to tickets.:\n @see ED-6551 - original issue.\n @see ED-7015 - follow up issue.\n @see ED-7447 - flow-root change.\n\n We use 'display: table' (old clear fix / new block formatting context hack)\n for older browsers and 'flow-root' for modern browsers.\n\n @see https://css-tricks.com/display-flow-root/\n */\n // For older browsers the do not support flow-root.\n display: table;\n display: flow-root;\n }\n\n /* =============== INDENTATION AESTHETICS ========= */\n\n /**\n We support nested lists up to six levels deep.\n **/\n\n /* LEGACY LISTS */\n\n ul,\n ul ul ul ul {\n list-style-type: disc;\n }\n\n ul ul,\n ul ul ul ul ul {\n list-style-type: circle;\n }\n\n ul ul ul,\n ul ul ul ul ul ul {\n list-style-type: square;\n }\n\n ol,\n ol ol ol ol {\n list-style-type: decimal;\n }\n ol ol,\n ol ol ol ol ol {\n list-style-type: lower-alpha;\n }\n ol ol ol,\n ol ol ol ol ol ol {\n list-style-type: lower-roman;\n }\n\n /* PREDICTABLE LISTS */\n\n ol[data-indent-level='1'],\n ol[data-indent-level='4'] {\n list-style-type: decimal;\n }\n\n ol[data-indent-level='2'],\n ol[data-indent-level='5'] {\n list-style-type: lower-alpha;\n }\n\n ol[data-indent-level='3'],\n ol[data-indent-level='6'] {\n list-style-type: lower-roman;\n }\n\n ul[data-indent-level='1'],\n ul[data-indent-level='4'] {\n list-style-type: disc;\n }\n\n ul[data-indent-level='2'],\n ul[data-indent-level='5'] {\n list-style-type: circle;\n }\n\n ul[data-indent-level='3'],\n ul[data-indent-level='6'] {\n list-style-type: square;\n }\n"])), _adfSchema.orderedListSelector, _adfSchema.bulletListSelector);
20
+ var listsSharedStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* =============== INDENTATION SPACING ========= */\n\n ul,\n ol {\n box-sizing: border-box;\n padding-left: 24px;\n\n /*\n Firefox does not handle empty block element inside li tag.\n If there is not block element inside li tag,\n then firefox sets inherited height to li\n However, if there is any block element and if it's empty\n (or has empty inline element) then\n firefox sets li tag height to zero.\n More details at\n https://product-fabric.atlassian.net/wiki/spaces/~455502413/pages/3149365890/ED-14110+Investigation\n */\n li p:empty,\n li p > span:empty {\n ", "\n }\n }\n\n ", ", ", " {\n /*\n Ensures list item content adheres to the list's margin instead\n of filling the entire block row. This is important to allow\n clicking interactive elements which are floated next to a list.\n\n For some history and context on this block, see PRs related to tickets.:\n @see ED-6551 - original issue.\n @see ED-7015 - follow up issue.\n @see ED-7447 - flow-root change.\n\n We use 'display: table' (old clear fix / new block formatting context hack)\n for older browsers and 'flow-root' for modern browsers.\n\n @see https://css-tricks.com/display-flow-root/\n */\n // For older browsers the do not support flow-root.\n display: table;\n display: flow-root;\n }\n\n /* =============== INDENTATION AESTHETICS ========= */\n\n /**\n We support nested lists up to six levels deep.\n **/\n\n /* LEGACY LISTS */\n\n ul,\n ul ul ul ul {\n list-style-type: disc;\n }\n\n ul ul,\n ul ul ul ul ul {\n list-style-type: circle;\n }\n\n ul ul ul,\n ul ul ul ul ul ul {\n list-style-type: square;\n }\n\n ol,\n ol ol ol ol {\n list-style-type: decimal;\n }\n ol ol,\n ol ol ol ol ol {\n list-style-type: lower-alpha;\n }\n ol ol ol,\n ol ol ol ol ol ol {\n list-style-type: lower-roman;\n }\n\n /* PREDICTABLE LISTS */\n\n ol[data-indent-level='1'],\n ol[data-indent-level='4'] {\n list-style-type: decimal;\n }\n\n ol[data-indent-level='2'],\n ol[data-indent-level='5'] {\n list-style-type: lower-alpha;\n }\n\n ol[data-indent-level='3'],\n ol[data-indent-level='6'] {\n list-style-type: lower-roman;\n }\n\n ul[data-indent-level='1'],\n ul[data-indent-level='4'] {\n list-style-type: disc;\n }\n\n ul[data-indent-level='2'],\n ul[data-indent-level='5'] {\n list-style-type: circle;\n }\n\n ul[data-indent-level='3'],\n ul[data-indent-level='6'] {\n list-style-type: square;\n }\n"])), _browser.default.gecko ? 'display: inline-block;' : '', _adfSchema.orderedListSelector, _adfSchema.bulletListSelector);
19
21
  exports.listsSharedStyles = listsSharedStyles;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -50,7 +50,8 @@ function MediaSingle(_ref) {
50
50
  fullWidthMode = _ref.fullWidthMode,
51
51
  lineLength = _ref.lineLength,
52
52
  _ref$hasFallbackConta = _ref.hasFallbackContainer,
53
- hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta;
53
+ hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta,
54
+ handleMediaSingleRef = _ref.handleMediaSingleRef;
54
55
 
55
56
  var children = _react.default.Children.toArray(propsChildren);
56
57
 
@@ -106,6 +107,7 @@ function MediaSingle(_ref) {
106
107
  caption = _children[1];
107
108
 
108
109
  return /*#__PURE__*/_react.default.createElement(_styled.MediaSingleWrapper, {
110
+ innerRef: handleMediaSingleRef,
109
111
  width: width,
110
112
  layout: layout,
111
113
  containerWidth: containerWidth,
@@ -52,7 +52,6 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
52
52
  accessLevel = _this$props.accessLevel,
53
53
  eventHandlers = _this$props.eventHandlers,
54
54
  id = _this$props.id,
55
- portal = _this$props.portal,
56
55
  text = _this$props.text;
57
56
  var mentionProvider = providers.mentionProvider,
58
57
  profilecardProvider = providers.profilecardProvider;
@@ -62,8 +61,7 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
62
61
  accessLevel: accessLevel,
63
62
  eventHandlers: eventHandlers,
64
63
  mentionProvider: mentionProvider,
65
- profilecardProvider: profilecardProvider,
66
- portal: portal
64
+ profilecardProvider: profilecardProvider
67
65
  });
68
66
  });
69
67
  _this.providerFactory = props.providers || new _providerFactory.ProviderFactory();
@@ -1,211 +1,50 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  var _typeof = require("@babel/runtime/helpers/typeof");
6
4
 
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
- exports.default = void 0;
11
-
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
-
14
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
15
-
16
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
-
18
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
19
-
20
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
21
-
22
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
23
-
24
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
25
-
26
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
+ exports.default = MentionWithProfileCard;
27
9
 
28
10
  var _react = _interopRequireWildcard(require("react"));
29
11
 
30
- var _reactDom = require("react-dom");
31
-
32
12
  var _mention = require("@atlaskit/mention");
33
13
 
34
- var _profilecard = _interopRequireDefault(require("@atlaskit/profilecard"));
35
-
36
- var _Popup = _interopRequireDefault(require("../Popup"));
37
-
38
- var _withOuterListeners = _interopRequireDefault(require("../with-outer-listeners"));
14
+ var _profilecard = require("@atlaskit/profilecard");
39
15
 
40
16
  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); }
41
17
 
42
18
  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; }
43
19
 
44
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
45
-
46
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
47
-
48
- 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); }; }
49
-
50
- 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; } }
51
-
52
- var ProfilecardResourcedWithListeners = (0, _withOuterListeners.default)(_profilecard.default);
53
-
54
- var MentionWithProfileCard = /*#__PURE__*/function (_PureComponent) {
55
- (0, _inherits2.default)(MentionWithProfileCard, _PureComponent);
56
-
57
- var _super = _createSuper(MentionWithProfileCard);
58
-
59
- function MentionWithProfileCard() {
60
- var _this;
61
-
62
- (0, _classCallCheck2.default)(this, MentionWithProfileCard);
63
-
64
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
65
- args[_key] = arguments[_key];
66
- }
67
-
68
- _this = _super.call.apply(_super, [this].concat(args));
69
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
70
- target: null,
71
- visible: false,
72
- popupAlignX: 'left',
73
- popupAlignY: 'top'
74
- });
75
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleRef", function (target) {
76
- _this.setState({
77
- target: target
78
- });
79
- });
80
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleMentionNodeRef", function (component) {
81
- if (!component) {
82
- _this.domNode = null;
83
- } else {
84
- _this.domNode = (0, _reactDom.findDOMNode)(component);
85
- }
86
- });
87
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "showProfilecard", function (event) {
88
- if (!_this.domNode) {
89
- return;
90
- }
91
-
92
- event.stopPropagation();
93
-
94
- var _this$calculateLayerP = _this.calculateLayerPosition(),
95
- _this$calculateLayerP2 = (0, _slicedToArray2.default)(_this$calculateLayerP, 2),
96
- popupAlignX = _this$calculateLayerP2[0],
97
- popupAlignY = _this$calculateLayerP2[1];
98
-
99
- _this.setState({
100
- popupAlignX: popupAlignX,
101
- popupAlignY: popupAlignY,
102
- visible: true
103
- });
104
- });
105
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hideProfilecard", function () {
106
- _this.setState({
107
- visible: false
108
- });
109
- });
110
- return _this;
111
- }
112
-
113
- (0, _createClass2.default)(MentionWithProfileCard, [{
114
- key: "calculateLayerPosition",
115
- value: function calculateLayerPosition() {
116
- var domNodeCentreCoords = this.getDomNodeCenterCoords();
117
- var visibleAreaCentreCoords = this.getVisibleAreaCentreCoords();
118
- var popupAlignY = domNodeCentreCoords.y > visibleAreaCentreCoords.y ? 'top' : 'bottom';
119
- var popupAlignX = domNodeCentreCoords.x > visibleAreaCentreCoords.x ? 'right' : 'left';
120
- return [popupAlignX, popupAlignY];
121
- }
122
- }, {
123
- key: "getDomNodeCenterCoords",
124
- value: function getDomNodeCenterCoords() {
125
- var rect = this.domNode.getBoundingClientRect();
126
- return {
127
- x: rect.left + rect.width / 2,
128
- y: rect.top + rect.height / 2
129
- };
130
- }
131
- }, {
132
- key: "getVisibleAreaCentreCoords",
133
- value: function getVisibleAreaCentreCoords() {
134
- return {
135
- x: window.innerWidth / 2,
136
- y: window.innerHeight / 2
137
- };
138
- }
139
- }, {
140
- key: "getActions",
141
- value: function getActions(id, text, accessLevel) {
142
- var _this2 = this;
143
-
144
- var profilecardProvider = this.props.profilecardProvider;
145
- var actions = profilecardProvider.getActions(id, text, accessLevel);
146
- return actions.map(function (action) {
147
- return _objectSpread(_objectSpread({}, action), {}, {
148
- callback: function callback() {
149
- _this2.setState({
150
- visible: false
151
- });
152
-
153
- if (action && action.callback) {
154
- action.callback();
155
- }
156
- }
157
- });
158
- });
159
- }
160
- }, {
161
- key: "render",
162
- value: function render() {
163
- var _this$props = this.props,
164
- accessLevel = _this$props.accessLevel,
165
- id = _this$props.id,
166
- mentionProvider = _this$props.mentionProvider,
167
- profilecardProvider = _this$props.profilecardProvider,
168
- text = _this$props.text,
169
- onClick = _this$props.onClick,
170
- onMouseEnter = _this$props.onMouseEnter,
171
- onMouseLeave = _this$props.onMouseLeave,
172
- portal = _this$props.portal;
173
- var _this$state = this.state,
174
- popupAlignX = _this$state.popupAlignX,
175
- popupAlignY = _this$state.popupAlignY,
176
- target = _this$state.target,
177
- visible = _this$state.visible;
178
- var cloudId = profilecardProvider.cloudId,
179
- resourceClient = profilecardProvider.resourceClient;
180
- return /*#__PURE__*/_react.default.createElement("span", {
181
- ref: this.handleRef,
182
- onClick: this.showProfilecard
183
- }, /*#__PURE__*/_react.default.createElement(_mention.ResourcedMention, {
184
- ref: this.handleMentionNodeRef,
185
- id: id,
186
- text: text,
187
- accessLevel: accessLevel,
188
- mentionProvider: mentionProvider,
189
- onClick: onClick,
190
- onMouseEnter: onMouseEnter,
191
- onMouseLeave: onMouseLeave
192
- }), target && portal && visible && /*#__PURE__*/_react.default.createElement(_Popup.default, {
193
- offset: [0, 8],
194
- target: target,
195
- mountTo: portal,
196
- alignX: popupAlignX,
197
- alignY: popupAlignY
198
- }, /*#__PURE__*/_react.default.createElement(ProfilecardResourcedWithListeners, {
199
- handleClickOutside: this.hideProfilecard,
200
- handleEscapeKeydown: this.hideProfilecard,
201
- cloudId: cloudId,
202
- userId: id,
203
- resourceClient: resourceClient,
204
- actions: this.getActions(id, text, accessLevel)
205
- })));
206
- }
207
- }]);
208
- return MentionWithProfileCard;
209
- }(_react.PureComponent);
210
-
211
- exports.default = MentionWithProfileCard;
20
+ function MentionWithProfileCard(_ref) {
21
+ var id = _ref.id,
22
+ text = _ref.text,
23
+ accessLevel = _ref.accessLevel,
24
+ mentionProvider = _ref.mentionProvider,
25
+ profilecardProvider = _ref.profilecardProvider,
26
+ onClick = _ref.onClick,
27
+ onMouseEnter = _ref.onMouseEnter,
28
+ onMouseLeave = _ref.onMouseLeave;
29
+ var cloudId = profilecardProvider.cloudId,
30
+ resourceClient = profilecardProvider.resourceClient;
31
+ var actions = (0, _react.useMemo)(function () {
32
+ return profilecardProvider.getActions(id, text, accessLevel);
33
+ }, [accessLevel, id, profilecardProvider, text]);
34
+ return /*#__PURE__*/_react.default.createElement(_profilecard.ProfileCardTrigger, {
35
+ cloudId: cloudId,
36
+ userId: id,
37
+ resourceClient: resourceClient,
38
+ actions: actions,
39
+ trigger: "click",
40
+ position: "bottom-end"
41
+ }, /*#__PURE__*/_react.default.createElement(_mention.ResourcedMention, {
42
+ id: id,
43
+ text: text,
44
+ accessLevel: accessLevel,
45
+ mentionProvider: mentionProvider,
46
+ onClick: onClick,
47
+ onMouseEnter: onMouseEnter,
48
+ onMouseLeave: onMouseLeave
49
+ }));
50
+ }
@@ -106,11 +106,9 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
106
106
  value: function render() {
107
107
  var _this$props = this.props,
108
108
  accessLevel = _this$props.accessLevel,
109
- userType = _this$props.userType,
110
109
  eventHandlers = _this$props.eventHandlers,
111
110
  id = _this$props.id,
112
111
  mentionProvider = _this$props.mentionProvider,
113
- portal = _this$props.portal,
114
112
  text = _this$props.text;
115
113
  var profilecardProvider = this.state.profilecardProvider;
116
114
  var actionHandlers = {};
@@ -122,10 +120,8 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
122
120
  id: id,
123
121
  text: text,
124
122
  accessLevel: accessLevel,
125
- userType: userType,
126
123
  mentionProvider: mentionProvider,
127
- profilecardProvider: profilecardProvider,
128
- portal: portal
124
+ profilecardProvider: profilecardProvider
129
125
  }, actionHandlers));
130
126
  }
131
127
  }]);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "63.0.1",
3
+ "version": "64.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,10 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ export class SafePlugin extends Plugin {
3
+ // This variable isn't (and shouldn't) be used anywhere. Its purpose is
4
+ // to distinguish Plugin from SafePlugin, thus ensuring that an 'unsafe'
5
+ // Plugin cannot be assigned as an item in EditorPlugin → pmPlugins.
6
+ constructor(spec) {
7
+ super(spec);
8
+ }
9
+
10
+ }
@@ -9,7 +9,6 @@ export { getPanelTypeBackground, darkPanelColors, getPanelDarkColor, panelShared
9
9
  export { ruleSharedStyles } from './shared/rule';
10
10
  export { whitespaceSharedStyles } from './shared/whitespace';
11
11
  export { paragraphSharedStyles } from './shared/paragraph';
12
- export { inlineNodeSharedStyle } from './shared/inline-nodes';
13
12
  export { linkSharedStyle } from './shared/link';
14
13
  export { listsSharedStyles } from './shared/lists';
15
14
  export { indentationSharedStyles } from './shared/indentation';
@@ -13,7 +13,8 @@ export const blockMarksSharedStyles = css`
13
13
  h3,
14
14
  h4,
15
15
  h5,
16
- h6 {
16
+ h6,
17
+ .heading-wrapper {
17
18
  &:first-child {
18
19
  margin-top: 0;
19
20
  }
@@ -1,5 +1,6 @@
1
1
  import { css } from 'styled-components';
2
2
  import { bulletListSelector, orderedListSelector } from '@atlaskit/adf-schema';
3
+ import browser from '../../utils/browser';
3
4
  export const listsSharedStyles = css`
4
5
  /* =============== INDENTATION SPACING ========= */
5
6
 
@@ -7,6 +8,21 @@ export const listsSharedStyles = css`
7
8
  ol {
8
9
  box-sizing: border-box;
9
10
  padding-left: 24px;
11
+
12
+ /*
13
+ Firefox does not handle empty block element inside li tag.
14
+ If there is not block element inside li tag,
15
+ then firefox sets inherited height to li
16
+ However, if there is any block element and if it's empty
17
+ (or has empty inline element) then
18
+ firefox sets li tag height to zero.
19
+ More details at
20
+ https://product-fabric.atlassian.net/wiki/spaces/~455502413/pages/3149365890/ED-14110+Investigation
21
+ */
22
+ li p:empty,
23
+ li p > span:empty {
24
+ ${browser.gecko ? 'display: inline-block;' : ''}
25
+ }
10
26
  }
11
27
 
12
28
  ${orderedListSelector}, ${bulletListSelector} {
@@ -0,0 +1 @@
1
+ export {};
@@ -21,7 +21,8 @@ export default function MediaSingle({
21
21
  nodeType = 'mediaSingle',
22
22
  fullWidthMode,
23
23
  lineLength,
24
- hasFallbackContainer = true
24
+ hasFallbackContainer = true,
25
+ handleMediaSingleRef
25
26
  }) {
26
27
  const children = React.Children.toArray(propsChildren);
27
28
 
@@ -74,6 +75,7 @@ export default function MediaSingle({
74
75
 
75
76
  const [media, caption] = children;
76
77
  return /*#__PURE__*/React.createElement(MediaSingleWrapper, {
78
+ innerRef: handleMediaSingleRef,
77
79
  width: width,
78
80
  layout: layout,
79
81
  containerWidth: containerWidth,
@@ -11,7 +11,6 @@ export default class Mention extends PureComponent {
11
11
  accessLevel,
12
12
  eventHandlers,
13
13
  id,
14
- portal,
15
14
  text
16
15
  } = this.props;
17
16
  const {
@@ -24,8 +23,7 @@ export default class Mention extends PureComponent {
24
23
  accessLevel: accessLevel,
25
24
  eventHandlers: eventHandlers,
26
25
  mentionProvider: mentionProvider,
27
- profilecardProvider: profilecardProvider,
28
- portal: portal
26
+ profilecardProvider: profilecardProvider
29
27
  });
30
28
  });
31
29