@atlaskit/editor-plugin-floating-toolbar 1.4.6 → 1.4.8
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/.eslintrc.js +16 -16
- package/CHANGELOG.md +244 -232
- package/LICENSE.md +6 -8
- package/README.md +1 -1
- package/dist/cjs/plugin.js +12 -3
- package/dist/cjs/ui/EmojiPickerButton.js +5 -0
- package/dist/cjs/ui/ScrollButtons.js +3 -1
- package/dist/cjs/ui/Toolbar.js +6 -2
- package/dist/es2019/plugin.js +12 -4
- package/dist/es2019/ui/EmojiPickerButton.js +5 -0
- package/dist/es2019/ui/ScrollButtons.js +3 -1
- package/dist/es2019/ui/Toolbar.js +6 -2
- package/dist/esm/plugin.js +12 -4
- package/dist/esm/ui/EmojiPickerButton.js +5 -0
- package/dist/esm/ui/ScrollButtons.js +3 -1
- package/dist/esm/ui/Toolbar.js +6 -2
- package/dist/types/plugin.d.ts +5 -1
- package/dist/types/types.d.ts +3 -1
- package/dist/types/ui/ScrollButtons.d.ts +1 -1
- package/dist/types-ts4.5/plugin.d.ts +5 -1
- package/dist/types-ts4.5/types.d.ts +3 -1
- package/dist/types-ts4.5/ui/ScrollButtons.d.ts +1 -1
- package/package.json +9 -7
- package/report.api.md +29 -32
package/LICENSE.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Copyright 2023 Atlassian Pty Ltd
|
|
2
2
|
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
|
|
5
|
-
You may obtain a copy of the License at
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
|
4
|
+
compliance with the License. You may obtain a copy of the License at
|
|
6
5
|
|
|
7
6
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
7
|
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
limitations under the License.
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
10
|
+
implied. See the License for the specific language governing permissions and limitations under the
|
|
11
|
+
License.
|
package/README.md
CHANGED
|
@@ -27,4 +27,4 @@ Please see [Atlaskit - Editor plugin floating toolbar](https://atlaskit.atlassia
|
|
|
27
27
|
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
28
28
|
## License
|
|
29
29
|
---
|
|
30
|
-
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
|
|
30
|
+
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -5,6 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.ContentComponent = ContentComponent;
|
|
8
9
|
exports.pluginKey = exports.getRelevantConfig = exports.floatingToolbarPlugin = void 0;
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -17,6 +18,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
17
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
18
19
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
19
20
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
21
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
22
|
var _forceFocus = _interopRequireWildcard(require("./pm-plugins/force-focus"));
|
|
21
23
|
var _commands = require("./pm-plugins/toolbar-data/commands");
|
|
22
24
|
var _plugin = require("./pm-plugins/toolbar-data/plugin");
|
|
@@ -187,7 +189,7 @@ var floatingToolbarPlugin = exports.floatingToolbarPlugin = function floatingToo
|
|
|
187
189
|
};
|
|
188
190
|
};
|
|
189
191
|
function ContentComponent(_ref5) {
|
|
190
|
-
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$c, _pluginInjectionApi$d;
|
|
192
|
+
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$b, _pluginInjectionApi$c, _pluginInjectionApi$d;
|
|
191
193
|
var pluginInjectionApi = _ref5.pluginInjectionApi,
|
|
192
194
|
editorView = _ref5.editorView,
|
|
193
195
|
popupsMountPoint = _ref5.popupsMountPoint,
|
|
@@ -205,6 +207,9 @@ function ContentComponent(_ref5) {
|
|
|
205
207
|
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)) {
|
|
206
208
|
return null;
|
|
207
209
|
}
|
|
210
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.drag-and-drop_wmv9t') && pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$b = pluginInjectionApi.blockControls) !== null && _pluginInjectionApi$b !== void 0 && (_pluginInjectionApi$b = _pluginInjectionApi$b.sharedState) !== null && _pluginInjectionApi$b !== void 0 && (_pluginInjectionApi$b = _pluginInjectionApi$b.currentState()) !== null && _pluginInjectionApi$b !== void 0 && _pluginInjectionApi$b.isDragging) {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
208
213
|
var config = configWithNodeInfo.config,
|
|
209
214
|
node = configWithNodeInfo.node;
|
|
210
215
|
var items = config.items,
|
|
@@ -289,7 +294,9 @@ function ContentComponent(_ref5) {
|
|
|
289
294
|
mountTo: popupsMountPoint,
|
|
290
295
|
boundariesElement: popupsBoundariesElement,
|
|
291
296
|
scrollableElement: popupsScrollableElement,
|
|
292
|
-
onPositionCalculated: customPositionCalculation
|
|
297
|
+
onPositionCalculated: customPositionCalculation
|
|
298
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
299
|
+
,
|
|
293
300
|
style: scrollable ? {
|
|
294
301
|
maxWidth: '100%'
|
|
295
302
|
} : {},
|
|
@@ -305,7 +312,9 @@ function ContentComponent(_ref5) {
|
|
|
305
312
|
groupLabel: groupLabel,
|
|
306
313
|
node: node,
|
|
307
314
|
dispatchCommand: dispatchCommand,
|
|
308
|
-
editorView: editorView
|
|
315
|
+
editorView: editorView
|
|
316
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
317
|
+
,
|
|
309
318
|
className: className,
|
|
310
319
|
focusEditor: function focusEditor() {
|
|
311
320
|
return editorView.focus();
|
|
@@ -107,10 +107,15 @@ var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(p
|
|
|
107
107
|
appearance: 'subtle',
|
|
108
108
|
key: props.idx,
|
|
109
109
|
style: {
|
|
110
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
110
111
|
padding: 0,
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
111
113
|
margin: 0,
|
|
114
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
112
115
|
display: 'flex',
|
|
116
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
113
117
|
height: '24px',
|
|
118
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
114
119
|
width: '24px'
|
|
115
120
|
},
|
|
116
121
|
onClick: togglePopup,
|
|
@@ -140,7 +140,9 @@ var ScrollButtons = exports.ScrollButtons = function ScrollButtons(_ref) {
|
|
|
140
140
|
}, [node.type]);
|
|
141
141
|
return needScroll ? (0, _react2.jsx)("div", {
|
|
142
142
|
ref: buttonsContainerRef,
|
|
143
|
-
css: toolbarScrollButtons
|
|
143
|
+
css: toolbarScrollButtons
|
|
144
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
145
|
+
,
|
|
144
146
|
className: "scroll-buttons"
|
|
145
147
|
}, (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
146
148
|
title: intl.formatMessage(_floatingToolbar.messages.floatingToolbarScrollLeft),
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -100,7 +100,9 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
return (0, _react2.jsx)(_ui.FloatingToolbarButton
|
|
103
|
+
return (0, _react2.jsx)(_ui.FloatingToolbarButton
|
|
104
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
105
|
+
, {
|
|
104
106
|
className: item.className,
|
|
105
107
|
key: idx,
|
|
106
108
|
title: item.title,
|
|
@@ -489,7 +491,9 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
489
491
|
},
|
|
490
492
|
"aria-label": intl.formatMessage(_floatingToolbar.messages.floatingToolbarAriaLabel),
|
|
491
493
|
role: "toolbar",
|
|
492
|
-
"data-testid": "editor-floating-toolbar"
|
|
494
|
+
"data-testid": "editor-floating-toolbar"
|
|
495
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
496
|
+
,
|
|
493
497
|
className: className
|
|
494
498
|
}, (0, _react2.jsx)(_ui.Announcer, {
|
|
495
499
|
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer)) : intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer),
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -8,6 +8,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
8
8
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
11
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
|
|
12
13
|
import { hideConfirmDialog } from './pm-plugins/toolbar-data/commands';
|
|
13
14
|
import { createPlugin as floatingToolbarDataPluginFactory } from './pm-plugins/toolbar-data/plugin';
|
|
@@ -173,7 +174,7 @@ export const floatingToolbarPlugin = ({
|
|
|
173
174
|
}
|
|
174
175
|
};
|
|
175
176
|
};
|
|
176
|
-
function ContentComponent({
|
|
177
|
+
export function ContentComponent({
|
|
177
178
|
pluginInjectionApi,
|
|
178
179
|
editorView,
|
|
179
180
|
popupsMountPoint,
|
|
@@ -182,7 +183,7 @@ function ContentComponent({
|
|
|
182
183
|
providerFactory,
|
|
183
184
|
dispatchAnalyticsEvent
|
|
184
185
|
}) {
|
|
185
|
-
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$c, _pluginInjectionApi$d;
|
|
186
|
+
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$b, _pluginInjectionApi$b2, _pluginInjectionApi$b3, _pluginInjectionApi$c, _pluginInjectionApi$d;
|
|
186
187
|
const {
|
|
187
188
|
floatingToolbarState,
|
|
188
189
|
editorDisabledState,
|
|
@@ -195,6 +196,9 @@ function ContentComponent({
|
|
|
195
196
|
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)) {
|
|
196
197
|
return null;
|
|
197
198
|
}
|
|
199
|
+
if (getBooleanFF('platform.editor.drag-and-drop_wmv9t') && pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$b = pluginInjectionApi.blockControls) !== null && _pluginInjectionApi$b !== void 0 && (_pluginInjectionApi$b2 = _pluginInjectionApi$b.sharedState) !== null && _pluginInjectionApi$b2 !== void 0 && (_pluginInjectionApi$b3 = _pluginInjectionApi$b2.currentState()) !== null && _pluginInjectionApi$b3 !== void 0 && _pluginInjectionApi$b3.isDragging) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
198
202
|
const {
|
|
199
203
|
config,
|
|
200
204
|
node
|
|
@@ -276,7 +280,9 @@ function ContentComponent({
|
|
|
276
280
|
mountTo: popupsMountPoint,
|
|
277
281
|
boundariesElement: popupsBoundariesElement,
|
|
278
282
|
scrollableElement: popupsScrollableElement,
|
|
279
|
-
onPositionCalculated: customPositionCalculation
|
|
283
|
+
onPositionCalculated: customPositionCalculation
|
|
284
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
285
|
+
,
|
|
280
286
|
style: scrollable ? {
|
|
281
287
|
maxWidth: '100%'
|
|
282
288
|
} : {},
|
|
@@ -292,7 +298,9 @@ function ContentComponent({
|
|
|
292
298
|
groupLabel: groupLabel,
|
|
293
299
|
node: node,
|
|
294
300
|
dispatchCommand: dispatchCommand,
|
|
295
|
-
editorView: editorView
|
|
301
|
+
editorView: editorView
|
|
302
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
303
|
+
,
|
|
296
304
|
className: className,
|
|
297
305
|
focusEditor: () => editorView.focus(),
|
|
298
306
|
providerFactory: providerFactory,
|
|
@@ -94,10 +94,15 @@ export const EmojiPickerButton = props => {
|
|
|
94
94
|
appearance: 'subtle',
|
|
95
95
|
key: props.idx,
|
|
96
96
|
style: {
|
|
97
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
97
98
|
padding: 0,
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
98
100
|
margin: 0,
|
|
101
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
99
102
|
display: 'flex',
|
|
103
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
100
104
|
height: '24px',
|
|
105
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
101
106
|
width: '24px'
|
|
102
107
|
},
|
|
103
108
|
onClick: togglePopup,
|
|
@@ -119,7 +119,9 @@ export const ScrollButtons = ({
|
|
|
119
119
|
}, [node.type]);
|
|
120
120
|
return needScroll ? jsx("div", {
|
|
121
121
|
ref: buttonsContainerRef,
|
|
122
|
-
css: toolbarScrollButtons
|
|
122
|
+
css: toolbarScrollButtons
|
|
123
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
124
|
+
,
|
|
123
125
|
className: "scroll-buttons"
|
|
124
126
|
}, jsx(Button, {
|
|
125
127
|
title: intl.formatMessage(messages.floatingToolbarScrollLeft),
|
|
@@ -86,7 +86,9 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
-
return jsx(Button
|
|
89
|
+
return jsx(Button
|
|
90
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
91
|
+
, {
|
|
90
92
|
className: item.className,
|
|
91
93
|
key: idx,
|
|
92
94
|
title: item.title,
|
|
@@ -436,7 +438,9 @@ class Toolbar extends Component {
|
|
|
436
438
|
css: () => [toolbarContainer(scrollable, hasSelect !== undefined, firstElementIsSelect)],
|
|
437
439
|
"aria-label": intl.formatMessage(messages.floatingToolbarAriaLabel),
|
|
438
440
|
role: "toolbar",
|
|
439
|
-
"data-testid": "editor-floating-toolbar"
|
|
441
|
+
"data-testid": "editor-floating-toolbar"
|
|
442
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
443
|
+
,
|
|
440
444
|
className: className
|
|
441
445
|
}, jsx(Announcer, {
|
|
442
446
|
text: mediaAssistiveMessage ? `${mediaAssistiveMessage}, ${intl.formatMessage(messages.floatingToolbarAnnouncer)}` : intl.formatMessage(messages.floatingToolbarAnnouncer),
|
package/dist/esm/plugin.js
CHANGED
|
@@ -11,6 +11,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
11
11
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { AllSelection, PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
13
13
|
import { findDomRefAtPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
14
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import forceFocusPlugin, { forceFocusSelector } from './pm-plugins/force-focus';
|
|
15
16
|
import { hideConfirmDialog } from './pm-plugins/toolbar-data/commands';
|
|
16
17
|
import { createPlugin as floatingToolbarDataPluginFactory } from './pm-plugins/toolbar-data/plugin';
|
|
@@ -177,8 +178,8 @@ export var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
|
177
178
|
}
|
|
178
179
|
};
|
|
179
180
|
};
|
|
180
|
-
function ContentComponent(_ref5) {
|
|
181
|
-
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$c, _pluginInjectionApi$d;
|
|
181
|
+
export function ContentComponent(_ref5) {
|
|
182
|
+
var _configWithNodeInfo$c, _configWithNodeInfo$c2, _pluginInjectionApi$b, _pluginInjectionApi$c, _pluginInjectionApi$d;
|
|
182
183
|
var pluginInjectionApi = _ref5.pluginInjectionApi,
|
|
183
184
|
editorView = _ref5.editorView,
|
|
184
185
|
popupsMountPoint = _ref5.popupsMountPoint,
|
|
@@ -196,6 +197,9 @@ function ContentComponent(_ref5) {
|
|
|
196
197
|
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)) {
|
|
197
198
|
return null;
|
|
198
199
|
}
|
|
200
|
+
if (getBooleanFF('platform.editor.drag-and-drop_wmv9t') && pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$b = pluginInjectionApi.blockControls) !== null && _pluginInjectionApi$b !== void 0 && (_pluginInjectionApi$b = _pluginInjectionApi$b.sharedState) !== null && _pluginInjectionApi$b !== void 0 && (_pluginInjectionApi$b = _pluginInjectionApi$b.currentState()) !== null && _pluginInjectionApi$b !== void 0 && _pluginInjectionApi$b.isDragging) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
199
203
|
var config = configWithNodeInfo.config,
|
|
200
204
|
node = configWithNodeInfo.node;
|
|
201
205
|
var items = config.items,
|
|
@@ -280,7 +284,9 @@ function ContentComponent(_ref5) {
|
|
|
280
284
|
mountTo: popupsMountPoint,
|
|
281
285
|
boundariesElement: popupsBoundariesElement,
|
|
282
286
|
scrollableElement: popupsScrollableElement,
|
|
283
|
-
onPositionCalculated: customPositionCalculation
|
|
287
|
+
onPositionCalculated: customPositionCalculation
|
|
288
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
289
|
+
,
|
|
284
290
|
style: scrollable ? {
|
|
285
291
|
maxWidth: '100%'
|
|
286
292
|
} : {},
|
|
@@ -296,7 +302,9 @@ function ContentComponent(_ref5) {
|
|
|
296
302
|
groupLabel: groupLabel,
|
|
297
303
|
node: node,
|
|
298
304
|
dispatchCommand: dispatchCommand,
|
|
299
|
-
editorView: editorView
|
|
305
|
+
editorView: editorView
|
|
306
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
307
|
+
,
|
|
300
308
|
className: className,
|
|
301
309
|
focusEditor: function focusEditor() {
|
|
302
310
|
return editorView.focus();
|
|
@@ -100,10 +100,15 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
100
100
|
appearance: 'subtle',
|
|
101
101
|
key: props.idx,
|
|
102
102
|
style: {
|
|
103
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
103
104
|
padding: 0,
|
|
105
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
104
106
|
margin: 0,
|
|
107
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
105
108
|
display: 'flex',
|
|
109
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
106
110
|
height: '24px',
|
|
111
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
107
112
|
width: '24px'
|
|
108
113
|
},
|
|
109
114
|
onClick: togglePopup,
|
|
@@ -129,7 +129,9 @@ export var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
129
129
|
}, [node.type]);
|
|
130
130
|
return needScroll ? jsx("div", {
|
|
131
131
|
ref: buttonsContainerRef,
|
|
132
|
-
css: toolbarScrollButtons
|
|
132
|
+
css: toolbarScrollButtons
|
|
133
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
134
|
+
,
|
|
133
135
|
className: "scroll-buttons"
|
|
134
136
|
}, jsx(Button, {
|
|
135
137
|
title: intl.formatMessage(messages.floatingToolbarScrollLeft),
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -91,7 +91,9 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
return jsx(Button
|
|
94
|
+
return jsx(Button
|
|
95
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
96
|
+
, {
|
|
95
97
|
className: item.className,
|
|
96
98
|
key: idx,
|
|
97
99
|
title: item.title,
|
|
@@ -480,7 +482,9 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
480
482
|
},
|
|
481
483
|
"aria-label": intl.formatMessage(messages.floatingToolbarAriaLabel),
|
|
482
484
|
role: "toolbar",
|
|
483
|
-
"data-testid": "editor-floating-toolbar"
|
|
485
|
+
"data-testid": "editor-floating-toolbar"
|
|
486
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
487
|
+
,
|
|
484
488
|
className: className
|
|
485
489
|
}, jsx(Announcer, {
|
|
486
490
|
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(messages.floatingToolbarAnnouncer)) : intl.formatMessage(messages.floatingToolbarAnnouncer),
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ExtractInjectionAPI, FloatingToolbarConfig, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import type { ConfigWithNodeInfo, FloatingToolbarPlugin, FloatingToolbarPluginState } from './types';
|
|
5
6
|
export declare const getRelevantConfig: (selection: Selection, configs: Array<FloatingToolbarConfig>) => ConfigWithNodeInfo | undefined;
|
|
6
7
|
export declare const floatingToolbarPlugin: FloatingToolbarPlugin;
|
|
8
|
+
export declare function ContentComponent({ pluginInjectionApi, editorView, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, providerFactory, dispatchAnalyticsEvent, }: Pick<UiComponentFactoryParams, 'editorView' | 'popupsMountPoint' | 'popupsBoundariesElement' | 'providerFactory' | 'dispatchAnalyticsEvent' | 'popupsScrollableElement'> & {
|
|
9
|
+
pluginInjectionApi: ExtractInjectionAPI<FloatingToolbarPlugin> | undefined;
|
|
10
|
+
}): JSX.Element | null;
|
|
7
11
|
/**
|
|
8
12
|
*
|
|
9
13
|
* ProseMirror Plugin
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FloatingToolbarConfig, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
2
3
|
import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
3
4
|
import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
|
|
4
5
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
@@ -30,7 +31,8 @@ export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
|
30
31
|
OptionalPlugin<ExtensionPlugin>,
|
|
31
32
|
CopyButtonPlugin,
|
|
32
33
|
EditorDisabledPlugin,
|
|
33
|
-
OptionalPlugin<EditorViewModePlugin
|
|
34
|
+
OptionalPlugin<EditorViewModePlugin>,
|
|
35
|
+
OptionalPlugin<BlockControlsPlugin>
|
|
34
36
|
];
|
|
35
37
|
actions: {
|
|
36
38
|
forceFocusSelector: ForceFocusSelector;
|
|
@@ -9,5 +9,5 @@ interface ScrollButtonsProps {
|
|
|
9
9
|
node: Node;
|
|
10
10
|
disabled: boolean;
|
|
11
11
|
}
|
|
12
|
-
export declare const ScrollButtons: ({ intl, scrollContainerRef, node, disabled
|
|
12
|
+
export declare const ScrollButtons: ({ intl, scrollContainerRef, node, disabled }: ScrollButtonsProps) => jsx.JSX.Element | null;
|
|
13
13
|
export {};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ExtractInjectionAPI, FloatingToolbarConfig, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import type { ConfigWithNodeInfo, FloatingToolbarPlugin, FloatingToolbarPluginState } from './types';
|
|
5
6
|
export declare const getRelevantConfig: (selection: Selection, configs: Array<FloatingToolbarConfig>) => ConfigWithNodeInfo | undefined;
|
|
6
7
|
export declare const floatingToolbarPlugin: FloatingToolbarPlugin;
|
|
8
|
+
export declare function ContentComponent({ pluginInjectionApi, editorView, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, providerFactory, dispatchAnalyticsEvent, }: Pick<UiComponentFactoryParams, 'editorView' | 'popupsMountPoint' | 'popupsBoundariesElement' | 'providerFactory' | 'dispatchAnalyticsEvent' | 'popupsScrollableElement'> & {
|
|
9
|
+
pluginInjectionApi: ExtractInjectionAPI<FloatingToolbarPlugin> | undefined;
|
|
10
|
+
}): JSX.Element | null;
|
|
7
11
|
/**
|
|
8
12
|
*
|
|
9
13
|
* ProseMirror Plugin
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FloatingToolbarConfig, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
2
3
|
import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
3
4
|
import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
|
|
4
5
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
@@ -30,7 +31,8 @@ export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
|
30
31
|
OptionalPlugin<ExtensionPlugin>,
|
|
31
32
|
CopyButtonPlugin,
|
|
32
33
|
EditorDisabledPlugin,
|
|
33
|
-
OptionalPlugin<EditorViewModePlugin
|
|
34
|
+
OptionalPlugin<EditorViewModePlugin>,
|
|
35
|
+
OptionalPlugin<BlockControlsPlugin>
|
|
34
36
|
];
|
|
35
37
|
actions: {
|
|
36
38
|
forceFocusSelector: ForceFocusSelector;
|
|
@@ -9,5 +9,5 @@ interface ScrollButtonsProps {
|
|
|
9
9
|
node: Node;
|
|
10
10
|
disabled: boolean;
|
|
11
11
|
}
|
|
12
|
-
export declare const ScrollButtons: ({ intl, scrollContainerRef, node, disabled
|
|
12
|
+
export declare const ScrollButtons: ({ intl, scrollContainerRef, node, disabled }: ScrollButtonsProps) => jsx.JSX.Element | null;
|
|
13
13
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@atlaskit/adf-utils": "^19.2.0",
|
|
28
|
-
"@atlaskit/button": "^17.
|
|
29
|
-
"@atlaskit/checkbox": "^13.
|
|
30
|
-
"@atlaskit/editor-common": "^
|
|
28
|
+
"@atlaskit/button": "^17.17.0",
|
|
29
|
+
"@atlaskit/checkbox": "^13.4.0",
|
|
30
|
+
"@atlaskit/editor-common": "^82.0.0",
|
|
31
31
|
"@atlaskit/editor-palette": "1.6.0",
|
|
32
|
+
"@atlaskit/editor-plugin-block-controls": "^1.4.1",
|
|
32
33
|
"@atlaskit/editor-plugin-context-panel": "^1.1.0",
|
|
33
34
|
"@atlaskit/editor-plugin-copy-button": "^1.1.0",
|
|
34
35
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"@atlaskit/menu": "^2.3.0",
|
|
43
44
|
"@atlaskit/modal-dialog": "^12.13.0",
|
|
44
45
|
"@atlaskit/platform-feature-flags": "^0.2.5",
|
|
45
|
-
"@atlaskit/select": "^17.
|
|
46
|
+
"@atlaskit/select": "^17.10.0",
|
|
46
47
|
"@atlaskit/theme": "^12.8.0",
|
|
47
48
|
"@atlaskit/tokens": "^1.49.0",
|
|
48
49
|
"@atlaskit/tooltip": "^18.4.0",
|
|
@@ -58,7 +59,6 @@
|
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@atlaskit/visual-regression": "*",
|
|
61
|
-
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
62
62
|
"@testing-library/dom": "^8.17.1",
|
|
63
63
|
"@testing-library/react": "^12.1.5",
|
|
64
64
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -105,13 +105,15 @@
|
|
|
105
105
|
]
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
|
|
109
108
|
"platform-feature-flags": {
|
|
110
109
|
"platform.editor.a11y-floating-toolbar-markup_vexmo": {
|
|
111
110
|
"type": "boolean"
|
|
112
111
|
},
|
|
113
112
|
"platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33": {
|
|
114
113
|
"type": "boolean"
|
|
114
|
+
},
|
|
115
|
+
"platform.editor.drag-and-drop_wmv9t": {
|
|
116
|
+
"type": "boolean"
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
119
|
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/editor-plugin-floating-toolbar"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -30,33 +31,33 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
30
31
|
|
|
31
32
|
// @public (undocumented)
|
|
32
33
|
export type ConfigWithNodeInfo = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
config: FloatingToolbarConfig | undefined;
|
|
35
|
+
pos: number;
|
|
36
|
+
node: Node_2;
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
// @public
|
|
39
40
|
export type FloatingToolbarPlugin = NextEditorPlugin<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
'floatingToolbar',
|
|
42
|
+
{
|
|
43
|
+
dependencies: [
|
|
44
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
45
|
+
DecorationsPlugin,
|
|
46
|
+
OptionalPlugin<ContextPanelPlugin>,
|
|
47
|
+
OptionalPlugin<ExtensionPlugin>,
|
|
48
|
+
CopyButtonPlugin,
|
|
49
|
+
EditorDisabledPlugin,
|
|
50
|
+
];
|
|
51
|
+
actions: {
|
|
52
|
+
forceFocusSelector: ForceFocusSelector;
|
|
53
|
+
};
|
|
54
|
+
sharedState:
|
|
55
|
+
| undefined
|
|
56
|
+
| {
|
|
57
|
+
configWithNodeInfo: ConfigWithNodeInfo | undefined;
|
|
58
|
+
floatingToolbarData: FloatingToolbarPluginData | undefined;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
60
61
|
>;
|
|
61
62
|
|
|
62
63
|
// @public (undocumented)
|
|
@@ -64,20 +65,16 @@ export const floatingToolbarPlugin: FloatingToolbarPlugin;
|
|
|
64
65
|
|
|
65
66
|
// @public (undocumented)
|
|
66
67
|
export type FloatingToolbarPluginData = {
|
|
67
|
-
|
|
68
|
+
confirmDialogForItem?: number;
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
// @public (undocumented)
|
|
71
72
|
export type FloatingToolbarPluginState = {
|
|
72
|
-
|
|
73
|
-
state: EditorState,
|
|
74
|
-
) => ConfigWithNodeInfo | null | undefined;
|
|
73
|
+
getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
|
|
75
74
|
};
|
|
76
75
|
|
|
77
76
|
// @public (undocumented)
|
|
78
|
-
export type ForceFocusSelector = (
|
|
79
|
-
selector: null | string,
|
|
80
|
-
) => (tr: Transaction) => Transaction;
|
|
77
|
+
export type ForceFocusSelector = (selector: null | string) => (tr: Transaction) => Transaction;
|
|
81
78
|
|
|
82
79
|
// (No @packageDocumentation comment for this package)
|
|
83
80
|
```
|
|
@@ -90,7 +87,7 @@ export type ForceFocusSelector = (
|
|
|
90
87
|
|
|
91
88
|
```json
|
|
92
89
|
{
|
|
93
|
-
|
|
90
|
+
"react": "^16.8.0"
|
|
94
91
|
}
|
|
95
92
|
```
|
|
96
93
|
|