@atlaskit/editor-plugin-expand 11.0.12 → 11.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 +18 -0
- package/dist/cjs/legacyExpand/nodeviews/index.js +5 -2
- package/dist/cjs/singlePlayerExpand/ui/NodeView.js +6 -2
- package/dist/es2019/legacyExpand/nodeviews/index.js +5 -1
- package/dist/es2019/singlePlayerExpand/ui/NodeView.js +6 -1
- package/dist/esm/legacyExpand/nodeviews/index.js +5 -2
- package/dist/esm/singlePlayerExpand/ui/NodeView.js +6 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-expand
|
|
2
2
|
|
|
3
|
+
## 11.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`9c750ab0192db`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9c750ab0192db) -
|
|
8
|
+
Add role=group and aria-label to expand content div so screen readers announce the body of an
|
|
9
|
+
expand node
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 11.0.13
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 11.0.12
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -61,11 +61,14 @@ var toDOM = function toDOM(node, __livePage, intl, titleReadOnly, contentEditabl
|
|
|
61
61
|
placeholder: intl && intl.formatMessage(_ui.expandMessages.expandPlaceholderText) || _ui.expandMessages.expandPlaceholderText.defaultMessage,
|
|
62
62
|
type: 'text',
|
|
63
63
|
readonly: titleReadOnly ? 'true' : undefined
|
|
64
|
-
}]]], ['div', {
|
|
64
|
+
}]]], ['div', _objectSpread({
|
|
65
65
|
// prettier-ignore
|
|
66
66
|
class: "".concat(_styles.expandClassNames.content, " ").concat((__livePage ? !node.attrs.__expanded : node.attrs.__expanded) ? '' : _styles.expandClassNames.contentCollapsed),
|
|
67
67
|
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
68
|
-
}, 0
|
|
68
|
+
}, (0, _expValEquals.expValEquals)('platform_editor_expand_content_a11y', 'isEnabled', true) && {
|
|
69
|
+
role: 'group',
|
|
70
|
+
'aria-label': intl && intl.formatMessage(_ui.expandMessages.expandBodyAriaLabel) || _ui.expandMessages.expandBodyAriaLabel.defaultMessage
|
|
71
|
+
}), 0]];
|
|
69
72
|
};
|
|
70
73
|
var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
|
|
71
74
|
function ExpandNodeView(_node, view, getPos, getIntl, isMobile, selectNearNode, api, nodeViewPortalProviderAPI) {
|
|
@@ -10,6 +10,7 @@ var _expand = require("@atlaskit/editor-common/expand");
|
|
|
10
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
11
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
16
|
var buildExpandClassName = exports.buildExpandClassName = function buildExpandClassName(type, expanded) {
|
|
@@ -48,9 +49,12 @@ var toDOM = exports.toDOM = function toDOM(node, __livePage, intl, titleReadOnly
|
|
|
48
49
|
placeholder: intl && typeof intl.formatMessage === 'function' && intl.formatMessage(_ui.expandMessages.expandPlaceholderText) || _ui.expandMessages.expandPlaceholderText.defaultMessage,
|
|
49
50
|
type: 'text',
|
|
50
51
|
readonly: titleReadOnly ? 'true' : undefined
|
|
51
|
-
}]]], ['div', {
|
|
52
|
+
}]]], ['div', _objectSpread({
|
|
52
53
|
// prettier-ignore
|
|
53
54
|
class: "".concat(_styles.expandClassNames.content, " ").concat(_expand.expandedState.get(node) ? '' : _styles.expandClassNames.contentCollapsed),
|
|
54
55
|
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
55
|
-
}, 0
|
|
56
|
+
}, (0, _expValEquals.expValEquals)('platform_editor_expand_content_a11y', 'isEnabled', true) && {
|
|
57
|
+
role: 'group',
|
|
58
|
+
'aria-label': intl && intl.formatMessage(_ui.expandMessages.expandBodyAriaLabel) || _ui.expandMessages.expandBodyAriaLabel.defaultMessage
|
|
59
|
+
}), 0]];
|
|
56
60
|
};
|
|
@@ -53,7 +53,11 @@ const toDOM = (node, __livePage, intl, titleReadOnly, contentEditable) => ['div'
|
|
|
53
53
|
}]]], ['div', {
|
|
54
54
|
// prettier-ignore
|
|
55
55
|
class: `${expandClassNames.content} ${(__livePage ? !node.attrs.__expanded : node.attrs.__expanded) ? '' : expandClassNames.contentCollapsed}`,
|
|
56
|
-
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
56
|
+
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined,
|
|
57
|
+
...(expValEquals('platform_editor_expand_content_a11y', 'isEnabled', true) && {
|
|
58
|
+
role: 'group',
|
|
59
|
+
'aria-label': intl && intl.formatMessage(expandMessages.expandBodyAriaLabel) || expandMessages.expandBodyAriaLabel.defaultMessage
|
|
60
|
+
})
|
|
57
61
|
}, 0]];
|
|
58
62
|
export class ExpandNodeView {
|
|
59
63
|
constructor(_node, view, getPos, getIntl, isMobile, selectNearNode, api, nodeViewPortalProviderAPI, allowInteractiveExpand = true, __livePage = false, cleanUpEditorDisabledOnChange) {
|
|
@@ -2,6 +2,7 @@ import { expandedState } from '@atlaskit/editor-common/expand';
|
|
|
2
2
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { expandMessages } from '@atlaskit/editor-common/ui';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
6
|
export const buildExpandClassName = (type, expanded) => {
|
|
6
7
|
return `${expandClassNames.prefix} ${expandClassNames.type(type)} ${expanded ? expandClassNames.expanded : ''}`;
|
|
7
8
|
};
|
|
@@ -42,6 +43,10 @@ export const toDOM = (node, __livePage, intl, titleReadOnly, contentEditable) =>
|
|
|
42
43
|
}]]], ['div', {
|
|
43
44
|
// prettier-ignore
|
|
44
45
|
class: `${expandClassNames.content} ${expandedState.get(node) ? '' : expandClassNames.contentCollapsed}`,
|
|
45
|
-
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
46
|
+
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined,
|
|
47
|
+
...(expValEquals('platform_editor_expand_content_a11y', 'isEnabled', true) && {
|
|
48
|
+
role: 'group',
|
|
49
|
+
'aria-label': intl && intl.formatMessage(expandMessages.expandBodyAriaLabel) || expandMessages.expandBodyAriaLabel.defaultMessage
|
|
50
|
+
})
|
|
46
51
|
}, 0]];
|
|
47
52
|
};
|
|
@@ -54,11 +54,14 @@ var toDOM = function toDOM(node, __livePage, intl, titleReadOnly, contentEditabl
|
|
|
54
54
|
placeholder: intl && intl.formatMessage(expandMessages.expandPlaceholderText) || expandMessages.expandPlaceholderText.defaultMessage,
|
|
55
55
|
type: 'text',
|
|
56
56
|
readonly: titleReadOnly ? 'true' : undefined
|
|
57
|
-
}]]], ['div', {
|
|
57
|
+
}]]], ['div', _objectSpread({
|
|
58
58
|
// prettier-ignore
|
|
59
59
|
class: "".concat(expandClassNames.content, " ").concat((__livePage ? !node.attrs.__expanded : node.attrs.__expanded) ? '' : expandClassNames.contentCollapsed),
|
|
60
60
|
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
61
|
-
},
|
|
61
|
+
}, expValEquals('platform_editor_expand_content_a11y', 'isEnabled', true) && {
|
|
62
|
+
role: 'group',
|
|
63
|
+
'aria-label': intl && intl.formatMessage(expandMessages.expandBodyAriaLabel) || expandMessages.expandBodyAriaLabel.defaultMessage
|
|
64
|
+
}), 0]];
|
|
62
65
|
};
|
|
63
66
|
export var ExpandNodeView = /*#__PURE__*/function () {
|
|
64
67
|
function ExpandNodeView(_node, view, getPos, getIntl, isMobile, selectNearNode, api, nodeViewPortalProviderAPI) {
|
|
@@ -5,6 +5,7 @@ import { expandedState } from '@atlaskit/editor-common/expand';
|
|
|
5
5
|
import { expandClassNames } from '@atlaskit/editor-common/styles';
|
|
6
6
|
import { expandMessages } from '@atlaskit/editor-common/ui';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
export var buildExpandClassName = function buildExpandClassName(type, expanded) {
|
|
9
10
|
return "".concat(expandClassNames.prefix, " ").concat(expandClassNames.type(type), " ").concat(expanded ? expandClassNames.expanded : '');
|
|
10
11
|
};
|
|
@@ -41,9 +42,12 @@ export var toDOM = function toDOM(node, __livePage, intl, titleReadOnly, content
|
|
|
41
42
|
placeholder: intl && typeof intl.formatMessage === 'function' && intl.formatMessage(expandMessages.expandPlaceholderText) || expandMessages.expandPlaceholderText.defaultMessage,
|
|
42
43
|
type: 'text',
|
|
43
44
|
readonly: titleReadOnly ? 'true' : undefined
|
|
44
|
-
}]]], ['div', {
|
|
45
|
+
}]]], ['div', _objectSpread({
|
|
45
46
|
// prettier-ignore
|
|
46
47
|
class: "".concat(expandClassNames.content, " ").concat(expandedState.get(node) ? '' : expandClassNames.contentCollapsed),
|
|
47
48
|
contenteditable: contentEditable !== undefined ? contentEditable ? 'true' : 'false' : undefined
|
|
48
|
-
},
|
|
49
|
+
}, expValEquals('platform_editor_expand_content_a11y', 'isEnabled', true) && {
|
|
50
|
+
role: 'group',
|
|
51
|
+
'aria-label': intl && intl.formatMessage(expandMessages.expandBodyAriaLabel) || expandMessages.expandBodyAriaLabel.defaultMessage
|
|
52
|
+
}), 0]];
|
|
49
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "11.0
|
|
3
|
+
"version": "11.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.7.0",
|
|
33
33
|
"@atlaskit/button": "^23.11.0",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^10.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-block-controls": "^11.2.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/icon-lab": "^6.6.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^74.0.0",
|
|
52
52
|
"@atlaskit/tokens": "^13.0.0",
|
|
53
53
|
"@atlaskit/tooltip": "^21.2.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"w3c-keyname": "^2.1.8"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@atlaskit/editor-common": "^114.
|
|
60
|
+
"@atlaskit/editor-common": "^114.17.0",
|
|
61
61
|
"react": "^18.2.0",
|
|
62
62
|
"react-dom": "^18.2.0",
|
|
63
63
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|