@atlaskit/editor-plugin-expand 1.4.1 → 1.4.2
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 +6 -0
- package/dist/cjs/legacyExpand/nodeviews/index.js +11 -5
- package/dist/cjs/singlePlayerExpand/node-views/index.js +9 -5
- package/dist/es2019/legacyExpand/nodeviews/index.js +11 -5
- package/dist/es2019/singlePlayerExpand/node-views/index.js +9 -5
- package/dist/esm/legacyExpand/nodeviews/index.js +11 -5
- package/dist/esm/singlePlayerExpand/node-views/index.js +9 -5
- package/dist/types/legacyExpand/nodeviews/index.d.ts +1 -0
- package/dist/types/singlePlayerExpand/node-views/index.d.ts +1 -0
- package/dist/types-ts4.5/legacyExpand/nodeviews/index.d.ts +1 -0
- package/dist/types-ts4.5/singlePlayerExpand/node-views/index.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 1.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#91886](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91886) [`5c0443e007d9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5c0443e007d9) - [ux] Fix bug where selection marker shows when focussing on the expand title with the keyboard.
|
|
8
|
+
|
|
3
9
|
## 1.4.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -67,7 +67,6 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
67
67
|
(0, _defineProperty2.default)(this, "isMobile", false);
|
|
68
68
|
(0, _defineProperty2.default)(this, "focusTitle", function () {
|
|
69
69
|
if (_this.input) {
|
|
70
|
-
var _this$api;
|
|
71
70
|
var _this$view = _this.view,
|
|
72
71
|
state = _this$view.state,
|
|
73
72
|
dispatch = _this$view.dispatch;
|
|
@@ -83,7 +82,6 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
83
82
|
if (typeof pos === 'number') {
|
|
84
83
|
(0, _commands.setSelectionInsideExpand)(pos)(state, dispatch, _this.view);
|
|
85
84
|
}
|
|
86
|
-
_this.decorationCleanup = (_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.selectionMarker) === null || _this$api === void 0 || (_this$api = _this$api.actions) === null || _this$api === void 0 ? void 0 : _this$api.hideDecoration();
|
|
87
85
|
_this.input.focus();
|
|
88
86
|
}
|
|
89
87
|
});
|
|
@@ -109,7 +107,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
109
107
|
state = _this$view2.state,
|
|
110
108
|
dispatch = _this$view2.dispatch;
|
|
111
109
|
if ((0, _utils.closestElement)(target, ".".concat(_styles.expandClassNames.icon))) {
|
|
112
|
-
var _this$
|
|
110
|
+
var _this$api;
|
|
113
111
|
if (!_this.allowInteractiveExpand) {
|
|
114
112
|
return;
|
|
115
113
|
}
|
|
@@ -121,7 +119,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
121
119
|
_this.view.dom.blur();
|
|
122
120
|
}
|
|
123
121
|
(0, _commands.toggleExpandExpanded)({
|
|
124
|
-
editorAnalyticsAPI: (_this$
|
|
122
|
+
editorAnalyticsAPI: (_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.analytics) === null || _this$api === void 0 ? void 0 : _this$api.actions,
|
|
125
123
|
pos: pos,
|
|
126
124
|
nodeType: _this.node.type,
|
|
127
125
|
__livePage: _this.__livePage
|
|
@@ -156,7 +154,11 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
156
154
|
(0, _defineProperty2.default)(this, "handleFocus", function (event) {
|
|
157
155
|
event.stopImmediatePropagation();
|
|
158
156
|
});
|
|
159
|
-
(0, _defineProperty2.default)(this, "
|
|
157
|
+
(0, _defineProperty2.default)(this, "handleInputFocus", function () {
|
|
158
|
+
var _this$api2;
|
|
159
|
+
_this.decorationCleanup = (_this$api2 = _this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.selectionMarker) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.actions) === null || _this$api2 === void 0 ? void 0 : _this$api2.hideDecoration();
|
|
160
|
+
});
|
|
161
|
+
(0, _defineProperty2.default)(this, "handleBlur", function () {
|
|
160
162
|
var _this$decorationClean;
|
|
161
163
|
(_this$decorationClean = _this.decorationCleanup) === null || _this$decorationClean === void 0 || _this$decorationClean.call(_this);
|
|
162
164
|
});
|
|
@@ -399,6 +401,8 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
399
401
|
this.input.addEventListener('keydown', this.handleTitleKeydown);
|
|
400
402
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
401
403
|
this.input.addEventListener('blur', this.handleBlur);
|
|
404
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
405
|
+
this.input.addEventListener('focus', this.handleInputFocus);
|
|
402
406
|
}
|
|
403
407
|
if (this.titleContainer) {
|
|
404
408
|
// If the user interacts in our title bar (either toggle or input)
|
|
@@ -490,6 +494,8 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
490
494
|
this.input.removeEventListener('keydown', this.handleTitleKeydown);
|
|
491
495
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
492
496
|
this.input.removeEventListener('blur', this.handleBlur);
|
|
497
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
498
|
+
this.input.removeEventListener('focus', this.handleInputFocus);
|
|
493
499
|
}
|
|
494
500
|
if (this.titleContainer) {
|
|
495
501
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -29,7 +29,6 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
29
29
|
(0, _defineProperty2.default)(this, "isMobile", false);
|
|
30
30
|
(0, _defineProperty2.default)(this, "focusTitle", function () {
|
|
31
31
|
if (_this.input) {
|
|
32
|
-
var _this$api;
|
|
33
32
|
var _this$view = _this.view,
|
|
34
33
|
state = _this$view.state,
|
|
35
34
|
dispatch = _this$view.dispatch;
|
|
@@ -45,7 +44,6 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
45
44
|
if (typeof pos === 'number') {
|
|
46
45
|
(0, _commands.setSelectionInsideExpand)(pos)(state, dispatch, _this.view);
|
|
47
46
|
}
|
|
48
|
-
_this.decorationCleanup = (_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.selectionMarker) === null || _this$api === void 0 || (_this$api = _this$api.actions) === null || _this$api === void 0 ? void 0 : _this$api.hideDecoration();
|
|
49
47
|
_this.input.focus();
|
|
50
48
|
}
|
|
51
49
|
});
|
|
@@ -68,7 +66,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
68
66
|
}
|
|
69
67
|
var target = event.target;
|
|
70
68
|
if ((0, _utils.closestElement)(target, ".".concat(_styles.expandClassNames.icon))) {
|
|
71
|
-
var _this$
|
|
69
|
+
var _this$api;
|
|
72
70
|
if (!_this.allowInteractiveExpand) {
|
|
73
71
|
return;
|
|
74
72
|
}
|
|
@@ -80,7 +78,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
80
78
|
_this.view.dom.blur();
|
|
81
79
|
}
|
|
82
80
|
(0, _commands.toggleExpandExpanded)({
|
|
83
|
-
editorAnalyticsAPI: (_this$
|
|
81
|
+
editorAnalyticsAPI: (_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.analytics) === null || _this$api === void 0 ? void 0 : _this$api.actions,
|
|
84
82
|
pos: pos,
|
|
85
83
|
node: _this.node
|
|
86
84
|
})(_this.view.state, _this.view.dispatch);
|
|
@@ -114,7 +112,11 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
114
112
|
(0, _defineProperty2.default)(this, "handleFocus", function (event) {
|
|
115
113
|
event.stopImmediatePropagation();
|
|
116
114
|
});
|
|
117
|
-
(0, _defineProperty2.default)(this, "
|
|
115
|
+
(0, _defineProperty2.default)(this, "handleInputFocus", function () {
|
|
116
|
+
var _this$api2;
|
|
117
|
+
_this.decorationCleanup = (_this$api2 = _this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.selectionMarker) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.actions) === null || _this$api2 === void 0 ? void 0 : _this$api2.hideDecoration();
|
|
118
|
+
});
|
|
119
|
+
(0, _defineProperty2.default)(this, "handleBlur", function () {
|
|
118
120
|
var _this$decorationClean;
|
|
119
121
|
(_this$decorationClean = _this.decorationCleanup) === null || _this$decorationClean === void 0 || _this$decorationClean.call(_this);
|
|
120
122
|
});
|
|
@@ -346,6 +348,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
346
348
|
this.dom.addEventListener('input', this.handleInput);
|
|
347
349
|
this.input.addEventListener('keydown', this.handleTitleKeydown);
|
|
348
350
|
this.input.addEventListener('blur', this.handleBlur);
|
|
351
|
+
this.input.addEventListener('focus', this.handleInputFocus);
|
|
349
352
|
// If the user interacts in our title bar (either toggle or input)
|
|
350
353
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
351
354
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
@@ -415,6 +418,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
415
418
|
this.dom.removeEventListener('input', this.handleInput);
|
|
416
419
|
this.input.removeEventListener('keydown', this.handleTitleKeydown);
|
|
417
420
|
this.input.removeEventListener('blur', this.handleBlur);
|
|
421
|
+
this.input.removeEventListener('focus', this.handleInputFocus);
|
|
418
422
|
this.titleContainer.removeEventListener('focus', this.handleFocus);
|
|
419
423
|
this.icon.removeEventListener('keydown', this.handleIconKeyDown);
|
|
420
424
|
(_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 || _this$decorationClean2.call(this);
|
|
@@ -51,7 +51,6 @@ export class ExpandNodeView {
|
|
|
51
51
|
_defineProperty(this, "isMobile", false);
|
|
52
52
|
_defineProperty(this, "focusTitle", () => {
|
|
53
53
|
if (this.input) {
|
|
54
|
-
var _this$api, _this$api$selectionMa, _this$api$selectionMa2;
|
|
55
54
|
const {
|
|
56
55
|
state,
|
|
57
56
|
dispatch
|
|
@@ -68,7 +67,6 @@ export class ExpandNodeView {
|
|
|
68
67
|
if (typeof pos === 'number') {
|
|
69
68
|
setSelectionInsideExpand(pos)(state, dispatch, this.view);
|
|
70
69
|
}
|
|
71
|
-
this.decorationCleanup = (_this$api = this.api) === null || _this$api === void 0 ? void 0 : (_this$api$selectionMa = _this$api.selectionMarker) === null || _this$api$selectionMa === void 0 ? void 0 : (_this$api$selectionMa2 = _this$api$selectionMa.actions) === null || _this$api$selectionMa2 === void 0 ? void 0 : _this$api$selectionMa2.hideDecoration();
|
|
72
70
|
this.input.focus();
|
|
73
71
|
}
|
|
74
72
|
});
|
|
@@ -95,7 +93,7 @@ export class ExpandNodeView {
|
|
|
95
93
|
dispatch
|
|
96
94
|
} = this.view;
|
|
97
95
|
if (closestElement(target, `.${expandClassNames.icon}`)) {
|
|
98
|
-
var _this$
|
|
96
|
+
var _this$api, _this$api$analytics;
|
|
99
97
|
if (!this.allowInteractiveExpand) {
|
|
100
98
|
return;
|
|
101
99
|
}
|
|
@@ -107,7 +105,7 @@ export class ExpandNodeView {
|
|
|
107
105
|
this.view.dom.blur();
|
|
108
106
|
}
|
|
109
107
|
toggleExpandExpanded({
|
|
110
|
-
editorAnalyticsAPI: (_this$
|
|
108
|
+
editorAnalyticsAPI: (_this$api = this.api) === null || _this$api === void 0 ? void 0 : (_this$api$analytics = _this$api.analytics) === null || _this$api$analytics === void 0 ? void 0 : _this$api$analytics.actions,
|
|
111
109
|
pos,
|
|
112
110
|
nodeType: this.node.type,
|
|
113
111
|
__livePage: this.__livePage
|
|
@@ -143,7 +141,11 @@ export class ExpandNodeView {
|
|
|
143
141
|
_defineProperty(this, "handleFocus", event => {
|
|
144
142
|
event.stopImmediatePropagation();
|
|
145
143
|
});
|
|
146
|
-
_defineProperty(this, "
|
|
144
|
+
_defineProperty(this, "handleInputFocus", () => {
|
|
145
|
+
var _this$api2, _this$api2$selectionM, _this$api2$selectionM2;
|
|
146
|
+
this.decorationCleanup = (_this$api2 = this.api) === null || _this$api2 === void 0 ? void 0 : (_this$api2$selectionM = _this$api2.selectionMarker) === null || _this$api2$selectionM === void 0 ? void 0 : (_this$api2$selectionM2 = _this$api2$selectionM.actions) === null || _this$api2$selectionM2 === void 0 ? void 0 : _this$api2$selectionM2.hideDecoration();
|
|
147
|
+
});
|
|
148
|
+
_defineProperty(this, "handleBlur", () => {
|
|
147
149
|
var _this$decorationClean;
|
|
148
150
|
(_this$decorationClean = this.decorationCleanup) === null || _this$decorationClean === void 0 ? void 0 : _this$decorationClean.call(this);
|
|
149
151
|
});
|
|
@@ -398,6 +400,8 @@ export class ExpandNodeView {
|
|
|
398
400
|
this.input.addEventListener('keydown', this.handleTitleKeydown);
|
|
399
401
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
400
402
|
this.input.addEventListener('blur', this.handleBlur);
|
|
403
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
404
|
+
this.input.addEventListener('focus', this.handleInputFocus);
|
|
401
405
|
}
|
|
402
406
|
if (this.titleContainer) {
|
|
403
407
|
// If the user interacts in our title bar (either toggle or input)
|
|
@@ -479,6 +483,8 @@ export class ExpandNodeView {
|
|
|
479
483
|
this.input.removeEventListener('keydown', this.handleTitleKeydown);
|
|
480
484
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
481
485
|
this.input.removeEventListener('blur', this.handleBlur);
|
|
486
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
487
|
+
this.input.removeEventListener('focus', this.handleInputFocus);
|
|
482
488
|
}
|
|
483
489
|
if (this.titleContainer) {
|
|
484
490
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -15,7 +15,6 @@ export class ExpandNodeView {
|
|
|
15
15
|
_defineProperty(this, "isMobile", false);
|
|
16
16
|
_defineProperty(this, "focusTitle", () => {
|
|
17
17
|
if (this.input) {
|
|
18
|
-
var _this$api, _this$api$selectionMa, _this$api$selectionMa2;
|
|
19
18
|
const {
|
|
20
19
|
state,
|
|
21
20
|
dispatch
|
|
@@ -32,7 +31,6 @@ export class ExpandNodeView {
|
|
|
32
31
|
if (typeof pos === 'number') {
|
|
33
32
|
setSelectionInsideExpand(pos)(state, dispatch, this.view);
|
|
34
33
|
}
|
|
35
|
-
this.decorationCleanup = (_this$api = this.api) === null || _this$api === void 0 ? void 0 : (_this$api$selectionMa = _this$api.selectionMarker) === null || _this$api$selectionMa === void 0 ? void 0 : (_this$api$selectionMa2 = _this$api$selectionMa.actions) === null || _this$api$selectionMa2 === void 0 ? void 0 : _this$api$selectionMa2.hideDecoration();
|
|
36
34
|
this.input.focus();
|
|
37
35
|
}
|
|
38
36
|
});
|
|
@@ -55,7 +53,7 @@ export class ExpandNodeView {
|
|
|
55
53
|
}
|
|
56
54
|
const target = event.target;
|
|
57
55
|
if (closestElement(target, `.${expandClassNames.icon}`)) {
|
|
58
|
-
var _this$
|
|
56
|
+
var _this$api, _this$api$analytics;
|
|
59
57
|
if (!this.allowInteractiveExpand) {
|
|
60
58
|
return;
|
|
61
59
|
}
|
|
@@ -67,7 +65,7 @@ export class ExpandNodeView {
|
|
|
67
65
|
this.view.dom.blur();
|
|
68
66
|
}
|
|
69
67
|
toggleExpandExpanded({
|
|
70
|
-
editorAnalyticsAPI: (_this$
|
|
68
|
+
editorAnalyticsAPI: (_this$api = this.api) === null || _this$api === void 0 ? void 0 : (_this$api$analytics = _this$api.analytics) === null || _this$api$analytics === void 0 ? void 0 : _this$api$analytics.actions,
|
|
71
69
|
pos,
|
|
72
70
|
node: this.node
|
|
73
71
|
})(this.view.state, this.view.dispatch);
|
|
@@ -102,7 +100,11 @@ export class ExpandNodeView {
|
|
|
102
100
|
_defineProperty(this, "handleFocus", event => {
|
|
103
101
|
event.stopImmediatePropagation();
|
|
104
102
|
});
|
|
105
|
-
_defineProperty(this, "
|
|
103
|
+
_defineProperty(this, "handleInputFocus", () => {
|
|
104
|
+
var _this$api2, _this$api2$selectionM, _this$api2$selectionM2;
|
|
105
|
+
this.decorationCleanup = (_this$api2 = this.api) === null || _this$api2 === void 0 ? void 0 : (_this$api2$selectionM = _this$api2.selectionMarker) === null || _this$api2$selectionM === void 0 ? void 0 : (_this$api2$selectionM2 = _this$api2$selectionM.actions) === null || _this$api2$selectionM2 === void 0 ? void 0 : _this$api2$selectionM2.hideDecoration();
|
|
106
|
+
});
|
|
107
|
+
_defineProperty(this, "handleBlur", () => {
|
|
106
108
|
var _this$decorationClean;
|
|
107
109
|
(_this$decorationClean = this.decorationCleanup) === null || _this$decorationClean === void 0 ? void 0 : _this$decorationClean.call(this);
|
|
108
110
|
});
|
|
@@ -348,6 +350,7 @@ export class ExpandNodeView {
|
|
|
348
350
|
this.dom.addEventListener('input', this.handleInput);
|
|
349
351
|
this.input.addEventListener('keydown', this.handleTitleKeydown);
|
|
350
352
|
this.input.addEventListener('blur', this.handleBlur);
|
|
353
|
+
this.input.addEventListener('focus', this.handleInputFocus);
|
|
351
354
|
// If the user interacts in our title bar (either toggle or input)
|
|
352
355
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
353
356
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
@@ -406,6 +409,7 @@ export class ExpandNodeView {
|
|
|
406
409
|
this.dom.removeEventListener('input', this.handleInput);
|
|
407
410
|
this.input.removeEventListener('keydown', this.handleTitleKeydown);
|
|
408
411
|
this.input.removeEventListener('blur', this.handleBlur);
|
|
412
|
+
this.input.removeEventListener('focus', this.handleInputFocus);
|
|
409
413
|
this.titleContainer.removeEventListener('focus', this.handleFocus);
|
|
410
414
|
this.icon.removeEventListener('keydown', this.handleIconKeyDown);
|
|
411
415
|
(_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 ? void 0 : _this$decorationClean2.call(this);
|
|
@@ -59,7 +59,6 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
59
59
|
_defineProperty(this, "isMobile", false);
|
|
60
60
|
_defineProperty(this, "focusTitle", function () {
|
|
61
61
|
if (_this.input) {
|
|
62
|
-
var _this$api;
|
|
63
62
|
var _this$view = _this.view,
|
|
64
63
|
state = _this$view.state,
|
|
65
64
|
dispatch = _this$view.dispatch;
|
|
@@ -75,7 +74,6 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
75
74
|
if (typeof pos === 'number') {
|
|
76
75
|
setSelectionInsideExpand(pos)(state, dispatch, _this.view);
|
|
77
76
|
}
|
|
78
|
-
_this.decorationCleanup = (_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.selectionMarker) === null || _this$api === void 0 || (_this$api = _this$api.actions) === null || _this$api === void 0 ? void 0 : _this$api.hideDecoration();
|
|
79
77
|
_this.input.focus();
|
|
80
78
|
}
|
|
81
79
|
});
|
|
@@ -101,7 +99,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
101
99
|
state = _this$view2.state,
|
|
102
100
|
dispatch = _this$view2.dispatch;
|
|
103
101
|
if (closestElement(target, ".".concat(expandClassNames.icon))) {
|
|
104
|
-
var _this$
|
|
102
|
+
var _this$api;
|
|
105
103
|
if (!_this.allowInteractiveExpand) {
|
|
106
104
|
return;
|
|
107
105
|
}
|
|
@@ -113,7 +111,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
113
111
|
_this.view.dom.blur();
|
|
114
112
|
}
|
|
115
113
|
toggleExpandExpanded({
|
|
116
|
-
editorAnalyticsAPI: (_this$
|
|
114
|
+
editorAnalyticsAPI: (_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.analytics) === null || _this$api === void 0 ? void 0 : _this$api.actions,
|
|
117
115
|
pos: pos,
|
|
118
116
|
nodeType: _this.node.type,
|
|
119
117
|
__livePage: _this.__livePage
|
|
@@ -148,7 +146,11 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
148
146
|
_defineProperty(this, "handleFocus", function (event) {
|
|
149
147
|
event.stopImmediatePropagation();
|
|
150
148
|
});
|
|
151
|
-
_defineProperty(this, "
|
|
149
|
+
_defineProperty(this, "handleInputFocus", function () {
|
|
150
|
+
var _this$api2;
|
|
151
|
+
_this.decorationCleanup = (_this$api2 = _this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.selectionMarker) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.actions) === null || _this$api2 === void 0 ? void 0 : _this$api2.hideDecoration();
|
|
152
|
+
});
|
|
153
|
+
_defineProperty(this, "handleBlur", function () {
|
|
152
154
|
var _this$decorationClean;
|
|
153
155
|
(_this$decorationClean = _this.decorationCleanup) === null || _this$decorationClean === void 0 || _this$decorationClean.call(_this);
|
|
154
156
|
});
|
|
@@ -391,6 +393,8 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
391
393
|
this.input.addEventListener('keydown', this.handleTitleKeydown);
|
|
392
394
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
393
395
|
this.input.addEventListener('blur', this.handleBlur);
|
|
396
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
397
|
+
this.input.addEventListener('focus', this.handleInputFocus);
|
|
394
398
|
}
|
|
395
399
|
if (this.titleContainer) {
|
|
396
400
|
// If the user interacts in our title bar (either toggle or input)
|
|
@@ -482,6 +486,8 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
482
486
|
this.input.removeEventListener('keydown', this.handleTitleKeydown);
|
|
483
487
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
484
488
|
this.input.removeEventListener('blur', this.handleBlur);
|
|
489
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
490
|
+
this.input.removeEventListener('focus', this.handleInputFocus);
|
|
485
491
|
}
|
|
486
492
|
if (this.titleContainer) {
|
|
487
493
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -21,7 +21,6 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
21
21
|
_defineProperty(this, "isMobile", false);
|
|
22
22
|
_defineProperty(this, "focusTitle", function () {
|
|
23
23
|
if (_this.input) {
|
|
24
|
-
var _this$api;
|
|
25
24
|
var _this$view = _this.view,
|
|
26
25
|
state = _this$view.state,
|
|
27
26
|
dispatch = _this$view.dispatch;
|
|
@@ -37,7 +36,6 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
37
36
|
if (typeof pos === 'number') {
|
|
38
37
|
setSelectionInsideExpand(pos)(state, dispatch, _this.view);
|
|
39
38
|
}
|
|
40
|
-
_this.decorationCleanup = (_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.selectionMarker) === null || _this$api === void 0 || (_this$api = _this$api.actions) === null || _this$api === void 0 ? void 0 : _this$api.hideDecoration();
|
|
41
39
|
_this.input.focus();
|
|
42
40
|
}
|
|
43
41
|
});
|
|
@@ -60,7 +58,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
60
58
|
}
|
|
61
59
|
var target = event.target;
|
|
62
60
|
if (closestElement(target, ".".concat(expandClassNames.icon))) {
|
|
63
|
-
var _this$
|
|
61
|
+
var _this$api;
|
|
64
62
|
if (!_this.allowInteractiveExpand) {
|
|
65
63
|
return;
|
|
66
64
|
}
|
|
@@ -72,7 +70,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
72
70
|
_this.view.dom.blur();
|
|
73
71
|
}
|
|
74
72
|
toggleExpandExpanded({
|
|
75
|
-
editorAnalyticsAPI: (_this$
|
|
73
|
+
editorAnalyticsAPI: (_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.analytics) === null || _this$api === void 0 ? void 0 : _this$api.actions,
|
|
76
74
|
pos: pos,
|
|
77
75
|
node: _this.node
|
|
78
76
|
})(_this.view.state, _this.view.dispatch);
|
|
@@ -106,7 +104,11 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
106
104
|
_defineProperty(this, "handleFocus", function (event) {
|
|
107
105
|
event.stopImmediatePropagation();
|
|
108
106
|
});
|
|
109
|
-
_defineProperty(this, "
|
|
107
|
+
_defineProperty(this, "handleInputFocus", function () {
|
|
108
|
+
var _this$api2;
|
|
109
|
+
_this.decorationCleanup = (_this$api2 = _this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.selectionMarker) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.actions) === null || _this$api2 === void 0 ? void 0 : _this$api2.hideDecoration();
|
|
110
|
+
});
|
|
111
|
+
_defineProperty(this, "handleBlur", function () {
|
|
110
112
|
var _this$decorationClean;
|
|
111
113
|
(_this$decorationClean = _this.decorationCleanup) === null || _this$decorationClean === void 0 || _this$decorationClean.call(_this);
|
|
112
114
|
});
|
|
@@ -338,6 +340,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
338
340
|
this.dom.addEventListener('input', this.handleInput);
|
|
339
341
|
this.input.addEventListener('keydown', this.handleTitleKeydown);
|
|
340
342
|
this.input.addEventListener('blur', this.handleBlur);
|
|
343
|
+
this.input.addEventListener('focus', this.handleInputFocus);
|
|
341
344
|
// If the user interacts in our title bar (either toggle or input)
|
|
342
345
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
343
346
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
@@ -407,6 +410,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
407
410
|
this.dom.removeEventListener('input', this.handleInput);
|
|
408
411
|
this.input.removeEventListener('keydown', this.handleTitleKeydown);
|
|
409
412
|
this.input.removeEventListener('blur', this.handleBlur);
|
|
413
|
+
this.input.removeEventListener('focus', this.handleInputFocus);
|
|
410
414
|
this.titleContainer.removeEventListener('focus', this.handleFocus);
|
|
411
415
|
this.icon.removeEventListener('keydown', this.handleIconKeyDown);
|
|
412
416
|
(_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 || _this$decorationClean2.call(this);
|