@cubejs-backend/server-core 0.34.48 → 0.34.50
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/package.json +6 -6
- package/playground/assets/{CachePane-aeb1434a.js → CachePane-cea5a516.js} +1 -1
- package/playground/assets/{GraphiQLSandbox-5d01643e.js → GraphiQLSandbox-6aa9130e.js} +2 -2
- package/playground/assets/{SchemaReference-440f36cb.js → SchemaReference-b752cf73.js} +1 -1
- package/playground/assets/{SqlQueryTab-083c8bef.js → SqlQueryTab-fbc2609e.js} +1 -1
- package/playground/assets/{brace-fold-95aacab3.js → brace-fold-b4f9baf0.js} +1 -1
- package/playground/assets/{closebrackets-636b3872.js → closebrackets-9e47d990.js} +1 -1
- package/playground/assets/{codemirror-bd4e751c.js → codemirror-ed470cdd.js} +1 -1
- package/playground/assets/{comment-741261ca.js → comment-fc548bea.js} +1 -1
- package/playground/assets/{dialog-ad7b11cb.js → dialog-977ef32c.js} +1 -1
- package/playground/assets/{dialog-2b4556fb.js → dialog-fd80324d.js} +1 -1
- package/playground/assets/{foldgutter-4e81c6cb.js → foldgutter-27bc3667.js} +1 -1
- package/playground/assets/{hint-4270a64e.js → hint-44a4e89d.js} +1 -1
- package/playground/assets/{hint-fa1b3e8a.js → hint-d83354f4.js} +1 -1
- package/playground/assets/{index-85c5343c.js → index-4af20da0.js} +52 -49
- package/playground/assets/{index-87161fa1.js → index-68e2529d.js} +1 -1
- package/playground/assets/{index-22beca08.js → index-f40fb76d.js} +1 -1
- package/playground/assets/{info-ea43908f.js → info-6b723de1.js} +1 -1
- package/playground/assets/{info-addon-64fb03a1.js → info-addon-831264d6.js} +1 -1
- package/playground/assets/{javascript-f03c3e75.js → javascript-6a931b32.js} +1 -1
- package/playground/assets/{jump-0648d51a.js → jump-6eae08f2.js} +1 -1
- package/playground/assets/{jump-to-line-1e79fddb.js → jump-to-line-4af2f1de.js} +1 -1
- package/playground/assets/{lint-e090cdf8.js → lint-8558f383.js} +1 -1
- package/playground/assets/{lint-bc8ae2d9.js → lint-c485838c.js} +1 -1
- package/playground/assets/{lint-4056022c.js → lint-c6ecafc7.js} +1 -1
- package/playground/assets/matchbrackets-0aeb0f60.js +1 -0
- package/playground/assets/matchbrackets-75cad4c4.js +1 -0
- package/playground/assets/{mode-da7e533d.js → mode-0a2421fc.js} +1 -1
- package/playground/assets/{mode-b5f1d3a4.js → mode-be3e2893.js} +1 -1
- package/playground/assets/{mode-de3714ba.js → mode-ce7728ad.js} +1 -1
- package/playground/assets/{search-b228d6bf.js → search-d9211cb8.js} +1 -1
- package/playground/assets/{searchcursor-30acddbf.js → searchcursor-7479bf4b.js} +1 -1
- package/playground/assets/{searchcursor-fb41d04c.js → searchcursor-831b5fe6.js} +1 -1
- package/playground/assets/{show-hint-c704cd4c.js → show-hint-886926eb.js} +1 -1
- package/playground/assets/{sublime-ecc69bfb.js → sublime-5ed64a0c.js} +3 -3
- package/playground/index.html +1 -1
- package/playground/assets/matchbrackets-d9fe0115.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as ot}from"./index-85c5343c.js";import{a as rt}from"./codemirror-bd4e751c.js";function ct(x,I){for(var r=0;r<I.length;r++){const y=I[r];if(typeof y!="string"&&!Array.isArray(y)){for(const m in y)if(m!=="default"&&!(m in x)){const w=Object.getOwnPropertyDescriptor(y,m);w&&Object.defineProperty(x,m,w.get?w:{enumerable:!0,get:()=>y[m]})}}}return Object.freeze(Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}))}var lt={exports:{}};(function(x,I){(function(r){r(rt)})(function(r){var y="CodeMirror-hint",m="CodeMirror-hint-active";r.showHint=function(t,e,i){if(!e)return t.showHint(i);i&&i.async&&(e.async=!0);var n={hint:e};if(i)for(var s in i)n[s]=i[s];return t.showHint(n)},r.defineExtension("showHint",function(t){t=Q(this,this.getCursor("start"),t);var e=this.listSelections();if(!(e.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var i=0;i<e.length;i++)if(e[i].head.line!=e[i].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var n=this.state.completionActive=new w(this,t);n.options.hint&&(r.signal(this,"startCompletion",this),n.update(!0))}}),r.defineExtension("closeHint",function(){this.state.completionActive&&this.state.completionActive.close()});function w(t,e){if(this.cm=t,this.options=e,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var i=this;t.on("cursorActivity",this.activityFunc=function(){i.cursorActivity()})}}var G=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},J=window.cancelAnimationFrame||clearTimeout;w.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&r.signal(this.data,"close"),this.widget&&this.widget.close(),r.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,e){var i=t.list[e],n=this;this.cm.operation(function(){i.hint?i.hint(n.cm,t,i):n.cm.replaceRange(R(i),i.from||t.from,i.to||t.to,"complete"),r.signal(t,"pick",i),n.cm.scrollIntoView()}),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(J(this.debounce),this.debounce=0);var t=this.startPos;this.data&&(t=this.data.from);var e=this.cm.getCursor(),i=this.cm.getLine(e.line);if(e.line!=this.startPos.line||i.length-e.ch!=this.startLen-this.startPos.ch||e.ch<t.ch||this.cm.somethingSelected()||!e.ch||this.options.closeCharacters.test(i.charAt(e.ch-1)))this.close();else{var n=this;this.debounce=G(function(){n.update()}),this.widget&&this.widget.disable()}},update:function(t){if(this.tick!=null){var e=this,i=++this.tick;K(this.options.hint,this.cm,this.options,function(n){e.tick==i&&e.finishUpdate(n,t)})}},finishUpdate:function(t,e){this.data&&r.signal(this.data,"update");var i=this.widget&&this.widget.picked||e&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=t,t&&t.list.length&&(i&&t.list.length==1?this.pick(t,0):(this.widget=new B(this,t),r.signal(t,"shown")))}};function Q(t,e,i){var n=t.options.hintOptions,s={};for(var c in U)s[c]=U[c];if(n)for(var c in n)n[c]!==void 0&&(s[c]=n[c]);if(i)for(var c in i)i[c]!==void 0&&(s[c]=i[c]);return s.hint.resolve&&(s.hint=s.hint.resolve(t,e)),s}function R(t){return typeof t=="string"?t:t.text}function Z(t,e){var i={Up:function(){e.moveFocus(-1)},Down:function(){e.moveFocus(1)},PageUp:function(){e.moveFocus(-e.menuSize()+1,!0)},PageDown:function(){e.moveFocus(e.menuSize()-1,!0)},Home:function(){e.setFocus(0)},End:function(){e.setFocus(e.length-1)},Enter:e.pick,Tab:e.pick,Esc:e.close},n=/Mac/.test(navigator.platform);n&&(i["Ctrl-P"]=function(){e.moveFocus(-1)},i["Ctrl-N"]=function(){e.moveFocus(1)});var s=t.options.customKeys,c=s?{}:i;function o(u,l){var h;typeof l!="string"?h=function(H){return l(H,e)}:i.hasOwnProperty(l)?h=i[l]:h=l,c[u]=h}if(s)for(var f in s)s.hasOwnProperty(f)&&o(f,s[f]);var a=t.options.extraKeys;if(a)for(var f in a)a.hasOwnProperty(f)&&o(f,a[f]);return c}function _(t,e){for(;e&&e!=t;){if(e.nodeName.toUpperCase()==="LI"&&e.parentNode==t)return e;e=e.parentNode}}function B(t,e){this.id="cm-complete-"+Math.floor(Math.random(1e6)),this.completion=t,this.data=e,this.picked=!1;var i=this,n=t.cm,s=n.getInputField().ownerDocument,c=s.defaultView||s.parentWindow,o=this.hints=s.createElement("ul");o.setAttribute("role","listbox"),o.setAttribute("aria-expanded","true"),o.id=this.id;var f=t.cm.options.theme;o.className="CodeMirror-hints "+f,this.selectedHint=e.selectedHint||0;for(var a=e.list,u=0;u<a.length;++u){var l=o.appendChild(s.createElement("li")),h=a[u],H=y+(u!=this.selectedHint?"":" "+m);h.className!=null&&(H=h.className+" "+H),l.className=H,u==this.selectedHint&&l.setAttribute("aria-selected","true"),l.id=this.id+"-"+u,l.setAttribute("role","option"),h.render?h.render(l,e,h):l.appendChild(s.createTextNode(h.displayText||R(h))),l.hintId=u}var b=t.options.container||s.body,v=n.cursorCoords(t.options.alignWithWord?e.from:null),S=v.left,T=v.bottom,D=!0,k=0,O=0;if(b!==s.body){var it=["absolute","relative","fixed"].indexOf(c.getComputedStyle(b).position)!==-1,C=it?b:b.offsetParent,j=C.getBoundingClientRect(),M=s.body.getBoundingClientRect();k=j.left-M.left-C.scrollLeft,O=j.top-M.top-C.scrollTop}o.style.left=S-k+"px",o.style.top=T-O+"px";var F=c.innerWidth||Math.max(s.body.offsetWidth,s.documentElement.offsetWidth),W=c.innerHeight||Math.max(s.body.offsetHeight,s.documentElement.offsetHeight);b.appendChild(o),n.getInputField().setAttribute("aria-autocomplete","list"),n.getInputField().setAttribute("aria-owns",this.id),n.getInputField().setAttribute("aria-activedescendant",this.id+"-"+this.selectedHint);var g=t.options.moveOnOverlap?o.getBoundingClientRect():new DOMRect,z=t.options.paddingForScrollbar?o.scrollHeight>o.clientHeight+1:!1,A;setTimeout(function(){A=n.getScrollInfo()});var nt=g.bottom-W;if(nt>0){var L=g.bottom-g.top,st=v.top-(v.bottom-g.top);if(st-L>0)o.style.top=(T=v.top-L-O)+"px",D=!1;else if(L>W){o.style.height=W-5+"px",o.style.top=(T=v.bottom-g.top-O)+"px";var V=n.getCursor();e.from.ch!=V.ch&&(v=n.cursorCoords(V),o.style.left=(S=v.left-k)+"px",g=o.getBoundingClientRect())}}var E=g.right-F;if(z&&(E+=n.display.nativeBarWidth),E>0&&(g.right-g.left>F&&(o.style.width=F-5+"px",E-=g.right-g.left-F),o.style.left=(S=v.left-E-k)+"px"),z)for(var N=o.firstChild;N;N=N.nextSibling)N.style.paddingRight=n.display.nativeBarWidth+"px";if(n.addKeyMap(this.keyMap=Z(t,{moveFocus:function(p,d){i.changeActive(i.selectedHint+p,d)},setFocus:function(p){i.changeActive(p)},menuSize:function(){return i.screenAmount()},length:a.length,close:function(){t.close()},pick:function(){i.pick()},data:e})),t.options.closeOnUnfocus){var q;n.on("blur",this.onBlur=function(){q=setTimeout(function(){t.close()},100)}),n.on("focus",this.onFocus=function(){clearTimeout(q)})}n.on("scroll",this.onScroll=function(){var p=n.getScrollInfo(),d=n.getWrapperElement().getBoundingClientRect();A||(A=n.getScrollInfo());var $=T+A.top-p.top,P=$-(c.pageYOffset||(s.documentElement||s.body).scrollTop);if(D||(P+=o.offsetHeight),P<=d.top||P>=d.bottom)return t.close();o.style.top=$+"px",o.style.left=S+A.left-p.left+"px"}),r.on(o,"dblclick",function(p){var d=_(o,p.target||p.srcElement);d&&d.hintId!=null&&(i.changeActive(d.hintId),i.pick())}),r.on(o,"click",function(p){var d=_(o,p.target||p.srcElement);d&&d.hintId!=null&&(i.changeActive(d.hintId),t.options.completeOnSingleClick&&i.pick())}),r.on(o,"mousedown",function(){setTimeout(function(){n.focus()},20)});var Y=this.getSelectedHintRange();return(Y.from!==0||Y.to!==0)&&this.scrollToActive(),r.signal(e,"select",a[this.selectedHint],o.childNodes[this.selectedHint]),!0}B.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm.getInputField();t.removeAttribute("aria-activedescendant"),t.removeAttribute("aria-owns");var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,e){if(t>=this.data.list.length?t=e?this.data.list.length-1:0:t<0&&(t=e?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" "+m,""),i.removeAttribute("aria-selected")),i=this.hints.childNodes[this.selectedHint=t],i.className+=" "+m,i.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",i.id),this.scrollToActive(),r.signal(this.data,"select",this.data.list[this.selectedHint],i)}},scrollToActive:function(){var t=this.getSelectedHintRange(),e=this.hints.childNodes[t.from],i=this.hints.childNodes[t.to],n=this.hints.firstChild;e.offsetTop<this.hints.scrollTop?this.hints.scrollTop=e.offsetTop-n.offsetTop:i.offsetTop+i.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+n.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var t=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-t),to:Math.min(this.data.list.length-1,this.selectedHint+t)}}};function tt(t,e){if(!t.somethingSelected())return e;for(var i=[],n=0;n<e.length;n++)e[n].supportsSelection&&i.push(e[n]);return i}function K(t,e,i,n){if(t.async)t(e,n,i);else{var s=t(e,i);s&&s.then?s.then(n):n(s)}}function et(t,e){var i=t.getHelpers(e,"hint"),n;if(i.length){var s=function(c,o,f){var a=tt(c,i);function u(l){if(l==a.length)return o(null);K(a[l],c,f,function(h){h&&h.list.length>0?o(h):u(l+1)})}u(0)};return s.async=!0,s.supportsSelection=!0,s}else return(n=t.getHelper(t.getCursor(),"hintWords"))?function(c){return r.hint.fromList(c,{words:n})}:r.hint.anyword?function(c,o){return r.hint.anyword(c,o)}:function(){}}r.registerHelper("hint","auto",{resolve:et}),r.registerHelper("hint","fromList",function(t,e){var i=t.getCursor(),n=t.getTokenAt(i),s,c=r.Pos(i.line,n.start),o=i;n.start<i.ch&&/\w/.test(n.string.charAt(i.ch-n.start-1))?s=n.string.substr(0,i.ch-n.start):(s="",c=i);for(var f=[],a=0;a<e.words.length;a++){var u=e.words[a];u.slice(0,s.length)==s&&f.push(u)}if(f.length)return{list:f,from:c,to:o}}),r.commands.autocomplete=r.showHint;var U={hint:r.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};r.defineOption("hintOptions",null)})})();var X=lt.exports;const at=ot(X),ut=ct({__proto__:null,default:at},[X]);export{ut as s};
|
|
1
|
+
import{g as ot}from"./index-4af20da0.js";import{a as rt}from"./codemirror-ed470cdd.js";function ct(x,I){for(var r=0;r<I.length;r++){const y=I[r];if(typeof y!="string"&&!Array.isArray(y)){for(const m in y)if(m!=="default"&&!(m in x)){const w=Object.getOwnPropertyDescriptor(y,m);w&&Object.defineProperty(x,m,w.get?w:{enumerable:!0,get:()=>y[m]})}}}return Object.freeze(Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}))}var lt={exports:{}};(function(x,I){(function(r){r(rt)})(function(r){var y="CodeMirror-hint",m="CodeMirror-hint-active";r.showHint=function(t,e,i){if(!e)return t.showHint(i);i&&i.async&&(e.async=!0);var n={hint:e};if(i)for(var s in i)n[s]=i[s];return t.showHint(n)},r.defineExtension("showHint",function(t){t=Q(this,this.getCursor("start"),t);var e=this.listSelections();if(!(e.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var i=0;i<e.length;i++)if(e[i].head.line!=e[i].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var n=this.state.completionActive=new w(this,t);n.options.hint&&(r.signal(this,"startCompletion",this),n.update(!0))}}),r.defineExtension("closeHint",function(){this.state.completionActive&&this.state.completionActive.close()});function w(t,e){if(this.cm=t,this.options=e,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var i=this;t.on("cursorActivity",this.activityFunc=function(){i.cursorActivity()})}}var G=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},J=window.cancelAnimationFrame||clearTimeout;w.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&r.signal(this.data,"close"),this.widget&&this.widget.close(),r.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,e){var i=t.list[e],n=this;this.cm.operation(function(){i.hint?i.hint(n.cm,t,i):n.cm.replaceRange(R(i),i.from||t.from,i.to||t.to,"complete"),r.signal(t,"pick",i),n.cm.scrollIntoView()}),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(J(this.debounce),this.debounce=0);var t=this.startPos;this.data&&(t=this.data.from);var e=this.cm.getCursor(),i=this.cm.getLine(e.line);if(e.line!=this.startPos.line||i.length-e.ch!=this.startLen-this.startPos.ch||e.ch<t.ch||this.cm.somethingSelected()||!e.ch||this.options.closeCharacters.test(i.charAt(e.ch-1)))this.close();else{var n=this;this.debounce=G(function(){n.update()}),this.widget&&this.widget.disable()}},update:function(t){if(this.tick!=null){var e=this,i=++this.tick;K(this.options.hint,this.cm,this.options,function(n){e.tick==i&&e.finishUpdate(n,t)})}},finishUpdate:function(t,e){this.data&&r.signal(this.data,"update");var i=this.widget&&this.widget.picked||e&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=t,t&&t.list.length&&(i&&t.list.length==1?this.pick(t,0):(this.widget=new B(this,t),r.signal(t,"shown")))}};function Q(t,e,i){var n=t.options.hintOptions,s={};for(var c in U)s[c]=U[c];if(n)for(var c in n)n[c]!==void 0&&(s[c]=n[c]);if(i)for(var c in i)i[c]!==void 0&&(s[c]=i[c]);return s.hint.resolve&&(s.hint=s.hint.resolve(t,e)),s}function R(t){return typeof t=="string"?t:t.text}function Z(t,e){var i={Up:function(){e.moveFocus(-1)},Down:function(){e.moveFocus(1)},PageUp:function(){e.moveFocus(-e.menuSize()+1,!0)},PageDown:function(){e.moveFocus(e.menuSize()-1,!0)},Home:function(){e.setFocus(0)},End:function(){e.setFocus(e.length-1)},Enter:e.pick,Tab:e.pick,Esc:e.close},n=/Mac/.test(navigator.platform);n&&(i["Ctrl-P"]=function(){e.moveFocus(-1)},i["Ctrl-N"]=function(){e.moveFocus(1)});var s=t.options.customKeys,c=s?{}:i;function o(u,l){var h;typeof l!="string"?h=function(H){return l(H,e)}:i.hasOwnProperty(l)?h=i[l]:h=l,c[u]=h}if(s)for(var f in s)s.hasOwnProperty(f)&&o(f,s[f]);var a=t.options.extraKeys;if(a)for(var f in a)a.hasOwnProperty(f)&&o(f,a[f]);return c}function _(t,e){for(;e&&e!=t;){if(e.nodeName.toUpperCase()==="LI"&&e.parentNode==t)return e;e=e.parentNode}}function B(t,e){this.id="cm-complete-"+Math.floor(Math.random(1e6)),this.completion=t,this.data=e,this.picked=!1;var i=this,n=t.cm,s=n.getInputField().ownerDocument,c=s.defaultView||s.parentWindow,o=this.hints=s.createElement("ul");o.setAttribute("role","listbox"),o.setAttribute("aria-expanded","true"),o.id=this.id;var f=t.cm.options.theme;o.className="CodeMirror-hints "+f,this.selectedHint=e.selectedHint||0;for(var a=e.list,u=0;u<a.length;++u){var l=o.appendChild(s.createElement("li")),h=a[u],H=y+(u!=this.selectedHint?"":" "+m);h.className!=null&&(H=h.className+" "+H),l.className=H,u==this.selectedHint&&l.setAttribute("aria-selected","true"),l.id=this.id+"-"+u,l.setAttribute("role","option"),h.render?h.render(l,e,h):l.appendChild(s.createTextNode(h.displayText||R(h))),l.hintId=u}var b=t.options.container||s.body,v=n.cursorCoords(t.options.alignWithWord?e.from:null),S=v.left,T=v.bottom,D=!0,k=0,O=0;if(b!==s.body){var it=["absolute","relative","fixed"].indexOf(c.getComputedStyle(b).position)!==-1,C=it?b:b.offsetParent,j=C.getBoundingClientRect(),M=s.body.getBoundingClientRect();k=j.left-M.left-C.scrollLeft,O=j.top-M.top-C.scrollTop}o.style.left=S-k+"px",o.style.top=T-O+"px";var F=c.innerWidth||Math.max(s.body.offsetWidth,s.documentElement.offsetWidth),W=c.innerHeight||Math.max(s.body.offsetHeight,s.documentElement.offsetHeight);b.appendChild(o),n.getInputField().setAttribute("aria-autocomplete","list"),n.getInputField().setAttribute("aria-owns",this.id),n.getInputField().setAttribute("aria-activedescendant",this.id+"-"+this.selectedHint);var g=t.options.moveOnOverlap?o.getBoundingClientRect():new DOMRect,z=t.options.paddingForScrollbar?o.scrollHeight>o.clientHeight+1:!1,A;setTimeout(function(){A=n.getScrollInfo()});var nt=g.bottom-W;if(nt>0){var L=g.bottom-g.top,st=v.top-(v.bottom-g.top);if(st-L>0)o.style.top=(T=v.top-L-O)+"px",D=!1;else if(L>W){o.style.height=W-5+"px",o.style.top=(T=v.bottom-g.top-O)+"px";var V=n.getCursor();e.from.ch!=V.ch&&(v=n.cursorCoords(V),o.style.left=(S=v.left-k)+"px",g=o.getBoundingClientRect())}}var E=g.right-F;if(z&&(E+=n.display.nativeBarWidth),E>0&&(g.right-g.left>F&&(o.style.width=F-5+"px",E-=g.right-g.left-F),o.style.left=(S=v.left-E-k)+"px"),z)for(var N=o.firstChild;N;N=N.nextSibling)N.style.paddingRight=n.display.nativeBarWidth+"px";if(n.addKeyMap(this.keyMap=Z(t,{moveFocus:function(p,d){i.changeActive(i.selectedHint+p,d)},setFocus:function(p){i.changeActive(p)},menuSize:function(){return i.screenAmount()},length:a.length,close:function(){t.close()},pick:function(){i.pick()},data:e})),t.options.closeOnUnfocus){var q;n.on("blur",this.onBlur=function(){q=setTimeout(function(){t.close()},100)}),n.on("focus",this.onFocus=function(){clearTimeout(q)})}n.on("scroll",this.onScroll=function(){var p=n.getScrollInfo(),d=n.getWrapperElement().getBoundingClientRect();A||(A=n.getScrollInfo());var $=T+A.top-p.top,P=$-(c.pageYOffset||(s.documentElement||s.body).scrollTop);if(D||(P+=o.offsetHeight),P<=d.top||P>=d.bottom)return t.close();o.style.top=$+"px",o.style.left=S+A.left-p.left+"px"}),r.on(o,"dblclick",function(p){var d=_(o,p.target||p.srcElement);d&&d.hintId!=null&&(i.changeActive(d.hintId),i.pick())}),r.on(o,"click",function(p){var d=_(o,p.target||p.srcElement);d&&d.hintId!=null&&(i.changeActive(d.hintId),t.options.completeOnSingleClick&&i.pick())}),r.on(o,"mousedown",function(){setTimeout(function(){n.focus()},20)});var Y=this.getSelectedHintRange();return(Y.from!==0||Y.to!==0)&&this.scrollToActive(),r.signal(e,"select",a[this.selectedHint],o.childNodes[this.selectedHint]),!0}B.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var t=this.completion.cm.getInputField();t.removeAttribute("aria-activedescendant"),t.removeAttribute("aria-owns");var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,e){if(t>=this.data.list.length?t=e?this.data.list.length-1:0:t<0&&(t=e?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" "+m,""),i.removeAttribute("aria-selected")),i=this.hints.childNodes[this.selectedHint=t],i.className+=" "+m,i.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",i.id),this.scrollToActive(),r.signal(this.data,"select",this.data.list[this.selectedHint],i)}},scrollToActive:function(){var t=this.getSelectedHintRange(),e=this.hints.childNodes[t.from],i=this.hints.childNodes[t.to],n=this.hints.firstChild;e.offsetTop<this.hints.scrollTop?this.hints.scrollTop=e.offsetTop-n.offsetTop:i.offsetTop+i.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+n.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var t=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-t),to:Math.min(this.data.list.length-1,this.selectedHint+t)}}};function tt(t,e){if(!t.somethingSelected())return e;for(var i=[],n=0;n<e.length;n++)e[n].supportsSelection&&i.push(e[n]);return i}function K(t,e,i,n){if(t.async)t(e,n,i);else{var s=t(e,i);s&&s.then?s.then(n):n(s)}}function et(t,e){var i=t.getHelpers(e,"hint"),n;if(i.length){var s=function(c,o,f){var a=tt(c,i);function u(l){if(l==a.length)return o(null);K(a[l],c,f,function(h){h&&h.list.length>0?o(h):u(l+1)})}u(0)};return s.async=!0,s.supportsSelection=!0,s}else return(n=t.getHelper(t.getCursor(),"hintWords"))?function(c){return r.hint.fromList(c,{words:n})}:r.hint.anyword?function(c,o){return r.hint.anyword(c,o)}:function(){}}r.registerHelper("hint","auto",{resolve:et}),r.registerHelper("hint","fromList",function(t,e){var i=t.getCursor(),n=t.getTokenAt(i),s,c=r.Pos(i.line,n.start),o=i;n.start<i.ch&&/\w/.test(n.string.charAt(i.ch-n.start-1))?s=n.string.substr(0,i.ch-n.start):(s="",c=i);for(var f=[],a=0;a<e.words.length;a++){var u=e.words[a];u.slice(0,s.length)==s&&f.push(u)}if(f.length)return{list:f,from:c,to:o}}),r.commands.autocomplete=r.showHint;var U={hint:r.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};r.defineOption("hintOptions",null)})})();var X=lt.exports;const at=ot(X),ut=ct({__proto__:null,default:at},[X]);export{ut as s};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{g as V}from"./index-
|
|
2
|
-
`,s,null,"+insertLine"),e.indentLine(s.line,null,!0),r.push({head:s,anchor:s}),l=o.line+1}}e.setSelections(r)}),e.execCommand("indentAuto")}a.insertLineAfter=function(e){return F(e,!1)},a.insertLineBefore=function(e){return F(e,!0)};function R(e,t){for(var n=t.ch,r=n,l=e.getLine(t.line);n&&h.isWordChar(l.charAt(n-1));)--n;for(;r<l.length&&h.isWordChar(l.charAt(r));)++r;return{from:f(t.line,n),to:f(t.line,r),word:l.slice(n,r)}}a.selectNextOccurrence=function(e){var t=e.getCursor("from"),n=e.getCursor("to"),r=e.state.sublimeFindFullWord==e.doc.sel;if(h.cmpPos(t,n)==0){var l=R(e,t);if(!l.word)return;e.setSelection(l.from,l.to),r=!0}else{var i=e.getRange(t,n),o=r?new RegExp("\\b"+i+"\\b"):i,s=e.getSearchCursor(o,n),u=s.findNext();if(u||(s=e.getSearchCursor(o,f(e.firstLine(),0)),u=s.findNext()),!u||
|
|
1
|
+
import{g as V}from"./index-4af20da0.js";import{a as _}from"./codemirror-ed470cdd.js";import{r as q}from"./searchcursor-831b5fe6.js";import{r as Y}from"./matchbrackets-0aeb0f60.js";function z(w,A){for(var h=0;h<A.length;h++){const a=A[h];if(typeof a!="string"&&!Array.isArray(a)){for(const f in a)if(f!=="default"&&!(f in w)){const b=Object.getOwnPropertyDescriptor(a,f);b&&Object.defineProperty(w,f,b.get?b:{enumerable:!0,get:()=>a[f]})}}}return Object.freeze(Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}))}var J={exports:{}};(function(w,A){(function(h){h(_,q(),Y())})(function(h){var a=h.commands,f=h.Pos;function b(e,t,n){if(n<0&&t.ch==0)return e.clipPos(f(t.line-1));var r=e.getLine(t.line);if(n>0&&t.ch>=r.length)return e.clipPos(f(t.line+1,0));for(var l="start",i,o=t.ch,s=o,u=n<0?0:r.length,d=0;s!=u;s+=n,d++){var p=r.charAt(n<0?s-1:s),c=p!="_"&&h.isWordChar(p)?"w":"o";if(c=="w"&&p.toUpperCase()==p&&(c="W"),l=="start")c!="o"?(l="in",i=c):o=s+n;else if(l=="in"&&i!=c){if(i=="w"&&c=="W"&&n<0&&s--,i=="W"&&c=="w"&&n>0)if(s==o+1){i="w";continue}else s--;break}}return f(t.line,s)}function K(e,t){e.extendSelectionsBy(function(n){return e.display.shift||e.doc.extend||n.empty()?b(e.doc,n.head,t):t<0?n.from():n.to()})}a.goSubwordLeft=function(e){K(e,-1)},a.goSubwordRight=function(e){K(e,1)},a.scrollLineUp=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},a.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},a.splitSelectionByLine=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)for(var l=t[r].from(),i=t[r].to(),o=l.line;o<=i.line;++o)i.line>l.line&&o==i.line&&i.ch==0||n.push({anchor:o==l.line?l:f(o,0),head:o==i.line?i:f(o)});e.setSelections(n,0)},a.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},a.selectLine=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var l=t[r];n.push({anchor:f(l.from().line,0),head:f(l.to().line+1,0)})}e.setSelections(n)};function F(e,t){if(e.isReadOnly())return h.Pass;e.operation(function(){for(var n=e.listSelections().length,r=[],l=-1,i=0;i<n;i++){var o=e.listSelections()[i].head;if(!(o.line<=l)){var s=f(o.line+(t?0:1),0);e.replaceRange(`
|
|
2
|
+
`,s,null,"+insertLine"),e.indentLine(s.line,null,!0),r.push({head:s,anchor:s}),l=o.line+1}}e.setSelections(r)}),e.execCommand("indentAuto")}a.insertLineAfter=function(e){return F(e,!1)},a.insertLineBefore=function(e){return F(e,!0)};function R(e,t){for(var n=t.ch,r=n,l=e.getLine(t.line);n&&h.isWordChar(l.charAt(n-1));)--n;for(;r<l.length&&h.isWordChar(l.charAt(r));)++r;return{from:f(t.line,n),to:f(t.line,r),word:l.slice(n,r)}}a.selectNextOccurrence=function(e){var t=e.getCursor("from"),n=e.getCursor("to"),r=e.state.sublimeFindFullWord==e.doc.sel;if(h.cmpPos(t,n)==0){var l=R(e,t);if(!l.word)return;e.setSelection(l.from,l.to),r=!0}else{var i=e.getRange(t,n),o=r?new RegExp("\\b"+i+"\\b"):i,s=e.getSearchCursor(o,n),u=s.findNext();if(u||(s=e.getSearchCursor(o,f(e.firstLine(),0)),u=s.findNext()),!u||E(e.listSelections(),s.from(),s.to()))return;e.addSelection(s.from(),s.to())}r&&(e.state.sublimeFindFullWord=e.doc.sel)},a.skipAndSelectNextOccurrence=function(e){var t=e.getCursor("anchor"),n=e.getCursor("head");a.selectNextOccurrence(e),h.cmpPos(t,n)!=0&&e.doc.setSelections(e.doc.listSelections().filter(function(r){return r.anchor!=t||r.head!=n}))};function T(e,t){for(var n=e.listSelections(),r=[],l=0;l<n.length;l++){var i=n[l],o=e.findPosV(i.anchor,t,"line",i.anchor.goalColumn),s=e.findPosV(i.head,t,"line",i.head.goalColumn);o.goalColumn=i.anchor.goalColumn!=null?i.anchor.goalColumn:e.cursorCoords(i.anchor,"div").left,s.goalColumn=i.head.goalColumn!=null?i.head.goalColumn:e.cursorCoords(i.head,"div").left;var u={anchor:o,head:s};r.push(i),r.push(u)}e.setSelections(r)}a.addCursorToPrevLine=function(e){T(e,-1)},a.addCursorToNextLine=function(e){T(e,1)};function E(e,t,n){for(var r=0;r<e.length;r++)if(h.cmpPos(e[r].from(),t)==0&&h.cmpPos(e[r].to(),n)==0)return!0;return!1}var y="(){}[]";function P(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var l=t[r],i=l.head,o=e.scanForBracket(i,-1);if(!o)return!1;for(;;){var s=e.scanForBracket(i,1);if(!s)return!1;if(s.ch==y.charAt(y.indexOf(o.ch)+1)){var u=f(o.pos.line,o.pos.ch+1);if(h.cmpPos(u,l.from())==0&&h.cmpPos(s.pos,l.to())==0){if(o=e.scanForBracket(o.pos,-1),!o)return!1}else{n.push({anchor:u,head:s.pos});break}}i=f(s.pos.line,s.pos.ch+1)}}return e.setSelections(n),!0}a.selectScope=function(e){P(e)||e.execCommand("selectAll")},a.selectBetweenBrackets=function(e){if(!P(e))return h.Pass};function U(e){return e?/\bpunctuation\b/.test(e)?e:void 0:null}a.goToBracket=function(e){e.extendSelectionsBy(function(t){var n=e.scanForBracket(t.head,1,U(e.getTokenTypeAt(t.head)));if(n&&h.cmpPos(n.pos,t.head)!=0)return n.pos;var r=e.scanForBracket(t.head,-1,U(e.getTokenTypeAt(f(t.head.line,t.head.ch+1))));return r&&f(r.pos.line,r.pos.ch+1)||t.head})},a.swapLineUp=function(e){if(e.isReadOnly())return h.Pass;for(var t=e.listSelections(),n=[],r=e.firstLine()-1,l=[],i=0;i<t.length;i++){var o=t[i],s=o.from().line-1,u=o.to().line;l.push({anchor:f(o.anchor.line-1,o.anchor.ch),head:f(o.head.line-1,o.head.ch)}),o.to().ch==0&&!o.empty()&&--u,s>r?n.push(s,u):n.length&&(n[n.length-1]=u),r=u}e.operation(function(){for(var d=0;d<n.length;d+=2){var p=n[d],c=n[d+1],L=e.getLine(p);e.replaceRange("",f(p,0),f(p+1,0),"+swapLine"),c>e.lastLine()?e.replaceRange(`
|
|
3
3
|
`+L,f(e.lastLine()),null,"+swapLine"):e.replaceRange(L+`
|
|
4
4
|
`,f(c,0),null,"+swapLine")}e.setSelections(l),e.scrollIntoView()})},a.swapLineDown=function(e){if(e.isReadOnly())return h.Pass;for(var t=e.listSelections(),n=[],r=e.lastLine()+1,l=t.length-1;l>=0;l--){var i=t[l],o=i.to().line+1,s=i.from().line;i.to().ch==0&&!i.empty()&&o--,o<r?n.push(o,s):n.length&&(n[n.length-1]=s),r=s}e.operation(function(){for(var u=n.length-2;u>=0;u-=2){var d=n[u],p=n[u+1],c=e.getLine(d);d==e.lastLine()?e.replaceRange("",f(d-1),f(d),"+swapLine"):e.replaceRange("",f(d,0),f(d+1,0),"+swapLine"),e.replaceRange(c+`
|
|
5
5
|
`,f(p,0),null,"+swapLine")}e.scrollIntoView()})},a.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},a.joinLines=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){for(var l=t[r],i=l.from(),o=i.line,s=l.to().line;r<t.length-1&&t[r+1].from().line==s;)s=t[++r].to().line;n.push({start:o,end:s,anchor:!l.empty()&&i})}e.operation(function(){for(var u=0,d=[],p=0;p<n.length;p++){for(var c=n[p],L=c.anchor&&f(c.anchor.line-u,c.anchor.ch),m,S=c.start;S<=c.end;S++){var C=S-u;S==c.end&&(m=f(C,e.getLine(C).length+1)),C<e.lastLine()&&(e.replaceRange(" ",f(C),f(C+1,/^\s*/.exec(e.getLine(C+1))[0].length)),++u)}d.push({anchor:L||m,head:m})}e.setSelections(d,0)})},a.duplicateLine=function(e){e.operation(function(){for(var t=e.listSelections().length,n=0;n<t;n++){var r=e.listSelections()[n];r.empty()?e.replaceRange(e.getLine(r.head.line)+`
|
|
6
|
-
`,f(r.head.line,0)):e.replaceRange(e.getRange(r.from(),r.to()),r.from())}e.scrollIntoView()})};function B(e,t,n){if(e.isReadOnly())return h.Pass;for(var r=e.listSelections(),l=[],i,o=0;o<r.length;o++){var s=r[o];if(!s.empty()){for(var u=s.from().line,d=s.to().line;o<r.length-1&&r[o+1].from().line==d;)d=r[++o].to().line;r[o].to().ch||d--,l.push(u,d)}}l.length?i=!0:l.push(e.firstLine(),e.lastLine()),e.operation(function(){for(var p=[],c=0;c<l.length;c+=2){var L=l[c],m=l[c+1],S=f(L,0),C=f(m),x=e.getRange(S,C,!1);t?x.sort(function(g,k){return g<k?-n:g==k?0:n}):x.sort(function(g,k){var O=g.toUpperCase(),W=k.toUpperCase();return O!=W&&(g=O,k=W),g<k?-n:g==k?0:n}),e.replaceRange(x,S,C),i&&p.push({anchor:S,head:f(m+1,0)})}i&&e.setSelections(p,0)})}a.sortLines=function(e){B(e,!0,1)},a.reverseSortLines=function(e){B(e,!0,-1)},a.sortLinesInsensitive=function(e){B(e,!1,1)},a.reverseSortLinesInsensitive=function(e){B(e,!1,-1)},a.nextBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},a.prevBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(!n)t.pop();else return e.setSelection(n.from,n.to)}},a.toggleBookmark=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var l=t[r].from(),i=t[r].to(),o=t[r].empty()?e.findMarksAt(l):e.findMarks(l,i),s=0;s<o.length;s++)if(o[s].sublimeBookmark){o[s].clear();for(var u=0;u<n.length;u++)n[u]==o[s]&&n.splice(u--,1);break}s==o.length&&n.push(e.markText(l,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},a.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},a.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var l=t[r].find();l?n.push({anchor:l.from,head:l.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)};function I(e,t){e.operation(function(){for(var n=e.listSelections(),r=[],l=[],i=0;i<n.length;i++){var o=n[i];o.empty()?(r.push(i),l.push("")):l.push(t(e.getRange(o.from(),o.to())))}e.replaceSelections(l,"around","case");for(var i=r.length-1,s;i>=0;i--){var o=n[r[i]];if(!(s&&h.cmpPos(o.head,s)>0)){var u=R(e,o.head);s=u.from,e.replaceRange(t(u.word),u.from,u.to)}}})}a.smartBackspace=function(e){if(e.somethingSelected())return h.Pass;e.operation(function(){for(var t=e.listSelections(),n=e.getOption("indentUnit"),r=t.length-1;r>=0;r--){var l=t[r].head,i=e.getRange({line:l.line,ch:0},l),o=h.countColumn(i,null,e.getOption("tabSize")),s=e.findPosH(l,-1,"char",!1);if(i&&!/\S/.test(i)&&o%n==0){var u=new f(l.line,h.findColumn(i,o-n,n));u.ch!=l.ch&&(s=u)}e.replaceRange("",s,l,"+delete")}})},a.delLineRight=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,f(t[n].to().line),"+delete");e.scrollIntoView()})},a.upcaseAtCursor=function(e){I(e,function(t){return t.toUpperCase()})},a.downcaseAtCursor=function(e){I(e,function(t){return t.toLowerCase()})},a.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},a.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},a.deleteToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();if(t){var n=e.getCursor(),r=t;if(h.cmpPos(n,r)>0){var l=r;r=n,n=l}e.state.sublimeKilled=e.getRange(n,r),e.replaceRange("",n,r)}},a.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},a.sublimeYank=function(e){e.state.sublimeKilled!=null&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},a.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)};function D(e){var t=e.getCursor("from"),n=e.getCursor("to");if(h.cmpPos(t,n)==0){var r=R(e,t);if(!r.word)return;t=r.from,n=r.to}return{from:t,to:n,query:e.getRange(t,n),word:r}}function N(e,t){var n=D(e);if(n){var r=n.query,l=e.getSearchCursor(r,t?n.to:n.from);(t?l.findNext():l.findPrevious())?e.setSelection(l.from(),l.to()):(l=e.getSearchCursor(r,t?f(e.firstLine(),0):e.clipPos(f(e.lastLine()))),(t?l.findNext():l.findPrevious())?e.setSelection(l.from(),l.to()):n.word&&e.setSelection(n.from,n.to))}}a.findUnder=function(e){N(e,!0)},a.findUnderPrevious=function(e){N(e,!1)},a.findAllUnder=function(e){var t=D(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],l=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&l++;e.setSelections(r,l)}};var v=h.keyMap;v.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},h.normalizeKeyMap(v.macSublime),v.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},h.normalizeKeyMap(v.pcSublime);var H=v.default==v.macDefault;v.sublime=H?v.macSublime:v.pcSublime})})();var
|
|
6
|
+
`,f(r.head.line,0)):e.replaceRange(e.getRange(r.from(),r.to()),r.from())}e.scrollIntoView()})};function B(e,t,n){if(e.isReadOnly())return h.Pass;for(var r=e.listSelections(),l=[],i,o=0;o<r.length;o++){var s=r[o];if(!s.empty()){for(var u=s.from().line,d=s.to().line;o<r.length-1&&r[o+1].from().line==d;)d=r[++o].to().line;r[o].to().ch||d--,l.push(u,d)}}l.length?i=!0:l.push(e.firstLine(),e.lastLine()),e.operation(function(){for(var p=[],c=0;c<l.length;c+=2){var L=l[c],m=l[c+1],S=f(L,0),C=f(m),x=e.getRange(S,C,!1);t?x.sort(function(g,k){return g<k?-n:g==k?0:n}):x.sort(function(g,k){var O=g.toUpperCase(),W=k.toUpperCase();return O!=W&&(g=O,k=W),g<k?-n:g==k?0:n}),e.replaceRange(x,S,C),i&&p.push({anchor:S,head:f(m+1,0)})}i&&e.setSelections(p,0)})}a.sortLines=function(e){B(e,!0,1)},a.reverseSortLines=function(e){B(e,!0,-1)},a.sortLinesInsensitive=function(e){B(e,!1,1)},a.reverseSortLinesInsensitive=function(e){B(e,!1,-1)},a.nextBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},a.prevBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(!n)t.pop();else return e.setSelection(n.from,n.to)}},a.toggleBookmark=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var l=t[r].from(),i=t[r].to(),o=t[r].empty()?e.findMarksAt(l):e.findMarks(l,i),s=0;s<o.length;s++)if(o[s].sublimeBookmark){o[s].clear();for(var u=0;u<n.length;u++)n[u]==o[s]&&n.splice(u--,1);break}s==o.length&&n.push(e.markText(l,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},a.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},a.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var l=t[r].find();l?n.push({anchor:l.from,head:l.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)};function I(e,t){e.operation(function(){for(var n=e.listSelections(),r=[],l=[],i=0;i<n.length;i++){var o=n[i];o.empty()?(r.push(i),l.push("")):l.push(t(e.getRange(o.from(),o.to())))}e.replaceSelections(l,"around","case");for(var i=r.length-1,s;i>=0;i--){var o=n[r[i]];if(!(s&&h.cmpPos(o.head,s)>0)){var u=R(e,o.head);s=u.from,e.replaceRange(t(u.word),u.from,u.to)}}})}a.smartBackspace=function(e){if(e.somethingSelected())return h.Pass;e.operation(function(){for(var t=e.listSelections(),n=e.getOption("indentUnit"),r=t.length-1;r>=0;r--){var l=t[r].head,i=e.getRange({line:l.line,ch:0},l),o=h.countColumn(i,null,e.getOption("tabSize")),s=e.findPosH(l,-1,"char",!1);if(i&&!/\S/.test(i)&&o%n==0){var u=new f(l.line,h.findColumn(i,o-n,n));u.ch!=l.ch&&(s=u)}e.replaceRange("",s,l,"+delete")}})},a.delLineRight=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,f(t[n].to().line),"+delete");e.scrollIntoView()})},a.upcaseAtCursor=function(e){I(e,function(t){return t.toUpperCase()})},a.downcaseAtCursor=function(e){I(e,function(t){return t.toLowerCase()})},a.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},a.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},a.deleteToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();if(t){var n=e.getCursor(),r=t;if(h.cmpPos(n,r)>0){var l=r;r=n,n=l}e.state.sublimeKilled=e.getRange(n,r),e.replaceRange("",n,r)}},a.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},a.sublimeYank=function(e){e.state.sublimeKilled!=null&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},a.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)};function D(e){var t=e.getCursor("from"),n=e.getCursor("to");if(h.cmpPos(t,n)==0){var r=R(e,t);if(!r.word)return;t=r.from,n=r.to}return{from:t,to:n,query:e.getRange(t,n),word:r}}function N(e,t){var n=D(e);if(n){var r=n.query,l=e.getSearchCursor(r,t?n.to:n.from);(t?l.findNext():l.findPrevious())?e.setSelection(l.from(),l.to()):(l=e.getSearchCursor(r,t?f(e.firstLine(),0):e.clipPos(f(e.lastLine()))),(t?l.findNext():l.findPrevious())?e.setSelection(l.from(),l.to()):n.word&&e.setSelection(n.from,n.to))}}a.findUnder=function(e){N(e,!0)},a.findUnderPrevious=function(e){N(e,!1)},a.findAllUnder=function(e){var t=D(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],l=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&l++;e.setSelections(r,l)}};var v=h.keyMap;v.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},h.normalizeKeyMap(v.macSublime),v.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},h.normalizeKeyMap(v.pcSublime);var H=v.default==v.macDefault;v.sublime=H?v.macSublime:v.pcSublime})})();var M=J.exports;const G=V(M),j=z({__proto__:null,default:G},[M]);export{j as s};
|
package/playground/index.html
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
</style>
|
|
25
25
|
<title>Cube Playground</title>
|
|
26
|
-
<script type="module" crossorigin src="/assets/index-
|
|
26
|
+
<script type="module" crossorigin src="/assets/index-4af20da0.js"></script>
|
|
27
27
|
<link rel="stylesheet" href="/assets/index-af3b87a2.css">
|
|
28
28
|
</head>
|
|
29
29
|
<body>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as T}from"./index-85c5343c.js";import{a as j}from"./codemirror-bd4e751c.js";function O(x,B){for(var u=0;u<B.length;u++){const g=B[u];if(typeof g!="string"&&!Array.isArray(g)){for(const i in g)if(i!=="default"&&!(i in x)){const k=Object.getOwnPropertyDescriptor(g,i);k&&Object.defineProperty(x,i,k.get?k:{enumerable:!0,get:()=>g[i]})}}}return Object.freeze(Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}))}var _={exports:{}};(function(x,B){(function(u){u(j)})(function(u){var g=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),i=u.Pos,k={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function m(t){return t&&t.bracketRegex||/[(){}[\]]/}function L(t,r,e){var l=t.getLineHandle(r.line),n=r.ch-1,c=e&&e.afterCursor;c==null&&(c=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var f=m(e),o=!c&&n>=0&&f.test(l.text.charAt(n))&&k[l.text.charAt(n)]||f.test(l.text.charAt(n+1))&&k[l.text.charAt(++n)];if(!o)return null;var a=o.charAt(1)==">"?1:-1;if(e&&e.strict&&a>0!=(n==r.ch))return null;var v=t.getTokenTypeAt(i(r.line,n+1)),s=A(t,i(r.line,n+(a>0?1:0)),a,v,e);return s==null?null:{from:i(r.line,n),to:s&&s.pos,match:s&&s.ch==o.charAt(0),forward:a>0}}function A(t,r,e,l,n){for(var c=n&&n.maxScanLineLength||1e4,f=n&&n.maxScanLines||1e3,o=[],a=m(n),v=e>0?Math.min(r.line+f,t.lastLine()+1):Math.max(t.firstLine()-1,r.line-f),s=r.line;s!=v;s+=e){var h=t.getLine(s);if(h){var p=e>0?0:h.length-1,S=e>0?h.length:-1;if(!(h.length>c))for(s==r.line&&(p=r.ch-(e<0?1:0));p!=S;p+=e){var y=h.charAt(p);if(a.test(y)&&(l===void 0||(t.getTokenTypeAt(i(s,p+1))||"")==(l||""))){var E=k[y];if(E&&E.charAt(1)==">"==e>0)o.push(y);else if(o.length)o.pop();else return{pos:i(s,p),ch:y}}}}}return s-e==(e>0?t.lastLine():t.firstLine())?!1:null}function H(t,r,e){for(var l=t.state.matchBrackets.maxHighlightLineLength||1e3,n=e&&e.highlightNonMatching,c=[],f=t.listSelections(),o=0;o<f.length;o++){var a=f[o].empty()&&L(t,f[o].head,e);if(a&&(a.match||n!==!1)&&t.getLine(a.from.line).length<=l){var v=a.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";c.push(t.markText(a.from,i(a.from.line,a.from.ch+1),{className:v})),a.to&&t.getLine(a.to.line).length<=l&&c.push(t.markText(a.to,i(a.to.line,a.to.ch+1),{className:v}))}}if(c.length){g&&t.state.focused&&t.focus();var s=function(){t.operation(function(){for(var h=0;h<c.length;h++)c[h].clear()})};if(r)setTimeout(s,800);else return s}}function d(t){t.operation(function(){t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null),t.state.matchBrackets.currentlyHighlighted=H(t,!1,t.state.matchBrackets)})}function b(t){t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)}u.defineOption("matchBrackets",!1,function(t,r,e){e&&e!=u.Init&&(t.off("cursorActivity",d),t.off("focus",d),t.off("blur",b),b(t)),r&&(t.state.matchBrackets=typeof r=="object"?r:{},t.on("cursorActivity",d),t.on("focus",d),t.on("blur",b))}),u.defineExtension("matchBrackets",function(){H(this,!0)}),u.defineExtension("findMatchingBracket",function(t,r,e){return(e||typeof r=="boolean")&&(e?(e.strict=r,r=e):r=r?{strict:!0}:null),L(this,t,r)}),u.defineExtension("scanForBracket",function(t,r,e,l){return A(this,t,r,e,l)})})})();var M=_.exports;const P=T(M),D=O({__proto__:null,default:P},[M]);export{M as a,D as m};
|