@instructure/ui-source-code-editor 11.7.10 → 11.7.11-pr-snapshot-1794841957152
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 +17 -0
- package/es/SourceCodeEditor/v1/SearchPanel.js +81 -104
- package/es/SourceCodeEditor/v1/customKeybinding.js +85 -98
- package/es/SourceCodeEditor/v1/index.js +463 -507
- package/es/SourceCodeEditor/v1/props.js +30 -28
- package/es/SourceCodeEditor/v1/styles.js +198 -222
- package/es/SourceCodeEditor/v1/theme.js +19 -53
- package/es/SourceCodeEditor/v2/SearchPanel.js +81 -109
- package/es/SourceCodeEditor/v2/customKeybinding.js +85 -98
- package/es/SourceCodeEditor/v2/index.js +519 -545
- package/es/SourceCodeEditor/v2/props.js +30 -28
- package/es/SourceCodeEditor/v2/styles.js +208 -232
- package/es/exports/a.js +1 -24
- package/es/exports/b.js +1 -24
- package/package.json +16 -22
- package/src/SourceCodeEditor/v1/index.tsx +10 -5
- package/src/SourceCodeEditor/v2/index.tsx +47 -12
- package/tsconfig.build.json +0 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/SourceCodeEditor/v1/index.d.ts +3 -1
- package/types/SourceCodeEditor/v1/index.d.ts.map +1 -1
- package/types/SourceCodeEditor/v2/index.d.ts +6 -1
- package/types/SourceCodeEditor/v2/index.d.ts.map +1 -1
- package/lib/SourceCodeEditor/v1/SearchPanel.js +0 -119
- package/lib/SourceCodeEditor/v1/customKeybinding.js +0 -105
- package/lib/SourceCodeEditor/v1/index.js +0 -550
- package/lib/SourceCodeEditor/v1/props.js +0 -33
- package/lib/SourceCodeEditor/v1/styles.js +0 -230
- package/lib/SourceCodeEditor/v1/theme.js +0 -60
- package/lib/SourceCodeEditor/v2/SearchPanel.js +0 -125
- package/lib/SourceCodeEditor/v2/customKeybinding.js +0 -105
- package/lib/SourceCodeEditor/v2/index.js +0 -591
- package/lib/SourceCodeEditor/v2/props.js +0 -33
- package/lib/SourceCodeEditor/v2/styles.js +0 -240
- package/lib/exports/a.js +0 -12
- package/lib/exports/b.js +0 -12
- package/lib/package.json +0 -1
|
@@ -7,7 +7,7 @@ import type { SourceCodeEditorProps } from './props';
|
|
|
7
7
|
category: components
|
|
8
8
|
---
|
|
9
9
|
**/
|
|
10
|
-
declare class
|
|
10
|
+
export declare class SourceCodeEditorBase extends Component<SourceCodeEditorProps> {
|
|
11
11
|
static displayName: string;
|
|
12
12
|
static readonly componentId = "SourceCodeEditor";
|
|
13
13
|
static allowedProps: readonly (keyof {
|
|
@@ -99,6 +99,8 @@ declare class SourceCodeEditor extends Component<SourceCodeEditorProps> {
|
|
|
99
99
|
assignAriaLabel: () => void;
|
|
100
100
|
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
101
101
|
}
|
|
102
|
+
declare const SourceCodeEditor: typeof SourceCodeEditorBase;
|
|
103
|
+
type SourceCodeEditor = SourceCodeEditorBase;
|
|
102
104
|
export default SourceCodeEditor;
|
|
103
105
|
export { SourceCodeEditor };
|
|
104
106
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/SourceCodeEditor/v1/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAiBjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAgBlD,OAAO,EAIL,cAAc,EAOf,MAAM,sBAAsB,CAAA;AA+B7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/SourceCodeEditor/v1/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAiBjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,C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ED,iBAAiB,SA8BhB;IAED,oBAAoB,SAInB;IAED,kBAAkB,CAAC,SAAS,EAAE,qBAAqB,QAYlD;IAED,OAAO,CAAC,sBAAsB;IAgC9B,IAAI,SAAS,8BAIZ;IAED,IAAI,UAAU,wEAkDb;IAED,IAAI,cAAc,4CAsBjB;IAED,IAAI,OAAO,IAAI,UAAU,EAAE,CAiB1B;IAED,IAAI,iBAAiB,0BAoBpB;IAED,IAAI,cAAc,wDAmBjB;IAED,IAAI,iBAAiB,6EA0BpB;IAED,mBAAmB,CAAC,QAAQ,EAAE,MAAM,QAQnC;IAED,IAAI,iBAAiB,0CA2BpB;IAED,IAAI,sBAAsB,0CAgBzB;IAED,IAAI,2BAA2B,0CAiB9B;IAED,iBAAiB,SAEhB;IAED,kBAAkB,SAkCjB;IAED,eAAe,aAOd;IAED,MAAM,qDAqBL;CACF;AAED,QAAA,MAAM,gBAAgB,6BAKrB,CAAA;AACD,KAAK,gBAAgB,GAAG,oBAAoB,CAAA;eAE7B,gBAAgB;AAC/B,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -16,7 +16,7 @@ type SourceCodeEditorState = {
|
|
|
16
16
|
category: components
|
|
17
17
|
---
|
|
18
18
|
**/
|
|
19
|
-
declare class
|
|
19
|
+
export declare class SourceCodeEditorBase extends Component<SourceCodeEditorProps, SourceCodeEditorState> {
|
|
20
20
|
static displayName: string;
|
|
21
21
|
static readonly componentId = "SourceCodeEditor";
|
|
22
22
|
static allowedProps: readonly (keyof {
|
|
@@ -73,6 +73,7 @@ declare class SourceCodeEditor extends Component<SourceCodeEditorProps, SourceCo
|
|
|
73
73
|
private _raf;
|
|
74
74
|
private _searchPanelId;
|
|
75
75
|
private _isUnmounting;
|
|
76
|
+
private _resizeObserver?;
|
|
76
77
|
private _newSelectionAfterValueChange?;
|
|
77
78
|
handleSearchPanelMount: (dom: HTMLElement, view: EditorView) => void;
|
|
78
79
|
handleSearchPanelDestroy: (dom: HTMLElement) => void;
|
|
@@ -109,10 +110,14 @@ declare class SourceCodeEditor extends Component<SourceCodeEditorProps, SourceCo
|
|
|
109
110
|
get focusListenerExtension(): import("@codemirror/state").Extension;
|
|
110
111
|
get announceLineNumberExtension(): import("@codemirror/state").Extension;
|
|
111
112
|
refreshExtensions(): void;
|
|
113
|
+
private updateScrollerFocusability;
|
|
114
|
+
private observeScrollerOverflow;
|
|
112
115
|
refreshEditorValue(): void;
|
|
113
116
|
assignAriaLabel: () => void;
|
|
114
117
|
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
115
118
|
}
|
|
119
|
+
declare const SourceCodeEditor: typeof SourceCodeEditorBase;
|
|
120
|
+
type SourceCodeEditor = SourceCodeEditorBase;
|
|
116
121
|
export default SourceCodeEditor;
|
|
117
122
|
export { SourceCodeEditor };
|
|
118
123
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/SourceCodeEditor/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,EACL,UAAU,EAUX,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAgBlD,OAAO,EAIL,cAAc,EAOf,MAAM,sBAAsB,CAAA;AA8B7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,KAAK,mBAAmB,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,WAAW,CAAA;IAChB,IAAI,EAAE,UAAU,CAAA;CACjB,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,YAAY,EAAE,mBAAmB,EAAE,CAAA;CACpC,CAAA;AAED;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/SourceCodeEditor/v2/index.tsx"],"names":[],"mappings":"AAwB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AG,oBAAoB,CAAA;eAE7B,gBAAgB;AAC/B,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = customSearch;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _search = require("@codemirror/search");
|
|
9
|
-
var _v11_ = require("@instructure/ui-text-input/v11_6");
|
|
10
|
-
var _v11_2 = require("@instructure/ui-buttons/v11_6");
|
|
11
|
-
var _uiIcons = require("@instructure/ui-icons");
|
|
12
|
-
var _client = require("react-dom/client");
|
|
13
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
14
|
-
/*
|
|
15
|
-
* The MIT License (MIT)
|
|
16
|
-
*
|
|
17
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
18
|
-
*
|
|
19
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
20
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
21
|
-
* in the Software without restriction, including without limitation the rights
|
|
22
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
24
|
-
* furnished to do so, subject to the following conditions:
|
|
25
|
-
*
|
|
26
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
27
|
-
* copies or substantial portions of the Software.
|
|
28
|
-
*
|
|
29
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
30
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
31
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
32
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
33
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
34
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
|
-
* SOFTWARE.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
function SearchPanel({
|
|
39
|
-
view,
|
|
40
|
-
searchConfig
|
|
41
|
-
}) {
|
|
42
|
-
const [searchQueryStr, setSearchQueryStr] = (0, _react.useState)('');
|
|
43
|
-
const handleChange = (_e, value) => {
|
|
44
|
-
setSearchQueryStr(value);
|
|
45
|
-
handleHighlightSearch(value);
|
|
46
|
-
};
|
|
47
|
-
const handleHighlightSearch = searchStr => {
|
|
48
|
-
view.dispatch({
|
|
49
|
-
effects: _search.setSearchQuery.of(new _search.SearchQuery({
|
|
50
|
-
search: searchStr
|
|
51
|
-
}))
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
const handleKeyDown = e => {
|
|
55
|
-
if (e.key !== 'Enter') return;
|
|
56
|
-
if (!e.shiftKey) handleFindNext();else handleFindPrev();
|
|
57
|
-
};
|
|
58
|
-
const handleKeyUp = e => {
|
|
59
|
-
if (e.key !== 'Escape') return;
|
|
60
|
-
(0, _search.closeSearchPanel)(view);
|
|
61
|
-
};
|
|
62
|
-
const handleFindNext = () => {
|
|
63
|
-
handleHighlightSearch(searchQueryStr);
|
|
64
|
-
(0, _search.findNext)(view);
|
|
65
|
-
};
|
|
66
|
-
const handleFindPrev = () => {
|
|
67
|
-
handleHighlightSearch(searchQueryStr);
|
|
68
|
-
(0, _search.findPrevious)(view);
|
|
69
|
-
};
|
|
70
|
-
return (0, _jsxRuntime.jsx)(_v11_.TextInput, {
|
|
71
|
-
renderLabel: "",
|
|
72
|
-
inputRef: r => {
|
|
73
|
-
setTimeout(() => r?.focus(), 0);
|
|
74
|
-
},
|
|
75
|
-
size: "small",
|
|
76
|
-
display: "inline-block",
|
|
77
|
-
width: "20rem",
|
|
78
|
-
placeholder: searchConfig.placeholder,
|
|
79
|
-
onChange: handleChange,
|
|
80
|
-
onKeyDown: handleKeyDown,
|
|
81
|
-
onKeyUp: handleKeyUp,
|
|
82
|
-
renderBeforeInput: (0, _jsxRuntime.jsx)(_uiIcons.IconSearchLine, {
|
|
83
|
-
size: "x-small"
|
|
84
|
-
}),
|
|
85
|
-
renderAfterInput: (0, _jsxRuntime.jsxs)("span", {
|
|
86
|
-
children: [(0, _jsxRuntime.jsx)(_v11_2.IconButton, {
|
|
87
|
-
size: "small",
|
|
88
|
-
withBorder: false,
|
|
89
|
-
withBackground: false,
|
|
90
|
-
onClick: handleFindNext,
|
|
91
|
-
screenReaderLabel: searchConfig.nextResultLabel,
|
|
92
|
-
children: (0, _jsxRuntime.jsx)(_uiIcons.IconArrowOpenDownLine, {})
|
|
93
|
-
}), (0, _jsxRuntime.jsx)(_v11_2.IconButton, {
|
|
94
|
-
size: "small",
|
|
95
|
-
withBorder: false,
|
|
96
|
-
withBackground: false,
|
|
97
|
-
onClick: handleFindPrev,
|
|
98
|
-
screenReaderLabel: searchConfig.prevResultLabel,
|
|
99
|
-
children: (0, _jsxRuntime.jsx)(_uiIcons.IconArrowOpenUpLine, {})
|
|
100
|
-
})]
|
|
101
|
-
})
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
function customSearch(searchConfig) {
|
|
105
|
-
return searchConfig ? (0, _search.search)({
|
|
106
|
-
createPanel: view => {
|
|
107
|
-
const dom = document.createElement('div');
|
|
108
|
-
dom.style.padding = '8px';
|
|
109
|
-
const root = (0, _client.createRoot)(dom);
|
|
110
|
-
root.render((0, _jsxRuntime.jsx)(SearchPanel, {
|
|
111
|
-
view: view,
|
|
112
|
-
searchConfig: searchConfig
|
|
113
|
-
}));
|
|
114
|
-
return {
|
|
115
|
-
dom
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
}) : [];
|
|
119
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.rtlHorizontalArrowKeymap = void 0;
|
|
7
|
-
var _commands = require("@codemirror/commands");
|
|
8
|
-
/*
|
|
9
|
-
* The MIT License (MIT)
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
12
|
-
*
|
|
13
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
-
* in the Software without restriction, including without limitation the rights
|
|
16
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
18
|
-
* furnished to do so, subject to the following conditions:
|
|
19
|
-
*
|
|
20
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
21
|
-
* copies or substantial portions of the Software.
|
|
22
|
-
*
|
|
23
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
-
* SOFTWARE.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
const rtlHorizontalArrowKeymap = exports.rtlHorizontalArrowKeymap = [
|
|
33
|
-
// Left/Start/Forward
|
|
34
|
-
{
|
|
35
|
-
key: 'ArrowLeft',
|
|
36
|
-
run: _commands.cursorCharRight,
|
|
37
|
-
shift: _commands.selectCharRight,
|
|
38
|
-
preventDefault: true
|
|
39
|
-
}, {
|
|
40
|
-
key: 'Mod-ArrowLeft',
|
|
41
|
-
mac: 'Alt-ArrowLeft',
|
|
42
|
-
run: _commands.cursorGroupRight,
|
|
43
|
-
shift: _commands.selectGroupRight
|
|
44
|
-
}, {
|
|
45
|
-
key: 'Alt-ArrowLeft',
|
|
46
|
-
mac: 'Ctrl-ArrowLeft',
|
|
47
|
-
run: _commands.cursorSyntaxRight,
|
|
48
|
-
shift: _commands.selectSyntaxRight
|
|
49
|
-
}, {
|
|
50
|
-
mac: 'Cmd-ArrowLeft',
|
|
51
|
-
run: _commands.cursorLineBoundaryRight,
|
|
52
|
-
shift: _commands.selectLineBoundaryRight
|
|
53
|
-
}, {
|
|
54
|
-
key: 'Home',
|
|
55
|
-
run: _commands.cursorLineBoundaryForward,
|
|
56
|
-
shift: _commands.selectLineBoundaryForward
|
|
57
|
-
},
|
|
58
|
-
// Right/End/Backward
|
|
59
|
-
{
|
|
60
|
-
key: 'ArrowRight',
|
|
61
|
-
run: _commands.cursorCharLeft,
|
|
62
|
-
shift: _commands.selectCharLeft,
|
|
63
|
-
preventDefault: true
|
|
64
|
-
}, {
|
|
65
|
-
key: 'Mod-ArrowRight',
|
|
66
|
-
mac: 'Alt-ArrowRight',
|
|
67
|
-
run: _commands.cursorGroupLeft,
|
|
68
|
-
shift: _commands.selectGroupLeft
|
|
69
|
-
}, {
|
|
70
|
-
key: 'Alt-ArrowRight',
|
|
71
|
-
mac: 'Ctrl-ArrowRight',
|
|
72
|
-
run: _commands.cursorSyntaxLeft,
|
|
73
|
-
shift: _commands.selectSyntaxLeft
|
|
74
|
-
}, {
|
|
75
|
-
mac: 'Cmd-ArrowRight',
|
|
76
|
-
run: _commands.cursorLineBoundaryLeft,
|
|
77
|
-
shift: _commands.selectLineBoundaryLeft
|
|
78
|
-
}, {
|
|
79
|
-
key: 'End',
|
|
80
|
-
run: _commands.cursorLineBoundaryBackward,
|
|
81
|
-
shift: _commands.selectLineBoundaryBackward
|
|
82
|
-
},
|
|
83
|
-
// Delete/Backspace
|
|
84
|
-
{
|
|
85
|
-
key: 'Delete',
|
|
86
|
-
run: _commands.deleteCharBackward
|
|
87
|
-
}, {
|
|
88
|
-
key: 'Mod-Delete',
|
|
89
|
-
mac: 'Alt-Delete',
|
|
90
|
-
run: _commands.deleteGroupBackward
|
|
91
|
-
}, {
|
|
92
|
-
key: 'Backspace',
|
|
93
|
-
run: _commands.deleteCharForward,
|
|
94
|
-
shift: _commands.deleteCharForward
|
|
95
|
-
}, {
|
|
96
|
-
key: 'Mod-Backspace',
|
|
97
|
-
mac: 'Alt-Backspace',
|
|
98
|
-
run: _commands.deleteGroupForward
|
|
99
|
-
}, {
|
|
100
|
-
mac: 'Mod-Delete',
|
|
101
|
-
run: _commands.deleteToLineStart
|
|
102
|
-
}, {
|
|
103
|
-
mac: 'Mod-Backspace',
|
|
104
|
-
run: _commands.deleteToLineEnd
|
|
105
|
-
}];
|