@instructure/ui-editable 10.13.0 → 10.13.1-pr-snapshot-1741357986437
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,14 @@
|
|
|
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
|
+
## [10.13.1-pr-snapshot-1741357986437](https://github.com/instructure/instructure-ui/compare/v10.13.0...v10.13.1-pr-snapshot-1741357986437) (2025-03-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-editable
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [10.13.0](https://github.com/instructure/instructure-ui/compare/v10.12.0...v10.13.0) (2025-03-06)
|
|
7
15
|
|
|
8
16
|
**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
|
}
|
|
@@ -6,7 +6,7 @@ var _react2 = require("@testing-library/react");
|
|
|
6
6
|
var _vitest = require("vitest");
|
|
7
7
|
require("@testing-library/jest-dom");
|
|
8
8
|
var _index = require("../index");
|
|
9
|
-
var
|
|
9
|
+
var _uiAxeCheck = require("@instructure/ui-axe-check");
|
|
10
10
|
var _div;
|
|
11
11
|
/*
|
|
12
12
|
* The MIT License (MIT)
|
|
@@ -205,7 +205,7 @@ describe('<InPlaceEdit />', () => {
|
|
|
205
205
|
renderEditButton: renderEditButton
|
|
206
206
|
})),
|
|
207
207
|
container = _render4.container;
|
|
208
|
-
const axeCheck = await (0,
|
|
208
|
+
const axeCheck = await (0, _uiAxeCheck.runAxeCheck)(container);
|
|
209
209
|
expect(axeCheck).toBe(true);
|
|
210
210
|
});
|
|
211
211
|
it('should meet a11y standards in edit mode', async () => {
|
|
@@ -217,7 +217,7 @@ describe('<InPlaceEdit />', () => {
|
|
|
217
217
|
renderEditButton: renderEditButton
|
|
218
218
|
})),
|
|
219
219
|
container = _render5.container;
|
|
220
|
-
const axeCheck = await (0,
|
|
220
|
+
const axeCheck = await (0, _uiAxeCheck.runAxeCheck)(container);
|
|
221
221
|
expect(axeCheck).toBe(true);
|
|
222
222
|
});
|
|
223
223
|
});
|
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
|
}, _InPlaceEdit)) || _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": "10.13.
|
|
3
|
+
"version": "10.13.1-pr-snapshot-1741357986437",
|
|
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,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "10.13.
|
|
27
|
-
"@instructure/ui-babel-preset": "10.13.
|
|
26
|
+
"@instructure/ui-axe-check": "10.13.1-pr-snapshot-1741357986437",
|
|
27
|
+
"@instructure/ui-babel-preset": "10.13.1-pr-snapshot-1741357986437",
|
|
28
28
|
"@testing-library/jest-dom": "^6.6.3",
|
|
29
29
|
"@testing-library/react": "^16.0.1",
|
|
30
30
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.26.0",
|
|
35
|
-
"@instructure/console": "10.13.
|
|
36
|
-
"@instructure/emotion": "10.13.
|
|
37
|
-
"@instructure/shared-types": "10.13.
|
|
38
|
-
"@instructure/ui-a11y-content": "10.13.
|
|
39
|
-
"@instructure/ui-buttons": "10.13.
|
|
40
|
-
"@instructure/ui-dom-utils": "10.13.
|
|
41
|
-
"@instructure/ui-flex": "10.13.
|
|
42
|
-
"@instructure/ui-focusable": "10.13.
|
|
43
|
-
"@instructure/ui-icons": "10.13.
|
|
44
|
-
"@instructure/ui-utils": "10.13.
|
|
45
|
-
"@instructure/ui-view": "10.13.
|
|
35
|
+
"@instructure/console": "10.13.1-pr-snapshot-1741357986437",
|
|
36
|
+
"@instructure/emotion": "10.13.1-pr-snapshot-1741357986437",
|
|
37
|
+
"@instructure/shared-types": "10.13.1-pr-snapshot-1741357986437",
|
|
38
|
+
"@instructure/ui-a11y-content": "10.13.1-pr-snapshot-1741357986437",
|
|
39
|
+
"@instructure/ui-buttons": "10.13.1-pr-snapshot-1741357986437",
|
|
40
|
+
"@instructure/ui-dom-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
41
|
+
"@instructure/ui-flex": "10.13.1-pr-snapshot-1741357986437",
|
|
42
|
+
"@instructure/ui-focusable": "10.13.1-pr-snapshot-1741357986437",
|
|
43
|
+
"@instructure/ui-icons": "10.13.1-pr-snapshot-1741357986437",
|
|
44
|
+
"@instructure/ui-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
45
|
+
"@instructure/ui-view": "10.13.1-pr-snapshot-1741357986437",
|
|
46
46
|
"prop-types": "^15.8.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|