@atlaskit/editor-plugin-expand 2.7.7 → 2.8.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 +8 -0
- package/dist/cjs/legacyExpand/nodeviews/index.js +4 -4
- package/dist/cjs/singlePlayerExpand/node-views/index.js +2 -3
- package/dist/cjs/singlePlayerExpand/ui/NodeView.js +2 -3
- package/dist/es2019/legacyExpand/nodeviews/index.js +4 -4
- package/dist/es2019/singlePlayerExpand/node-views/index.js +2 -3
- package/dist/es2019/singlePlayerExpand/ui/NodeView.js +2 -3
- package/dist/esm/legacyExpand/nodeviews/index.js +4 -4
- package/dist/esm/singlePlayerExpand/node-views/index.js +2 -3
- package/dist/esm/singlePlayerExpand/ui/NodeView.js +2 -3
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 2.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#146025](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146025)
|
|
8
|
+
[`03eae90c614d1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/03eae90c614d1) -
|
|
9
|
+
Remove platform.editor.live-view.disable-editing-in-view-mode_fi1rx feature flag
|
|
10
|
+
|
|
3
11
|
## 2.7.7
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -52,11 +52,11 @@ var toDOM = function toDOM(node, __livePage, intl, titleReadOnly, contentEditabl
|
|
|
52
52
|
value: node.attrs.title,
|
|
53
53
|
placeholder: intl && intl.formatMessage(_ui.expandMessages.expandPlaceholderText) || _ui.expandMessages.expandPlaceholderText.defaultMessage,
|
|
54
54
|
type: 'text',
|
|
55
|
-
readonly: titleReadOnly
|
|
55
|
+
readonly: titleReadOnly ? 'true' : undefined
|
|
56
56
|
}]]], ['div', {
|
|
57
57
|
// prettier-ignore
|
|
58
58
|
class: _styles.expandClassNames.content,
|
|
59
|
-
contenteditable: contentEditable
|
|
59
|
+
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
60
60
|
}, 0]];
|
|
61
61
|
};
|
|
62
62
|
var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
@@ -398,7 +398,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
398
398
|
});
|
|
399
399
|
(0, _defineProperty2.default)(this, "getContentEditable", function (node) {
|
|
400
400
|
var contentEditable = _this.__livePage && (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence') ? !node.attrs.__expanded : node.attrs.__expanded;
|
|
401
|
-
if (_this.api && _this.api.editorDisabled
|
|
401
|
+
if (_this.api && _this.api.editorDisabled) {
|
|
402
402
|
var _this$api$editorDisab;
|
|
403
403
|
return !((_this$api$editorDisab = _this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
|
|
404
404
|
}
|
|
@@ -455,7 +455,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
455
455
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
456
456
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
457
457
|
}
|
|
458
|
-
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled
|
|
458
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
|
|
459
459
|
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(function (sharedState) {
|
|
460
460
|
var editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
461
461
|
if (_this2.input) {
|
|
@@ -18,7 +18,6 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
18
18
|
var _history = require("@atlaskit/editor-prosemirror/history");
|
|
19
19
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
20
20
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
21
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
21
|
var _commands = require("../commands");
|
|
23
22
|
var _NodeView = require("../ui/NodeView");
|
|
24
23
|
var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
@@ -354,7 +353,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
354
353
|
});
|
|
355
354
|
(0, _defineProperty2.default)(this, "getContentEditable", function (node) {
|
|
356
355
|
var contentEditable = !(0, _expand.isExpandCollapsed)(node);
|
|
357
|
-
if (_this.api && _this.api.editorDisabled
|
|
356
|
+
if (_this.api && _this.api.editorDisabled) {
|
|
358
357
|
var _this$api$editorDisab;
|
|
359
358
|
return !((_this$api$editorDisab = _this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
|
|
360
359
|
}
|
|
@@ -398,7 +397,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
398
397
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
399
398
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
400
399
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
401
|
-
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled
|
|
400
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
|
|
402
401
|
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(function (sharedState) {
|
|
403
402
|
var editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
404
403
|
if (_this.input) {
|
|
@@ -10,7 +10,6 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
10
10
|
var _expand = require("@atlaskit/editor-common/expand");
|
|
11
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
12
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _ExpandButton = require("../ui/ExpandButton");
|
|
15
14
|
var buildExpandClassName = exports.buildExpandClassName = function buildExpandClassName(type, expanded) {
|
|
16
15
|
return "".concat(_styles.expandClassNames.prefix, " ").concat(_styles.expandClassNames.type(type), " ").concat(expanded ? _styles.expandClassNames.expanded : '');
|
|
@@ -43,11 +42,11 @@ var toDOM = exports.toDOM = function toDOM(node, __livePage, intl, titleReadOnly
|
|
|
43
42
|
value: node.attrs.title,
|
|
44
43
|
placeholder: intl && typeof intl.formatMessage === 'function' && intl.formatMessage(_ui.expandMessages.expandPlaceholderText) || _ui.expandMessages.expandPlaceholderText.defaultMessage,
|
|
45
44
|
type: 'text',
|
|
46
|
-
readonly:
|
|
45
|
+
readonly: titleReadOnly ? 'true' : undefined
|
|
47
46
|
}]]], ['div', {
|
|
48
47
|
// prettier-ignore
|
|
49
48
|
class: _styles.expandClassNames.content,
|
|
50
|
-
contenteditable:
|
|
49
|
+
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
51
50
|
}, 0]];
|
|
52
51
|
};
|
|
53
52
|
var renderIcon = exports.renderIcon = function renderIcon(icon, allowInteractiveExpand, expanded, intl) {
|
|
@@ -41,11 +41,11 @@ const toDOM = (node, __livePage, intl, titleReadOnly, contentEditable) => ['div'
|
|
|
41
41
|
value: node.attrs.title,
|
|
42
42
|
placeholder: intl && intl.formatMessage(expandMessages.expandPlaceholderText) || expandMessages.expandPlaceholderText.defaultMessage,
|
|
43
43
|
type: 'text',
|
|
44
|
-
readonly: titleReadOnly
|
|
44
|
+
readonly: titleReadOnly ? 'true' : undefined
|
|
45
45
|
}]]], ['div', {
|
|
46
46
|
// prettier-ignore
|
|
47
47
|
class: expandClassNames.content,
|
|
48
|
-
contenteditable: contentEditable
|
|
48
|
+
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
49
49
|
}, 0]];
|
|
50
50
|
export class ExpandNodeView {
|
|
51
51
|
constructor(_node, view, getPos, getIntl, isMobile, selectNearNode, api, allowInteractiveExpand = true, __livePage = false, cleanUpEditorDisabledOnChange) {
|
|
@@ -399,7 +399,7 @@ export class ExpandNodeView {
|
|
|
399
399
|
});
|
|
400
400
|
_defineProperty(this, "getContentEditable", node => {
|
|
401
401
|
const contentEditable = this.__livePage && fg('platform.editor.live-pages-expand-divergence') ? !node.attrs.__expanded : node.attrs.__expanded;
|
|
402
|
-
if (this.api && this.api.editorDisabled
|
|
402
|
+
if (this.api && this.api.editorDisabled) {
|
|
403
403
|
var _this$api$editorDisab;
|
|
404
404
|
return !((_this$api$editorDisab = this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
|
|
405
405
|
}
|
|
@@ -454,7 +454,7 @@ export class ExpandNodeView {
|
|
|
454
454
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
455
455
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
456
456
|
}
|
|
457
|
-
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled
|
|
457
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
|
|
458
458
|
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(sharedState => {
|
|
459
459
|
const editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
460
460
|
if (this.input) {
|
|
@@ -8,7 +8,6 @@ import { closestElement, isEmptyNode } from '@atlaskit/editor-common/utils';
|
|
|
8
8
|
import { redo, undo } from '@atlaskit/editor-prosemirror/history';
|
|
9
9
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
|
|
13
12
|
import { buildExpandClassName, renderIcon, toDOM } from '../ui/NodeView';
|
|
14
13
|
export class ExpandNodeView {
|
|
@@ -355,7 +354,7 @@ export class ExpandNodeView {
|
|
|
355
354
|
});
|
|
356
355
|
_defineProperty(this, "getContentEditable", node => {
|
|
357
356
|
const contentEditable = !isExpandCollapsed(node);
|
|
358
|
-
if (this.api && this.api.editorDisabled
|
|
357
|
+
if (this.api && this.api.editorDisabled) {
|
|
359
358
|
var _this$api$editorDisab;
|
|
360
359
|
return !((_this$api$editorDisab = this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
|
|
361
360
|
}
|
|
@@ -400,7 +399,7 @@ export class ExpandNodeView {
|
|
|
400
399
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
401
400
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
402
401
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
403
|
-
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled
|
|
402
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
|
|
404
403
|
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(sharedState => {
|
|
405
404
|
const editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
406
405
|
if (this.input) {
|
|
@@ -3,7 +3,6 @@ import ReactDOM from 'react-dom';
|
|
|
3
3
|
import { expandedState } from '@atlaskit/editor-common/expand';
|
|
4
4
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { expandMessages } from '@atlaskit/editor-common/ui';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { ExpandButton } from '../ui/ExpandButton';
|
|
8
7
|
export const buildExpandClassName = (type, expanded) => {
|
|
9
8
|
return `${expandClassNames.prefix} ${expandClassNames.type(type)} ${expanded ? expandClassNames.expanded : ''}`;
|
|
@@ -36,11 +35,11 @@ export const toDOM = (node, __livePage, intl, titleReadOnly, contentEditable) =>
|
|
|
36
35
|
value: node.attrs.title,
|
|
37
36
|
placeholder: intl && typeof intl.formatMessage === 'function' && intl.formatMessage(expandMessages.expandPlaceholderText) || expandMessages.expandPlaceholderText.defaultMessage,
|
|
38
37
|
type: 'text',
|
|
39
|
-
readonly:
|
|
38
|
+
readonly: titleReadOnly ? 'true' : undefined
|
|
40
39
|
}]]], ['div', {
|
|
41
40
|
// prettier-ignore
|
|
42
41
|
class: expandClassNames.content,
|
|
43
|
-
contenteditable:
|
|
42
|
+
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
44
43
|
}, 0]];
|
|
45
44
|
};
|
|
46
45
|
export const renderIcon = (icon, allowInteractiveExpand, expanded, intl) => {
|
|
@@ -44,11 +44,11 @@ var toDOM = function toDOM(node, __livePage, intl, titleReadOnly, contentEditabl
|
|
|
44
44
|
value: node.attrs.title,
|
|
45
45
|
placeholder: intl && intl.formatMessage(expandMessages.expandPlaceholderText) || expandMessages.expandPlaceholderText.defaultMessage,
|
|
46
46
|
type: 'text',
|
|
47
|
-
readonly: titleReadOnly
|
|
47
|
+
readonly: titleReadOnly ? 'true' : undefined
|
|
48
48
|
}]]], ['div', {
|
|
49
49
|
// prettier-ignore
|
|
50
50
|
class: expandClassNames.content,
|
|
51
|
-
contenteditable: contentEditable
|
|
51
|
+
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
52
52
|
}, 0]];
|
|
53
53
|
};
|
|
54
54
|
export var ExpandNodeView = /*#__PURE__*/function () {
|
|
@@ -390,7 +390,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
390
390
|
});
|
|
391
391
|
_defineProperty(this, "getContentEditable", function (node) {
|
|
392
392
|
var contentEditable = _this.__livePage && fg('platform.editor.live-pages-expand-divergence') ? !node.attrs.__expanded : node.attrs.__expanded;
|
|
393
|
-
if (_this.api && _this.api.editorDisabled
|
|
393
|
+
if (_this.api && _this.api.editorDisabled) {
|
|
394
394
|
var _this$api$editorDisab;
|
|
395
395
|
return !((_this$api$editorDisab = _this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
|
|
396
396
|
}
|
|
@@ -447,7 +447,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
447
447
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
448
448
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
449
449
|
}
|
|
450
|
-
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled
|
|
450
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
|
|
451
451
|
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(function (sharedState) {
|
|
452
452
|
var editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
453
453
|
if (_this2.input) {
|
|
@@ -10,7 +10,6 @@ import { closestElement, isEmptyNode } from '@atlaskit/editor-common/utils';
|
|
|
10
10
|
import { redo, undo } from '@atlaskit/editor-prosemirror/history';
|
|
11
11
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
12
12
|
import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
|
|
15
14
|
import { buildExpandClassName, renderIcon, toDOM } from '../ui/NodeView';
|
|
16
15
|
export var ExpandNodeView = /*#__PURE__*/function () {
|
|
@@ -346,7 +345,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
346
345
|
});
|
|
347
346
|
_defineProperty(this, "getContentEditable", function (node) {
|
|
348
347
|
var contentEditable = !isExpandCollapsed(node);
|
|
349
|
-
if (_this.api && _this.api.editorDisabled
|
|
348
|
+
if (_this.api && _this.api.editorDisabled) {
|
|
350
349
|
var _this$api$editorDisab;
|
|
351
350
|
return !((_this$api$editorDisab = _this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
|
|
352
351
|
}
|
|
@@ -390,7 +389,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
390
389
|
// Prevent ProseMirror from getting a focus event (causes weird selection issues).
|
|
391
390
|
this.titleContainer.addEventListener('focus', this.handleFocus);
|
|
392
391
|
this.icon.addEventListener('keydown', this.handleIconKeyDown);
|
|
393
|
-
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled
|
|
392
|
+
if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
|
|
394
393
|
this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(function (sharedState) {
|
|
395
394
|
var editorDisabled = sharedState.nextSharedState.editorDisabled;
|
|
396
395
|
if (_this.input) {
|
|
@@ -3,7 +3,6 @@ import ReactDOM from 'react-dom';
|
|
|
3
3
|
import { expandedState } from '@atlaskit/editor-common/expand';
|
|
4
4
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { expandMessages } from '@atlaskit/editor-common/ui';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { ExpandButton } from '../ui/ExpandButton';
|
|
8
7
|
export var buildExpandClassName = function buildExpandClassName(type, expanded) {
|
|
9
8
|
return "".concat(expandClassNames.prefix, " ").concat(expandClassNames.type(type), " ").concat(expanded ? expandClassNames.expanded : '');
|
|
@@ -36,11 +35,11 @@ export var toDOM = function toDOM(node, __livePage, intl, titleReadOnly, content
|
|
|
36
35
|
value: node.attrs.title,
|
|
37
36
|
placeholder: intl && typeof intl.formatMessage === 'function' && intl.formatMessage(expandMessages.expandPlaceholderText) || expandMessages.expandPlaceholderText.defaultMessage,
|
|
38
37
|
type: 'text',
|
|
39
|
-
readonly:
|
|
38
|
+
readonly: titleReadOnly ? 'true' : undefined
|
|
40
39
|
}]]], ['div', {
|
|
41
40
|
// prettier-ignore
|
|
42
41
|
class: expandClassNames.content,
|
|
43
|
-
contenteditable:
|
|
42
|
+
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
44
43
|
}, 0]];
|
|
45
44
|
};
|
|
46
45
|
export var renderIcon = function renderIcon(icon, allowInteractiveExpand, expanded, intl) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -107,9 +107,6 @@
|
|
|
107
107
|
"platform.editor.single-player-expand": {
|
|
108
108
|
"type": "boolean"
|
|
109
109
|
},
|
|
110
|
-
"platform.editor.live-view.disable-editing-in-view-mode_fi1rx": {
|
|
111
|
-
"type": "boolean"
|
|
112
|
-
},
|
|
113
110
|
"platform_editor_nest_nested_expand_in_expand_jira": {
|
|
114
111
|
"type": "boolean"
|
|
115
112
|
},
|