@atlaskit/editor-plugin-floating-toolbar 2.0.0 → 2.0.2

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,27 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#118581](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/118581)
8
+ [`8e3b48ccfe22f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e3b48ccfe22f) -
9
+ Persist block menu while mouse moving
10
+ - Updated dependencies
11
+
12
+ ## 2.0.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [#117485](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/117485)
17
+ [`e9a8d9ba26963`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e9a8d9ba26963) -
18
+ Reorder icons, and remove some based on new editor controls. Changes under
19
+ `editor_plugin_controls` experiment.
20
+ - [#118657](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/118657)
21
+ [`849aa409da86d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/849aa409da86d) -
22
+ [ux] ED-26673 Toolbar overflow menu shows active docking preference
23
+ - Updated dependencies
24
+
3
25
  ## 2.0.0
4
26
 
5
27
  ### Major Changes
@@ -238,6 +238,9 @@ function ContentComponent(_ref6) {
238
238
  if (blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isDragging) {
239
239
  return null;
240
240
  }
241
+ if (blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isMenuOpen && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
242
+ return null;
243
+ }
241
244
  var config = configWithNodeInfo.config,
242
245
  node = configWithNodeInfo.node;
243
246
  var items = config.items;
@@ -41,7 +41,7 @@ var separatorStyles = (0, _react2.css)({
41
41
  height: "var(--ds-space-025, 1px)"
42
42
  });
43
43
  var headingStyles = (0, _react2.css)({
44
- padding: "var(--ds-space-100, 8px)".concat(" 0")
44
+ padding: "var(--ds-space-200, 16px)".concat(" 0 ", "var(--ds-space-100, 8px)")
45
45
  });
46
46
 
47
47
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
@@ -190,7 +190,7 @@ var DropdownMenuItem = function DropdownMenuItem(props) {
190
190
  };
191
191
  });
192
192
  var itemContent = (0, _react2.jsx)(DropdownButtonItem, {
193
- isSelected: (0, _experiments.editorExperiment)('advanced_layouts', true) ? itemSelected : undefined,
193
+ isSelected: itemSelected,
194
194
  iconBefore: iconBefore,
195
195
  iconAfter: item.elemAfter,
196
196
  onClick: handleItemClick,
@@ -453,7 +453,7 @@ var ToolbarItemsCollapsable = /*#__PURE__*/_react.default.memo(function (_ref2)
453
453
 
454
454
  // NOTE: Unsure if collapse/expand logic will be needed, for now hard code for cards
455
455
  var isCard = node.type.name === 'inlineCard' || node.type.name === 'blockCard' || node.type.name === 'embedCard';
456
- var updatedItems = isCard ? getFormattedItems(items.map(function (item) {
456
+ var updatedItems = isCard && items.length > 1 ? getFormattedItems(items.map(function (item) {
457
457
  if ('id' in item && (item.id === 'editor.link.openLink' || item.id === 'editor.floatingToolbar.copy' || item.id === 'editor.link.commentLink')) {
458
458
  return item;
459
459
  }
@@ -222,6 +222,9 @@ export function ContentComponent({
222
222
  if (blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isDragging) {
223
223
  return null;
224
224
  }
225
+ if (blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isMenuOpen && editorExperiment('platform_editor_controls', 'variant1')) {
226
+ return null;
227
+ }
225
228
  const {
226
229
  config,
227
230
  node
@@ -31,7 +31,7 @@ const separatorStyles = css({
31
31
  height: "var(--ds-space-025, 1px)"
32
32
  });
33
33
  const headingStyles = css({
34
- padding: `${"var(--ds-space-100, 8px)"} 0`
34
+ padding: `${"var(--ds-space-200, 16px)"} 0 ${"var(--ds-space-100, 8px)"}`
35
35
  });
36
36
 
37
37
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
@@ -181,7 +181,7 @@ const DropdownMenuItem = props => {
181
181
  };
182
182
  });
183
183
  const itemContent = jsx(DropdownButtonItem, {
184
- isSelected: editorExperiment('advanced_layouts', true) ? itemSelected : undefined,
184
+ isSelected: itemSelected,
185
185
  iconBefore: iconBefore,
186
186
  iconAfter: item.elemAfter,
187
187
  onClick: handleItemClick,
@@ -411,7 +411,7 @@ const ToolbarItemsCollapsable = /*#__PURE__*/React.memo(({
411
411
 
412
412
  // NOTE: Unsure if collapse/expand logic will be needed, for now hard code for cards
413
413
  const isCard = node.type.name === 'inlineCard' || node.type.name === 'blockCard' || node.type.name === 'embedCard';
414
- const updatedItems = isCard ? getFormattedItems(items.map(item => {
414
+ const updatedItems = isCard && items.length > 1 ? getFormattedItems(items.map(item => {
415
415
  if ('id' in item && (item.id === 'editor.link.openLink' || item.id === 'editor.floatingToolbar.copy' || item.id === 'editor.link.commentLink')) {
416
416
  return item;
417
417
  }
@@ -226,6 +226,9 @@ export function ContentComponent(_ref6) {
226
226
  if (blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isDragging) {
227
227
  return null;
228
228
  }
229
+ if (blockControlsState !== null && blockControlsState !== void 0 && blockControlsState.isMenuOpen && editorExperiment('platform_editor_controls', 'variant1')) {
230
+ return null;
231
+ }
229
232
  var config = configWithNodeInfo.config,
230
233
  node = configWithNodeInfo.node;
231
234
  var items = config.items;
@@ -32,7 +32,7 @@ var separatorStyles = css({
32
32
  height: "var(--ds-space-025, 1px)"
33
33
  });
34
34
  var headingStyles = css({
35
- padding: "var(--ds-space-100, 8px)".concat(" 0")
35
+ padding: "var(--ds-space-200, 16px)".concat(" 0 ", "var(--ds-space-100, 8px)")
36
36
  });
37
37
 
38
38
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
@@ -181,7 +181,7 @@ var DropdownMenuItem = function DropdownMenuItem(props) {
181
181
  };
182
182
  });
183
183
  var itemContent = jsx(DropdownButtonItem, {
184
- isSelected: editorExperiment('advanced_layouts', true) ? itemSelected : undefined,
184
+ isSelected: itemSelected,
185
185
  iconBefore: iconBefore,
186
186
  iconAfter: item.elemAfter,
187
187
  onClick: handleItemClick,
@@ -446,7 +446,7 @@ var ToolbarItemsCollapsable = /*#__PURE__*/React.memo(function (_ref2) {
446
446
 
447
447
  // NOTE: Unsure if collapse/expand logic will be needed, for now hard code for cards
448
448
  var isCard = node.type.name === 'inlineCard' || node.type.name === 'blockCard' || node.type.name === 'embedCard';
449
- var updatedItems = isCard ? getFormattedItems(items.map(function (item) {
449
+ var updatedItems = isCard && items.length > 1 ? getFormattedItems(items.map(function (item) {
450
450
  if ('id' in item && (item.id === 'editor.link.openLink' || item.id === 'editor.floatingToolbar.copy' || item.id === 'editor.link.commentLink')) {
451
451
  return item;
452
452
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -24,11 +24,11 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@atlaskit/adf-utils": "^19.18.0",
27
- "@atlaskit/button": "^21.0.0",
27
+ "@atlaskit/button": "^21.1.0",
28
28
  "@atlaskit/checkbox": "^16.0.0",
29
- "@atlaskit/editor-common": "^100.0.0",
29
+ "@atlaskit/editor-common": "^100.2.0",
30
30
  "@atlaskit/editor-palette": "2.0.0",
31
- "@atlaskit/editor-plugin-block-controls": "^3.0.0",
31
+ "@atlaskit/editor-plugin-block-controls": "^3.1.0",
32
32
  "@atlaskit/editor-plugin-context-panel": "^3.0.0",
33
33
  "@atlaskit/editor-plugin-copy-button": "^2.0.0",
34
34
  "@atlaskit/editor-plugin-decorations": "^2.0.0",
@@ -36,18 +36,18 @@
36
36
  "@atlaskit/editor-plugin-editor-viewmode": "^3.0.0",
37
37
  "@atlaskit/editor-plugin-emoji": "^3.0.0",
38
38
  "@atlaskit/editor-plugin-extension": "^4.0.0",
39
- "@atlaskit/editor-plugin-table": "^10.0.0",
39
+ "@atlaskit/editor-plugin-table": "^10.1.0",
40
40
  "@atlaskit/editor-prosemirror": "7.0.0",
41
41
  "@atlaskit/emoji": "^68.0.0",
42
- "@atlaskit/icon": "^24.0.0",
43
- "@atlaskit/menu": "^3.0.0",
42
+ "@atlaskit/icon": "^24.1.0",
43
+ "@atlaskit/menu": "^3.1.0",
44
44
  "@atlaskit/modal-dialog": "^13.0.0",
45
45
  "@atlaskit/platform-feature-flags": "^1.1.0",
46
- "@atlaskit/primitives": "^14.0.0",
46
+ "@atlaskit/primitives": "^14.1.0",
47
47
  "@atlaskit/select": "^19.0.0",
48
48
  "@atlaskit/theme": "^17.0.0",
49
- "@atlaskit/tmp-editor-statsig": "^3.0.0",
50
- "@atlaskit/tokens": "^4.0.0",
49
+ "@atlaskit/tmp-editor-statsig": "^3.2.0",
50
+ "@atlaskit/tokens": "^4.2.0",
51
51
  "@atlaskit/tooltip": "^20.0.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@emotion/react": "^11.7.1",