@atlaskit/editor-plugin-floating-toolbar 21.1.1 → 21.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 21.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c4d3272bbafce`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c4d3272bbafce) -
8
+ Add an opt-in LinkPickerOptions.popupContainerSurface ('default' | 'none') that lets a custom link
9
+ picker component (e.g. RovoLinkPicker) suppress the editor's floating toolbar popup surface
10
+ (background, box-shadow, border-radius, padding) when it renders its own complete surface.
11
+ Threaded through FloatingToolbarConfig/Toolbar's new containerSurface prop. Defaults to the
12
+ existing wrapper surface; only a caller that explicitly opts in is affected.
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
18
+ ## 21.2.0
19
+
20
+ ### Minor Changes
21
+
22
+ - [`9df8889f51f21`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9df8889f51f21) -
23
+ Add an opt-in LinkPickerOptions.popupContainerSurface ('default' | 'none') that lets a custom link
24
+ picker component (e.g. RovoLinkPicker) suppress the editor's floating toolbar popup surface
25
+ (background, box-shadow, border-radius, padding) when it renders its own complete surface.
26
+ Threaded through FloatingToolbarConfig/Toolbar's new containerSurface prop. Defaults to the
27
+ existing wrapper surface; only a caller that explicitly opts in is affected.
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies
32
+
3
33
  ## 21.1.1
4
34
 
5
35
  ### Patch Changes
@@ -292,6 +292,7 @@ function ContentComponent(_ref5) {
292
292
  align = _config$align === void 0 ? 'center' : _config$align,
293
293
  _config$className = config.className,
294
294
  className = _config$className === void 0 ? '' : _config$className,
295
+ containerSurface = config.containerSurface,
295
296
  height = config.height,
296
297
  width = config.width,
297
298
  zIndex = config.zIndex,
@@ -468,7 +469,8 @@ function ContentComponent(_ref5) {
468
469
  editorView: editorView
469
470
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
470
471
  ,
471
- className: className
472
+ className: className,
473
+ containerSurface: containerSurface
472
474
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
473
475
  ,
474
476
  focusEditor: function focusEditor() {
@@ -445,24 +445,33 @@ var buttonGroupStylesNew = (0, _react2.css)({
445
445
  display: 'flex',
446
446
  gap: "var(--ds-space-075, 6px)"
447
447
  });
448
+ var toolbarContainerBase = (0, _react2.css)({
449
+ display: 'flex',
450
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
451
+ lineHeight: 1,
452
+ boxSizing: 'border-box',
453
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
454
+ '& > div > div': {
455
+ alignItems: 'center'
456
+ }
457
+ });
448
458
 
449
459
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
450
460
  var toolbarContainer = function toolbarContainer(areAnyNewToolbarFlagsEnabled, scrollable, hasSelect, firstElementIsSelect) {
451
- return (0, _react2.css)({
461
+ var containerSurface = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'default';
462
+ return (0, _react2.css)(
463
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
464
+ containerSurface === 'none' ? undefined : {
452
465
  backgroundColor: "var(--ds-surface-overlay, #FFFFFF)",
453
466
  borderRadius: "var(--ds-radius-small, 3px)",
454
- boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)",
455
- display: 'flex',
456
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
457
- lineHeight: 1,
458
- boxSizing: 'border-box',
459
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
460
- '& > div > div': {
461
- alignItems: 'center'
462
- }
467
+ boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)"
463
468
  },
464
469
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
465
- scrollable ?
470
+ containerSurface === 'none' ?
471
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
472
+ (0, _react2.css)({
473
+ padding: "var(--ds-space-0, 0px)"
474
+ }) : scrollable ?
466
475
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
467
476
  (0, _react2.css)(
468
477
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -692,7 +701,8 @@ var Toolbar = /*#__PURE__*/function (_Component) {
692
701
  }, {
693
702
  key: "render",
694
703
  value: function render() {
695
- var _this$props$api2;
704
+ var _this$props$api2,
705
+ _this2 = this;
696
706
  var _this$props2 = this.props,
697
707
  items = _this$props2.items,
698
708
  className = _this$props2.className,
@@ -720,7 +730,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
720
730
  }, (0, _react2.jsx)("div", {
721
731
  ref: this.toolbarContainerRef,
722
732
  css: function css() {
723
- return [toolbarContainer(areAnyNewToolbarFlagsEnabled, scrollable, hasSelect !== undefined, firstElementIsSelect)];
733
+ return [toolbarContainerBase, toolbarContainer(areAnyNewToolbarFlagsEnabled, scrollable, hasSelect !== undefined, firstElementIsSelect, _this2.props.containerSurface)];
724
734
  },
725
735
  "aria-label": intl.formatMessage(_floatingToolbar.messages.floatingToolbarAriaLabel),
726
736
  role: "toolbar",
@@ -283,6 +283,7 @@ export function ContentComponent({
283
283
  getDomRef = getDomRefFromSelection,
284
284
  align = 'center',
285
285
  className = '',
286
+ containerSurface,
286
287
  height,
287
288
  width,
288
289
  zIndex,
@@ -450,7 +451,8 @@ export function ContentComponent({
450
451
  editorView: editorView
451
452
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
452
453
  ,
453
- className: className
454
+ className: className,
455
+ containerSurface: containerSurface
454
456
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
455
457
  ,
456
458
  focusEditor: () => editorView.focus(),
@@ -413,12 +413,7 @@ const buttonGroupStylesNew = css({
413
413
  display: 'flex',
414
414
  gap: "var(--ds-space-075, 6px)"
415
415
  });
416
-
417
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
418
- const toolbarContainer = (areAnyNewToolbarFlagsEnabled, scrollable, hasSelect, firstElementIsSelect) => css({
419
- backgroundColor: "var(--ds-surface-overlay, #FFFFFF)",
420
- borderRadius: "var(--ds-radius-small, 3px)",
421
- boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)",
416
+ const toolbarContainerBase = css({
422
417
  display: 'flex',
423
418
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
424
419
  lineHeight: 1,
@@ -427,9 +422,25 @@ const toolbarContainer = (areAnyNewToolbarFlagsEnabled, scrollable, hasSelect, f
427
422
  '& > div > div': {
428
423
  alignItems: 'center'
429
424
  }
425
+ });
426
+
427
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
428
+ const toolbarContainer = (areAnyNewToolbarFlagsEnabled, scrollable, hasSelect, firstElementIsSelect,
429
+ // See `FloatingToolbarConfig.containerSurface`: 'none' is for a single custom item that
430
+ // already renders its own complete surface, so this wrapper's own surface is omitted.
431
+ containerSurface = 'default') => css(
432
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
433
+ containerSurface === 'none' ? undefined : {
434
+ backgroundColor: "var(--ds-surface-overlay, #FFFFFF)",
435
+ borderRadius: "var(--ds-radius-small, 3px)",
436
+ boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)"
430
437
  },
431
438
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
432
- scrollable ?
439
+ containerSurface === 'none' ?
440
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
441
+ css({
442
+ padding: "var(--ds-space-0, 0px)"
443
+ }) : scrollable ?
433
444
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
434
445
  css(
435
446
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -674,7 +685,7 @@ class Toolbar extends Component {
674
685
  intl: intl
675
686
  }, jsx("div", {
676
687
  ref: this.toolbarContainerRef,
677
- css: () => [toolbarContainer(areAnyNewToolbarFlagsEnabled, scrollable, hasSelect !== undefined, firstElementIsSelect)],
688
+ css: () => [toolbarContainerBase, toolbarContainer(areAnyNewToolbarFlagsEnabled, scrollable, hasSelect !== undefined, firstElementIsSelect, this.props.containerSurface)],
678
689
  "aria-label": intl.formatMessage(messages.floatingToolbarAriaLabel),
679
690
  role: "toolbar",
680
691
  "data-testid": "editor-floating-toolbar"
@@ -282,6 +282,7 @@ export function ContentComponent(_ref5) {
282
282
  align = _config$align === void 0 ? 'center' : _config$align,
283
283
  _config$className = config.className,
284
284
  className = _config$className === void 0 ? '' : _config$className,
285
+ containerSurface = config.containerSurface,
285
286
  height = config.height,
286
287
  width = config.width,
287
288
  zIndex = config.zIndex,
@@ -458,7 +459,8 @@ export function ContentComponent(_ref5) {
458
459
  editorView: editorView
459
460
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
460
461
  ,
461
- className: className
462
+ className: className,
463
+ containerSurface: containerSurface
462
464
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
463
465
  ,
464
466
  focusEditor: function focusEditor() {
@@ -440,24 +440,33 @@ var buttonGroupStylesNew = css({
440
440
  display: 'flex',
441
441
  gap: "var(--ds-space-075, 6px)"
442
442
  });
443
+ var toolbarContainerBase = css({
444
+ display: 'flex',
445
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
446
+ lineHeight: 1,
447
+ boxSizing: 'border-box',
448
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
449
+ '& > div > div': {
450
+ alignItems: 'center'
451
+ }
452
+ });
443
453
 
444
454
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
445
455
  var toolbarContainer = function toolbarContainer(areAnyNewToolbarFlagsEnabled, scrollable, hasSelect, firstElementIsSelect) {
446
- return css({
456
+ var containerSurface = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'default';
457
+ return css(
458
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
459
+ containerSurface === 'none' ? undefined : {
447
460
  backgroundColor: "var(--ds-surface-overlay, #FFFFFF)",
448
461
  borderRadius: "var(--ds-radius-small, 3px)",
449
- boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)",
450
- display: 'flex',
451
- // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
452
- lineHeight: 1,
453
- boxSizing: 'border-box',
454
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
455
- '& > div > div': {
456
- alignItems: 'center'
457
- }
462
+ boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)"
458
463
  },
459
464
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
460
- scrollable ?
465
+ containerSurface === 'none' ?
466
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
467
+ css({
468
+ padding: "var(--ds-space-0, 0px)"
469
+ }) : scrollable ?
461
470
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
462
471
  css(
463
472
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -687,7 +696,8 @@ var Toolbar = /*#__PURE__*/function (_Component) {
687
696
  }, {
688
697
  key: "render",
689
698
  value: function render() {
690
- var _this$props$api2;
699
+ var _this$props$api2,
700
+ _this2 = this;
691
701
  var _this$props2 = this.props,
692
702
  items = _this$props2.items,
693
703
  className = _this$props2.className,
@@ -715,7 +725,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
715
725
  }, jsx("div", {
716
726
  ref: this.toolbarContainerRef,
717
727
  css: function css() {
718
- return [toolbarContainer(areAnyNewToolbarFlagsEnabled, scrollable, hasSelect !== undefined, firstElementIsSelect)];
728
+ return [toolbarContainerBase, toolbarContainer(areAnyNewToolbarFlagsEnabled, scrollable, hasSelect !== undefined, firstElementIsSelect, _this2.props.containerSurface)];
719
729
  },
720
730
  "aria-label": intl.formatMessage(messages.floatingToolbarAriaLabel),
721
731
  role: "toolbar",
@@ -15,6 +15,8 @@ import type { FloatingToolbarPlugin } from '../floatingToolbarPluginType';
15
15
  export interface Props {
16
16
  api: ExtractInjectionAPI<FloatingToolbarPlugin> | undefined;
17
17
  className?: string;
18
+ /** See `FloatingToolbarConfig.containerSurface`. Defaults to `'default'`. */
19
+ containerSurface?: 'default' | 'none';
18
20
  dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
19
21
  dispatchCommand: (command?: Function) => void;
20
22
  editorView?: EditorView;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "21.1.1",
3
+ "version": "21.3.0",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -22,7 +22,7 @@
22
22
  "atlaskit:src": "src/index.ts",
23
23
  "dependencies": {
24
24
  "@atlaskit/adf-utils": "^20.9.0",
25
- "@atlaskit/button": "^25.3.0",
25
+ "@atlaskit/button": "^25.4.0",
26
26
  "@atlaskit/checkbox": "^19.2.0",
27
27
  "@atlaskit/editor-palette": "^3.5.0",
28
28
  "@atlaskit/editor-plugin-analytics": "^19.0.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": "^22.11.0",
47
- "@atlaskit/tmp-editor-statsig": "^201.0.0",
47
+ "@atlaskit/tmp-editor-statsig": "^202.0.0",
48
48
  "@atlaskit/tokens": "^18.2.0",
49
49
  "@atlaskit/tooltip": "^24.3.0",
50
50
  "@babel/runtime": "^7.0.0",
@@ -56,7 +56,7 @@
56
56
  "react-loosely-lazy": "^1.0.0"
57
57
  },
58
58
  "peerDependencies": {
59
- "@atlaskit/editor-common": "^123.2.0",
59
+ "@atlaskit/editor-common": "^123.5.0",
60
60
  "react": "^18.2.0 || ^19.2.0",
61
61
  "react-dom": "^18.2.0 || ^19.2.0",
62
62
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"