@atlaskit/editor-plugin-floating-toolbar 0.7.9 → 0.7.11

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,37 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 0.7.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43825](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43825) [`135446e0465`](https://bitbucket.org/atlassian/atlassian-frontend/commits/135446e0465) - [ED-20885] Add setTimeout to make sure a tooltip for a dropdown item renders at the correct position
8
+
9
+ ## 0.7.10
10
+
11
+ ### Patch Changes
12
+
13
+ - [#43646](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43646) [`d43f8e9402f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d43f8e9402f) - Make feature flags plugin optional in all plugins including:
14
+
15
+ - analytics
16
+ - base
17
+ - card
18
+ - code-block
19
+ - expand
20
+ - extension
21
+ - floating-toolbar
22
+ - hyperlink
23
+ - insert-block
24
+ - layout
25
+ - layout
26
+ - list
27
+ - media
28
+ - paste
29
+ - rule
30
+ - table
31
+ - tasks-and-decisions
32
+
33
+ We already treat it as optional in the plugins, so this is just ensuring that the plugin is not mandatory to be added to the preset.
34
+
3
35
  ## 0.7.9
4
36
 
5
37
  ### Patch Changes
@@ -204,11 +204,17 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
204
204
  if (this.state.isOpen && this.state.isOpenedByKeyboard) {
205
205
  var dropList = document.querySelector('[data-role="droplistContent"]');
206
206
  if (dropList) {
207
- var keyboardEvent = new KeyboardEvent('keydown', {
208
- bubbles: true,
209
- key: 'ArrowDown'
210
- });
211
- dropList.dispatchEvent(keyboardEvent);
207
+ // Add setTimeout so that if a dropdown item has tooltip,
208
+ // the tooltip won't be rendered until next render cycle
209
+ // when the droplist is correctly positioned.
210
+ // This makes tooltip appears at the correct position for the first dropdown item.
211
+ setTimeout(function () {
212
+ var keyboardEvent = new KeyboardEvent('keydown', {
213
+ bubbles: true,
214
+ key: 'ArrowDown'
215
+ });
216
+ dropList.dispatchEvent(keyboardEvent);
217
+ }, 0);
212
218
  }
213
219
  }
214
220
  }
@@ -180,11 +180,17 @@ export default class Dropdown extends Component {
180
180
  if (this.state.isOpen && this.state.isOpenedByKeyboard) {
181
181
  const dropList = document.querySelector('[data-role="droplistContent"]');
182
182
  if (dropList) {
183
- const keyboardEvent = new KeyboardEvent('keydown', {
184
- bubbles: true,
185
- key: 'ArrowDown'
186
- });
187
- dropList.dispatchEvent(keyboardEvent);
183
+ // Add setTimeout so that if a dropdown item has tooltip,
184
+ // the tooltip won't be rendered until next render cycle
185
+ // when the droplist is correctly positioned.
186
+ // This makes tooltip appears at the correct position for the first dropdown item.
187
+ setTimeout(() => {
188
+ const keyboardEvent = new KeyboardEvent('keydown', {
189
+ bubbles: true,
190
+ key: 'ArrowDown'
191
+ });
192
+ dropList.dispatchEvent(keyboardEvent);
193
+ }, 0);
188
194
  }
189
195
  }
190
196
  }
@@ -196,11 +196,17 @@ var Dropdown = /*#__PURE__*/function (_Component) {
196
196
  if (this.state.isOpen && this.state.isOpenedByKeyboard) {
197
197
  var dropList = document.querySelector('[data-role="droplistContent"]');
198
198
  if (dropList) {
199
- var keyboardEvent = new KeyboardEvent('keydown', {
200
- bubbles: true,
201
- key: 'ArrowDown'
202
- });
203
- dropList.dispatchEvent(keyboardEvent);
199
+ // Add setTimeout so that if a dropdown item has tooltip,
200
+ // the tooltip won't be rendered until next render cycle
201
+ // when the droplist is correctly positioned.
202
+ // This makes tooltip appears at the correct position for the first dropdown item.
203
+ setTimeout(function () {
204
+ var keyboardEvent = new KeyboardEvent('keydown', {
205
+ bubbles: true,
206
+ key: 'ArrowDown'
207
+ });
208
+ dropList.dispatchEvent(keyboardEvent);
209
+ }, 0);
204
210
  }
205
211
  }
206
212
  }
@@ -25,7 +25,7 @@ export type ForceFocusSelector = (selector: string | null) => (tr: Transaction)
25
25
  */
26
26
  export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
27
27
  dependencies: [
28
- FeatureFlagsPlugin,
28
+ OptionalPlugin<FeatureFlagsPlugin>,
29
29
  DecorationsPlugin,
30
30
  OptionalPlugin<ContextPanelPlugin>,
31
31
  OptionalPlugin<ExtensionPlugin>,
@@ -25,7 +25,7 @@ export type ForceFocusSelector = (selector: string | null) => (tr: Transaction)
25
25
  */
26
26
  export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
27
27
  dependencies: [
28
- FeatureFlagsPlugin,
28
+ OptionalPlugin<FeatureFlagsPlugin>,
29
29
  DecorationsPlugin,
30
30
  OptionalPlugin<ContextPanelPlugin>,
31
31
  OptionalPlugin<ExtensionPlugin>,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -27,7 +27,7 @@
27
27
  "@atlaskit/adf-utils": "^19.0.0",
28
28
  "@atlaskit/button": "^16.17.0",
29
29
  "@atlaskit/checkbox": "^13.0.0",
30
- "@atlaskit/editor-common": "^76.22.0",
30
+ "@atlaskit/editor-common": "^76.23.0",
31
31
  "@atlaskit/editor-palette": "1.5.2",
32
32
  "@atlaskit/editor-plugin-context-panel": "^0.2.0",
33
33
  "@atlaskit/editor-plugin-copy-button": "^1.0.0",
@@ -35,15 +35,15 @@
35
35
  "@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
36
36
  "@atlaskit/editor-plugin-extension": "^0.4.0",
37
37
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
38
- "@atlaskit/editor-plugin-table": "^5.3.0",
38
+ "@atlaskit/editor-plugin-table": "^5.4.0",
39
39
  "@atlaskit/editor-prosemirror": "1.1.0",
40
40
  "@atlaskit/emoji": "^67.6.0",
41
41
  "@atlaskit/icon": "^22.0.0",
42
42
  "@atlaskit/menu": "^2.1.0",
43
- "@atlaskit/modal-dialog": "^12.8.0",
43
+ "@atlaskit/modal-dialog": "^12.9.0",
44
44
  "@atlaskit/select": "^17.0.0",
45
45
  "@atlaskit/theme": "^12.6.0",
46
- "@atlaskit/tokens": "^1.28.0",
46
+ "@atlaskit/tokens": "^1.29.0",
47
47
  "@atlaskit/tooltip": "^18.0.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1",
package/report.api.md CHANGED
@@ -40,7 +40,7 @@ export type FloatingToolbarPlugin = NextEditorPlugin<
40
40
  'floatingToolbar',
41
41
  {
42
42
  dependencies: [
43
- FeatureFlagsPlugin,
43
+ OptionalPlugin<FeatureFlagsPlugin>,
44
44
  DecorationsPlugin,
45
45
  OptionalPlugin<ContextPanelPlugin>,
46
46
  OptionalPlugin<ExtensionPlugin>,
@@ -27,7 +27,7 @@ export type ConfigWithNodeInfo = {
27
27
  // @public
28
28
  export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
29
29
  dependencies: [
30
- FeatureFlagsPlugin,
30
+ OptionalPlugin<FeatureFlagsPlugin>,
31
31
  DecorationsPlugin,
32
32
  OptionalPlugin<ContextPanelPlugin>,
33
33
  OptionalPlugin<ExtensionPlugin>,