@atlaskit/editor-plugin-expand 9.0.4 → 9.1.0
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 +11 -0
- package/dist/cjs/singlePlayerExpand/commands.js +2 -2
- package/dist/cjs/singlePlayerExpand/node-views/index.js +13 -19
- package/dist/es2019/singlePlayerExpand/commands.js +2 -2
- package/dist/es2019/singlePlayerExpand/node-views/index.js +13 -19
- package/dist/esm/singlePlayerExpand/commands.js +2 -2
- package/dist/esm/singlePlayerExpand/node-views/index.js +13 -19
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 9.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`0efca55740b36`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0efca55740b36) -
|
|
8
|
+
[FFCLEANUP-71458] clean up experiment platform_editor_toggle_expand_on_match_found
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 9.0.4
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -268,7 +268,7 @@ var toggleExpandWithMatch = exports.toggleExpandWithMatch = function toggleExpan
|
|
|
268
268
|
nestedExpand = _tr$doc$type$schema$n.nestedExpand;
|
|
269
269
|
// if match is inside a nested expand, open the nested expand
|
|
270
270
|
var nestedExpandNode = (0, _utils2.findParentNodeOfType)(nestedExpand)(selection);
|
|
271
|
-
if (nestedExpandNode
|
|
271
|
+
if (nestedExpandNode) {
|
|
272
272
|
var _expandedState$get2;
|
|
273
273
|
var expanded = (_expandedState$get2 = _expand.expandedState.get(nestedExpandNode.node)) !== null && _expandedState$get2 !== void 0 ? _expandedState$get2 : false;
|
|
274
274
|
if (!expanded) {
|
|
@@ -277,7 +277,7 @@ var toggleExpandWithMatch = exports.toggleExpandWithMatch = function toggleExpan
|
|
|
277
277
|
}
|
|
278
278
|
// if match is (also) inside an expand, open the expand
|
|
279
279
|
var expandNode = (0, _utils2.findParentNodeOfType)(expand)(selection);
|
|
280
|
-
if (expandNode
|
|
280
|
+
if (expandNode) {
|
|
281
281
|
var _expandedState$get3;
|
|
282
282
|
var _expanded = (_expandedState$get3 = _expand.expandedState.get(expandNode.node)) !== null && _expandedState$get3 !== void 0 ? _expandedState$get3 : false;
|
|
283
283
|
if (!_expanded) {
|
|
@@ -529,6 +529,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
529
529
|
value: function update(node, _decorations) {
|
|
530
530
|
var _this2 = this;
|
|
531
531
|
if (this.node.type === node.type) {
|
|
532
|
+
var _expandedState$get2;
|
|
532
533
|
// During a collab session the title doesn't sync with other users
|
|
533
534
|
// since we're intentionally being less aggressive about re-rendering.
|
|
534
535
|
// We also apply a rAF to avoid abrupt continuous replacement of the title.
|
|
@@ -548,17 +549,12 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
548
549
|
_expand.expandedState.set(node, wasExpanded);
|
|
549
550
|
}
|
|
550
551
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
this.updateExpandToggleIcon(node);
|
|
558
|
-
this.updateDisplayStyle(node);
|
|
559
|
-
}
|
|
560
|
-
} else {
|
|
561
|
-
this.node = node;
|
|
552
|
+
this.node = node;
|
|
553
|
+
var currentExpanded = (_expandedState$get2 = _expand.expandedState.get(node)) !== null && _expandedState$get2 !== void 0 ? _expandedState$get2 : false;
|
|
554
|
+
var hasChanged = (0, _expValEquals.expValEquals)('platform_editor_block_menu', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? this.isExpanded.expanded !== currentExpanded && this.isExpanded.localId === node.attrs.localId : this.isExpanded.expanded !== currentExpanded;
|
|
555
|
+
if (hasChanged) {
|
|
556
|
+
this.updateExpandToggleIcon(node);
|
|
557
|
+
this.updateDisplayStyle(node);
|
|
562
558
|
}
|
|
563
559
|
return true;
|
|
564
560
|
}
|
|
@@ -588,14 +584,12 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
588
584
|
}
|
|
589
585
|
}
|
|
590
586
|
this.updateExpandBodyContentEditable();
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
};
|
|
598
|
-
}
|
|
587
|
+
this.isExpanded = (0, _expValEquals.expValEquals)('platform_editor_block_menu', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? {
|
|
588
|
+
expanded: expanded !== null && expanded !== void 0 ? expanded : false,
|
|
589
|
+
localId: node.attrs.localId
|
|
590
|
+
} : {
|
|
591
|
+
expanded: expanded !== null && expanded !== void 0 ? expanded : false
|
|
592
|
+
};
|
|
599
593
|
}
|
|
600
594
|
}, {
|
|
601
595
|
key: "updateDisplayStyle",
|
|
@@ -250,7 +250,7 @@ export const toggleExpandWithMatch = selection => ({
|
|
|
250
250
|
} = tr.doc.type.schema.nodes;
|
|
251
251
|
// if match is inside a nested expand, open the nested expand
|
|
252
252
|
const nestedExpandNode = findParentNodeOfType(nestedExpand)(selection);
|
|
253
|
-
if (nestedExpandNode
|
|
253
|
+
if (nestedExpandNode) {
|
|
254
254
|
var _expandedState$get2;
|
|
255
255
|
const expanded = (_expandedState$get2 = expandedState.get(nestedExpandNode.node)) !== null && _expandedState$get2 !== void 0 ? _expandedState$get2 : false;
|
|
256
256
|
if (!expanded) {
|
|
@@ -259,7 +259,7 @@ export const toggleExpandWithMatch = selection => ({
|
|
|
259
259
|
}
|
|
260
260
|
// if match is (also) inside an expand, open the expand
|
|
261
261
|
const expandNode = findParentNodeOfType(expand)(selection);
|
|
262
|
-
if (expandNode
|
|
262
|
+
if (expandNode) {
|
|
263
263
|
var _expandedState$get3;
|
|
264
264
|
const expanded = (_expandedState$get3 = expandedState.get(expandNode.node)) !== null && _expandedState$get3 !== void 0 ? _expandedState$get3 : false;
|
|
265
265
|
if (!expanded) {
|
|
@@ -523,6 +523,7 @@ export class ExpandNodeView {
|
|
|
523
523
|
}
|
|
524
524
|
update(node, _decorations) {
|
|
525
525
|
if (this.node.type === node.type) {
|
|
526
|
+
var _expandedState$get2;
|
|
526
527
|
// During a collab session the title doesn't sync with other users
|
|
527
528
|
// since we're intentionally being less aggressive about re-rendering.
|
|
528
529
|
// We also apply a rAF to avoid abrupt continuous replacement of the title.
|
|
@@ -542,17 +543,12 @@ export class ExpandNodeView {
|
|
|
542
543
|
expandedState.set(node, wasExpanded);
|
|
543
544
|
}
|
|
544
545
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
this.updateExpandToggleIcon(node);
|
|
552
|
-
this.updateDisplayStyle(node);
|
|
553
|
-
}
|
|
554
|
-
} else {
|
|
555
|
-
this.node = node;
|
|
546
|
+
this.node = node;
|
|
547
|
+
const currentExpanded = (_expandedState$get2 = expandedState.get(node)) !== null && _expandedState$get2 !== void 0 ? _expandedState$get2 : false;
|
|
548
|
+
const hasChanged = expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_v2_patch_3') ? this.isExpanded.expanded !== currentExpanded && this.isExpanded.localId === node.attrs.localId : this.isExpanded.expanded !== currentExpanded;
|
|
549
|
+
if (hasChanged) {
|
|
550
|
+
this.updateExpandToggleIcon(node);
|
|
551
|
+
this.updateDisplayStyle(node);
|
|
556
552
|
}
|
|
557
553
|
return true;
|
|
558
554
|
}
|
|
@@ -578,14 +574,12 @@ export class ExpandNodeView {
|
|
|
578
574
|
}
|
|
579
575
|
}
|
|
580
576
|
this.updateExpandBodyContentEditable();
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
};
|
|
588
|
-
}
|
|
577
|
+
this.isExpanded = expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_v2_patch_3') ? {
|
|
578
|
+
expanded: expanded !== null && expanded !== void 0 ? expanded : false,
|
|
579
|
+
localId: node.attrs.localId
|
|
580
|
+
} : {
|
|
581
|
+
expanded: expanded !== null && expanded !== void 0 ? expanded : false
|
|
582
|
+
};
|
|
589
583
|
}
|
|
590
584
|
updateDisplayStyle(node) {
|
|
591
585
|
if (this.content) {
|
|
@@ -263,7 +263,7 @@ export var toggleExpandWithMatch = function toggleExpandWithMatch(selection) {
|
|
|
263
263
|
nestedExpand = _tr$doc$type$schema$n.nestedExpand;
|
|
264
264
|
// if match is inside a nested expand, open the nested expand
|
|
265
265
|
var nestedExpandNode = findParentNodeOfType(nestedExpand)(selection);
|
|
266
|
-
if (nestedExpandNode
|
|
266
|
+
if (nestedExpandNode) {
|
|
267
267
|
var _expandedState$get2;
|
|
268
268
|
var expanded = (_expandedState$get2 = expandedState.get(nestedExpandNode.node)) !== null && _expandedState$get2 !== void 0 ? _expandedState$get2 : false;
|
|
269
269
|
if (!expanded) {
|
|
@@ -272,7 +272,7 @@ export var toggleExpandWithMatch = function toggleExpandWithMatch(selection) {
|
|
|
272
272
|
}
|
|
273
273
|
// if match is (also) inside an expand, open the expand
|
|
274
274
|
var expandNode = findParentNodeOfType(expand)(selection);
|
|
275
|
-
if (expandNode
|
|
275
|
+
if (expandNode) {
|
|
276
276
|
var _expandedState$get3;
|
|
277
277
|
var _expanded = (_expandedState$get3 = expandedState.get(expandNode.node)) !== null && _expandedState$get3 !== void 0 ? _expandedState$get3 : false;
|
|
278
278
|
if (!_expanded) {
|
|
@@ -521,6 +521,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
521
521
|
value: function update(node, _decorations) {
|
|
522
522
|
var _this2 = this;
|
|
523
523
|
if (this.node.type === node.type) {
|
|
524
|
+
var _expandedState$get2;
|
|
524
525
|
// During a collab session the title doesn't sync with other users
|
|
525
526
|
// since we're intentionally being less aggressive about re-rendering.
|
|
526
527
|
// We also apply a rAF to avoid abrupt continuous replacement of the title.
|
|
@@ -540,17 +541,12 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
540
541
|
expandedState.set(node, wasExpanded);
|
|
541
542
|
}
|
|
542
543
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
this.updateExpandToggleIcon(node);
|
|
550
|
-
this.updateDisplayStyle(node);
|
|
551
|
-
}
|
|
552
|
-
} else {
|
|
553
|
-
this.node = node;
|
|
544
|
+
this.node = node;
|
|
545
|
+
var currentExpanded = (_expandedState$get2 = expandedState.get(node)) !== null && _expandedState$get2 !== void 0 ? _expandedState$get2 : false;
|
|
546
|
+
var hasChanged = expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_v2_patch_3') ? this.isExpanded.expanded !== currentExpanded && this.isExpanded.localId === node.attrs.localId : this.isExpanded.expanded !== currentExpanded;
|
|
547
|
+
if (hasChanged) {
|
|
548
|
+
this.updateExpandToggleIcon(node);
|
|
549
|
+
this.updateDisplayStyle(node);
|
|
554
550
|
}
|
|
555
551
|
return true;
|
|
556
552
|
}
|
|
@@ -580,14 +576,12 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
580
576
|
}
|
|
581
577
|
}
|
|
582
578
|
this.updateExpandBodyContentEditable();
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
};
|
|
590
|
-
}
|
|
579
|
+
this.isExpanded = expValEquals('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_block_menu_v2_patch_3') ? {
|
|
580
|
+
expanded: expanded !== null && expanded !== void 0 ? expanded : false,
|
|
581
|
+
localId: node.attrs.localId
|
|
582
|
+
} : {
|
|
583
|
+
expanded: expanded !== null && expanded !== void 0 ? expanded : false
|
|
584
|
+
};
|
|
591
585
|
}
|
|
592
586
|
}, {
|
|
593
587
|
key: "updateDisplayStyle",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/adf-schema": "^52.
|
|
32
|
+
"@atlaskit/adf-schema": "^52.3.0",
|
|
33
33
|
"@atlaskit/button": "^23.10.0",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^8.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-block-menu": "^7.0.0",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
44
44
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
45
45
|
"@atlaskit/editor-toolbar": "^0.19.0",
|
|
46
|
-
"@atlaskit/icon": "^32.
|
|
47
|
-
"@atlaskit/icon-lab": "^5.
|
|
46
|
+
"@atlaskit/icon": "^32.1.0",
|
|
47
|
+
"@atlaskit/icon-lab": "^5.18.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^39.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^11.1.0",
|
|
52
52
|
"@atlaskit/tooltip": "^20.14.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"w3c-keyname": "^2.1.8"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@atlaskit/editor-common": "^112.
|
|
59
|
+
"@atlaskit/editor-common": "^112.3.0",
|
|
60
60
|
"react": "^18.2.0",
|
|
61
61
|
"react-dom": "^18.2.0",
|
|
62
62
|
"react-intl-next": "npm:react-intl@^5.18.1"
|