@atlaskit/editor-plugin-expand 1.3.3 → 1.3.4
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,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 1.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#91146](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91146) [`c982f92adfee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c982f92adfee) - [ux] Revert changes from ED-22666 as expand is not editable when not selected initially
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 1.3.3
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -24,7 +24,7 @@ var _ExpandIconButton = require("../ui/ExpandIconButton");
|
|
|
24
24
|
function buildExpandClassName(type, expanded) {
|
|
25
25
|
return "".concat(_styles.expandClassNames.prefix, " ").concat(_styles.expandClassNames.type(type), " ").concat(expanded ? _styles.expandClassNames.expanded : '');
|
|
26
26
|
}
|
|
27
|
-
var toDOM = function toDOM(node, __livePage, intl
|
|
27
|
+
var toDOM = function toDOM(node, __livePage, intl) {
|
|
28
28
|
return ['div', {
|
|
29
29
|
// prettier-ignore
|
|
30
30
|
'class': buildExpandClassName(node.type.name, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.live-pages-expand-divergence') && __livePage ? !node.attrs.__expanded : node.attrs.__expanded),
|
|
@@ -50,13 +50,11 @@ var toDOM = function toDOM(node, __livePage, intl, editable) {
|
|
|
50
50
|
'class': _styles.expandClassNames.titleInput,
|
|
51
51
|
value: node.attrs.title,
|
|
52
52
|
placeholder: intl && intl.formatMessage(_ui.expandMessages.expandPlaceholderText) || _ui.expandMessages.expandPlaceholderText.defaultMessage,
|
|
53
|
-
type: 'text'
|
|
54
|
-
readonly: !editable ? 'true' : undefined
|
|
53
|
+
type: 'text'
|
|
55
54
|
}]]],
|
|
56
55
|
// prettier-ignore
|
|
57
56
|
['div', {
|
|
58
|
-
'class': _styles.expandClassNames.content
|
|
59
|
-
contenteditable: editable
|
|
57
|
+
'class': _styles.expandClassNames.content
|
|
60
58
|
}, 0]];
|
|
61
59
|
};
|
|
62
60
|
var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
@@ -363,7 +361,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
363
361
|
this.selectNearNode = selectNearNode;
|
|
364
362
|
this.__livePage = __livePage;
|
|
365
363
|
this.intl = getIntl();
|
|
366
|
-
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, toDOM(node, this.__livePage, this.intl
|
|
364
|
+
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, toDOM(node, this.__livePage, this.intl)),
|
|
367
365
|
dom = _DOMSerializer$render.dom,
|
|
368
366
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
369
367
|
this.allowInteractiveExpand = allowInteractiveExpand;
|
|
@@ -452,18 +450,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
|
452
450
|
}
|
|
453
451
|
if (this.content) {
|
|
454
452
|
// Disallow interaction/selection inside when collapsed.
|
|
455
|
-
this.content.setAttribute('contenteditable',
|
|
456
|
-
}
|
|
457
|
-
} else {
|
|
458
|
-
if (this.content) {
|
|
459
|
-
this.content.setAttribute('contenteditable', this.view.editable ? 'true' : 'false');
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
if (this.input) {
|
|
463
|
-
if (!this.view.editable) {
|
|
464
|
-
this.input.setAttribute('readonly', 'true');
|
|
465
|
-
} else {
|
|
466
|
-
this.input.removeAttribute('readonly');
|
|
453
|
+
this.content.setAttribute('contenteditable', (0, _platformFeatureFlags.getBooleanFF)('platform.editor.live-pages-expand-divergence') && this.__livePage ? !node.attrs.__expanded : node.attrs.__expanded);
|
|
467
454
|
}
|
|
468
455
|
}
|
|
469
456
|
|
|
@@ -14,7 +14,7 @@ import { ExpandIconButton } from '../ui/ExpandIconButton';
|
|
|
14
14
|
function buildExpandClassName(type, expanded) {
|
|
15
15
|
return `${expandClassNames.prefix} ${expandClassNames.type(type)} ${expanded ? expandClassNames.expanded : ''}`;
|
|
16
16
|
}
|
|
17
|
-
const toDOM = (node, __livePage, intl
|
|
17
|
+
const toDOM = (node, __livePage, intl) => ['div', {
|
|
18
18
|
// prettier-ignore
|
|
19
19
|
'class': buildExpandClassName(node.type.name, getBooleanFF('platform.editor.live-pages-expand-divergence') && __livePage ? !node.attrs.__expanded : node.attrs.__expanded),
|
|
20
20
|
'data-node-type': node.type.name,
|
|
@@ -39,13 +39,11 @@ const toDOM = (node, __livePage, intl, editable) => ['div', {
|
|
|
39
39
|
'class': expandClassNames.titleInput,
|
|
40
40
|
value: node.attrs.title,
|
|
41
41
|
placeholder: intl && intl.formatMessage(expandMessages.expandPlaceholderText) || expandMessages.expandPlaceholderText.defaultMessage,
|
|
42
|
-
type: 'text'
|
|
43
|
-
readonly: !editable ? 'true' : undefined
|
|
42
|
+
type: 'text'
|
|
44
43
|
}]]],
|
|
45
44
|
// prettier-ignore
|
|
46
45
|
['div', {
|
|
47
|
-
'class': expandClassNames.content
|
|
48
|
-
contenteditable: editable
|
|
46
|
+
'class': expandClassNames.content
|
|
49
47
|
}, 0]];
|
|
50
48
|
export class ExpandNodeView {
|
|
51
49
|
constructor(node, view, getPos, getIntl, isMobile, selectNearNode, api, allowInteractiveExpand = true, __livePage = false) {
|
|
@@ -366,7 +364,7 @@ export class ExpandNodeView {
|
|
|
366
364
|
const {
|
|
367
365
|
dom,
|
|
368
366
|
contentDOM
|
|
369
|
-
} = DOMSerializer.renderSpec(document, toDOM(node, this.__livePage, this.intl
|
|
367
|
+
} = DOMSerializer.renderSpec(document, toDOM(node, this.__livePage, this.intl));
|
|
370
368
|
this.allowInteractiveExpand = allowInteractiveExpand;
|
|
371
369
|
this.getPos = getPos;
|
|
372
370
|
this.view = view;
|
|
@@ -443,18 +441,7 @@ export class ExpandNodeView {
|
|
|
443
441
|
}
|
|
444
442
|
if (this.content) {
|
|
445
443
|
// Disallow interaction/selection inside when collapsed.
|
|
446
|
-
this.content.setAttribute('contenteditable',
|
|
447
|
-
}
|
|
448
|
-
} else {
|
|
449
|
-
if (this.content) {
|
|
450
|
-
this.content.setAttribute('contenteditable', this.view.editable ? 'true' : 'false');
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
if (this.input) {
|
|
454
|
-
if (!this.view.editable) {
|
|
455
|
-
this.input.setAttribute('readonly', 'true');
|
|
456
|
-
} else {
|
|
457
|
-
this.input.removeAttribute('readonly');
|
|
444
|
+
this.content.setAttribute('contenteditable', getBooleanFF('platform.editor.live-pages-expand-divergence') && this.__livePage ? !node.attrs.__expanded : node.attrs.__expanded);
|
|
458
445
|
}
|
|
459
446
|
}
|
|
460
447
|
|
|
@@ -16,7 +16,7 @@ import { ExpandIconButton } from '../ui/ExpandIconButton';
|
|
|
16
16
|
function buildExpandClassName(type, expanded) {
|
|
17
17
|
return "".concat(expandClassNames.prefix, " ").concat(expandClassNames.type(type), " ").concat(expanded ? expandClassNames.expanded : '');
|
|
18
18
|
}
|
|
19
|
-
var toDOM = function toDOM(node, __livePage, intl
|
|
19
|
+
var toDOM = function toDOM(node, __livePage, intl) {
|
|
20
20
|
return ['div', {
|
|
21
21
|
// prettier-ignore
|
|
22
22
|
'class': buildExpandClassName(node.type.name, getBooleanFF('platform.editor.live-pages-expand-divergence') && __livePage ? !node.attrs.__expanded : node.attrs.__expanded),
|
|
@@ -42,13 +42,11 @@ var toDOM = function toDOM(node, __livePage, intl, editable) {
|
|
|
42
42
|
'class': expandClassNames.titleInput,
|
|
43
43
|
value: node.attrs.title,
|
|
44
44
|
placeholder: intl && intl.formatMessage(expandMessages.expandPlaceholderText) || expandMessages.expandPlaceholderText.defaultMessage,
|
|
45
|
-
type: 'text'
|
|
46
|
-
readonly: !editable ? 'true' : undefined
|
|
45
|
+
type: 'text'
|
|
47
46
|
}]]],
|
|
48
47
|
// prettier-ignore
|
|
49
48
|
['div', {
|
|
50
|
-
'class': expandClassNames.content
|
|
51
|
-
contenteditable: editable
|
|
49
|
+
'class': expandClassNames.content
|
|
52
50
|
}, 0]];
|
|
53
51
|
};
|
|
54
52
|
export var ExpandNodeView = /*#__PURE__*/function () {
|
|
@@ -355,7 +353,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
355
353
|
this.selectNearNode = selectNearNode;
|
|
356
354
|
this.__livePage = __livePage;
|
|
357
355
|
this.intl = getIntl();
|
|
358
|
-
var _DOMSerializer$render = DOMSerializer.renderSpec(document, toDOM(node, this.__livePage, this.intl
|
|
356
|
+
var _DOMSerializer$render = DOMSerializer.renderSpec(document, toDOM(node, this.__livePage, this.intl)),
|
|
359
357
|
dom = _DOMSerializer$render.dom,
|
|
360
358
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
361
359
|
this.allowInteractiveExpand = allowInteractiveExpand;
|
|
@@ -444,18 +442,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
|
|
|
444
442
|
}
|
|
445
443
|
if (this.content) {
|
|
446
444
|
// Disallow interaction/selection inside when collapsed.
|
|
447
|
-
this.content.setAttribute('contenteditable',
|
|
448
|
-
}
|
|
449
|
-
} else {
|
|
450
|
-
if (this.content) {
|
|
451
|
-
this.content.setAttribute('contenteditable', this.view.editable ? 'true' : 'false');
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
if (this.input) {
|
|
455
|
-
if (!this.view.editable) {
|
|
456
|
-
this.input.setAttribute('readonly', 'true');
|
|
457
|
-
} else {
|
|
458
|
-
this.input.removeAttribute('readonly');
|
|
445
|
+
this.content.setAttribute('contenteditable', getBooleanFF('platform.editor.live-pages-expand-divergence') && this.__livePage ? !node.attrs.__expanded : node.attrs.__expanded);
|
|
459
446
|
}
|
|
460
447
|
}
|
|
461
448
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^35.8.0",
|
|
37
37
|
"@atlaskit/button": "^17.12.0",
|
|
38
|
-
"@atlaskit/editor-common": "^78.
|
|
38
|
+
"@atlaskit/editor-common": "^78.27.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-decorations": "^1.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-selection": "^1.1.0",
|