@instructure/ui-source-code-editor 11.7.8 → 11.7.9-pr-snapshot-1792147648392

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,19 @@
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
+ ## [11.7.9-pr-snapshot-1792147648392](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-pr-snapshot-1792147648392) (2026-10-16)
7
+
8
+ ### Build System
9
+
10
+ * **many:** replace babel with swc ([7e36c54](https://github.com/instructure/instructure-ui/commit/7e36c54d240b4fa483801c03ab18e7f860f561e2))
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ * **many:** `@instructure/ui-babel-preset` and
15
+ `@instructure/browserslist-config-instui` are removed and will no longer be
16
+ published. Packages depend on `@swc/helpers` instead of `@babel/runtime`.
17
+
18
+
6
19
  ## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
7
20
 
8
21
  **Note:** Version bump only for package @instructure/ui-source-code-editor
@@ -1,113 +1,90 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
25
2
  import { useState } from 'react';
26
3
  import { setSearchQuery, search, findNext, findPrevious, SearchQuery, closeSearchPanel } from '@codemirror/search';
27
4
  import { TextInput } from '@instructure/ui-text-input/v11_6';
28
5
  import { IconButton } from '@instructure/ui-buttons/v11_6';
29
6
  import { IconArrowOpenDownLine, IconArrowOpenUpLine, IconSearchLine } from '@instructure/ui-icons';
30
7
  import { createRoot } from 'react-dom/client';
31
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
32
- function SearchPanel({
33
- view,
34
- searchConfig
35
- }) {
36
- const [searchQueryStr, setSearchQueryStr] = useState('');
37
- const handleChange = (_e, value) => {
38
- setSearchQueryStr(value);
39
- handleHighlightSearch(value);
40
- };
41
- const handleHighlightSearch = searchStr => {
42
- view.dispatch({
43
- effects: setSearchQuery.of(new SearchQuery({
44
- search: searchStr
45
- }))
46
- });
47
- };
48
- const handleKeyDown = e => {
49
- if (e.key !== 'Enter') return;
50
- if (!e.shiftKey) handleFindNext();else handleFindPrev();
51
- };
52
- const handleKeyUp = e => {
53
- if (e.key !== 'Escape') return;
54
- closeSearchPanel(view);
55
- };
56
- const handleFindNext = () => {
57
- handleHighlightSearch(searchQueryStr);
58
- findNext(view);
59
- };
60
- const handleFindPrev = () => {
61
- handleHighlightSearch(searchQueryStr);
62
- findPrevious(view);
63
- };
64
- return _jsx(TextInput, {
65
- renderLabel: "",
66
- inputRef: r => {
67
- setTimeout(() => r?.focus(), 0);
68
- },
69
- size: "small",
70
- display: "inline-block",
71
- width: "20rem",
72
- placeholder: searchConfig.placeholder,
73
- onChange: handleChange,
74
- onKeyDown: handleKeyDown,
75
- onKeyUp: handleKeyUp,
76
- renderBeforeInput: _jsx(IconSearchLine, {
77
- size: "x-small"
78
- }),
79
- renderAfterInput: _jsxs("span", {
80
- children: [_jsx(IconButton, {
8
+ function SearchPanel({ view, searchConfig }) {
9
+ const [searchQueryStr, setSearchQueryStr] = useState('');
10
+ const handleChange = (_e, value)=>{
11
+ setSearchQueryStr(value);
12
+ handleHighlightSearch(value);
13
+ };
14
+ const handleHighlightSearch = (searchStr)=>{
15
+ view.dispatch({
16
+ effects: setSearchQuery.of(new SearchQuery({
17
+ search: searchStr
18
+ }))
19
+ });
20
+ };
21
+ const handleKeyDown = (e)=>{
22
+ if (e.key !== 'Enter') return;
23
+ if (!e.shiftKey) handleFindNext();
24
+ else handleFindPrev();
25
+ };
26
+ const handleKeyUp = (e)=>{
27
+ if (e.key !== 'Escape') return;
28
+ closeSearchPanel(view);
29
+ };
30
+ const handleFindNext = ()=>{
31
+ handleHighlightSearch(searchQueryStr);
32
+ findNext(view);
33
+ };
34
+ const handleFindPrev = ()=>{
35
+ handleHighlightSearch(searchQueryStr);
36
+ findPrevious(view);
37
+ };
38
+ return /*#__PURE__*/ _jsx(TextInput, {
39
+ renderLabel: "",
40
+ inputRef: (r)=>{
41
+ setTimeout(()=>r?.focus(), 0);
42
+ },
81
43
  size: "small",
82
- withBorder: false,
83
- withBackground: false,
84
- onClick: handleFindNext,
85
- screenReaderLabel: searchConfig.nextResultLabel,
86
- children: _jsx(IconArrowOpenDownLine, {})
87
- }), _jsx(IconButton, {
88
- size: "small",
89
- withBorder: false,
90
- withBackground: false,
91
- onClick: handleFindPrev,
92
- screenReaderLabel: searchConfig.prevResultLabel,
93
- children: _jsx(IconArrowOpenUpLine, {})
94
- })]
95
- })
96
- });
44
+ display: "inline-block",
45
+ width: "20rem",
46
+ placeholder: searchConfig.placeholder,
47
+ onChange: handleChange,
48
+ onKeyDown: handleKeyDown,
49
+ onKeyUp: handleKeyUp,
50
+ renderBeforeInput: /*#__PURE__*/ _jsx(IconSearchLine, {
51
+ size: "x-small"
52
+ }),
53
+ renderAfterInput: /*#__PURE__*/ _jsxs("span", {
54
+ children: [
55
+ /*#__PURE__*/ _jsx(IconButton, {
56
+ size: "small",
57
+ withBorder: false,
58
+ withBackground: false,
59
+ onClick: handleFindNext,
60
+ screenReaderLabel: searchConfig.nextResultLabel,
61
+ children: /*#__PURE__*/ _jsx(IconArrowOpenDownLine, {})
62
+ }),
63
+ /*#__PURE__*/ _jsx(IconButton, {
64
+ size: "small",
65
+ withBorder: false,
66
+ withBackground: false,
67
+ onClick: handleFindPrev,
68
+ screenReaderLabel: searchConfig.prevResultLabel,
69
+ children: /*#__PURE__*/ _jsx(IconArrowOpenUpLine, {})
70
+ })
71
+ ]
72
+ })
73
+ });
97
74
  }
98
75
  export default function customSearch(searchConfig) {
99
- return searchConfig ? search({
100
- createPanel: view => {
101
- const dom = document.createElement('div');
102
- dom.style.padding = '8px';
103
- const root = createRoot(dom);
104
- root.render(_jsx(SearchPanel, {
105
- view: view,
106
- searchConfig: searchConfig
107
- }));
108
- return {
109
- dom
110
- };
111
- }
112
- }) : [];
113
- }
76
+ return searchConfig ? search({
77
+ createPanel: (view)=>{
78
+ const dom = document.createElement('div');
79
+ dom.style.padding = '8px';
80
+ const root = createRoot(dom);
81
+ root.render(/*#__PURE__*/ _jsx(SearchPanel, {
82
+ view: view,
83
+ searchConfig: searchConfig
84
+ }));
85
+ return {
86
+ dom
87
+ };
88
+ }
89
+ }) : [];
90
+ }
@@ -1,100 +1,87 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
1
  import { cursorCharLeft, cursorCharRight, cursorGroupLeft, cursorGroupRight, cursorLineBoundaryLeft, cursorLineBoundaryRight, cursorLineBoundaryBackward, cursorLineBoundaryForward, cursorSyntaxLeft, cursorSyntaxRight, deleteCharBackward, deleteCharForward, deleteGroupBackward, deleteGroupForward, deleteToLineEnd, deleteToLineStart, selectCharLeft, selectCharRight, selectGroupLeft, selectGroupRight, selectLineBoundaryLeft, selectLineBoundaryRight, selectLineBoundaryBackward, selectLineBoundaryForward, selectSyntaxLeft, selectSyntaxRight } from '@codemirror/commands';
26
2
  const rtlHorizontalArrowKeymap = [
27
- // Left/Start/Forward
28
- {
29
- key: 'ArrowLeft',
30
- run: cursorCharRight,
31
- shift: selectCharRight,
32
- preventDefault: true
33
- }, {
34
- key: 'Mod-ArrowLeft',
35
- mac: 'Alt-ArrowLeft',
36
- run: cursorGroupRight,
37
- shift: selectGroupRight
38
- }, {
39
- key: 'Alt-ArrowLeft',
40
- mac: 'Ctrl-ArrowLeft',
41
- run: cursorSyntaxRight,
42
- shift: selectSyntaxRight
43
- }, {
44
- mac: 'Cmd-ArrowLeft',
45
- run: cursorLineBoundaryRight,
46
- shift: selectLineBoundaryRight
47
- }, {
48
- key: 'Home',
49
- run: cursorLineBoundaryForward,
50
- shift: selectLineBoundaryForward
51
- },
52
- // Right/End/Backward
53
- {
54
- key: 'ArrowRight',
55
- run: cursorCharLeft,
56
- shift: selectCharLeft,
57
- preventDefault: true
58
- }, {
59
- key: 'Mod-ArrowRight',
60
- mac: 'Alt-ArrowRight',
61
- run: cursorGroupLeft,
62
- shift: selectGroupLeft
63
- }, {
64
- key: 'Alt-ArrowRight',
65
- mac: 'Ctrl-ArrowRight',
66
- run: cursorSyntaxLeft,
67
- shift: selectSyntaxLeft
68
- }, {
69
- mac: 'Cmd-ArrowRight',
70
- run: cursorLineBoundaryLeft,
71
- shift: selectLineBoundaryLeft
72
- }, {
73
- key: 'End',
74
- run: cursorLineBoundaryBackward,
75
- shift: selectLineBoundaryBackward
76
- },
77
- // Delete/Backspace
78
- {
79
- key: 'Delete',
80
- run: deleteCharBackward
81
- }, {
82
- key: 'Mod-Delete',
83
- mac: 'Alt-Delete',
84
- run: deleteGroupBackward
85
- }, {
86
- key: 'Backspace',
87
- run: deleteCharForward,
88
- shift: deleteCharForward
89
- }, {
90
- key: 'Mod-Backspace',
91
- mac: 'Alt-Backspace',
92
- run: deleteGroupForward
93
- }, {
94
- mac: 'Mod-Delete',
95
- run: deleteToLineStart
96
- }, {
97
- mac: 'Mod-Backspace',
98
- run: deleteToLineEnd
99
- }];
100
- export { rtlHorizontalArrowKeymap };
3
+ {
4
+ key: 'ArrowLeft',
5
+ run: cursorCharRight,
6
+ shift: selectCharRight,
7
+ preventDefault: true
8
+ },
9
+ {
10
+ key: 'Mod-ArrowLeft',
11
+ mac: 'Alt-ArrowLeft',
12
+ run: cursorGroupRight,
13
+ shift: selectGroupRight
14
+ },
15
+ {
16
+ key: 'Alt-ArrowLeft',
17
+ mac: 'Ctrl-ArrowLeft',
18
+ run: cursorSyntaxRight,
19
+ shift: selectSyntaxRight
20
+ },
21
+ {
22
+ mac: 'Cmd-ArrowLeft',
23
+ run: cursorLineBoundaryRight,
24
+ shift: selectLineBoundaryRight
25
+ },
26
+ {
27
+ key: 'Home',
28
+ run: cursorLineBoundaryForward,
29
+ shift: selectLineBoundaryForward
30
+ },
31
+ {
32
+ key: 'ArrowRight',
33
+ run: cursorCharLeft,
34
+ shift: selectCharLeft,
35
+ preventDefault: true
36
+ },
37
+ {
38
+ key: 'Mod-ArrowRight',
39
+ mac: 'Alt-ArrowRight',
40
+ run: cursorGroupLeft,
41
+ shift: selectGroupLeft
42
+ },
43
+ {
44
+ key: 'Alt-ArrowRight',
45
+ mac: 'Ctrl-ArrowRight',
46
+ run: cursorSyntaxLeft,
47
+ shift: selectSyntaxLeft
48
+ },
49
+ {
50
+ mac: 'Cmd-ArrowRight',
51
+ run: cursorLineBoundaryLeft,
52
+ shift: selectLineBoundaryLeft
53
+ },
54
+ {
55
+ key: 'End',
56
+ run: cursorLineBoundaryBackward,
57
+ shift: selectLineBoundaryBackward
58
+ },
59
+ {
60
+ key: 'Delete',
61
+ run: deleteCharBackward
62
+ },
63
+ {
64
+ key: 'Mod-Delete',
65
+ mac: 'Alt-Delete',
66
+ run: deleteGroupBackward
67
+ },
68
+ {
69
+ key: 'Backspace',
70
+ run: deleteCharForward,
71
+ shift: deleteCharForward
72
+ },
73
+ {
74
+ key: 'Mod-Backspace',
75
+ mac: 'Alt-Backspace',
76
+ run: deleteGroupForward
77
+ },
78
+ {
79
+ mac: 'Mod-Delete',
80
+ run: deleteToLineStart
81
+ },
82
+ {
83
+ mac: 'Mod-Backspace',
84
+ run: deleteToLineEnd
85
+ }
86
+ ];
87
+ export { rtlHorizontalArrowKeymap };