@wsxjs/wsx-press 0.0.26 → 0.0.28
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 +1 -1
- package/dist/client.js +56 -56
- package/package.json +7 -7
- package/src/client/components/DocTOC.css +1 -5
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;height:100%;overflow-y:auto;position:sticky;top:70px;max-height:calc(100vh - 70px)}.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)},"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();
|
package/dist/client.js
CHANGED
|
@@ -6,9 +6,9 @@ import { DocumentLoadError as te } from "./index.js";
|
|
|
6
6
|
import le from "fuse.js";
|
|
7
7
|
const de = ".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}";
|
|
8
8
|
var Ce;
|
|
9
|
-
let Se,
|
|
9
|
+
let Se, Ee;
|
|
10
10
|
function G(t, e, r) {
|
|
11
|
-
return (e =
|
|
11
|
+
return (e = ke(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
|
|
12
12
|
}
|
|
13
13
|
function Ue(t, e, r, d, o, x) {
|
|
14
14
|
function u(i, c, h) {
|
|
@@ -25,12 +25,12 @@ function Ue(t, e, r, d, o, x) {
|
|
|
25
25
|
return i;
|
|
26
26
|
}
|
|
27
27
|
function H(i, c, h, a, n, L, $, O, z, S, v, m, p) {
|
|
28
|
-
function
|
|
28
|
+
function E(l) {
|
|
29
29
|
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
30
30
|
}
|
|
31
|
-
var f,
|
|
31
|
+
var f, k = c[0], D = c[3], T = !O;
|
|
32
32
|
if (!T) {
|
|
33
|
-
h || Array.isArray(
|
|
33
|
+
h || Array.isArray(k) || (k = [k]);
|
|
34
34
|
var s = {}, _ = [], b = n === 3 ? "get" : n === 4 || m ? "set" : "value";
|
|
35
35
|
S ? (v || m ? s = { get: ue(function() {
|
|
36
36
|
return D(this);
|
|
@@ -38,8 +38,8 @@ function Ue(t, e, r, d, o, x) {
|
|
|
38
38
|
c[4](this, l);
|
|
39
39
|
} } : s[b] = D, v || ue(s[b], a, n === 2 ? "" : b)) : v || (s = Object.getOwnPropertyDescriptor(i, a));
|
|
40
40
|
}
|
|
41
|
-
for (var g = i, q =
|
|
42
|
-
var U =
|
|
41
|
+
for (var g = i, q = k.length - 1; q >= 0; q -= h ? 2 : 1) {
|
|
42
|
+
var U = k[q], K = h ? k[q - 1] : void 0, B = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: a, metadata: L, addInitializer: (function(l, I) {
|
|
43
43
|
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
44
44
|
y(I, "An initializer", "be", !0), $.push(I);
|
|
45
45
|
}).bind(null, B) };
|
|
@@ -48,8 +48,8 @@ function Ue(t, e, r, d, o, x) {
|
|
|
48
48
|
else {
|
|
49
49
|
var A, F;
|
|
50
50
|
R.static = z, R.private = S, S ? n === 2 ? A = function(l) {
|
|
51
|
-
return
|
|
52
|
-
} : (n < 4 && (A = u(s, "get",
|
|
51
|
+
return E(l), s.value;
|
|
52
|
+
} : (n < 4 && (A = u(s, "get", E)), n !== 3 && (F = u(s, "set", E))) : (A = function(l) {
|
|
53
53
|
return l[a];
|
|
54
54
|
}, (n < 2 || n === 4) && (F = function(l, I) {
|
|
55
55
|
l[a] = I;
|
|
@@ -85,13 +85,13 @@ function Ue(t, e, r, d, o, x) {
|
|
|
85
85
|
for (var v = 0; v < c.length; v++) {
|
|
86
86
|
var m = c[v];
|
|
87
87
|
if (Array.isArray(m)) {
|
|
88
|
-
var p = m[1],
|
|
88
|
+
var p = m[1], E = m[2], f = m.length > 3, k = 16 & p, D = !!(8 & p), T = (p &= 7) == 0, s = E + "/" + D;
|
|
89
89
|
if (!T && !f) {
|
|
90
90
|
var _ = z.get(s);
|
|
91
|
-
if (_ === !0 || _ === 3 && p !== 4 || _ === 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: " +
|
|
91
|
+
if (_ === !0 || _ === 3 && p !== 4 || _ === 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: " + E);
|
|
92
92
|
z.set(s, !(p > 2) || p);
|
|
93
93
|
}
|
|
94
|
-
H(D ? i : i.prototype, m,
|
|
94
|
+
H(D ? i : i.prototype, m, k, f ? "#" + E : ke(E), p, a, D ? L = L || [] : n = n || [], $, D, f, T, p === 1, D && f ? O : h);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
return S(n), S(L), $;
|
|
@@ -101,7 +101,7 @@ function Ue(t, e, r, d, o, x) {
|
|
|
101
101
|
return r.length && [j(H(t, [r], d, t.name, 5, P, i), P), w.bind(null, i, t)];
|
|
102
102
|
} };
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function ke(t) {
|
|
105
105
|
var e = Ke(t, "string");
|
|
106
106
|
return typeof e == "symbol" ? e : e + "";
|
|
107
107
|
}
|
|
@@ -171,7 +171,7 @@ async function We() {
|
|
|
171
171
|
}
|
|
172
172
|
})()), J.promise);
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
Ee = [oe({
|
|
175
175
|
tagName: "wsx-doc-page"
|
|
176
176
|
})];
|
|
177
177
|
let Ye;
|
|
@@ -362,7 +362,7 @@ class Ge extends X {
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
Ce = Ge;
|
|
365
|
-
[Ye, Se] = Ue(Ce, [],
|
|
365
|
+
[Ye, Se] = Ue(Ce, [], Ee, 0, void 0, X).c;
|
|
366
366
|
Se();
|
|
367
367
|
const he = ".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}";
|
|
368
368
|
var _e;
|
|
@@ -385,12 +385,12 @@ function Je(t, e, r, d, o, x) {
|
|
|
385
385
|
return i;
|
|
386
386
|
}
|
|
387
387
|
function H(i, c, h, a, n, L, $, O, z, S, v, m, p) {
|
|
388
|
-
function
|
|
388
|
+
function E(l) {
|
|
389
389
|
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
390
390
|
}
|
|
391
|
-
var f,
|
|
391
|
+
var f, k = c[0], D = c[3], T = !O;
|
|
392
392
|
if (!T) {
|
|
393
|
-
h || Array.isArray(
|
|
393
|
+
h || Array.isArray(k) || (k = [k]);
|
|
394
394
|
var s = {}, _ = [], b = n === 3 ? "get" : n === 4 || m ? "set" : "value";
|
|
395
395
|
S ? (v || m ? s = { get: fe(function() {
|
|
396
396
|
return D(this);
|
|
@@ -398,8 +398,8 @@ function Je(t, e, r, d, o, x) {
|
|
|
398
398
|
c[4](this, l);
|
|
399
399
|
} } : s[b] = D, v || fe(s[b], a, n === 2 ? "" : b)) : v || (s = Object.getOwnPropertyDescriptor(i, a));
|
|
400
400
|
}
|
|
401
|
-
for (var g = i, q =
|
|
402
|
-
var U =
|
|
401
|
+
for (var g = i, q = k.length - 1; q >= 0; q -= h ? 2 : 1) {
|
|
402
|
+
var U = k[q], K = h ? k[q - 1] : void 0, B = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: a, metadata: L, addInitializer: (function(l, I) {
|
|
403
403
|
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
404
404
|
y(I, "An initializer", "be", !0), $.push(I);
|
|
405
405
|
}).bind(null, B) };
|
|
@@ -408,8 +408,8 @@ function Je(t, e, r, d, o, x) {
|
|
|
408
408
|
else {
|
|
409
409
|
var A, F;
|
|
410
410
|
R.static = z, R.private = S, S ? n === 2 ? A = function(l) {
|
|
411
|
-
return
|
|
412
|
-
} : (n < 4 && (A = u(s, "get",
|
|
411
|
+
return E(l), s.value;
|
|
412
|
+
} : (n < 4 && (A = u(s, "get", E)), n !== 3 && (F = u(s, "set", E))) : (A = function(l) {
|
|
413
413
|
return l[a];
|
|
414
414
|
}, (n < 2 || n === 4) && (F = function(l, I) {
|
|
415
415
|
l[a] = I;
|
|
@@ -445,13 +445,13 @@ function Je(t, e, r, d, o, x) {
|
|
|
445
445
|
for (var v = 0; v < c.length; v++) {
|
|
446
446
|
var m = c[v];
|
|
447
447
|
if (Array.isArray(m)) {
|
|
448
|
-
var p = m[1],
|
|
448
|
+
var p = m[1], E = m[2], f = m.length > 3, k = 16 & p, D = !!(8 & p), T = (p &= 7) == 0, s = E + "/" + D;
|
|
449
449
|
if (!T && !f) {
|
|
450
450
|
var _ = z.get(s);
|
|
451
|
-
if (_ === !0 || _ === 3 && p !== 4 || _ === 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: " +
|
|
451
|
+
if (_ === !0 || _ === 3 && p !== 4 || _ === 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: " + E);
|
|
452
452
|
z.set(s, !(p > 2) || p);
|
|
453
453
|
}
|
|
454
|
-
H(D ? i : i.prototype, m,
|
|
454
|
+
H(D ? i : i.prototype, m, k, f ? "#" + E : Te(E), p, a, D ? L = L || [] : n = n || [], $, D, f, T, p === 1, D && f ? O : h);
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
return S(n), S(L), $;
|
|
@@ -677,12 +677,12 @@ function et(t, e, r, d, o, x) {
|
|
|
677
677
|
return i;
|
|
678
678
|
}
|
|
679
679
|
function H(i, c, h, a, n, L, $, O, z, S, v, m, p) {
|
|
680
|
-
function
|
|
680
|
+
function E(l) {
|
|
681
681
|
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
682
682
|
}
|
|
683
|
-
var f,
|
|
683
|
+
var f, k = c[0], D = c[3], T = !O;
|
|
684
684
|
if (!T) {
|
|
685
|
-
h || Array.isArray(
|
|
685
|
+
h || Array.isArray(k) || (k = [k]);
|
|
686
686
|
var s = {}, _ = [], b = n === 3 ? "get" : n === 4 || m ? "set" : "value";
|
|
687
687
|
S ? (v || m ? s = { get: pe(function() {
|
|
688
688
|
return D(this);
|
|
@@ -690,8 +690,8 @@ function et(t, e, r, d, o, x) {
|
|
|
690
690
|
c[4](this, l);
|
|
691
691
|
} } : s[b] = D, v || pe(s[b], a, n === 2 ? "" : b)) : v || (s = Object.getOwnPropertyDescriptor(i, a));
|
|
692
692
|
}
|
|
693
|
-
for (var g = i, q =
|
|
694
|
-
var U =
|
|
693
|
+
for (var g = i, q = k.length - 1; q >= 0; q -= h ? 2 : 1) {
|
|
694
|
+
var U = k[q], K = h ? k[q - 1] : void 0, B = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: a, metadata: L, addInitializer: (function(l, I) {
|
|
695
695
|
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
696
696
|
y(I, "An initializer", "be", !0), $.push(I);
|
|
697
697
|
}).bind(null, B) };
|
|
@@ -700,8 +700,8 @@ function et(t, e, r, d, o, x) {
|
|
|
700
700
|
else {
|
|
701
701
|
var A, F;
|
|
702
702
|
R.static = z, R.private = S, S ? n === 2 ? A = function(l) {
|
|
703
|
-
return
|
|
704
|
-
} : (n < 4 && (A = u(s, "get",
|
|
703
|
+
return E(l), s.value;
|
|
704
|
+
} : (n < 4 && (A = u(s, "get", E)), n !== 3 && (F = u(s, "set", E))) : (A = function(l) {
|
|
705
705
|
return l[a];
|
|
706
706
|
}, (n < 2 || n === 4) && (F = function(l, I) {
|
|
707
707
|
l[a] = I;
|
|
@@ -737,13 +737,13 @@ function et(t, e, r, d, o, x) {
|
|
|
737
737
|
for (var v = 0; v < c.length; v++) {
|
|
738
738
|
var m = c[v];
|
|
739
739
|
if (Array.isArray(m)) {
|
|
740
|
-
var p = m[1],
|
|
740
|
+
var p = m[1], E = m[2], f = m.length > 3, k = 16 & p, D = !!(8 & p), T = (p &= 7) == 0, s = E + "/" + D;
|
|
741
741
|
if (!T && !f) {
|
|
742
742
|
var _ = z.get(s);
|
|
743
|
-
if (_ === !0 || _ === 3 && p !== 4 || _ === 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: " +
|
|
743
|
+
if (_ === !0 || _ === 3 && p !== 4 || _ === 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: " + E);
|
|
744
744
|
z.set(s, !(p > 2) || p);
|
|
745
745
|
}
|
|
746
|
-
H(D ? i : i.prototype, m,
|
|
746
|
+
H(D ? i : i.prototype, m, k, f ? "#" + E : Re(E), p, a, D ? L = L || [] : n = n || [], $, D, f, T, p === 1, D && f ? O : h);
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
749
|
return S(n), S(L), $;
|
|
@@ -835,12 +835,12 @@ function ot(t, e, r, d, o, x) {
|
|
|
835
835
|
return i;
|
|
836
836
|
}
|
|
837
837
|
function H(i, c, h, a, n, L, $, O, z, S, v, m, p) {
|
|
838
|
-
function
|
|
838
|
+
function E(l) {
|
|
839
839
|
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
840
840
|
}
|
|
841
|
-
var f,
|
|
841
|
+
var f, k = c[0], D = c[3], T = !O;
|
|
842
842
|
if (!T) {
|
|
843
|
-
h || Array.isArray(
|
|
843
|
+
h || Array.isArray(k) || (k = [k]);
|
|
844
844
|
var s = {}, _ = [], b = n === 3 ? "get" : n === 4 || m ? "set" : "value";
|
|
845
845
|
S ? (v || m ? s = { get: ye(function() {
|
|
846
846
|
return D(this);
|
|
@@ -848,8 +848,8 @@ function ot(t, e, r, d, o, x) {
|
|
|
848
848
|
c[4](this, l);
|
|
849
849
|
} } : s[b] = D, v || ye(s[b], a, n === 2 ? "" : b)) : v || (s = Object.getOwnPropertyDescriptor(i, a));
|
|
850
850
|
}
|
|
851
|
-
for (var g = i, q =
|
|
852
|
-
var U =
|
|
851
|
+
for (var g = i, q = k.length - 1; q >= 0; q -= h ? 2 : 1) {
|
|
852
|
+
var U = k[q], K = h ? k[q - 1] : void 0, B = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: a, metadata: L, addInitializer: (function(l, I) {
|
|
853
853
|
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
854
854
|
y(I, "An initializer", "be", !0), $.push(I);
|
|
855
855
|
}).bind(null, B) };
|
|
@@ -858,8 +858,8 @@ function ot(t, e, r, d, o, x) {
|
|
|
858
858
|
else {
|
|
859
859
|
var A, F;
|
|
860
860
|
R.static = z, R.private = S, S ? n === 2 ? A = function(l) {
|
|
861
|
-
return
|
|
862
|
-
} : (n < 4 && (A = u(s, "get",
|
|
861
|
+
return E(l), s.value;
|
|
862
|
+
} : (n < 4 && (A = u(s, "get", E)), n !== 3 && (F = u(s, "set", E))) : (A = function(l) {
|
|
863
863
|
return l[a];
|
|
864
864
|
}, (n < 2 || n === 4) && (F = function(l, I) {
|
|
865
865
|
l[a] = I;
|
|
@@ -895,13 +895,13 @@ function ot(t, e, r, d, o, x) {
|
|
|
895
895
|
for (var v = 0; v < c.length; v++) {
|
|
896
896
|
var m = c[v];
|
|
897
897
|
if (Array.isArray(m)) {
|
|
898
|
-
var p = m[1],
|
|
898
|
+
var p = m[1], E = m[2], f = m.length > 3, k = 16 & p, D = !!(8 & p), T = (p &= 7) == 0, s = E + "/" + D;
|
|
899
899
|
if (!T && !f) {
|
|
900
900
|
var _ = z.get(s);
|
|
901
|
-
if (_ === !0 || _ === 3 && p !== 4 || _ === 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: " +
|
|
901
|
+
if (_ === !0 || _ === 3 && p !== 4 || _ === 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: " + E);
|
|
902
902
|
z.set(s, !(p > 2) || p);
|
|
903
903
|
}
|
|
904
|
-
H(D ? i : i.prototype, m,
|
|
904
|
+
H(D ? i : i.prototype, m, k, f ? "#" + E : qe(E), p, a, D ? L = L || [] : n = n || [], $, D, f, T, p === 1, D && f ? O : h);
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
907
|
return S(n), S(L), $;
|
|
@@ -1036,7 +1036,7 @@ class dt extends X {
|
|
|
1036
1036
|
Ae = dt;
|
|
1037
1037
|
[lt, Pe] = ot(Ae, [], ze, 0, void 0, X).c;
|
|
1038
1038
|
Pe();
|
|
1039
|
-
const ve = "wsx-doc-toc{display:flex;flex-direction:column;width:240px;min-width:240px
|
|
1039
|
+
const ve = "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}}";
|
|
1040
1040
|
var Fe;
|
|
1041
1041
|
let He, Ne;
|
|
1042
1042
|
function re(t, e, r) {
|
|
@@ -1057,12 +1057,12 @@ function ut(t, e, r, d, o, x) {
|
|
|
1057
1057
|
return i;
|
|
1058
1058
|
}
|
|
1059
1059
|
function H(i, c, h, a, n, L, $, O, z, S, v, m, p) {
|
|
1060
|
-
function
|
|
1060
|
+
function E(l) {
|
|
1061
1061
|
if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
|
|
1062
1062
|
}
|
|
1063
|
-
var f,
|
|
1063
|
+
var f, k = c[0], D = c[3], T = !O;
|
|
1064
1064
|
if (!T) {
|
|
1065
|
-
h || Array.isArray(
|
|
1065
|
+
h || Array.isArray(k) || (k = [k]);
|
|
1066
1066
|
var s = {}, _ = [], b = n === 3 ? "get" : n === 4 || m ? "set" : "value";
|
|
1067
1067
|
S ? (v || m ? s = { get: xe(function() {
|
|
1068
1068
|
return D(this);
|
|
@@ -1070,8 +1070,8 @@ function ut(t, e, r, d, o, x) {
|
|
|
1070
1070
|
c[4](this, l);
|
|
1071
1071
|
} } : s[b] = D, v || xe(s[b], a, n === 2 ? "" : b)) : v || (s = Object.getOwnPropertyDescriptor(i, a));
|
|
1072
1072
|
}
|
|
1073
|
-
for (var g = i, q =
|
|
1074
|
-
var U =
|
|
1073
|
+
for (var g = i, q = k.length - 1; q >= 0; q -= h ? 2 : 1) {
|
|
1074
|
+
var U = k[q], K = h ? k[q - 1] : void 0, B = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][n], name: a, metadata: L, addInitializer: (function(l, I) {
|
|
1075
1075
|
if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
|
|
1076
1076
|
y(I, "An initializer", "be", !0), $.push(I);
|
|
1077
1077
|
}).bind(null, B) };
|
|
@@ -1080,8 +1080,8 @@ function ut(t, e, r, d, o, x) {
|
|
|
1080
1080
|
else {
|
|
1081
1081
|
var A, F;
|
|
1082
1082
|
R.static = z, R.private = S, S ? n === 2 ? A = function(l) {
|
|
1083
|
-
return
|
|
1084
|
-
} : (n < 4 && (A = u(s, "get",
|
|
1083
|
+
return E(l), s.value;
|
|
1084
|
+
} : (n < 4 && (A = u(s, "get", E)), n !== 3 && (F = u(s, "set", E))) : (A = function(l) {
|
|
1085
1085
|
return l[a];
|
|
1086
1086
|
}, (n < 2 || n === 4) && (F = function(l, I) {
|
|
1087
1087
|
l[a] = I;
|
|
@@ -1117,13 +1117,13 @@ function ut(t, e, r, d, o, x) {
|
|
|
1117
1117
|
for (var v = 0; v < c.length; v++) {
|
|
1118
1118
|
var m = c[v];
|
|
1119
1119
|
if (Array.isArray(m)) {
|
|
1120
|
-
var p = m[1],
|
|
1120
|
+
var p = m[1], E = m[2], f = m.length > 3, k = 16 & p, D = !!(8 & p), T = (p &= 7) == 0, s = E + "/" + D;
|
|
1121
1121
|
if (!T && !f) {
|
|
1122
1122
|
var _ = z.get(s);
|
|
1123
|
-
if (_ === !0 || _ === 3 && p !== 4 || _ === 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: " +
|
|
1123
|
+
if (_ === !0 || _ === 3 && p !== 4 || _ === 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: " + E);
|
|
1124
1124
|
z.set(s, !(p > 2) || p);
|
|
1125
1125
|
}
|
|
1126
|
-
H(D ? i : i.prototype, m,
|
|
1126
|
+
H(D ? i : i.prototype, m, k, f ? "#" + E : Me(E), p, a, D ? L = L || [] : n = n || [], $, D, f, T, p === 1, D && f ? O : h);
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
1129
|
return S(n), S(L), $;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wsxjs/wsx-press",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
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.
|
|
32
|
-
"@wsxjs/wsx-
|
|
33
|
-
"@wsxjs/wsx-
|
|
34
|
-
"@wsxjs/wsx-router": "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"
|
|
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/
|
|
52
|
-
"@wsxjs/
|
|
51
|
+
"@wsxjs/wsx-vite-plugin": "0.0.28",
|
|
52
|
+
"@wsxjs/eslint-plugin-wsx": "0.0.28"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"typedoc": "^0.26.0",
|
|
@@ -3,11 +3,7 @@ wsx-doc-toc {
|
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: 240px;
|
|
5
5
|
min-width: 240px;
|
|
6
|
-
|
|
7
|
-
overflow-y: auto;
|
|
8
|
-
position: sticky;
|
|
9
|
-
top: 70px; /* Navigation height */
|
|
10
|
-
max-height: calc(100vh - 70px);
|
|
6
|
+
/* TOC scrolls with content instead of staying fixed at top */
|
|
11
7
|
}
|
|
12
8
|
|
|
13
9
|
.doc-toc {
|