@atlaskit/inline-edit 13.7.9 → 14.0.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 +20 -0
- package/dist/cjs/inline-edit.compiled.css +2 -0
- package/dist/cjs/inline-edit.js +46 -51
- package/dist/cjs/inline-editable-textfield.compiled.css +9 -0
- package/dist/cjs/inline-editable-textfield.js +18 -21
- package/dist/cjs/internal/buttons.compiled.css +18 -0
- package/dist/cjs/internal/buttons.js +35 -62
- package/dist/cjs/internal/read-view.compiled.css +28 -0
- package/dist/cjs/internal/read-view.js +21 -55
- package/dist/es2019/inline-edit.compiled.css +2 -0
- package/dist/es2019/inline-edit.js +20 -27
- package/dist/es2019/inline-editable-textfield.compiled.css +9 -0
- package/dist/es2019/inline-editable-textfield.js +16 -19
- package/dist/es2019/internal/buttons.compiled.css +18 -0
- package/dist/es2019/internal/buttons.js +18 -60
- package/dist/es2019/internal/read-view.compiled.css +28 -0
- package/dist/es2019/internal/read-view.js +18 -54
- package/dist/esm/inline-edit.compiled.css +2 -0
- package/dist/esm/inline-edit.js +45 -53
- package/dist/esm/inline-editable-textfield.compiled.css +9 -0
- package/dist/esm/inline-editable-textfield.js +16 -19
- package/dist/esm/internal/buttons.compiled.css +18 -0
- package/dist/esm/internal/buttons.js +32 -60
- package/dist/esm/internal/read-view.compiled.css +28 -0
- package/dist/esm/internal/read-view.js +21 -54
- package/dist/types/entry-points/types.d.ts +1 -1
- package/dist/types/inline-edit.d.ts +2 -2
- package/dist/types/internal/buttons.d.ts +1 -11
- package/dist/types/internal/read-view.d.ts +1 -2
- package/dist/types-ts4.5/entry-points/types.d.ts +1 -1
- package/dist/types-ts4.5/inline-edit.d.ts +2 -2
- package/dist/types-ts4.5/internal/buttons.d.ts +1 -11
- package/dist/types-ts4.5/internal/read-view.d.ts +1 -2
- package/package.json +10 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/inline-edit
|
|
2
2
|
|
|
3
|
+
## 14.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#175115](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/175115)
|
|
8
|
+
[`a39f1957d919f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a39f1957d919f) -
|
|
9
|
+
Migrated from `@emotion/react` to `@compiled/react` in order to improve performance, align with
|
|
10
|
+
the rest of the Atlaskit techstack, and support React 18 Streaming SSR. Please note, in order to
|
|
11
|
+
use this version of `@atlaskit/inline-edit`, you will need to ensure that your bundler is
|
|
12
|
+
configured to handle `.css` imports correctly.
|
|
13
|
+
|
|
14
|
+
Most bundlers come with built-in support for `.css` imports, so you may not need to do anything.
|
|
15
|
+
If you are using a different bundler, please refer to the documentation for that bundler to
|
|
16
|
+
understand how to handle `.css` imports. For more information on the migration, please refer to
|
|
17
|
+
[RFC-73 Migrating our components to Compiled CSS-in-JS](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 13.7.9
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/cjs/inline-edit.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* inline-edit.tsx generated by @compiled/babel-plugin v0.32.2 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -6,15 +7,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.default = void 0;
|
|
10
|
+
require("./inline-edit.compiled.css");
|
|
11
|
+
var _runtime = require("@compiled/react/runtime");
|
|
9
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _react2 = require("@emotion/react");
|
|
13
15
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
14
16
|
var _Field = _interopRequireDefault(require("@atlaskit/form/Field"));
|
|
15
17
|
var _Form = _interopRequireDefault(require("@atlaskit/form/Form"));
|
|
16
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
-
var
|
|
19
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
18
20
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
19
21
|
var _buttons = _interopRequireDefault(require("./internal/buttons"));
|
|
20
22
|
var _useButtonFocusHook2 = _interopRequireDefault(require("./internal/hooks/use-button-focus-hook"));
|
|
@@ -22,18 +24,12 @@ var _readView = _interopRequireDefault(require("./internal/read-view"));
|
|
|
22
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
23
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
26
|
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; }
|
|
25
|
-
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; }
|
|
26
|
-
|
|
27
|
-
* @jsx jsx
|
|
28
|
-
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
29
|
-
var fieldStyles = (0, _react2.css)({
|
|
30
|
-
maxWidth: '100%',
|
|
31
|
-
position: 'relative'
|
|
32
|
-
});
|
|
27
|
+
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; }
|
|
28
|
+
var fieldStyles = null;
|
|
33
29
|
var analyticsAttributes = {
|
|
34
30
|
componentName: 'inlineEdit',
|
|
35
31
|
packageName: "@atlaskit/inline-edit",
|
|
36
|
-
packageVersion: "
|
|
32
|
+
packageVersion: "14.0.0"
|
|
37
33
|
};
|
|
38
34
|
var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
39
35
|
var _props$startWithEditV = props.startWithEditViewOpen,
|
|
@@ -157,7 +153,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
157
153
|
return "".concat(editButtonLabel, ", ").concat(editLabel);
|
|
158
154
|
};
|
|
159
155
|
var renderReadView = function renderReadView() {
|
|
160
|
-
return
|
|
156
|
+
return /*#__PURE__*/_react.default.createElement(_readView.default, {
|
|
161
157
|
editButtonLabel: concatenatedEditButtonLabel(),
|
|
162
158
|
onEditRequested: onEditRequested,
|
|
163
159
|
postReadViewClick: doNotFocusOnEditButton,
|
|
@@ -167,7 +163,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
167
163
|
testId: testId
|
|
168
164
|
});
|
|
169
165
|
};
|
|
170
|
-
return
|
|
166
|
+
return /*#__PURE__*/_react.default.createElement(_Form.default, {
|
|
171
167
|
onSubmit: function onSubmit(data) {
|
|
172
168
|
return onConfirm(data.inlineEdit);
|
|
173
169
|
}
|
|
@@ -177,7 +173,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
177
173
|
onSubmit = _ref$formProps.onSubmit,
|
|
178
174
|
formRef = _ref$formProps.ref,
|
|
179
175
|
reset = _ref.reset;
|
|
180
|
-
return
|
|
176
|
+
return /*#__PURE__*/_react.default.createElement("form", {
|
|
181
177
|
/**
|
|
182
178
|
* It is not normally acceptable to add key handlers to non-interactive elements
|
|
183
179
|
* as this is an accessibility anti-pattern. However, because this instance is
|
|
@@ -197,7 +193,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
197
193
|
},
|
|
198
194
|
onSubmit: onSubmit,
|
|
199
195
|
ref: formRef
|
|
200
|
-
}, shouldBeEditing ?
|
|
196
|
+
}, shouldBeEditing ? /*#__PURE__*/_react.default.createElement(_Field.default, {
|
|
201
197
|
name: "inlineEdit",
|
|
202
198
|
label: label,
|
|
203
199
|
defaultValue: defaultValue,
|
|
@@ -207,46 +203,45 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
207
203
|
}, function (_ref2) {
|
|
208
204
|
var fieldProps = _ref2.fieldProps,
|
|
209
205
|
error = _ref2.error;
|
|
210
|
-
return (
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
onBlur: function onBlur(e) {
|
|
215
|
-
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
216
|
-
onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
onFocus: onEditViewWrapperFocus
|
|
220
|
-
}, editView(_objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
221
|
-
errorMessage: error
|
|
222
|
-
}), editViewRef), !hideActionButtons ? (0, _react2.jsx)(_buttons.default, {
|
|
223
|
-
testId: testId,
|
|
224
|
-
cancelButtonLabel: cancelButtonLabel,
|
|
225
|
-
confirmButtonLabel: confirmButtonLabel,
|
|
226
|
-
onMouseDown: function onMouseDown() {
|
|
227
|
-
/**
|
|
228
|
-
* Prevents focus on edit button only if mouse is used to click button, but not when keyboard is used
|
|
229
|
-
*/
|
|
230
|
-
doNotFocusOnEditButton();
|
|
231
|
-
},
|
|
232
|
-
onCancelClick: function onCancelClick(e) {
|
|
233
|
-
reset();
|
|
234
|
-
_onCancelClick(e);
|
|
206
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
207
|
+
onBlur: function onBlur(e) {
|
|
208
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
209
|
+
onEditViewWrapperBlur(fieldProps.isInvalid, onSubmit, formRef);
|
|
235
210
|
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
211
|
+
},
|
|
212
|
+
onFocus: onEditViewWrapperFocus,
|
|
213
|
+
className: (0, _runtime.ax)(["_p12f1osq _kqswh2mm"])
|
|
214
|
+
}, editView(_objectSpread(_objectSpread({}, fieldProps), {}, {
|
|
215
|
+
errorMessage: error
|
|
216
|
+
}), editViewRef), !hideActionButtons ? /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
217
|
+
testId: testId,
|
|
218
|
+
cancelButtonLabel: cancelButtonLabel,
|
|
219
|
+
confirmButtonLabel: confirmButtonLabel,
|
|
220
|
+
onMouseDown: function onMouseDown() {
|
|
221
|
+
/**
|
|
222
|
+
* Prevents focus on edit button only if mouse is used to click button, but not when keyboard is used
|
|
223
|
+
*/
|
|
224
|
+
doNotFocusOnEditButton();
|
|
225
|
+
},
|
|
226
|
+
onCancelClick: function onCancelClick(e) {
|
|
227
|
+
reset();
|
|
228
|
+
_onCancelClick(e);
|
|
229
|
+
}
|
|
230
|
+
}) :
|
|
231
|
+
/*#__PURE__*/
|
|
232
|
+
/**
|
|
233
|
+
* This is to allow Ctrl + Enter to submit without action buttons
|
|
234
|
+
*/
|
|
235
|
+
_react.default.createElement(_compiled.Pressable, {
|
|
236
|
+
hidden: true,
|
|
237
|
+
type: "submit"
|
|
238
|
+
}, /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, null, "Submit")));
|
|
245
239
|
}) :
|
|
240
|
+
/*#__PURE__*/
|
|
246
241
|
/**
|
|
247
242
|
* Field is used here only for the label and spacing
|
|
248
243
|
*/
|
|
249
|
-
|
|
244
|
+
_react.default.createElement(_Field.default, {
|
|
250
245
|
name: "inlineEdit",
|
|
251
246
|
label: label,
|
|
252
247
|
defaultValue: "",
|
|
@@ -257,7 +252,7 @@ var InnerInlineEdit = function InnerInlineEdit(props) {
|
|
|
257
252
|
};
|
|
258
253
|
var InlineEdit = function InlineEdit(props) {
|
|
259
254
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
260
|
-
return
|
|
255
|
+
return /*#__PURE__*/_react.default.createElement(InnerInlineEdit, props);
|
|
261
256
|
};
|
|
262
257
|
|
|
263
258
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._18zr12x7{padding-inline:var(--ds-space-075,6px)}
|
|
3
|
+
._1rjc1b66{padding-block:var(--ds-space-050,4px)}
|
|
4
|
+
._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
|
|
5
|
+
._1e0c1txw{display:flex}
|
|
6
|
+
._1nmz1hna{word-break:break-word}
|
|
7
|
+
._p12f1osq{max-width:100%}
|
|
8
|
+
._vwz41osq{line-height:100%}
|
|
9
|
+
._y4ti12x7{padding-inline-end:var(--ds-space-075,6px)}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* inline-editable-textfield.tsx generated by @compiled/babel-plugin v0.32.2 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -6,34 +7,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.default = void 0;
|
|
10
|
+
require("./inline-editable-textfield.compiled.css");
|
|
11
|
+
var _runtime = require("@compiled/react/runtime");
|
|
9
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _css = require("@atlaskit/css");
|
|
12
16
|
var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/error"));
|
|
13
17
|
var _inlineDialog = _interopRequireDefault(require("@atlaskit/inline-dialog"));
|
|
14
|
-
var
|
|
18
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
19
|
var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
16
20
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
21
|
var _inlineEdit = _interopRequireDefault(require("./inline-edit"));
|
|
18
22
|
var _excluded = ["errorMessage", "isInvalid"];
|
|
19
23
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
24
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
-
var errorIconContainerStyles =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
paddingInline: 'space.075',
|
|
31
|
-
wordBreak: 'break-word'
|
|
32
|
-
});
|
|
33
|
-
var compactStyles = (0, _primitives.xcss)({
|
|
34
|
-
paddingBlock: 'space.050',
|
|
35
|
-
paddingInline: 'space.075'
|
|
36
|
-
});
|
|
25
|
+
var errorIconContainerStyles = {
|
|
26
|
+
root: "_vwz41osq _y4ti12x7"
|
|
27
|
+
};
|
|
28
|
+
var readViewForTextFieldStyles = {
|
|
29
|
+
root: "_1e0c1txw _11c81oud _p12f1osq _1rjcu2gc _18zr12x7 _1nmz1hna"
|
|
30
|
+
};
|
|
31
|
+
var compactStyles = {
|
|
32
|
+
root: "_1rjc1b66 _18zr12x7"
|
|
33
|
+
};
|
|
37
34
|
var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
38
35
|
var _props$isCompact = props.isCompact,
|
|
39
36
|
isCompact = _props$isCompact === void 0 ? false : _props$isCompact,
|
|
@@ -63,8 +60,8 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
|
63
60
|
placement: "right"
|
|
64
61
|
}, /*#__PURE__*/_react.default.createElement(_textfield.default, (0, _extends2.default)({}, props, {
|
|
65
62
|
ref: textFieldRef,
|
|
66
|
-
elemAfterInput: isInvalid && /*#__PURE__*/_react.default.createElement(
|
|
67
|
-
xcss: errorIconContainerStyles
|
|
63
|
+
elemAfterInput: isInvalid && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
64
|
+
xcss: errorIconContainerStyles.root
|
|
68
65
|
}, /*#__PURE__*/_react.default.createElement(_error.default, {
|
|
69
66
|
label: "error",
|
|
70
67
|
primaryColor: "var(--ds-icon-danger, ".concat(_colors.R400, ")")
|
|
@@ -75,8 +72,8 @@ var InlineEditableTextfield = function InlineEditableTextfield(props) {
|
|
|
75
72
|
})));
|
|
76
73
|
},
|
|
77
74
|
readView: function readView() {
|
|
78
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
79
|
-
xcss:
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
76
|
+
xcss: (0, _css.cx)(readViewForTextFieldStyles.root, isCompact && compactStyles.root),
|
|
80
77
|
"data-compact": isCompact,
|
|
81
78
|
testId: testId && "read-view-".concat(testId)
|
|
82
79
|
}, defaultValue || placeholder);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._2rko1sit{border-radius:var(--ds-border-radius,3px)}
|
|
3
|
+
._152t1osq{inset-block-start:100%}
|
|
4
|
+
._16qs1a23{box-shadow:var(--_3t1odq)}
|
|
5
|
+
._1bsbxy5q{width:var(--ds-space-400,2pc)}
|
|
6
|
+
._1e0c1txw{display:flex}
|
|
7
|
+
._1mpy1b66:last-child{margin-inline-start:var(--ds-space-050,4px)}
|
|
8
|
+
._1nlx13nm>button{background-color:var(--_12yx4z3)}
|
|
9
|
+
._1o9zidpf{flex-shrink:0}
|
|
10
|
+
._1pby1kze{z-index:200}
|
|
11
|
+
._1pfh12x7{margin-block-start:var(--ds-space-075,6px)}
|
|
12
|
+
._bfhk13b4{background-color:var(--_1f6rtr1)}
|
|
13
|
+
._kqswstnw{position:absolute}
|
|
14
|
+
._rjxpidpf{inset-inline-end:0}
|
|
15
|
+
._vchhusvi{box-sizing:border-box}
|
|
16
|
+
._l2uv11wk>button:hover{background-color:var(--_qfu7kd)}
|
|
17
|
+
._7mfvdecw>button:active{background-color:var(--ds-surface-overlay-pressed,rgba(179,212,255,.6))}
|
|
18
|
+
._szlb17km>button:active{color:var(--_1lrmnoy)}
|
|
@@ -1,94 +1,67 @@
|
|
|
1
|
+
/* buttons.tsx generated by @compiled/babel-plugin v0.32.2 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.default = void 0;
|
|
10
|
+
require("./buttons.compiled.css");
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
14
|
var _new = require("@atlaskit/button/new");
|
|
11
15
|
var _check = _interopRequireDefault(require("@atlaskit/icon/glyph/check"));
|
|
12
16
|
var _cross = _interopRequireDefault(require("@atlaskit/icon/glyph/cross"));
|
|
13
17
|
var _colors = require("@atlaskit/theme/colors");
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
20
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
15
21
|
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* @jsx jsx
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
|
-
|
|
23
|
-
var buttonsContainerStyles = (0, _react.css)({
|
|
24
|
-
display: 'flex',
|
|
25
|
-
position: 'absolute',
|
|
26
|
-
flexShrink: 0,
|
|
27
|
-
insetBlockStart: '100%',
|
|
28
|
-
insetInlineEnd: 0,
|
|
29
|
-
marginBlockStart: "var(--ds-space-075, 6px)"
|
|
30
|
-
});
|
|
31
|
-
var buttonWrapperBaseStyles = (0, _react.css)({
|
|
32
|
-
boxSizing: 'border-box',
|
|
33
|
-
width: "var(--ds-space-400, 32px)",
|
|
34
|
-
zIndex: 200,
|
|
35
|
-
backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
|
|
36
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
37
|
-
boxShadow: "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")"),
|
|
38
|
-
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
39
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
40
|
-
'&:last-child': {
|
|
41
|
-
marginInlineStart: "var(--ds-space-050, 4px)"
|
|
42
|
-
},
|
|
43
|
-
'& > button': {
|
|
44
|
-
backgroundColor: "var(--ds-surface-overlay, ".concat(_colors.N20A, ")")
|
|
45
|
-
},
|
|
46
|
-
'& > button:hover': {
|
|
47
|
-
backgroundColor: "var(--ds-surface-overlay-hovered, ".concat(_colors.N30A, ")")
|
|
48
|
-
},
|
|
49
|
-
'& > button:active': {
|
|
50
|
-
backgroundColor: "var(--ds-surface-overlay-pressed, rgba(179, 212, 255, 0.6))",
|
|
51
|
-
color: "var(--ds-text, ".concat(_colors.B400, ")")
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
55
|
-
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
56
|
-
/**
|
|
57
|
-
* __Buttons__
|
|
58
|
-
*
|
|
59
|
-
* A buttons {description}.
|
|
60
|
-
*
|
|
61
|
-
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
62
|
-
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
63
|
-
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
64
|
-
*/
|
|
22
|
+
var buttonsContainerStyles = null;
|
|
23
|
+
var buttonWrapperBaseStyles = null;
|
|
65
24
|
var Buttons = function Buttons(_ref) {
|
|
66
25
|
var confirmButtonLabel = _ref.confirmButtonLabel,
|
|
67
26
|
cancelButtonLabel = _ref.cancelButtonLabel,
|
|
68
27
|
onMouseDown = _ref.onMouseDown,
|
|
69
28
|
onCancelClick = _ref.onCancelClick,
|
|
70
29
|
testId = _ref.testId;
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: (0, _runtime.ax)(["_1e0c1txw _kqswstnw _1o9zidpf _152t1osq _rjxpidpf _1pfh12x7"])
|
|
32
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
tabIndex: -1,
|
|
34
|
+
className: (0, _runtime.ax)(["_vchhusvi _1bsbxy5q _1pby1kze _bfhk13b4 _2rko1sit _16qs1a23 _11c81oud _1mpy1b66 _1nlx13nm _l2uv11wk _7mfvdecw _szlb17km"]),
|
|
35
|
+
style: {
|
|
36
|
+
"--_1f6rtr1": (0, _runtime.ix)("var(--ds-surface-overlay, ".concat(_colors.N0, ")")),
|
|
37
|
+
"--_3t1odq": (0, _runtime.ix)("var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")")),
|
|
38
|
+
"--_12yx4z3": (0, _runtime.ix)("var(--ds-surface-overlay, ".concat(_colors.N20A, ")")),
|
|
39
|
+
"--_qfu7kd": (0, _runtime.ix)("var(--ds-surface-overlay-hovered, ".concat(_colors.N30A, ")")),
|
|
40
|
+
"--_1lrmnoy": (0, _runtime.ix)("var(--ds-text, ".concat(_colors.B400, ")"))
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/React.createElement(_new.IconButton, {
|
|
77
43
|
type: "submit",
|
|
78
44
|
icon: function icon(iconProps) {
|
|
79
|
-
return
|
|
45
|
+
return /*#__PURE__*/React.createElement(_check.default, (0, _extends2.default)({}, iconProps, {
|
|
80
46
|
size: "small"
|
|
81
47
|
}));
|
|
82
48
|
},
|
|
83
49
|
onMouseDown: onMouseDown,
|
|
84
50
|
label: confirmButtonLabel,
|
|
85
51
|
testId: testId && "".concat(testId, "--confirm")
|
|
86
|
-
})),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
52
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
tabIndex: -1,
|
|
54
|
+
className: (0, _runtime.ax)(["_vchhusvi _1bsbxy5q _1pby1kze _bfhk13b4 _2rko1sit _16qs1a23 _11c81oud _1mpy1b66 _1nlx13nm _l2uv11wk _7mfvdecw _szlb17km"]),
|
|
55
|
+
style: {
|
|
56
|
+
"--_1f6rtr1": (0, _runtime.ix)("var(--ds-surface-overlay, ".concat(_colors.N0, ")")),
|
|
57
|
+
"--_3t1odq": (0, _runtime.ix)("var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")")),
|
|
58
|
+
"--_12yx4z3": (0, _runtime.ix)("var(--ds-surface-overlay, ".concat(_colors.N20A, ")")),
|
|
59
|
+
"--_qfu7kd": (0, _runtime.ix)("var(--ds-surface-overlay-hovered, ".concat(_colors.N30A, ")")),
|
|
60
|
+
"--_1lrmnoy": (0, _runtime.ix)("var(--ds-text, ".concat(_colors.B400, ")"))
|
|
61
|
+
}
|
|
62
|
+
}, /*#__PURE__*/React.createElement(_new.IconButton, {
|
|
90
63
|
icon: function icon(iconProps) {
|
|
91
|
-
return
|
|
64
|
+
return /*#__PURE__*/React.createElement(_cross.default, (0, _extends2.default)({}, iconProps, {
|
|
92
65
|
size: "small"
|
|
93
66
|
}));
|
|
94
67
|
},
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
._18s8ze3t{margin:var(--ds-space-0,0)}
|
|
3
|
+
._1yt4ze3t{padding:var(--ds-space-0,0)}
|
|
4
|
+
._2rko1sit{border-radius:var(--ds-border-radius,3px)}
|
|
5
|
+
._v564thzt{transition:background .2s}
|
|
6
|
+
._14ly1bk5:focus+div{border-width:var(--ds-border-width-outline,2px)}
|
|
7
|
+
._189e1bk5{border-width:var(--ds-border-width-outline,2px)}
|
|
8
|
+
._189e1grb{border-width:var(--ds-border-width-0,0)}
|
|
9
|
+
._1dqoglyw{border-style:none}
|
|
10
|
+
._1dqonqa1{border-style:solid}
|
|
11
|
+
._1h6d1j28{border-color:transparent}
|
|
12
|
+
._1j8znqa1:focus+div{border-style:solid}
|
|
13
|
+
._1xp41p6i:focus+div{border-color:var(--ds-border-focused,#388bff)}
|
|
14
|
+
._12ji1r31{outline-color:currentColor}
|
|
15
|
+
._12y3idpf{outline-width:0}
|
|
16
|
+
._1bsb1osq{width:100%}
|
|
17
|
+
._1bsb1wug{width:auto}
|
|
18
|
+
._1e0c1o8l{display:inline-block}
|
|
19
|
+
._1e0c1ule{display:block}
|
|
20
|
+
._1qu2glyw{outline-style:none}
|
|
21
|
+
._bfhk18uv{background-color:initial}
|
|
22
|
+
._p12f1osq{max-width:100%}
|
|
23
|
+
._r06hglyw{-webkit-appearance:none;appearance:none}
|
|
24
|
+
._vchhusvi{box-sizing:border-box}
|
|
25
|
+
._vwz4kb7n{line-height:1}._128midpf:focus-visible{outline-width:0}
|
|
26
|
+
._mizu1r31:focus-visible{outline-color:currentColor}
|
|
27
|
+
._ra3xglyw:focus-visible{outline-style:none}
|
|
28
|
+
._irr32tgk:hover{background-color:var(--_1y60f1n)}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* read-view.tsx generated by @compiled/babel-plugin v0.32.2 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -5,57 +6,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
require("./read-view.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
8
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var
|
|
10
|
-
var _primitives = require("@atlaskit/primitives");
|
|
12
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
11
13
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var readViewContainerStyles = (0, _react2.css)({
|
|
22
|
-
lineHeight: 1
|
|
23
|
-
});
|
|
24
|
-
var editButtonStyles = (0, _primitives.xcss)({
|
|
25
|
-
display: 'block',
|
|
26
|
-
margin: 'space.0',
|
|
27
|
-
padding: 'space.0',
|
|
28
|
-
appearance: 'none',
|
|
29
|
-
background: 'transparent',
|
|
30
|
-
border: 0,
|
|
31
|
-
lineHeight: 1,
|
|
32
|
-
outline: 0,
|
|
33
|
-
':focus-visible': {
|
|
34
|
-
outline: 0
|
|
35
|
-
},
|
|
36
|
-
// @ts-expect-error
|
|
37
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
38
|
-
':focus + div': {
|
|
39
|
-
borderColor: 'color.border.focused',
|
|
40
|
-
borderWidth: 'border.width.outline',
|
|
41
|
-
borderStyle: 'solid'
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
var readViewWrapperStyles = (0, _react2.css)({
|
|
45
|
-
display: 'inline-block',
|
|
46
|
-
boxSizing: 'border-box',
|
|
47
|
-
width: 'auto',
|
|
48
|
-
maxWidth: '100%',
|
|
49
|
-
border: '2px solid transparent',
|
|
50
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
51
|
-
transition: 'background 0.2s',
|
|
52
|
-
'&:hover': {
|
|
53
|
-
background: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30, ")")
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
var readViewFitContainerWidthStyles = (0, _react2.css)({
|
|
57
|
-
width: '100%'
|
|
58
|
-
});
|
|
16
|
+
var readViewContainerStyles = null;
|
|
17
|
+
var editButtonStyles = {
|
|
18
|
+
root: "_1e0c1ule _18s8ze3t _1yt4ze3t _r06hglyw _bfhk18uv _189e1grb _1dqoglyw _1h6d1j28 _vwz4kb7n _12ji1r31 _1qu2glyw _12y3idpf _1xp41p6i _14ly1bk5 _1j8znqa1 _mizu1r31 _ra3xglyw _128midpf"
|
|
19
|
+
};
|
|
20
|
+
var readViewWrapperStyles = null;
|
|
21
|
+
var readViewFitContainerWidthStyles = null;
|
|
59
22
|
var DRAG_THRESHOLD = 5;
|
|
60
23
|
var ReadView = function ReadView(_ref) {
|
|
61
24
|
var editButtonLabel = _ref.editButtonLabel,
|
|
@@ -81,16 +44,15 @@ var ReadView = function ReadView(_ref) {
|
|
|
81
44
|
postReadViewClick();
|
|
82
45
|
}
|
|
83
46
|
};
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
xcss: editButtonStyles,
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
48
|
+
className: (0, _runtime.ax)(["_vwz4kb7n"])
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
|
|
50
|
+
xcss: editButtonStyles.root,
|
|
88
51
|
onClick: onEditRequested,
|
|
89
52
|
ref: editButtonRef,
|
|
90
53
|
testId: testId && "".concat(testId, "--edit-button"),
|
|
91
54
|
"aria-label": editButtonLabel
|
|
92
|
-
}),
|
|
93
|
-
css: [readViewWrapperStyles, readViewFitContainerWidth && readViewFitContainerWidthStyles]
|
|
55
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
94
56
|
/**
|
|
95
57
|
* It is not normally acceptable to add click handlers to non-interactive elements
|
|
96
58
|
* as this is an accessibility anti-pattern. However, because this instance is
|
|
@@ -98,14 +60,18 @@ var ReadView = function ReadView(_ref) {
|
|
|
98
60
|
* creating an inaccessible custom element, we can add role="presentation" so that
|
|
99
61
|
* there is no negative impacts to assistive technologies.
|
|
100
62
|
* (Why links are embeeded in inline-edit is for another day...)
|
|
101
|
-
|
|
63
|
+
*/
|
|
102
64
|
role: "presentation",
|
|
103
65
|
onClick: onReadViewClick,
|
|
104
66
|
onMouseDown: function onMouseDown(e) {
|
|
105
67
|
startX.current = e.clientX;
|
|
106
68
|
startY.current = e.clientY;
|
|
107
69
|
},
|
|
108
|
-
"data-read-view-fit-container-width": readViewFitContainerWidth
|
|
70
|
+
"data-read-view-fit-container-width": readViewFitContainerWidth,
|
|
71
|
+
className: (0, _runtime.ax)(["_1e0c1o8l _vchhusvi _1bsb1wug _p12f1osq _1h6d1j28 _2rko1sit _1dqonqa1 _189e1bk5 _v564thzt _irr32tgk", readViewFitContainerWidth && "_1bsb1osq"]),
|
|
72
|
+
style: {
|
|
73
|
+
"--_1y60f1n": (0, _runtime.ix)("var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30, ")"))
|
|
74
|
+
}
|
|
109
75
|
}, readView()));
|
|
110
76
|
};
|
|
111
77
|
var _default = exports.default = ReadView;
|