The server's 2.0 tokens and its CodeMirror build, pinned

ui/tokens.css from the server's dev (tokens.lock.json; repin to the beta tag
at release). scripts/fetch-vendor.sh copies the server's vendored CodeMirror and
Lezer modules into ui/vendor/, each checked against the server's own pin first,
with the bare module names rewritten to sibling files (the page has no import
map); vendor.lock.json records both hashes, and the script with no argument
verifies the copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Opus 5.5 committed 2026-10-28 04:55:03 +00:00
1 parent b849e1a4b8
commit af48856fcd
21 files changed
+224 -35

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
/* esm.sh - @codemirror/search@6.7.2 */
import{getDialog as ge,showDialog as xe,EditorView as M,Decoration as m,ViewPlugin as ie,showPanel as ye,runScopeHandlers as Me,getPanel as se}from"./cm-view.mjs";import{codePointAt as ve,fromCodePoint as Se,codePointSize as be,EditorSelection as g,Facet as le,combineConfig as oe,CharCategory as p,StateEffect as G,StateField as Ce,RangeSetBuilder as ke,Prec as Le,EditorState as We,findClusterBreak as ce}from"./cm-state.mjs";function u(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,r=arguments[1];if(r&&typeof r=="object"&&r.nodeType==null&&!Array.isArray(r)){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var i=r[n];typeof i=="string"?t.setAttribute(n,i):i!=null&&(t[n]=i)}e++}for(;e<arguments.length;e++)ee(t,arguments[e]);return t}function ee(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var r=0;r<e.length;r++)ee(t,e[r]);else throw new RangeError("Unsupported child node: "+e)}var te=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t,y=class{constructor(e,r,n=0,i=e.length,s,l){this.test=l,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=s?o=>s(te(o)):te,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ve(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let r=Se(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=be(e);let i=this.normalize(r);if(i.length)for(let s=0,l=n,o=!0;;s++){let c=i.charCodeAt(s),a=this.match(c,l,o,this.bufferPos+this.bufferStart,s==i.length-1);if(a)return this.value=a,this;if(s==i.length-1)break;o&&s<r.length&&r.charCodeAt(s)==c?l++:o=!1}}}match(e,r,n,i,s){let l=null;for(let o=0;o<this.matches.length;){let c=this.matches[o],a=!1;this.query.charCodeAt(c.index)==e&&(c.index==this.query.length-1?l={from:c.from,to:i,precise:s&&c.precise}:(c.index++,a=!0)),a?o++:this.matches.splice(o,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?l={from:r,to:i,precise:n&&s}:this.matches.push({from:r,index:1,precise:n})),l&&this.test&&!this.test(l.from,l.to,this.buffer,this.bufferStart)&&(l=null),l}};typeof Symbol<"u"&&(y.prototype[Symbol.iterator]=function(){return this});var ae={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Q="gm"+(/x/.unicode==null?"":"u"),q=class{constructor(e,r,n,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=ae,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new E(e,r,n,i,s);this.re=new RegExp(r,Q+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=e.iter();let l=e.lineAt(i);this.curLineStart=l.from,this.matchPos=R(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,i=n+r[0].length;if(this.matchPos=R(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,precise:!0,match:r},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},B=new WeakMap,w=class t{constructor(e,r){this.from=e,this.text=r}get to(){return this.from+this.text.length}static get(e,r,n){let i=B.get(e);if(!i||i.from>=n||i.to<=r){let o=new t(r,e.sliceString(r,n));return B.set(e,o),o}if(i.from==r&&i.to==n)return i;let{text:s,from:l}=i;return l>r&&(s=e.sliceString(r,l)+s,l=r),i.to<n&&(s+=e.sliceString(i.to,n)),B.set(e,new t(l,s)),new t(r,s.slice(r-l,n-l))}},E=class{constructor(e,r,n,i,s){this.text=e,this.to=s,this.done=!1,this.value=ae,this.matchPos=R(e,i),this.re=new RegExp(r,Q+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=w.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,i=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,i,r)))return this.value={from:n,to:i,precise:!0,match:r},this.matchPos=R(this.text,i+(Line truncated
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new H(this):new V(this)}getCursor(e,r=0,n){let i=e.doc?e:We.create({doc:e});return n==null&&(n=i.doc.length),this.regexp?b(this,i,r,n):S(this,i,r,n)}},I=class{constructor(e){this.spec=e}};function $e(t,e,r){return(n,i,s,l)=>{if(r&&!r(n,i,s,l))return!1;let o=n>=l&&i<=l+s.length?s.slice(n-l,i-l):e.doc.sliceString(n,i);return t(o,e,n,i)}}function S(t,e,r,n){let i;return t.wholeWord&&(i=_e(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=$e(t.test,e,i)),new y(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:s=>s.toLowerCase(),i)}function _e(t,e){return(r,n,i,s)=>((s>r||s+i.length<n)&&(s=Math.max(0,r-2),i=t.sliceString(s,Math.min(t.length,n+2))),(e(T(i,r-s))!=p.Word||e(O(i,r-s))!=p.Word)&&(e(O(i,n-s))!=p.Word||e(T(i,n-s))!=p.Word))}var V=class extends I{constructor(e){super(e)}nextMatch(e,r,n){let i=S(this.spec,e,n,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,r+this.spec.unquoted.length);i=S(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==r&&i.value.to==n?null:i.value}prevMatchInRange(e,r,n){for(let i=n;;){let s=Math.max(r,i-1e4-this.spec.unquoted.length),l=S(this.spec,e,s,i),o=null;for(;!l.nextOverlapping().done;)o=l.value;if(o)return o;if(s==r)return null;i-=1e4}}prevMatch(e,r,n){let i=this.prevMatchInRange(e,0,r);return i||(i=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=r||i.to!=n)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,r){let n=S(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let s=S(this.spec,e,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}};function Ne(t,e,r){return(n,i,s)=>(!r||r(n,i,s))&&t(s[0],e,n,i)}function b(t,e,r,n){let i;return t.wholeWord&&(i=ze(e.charCategorizer(e.selection.main.head))),t.test&&(i=Ne(t.test,e,i)),new q(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},r,n)}function T(t,e){return t.slice(ce(t,e,!1),e)}function O(t,e){return t.slice(e,ce(t,e))}function ze(t){return(e,r,n)=>!n[0].length||(t(T(n.input,n.index))!=p.Word||t(O(n.input,n.index))!=p.Word)&&(t(O(n.input,n.index+n[0].length))!=p.Word||t(T(n.input,n.index+n[0].length))!=p.Word)}var H=class extends I{nextMatch(e,r,n){let i=b(this.spec,e,n,e.doc.length).next();return i.done&&(i=b(this.spec,e,0,r).next()),i.done?null:i.value}prevMatchInRange(e,r,n){for(let i=1;;i++){let s=Math.max(r,n-i*1e4),l=b(this.spec,e,s,n),o=null;for(;!l.next().done;)o=l.value;if(o&&(s==r||o.from>s+10))return o;if(s==r)return null}}prevMatch(e,r,n){return this.prevMatchInRange(e,0,r)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let i=n.length;i>0;i--){let s=+n.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+n.slice(i)}return r})}matchAll(e,r){let n=b(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=r)return null;i.push(n.value)}return i}highlight(e,r,n,i){let s=b(this.spec,e,Math.max(0,r-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}},L=G.define(),U=G.define(),x=Ce.define({create(t){return new k(N(t).create(),null)},update(t,e){for(let r of e.effects)r.is(L)?t=new k(r.value.create(),t.panel):r.is(U)&&(t=new k(t.query,r.value?J:null));return t},provide:t=>ye.from(t,e=>e.panel)});function tt(t){let e=t.field(x,!1);return e?e.query.spec:N(t)}function rt(t){var e;return((e=t.field(x,!1))===null||e===void 0?void 0:e.panel)!=null}var k=class{constructor(e,r){this.query=e,this.panel=r}},Be=m.mark({class:"cm-searchMatch"}),Ve=m.mark({class:"cm-searchMatch cm-searchMatch-selected"}),He=ie.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(x))}update(t){let e=t.state.field(x);(e!=t.startState.field(x)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return m.none;let{view:r}=this,n=new ke;for(let i=0,s=r.visibleRanges,l=s.length;i<l;i++){let{from:o,to:c}=s[i];for(;i<l-1&&c>s[i+1].from-500;)c=s[++i].to;t.highlight(r.state,o,c,(a,h)=>{let f=r.state.selection.ranges.some(A=>A.from==a&&A.to==h);n.add(a,h,f?Ve:Be)})}return n.finish()}},{decorations:t=>t.decorations});function W(t){return e=>{let r=e.state.field(x,!1);return r&&r.query.spec.valid?t(e,r):de(e)}}var $=W((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let i=g.single(n.from,n.to),s=t.state.facet(v);return t.dispatch({selection:i,effects:[X(t,n),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),fe(t),!0}),_=W( Line truncated
//# sourceMappingURL=search.bundle.mjs.map