@sy-design/svelte 1.0.2 → 1.0.4
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/index.umd.js +1 -1
- package/package.json +6 -9
package/dist/index.umd.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(re,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(re=typeof globalThis<"u"?globalThis:re||self,Z(re["@sy-design/svelte"]={}))})(this,function(re){"use strict";var cl=Object.defineProperty;var ii=re=>{throw TypeError(re)};var ul=(re,Z,xe)=>Z in re?cl(re,Z,{enumerable:!0,configurable:!0,writable:!0,value:xe}):re[Z]=xe;var ne=(re,Z,xe)=>ul(re,typeof Z!="symbol"?Z+"":Z,xe),fl=(re,Z,xe)=>Z.has(re)||ii("Cannot "+xe);var oi=(re,Z,xe)=>Z.has(re)?ii("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(re):Z.set(re,xe);var $t=(re,Z,xe)=>(fl(re,Z,"access private method"),xe);var tt,Nn,li;function Z(){}function xe(s){return s()}function Pn(){return Object.create(null)}function me(s){s.forEach(xe)}function en(s){return typeof s=="function"}function Ct(s,e){return s!=s?e==e:s!==e||s&&typeof s=="object"||typeof s=="function"}function ri(s){return Object.keys(s).length===0}function ai(s,...e){if(s==null){for(const n of e)n(void 0);return Z}const t=s.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}const Fn=typeof window<"u";let Hn=Fn?()=>window.performance.now():()=>Date.now(),Bn=Fn?s=>requestAnimationFrame(s):Z;const it=new Set;function Un(s){it.forEach(e=>{e.c(s)||(it.delete(e),e.f())}),it.size!==0&&Bn(Un)}function ci(s){let e;return it.size===0&&Bn(Un),{promise:new Promise(t=>{it.add(e={c:s,f:t})}),abort(){it.delete(e)}}}function m(s,e){s.appendChild(e)}function W(s,e,t){s.insertBefore(e,t||null)}function U(s){s.parentNode&&s.parentNode.removeChild(s)}function ui(s,e){for(let t=0;t<s.length;t+=1)s[t]&&s[t].d(e)}function x(s){return document.createElement(s)}function Q(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function we(s){return document.createTextNode(s)}function G(){return we(" ")}function Lt(){return we("")}function H(s,e,t,n){return s.addEventListener(e,t,n),()=>s.removeEventListener(e,t,n)}function jn(s){return function(e){return e.preventDefault(),s.call(this,e)}}function r(s,e,t){t==null?s.removeAttribute(e):s.getAttribute(e)!==t&&s.setAttribute(e,t)}function fi(s){return Array.from(s.childNodes)}function Le(s,e){e=""+e,s.data!==e&&(s.data=e)}function ot(s,e){s.value=e??""}function N(s,e,t,n){t==null?s.style.removeProperty(e):s.style.setProperty(e,t,"")}function K(s,e,t){s.classList.toggle(e,!!t)}let mt;function wt(s){mt=s}function tn(){if(!mt)throw new Error("Function called outside component initialization");return mt}function Wn(s){tn().$$.on_mount.push(s)}function pi(s){tn().$$.after_update.push(s)}function hi(s){tn().$$.on_destroy.push(s)}const lt=[],rt=[];let at=[];const Gn=[],di=Promise.resolve();let nn=!1;function gi(){nn||(nn=!0,di.then(qn))}function sn(s){at.push(s)}const on=new Set;let ct=0;function qn(){if(ct!==0)return;const s=mt;do{try{for(;ct<lt.length;){const e=lt[ct];ct++,wt(e),mi(e.$$)}}catch(e){throw lt.length=0,ct=0,e}for(wt(null),lt.length=0,ct=0;rt.length;)rt.pop()();for(let e=0;e<at.length;e+=1){const t=at[e];on.has(t)||(on.add(t),t())}at.length=0}while(lt.length);for(;Gn.length;)Gn.pop()();nn=!1,on.clear(),wt(s)}function mi(s){if(s.fragment!==null){s.update(),me(s.before_update);const e=s.dirty;s.dirty=[-1],s.fragment&&s.fragment.p(s.ctx,e),s.after_update.forEach(sn)}}function wi(s){const e=[],t=[];at.forEach(n=>s.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),at=e}const Mt=new Set;let Ke;function ln(){Ke={r:0,c:[],p:Ke}}function rn(){Ke.r||me(Ke.c),Ke=Ke.p}function Me(s,e){s&&s.i&&(Mt.delete(s),s.i(e))}function We(s,e,t,n){if(s&&s.o){if(Mt.has(s))return;Mt.add(s),Ke.c.push(()=>{Mt.delete(s),n&&(t&&s.d(1),n())}),s.o(e)}else n&&n()}function ut(s){return(s==null?void 0:s.length)!==void 0?s:Array.from(s)}function Yn(s,e){s.d(1),e.delete(s.key)}function Zn(s,e,t,n,i,o,l,a,c,u,p,h){let g=s.length,d=o.length,w=g;const E={};for(;w--;)E[s[w].key]=w;const z=[],M=new Map,y=new Map,_=[];for(w=d;w--;){const A=h(i,o,w),C=t(A);let R=l.get(C);R?_.push(()=>R.p(A,e)):(R=u(C,A),R.c()),M.set(C,z[w]=R),C in E&&y.set(C,Math.abs(w-E[C]))}const k=new Set,S=new Set;function b(A){Me(A,1),A.m(a,p),l.set(A.key,A),p=A.first,d--}for(;g&&d;){const A=z[d-1],C=s[g-1],R=A.key,P=C.key;A===C?(p=A.first,g--,d--):M.has(P)?!l.has(R)||k.has(R)?b(A):S.has(P)?g--:y.get(R)>y.get(P)?(S.add(R),b(A)):(k.add(P),g--):(c(C,l),g--)}for(;g--;){const A=s[g];M.has(A.key)||c(A,l)}for(;d;)b(z[d-1]);return me(_),z}function an(s){s&&s.c()}function Ot(s,e,t){const{fragment:n,after_update:i}=s.$$;n&&n.m(e,t),sn(()=>{const o=s.$$.on_mount.map(xe).filter(en);s.$$.on_destroy?s.$$.on_destroy.push(...o):me(o),s.$$.on_mount=[]}),i.forEach(sn)}function Dt(s,e){const t=s.$$;t.fragment!==null&&(wi(t.after_update),me(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function ki(s,e){s.$$.dirty[0]===-1&&(lt.push(s),gi(),s.$$.dirty.fill(0)),s.$$.dirty[e/31|0]|=1<<e%31}function cn(s,e,t,n,i,o,l=null,a=[-1]){const c=mt;wt(s);const u=s.$$={fragment:null,ctx:[],props:o,update:Z,not_equal:i,bound:Pn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Pn(),dirty:a,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let p=!1;if(u.ctx=t?t(s,e.props||{},(h,g,...d)=>{const w=d.length?d[0]:g;return u.ctx&&i(u.ctx[h],u.ctx[h]=w)&&(!u.skip_bound&&u.bound[h]&&u.bound[h](w),p&&ki(s,h)),g}):[],u.update(),p=!0,me(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const h=fi(e.target);u.fragment&&u.fragment.l(h),h.forEach(U)}else u.fragment&&u.fragment.c();e.intro&&Me(s.$$.fragment),Ot(s,e.target,e.anchor),qn()}wt(c)}class un{constructor(){ne(this,"$$");ne(this,"$$set")}$destroy(){Dt(this,1),this.$destroy=Z}$on(e,t){if(!en(t))return Z;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!ri(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const _i="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_i);const ft=[];function bi(s,e=Z){let t;const n=new Set;function i(a){if(Ct(s,a)&&(s=a,t)){const c=!ft.length;for(const u of n)u[1](),ft.push(u,s);if(c){for(let u=0;u<ft.length;u+=2)ft[u][0](ft[u+1]);ft.length=0}}}function o(a){i(a(s))}function l(a,c=Z){const u=[a,c];return n.add(u),n.size===1&&(t=e(i,o)||Z),a(s),()=>{n.delete(u),n.size===0&&t&&(t(),t=null)}}return{set:i,update:o,subscribe:l}}function Xn(s){return Object.prototype.toString.call(s)==="[object Date]"}function fn(s,e,t,n){if(typeof t=="number"||Xn(t)){const i=n-t,o=(t-e)/(s.dt||1/60),l=s.opts.stiffness*i,a=s.opts.damping*o,c=(l-a)*s.inv_mass,u=(o+c)*s.dt;return Math.abs(u)<s.opts.precision&&Math.abs(i)<s.opts.precision?n:(s.settled=!1,Xn(t)?new Date(t.getTime()+u):t+u)}else{if(Array.isArray(t))return t.map((i,o)=>fn(s,e[o],t[o],n[o]));if(typeof t=="object"){const i={};for(const o in t)i[o]=fn(s,e[o],t[o],n[o]);return i}else throw new Error(`Cannot spring ${typeof t} values`)}}function yi(s,e={}){const t=bi(s),{stiffness:n=.15,damping:i=.8,precision:o=.01}=e;let l,a,c,u=s,p=s,h=1,g=0,d=!1;function w(z,M={}){p=z;const y=c={};return s==null||M.hard||E.stiffness>=1&&E.damping>=1?(d=!0,l=Hn(),u=z,t.set(s=p),Promise.resolve()):(M.soft&&(g=1/((M.soft===!0?.5:+M.soft)*60),h=0),a||(l=Hn(),d=!1,a=ci(_=>{if(d)return d=!1,a=null,!1;h=Math.min(h+g,1);const k={inv_mass:h,opts:E,settled:!0,dt:(_-l)*60/1e3},S=fn(k,u,s,p);return l=_,u=s,t.set(s=S),k.settled&&(a=null),!k.settled})),new Promise(_=>{a.promise.then(()=>{y===c&&_()})}))}const E={set:w,update:(z,M)=>w(z(p,s),M),subscribe:t.subscribe,stiffness:n,damping:i,precision:o};return E}async function Ti(s,e){const t=s.getReader();let n;for(;!(n=await t.read()).done;)e(n.value)}function vi(s){let e,t,n,i=!1;return function(l){e===void 0?(e=l,t=0,n=-1):e=Si(e,l);const a=e.length;let c=0;for(;t<a;){i&&(e[t]===10&&(c=++t),i=!1);let u=-1;for(;t<a&&u===-1;++t)switch(e[t]){case 58:n===-1&&(n=t-c);break;case 13:i=!0;case 10:u=t;break}if(u===-1)break;s(e.subarray(c,u),n),c=t,n=-1}c===a?e=void 0:c!==0&&(e=e.subarray(c),t-=c)}}function Ei(s,e,t){let n=Vn();const i=new TextDecoder;return function(l,a){if(l.length===0)t==null||t(n),n=Vn();else if(a>0){const c=i.decode(l.subarray(0,a)),u=a+(l[a+1]===32?2:1),p=i.decode(l.subarray(u));switch(c){case"data":n.data=n.data?n.data+`
|
1
|
+
(function(re,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(re=typeof globalThis<"u"?globalThis:re||self,Z(re["@sy-design/svelte"]=re["@sy-design/svelte"]||{}))})(this,function(re){"use strict";var cl=Object.defineProperty;var ii=re=>{throw TypeError(re)};var ul=(re,Z,xe)=>Z in re?cl(re,Z,{enumerable:!0,configurable:!0,writable:!0,value:xe}):re[Z]=xe;var ne=(re,Z,xe)=>ul(re,typeof Z!="symbol"?Z+"":Z,xe),fl=(re,Z,xe)=>Z.has(re)||ii("Cannot "+xe);var oi=(re,Z,xe)=>Z.has(re)?ii("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(re):Z.set(re,xe);var $t=(re,Z,xe)=>(fl(re,Z,"access private method"),xe);var tt,Nn,li;function Z(){}function xe(s){return s()}function Pn(){return Object.create(null)}function me(s){s.forEach(xe)}function en(s){return typeof s=="function"}function Ct(s,e){return s!=s?e==e:s!==e||s&&typeof s=="object"||typeof s=="function"}function ri(s){return Object.keys(s).length===0}function ai(s,...e){if(s==null){for(const n of e)n(void 0);return Z}const t=s.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}const Fn=typeof window<"u";let Hn=Fn?()=>window.performance.now():()=>Date.now(),Bn=Fn?s=>requestAnimationFrame(s):Z;const it=new Set;function Un(s){it.forEach(e=>{e.c(s)||(it.delete(e),e.f())}),it.size!==0&&Bn(Un)}function ci(s){let e;return it.size===0&&Bn(Un),{promise:new Promise(t=>{it.add(e={c:s,f:t})}),abort(){it.delete(e)}}}function m(s,e){s.appendChild(e)}function W(s,e,t){s.insertBefore(e,t||null)}function U(s){s.parentNode&&s.parentNode.removeChild(s)}function ui(s,e){for(let t=0;t<s.length;t+=1)s[t]&&s[t].d(e)}function x(s){return document.createElement(s)}function Q(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function we(s){return document.createTextNode(s)}function G(){return we(" ")}function Lt(){return we("")}function H(s,e,t,n){return s.addEventListener(e,t,n),()=>s.removeEventListener(e,t,n)}function jn(s){return function(e){return e.preventDefault(),s.call(this,e)}}function r(s,e,t){t==null?s.removeAttribute(e):s.getAttribute(e)!==t&&s.setAttribute(e,t)}function fi(s){return Array.from(s.childNodes)}function Le(s,e){e=""+e,s.data!==e&&(s.data=e)}function ot(s,e){s.value=e??""}function N(s,e,t,n){t==null?s.style.removeProperty(e):s.style.setProperty(e,t,"")}function K(s,e,t){s.classList.toggle(e,!!t)}let mt;function wt(s){mt=s}function tn(){if(!mt)throw new Error("Function called outside component initialization");return mt}function Wn(s){tn().$$.on_mount.push(s)}function pi(s){tn().$$.after_update.push(s)}function hi(s){tn().$$.on_destroy.push(s)}const lt=[],rt=[];let at=[];const Gn=[],di=Promise.resolve();let nn=!1;function gi(){nn||(nn=!0,di.then(qn))}function sn(s){at.push(s)}const on=new Set;let ct=0;function qn(){if(ct!==0)return;const s=mt;do{try{for(;ct<lt.length;){const e=lt[ct];ct++,wt(e),mi(e.$$)}}catch(e){throw lt.length=0,ct=0,e}for(wt(null),lt.length=0,ct=0;rt.length;)rt.pop()();for(let e=0;e<at.length;e+=1){const t=at[e];on.has(t)||(on.add(t),t())}at.length=0}while(lt.length);for(;Gn.length;)Gn.pop()();nn=!1,on.clear(),wt(s)}function mi(s){if(s.fragment!==null){s.update(),me(s.before_update);const e=s.dirty;s.dirty=[-1],s.fragment&&s.fragment.p(s.ctx,e),s.after_update.forEach(sn)}}function wi(s){const e=[],t=[];at.forEach(n=>s.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),at=e}const Mt=new Set;let Ke;function ln(){Ke={r:0,c:[],p:Ke}}function rn(){Ke.r||me(Ke.c),Ke=Ke.p}function Me(s,e){s&&s.i&&(Mt.delete(s),s.i(e))}function We(s,e,t,n){if(s&&s.o){if(Mt.has(s))return;Mt.add(s),Ke.c.push(()=>{Mt.delete(s),n&&(t&&s.d(1),n())}),s.o(e)}else n&&n()}function ut(s){return(s==null?void 0:s.length)!==void 0?s:Array.from(s)}function Yn(s,e){s.d(1),e.delete(s.key)}function Zn(s,e,t,n,i,o,l,a,c,u,p,h){let g=s.length,d=o.length,w=g;const E={};for(;w--;)E[s[w].key]=w;const z=[],M=new Map,y=new Map,_=[];for(w=d;w--;){const A=h(i,o,w),C=t(A);let R=l.get(C);R?_.push(()=>R.p(A,e)):(R=u(C,A),R.c()),M.set(C,z[w]=R),C in E&&y.set(C,Math.abs(w-E[C]))}const k=new Set,S=new Set;function b(A){Me(A,1),A.m(a,p),l.set(A.key,A),p=A.first,d--}for(;g&&d;){const A=z[d-1],C=s[g-1],R=A.key,P=C.key;A===C?(p=A.first,g--,d--):M.has(P)?!l.has(R)||k.has(R)?b(A):S.has(P)?g--:y.get(R)>y.get(P)?(S.add(R),b(A)):(k.add(P),g--):(c(C,l),g--)}for(;g--;){const A=s[g];M.has(A.key)||c(A,l)}for(;d;)b(z[d-1]);return me(_),z}function an(s){s&&s.c()}function Ot(s,e,t){const{fragment:n,after_update:i}=s.$$;n&&n.m(e,t),sn(()=>{const o=s.$$.on_mount.map(xe).filter(en);s.$$.on_destroy?s.$$.on_destroy.push(...o):me(o),s.$$.on_mount=[]}),i.forEach(sn)}function Dt(s,e){const t=s.$$;t.fragment!==null&&(wi(t.after_update),me(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function ki(s,e){s.$$.dirty[0]===-1&&(lt.push(s),gi(),s.$$.dirty.fill(0)),s.$$.dirty[e/31|0]|=1<<e%31}function cn(s,e,t,n,i,o,l=null,a=[-1]){const c=mt;wt(s);const u=s.$$={fragment:null,ctx:[],props:o,update:Z,not_equal:i,bound:Pn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Pn(),dirty:a,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let p=!1;if(u.ctx=t?t(s,e.props||{},(h,g,...d)=>{const w=d.length?d[0]:g;return u.ctx&&i(u.ctx[h],u.ctx[h]=w)&&(!u.skip_bound&&u.bound[h]&&u.bound[h](w),p&&ki(s,h)),g}):[],u.update(),p=!0,me(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const h=fi(e.target);u.fragment&&u.fragment.l(h),h.forEach(U)}else u.fragment&&u.fragment.c();e.intro&&Me(s.$$.fragment),Ot(s,e.target,e.anchor),qn()}wt(c)}class un{constructor(){ne(this,"$$");ne(this,"$$set")}$destroy(){Dt(this,1),this.$destroy=Z}$on(e,t){if(!en(t))return Z;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!ri(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const _i="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_i);const ft=[];function bi(s,e=Z){let t;const n=new Set;function i(a){if(Ct(s,a)&&(s=a,t)){const c=!ft.length;for(const u of n)u[1](),ft.push(u,s);if(c){for(let u=0;u<ft.length;u+=2)ft[u][0](ft[u+1]);ft.length=0}}}function o(a){i(a(s))}function l(a,c=Z){const u=[a,c];return n.add(u),n.size===1&&(t=e(i,o)||Z),a(s),()=>{n.delete(u),n.size===0&&t&&(t(),t=null)}}return{set:i,update:o,subscribe:l}}function Xn(s){return Object.prototype.toString.call(s)==="[object Date]"}function fn(s,e,t,n){if(typeof t=="number"||Xn(t)){const i=n-t,o=(t-e)/(s.dt||1/60),l=s.opts.stiffness*i,a=s.opts.damping*o,c=(l-a)*s.inv_mass,u=(o+c)*s.dt;return Math.abs(u)<s.opts.precision&&Math.abs(i)<s.opts.precision?n:(s.settled=!1,Xn(t)?new Date(t.getTime()+u):t+u)}else{if(Array.isArray(t))return t.map((i,o)=>fn(s,e[o],t[o],n[o]));if(typeof t=="object"){const i={};for(const o in t)i[o]=fn(s,e[o],t[o],n[o]);return i}else throw new Error(`Cannot spring ${typeof t} values`)}}function yi(s,e={}){const t=bi(s),{stiffness:n=.15,damping:i=.8,precision:o=.01}=e;let l,a,c,u=s,p=s,h=1,g=0,d=!1;function w(z,M={}){p=z;const y=c={};return s==null||M.hard||E.stiffness>=1&&E.damping>=1?(d=!0,l=Hn(),u=z,t.set(s=p),Promise.resolve()):(M.soft&&(g=1/((M.soft===!0?.5:+M.soft)*60),h=0),a||(l=Hn(),d=!1,a=ci(_=>{if(d)return d=!1,a=null,!1;h=Math.min(h+g,1);const k={inv_mass:h,opts:E,settled:!0,dt:(_-l)*60/1e3},S=fn(k,u,s,p);return l=_,u=s,t.set(s=S),k.settled&&(a=null),!k.settled})),new Promise(_=>{a.promise.then(()=>{y===c&&_()})}))}const E={set:w,update:(z,M)=>w(z(p,s),M),subscribe:t.subscribe,stiffness:n,damping:i,precision:o};return E}async function Ti(s,e){const t=s.getReader();let n;for(;!(n=await t.read()).done;)e(n.value)}function vi(s){let e,t,n,i=!1;return function(l){e===void 0?(e=l,t=0,n=-1):e=Si(e,l);const a=e.length;let c=0;for(;t<a;){i&&(e[t]===10&&(c=++t),i=!1);let u=-1;for(;t<a&&u===-1;++t)switch(e[t]){case 58:n===-1&&(n=t-c);break;case 13:i=!0;case 10:u=t;break}if(u===-1)break;s(e.subarray(c,u),n),c=t,n=-1}c===a?e=void 0:c!==0&&(e=e.subarray(c),t-=c)}}function Ei(s,e,t){let n=Vn();const i=new TextDecoder;return function(l,a){if(l.length===0)t==null||t(n),n=Vn();else if(a>0){const c=i.decode(l.subarray(0,a)),u=a+(l[a+1]===32?2:1),p=i.decode(l.subarray(u));switch(c){case"data":n.data=n.data?n.data+`
|
2
2
|
`+p:p;break;case"event":n.event=p;break;case"id":s(n.id=p);break;case"retry":const h=parseInt(p,10);isNaN(h)||e(n.retry=h);break}}}}function Si(s,e){const t=new Uint8Array(s.length+e.length);return t.set(s),t.set(e,s.length),t}function Vn(){return{data:"",event:"",id:"",retry:void 0}}var Ai=function(s,e){var t={};for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&e.indexOf(n)<0&&(t[n]=s[n]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(s);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(s,n[i])&&(t[n[i]]=s[n[i]]);return t};const pn="text/event-stream",xi=1e3,Qn="last-event-id";function Ri(s,e){var{signal:t,headers:n,onopen:i,onmessage:o,onclose:l,onerror:a,openWhenHidden:c,fetch:u}=e,p=Ai(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((h,g)=>{const d=Object.assign({},n);d.accept||(d.accept=pn);let w;function E(){w.abort(),document.hidden||S()}c||document.addEventListener("visibilitychange",E);let z=xi,M=0;function y(){document.removeEventListener("visibilitychange",E),window.clearTimeout(M),w.abort()}t==null||t.addEventListener("abort",()=>{y(),h()});const _=u??window.fetch,k=i??Ii;async function S(){var b;w=new AbortController;try{const A=await _(s,Object.assign(Object.assign({},p),{headers:d,signal:w.signal}));await k(A),await Ti(A.body,vi(Ei(C=>{C?d[Qn]=C:delete d[Qn]},C=>{z=C},o))),l==null||l(),y(),h()}catch(A){if(!w.signal.aborted)try{const C=(b=a==null?void 0:a(A))!==null&&b!==void 0?b:z;window.clearTimeout(M),M=window.setTimeout(S,C)}catch(C){y(),g(C)}}}S()})}function Ii(s){const e=s.headers.get("content-type");if(!(e!=null&&e.startsWith(pn)))throw new Error(`Expected content-type to be ${pn}, Actual: ${e}`)}function hn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Je=hn();function Kn(s){Je=s}const Jn=/[&<>"']/,zi=new RegExp(Jn.source,"g"),$n=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ci=new RegExp($n.source,"g"),Li={"&":"&","<":"<",">":">",'"':""","'":"'"},es=s=>Li[s];function Re(s,e){if(e){if(Jn.test(s))return s.replace(zi,es)}else if($n.test(s))return s.replace(Ci,es);return s}const Mi=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Oi(s){return s.replace(Mi,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Di=/(^|[^\[])\^/g;function $(s,e){let t=typeof s=="string"?s:s.source;e=e||"";const n={replace:(i,o)=>{let l=typeof o=="string"?o:o.source;return l=l.replace(Di,"$1"),t=t.replace(i,l),n},getRegex:()=>new RegExp(t,e)};return n}function ts(s){try{s=encodeURI(s).replace(/%25/g,"%")}catch{return null}return s}const kt={exec:()=>null};function ns(s,e){const t=s.replace(/\|/g,(o,l,a)=>{let c=!1,u=l;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function Nt(s,e,t){const n=s.length;if(n===0)return"";let i=0;for(;i<n;){const o=s.charAt(n-i-1);if(o===e&&!t)i++;else if(o!==e&&t)i++;else break}return s.slice(0,n-i)}function Ni(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])t++;else if(s[n]===e[1]&&(t--,t<0))return n;return-1}function ss(s,e,t,n){const i=e.href,o=e.title?Re(e.title):null,l=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:t,href:i,title:o,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,a}return{type:"image",raw:t,href:i,title:o,text:Re(l)}}function Pi(s,e){const t=s.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
|
3
3
|
`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[l]=o;return l.length>=n.length?i.slice(n.length):i}).join(`
|
4
4
|
`)}class Pt{constructor(e){ne(this,"options");ne(this,"rules");ne(this,"lexer");this.options=e||Je}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Nt(n,`
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sy-design/svelte",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.4",
|
4
4
|
"description": "跨框架组件封装",
|
5
5
|
"type": "module",
|
6
6
|
"module": "dist/index.es.js",
|
@@ -9,7 +9,8 @@
|
|
9
9
|
".": {
|
10
10
|
"import": "./dist/index.es.js",
|
11
11
|
"require": "./dist/index.umd.js"
|
12
|
-
}
|
12
|
+
},
|
13
|
+
"./style.css": "./dist/style.css"
|
13
14
|
},
|
14
15
|
"files": [
|
15
16
|
"dist"
|
@@ -18,23 +19,19 @@
|
|
18
19
|
"build": "vite build"
|
19
20
|
},
|
20
21
|
"dependencies": {
|
22
|
+
"svelte": "^4.2.10",
|
21
23
|
"@microsoft/fetch-event-source": "^2.0.1",
|
22
|
-
"dompurify": "^3.0.6",
|
23
24
|
"marked": "^11.1.0",
|
24
|
-
"
|
25
|
+
"dompurify": "^3.0.6"
|
25
26
|
},
|
26
27
|
"devDependencies": {
|
27
|
-
"@babel/cli": "^7.26.4",
|
28
|
-
"@babel/core": "^7.12.16",
|
29
|
-
"@babel/preset-env": "^7.26.0",
|
30
|
-
"@rollup/plugin-babel": "^6.0.4",
|
31
28
|
"@sveltejs/package": "^2.2.6",
|
32
29
|
"@sveltejs/vite-plugin-svelte": "^3.0.2",
|
33
30
|
"@tsconfig/svelte": "^5.0.2",
|
34
31
|
"svelte-check": "^3.6.3",
|
35
32
|
"svelte-preprocess": "^5.1.3",
|
36
|
-
"tslib": "^2.6.2",
|
37
33
|
"typescript": "^5.2.2",
|
34
|
+
"tslib": "^2.6.2",
|
38
35
|
"vite": "^5.0.10"
|
39
36
|
}
|
40
37
|
}
|