@atlaskit/editor-plugin-floating-toolbar 3.2.3 → 3.2.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 +19 -0
- package/dist/cjs/ui/Toolbar.js +22 -3
- package/dist/es2019/ui/Toolbar.js +22 -3
- package/dist/esm/ui/Toolbar.js +22 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 3.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#128611](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128611)
|
|
8
|
+
[`428548761fab9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/428548761fab9) -
|
|
9
|
+
[ux] ED-27133 fix toolbar link button
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.2.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#127441](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/127441)
|
|
17
|
+
[`f2f4b5971e0b2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2f4b5971e0b2) -
|
|
18
|
+
[ux] Updates Text Formatting toolbar separators, active option style and removes range selection
|
|
19
|
+
when the toolbar is docked to top.
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 3.2.3
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -417,6 +417,19 @@ var toolbarContainer = function toolbarContainer(scrollable, hasSelect, firstEle
|
|
|
417
417
|
}), {
|
|
418
418
|
overflow: 'hidden'
|
|
419
419
|
}) :
|
|
420
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
421
|
+
(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ?
|
|
422
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
423
|
+
(0, _react2.css)({
|
|
424
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
425
|
+
padding: "var(--ds-space-0, 0)".concat(" 4px ", "var(--ds-space-0, 0)", " 4px")
|
|
426
|
+
},
|
|
427
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
428
|
+
firstElementIsSelect &&
|
|
429
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
430
|
+
(0, _react2.css)({
|
|
431
|
+
paddingLeft: "var(--ds-space-050, 4px)"
|
|
432
|
+
})) :
|
|
420
433
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
421
434
|
(0, _react2.css)({
|
|
422
435
|
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)")
|
|
@@ -532,8 +545,14 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
532
545
|
event.preventDefault();
|
|
533
546
|
event.stopPropagation();
|
|
534
547
|
});
|
|
535
|
-
(0, _defineProperty2.default)(_this, "
|
|
536
|
-
|
|
548
|
+
(0, _defineProperty2.default)(_this, "captureMouseEvent", function (event) {
|
|
549
|
+
var _this$props$items2;
|
|
550
|
+
// Don't capture mouse event for custom toolbars e.g. insert hyperlink
|
|
551
|
+
if (((_this$props$items2 = _this.props.items) === null || _this$props$items2 === void 0 ? void 0 : _this$props$items2.length) === 1 && _this.props.items[0].type === 'custom') {
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// Prevents toolbar from closing when clicking on the toolbar itself and not on the buttons
|
|
537
556
|
event.stopPropagation();
|
|
538
557
|
event.preventDefault();
|
|
539
558
|
});
|
|
@@ -653,7 +672,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
653
672
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
654
673
|
,
|
|
655
674
|
className: className,
|
|
656
|
-
onMouseDown: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? this.
|
|
675
|
+
onMouseDown: (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? this.captureMouseEvent : undefined
|
|
657
676
|
}, (0, _react2.jsx)(_ui.Announcer, {
|
|
658
677
|
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer)) : intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer),
|
|
659
678
|
delay: 250
|
|
@@ -383,6 +383,19 @@ css({
|
|
|
383
383
|
}), {
|
|
384
384
|
overflow: 'hidden'
|
|
385
385
|
}) :
|
|
386
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
387
|
+
editorExperiment('platform_editor_controls', 'variant1') ?
|
|
388
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
389
|
+
css({
|
|
390
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
391
|
+
padding: `${"var(--ds-space-0, 0)"} 4px ${"var(--ds-space-0, 0)"} 4px`
|
|
392
|
+
},
|
|
393
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
394
|
+
firstElementIsSelect &&
|
|
395
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
396
|
+
css({
|
|
397
|
+
paddingLeft: "var(--ds-space-050, 4px)"
|
|
398
|
+
})) :
|
|
386
399
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
387
400
|
css({
|
|
388
401
|
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-100, 8px)"}`
|
|
@@ -492,8 +505,14 @@ class Toolbar extends Component {
|
|
|
492
505
|
event.preventDefault();
|
|
493
506
|
event.stopPropagation();
|
|
494
507
|
});
|
|
495
|
-
_defineProperty(this, "
|
|
496
|
-
|
|
508
|
+
_defineProperty(this, "captureMouseEvent", event => {
|
|
509
|
+
var _this$props$items2;
|
|
510
|
+
// Don't capture mouse event for custom toolbars e.g. insert hyperlink
|
|
511
|
+
if (((_this$props$items2 = this.props.items) === null || _this$props$items2 === void 0 ? void 0 : _this$props$items2.length) === 1 && this.props.items[0].type === 'custom') {
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// Prevents toolbar from closing when clicking on the toolbar itself and not on the buttons
|
|
497
516
|
event.stopPropagation();
|
|
498
517
|
event.preventDefault();
|
|
499
518
|
});
|
|
@@ -603,7 +622,7 @@ class Toolbar extends Component {
|
|
|
603
622
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
604
623
|
,
|
|
605
624
|
className: className,
|
|
606
|
-
onMouseDown: editorExperiment('platform_editor_controls', 'variant1') ? this.
|
|
625
|
+
onMouseDown: editorExperiment('platform_editor_controls', 'variant1') ? this.captureMouseEvent : undefined
|
|
607
626
|
}, jsx(Announcer, {
|
|
608
627
|
text: mediaAssistiveMessage ? `${mediaAssistiveMessage}, ${intl.formatMessage(messages.floatingToolbarAnnouncer)}` : intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
609
628
|
delay: 250
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -410,6 +410,19 @@ var toolbarContainer = function toolbarContainer(scrollable, hasSelect, firstEle
|
|
|
410
410
|
}), {
|
|
411
411
|
overflow: 'hidden'
|
|
412
412
|
}) :
|
|
413
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
414
|
+
editorExperiment('platform_editor_controls', 'variant1') ?
|
|
415
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
416
|
+
css({
|
|
417
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
418
|
+
padding: "var(--ds-space-0, 0)".concat(" 4px ", "var(--ds-space-0, 0)", " 4px")
|
|
419
|
+
},
|
|
420
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
421
|
+
firstElementIsSelect &&
|
|
422
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
423
|
+
css({
|
|
424
|
+
paddingLeft: "var(--ds-space-050, 4px)"
|
|
425
|
+
})) :
|
|
413
426
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
414
427
|
css({
|
|
415
428
|
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)")
|
|
@@ -525,8 +538,14 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
525
538
|
event.preventDefault();
|
|
526
539
|
event.stopPropagation();
|
|
527
540
|
});
|
|
528
|
-
_defineProperty(_this, "
|
|
529
|
-
|
|
541
|
+
_defineProperty(_this, "captureMouseEvent", function (event) {
|
|
542
|
+
var _this$props$items2;
|
|
543
|
+
// Don't capture mouse event for custom toolbars e.g. insert hyperlink
|
|
544
|
+
if (((_this$props$items2 = _this.props.items) === null || _this$props$items2 === void 0 ? void 0 : _this$props$items2.length) === 1 && _this.props.items[0].type === 'custom') {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// Prevents toolbar from closing when clicking on the toolbar itself and not on the buttons
|
|
530
549
|
event.stopPropagation();
|
|
531
550
|
event.preventDefault();
|
|
532
551
|
});
|
|
@@ -646,7 +665,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
646
665
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
647
666
|
,
|
|
648
667
|
className: className,
|
|
649
|
-
onMouseDown: editorExperiment('platform_editor_controls', 'variant1') ? this.
|
|
668
|
+
onMouseDown: editorExperiment('platform_editor_controls', 'variant1') ? this.captureMouseEvent : undefined
|
|
650
669
|
}, jsx(Announcer, {
|
|
651
670
|
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(messages.floatingToolbarAnnouncer)) : intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
652
671
|
delay: 250
|