@atlaskit/editor-core 187.47.6 → 187.48.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 +17 -0
- package/dist/cjs/editor-next/index.js +2 -2
- package/dist/cjs/index.js +7 -7
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +8 -20
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +4 -4
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +1 -2
- package/dist/cjs/test-utils.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/editor-next/index.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +9 -19
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +5 -5
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
- package/dist/es2019/test-utils.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/editor-next/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +9 -21
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +5 -5
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
- package/dist/esm/test-utils.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/create-plugins-list.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/labs/next/presets/default.d.ts +1 -1
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -1
- package/dist/types/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/create-editor/create-plugins-list.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +1 -1
- package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +8 -9
- package/report.api.md +3 -26
- package/tmp/api-report-tmp.d.ts +3 -26
- package/dist/cjs/plugins/base/commands.js +0 -20
- package/dist/cjs/plugins/base/index.js +0 -13
- package/dist/cjs/plugins/base/plugin.js +0 -143
- package/dist/cjs/plugins/base/pm-plugins/context-identifier.js +0 -58
- package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +0 -63
- package/dist/cjs/plugins/base/pm-plugins/filter-steps.js +0 -34
- package/dist/cjs/plugins/base/pm-plugins/fix-chrome-88-selection.js +0 -34
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +0 -265
- package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +0 -183
- package/dist/cjs/plugins/base/pm-plugins/newline-preserve-marks.js +0 -34
- package/dist/cjs/plugins/base/pm-plugins/scroll-gutter/index.js +0 -262
- package/dist/cjs/plugins/base/pm-plugins/scroll-gutter/plugin-key.js +0 -15
- package/dist/cjs/plugins/base/utils/frozen-editor.js +0 -11
- package/dist/cjs/plugins/base/utils/input-latency-tracking.js +0 -134
- package/dist/cjs/ui/Dropdown/index.js +0 -9
- package/dist/es2019/plugins/base/commands.js +0 -13
- package/dist/es2019/plugins/base/index.js +0 -2
- package/dist/es2019/plugins/base/plugin.js +0 -113
- package/dist/es2019/plugins/base/pm-plugins/context-identifier.js +0 -43
- package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +0 -54
- package/dist/es2019/plugins/base/pm-plugins/filter-steps.js +0 -23
- package/dist/es2019/plugins/base/pm-plugins/fix-chrome-88-selection.js +0 -24
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +0 -258
- package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +0 -186
- package/dist/es2019/plugins/base/pm-plugins/newline-preserve-marks.js +0 -20
- package/dist/es2019/plugins/base/pm-plugins/scroll-gutter/index.js +0 -242
- package/dist/es2019/plugins/base/pm-plugins/scroll-gutter/plugin-key.js +0 -7
- package/dist/es2019/plugins/base/utils/frozen-editor.js +0 -2
- package/dist/es2019/plugins/base/utils/input-latency-tracking.js +0 -104
- package/dist/es2019/ui/Dropdown/index.js +0 -2
- package/dist/esm/plugins/base/commands.js +0 -13
- package/dist/esm/plugins/base/index.js +0 -2
- package/dist/esm/plugins/base/plugin.js +0 -131
- package/dist/esm/plugins/base/pm-plugins/context-identifier.js +0 -48
- package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +0 -56
- package/dist/esm/plugins/base/pm-plugins/filter-steps.js +0 -27
- package/dist/esm/plugins/base/pm-plugins/fix-chrome-88-selection.js +0 -26
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +0 -251
- package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +0 -174
- package/dist/esm/plugins/base/pm-plugins/newline-preserve-marks.js +0 -26
- package/dist/esm/plugins/base/pm-plugins/scroll-gutter/index.js +0 -254
- package/dist/esm/plugins/base/pm-plugins/scroll-gutter/plugin-key.js +0 -7
- package/dist/esm/plugins/base/utils/frozen-editor.js +0 -4
- package/dist/esm/plugins/base/utils/input-latency-tracking.js +0 -128
- package/dist/esm/ui/Dropdown/index.js +0 -2
- package/dist/types/plugins/base/commands.d.ts +0 -2
- package/dist/types/plugins/base/index.d.ts +0 -5
- package/dist/types/plugins/base/plugin.d.ts +0 -25
- package/dist/types/plugins/base/pm-plugins/context-identifier.d.ts +0 -13
- package/dist/types/plugins/base/pm-plugins/disable-spell-checking.d.ts +0 -4
- package/dist/types/plugins/base/pm-plugins/filter-steps.d.ts +0 -4
- package/dist/types/plugins/base/pm-plugins/fix-chrome-88-selection.d.ts +0 -5
- package/dist/types/plugins/base/pm-plugins/frozen-editor.d.ts +0 -12
- package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +0 -17
- package/dist/types/plugins/base/pm-plugins/newline-preserve-marks.d.ts +0 -5
- package/dist/types/plugins/base/pm-plugins/scroll-gutter/index.d.ts +0 -22
- package/dist/types/plugins/base/pm-plugins/scroll-gutter/plugin-key.d.ts +0 -7
- package/dist/types/plugins/base/utils/frozen-editor.d.ts +0 -2
- package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +0 -42
- package/dist/types/ui/Dropdown/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/base/commands.d.ts +0 -2
- package/dist/types-ts4.5/plugins/base/index.d.ts +0 -5
- package/dist/types-ts4.5/plugins/base/plugin.d.ts +0 -27
- package/dist/types-ts4.5/plugins/base/pm-plugins/context-identifier.d.ts +0 -13
- package/dist/types-ts4.5/plugins/base/pm-plugins/disable-spell-checking.d.ts +0 -4
- package/dist/types-ts4.5/plugins/base/pm-plugins/filter-steps.d.ts +0 -4
- package/dist/types-ts4.5/plugins/base/pm-plugins/fix-chrome-88-selection.d.ts +0 -5
- package/dist/types-ts4.5/plugins/base/pm-plugins/frozen-editor.d.ts +0 -12
- package/dist/types-ts4.5/plugins/base/pm-plugins/inline-cursor-target.d.ts +0 -17
- package/dist/types-ts4.5/plugins/base/pm-plugins/newline-preserve-marks.d.ts +0 -5
- package/dist/types-ts4.5/plugins/base/pm-plugins/scroll-gutter/index.d.ts +0 -22
- package/dist/types-ts4.5/plugins/base/pm-plugins/scroll-gutter/plugin-key.d.ts +0 -7
- package/dist/types-ts4.5/plugins/base/utils/frozen-editor.d.ts +0 -2
- package/dist/types-ts4.5/plugins/base/utils/input-latency-tracking.d.ts +0 -42
- package/dist/types-ts4.5/ui/Dropdown/index.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.48.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`f8e7203eec6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f8e7203eec6) - ED-19618 Extract base plugin from editor-core
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`4e0f5ccf818`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e0f5ccf818) - ADFEXP-526: fix loading-adf test
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 187.47.9
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`36b7e4fd8d5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/36b7e4fd8d5) - ED-20017 Clean up unused functions in Dropdown
|
|
19
|
+
|
|
3
20
|
## 187.47.6
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -14,7 +14,7 @@ var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-contex
|
|
|
14
14
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
15
15
|
var _ufo = require("@atlaskit/editor-common/ufo");
|
|
16
16
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
17
|
-
var
|
|
17
|
+
var _editorPluginBase = require("@atlaskit/editor-plugin-base");
|
|
18
18
|
var _actions = _interopRequireDefault(require("../actions"));
|
|
19
19
|
var _featureFlagsFromProps = require("../create-editor/feature-flags-from-props");
|
|
20
20
|
var _versionWrapper = require("../version-wrapper");
|
|
@@ -113,7 +113,7 @@ EditorNext.propTypes = {
|
|
|
113
113
|
},
|
|
114
114
|
preset: function preset(_ref2) {
|
|
115
115
|
var _preset = _ref2.preset;
|
|
116
|
-
if (!_preset.has(
|
|
116
|
+
if (!_preset.has(_editorPluginBase.basePlugin)) {
|
|
117
117
|
return new Error('Presets must contain the base plugin');
|
|
118
118
|
}
|
|
119
119
|
return null;
|
package/dist/cjs/index.js
CHANGED
|
@@ -278,7 +278,7 @@ Object.defineProperty(exports, "insertDate", {
|
|
|
278
278
|
Object.defineProperty(exports, "insertExpand", {
|
|
279
279
|
enumerable: true,
|
|
280
280
|
get: function get() {
|
|
281
|
-
return
|
|
281
|
+
return _commands5.insertExpand;
|
|
282
282
|
}
|
|
283
283
|
});
|
|
284
284
|
Object.defineProperty(exports, "insertMediaSingleNode", {
|
|
@@ -350,19 +350,19 @@ Object.defineProperty(exports, "selectionPluginKey", {
|
|
|
350
350
|
Object.defineProperty(exports, "setIsExpanded", {
|
|
351
351
|
enumerable: true,
|
|
352
352
|
get: function get() {
|
|
353
|
-
return
|
|
353
|
+
return _commands4.setIsExpanded;
|
|
354
354
|
}
|
|
355
355
|
});
|
|
356
356
|
Object.defineProperty(exports, "setKeyboardHeight", {
|
|
357
357
|
enumerable: true,
|
|
358
358
|
get: function get() {
|
|
359
|
-
return
|
|
359
|
+
return _editorPluginBase.setKeyboardHeight;
|
|
360
360
|
}
|
|
361
361
|
});
|
|
362
362
|
Object.defineProperty(exports, "setMobilePaddingTop", {
|
|
363
363
|
enumerable: true,
|
|
364
364
|
get: function get() {
|
|
365
|
-
return
|
|
365
|
+
return _commands4.setMobilePaddingTop;
|
|
366
366
|
}
|
|
367
367
|
});
|
|
368
368
|
Object.defineProperty(exports, "setStatusPickerAt", {
|
|
@@ -462,8 +462,8 @@ var _actions2 = require("./plugins/status/actions");
|
|
|
462
462
|
var _typeAhead = require("./plugins/type-ahead");
|
|
463
463
|
var _history = require("./plugins/history");
|
|
464
464
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
465
|
-
var
|
|
466
|
-
var
|
|
465
|
+
var _editorPluginBase = require("@atlaskit/editor-plugin-base");
|
|
466
|
+
var _commands4 = require("./plugins/mobile-dimensions/commands");
|
|
467
467
|
var _utils = require("./utils");
|
|
468
468
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
469
469
|
var _createEditor = require("./create-editor");
|
|
@@ -471,7 +471,7 @@ var _actions3 = _interopRequireDefault(require("./actions"));
|
|
|
471
471
|
var _portalProvider = require("@atlaskit/editor-common/portal-provider");
|
|
472
472
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
473
473
|
var _mobileSelection = require("./plugins/mobile-selection");
|
|
474
|
-
var
|
|
474
|
+
var _commands5 = require("./plugins/expand/commands");
|
|
475
475
|
var _WithPluginState = _interopRequireDefault(require("./ui/WithPluginState"));
|
|
476
476
|
var _statusColorPalette = require("./ui/ColorPalette/Palettes/statusColorPalette");
|
|
477
477
|
var _common = require("./ui/ColorPalette/Palettes/common");
|
|
@@ -13,7 +13,7 @@ var _editorPluginHyperlink = require("@atlaskit/editor-plugin-hyperlink");
|
|
|
13
13
|
var _editorPluginTextFormatting = require("@atlaskit/editor-plugin-text-formatting");
|
|
14
14
|
var _editorPluginWidth = require("@atlaskit/editor-plugin-width");
|
|
15
15
|
var _editorPluginUnsupportedContent = require("@atlaskit/editor-plugin-unsupported-content");
|
|
16
|
-
var
|
|
16
|
+
var _editorPluginBase = require("@atlaskit/editor-plugin-base");
|
|
17
17
|
var _editorPluginFocus = require("@atlaskit/editor-plugin-focus");
|
|
18
18
|
var _editorPluginEditorDisabled = require("@atlaskit/editor-plugin-editor-disabled");
|
|
19
19
|
var _typeAhead = _interopRequireDefault(require("../../../plugins/type-ahead"));
|
|
@@ -63,7 +63,7 @@ function createDefaultPreset(options) {
|
|
|
63
63
|
}]);
|
|
64
64
|
}
|
|
65
65
|
return builder;
|
|
66
|
-
}).add([_paste.default, options.paste]).add(_clipboard.default).add(_editorPluginFocus.focusPlugin).add(_editorPluginComposition.compositionPlugin).add([
|
|
66
|
+
}).add([_paste.default, options.paste]).add(_clipboard.default).add(_editorPluginFocus.focusPlugin).add(_editorPluginComposition.compositionPlugin).add([_editorPluginBase.basePlugin, options.base]).add(_editorPluginDecorations.decorationsPlugin).maybeAdd(_undoRedo.default, function (p, builder) {
|
|
67
67
|
var _options$featureFlags;
|
|
68
68
|
// The undo redo plugin needs to be add before the blockTypePlugin
|
|
69
69
|
if ((_options$featureFlags = options.featureFlags) !== null && _options$featureFlags !== void 0 && _options$featureFlags.undoRedoButtons) {
|
|
@@ -23,8 +23,6 @@ var _styles = require("./styles");
|
|
|
23
23
|
var _styles2 = require("@atlaskit/editor-common/styles");
|
|
24
24
|
var _iconMap = require("./icon-map");
|
|
25
25
|
var _messages = require("./messages");
|
|
26
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
26
|
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); }; }
|
|
29
27
|
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; } } /** @jsx jsx */
|
|
30
28
|
var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
@@ -39,8 +37,7 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
39
37
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
40
38
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toolbarItemRef", /*#__PURE__*/_react.default.createRef());
|
|
41
39
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
42
|
-
isOpen: false
|
|
43
|
-
isOpenedByKeyboard: false
|
|
40
|
+
isOpen: false
|
|
44
41
|
});
|
|
45
42
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeAlignment", function (align, togglePopup) {
|
|
46
43
|
if (togglePopup) {
|
|
@@ -50,16 +47,14 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
50
47
|
});
|
|
51
48
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpen", function () {
|
|
52
49
|
_this.setState({
|
|
53
|
-
isOpen: !_this.state.isOpen
|
|
54
|
-
isOpenedByKeyboard: false
|
|
50
|
+
isOpen: !_this.state.isOpen
|
|
55
51
|
});
|
|
56
52
|
});
|
|
57
53
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpenByKeyboard", function (event) {
|
|
58
54
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
59
55
|
event.preventDefault();
|
|
60
56
|
_this.setState({
|
|
61
|
-
isOpen: !_this.state.isOpen
|
|
62
|
-
isOpenedByKeyboard: true
|
|
57
|
+
isOpen: !_this.state.isOpen
|
|
63
58
|
});
|
|
64
59
|
}
|
|
65
60
|
});
|
|
@@ -85,9 +80,7 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
85
80
|
key: "render",
|
|
86
81
|
value: function render() {
|
|
87
82
|
var _this2 = this;
|
|
88
|
-
var
|
|
89
|
-
isOpen = _this$state.isOpen,
|
|
90
|
-
isOpenedByKeyboard = _this$state.isOpenedByKeyboard;
|
|
83
|
+
var isOpen = this.state.isOpen;
|
|
91
84
|
var _this$props = this.props,
|
|
92
85
|
popupsMountPoint = _this$props.popupsMountPoint,
|
|
93
86
|
popupsBoundariesElement = _this$props.popupsBoundariesElement,
|
|
@@ -104,14 +97,6 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
104
97
|
boundariesElement: popupsBoundariesElement,
|
|
105
98
|
scrollableElement: popupsScrollableElement,
|
|
106
99
|
isOpen: isOpen,
|
|
107
|
-
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
108
|
-
if (isOpenedByKeyboard) {
|
|
109
|
-
_this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {
|
|
110
|
-
isOpenedByKeyboard: false
|
|
111
|
-
}));
|
|
112
|
-
}
|
|
113
|
-
return isOpenedByKeyboard;
|
|
114
|
-
},
|
|
115
100
|
onOpenChange: function onOpenChange(_ref) {
|
|
116
101
|
var isOpen = _ref.isOpen;
|
|
117
102
|
_this2.setState({
|
|
@@ -127,6 +112,9 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
127
112
|
}
|
|
128
113
|
},
|
|
129
114
|
handleEscapeKeydown: this.hideOnEscape,
|
|
115
|
+
arrowKeyNavigationProviderOptions: {
|
|
116
|
+
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
117
|
+
},
|
|
130
118
|
fitWidth: 112,
|
|
131
119
|
fitHeight: 80,
|
|
132
120
|
closeOnTab: true,
|
|
@@ -165,7 +153,7 @@ var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
165
153
|
key: "componentDidUpdate",
|
|
166
154
|
value: function componentDidUpdate(prevProps) {
|
|
167
155
|
var _this3 = this;
|
|
168
|
-
if (this.state.isOpen
|
|
156
|
+
if (this.state.isOpen) {
|
|
169
157
|
// by triggering the keyboard event with a setTimeout, we ensure that the tooltip
|
|
170
158
|
// associated with the alignment button doesn't render until the next render cycle
|
|
171
159
|
// where the popup will be correctly positioned and the relative position of the tooltip
|
|
@@ -120,7 +120,6 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
120
120
|
tooltip = _this$props2.tooltip,
|
|
121
121
|
buttonTestId = _this$props2.buttonTestId,
|
|
122
122
|
dropdownWidth = _this$props2.dropdownWidth,
|
|
123
|
-
editorView = _this$props2.editorView,
|
|
124
123
|
dropdownListId = _this$props2.dropdownListId,
|
|
125
124
|
alignDropdownWithToolbar = _this$props2.alignDropdownWithToolbar;
|
|
126
125
|
var trigger;
|
|
@@ -164,7 +163,6 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
164
163
|
var fitWidth = Array.isArray(options) ? dropdownWidth || _DropdownMenu.menuItemDimensions.width : options.width;
|
|
165
164
|
var fitHeight = Array.isArray(options) ? options.length * _DropdownMenu.menuItemDimensions.height + _DropdownMenu.itemSpacing * 2 : options.height;
|
|
166
165
|
return (0, _react2.jsx)(_uiMenu.DropdownContainer, {
|
|
167
|
-
ref: this.triggerRef,
|
|
168
166
|
mountTo: mountPoint,
|
|
169
167
|
boundariesElement: boundariesElement,
|
|
170
168
|
scrollableElement: scrollableElement,
|
|
@@ -175,9 +173,11 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
175
173
|
fitWidth: fitWidth + fitTolerance,
|
|
176
174
|
fitHeight: fitHeight + fitTolerance,
|
|
177
175
|
trigger: trigger,
|
|
178
|
-
editorView: editorView,
|
|
179
176
|
dropdownListId: dropdownListId,
|
|
180
|
-
alignDropdownWithParentElement: alignDropdownWithToolbar
|
|
177
|
+
alignDropdownWithParentElement: alignDropdownWithToolbar,
|
|
178
|
+
arrowKeyNavigationProviderOptions: {
|
|
179
|
+
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
180
|
+
}
|
|
181
181
|
}, Array.isArray(options) ? this.renderArrayOptions(options) : options.render({
|
|
182
182
|
hide: this.hide,
|
|
183
183
|
dispatchCommand: dispatchCommand
|
|
@@ -29,12 +29,6 @@ Object.defineProperty(exports, "avatarGroupPlugin", {
|
|
|
29
29
|
return _avatarGroup.default;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
Object.defineProperty(exports, "basePlugin", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function get() {
|
|
35
|
-
return _base.basePlugin;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
32
|
Object.defineProperty(exports, "beforePrimaryToolbarPlugin", {
|
|
39
33
|
enumerable: true,
|
|
40
34
|
get: function get() {
|
|
@@ -317,7 +311,6 @@ Object.defineProperty(exports, "viewUpdateSubscriptionPlugin", {
|
|
|
317
311
|
return _viewUpdateSubscription.default;
|
|
318
312
|
}
|
|
319
313
|
});
|
|
320
|
-
var _base = require("./base");
|
|
321
314
|
var _betterTypeHistory = _interopRequireDefault(require("./better-type-history"));
|
|
322
315
|
var _clearMarksOnChangeToEmptyDocument = _interopRequireDefault(require("./clear-marks-on-change-to-empty-document"));
|
|
323
316
|
var _codeBlock = _interopRequireDefault(require("./code-block"));
|
|
@@ -22,7 +22,6 @@ var _editorPalette = require("@atlaskit/editor-palette");
|
|
|
22
22
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
23
23
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
24
24
|
var _ColorPalette = _interopRequireWildcard(require("../../../../ui/ColorPalette"));
|
|
25
|
-
var _Dropdown = _interopRequireDefault(require("../../../../ui/Dropdown"));
|
|
26
25
|
var _styles = require("../../../../ui/styles");
|
|
27
26
|
var _styles2 = require("@atlaskit/editor-common/styles");
|
|
28
27
|
var _ToolbarButton = _interopRequireWildcard(require("../../../../ui/ToolbarButton"));
|
|
@@ -185,7 +184,7 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
185
184
|
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
186
185
|
return (0, _react2.jsx)("span", {
|
|
187
186
|
css: _styles2.wrapperStyle
|
|
188
|
-
}, (0, _react2.jsx)(
|
|
187
|
+
}, (0, _react2.jsx)(_uiMenu.DropdownContainer, {
|
|
189
188
|
mountTo: popupsMountPoint,
|
|
190
189
|
boundariesElement: popupsBoundariesElement,
|
|
191
190
|
scrollableElement: popupsScrollableElement,
|
package/dist/cjs/test-utils.js
CHANGED
|
@@ -39,7 +39,7 @@ var _preset = require("@atlaskit/editor-common/preset");
|
|
|
39
39
|
var _createSchema = require("./create-editor/create-schema");
|
|
40
40
|
var _sortByOrder = require("./create-editor/sort-by-order");
|
|
41
41
|
var _pluginKey = require("./plugins/analytics/plugin-key");
|
|
42
|
-
var
|
|
42
|
+
var _editorPluginBase = require("@atlaskit/editor-plugin-base");
|
|
43
43
|
var _api = require("./plugins/type-ahead/api");
|
|
44
44
|
var _eventDispatcher = require("./event-dispatcher");
|
|
45
45
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
@@ -104,7 +104,7 @@ var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
|
|
|
104
104
|
var inputPreset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new _preset.EditorPresetBuilder();
|
|
105
105
|
return function (pluginFactoryParams) {
|
|
106
106
|
var editorPlugins = [];
|
|
107
|
-
var preset = inputPreset.has(
|
|
107
|
+
var preset = inputPreset.has(_editorPluginBase.basePlugin) ? inputPreset : inputPreset.add(_editorPluginBase.basePlugin);
|
|
108
108
|
editorPlugins = preset.build({
|
|
109
109
|
pluginInjectionAPI: pluginFactoryParams.pluginInjectionAPI
|
|
110
110
|
});
|
|
@@ -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 = "187.
|
|
9
|
+
var version = "187.48.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -6,7 +6,7 @@ import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-con
|
|
|
6
6
|
import { ACTION, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
8
8
|
import { getAnalyticsAppearance, startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
|
|
9
|
-
import { basePlugin } from '
|
|
9
|
+
import { basePlugin } from '@atlaskit/editor-plugin-base';
|
|
10
10
|
import EditorActions from '../actions';
|
|
11
11
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
12
12
|
import { name, version } from '../version-wrapper';
|
package/dist/es2019/index.js
CHANGED
|
@@ -41,7 +41,7 @@ export { commitStatusPicker, setStatusPickerAt, updateStatus, updateStatusWithAn
|
|
|
41
41
|
export { typeAheadPluginKey } from './plugins/type-ahead';
|
|
42
42
|
export { historyPluginKey } from './plugins/history';
|
|
43
43
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
44
|
-
export { setKeyboardHeight } from '
|
|
44
|
+
export { setKeyboardHeight } from '@atlaskit/editor-plugin-base';
|
|
45
45
|
export { setMobilePaddingTop, setIsExpanded } from './plugins/mobile-dimensions/commands';
|
|
46
46
|
|
|
47
47
|
// Used in editor-test-helpers and mobile bridge
|
|
@@ -7,7 +7,7 @@ import { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
|
7
7
|
import { textFormattingPlugin } from '@atlaskit/editor-plugin-text-formatting';
|
|
8
8
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
9
9
|
import { unsupportedContentPlugin } from '@atlaskit/editor-plugin-unsupported-content';
|
|
10
|
-
import { basePlugin } from '
|
|
10
|
+
import { basePlugin } from '@atlaskit/editor-plugin-base';
|
|
11
11
|
import { focusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
12
12
|
import { editorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
13
13
|
import typeAheadPlugin from '../../../plugins/type-ahead';
|
|
@@ -5,7 +5,7 @@ import { jsx } from '@emotion/react';
|
|
|
5
5
|
import { injectIntl } from 'react-intl-next';
|
|
6
6
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
7
7
|
import ToolbarButton from '../../../../ui/ToolbarButton';
|
|
8
|
-
import { DropdownContainer as Dropdown } from '@atlaskit/editor-common/ui-menu';
|
|
8
|
+
import { ArrowKeyNavigationType, DropdownContainer as Dropdown } from '@atlaskit/editor-common/ui-menu';
|
|
9
9
|
import Alignment from '../../../../ui/Alignment';
|
|
10
10
|
import { expandIconWrapper, triggerWrapper, wrapper } from './styles';
|
|
11
11
|
import { separatorStyles } from '@atlaskit/editor-common/styles';
|
|
@@ -16,8 +16,7 @@ export class AlignmentToolbar extends React.Component {
|
|
|
16
16
|
super(...args);
|
|
17
17
|
_defineProperty(this, "toolbarItemRef", /*#__PURE__*/React.createRef());
|
|
18
18
|
_defineProperty(this, "state", {
|
|
19
|
-
isOpen: false
|
|
20
|
-
isOpenedByKeyboard: false
|
|
19
|
+
isOpen: false
|
|
21
20
|
});
|
|
22
21
|
_defineProperty(this, "changeAlignment", (align, togglePopup) => {
|
|
23
22
|
if (togglePopup) {
|
|
@@ -27,16 +26,14 @@ export class AlignmentToolbar extends React.Component {
|
|
|
27
26
|
});
|
|
28
27
|
_defineProperty(this, "toggleOpen", () => {
|
|
29
28
|
this.setState({
|
|
30
|
-
isOpen: !this.state.isOpen
|
|
31
|
-
isOpenedByKeyboard: false
|
|
29
|
+
isOpen: !this.state.isOpen
|
|
32
30
|
});
|
|
33
31
|
});
|
|
34
32
|
_defineProperty(this, "toggleOpenByKeyboard", event => {
|
|
35
33
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
36
34
|
event.preventDefault();
|
|
37
35
|
this.setState({
|
|
38
|
-
isOpen: !this.state.isOpen
|
|
39
|
-
isOpenedByKeyboard: true
|
|
36
|
+
isOpen: !this.state.isOpen
|
|
40
37
|
});
|
|
41
38
|
}
|
|
42
39
|
});
|
|
@@ -59,8 +56,7 @@ export class AlignmentToolbar extends React.Component {
|
|
|
59
56
|
}
|
|
60
57
|
render() {
|
|
61
58
|
const {
|
|
62
|
-
isOpen
|
|
63
|
-
isOpenedByKeyboard
|
|
59
|
+
isOpen
|
|
64
60
|
} = this.state;
|
|
65
61
|
const {
|
|
66
62
|
popupsMountPoint,
|
|
@@ -79,15 +75,6 @@ export class AlignmentToolbar extends React.Component {
|
|
|
79
75
|
boundariesElement: popupsBoundariesElement,
|
|
80
76
|
scrollableElement: popupsScrollableElement,
|
|
81
77
|
isOpen: isOpen,
|
|
82
|
-
shouldFocusFirstItem: () => {
|
|
83
|
-
if (isOpenedByKeyboard) {
|
|
84
|
-
this.setState({
|
|
85
|
-
...this.state,
|
|
86
|
-
isOpenedByKeyboard: false
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return isOpenedByKeyboard;
|
|
90
|
-
},
|
|
91
78
|
onOpenChange: ({
|
|
92
79
|
isOpen
|
|
93
80
|
}) => {
|
|
@@ -104,6 +91,9 @@ export class AlignmentToolbar extends React.Component {
|
|
|
104
91
|
}
|
|
105
92
|
},
|
|
106
93
|
handleEscapeKeydown: this.hideOnEscape,
|
|
94
|
+
arrowKeyNavigationProviderOptions: {
|
|
95
|
+
type: ArrowKeyNavigationType.MENU
|
|
96
|
+
},
|
|
107
97
|
fitWidth: 112,
|
|
108
98
|
fitHeight: 80,
|
|
109
99
|
closeOnTab: true,
|
|
@@ -137,7 +127,7 @@ export class AlignmentToolbar extends React.Component {
|
|
|
137
127
|
}));
|
|
138
128
|
}
|
|
139
129
|
componentDidUpdate(prevProps) {
|
|
140
|
-
if (this.state.isOpen
|
|
130
|
+
if (this.state.isOpen) {
|
|
141
131
|
// by triggering the keyboard event with a setTimeout, we ensure that the tooltip
|
|
142
132
|
// associated with the alignment button doesn't render until the next render cycle
|
|
143
133
|
// where the popup will be correctly positioned and the relative position of the tooltip
|
|
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
import React, { Component } from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
7
|
-
import { DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
7
|
+
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
8
8
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import DropdownMenu, { itemSpacing, menuItemDimensions } from './DropdownMenu';
|
|
10
10
|
const dropdownExpandContainer = css`
|
|
@@ -96,7 +96,6 @@ export default class Dropdown extends Component {
|
|
|
96
96
|
tooltip,
|
|
97
97
|
buttonTestId,
|
|
98
98
|
dropdownWidth,
|
|
99
|
-
editorView,
|
|
100
99
|
dropdownListId,
|
|
101
100
|
alignDropdownWithToolbar
|
|
102
101
|
} = this.props;
|
|
@@ -141,7 +140,6 @@ export default class Dropdown extends Component {
|
|
|
141
140
|
const fitWidth = Array.isArray(options) ? dropdownWidth || menuItemDimensions.width : options.width;
|
|
142
141
|
const fitHeight = Array.isArray(options) ? options.length * menuItemDimensions.height + itemSpacing * 2 : options.height;
|
|
143
142
|
return jsx(UiDropdown, {
|
|
144
|
-
ref: this.triggerRef,
|
|
145
143
|
mountTo: mountPoint,
|
|
146
144
|
boundariesElement: boundariesElement,
|
|
147
145
|
scrollableElement: scrollableElement,
|
|
@@ -152,9 +150,11 @@ export default class Dropdown extends Component {
|
|
|
152
150
|
fitWidth: fitWidth + fitTolerance,
|
|
153
151
|
fitHeight: fitHeight + fitTolerance,
|
|
154
152
|
trigger: trigger,
|
|
155
|
-
editorView: editorView,
|
|
156
153
|
dropdownListId: dropdownListId,
|
|
157
|
-
alignDropdownWithParentElement: alignDropdownWithToolbar
|
|
154
|
+
alignDropdownWithParentElement: alignDropdownWithToolbar,
|
|
155
|
+
arrowKeyNavigationProviderOptions: {
|
|
156
|
+
type: ArrowKeyNavigationType.MENU
|
|
157
|
+
}
|
|
158
158
|
}, Array.isArray(options) ? this.renderArrayOptions(options) : options.render({
|
|
159
159
|
hide: this.hide,
|
|
160
160
|
dispatchCommand
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { basePlugin } from './base';
|
|
2
1
|
export { default as betterTypeHistoryPlugin } from './better-type-history';
|
|
3
2
|
export { default as clearMarksOnChangeToEmptyDocumentPlugin } from './clear-marks-on-change-to-empty-document';
|
|
4
3
|
export { default as codeBlockPlugin } from './code-block';
|
|
@@ -9,7 +9,7 @@ import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
|
|
9
9
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
11
11
|
import ColorPalette, { textPaletteTooltipMessages } from '../../../../ui/ColorPalette';
|
|
12
|
-
import Dropdown from '
|
|
12
|
+
import { DropdownContainer as Dropdown } from '@atlaskit/editor-common/ui-menu';
|
|
13
13
|
import { expandIconWrapperStyle } from '../../../../ui/styles';
|
|
14
14
|
import { wrapperStyle, separatorStyles, triggerWrapperStyles } from '@atlaskit/editor-common/styles';
|
|
15
15
|
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
|
|
@@ -3,7 +3,7 @@ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
|
3
3
|
import { createSchema } from './create-editor/create-schema';
|
|
4
4
|
import { sortByOrder } from './create-editor/sort-by-order';
|
|
5
5
|
import { analyticsPluginKey } from './plugins/analytics/plugin-key';
|
|
6
|
-
import { basePlugin } from '
|
|
6
|
+
import { basePlugin } from '@atlaskit/editor-plugin-base';
|
|
7
7
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
8
8
|
export function getFireAnalytics(editorView) {
|
|
9
9
|
var _analyticsPluginKey$g;
|
|
@@ -9,7 +9,7 @@ import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-con
|
|
|
9
9
|
import { ACTION, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
11
11
|
import { getAnalyticsAppearance, startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
|
|
12
|
-
import { basePlugin } from '
|
|
12
|
+
import { basePlugin } from '@atlaskit/editor-plugin-base';
|
|
13
13
|
import EditorActions from '../actions';
|
|
14
14
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
15
15
|
import { name, version } from '../version-wrapper';
|
package/dist/esm/index.js
CHANGED
|
@@ -41,7 +41,7 @@ export { commitStatusPicker, setStatusPickerAt, updateStatus, updateStatusWithAn
|
|
|
41
41
|
export { typeAheadPluginKey } from './plugins/type-ahead';
|
|
42
42
|
export { historyPluginKey } from './plugins/history';
|
|
43
43
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
44
|
-
export { setKeyboardHeight } from '
|
|
44
|
+
export { setKeyboardHeight } from '@atlaskit/editor-plugin-base';
|
|
45
45
|
export { setMobilePaddingTop, setIsExpanded } from './plugins/mobile-dimensions/commands';
|
|
46
46
|
|
|
47
47
|
// Used in editor-test-helpers and mobile bridge
|
|
@@ -7,7 +7,7 @@ import { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
|
7
7
|
import { textFormattingPlugin } from '@atlaskit/editor-plugin-text-formatting';
|
|
8
8
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
9
9
|
import { unsupportedContentPlugin } from '@atlaskit/editor-plugin-unsupported-content';
|
|
10
|
-
import { basePlugin } from '
|
|
10
|
+
import { basePlugin } from '@atlaskit/editor-plugin-base';
|
|
11
11
|
import { focusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
12
12
|
import { editorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
13
13
|
import typeAheadPlugin from '../../../plugins/type-ahead';
|
|
@@ -5,8 +5,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
9
|
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; } }
|
|
12
10
|
/** @jsx jsx */
|
|
@@ -15,7 +13,7 @@ import { jsx } from '@emotion/react';
|
|
|
15
13
|
import { injectIntl } from 'react-intl-next';
|
|
16
14
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
17
15
|
import ToolbarButton from '../../../../ui/ToolbarButton';
|
|
18
|
-
import { DropdownContainer as Dropdown } from '@atlaskit/editor-common/ui-menu';
|
|
16
|
+
import { ArrowKeyNavigationType, DropdownContainer as Dropdown } from '@atlaskit/editor-common/ui-menu';
|
|
19
17
|
import Alignment from '../../../../ui/Alignment';
|
|
20
18
|
import { expandIconWrapper, triggerWrapper, wrapper } from './styles';
|
|
21
19
|
import { separatorStyles } from '@atlaskit/editor-common/styles';
|
|
@@ -33,8 +31,7 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
33
31
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
34
32
|
_defineProperty(_assertThisInitialized(_this), "toolbarItemRef", /*#__PURE__*/React.createRef());
|
|
35
33
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
36
|
-
isOpen: false
|
|
37
|
-
isOpenedByKeyboard: false
|
|
34
|
+
isOpen: false
|
|
38
35
|
});
|
|
39
36
|
_defineProperty(_assertThisInitialized(_this), "changeAlignment", function (align, togglePopup) {
|
|
40
37
|
if (togglePopup) {
|
|
@@ -44,16 +41,14 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
44
41
|
});
|
|
45
42
|
_defineProperty(_assertThisInitialized(_this), "toggleOpen", function () {
|
|
46
43
|
_this.setState({
|
|
47
|
-
isOpen: !_this.state.isOpen
|
|
48
|
-
isOpenedByKeyboard: false
|
|
44
|
+
isOpen: !_this.state.isOpen
|
|
49
45
|
});
|
|
50
46
|
});
|
|
51
47
|
_defineProperty(_assertThisInitialized(_this), "toggleOpenByKeyboard", function (event) {
|
|
52
48
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
53
49
|
event.preventDefault();
|
|
54
50
|
_this.setState({
|
|
55
|
-
isOpen: !_this.state.isOpen
|
|
56
|
-
isOpenedByKeyboard: true
|
|
51
|
+
isOpen: !_this.state.isOpen
|
|
57
52
|
});
|
|
58
53
|
}
|
|
59
54
|
});
|
|
@@ -79,9 +74,7 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
79
74
|
key: "render",
|
|
80
75
|
value: function render() {
|
|
81
76
|
var _this2 = this;
|
|
82
|
-
var
|
|
83
|
-
isOpen = _this$state.isOpen,
|
|
84
|
-
isOpenedByKeyboard = _this$state.isOpenedByKeyboard;
|
|
77
|
+
var isOpen = this.state.isOpen;
|
|
85
78
|
var _this$props = this.props,
|
|
86
79
|
popupsMountPoint = _this$props.popupsMountPoint,
|
|
87
80
|
popupsBoundariesElement = _this$props.popupsBoundariesElement,
|
|
@@ -98,14 +91,6 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
98
91
|
boundariesElement: popupsBoundariesElement,
|
|
99
92
|
scrollableElement: popupsScrollableElement,
|
|
100
93
|
isOpen: isOpen,
|
|
101
|
-
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
102
|
-
if (isOpenedByKeyboard) {
|
|
103
|
-
_this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {
|
|
104
|
-
isOpenedByKeyboard: false
|
|
105
|
-
}));
|
|
106
|
-
}
|
|
107
|
-
return isOpenedByKeyboard;
|
|
108
|
-
},
|
|
109
94
|
onOpenChange: function onOpenChange(_ref) {
|
|
110
95
|
var isOpen = _ref.isOpen;
|
|
111
96
|
_this2.setState({
|
|
@@ -121,6 +106,9 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
121
106
|
}
|
|
122
107
|
},
|
|
123
108
|
handleEscapeKeydown: this.hideOnEscape,
|
|
109
|
+
arrowKeyNavigationProviderOptions: {
|
|
110
|
+
type: ArrowKeyNavigationType.MENU
|
|
111
|
+
},
|
|
124
112
|
fitWidth: 112,
|
|
125
113
|
fitHeight: 80,
|
|
126
114
|
closeOnTab: true,
|
|
@@ -159,7 +147,7 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
159
147
|
key: "componentDidUpdate",
|
|
160
148
|
value: function componentDidUpdate(prevProps) {
|
|
161
149
|
var _this3 = this;
|
|
162
|
-
if (this.state.isOpen
|
|
150
|
+
if (this.state.isOpen) {
|
|
163
151
|
// by triggering the keyboard event with a setTimeout, we ensure that the tooltip
|
|
164
152
|
// associated with the alignment button doesn't render until the next render cycle
|
|
165
153
|
// where the popup will be correctly positioned and the relative position of the tooltip
|