@uiw/react-codemirror 4.25.10 → 4.25.11
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/README.md +0 -2
- package/cjs/theme/dimensionTheme.d.ts +3 -0
- package/cjs/theme/dimensionTheme.js +43 -0
- package/cjs/useCodeMirror.js +3 -14
- package/dist/codemirror.js +94 -46
- package/dist/codemirror.min.js +1 -1
- package/esm/theme/dimensionTheme.d.ts +3 -0
- package/esm/theme/dimensionTheme.js +36 -0
- package/esm/useCodeMirror.js +3 -14
- package/package.json +2 -2
- package/src/theme/dimensionTheme.ts +42 -0
- package/src/useCodeMirror.ts +8 -14
package/README.md
CHANGED
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6476400184" title="Resume Revise for macOS"><img alt="Resume Revise" height="52" src="https://wangchujiang.com/appicon/resume-revise.png"></a>
|
|
52
52
|
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6472593276" title="Palette Genius for macOS"><img alt="Palette Genius" height="52" src="https://wangchujiang.com/appicon/palette-genius.png"></a>
|
|
53
53
|
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6470879005" title="Symbol Scribe for macOS"><img alt="Symbol Scribe" height="52" src="https://wangchujiang.com/appicon/symbol-scribe.png"></a>
|
|
54
|
-
<br><br>
|
|
55
54
|
</div>
|
|
56
55
|
<hr>
|
|
57
56
|
|
|
@@ -133,7 +132,6 @@ npm install @uiw/react-codemirror --save
|
|
|
133
132
|
| [`@uiw/codemirror-theme-github`](https://uiwjs.github.io/react-codemirror/#/theme/data/github) | [](https://www.npmjs.com/package/@uiw/codemirror-theme-github) [](https://www.npmjs.com/package/@uiw/codemirror-theme-github) |
|
|
134
133
|
| [`@uiw/codemirror-theme-gruvbox-dark`](https://uiwjs.github.io/react-codemirror/#/theme/data/gruvbox/dark) | [](https://www.npmjs.com/package/@uiw/codemirror-theme-gruvbox-dark) [](https://www.npmjs.com/package/@uiw/codemirror-theme-gruvbox-dark) |
|
|
135
134
|
| [`@uiw/codemirror-theme-kimbie`](https://uiwjs.github.io/react-codemirror/#/theme/data/kimbie/dark) | [](https://www.npmjs.com/package/@uiw/codemirror-theme-kimbie) [](https://www.npmjs.com/package/@uiw/codemirror-theme-kimbie) |
|
|
136
|
-
| [`@uiw/codemirror-theme-kimbie`](https://uiwjs.github.io/react-codemirror/#/theme/data/kimbie/dark) | [](https://www.npmjs.com/package/@uiw/codemirror-theme-kimbie) [](https://www.npmjs.com/package/@uiw/codemirror-theme-kimbie) |
|
|
137
135
|
| [`@uiw/codemirror-theme-material`](https://uiwjs.github.io/react-codemirror/#/theme/data/material/dark) | [](https://www.npmjs.com/package/@uiw/codemirror-theme-material) [](https://www.npmjs.com/package/@uiw/codemirror-theme-material) |
|
|
138
136
|
| [`@uiw/codemirror-theme-monokai`](https://uiwjs.github.io/react-codemirror/#/theme/data/monokai) | [](https://www.npmjs.com/package/@uiw/codemirror-theme-monokai) [](https://www.npmjs.com/package/@uiw/codemirror-theme-monokai) |
|
|
139
137
|
| [`@uiw/codemirror-theme-monokai-dimmed`](https://uiwjs.github.io/react-codemirror/#/theme/data/monokai) | [](https://www.npmjs.com/package/@uiw/codemirror-theme-monokai-dimmed) [](https://www.npmjs.com/package/@uiw/codemirror-theme-monokai-dimmed) |
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Extension } from '@codemirror/state';
|
|
2
|
+
export declare const scrollerTheme: Extension;
|
|
3
|
+
export declare function getDimensionTheme(height: string | null, minHeight: string | null, maxHeight: string | null, width: string | null, minWidth: string | null, maxWidth: string | null): Extension | null;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getDimensionTheme = getDimensionTheme;
|
|
7
|
+
exports.scrollerTheme = void 0;
|
|
8
|
+
var _view = require("@codemirror/view");
|
|
9
|
+
var scrollerTheme = exports.scrollerTheme = _view.EditorView.theme({
|
|
10
|
+
'& .cm-scroller': {
|
|
11
|
+
height: '100% !important'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var lastDimensionKey = null;
|
|
15
|
+
var lastDimensionTheme = null;
|
|
16
|
+
function getDimensionTheme(height, minHeight, maxHeight, width, minWidth, maxWidth) {
|
|
17
|
+
if (!height && !minHeight && !maxHeight && !width && !minWidth && !maxWidth) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
var cacheKey = JSON.stringify({
|
|
21
|
+
height: height,
|
|
22
|
+
minHeight: minHeight,
|
|
23
|
+
maxHeight: maxHeight,
|
|
24
|
+
width: width,
|
|
25
|
+
minWidth: minWidth,
|
|
26
|
+
maxWidth: maxWidth
|
|
27
|
+
});
|
|
28
|
+
if (cacheKey === lastDimensionKey) {
|
|
29
|
+
return lastDimensionTheme;
|
|
30
|
+
}
|
|
31
|
+
lastDimensionKey = cacheKey;
|
|
32
|
+
lastDimensionTheme = _view.EditorView.theme({
|
|
33
|
+
'&': {
|
|
34
|
+
height: height,
|
|
35
|
+
minHeight: minHeight,
|
|
36
|
+
maxHeight: maxHeight,
|
|
37
|
+
width: width,
|
|
38
|
+
minWidth: minWidth,
|
|
39
|
+
maxWidth: maxWidth
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return lastDimensionTheme;
|
|
43
|
+
}
|
package/cjs/useCodeMirror.js
CHANGED
|
@@ -14,6 +14,7 @@ var _view = require("@codemirror/view");
|
|
|
14
14
|
var _getDefaultExtensions = require("./getDefaultExtensions");
|
|
15
15
|
var _utils = require("./utils");
|
|
16
16
|
var _timeoutLatch = require("./timeoutLatch");
|
|
17
|
+
var _dimensionTheme = require("./theme/dimensionTheme");
|
|
17
18
|
var ExternalChange = exports.ExternalChange = _state.Annotation.define();
|
|
18
19
|
var TYPING_TIMOUT = 200; // ms
|
|
19
20
|
|
|
@@ -76,19 +77,7 @@ function useCodeMirror(props) {
|
|
|
76
77
|
current: null
|
|
77
78
|
};
|
|
78
79
|
})[0];
|
|
79
|
-
var defaultThemeOption =
|
|
80
|
-
'&': {
|
|
81
|
-
height: height,
|
|
82
|
-
minHeight: minHeight,
|
|
83
|
-
maxHeight: maxHeight,
|
|
84
|
-
width: width,
|
|
85
|
-
minWidth: minWidth,
|
|
86
|
-
maxWidth: maxWidth
|
|
87
|
-
},
|
|
88
|
-
'& .cm-scroller': {
|
|
89
|
-
height: '100% !important'
|
|
90
|
-
}
|
|
91
|
-
});
|
|
80
|
+
var defaultThemeOption = (0, _dimensionTheme.getDimensionTheme)(height, minHeight, maxHeight, width, minWidth, maxWidth);
|
|
92
81
|
var updateListener = _view.EditorView.updateListener.of(function (vu) {
|
|
93
82
|
if (vu.docChanged && typeof onChange === 'function' &&
|
|
94
83
|
// Fix echoing of the remote changes:
|
|
@@ -123,7 +112,7 @@ function useCodeMirror(props) {
|
|
|
123
112
|
indentWithTab: defaultIndentWithTab,
|
|
124
113
|
basicSetup: defaultBasicSetup
|
|
125
114
|
});
|
|
126
|
-
var getExtensions = [updateListener, defaultThemeOption].
|
|
115
|
+
var getExtensions = [updateListener].concat((0, _toConsumableArray2["default"])(defaultThemeOption ? [defaultThemeOption] : []), [_dimensionTheme.scrollerTheme], (0, _toConsumableArray2["default"])(defaultExtensions));
|
|
127
116
|
if (onUpdate && typeof onUpdate === 'function') {
|
|
128
117
|
getExtensions.push(_view.EditorView.updateListener.of(onUpdate));
|
|
129
118
|
}
|
package/dist/codemirror.js
CHANGED
|
@@ -48,7 +48,7 @@ var defaultLightThemeOption=_codemirror_view__WEBPACK_IMPORTED_MODULE_0__.Editor
|
|
|
48
48
|
|
|
49
49
|
/***/ },
|
|
50
50
|
|
|
51
|
-
/***/
|
|
51
|
+
/***/ 637
|
|
52
52
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
53
53
|
|
|
54
54
|
|
|
@@ -183,11 +183,13 @@ function _createClass(e, r, t) {
|
|
|
183
183
|
// Setting / Unsetting timeouts for every keystroke was a significant overhead
|
|
184
184
|
// Inspired from https://github.com/iostreamer-X/timeout-latch
|
|
185
185
|
var TimeoutLatch=/*#__PURE__*/function(){function TimeoutLatch(callback,timeoutMS){_classCallCheck(this,TimeoutLatch);this.timeLeftMS=void 0;this.timeoutMS=void 0;this.isCancelled=false;this.isTimeExhausted=false;this.callbacks=[];this.timeLeftMS=timeoutMS;this.timeoutMS=timeoutMS;this.callbacks.push(callback);}return _createClass(TimeoutLatch,[{key:"tick",value:function tick(){if(!this.isCancelled&&!this.isTimeExhausted){this.timeLeftMS--;if(this.timeLeftMS<=0){this.isTimeExhausted=true;var callbacks=this.callbacks.slice();this.callbacks.length=0;callbacks.forEach(function(callback){try{callback();}catch(error){console.error('TimeoutLatch callback error:',error);}});}}}},{key:"cancel",value:function cancel(){this.isCancelled=true;this.callbacks.length=0;}},{key:"reset",value:function reset(){this.timeLeftMS=this.timeoutMS;this.isCancelled=false;this.isTimeExhausted=false;}},{key:"isDone",get:function get(){return this.isCancelled||this.isTimeExhausted;}}]);}();var Scheduler=/*#__PURE__*/function(){function Scheduler(){_classCallCheck(this,Scheduler);this.interval=null;this.latches=new Set();}return _createClass(Scheduler,[{key:"add",value:function add(latch){this.latches.add(latch);this.start();}},{key:"remove",value:function remove(latch){this.latches["delete"](latch);if(this.latches.size===0){this.stop();}}},{key:"start",value:function start(){var _this=this;if(this.interval===null){this.interval=setInterval(function(){_this.latches.forEach(function(latch){latch.tick();if(latch.isDone){_this.remove(latch);}});},1);}}},{key:"stop",value:function stop(){if(this.interval!==null){clearInterval(this.interval);this.interval=null;}}}]);}();var globalScheduler=null;var getScheduler=function getScheduler(){if(typeof window==='undefined'){return new Scheduler();}if(!globalScheduler){globalScheduler=new Scheduler();}return globalScheduler;};
|
|
186
|
+
;// ./src/theme/dimensionTheme.ts
|
|
187
|
+
var scrollerTheme=view_.EditorView.theme({'& .cm-scroller':{height:'100% !important'}});var lastDimensionKey=null;var lastDimensionTheme=null;function getDimensionTheme(height,minHeight,maxHeight,width,minWidth,maxWidth){if(!height&&!minHeight&&!maxHeight&&!width&&!minWidth&&!maxWidth){return null;}var cacheKey=JSON.stringify({height:height,minHeight:minHeight,maxHeight:maxHeight,width:width,minWidth:minWidth,maxWidth:maxWidth});if(cacheKey===lastDimensionKey){return lastDimensionTheme;}lastDimensionKey=cacheKey;lastDimensionTheme=view_.EditorView.theme({'&':{height:height,minHeight:minHeight,maxHeight:maxHeight,width:width,minWidth:minWidth,maxWidth:maxWidth}});return lastDimensionTheme;}
|
|
186
188
|
;// ./src/useCodeMirror.ts
|
|
187
189
|
var ExternalChange=state_.Annotation.define();var TYPING_TIMOUT=200;// ms
|
|
188
|
-
var emptyExtensions=[];function useCodeMirror(props){var value=props.value,selection=props.selection,onChange=props.onChange,onStatistics=props.onStatistics,onCreateEditor=props.onCreateEditor,onUpdate=props.onUpdate,_props$extensions=props.extensions,extensions=_props$extensions===void 0?emptyExtensions:_props$extensions,autoFocus=props.autoFocus,_props$theme=props.theme,theme=_props$theme===void 0?'light':_props$theme,_props$height=props.height,height=_props$height===void 0?null:_props$height,_props$minHeight=props.minHeight,minHeight=_props$minHeight===void 0?null:_props$minHeight,_props$maxHeight=props.maxHeight,maxHeight=_props$maxHeight===void 0?null:_props$maxHeight,_props$width=props.width,width=_props$width===void 0?null:_props$width,_props$minWidth=props.minWidth,minWidth=_props$minWidth===void 0?null:_props$minWidth,_props$maxWidth=props.maxWidth,maxWidth=_props$maxWidth===void 0?null:_props$maxWidth,_props$placeholder=props.placeholder,placeholderStr=_props$placeholder===void 0?'':_props$placeholder,_props$editable=props.editable,editable=_props$editable===void 0?true:_props$editable,_props$readOnly=props.readOnly,readOnly=_props$readOnly===void 0?false:_props$readOnly,_props$indentWithTab=props.indentWithTab,defaultIndentWithTab=_props$indentWithTab===void 0?true:_props$indentWithTab,_props$basicSetup=props.basicSetup,defaultBasicSetup=_props$basicSetup===void 0?true:_props$basicSetup,root=props.root,initialState=props.initialState;var _useState=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),_useState2=_slicedToArray(_useState,2),container=_useState2[0],setContainer=_useState2[1];var _useState3=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),_useState4=_slicedToArray(_useState3,2),view=_useState4[0],setView=_useState4[1];var _useState5=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),_useState6=_slicedToArray(_useState5,2),state=_useState6[0],setState=_useState6[1];var typingLatch=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(function(){return{current:null};})[0];var pendingUpdate=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(function(){return{current:null};})[0];var defaultThemeOption=
|
|
190
|
+
var emptyExtensions=[];function useCodeMirror(props){var value=props.value,selection=props.selection,onChange=props.onChange,onStatistics=props.onStatistics,onCreateEditor=props.onCreateEditor,onUpdate=props.onUpdate,_props$extensions=props.extensions,extensions=_props$extensions===void 0?emptyExtensions:_props$extensions,autoFocus=props.autoFocus,_props$theme=props.theme,theme=_props$theme===void 0?'light':_props$theme,_props$height=props.height,height=_props$height===void 0?null:_props$height,_props$minHeight=props.minHeight,minHeight=_props$minHeight===void 0?null:_props$minHeight,_props$maxHeight=props.maxHeight,maxHeight=_props$maxHeight===void 0?null:_props$maxHeight,_props$width=props.width,width=_props$width===void 0?null:_props$width,_props$minWidth=props.minWidth,minWidth=_props$minWidth===void 0?null:_props$minWidth,_props$maxWidth=props.maxWidth,maxWidth=_props$maxWidth===void 0?null:_props$maxWidth,_props$placeholder=props.placeholder,placeholderStr=_props$placeholder===void 0?'':_props$placeholder,_props$editable=props.editable,editable=_props$editable===void 0?true:_props$editable,_props$readOnly=props.readOnly,readOnly=_props$readOnly===void 0?false:_props$readOnly,_props$indentWithTab=props.indentWithTab,defaultIndentWithTab=_props$indentWithTab===void 0?true:_props$indentWithTab,_props$basicSetup=props.basicSetup,defaultBasicSetup=_props$basicSetup===void 0?true:_props$basicSetup,root=props.root,initialState=props.initialState;var _useState=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),_useState2=_slicedToArray(_useState,2),container=_useState2[0],setContainer=_useState2[1];var _useState3=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),_useState4=_slicedToArray(_useState3,2),view=_useState4[0],setView=_useState4[1];var _useState5=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(),_useState6=_slicedToArray(_useState5,2),state=_useState6[0],setState=_useState6[1];var typingLatch=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(function(){return{current:null};})[0];var pendingUpdate=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(function(){return{current:null};})[0];var defaultThemeOption=getDimensionTheme(height,minHeight,maxHeight,width,minWidth,maxWidth);var updateListener=view_.EditorView.updateListener.of(function(vu){if(vu.docChanged&&typeof onChange==='function'&&// Fix echoing of the remote changes:
|
|
189
191
|
// If transaction is market as remote we don't have to call `onChange` handler again
|
|
190
|
-
!vu.transactions.some(function(tr){return tr.annotation(ExternalChange);})){if(typingLatch.current){typingLatch.current.reset();}else{typingLatch.current=new TimeoutLatch(function(){if(pendingUpdate.current){var forceUpdate=pendingUpdate.current;pendingUpdate.current=null;forceUpdate();}typingLatch.current=null;},TYPING_TIMOUT);getScheduler().add(typingLatch.current);}var doc=vu.state.doc;var _value=doc.toString();onChange(_value,vu);}onStatistics&&onStatistics((0,utils/* getStatistics */.m)(vu));});var defaultExtensions=(0,getDefaultExtensions.getDefaultExtensions)({theme:theme,editable:editable,readOnly:readOnly,placeholder:placeholderStr,indentWithTab:defaultIndentWithTab,basicSetup:defaultBasicSetup});var getExtensions=[updateListener
|
|
192
|
+
!vu.transactions.some(function(tr){return tr.annotation(ExternalChange);})){if(typingLatch.current){typingLatch.current.reset();}else{typingLatch.current=new TimeoutLatch(function(){if(pendingUpdate.current){var forceUpdate=pendingUpdate.current;pendingUpdate.current=null;forceUpdate();}typingLatch.current=null;},TYPING_TIMOUT);getScheduler().add(typingLatch.current);}var doc=vu.state.doc;var _value=doc.toString();onChange(_value,vu);}onStatistics&&onStatistics((0,utils/* getStatistics */.m)(vu));});var defaultExtensions=(0,getDefaultExtensions.getDefaultExtensions)({theme:theme,editable:editable,readOnly:readOnly,placeholder:placeholderStr,indentWithTab:defaultIndentWithTab,basicSetup:defaultBasicSetup});var getExtensions=[updateListener].concat(_toConsumableArray(defaultThemeOption?[defaultThemeOption]:[]),[scrollerTheme],_toConsumableArray(defaultExtensions));if(onUpdate&&typeof onUpdate==='function'){getExtensions.push(view_.EditorView.updateListener.of(onUpdate));}getExtensions=getExtensions.concat(extensions);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function(){if(container&&!state){var config={doc:value,selection:selection,extensions:getExtensions};var stateCurrent=initialState?state_.EditorState.fromJSON(initialState.json,config,initialState.fields):state_.EditorState.create(config);setState(stateCurrent);if(!view){var viewCurrent=new view_.EditorView({state:stateCurrent,parent:container,root:root});setView(viewCurrent);onCreateEditor&&onCreateEditor(viewCurrent,stateCurrent);}}return function(){if(view){setState(undefined);setView(undefined);}};},[container,state]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(props.container){setContainer(props.container);}},[props.container]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){return function(){if(view){view.destroy();setView(undefined);}if(typingLatch.current){typingLatch.current.cancel();typingLatch.current=null;}};},[view]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(autoFocus&&view){view.focus();}},[autoFocus,view]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(view){view.dispatch({effects:state_.StateEffect.reconfigure.of(getExtensions)});}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
191
193
|
},[theme,extensions,height,minHeight,maxHeight,width,minWidth,maxWidth,placeholderStr,editable,readOnly,defaultIndentWithTab,defaultBasicSetup,onChange,onUpdate]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function(){if(value===undefined){return;}var currentValue=view?view.state.doc.toString():'';if(view&&value!==currentValue){var isTyping=typingLatch.current&&!typingLatch.current.isDone;var forceUpdate=function forceUpdate(){if(view&&value!==view.state.doc.toString()){view.dispatch({changes:{from:0,to:view.state.doc.toString().length,insert:value||''},annotations:[ExternalChange.of(true)]});}};if(!isTyping){forceUpdate();}else{pendingUpdate.current=forceUpdate;}}},[value,view]);return{state:state,setState:setState,view:view,setView:setView,container:container,setContainer:setContainer};}
|
|
192
194
|
|
|
193
195
|
/***/ },
|
|
@@ -1214,6 +1216,7 @@ const replaceNext = /*@__PURE__*/searchCommand((view, { query }) => {
|
|
|
1214
1216
|
else if (next.from == from && next.to == to) {
|
|
1215
1217
|
replacement = state.toText(query.getReplacement(next));
|
|
1216
1218
|
changes.push({ from: next.from, to: next.to, insert: replacement });
|
|
1219
|
+
next = query.nextMatch(state, next.from, next.to);
|
|
1217
1220
|
effects.push(view_.EditorView.announce.of(state.phrase("replaced match on line $", state.doc.lineAt(from).number) + "."));
|
|
1218
1221
|
}
|
|
1219
1222
|
let changeSet = view.state.changes(changes);
|
|
@@ -2560,7 +2563,7 @@ class ActiveResult extends ActiveSource {
|
|
|
2560
2563
|
let result = this.result.map ? this.result.map(this.result, mapping) : this.result;
|
|
2561
2564
|
if (!result)
|
|
2562
2565
|
return new ActiveSource(this.source, 0 /* State.Inactive */);
|
|
2563
|
-
return new ActiveResult(this.source, this.explicit, mapping.mapPos(this.limit),
|
|
2566
|
+
return new ActiveResult(this.source, this.explicit, mapping.mapPos(this.limit), result, mapping.mapPos(this.from), mapping.mapPos(this.to, 1));
|
|
2564
2567
|
}
|
|
2565
2568
|
touches(tr) {
|
|
2566
2569
|
return tr.changes.touchesRange(this.from, this.to);
|
|
@@ -3012,6 +3015,9 @@ class Snippet {
|
|
|
3012
3015
|
for (let line of template.split(/\r\n?|\n/)) {
|
|
3013
3016
|
while (m = /[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(line)) {
|
|
3014
3017
|
let seq = m[1] ? +m[1] : null, rawName = m[2] || m[3] || "", found = -1;
|
|
3018
|
+
// `${0}` is the cursor's final position, after every other tab stop.
|
|
3019
|
+
if (seq === 0)
|
|
3020
|
+
seq = 1e9;
|
|
3015
3021
|
let name = rawName.replace(/\\[{}]/g, m => m[1]);
|
|
3016
3022
|
for (let i = 0; i < fields.length; i++) {
|
|
3017
3023
|
if (seq != null ? fields[i].seq == seq : name ? fields[i].name == name : false)
|
|
@@ -3126,7 +3132,8 @@ cursor out of the current field deactivates the fields.
|
|
|
3126
3132
|
|
|
3127
3133
|
The order of fields defaults to textual order, but you can add
|
|
3128
3134
|
numbers to placeholders (`${1}` or `${1:defaultText}`) to provide
|
|
3129
|
-
a custom order.
|
|
3135
|
+
a custom order. `${0}` is special—it is always the last stop, where
|
|
3136
|
+
the cursor ends up after tabbing through the other fields.
|
|
3130
3137
|
|
|
3131
3138
|
To include a literal `{` or `}` in your template, put a backslash
|
|
3132
3139
|
in front of it. This will be removed and the brace will not be
|
|
@@ -3866,7 +3873,7 @@ function lintTooltip(view, pos, side) {
|
|
|
3866
3873
|
return {
|
|
3867
3874
|
pos: start,
|
|
3868
3875
|
end: end,
|
|
3869
|
-
above:
|
|
3876
|
+
above: true,
|
|
3870
3877
|
create() {
|
|
3871
3878
|
return { dom: diagnosticsTooltip(view, found) };
|
|
3872
3879
|
}
|
|
@@ -4880,10 +4887,7 @@ function toPropertyKey(t) {
|
|
|
4880
4887
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
4881
4888
|
|
|
4882
4889
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4883
|
-
/* harmony export */
|
|
4884
|
-
/* harmony export */ b6: () => (/* binding */ history),
|
|
4885
|
-
/* harmony export */ cL: () => (/* binding */ historyKeymap),
|
|
4886
|
-
/* harmony export */ pw: () => (/* binding */ defaultKeymap)
|
|
4890
|
+
/* harmony export */ b6: () => (/* binding */ history)
|
|
4887
4891
|
/* harmony export */ });
|
|
4888
4892
|
/* unused harmony exports addCursorAbove, addCursorBelow, blockComment, blockUncomment, copyLineDown, copyLineUp, cursorCharBackward, cursorCharBackwardLogical, cursorCharForward, cursorCharForwardLogical, cursorCharLeft, cursorCharRight, cursorDocEnd, cursorDocStart, cursorGroupBackward, cursorGroupForward, cursorGroupForwardWin, cursorGroupLeft, cursorGroupRight, cursorLineBoundaryBackward, cursorLineBoundaryForward, cursorLineBoundaryLeft, cursorLineBoundaryRight, cursorLineDown, cursorLineEnd, cursorLineStart, cursorLineUp, cursorMatchingBracket, cursorPageDown, cursorPageUp, cursorSubwordBackward, cursorSubwordForward, cursorSyntaxLeft, cursorSyntaxRight, deleteCharBackward, deleteCharBackwardStrict, deleteCharForward, deleteGroupBackward, deleteGroupForward, deleteGroupForwardWin, deleteLine, deleteLineBoundaryBackward, deleteLineBoundaryForward, deleteToLineEnd, deleteToLineStart, deleteTrailingWhitespace, emacsStyleKeymap, historyField, indentLess, indentMore, indentSelection, insertBlankLine, insertNewline, insertNewlineAndIndent, insertNewlineKeepIndent, insertTab, invertedEffects, isolateHistory, lineComment, lineUncomment, moveLineDown, moveLineUp, redo, redoDepth, redoSelection, selectAll, selectCharBackward, selectCharBackwardLogical, selectCharForward, selectCharForwardLogical, selectCharLeft, selectCharRight, selectDocEnd, selectDocStart, selectGroupBackward, selectGroupForward, selectGroupForwardWin, selectGroupLeft, selectGroupRight, selectLine, selectLineBoundaryBackward, selectLineBoundaryForward, selectLineBoundaryLeft, selectLineBoundaryRight, selectLineDown, selectLineEnd, selectLineStart, selectLineUp, selectMatchingBracket, selectPageDown, selectPageUp, selectParentSyntax, selectSubwordBackward, selectSubwordForward, selectSyntaxLeft, selectSyntaxRight, simplifySelection, splitLine, standardKeymap, temporarilySetTabFocusMode, toggleBlockComment, toggleBlockCommentByLine, toggleComment, toggleLineComment, toggleTabFocusMode, transposeChars, undo, undoDepth, undoSelection */
|
|
4889
4893
|
/* unused harmony import specifier */ var findClusterBreak;
|
|
@@ -5782,8 +5786,10 @@ Extend the selection to the bracket matching the one the selection
|
|
|
5782
5786
|
head is currently on, if any.
|
|
5783
5787
|
*/
|
|
5784
5788
|
const selectMatchingBracket = ({ state, dispatch }) => toMatchingBracket(state, dispatch, true);
|
|
5785
|
-
function extendSel(target, how) {
|
|
5789
|
+
function extendSel(target, forward, how) {
|
|
5786
5790
|
let selection = updateSel(target.state.selection, range => {
|
|
5791
|
+
if (range.undirectional && (range.head >= range.anchor) != forward)
|
|
5792
|
+
range = _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.EditorSelection.range(range.head, range.anchor);
|
|
5787
5793
|
let head = how(range);
|
|
5788
5794
|
return _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.EditorSelection.range(range.anchor, head.head, head.goalColumn, head.bidiLevel || undefined, head.assoc);
|
|
5789
5795
|
});
|
|
@@ -5793,7 +5799,7 @@ function extendSel(target, how) {
|
|
|
5793
5799
|
return true;
|
|
5794
5800
|
}
|
|
5795
5801
|
function selectByChar(view, forward) {
|
|
5796
|
-
return extendSel(view, range => view.moveByChar(range, forward));
|
|
5802
|
+
return extendSel(view, forward, range => view.moveByChar(range, forward));
|
|
5797
5803
|
}
|
|
5798
5804
|
/**
|
|
5799
5805
|
Move the selection head one character to the left, while leaving
|
|
@@ -5816,14 +5822,14 @@ const selectCharBackward = view => selectByChar(view, false);
|
|
|
5816
5822
|
Move the selection head one character forward by logical
|
|
5817
5823
|
(non-direction aware) string index order.
|
|
5818
5824
|
*/
|
|
5819
|
-
const selectCharForwardLogical = target => extendSel(target, range => byCharLogical(target.state, range, true));
|
|
5825
|
+
const selectCharForwardLogical = target => extendSel(target, true, range => byCharLogical(target.state, range, true));
|
|
5820
5826
|
/**
|
|
5821
5827
|
Move the selection head one character backward by logical string
|
|
5822
5828
|
index order.
|
|
5823
5829
|
*/
|
|
5824
|
-
const selectCharBackwardLogical = target => extendSel(target, range => byCharLogical(target.state, range, false));
|
|
5830
|
+
const selectCharBackwardLogical = target => extendSel(target, false, range => byCharLogical(target.state, range, false));
|
|
5825
5831
|
function selectByGroup(view, forward) {
|
|
5826
|
-
return extendSel(view, range => view.moveByGroup(range, forward));
|
|
5832
|
+
return extendSel(view, forward, range => view.moveByGroup(range, forward));
|
|
5827
5833
|
}
|
|
5828
5834
|
/**
|
|
5829
5835
|
Move the selection head one [group](https://codemirror.net/6/docs/ref/#commands.cursorGroupLeft) to
|
|
@@ -5847,10 +5853,10 @@ Move the selection head one group forward in the default Windows
|
|
|
5847
5853
|
style, skipping to the start of the next group.
|
|
5848
5854
|
*/
|
|
5849
5855
|
const selectGroupForwardWin = view => {
|
|
5850
|
-
return extendSel(view, range => view.moveByChar(range, true, start => toGroupStart(view, range.head, start)));
|
|
5856
|
+
return extendSel(view, true, range => view.moveByChar(range, true, start => toGroupStart(view, range.head, start)));
|
|
5851
5857
|
};
|
|
5852
5858
|
function selectBySubword(view, forward) {
|
|
5853
|
-
return extendSel(view, range => moveBySubword(view, range, forward));
|
|
5859
|
+
return extendSel(view, forward, range => moveBySubword(view, range, forward));
|
|
5854
5860
|
}
|
|
5855
5861
|
/**
|
|
5856
5862
|
Move the selection head one group or camel-case subword forward.
|
|
@@ -5863,13 +5869,19 @@ const selectSubwordBackward = view => selectBySubword(view, false);
|
|
|
5863
5869
|
/**
|
|
5864
5870
|
Move the selection head over the next syntactic element to the left.
|
|
5865
5871
|
*/
|
|
5866
|
-
const selectSyntaxLeft = view =>
|
|
5872
|
+
const selectSyntaxLeft = view => {
|
|
5873
|
+
let forward = !ltrAtCursor(view);
|
|
5874
|
+
return extendSel(view, forward, range => moveBySyntax(view.state, range, forward));
|
|
5875
|
+
};
|
|
5867
5876
|
/**
|
|
5868
5877
|
Move the selection head over the next syntactic element to the right.
|
|
5869
5878
|
*/
|
|
5870
|
-
const selectSyntaxRight = view =>
|
|
5879
|
+
const selectSyntaxRight = view => {
|
|
5880
|
+
let forward = ltrAtCursor(view);
|
|
5881
|
+
return extendSel(view, forward, range => moveBySyntax(view.state, range, forward));
|
|
5882
|
+
};
|
|
5871
5883
|
function selectByLine(view, forward) {
|
|
5872
|
-
return extendSel(view, range => view.moveVertically(range, forward));
|
|
5884
|
+
return extendSel(view, forward, range => view.moveVertically(range, forward));
|
|
5873
5885
|
}
|
|
5874
5886
|
/**
|
|
5875
5887
|
Move the selection head one line up.
|
|
@@ -5880,7 +5892,7 @@ Move the selection head one line down.
|
|
|
5880
5892
|
*/
|
|
5881
5893
|
const selectLineDown = view => selectByLine(view, true);
|
|
5882
5894
|
function selectByPage(view, forward) {
|
|
5883
|
-
return extendSel(view, range => view.moveVertically(range, forward, pageInfo(view).height));
|
|
5895
|
+
return extendSel(view, forward, range => view.moveVertically(range, forward, pageInfo(view).height));
|
|
5884
5896
|
}
|
|
5885
5897
|
/**
|
|
5886
5898
|
Move the selection head one page up.
|
|
@@ -5893,27 +5905,33 @@ const selectPageDown = view => selectByPage(view, true);
|
|
|
5893
5905
|
/**
|
|
5894
5906
|
Move the selection head to the next line boundary.
|
|
5895
5907
|
*/
|
|
5896
|
-
const selectLineBoundaryForward = view => extendSel(view, range => moveByLineBoundary(view, range, true));
|
|
5908
|
+
const selectLineBoundaryForward = view => extendSel(view, true, range => moveByLineBoundary(view, range, true));
|
|
5897
5909
|
/**
|
|
5898
5910
|
Move the selection head to the previous line boundary.
|
|
5899
5911
|
*/
|
|
5900
|
-
const selectLineBoundaryBackward = view => extendSel(view, range => moveByLineBoundary(view, range, false));
|
|
5912
|
+
const selectLineBoundaryBackward = view => extendSel(view, false, range => moveByLineBoundary(view, range, false));
|
|
5901
5913
|
/**
|
|
5902
5914
|
Move the selection head one line boundary to the left.
|
|
5903
5915
|
*/
|
|
5904
|
-
const selectLineBoundaryLeft = view =>
|
|
5916
|
+
const selectLineBoundaryLeft = view => {
|
|
5917
|
+
let forward = !ltrAtCursor(view);
|
|
5918
|
+
return extendSel(view, forward, range => moveByLineBoundary(view, range, forward));
|
|
5919
|
+
};
|
|
5905
5920
|
/**
|
|
5906
5921
|
Move the selection head one line boundary to the right.
|
|
5907
5922
|
*/
|
|
5908
|
-
const selectLineBoundaryRight = view =>
|
|
5923
|
+
const selectLineBoundaryRight = view => {
|
|
5924
|
+
let forward = ltrAtCursor(view);
|
|
5925
|
+
return extendSel(view, forward, range => moveByLineBoundary(view, range, forward));
|
|
5926
|
+
};
|
|
5909
5927
|
/**
|
|
5910
5928
|
Move the selection head to the start of the line.
|
|
5911
5929
|
*/
|
|
5912
|
-
const selectLineStart = view => extendSel(view, range => _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.EditorSelection.cursor(view.lineBlockAt(range.head).from));
|
|
5930
|
+
const selectLineStart = view => extendSel(view, false, range => _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.EditorSelection.cursor(view.lineBlockAt(range.head).from));
|
|
5913
5931
|
/**
|
|
5914
5932
|
Move the selection head to the end of the line.
|
|
5915
5933
|
*/
|
|
5916
|
-
const selectLineEnd = view => extendSel(view, range => _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.EditorSelection.cursor(view.lineBlockAt(range.head).to));
|
|
5934
|
+
const selectLineEnd = view => extendSel(view, true, range => _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.EditorSelection.cursor(view.lineBlockAt(range.head).to));
|
|
5917
5935
|
/**
|
|
5918
5936
|
Move the selection to the start of the document.
|
|
5919
5937
|
*/
|
|
@@ -6689,6 +6707,12 @@ const indentWithTab = { key: "Tab", run: indentMore, shift: indentLess };
|
|
|
6689
6707
|
|
|
6690
6708
|
|
|
6691
6709
|
|
|
6710
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
6711
|
+
/* harmony export */ "Yc", 0, /* binding */ indentWithTab,
|
|
6712
|
+
/* harmony export */ "cL", 0, /* binding */ historyKeymap,
|
|
6713
|
+
/* harmony export */ "pw", 0, /* binding */ defaultKeymap
|
|
6714
|
+
/* harmony export */ ]);
|
|
6715
|
+
|
|
6692
6716
|
|
|
6693
6717
|
/***/ },
|
|
6694
6718
|
|
|
@@ -7988,8 +8012,7 @@ function topNodeAt(state, pos, side) {
|
|
|
7988
8012
|
}
|
|
7989
8013
|
/**
|
|
7990
8014
|
A subclass of [`Language`](https://codemirror.net/6/docs/ref/#language.Language) for use with Lezer
|
|
7991
|
-
[LR parsers](https://lezer.codemirror.net/docs/ref#lr.LRParser)
|
|
7992
|
-
parsers.
|
|
8015
|
+
[LR parsers](https://lezer.codemirror.net/docs/ref#lr.LRParser).
|
|
7993
8016
|
*/
|
|
7994
8017
|
class LRLanguage extends Language {
|
|
7995
8018
|
constructor(data, parser, name) {
|
|
@@ -9155,18 +9178,25 @@ const foldState = /*@__PURE__*/state_.StateField.define({
|
|
|
9155
9178
|
if (tr.isUserEvent("delete"))
|
|
9156
9179
|
tr.changes.iterChangedRanges((fromA, toA) => folded = clearTouchedFolds(folded, fromA, toA));
|
|
9157
9180
|
folded = folded.map(tr.changes);
|
|
9181
|
+
let rangesToFold = [];
|
|
9158
9182
|
for (let e of tr.effects) {
|
|
9159
9183
|
if (e.is(foldEffect) && !foldExists(folded, e.value.from, e.value.to)) {
|
|
9160
|
-
|
|
9161
|
-
let widget = !preparePlaceholder ? foldWidget :
|
|
9162
|
-
view_.Decoration.replace({ widget: new PreparedFoldWidget(preparePlaceholder(tr.state, e.value)) });
|
|
9163
|
-
folded = folded.update({ add: [widget.range(e.value.from, e.value.to)] });
|
|
9184
|
+
rangesToFold.push(e.value);
|
|
9164
9185
|
}
|
|
9165
9186
|
else if (e.is(unfoldEffect)) {
|
|
9166
9187
|
folded = folded.update({ filter: (from, to) => e.value.from != from || e.value.to != to,
|
|
9167
9188
|
filterFrom: e.value.from, filterTo: e.value.to });
|
|
9168
9189
|
}
|
|
9169
9190
|
}
|
|
9191
|
+
if (rangesToFold.length) {
|
|
9192
|
+
let { preparePlaceholder } = tr.state.facet(foldConfig);
|
|
9193
|
+
let decorations = rangesToFold.map(value => {
|
|
9194
|
+
let widget = !preparePlaceholder ? foldWidget :
|
|
9195
|
+
view_.Decoration.replace({ widget: new PreparedFoldWidget(preparePlaceholder(tr.state, value)) });
|
|
9196
|
+
return widget.range(value.from, value.to);
|
|
9197
|
+
});
|
|
9198
|
+
folded = folded.update({ add: decorations });
|
|
9199
|
+
}
|
|
9170
9200
|
// Clear folded ranges that cover the selection head
|
|
9171
9201
|
if (tr.selection)
|
|
9172
9202
|
folded = clearTouchedFolds(folded, tr.selection.main.head);
|
|
@@ -9526,7 +9556,7 @@ class HighlightStyle {
|
|
|
9526
9556
|
or array of tags in their `tag` property, and either a single
|
|
9527
9557
|
`class` property providing a static CSS class (for highlighter
|
|
9528
9558
|
that rely on external styling), or a
|
|
9529
|
-
[`style-mod`](https://
|
|
9559
|
+
[`style-mod`](https://code.haverbeke.berlin/marijn/style-mod#documentation)-style
|
|
9530
9560
|
set of CSS properties (which define the styling for those tags).
|
|
9531
9561
|
|
|
9532
9562
|
The CSS rules created for a highlighter will be emitted in the
|
|
@@ -12747,17 +12777,17 @@ function enterFragments(mounts, ranges) {
|
|
|
12747
12777
|
/******/ });
|
|
12748
12778
|
/************************************************************************/
|
|
12749
12779
|
/******/ // The module cache
|
|
12750
|
-
/******/
|
|
12780
|
+
/******/ const __webpack_module_cache__ = {};
|
|
12751
12781
|
/******/
|
|
12752
12782
|
/******/ // The require function
|
|
12753
12783
|
/******/ function __webpack_require__(moduleId) {
|
|
12754
12784
|
/******/ // Check if module is in cache
|
|
12755
|
-
/******/
|
|
12785
|
+
/******/ const cachedModule = __webpack_module_cache__[moduleId];
|
|
12756
12786
|
/******/ if (cachedModule !== undefined) {
|
|
12757
12787
|
/******/ return cachedModule.exports;
|
|
12758
12788
|
/******/ }
|
|
12759
12789
|
/******/ // Create a new module (and put it into the cache)
|
|
12760
|
-
/******/
|
|
12790
|
+
/******/ const module = __webpack_module_cache__[moduleId] = {
|
|
12761
12791
|
/******/ // no module.id needed
|
|
12762
12792
|
/******/ // no module.loaded needed
|
|
12763
12793
|
/******/ exports: {}
|
|
@@ -12775,7 +12805,7 @@ function enterFragments(mounts, ranges) {
|
|
|
12775
12805
|
/******/ (() => {
|
|
12776
12806
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
12777
12807
|
/******/ __webpack_require__.n = (module) => {
|
|
12778
|
-
/******/
|
|
12808
|
+
/******/ const getter = module && module.__esModule ?
|
|
12779
12809
|
/******/ () => (module['default']) :
|
|
12780
12810
|
/******/ () => (module);
|
|
12781
12811
|
/******/ __webpack_require__.d(getter, { a: getter });
|
|
@@ -12785,11 +12815,26 @@ function enterFragments(mounts, ranges) {
|
|
|
12785
12815
|
/******/
|
|
12786
12816
|
/******/ /* webpack/runtime/define property getters */
|
|
12787
12817
|
/******/ (() => {
|
|
12788
|
-
/******/ // define getter functions for harmony exports
|
|
12818
|
+
/******/ // define getter/value functions for harmony exports
|
|
12789
12819
|
/******/ __webpack_require__.d = (exports, definition) => {
|
|
12790
|
-
/******/
|
|
12791
|
-
/******/
|
|
12792
|
-
/******/
|
|
12820
|
+
/******/ if(Array.isArray(definition)) {
|
|
12821
|
+
/******/ var i = 0;
|
|
12822
|
+
/******/ while(i < definition.length) {
|
|
12823
|
+
/******/ var key = definition[i++];
|
|
12824
|
+
/******/ var binding = definition[i++];
|
|
12825
|
+
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
12826
|
+
/******/ if(binding === 0) {
|
|
12827
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
12828
|
+
/******/ } else {
|
|
12829
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
12830
|
+
/******/ }
|
|
12831
|
+
/******/ } else if(binding === 0) { i++; }
|
|
12832
|
+
/******/ }
|
|
12833
|
+
/******/ } else {
|
|
12834
|
+
/******/ for(var key in definition) {
|
|
12835
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
12836
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
12837
|
+
/******/ }
|
|
12793
12838
|
/******/ }
|
|
12794
12839
|
/******/ }
|
|
12795
12840
|
/******/ };
|
|
@@ -12804,7 +12849,7 @@ function enterFragments(mounts, ranges) {
|
|
|
12804
12849
|
/******/ (() => {
|
|
12805
12850
|
/******/ // define __esModule on exports
|
|
12806
12851
|
/******/ __webpack_require__.r = (exports) => {
|
|
12807
|
-
/******/ if(
|
|
12852
|
+
/******/ if(Symbol.toStringTag) {
|
|
12808
12853
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
12809
12854
|
/******/ }
|
|
12810
12855
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -12812,12 +12857,11 @@ function enterFragments(mounts, ranges) {
|
|
|
12812
12857
|
/******/ })();
|
|
12813
12858
|
/******/
|
|
12814
12859
|
/************************************************************************/
|
|
12815
|
-
|
|
12860
|
+
let __webpack_exports__ = {};
|
|
12816
12861
|
__webpack_require__.r(__webpack_exports__);
|
|
12817
12862
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12818
12863
|
/* harmony export */ ExternalChange: () => (/* reexport safe */ _useCodeMirror__WEBPACK_IMPORTED_MODULE_3__.Q),
|
|
12819
12864
|
/* harmony export */ basicSetup: () => (/* reexport safe */ _uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_7__.o),
|
|
12820
|
-
/* harmony export */ "default": () => (src),
|
|
12821
12865
|
/* harmony export */ getStatistics: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.m),
|
|
12822
12866
|
/* harmony export */ minimalSetup: () => (/* reexport safe */ _uiw_codemirror_extensions_basic_setup__WEBPACK_IMPORTED_MODULE_7__.V),
|
|
12823
12867
|
/* harmony export */ useCodeMirror: () => (/* reexport safe */ _useCodeMirror__WEBPACK_IMPORTED_MODULE_3__.q)
|
|
@@ -12826,7 +12870,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12826
12870
|
/* harmony import */ var _home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(644);
|
|
12827
12871
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(442);
|
|
12828
12872
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
12829
|
-
/* harmony import */ var _useCodeMirror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
12873
|
+
/* harmony import */ var _useCodeMirror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(637);
|
|
12830
12874
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(742);
|
|
12831
12875
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
|
|
12832
12876
|
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(730);
|
|
@@ -12847,6 +12891,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12847
12891
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(369);
|
|
12848
12892
|
var _excluded=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"];var ReactCodeMirror=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function(props,ref){var className=props.className,_props$value=props.value,value=_props$value===void 0?'':_props$value,selection=props.selection,_props$extensions=props.extensions,extensions=_props$extensions===void 0?[]:_props$extensions,onChange=props.onChange,onStatistics=props.onStatistics,onCreateEditor=props.onCreateEditor,onUpdate=props.onUpdate,autoFocus=props.autoFocus,_props$theme=props.theme,theme=_props$theme===void 0?'light':_props$theme,height=props.height,minHeight=props.minHeight,maxHeight=props.maxHeight,width=props.width,minWidth=props.minWidth,maxWidth=props.maxWidth,basicSetup=props.basicSetup,placeholder=props.placeholder,indentWithTab=props.indentWithTab,editable=props.editable,readOnly=props.readOnly,root=props.root,initialState=props.initialState,other=(0,_home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(props,_excluded);var editor=(0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);var _useCodeMirror=(0,_useCodeMirror__WEBPACK_IMPORTED_MODULE_3__/* .useCodeMirror */ .q)({root:root,value:value,autoFocus:autoFocus,theme:theme,height:height,minHeight:minHeight,maxHeight:maxHeight,width:width,minWidth:minWidth,maxWidth:maxWidth,basicSetup:basicSetup,placeholder:placeholder,indentWithTab:indentWithTab,editable:editable,readOnly:readOnly,selection:selection,onChange:onChange,onStatistics:onStatistics,onCreateEditor:onCreateEditor,onUpdate:onUpdate,extensions:extensions,initialState:initialState}),state=_useCodeMirror.state,view=_useCodeMirror.view,container=_useCodeMirror.container,setContainer=_useCodeMirror.setContainer;(0,react__WEBPACK_IMPORTED_MODULE_2__.useImperativeHandle)(ref,function(){return{editor:editor.current,state:state,view:view};},[editor,container,state,view]);var setEditorRef=(0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function(el){editor.current=el;setContainer(el);},[setContainer]);// check type of value
|
|
12849
12893
|
if(typeof value!=='string'){throw new Error("value must be typeof string but got ".concat(typeof value));}var defaultClassNames=typeof theme==='string'?"cm-theme-".concat(theme):'cm-theme';return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",(0,_home_runner_work_react_codemirror_react_codemirror_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)({ref:setEditorRef,className:"".concat(defaultClassNames).concat(className?" ".concat(className):'')},other));});ReactCodeMirror.displayName='CodeMirror';/* harmony default export */ const src = (ReactCodeMirror);
|
|
12894
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
12895
|
+
/* harmony export */ "default", 0, /* export default binding */ src
|
|
12896
|
+
/* harmony export */ ]);
|
|
12897
|
+
|
|
12850
12898
|
/******/ return __webpack_exports__;
|
|
12851
12899
|
/******/ })()
|
|
12852
12900
|
;
|