@atlaskit/editor-plugin-floating-toolbar 28.0.4 → 28.0.5
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 +6 -0
- package/dist/cjs/floatingToolbarPlugin.js +22 -22
- package/dist/cjs/pm-plugins/toolbar-data/plugin-factory.js +2 -2
- package/dist/cjs/ui/CheckboxModal.js +5 -5
- package/dist/cjs/ui/Dropdown.js +7 -6
- package/dist/cjs/ui/DropdownMenu.js +5 -4
- package/dist/cjs/ui/EmojiPickerButton.js +6 -5
- package/dist/cjs/ui/ExtensionsPlaceholder.js +11 -10
- package/dist/cjs/ui/Input.js +2 -2
- package/dist/cjs/ui/ScrollButton.js +2 -2
- package/dist/cjs/ui/ScrollButtons.js +8 -8
- package/dist/cjs/ui/SimpleModal.js +4 -4
- package/dist/cjs/ui/Toolbar.js +20 -16
- package/dist/es2019/floatingToolbarPlugin.js +5 -7
- package/dist/es2019/pm-plugins/toolbar-data/plugin-factory.js +1 -1
- package/dist/es2019/ui/CheckboxModal.js +1 -1
- package/dist/es2019/ui/Dropdown.js +3 -2
- package/dist/es2019/ui/DropdownMenu.js +2 -1
- package/dist/es2019/ui/EmojiPickerButton.js +4 -3
- package/dist/es2019/ui/ExtensionsPlaceholder.js +4 -3
- package/dist/es2019/ui/Input.js +1 -1
- package/dist/es2019/ui/ScrollButton.js +1 -1
- package/dist/es2019/ui/ScrollButtons.js +2 -2
- package/dist/es2019/ui/SimpleModal.js +1 -1
- package/dist/es2019/ui/Toolbar.js +9 -5
- package/dist/esm/floatingToolbarPlugin.js +5 -7
- package/dist/esm/pm-plugins/toolbar-data/plugin-factory.js +1 -1
- package/dist/esm/ui/CheckboxModal.js +1 -1
- package/dist/esm/ui/Dropdown.js +3 -2
- package/dist/esm/ui/DropdownMenu.js +2 -1
- package/dist/esm/ui/EmojiPickerButton.js +4 -3
- package/dist/esm/ui/ExtensionsPlaceholder.js +4 -3
- package/dist/esm/ui/Input.js +1 -1
- package/dist/esm/ui/ScrollButton.js +1 -1
- package/dist/esm/ui/ScrollButtons.js +2 -2
- package/dist/esm/ui/SimpleModal.js +1 -1
- package/dist/esm/ui/Toolbar.js +9 -5
- package/dist/types/floatingToolbarPlugin.d.ts +4 -2
- package/dist/types/floatingToolbarPluginType.d.ts +15 -14
- package/dist/types/pm-plugins/commands.d.ts +2 -1
- package/dist/types/pm-plugins/toolbar-data/commands.d.ts +1 -1
- package/dist/types/pm-plugins/toolbar-data/plugin-factory.d.ts +1 -1
- package/dist/types/ui/CheckboxModal.d.ts +1 -1
- package/dist/types/ui/ConfirmationModal.d.ts +1 -1
- package/dist/types/ui/Dropdown.d.ts +2 -1
- package/dist/types/ui/DropdownMenu.d.ts +3 -2
- package/dist/types/ui/EmojiPickerButton.d.ts +2 -2
- package/dist/types/ui/ExtensionsPlaceholder.d.ts +3 -2
- package/dist/types/ui/Select.d.ts +1 -1
- package/dist/types/ui/SimpleModal.d.ts +1 -1
- package/dist/types/ui/Toolbar.d.ts +4 -4
- package/dist/types/ui/utils/index.d.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -13,14 +13,14 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
13
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
|
|
16
|
-
var
|
|
17
|
-
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
16
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
18
17
|
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
19
|
-
var
|
|
20
|
-
var
|
|
18
|
+
var _isSsr = require("@atlaskit/editor-common/is-ssr");
|
|
19
|
+
var _Popup = _interopRequireDefault(require("@atlaskit/editor-common/Popup"));
|
|
20
|
+
var _withProviders = require("@atlaskit/editor-common/provider-factory/with-providers");
|
|
21
21
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
22
22
|
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
23
|
-
var
|
|
23
|
+
var _useSharedPluginState2 = require("@atlaskit/editor-common/useSharedPluginState");
|
|
24
24
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
25
25
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
26
26
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
@@ -119,11 +119,11 @@ var getDomRefFromSelection = function getDomRefFromSelection(view, dispatchAnaly
|
|
|
119
119
|
console.warn(error);
|
|
120
120
|
if (dispatchAnalyticsEvent) {
|
|
121
121
|
var payload = {
|
|
122
|
-
action:
|
|
123
|
-
actionSubject:
|
|
124
|
-
eventType:
|
|
122
|
+
action: _enums.ACTION.ERRORED,
|
|
123
|
+
actionSubject: _enums.ACTION_SUBJECT.CONTENT_COMPONENT,
|
|
124
|
+
eventType: _enums.EVENT_TYPE.OPERATIONAL,
|
|
125
125
|
attributes: {
|
|
126
|
-
component:
|
|
126
|
+
component: _enums.CONTENT_COMPONENT.FLOATING_TOOLBAR,
|
|
127
127
|
selection: view.state.selection.toJSON(),
|
|
128
128
|
position: view.state.selection.from,
|
|
129
129
|
docSize: view.state.doc.nodeSize,
|
|
@@ -243,7 +243,7 @@ function ContentComponent(_ref5) {
|
|
|
243
243
|
popupsScrollableElement = _ref5.popupsScrollableElement,
|
|
244
244
|
providerFactory = _ref5.providerFactory,
|
|
245
245
|
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
246
|
-
var _useSharedPluginState = (0,
|
|
246
|
+
var _useSharedPluginState = (0, _useSharedPluginState2.useSharedPluginState)(pluginInjectionApi, ['floatingToolbar', 'editorDisabled', 'editorViewMode', 'userIntent']),
|
|
247
247
|
floatingToolbarState = _useSharedPluginState.floatingToolbarState,
|
|
248
248
|
editorDisabledState = _useSharedPluginState.editorDisabledState,
|
|
249
249
|
editorViewModeState = _useSharedPluginState.editorViewModeState,
|
|
@@ -259,7 +259,7 @@ function ContentComponent(_ref5) {
|
|
|
259
259
|
// for example, trigger remix on panel will not hide the floating toolbar
|
|
260
260
|
configWithNodeInfo = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 || (_pluginInjectionApi$f = _pluginInjectionApi$f.sharedState.currentState()) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.configWithNodeInfo;
|
|
261
261
|
}
|
|
262
|
-
if ((0,
|
|
262
|
+
if ((0, _isSsr.isSSR)()) {
|
|
263
263
|
return null;
|
|
264
264
|
}
|
|
265
265
|
if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
|
|
@@ -374,10 +374,10 @@ function ContentComponent(_ref5) {
|
|
|
374
374
|
var _pluginInjectionApi$e;
|
|
375
375
|
var editorContentMode = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.mode;
|
|
376
376
|
dispatchAnalyticsEvent({
|
|
377
|
-
action:
|
|
378
|
-
actionSubject:
|
|
379
|
-
actionSubjectId:
|
|
380
|
-
eventType:
|
|
377
|
+
action: _enums.ACTION.CLICKED,
|
|
378
|
+
actionSubject: _enums.ACTION_SUBJECT.BUTTON,
|
|
379
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.FLOATING_TOOLBAR_OVERFLOW,
|
|
380
|
+
eventType: _enums.EVENT_TYPE.UI,
|
|
381
381
|
attributes: {
|
|
382
382
|
editorContentMode: editorContentMode
|
|
383
383
|
}
|
|
@@ -421,11 +421,11 @@ function ContentComponent(_ref5) {
|
|
|
421
421
|
var scrollable = config.scrollable;
|
|
422
422
|
var confirmDialogOptions = typeof ((_confirmButtonItem = confirmButtonItem) === null || _confirmButtonItem === void 0 ? void 0 : _confirmButtonItem.confirmDialog) === 'function' ? (_confirmButtonItem2 = confirmButtonItem) === null || _confirmButtonItem2 === void 0 ? void 0 : _confirmButtonItem2.confirmDialog() : (_confirmButtonItem3 = confirmButtonItem) === null || _confirmButtonItem3 === void 0 ? void 0 : _confirmButtonItem3.confirmDialog;
|
|
423
423
|
return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
|
|
424
|
-
component:
|
|
424
|
+
component: _enums.ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
|
|
425
425
|
componentId: (0, _camelCase.default)(title),
|
|
426
426
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
427
427
|
fallbackComponent: null
|
|
428
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
428
|
+
}, /*#__PURE__*/_react.default.createElement(_Popup.default, {
|
|
429
429
|
ariaLabel: title,
|
|
430
430
|
role: 'toolbar',
|
|
431
431
|
offset: offset,
|
|
@@ -449,7 +449,7 @@ function ContentComponent(_ref5) {
|
|
|
449
449
|
} : {},
|
|
450
450
|
focusTrap: focusTrap,
|
|
451
451
|
preventOverflow: preventPopupOverflow
|
|
452
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
452
|
+
}, /*#__PURE__*/_react.default.createElement(_withProviders.WithProviders, {
|
|
453
453
|
providerFactory: providerFactory
|
|
454
454
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
455
455
|
,
|
|
@@ -607,10 +607,10 @@ function floatingToolbarPluginFactory(options) {
|
|
|
607
607
|
if (pluginState !== null && pluginState !== void 0 && pluginState.suppressedToolbar && !(prevPluginState !== null && prevPluginState !== void 0 && prevPluginState.suppressedToolbar)) {
|
|
608
608
|
var _api$analytics2;
|
|
609
609
|
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || (_api$analytics2 = _api$analytics2.actions) === null || _api$analytics2 === void 0 || _api$analytics2.fireAnalyticsEvent({
|
|
610
|
-
action:
|
|
611
|
-
actionSubject:
|
|
612
|
-
actionSubjectId:
|
|
613
|
-
eventType:
|
|
610
|
+
action: _enums.ACTION.SUPPRESSED,
|
|
611
|
+
actionSubject: _enums.ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
|
|
612
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.FLOATING_TOOLBAR,
|
|
613
|
+
eventType: _enums.EVENT_TYPE.TRACK
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
616
|
}
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getPluginState = exports.createPluginState = exports.createCommand = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _pluginStateFactory = require("@atlaskit/editor-common/utils/plugin-state-factory");
|
|
8
8
|
var _pluginKey = require("./plugin-key");
|
|
9
9
|
var _reducer = require("./reducer");
|
|
10
|
-
var dest = (0,
|
|
10
|
+
var dest = (0, _pluginStateFactory.pluginFactory)(_pluginKey.pluginKey, _reducer.reducer);
|
|
11
11
|
var createPluginState = exports.createPluginState = dest.createPluginState;
|
|
12
12
|
var createCommand = exports.createCommand = dest.createCommand;
|
|
13
13
|
var getPluginState = exports.getPluginState = dest.getPluginState;
|
|
@@ -11,7 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _button = _interopRequireDefault(require("@atlaskit/button/default/button"));
|
|
13
13
|
var _checkbox = require("@atlaskit/checkbox/checkbox");
|
|
14
|
-
var
|
|
14
|
+
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/floating-toolbar/messages"));
|
|
15
15
|
var _modalBody = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-body"));
|
|
16
16
|
var _modalDialog = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-dialog"));
|
|
17
17
|
var _modalFooter = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-footer"));
|
|
@@ -30,9 +30,9 @@ var CheckboxModal = exports.CheckboxModal = function CheckboxModal(props) {
|
|
|
30
30
|
options = props.options,
|
|
31
31
|
formatMessage = props.intl.formatMessage,
|
|
32
32
|
testId = props.testId;
|
|
33
|
-
var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(
|
|
34
|
-
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(
|
|
35
|
-
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(
|
|
33
|
+
var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(_messages.default.confirmModalDefaultHeading);
|
|
34
|
+
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(_messages.default.confirmModalOK);
|
|
35
|
+
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(_messages.default.confirmModalCancel);
|
|
36
36
|
var checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
|
|
37
37
|
var childrenInfo = options === null || options === void 0 || (_options$getChildrenI = options.getChildrenInfo) === null || _options$getChildrenI === void 0 ? void 0 : _options$getChildrenI.call(options);
|
|
38
38
|
var ListComponent = function ListComponent(_ref) {
|
|
@@ -57,7 +57,7 @@ var CheckboxModal = exports.CheckboxModal = function CheckboxModal(props) {
|
|
|
57
57
|
amount = props.amount;
|
|
58
58
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
59
59
|
id: id
|
|
60
|
-
}, formatMessage(
|
|
60
|
+
}, formatMessage(_messages.default.confirmModalListUnit, {
|
|
61
61
|
name: name,
|
|
62
62
|
amount: amount
|
|
63
63
|
}));
|
package/dist/cjs/ui/Dropdown.js
CHANGED
|
@@ -14,8 +14,9 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
|
-
var
|
|
18
|
-
var
|
|
17
|
+
var _Button = _interopRequireDefault(require("@atlaskit/editor-common/FloatingToolbar/Button"));
|
|
18
|
+
var _types = require("@atlaskit/editor-common/ui-menu/ArrowKeyNavigationProvider/types");
|
|
19
|
+
var _DropdownContainer = require("@atlaskit/editor-common/ui-menu/DropdownContainer");
|
|
19
20
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
20
21
|
var _Divider = require("./Divider");
|
|
21
22
|
var _DropdownMenu = _interopRequireWildcard(require("./DropdownMenu"));
|
|
@@ -162,7 +163,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
162
163
|
var TriggerIcon = hideExpandIcon ? icon : (0, _react2.jsx)(CompositeIcon, {
|
|
163
164
|
icon: icon
|
|
164
165
|
});
|
|
165
|
-
trigger = (0, _react2.jsx)(
|
|
166
|
+
trigger = (0, _react2.jsx)(_Button.default, {
|
|
166
167
|
testId: buttonTestId,
|
|
167
168
|
title: title,
|
|
168
169
|
icon: TriggerIcon,
|
|
@@ -177,7 +178,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
177
178
|
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
178
179
|
});
|
|
179
180
|
} else {
|
|
180
|
-
trigger = (0, _react2.jsx)(
|
|
181
|
+
trigger = (0, _react2.jsx)(_Button.default, {
|
|
181
182
|
testId: buttonTestId,
|
|
182
183
|
iconAfter: (0, _react2.jsx)("span", {
|
|
183
184
|
css: dropdownExpandContainer
|
|
@@ -215,7 +216,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
215
216
|
* Refer to the PR for more details:
|
|
216
217
|
* https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/137394/overview?commentId=8130003
|
|
217
218
|
*/
|
|
218
|
-
(0, _react2.jsx)(
|
|
219
|
+
(0, _react2.jsx)(_DropdownContainer.DropdownContainer, {
|
|
219
220
|
alignX: alignX,
|
|
220
221
|
mountTo: mountPoint,
|
|
221
222
|
boundariesElement: boundariesElement,
|
|
@@ -232,7 +233,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
232
233
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
233
234
|
,
|
|
234
235
|
arrowKeyNavigationProviderOptions: {
|
|
235
|
-
type:
|
|
236
|
+
type: _types.ArrowKeyNavigationType.MENU
|
|
236
237
|
},
|
|
237
238
|
shouldFitContainer: shouldFitContainer
|
|
238
239
|
}, Array.isArray(options) ? this.renderArrayOptions(options) : typeof options === 'function' ? this.renderArrayOptions(this.makeArrayOptionsFromCallback(options)) : options.render({
|
|
@@ -8,7 +8,8 @@ exports.menuItemDimensions = exports.itemSpacing = exports.default = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _reactIntl = require("react-intl");
|
|
11
|
-
var
|
|
11
|
+
var _DropdownMenuItem = require("@atlaskit/editor-common/DropdownMenuItem");
|
|
12
|
+
var _DropdownSeparator = require("@atlaskit/editor-common/DropdownSeparator");
|
|
12
13
|
var _headingItem = _interopRequireDefault(require("@atlaskit/menu/heading-item"));
|
|
13
14
|
/**
|
|
14
15
|
* @jsxRuntime classic
|
|
@@ -65,7 +66,7 @@ var Dropdown = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
65
66
|
return item && (!('hidden' in item) || !item.hidden);
|
|
66
67
|
}).map(function (item, idx) {
|
|
67
68
|
if (!('type' in item)) {
|
|
68
|
-
return (0, _react2.jsx)(
|
|
69
|
+
return (0, _react2.jsx)(_DropdownMenuItem.DropdownMenuItem
|
|
69
70
|
// Ignored via go/ees005
|
|
70
71
|
// eslint-disable-next-line react/no-array-index-key
|
|
71
72
|
, {
|
|
@@ -80,7 +81,7 @@ var Dropdown = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
80
81
|
}
|
|
81
82
|
if (item.type === 'separator') {
|
|
82
83
|
// eslint-disable-next-line react/no-array-index-key
|
|
83
|
-
return (0, _react2.jsx)(
|
|
84
|
+
return (0, _react2.jsx)(_DropdownSeparator.DropdownSeparator, {
|
|
84
85
|
key: idx
|
|
85
86
|
});
|
|
86
87
|
}
|
|
@@ -108,7 +109,7 @@ var Dropdown = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
108
109
|
}, items.filter(function (item) {
|
|
109
110
|
return !item.hidden;
|
|
110
111
|
}).map(function (item, idx) {
|
|
111
|
-
return (0, _react2.jsx)(
|
|
112
|
+
return (0, _react2.jsx)(_DropdownMenuItem.DropdownMenuItem
|
|
112
113
|
// Ignored via go/ees005
|
|
113
114
|
// eslint-disable-next-line react/no-array-index-key
|
|
114
115
|
, {
|
|
@@ -10,9 +10,10 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _button = _interopRequireDefault(require("@atlaskit/button/icon/button"));
|
|
13
|
-
var
|
|
14
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
|
+
var _Popup = _interopRequireDefault(require("@atlaskit/editor-common/Popup"));
|
|
15
14
|
var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
15
|
+
var _withReactEditorViewOuterListeners = _interopRequireDefault(require("@atlaskit/editor-common/ui-react/with-react-editor-view-outer-listeners"));
|
|
16
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
16
17
|
var _emoji = require("@atlaskit/emoji");
|
|
17
18
|
var _emojiAdd = _interopRequireDefault(require("@atlaskit/icon/core/emoji-add"));
|
|
18
19
|
var _Tooltip = _interopRequireDefault(require("@atlaskit/tooltip/Tooltip"));
|
|
@@ -40,7 +41,7 @@ var selector = function selector(states) {
|
|
|
40
41
|
return (_states$emojiState = states.emojiState) === null || _states$emojiState === void 0 ? void 0 : _states$emojiState.emojiProvider;
|
|
41
42
|
};
|
|
42
43
|
var EmojiPickerWithProvider = function EmojiPickerWithProvider(props) {
|
|
43
|
-
var emojiProvider = (0,
|
|
44
|
+
var emojiProvider = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(props.pluginInjectionApi, ['emoji'], selector);
|
|
44
45
|
var setOutsideClickTargetRef = (0, _react.useContext)(_uiReact.OutsideClickTargetRefContext);
|
|
45
46
|
if (!emojiProvider) {
|
|
46
47
|
return null;
|
|
@@ -57,7 +58,7 @@ var EmojiPickerWithProvider = function EmojiPickerWithProvider(props) {
|
|
|
57
58
|
// written down.
|
|
58
59
|
var EMOJI_PICKER_MAX_HEIGHT = 431;
|
|
59
60
|
var EMOJI_PICKER_MAX_WIDTH = 352;
|
|
60
|
-
var EmojiPickerWithListener = (0,
|
|
61
|
+
var EmojiPickerWithListener = (0, _withReactEditorViewOuterListeners.default)(EmojiPickerWithProvider);
|
|
61
62
|
var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(props) {
|
|
62
63
|
var buttonRef = _react.default.useRef(null);
|
|
63
64
|
var _React$useState = _react.default.useState(false),
|
|
@@ -104,7 +105,7 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
104
105
|
if (!buttonRef.current || !isPopupOpen) {
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
|
-
return (0, _react2.jsx)(
|
|
108
|
+
return (0, _react2.jsx)(_Popup.default, {
|
|
108
109
|
target: buttonRef.current
|
|
109
110
|
// Ignored via go/ees005
|
|
110
111
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -13,10 +13,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
14
14
|
var _reactLooselyLazy = require("react-loosely-lazy");
|
|
15
15
|
var _buttonGroup = _interopRequireDefault(require("@atlaskit/button/button-group"));
|
|
16
|
-
var
|
|
16
|
+
var _moduleHelpers = require("@atlaskit/editor-common/extensions/module-helpers");
|
|
17
|
+
var _Button = _interopRequireDefault(require("@atlaskit/editor-common/FloatingToolbar/Button"));
|
|
18
|
+
var _Separator = _interopRequireDefault(require("@atlaskit/editor-common/FloatingToolbar/Separator"));
|
|
17
19
|
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
18
|
-
var
|
|
19
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
|
+
var _nodes = require("@atlaskit/editor-common/utils/nodes");
|
|
20
21
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
21
22
|
var _Dropdown = _interopRequireDefault(require("./Dropdown"));
|
|
22
23
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
@@ -120,7 +121,7 @@ var ExtensionButton = function ExtensionButton(props) {
|
|
|
120
121
|
if (typeof item.action !== 'function') {
|
|
121
122
|
throw new Error("'action' of context toolbar item '".concat(item.key, "' is not a function"));
|
|
122
123
|
}
|
|
123
|
-
var targetNodeAdf = (0,
|
|
124
|
+
var targetNodeAdf = (0, _nodes.nodeToJSON)(node);
|
|
124
125
|
// Ignored via go/ees005
|
|
125
126
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
126
127
|
item.action(targetNodeAdf, extensionApi);
|
|
@@ -137,7 +138,7 @@ var ExtensionButton = function ExtensionButton(props) {
|
|
|
137
138
|
}
|
|
138
139
|
return '';
|
|
139
140
|
};
|
|
140
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
141
|
+
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
141
142
|
title: item.label,
|
|
142
143
|
ariaLabel: getAriaLabel(),
|
|
143
144
|
icon: item.icon ? /*#__PURE__*/_react.default.createElement(ExtensionIcon, {
|
|
@@ -207,12 +208,12 @@ var ExtensionsPlaceholder = exports.ExtensionsPlaceholder = function ExtensionsP
|
|
|
207
208
|
}
|
|
208
209
|
}, []);
|
|
209
210
|
var nodeAdf = _react.default.useMemo(function () {
|
|
210
|
-
return (0,
|
|
211
|
+
return (0, _nodes.nodeToJSON)(node);
|
|
211
212
|
}, [node]);
|
|
212
213
|
var extensionItems = _react.default.useMemo(function () {
|
|
213
214
|
// Ignored via go/ees005
|
|
214
215
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
215
|
-
return (0,
|
|
216
|
+
return (0, _moduleHelpers.getContextualToolbarItemsFromModule)(extensions, nodeAdf, extensionApi);
|
|
216
217
|
}, [extensions, nodeAdf, extensionApi]);
|
|
217
218
|
if (!extensionItems.length) {
|
|
218
219
|
return null;
|
|
@@ -222,7 +223,7 @@ var ExtensionsPlaceholder = exports.ExtensionsPlaceholder = function ExtensionsP
|
|
|
222
223
|
// but count fragment as 1 child, so here we create the children manually.
|
|
223
224
|
var children = [];
|
|
224
225
|
if (separator && ['start', 'both'].includes(separator)) {
|
|
225
|
-
children.push( /*#__PURE__*/_react.default.createElement(
|
|
226
|
+
children.push( /*#__PURE__*/_react.default.createElement(_Separator.default, {
|
|
226
227
|
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
227
228
|
}));
|
|
228
229
|
}
|
|
@@ -273,13 +274,13 @@ var ExtensionsPlaceholder = exports.ExtensionsPlaceholder = function ExtensionsP
|
|
|
273
274
|
}));
|
|
274
275
|
}
|
|
275
276
|
if (index < extensionItems.length - 1) {
|
|
276
|
-
children.push( /*#__PURE__*/_react.default.createElement(
|
|
277
|
+
children.push( /*#__PURE__*/_react.default.createElement(_Separator.default, {
|
|
277
278
|
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
278
279
|
}));
|
|
279
280
|
}
|
|
280
281
|
});
|
|
281
282
|
if (separator && ['end', 'both'].includes(separator)) {
|
|
282
|
-
children.push( /*#__PURE__*/_react.default.createElement(
|
|
283
|
+
children.push( /*#__PURE__*/_react.default.createElement(_Separator.default, {
|
|
283
284
|
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
284
285
|
}));
|
|
285
286
|
}
|
package/dist/cjs/ui/Input.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.Input = void 0;
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
|
-
var
|
|
12
|
+
var _styles = require("@atlaskit/editor-common/PanelTextInput/styles");
|
|
13
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
14
|
/**
|
|
15
15
|
* @jsxRuntime classic
|
|
@@ -42,7 +42,7 @@ var Input = exports.Input = function Input(props) {
|
|
|
42
42
|
onSubmit: handleSubmit
|
|
43
43
|
}, (0, _react2.jsx)("input", {
|
|
44
44
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
45
|
-
css:
|
|
45
|
+
css: _styles.panelTextInput,
|
|
46
46
|
value: text,
|
|
47
47
|
onChange: handleChange,
|
|
48
48
|
placeholder: placeholder,
|
|
@@ -11,7 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _bindEventListener = require("bind-event-listener");
|
|
12
12
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
13
13
|
var _button = _interopRequireDefault(require("@atlaskit/button/icon/button"));
|
|
14
|
-
var
|
|
14
|
+
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/floating-toolbar/messages"));
|
|
15
15
|
var _chevronLeft = _interopRequireDefault(require("@atlaskit/icon/core/chevron-left"));
|
|
16
16
|
var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
|
|
17
17
|
var _primitives = require("@atlaskit/primitives");
|
|
@@ -139,7 +139,7 @@ var ScrollButton = exports.ScrollButton = function ScrollButton(_ref) {
|
|
|
139
139
|
xcss: [side === 'left' ? leftSideStyles : rightSideStyles, buttonCommonStyles]
|
|
140
140
|
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
141
141
|
appearance: "subtle",
|
|
142
|
-
label: intl.formatMessage(side === 'left' ?
|
|
142
|
+
label: intl.formatMessage(side === 'left' ? _messages.default.floatingToolbarScrollLeft : _messages.default.floatingToolbarScrollRight),
|
|
143
143
|
onClick: onClick,
|
|
144
144
|
isDisabled: disabled
|
|
145
145
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
@@ -10,8 +10,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/floating-toolbar/messages"));
|
|
14
|
+
var _Button = _interopRequireDefault(require("@atlaskit/editor-common/FloatingToolbar/Button"));
|
|
15
15
|
var _chevronLeft = _interopRequireDefault(require("@atlaskit/icon/core/chevron-left"));
|
|
16
16
|
var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -151,19 +151,19 @@ var ScrollButtons = exports.ScrollButtons = function ScrollButtons(_ref) {
|
|
|
151
151
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
152
152
|
,
|
|
153
153
|
className: "scroll-buttons"
|
|
154
|
-
}, (0, _react2.jsx)(
|
|
155
|
-
title: intl.formatMessage(
|
|
154
|
+
}, (0, _react2.jsx)(_Button.default, {
|
|
155
|
+
title: intl.formatMessage(_messages.default.floatingToolbarScrollLeft),
|
|
156
156
|
icon: (0, _react2.jsx)(LeftIcon, {
|
|
157
|
-
label: intl.formatMessage(
|
|
157
|
+
label: intl.formatMessage(_messages.default.floatingToolbarScrollLeft),
|
|
158
158
|
size: "small"
|
|
159
159
|
}),
|
|
160
160
|
onClick: scrollLeft,
|
|
161
161
|
disabled: !canScrollLeft || disabled,
|
|
162
162
|
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
163
|
-
}), (0, _react2.jsx)(
|
|
164
|
-
title: intl.formatMessage(
|
|
163
|
+
}), (0, _react2.jsx)(_Button.default, {
|
|
164
|
+
title: intl.formatMessage(_messages.default.floatingToolbarScrollRight),
|
|
165
165
|
icon: (0, _react2.jsx)(RightIcon, {
|
|
166
|
-
label: intl.formatMessage(
|
|
166
|
+
label: intl.formatMessage(_messages.default.floatingToolbarScrollRight),
|
|
167
167
|
size: "small"
|
|
168
168
|
}),
|
|
169
169
|
onClick: scrollRight,
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.SimpleModal = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _button = _interopRequireDefault(require("@atlaskit/button/default/button"));
|
|
10
|
-
var
|
|
10
|
+
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/floating-toolbar/messages"));
|
|
11
11
|
var _modalBody = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-body"));
|
|
12
12
|
var _modalDialog = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-dialog"));
|
|
13
13
|
var _modalFooter = _interopRequireDefault(require("@atlaskit/modal-dialog/modal-footer"));
|
|
@@ -20,9 +20,9 @@ var SimpleModal = exports.SimpleModal = function SimpleModal(props) {
|
|
|
20
20
|
options = props.options,
|
|
21
21
|
formatMessage = props.intl.formatMessage,
|
|
22
22
|
testId = props.testId;
|
|
23
|
-
var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(
|
|
24
|
-
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(
|
|
25
|
-
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(
|
|
23
|
+
var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(_messages.default.confirmModalDefaultHeading);
|
|
24
|
+
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(_messages.default.confirmModalOK);
|
|
25
|
+
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(_messages.default.confirmModalCancel);
|
|
26
26
|
return /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
|
|
27
27
|
onClose: onClose,
|
|
28
28
|
testId: testId
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -18,13 +18,17 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
18
18
|
var _react2 = require("@emotion/react");
|
|
19
19
|
var _reactIntl = require("react-intl");
|
|
20
20
|
var _buttonGroup = _interopRequireDefault(require("@atlaskit/button/button-group"));
|
|
21
|
+
var _announcer = _interopRequireDefault(require("@atlaskit/editor-common/announcer"));
|
|
21
22
|
var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
|
|
22
|
-
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages"));
|
|
23
|
+
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/floating-toolbar/messages"));
|
|
24
|
+
var _Button = _interopRequireDefault(require("@atlaskit/editor-common/FloatingToolbar/Button"));
|
|
25
|
+
var _Separator = _interopRequireDefault(require("@atlaskit/editor-common/FloatingToolbar/Separator"));
|
|
26
|
+
var _messages2 = _interopRequireDefault(require("@atlaskit/editor-common/messages"));
|
|
23
27
|
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
+
var _paletteMessagesTokenModeNames = require("@atlaskit/editor-common/ui-color/ColorPalette/paletteMessagesTokenModeNames");
|
|
29
|
+
var _ColorPickerButton = _interopRequireDefault(require("@atlaskit/editor-common/ui-menu/ColorPickerButton"));
|
|
30
|
+
var _ToolbarArrowKeyNavigationProvider = require("@atlaskit/editor-common/ui-menu/ToolbarArrowKeyNavigationProvider");
|
|
31
|
+
var _background = require("@atlaskit/editor-palette/background");
|
|
28
32
|
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
|
|
29
33
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
30
34
|
var _forceFocus = require("../pm-plugins/force-focus");
|
|
@@ -128,7 +132,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
128
132
|
}
|
|
129
133
|
return 'currentColor';
|
|
130
134
|
};
|
|
131
|
-
return (0, _react2.jsx)(
|
|
135
|
+
return (0, _react2.jsx)(_Button.default
|
|
132
136
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
|
|
133
137
|
, {
|
|
134
138
|
className: item.className,
|
|
@@ -229,7 +233,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
229
233
|
return (0, _react2.jsx)(_Dropdown.default, {
|
|
230
234
|
alignX: areAnyNewToolbarFlagsEnabled ? 'right' : undefined,
|
|
231
235
|
key: idx,
|
|
232
|
-
title: intl.formatMessage(
|
|
236
|
+
title: intl.formatMessage(_messages2.default.viewMore),
|
|
233
237
|
icon: (0, _react2.jsx)(_showMoreHorizontal.default, {
|
|
234
238
|
label: "",
|
|
235
239
|
spacing: "spacious"
|
|
@@ -316,7 +320,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
316
320
|
}
|
|
317
321
|
if (item.selectType === 'color') {
|
|
318
322
|
var _item$hexToPaletteCol, _item$paletteColorToo;
|
|
319
|
-
return (0, _react2.jsx)(
|
|
323
|
+
return (0, _react2.jsx)(_ColorPickerButton.default, {
|
|
320
324
|
skipFocusButtonAfterPick: true,
|
|
321
325
|
key: idx,
|
|
322
326
|
isAriaExpanded: item.isAriaExpanded,
|
|
@@ -333,8 +337,8 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
333
337
|
placement: "Panels",
|
|
334
338
|
mountPoint: emojiAndColourPickerMountPoint,
|
|
335
339
|
setDisableParentScroll: scrollable ? setDisableScroll : undefined,
|
|
336
|
-
hexToPaletteColor: (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_dividers') ? (_item$hexToPaletteCol = item.hexToPaletteColor) !== null && _item$hexToPaletteCol !== void 0 ? _item$hexToPaletteCol :
|
|
337
|
-
paletteColorTooltipMessages: (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_dividers') ? (_item$paletteColorToo = item.paletteColorTooltipMessages) !== null && _item$paletteColorToo !== void 0 ? _item$paletteColorToo :
|
|
340
|
+
hexToPaletteColor: (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_dividers') ? (_item$hexToPaletteCol = item.hexToPaletteColor) !== null && _item$hexToPaletteCol !== void 0 ? _item$hexToPaletteCol : _background.hexToEditorBackgroundPaletteColor : _background.hexToEditorBackgroundPaletteColor,
|
|
341
|
+
paletteColorTooltipMessages: (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_dividers') ? (_item$paletteColorToo = item.paletteColorTooltipMessages) !== null && _item$paletteColorToo !== void 0 ? _item$paletteColorToo : _paletteMessagesTokenModeNames.backgroundPaletteTooltipMessages : _paletteMessagesTokenModeNames.backgroundPaletteTooltipMessages,
|
|
338
342
|
returnEscToButton: item.returnEscToButton
|
|
339
343
|
});
|
|
340
344
|
}
|
|
@@ -379,13 +383,13 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
379
383
|
});
|
|
380
384
|
case 'separator':
|
|
381
385
|
if (areAnyNewToolbarFlagsEnabled) {
|
|
382
|
-
return item.fullHeight ? (0, _react2.jsx)(
|
|
386
|
+
return item.fullHeight ? (0, _react2.jsx)(_Separator.default, {
|
|
383
387
|
key: idx,
|
|
384
388
|
fullHeight: true,
|
|
385
389
|
areAnyNewToolbarFlagsEnabled: true
|
|
386
390
|
}) : null;
|
|
387
391
|
}
|
|
388
|
-
return (0, _react2.jsx)(
|
|
392
|
+
return (0, _react2.jsx)(_Separator.default, {
|
|
389
393
|
key: idx,
|
|
390
394
|
fullHeight: item.fullHeight,
|
|
391
395
|
areAnyNewToolbarFlagsEnabled: false
|
|
@@ -714,7 +718,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
714
718
|
var hasSelect = items.find(function (item) {
|
|
715
719
|
return item.type === 'select' && item.selectType === 'list';
|
|
716
720
|
});
|
|
717
|
-
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(
|
|
721
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_ToolbarArrowKeyNavigationProvider.ToolbarArrowKeyNavigationProvider, {
|
|
718
722
|
editorView: this.props.editorView,
|
|
719
723
|
handleEscape: this.handleEscape,
|
|
720
724
|
disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
|
|
@@ -726,15 +730,15 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
726
730
|
css: function css() {
|
|
727
731
|
return [toolbarContainerBase, toolbarContainer(areAnyNewToolbarFlagsEnabled, scrollable, hasSelect !== undefined, firstElementIsSelect, _this2.props.containerSurface)];
|
|
728
732
|
},
|
|
729
|
-
"aria-label": intl.formatMessage(
|
|
733
|
+
"aria-label": intl.formatMessage(_messages.default.floatingToolbarAriaLabel),
|
|
730
734
|
role: "toolbar",
|
|
731
735
|
"data-testid": "editor-floating-toolbar"
|
|
732
736
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
733
737
|
,
|
|
734
738
|
className: className,
|
|
735
739
|
onMouseDown: areAnyNewToolbarFlagsEnabled ? this.captureMouseEvent : undefined
|
|
736
|
-
}, (0, _react2.jsx)(
|
|
737
|
-
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(
|
|
740
|
+
}, (0, _react2.jsx)(_announcer.default, {
|
|
741
|
+
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(_messages.default.floatingToolbarAnnouncer)) : intl.formatMessage(_messages.default.floatingToolbarAnnouncer),
|
|
738
742
|
delay: 250
|
|
739
743
|
}), scrollable && areAnyNewToolbarFlagsEnabled && (0, _react2.jsx)(_ScrollButton.ScrollButton, {
|
|
740
744
|
intl: intl,
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import camelCase from 'lodash/camelCase';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
5
4
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
+
import { isSSR } from '@atlaskit/editor-common/is-ssr';
|
|
6
|
+
import Popup from '@atlaskit/editor-common/Popup';
|
|
7
|
+
import { WithProviders } from '@atlaskit/editor-common/provider-factory/with-providers';
|
|
10
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
11
9
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
12
|
-
import {
|
|
10
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/useSharedPluginState';
|
|
13
11
|
import { AllSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
14
12
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
15
13
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
1
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils/plugin-state-factory';
|
|
2
2
|
import { pluginKey } from './plugin-key';
|
|
3
3
|
import { reducer } from './reducer';
|
|
4
4
|
const dest = pluginFactory(pluginKey, reducer);
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import Button from '@atlaskit/button/default/button';
|
|
4
4
|
import { Checkbox } from '@atlaskit/checkbox/checkbox';
|
|
5
|
-
import
|
|
5
|
+
import messages from '@atlaskit/editor-common/floating-toolbar/messages';
|
|
6
6
|
import ModalBody from '@atlaskit/modal-dialog/modal-body';
|
|
7
7
|
import Modal from '@atlaskit/modal-dialog/modal-dialog';
|
|
8
8
|
import ModalFooter from '@atlaskit/modal-dialog/modal-footer';
|
|
@@ -8,8 +8,9 @@ import React, { Component } from 'react';
|
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
|
-
import
|
|
12
|
-
import { ArrowKeyNavigationType
|
|
11
|
+
import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
|
|
12
|
+
import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu/ArrowKeyNavigationProvider/types';
|
|
13
|
+
import { DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu/DropdownContainer';
|
|
13
14
|
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
14
15
|
import { Divider } from './Divider';
|
|
15
16
|
import DropdownMenu, { itemSpacing, menuItemDimensions } from './DropdownMenu';
|
|
@@ -8,7 +8,8 @@ import { css, jsx } from '@emotion/react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
9
9
|
|
|
10
10
|
import { injectIntl } from 'react-intl';
|
|
11
|
-
import { DropdownMenuItem
|
|
11
|
+
import { DropdownMenuItem } from '@atlaskit/editor-common/DropdownMenuItem';
|
|
12
|
+
import { DropdownSeparator } from '@atlaskit/editor-common/DropdownSeparator';
|
|
12
13
|
import HeadingItem from '@atlaskit/menu/heading-item';
|
|
13
14
|
export const menuItemDimensions = {
|
|
14
15
|
width: 175,
|
|
@@ -7,9 +7,10 @@ import React, { useCallback, useContext } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import IconButton from '@atlaskit/button/icon/button';
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
10
|
+
import Popup from '@atlaskit/editor-common/Popup';
|
|
11
|
+
import { OutsideClickTargetRefContext } from '@atlaskit/editor-common/ui-react';
|
|
12
|
+
import withReactEditorViewOuterListeners from '@atlaskit/editor-common/ui-react/with-react-editor-view-outer-listeners';
|
|
13
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
13
14
|
import { EmojiPicker } from '@atlaskit/emoji';
|
|
14
15
|
import EmojiAddIcon from '@atlaskit/icon/core/emoji-add';
|
|
15
16
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
@@ -3,10 +3,11 @@ import Loadable from 'react-loadable';
|
|
|
3
3
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
4
4
|
import { lazy, LazySuspense } from 'react-loosely-lazy';
|
|
5
5
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
6
|
-
import { getContextualToolbarItemsFromModule } from '@atlaskit/editor-common/extensions';
|
|
6
|
+
import { getContextualToolbarItemsFromModule } from '@atlaskit/editor-common/extensions/module-helpers';
|
|
7
|
+
import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
|
|
8
|
+
import Separator from '@atlaskit/editor-common/FloatingToolbar/Separator';
|
|
7
9
|
import { isNestedTablesSupported, isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
|
|
8
|
-
import {
|
|
9
|
-
import { nodeToJSON } from '@atlaskit/editor-common/utils';
|
|
10
|
+
import { nodeToJSON } from '@atlaskit/editor-common/utils/nodes';
|
|
10
11
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
11
12
|
import Dropdown from './Dropdown';
|
|
12
13
|
const noop = () => null;
|
package/dist/es2019/ui/Input.js
CHANGED
|
@@ -6,7 +6,7 @@ import React, { useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
|
-
import { panelTextInput } from '@atlaskit/editor-common/
|
|
9
|
+
import { panelTextInput } from '@atlaskit/editor-common/PanelTextInput/styles';
|
|
10
10
|
export const Input = props => {
|
|
11
11
|
const {
|
|
12
12
|
defaultValue,
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
3
|
import rafSchedule from 'raf-schd';
|
|
4
4
|
import IconButton from '@atlaskit/button/icon/button';
|
|
5
|
-
import
|
|
5
|
+
import messages from '@atlaskit/editor-common/floating-toolbar/messages';
|
|
6
6
|
import ChevronLeftLargeIcon from '@atlaskit/icon/core/chevron-left';
|
|
7
7
|
import ChevronRightLargeIcon from '@atlaskit/icon/core/chevron-right';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
@@ -7,8 +7,8 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import rafSchedule from 'raf-schd';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import messages from '@atlaskit/editor-common/floating-toolbar/messages';
|
|
11
|
+
import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
|
|
12
12
|
import ChevronLeftLargeIcon from '@atlaskit/icon/core/chevron-left';
|
|
13
13
|
import ChevronRightLargeIcon from '@atlaskit/icon/core/chevron-right';
|
|
14
14
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Button from '@atlaskit/button/default/button';
|
|
3
|
-
import
|
|
3
|
+
import messages from '@atlaskit/editor-common/floating-toolbar/messages';
|
|
4
4
|
import ModalBody from '@atlaskit/modal-dialog/modal-body';
|
|
5
5
|
import Modal from '@atlaskit/modal-dialog/modal-dialog';
|
|
6
6
|
import ModalFooter from '@atlaskit/modal-dialog/modal-footer';
|
|
@@ -12,13 +12,17 @@ import React, { Component } from 'react';
|
|
|
12
12
|
import { css, jsx } from '@emotion/react';
|
|
13
13
|
import { injectIntl } from 'react-intl';
|
|
14
14
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
15
|
-
import
|
|
15
|
+
import Announcer from '@atlaskit/editor-common/announcer';
|
|
16
|
+
import { areSameItems } from '@atlaskit/editor-common/floating-toolbar';
|
|
17
|
+
import messages from '@atlaskit/editor-common/floating-toolbar/messages';
|
|
18
|
+
import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
|
|
19
|
+
import Separator from '@atlaskit/editor-common/FloatingToolbar/Separator';
|
|
16
20
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
17
21
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
22
|
+
import { backgroundPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color/ColorPalette/paletteMessagesTokenModeNames';
|
|
23
|
+
import ColorPickerButton from '@atlaskit/editor-common/ui-menu/ColorPickerButton';
|
|
24
|
+
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu/ToolbarArrowKeyNavigationProvider';
|
|
25
|
+
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette/background';
|
|
22
26
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
23
27
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
24
28
|
import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
|
|
@@ -4,16 +4,14 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
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; }
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import camelCase from 'lodash/camelCase';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
7
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
9
8
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
9
|
+
import { isSSR } from '@atlaskit/editor-common/is-ssr';
|
|
10
|
+
import Popup from '@atlaskit/editor-common/Popup';
|
|
11
|
+
import { WithProviders } from '@atlaskit/editor-common/provider-factory/with-providers';
|
|
14
12
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
15
13
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
16
|
-
import {
|
|
14
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/useSharedPluginState';
|
|
17
15
|
import { AllSelection, PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
18
16
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
19
17
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
1
|
+
import { pluginFactory } from '@atlaskit/editor-common/utils/plugin-state-factory';
|
|
2
2
|
import { pluginKey } from './plugin-key';
|
|
3
3
|
import { reducer } from './reducer';
|
|
4
4
|
var dest = pluginFactory(pluginKey, reducer);
|
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import Button from '@atlaskit/button/default/button';
|
|
5
5
|
import { Checkbox } from '@atlaskit/checkbox/checkbox';
|
|
6
|
-
import
|
|
6
|
+
import messages from '@atlaskit/editor-common/floating-toolbar/messages';
|
|
7
7
|
import ModalBody from '@atlaskit/modal-dialog/modal-body';
|
|
8
8
|
import Modal from '@atlaskit/modal-dialog/modal-dialog';
|
|
9
9
|
import ModalFooter from '@atlaskit/modal-dialog/modal-footer';
|
package/dist/esm/ui/Dropdown.js
CHANGED
|
@@ -17,8 +17,9 @@ import React, { Component } from 'react';
|
|
|
17
17
|
|
|
18
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
19
19
|
import { css, jsx } from '@emotion/react';
|
|
20
|
-
import
|
|
21
|
-
import { ArrowKeyNavigationType
|
|
20
|
+
import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
|
|
21
|
+
import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu/ArrowKeyNavigationProvider/types';
|
|
22
|
+
import { DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu/DropdownContainer';
|
|
22
23
|
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
23
24
|
import { Divider } from './Divider';
|
|
24
25
|
import DropdownMenu, { itemSpacing, menuItemDimensions } from './DropdownMenu';
|
|
@@ -8,7 +8,8 @@ import { css, jsx } from '@emotion/react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
9
9
|
|
|
10
10
|
import { injectIntl } from 'react-intl';
|
|
11
|
-
import { DropdownMenuItem
|
|
11
|
+
import { DropdownMenuItem } from '@atlaskit/editor-common/DropdownMenuItem';
|
|
12
|
+
import { DropdownSeparator } from '@atlaskit/editor-common/DropdownSeparator';
|
|
12
13
|
import HeadingItem from '@atlaskit/menu/heading-item';
|
|
13
14
|
export var menuItemDimensions = {
|
|
14
15
|
width: 175,
|
|
@@ -8,9 +8,10 @@ import React, { useCallback, useContext } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import IconButton from '@atlaskit/button/icon/button';
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
11
|
+
import Popup from '@atlaskit/editor-common/Popup';
|
|
12
|
+
import { OutsideClickTargetRefContext } from '@atlaskit/editor-common/ui-react';
|
|
13
|
+
import withReactEditorViewOuterListeners from '@atlaskit/editor-common/ui-react/with-react-editor-view-outer-listeners';
|
|
14
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
14
15
|
import { EmojiPicker } from '@atlaskit/emoji';
|
|
15
16
|
import EmojiAddIcon from '@atlaskit/icon/core/emoji-add';
|
|
16
17
|
import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
@@ -6,10 +6,11 @@ import Loadable from 'react-loadable';
|
|
|
6
6
|
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
7
7
|
import { lazy, LazySuspense } from 'react-loosely-lazy';
|
|
8
8
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
9
|
-
import { getContextualToolbarItemsFromModule } from '@atlaskit/editor-common/extensions';
|
|
9
|
+
import { getContextualToolbarItemsFromModule } from '@atlaskit/editor-common/extensions/module-helpers';
|
|
10
|
+
import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
|
|
11
|
+
import Separator from '@atlaskit/editor-common/FloatingToolbar/Separator';
|
|
10
12
|
import { isNestedTablesSupported, isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
|
|
11
|
-
import {
|
|
12
|
-
import { nodeToJSON } from '@atlaskit/editor-common/utils';
|
|
13
|
+
import { nodeToJSON } from '@atlaskit/editor-common/utils/nodes';
|
|
13
14
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
14
15
|
import Dropdown from './Dropdown';
|
|
15
16
|
var noop = function noop() {
|
package/dist/esm/ui/Input.js
CHANGED
|
@@ -7,7 +7,7 @@ import React, { useState } from 'react';
|
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
|
-
import { panelTextInput } from '@atlaskit/editor-common/
|
|
10
|
+
import { panelTextInput } from '@atlaskit/editor-common/PanelTextInput/styles';
|
|
11
11
|
export var Input = function Input(props) {
|
|
12
12
|
var defaultValue = props.defaultValue,
|
|
13
13
|
onBlur = props.onBlur,
|
|
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
3
3
|
import { bind } from 'bind-event-listener';
|
|
4
4
|
import rafSchedule from 'raf-schd';
|
|
5
5
|
import IconButton from '@atlaskit/button/icon/button';
|
|
6
|
-
import
|
|
6
|
+
import messages from '@atlaskit/editor-common/floating-toolbar/messages';
|
|
7
7
|
import ChevronLeftLargeIcon from '@atlaskit/icon/core/chevron-left';
|
|
8
8
|
import ChevronRightLargeIcon from '@atlaskit/icon/core/chevron-right';
|
|
9
9
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
@@ -8,8 +8,8 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import rafSchedule from 'raf-schd';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import messages from '@atlaskit/editor-common/floating-toolbar/messages';
|
|
12
|
+
import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
|
|
13
13
|
import ChevronLeftLargeIcon from '@atlaskit/icon/core/chevron-left';
|
|
14
14
|
import ChevronRightLargeIcon from '@atlaskit/icon/core/chevron-right';
|
|
15
15
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Button from '@atlaskit/button/default/button';
|
|
3
|
-
import
|
|
3
|
+
import messages from '@atlaskit/editor-common/floating-toolbar/messages';
|
|
4
4
|
import ModalBody from '@atlaskit/modal-dialog/modal-body';
|
|
5
5
|
import Modal from '@atlaskit/modal-dialog/modal-dialog';
|
|
6
6
|
import ModalFooter from '@atlaskit/modal-dialog/modal-footer';
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -21,13 +21,17 @@ import React, { Component } from 'react';
|
|
|
21
21
|
import { css, jsx } from '@emotion/react';
|
|
22
22
|
import { injectIntl } from 'react-intl';
|
|
23
23
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
24
|
-
import
|
|
24
|
+
import Announcer from '@atlaskit/editor-common/announcer';
|
|
25
|
+
import { areSameItems } from '@atlaskit/editor-common/floating-toolbar';
|
|
26
|
+
import messages from '@atlaskit/editor-common/floating-toolbar/messages';
|
|
27
|
+
import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
|
|
28
|
+
import Separator from '@atlaskit/editor-common/FloatingToolbar/Separator';
|
|
25
29
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
26
30
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
30
|
-
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
31
|
+
import { backgroundPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color/ColorPalette/paletteMessagesTokenModeNames';
|
|
32
|
+
import ColorPickerButton from '@atlaskit/editor-common/ui-menu/ColorPickerButton';
|
|
33
|
+
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu/ToolbarArrowKeyNavigationProvider';
|
|
34
|
+
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette/background';
|
|
31
35
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
32
36
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
33
37
|
import { checkShouldForceFocusAndApply, forceFocusSelector } from '../pm-plugins/force-focus';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { IntlShape } from 'react-intl';
|
|
3
|
-
import type
|
|
3
|
+
import type ProviderFactory from '@atlaskit/editor-common/provider-factory/provider-factory';
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
-
import type {
|
|
5
|
+
import type { FloatingToolbarConfig, FloatingToolbarHandler } from '@atlaskit/editor-common/types/floating-toolbar';
|
|
6
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
7
|
+
import type { UiComponentFactoryParams } from '@atlaskit/editor-common/types/ui-components';
|
|
6
8
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
9
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
8
10
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { FloatingToolbarConfig
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
14
|
-
import type {
|
|
1
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
+
import type { FloatingToolbarConfig } from '@atlaskit/editor-common/types/floating-toolbar';
|
|
3
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
4
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics/analyticsPluginType';
|
|
5
|
+
import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel/contextPanelPluginType';
|
|
6
|
+
import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button/copyButtonPluginType';
|
|
7
|
+
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations/decorationsPluginType';
|
|
8
|
+
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled/editorDisabledPluginType';
|
|
9
|
+
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode/editorViewmodePluginType';
|
|
10
|
+
import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji/emojiPluginType';
|
|
11
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension/extensionPluginType';
|
|
12
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags/featureFlagsPluginType';
|
|
13
|
+
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction/interaction-plugin-type';
|
|
14
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar/toolbar-plugin-type';
|
|
15
|
+
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent/user-intent-plugin-type';
|
|
15
16
|
import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
16
17
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
17
18
|
export type ConfigWithNodeInfo = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics/api';
|
|
2
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
3
|
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
export declare const copyNode: (nodeType: NodeType | Array<NodeType>, editorAnalyticsApi?: EditorAnalyticsAPI | undefined, inputMethod?: INPUT_METHOD) => ({ tr }: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types/command';
|
|
2
2
|
export declare const showConfirmDialog: (buttonIndex: number, optionIndex?: number) => Command;
|
|
3
3
|
export declare const hideConfirmDialog: () => Command;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types/command';
|
|
3
3
|
import type { EditorState, SafeStateField, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { FloatingToolbarPluginData } from '../../floatingToolbarPluginType';
|
|
5
5
|
import type { FloatingToolbarPluginAction } from './types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl';
|
|
3
|
-
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types/floating-toolbar';
|
|
4
4
|
export declare const CheckboxModal: (props: ConfirmationDialogProps & WrappedComponentProps) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
3
|
-
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types/floating-toolbar';
|
|
4
4
|
export declare const ConfirmationModal: React.FC<WithIntlProps<ConfirmationDialogProps & WrappedComponentProps>> & {
|
|
5
5
|
WrappedComponent: React.ComponentType<ConfirmationDialogProps & WrappedComponentProps>;
|
|
6
6
|
};
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import type { ReactElement } from 'react';
|
|
6
6
|
import React, { Component } from 'react';
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
|
-
import type { CommandDispatch
|
|
8
|
+
import type { CommandDispatch } from '@atlaskit/editor-common/types/command';
|
|
9
|
+
import type { DropdownOptions, ExtensionDropdownOptions, FloatingToolbarOverflowDropdownOptions } from '@atlaskit/editor-common/types/floating-toolbar';
|
|
9
10
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
10
11
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
12
|
export interface Props {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ComponentType, FC } from 'react';
|
|
2
2
|
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
3
|
-
import type { ExtensionAPI
|
|
4
|
-
import type {
|
|
3
|
+
import type { ExtensionAPI } from '@atlaskit/editor-common/extensions/extension-handler';
|
|
4
|
+
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions/extension-provider';
|
|
5
|
+
import type { DropdownOptionT, FloatingToolbarOverflowDropdownOptions } from '@atlaskit/editor-common/types/floating-toolbar';
|
|
5
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
7
|
import type { ButtonItemProps } from '@atlaskit/menu/types';
|
|
7
8
|
export declare const menuItemDimensions: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type ProviderFactory from '@atlaskit/editor-common/provider-factory/provider-factory';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { EmojiId } from '@atlaskit/emoji';
|
|
5
5
|
import type { FloatingToolbarPlugin } from '../floatingToolbarPluginType';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ExtensionAPI
|
|
3
|
-
import type {
|
|
2
|
+
import type { ExtensionAPI } from '@atlaskit/editor-common/extensions/extension-handler';
|
|
3
|
+
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions/extension-provider';
|
|
4
|
+
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel/types';
|
|
4
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
7
|
interface Props {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { SelectOption } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { SelectOption } from '@atlaskit/editor-common/types/floating-toolbar';
|
|
3
3
|
import type { ValueType } from '@atlaskit/select/types';
|
|
4
4
|
export interface Props {
|
|
5
5
|
ariaLabel?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl';
|
|
3
|
-
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { ConfirmationDialogProps } from '@atlaskit/editor-common/types/floating-toolbar';
|
|
4
4
|
export declare const SimpleModal: (props: ConfirmationDialogProps & WrappedComponentProps) => React.JSX.Element;
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
7
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
7
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics/types/dispatch-analytics-event';
|
|
8
|
+
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions/extension-provider';
|
|
9
9
|
import type { Item } from '@atlaskit/editor-common/floating-toolbar';
|
|
10
|
-
import type
|
|
11
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
10
|
+
import type ProviderFactory from '@atlaskit/editor-common/provider-factory/provider-factory';
|
|
11
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
12
12
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
13
13
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
14
|
import type { FloatingToolbarPlugin } from '../floatingToolbarPluginType';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type { Command
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types/command';
|
|
2
|
+
import type { FloatingToolbarOverflowDropdown } from '@atlaskit/editor-common/types/floating-toolbar';
|
|
2
3
|
export declare const consolidateOverflowDropdownItems: (overflowDropdowns: FloatingToolbarOverflowDropdown<Command>[]) => FloatingToolbarOverflowDropdown<Command>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "28.0.
|
|
3
|
+
"version": "28.0.5",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
45
45
|
"@atlaskit/primitives": "^22.5.0",
|
|
46
46
|
"@atlaskit/select": "^23.1.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^232.0.0",
|
|
48
48
|
"@atlaskit/tokens": "^20.4.0",
|
|
49
49
|
"@atlaskit/tooltip": "^24.4.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|