@atlaskit/editor-plugin-toolbar-lists-indentation 18.0.5 → 18.0.6

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,23 @@
1
1
  # @atlaskit/editor-plugin-toolbar-lists-indentation
2
2
 
3
+ ## 18.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`728f80b4dc5d2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/728f80b4dc5d2) -
8
+ Replace the toolbar's dependency on `listState.decorationSet` identity with an explicit
9
+ `listStructureToken` on the list plugin state.
10
+
11
+ The lists and indentation toolbar re-rendered by watching `decorationSet` for a new object, which
12
+ only worked while a fresh `DecorationSet` was allocated on every list edit. Indenting to the
13
+ maximum nesting depth changes whether indent is available without moving any of the active or
14
+ disabled flags, so that identity change was the only thing prompting the toolbar to re-evaluate.
15
+ The token is incremented when the document changes while the selection is inside a list, which
16
+ makes the dependency explicit and keeps documents with no list involvement from re-rendering the
17
+ toolbar on every keystroke.
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 18.0.5
4
22
 
5
23
  ### Patch Changes
@@ -135,8 +135,9 @@ function PrimaryToolbarComponent(_ref4) {
135
135
  isIndentationAllowed: (_states$indentationSt = states.indentationState) === null || _states$indentationSt === void 0 ? void 0 : _states$indentationSt.isIndentationAllowed,
136
136
  indentDisabled: (_states$indentationSt2 = states.indentationState) === null || _states$indentationSt2 === void 0 ? void 0 : _states$indentationSt2.indentDisabled,
137
137
  outdentDisabled: (_states$indentationSt3 = states.indentationState) === null || _states$indentationSt3 === void 0 ? void 0 : _states$indentationSt3.outdentDisabled,
138
- // decorationSet is required to re-render PrimaryToolbarComponent component, so that the toolbar states updates regularly
139
- decorationSet: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.decorationSet
138
+ // listStructureToken changes when a list edit could have altered indent/outdent
139
+ // availability, which none of the flags above capture on their own
140
+ listStructureToken: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.listStructureToken
140
141
  };
141
142
  }),
142
143
  bulletListActive = _useSharedPluginState.bulletListActive,
@@ -37,8 +37,9 @@ function FloatingToolbarComponent(_ref) {
37
37
  isIndentationAllowed: (_states$indentationSt = states.indentationState) === null || _states$indentationSt === void 0 ? void 0 : _states$indentationSt.isIndentationAllowed,
38
38
  indentDisabled: (_states$indentationSt2 = states.indentationState) === null || _states$indentationSt2 === void 0 ? void 0 : _states$indentationSt2.indentDisabled,
39
39
  outdentDisabled: (_states$indentationSt3 = states.indentationState) === null || _states$indentationSt3 === void 0 ? void 0 : _states$indentationSt3.outdentDisabled,
40
- // decorationSet is required to re-render PrimaryToolbarComponent component, so that the toolbar states updates regularly
41
- decorationSet: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.decorationSet
40
+ // listStructureToken changes when a list edit could have altered indent/outdent
41
+ // availability, which none of the flags above capture on their own
42
+ listStructureToken: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.listStructureToken
42
43
  };
43
44
  }),
44
45
  bulletListActive = _useSharedPluginState.bulletListActive,
@@ -1,4 +1,4 @@
1
- /* Toolbar.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* Toolbar.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* ToolbarDropdown.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* ToolbarDropdown.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* index.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _typeof = require("@babel/runtime/helpers/typeof");
@@ -133,8 +133,9 @@ export function PrimaryToolbarComponent({
133
133
  isIndentationAllowed: (_states$indentationSt = states.indentationState) === null || _states$indentationSt === void 0 ? void 0 : _states$indentationSt.isIndentationAllowed,
134
134
  indentDisabled: (_states$indentationSt2 = states.indentationState) === null || _states$indentationSt2 === void 0 ? void 0 : _states$indentationSt2.indentDisabled,
135
135
  outdentDisabled: (_states$indentationSt3 = states.indentationState) === null || _states$indentationSt3 === void 0 ? void 0 : _states$indentationSt3.outdentDisabled,
136
- // decorationSet is required to re-render PrimaryToolbarComponent component, so that the toolbar states updates regularly
137
- decorationSet: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.decorationSet
136
+ // listStructureToken changes when a list edit could have altered indent/outdent
137
+ // availability, which none of the flags above capture on their own
138
+ listStructureToken: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.listStructureToken
138
139
  };
139
140
  });
140
141
  const [taskDecisionState, setTaskDecisionState] = useState();
@@ -36,8 +36,9 @@ export function FloatingToolbarComponent({
36
36
  isIndentationAllowed: (_states$indentationSt = states.indentationState) === null || _states$indentationSt === void 0 ? void 0 : _states$indentationSt.isIndentationAllowed,
37
37
  indentDisabled: (_states$indentationSt2 = states.indentationState) === null || _states$indentationSt2 === void 0 ? void 0 : _states$indentationSt2.indentDisabled,
38
38
  outdentDisabled: (_states$indentationSt3 = states.indentationState) === null || _states$indentationSt3 === void 0 ? void 0 : _states$indentationSt3.outdentDisabled,
39
- // decorationSet is required to re-render PrimaryToolbarComponent component, so that the toolbar states updates regularly
40
- decorationSet: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.decorationSet
39
+ // listStructureToken changes when a list edit could have altered indent/outdent
40
+ // availability, which none of the flags above capture on their own
41
+ listStructureToken: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.listStructureToken
41
42
  };
42
43
  });
43
44
  const [taskDecisionState, setTaskDecisionState] = useState();
@@ -1,4 +1,4 @@
1
- /* Toolbar.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* Toolbar.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import * as React from 'react';
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import { useEffect, useRef } from 'react';
@@ -1,4 +1,4 @@
1
- /* ToolbarDropdown.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* ToolbarDropdown.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import { ax, ix } from "@compiled/react/runtime";
3
3
  import React from 'react';
4
4
  import { useIntl } from 'react-intl';
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* index.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import * as React from 'react';
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
@@ -125,8 +125,9 @@ export function PrimaryToolbarComponent(_ref4) {
125
125
  isIndentationAllowed: (_states$indentationSt = states.indentationState) === null || _states$indentationSt === void 0 ? void 0 : _states$indentationSt.isIndentationAllowed,
126
126
  indentDisabled: (_states$indentationSt2 = states.indentationState) === null || _states$indentationSt2 === void 0 ? void 0 : _states$indentationSt2.indentDisabled,
127
127
  outdentDisabled: (_states$indentationSt3 = states.indentationState) === null || _states$indentationSt3 === void 0 ? void 0 : _states$indentationSt3.outdentDisabled,
128
- // decorationSet is required to re-render PrimaryToolbarComponent component, so that the toolbar states updates regularly
129
- decorationSet: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.decorationSet
128
+ // listStructureToken changes when a list edit could have altered indent/outdent
129
+ // availability, which none of the flags above capture on their own
130
+ listStructureToken: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.listStructureToken
130
131
  };
131
132
  }),
132
133
  bulletListActive = _useSharedPluginState.bulletListActive,
@@ -28,8 +28,9 @@ export function FloatingToolbarComponent(_ref) {
28
28
  isIndentationAllowed: (_states$indentationSt = states.indentationState) === null || _states$indentationSt === void 0 ? void 0 : _states$indentationSt.isIndentationAllowed,
29
29
  indentDisabled: (_states$indentationSt2 = states.indentationState) === null || _states$indentationSt2 === void 0 ? void 0 : _states$indentationSt2.indentDisabled,
30
30
  outdentDisabled: (_states$indentationSt3 = states.indentationState) === null || _states$indentationSt3 === void 0 ? void 0 : _states$indentationSt3.outdentDisabled,
31
- // decorationSet is required to re-render PrimaryToolbarComponent component, so that the toolbar states updates regularly
32
- decorationSet: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.decorationSet
31
+ // listStructureToken changes when a list edit could have altered indent/outdent
32
+ // availability, which none of the flags above capture on their own
33
+ listStructureToken: (_states$listState5 = states.listState) === null || _states$listState5 === void 0 ? void 0 : _states$listState5.listStructureToken
33
34
  };
34
35
  }),
35
36
  bulletListActive = _useSharedPluginState.bulletListActive,
@@ -1,4 +1,4 @@
1
- /* Toolbar.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* Toolbar.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import * as React from 'react';
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import { useEffect, useRef } from 'react';
@@ -1,4 +1,4 @@
1
- /* ToolbarDropdown.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* ToolbarDropdown.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* index.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import * as React from 'react';
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-toolbar-lists-indentation",
3
- "version": "18.0.5",
3
+ "version": "18.0.6",
4
4
  "description": "Toolbar lists and indentation plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,12 +38,12 @@
38
38
  "@atlaskit/icon": "^37.6.0",
39
39
  "@atlaskit/platform-feature-experiments": "^0.3.0",
40
40
  "@atlaskit/platform-feature-flags": "^2.2.0",
41
- "@atlaskit/tmp-editor-statsig": "^184.0.0",
41
+ "@atlaskit/tmp-editor-statsig": "^185.0.0",
42
42
  "@atlaskit/tokens": "^16.11.0",
43
43
  "@babel/runtime": "^7.0.0"
44
44
  },
45
45
  "peerDependencies": {
46
- "@atlaskit/editor-common": "^121.2.0",
46
+ "@atlaskit/editor-common": "^121.3.0",
47
47
  "react": "^18.2.0 || ^19.2.0",
48
48
  "react-dom": "^18.2.0 || ^19.2.0",
49
49
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"