@atlaskit/editor-plugin-expand 14.0.4 → 15.0.1

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,17 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 15.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 15.0.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 14.0.4
4
16
 
5
17
  ### Patch Changes
@@ -3,37 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.toggleExpandRange = exports.TOGGLE_EXPAND_RANGE_META_KEY = void 0;
7
- var _expand = require("@atlaskit/editor-common/expand");
8
- var TOGGLE_EXPAND_RANGE_META_KEY = exports.TOGGLE_EXPAND_RANGE_META_KEY = 'toggleExpandRange';
9
- var toggleExpandRange = exports.toggleExpandRange = function toggleExpandRange(from, to) {
10
- var open = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
11
- return function (_ref) {
12
- var tr = _ref.tr;
13
- var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
14
- expand = _tr$doc$type$schema$n.expand,
15
- nestedExpand = _tr$doc$type$schema$n.nestedExpand;
16
- var fromClamped = from && from >= 0 ? from : 0;
17
- var toClamped = to && to <= tr.doc.content.size ? to : tr.doc.content.size;
18
- var positions = [];
19
- tr.doc.nodesBetween(fromClamped, toClamped, function (node, pos) {
20
- if ([expand, nestedExpand].includes(node.type)) {
21
- _expand.expandedState.set(node, open);
22
- positions.push(pos);
23
- }
24
- });
25
- if (positions.length === 0) {
26
- // No expand nodes found in the range — nothing to dispatch.
27
- return null;
28
- }
29
-
30
- // Set meta so the expand PM plugin can add node decorations.
31
- // This ensures ExpandNodeView.update() receives the decoration and visually
32
- // opens or closes the expand.
33
- tr.setMeta(TOGGLE_EXPAND_RANGE_META_KEY, {
34
- positions: positions,
35
- open: open
36
- });
37
- return tr;
38
- };
39
- };
6
+ Object.defineProperty(exports, "TOGGLE_EXPAND_RANGE_META_KEY", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _expand.TOGGLE_EXPAND_RANGE_META_KEY;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "toggleExpandRange", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _expand.toggleExpandRange;
16
+ }
17
+ });
18
+ var _expand = require("@atlaskit/editor-common/expand");
@@ -1,32 +1,5 @@
1
- import { expandedState } from '@atlaskit/editor-common/expand';
2
- export const TOGGLE_EXPAND_RANGE_META_KEY = 'toggleExpandRange';
3
- export const toggleExpandRange = (from, to, open = true) => ({
4
- tr
5
- }) => {
6
- const {
7
- expand,
8
- nestedExpand
9
- } = tr.doc.type.schema.nodes;
10
- const fromClamped = from && from >= 0 ? from : 0;
11
- const toClamped = to && to <= tr.doc.content.size ? to : tr.doc.content.size;
12
- const positions = [];
13
- tr.doc.nodesBetween(fromClamped, toClamped, (node, pos) => {
14
- if ([expand, nestedExpand].includes(node.type)) {
15
- expandedState.set(node, open);
16
- positions.push(pos);
17
- }
18
- });
19
- if (positions.length === 0) {
20
- // No expand nodes found in the range — nothing to dispatch.
21
- return null;
22
- }
23
-
24
- // Set meta so the expand PM plugin can add node decorations.
25
- // This ensures ExpandNodeView.update() receives the decoration and visually
26
- // opens or closes the expand.
27
- tr.setMeta(TOGGLE_EXPAND_RANGE_META_KEY, {
28
- positions,
29
- open
30
- });
31
- return tr;
32
- };
1
+ // EDITOR-7926: implementation moved to editor-common to avoid a circular dependency; re-exported
2
+ // here for backwards compatibility.
3
+ /* eslint-disable @atlaskit/editor/no-re-export */
4
+ export { TOGGLE_EXPAND_RANGE_META_KEY, toggleExpandRange } from '@atlaskit/editor-common/expand';
5
+ /* eslint-enable @atlaskit/editor/no-re-export */
@@ -1,33 +1,5 @@
1
- import { expandedState } from '@atlaskit/editor-common/expand';
2
- export var TOGGLE_EXPAND_RANGE_META_KEY = 'toggleExpandRange';
3
- export var toggleExpandRange = function toggleExpandRange(from, to) {
4
- var open = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
5
- return function (_ref) {
6
- var tr = _ref.tr;
7
- var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
8
- expand = _tr$doc$type$schema$n.expand,
9
- nestedExpand = _tr$doc$type$schema$n.nestedExpand;
10
- var fromClamped = from && from >= 0 ? from : 0;
11
- var toClamped = to && to <= tr.doc.content.size ? to : tr.doc.content.size;
12
- var positions = [];
13
- tr.doc.nodesBetween(fromClamped, toClamped, function (node, pos) {
14
- if ([expand, nestedExpand].includes(node.type)) {
15
- expandedState.set(node, open);
16
- positions.push(pos);
17
- }
18
- });
19
- if (positions.length === 0) {
20
- // No expand nodes found in the range — nothing to dispatch.
21
- return null;
22
- }
23
-
24
- // Set meta so the expand PM plugin can add node decorations.
25
- // This ensures ExpandNodeView.update() receives the decoration and visually
26
- // opens or closes the expand.
27
- tr.setMeta(TOGGLE_EXPAND_RANGE_META_KEY, {
28
- positions: positions,
29
- open: open
30
- });
31
- return tr;
32
- };
33
- };
1
+ // EDITOR-7926: implementation moved to editor-common to avoid a circular dependency; re-exported
2
+ // here for backwards compatibility.
3
+ /* eslint-disable @atlaskit/editor/no-re-export */
4
+ export { TOGGLE_EXPAND_RANGE_META_KEY, toggleExpandRange } from '@atlaskit/editor-common/expand';
5
+ /* eslint-enable @atlaskit/editor/no-re-export */
@@ -1,3 +1 @@
1
- import type { EditorCommand } from '@atlaskit/editor-common/types';
2
- export declare const TOGGLE_EXPAND_RANGE_META_KEY = "toggleExpandRange";
3
- export declare const toggleExpandRange: (from?: number, to?: number, open?: boolean) => EditorCommand;
1
+ export { TOGGLE_EXPAND_RANGE_META_KEY, toggleExpandRange } from '@atlaskit/editor-common/expand';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "14.0.4",
3
+ "version": "15.0.1",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -23,15 +23,15 @@
23
23
  "dependencies": {
24
24
  "@atlaskit/adf-schema": "^56.6.0",
25
25
  "@atlaskit/button": "^25.0.0",
26
- "@atlaskit/editor-plugin-analytics": "^13.0.0",
27
- "@atlaskit/editor-plugin-block-controls": "^14.0.0",
28
- "@atlaskit/editor-plugin-block-menu": "^12.1.0",
29
- "@atlaskit/editor-plugin-decorations": "^13.0.0",
30
- "@atlaskit/editor-plugin-editor-disabled": "^13.0.0",
31
- "@atlaskit/editor-plugin-editor-viewmode": "^15.0.0",
32
- "@atlaskit/editor-plugin-local-id": "^11.0.0",
33
- "@atlaskit/editor-plugin-selection": "^13.0.0",
34
- "@atlaskit/editor-plugin-selection-marker": "^13.0.0",
26
+ "@atlaskit/editor-plugin-analytics": "^14.0.0",
27
+ "@atlaskit/editor-plugin-block-controls": "^15.0.0",
28
+ "@atlaskit/editor-plugin-block-menu": "^13.0.0",
29
+ "@atlaskit/editor-plugin-decorations": "^14.0.0",
30
+ "@atlaskit/editor-plugin-editor-disabled": "^14.0.0",
31
+ "@atlaskit/editor-plugin-editor-viewmode": "^16.0.0",
32
+ "@atlaskit/editor-plugin-local-id": "^12.0.0",
33
+ "@atlaskit/editor-plugin-selection": "^14.0.0",
34
+ "@atlaskit/editor-plugin-selection-marker": "^14.0.0",
35
35
  "@atlaskit/editor-prosemirror": "^8.0.0",
36
36
  "@atlaskit/editor-shared-styles": "^4.0.0",
37
37
  "@atlaskit/editor-tables": "^3.0.0",
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/icon-lab": "^7.5.0",
41
41
  "@atlaskit/platform-feature-flags": "^2.1.0",
42
42
  "@atlaskit/prosemirror-history": "^1.1.0",
43
- "@atlaskit/tmp-editor-statsig": "^142.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^143.0.0",
44
44
  "@atlaskit/tokens": "^16.4.0",
45
45
  "@atlaskit/tooltip": "^24.0.0",
46
46
  "@babel/runtime": "^7.0.0",
@@ -49,7 +49,7 @@
49
49
  "w3c-keyname": "^2.1.8"
50
50
  },
51
51
  "peerDependencies": {
52
- "@atlaskit/editor-common": "^117.4.0",
52
+ "@atlaskit/editor-common": "^118.1.0",
53
53
  "react": "^18.2.0 || ^19.2.0",
54
54
  "react-dom": "^18.2.0 || ^19.2.0",
55
55
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"