@atlaskit/editor-common 62.1.0 → 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.
- package/CHANGELOG.md +102 -0
- package/dist/cjs/extensions/manifest-helpers.js +2 -2
- package/dist/cjs/extensions/module-helpers.js +2 -2
- package/dist/cjs/icons/index.js +45 -0
- package/dist/cjs/icons/shared/PanelErrorIcon.js +37 -0
- package/dist/cjs/icons/shared/PanelInfoIcon.js +37 -0
- package/dist/cjs/icons/shared/PanelNoteIcon.js +37 -0
- package/dist/cjs/icons/shared/PanelSuccessIcon.js +37 -0
- package/dist/cjs/icons/shared/PanelWarningIcon.js +37 -0
- package/dist/cjs/index.js +1 -945
- package/dist/cjs/provider-factory/with-providers.js +2 -2
- package/dist/cjs/safe-plugin/index.js +42 -0
- package/dist/cjs/styles/index.js +12 -24
- package/dist/cjs/styles/shared/block-marks.js +1 -1
- package/dist/cjs/styles/shared/lists.js +3 -1
- package/dist/cjs/styles/shared/panel.js +26 -8
- package/dist/cjs/styles/shared/table.js +2 -1
- package/dist/cjs/types/collab.js +5 -0
- package/dist/cjs/ui/LegacyToNextIntlProvider/index.js +2 -2
- package/dist/cjs/ui/MediaSingle/index.js +3 -1
- package/dist/cjs/ui/Mention/index.js +1 -3
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +33 -194
- package/dist/cjs/ui/Mention/mention-with-providers.js +1 -5
- package/dist/cjs/ui/Popup/index.js +4 -4
- package/dist/cjs/ui/Popup/utils.js +2 -2
- package/dist/cjs/ui/index.js +0 -16
- package/dist/cjs/utils/browser.js +1 -1
- package/dist/cjs/utils/profiler/render-count.js +2 -2
- package/dist/cjs/utils/track-unsupported-content.js +2 -2
- package/dist/cjs/utils/validator.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/icons/index.js +5 -0
- package/dist/es2019/icons/shared/PanelErrorIcon.js +24 -0
- package/dist/es2019/icons/shared/PanelInfoIcon.js +24 -0
- package/dist/es2019/icons/shared/PanelNoteIcon.js +24 -0
- package/dist/es2019/icons/shared/PanelSuccessIcon.js +24 -0
- package/dist/es2019/icons/shared/PanelWarningIcon.js +24 -0
- package/dist/es2019/index.js +5 -25
- package/dist/es2019/safe-plugin/index.js +10 -0
- package/dist/es2019/styles/index.js +2 -7
- package/dist/es2019/styles/shared/block-marks.js +2 -1
- package/dist/es2019/styles/shared/lists.js +16 -0
- package/dist/es2019/styles/shared/panel.js +20 -8
- package/dist/es2019/styles/shared/table.js +3 -2
- package/dist/es2019/types/collab.js +1 -0
- package/dist/es2019/ui/MediaSingle/index.js +3 -1
- package/dist/es2019/ui/Mention/index.js +1 -3
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +33 -146
- package/dist/es2019/ui/Mention/mention-with-providers.js +1 -5
- package/dist/es2019/ui/Popup/index.js +2 -2
- package/dist/es2019/ui/index.js +1 -8
- package/dist/es2019/utils/browser.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/extensions/manifest-helpers.js +2 -2
- package/dist/esm/extensions/module-helpers.js +2 -2
- package/dist/esm/icons/index.js +5 -0
- package/dist/esm/icons/shared/PanelErrorIcon.js +24 -0
- package/dist/esm/icons/shared/PanelInfoIcon.js +24 -0
- package/dist/esm/icons/shared/PanelNoteIcon.js +24 -0
- package/dist/esm/icons/shared/PanelSuccessIcon.js +24 -0
- package/dist/esm/icons/shared/PanelWarningIcon.js +24 -0
- package/dist/esm/index.js +5 -25
- package/dist/esm/provider-factory/with-providers.js +2 -2
- package/dist/esm/safe-plugin/index.js +27 -0
- package/dist/esm/styles/index.js +2 -7
- package/dist/esm/styles/shared/block-marks.js +1 -1
- package/dist/esm/styles/shared/lists.js +2 -1
- package/dist/esm/styles/shared/panel.js +22 -8
- package/dist/esm/styles/shared/table.js +3 -2
- package/dist/esm/types/collab.js +1 -0
- package/dist/esm/ui/LegacyToNextIntlProvider/index.js +2 -2
- package/dist/esm/ui/MediaSingle/index.js +3 -1
- package/dist/esm/ui/Mention/index.js +1 -3
- package/dist/esm/ui/Mention/mention-with-profilecard.js +33 -189
- package/dist/esm/ui/Mention/mention-with-providers.js +1 -5
- package/dist/esm/ui/Popup/index.js +4 -4
- package/dist/esm/ui/Popup/utils.js +2 -2
- package/dist/esm/ui/index.js +1 -8
- package/dist/esm/utils/browser.js +1 -1
- package/dist/esm/utils/profiler/render-count.js +2 -2
- package/dist/esm/utils/track-unsupported-content.js +2 -2
- package/dist/esm/utils/validator.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/collab/types.d.ts +14 -2
- package/dist/types/collab.d.ts +1 -1
- package/dist/types/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types/icons/index.d.ts +5 -0
- package/dist/types/icons/shared/PanelErrorIcon.d.ts +3 -0
- package/dist/types/icons/shared/PanelInfoIcon.d.ts +3 -0
- package/dist/types/icons/shared/PanelNoteIcon.d.ts +3 -0
- package/dist/types/icons/shared/PanelSuccessIcon.d.ts +3 -0
- package/dist/types/icons/shared/PanelWarningIcon.d.ts +3 -0
- package/dist/types/index.d.ts +13 -19
- package/dist/types/safe-plugin/index.d.ts +6 -0
- package/dist/types/styles/index.d.ts +1 -4
- package/dist/types/styles/shared/panel.d.ts +56 -0
- package/dist/types/styles/shared/table.d.ts +1 -0
- package/dist/types/types/collab.d.ts +8 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/ui/MediaSingle/index.d.ts +2 -1
- package/dist/types/ui/MediaSingle/styled.d.ts +2 -2
- package/dist/types/ui/Mention/index.d.ts +0 -3
- package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -25
- package/dist/types/ui/Mention/mention-with-providers.d.ts +0 -3
- package/dist/types/ui/Popup/index.d.ts +1 -1
- package/dist/types/ui/WidthProvider/index.d.ts +3 -1
- package/dist/types/ui/index.d.ts +1 -4
- package/icons/package.json +7 -0
- package/package.json +23 -21
- package/safe-plugin/package.json +7 -0
- package/dist/cjs/styles/shared/inline-nodes.js +0 -17
- package/dist/es2019/styles/shared/inline-nodes.js +0 -7
- package/dist/esm/styles/shared/inline-nodes.js +0 -7
- package/dist/types/styles/shared/inline-nodes.d.ts +0 -2
|
@@ -23,9 +23,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
23
23
|
|
|
24
24
|
var _react = require("react");
|
|
25
25
|
|
|
26
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
26
|
+
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; }
|
|
27
27
|
|
|
28
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
28
|
+
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; }
|
|
29
29
|
|
|
30
30
|
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); }; }
|
|
31
31
|
|
|
@@ -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;
|
package/dist/cjs/styles/index.js
CHANGED
|
@@ -21,18 +21,6 @@ Object.defineProperty(exports, "DateSharedCssClassName", {
|
|
|
21
21
|
return _date.DateSharedCssClassName;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "EmojiSharedCssClassName", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _emoji.EmojiSharedCssClassName;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "MentionSharedCssClassName", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _mention.MentionSharedCssClassName;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
24
|
Object.defineProperty(exports, "PanelSharedCssClassName", {
|
|
37
25
|
enumerable: true,
|
|
38
26
|
get: function get() {
|
|
@@ -105,6 +93,12 @@ Object.defineProperty(exports, "columnLayoutSharedStyle", {
|
|
|
105
93
|
return _columnLayout.columnLayoutSharedStyle;
|
|
106
94
|
}
|
|
107
95
|
});
|
|
96
|
+
Object.defineProperty(exports, "darkPanelColors", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function get() {
|
|
99
|
+
return _panel.darkPanelColors;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
108
102
|
Object.defineProperty(exports, "dateSharedStyle", {
|
|
109
103
|
enumerable: true,
|
|
110
104
|
get: function get() {
|
|
@@ -117,6 +111,12 @@ Object.defineProperty(exports, "getPanelBackgroundDarkModeColors", {
|
|
|
117
111
|
return _panel.getPanelBackgroundDarkModeColors;
|
|
118
112
|
}
|
|
119
113
|
});
|
|
114
|
+
Object.defineProperty(exports, "getPanelDarkColor", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function get() {
|
|
117
|
+
return _panel.getPanelDarkColor;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
120
|
Object.defineProperty(exports, "getPanelTypeBackground", {
|
|
121
121
|
enumerable: true,
|
|
122
122
|
get: function get() {
|
|
@@ -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");
|
|
@@ -308,10 +300,6 @@ var _date = require("./shared/date");
|
|
|
308
300
|
|
|
309
301
|
var _taskDecision = require("./shared/task-decision");
|
|
310
302
|
|
|
311
|
-
var _mention = require("./shared/mention");
|
|
312
|
-
|
|
313
|
-
var _emoji = require("./shared/emoji");
|
|
314
|
-
|
|
315
303
|
var _status = require("./shared/status");
|
|
316
304
|
|
|
317
305
|
var _smartCard = require("./shared/smart-card");
|
|
@@ -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;
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.getPanelBackgroundDarkModeColors = exports.PanelSharedSelectors = exports.PanelSharedCssClassName = void 0;
|
|
10
|
+
exports.getPanelDarkColor = exports.getPanelBackgroundDarkModeColors = exports.darkPanelColors = exports.PanelSharedSelectors = exports.PanelSharedCssClassName = void 0;
|
|
11
11
|
exports.getPanelDarkModeCSS = getPanelDarkModeCSS;
|
|
12
12
|
exports.panelSharedStyles = exports.getPanelTypeBackground = void 0;
|
|
13
13
|
|
|
@@ -102,11 +102,12 @@ var darkPanelColors = {
|
|
|
102
102
|
T900S: "#056270",
|
|
103
103
|
T1200S: "#0B3037",
|
|
104
104
|
// Dark Mode Alpha
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
DarkGray: '#161A1D',
|
|
106
|
+
Gray: '#2C333A',
|
|
107
|
+
LightGray: '#5A6977',
|
|
108
108
|
TextColor: '#D9DDE3'
|
|
109
109
|
};
|
|
110
|
+
exports.darkPanelColors = darkPanelColors;
|
|
110
111
|
var lightIconColor = {
|
|
111
112
|
info: colors.B400,
|
|
112
113
|
note: colors.P400,
|
|
@@ -127,7 +128,17 @@ var darkIconColor = {
|
|
|
127
128
|
|
|
128
129
|
var panelEmojiSpriteVerticalAlignment = -((0, _constants.gridSize)() * 3 - _consts.akEditorCustomIconSize) / 2;
|
|
129
130
|
var panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
|
|
130
|
-
var
|
|
131
|
+
var panelDarkModeColors = [[colors.B50, darkPanelColors.B1200S], [colors.B75, darkPanelColors.B900], [colors.B100, darkPanelColors.B800S], [colors.N0, darkPanelColors.LightGray], [colors.N20, darkPanelColors.Gray], [colors.N60, darkPanelColors.DarkGray], [colors.T50, darkPanelColors.T1200S], [colors.T75, darkPanelColors.T900], [colors.T100, darkPanelColors.T900S], [colors.G50, darkPanelColors.G1200S], [colors.G75, darkPanelColors.G900], [colors.G200, darkPanelColors.G900S], [colors.Y50, darkPanelColors.Y1200S], [colors.Y75, darkPanelColors.Y900], [colors.Y200, darkPanelColors.Y800S], [colors.R50, darkPanelColors.R1200S], [colors.R75, darkPanelColors.R900], [colors.R100, darkPanelColors.R800S], [colors.P50, darkPanelColors.P1200S], [colors.P75, darkPanelColors.P900], [colors.P100, darkPanelColors.P800S]];
|
|
132
|
+
|
|
133
|
+
var getPanelDarkColor = function getPanelDarkColor(panelColor) {
|
|
134
|
+
var colorObject = panelDarkModeColors.find(function (color) {
|
|
135
|
+
return color[0] === panelColor || color[1] === panelColor;
|
|
136
|
+
});
|
|
137
|
+
return colorObject ? colorObject[1] : darkPanelColors.B1200S;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
exports.getPanelDarkColor = getPanelDarkColor;
|
|
141
|
+
var getPanelBackgroundDarkModeColors = panelDarkModeColors.map(function (_ref) {
|
|
131
142
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
132
143
|
colorName = _ref2[0],
|
|
133
144
|
colorValue = _ref2[1];
|
|
@@ -154,13 +165,20 @@ var PanelSharedSelectors = {
|
|
|
154
165
|
errorPanel: ".".concat(prefix, "[data-panel-type=").concat(_adfSchema.PanelType.ERROR, "]"),
|
|
155
166
|
successPanel: ".".concat(prefix, "[data-panel-type=").concat(_adfSchema.PanelType.SUCCESS, "]"),
|
|
156
167
|
noteButton: "button[aria-label=\"Note\"]",
|
|
168
|
+
warningButton: "button[aria-label=\"Warning\"]",
|
|
157
169
|
removeButton: "button[aria-label=\"Remove\"]",
|
|
158
170
|
colorPalette: "[aria-label=\"Background color\"]",
|
|
159
|
-
selectedColor: "[aria-label=\"
|
|
171
|
+
selectedColor: "[aria-label=\"Light green\"]",
|
|
160
172
|
removeEmojiIcon: "[aria-label=\"Remove emoji\"]",
|
|
161
173
|
emojiIcon: "[aria-label=\"editor-add-emoji\"]",
|
|
162
174
|
selectedEmoji: "[aria-label=\":grinning:\"]",
|
|
163
|
-
|
|
175
|
+
addYourOwnEmoji: "[aria-label=\"Add your own emoji\"]",
|
|
176
|
+
emojiNameInCustomEmoji: "[aria-label=\"Enter a name for the new emoji\"]",
|
|
177
|
+
title: "#editor-title",
|
|
178
|
+
emojiPopup: "[aria-label=\"Popup\"]",
|
|
179
|
+
searchEmoji: "[aria-label=\"Search emoji\"]",
|
|
180
|
+
orangeWarningIcon: "[aria-label=\":warning:\"]",
|
|
181
|
+
yellowWarningIcon: "[aria-label=\":warning:\"] span:nth-child(1)"
|
|
164
182
|
};
|
|
165
183
|
exports.PanelSharedSelectors = PanelSharedSelectors;
|
|
166
184
|
|
|
@@ -200,7 +218,7 @@ var mainDynamicStyles = function mainDynamicStyles(panelType) {
|
|
|
200
218
|
};
|
|
201
219
|
};
|
|
202
220
|
|
|
203
|
-
var panelSharedStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n position: relative;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n flex-shrink: 0;\n height: ", "px;\n width: ", "px;\n box-sizing: content-box;\n padding-right: ", "px;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n ", "\n\n > span {\n vertical-align: middle;\n display: inline;\n }\n\n .", " {\n vertical-align: ", "px;\n }\n\n .", " {\n vertical-align: ", "px;\n\n // Vertical align only works for inline-block elements in Firefox\n @-moz-document url-prefix() {\n img {\n display: inline-block;\n }\n }\n }\n }\n\n .ak-editor-panel__content {\n margin: 1px 0 1px;\n flex: 1 0 0;\n /*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n min-width: 0;\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", ";\n }\n }\n"])), PanelSharedCssClassName.prefix, (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, (0, _constants.gridSize)(), _editorSharedStyles.akEditorTableCellMinWidth, mainDynamicStyles(_adfSchema.PanelType.INFO), PanelSharedCssClassName.icon, (0, _constants.gridSize)() * 3, (0, _constants.gridSize)() * 3, (0, _constants.gridSize)(), iconDynamicStyles(_adfSchema.PanelType.INFO), _emoji.emojiSprite, panelEmojiSpriteVerticalAlignment, _emoji.emojiImage, panelEmojiImageVerticalAlignment, _adfSchema.PanelType.NOTE, mainDynamicStyles(_adfSchema.PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.NOTE), _adfSchema.PanelType.TIP, mainDynamicStyles(_adfSchema.PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.TIP), _adfSchema.PanelType.WARNING, mainDynamicStyles(_adfSchema.PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.WARNING), _adfSchema.PanelType.ERROR, mainDynamicStyles(_adfSchema.PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.ERROR), _adfSchema.PanelType.SUCCESS, mainDynamicStyles(_adfSchema.PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.SUCCESS), _adfSchema.PanelType.CUSTOM, (0, _components.themed)({
|
|
221
|
+
var panelSharedStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n position: relative;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n flex-shrink: 0;\n height: ", "px;\n width: ", "px;\n box-sizing: content-box;\n padding-right: ", "px;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n ", "\n\n > span {\n vertical-align: middle;\n display: inline-flex;\n }\n\n .", " {\n vertical-align: ", "px;\n }\n\n .", " {\n vertical-align: ", "px;\n\n // Vertical align only works for inline-block elements in Firefox\n @-moz-document url-prefix() {\n img {\n display: inline-block;\n }\n }\n }\n }\n\n .ak-editor-panel__content {\n margin: 1px 0 1px;\n flex: 1 0 0;\n /*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n min-width: 0;\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", ";\n }\n }\n"])), PanelSharedCssClassName.prefix, (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, (0, _constants.gridSize)(), _editorSharedStyles.akEditorTableCellMinWidth, mainDynamicStyles(_adfSchema.PanelType.INFO), PanelSharedCssClassName.icon, (0, _constants.gridSize)() * 3, (0, _constants.gridSize)() * 3, (0, _constants.gridSize)(), iconDynamicStyles(_adfSchema.PanelType.INFO), _emoji.emojiSprite, panelEmojiSpriteVerticalAlignment, _emoji.emojiImage, panelEmojiImageVerticalAlignment, _adfSchema.PanelType.NOTE, mainDynamicStyles(_adfSchema.PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.NOTE), _adfSchema.PanelType.TIP, mainDynamicStyles(_adfSchema.PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.TIP), _adfSchema.PanelType.WARNING, mainDynamicStyles(_adfSchema.PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.WARNING), _adfSchema.PanelType.ERROR, mainDynamicStyles(_adfSchema.PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.ERROR), _adfSchema.PanelType.SUCCESS, mainDynamicStyles(_adfSchema.PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.SUCCESS), _adfSchema.PanelType.CUSTOM, (0, _components.themed)({
|
|
204
222
|
dark: getPanelBackgroundDarkModeColors
|
|
205
223
|
}));
|
|
206
224
|
exports.panelSharedStyles = panelSharedStyles;
|
|
@@ -51,7 +51,8 @@ var TableSharedCssClassName = {
|
|
|
51
51
|
TABLE_STICKY_SENTINEL_TOP: "".concat(_adfSchema.tablePrefixSelector, "-sticky-sentinel-top"),
|
|
52
52
|
TABLE_STICKY_SENTINEL_BOTTOM: "".concat(_adfSchema.tablePrefixSelector, "-sticky-sentinel-bottom"),
|
|
53
53
|
TABLE_CELL_NODEVIEW_CONTENT_DOM: _adfSchema.tableCellContentDomSelector,
|
|
54
|
-
TABLE_CELL_WRAPPER: _adfSchema.tableCellSelector
|
|
54
|
+
TABLE_CELL_WRAPPER: _adfSchema.tableCellSelector,
|
|
55
|
+
TABLE_HEADER_CELL_WRAPPER: _adfSchema.tableHeaderSelector
|
|
55
56
|
};
|
|
56
57
|
exports.TableSharedCssClassName = TableSharedCssClassName;
|
|
57
58
|
var tableSharedStyle = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-child > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n margin: ", "px ", "px 0 0;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: white;\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]) {\n .code-block {\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n background-color: ", ";\n\n .line-number-gutter {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, tableCellBorderWidth, (0, _components.themed)({
|
|
@@ -25,9 +25,9 @@ var _reactIntl = require("react-intl");
|
|
|
25
25
|
|
|
26
26
|
var _reactIntlNext = require("react-intl-next");
|
|
27
27
|
|
|
28
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
28
|
+
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; }
|
|
29
29
|
|
|
30
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
30
|
+
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; }
|
|
31
31
|
|
|
32
32
|
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); }; }
|
|
33
33
|
|
|
@@ -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 =
|
|
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 =
|
|
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
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
(0,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
}]);
|
|
@@ -37,9 +37,9 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
37
37
|
|
|
38
38
|
var _utils = require("./utils");
|
|
39
39
|
|
|
40
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
40
|
+
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; }
|
|
41
41
|
|
|
42
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
42
|
+
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; }
|
|
43
43
|
|
|
44
44
|
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); }; }
|
|
45
45
|
|
|
@@ -75,7 +75,7 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
75
75
|
return _this.updatePosition(props);
|
|
76
76
|
}));
|
|
77
77
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onResize", function () {
|
|
78
|
-
return _this.scheduledUpdatePosition();
|
|
78
|
+
return _this.scheduledUpdatePosition(_this.props);
|
|
79
79
|
});
|
|
80
80
|
return _this;
|
|
81
81
|
}
|
|
@@ -188,7 +188,7 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
188
188
|
* which is currently working for most of the floating toolbar and other popups.
|
|
189
189
|
*/
|
|
190
190
|
|
|
191
|
-
this.scheduledUpdatePosition();
|
|
191
|
+
this.scheduledUpdatePosition(this.props);
|
|
192
192
|
}
|
|
193
193
|
}, {
|
|
194
194
|
key: "UNSAFE_componentWillReceiveProps",
|