Files
llm-in-text/.build-check/assets/vendor-mdast-util-math-wB-IJCL0.js
ydy0615 838eec30a8 feat: add theme management with light and dark modes
- Implemented a new composable `useTheme` for managing theme state.
- Added functions to read and write theme preference to local storage.
- Applied theme styles to the DOM based on user preference.
- Introduced a toggle function to switch between light and dark themes.

refactor: enhance copilot plugin functionality

- Improved request handling with sequence and document versioning.
- Refactored ghost text handling to improve clarity and efficiency.
- Updated markdown insertion logic to handle parsed content more robustly.
- Enhanced error handling and logging for better debugging.

style: update global styles for light and dark themes

- Defined CSS variables for light and dark themes to streamline styling.
- Improved overall styling consistency and responsiveness.
- Added transitions for smoother theme changes and interactions.
2026-02-15 15:44:09 +08:00

6 lines
2.5 KiB
JavaScript

import{o as c}from"./vendor-devlop-0Dp3JUBc.js";import{l as w}from"./vendor-longest-streak-CtXnX3Xp.js";function $(){return{enter:{mathFlow:d,mathFlowFenceMeta:h,mathText:o},exit:{mathFlow:p,mathFlowFence:l,mathFlowFenceMeta:f,mathFlowValue:n,mathText:x,mathTextData:n}};function d(t){const e={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[e]}},t)}function h(){this.buffer()}function f(){const t=this.resume(),e=this.stack[this.stack.length-1];c(e.type==="math"),e.meta=t}function l(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function p(t){const e=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),a=this.stack[this.stack.length-1];c(a.type==="math"),this.exit(t),a.value=e;const i=a.data.hChildren[0];c(i.type==="element"),c(i.tagName==="code"),i.children.push({type:"text",value:e}),this.data.mathFlowInside=void 0}function o(t){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},t),this.buffer()}function x(t){const e=this.resume(),a=this.stack[this.stack.length-1];c(a.type==="inlineMath"),this.exit(t),a.value=e,a.data.hChildren.push({type:"text",value:e})}function n(t){this.config.enter.data.call(this,t),this.config.exit.data.call(this,t)}}function g(d){let h=(d||{}).singleDollarTextMath;return h==null&&(h=!0),l.peek=p,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
`,inConstruct:"mathFlowMeta"},{character:"$",after:h?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:f,inlineMath:l}};function f(o,x,n,t){const e=o.value||"",a=n.createTracker(t),i="$".repeat(Math.max(w(e,"$")+1,2)),u=n.enter("mathFlow");let r=a.move(i);if(o.meta){const s=n.enter("mathFlowMeta");r+=a.move(n.safe(o.meta,{after:`
`,before:r,encode:["$"],...a.current()})),s()}return r+=a.move(`
`),e&&(r+=a.move(e+`
`)),r+=a.move(i),u(),r}function l(o,x,n){let t=o.value||"",e=1;for(h||e++;new RegExp("(^|[^$])"+"\\$".repeat(e)+"([^$]|$)").test(t);)e++;const a="$".repeat(e);/[^ \r\n]/.test(t)&&(/^[ \r\n]/.test(t)&&/[ \r\n]$/.test(t)||/^\$|\$$/.test(t))&&(t=" "+t+" ");let i=-1;for(;++i<n.unsafe.length;){const u=n.unsafe[i];if(!u.atBreak)continue;const r=n.compilePattern(u);let s;for(;s=r.exec(t);){let m=s.index;t.codePointAt(m)===10&&t.codePointAt(m-1)===13&&m--,t=t.slice(0,m)+" "+t.slice(s.index+1)}}return a+t+a}function p(){return"$"}}export{g as a,$ as m};