@instructure/ui-editable 8.56.3 → 8.56.5-pr-snapshot-1728655013879
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
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.56.5-pr-snapshot-1728655013879](https://github.com/instructure/instructure-ui/compare/v8.56.4...v8.56.5-pr-snapshot-1728655013879) (2024-10-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-editable
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [8.56.4](https://github.com/instructure/instructure-ui/compare/v8.56.3...v8.56.4) (2024-10-02)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @instructure/ui-editable
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [8.56.3](https://github.com/instructure/instructure-ui/compare/v8.56.2...v8.56.3) (2024-09-18)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @instructure/ui-editable
|
package/lib/Editable/index.js
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.Editable = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
9
9
|
var _console = require("@instructure/console");
|
|
10
|
-
var
|
|
10
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
11
11
|
var _props2 = require("./props");
|
|
12
12
|
/*
|
|
13
13
|
* The MIT License (MIT)
|
|
@@ -72,7 +72,7 @@ class Editable extends _react.Component {
|
|
|
72
72
|
};
|
|
73
73
|
this.handleViewClick = event => {
|
|
74
74
|
if (event.buttons === 1) {
|
|
75
|
-
(0,
|
|
75
|
+
(0, _uiDomUtils.requestAnimationFrame)(() => {
|
|
76
76
|
this.enterEdit();
|
|
77
77
|
});
|
|
78
78
|
}
|
|
@@ -171,7 +171,7 @@ class Editable extends _react.Component {
|
|
|
171
171
|
// on the switch from edit to view
|
|
172
172
|
if (prevProps.mode === 'edit' && mode !== 'edit') {
|
|
173
173
|
this._editButtonRef && this._editButtonRef.focus();
|
|
174
|
-
if (onChange && !(0,
|
|
174
|
+
if (onChange && !(0, _uiUtils.deepEqual)(this.state.valueOnEdit, value)) {
|
|
175
175
|
onChange(value);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
@@ -5,7 +5,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
5
5
|
var _react2 = require("@testing-library/react");
|
|
6
6
|
require("@testing-library/jest-dom");
|
|
7
7
|
var _index = require("../index");
|
|
8
|
-
var
|
|
8
|
+
var _uiAxeCheck = require("@instructure/ui-axe-check");
|
|
9
9
|
var _div;
|
|
10
10
|
/*
|
|
11
11
|
* The MIT License (MIT)
|
|
@@ -194,7 +194,7 @@ describe('<InPlaceEdit />', () => {
|
|
|
194
194
|
renderEditButton: renderEditButton
|
|
195
195
|
})),
|
|
196
196
|
container = _render4.container;
|
|
197
|
-
const axeCheck = await (0,
|
|
197
|
+
const axeCheck = await (0, _uiAxeCheck.runAxeCheck)(container);
|
|
198
198
|
expect(axeCheck).toBe(true);
|
|
199
199
|
});
|
|
200
200
|
it('should meet a11y standards in edit mode', async () => {
|
|
@@ -206,7 +206,7 @@ describe('<InPlaceEdit />', () => {
|
|
|
206
206
|
renderEditButton: renderEditButton
|
|
207
207
|
})),
|
|
208
208
|
container = _render5.container;
|
|
209
|
-
const axeCheck = await (0,
|
|
209
|
+
const axeCheck = await (0, _uiAxeCheck.runAxeCheck)(container);
|
|
210
210
|
expect(axeCheck).toBe(true);
|
|
211
211
|
});
|
|
212
212
|
});
|
package/lib/InPlaceEdit/index.js
CHANGED
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.InPlaceEdit = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var _uiFlex = require("@instructure/ui-flex");
|
|
10
|
+
var _uiButtons = require("@instructure/ui-buttons");
|
|
11
|
+
var _uiIcons = require("@instructure/ui-icons");
|
|
12
12
|
var _console = require("@instructure/console");
|
|
13
|
-
var
|
|
13
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
14
14
|
var _emotion = require("@instructure/emotion");
|
|
15
|
-
var
|
|
15
|
+
var _uiView = require("@instructure/ui-view");
|
|
16
16
|
var _Editable = require("../Editable");
|
|
17
17
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
18
18
|
var _props = require("./props");
|
|
@@ -66,14 +66,14 @@ let InPlaceEdit = exports.InPlaceEdit = (_dec = (0, _emotion.withStyle)(_styles.
|
|
|
66
66
|
const flexDir = this.props.editButtonPlacement === 'start' ? 'row-reverse' : 'row';
|
|
67
67
|
const justifyItems = flexDir === 'row-reverse' ? 'end' : 'start';
|
|
68
68
|
const buttonMargin = this.props.editButtonPlacement === 'start' ? '0 xx-small 0 0' : '0 0 0 xx-small';
|
|
69
|
-
return (0, _emotion.jsx)(
|
|
69
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, Object.assign({
|
|
70
70
|
display: this.props.inline ? 'inline-flex' : 'flex',
|
|
71
71
|
direction: flexDir,
|
|
72
72
|
justifyItems: justifyItems
|
|
73
|
-
}, getContainerProps()), (0, _emotion.jsx)(
|
|
73
|
+
}, getContainerProps()), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
74
74
|
shouldGrow: true,
|
|
75
75
|
shouldShrink: true
|
|
76
|
-
}, this.renderEditor(getEditorProps()), this.renderViewer(getViewerProps())), (0, _emotion.jsx)(
|
|
76
|
+
}, this.renderEditor(getEditorProps()), this.renderViewer(getViewerProps())), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
77
77
|
margin: buttonMargin
|
|
78
78
|
}, this.renderEditButton(getEditButtonProps())));
|
|
79
79
|
};
|
|
@@ -98,7 +98,7 @@ let InPlaceEdit = exports.InPlaceEdit = (_dec = (0, _emotion.withStyle)(_styles.
|
|
|
98
98
|
showFocusRing = _this$props3.showFocusRing,
|
|
99
99
|
renderEditor = _this$props3.renderEditor;
|
|
100
100
|
const isEditMode = !readOnly && mode === 'edit';
|
|
101
|
-
return isEditMode ? (0, _emotion.jsx)(
|
|
101
|
+
return isEditMode ? (0, _emotion.jsx)(_uiView.View, {
|
|
102
102
|
as: "span",
|
|
103
103
|
display: "block",
|
|
104
104
|
withFocusOutline: showFocusRing,
|
|
@@ -122,7 +122,7 @@ let InPlaceEdit = exports.InPlaceEdit = (_dec = (0, _emotion.withStyle)(_styles.
|
|
|
122
122
|
...rest
|
|
123
123
|
}) {
|
|
124
124
|
return this.props.renderEditButton({
|
|
125
|
-
elementRef: (0,
|
|
125
|
+
elementRef: (0, _uiUtils.createChainedFunction)(this.handleEditButtonRef, buttonRef),
|
|
126
126
|
...rest
|
|
127
127
|
});
|
|
128
128
|
}
|
|
@@ -161,11 +161,11 @@ let InPlaceEdit = exports.InPlaceEdit = (_dec = (0, _emotion.withStyle)(_styles.
|
|
|
161
161
|
if (readOnly) {
|
|
162
162
|
return null;
|
|
163
163
|
}
|
|
164
|
-
return (0, _emotion.jsx)(
|
|
164
|
+
return (0, _emotion.jsx)(_uiButtons.IconButton, Object.assign({
|
|
165
165
|
size: "small",
|
|
166
166
|
screenReaderLabel: label,
|
|
167
167
|
withBackground: false,
|
|
168
168
|
withBorder: false
|
|
169
|
-
}, buttonProps), isVisible ?
|
|
169
|
+
}, buttonProps), isVisible ? _uiIcons.IconEditLine : null);
|
|
170
170
|
}, _class2)) || _class);
|
|
171
171
|
var _default = exports.default = InPlaceEdit;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-editable",
|
|
3
|
-
"version": "8.56.
|
|
3
|
+
"version": "8.56.5-pr-snapshot-1728655013879",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "8.56.
|
|
27
|
-
"@instructure/ui-babel-preset": "8.56.
|
|
26
|
+
"@instructure/ui-axe-check": "8.56.5-pr-snapshot-1728655013879",
|
|
27
|
+
"@instructure/ui-babel-preset": "8.56.5-pr-snapshot-1728655013879",
|
|
28
28
|
"@testing-library/jest-dom": "^6.1.4",
|
|
29
29
|
"@testing-library/react": "^14.1.2",
|
|
30
30
|
"@testing-library/user-event": "^14.5.1"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.23.2",
|
|
34
|
-
"@instructure/console": "8.56.
|
|
35
|
-
"@instructure/emotion": "8.56.
|
|
36
|
-
"@instructure/ui-a11y-content": "8.56.
|
|
37
|
-
"@instructure/ui-buttons": "8.56.
|
|
38
|
-
"@instructure/ui-dom-utils": "8.56.
|
|
39
|
-
"@instructure/ui-flex": "8.56.
|
|
40
|
-
"@instructure/ui-focusable": "8.56.
|
|
41
|
-
"@instructure/ui-icons": "8.56.
|
|
42
|
-
"@instructure/ui-utils": "8.56.
|
|
43
|
-
"@instructure/ui-view": "8.56.
|
|
34
|
+
"@instructure/console": "8.56.5-pr-snapshot-1728655013879",
|
|
35
|
+
"@instructure/emotion": "8.56.5-pr-snapshot-1728655013879",
|
|
36
|
+
"@instructure/ui-a11y-content": "8.56.5-pr-snapshot-1728655013879",
|
|
37
|
+
"@instructure/ui-buttons": "8.56.5-pr-snapshot-1728655013879",
|
|
38
|
+
"@instructure/ui-dom-utils": "8.56.5-pr-snapshot-1728655013879",
|
|
39
|
+
"@instructure/ui-flex": "8.56.5-pr-snapshot-1728655013879",
|
|
40
|
+
"@instructure/ui-focusable": "8.56.5-pr-snapshot-1728655013879",
|
|
41
|
+
"@instructure/ui-icons": "8.56.5-pr-snapshot-1728655013879",
|
|
42
|
+
"@instructure/ui-utils": "8.56.5-pr-snapshot-1728655013879",
|
|
43
|
+
"@instructure/ui-view": "8.56.5-pr-snapshot-1728655013879",
|
|
44
44
|
"prop-types": "^15.8.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|