@atlaskit/inline-edit 12.4.2 → 12.4.3
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/inline-edit.js +53 -49
- package/dist/cjs/internal/read-view.js +10 -4
- package/dist/es2019/inline-edit.js +13 -8
- package/dist/es2019/internal/read-view.js +10 -5
- package/dist/esm/inline-edit.js +53 -49
- package/dist/esm/internal/read-view.js +10 -5
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
package/dist/cjs/inline-edit.js
CHANGED
|
@@ -20,19 +20,16 @@ var _useButtonFocusHook2 = _interopRequireDefault(require("./internal/hooks/use-
|
|
|
20
20
|
var _readView = _interopRequireDefault(require("./internal/read-view"));
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
function ownKeys(
|
|
24
|
-
function _objectSpread(
|
|
23
|
+
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; }
|
|
24
|
+
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; } /** @jsx jsx */
|
|
25
25
|
var fieldStyles = (0, _react2.css)({
|
|
26
26
|
maxWidth: '100%',
|
|
27
27
|
position: 'relative'
|
|
28
28
|
});
|
|
29
|
-
var buttonStyles = (0, _react2.css)({
|
|
30
|
-
display: 'none'
|
|
31
|
-
});
|
|
32
29
|
var analyticsAttributes = {
|
|
33
30
|
componentName: 'inlineEdit',
|
|
34
31
|
packageName: "@atlaskit/inline-edit",
|
|
35
|
-
packageVersion: "12.4.
|
|
32
|
+
packageVersion: "12.4.3"
|
|
36
33
|
};
|
|
37
34
|
var noop = function noop() {};
|
|
38
35
|
var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
@@ -168,50 +165,57 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
168
165
|
_onKeyDown = _ref$formProps.onKeyDown,
|
|
169
166
|
onSubmit = _ref$formProps.onSubmit,
|
|
170
167
|
formRef = _ref$formProps.ref;
|
|
171
|
-
return (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
168
|
+
return (0, _react2.jsx)("form", {
|
|
169
|
+
/**
|
|
170
|
+
* It is not normally acceptable to add key handlers to non-interactive elements
|
|
171
|
+
* as this is an accessibility anti-pattern. However, because this instance is
|
|
172
|
+
* to add support for keyboard functionality instead of creating an inaccessible
|
|
173
|
+
* custom element, we can add role="presentation" so that there is no negative
|
|
174
|
+
* impacts to assistive technologies.
|
|
175
|
+
*/
|
|
176
|
+
role: "presentation",
|
|
177
|
+
onKeyDown: function onKeyDown(e) {
|
|
178
|
+
_onKeyDown(e);
|
|
179
|
+
if (e.key === 'Esc' || e.key === 'Escape') {
|
|
180
|
+
onCancel();
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
onSubmit: onSubmit,
|
|
184
|
+
ref: formRef
|
|
185
|
+
}, (0, _react2.jsx)(_Field.default, {
|
|
186
|
+
name: "inlineEdit",
|
|
187
|
+
label: label,
|
|
188
|
+
defaultValue: defaultValue,
|
|
189
|
+
validate: validate,
|
|
190
|
+
isRequired: isRequired,
|
|
191
|
+
key: "edit-view" // used for reset to default value
|
|
192
|
+
}, function (_ref2) {
|
|
193
|
+
var fieldProps = _ref2.fieldProps,
|
|
194
|
+
error = _ref2.error;
|
|
195
|
+
return (0, _react2.jsx)("div", {
|
|
196
|
+
css: fieldStyles,
|
|
197
|
+
onBlur: function onBlur() {
|
|
198
|
+
onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
|
|
199
|
+
},
|
|
200
|
+
onFocus: onEditViewWrapperFocus
|
|
201
|
+
}, editView(_objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
202
|
+
errorMessage: error
|
|
203
|
+
}), editViewRef), !hideActionButtons ? (0, _react2.jsx)(_buttons.default, {
|
|
204
|
+
cancelButtonLabel: cancelButtonLabel,
|
|
205
|
+
confirmButtonLabel: confirmButtonLabel,
|
|
206
|
+
onMouseDown: function onMouseDown() {
|
|
207
|
+
/** Prevents focus on edit button only if mouse is used to click button, but not when keyboard is used */
|
|
208
|
+
doNotFocusOnEditButton();
|
|
178
209
|
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}, function (_ref2) {
|
|
189
|
-
var fieldProps = _ref2.fieldProps,
|
|
190
|
-
error = _ref2.error;
|
|
191
|
-
return (0, _react2.jsx)("div", {
|
|
192
|
-
css: fieldStyles,
|
|
193
|
-
onBlur: function onBlur() {
|
|
194
|
-
onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
|
|
195
|
-
},
|
|
196
|
-
onFocus: onEditViewWrapperFocus
|
|
197
|
-
}, editView(_objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
198
|
-
errorMessage: error
|
|
199
|
-
}), editViewRef), !hideActionButtons ? (0, _react2.jsx)(_buttons.default, {
|
|
200
|
-
cancelButtonLabel: cancelButtonLabel,
|
|
201
|
-
confirmButtonLabel: confirmButtonLabel,
|
|
202
|
-
onMouseDown: function onMouseDown() {
|
|
203
|
-
/** Prevents focus on edit button only if mouse is used to click button, but not when keyboard is used */
|
|
204
|
-
doNotFocusOnEditButton();
|
|
205
|
-
},
|
|
206
|
-
mode: mode,
|
|
207
|
-
onCancelClick: onCancelClick
|
|
208
|
-
}) : /** This is to allow Ctrl + Enter to submit without action buttons */
|
|
209
|
-
(0, _react2.jsx)("button", {
|
|
210
|
-
css: buttonStyles,
|
|
211
|
-
type: "submit"
|
|
212
|
-
}));
|
|
213
|
-
}))
|
|
214
|
-
);
|
|
210
|
+
mode: mode,
|
|
211
|
+
onCancelClick: onCancelClick
|
|
212
|
+
}) : /** This is to allow Ctrl + Enter to submit without action buttons */
|
|
213
|
+
(0, _react2.jsx)("button", {
|
|
214
|
+
hidden: true,
|
|
215
|
+
type: "submit",
|
|
216
|
+
"aria-label": "Submit"
|
|
217
|
+
}));
|
|
218
|
+
}));
|
|
215
219
|
});
|
|
216
220
|
}
|
|
217
221
|
return (/** Form, Field are used here only for the label and spacing */
|
|
@@ -66,8 +66,6 @@ var ReadView = function ReadView(_ref) {
|
|
|
66
66
|
postReadViewClick();
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions,jsx-a11y/no-noninteractive-element-interactions */
|
|
71
69
|
return (0, _react2.jsx)("div", {
|
|
72
70
|
css: readViewContainerStyles
|
|
73
71
|
}, (0, _react2.jsx)("button", {
|
|
@@ -77,7 +75,16 @@ var ReadView = function ReadView(_ref) {
|
|
|
77
75
|
onClick: onEditRequested,
|
|
78
76
|
ref: editButtonRef
|
|
79
77
|
}), (0, _react2.jsx)("div", {
|
|
80
|
-
css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles]
|
|
78
|
+
css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles]
|
|
79
|
+
/**
|
|
80
|
+
* It is not normally acceptable to add click handlers to non-interactive elements
|
|
81
|
+
* as this is an accessibility anti-pattern. However, because this instance is
|
|
82
|
+
* account for clicking on links that may be embedded within inline-edit and not
|
|
83
|
+
* creating an inaccessible custom element, we can add role="presentation" so that
|
|
84
|
+
* there is no negative impacts to assistive technologies.
|
|
85
|
+
* (Why links are embeeded in inline-edit is for another day...)
|
|
86
|
+
*/,
|
|
87
|
+
role: "presentation",
|
|
81
88
|
onClick: onReadViewClick,
|
|
82
89
|
onMouseDown: function onMouseDown(e) {
|
|
83
90
|
startX.current = e.clientX;
|
|
@@ -85,7 +92,6 @@ var ReadView = function ReadView(_ref) {
|
|
|
85
92
|
},
|
|
86
93
|
"data-read-view-fit-container-width": readViewFitContainerWidth
|
|
87
94
|
}, readView()));
|
|
88
|
-
/* eslint-enable jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions,jsx-a11y/no-noninteractive-element-interactions */
|
|
89
95
|
};
|
|
90
96
|
var _default = ReadView;
|
|
91
97
|
exports.default = _default;
|
|
@@ -13,13 +13,10 @@ const fieldStyles = css({
|
|
|
13
13
|
maxWidth: '100%',
|
|
14
14
|
position: 'relative'
|
|
15
15
|
});
|
|
16
|
-
const buttonStyles = css({
|
|
17
|
-
display: 'none'
|
|
18
|
-
});
|
|
19
16
|
const analyticsAttributes = {
|
|
20
17
|
componentName: 'inlineEdit',
|
|
21
18
|
packageName: "@atlaskit/inline-edit",
|
|
22
|
-
packageVersion: "12.4.
|
|
19
|
+
packageVersion: "12.4.3"
|
|
23
20
|
};
|
|
24
21
|
const noop = () => {};
|
|
25
22
|
const InnerInlineEdit = props => {
|
|
@@ -143,8 +140,15 @@ const InnerInlineEdit = props => {
|
|
|
143
140
|
onSubmit,
|
|
144
141
|
ref: formRef
|
|
145
142
|
}
|
|
146
|
-
}) =>
|
|
147
|
-
|
|
143
|
+
}) => jsx("form", {
|
|
144
|
+
/**
|
|
145
|
+
* It is not normally acceptable to add key handlers to non-interactive elements
|
|
146
|
+
* as this is an accessibility anti-pattern. However, because this instance is
|
|
147
|
+
* to add support for keyboard functionality instead of creating an inaccessible
|
|
148
|
+
* custom element, we can add role="presentation" so that there is no negative
|
|
149
|
+
* impacts to assistive technologies.
|
|
150
|
+
*/
|
|
151
|
+
role: "presentation",
|
|
148
152
|
onKeyDown: e => {
|
|
149
153
|
onKeyDown(e);
|
|
150
154
|
if (e.key === 'Esc' || e.key === 'Escape') {
|
|
@@ -183,8 +187,9 @@ const InnerInlineEdit = props => {
|
|
|
183
187
|
onCancelClick: onCancelClick
|
|
184
188
|
}) : /** This is to allow Ctrl + Enter to submit without action buttons */
|
|
185
189
|
jsx("button", {
|
|
186
|
-
|
|
187
|
-
type: "submit"
|
|
190
|
+
hidden: true,
|
|
191
|
+
type: "submit",
|
|
192
|
+
"aria-label": "Submit"
|
|
188
193
|
})))));
|
|
189
194
|
}
|
|
190
195
|
return (/** Form, Field are used here only for the label and spacing */
|
|
@@ -57,8 +57,6 @@ const ReadView = ({
|
|
|
57
57
|
postReadViewClick();
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions,jsx-a11y/no-noninteractive-element-interactions */
|
|
62
60
|
return jsx("div", {
|
|
63
61
|
css: readViewContainerStyles
|
|
64
62
|
}, jsx("button", {
|
|
@@ -68,7 +66,16 @@ const ReadView = ({
|
|
|
68
66
|
onClick: onEditRequested,
|
|
69
67
|
ref: editButtonRef
|
|
70
68
|
}), jsx("div", {
|
|
71
|
-
css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles]
|
|
69
|
+
css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles]
|
|
70
|
+
/**
|
|
71
|
+
* It is not normally acceptable to add click handlers to non-interactive elements
|
|
72
|
+
* as this is an accessibility anti-pattern. However, because this instance is
|
|
73
|
+
* account for clicking on links that may be embedded within inline-edit and not
|
|
74
|
+
* creating an inaccessible custom element, we can add role="presentation" so that
|
|
75
|
+
* there is no negative impacts to assistive technologies.
|
|
76
|
+
* (Why links are embeeded in inline-edit is for another day...)
|
|
77
|
+
*/,
|
|
78
|
+
role: "presentation",
|
|
72
79
|
onClick: onReadViewClick,
|
|
73
80
|
onMouseDown: e => {
|
|
74
81
|
startX.current = e.clientX;
|
|
@@ -76,7 +83,5 @@ const ReadView = ({
|
|
|
76
83
|
},
|
|
77
84
|
"data-read-view-fit-container-width": readViewFitContainerWidth
|
|
78
85
|
}, readView()));
|
|
79
|
-
/* eslint-enable jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions,jsx-a11y/no-noninteractive-element-interactions */
|
|
80
86
|
};
|
|
81
|
-
|
|
82
87
|
export default ReadView;
|
package/dist/esm/inline-edit.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
function ownKeys(
|
|
5
|
-
function _objectSpread(
|
|
4
|
+
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; }
|
|
5
|
+
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) { _defineProperty(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; }
|
|
6
6
|
/** @jsx jsx */
|
|
7
7
|
import React, { useCallback, useRef, useState } from 'react';
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -17,13 +17,10 @@ var fieldStyles = css({
|
|
|
17
17
|
maxWidth: '100%',
|
|
18
18
|
position: 'relative'
|
|
19
19
|
});
|
|
20
|
-
var buttonStyles = css({
|
|
21
|
-
display: 'none'
|
|
22
|
-
});
|
|
23
20
|
var analyticsAttributes = {
|
|
24
21
|
componentName: 'inlineEdit',
|
|
25
22
|
packageName: "@atlaskit/inline-edit",
|
|
26
|
-
packageVersion: "12.4.
|
|
23
|
+
packageVersion: "12.4.3"
|
|
27
24
|
};
|
|
28
25
|
var noop = function noop() {};
|
|
29
26
|
var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
@@ -159,50 +156,57 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
159
156
|
_onKeyDown = _ref$formProps.onKeyDown,
|
|
160
157
|
onSubmit = _ref$formProps.onSubmit,
|
|
161
158
|
formRef = _ref$formProps.ref;
|
|
162
|
-
return (
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
159
|
+
return jsx("form", {
|
|
160
|
+
/**
|
|
161
|
+
* It is not normally acceptable to add key handlers to non-interactive elements
|
|
162
|
+
* as this is an accessibility anti-pattern. However, because this instance is
|
|
163
|
+
* to add support for keyboard functionality instead of creating an inaccessible
|
|
164
|
+
* custom element, we can add role="presentation" so that there is no negative
|
|
165
|
+
* impacts to assistive technologies.
|
|
166
|
+
*/
|
|
167
|
+
role: "presentation",
|
|
168
|
+
onKeyDown: function onKeyDown(e) {
|
|
169
|
+
_onKeyDown(e);
|
|
170
|
+
if (e.key === 'Esc' || e.key === 'Escape') {
|
|
171
|
+
onCancel();
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
onSubmit: onSubmit,
|
|
175
|
+
ref: formRef
|
|
176
|
+
}, jsx(Field, {
|
|
177
|
+
name: "inlineEdit",
|
|
178
|
+
label: label,
|
|
179
|
+
defaultValue: defaultValue,
|
|
180
|
+
validate: validate,
|
|
181
|
+
isRequired: isRequired,
|
|
182
|
+
key: "edit-view" // used for reset to default value
|
|
183
|
+
}, function (_ref2) {
|
|
184
|
+
var fieldProps = _ref2.fieldProps,
|
|
185
|
+
error = _ref2.error;
|
|
186
|
+
return jsx("div", {
|
|
187
|
+
css: fieldStyles,
|
|
188
|
+
onBlur: function onBlur() {
|
|
189
|
+
onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
|
|
190
|
+
},
|
|
191
|
+
onFocus: onEditViewWrapperFocus
|
|
192
|
+
}, editView(_objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
193
|
+
errorMessage: error
|
|
194
|
+
}), editViewRef), !hideActionButtons ? jsx(Buttons, {
|
|
195
|
+
cancelButtonLabel: cancelButtonLabel,
|
|
196
|
+
confirmButtonLabel: confirmButtonLabel,
|
|
197
|
+
onMouseDown: function onMouseDown() {
|
|
198
|
+
/** Prevents focus on edit button only if mouse is used to click button, but not when keyboard is used */
|
|
199
|
+
doNotFocusOnEditButton();
|
|
169
200
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}, function (_ref2) {
|
|
180
|
-
var fieldProps = _ref2.fieldProps,
|
|
181
|
-
error = _ref2.error;
|
|
182
|
-
return jsx("div", {
|
|
183
|
-
css: fieldStyles,
|
|
184
|
-
onBlur: function onBlur() {
|
|
185
|
-
onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
|
|
186
|
-
},
|
|
187
|
-
onFocus: onEditViewWrapperFocus
|
|
188
|
-
}, editView(_objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
189
|
-
errorMessage: error
|
|
190
|
-
}), editViewRef), !hideActionButtons ? jsx(Buttons, {
|
|
191
|
-
cancelButtonLabel: cancelButtonLabel,
|
|
192
|
-
confirmButtonLabel: confirmButtonLabel,
|
|
193
|
-
onMouseDown: function onMouseDown() {
|
|
194
|
-
/** Prevents focus on edit button only if mouse is used to click button, but not when keyboard is used */
|
|
195
|
-
doNotFocusOnEditButton();
|
|
196
|
-
},
|
|
197
|
-
mode: mode,
|
|
198
|
-
onCancelClick: onCancelClick
|
|
199
|
-
}) : /** This is to allow Ctrl + Enter to submit without action buttons */
|
|
200
|
-
jsx("button", {
|
|
201
|
-
css: buttonStyles,
|
|
202
|
-
type: "submit"
|
|
203
|
-
}));
|
|
204
|
-
}))
|
|
205
|
-
);
|
|
201
|
+
mode: mode,
|
|
202
|
+
onCancelClick: onCancelClick
|
|
203
|
+
}) : /** This is to allow Ctrl + Enter to submit without action buttons */
|
|
204
|
+
jsx("button", {
|
|
205
|
+
hidden: true,
|
|
206
|
+
type: "submit",
|
|
207
|
+
"aria-label": "Submit"
|
|
208
|
+
}));
|
|
209
|
+
}));
|
|
206
210
|
});
|
|
207
211
|
}
|
|
208
212
|
return (/** Form, Field are used here only for the label and spacing */
|
|
@@ -56,8 +56,6 @@ var ReadView = function ReadView(_ref) {
|
|
|
56
56
|
postReadViewClick();
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions,jsx-a11y/no-noninteractive-element-interactions */
|
|
61
59
|
return jsx("div", {
|
|
62
60
|
css: readViewContainerStyles
|
|
63
61
|
}, jsx("button", {
|
|
@@ -67,7 +65,16 @@ var ReadView = function ReadView(_ref) {
|
|
|
67
65
|
onClick: onEditRequested,
|
|
68
66
|
ref: editButtonRef
|
|
69
67
|
}), jsx("div", {
|
|
70
|
-
css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles]
|
|
68
|
+
css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles]
|
|
69
|
+
/**
|
|
70
|
+
* It is not normally acceptable to add click handlers to non-interactive elements
|
|
71
|
+
* as this is an accessibility anti-pattern. However, because this instance is
|
|
72
|
+
* account for clicking on links that may be embedded within inline-edit and not
|
|
73
|
+
* creating an inaccessible custom element, we can add role="presentation" so that
|
|
74
|
+
* there is no negative impacts to assistive technologies.
|
|
75
|
+
* (Why links are embeeded in inline-edit is for another day...)
|
|
76
|
+
*/,
|
|
77
|
+
role: "presentation",
|
|
71
78
|
onClick: onReadViewClick,
|
|
72
79
|
onMouseDown: function onMouseDown(e) {
|
|
73
80
|
startX.current = e.clientX;
|
|
@@ -75,7 +82,5 @@ var ReadView = function ReadView(_ref) {
|
|
|
75
82
|
},
|
|
76
83
|
"data-read-view-fit-container-width": readViewFitContainerWidth
|
|
77
84
|
}, readView()));
|
|
78
|
-
/* eslint-enable jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions,jsx-a11y/no-noninteractive-element-interactions */
|
|
79
85
|
};
|
|
80
|
-
|
|
81
86
|
export default ReadView;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/inline-edit",
|
|
3
|
-
"version": "12.4.
|
|
3
|
+
"version": "12.4.3",
|
|
4
4
|
"description": "An inline edit displays a custom input component that switches between reading and editing on the same page.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
|
-
"@atlaskit/button": "^16.
|
|
36
|
+
"@atlaskit/button": "^16.10.0",
|
|
37
37
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
38
38
|
"@atlaskit/form": "^8.11.0",
|
|
39
39
|
"@atlaskit/icon": "^21.12.0",
|
|
40
40
|
"@atlaskit/inline-dialog": "^13.6.0",
|
|
41
41
|
"@atlaskit/textfield": "^5.6.0",
|
|
42
|
-
"@atlaskit/theme": "^12.
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
42
|
+
"@atlaskit/theme": "^12.6.0",
|
|
43
|
+
"@atlaskit/tokens": "^1.22.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@emotion/react": "^11.7.1"
|
|
46
46
|
},
|
|
@@ -49,12 +49,13 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@af/accessibility-testing": "*",
|
|
52
|
-
"@
|
|
52
|
+
"@af/integration-testing": "*",
|
|
53
|
+
"@atlaskit/datetime-picker": "^12.10.0",
|
|
53
54
|
"@atlaskit/docs": "*",
|
|
54
55
|
"@atlaskit/section-message": "^6.4.0",
|
|
55
|
-
"@atlaskit/select": "^16.
|
|
56
|
+
"@atlaskit/select": "^16.6.0",
|
|
56
57
|
"@atlaskit/ssr": "*",
|
|
57
|
-
"@atlaskit/tag": "^11.
|
|
58
|
+
"@atlaskit/tag": "^11.6.0",
|
|
58
59
|
"@atlaskit/tag-group": "^10.2.0",
|
|
59
60
|
"@atlaskit/textarea": "^4.7.0",
|
|
60
61
|
"@atlaskit/visual-regression": "*",
|