@wsxjs/wsx-press 0.0.28 → 0.1.0

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/dist/client.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@wsxjs/wsx-core"),oe=require("./index-mEWJapVH.cjs");require("@wsxjs/wsx-marked-components");const re=require("@wsxjs/wsx-router"),ee=require("./index.cjs"),ne=require("fuse.js"),ce=".wsx-doc-page{display:flex;flex-direction:column;min-height:100%}.doc-page{flex:1;padding:var(--doc-page-padding-y, 1rem) var(--doc-page-padding-x, 2rem);max-width:1200px;margin:0 auto;width:100%}.doc-loading,.doc-empty{text-align:center;padding:3rem;color:var(--wsx-press-text-secondary, #666)}.doc-error{padding:2rem;background:var(--wsx-press-error-bg, #fee);border:1px solid var(--wsx-press-error-border, #fcc);border-radius:4px;color:var(--wsx-press-error-text, #c33)}.doc-error h2{margin-top:0;color:var(--wsx-press-error-title, #a00)}.doc-header{margin-bottom:2rem;padding-bottom:1rem;border-bottom:1px solid var(--wsx-press-border, #ddd)}.doc-title{margin:0 0 .5rem;font-size:2rem;font-weight:600;color:var(--wsx-press-text-primary, #333)}.doc-description{margin:0;color:var(--wsx-press-text-secondary, #666);font-size:1.1rem}.doc-content{line-height:1.6}";var xe;let we,Ce;function G(t,e,r){return(e=je(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function He(t,e,r,d,o,w){function u(i,c,h){return function(a,n){return h&&h(a),i[c].call(a,n)}}function C(i,c){for(var h=0;h<i.length;h++)i[h].call(c);return c}function v(i,c,h,a){if(typeof i!="function"&&(a||i!==void 0))throw new TypeError(c+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return i}function U(i,c,h,a,n,T,R,O,q,j,x,m,p){function S(l){if(!p(l))throw new TypeError("Attempted to access private element on non-instance")}var g,E=c[0],D=c[3],_=!O;if(!_){h||Array.isArray(E)||(E=[E]);var s={},k=[],b=n===3?"get":n===4||m?"set":"value";j?(x||m?s={get:le(function(){return D(this)},a,"get"),set:function(l){c[4](this,l)}}:s[b]=D,x||le(s[b],a,n===2?"":b)):x||(s=Object.getOwnPropertyDescriptor(i,a))}for(var f=i,z=E.length-1;z>=0;z-=h?2:1){var M=E[z],K=h?E[z-1]:void 0,B={},$={kind:["field","accessor","method","getter","setter","class"][n],name:a,metadata:T,addInitializer:(function(l,I){if(l.v)throw Error("attempted to call addInitializer after decoration was finished");v(I,"An initializer","be",!0),R.push(I)}).bind(null,B)};try{if(_)(g=v(M.call(K,f,$),"class decorators","return"))&&(f=g);else{var A,F;$.static=q,$.private=j,j?n===2?A=function(l){return S(l),s.value}:(n<4&&(A=u(s,"get",S)),n!==3&&(F=u(s,"set",S))):(A=function(l){return l[a]},(n<2||n===4)&&(F=function(l,I){l[a]=I}));var W=$.access={has:j?p.bind():function(l){return a in l}};if(A&&(W.get=A),F&&(W.set=F),f=M.call(K,m?{get:s.get,set:s.set}:s[b],$),m){if(typeof f=="object"&&f)(g=v(f.get,"accessor.get"))&&(s.get=g),(g=v(f.set,"accessor.set"))&&(s.set=g),(g=v(f.init,"accessor.init"))&&k.push(g);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else v(f,(x?"field":"method")+" decorators","return")&&(x?k.push(f):s[b]=f)}}finally{B.v=!0}}return(x||m)&&O.push(function(l,I){for(var H=k.length-1;H>=0;H--)I=k[H].call(l,I);return I}),x||_||(j?m?O.push(u(s,"get"),u(s,"set")):O.push(n===2?s[b]:u.call.bind(s[b])):Object.defineProperty(i,a,s)),f}function L(i,c){return Object.defineProperty(i,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:c})}if(arguments.length>=6)var N=w[Symbol.metadata||Symbol.for("Symbol.metadata")];var P=Object.create(N??null),X=function(i,c,h,a){var n,T,R=[],O=function(b){return Me(b)===i},q=new Map;function j(b){b&&R.push(C.bind(null,b))}for(var x=0;x<c.length;x++){var m=c[x];if(Array.isArray(m)){var p=m[1],S=m[2],g=m.length>3,E=16&p,D=!!(8&p),_=(p&=7)==0,s=S+"/"+D;if(!_&&!g){var k=q.get(s);if(k===!0||k===3&&p!==4||k===4&&p!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+S);q.set(s,!(p>2)||p)}U(D?i:i.prototype,m,E,g?"#"+S:je(S),p,a,D?T=T||[]:n=n||[],R,D,g,_,p===1,D&&g?O:h)}}return j(n),j(T),R}(t,e,o,P);return r.length||L(t,P),{e:X,get c(){var i=[];return r.length&&[L(U(t,[r],d,t.name,5,P,i),P),C.bind(null,i,t)]}}}function je(t){var e=Ne(t,"string");return typeof e=="symbol"?e:e+""}function Ne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var d=r.call(t,e);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function le(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Me(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const Y=oe.createLogger("DocPage"),J={data:null,promise:null};async function Se(t,e={},r=1e4){var u;const d=new AbortController,o=setTimeout(()=>d.abort(),r);let w;if(e.signal){const C=new AbortController;e.signal.aborted?C.abort():e.signal.addEventListener("abort",()=>{C.abort()}),d.signal.addEventListener("abort",()=>{C.abort()}),w=C.signal}else w=d.signal;try{const C=await fetch(t,{...e,signal:w});return clearTimeout(o),C}catch(C){if(clearTimeout(o),C instanceof Error&&C.name==="AbortError"){const v=d.signal.aborted;throw((u=e.signal)==null?void 0:u.aborted)?new Error("Request was cancelled"):v?new Error(`Request timeout after ${r}ms`):new Error("Request was aborted")}throw C}}async function Ke(){return J.data?J.data:(J.promise||(J.promise=(async()=>{try{const t=await Se("/.wsx-press/docs-meta.json",{},5e3);if(!t.ok)throw new Error(`Failed to load metadata: ${t.statusText}`);const e=await t.json();return J.data=e,J.promise=null,e}catch(t){throw J.promise=null,t}})()),J.promise)}Ce=[y.autoRegister({tagName:"wsx-doc-page"})];exports.DocPage=void 0;class Be extends y.LightComponent{constructor(){super({styles:ce,styleName:"wsx-doc-page"}),G(this,"_autoStyles",ce),G(this,"loadingState",void 0),G(this,"markdown",void 0),G(this,"metadata",void 0),G(this,"error",void 0),G(this,"currentLoadingPath",null),G(this,"routeChangeUnsubscribe",null),G(this,"loadingAbortController",null),G(this,"isLoading",!1),G(this,"visibilityChangeHandler",null),G(this,"onHashChange",()=>{this.scrollToHash()}),Y.debug("DocPage initialized");const[e,r]=this.useState("loadingState","idle");Object.defineProperty(this,"loadingState",{get:e,set:r,enumerable:!0,configurable:!0});const[d,o]=this.useState("markdown","");Object.defineProperty(this,"markdown",{get:d,set:o,enumerable:!0,configurable:!0});const[w,u]=this.useState("metadata",null);Object.defineProperty(this,"metadata",{get:w,set:u,enumerable:!0,configurable:!0});const[C,v]=this.useState("error",null);Object.defineProperty(this,"error",{get:C,set:v,enumerable:!0,configurable:!0})}onConnected(){var e;(e=super.onConnected)==null||e.call(this),this.routeChangeUnsubscribe=re.RouterUtils.onRouteChange(()=>{this.cancelLoading(),this.loadDocument()}),this.visibilityChangeHandler=()=>{document.hidden?this.cancelLoading():this.loadingState==="loading"&&this.currentLoadingPath&&(Y.debug("Tab became visible, reloading document"),this.loadDocument())},document.addEventListener("visibilitychange",this.visibilityChangeHandler),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.loadDocument()})}),window.addEventListener("hashchange",this.onHashChange)}onDisconnected(){var e;(e=super.onDisconnected)==null||e.call(this),this.routeChangeUnsubscribe&&(this.routeChangeUnsubscribe(),this.routeChangeUnsubscribe=null),this.visibilityChangeHandler&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null),window.removeEventListener("hashchange",this.onHashChange),this.cancelLoading()}cancelLoading(){this.loadingAbortController&&(this.loadingAbortController.abort(),this.loadingAbortController=null),this.isLoading=!1,this.loadingState==="loading"&&(this.loadingState="idle"),this.currentLoadingPath=null}onAttributeChanged(e,r,d){e==="params"&&this.loadDocument()}async fetchWithTimeout(e,r={},d=1e4){return Se(e,r,d)}async loadDocument(){this.cancelLoading();try{this.loadingAbortController=new AbortController;const e=re.RouterUtils.getCurrentRoute();let r;if(e.path.startsWith("/docs/"))r=e.path.slice(6);else{const v=e.params;if(v.category&&v.page)r=`${v.category}/${v.page}`;else{if(Y.warn("Invalid document path:",{path:e.path,params:v}),Object.keys(v).length===0){Y.debug("Route params not yet initialized, keeping idle state"),this.loadingState="idle";return}this.loadingState="error",this.error=new ee.DocumentLoadError("Invalid document path: path must start with /docs/","INVALID_PARAMS");return}}if(!r||r.trim()===""){Y.warn("Empty document path:",{path:e.path}),this.loadingState="error",this.error=new ee.DocumentLoadError("Document path is empty","INVALID_PARAMS");return}this.currentLoadingPath=r,this.isLoading=!0,this.loadingState="loading",this.markdown="",this.error=null,this.metadata=null;const d=await Ke();if(this.currentLoadingPath!==r||this.loadingAbortController.signal.aborted){Y.debug(`Document switched after metadata, ignoring result for ${r}`),this.isLoading=!1,this.loadingState="idle";return}const o=d[r];if(!o){if(this.currentLoadingPath!==r||this.loadingAbortController.signal.aborted){this.isLoading=!1,this.loadingState="idle";return}this.loadingState="error",this.error=new ee.DocumentLoadError(`Document not found: ${r}`,"NOT_FOUND"),this.isLoading=!1;return}this.metadata=o;const w=`/docs/${r}.md`,u=await this.fetchWithTimeout(w,{signal:this.loadingAbortController.signal},1e4);if(this.currentLoadingPath!==r||this.loadingAbortController.signal.aborted){Y.debug(`Document switched during fetch, ignoring result for ${r}`),this.isLoading=!1,this.loadingState="idle";return}if(!u.ok){u.status===404?(this.loadingState="error",this.error=new ee.DocumentLoadError(`Document file not found: ${w}`,"NOT_FOUND")):(this.loadingState="error",this.error=new ee.DocumentLoadError(`Failed to load document: ${u.statusText}`,"NETWORK_ERROR",{status:u.status})),this.isLoading=!1;return}const C=await u.text();if(this.currentLoadingPath!==r||this.loadingAbortController.signal.aborted){Y.debug(`Document switched after fetch, ignoring result for ${r}`),this.isLoading=!1,this.loadingState="idle";return}this.markdown=C,this.loadingState="success",this.isLoading=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.connected&&this.scheduleRerender()})})}catch(e){if(this.isLoading=!1,e instanceof Error&&e.name==="AbortError"){Y.debug("Document loading was cancelled"),this.currentLoadingPath&&(this.loadingState="idle",this.currentLoadingPath=null);return}if(!this.currentLoadingPath){this.loadingState="error",this.error=new ee.DocumentLoadError(`Failed to load document: ${e instanceof Error?e.message:String(e)}`,"NETWORK_ERROR",e),Y.error("Failed to load document (no current path):",e);return}const r=this.currentLoadingPath;if(this.currentLoadingPath!==r){this.loadingState="idle";return}this.loadingState="error",this.error=new ee.DocumentLoadError(`Failed to load document: ${e instanceof Error?e.message:String(e)}`,"NETWORK_ERROR",e),Y.error("Failed to load document",e),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.connected&&this.scheduleRerender()})})}}scrollToHash(e=0){const o=window.location.hash;if(!o)return;const w=decodeURIComponent(o.slice(1));if(!w)return;const u=document.getElementById(w);u?(u.scrollIntoView({behavior:"smooth",block:"start"}),Y.debug(`Scrolled to anchor: ${w}`)):e<5?setTimeout(()=>{this.scrollToHash(e+1)},100):Y.warn(`Anchor element not found after 5 retries: ${w}`)}updated(){this.loadingState==="success"&&requestAnimationFrame(()=>this.scrollToHash())}render(){var e,r;return this.loadingState==="loading"?y.jsx("div",{class:"doc-page"},y.jsx("div",{class:"doc-loading"},"加载文档中...")):this.loadingState==="error"?y.jsx("div",{class:"doc-page"},y.jsx("div",{class:"doc-error"},y.jsx("h2",null,"加载失败"),y.jsx("p",null,((e=this.error)==null?void 0:e.message)||"未知错误"),((r=this.error)==null?void 0:r.code)==="NOT_FOUND"&&y.jsx("p",null,"文档不存在,请检查路径是否正确。"))):this.loadingState==="success"&&this.markdown?y.jsx("div",{class:"doc-page"},this.metadata&&y.jsx("div",{class:"doc-header"},y.jsx("h1",{class:"doc-title"},this.metadata.title),this.metadata.description&&y.jsx("p",{class:"doc-description"},this.metadata.description)),y.jsx("div",{class:"doc-content"},y.jsx("wsx-markdown",{markdown:this.markdown}))):y.jsx("div",{class:"doc-page"},y.jsx("div",{class:"doc-empty"},"请选择文档"))}}xe=Be;[exports.DocPage,we]=He(xe,[],Ce,0,void 0,y.LightComponent).c;we();const de=".wsx-doc-search{position:relative;width:100%;max-width:600px}.search-input-wrapper{position:relative}.search-input{width:100%;padding:.75rem 1rem;font-size:1rem;border:1px solid var(--wsx-press-border, #ddd);border-radius:4px;outline:none;transition:border-color .2s}.search-input:focus{border-color:var(--wsx-press-primary, #007bff);box-shadow:0 0 0 3px var(--wsx-press-primary-alpha, rgba(0, 123, 255, .1))}.search-loading{position:absolute;right:1rem;top:50%;transform:translateY(-50%);color:var(--wsx-press-text-secondary, #666);font-size:.875rem}.search-results{position:absolute;top:100%;left:0;right:0;margin-top:.5rem;background:var(--wsx-press-bg, #fff);border:1px solid var(--wsx-press-border, #ddd);border-radius:4px;box-shadow:0 4px 6px #0000001a;max-height:400px;overflow-y:auto;z-index:1000}.search-result{padding:1rem;border-bottom:1px solid var(--wsx-press-border-light, #f0f0f0);cursor:pointer;transition:background-color .2s}.search-result:last-child{border-bottom:none}.search-result:hover,.search-result.selected{background-color:var(--wsx-press-hover-bg, #f5f5f5)}.result-title{font-weight:600;color:var(--wsx-press-text-primary, #333);margin-bottom:.25rem}.result-title mark{background-color:var(--wsx-press-highlight-bg, #ffeb3b);color:var(--wsx-press-highlight-text, #000);padding:0 2px;border-radius:2px}.result-category{font-size:.875rem;color:var(--wsx-press-text-secondary, #666);margin-bottom:.5rem}.result-snippet{font-size:.875rem;color:var(--wsx-press-text-secondary, #666);line-height:1.4}.result-snippet mark{background-color:var(--wsx-press-highlight-bg, #ffeb3b);color:var(--wsx-press-highlight-text, #000);padding:0 2px;border-radius:2px}.search-no-results{position:absolute;top:100%;left:0;right:0;margin-top:.5rem;padding:1rem;background:var(--wsx-press-bg, #fff);border:1px solid var(--wsx-press-border, #ddd);border-radius:4px;box-shadow:0 4px 6px #0000001a;text-align:center;color:var(--wsx-press-text-secondary, #666);z-index:1000}";var Ee;let De,ke;function Q(t,e,r){return(e=Ie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function We(t,e,r,d,o,w){function u(i,c,h){return function(a,n){return h&&h(a),i[c].call(a,n)}}function C(i,c){for(var h=0;h<i.length;h++)i[h].call(c);return c}function v(i,c,h,a){if(typeof i!="function"&&(a||i!==void 0))throw new TypeError(c+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return i}function U(i,c,h,a,n,T,R,O,q,j,x,m,p){function S(l){if(!p(l))throw new TypeError("Attempted to access private element on non-instance")}var g,E=c[0],D=c[3],_=!O;if(!_){h||Array.isArray(E)||(E=[E]);var s={},k=[],b=n===3?"get":n===4||m?"set":"value";j?(x||m?s={get:ue(function(){return D(this)},a,"get"),set:function(l){c[4](this,l)}}:s[b]=D,x||ue(s[b],a,n===2?"":b)):x||(s=Object.getOwnPropertyDescriptor(i,a))}for(var f=i,z=E.length-1;z>=0;z-=h?2:1){var M=E[z],K=h?E[z-1]:void 0,B={},$={kind:["field","accessor","method","getter","setter","class"][n],name:a,metadata:T,addInitializer:(function(l,I){if(l.v)throw Error("attempted to call addInitializer after decoration was finished");v(I,"An initializer","be",!0),R.push(I)}).bind(null,B)};try{if(_)(g=v(M.call(K,f,$),"class decorators","return"))&&(f=g);else{var A,F;$.static=q,$.private=j,j?n===2?A=function(l){return S(l),s.value}:(n<4&&(A=u(s,"get",S)),n!==3&&(F=u(s,"set",S))):(A=function(l){return l[a]},(n<2||n===4)&&(F=function(l,I){l[a]=I}));var W=$.access={has:j?p.bind():function(l){return a in l}};if(A&&(W.get=A),F&&(W.set=F),f=M.call(K,m?{get:s.get,set:s.set}:s[b],$),m){if(typeof f=="object"&&f)(g=v(f.get,"accessor.get"))&&(s.get=g),(g=v(f.set,"accessor.set"))&&(s.set=g),(g=v(f.init,"accessor.init"))&&k.push(g);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else v(f,(x?"field":"method")+" decorators","return")&&(x?k.push(f):s[b]=f)}}finally{B.v=!0}}return(x||m)&&O.push(function(l,I){for(var H=k.length-1;H>=0;H--)I=k[H].call(l,I);return I}),x||_||(j?m?O.push(u(s,"get"),u(s,"set")):O.push(n===2?s[b]:u.call.bind(s[b])):Object.defineProperty(i,a,s)),f}function L(i,c){return Object.defineProperty(i,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:c})}if(arguments.length>=6)var N=w[Symbol.metadata||Symbol.for("Symbol.metadata")];var P=Object.create(N??null),X=function(i,c,h,a){var n,T,R=[],O=function(b){return Ge(b)===i},q=new Map;function j(b){b&&R.push(C.bind(null,b))}for(var x=0;x<c.length;x++){var m=c[x];if(Array.isArray(m)){var p=m[1],S=m[2],g=m.length>3,E=16&p,D=!!(8&p),_=(p&=7)==0,s=S+"/"+D;if(!_&&!g){var k=q.get(s);if(k===!0||k===3&&p!==4||k===4&&p!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+S);q.set(s,!(p>2)||p)}U(D?i:i.prototype,m,E,g?"#"+S:Ie(S),p,a,D?T=T||[]:n=n||[],R,D,g,_,p===1,D&&g?O:h)}}return j(n),j(T),R}(t,e,o,P);return r.length||L(t,P),{e:X,get c(){var i=[];return r.length&&[L(U(t,[r],d,t.name,5,P,i),P),C.bind(null,i,t)]}}}function Ie(t){var e=Ye(t,"string");return typeof e=="symbol"?e:e+""}function Ye(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var d=r.call(t,e);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ue(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Ge(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const ae=oe.createLogger("DocSearch"),Z={data:null,promise:null};async function he(){return Z.data?Z.data:(Z.promise||(Z.promise=(async()=>{try{const t=await fetch("/.wsx-press/search-index.json");if(!t.ok)throw new Error(`Failed to load search index: ${t.statusText}`);const e=await t.json();return Z.data=e,Z.promise=null,e}catch(t){throw Z.promise=null,t}})()),Z.promise)}ke=[y.autoRegister({tagName:"wsx-doc-search"})];exports.DocSearch=void 0;class Je extends y.LightComponent{constructor(){super({styles:de,styleName:"wsx-doc-search"}),Q(this,"_autoStyles",de),Q(this,"query",void 0),Q(this,"results",void 0),Q(this,"isOpen",void 0),Q(this,"isLoading",void 0),Q(this,"selectedIndex",void 0),Q(this,"fuse",null),Q(this,"searchTimeout",null),Q(this,"handleInput",L=>{const N=L.target;if(this.query=N.value,this.searchTimeout!==null&&clearTimeout(this.searchTimeout),!this.query.trim()){this.results=[],this.selectedIndex=-1,this.isOpen=!1;return}this.searchTimeout=window.setTimeout(()=>{this.performSearch()},300)}),Q(this,"handleKeyDown",L=>{if(!(!this.isOpen||this.results.length===0))switch(L.key){case"ArrowDown":L.preventDefault(),this.selectedIndex=Math.min(this.selectedIndex+1,this.results.length-1);break;case"ArrowUp":L.preventDefault(),this.selectedIndex=Math.max(this.selectedIndex-1,-1);break;case"Enter":L.preventDefault(),this.selectedIndex>=0&&this.selectedIndex<this.results.length?this.selectResult(this.results[this.selectedIndex]):this.results.length>0&&this.selectResult(this.results[0]);break;case"Escape":L.preventDefault(),this.isOpen=!1,this.query="",this.results=[],this.selectedIndex=-1;break}}),ae.info("DocSearch initialized");const[e,r]=this.useState("query","");Object.defineProperty(this,"query",{get:e,set:r,enumerable:!0,configurable:!0});let d=this.reactive([]);Object.defineProperty(this,"results",{get:()=>d,set:L=>{d=L!==null&&typeof L<"u"&&(Array.isArray(L)||typeof L=="object")?this.reactive(L):L,this.scheduleRerender()},enumerable:!0,configurable:!0});const[o,w]=this.useState("isOpen",!1);Object.defineProperty(this,"isOpen",{get:o,set:w,enumerable:!0,configurable:!0});const[u,C]=this.useState("isLoading",!1);Object.defineProperty(this,"isLoading",{get:u,set:C,enumerable:!0,configurable:!0});const[v,U]=this.useState("selectedIndex",-1);Object.defineProperty(this,"selectedIndex",{get:v,set:U,enumerable:!0,configurable:!0})}async onConnected(){var e;(e=super.onConnected)==null||e.call(this);try{const r=await he();this.fuse=new ne(r.documents,r.options)}catch(r){ae.error("Failed to load search index",r)}}async performSearch(){if(!this.fuse)try{this.isLoading=!0;const r=await he();this.fuse=new ne(r.documents,r.options)}catch(r){ae.error("Failed to load search index",r),this.isLoading=!1;return}if(this.isLoading=!1,!this.query.trim()){this.results=[],this.isOpen=!1;return}const e=this.fuse.search(this.query.trim());this.results=e,this.isOpen=this.query.trim().length>0,this.selectedIndex=-1}selectResult(e){const r=new CustomEvent("doc-search-select",{detail:{route:e.item.route},bubbles:!0});this.dispatchEvent(r),this.isOpen=!1,this.query="",this.results=[],this.selectedIndex=-1}highlightTextNodes(e,r){if(!r||r.length===0)return[e];const d=[];for(const C of r)C.indices&&d.push(...C.indices);d.sort((C,v)=>C[0]-v[0]);const o=[];for(const[C,v]of d)o.length===0||o[o.length-1][1]<C?o.push([C,v+1]):o[o.length-1][1]=Math.max(o[o.length-1][1],v+1);const w=[];let u=0;for(const[C,v]of o){C>u&&w.push(e.substring(u,C));const U=document.createElement("mark");U.textContent=e.substring(C,v),w.push(U),u=v}return u<e.length&&w.push(e.substring(u)),w}render(){return y.jsx("div",{class:"doc-search"},y.jsx("div",{class:"search-input-wrapper"},y.jsx("input",{type:"text",class:"search-input",placeholder:"搜索文档...",value:this.query,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:()=>{this.results.length>0&&(this.isOpen=!0)},"data-wsx-key":"DocSearch-input-text-1-1"}),this.isLoading&&y.jsx("div",{class:"search-loading"},"加载中...")),this.isOpen&&this.results.length>0&&y.jsx("div",{class:"search-results"},this.results.map((e,r)=>{var u,C;const d=r===this.selectedIndex,o=(u=e.matches)==null?void 0:u.find(v=>v.key==="title"),w=(C=e.matches)==null?void 0:C.find(v=>v.key==="content");return y.jsx("div",{key:e.item.id,class:`search-result ${d?"selected":""}`,onClick:()=>this.selectResult(e),onMouseEnter:()=>{this.selectedIndex=r}},y.jsx("div",{class:"result-title"},o?this.highlightTextNodes(e.item.title,[o]):e.item.title),y.jsx("div",{class:"result-category"},e.item.category),w&&y.jsx("div",{class:"result-snippet"},this.highlightTextNodes(e.item.content.substring(0,100),[w])))})),this.isOpen&&this.query.trim()&&this.results.length===0&&!this.isLoading&&y.jsx("div",{class:"search-no-results"},"未找到匹配的文档"))}}Ee=Je;[exports.DocSearch,De]=We(Ee,[],ke,0,void 0,y.LightComponent).c;De();const ge="wsx-doc-layout{display:flex;flex-direction:row;width:100%;min-height:calc(100vh - var(--nav-height, 70px))}.doc-layout{display:flex;flex-direction:row;width:100%;max-width:1600px;margin:0 auto;gap:0}.doc-layout-sidebar{flex-shrink:0}.doc-layout-main{flex:1;min-width:0;padding:var(--doc-layout-main-padding-y, 1.5rem) var(--doc-layout-main-padding-x, 2rem);max-width:100%}.doc-layout-toc{flex-shrink:0}@media (max-width: 1280px){.doc-layout-toc{display:none}}@media (max-width: 1024px){.doc-layout-sidebar{display:none}.doc-layout-main{padding:var(--doc-layout-main-padding-y, 1.5rem)}}";var Oe;let _e,Le;function se(t,e,r){return(e=Te(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qe(t,e,r,d,o,w){function u(i,c,h){return function(a,n){return h&&h(a),i[c].call(a,n)}}function C(i,c){for(var h=0;h<i.length;h++)i[h].call(c);return c}function v(i,c,h,a){if(typeof i!="function"&&(a||i!==void 0))throw new TypeError(c+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return i}function U(i,c,h,a,n,T,R,O,q,j,x,m,p){function S(l){if(!p(l))throw new TypeError("Attempted to access private element on non-instance")}var g,E=c[0],D=c[3],_=!O;if(!_){h||Array.isArray(E)||(E=[E]);var s={},k=[],b=n===3?"get":n===4||m?"set":"value";j?(x||m?s={get:fe(function(){return D(this)},a,"get"),set:function(l){c[4](this,l)}}:s[b]=D,x||fe(s[b],a,n===2?"":b)):x||(s=Object.getOwnPropertyDescriptor(i,a))}for(var f=i,z=E.length-1;z>=0;z-=h?2:1){var M=E[z],K=h?E[z-1]:void 0,B={},$={kind:["field","accessor","method","getter","setter","class"][n],name:a,metadata:T,addInitializer:(function(l,I){if(l.v)throw Error("attempted to call addInitializer after decoration was finished");v(I,"An initializer","be",!0),R.push(I)}).bind(null,B)};try{if(_)(g=v(M.call(K,f,$),"class decorators","return"))&&(f=g);else{var A,F;$.static=q,$.private=j,j?n===2?A=function(l){return S(l),s.value}:(n<4&&(A=u(s,"get",S)),n!==3&&(F=u(s,"set",S))):(A=function(l){return l[a]},(n<2||n===4)&&(F=function(l,I){l[a]=I}));var W=$.access={has:j?p.bind():function(l){return a in l}};if(A&&(W.get=A),F&&(W.set=F),f=M.call(K,m?{get:s.get,set:s.set}:s[b],$),m){if(typeof f=="object"&&f)(g=v(f.get,"accessor.get"))&&(s.get=g),(g=v(f.set,"accessor.set"))&&(s.set=g),(g=v(f.init,"accessor.init"))&&k.push(g);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else v(f,(x?"field":"method")+" decorators","return")&&(x?k.push(f):s[b]=f)}}finally{B.v=!0}}return(x||m)&&O.push(function(l,I){for(var H=k.length-1;H>=0;H--)I=k[H].call(l,I);return I}),x||_||(j?m?O.push(u(s,"get"),u(s,"set")):O.push(n===2?s[b]:u.call.bind(s[b])):Object.defineProperty(i,a,s)),f}function L(i,c){return Object.defineProperty(i,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:c})}if(arguments.length>=6)var N=w[Symbol.metadata||Symbol.for("Symbol.metadata")];var P=Object.create(N??null),X=function(i,c,h,a){var n,T,R=[],O=function(b){return Ze(b)===i},q=new Map;function j(b){b&&R.push(C.bind(null,b))}for(var x=0;x<c.length;x++){var m=c[x];if(Array.isArray(m)){var p=m[1],S=m[2],g=m.length>3,E=16&p,D=!!(8&p),_=(p&=7)==0,s=S+"/"+D;if(!_&&!g){var k=q.get(s);if(k===!0||k===3&&p!==4||k===4&&p!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+S);q.set(s,!(p>2)||p)}U(D?i:i.prototype,m,E,g?"#"+S:Te(S),p,a,D?T=T||[]:n=n||[],R,D,g,_,p===1,D&&g?O:h)}}return j(n),j(T),R}(t,e,o,P);return r.length||L(t,P),{e:X,get c(){var i=[];return r.length&&[L(U(t,[r],d,t.name,5,P,i),P),C.bind(null,i,t)]}}}function Te(t){var e=Xe(t,"string");return typeof e=="symbol"?e:e+""}function Xe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var d=r.call(t,e);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function fe(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Ze(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}Le=[y.autoRegister({tagName:"wsx-doc-layout"})];exports.DocLayout=void 0;class Ve extends y.LightComponent{constructor(){super({styles:ge,styleName:"wsx-doc-layout"}),se(this,"_autoStyles",ge),se(this,"sidebarInstance",null),se(this,"docPageInstance",null),se(this,"tocInstance",null)}onConnected(){var e;(e=super.onConnected)==null||e.call(this),requestAnimationFrame(()=>{if(this.connected){const r=this.querySelector(".doc-layout-sidebar");r&&!this.sidebarInstance&&(this.sidebarInstance=document.createElement("wsx-doc-sidebar"),r.appendChild(this.sidebarInstance));const d=this.querySelector(".doc-layout-main");d&&!this.docPageInstance&&(this.docPageInstance=document.createElement("wsx-doc-page"),d.appendChild(this.docPageInstance));const o=this.querySelector(".doc-layout-toc");o&&!this.tocInstance&&(this.tocInstance=document.createElement("wsx-doc-toc"),o.appendChild(this.tocInstance))}})}onDisconnected(){var e;(e=super.onDisconnected)==null||e.call(this),this.sidebarInstance&&(this.sidebarInstance.remove(),this.sidebarInstance=null),this.docPageInstance&&(this.docPageInstance.remove(),this.docPageInstance=null),this.tocInstance&&(this.tocInstance.remove(),this.tocInstance=null)}render(){return y.jsx("div",{class:"doc-layout"},y.jsx("aside",{class:"doc-layout-sidebar"}),y.jsx("main",{class:"doc-layout-main"}),y.jsx("aside",{class:"doc-layout-toc"}))}}Oe=Ve;[exports.DocLayout,_e]=Qe(Oe,[],Le,0,void 0,y.LightComponent).c;_e();const me="wsx-doc-sidebar{display:flex;flex-direction:column;width:280px;min-width:280px;height:100%;background:var(--wsx-press-sidebar-bg, #f9fafb);border-right:1px solid var(--wsx-press-border, #e5e7eb);overflow-y:auto;position:sticky;top:70px;max-height:calc(100vh - 70px)}.light wsx-doc-sidebar,[data-theme=light] wsx-doc-sidebar{background:var(--wsx-press-sidebar-bg, #f9fafb);border-right-color:var(--wsx-press-border, #e5e7eb)}.dark wsx-doc-sidebar,[data-theme=dark] wsx-doc-sidebar{background:var(--wsx-press-sidebar-bg, #1f2937);border-right-color:var(--wsx-press-border, #374151)}@media (prefers-color-scheme: dark){html:not(.light):not([data-theme=light]) wsx-doc-sidebar{background:var(--wsx-press-sidebar-bg, #1f2937);border-right-color:var(--wsx-press-border, #374151)}}.doc-sidebar{display:flex;flex-direction:column;width:100%;height:100%}.doc-sidebar-loading,.doc-sidebar-empty{padding:2rem;text-align:center;color:var(--wsx-press-text-secondary, #6b7280)}.doc-sidebar-nav{padding:1.5rem 0}.doc-sidebar-category{margin-bottom:2rem}.doc-sidebar-category:last-child{margin-bottom:0}.doc-sidebar-category-title{font-size:.875rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--wsx-press-text-secondary, #6b7280);padding:.5rem 1.5rem;margin:0 0 .5rem}.light .doc-sidebar-category-title,[data-theme=light] .doc-sidebar-category-title{color:var(--wsx-press-text-secondary, #6b7280)}.dark .doc-sidebar-category-title,[data-theme=dark] .doc-sidebar-category-title{color:var(--wsx-press-text-secondary, #9ca3af)}@media (prefers-color-scheme: dark){html:not(.light):not([data-theme=light]) .doc-sidebar-category-title{color:var(--wsx-press-text-secondary, #9ca3af)}}.doc-sidebar-list{list-style:none;margin:0;padding:0}.doc-sidebar-item{margin:0}.doc-sidebar-link{display:block;padding:.5rem 1.5rem;color:var(--wsx-press-text-primary, #111827);text-decoration:none;font-size:.875rem;line-height:1.5;transition:all .2s ease;border-left:3px solid transparent}.doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #f3f4f6);color:var(--wsx-press-text-primary, #111827)}.doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, #fef2f2);color:var(--wsx-press-sidebar-active-color, #dc2626);border-left-color:var(--wsx-press-sidebar-active-color, #dc2626);font-weight:500}.light .doc-sidebar-link,[data-theme=light] .doc-sidebar-link{color:var(--wsx-press-text-primary, #111827)}.light .doc-sidebar-link:hover,[data-theme=light] .doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #f3f4f6);color:var(--wsx-press-text-primary, #111827)}.light .doc-sidebar-link.active,[data-theme=light] .doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, #fef2f2);color:var(--wsx-press-sidebar-active-color, #dc2626);border-left-color:var(--wsx-press-sidebar-active-color, #dc2626)}.dark .doc-sidebar-link,[data-theme=dark] .doc-sidebar-link{color:var(--wsx-press-text-primary, #e5e7eb)}.dark .doc-sidebar-link:hover,[data-theme=dark] .doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #374151);color:var(--wsx-press-text-primary, #f3f4f6)}.dark .doc-sidebar-link.active,[data-theme=dark] .doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, rgba(220, 38, 38, .15));color:var(--wsx-press-sidebar-active-color, #f87171);border-left-color:var(--wsx-press-sidebar-active-color, #f87171)}@media (prefers-color-scheme: dark){html:not(.light):not([data-theme=light]) .doc-sidebar-link{color:var(--wsx-press-text-primary, #e5e7eb)}html:not(.light):not([data-theme=light]) .doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #374151);color:var(--wsx-press-text-primary, #f3f4f6)}html:not(.light):not([data-theme=light]) .doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, rgba(220, 38, 38, .15));color:var(--wsx-press-sidebar-active-color, #f87171);border-left-color:var(--wsx-press-sidebar-active-color, #f87171)}}@media (max-width: 1024px){wsx-doc-sidebar{width:240px;min-width:240px}}@media (max-width: 768px){wsx-doc-sidebar{display:none}}";var Re;let $e,Ae;function ie(t,e,r){return(e=Pe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function et(t,e,r,d,o,w){function u(i,c,h){return function(a,n){return h&&h(a),i[c].call(a,n)}}function C(i,c){for(var h=0;h<i.length;h++)i[h].call(c);return c}function v(i,c,h,a){if(typeof i!="function"&&(a||i!==void 0))throw new TypeError(c+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return i}function U(i,c,h,a,n,T,R,O,q,j,x,m,p){function S(l){if(!p(l))throw new TypeError("Attempted to access private element on non-instance")}var g,E=c[0],D=c[3],_=!O;if(!_){h||Array.isArray(E)||(E=[E]);var s={},k=[],b=n===3?"get":n===4||m?"set":"value";j?(x||m?s={get:pe(function(){return D(this)},a,"get"),set:function(l){c[4](this,l)}}:s[b]=D,x||pe(s[b],a,n===2?"":b)):x||(s=Object.getOwnPropertyDescriptor(i,a))}for(var f=i,z=E.length-1;z>=0;z-=h?2:1){var M=E[z],K=h?E[z-1]:void 0,B={},$={kind:["field","accessor","method","getter","setter","class"][n],name:a,metadata:T,addInitializer:(function(l,I){if(l.v)throw Error("attempted to call addInitializer after decoration was finished");v(I,"An initializer","be",!0),R.push(I)}).bind(null,B)};try{if(_)(g=v(M.call(K,f,$),"class decorators","return"))&&(f=g);else{var A,F;$.static=q,$.private=j,j?n===2?A=function(l){return S(l),s.value}:(n<4&&(A=u(s,"get",S)),n!==3&&(F=u(s,"set",S))):(A=function(l){return l[a]},(n<2||n===4)&&(F=function(l,I){l[a]=I}));var W=$.access={has:j?p.bind():function(l){return a in l}};if(A&&(W.get=A),F&&(W.set=F),f=M.call(K,m?{get:s.get,set:s.set}:s[b],$),m){if(typeof f=="object"&&f)(g=v(f.get,"accessor.get"))&&(s.get=g),(g=v(f.set,"accessor.set"))&&(s.set=g),(g=v(f.init,"accessor.init"))&&k.push(g);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else v(f,(x?"field":"method")+" decorators","return")&&(x?k.push(f):s[b]=f)}}finally{B.v=!0}}return(x||m)&&O.push(function(l,I){for(var H=k.length-1;H>=0;H--)I=k[H].call(l,I);return I}),x||_||(j?m?O.push(u(s,"get"),u(s,"set")):O.push(n===2?s[b]:u.call.bind(s[b])):Object.defineProperty(i,a,s)),f}function L(i,c){return Object.defineProperty(i,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:c})}if(arguments.length>=6)var N=w[Symbol.metadata||Symbol.for("Symbol.metadata")];var P=Object.create(N??null),X=function(i,c,h,a){var n,T,R=[],O=function(b){return rt(b)===i},q=new Map;function j(b){b&&R.push(C.bind(null,b))}for(var x=0;x<c.length;x++){var m=c[x];if(Array.isArray(m)){var p=m[1],S=m[2],g=m.length>3,E=16&p,D=!!(8&p),_=(p&=7)==0,s=S+"/"+D;if(!_&&!g){var k=q.get(s);if(k===!0||k===3&&p!==4||k===4&&p!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+S);q.set(s,!(p>2)||p)}U(D?i:i.prototype,m,E,g?"#"+S:Pe(S),p,a,D?T=T||[]:n=n||[],R,D,g,_,p===1,D&&g?O:h)}}return j(n),j(T),R}(t,e,o,P);return r.length||L(t,P),{e:X,get c(){var i=[];return r.length&&[L(U(t,[r],d,t.name,5,P,i),P),C.bind(null,i,t)]}}}function Pe(t){var e=tt(t,"string");return typeof e=="symbol"?e:e+""}function tt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var d=r.call(t,e);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function pe(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function rt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const it=oe.createLogger("DocSidebar");Ae=[y.autoRegister({tagName:"wsx-doc-sidebar"})];exports.DocSidebar=void 0;class st extends y.LightComponent{constructor(){super({styles:me,styleName:"wsx-doc-sidebar"}),ie(this,"_autoStyles",me),ie(this,"metadata",void 0),ie(this,"currentRoute",void 0),ie(this,"isLoading",void 0),ie(this,"routeChangeUnsubscribe",null),ie(this,"handleDocClick",(u,C)=>{C.preventDefault(),re.RouterUtils.navigate(u)});let e=this.reactive({});Object.defineProperty(this,"metadata",{get:()=>e,set:u=>{e=u!==null&&typeof u<"u"&&(Array.isArray(u)||typeof u=="object")?this.reactive(u):u,this.scheduleRerender()},enumerable:!0,configurable:!0});const[r,d]=this.useState("currentRoute","");Object.defineProperty(this,"currentRoute",{get:r,set:d,enumerable:!0,configurable:!0});const[o,w]=this.useState("isLoading",!0);Object.defineProperty(this,"isLoading",{get:o,set:w,enumerable:!0,configurable:!0})}async onConnected(){var e;(e=super.onConnected)==null||e.call(this),await this.loadMetadata(),this.routeChangeUnsubscribe=re.RouterUtils.onRouteChange(()=>{this.updateCurrentRoute()}),this.updateCurrentRoute()}onDisconnected(){var e;(e=super.onDisconnected)==null||e.call(this),this.routeChangeUnsubscribe&&(this.routeChangeUnsubscribe(),this.routeChangeUnsubscribe=null)}async loadMetadata(){try{if(this.isLoading=!0,J.data)this.metadata=J.data;else{const e=await fetch("/.wsx-press/docs-meta.json");e.ok&&(this.metadata=await e.json())}}catch(e){it.error("Failed to load metadata",e)}finally{this.isLoading=!1}}updateCurrentRoute(){const e=re.RouterUtils.getCurrentRoute();this.currentRoute=e.path}organizeByCategory(){const e={};return Object.values(this.metadata).forEach(d=>{const o=d.category||"other";e[o]||(e[o]=[]),e[o].push(d)}),Object.keys(e).sort().forEach(d=>{e[d].sort((o,w)=>o.order!==void 0&&w.order!==void 0?o.order-w.order:o.order!==void 0?-1:w.order!==void 0?1:o.title.localeCompare(w.title))}),e}isCurrentDoc(e){return this.currentRoute===e}render(){if(this.isLoading)return y.jsx("aside",{class:"doc-sidebar"},y.jsx("div",{class:"doc-sidebar-loading"},"加载中..."));const e=this.organizeByCategory(),r=Object.keys(e);return r.length===0?y.jsx("aside",{class:"doc-sidebar"},y.jsx("div",{class:"doc-sidebar-empty"},"暂无文档")):y.jsx("aside",{class:"doc-sidebar"},y.jsx("nav",{class:"doc-sidebar-nav"},r.map(d=>y.jsx("div",{key:d,class:"doc-sidebar-category"},y.jsx("h3",{class:"doc-sidebar-category-title"},d),y.jsx("ul",{class:"doc-sidebar-list"},e[d].map(o=>y.jsx("li",{key:o.route,class:"doc-sidebar-item"},y.jsx("a",{href:o.route,class:`doc-sidebar-link ${this.isCurrentDoc(o.route)?"active":""}`,onClick:w=>this.handleDocClick(o.route,w)},o.title))))))))}}Re=st;[exports.DocSidebar,$e]=et(Re,[],Ae,0,void 0,y.LightComponent).c;$e();const be="wsx-doc-toc{display:flex;flex-direction:column;width:240px;min-width:240px}.doc-toc{display:flex;flex-direction:column;width:100%;padding:1.5rem 1rem}.doc-toc-empty{padding:1rem;text-align:center;color:var(--wsx-press-text-secondary, #6b7280);font-size:.875rem}.doc-toc-title{font-size:.875rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--wsx-press-text-secondary, #6b7280);margin:0 0 1rem;padding:0}.doc-toc-nav{width:100%}.doc-toc-list{list-style:none;margin:0;padding:0}.doc-toc-sublist{margin-top:.25rem;padding-left:1rem}.doc-toc-item{margin:0;line-height:1.6}.doc-toc-item-level-1{margin-bottom:.5rem}.doc-toc-item-level-2{margin-bottom:.375rem;font-size:.875rem}.doc-toc-item-level-3{margin-bottom:.25rem;font-size:.8125rem}.doc-toc-item-level-4,.doc-toc-item-level-5,.doc-toc-item-level-6{margin-bottom:.25rem;font-size:.75rem}.doc-toc-link{display:block;color:var(--wsx-press-text-secondary, #6b7280);text-decoration:none;transition:color .2s ease;border-left:2px solid transparent;padding:.25rem 0 .25rem .5rem;margin-left:-.5rem}.doc-toc-link:hover{color:var(--wsx-press-text-primary, #111827)}.doc-toc-link.active{color:var(--wsx-press-toc-active-color, #2563eb);border-left-color:var(--wsx-press-toc-active-color, #2563eb);font-weight:500}@media (max-width: 1280px){wsx-doc-toc{display:none}}";var qe;let ze,Fe;function te(t,e,r){return(e=Ue(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ot(t,e,r,d,o,w){function u(i,c,h){return function(a,n){return h&&h(a),i[c].call(a,n)}}function C(i,c){for(var h=0;h<i.length;h++)i[h].call(c);return c}function v(i,c,h,a){if(typeof i!="function"&&(a||i!==void 0))throw new TypeError(c+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return i}function U(i,c,h,a,n,T,R,O,q,j,x,m,p){function S(l){if(!p(l))throw new TypeError("Attempted to access private element on non-instance")}var g,E=c[0],D=c[3],_=!O;if(!_){h||Array.isArray(E)||(E=[E]);var s={},k=[],b=n===3?"get":n===4||m?"set":"value";j?(x||m?s={get:ye(function(){return D(this)},a,"get"),set:function(l){c[4](this,l)}}:s[b]=D,x||ye(s[b],a,n===2?"":b)):x||(s=Object.getOwnPropertyDescriptor(i,a))}for(var f=i,z=E.length-1;z>=0;z-=h?2:1){var M=E[z],K=h?E[z-1]:void 0,B={},$={kind:["field","accessor","method","getter","setter","class"][n],name:a,metadata:T,addInitializer:(function(l,I){if(l.v)throw Error("attempted to call addInitializer after decoration was finished");v(I,"An initializer","be",!0),R.push(I)}).bind(null,B)};try{if(_)(g=v(M.call(K,f,$),"class decorators","return"))&&(f=g);else{var A,F;$.static=q,$.private=j,j?n===2?A=function(l){return S(l),s.value}:(n<4&&(A=u(s,"get",S)),n!==3&&(F=u(s,"set",S))):(A=function(l){return l[a]},(n<2||n===4)&&(F=function(l,I){l[a]=I}));var W=$.access={has:j?p.bind():function(l){return a in l}};if(A&&(W.get=A),F&&(W.set=F),f=M.call(K,m?{get:s.get,set:s.set}:s[b],$),m){if(typeof f=="object"&&f)(g=v(f.get,"accessor.get"))&&(s.get=g),(g=v(f.set,"accessor.set"))&&(s.set=g),(g=v(f.init,"accessor.init"))&&k.push(g);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else v(f,(x?"field":"method")+" decorators","return")&&(x?k.push(f):s[b]=f)}}finally{B.v=!0}}return(x||m)&&O.push(function(l,I){for(var H=k.length-1;H>=0;H--)I=k[H].call(l,I);return I}),x||_||(j?m?O.push(u(s,"get"),u(s,"set")):O.push(n===2?s[b]:u.call.bind(s[b])):Object.defineProperty(i,a,s)),f}function L(i,c){return Object.defineProperty(i,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:c})}if(arguments.length>=6)var N=w[Symbol.metadata||Symbol.for("Symbol.metadata")];var P=Object.create(N??null),X=function(i,c,h,a){var n,T,R=[],O=function(b){return nt(b)===i},q=new Map;function j(b){b&&R.push(C.bind(null,b))}for(var x=0;x<c.length;x++){var m=c[x];if(Array.isArray(m)){var p=m[1],S=m[2],g=m.length>3,E=16&p,D=!!(8&p),_=(p&=7)==0,s=S+"/"+D;if(!_&&!g){var k=q.get(s);if(k===!0||k===3&&p!==4||k===4&&p!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+S);q.set(s,!(p>2)||p)}U(D?i:i.prototype,m,E,g?"#"+S:Ue(S),p,a,D?T=T||[]:n=n||[],R,D,g,_,p===1,D&&g?O:h)}}return j(n),j(T),R}(t,e,o,P);return r.length||L(t,P),{e:X,get c(){var i=[];return r.length&&[L(U(t,[r],d,t.name,5,P,i),P),C.bind(null,i,t)]}}}function Ue(t){var e=at(t,"string");return typeof e=="symbol"?e:e+""}function at(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var d=r.call(t,e);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ye(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function nt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const ve=oe.createLogger("DocTOC"),V={data:null,promise:null};async function ct(){return V.data?V.data:(V.promise||(V.promise=(async()=>{try{const t=await fetch("/.wsx-press/docs-toc.json");if(!t.ok)throw new Error(`Failed to load TOC data: ${t.statusText}`);const e=await t.json();return V.data=e,V.promise=null,e}catch(t){throw V.promise=null,t}})()),V.promise)}Fe=[y.autoRegister({tagName:"wsx-doc-toc"})];exports.DocTOC=void 0;class lt extends y.LightComponent{constructor(){super({styles:be,styleName:"wsx-doc-toc"}),te(this,"_autoStyles",be),te(this,"items",void 0),te(this,"activeId",void 0),te(this,"observer",null),te(this,"headingElements",new Map),te(this,"routeChangeUnsubscribe",null),te(this,"handleTOCClick",(o,w)=>{w.preventDefault();let u=this.headingElements.get(o);u||(u=document.getElementById(o),u&&this.headingElements.set(o,u)),u?(u.scrollIntoView({behavior:"smooth",block:"start"}),window.history.replaceState(null,"",`#${o}`)):ve.warn(`Heading element not found for id: ${o}`)});let e=this.reactive([]);Object.defineProperty(this,"items",{get:()=>e,set:o=>{e=o!==null&&typeof o<"u"&&(Array.isArray(o)||typeof o=="object")?this.reactive(o):o,this.scheduleRerender()},enumerable:!0,configurable:!0});const[r,d]=this.useState("activeId","");Object.defineProperty(this,"activeId",{get:r,set:d,enumerable:!0,configurable:!0})}async onConnected(){var e;(e=super.onConnected)==null||e.call(this),await this.loadTOC(),this.routeChangeUnsubscribe=re.RouterUtils.onRouteChange(()=>{this.loadTOC()})}onDisconnected(){var e;(e=super.onDisconnected)==null||e.call(this),this.observer&&(this.observer.disconnect(),this.observer=null),this.routeChangeUnsubscribe&&(this.routeChangeUnsubscribe(),this.routeChangeUnsubscribe=null)}async loadTOC(){try{const e=re.RouterUtils.getCurrentRoute();let r;if(e.path.startsWith("/docs/"))r=e.path.slice(6);else{this.items=[];return}if(!r||r.trim()===""){this.items=[];return}const d=await ct();this.items=d[r]||[],requestAnimationFrame(()=>{this.setupHeadingIds(),this.setupScrollObserver()})}catch(e){ve.error("Failed to load TOC",e),this.items=[]}}setupHeadingIds(){const e=document.querySelector(".doc-content");if(!e)return;this.headingElements.clear(),e.querySelectorAll("wsx-marked-heading").forEach(o=>{const w=o.querySelector("h1, h2, h3, h4, h5, h6");w instanceof HTMLElement&&w.id&&this.headingElements.set(w.id,w)}),e.querySelectorAll(":scope > h1, :scope > h2, :scope > h3, :scope > h4, :scope > h5, :scope > h6").forEach(o=>{var w;if(o instanceof HTMLElement)if(o.id)this.headingElements.set(o.id,o);else{const u=((w=o.textContent)==null?void 0:w.trim())||"";if(u){const C=this.generateId(u);o.id=C,this.headingElements.set(C,o)}}})}generateId(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^\p{L}\p{N}-]/gu,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}setupScrollObserver(){"IntersectionObserver"in window&&(this.observer=new IntersectionObserver(e=>{const r=e.filter(d=>d.isIntersecting);r.length>0&&(r.sort((d,o)=>{const w=d.boundingClientRect.top,u=o.boundingClientRect.top;return Math.abs(w)-Math.abs(u)}),this.activeId=r[0].target.id)},{rootMargin:"-100px 0px -80% 0px",threshold:0}),this.headingElements.forEach(e=>{var r;(r=this.observer)==null||r.observe(e)}))}renderTOCItem(e){const r=this.activeId===e.id,d=e.children.length>0;return y.jsx("li",{class:`doc-toc-item doc-toc-item-level-${e.level}`},y.jsx("a",{href:`#${e.id}`,class:`doc-toc-link ${r?"active":""}`,onClick:o=>this.handleTOCClick(e.id,o)},e.text),d&&y.jsx("ul",{class:"doc-toc-list doc-toc-sublist"},e.children.map(o=>this.renderTOCItem(o))))}render(){return this.items.length===0?y.jsx("aside",{class:"doc-toc"},y.jsx("div",{class:"doc-toc-empty"},"暂无目录")):y.jsx("aside",{class:"doc-toc"},y.jsx("h3",{class:"doc-toc-title"},"目录"),y.jsx("nav",{class:"doc-toc-nav"},y.jsx("ul",{class:"doc-toc-list"},this.items.map(e=>this.renderTOCItem(e)))))}}qe=lt;[exports.DocTOC,ze]=ot(qe,[],Fe,0,void 0,y.LightComponent).c;ze();
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@wsxjs/wsx-core"),oe=require("./index-mEWJapVH.cjs");require("@wsxjs/wsx-marked-components");const re=require("@wsxjs/wsx-router"),ee=require("./index.cjs"),ne=require("fuse.js"),ce=".wsx-doc-page{display:flex;flex-direction:column;min-height:100%}.doc-page{flex:1;padding:var(--doc-page-padding-y, 1rem) var(--doc-page-padding-x, 2rem);max-width:1200px;margin:0 auto;width:100%}.doc-loading,.doc-empty{text-align:center;padding:3rem;color:var(--wsx-press-text-secondary, #666)}.doc-error{padding:2rem;background:var(--wsx-press-error-bg, #fee);border:1px solid var(--wsx-press-error-border, #fcc);border-radius:4px;color:var(--wsx-press-error-text, #c33)}.doc-error h2{margin-top:0;color:var(--wsx-press-error-title, #a00)}.doc-header{margin-bottom:2rem;padding-bottom:1rem;border-bottom:1px solid var(--wsx-press-border, #ddd)}.doc-title{margin:0 0 .5rem;font-size:2rem;font-weight:600;color:var(--wsx-press-text-primary, #333)}.doc-description{margin:0;color:var(--wsx-press-text-secondary, #666);font-size:1.1rem}.doc-content{line-height:1.6}";var xe;let we,Ce;function G(t,e,r){return(e=je(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function He(t,e,r,d,o,w){function u(i,c,h){return function(a,n){return h&&h(a),i[c].call(a,n)}}function C(i,c){for(var h=0;h<i.length;h++)i[h].call(c);return c}function v(i,c,h,a){if(typeof i!="function"&&(a||i!==void 0))throw new TypeError(c+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return i}function U(i,c,h,a,n,T,R,O,q,j,x,m,p){function S(l){if(!p(l))throw new TypeError("Attempted to access private element on non-instance")}var g,E=c[0],D=c[3],_=!O;if(!_){h||Array.isArray(E)||(E=[E]);var s={},k=[],b=n===3?"get":n===4||m?"set":"value";j?(x||m?s={get:le(function(){return D(this)},a,"get"),set:function(l){c[4](this,l)}}:s[b]=D,x||le(s[b],a,n===2?"":b)):x||(s=Object.getOwnPropertyDescriptor(i,a))}for(var f=i,z=E.length-1;z>=0;z-=h?2:1){var M=E[z],K=h?E[z-1]:void 0,B={},$={kind:["field","accessor","method","getter","setter","class"][n],name:a,metadata:T,addInitializer:(function(l,I){if(l.v)throw Error("attempted to call addInitializer after decoration was finished");v(I,"An initializer","be",!0),R.push(I)}).bind(null,B)};try{if(_)(g=v(M.call(K,f,$),"class decorators","return"))&&(f=g);else{var A,F;$.static=q,$.private=j,j?n===2?A=function(l){return S(l),s.value}:(n<4&&(A=u(s,"get",S)),n!==3&&(F=u(s,"set",S))):(A=function(l){return l[a]},(n<2||n===4)&&(F=function(l,I){l[a]=I}));var W=$.access={has:j?p.bind():function(l){return a in l}};if(A&&(W.get=A),F&&(W.set=F),f=M.call(K,m?{get:s.get,set:s.set}:s[b],$),m){if(typeof f=="object"&&f)(g=v(f.get,"accessor.get"))&&(s.get=g),(g=v(f.set,"accessor.set"))&&(s.set=g),(g=v(f.init,"accessor.init"))&&k.push(g);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else v(f,(x?"field":"method")+" decorators","return")&&(x?k.push(f):s[b]=f)}}finally{B.v=!0}}return(x||m)&&O.push(function(l,I){for(var H=k.length-1;H>=0;H--)I=k[H].call(l,I);return I}),x||_||(j?m?O.push(u(s,"get"),u(s,"set")):O.push(n===2?s[b]:u.call.bind(s[b])):Object.defineProperty(i,a,s)),f}function L(i,c){return Object.defineProperty(i,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:c})}if(arguments.length>=6)var N=w[Symbol.metadata||Symbol.for("Symbol.metadata")];var P=Object.create(N??null),X=function(i,c,h,a){var n,T,R=[],O=function(b){return Me(b)===i},q=new Map;function j(b){b&&R.push(C.bind(null,b))}for(var x=0;x<c.length;x++){var m=c[x];if(Array.isArray(m)){var p=m[1],S=m[2],g=m.length>3,E=16&p,D=!!(8&p),_=(p&=7)==0,s=S+"/"+D;if(!_&&!g){var k=q.get(s);if(k===!0||k===3&&p!==4||k===4&&p!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+S);q.set(s,!(p>2)||p)}U(D?i:i.prototype,m,E,g?"#"+S:je(S),p,a,D?T=T||[]:n=n||[],R,D,g,_,p===1,D&&g?O:h)}}return j(n),j(T),R}(t,e,o,P);return r.length||L(t,P),{e:X,get c(){var i=[];return r.length&&[L(U(t,[r],d,t.name,5,P,i),P),C.bind(null,i,t)]}}}function je(t){var e=Ne(t,"string");return typeof e=="symbol"?e:e+""}function Ne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var d=r.call(t,e);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function le(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Me(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const Y=oe.createLogger("DocPage"),J={data:null,promise:null};async function Se(t,e={},r=1e4){var u;const d=new AbortController,o=setTimeout(()=>d.abort(),r);let w;if(e.signal){const C=new AbortController;e.signal.aborted?C.abort():e.signal.addEventListener("abort",()=>{C.abort()}),d.signal.addEventListener("abort",()=>{C.abort()}),w=C.signal}else w=d.signal;try{const C=await fetch(t,{...e,signal:w});return clearTimeout(o),C}catch(C){if(clearTimeout(o),C instanceof Error&&C.name==="AbortError"){const v=d.signal.aborted;throw((u=e.signal)==null?void 0:u.aborted)?new Error("Request was cancelled"):v?new Error(`Request timeout after ${r}ms`):new Error("Request was aborted")}throw C}}async function Ke(){return J.data?J.data:(J.promise||(J.promise=(async()=>{try{const t=await Se("/.wsx-press/docs-meta.json",{},5e3);if(!t.ok)throw new Error(`Failed to load metadata: ${t.statusText}`);const e=await t.json();return J.data=e,J.promise=null,e}catch(t){throw J.promise=null,t}})()),J.promise)}Ce=[y.autoRegister({tagName:"wsx-doc-page"})];exports.DocPage=void 0;class Be extends y.LightComponent{constructor(){super({styles:ce,styleName:"wsx-doc-page"}),G(this,"_autoStyles",ce),G(this,"loadingState",void 0),G(this,"markdown",void 0),G(this,"metadata",void 0),G(this,"error",void 0),G(this,"currentLoadingPath",null),G(this,"routeChangeUnsubscribe",null),G(this,"loadingAbortController",null),G(this,"isLoading",!1),G(this,"visibilityChangeHandler",null),G(this,"onHashChange",()=>{this.scrollToHash()}),Y.debug("DocPage initialized");const[e,r]=this.useState("loadingState","idle");Object.defineProperty(this,"loadingState",{get:e,set:r,enumerable:!0,configurable:!0});const[d,o]=this.useState("markdown","");Object.defineProperty(this,"markdown",{get:d,set:o,enumerable:!0,configurable:!0});const[w,u]=this.useState("metadata",null);Object.defineProperty(this,"metadata",{get:w,set:u,enumerable:!0,configurable:!0});const[C,v]=this.useState("error",null);Object.defineProperty(this,"error",{get:C,set:v,enumerable:!0,configurable:!0})}onConnected(){var e;(e=super.onConnected)==null||e.call(this),this.routeChangeUnsubscribe=re.RouterUtils.onRouteChange(()=>{this.cancelLoading(),this.loadDocument()}),this.visibilityChangeHandler=()=>{document.hidden?this.cancelLoading():this.loadingState==="loading"&&this.currentLoadingPath&&(Y.debug("Tab became visible, reloading document"),this.loadDocument())},document.addEventListener("visibilitychange",this.visibilityChangeHandler),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.loadDocument()})}),window.addEventListener("hashchange",this.onHashChange)}onDisconnected(){var e;(e=super.onDisconnected)==null||e.call(this),this.routeChangeUnsubscribe&&(this.routeChangeUnsubscribe(),this.routeChangeUnsubscribe=null),this.visibilityChangeHandler&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null),window.removeEventListener("hashchange",this.onHashChange),this.cancelLoading()}cancelLoading(){this.loadingAbortController&&(this.loadingAbortController.abort(),this.loadingAbortController=null),this.isLoading=!1,this.loadingState==="loading"&&(this.loadingState="idle"),this.currentLoadingPath=null}onAttributeChanged(e,r,d){e==="params"&&this.loadDocument()}async fetchWithTimeout(e,r={},d=1e4){return Se(e,r,d)}async loadDocument(){this.cancelLoading();try{this.loadingAbortController=new AbortController;const e=re.RouterUtils.getCurrentRoute();let r;if(e.path.startsWith("/docs/"))r=e.path.slice(6);else{const v=e.params;if(v.category&&v.page)r=`${v.category}/${v.page}`;else{if(Y.warn("Invalid document path:",{path:e.path,params:v}),Object.keys(v).length===0){Y.debug("Route params not yet initialized, keeping idle state"),this.loadingState="idle";return}this.loadingState="error",this.error=new ee.DocumentLoadError("Invalid document path: path must start with /docs/","INVALID_PARAMS");return}}if(!r||r.trim()===""){Y.warn("Empty document path:",{path:e.path}),this.loadingState="error",this.error=new ee.DocumentLoadError("Document path is empty","INVALID_PARAMS");return}this.currentLoadingPath=r,this.isLoading=!0,this.loadingState="loading",this.markdown="",this.error=null,this.metadata=null;const d=await Ke();if(this.currentLoadingPath!==r||this.loadingAbortController.signal.aborted){Y.debug(`Document switched after metadata, ignoring result for ${r}`),this.isLoading=!1,this.loadingState="idle";return}const o=d[r];if(!o){if(this.currentLoadingPath!==r||this.loadingAbortController.signal.aborted){this.isLoading=!1,this.loadingState="idle";return}this.loadingState="error",this.error=new ee.DocumentLoadError(`Document not found: ${r}`,"NOT_FOUND"),this.isLoading=!1;return}this.metadata=o;const w=`/docs/${r}.md`,u=await this.fetchWithTimeout(w,{signal:this.loadingAbortController.signal},1e4);if(this.currentLoadingPath!==r||this.loadingAbortController.signal.aborted){Y.debug(`Document switched during fetch, ignoring result for ${r}`),this.isLoading=!1,this.loadingState="idle";return}if(!u.ok){u.status===404?(this.loadingState="error",this.error=new ee.DocumentLoadError(`Document file not found: ${w}`,"NOT_FOUND")):(this.loadingState="error",this.error=new ee.DocumentLoadError(`Failed to load document: ${u.statusText}`,"NETWORK_ERROR",{status:u.status})),this.isLoading=!1;return}const C=await u.text();if(this.currentLoadingPath!==r||this.loadingAbortController.signal.aborted){Y.debug(`Document switched after fetch, ignoring result for ${r}`),this.isLoading=!1,this.loadingState="idle";return}this.markdown=C,this.loadingState="success",this.isLoading=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.connected&&this.scheduleRerender()})})}catch(e){if(this.isLoading=!1,e instanceof Error&&e.name==="AbortError"){Y.debug("Document loading was cancelled"),this.currentLoadingPath&&(this.loadingState="idle",this.currentLoadingPath=null);return}if(!this.currentLoadingPath){this.loadingState="error",this.error=new ee.DocumentLoadError(`Failed to load document: ${e instanceof Error?e.message:String(e)}`,"NETWORK_ERROR",e),Y.error("Failed to load document (no current path):",e);return}const r=this.currentLoadingPath;if(this.currentLoadingPath!==r){this.loadingState="idle";return}this.loadingState="error",this.error=new ee.DocumentLoadError(`Failed to load document: ${e instanceof Error?e.message:String(e)}`,"NETWORK_ERROR",e),Y.error("Failed to load document",e),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.connected&&this.scheduleRerender()})})}}scrollToHash(e=0){const o=window.location.hash;if(!o)return;const w=decodeURIComponent(o.slice(1));if(!w)return;const u=document.getElementById(w);u?(u.scrollIntoView({behavior:"smooth",block:"start"}),Y.debug(`Scrolled to anchor: ${w}`)):e<5?setTimeout(()=>{this.scrollToHash(e+1)},100):Y.warn(`Anchor element not found after 5 retries: ${w}`)}updated(){this.loadingState==="success"&&requestAnimationFrame(()=>this.scrollToHash())}render(){var e,r;return this.loadingState==="loading"?y.jsx("div",{class:"doc-page"},y.jsx("div",{class:"doc-loading"},"加载文档中...")):this.loadingState==="error"?y.jsx("div",{class:"doc-page"},y.jsx("div",{class:"doc-error"},y.jsx("h2",null,"加载失败"),y.jsx("p",null,((e=this.error)==null?void 0:e.message)||"未知错误"),((r=this.error)==null?void 0:r.code)==="NOT_FOUND"&&y.jsx("p",null,"文档不存在,请检查路径是否正确。"))):this.loadingState==="success"&&this.markdown?y.jsx("div",{class:"doc-page"},this.metadata&&y.jsx("div",{class:"doc-header"},y.jsx("h1",{class:"doc-title"},this.metadata.title),this.metadata.description&&y.jsx("p",{class:"doc-description"},this.metadata.description)),y.jsx("div",{class:"doc-content"},y.jsx("wsx-markdown",{markdown:this.markdown}))):y.jsx("div",{class:"doc-page"},y.jsx("div",{class:"doc-empty"},"请选择文档"))}}xe=Be;[exports.DocPage,we]=He(xe,[],Ce,0,void 0,y.LightComponent).c;we();const de=".wsx-doc-search{position:relative;width:100%;max-width:600px}.search-input-wrapper{position:relative}.search-input{width:100%;padding:.75rem 1rem;font-size:1rem;border:1px solid var(--wsx-press-border, #ddd);border-radius:4px;outline:none;transition:border-color .2s}.search-input:focus{border-color:var(--wsx-press-primary, #007bff);box-shadow:0 0 0 3px var(--wsx-press-primary-alpha, rgba(0, 123, 255, .1))}.search-loading{position:absolute;right:1rem;top:50%;transform:translateY(-50%);color:var(--wsx-press-text-secondary, #666);font-size:.875rem}.search-results{position:absolute;top:100%;left:0;right:0;margin-top:.5rem;background:var(--wsx-press-bg, #fff);border:1px solid var(--wsx-press-border, #ddd);border-radius:4px;box-shadow:0 4px 6px #0000001a;max-height:400px;overflow-y:auto;z-index:1000}.search-result{padding:1rem;border-bottom:1px solid var(--wsx-press-border-light, #f0f0f0);cursor:pointer;transition:background-color .2s}.search-result:last-child{border-bottom:none}.search-result:hover,.search-result.selected{background-color:var(--wsx-press-hover-bg, #f5f5f5)}.result-title{font-weight:600;color:var(--wsx-press-text-primary, #333);margin-bottom:.25rem}.result-title mark{background-color:var(--wsx-press-highlight-bg, #ffeb3b);color:var(--wsx-press-highlight-text, #000);padding:0 2px;border-radius:2px}.result-category{font-size:.875rem;color:var(--wsx-press-text-secondary, #666);margin-bottom:.5rem}.result-snippet{font-size:.875rem;color:var(--wsx-press-text-secondary, #666);line-height:1.4}.result-snippet mark{background-color:var(--wsx-press-highlight-bg, #ffeb3b);color:var(--wsx-press-highlight-text, #000);padding:0 2px;border-radius:2px}.search-no-results{position:absolute;top:100%;left:0;right:0;margin-top:.5rem;padding:1rem;background:var(--wsx-press-bg, #fff);border:1px solid var(--wsx-press-border, #ddd);border-radius:4px;box-shadow:0 4px 6px #0000001a;text-align:center;color:var(--wsx-press-text-secondary, #666);z-index:1000}";var Ee;let De,ke;function Q(t,e,r){return(e=Ie(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function We(t,e,r,d,o,w){function u(i,c,h){return function(a,n){return h&&h(a),i[c].call(a,n)}}function C(i,c){for(var h=0;h<i.length;h++)i[h].call(c);return c}function v(i,c,h,a){if(typeof i!="function"&&(a||i!==void 0))throw new TypeError(c+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return i}function U(i,c,h,a,n,T,R,O,q,j,x,m,p){function S(l){if(!p(l))throw new TypeError("Attempted to access private element on non-instance")}var g,E=c[0],D=c[3],_=!O;if(!_){h||Array.isArray(E)||(E=[E]);var s={},k=[],b=n===3?"get":n===4||m?"set":"value";j?(x||m?s={get:ue(function(){return D(this)},a,"get"),set:function(l){c[4](this,l)}}:s[b]=D,x||ue(s[b],a,n===2?"":b)):x||(s=Object.getOwnPropertyDescriptor(i,a))}for(var f=i,z=E.length-1;z>=0;z-=h?2:1){var M=E[z],K=h?E[z-1]:void 0,B={},$={kind:["field","accessor","method","getter","setter","class"][n],name:a,metadata:T,addInitializer:(function(l,I){if(l.v)throw Error("attempted to call addInitializer after decoration was finished");v(I,"An initializer","be",!0),R.push(I)}).bind(null,B)};try{if(_)(g=v(M.call(K,f,$),"class decorators","return"))&&(f=g);else{var A,F;$.static=q,$.private=j,j?n===2?A=function(l){return S(l),s.value}:(n<4&&(A=u(s,"get",S)),n!==3&&(F=u(s,"set",S))):(A=function(l){return l[a]},(n<2||n===4)&&(F=function(l,I){l[a]=I}));var W=$.access={has:j?p.bind():function(l){return a in l}};if(A&&(W.get=A),F&&(W.set=F),f=M.call(K,m?{get:s.get,set:s.set}:s[b],$),m){if(typeof f=="object"&&f)(g=v(f.get,"accessor.get"))&&(s.get=g),(g=v(f.set,"accessor.set"))&&(s.set=g),(g=v(f.init,"accessor.init"))&&k.push(g);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else v(f,(x?"field":"method")+" decorators","return")&&(x?k.push(f):s[b]=f)}}finally{B.v=!0}}return(x||m)&&O.push(function(l,I){for(var H=k.length-1;H>=0;H--)I=k[H].call(l,I);return I}),x||_||(j?m?O.push(u(s,"get"),u(s,"set")):O.push(n===2?s[b]:u.call.bind(s[b])):Object.defineProperty(i,a,s)),f}function L(i,c){return Object.defineProperty(i,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:c})}if(arguments.length>=6)var N=w[Symbol.metadata||Symbol.for("Symbol.metadata")];var P=Object.create(N??null),X=function(i,c,h,a){var n,T,R=[],O=function(b){return Ge(b)===i},q=new Map;function j(b){b&&R.push(C.bind(null,b))}for(var x=0;x<c.length;x++){var m=c[x];if(Array.isArray(m)){var p=m[1],S=m[2],g=m.length>3,E=16&p,D=!!(8&p),_=(p&=7)==0,s=S+"/"+D;if(!_&&!g){var k=q.get(s);if(k===!0||k===3&&p!==4||k===4&&p!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+S);q.set(s,!(p>2)||p)}U(D?i:i.prototype,m,E,g?"#"+S:Ie(S),p,a,D?T=T||[]:n=n||[],R,D,g,_,p===1,D&&g?O:h)}}return j(n),j(T),R}(t,e,o,P);return r.length||L(t,P),{e:X,get c(){var i=[];return r.length&&[L(U(t,[r],d,t.name,5,P,i),P),C.bind(null,i,t)]}}}function Ie(t){var e=Ye(t,"string");return typeof e=="symbol"?e:e+""}function Ye(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var d=r.call(t,e);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ue(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Ge(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const ae=oe.createLogger("DocSearch"),Z={data:null,promise:null};async function he(){return Z.data?Z.data:(Z.promise||(Z.promise=(async()=>{try{const t=await fetch("/.wsx-press/search-index.json");if(!t.ok)throw new Error(`Failed to load search index: ${t.statusText}`);const e=await t.json();return Z.data=e,Z.promise=null,e}catch(t){throw Z.promise=null,t}})()),Z.promise)}ke=[y.autoRegister({tagName:"wsx-doc-search"})];exports.DocSearch=void 0;class Je extends y.LightComponent{constructor(){super({styles:de,styleName:"wsx-doc-search"}),Q(this,"_autoStyles",de),Q(this,"query",void 0),Q(this,"results",void 0),Q(this,"isOpen",void 0),Q(this,"isLoading",void 0),Q(this,"selectedIndex",void 0),Q(this,"fuse",null),Q(this,"searchTimeout",null),Q(this,"handleInput",L=>{const N=L.target;if(this.query=N.value,this.searchTimeout!==null&&clearTimeout(this.searchTimeout),!this.query.trim()){this.results=[],this.selectedIndex=-1,this.isOpen=!1;return}this.searchTimeout=window.setTimeout(()=>{this.performSearch()},300)}),Q(this,"handleKeyDown",L=>{if(!(!this.isOpen||this.results.length===0))switch(L.key){case"ArrowDown":L.preventDefault(),this.selectedIndex=Math.min(this.selectedIndex+1,this.results.length-1);break;case"ArrowUp":L.preventDefault(),this.selectedIndex=Math.max(this.selectedIndex-1,-1);break;case"Enter":L.preventDefault(),this.selectedIndex>=0&&this.selectedIndex<this.results.length?this.selectResult(this.results[this.selectedIndex]):this.results.length>0&&this.selectResult(this.results[0]);break;case"Escape":L.preventDefault(),this.isOpen=!1,this.query="",this.results=[],this.selectedIndex=-1;break}}),ae.info("DocSearch initialized");const[e,r]=this.useState("query","");Object.defineProperty(this,"query",{get:e,set:r,enumerable:!0,configurable:!0});let d=this.reactive([]);Object.defineProperty(this,"results",{get:()=>d,set:L=>{d=L!==null&&typeof L<"u"&&(Array.isArray(L)||typeof L=="object")?this.reactive(L):L,this.scheduleRerender()},enumerable:!0,configurable:!0});const[o,w]=this.useState("isOpen",!1);Object.defineProperty(this,"isOpen",{get:o,set:w,enumerable:!0,configurable:!0});const[u,C]=this.useState("isLoading",!1);Object.defineProperty(this,"isLoading",{get:u,set:C,enumerable:!0,configurable:!0});const[v,U]=this.useState("selectedIndex",-1);Object.defineProperty(this,"selectedIndex",{get:v,set:U,enumerable:!0,configurable:!0})}async onConnected(){var e;(e=super.onConnected)==null||e.call(this);try{const r=await he();this.fuse=new ne(r.documents,r.options)}catch(r){ae.error("Failed to load search index",r)}}async performSearch(){if(!this.fuse)try{this.isLoading=!0;const r=await he();this.fuse=new ne(r.documents,r.options)}catch(r){ae.error("Failed to load search index",r),this.isLoading=!1;return}if(this.isLoading=!1,!this.query.trim()){this.results=[],this.isOpen=!1;return}const e=this.fuse.search(this.query.trim());this.results=e,this.isOpen=this.query.trim().length>0,this.selectedIndex=-1}selectResult(e){const r=new CustomEvent("doc-search-select",{detail:{route:e.item.route},bubbles:!0});this.dispatchEvent(r),this.isOpen=!1,this.query="",this.results=[],this.selectedIndex=-1}highlightTextNodes(e,r){if(!r||r.length===0)return[e];const d=[];for(const C of r)C.indices&&d.push(...C.indices);d.sort((C,v)=>C[0]-v[0]);const o=[];for(const[C,v]of d)o.length===0||o[o.length-1][1]<C?o.push([C,v+1]):o[o.length-1][1]=Math.max(o[o.length-1][1],v+1);const w=[];let u=0;for(const[C,v]of o){C>u&&w.push(e.substring(u,C));const U=document.createElement("mark");U.textContent=e.substring(C,v),w.push(U),u=v}return u<e.length&&w.push(e.substring(u)),w}render(){return y.jsx("div",{class:"doc-search"},y.jsx("div",{class:"search-input-wrapper"},y.jsx("input",{type:"text",class:"search-input",placeholder:"搜索文档...",value:this.query,onInput:this.handleInput,onKeyDown:this.handleKeyDown,onFocus:()=>{this.results.length>0&&(this.isOpen=!0)}}),this.isLoading&&y.jsx("div",{class:"search-loading"},"加载中...")),this.isOpen&&this.results.length>0&&y.jsx("div",{class:"search-results"},this.results.map((e,r)=>{var u,C;const d=r===this.selectedIndex,o=(u=e.matches)==null?void 0:u.find(v=>v.key==="title"),w=(C=e.matches)==null?void 0:C.find(v=>v.key==="content");return y.jsx("div",{key:e.item.id,class:`search-result ${d?"selected":""}`,onClick:()=>this.selectResult(e),onMouseEnter:()=>{this.selectedIndex=r}},y.jsx("div",{class:"result-title"},o?this.highlightTextNodes(e.item.title,[o]):e.item.title),y.jsx("div",{class:"result-category"},e.item.category),w&&y.jsx("div",{class:"result-snippet"},this.highlightTextNodes(e.item.content.substring(0,100),[w])))})),this.isOpen&&this.query.trim()&&this.results.length===0&&!this.isLoading&&y.jsx("div",{class:"search-no-results"},"未找到匹配的文档"))}}Ee=Je;[exports.DocSearch,De]=We(Ee,[],ke,0,void 0,y.LightComponent).c;De();const ge="wsx-doc-layout{display:flex;flex-direction:row;width:100%;min-height:calc(100vh - var(--nav-height, 70px))}.doc-layout{display:flex;flex-direction:row;width:100%;max-width:1600px;margin:0 auto;gap:0}.doc-layout-sidebar{flex-shrink:0}.doc-layout-main{flex:1;min-width:0;padding:var(--doc-layout-main-padding-y, 1.5rem) var(--doc-layout-main-padding-x, 2rem);max-width:100%}.doc-layout-toc{flex-shrink:0}@media (max-width: 1280px){.doc-layout-toc{display:none}}@media (max-width: 1024px){.doc-layout-sidebar{display:none}.doc-layout-main{padding:var(--doc-layout-main-padding-y, 1.5rem)}}";var Oe;let _e,Le;function se(t,e,r){return(e=Te(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qe(t,e,r,d,o,w){function u(i,c,h){return function(a,n){return h&&h(a),i[c].call(a,n)}}function C(i,c){for(var h=0;h<i.length;h++)i[h].call(c);return c}function v(i,c,h,a){if(typeof i!="function"&&(a||i!==void 0))throw new TypeError(c+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return i}function U(i,c,h,a,n,T,R,O,q,j,x,m,p){function S(l){if(!p(l))throw new TypeError("Attempted to access private element on non-instance")}var g,E=c[0],D=c[3],_=!O;if(!_){h||Array.isArray(E)||(E=[E]);var s={},k=[],b=n===3?"get":n===4||m?"set":"value";j?(x||m?s={get:fe(function(){return D(this)},a,"get"),set:function(l){c[4](this,l)}}:s[b]=D,x||fe(s[b],a,n===2?"":b)):x||(s=Object.getOwnPropertyDescriptor(i,a))}for(var f=i,z=E.length-1;z>=0;z-=h?2:1){var M=E[z],K=h?E[z-1]:void 0,B={},$={kind:["field","accessor","method","getter","setter","class"][n],name:a,metadata:T,addInitializer:(function(l,I){if(l.v)throw Error("attempted to call addInitializer after decoration was finished");v(I,"An initializer","be",!0),R.push(I)}).bind(null,B)};try{if(_)(g=v(M.call(K,f,$),"class decorators","return"))&&(f=g);else{var A,F;$.static=q,$.private=j,j?n===2?A=function(l){return S(l),s.value}:(n<4&&(A=u(s,"get",S)),n!==3&&(F=u(s,"set",S))):(A=function(l){return l[a]},(n<2||n===4)&&(F=function(l,I){l[a]=I}));var W=$.access={has:j?p.bind():function(l){return a in l}};if(A&&(W.get=A),F&&(W.set=F),f=M.call(K,m?{get:s.get,set:s.set}:s[b],$),m){if(typeof f=="object"&&f)(g=v(f.get,"accessor.get"))&&(s.get=g),(g=v(f.set,"accessor.set"))&&(s.set=g),(g=v(f.init,"accessor.init"))&&k.push(g);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else v(f,(x?"field":"method")+" decorators","return")&&(x?k.push(f):s[b]=f)}}finally{B.v=!0}}return(x||m)&&O.push(function(l,I){for(var H=k.length-1;H>=0;H--)I=k[H].call(l,I);return I}),x||_||(j?m?O.push(u(s,"get"),u(s,"set")):O.push(n===2?s[b]:u.call.bind(s[b])):Object.defineProperty(i,a,s)),f}function L(i,c){return Object.defineProperty(i,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:c})}if(arguments.length>=6)var N=w[Symbol.metadata||Symbol.for("Symbol.metadata")];var P=Object.create(N??null),X=function(i,c,h,a){var n,T,R=[],O=function(b){return Ze(b)===i},q=new Map;function j(b){b&&R.push(C.bind(null,b))}for(var x=0;x<c.length;x++){var m=c[x];if(Array.isArray(m)){var p=m[1],S=m[2],g=m.length>3,E=16&p,D=!!(8&p),_=(p&=7)==0,s=S+"/"+D;if(!_&&!g){var k=q.get(s);if(k===!0||k===3&&p!==4||k===4&&p!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+S);q.set(s,!(p>2)||p)}U(D?i:i.prototype,m,E,g?"#"+S:Te(S),p,a,D?T=T||[]:n=n||[],R,D,g,_,p===1,D&&g?O:h)}}return j(n),j(T),R}(t,e,o,P);return r.length||L(t,P),{e:X,get c(){var i=[];return r.length&&[L(U(t,[r],d,t.name,5,P,i),P),C.bind(null,i,t)]}}}function Te(t){var e=Xe(t,"string");return typeof e=="symbol"?e:e+""}function Xe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var d=r.call(t,e);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function fe(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function Ze(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}Le=[y.autoRegister({tagName:"wsx-doc-layout"})];exports.DocLayout=void 0;class Ve extends y.LightComponent{constructor(){super({styles:ge,styleName:"wsx-doc-layout"}),se(this,"_autoStyles",ge),se(this,"sidebarInstance",null),se(this,"docPageInstance",null),se(this,"tocInstance",null)}onConnected(){var e;(e=super.onConnected)==null||e.call(this),requestAnimationFrame(()=>{if(this.connected){const r=this.querySelector(".doc-layout-sidebar");r&&!this.sidebarInstance&&(this.sidebarInstance=document.createElement("wsx-doc-sidebar"),r.appendChild(this.sidebarInstance));const d=this.querySelector(".doc-layout-main");d&&!this.docPageInstance&&(this.docPageInstance=document.createElement("wsx-doc-page"),d.appendChild(this.docPageInstance));const o=this.querySelector(".doc-layout-toc");o&&!this.tocInstance&&(this.tocInstance=document.createElement("wsx-doc-toc"),o.appendChild(this.tocInstance))}})}onDisconnected(){var e;(e=super.onDisconnected)==null||e.call(this),this.sidebarInstance&&(this.sidebarInstance.remove(),this.sidebarInstance=null),this.docPageInstance&&(this.docPageInstance.remove(),this.docPageInstance=null),this.tocInstance&&(this.tocInstance.remove(),this.tocInstance=null)}render(){return y.jsx("div",{class:"doc-layout"},y.jsx("aside",{class:"doc-layout-sidebar"}),y.jsx("main",{class:"doc-layout-main"}),y.jsx("aside",{class:"doc-layout-toc"}))}}Oe=Ve;[exports.DocLayout,_e]=Qe(Oe,[],Le,0,void 0,y.LightComponent).c;_e();const me="wsx-doc-sidebar{display:flex;flex-direction:column;width:280px;min-width:280px;height:100%;background:var(--wsx-press-sidebar-bg, #f9fafb);border-right:1px solid var(--wsx-press-border, #e5e7eb);overflow-y:auto;position:sticky;top:70px;max-height:calc(100vh - 70px)}.light wsx-doc-sidebar,[data-theme=light] wsx-doc-sidebar{background:var(--wsx-press-sidebar-bg, #f9fafb);border-right-color:var(--wsx-press-border, #e5e7eb)}.dark wsx-doc-sidebar,[data-theme=dark] wsx-doc-sidebar{background:var(--wsx-press-sidebar-bg, #1f2937);border-right-color:var(--wsx-press-border, #374151)}@media (prefers-color-scheme: dark){html:not(.light):not([data-theme=light]) wsx-doc-sidebar{background:var(--wsx-press-sidebar-bg, #1f2937);border-right-color:var(--wsx-press-border, #374151)}}.doc-sidebar{display:flex;flex-direction:column;width:100%;height:100%}.doc-sidebar-loading,.doc-sidebar-empty{padding:2rem;text-align:center;color:var(--wsx-press-text-secondary, #6b7280)}.doc-sidebar-nav{padding:1.5rem 0}.doc-sidebar-category{margin-bottom:2rem}.doc-sidebar-category:last-child{margin-bottom:0}.doc-sidebar-category-title{font-size:.875rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--wsx-press-text-secondary, #6b7280);padding:.5rem 1.5rem;margin:0 0 .5rem}.light .doc-sidebar-category-title,[data-theme=light] .doc-sidebar-category-title{color:var(--wsx-press-text-secondary, #6b7280)}.dark .doc-sidebar-category-title,[data-theme=dark] .doc-sidebar-category-title{color:var(--wsx-press-text-secondary, #9ca3af)}@media (prefers-color-scheme: dark){html:not(.light):not([data-theme=light]) .doc-sidebar-category-title{color:var(--wsx-press-text-secondary, #9ca3af)}}.doc-sidebar-list{list-style:none;margin:0;padding:0}.doc-sidebar-item{margin:0}.doc-sidebar-link{display:block;padding:.5rem 1.5rem;color:var(--wsx-press-text-primary, #111827);text-decoration:none;font-size:.875rem;line-height:1.5;transition:all .2s ease;border-left:3px solid transparent}.doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #f3f4f6);color:var(--wsx-press-text-primary, #111827)}.doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, #fef2f2);color:var(--wsx-press-sidebar-active-color, #dc2626);border-left-color:var(--wsx-press-sidebar-active-color, #dc2626);font-weight:500}.light .doc-sidebar-link,[data-theme=light] .doc-sidebar-link{color:var(--wsx-press-text-primary, #111827)}.light .doc-sidebar-link:hover,[data-theme=light] .doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #f3f4f6);color:var(--wsx-press-text-primary, #111827)}.light .doc-sidebar-link.active,[data-theme=light] .doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, #fef2f2);color:var(--wsx-press-sidebar-active-color, #dc2626);border-left-color:var(--wsx-press-sidebar-active-color, #dc2626)}.dark .doc-sidebar-link,[data-theme=dark] .doc-sidebar-link{color:var(--wsx-press-text-primary, #e5e7eb)}.dark .doc-sidebar-link:hover,[data-theme=dark] .doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #374151);color:var(--wsx-press-text-primary, #f3f4f6)}.dark .doc-sidebar-link.active,[data-theme=dark] .doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, rgba(220, 38, 38, .15));color:var(--wsx-press-sidebar-active-color, #f87171);border-left-color:var(--wsx-press-sidebar-active-color, #f87171)}@media (prefers-color-scheme: dark){html:not(.light):not([data-theme=light]) .doc-sidebar-link{color:var(--wsx-press-text-primary, #e5e7eb)}html:not(.light):not([data-theme=light]) .doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #374151);color:var(--wsx-press-text-primary, #f3f4f6)}html:not(.light):not([data-theme=light]) .doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, rgba(220, 38, 38, .15));color:var(--wsx-press-sidebar-active-color, #f87171);border-left-color:var(--wsx-press-sidebar-active-color, #f87171)}}@media (max-width: 1024px){wsx-doc-sidebar{width:240px;min-width:240px}}@media (max-width: 768px){wsx-doc-sidebar{display:none}}";var Re;let $e,Ae;function ie(t,e,r){return(e=Pe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function et(t,e,r,d,o,w){function u(i,c,h){return function(a,n){return h&&h(a),i[c].call(a,n)}}function C(i,c){for(var h=0;h<i.length;h++)i[h].call(c);return c}function v(i,c,h,a){if(typeof i!="function"&&(a||i!==void 0))throw new TypeError(c+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return i}function U(i,c,h,a,n,T,R,O,q,j,x,m,p){function S(l){if(!p(l))throw new TypeError("Attempted to access private element on non-instance")}var g,E=c[0],D=c[3],_=!O;if(!_){h||Array.isArray(E)||(E=[E]);var s={},k=[],b=n===3?"get":n===4||m?"set":"value";j?(x||m?s={get:pe(function(){return D(this)},a,"get"),set:function(l){c[4](this,l)}}:s[b]=D,x||pe(s[b],a,n===2?"":b)):x||(s=Object.getOwnPropertyDescriptor(i,a))}for(var f=i,z=E.length-1;z>=0;z-=h?2:1){var M=E[z],K=h?E[z-1]:void 0,B={},$={kind:["field","accessor","method","getter","setter","class"][n],name:a,metadata:T,addInitializer:(function(l,I){if(l.v)throw Error("attempted to call addInitializer after decoration was finished");v(I,"An initializer","be",!0),R.push(I)}).bind(null,B)};try{if(_)(g=v(M.call(K,f,$),"class decorators","return"))&&(f=g);else{var A,F;$.static=q,$.private=j,j?n===2?A=function(l){return S(l),s.value}:(n<4&&(A=u(s,"get",S)),n!==3&&(F=u(s,"set",S))):(A=function(l){return l[a]},(n<2||n===4)&&(F=function(l,I){l[a]=I}));var W=$.access={has:j?p.bind():function(l){return a in l}};if(A&&(W.get=A),F&&(W.set=F),f=M.call(K,m?{get:s.get,set:s.set}:s[b],$),m){if(typeof f=="object"&&f)(g=v(f.get,"accessor.get"))&&(s.get=g),(g=v(f.set,"accessor.set"))&&(s.set=g),(g=v(f.init,"accessor.init"))&&k.push(g);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else v(f,(x?"field":"method")+" decorators","return")&&(x?k.push(f):s[b]=f)}}finally{B.v=!0}}return(x||m)&&O.push(function(l,I){for(var H=k.length-1;H>=0;H--)I=k[H].call(l,I);return I}),x||_||(j?m?O.push(u(s,"get"),u(s,"set")):O.push(n===2?s[b]:u.call.bind(s[b])):Object.defineProperty(i,a,s)),f}function L(i,c){return Object.defineProperty(i,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:c})}if(arguments.length>=6)var N=w[Symbol.metadata||Symbol.for("Symbol.metadata")];var P=Object.create(N??null),X=function(i,c,h,a){var n,T,R=[],O=function(b){return rt(b)===i},q=new Map;function j(b){b&&R.push(C.bind(null,b))}for(var x=0;x<c.length;x++){var m=c[x];if(Array.isArray(m)){var p=m[1],S=m[2],g=m.length>3,E=16&p,D=!!(8&p),_=(p&=7)==0,s=S+"/"+D;if(!_&&!g){var k=q.get(s);if(k===!0||k===3&&p!==4||k===4&&p!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+S);q.set(s,!(p>2)||p)}U(D?i:i.prototype,m,E,g?"#"+S:Pe(S),p,a,D?T=T||[]:n=n||[],R,D,g,_,p===1,D&&g?O:h)}}return j(n),j(T),R}(t,e,o,P);return r.length||L(t,P),{e:X,get c(){var i=[];return r.length&&[L(U(t,[r],d,t.name,5,P,i),P),C.bind(null,i,t)]}}}function Pe(t){var e=tt(t,"string");return typeof e=="symbol"?e:e+""}function tt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var d=r.call(t,e);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function pe(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function rt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const it=oe.createLogger("DocSidebar");Ae=[y.autoRegister({tagName:"wsx-doc-sidebar"})];exports.DocSidebar=void 0;class st extends y.LightComponent{constructor(){super({styles:me,styleName:"wsx-doc-sidebar"}),ie(this,"_autoStyles",me),ie(this,"metadata",void 0),ie(this,"currentRoute",void 0),ie(this,"isLoading",void 0),ie(this,"routeChangeUnsubscribe",null),ie(this,"handleDocClick",(u,C)=>{C.preventDefault(),re.RouterUtils.navigate(u)});let e=this.reactive({});Object.defineProperty(this,"metadata",{get:()=>e,set:u=>{e=u!==null&&typeof u<"u"&&(Array.isArray(u)||typeof u=="object")?this.reactive(u):u,this.scheduleRerender()},enumerable:!0,configurable:!0});const[r,d]=this.useState("currentRoute","");Object.defineProperty(this,"currentRoute",{get:r,set:d,enumerable:!0,configurable:!0});const[o,w]=this.useState("isLoading",!0);Object.defineProperty(this,"isLoading",{get:o,set:w,enumerable:!0,configurable:!0})}async onConnected(){var e;(e=super.onConnected)==null||e.call(this),await this.loadMetadata(),this.routeChangeUnsubscribe=re.RouterUtils.onRouteChange(()=>{this.updateCurrentRoute()}),this.updateCurrentRoute()}onDisconnected(){var e;(e=super.onDisconnected)==null||e.call(this),this.routeChangeUnsubscribe&&(this.routeChangeUnsubscribe(),this.routeChangeUnsubscribe=null)}async loadMetadata(){try{if(this.isLoading=!0,J.data)this.metadata=J.data;else{const e=await fetch("/.wsx-press/docs-meta.json");e.ok&&(this.metadata=await e.json())}}catch(e){it.error("Failed to load metadata",e)}finally{this.isLoading=!1}}updateCurrentRoute(){const e=re.RouterUtils.getCurrentRoute();this.currentRoute=e.path}organizeByCategory(){const e={};return Object.values(this.metadata).forEach(d=>{const o=d.category||"other";e[o]||(e[o]=[]),e[o].push(d)}),Object.keys(e).sort().forEach(d=>{e[d].sort((o,w)=>o.order!==void 0&&w.order!==void 0?o.order-w.order:o.order!==void 0?-1:w.order!==void 0?1:o.title.localeCompare(w.title))}),e}isCurrentDoc(e){return this.currentRoute===e}render(){if(this.isLoading)return y.jsx("aside",{class:"doc-sidebar"},y.jsx("div",{class:"doc-sidebar-loading"},"加载中..."));const e=this.organizeByCategory(),r=Object.keys(e);return r.length===0?y.jsx("aside",{class:"doc-sidebar"},y.jsx("div",{class:"doc-sidebar-empty"},"暂无文档")):y.jsx("aside",{class:"doc-sidebar"},y.jsx("nav",{class:"doc-sidebar-nav"},r.map(d=>y.jsx("div",{key:d,class:"doc-sidebar-category"},y.jsx("h3",{class:"doc-sidebar-category-title"},d),y.jsx("ul",{class:"doc-sidebar-list"},e[d].map(o=>y.jsx("li",{key:o.route,class:"doc-sidebar-item"},y.jsx("a",{href:o.route,class:`doc-sidebar-link ${this.isCurrentDoc(o.route)?"active":""}`,onClick:w=>this.handleDocClick(o.route,w)},o.title))))))))}}Re=st;[exports.DocSidebar,$e]=et(Re,[],Ae,0,void 0,y.LightComponent).c;$e();const be="wsx-doc-toc{display:flex;flex-direction:column;width:240px;min-width:240px}.doc-toc{display:flex;flex-direction:column;width:100%;padding:1.5rem 1rem}.doc-toc-empty{padding:1rem;text-align:center;color:var(--wsx-press-text-secondary, #6b7280);font-size:.875rem}.doc-toc-title{font-size:.875rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--wsx-press-text-secondary, #6b7280);margin:0 0 1rem;padding:0}.doc-toc-nav{width:100%}.doc-toc-list{list-style:none;margin:0;padding:0}.doc-toc-sublist{margin-top:.25rem;padding-left:1rem}.doc-toc-item{margin:0;line-height:1.6}.doc-toc-item-level-1{margin-bottom:.5rem}.doc-toc-item-level-2{margin-bottom:.375rem;font-size:.875rem}.doc-toc-item-level-3{margin-bottom:.25rem;font-size:.8125rem}.doc-toc-item-level-4,.doc-toc-item-level-5,.doc-toc-item-level-6{margin-bottom:.25rem;font-size:.75rem}.doc-toc-link{display:block;color:var(--wsx-press-text-secondary, #6b7280);text-decoration:none;transition:color .2s ease;border-left:2px solid transparent;padding:.25rem 0 .25rem .5rem;margin-left:-.5rem}.doc-toc-link:hover{color:var(--wsx-press-text-primary, #111827)}.doc-toc-link.active{color:var(--wsx-press-toc-active-color, #2563eb);border-left-color:var(--wsx-press-toc-active-color, #2563eb);font-weight:500}@media (max-width: 1280px){wsx-doc-toc{display:none}}";var qe;let ze,Fe;function te(t,e,r){return(e=Ue(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ot(t,e,r,d,o,w){function u(i,c,h){return function(a,n){return h&&h(a),i[c].call(a,n)}}function C(i,c){for(var h=0;h<i.length;h++)i[h].call(c);return c}function v(i,c,h,a){if(typeof i!="function"&&(a||i!==void 0))throw new TypeError(c+" must "+(h||"be")+" a function"+(a?"":" or undefined"));return i}function U(i,c,h,a,n,T,R,O,q,j,x,m,p){function S(l){if(!p(l))throw new TypeError("Attempted to access private element on non-instance")}var g,E=c[0],D=c[3],_=!O;if(!_){h||Array.isArray(E)||(E=[E]);var s={},k=[],b=n===3?"get":n===4||m?"set":"value";j?(x||m?s={get:ye(function(){return D(this)},a,"get"),set:function(l){c[4](this,l)}}:s[b]=D,x||ye(s[b],a,n===2?"":b)):x||(s=Object.getOwnPropertyDescriptor(i,a))}for(var f=i,z=E.length-1;z>=0;z-=h?2:1){var M=E[z],K=h?E[z-1]:void 0,B={},$={kind:["field","accessor","method","getter","setter","class"][n],name:a,metadata:T,addInitializer:(function(l,I){if(l.v)throw Error("attempted to call addInitializer after decoration was finished");v(I,"An initializer","be",!0),R.push(I)}).bind(null,B)};try{if(_)(g=v(M.call(K,f,$),"class decorators","return"))&&(f=g);else{var A,F;$.static=q,$.private=j,j?n===2?A=function(l){return S(l),s.value}:(n<4&&(A=u(s,"get",S)),n!==3&&(F=u(s,"set",S))):(A=function(l){return l[a]},(n<2||n===4)&&(F=function(l,I){l[a]=I}));var W=$.access={has:j?p.bind():function(l){return a in l}};if(A&&(W.get=A),F&&(W.set=F),f=M.call(K,m?{get:s.get,set:s.set}:s[b],$),m){if(typeof f=="object"&&f)(g=v(f.get,"accessor.get"))&&(s.get=g),(g=v(f.set,"accessor.set"))&&(s.set=g),(g=v(f.init,"accessor.init"))&&k.push(g);else if(f!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else v(f,(x?"field":"method")+" decorators","return")&&(x?k.push(f):s[b]=f)}}finally{B.v=!0}}return(x||m)&&O.push(function(l,I){for(var H=k.length-1;H>=0;H--)I=k[H].call(l,I);return I}),x||_||(j?m?O.push(u(s,"get"),u(s,"set")):O.push(n===2?s[b]:u.call.bind(s[b])):Object.defineProperty(i,a,s)),f}function L(i,c){return Object.defineProperty(i,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:c})}if(arguments.length>=6)var N=w[Symbol.metadata||Symbol.for("Symbol.metadata")];var P=Object.create(N??null),X=function(i,c,h,a){var n,T,R=[],O=function(b){return nt(b)===i},q=new Map;function j(b){b&&R.push(C.bind(null,b))}for(var x=0;x<c.length;x++){var m=c[x];if(Array.isArray(m)){var p=m[1],S=m[2],g=m.length>3,E=16&p,D=!!(8&p),_=(p&=7)==0,s=S+"/"+D;if(!_&&!g){var k=q.get(s);if(k===!0||k===3&&p!==4||k===4&&p!==3)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+S);q.set(s,!(p>2)||p)}U(D?i:i.prototype,m,E,g?"#"+S:Ue(S),p,a,D?T=T||[]:n=n||[],R,D,g,_,p===1,D&&g?O:h)}}return j(n),j(T),R}(t,e,o,P);return r.length||L(t,P),{e:X,get c(){var i=[];return r.length&&[L(U(t,[r],d,t.name,5,P,i),P),C.bind(null,i,t)]}}}function Ue(t){var e=at(t,"string");return typeof e=="symbol"?e:e+""}function at(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var d=r.call(t,e);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ye(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function nt(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}const ve=oe.createLogger("DocTOC"),V={data:null,promise:null};async function ct(){return V.data?V.data:(V.promise||(V.promise=(async()=>{try{const t=await fetch("/.wsx-press/docs-toc.json");if(!t.ok)throw new Error(`Failed to load TOC data: ${t.statusText}`);const e=await t.json();return V.data=e,V.promise=null,e}catch(t){throw V.promise=null,t}})()),V.promise)}Fe=[y.autoRegister({tagName:"wsx-doc-toc"})];exports.DocTOC=void 0;class lt extends y.LightComponent{constructor(){super({styles:be,styleName:"wsx-doc-toc"}),te(this,"_autoStyles",be),te(this,"items",void 0),te(this,"activeId",void 0),te(this,"observer",null),te(this,"headingElements",new Map),te(this,"routeChangeUnsubscribe",null),te(this,"handleTOCClick",(o,w)=>{w.preventDefault();let u=this.headingElements.get(o);u||(u=document.getElementById(o),u&&this.headingElements.set(o,u)),u?(u.scrollIntoView({behavior:"smooth",block:"start"}),window.history.replaceState(null,"",`#${o}`)):ve.warn(`Heading element not found for id: ${o}`)});let e=this.reactive([]);Object.defineProperty(this,"items",{get:()=>e,set:o=>{e=o!==null&&typeof o<"u"&&(Array.isArray(o)||typeof o=="object")?this.reactive(o):o,this.scheduleRerender()},enumerable:!0,configurable:!0});const[r,d]=this.useState("activeId","");Object.defineProperty(this,"activeId",{get:r,set:d,enumerable:!0,configurable:!0})}async onConnected(){var e;(e=super.onConnected)==null||e.call(this),await this.loadTOC(),this.routeChangeUnsubscribe=re.RouterUtils.onRouteChange(()=>{this.loadTOC()})}onDisconnected(){var e;(e=super.onDisconnected)==null||e.call(this),this.observer&&(this.observer.disconnect(),this.observer=null),this.routeChangeUnsubscribe&&(this.routeChangeUnsubscribe(),this.routeChangeUnsubscribe=null)}async loadTOC(){try{const e=re.RouterUtils.getCurrentRoute();let r;if(e.path.startsWith("/docs/"))r=e.path.slice(6);else{this.items=[];return}if(!r||r.trim()===""){this.items=[];return}const d=await ct();this.items=d[r]||[],requestAnimationFrame(()=>{this.setupHeadingIds(),this.setupScrollObserver()})}catch(e){ve.error("Failed to load TOC",e),this.items=[]}}setupHeadingIds(){const e=document.querySelector(".doc-content");if(!e)return;this.headingElements.clear(),e.querySelectorAll("wsx-marked-heading").forEach(o=>{const w=o.querySelector("h1, h2, h3, h4, h5, h6");w instanceof HTMLElement&&w.id&&this.headingElements.set(w.id,w)}),e.querySelectorAll(":scope > h1, :scope > h2, :scope > h3, :scope > h4, :scope > h5, :scope > h6").forEach(o=>{var w;if(o instanceof HTMLElement)if(o.id)this.headingElements.set(o.id,o);else{const u=((w=o.textContent)==null?void 0:w.trim())||"";if(u){const C=this.generateId(u);o.id=C,this.headingElements.set(C,o)}}})}generateId(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^\p{L}\p{N}-]/gu,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}setupScrollObserver(){"IntersectionObserver"in window&&(this.observer=new IntersectionObserver(e=>{const r=e.filter(d=>d.isIntersecting);r.length>0&&(r.sort((d,o)=>{const w=d.boundingClientRect.top,u=o.boundingClientRect.top;return Math.abs(w)-Math.abs(u)}),this.activeId=r[0].target.id)},{rootMargin:"-100px 0px -80% 0px",threshold:0}),this.headingElements.forEach(e=>{var r;(r=this.observer)==null||r.observe(e)}))}renderTOCItem(e){const r=this.activeId===e.id,d=e.children.length>0;return y.jsx("li",{class:`doc-toc-item doc-toc-item-level-${e.level}`},y.jsx("a",{href:`#${e.id}`,class:`doc-toc-link ${r?"active":""}`,onClick:o=>this.handleTOCClick(e.id,o)},e.text),d&&y.jsx("ul",{class:"doc-toc-list doc-toc-sublist"},e.children.map(o=>this.renderTOCItem(o))))}render(){return this.items.length===0?y.jsx("aside",{class:"doc-toc"},y.jsx("div",{class:"doc-toc-empty"},"暂无目录")):y.jsx("aside",{class:"doc-toc"},y.jsx("h3",{class:"doc-toc-title"},"目录"),y.jsx("nav",{class:"doc-toc-nav"},y.jsx("ul",{class:"doc-toc-list"},this.items.map(e=>this.renderTOCItem(e)))))}}qe=lt;[exports.DocTOC,ze]=ot(qe,[],Fe,0,void 0,y.LightComponent).c;ze();
package/dist/client.js CHANGED
@@ -644,7 +644,7 @@ class Ve extends X {
644
644
  render() {
645
645
  return /* @__PURE__ */ C("div", { class: "doc-search" }, /* @__PURE__ */ C("div", { class: "search-input-wrapper" }, /* @__PURE__ */ C("input", { type: "text", class: "search-input", placeholder: "搜索文档...", value: this.query, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: () => {
646
646
  this.results.length > 0 && (this.isOpen = !0);
647
- }, "data-wsx-key": "DocSearch-input-text-1-1" }), this.isLoading && /* @__PURE__ */ C("div", { class: "search-loading" }, "加载中...")), this.isOpen && this.results.length > 0 && /* @__PURE__ */ C("div", { class: "search-results" }, this.results.map((e, r) => {
647
+ } }), this.isLoading && /* @__PURE__ */ C("div", { class: "search-loading" }, "加载中...")), this.isOpen && this.results.length > 0 && /* @__PURE__ */ C("div", { class: "search-results" }, this.results.map((e, r) => {
648
648
  var u, w;
649
649
  const d = r === this.selectedIndex, o = (u = e.matches) == null ? void 0 : u.find((y) => y.key === "title"), x = (w = e.matches) == null ? void 0 : w.find((y) => y.key === "content");
650
650
  return /* @__PURE__ */ C("div", { key: e.item.id, class: `search-result ${d ? "selected" : ""}`, onClick: () => this.selectResult(e), onMouseEnter: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wsxjs/wsx-press",
3
- "version": "0.0.28",
3
+ "version": "0.1.0",
4
4
  "description": "A VitePress-like documentation system built with WSXJS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -28,10 +28,10 @@
28
28
  "dependencies": {
29
29
  "fuse.js": "^7.0.0",
30
30
  "marked": "^12.0.0",
31
- "@wsxjs/wsx-core": "0.0.28",
32
- "@wsxjs/wsx-marked-components": "0.0.28",
33
- "@wsxjs/wsx-logger": "0.0.28",
34
- "@wsxjs/wsx-router": "0.0.28"
31
+ "@wsxjs/wsx-core": "0.1.0",
32
+ "@wsxjs/wsx-marked-components": "0.1.0",
33
+ "@wsxjs/wsx-router": "0.1.0",
34
+ "@wsxjs/wsx-logger": "0.1.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/fs-extra": "^11.0.4",
@@ -48,8 +48,8 @@
48
48
  "typescript": "^5.0.0",
49
49
  "vite": "^5.4.19",
50
50
  "vitest": "^2.0.0",
51
- "@wsxjs/wsx-vite-plugin": "0.0.28",
52
- "@wsxjs/eslint-plugin-wsx": "0.0.28"
51
+ "@wsxjs/eslint-plugin-wsx": "0.1.0",
52
+ "@wsxjs/wsx-vite-plugin": "0.1.0"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "typedoc": "^0.26.0",