@instructure/ui-source-code-editor 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-source-code-editor
|
|
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-source-code-editor
|
|
@@ -10,11 +10,9 @@ 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
|
|
16
|
-
var _IconArrowOpenUpLine2 = require("@instructure/ui-icons/lib/IconArrowOpenUpLine.js");
|
|
17
|
-
var _IconSearchLine2 = require("@instructure/ui-icons/lib/IconSearchLine.js");
|
|
13
|
+
var _uiTextInput = require("@instructure/ui-text-input");
|
|
14
|
+
var _uiButtons = require("@instructure/ui-buttons");
|
|
15
|
+
var _uiIcons = require("@instructure/ui-icons");
|
|
18
16
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
19
17
|
var _IconSearchLine, _IconArrowOpenDownLin, _IconArrowOpenUpLine;
|
|
20
18
|
/*
|
|
@@ -75,7 +73,7 @@ function SearchPanel({
|
|
|
75
73
|
handleHighlightSearch(searchQueryStr);
|
|
76
74
|
(0, _search.findPrevious)(view);
|
|
77
75
|
};
|
|
78
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_uiTextInput.TextInput, {
|
|
79
77
|
renderLabel: "",
|
|
80
78
|
inputRef: r => {
|
|
81
79
|
setTimeout(() => r === null || r === void 0 ? void 0 : r.focus(), 0);
|
|
@@ -87,22 +85,22 @@ function SearchPanel({
|
|
|
87
85
|
onChange: handleChange,
|
|
88
86
|
onKeyDown: handleKeyDown,
|
|
89
87
|
onKeyUp: handleKeyUp,
|
|
90
|
-
renderBeforeInput: _IconSearchLine || (_IconSearchLine = /*#__PURE__*/_react.default.createElement(
|
|
88
|
+
renderBeforeInput: _IconSearchLine || (_IconSearchLine = /*#__PURE__*/_react.default.createElement(_uiIcons.IconSearchLine, {
|
|
91
89
|
size: "x-small"
|
|
92
90
|
})),
|
|
93
|
-
renderAfterInput: /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(
|
|
91
|
+
renderAfterInput: /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_uiButtons.IconButton, {
|
|
94
92
|
size: "small",
|
|
95
93
|
withBorder: false,
|
|
96
94
|
withBackground: false,
|
|
97
95
|
onClick: handleFindNext,
|
|
98
96
|
screenReaderLabel: searchConfig.nextResultLabel
|
|
99
|
-
}, _IconArrowOpenDownLin || (_IconArrowOpenDownLin = /*#__PURE__*/_react.default.createElement(
|
|
97
|
+
}, _IconArrowOpenDownLin || (_IconArrowOpenDownLin = /*#__PURE__*/_react.default.createElement(_uiIcons.IconArrowOpenDownLine, null))), /*#__PURE__*/_react.default.createElement(_uiButtons.IconButton, {
|
|
100
98
|
size: "small",
|
|
101
99
|
withBorder: false,
|
|
102
100
|
withBackground: false,
|
|
103
101
|
onClick: handleFindPrev,
|
|
104
102
|
screenReaderLabel: searchConfig.prevResultLabel
|
|
105
|
-
}, _IconArrowOpenUpLine || (_IconArrowOpenUpLine = /*#__PURE__*/_react.default.createElement(
|
|
103
|
+
}, _IconArrowOpenUpLine || (_IconArrowOpenUpLine = /*#__PURE__*/_react.default.createElement(_uiIcons.IconArrowOpenUpLine, null))))
|
|
106
104
|
});
|
|
107
105
|
}
|
|
108
106
|
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 _uiTestLocator = require("@instructure/ui-test-locator");
|
|
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, _uiTestLocator.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 _uiUtils = require("@instructure/ui-utils");
|
|
11
11
|
var _state = require("@codemirror/state");
|
|
12
12
|
var _view = require("@codemirror/view");
|
|
13
13
|
var _autocomplete = require("@codemirror/autocomplete");
|
|
@@ -22,13 +22,11 @@ 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
|
|
30
|
-
var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
|
|
31
|
-
var _textDirectionContextConsumer = require("@instructure/ui-i18n/lib/textDirectionContextConsumer.js");
|
|
25
|
+
var _uiTestable = require("@instructure/ui-testable");
|
|
26
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
27
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
28
|
+
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
29
|
+
var _uiI18n = require("@instructure/ui-i18n");
|
|
32
30
|
var _emotion = require("@instructure/emotion");
|
|
33
31
|
var _SearchPanel = _interopRequireDefault(require("./SearchPanel"));
|
|
34
32
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
@@ -67,10 +65,10 @@ var _dec, _dec2, _dec3, _dec4, _class, _SourceCodeEditor;
|
|
|
67
65
|
category: components
|
|
68
66
|
---
|
|
69
67
|
**/
|
|
70
|
-
let SourceCodeEditor = exports.SourceCodeEditor = (_dec = (0,
|
|
68
|
+
let SourceCodeEditor = exports.SourceCodeEditor = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _uiI18n.textDirectionContextConsumer)(), _dec4 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = _dec4(_class = (_SourceCodeEditor = class SourceCodeEditor extends _react.Component {
|
|
71
69
|
addAnimationFrame(callback) {
|
|
72
70
|
if (typeof callback === 'function') {
|
|
73
|
-
this._raf.push((0,
|
|
71
|
+
this._raf.push((0, _uiDomUtils.requestAnimationFrame)(callback));
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
74
|
cancelAnimationFrames() {
|
|
@@ -258,7 +256,7 @@ let SourceCodeEditor = exports.SourceCodeEditor = (_dec = (0, _withDeterministic
|
|
|
258
256
|
// needed for theme update
|
|
259
257
|
'themeOverride', 'language', 'readOnly', 'editable', 'lineNumbers', 'highlightActiveLineGutter', 'foldGutter', 'lineWrapping', 'autofocus', 'spellcheck', 'direction', 'dir', 'rtlMoveVisually', 'indentOnLoad', 'indentWithTab', 'indentUnit', 'highlightActiveLine', 'attachment'];
|
|
260
258
|
for (const prop of propsToObserve) {
|
|
261
|
-
if (!(0,
|
|
259
|
+
if (!(0, _uiUtils.deepEqual)(this.props[prop], prevProps[prop])) {
|
|
262
260
|
return true;
|
|
263
261
|
}
|
|
264
262
|
}
|
|
@@ -501,10 +499,10 @@ let SourceCodeEditor = exports.SourceCodeEditor = (_dec = (0, _withDeterministic
|
|
|
501
499
|
return (0, _emotion.jsx)("div", Object.assign({
|
|
502
500
|
ref: this.handleRef,
|
|
503
501
|
css: styles === null || styles === void 0 ? void 0 : styles.codeEditor
|
|
504
|
-
}, (0,
|
|
502
|
+
}, (0, _uiReactUtils.passthroughProps)((0, _uiReactUtils.omitProps)(restProps, SourceCodeEditor.allowedProps))), (0, _emotion.jsx)("label", {
|
|
505
503
|
css: styles === null || styles === void 0 ? void 0 : styles.label,
|
|
506
504
|
id: this._id
|
|
507
|
-
}, (0, _emotion.jsx)(
|
|
505
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, label), (0, _emotion.jsx)("div", {
|
|
508
506
|
ref: this.handleContainerRef,
|
|
509
507
|
css: styles === null || styles === void 0 ? void 0 : styles.codeEditorContainer
|
|
510
508
|
})));
|
|
@@ -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 _uiPropTypes = require("@instructure/ui-prop-types");
|
|
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, _uiPropTypes.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.
|
|
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,9 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "10.13.
|
|
27
|
-
"@instructure/ui-test-queries": "10.13.
|
|
28
|
-
"@instructure/ui-test-utils": "10.13.
|
|
26
|
+
"@instructure/ui-babel-preset": "10.13.1-pr-snapshot-1741357986437",
|
|
27
|
+
"@instructure/ui-test-queries": "10.13.1-pr-snapshot-1741357986437",
|
|
28
|
+
"@instructure/ui-test-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
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.
|
|
49
|
-
"@instructure/shared-types": "10.13.
|
|
50
|
-
"@instructure/ui-a11y-content": "10.13.
|
|
51
|
-
"@instructure/ui-buttons": "10.13.
|
|
52
|
-
"@instructure/ui-dom-utils": "10.13.
|
|
53
|
-
"@instructure/ui-i18n": "10.13.
|
|
54
|
-
"@instructure/ui-icons": "10.13.
|
|
55
|
-
"@instructure/ui-prop-types": "10.13.
|
|
56
|
-
"@instructure/ui-react-utils": "10.13.
|
|
57
|
-
"@instructure/ui-test-locator": "10.13.
|
|
58
|
-
"@instructure/ui-testable": "10.13.
|
|
59
|
-
"@instructure/ui-text-input": "10.13.
|
|
60
|
-
"@instructure/ui-themes": "10.13.
|
|
61
|
-
"@instructure/ui-utils": "10.13.
|
|
48
|
+
"@instructure/emotion": "10.13.1-pr-snapshot-1741357986437",
|
|
49
|
+
"@instructure/shared-types": "10.13.1-pr-snapshot-1741357986437",
|
|
50
|
+
"@instructure/ui-a11y-content": "10.13.1-pr-snapshot-1741357986437",
|
|
51
|
+
"@instructure/ui-buttons": "10.13.1-pr-snapshot-1741357986437",
|
|
52
|
+
"@instructure/ui-dom-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
53
|
+
"@instructure/ui-i18n": "10.13.1-pr-snapshot-1741357986437",
|
|
54
|
+
"@instructure/ui-icons": "10.13.1-pr-snapshot-1741357986437",
|
|
55
|
+
"@instructure/ui-prop-types": "10.13.1-pr-snapshot-1741357986437",
|
|
56
|
+
"@instructure/ui-react-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
57
|
+
"@instructure/ui-test-locator": "10.13.1-pr-snapshot-1741357986437",
|
|
58
|
+
"@instructure/ui-testable": "10.13.1-pr-snapshot-1741357986437",
|
|
59
|
+
"@instructure/ui-text-input": "10.13.1-pr-snapshot-1741357986437",
|
|
60
|
+
"@instructure/ui-themes": "10.13.1-pr-snapshot-1741357986437",
|
|
61
|
+
"@instructure/ui-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
62
62
|
"@lezer/highlight": "1.2.1",
|
|
63
63
|
"prop-types": "^15.8.1"
|
|
64
64
|
},
|