@atlaskit/editor-core 172.0.5 → 172.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.
- package/CHANGELOG.md +44 -0
- package/dist/cjs/create-editor/ReactEditorView.js +11 -2
- package/dist/cjs/create-editor/ReactEditorViewContext.js +15 -0
- package/dist/cjs/create-editor/create-plugins-list.js +2 -1
- package/dist/cjs/editor.js +7 -1
- package/dist/cjs/labs/next/mobile.js +5 -3
- package/dist/cjs/messages.js +5 -0
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +8 -0
- package/dist/cjs/plugins/card/pm-plugins/doc.js +2 -26
- package/dist/cjs/plugins/card/toolbar.js +118 -86
- package/dist/cjs/plugins/code-block/nodeviews/code-block.js +9 -2
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +37 -1
- package/dist/cjs/plugins/code-block/toolbar.js +3 -1
- package/dist/cjs/plugins/code-block/ui/class-names.js +2 -0
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +42 -2
- package/dist/cjs/plugins/hyperlink/Toolbar.js +43 -8
- package/dist/cjs/plugins/media/commands/helpers.js +1 -8
- package/dist/cjs/plugins/media/index.js +1 -1
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +0 -10
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
- package/dist/cjs/plugins/media/picker-facade.js +1 -0
- package/dist/cjs/plugins/media/pm-plugins/main.js +3 -13
- package/dist/cjs/plugins/paste/handlers.js +9 -20
- package/dist/cjs/plugins/paste/md.js +8 -2
- package/dist/cjs/plugins/paste/newline-md-plugin.js +67 -0
- package/dist/cjs/plugins/paste/paragraph-md-plugin.js +72 -0
- package/dist/cjs/plugins/table/commands/hover.js +4 -4
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/utils/decoration.js +53 -3
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +3 -2
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +78 -53
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +1 -1
- package/dist/cjs/ui/Addon/ClickAreaBlock/index.js +7 -2
- package/dist/cjs/ui/Addon/ClickAreaMobile/index.js +8 -2
- package/dist/cjs/ui/Appearance/Comment/Comment.js +13 -13
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +8 -7
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/cjs/ui/Appearance/Mobile.js +4 -2
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +5 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/DropdownMenu/index.js +5 -5
- package/dist/cjs/ui/with-outer-listeners.js +105 -50
- package/dist/cjs/utils/deprecation-warnings.js +4 -0
- package/dist/cjs/utils/linking-utils.js +40 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +11 -2
- package/dist/es2019/create-editor/ReactEditorViewContext.js +3 -0
- package/dist/es2019/create-editor/create-plugins-list.js +2 -1
- package/dist/es2019/editor.js +7 -1
- package/dist/es2019/labs/next/mobile.js +5 -3
- package/dist/es2019/messages.js +5 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +10 -0
- package/dist/es2019/plugins/card/pm-plugins/doc.js +1 -24
- package/dist/es2019/plugins/card/toolbar.js +114 -86
- package/dist/es2019/plugins/code-block/nodeviews/code-block.js +9 -2
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +40 -2
- package/dist/es2019/plugins/code-block/toolbar.js +2 -1
- package/dist/es2019/plugins/code-block/ui/class-names.js +2 -0
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +37 -0
- package/dist/es2019/plugins/hyperlink/Toolbar.js +40 -9
- package/dist/es2019/plugins/media/commands/helpers.js +0 -2
- package/dist/es2019/plugins/media/index.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +0 -7
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
- package/dist/es2019/plugins/media/picker-facade.js +1 -0
- package/dist/es2019/plugins/media/pm-plugins/main.js +3 -13
- package/dist/es2019/plugins/paste/handlers.js +7 -19
- package/dist/es2019/plugins/paste/md.js +6 -2
- package/dist/es2019/plugins/paste/newline-md-plugin.js +56 -0
- package/dist/es2019/plugins/paste/paragraph-md-plugin.js +61 -0
- package/dist/es2019/plugins/table/commands/hover.js +4 -4
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +39 -0
- package/dist/es2019/plugins/table/utils/decoration.js +60 -24
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +4 -3
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +78 -59
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -2
- package/dist/es2019/ui/Addon/ClickAreaBlock/index.js +6 -2
- package/dist/es2019/ui/Addon/ClickAreaMobile/index.js +7 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +12 -6
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +7 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/es2019/ui/Appearance/Mobile.js +4 -2
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +5 -4
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/DropdownMenu/index.js +10 -6
- package/dist/es2019/ui/with-outer-listeners.js +83 -33
- package/dist/es2019/utils/deprecation-warnings.js +4 -0
- package/dist/es2019/utils/linking-utils.js +37 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +11 -2
- package/dist/esm/create-editor/ReactEditorViewContext.js +3 -0
- package/dist/esm/create-editor/create-plugins-list.js +2 -1
- package/dist/esm/editor.js +7 -1
- package/dist/esm/labs/next/mobile.js +5 -3
- package/dist/esm/messages.js +5 -0
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +9 -0
- package/dist/esm/plugins/card/pm-plugins/doc.js +1 -20
- package/dist/esm/plugins/card/toolbar.js +108 -83
- package/dist/esm/plugins/code-block/nodeviews/code-block.js +9 -2
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +37 -2
- package/dist/esm/plugins/code-block/toolbar.js +2 -1
- package/dist/esm/plugins/code-block/ui/class-names.js +2 -0
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -2
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +41 -2
- package/dist/esm/plugins/hyperlink/Toolbar.js +43 -10
- package/dist/esm/plugins/media/commands/helpers.js +0 -4
- package/dist/esm/plugins/media/index.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +0 -8
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
- package/dist/esm/plugins/media/picker-facade.js +1 -0
- package/dist/esm/plugins/media/pm-plugins/main.js +3 -15
- package/dist/esm/plugins/paste/handlers.js +11 -22
- package/dist/esm/plugins/paste/md.js +6 -2
- package/dist/esm/plugins/paste/newline-md-plugin.js +58 -0
- package/dist/esm/plugins/paste/paragraph-md-plugin.js +63 -0
- package/dist/esm/plugins/table/commands/hover.js +4 -4
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/utils/decoration.js +50 -3
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +4 -3
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +77 -51
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -2
- package/dist/esm/ui/Addon/ClickAreaBlock/index.js +7 -2
- package/dist/esm/ui/Addon/ClickAreaMobile/index.js +8 -2
- package/dist/esm/ui/Appearance/Comment/Comment.js +12 -12
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +7 -6
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/esm/ui/Appearance/Mobile.js +4 -2
- package/dist/esm/ui/AppearanceComponents/Mobile.js +5 -4
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/DropdownMenu/index.js +5 -5
- package/dist/esm/ui/with-outer-listeners.js +105 -51
- package/dist/esm/utils/deprecation-warnings.js +4 -0
- package/dist/esm/utils/linking-utils.js +37 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorView.d.ts +2 -0
- package/dist/types/create-editor/ReactEditorViewContext.d.ts +8 -0
- package/dist/types/messages.d.ts +5 -0
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +2 -2
- package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -0
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +3 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -2
- package/dist/types/plugins/card/toolbar.d.ts +1 -0
- package/dist/types/plugins/code-block/pm-plugins/ide-ux.d.ts +4 -1
- package/dist/types/plugins/code-block/ui/class-names.d.ts +2 -0
- package/dist/types/plugins/hyperlink/types.d.ts +1 -0
- package/dist/types/plugins/media/commands/helpers.d.ts +0 -1
- package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +0 -1
- package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +0 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +0 -2
- package/dist/types/plugins/media/pm-plugins/types.d.ts +0 -2
- package/dist/types/plugins/paste/newline-md-plugin.d.ts +2 -0
- package/dist/types/plugins/paste/paragraph-md-plugin.d.ts +2 -0
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +9 -0
- package/dist/types/ui/Addon/ClickAreaBlock/index.d.ts +1 -0
- package/dist/types/ui/Addon/ClickAreaMobile/index.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
- package/dist/types/ui/Appearance/Mobile.d.ts +1 -1
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -1
- package/dist/types/ui/Dropdown/index.d.ts +1 -1
- package/dist/types/ui/with-outer-listeners.d.ts +2 -1
- package/dist/types/utils/linking-utils.d.ts +1 -0
- package/package.json +30 -32
- package/dist/cjs/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -77
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -118
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -70
- package/dist/es2019/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -51
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -97
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -53
- package/dist/esm/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -51
- package/dist/esm/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -101
- package/dist/esm/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -48
- package/dist/types/plugins/type-ahead/ui/DynamicHeightListItem.d.ts +0 -21
- package/dist/types/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.d.ts +0 -25
- package/dist/types/plugins/type-ahead/ui/hooks/use-resize-observer.d.ts +0 -8
|
@@ -71,17 +71,17 @@ var buttonStyles = function buttonStyles(isActive) {
|
|
|
71
71
|
/**
|
|
72
72
|
* Hack for item to imitate old dropdown-menu selected styles
|
|
73
73
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
77
|
-
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n > span,\n > span:hover {\n background: #6c798f;\n color: #fff;\n }\n "])));
|
|
74
|
+
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n > span,\n > span:hover,\n > span:active {\n background: ", ";\n color: ", ";\n }\n "])), (0, _tokens.token)('color.background.selected', '#6c798f'), (0, _tokens.token)('color.text', '#fff'));
|
|
78
75
|
} else {
|
|
79
|
-
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n > span:hover[aria-disabled='false'] {\n color: ", ";\n background-color: ", ";\n }\n > span[aria-disabled='true'] {\n color: ", ";\n }\n "])), (0, _components.themed)({
|
|
76
|
+
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n > span:hover[aria-disabled='false'] {\n color: ", ";\n background-color: ", ";\n }\n > span:active[aria-disabled='false'] {\n background-color: ", ";\n }\n > span[aria-disabled='true'] {\n color: ", ";\n }\n "])), (0, _components.themed)({
|
|
80
77
|
light: (0, _tokens.token)('color.text', _colors.N900),
|
|
81
78
|
dark: (0, _tokens.token)('color.text', _colors.DN600)
|
|
82
79
|
})(theme), (0, _components.themed)({
|
|
83
80
|
light: (0, _tokens.token)('color.background.neutral.subtle.hovered', 'rgb(244, 245, 247)'),
|
|
84
81
|
dark: (0, _tokens.token)('color.background.neutral.subtle.hovered', 'rgb(59, 71, 92)')
|
|
82
|
+
})(theme), (0, _components.themed)({
|
|
83
|
+
light: (0, _tokens.token)('color.background.neutral.subtle.pressed', 'rgb(179, 212, 255)'),
|
|
84
|
+
dark: (0, _tokens.token)('color.background.neutral.subtle.pressed', 'rgb(179, 212, 255)')
|
|
85
85
|
})(theme), (0, _components.themed)({
|
|
86
86
|
light: (0, _tokens.token)('color.text.disabled', _colors.N70),
|
|
87
87
|
dark: (0, _tokens.token)('color.text.disabled', _colors.DN80)
|
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = withOuterListeners;
|
|
11
11
|
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
12
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
15
|
|
|
14
16
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -27,6 +29,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
27
29
|
|
|
28
30
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
29
31
|
|
|
32
|
+
var _ReactEditorViewContext = _interopRequireDefault(require("../create-editor/ReactEditorViewContext"));
|
|
33
|
+
|
|
34
|
+
var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown"];
|
|
35
|
+
|
|
30
36
|
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); }
|
|
31
37
|
|
|
32
38
|
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; }
|
|
@@ -35,70 +41,119 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
35
41
|
|
|
36
42
|
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; } }
|
|
37
43
|
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
(0, _inherits2.default)(WithOutsideClick, _PureComponent);
|
|
44
|
+
var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
45
|
+
(0, _inherits2.default)(WithOutsideClick, _PureComponent);
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
var _super = _createSuper(WithOutsideClick);
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
function WithOutsideClick() {
|
|
50
|
+
var _this;
|
|
46
51
|
|
|
47
|
-
|
|
52
|
+
(0, _classCallCheck2.default)(this, WithOutsideClick);
|
|
48
53
|
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
55
|
+
args[_key] = arguments[_key];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
59
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function (evt) {
|
|
60
|
+
if (!_this.props.isActiveComponent) {
|
|
61
|
+
return;
|
|
51
62
|
}
|
|
52
63
|
|
|
53
|
-
|
|
54
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function (evt) {
|
|
55
|
-
var domNode = _reactDom.default.findDOMNode((0, _assertThisInitialized2.default)(_this)); // eslint-disable-line react/no-find-dom-node
|
|
64
|
+
var domNode = _reactDom.default.findDOMNode((0, _assertThisInitialized2.default)(_this)); // eslint-disable-line react/no-find-dom-node
|
|
56
65
|
|
|
57
66
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeydown", function (evt) {
|
|
65
|
-
if (evt.code === 'Escape' && _this.props.handleEscapeKeydown) {
|
|
66
|
-
_this.props.handleEscapeKeydown(evt);
|
|
67
|
-
} else if (evt.code === 'Enter' && _this.props.handleEnterKeydown) {
|
|
68
|
-
_this.props.handleEnterKeydown(evt);
|
|
67
|
+
if (!domNode || evt.target instanceof Node && !domNode.contains(evt.target)) {
|
|
68
|
+
if (_this.props.handleClickOutside) {
|
|
69
|
+
_this.props.handleClickOutside(evt);
|
|
69
70
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeydown", function (evt) {
|
|
74
|
+
if (!_this.props.isActiveComponent) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
73
77
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
if (evt.code === 'Escape' && _this.props.handleEscapeKeydown) {
|
|
79
|
+
var _this$props$editorVie;
|
|
80
|
+
|
|
81
|
+
evt.preventDefault();
|
|
82
|
+
evt.stopPropagation();
|
|
83
|
+
|
|
84
|
+
_this.props.handleEscapeKeydown(evt);
|
|
85
|
+
|
|
86
|
+
if (!((_this$props$editorVie = _this.props.editorView) !== null && _this$props$editorVie !== void 0 && _this$props$editorVie.hasFocus())) {
|
|
87
|
+
var _this$props$editorVie2;
|
|
80
88
|
|
|
81
|
-
|
|
82
|
-
document.addEventListener('keydown', this.handleKeydown, false);
|
|
89
|
+
(_this$props$editorVie2 = _this.props.editorView) === null || _this$props$editorVie2 === void 0 ? void 0 : _this$props$editorVie2.focus();
|
|
83
90
|
}
|
|
91
|
+
|
|
92
|
+
return false;
|
|
93
|
+
} else if (evt.code === 'Enter' && _this.props.handleEnterKeydown) {
|
|
94
|
+
_this.props.handleEnterKeydown(evt);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return _this;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
(0, _createClass2.default)(WithOutsideClick, [{
|
|
101
|
+
key: "componentDidMount",
|
|
102
|
+
value: function componentDidMount() {
|
|
103
|
+
if (this.props.handleClickOutside) {
|
|
104
|
+
document.addEventListener('click', this.handleClick, false);
|
|
84
105
|
}
|
|
85
|
-
}, {
|
|
86
|
-
key: "componentWillUnmount",
|
|
87
|
-
value: function componentWillUnmount() {
|
|
88
|
-
if (this.props.handleClickOutside) {
|
|
89
|
-
document.removeEventListener('click', this.handleClick, false);
|
|
90
|
-
}
|
|
91
106
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
if (this.props.handleEscapeKeydown) {
|
|
108
|
+
var _this$props$editorRef;
|
|
109
|
+
|
|
110
|
+
(((_this$props$editorRef = this.props.editorRef) === null || _this$props$editorRef === void 0 ? void 0 : _this$props$editorRef.current) || document).addEventListener('keydown', this.handleKeydown, false);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "componentWillUnmount",
|
|
115
|
+
value: function componentWillUnmount() {
|
|
116
|
+
if (this.props.handleClickOutside) {
|
|
117
|
+
document.removeEventListener('click', this.handleClick, false);
|
|
95
118
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
119
|
+
|
|
120
|
+
if (this.props.handleEscapeKeydown) {
|
|
121
|
+
var _this$props$editorRef2;
|
|
122
|
+
|
|
123
|
+
(((_this$props$editorRef2 = this.props.editorRef) === null || _this$props$editorRef2 === void 0 ? void 0 : _this$props$editorRef2.current) || document).removeEventListener('keydown', this.handleKeydown, false);
|
|
100
124
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "render",
|
|
128
|
+
value: function render() {
|
|
129
|
+
return this.props.children;
|
|
130
|
+
}
|
|
131
|
+
}]);
|
|
132
|
+
return WithOutsideClick;
|
|
133
|
+
}(_react.PureComponent);
|
|
134
|
+
|
|
135
|
+
function hasIsOpen(props) {
|
|
136
|
+
return 'isOpen' in props;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function withOuterListeners(Component) {
|
|
140
|
+
return function (_ref) {
|
|
141
|
+
var handleClickOutside = _ref.handleClickOutside,
|
|
142
|
+
handleEnterKeydown = _ref.handleEnterKeydown,
|
|
143
|
+
handleEscapeKeydown = _ref.handleEscapeKeydown,
|
|
144
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
145
|
+
var isActiveComponent = hasIsOpen(props) ? props.isOpen : true;
|
|
146
|
+
return /*#__PURE__*/_react.default.createElement(_ReactEditorViewContext.default.Consumer, null, function (_ref2) {
|
|
147
|
+
var editorView = _ref2.editorView,
|
|
148
|
+
editorRef = _ref2.editorRef;
|
|
149
|
+
return /*#__PURE__*/_react.default.createElement(WithOutsideClick, {
|
|
150
|
+
editorView: editorView,
|
|
151
|
+
editorRef: editorRef,
|
|
152
|
+
isActiveComponent: isActiveComponent,
|
|
153
|
+
handleClickOutside: handleClickOutside,
|
|
154
|
+
handleEnterKeydown: handleEnterKeydown,
|
|
155
|
+
handleEscapeKeydown: handleEscapeKeydown
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement(Component, props));
|
|
157
|
+
});
|
|
158
|
+
};
|
|
104
159
|
}
|
|
@@ -14,6 +14,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
14
14
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
15
15
|
|
|
16
16
|
var deprecationWarnings = function deprecationWarnings(className, props, deprecations) {
|
|
17
|
+
if (process.env.NODE_ENV === 'production') {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
var nextVersion = (0, _versionWrapper.nextMajorVersion)();
|
|
18
22
|
|
|
19
23
|
var _iterator = _createForOfIteratorHelper(deprecations),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.unlinkPayload = exports.buildVisitedLinkPayload = exports.buildEditLinkPayload = void 0;
|
|
6
|
+
exports.unlinkPayload = exports.buildVisitedLinkPayload = exports.buildOpenedSettingsPayload = exports.buildEditLinkPayload = void 0;
|
|
7
7
|
|
|
8
8
|
var _analytics = require("../plugins/analytics");
|
|
9
9
|
|
|
@@ -21,6 +21,30 @@ var buildEditLinkPayload = function buildEditLinkPayload(type) {
|
|
|
21
21
|
|
|
22
22
|
exports.buildEditLinkPayload = buildEditLinkPayload;
|
|
23
23
|
|
|
24
|
+
var mapLinkTypeToCardAppearance = function mapLinkTypeToCardAppearance(type) {
|
|
25
|
+
switch (type) {
|
|
26
|
+
case _analytics.ACTION_SUBJECT_ID.CARD_INLINE:
|
|
27
|
+
{
|
|
28
|
+
return 'inline';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
case _analytics.ACTION_SUBJECT_ID.CARD_BLOCK:
|
|
32
|
+
{
|
|
33
|
+
return 'block';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
case _analytics.ACTION_SUBJECT_ID.EMBEDS:
|
|
37
|
+
{
|
|
38
|
+
return 'embed';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
default:
|
|
42
|
+
{
|
|
43
|
+
return 'url';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
24
48
|
var buildVisitedLinkPayload = function buildVisitedLinkPayload(type) {
|
|
25
49
|
return type === _analytics.ACTION_SUBJECT_ID.HYPERLINK ? {
|
|
26
50
|
action: _analytics.ACTION.VISITED,
|
|
@@ -43,6 +67,21 @@ var buildVisitedLinkPayload = function buildVisitedLinkPayload(type) {
|
|
|
43
67
|
|
|
44
68
|
exports.buildVisitedLinkPayload = buildVisitedLinkPayload;
|
|
45
69
|
|
|
70
|
+
var buildOpenedSettingsPayload = function buildOpenedSettingsPayload(type) {
|
|
71
|
+
return {
|
|
72
|
+
action: _analytics.ACTION.CLICKED,
|
|
73
|
+
actionSubject: _analytics.ACTION_SUBJECT.BUTTON,
|
|
74
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.GOTO_SMART_LINK_SETTINGS,
|
|
75
|
+
attributes: {
|
|
76
|
+
inputMethod: _analytics.INPUT_METHOD.TOOLBAR,
|
|
77
|
+
display: mapLinkTypeToCardAppearance(type)
|
|
78
|
+
},
|
|
79
|
+
eventType: _analytics.EVENT_TYPE.UI
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
exports.buildOpenedSettingsPayload = buildOpenedSettingsPayload;
|
|
84
|
+
|
|
46
85
|
var unlinkPayload = function unlinkPayload(type) {
|
|
47
86
|
return {
|
|
48
87
|
action: _analytics.ACTION.UNLINK,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "172.0
|
|
9
|
+
var version = "172.1.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
|
|
12
12
|
var nextMajorVersion = function nextMajorVersion() {
|
package/dist/cjs/version.json
CHANGED
|
@@ -29,6 +29,7 @@ import { TransactionTracker } from '../utils/performance/track-transactions';
|
|
|
29
29
|
import { EVENT_NAME_DISPATCH_TRANSACTION, EVENT_NAME_STATE_APPLY, EVENT_NAME_UPDATE_STATE, EVENT_NAME_VIEW_STATE_UPDATED, EVENT_NAME_ON_CHANGE } from '../utils/performance/track-transactions';
|
|
30
30
|
import { PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, DEFAULT_SAMPLING_RATE_VALID_TRANSACTIONS } from './consts';
|
|
31
31
|
import { getContextIdentifier } from '../plugins/base/pm-plugins/context-identifier';
|
|
32
|
+
import ReactEditorViewContext from './ReactEditorViewContext';
|
|
32
33
|
|
|
33
34
|
function handleEditorFocus(view) {
|
|
34
35
|
if (view.hasFocus()) {
|
|
@@ -77,6 +78,8 @@ export class ReactEditorView extends React.Component {
|
|
|
77
78
|
constructor(_props, context) {
|
|
78
79
|
super(_props, context);
|
|
79
80
|
|
|
81
|
+
_defineProperty(this, "editorRef", /*#__PURE__*/React.createRef());
|
|
82
|
+
|
|
80
83
|
_defineProperty(this, "canDispatchTransactions", true);
|
|
81
84
|
|
|
82
85
|
_defineProperty(this, "onPluginObservation", (report, editorState) => {
|
|
@@ -732,7 +735,12 @@ export class ReactEditorView extends React.Component {
|
|
|
732
735
|
const renderTracking = (_this$props$editorPro9 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro9 === void 0 ? void 0 : (_this$props$editorPro10 = _this$props$editorPro9.renderTracking) === null || _this$props$editorPro10 === void 0 ? void 0 : _this$props$editorPro10.reactEditorView;
|
|
733
736
|
const renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
734
737
|
const useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
735
|
-
return /*#__PURE__*/React.createElement(
|
|
738
|
+
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
739
|
+
value: {
|
|
740
|
+
editorRef: this.editorRef,
|
|
741
|
+
editorView: this.view
|
|
742
|
+
}
|
|
743
|
+
}, renderTrackingEnabled && /*#__PURE__*/React.createElement(RenderTracking, {
|
|
736
744
|
componentProps: this.props,
|
|
737
745
|
action: ACTION.RE_RENDERED,
|
|
738
746
|
actionSubject: ACTION_SUBJECT.REACT_EDITOR_VIEW,
|
|
@@ -744,7 +752,8 @@ export class ReactEditorView extends React.Component {
|
|
|
744
752
|
config: this.config,
|
|
745
753
|
eventDispatcher: this.eventDispatcher,
|
|
746
754
|
transformer: this.contentTransformer,
|
|
747
|
-
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent
|
|
755
|
+
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
|
|
756
|
+
editorRef: this.editorRef
|
|
748
757
|
}) : this.editor);
|
|
749
758
|
}
|
|
750
759
|
|
|
@@ -90,7 +90,8 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
90
90
|
cardOptions,
|
|
91
91
|
hyperlinkOptions: {
|
|
92
92
|
linkPicker: (_props$linking2 = props.linking) === null || _props$linking2 === void 0 ? void 0 : _props$linking2.linkPicker,
|
|
93
|
-
cardOptions
|
|
93
|
+
cardOptions,
|
|
94
|
+
platform: isMobile ? 'mobile' : 'web'
|
|
94
95
|
},
|
|
95
96
|
codeBlock: { ...props.codeBlock,
|
|
96
97
|
useLongPressSelection: false,
|
package/dist/es2019/editor.js
CHANGED
|
@@ -312,6 +312,10 @@ export default class Editor extends React.Component {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
deprecationWarnings(props) {
|
|
315
|
+
if (process.env.NODE_ENV === 'production') {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
|
|
315
319
|
const nextVersion = nextMajorVersion();
|
|
316
320
|
const deprecatedProperties = {
|
|
317
321
|
allowTasksAndDecisions: {
|
|
@@ -470,13 +474,15 @@ export default class Editor extends React.Component {
|
|
|
470
474
|
view,
|
|
471
475
|
eventDispatcher,
|
|
472
476
|
config,
|
|
473
|
-
dispatchAnalyticsEvent
|
|
477
|
+
dispatchAnalyticsEvent,
|
|
478
|
+
editorRef
|
|
474
479
|
}) => {
|
|
475
480
|
var _this$props$featureFl5, _this$props$featureFl6;
|
|
476
481
|
|
|
477
482
|
return jsx(BaseTheme, {
|
|
478
483
|
baseFontSize: this.getBaseFontSize()
|
|
479
484
|
}, jsx(Component, {
|
|
485
|
+
innerRef: editorRef,
|
|
480
486
|
appearance: this.props.appearance,
|
|
481
487
|
disabled: this.props.disabled,
|
|
482
488
|
editorActions: this.editorActions,
|
|
@@ -8,15 +8,17 @@ import { ContextAdapter } from '../../nodeviews/context-adapter';
|
|
|
8
8
|
export function MobileEditor(props) {
|
|
9
9
|
const {
|
|
10
10
|
maxHeight,
|
|
11
|
-
createAnalyticsEvent
|
|
11
|
+
createAnalyticsEvent,
|
|
12
|
+
disabled
|
|
12
13
|
} = props;
|
|
13
14
|
const handleAnalyticsEvent = useCreateAnalyticsHandler(createAnalyticsEvent);
|
|
14
15
|
const renderWithConfig = useCallback(config => {
|
|
15
16
|
return /*#__PURE__*/React.createElement(MobileAppearance, {
|
|
16
17
|
editorView: config && config.editorView,
|
|
17
|
-
maxHeight: maxHeight
|
|
18
|
+
maxHeight: maxHeight,
|
|
19
|
+
editorDisabled: disabled
|
|
18
20
|
}, /*#__PURE__*/React.createElement(EditorContent, null));
|
|
19
|
-
}, [maxHeight]);
|
|
21
|
+
}, [maxHeight, disabled]);
|
|
20
22
|
return /*#__PURE__*/React.createElement(ContextAdapter, null, /*#__PURE__*/React.createElement(Editor, _extends({}, props, {
|
|
21
23
|
onAnalyticsEvent: handleAnalyticsEvent
|
|
22
24
|
}), /*#__PURE__*/React.createElement(EditorSharedConfigConsumer, null, renderWithConfig)));
|
package/dist/es2019/messages.js
CHANGED
|
@@ -51,6 +51,11 @@ export const linkToolbarMessages = defineMessages({
|
|
|
51
51
|
id: 'fabric.editor.emptyLink',
|
|
52
52
|
defaultMessage: 'Please enter a link.',
|
|
53
53
|
description: 'Please enter a link.'
|
|
54
|
+
},
|
|
55
|
+
settingsLink: {
|
|
56
|
+
id: 'fabric.editor.settingsLinks',
|
|
57
|
+
defaultMessage: 'Go to Link Preferences',
|
|
58
|
+
description: 'Go to Link Preferences'
|
|
54
59
|
}
|
|
55
60
|
});
|
|
56
61
|
export default defineMessages({
|
|
@@ -309,6 +309,7 @@ export let ACTION_SUBJECT_ID;
|
|
|
309
309
|
ACTION_SUBJECT_ID["EDIT_LINK"] = "editLink";
|
|
310
310
|
ACTION_SUBJECT_ID["UNLINK"] = "unlink";
|
|
311
311
|
ACTION_SUBJECT_ID["OPEN_LINK"] = "openLink";
|
|
312
|
+
ACTION_SUBJECT_ID["GOTO_SMART_LINK_SETTINGS"] = "goToSmartLinkSettings";
|
|
312
313
|
ACTION_SUBJECT_ID["EMBEDS"] = "embeds";
|
|
313
314
|
ACTION_SUBJECT_ID["HYPERLINK"] = "hyperlink";
|
|
314
315
|
})(ACTION_SUBJECT_ID || (ACTION_SUBJECT_ID = {}));
|
|
@@ -6,7 +6,7 @@ import { shortcutStyle } from '../../../../ui/styles';
|
|
|
6
6
|
import { token } from '@atlaskit/tokens';
|
|
7
7
|
export const blockTypeMenuItemStyle = (tagName, selected) => {
|
|
8
8
|
// TEMP FIX: See https://product-fabric.atlassian.net/browse/ED-13878
|
|
9
|
-
const selectedStyle = selected ? `${tagName} { color: ${token('color.text
|
|
9
|
+
const selectedStyle = selected ? `${tagName} { color: ${token('color.text', 'white')} !important; }` : '';
|
|
10
10
|
return themeProps => css`
|
|
11
11
|
${headingsSharedStyles(themeProps)};
|
|
12
12
|
> {
|
|
@@ -35,6 +35,15 @@ export class InlineCardComponent extends React.PureComponent {
|
|
|
35
35
|
pos: getPos()
|
|
36
36
|
})(view.state.tr)))();
|
|
37
37
|
});
|
|
38
|
+
|
|
39
|
+
_defineProperty(this, "onError", data => {
|
|
40
|
+
const {
|
|
41
|
+
url
|
|
42
|
+
} = data;
|
|
43
|
+
this.onResolve({
|
|
44
|
+
url
|
|
45
|
+
});
|
|
46
|
+
});
|
|
38
47
|
}
|
|
39
48
|
|
|
40
49
|
UNSAFE_componentWillMount() {
|
|
@@ -65,6 +74,7 @@ export class InlineCardComponent extends React.PureComponent {
|
|
|
65
74
|
onClick: this.onClick,
|
|
66
75
|
container: this.scrollContainer,
|
|
67
76
|
onResolve: this.onResolve,
|
|
77
|
+
onError: this.onError,
|
|
68
78
|
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined
|
|
69
79
|
})); // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
70
80
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { NodeSelection } from 'prosemirror-state';
|
|
2
|
-
import { Fragment, Slice } from 'prosemirror-model';
|
|
3
2
|
import { closeHistory } from 'prosemirror-history';
|
|
4
3
|
import { pluginKey } from './plugin-key';
|
|
5
4
|
import { queueCards, resolveCard } from './actions';
|
|
@@ -13,27 +12,11 @@ import { SMART_LINK_TYPE } from '../../../plugins/analytics/types/node-events';
|
|
|
13
12
|
import { getLinkCreationAnalyticsEvent } from '../../../plugins/hyperlink/analytics';
|
|
14
13
|
import { unlinkPayload } from '../../../utils/linking-utils';
|
|
15
14
|
import { getFeatureFlags } from '../../feature-flags-context';
|
|
16
|
-
export function insertCard(tr, cardAdf, schema) {
|
|
17
|
-
const {
|
|
18
|
-
inlineCard
|
|
19
|
-
} = schema.nodes; // ED-5638: add an extra space after inline cards to avoid re-rendering them
|
|
20
|
-
|
|
21
|
-
const nodes = [cardAdf];
|
|
22
|
-
|
|
23
|
-
if (cardAdf.type === inlineCard) {
|
|
24
|
-
nodes.push(schema.text(' '));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return tr.replaceSelection(new Slice(Fragment.fromArray(nodes), 0, 0));
|
|
28
|
-
}
|
|
29
15
|
/**
|
|
30
16
|
* Attempt to replace the link into the respective card.
|
|
31
17
|
*/
|
|
32
18
|
|
|
33
19
|
function replaceLinksToCards(tr, cardAdf, schema, request) {
|
|
34
|
-
const {
|
|
35
|
-
inlineCard
|
|
36
|
-
} = schema.nodes;
|
|
37
20
|
const {
|
|
38
21
|
url
|
|
39
22
|
} = request;
|
|
@@ -55,15 +38,9 @@ function replaceLinksToCards(tr, cardAdf, schema, request) {
|
|
|
55
38
|
|
|
56
39
|
if (!replaceLink) {
|
|
57
40
|
return;
|
|
58
|
-
} // ED-5638: add an extra space after inline cards to avoid re-rendering them
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const nodes = [cardAdf];
|
|
62
|
-
|
|
63
|
-
if (cardAdf.type === inlineCard) {
|
|
64
|
-
nodes.push(schema.text(' '));
|
|
65
41
|
}
|
|
66
42
|
|
|
43
|
+
const nodes = [cardAdf];
|
|
67
44
|
tr.replaceWith(pos, pos + (node.text || url).length, nodes);
|
|
68
45
|
return $pos.node($pos.depth - 1).type.name;
|
|
69
46
|
}
|