@atlaskit/editor-plugin-expand 3.2.12 → 3.2.14
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 +30 -0
- package/dist/cjs/singlePlayerExpand/node-views/index.js +10 -25
- package/dist/es2019/singlePlayerExpand/node-views/index.js +10 -25
- package/dist/esm/singlePlayerExpand/node-views/index.js +10 -25
- package/dist/types/singlePlayerExpand/node-views/index.d.ts +0 -1
- package/dist/types-ts4.5/singlePlayerExpand/node-views/index.d.ts +0 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 3.2.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 3.2.13
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#159655](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159655)
|
|
14
|
+
[`24f8c627d50f2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24f8c627d50f2) - ##
|
|
15
|
+
WHAT? Remove experimental graceful edit mode from view mode plugin and associated props.
|
|
16
|
+
|
|
17
|
+
## WHY?
|
|
18
|
+
|
|
19
|
+
This experiment is being cleaned up and we are no longer proceeding in this direction.
|
|
20
|
+
|
|
21
|
+
## HOW to adjust?
|
|
22
|
+
|
|
23
|
+
This experiment was only enabled for Confluence and should not have been enabled in other places.
|
|
24
|
+
If for some reason any of the following props/state/methdos were used please remove them:
|
|
25
|
+
|
|
26
|
+
- isConsumption
|
|
27
|
+
- contentMode
|
|
28
|
+
- initialContentMode
|
|
29
|
+
- updateContentMode
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
|
|
3
33
|
## 3.2.12
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -20,7 +20,6 @@ var _history = require("@atlaskit/editor-prosemirror/history");
|
|
|
20
20
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
21
21
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
22
22
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
24
23
|
var _commands = require("../commands");
|
|
25
24
|
var _ExpandButton = require("../ui/ExpandButton");
|
|
26
25
|
var _NodeView = require("../ui/NodeView");
|
|
@@ -28,7 +27,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
28
27
|
function ExpandNodeView(_node, view, getPos, getIntl, isMobile, selectNearNode, api, nodeViewPortalProviderAPI) {
|
|
29
28
|
var _this = this,
|
|
30
29
|
_api$editorDisabled,
|
|
31
|
-
_this$
|
|
30
|
+
_this$api6;
|
|
32
31
|
var allowInteractiveExpand = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : true;
|
|
33
32
|
var __livePage = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
34
33
|
var cleanUpEditorDisabledOnChange = arguments.length > 10 ? arguments[10] : undefined;
|
|
@@ -123,17 +122,9 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
123
122
|
(0, _defineProperty2.default)(this, "handleFocus", function (event) {
|
|
124
123
|
event.stopImmediatePropagation();
|
|
125
124
|
});
|
|
126
|
-
(0, _defineProperty2.default)(this, "handleInputClick", function () {
|
|
127
|
-
if (!(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control')) {
|
|
128
|
-
var _this$api2, _this$api3;
|
|
129
|
-
(_this$api2 = _this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.core) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.actions) === null || _this$api2 === void 0 || _this$api2.execute((_this$api3 = _this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.editorViewMode) === null || _this$api3 === void 0 ? void 0 : _this$api3.commands.updateContentMode({
|
|
130
|
-
type: 'intent-to-edit'
|
|
131
|
-
}));
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
125
|
(0, _defineProperty2.default)(this, "handleInputFocus", function () {
|
|
135
|
-
var _this$
|
|
136
|
-
_this.decorationCleanup = (_this$
|
|
126
|
+
var _this$api2;
|
|
127
|
+
_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();
|
|
137
128
|
});
|
|
138
129
|
(0, _defineProperty2.default)(this, "handleBlur", function () {
|
|
139
130
|
var _this$decorationClean;
|
|
@@ -185,8 +176,8 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
185
176
|
return;
|
|
186
177
|
}
|
|
187
178
|
if (expandNode && (0, _utils.isEmptyNode)(state.schema)(expandNode)) {
|
|
188
|
-
var _this$
|
|
189
|
-
(0, _commands.deleteExpand)((_this$
|
|
179
|
+
var _this$api3;
|
|
180
|
+
(0, _commands.deleteExpand)((_this$api3 = _this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.analytics) === null || _this$api3 === void 0 ? void 0 : _this$api3.actions)(state, _this.view.dispatch);
|
|
190
181
|
}
|
|
191
182
|
});
|
|
192
183
|
(0, _defineProperty2.default)(this, "toggleExpand", function () {
|
|
@@ -195,12 +186,12 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
195
186
|
return;
|
|
196
187
|
}
|
|
197
188
|
if (_this.allowInteractiveExpand) {
|
|
198
|
-
var _this$
|
|
189
|
+
var _this$api4;
|
|
199
190
|
var _this$view3 = _this.view,
|
|
200
191
|
state = _this$view3.state,
|
|
201
192
|
dispatch = _this$view3.dispatch;
|
|
202
193
|
(0, _commands.toggleExpandExpanded)({
|
|
203
|
-
editorAnalyticsAPI: (_this$
|
|
194
|
+
editorAnalyticsAPI: (_this$api4 = _this.api) === null || _this$api4 === void 0 || (_this$api4 = _this$api4.analytics) === null || _this$api4 === void 0 ? void 0 : _this$api4.actions,
|
|
204
195
|
pos: pos,
|
|
205
196
|
node: _this.node
|
|
206
197
|
})(state, dispatch);
|
|
@@ -322,13 +313,13 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
322
313
|
selectionStart = _this$input5.selectionStart,
|
|
323
314
|
selectionEnd = _this$input5.selectionEnd;
|
|
324
315
|
if (selectionStart === selectionEnd && selectionStart === 0) {
|
|
325
|
-
var _this$
|
|
316
|
+
var _this$api5;
|
|
326
317
|
event.preventDefault();
|
|
327
318
|
var _this$view8 = _this.view,
|
|
328
319
|
state = _this$view8.state,
|
|
329
320
|
dispatch = _this$view8.dispatch;
|
|
330
321
|
_this.view.focus();
|
|
331
|
-
var selectionSharedState = ((_this$
|
|
322
|
+
var selectionSharedState = ((_this$api5 = _this.api) === null || _this$api5 === void 0 || (_this$api5 = _this$api5.selection) === null || _this$api5 === void 0 ? void 0 : _this$api5.sharedState.currentState()) || {};
|
|
332
323
|
// selectionRelativeToNode is undefined when user clicked to select node, then hit left to get focus in title
|
|
333
324
|
// This is a special case where we want to bypass node selection and jump straight to gap cursor
|
|
334
325
|
if ((selectionSharedState === null || selectionSharedState === void 0 ? void 0 : selectionSharedState.selectionRelativeToNode) === undefined) {
|
|
@@ -429,11 +420,8 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
429
420
|
// If the user interacts in our title bar (either toggle or input)
|
|
430
421
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
431
422
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
432
|
-
if (!(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control')) {
|
|
433
|
-
this.input.addEventListener('click', this.handleInputClick);
|
|
434
|
-
}
|
|
435
423
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
436
|
-
if ((_this$
|
|
424
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
|
|
437
425
|
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(function (sharedState) {
|
|
438
426
|
var editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
439
427
|
if (_this.input) {
|
|
@@ -535,9 +523,6 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
535
523
|
this.input.removeEventListener('blur', this.handleBlur);
|
|
536
524
|
this.input.removeEventListener('focus', this.handleInputFocus);
|
|
537
525
|
this.titleContainer.removeEventListener('focus', this.handleFocus);
|
|
538
|
-
if (!(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control')) {
|
|
539
|
-
this.input.removeEventListener('click', this.handleInputClick);
|
|
540
|
-
}
|
|
541
526
|
this.icon.removeEventListener('keydown', this.handleIconKeyDown);
|
|
542
527
|
(_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 || _this$decorationClean2.call(this);
|
|
543
528
|
if (this.cleanUpEditorDisabledOnChange) {
|
|
@@ -10,13 +10,12 @@ import { redo, undo } from '@atlaskit/editor-prosemirror/history';
|
|
|
10
10
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
11
11
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
13
|
import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
|
|
15
14
|
import { ExpandButton } from '../ui/ExpandButton';
|
|
16
15
|
import { buildExpandClassName, toDOM } from '../ui/NodeView';
|
|
17
16
|
export class ExpandNodeView {
|
|
18
17
|
constructor(_node, view, getPos, getIntl, isMobile, selectNearNode, api, nodeViewPortalProviderAPI, allowInteractiveExpand = true, __livePage = false, cleanUpEditorDisabledOnChange) {
|
|
19
|
-
var _api$editorDisabled, _api$editorDisabled$s, _this$
|
|
18
|
+
var _api$editorDisabled, _api$editorDisabled$s, _this$api6;
|
|
20
19
|
_defineProperty(this, "allowInteractiveExpand", true);
|
|
21
20
|
_defineProperty(this, "isMobile", false);
|
|
22
21
|
_defineProperty(this, "focusTitle", () => {
|
|
@@ -109,17 +108,9 @@ export class ExpandNodeView {
|
|
|
109
108
|
_defineProperty(this, "handleFocus", event => {
|
|
110
109
|
event.stopImmediatePropagation();
|
|
111
110
|
});
|
|
112
|
-
_defineProperty(this, "handleInputClick", () => {
|
|
113
|
-
if (!editorExperiment('live_pages_graceful_edit', 'control')) {
|
|
114
|
-
var _this$api2, _this$api2$core, _this$api2$core$actio, _this$api3, _this$api3$editorView;
|
|
115
|
-
(_this$api2 = this.api) === null || _this$api2 === void 0 ? void 0 : (_this$api2$core = _this$api2.core) === null || _this$api2$core === void 0 ? void 0 : (_this$api2$core$actio = _this$api2$core.actions) === null || _this$api2$core$actio === void 0 ? void 0 : _this$api2$core$actio.execute((_this$api3 = this.api) === null || _this$api3 === void 0 ? void 0 : (_this$api3$editorView = _this$api3.editorViewMode) === null || _this$api3$editorView === void 0 ? void 0 : _this$api3$editorView.commands.updateContentMode({
|
|
116
|
-
type: 'intent-to-edit'
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
111
|
_defineProperty(this, "handleInputFocus", () => {
|
|
121
|
-
var _this$
|
|
122
|
-
this.decorationCleanup = (_this$
|
|
112
|
+
var _this$api2, _this$api2$selectionM, _this$api2$selectionM2;
|
|
113
|
+
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();
|
|
123
114
|
});
|
|
124
115
|
_defineProperty(this, "handleBlur", () => {
|
|
125
116
|
var _this$decorationClean;
|
|
@@ -174,8 +165,8 @@ export class ExpandNodeView {
|
|
|
174
165
|
return;
|
|
175
166
|
}
|
|
176
167
|
if (expandNode && isEmptyNode(state.schema)(expandNode)) {
|
|
177
|
-
var _this$
|
|
178
|
-
deleteExpand((_this$
|
|
168
|
+
var _this$api3, _this$api3$analytics;
|
|
169
|
+
deleteExpand((_this$api3 = this.api) === null || _this$api3 === void 0 ? void 0 : (_this$api3$analytics = _this$api3.analytics) === null || _this$api3$analytics === void 0 ? void 0 : _this$api3$analytics.actions)(state, this.view.dispatch);
|
|
179
170
|
}
|
|
180
171
|
});
|
|
181
172
|
_defineProperty(this, "toggleExpand", () => {
|
|
@@ -184,13 +175,13 @@ export class ExpandNodeView {
|
|
|
184
175
|
return;
|
|
185
176
|
}
|
|
186
177
|
if (this.allowInteractiveExpand) {
|
|
187
|
-
var _this$
|
|
178
|
+
var _this$api4, _this$api4$analytics;
|
|
188
179
|
const {
|
|
189
180
|
state,
|
|
190
181
|
dispatch
|
|
191
182
|
} = this.view;
|
|
192
183
|
toggleExpandExpanded({
|
|
193
|
-
editorAnalyticsAPI: (_this$
|
|
184
|
+
editorAnalyticsAPI: (_this$api4 = this.api) === null || _this$api4 === void 0 ? void 0 : (_this$api4$analytics = _this$api4.analytics) === null || _this$api4$analytics === void 0 ? void 0 : _this$api4$analytics.actions,
|
|
194
185
|
pos,
|
|
195
186
|
node: this.node
|
|
196
187
|
})(state, dispatch);
|
|
@@ -320,14 +311,14 @@ export class ExpandNodeView {
|
|
|
320
311
|
selectionEnd
|
|
321
312
|
} = this.input;
|
|
322
313
|
if (selectionStart === selectionEnd && selectionStart === 0) {
|
|
323
|
-
var _this$
|
|
314
|
+
var _this$api5, _this$api5$selection;
|
|
324
315
|
event.preventDefault();
|
|
325
316
|
const {
|
|
326
317
|
state,
|
|
327
318
|
dispatch
|
|
328
319
|
} = this.view;
|
|
329
320
|
this.view.focus();
|
|
330
|
-
const selectionSharedState = ((_this$
|
|
321
|
+
const selectionSharedState = ((_this$api5 = this.api) === null || _this$api5 === void 0 ? void 0 : (_this$api5$selection = _this$api5.selection) === null || _this$api5$selection === void 0 ? void 0 : _this$api5$selection.sharedState.currentState()) || {};
|
|
331
322
|
// selectionRelativeToNode is undefined when user clicked to select node, then hit left to get focus in title
|
|
332
323
|
// This is a special case where we want to bypass node selection and jump straight to gap cursor
|
|
333
324
|
if ((selectionSharedState === null || selectionSharedState === void 0 ? void 0 : selectionSharedState.selectionRelativeToNode) === undefined) {
|
|
@@ -429,11 +420,8 @@ export class ExpandNodeView {
|
|
|
429
420
|
// If the user interacts in our title bar (either toggle or input)
|
|
430
421
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
431
422
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
432
|
-
if (!editorExperiment('live_pages_graceful_edit', 'control')) {
|
|
433
|
-
this.input.addEventListener('click', this.handleInputClick);
|
|
434
|
-
}
|
|
435
423
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
436
|
-
if ((_this$
|
|
424
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
|
|
437
425
|
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(sharedState => {
|
|
438
426
|
const editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
439
427
|
if (this.input) {
|
|
@@ -522,9 +510,6 @@ export class ExpandNodeView {
|
|
|
522
510
|
this.input.removeEventListener('blur', this.handleBlur);
|
|
523
511
|
this.input.removeEventListener('focus', this.handleInputFocus);
|
|
524
512
|
this.titleContainer.removeEventListener('focus', this.handleFocus);
|
|
525
|
-
if (!editorExperiment('live_pages_graceful_edit', 'control')) {
|
|
526
|
-
this.input.removeEventListener('click', this.handleInputClick);
|
|
527
|
-
}
|
|
528
513
|
this.icon.removeEventListener('keydown', this.handleIconKeyDown);
|
|
529
514
|
(_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 ? void 0 : _this$decorationClean2.call(this);
|
|
530
515
|
if (this.cleanUpEditorDisabledOnChange) {
|
|
@@ -12,7 +12,6 @@ import { redo, undo } from '@atlaskit/editor-prosemirror/history';
|
|
|
12
12
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
13
13
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
16
15
|
import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
|
|
17
16
|
import { ExpandButton } from '../ui/ExpandButton';
|
|
18
17
|
import { buildExpandClassName, toDOM } from '../ui/NodeView';
|
|
@@ -20,7 +19,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
20
19
|
function ExpandNodeView(_node, view, getPos, getIntl, isMobile, selectNearNode, api, nodeViewPortalProviderAPI) {
|
|
21
20
|
var _this = this,
|
|
22
21
|
_api$editorDisabled,
|
|
23
|
-
_this$
|
|
22
|
+
_this$api6;
|
|
24
23
|
var allowInteractiveExpand = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : true;
|
|
25
24
|
var __livePage = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
26
25
|
var cleanUpEditorDisabledOnChange = arguments.length > 10 ? arguments[10] : undefined;
|
|
@@ -115,17 +114,9 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
115
114
|
_defineProperty(this, "handleFocus", function (event) {
|
|
116
115
|
event.stopImmediatePropagation();
|
|
117
116
|
});
|
|
118
|
-
_defineProperty(this, "handleInputClick", function () {
|
|
119
|
-
if (!editorExperiment('live_pages_graceful_edit', 'control')) {
|
|
120
|
-
var _this$api2, _this$api3;
|
|
121
|
-
(_this$api2 = _this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.core) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.actions) === null || _this$api2 === void 0 || _this$api2.execute((_this$api3 = _this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.editorViewMode) === null || _this$api3 === void 0 ? void 0 : _this$api3.commands.updateContentMode({
|
|
122
|
-
type: 'intent-to-edit'
|
|
123
|
-
}));
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
117
|
_defineProperty(this, "handleInputFocus", function () {
|
|
127
|
-
var _this$
|
|
128
|
-
_this.decorationCleanup = (_this$
|
|
118
|
+
var _this$api2;
|
|
119
|
+
_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();
|
|
129
120
|
});
|
|
130
121
|
_defineProperty(this, "handleBlur", function () {
|
|
131
122
|
var _this$decorationClean;
|
|
@@ -177,8 +168,8 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
177
168
|
return;
|
|
178
169
|
}
|
|
179
170
|
if (expandNode && isEmptyNode(state.schema)(expandNode)) {
|
|
180
|
-
var _this$
|
|
181
|
-
deleteExpand((_this$
|
|
171
|
+
var _this$api3;
|
|
172
|
+
deleteExpand((_this$api3 = _this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.analytics) === null || _this$api3 === void 0 ? void 0 : _this$api3.actions)(state, _this.view.dispatch);
|
|
182
173
|
}
|
|
183
174
|
});
|
|
184
175
|
_defineProperty(this, "toggleExpand", function () {
|
|
@@ -187,12 +178,12 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
187
178
|
return;
|
|
188
179
|
}
|
|
189
180
|
if (_this.allowInteractiveExpand) {
|
|
190
|
-
var _this$
|
|
181
|
+
var _this$api4;
|
|
191
182
|
var _this$view3 = _this.view,
|
|
192
183
|
state = _this$view3.state,
|
|
193
184
|
dispatch = _this$view3.dispatch;
|
|
194
185
|
toggleExpandExpanded({
|
|
195
|
-
editorAnalyticsAPI: (_this$
|
|
186
|
+
editorAnalyticsAPI: (_this$api4 = _this.api) === null || _this$api4 === void 0 || (_this$api4 = _this$api4.analytics) === null || _this$api4 === void 0 ? void 0 : _this$api4.actions,
|
|
196
187
|
pos: pos,
|
|
197
188
|
node: _this.node
|
|
198
189
|
})(state, dispatch);
|
|
@@ -314,13 +305,13 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
314
305
|
selectionStart = _this$input5.selectionStart,
|
|
315
306
|
selectionEnd = _this$input5.selectionEnd;
|
|
316
307
|
if (selectionStart === selectionEnd && selectionStart === 0) {
|
|
317
|
-
var _this$
|
|
308
|
+
var _this$api5;
|
|
318
309
|
event.preventDefault();
|
|
319
310
|
var _this$view8 = _this.view,
|
|
320
311
|
state = _this$view8.state,
|
|
321
312
|
dispatch = _this$view8.dispatch;
|
|
322
313
|
_this.view.focus();
|
|
323
|
-
var selectionSharedState = ((_this$
|
|
314
|
+
var selectionSharedState = ((_this$api5 = _this.api) === null || _this$api5 === void 0 || (_this$api5 = _this$api5.selection) === null || _this$api5 === void 0 ? void 0 : _this$api5.sharedState.currentState()) || {};
|
|
324
315
|
// selectionRelativeToNode is undefined when user clicked to select node, then hit left to get focus in title
|
|
325
316
|
// This is a special case where we want to bypass node selection and jump straight to gap cursor
|
|
326
317
|
if ((selectionSharedState === null || selectionSharedState === void 0 ? void 0 : selectionSharedState.selectionRelativeToNode) === undefined) {
|
|
@@ -421,11 +412,8 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
421
412
|
// If the user interacts in our title bar (either toggle or input)
|
|
422
413
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
423
414
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
424
|
-
if (!editorExperiment('live_pages_graceful_edit', 'control')) {
|
|
425
|
-
this.input.addEventListener('click', this.handleInputClick);
|
|
426
|
-
}
|
|
427
415
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
428
|
-
if ((_this$
|
|
416
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
|
|
429
417
|
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(function (sharedState) {
|
|
430
418
|
var editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
431
419
|
if (_this.input) {
|
|
@@ -527,9 +515,6 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
527
515
|
this.input.removeEventListener('blur', this.handleBlur);
|
|
528
516
|
this.input.removeEventListener('focus', this.handleInputFocus);
|
|
529
517
|
this.titleContainer.removeEventListener('focus', this.handleFocus);
|
|
530
|
-
if (!editorExperiment('live_pages_graceful_edit', 'control')) {
|
|
531
|
-
this.input.removeEventListener('click', this.handleInputClick);
|
|
532
|
-
}
|
|
533
518
|
this.icon.removeEventListener('keydown', this.handleIconKeyDown);
|
|
534
519
|
(_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 || _this$decorationClean2.call(this);
|
|
535
520
|
if (this.cleanUpEditorDisabledOnChange) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.14",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
37
37
|
"@atlaskit/button": "^23.2.0",
|
|
38
|
-
"@atlaskit/editor-common": "^
|
|
38
|
+
"@atlaskit/editor-common": "^106.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
40
40
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
42
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^
|
|
42
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-selection": "^2.2.0",
|
|
44
44
|
"@atlaskit/editor-plugin-selection-marker": "^2.4.0",
|
|
45
45
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
46
46
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
47
47
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
48
|
-
"@atlaskit/icon": "^26.
|
|
48
|
+
"@atlaskit/icon": "^26.4.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^5.2.0",
|
|
51
51
|
"@atlaskit/tokens": "^4.9.0",
|
|
52
|
-
"@atlaskit/tooltip": "^20.
|
|
52
|
+
"@atlaskit/tooltip": "^20.2.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1",
|
|
55
55
|
"uuid": "^3.1.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@atlaskit/editor-plugin-content-insertion": "^2.1.0",
|
|
66
66
|
"@atlaskit/editor-plugin-guideline": "^2.0.0",
|
|
67
67
|
"@atlaskit/editor-plugin-quick-insert": "^2.5.0",
|
|
68
|
-
"@atlaskit/editor-plugin-table": "^10.
|
|
68
|
+
"@atlaskit/editor-plugin-table": "^10.11.0",
|
|
69
69
|
"@atlaskit/editor-plugin-type-ahead": "^2.7.0",
|
|
70
70
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
71
71
|
"@testing-library/react": "^13.4.0",
|