@instructure/ui-source-code-editor 10.13.1-pr-snapshot-1741357986437 → 10.13.1-snapshot-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
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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-
|
|
6
|
+
## [10.13.1-snapshot-0](https://github.com/instructure/instructure-ui/compare/v10.13.0...v10.13.1-snapshot-0) (2025-03-10)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-source-code-editor
|
|
9
9
|
|
|
@@ -10,9 +10,11 @@ var _interopRequireWildcard2 = _interopRequireDefault(require("@babel/runtime/he
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = _interopRequireWildcard3(require("react"));
|
|
12
12
|
var _search = require("@codemirror/search");
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
13
|
+
var _TextInput = require("@instructure/ui-text-input/lib/TextInput");
|
|
14
|
+
var _IconButton = require("@instructure/ui-buttons/lib/IconButton");
|
|
15
|
+
var _IconArrowOpenDownLine = require("@instructure/ui-icons/lib/IconArrowOpenDownLine.js");
|
|
16
|
+
var _IconArrowOpenUpLine2 = require("@instructure/ui-icons/lib/IconArrowOpenUpLine.js");
|
|
17
|
+
var _IconSearchLine2 = require("@instructure/ui-icons/lib/IconSearchLine.js");
|
|
16
18
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
17
19
|
var _IconSearchLine, _IconArrowOpenDownLin, _IconArrowOpenUpLine;
|
|
18
20
|
/*
|
|
@@ -73,7 +75,7 @@ function SearchPanel({
|
|
|
73
75
|
handleHighlightSearch(searchQueryStr);
|
|
74
76
|
(0, _search.findPrevious)(view);
|
|
75
77
|
};
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_TextInput.TextInput, {
|
|
77
79
|
renderLabel: "",
|
|
78
80
|
inputRef: r => {
|
|
79
81
|
setTimeout(() => r === null || r === void 0 ? void 0 : r.focus(), 0);
|
|
@@ -85,22 +87,22 @@ function SearchPanel({
|
|
|
85
87
|
onChange: handleChange,
|
|
86
88
|
onKeyDown: handleKeyDown,
|
|
87
89
|
onKeyUp: handleKeyUp,
|
|
88
|
-
renderBeforeInput: _IconSearchLine || (_IconSearchLine = /*#__PURE__*/_react.default.createElement(
|
|
90
|
+
renderBeforeInput: _IconSearchLine || (_IconSearchLine = /*#__PURE__*/_react.default.createElement(_IconSearchLine2.IconSearchLine, {
|
|
89
91
|
size: "x-small"
|
|
90
92
|
})),
|
|
91
|
-
renderAfterInput: /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(
|
|
93
|
+
renderAfterInput: /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, {
|
|
92
94
|
size: "small",
|
|
93
95
|
withBorder: false,
|
|
94
96
|
withBackground: false,
|
|
95
97
|
onClick: handleFindNext,
|
|
96
98
|
screenReaderLabel: searchConfig.nextResultLabel
|
|
97
|
-
}, _IconArrowOpenDownLin || (_IconArrowOpenDownLin = /*#__PURE__*/_react.default.createElement(
|
|
99
|
+
}, _IconArrowOpenDownLin || (_IconArrowOpenDownLin = /*#__PURE__*/_react.default.createElement(_IconArrowOpenDownLine.IconArrowOpenDownLine, null))), /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, {
|
|
98
100
|
size: "small",
|
|
99
101
|
withBorder: false,
|
|
100
102
|
withBackground: false,
|
|
101
103
|
onClick: handleFindPrev,
|
|
102
104
|
screenReaderLabel: searchConfig.prevResultLabel
|
|
103
|
-
}, _IconArrowOpenUpLine || (_IconArrowOpenUpLine = /*#__PURE__*/_react.default.createElement(
|
|
105
|
+
}, _IconArrowOpenUpLine || (_IconArrowOpenUpLine = /*#__PURE__*/_react.default.createElement(_IconArrowOpenUpLine2.IconArrowOpenUpLine, null))))
|
|
104
106
|
});
|
|
105
107
|
}
|
|
106
108
|
function customSearch(searchConfig) {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SourceCodeEditorLocator = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
8
8
|
var _uiTestQueries = require("@instructure/ui-test-queries");
|
|
9
9
|
var _index = require("./index");
|
|
10
10
|
/*
|
|
@@ -32,7 +32,7 @@ var _index = require("./index");
|
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
35
|
-
const SourceCodeEditorLocator = exports.SourceCodeEditorLocator = (0,
|
|
35
|
+
const SourceCodeEditorLocator = exports.SourceCodeEditorLocator = (0, _locator.locator)(_index.SourceCodeEditor.selector, {
|
|
36
36
|
findContainer: async (...args) => {
|
|
37
37
|
return await (0, _uiTestQueries.find)('[class$=-codeEditorContainer]', ...args);
|
|
38
38
|
},
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.SourceCodeEditor = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var
|
|
10
|
+
var _deepEqual = require("@instructure/ui-utils/lib/deepEqual.js");
|
|
11
11
|
var _state = require("@codemirror/state");
|
|
12
12
|
var _view = require("@codemirror/view");
|
|
13
13
|
var _autocomplete = require("@codemirror/autocomplete");
|
|
@@ -22,11 +22,13 @@ var _langMarkdown = require("@codemirror/lang-markdown");
|
|
|
22
22
|
var _langJson = require("@codemirror/lang-json");
|
|
23
23
|
var _shell = require("@codemirror/legacy-modes/mode/shell");
|
|
24
24
|
var _yaml = require("@codemirror/legacy-modes/mode/yaml");
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
25
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
26
|
+
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
27
|
+
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
28
|
+
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
29
|
+
var _requestAnimationFrame = require("@instructure/ui-dom-utils/lib/requestAnimationFrame.js");
|
|
30
|
+
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
31
|
+
var _textDirectionContextConsumer = require("@instructure/ui-i18n/lib/textDirectionContextConsumer.js");
|
|
30
32
|
var _emotion = require("@instructure/emotion");
|
|
31
33
|
var _SearchPanel = _interopRequireDefault(require("./SearchPanel"));
|
|
32
34
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
@@ -65,10 +67,10 @@ var _dec, _dec2, _dec3, _dec4, _class, _SourceCodeEditor;
|
|
|
65
67
|
category: components
|
|
66
68
|
---
|
|
67
69
|
**/
|
|
68
|
-
let SourceCodeEditor = exports.SourceCodeEditor = (_dec = (0,
|
|
70
|
+
let SourceCodeEditor = exports.SourceCodeEditor = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(), _dec4 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = _dec4(_class = (_SourceCodeEditor = class SourceCodeEditor extends _react.Component {
|
|
69
71
|
addAnimationFrame(callback) {
|
|
70
72
|
if (typeof callback === 'function') {
|
|
71
|
-
this._raf.push((0,
|
|
73
|
+
this._raf.push((0, _requestAnimationFrame.requestAnimationFrame)(callback));
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
cancelAnimationFrames() {
|
|
@@ -256,7 +258,7 @@ let SourceCodeEditor = exports.SourceCodeEditor = (_dec = (0, _uiReactUtils.with
|
|
|
256
258
|
// needed for theme update
|
|
257
259
|
'themeOverride', 'language', 'readOnly', 'editable', 'lineNumbers', 'highlightActiveLineGutter', 'foldGutter', 'lineWrapping', 'autofocus', 'spellcheck', 'direction', 'dir', 'rtlMoveVisually', 'indentOnLoad', 'indentWithTab', 'indentUnit', 'highlightActiveLine', 'attachment'];
|
|
258
260
|
for (const prop of propsToObserve) {
|
|
259
|
-
if (!(0,
|
|
261
|
+
if (!(0, _deepEqual.deepEqual)(this.props[prop], prevProps[prop])) {
|
|
260
262
|
return true;
|
|
261
263
|
}
|
|
262
264
|
}
|
|
@@ -499,10 +501,10 @@ let SourceCodeEditor = exports.SourceCodeEditor = (_dec = (0, _uiReactUtils.with
|
|
|
499
501
|
return (0, _emotion.jsx)("div", Object.assign({
|
|
500
502
|
ref: this.handleRef,
|
|
501
503
|
css: styles === null || styles === void 0 ? void 0 : styles.codeEditor
|
|
502
|
-
}, (0,
|
|
504
|
+
}, (0, _passthroughProps.passthroughProps)((0, _omitProps.omitProps)(restProps, SourceCodeEditor.allowedProps))), (0, _emotion.jsx)("label", {
|
|
503
505
|
css: styles === null || styles === void 0 ? void 0 : styles.label,
|
|
504
506
|
id: this._id
|
|
505
|
-
}, (0, _emotion.jsx)(
|
|
507
|
+
}, (0, _emotion.jsx)(_ScreenReaderContent.ScreenReaderContent, null, label), (0, _emotion.jsx)("div", {
|
|
506
508
|
ref: this.handleContainerRef,
|
|
507
509
|
css: styles === null || styles === void 0 ? void 0 : styles.codeEditorContainer
|
|
508
510
|
})));
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
9
|
+
var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
|
|
10
10
|
/*
|
|
11
11
|
* The MIT License (MIT)
|
|
12
12
|
*
|
|
@@ -49,7 +49,7 @@ const propTypes = exports.propTypes = {
|
|
|
49
49
|
indentWithTab: _propTypes.default.bool,
|
|
50
50
|
indentUnit: _propTypes.default.string,
|
|
51
51
|
defaultValue: _propTypes.default.string,
|
|
52
|
-
value: (0,
|
|
52
|
+
value: (0, _controllable.controllable)(_propTypes.default.string, 'onChange', 'defaultValue'),
|
|
53
53
|
onChange: _propTypes.default.func,
|
|
54
54
|
onFocus: _propTypes.default.func,
|
|
55
55
|
onBlur: _propTypes.default.func,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-source-code-editor",
|
|
3
|
-
"version": "10.13.1-
|
|
3
|
+
"version": "10.13.1-snapshot-0",
|
|
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,9 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "10.13.1-
|
|
27
|
-
"@instructure/ui-test-queries": "10.13.1-
|
|
28
|
-
"@instructure/ui-test-utils": "10.13.1-
|
|
26
|
+
"@instructure/ui-babel-preset": "10.13.1-snapshot-0",
|
|
27
|
+
"@instructure/ui-test-queries": "10.13.1-snapshot-0",
|
|
28
|
+
"@instructure/ui-test-utils": "10.13.1-snapshot-0",
|
|
29
29
|
"@testing-library/jest-dom": "^6.6.3",
|
|
30
30
|
"@testing-library/react": "^16.0.1",
|
|
31
31
|
"vitest": "^2.1.8"
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
"@codemirror/search": "^6.5.6",
|
|
46
46
|
"@codemirror/state": "^6.4.1",
|
|
47
47
|
"@codemirror/view": "^6.34.1",
|
|
48
|
-
"@instructure/emotion": "10.13.1-
|
|
49
|
-
"@instructure/shared-types": "10.13.1-
|
|
50
|
-
"@instructure/ui-a11y-content": "10.13.1-
|
|
51
|
-
"@instructure/ui-buttons": "10.13.1-
|
|
52
|
-
"@instructure/ui-dom-utils": "10.13.1-
|
|
53
|
-
"@instructure/ui-i18n": "10.13.1-
|
|
54
|
-
"@instructure/ui-icons": "10.13.1-
|
|
55
|
-
"@instructure/ui-prop-types": "10.13.1-
|
|
56
|
-
"@instructure/ui-react-utils": "10.13.1-
|
|
57
|
-
"@instructure/ui-test-locator": "10.13.1-
|
|
58
|
-
"@instructure/ui-testable": "10.13.1-
|
|
59
|
-
"@instructure/ui-text-input": "10.13.1-
|
|
60
|
-
"@instructure/ui-themes": "10.13.1-
|
|
61
|
-
"@instructure/ui-utils": "10.13.1-
|
|
48
|
+
"@instructure/emotion": "10.13.1-snapshot-0",
|
|
49
|
+
"@instructure/shared-types": "10.13.1-snapshot-0",
|
|
50
|
+
"@instructure/ui-a11y-content": "10.13.1-snapshot-0",
|
|
51
|
+
"@instructure/ui-buttons": "10.13.1-snapshot-0",
|
|
52
|
+
"@instructure/ui-dom-utils": "10.13.1-snapshot-0",
|
|
53
|
+
"@instructure/ui-i18n": "10.13.1-snapshot-0",
|
|
54
|
+
"@instructure/ui-icons": "10.13.1-snapshot-0",
|
|
55
|
+
"@instructure/ui-prop-types": "10.13.1-snapshot-0",
|
|
56
|
+
"@instructure/ui-react-utils": "10.13.1-snapshot-0",
|
|
57
|
+
"@instructure/ui-test-locator": "10.13.1-snapshot-0",
|
|
58
|
+
"@instructure/ui-testable": "10.13.1-snapshot-0",
|
|
59
|
+
"@instructure/ui-text-input": "10.13.1-snapshot-0",
|
|
60
|
+
"@instructure/ui-themes": "10.13.1-snapshot-0",
|
|
61
|
+
"@instructure/ui-utils": "10.13.1-snapshot-0",
|
|
62
62
|
"@lezer/highlight": "1.2.1",
|
|
63
63
|
"prop-types": "^15.8.1"
|
|
64
64
|
},
|