@atlaskit/editor-plugin-insert-block 2.4.14 → 2.4.15

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,13 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 2.4.15
4
+
5
+ ### Patch Changes
6
+
7
+ - [#168711](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/168711)
8
+ [`b2f2dc82e10b3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b2f2dc82e10b3) -
9
+ Memoises the CellMeasurerCache used in the insert menu
10
+
3
11
  ## 2.4.14
4
12
 
5
13
  ### Patch Changes
@@ -46,13 +46,13 @@ var InsertMenu = function InsertMenu(_ref) {
46
46
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
47
47
  height = _useState4[0],
48
48
  setHeight = _useState4[1];
49
-
50
- // eslint-disable-next-line react-hooks/exhaustive-deps
51
- var cache = new _CellMeasurer.CellMeasurerCache({
52
- fixedWidth: true,
53
- defaultHeight: _elementBrowser.ELEMENT_ITEM_HEIGHT,
54
- minHeight: _elementBrowser.ELEMENT_ITEM_HEIGHT
55
- });
49
+ var cache = (0, _react.useMemo)(function () {
50
+ return new _CellMeasurer.CellMeasurerCache({
51
+ fixedWidth: true,
52
+ defaultHeight: _elementBrowser.ELEMENT_ITEM_HEIGHT,
53
+ minHeight: _elementBrowser.ELEMENT_ITEM_HEIGHT
54
+ });
55
+ }, []);
56
56
  (0, _react.useLayoutEffect)(function () {
57
57
  // Figure based on visuals to exclude the searchbar, padding/margin, and the ViewMore item.
58
58
  var EXTRA_SPACE_EXCLUDING_ELEMENTLIST = 128;
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  * @jsx jsx
5
5
  */
6
6
 
7
- import { useCallback, useContext, useLayoutEffect, useState } from 'react';
7
+ import { useCallback, useContext, useLayoutEffect, useMemo, useState } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
@@ -32,13 +32,13 @@ const InsertMenu = ({
32
32
  var _pluginInjectionApi$q7, _pluginInjectionApi$q8, _pluginInjectionApi$q9;
33
33
  const [itemCount, setItemCount] = useState(0);
34
34
  const [height, setHeight] = useState(DEFAULT_HEIGHT);
35
-
36
- // eslint-disable-next-line react-hooks/exhaustive-deps
37
- const cache = new CellMeasurerCache({
38
- fixedWidth: true,
39
- defaultHeight: ELEMENT_ITEM_HEIGHT,
40
- minHeight: ELEMENT_ITEM_HEIGHT
41
- });
35
+ const cache = useMemo(() => {
36
+ return new CellMeasurerCache({
37
+ fixedWidth: true,
38
+ defaultHeight: ELEMENT_ITEM_HEIGHT,
39
+ minHeight: ELEMENT_ITEM_HEIGHT
40
+ });
41
+ }, []);
42
42
  useLayoutEffect(() => {
43
43
  // Figure based on visuals to exclude the searchbar, padding/margin, and the ViewMore item.
44
44
  const EXTRA_SPACE_EXCLUDING_ELEMENTLIST = 128;
@@ -8,7 +8,7 @@ var _excluded = ["children"];
8
8
  * @jsx jsx
9
9
  */
10
10
 
11
- import { useCallback, useContext, useLayoutEffect, useState } from 'react';
11
+ import { useCallback, useContext, useLayoutEffect, useMemo, useState } from 'react';
12
12
 
13
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
14
  import { css, jsx } from '@emotion/react';
@@ -41,13 +41,13 @@ var InsertMenu = function InsertMenu(_ref) {
41
41
  _useState4 = _slicedToArray(_useState3, 2),
42
42
  height = _useState4[0],
43
43
  setHeight = _useState4[1];
44
-
45
- // eslint-disable-next-line react-hooks/exhaustive-deps
46
- var cache = new CellMeasurerCache({
47
- fixedWidth: true,
48
- defaultHeight: ELEMENT_ITEM_HEIGHT,
49
- minHeight: ELEMENT_ITEM_HEIGHT
50
- });
44
+ var cache = useMemo(function () {
45
+ return new CellMeasurerCache({
46
+ fixedWidth: true,
47
+ defaultHeight: ELEMENT_ITEM_HEIGHT,
48
+ minHeight: ELEMENT_ITEM_HEIGHT
49
+ });
50
+ }, []);
51
51
  useLayoutEffect(function () {
52
52
  // Figure based on visuals to exclude the searchbar, padding/margin, and the ViewMore item.
53
53
  var EXTRA_SPACE_EXCLUDING_ELEMENTLIST = 128;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "2.4.14",
3
+ "version": "2.4.15",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,14 +32,14 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/button": "^20.3.0",
35
- "@atlaskit/editor-common": "^95.0.0",
35
+ "@atlaskit/editor-common": "^95.6.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
37
  "@atlaskit/editor-plugin-block-type": "^4.0.0",
38
38
  "@atlaskit/editor-plugin-code-block": "^3.5.0",
39
39
  "@atlaskit/editor-plugin-date": "^2.4.0",
40
40
  "@atlaskit/editor-plugin-emoji": "^2.7.0",
41
41
  "@atlaskit/editor-plugin-expand": "^2.10.0",
42
- "@atlaskit/editor-plugin-extension": "^1.17.0",
42
+ "@atlaskit/editor-plugin-extension": "^1.18.0",
43
43
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
44
44
  "@atlaskit/editor-plugin-hyperlink": "^3.2.0",
45
45
  "@atlaskit/editor-plugin-image-upload": "^1.2.0",
@@ -60,12 +60,12 @@
60
60
  "@atlaskit/editor-shared-styles": "^3.2.0",
61
61
  "@atlaskit/emoji": "^67.11.0",
62
62
  "@atlaskit/heading": "3.1.0",
63
- "@atlaskit/icon": "^22.24.0",
64
- "@atlaskit/icon-lab": "^1.0.0",
63
+ "@atlaskit/icon": "^22.26.0",
64
+ "@atlaskit/icon-lab": "^1.2.0",
65
65
  "@atlaskit/platform-feature-flags": "^0.3.0",
66
66
  "@atlaskit/primitives": "^13.2.0",
67
67
  "@atlaskit/theme": "^14.0.0",
68
- "@atlaskit/tmp-editor-statsig": "^2.19.0",
68
+ "@atlaskit/tmp-editor-statsig": "^2.20.0",
69
69
  "@atlaskit/tokens": "^2.3.0",
70
70
  "@atlaskit/tooltip": "18.9.3",
71
71
  "@babel/runtime": "^7.0.0",