@zephyr_zz/zephyr-ui 0.0.21 → 0.0.22
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.css +1 -1
- package/dist/types/audio/index.d.ts +0 -1
- package/dist/types/form/ZephyrForm.vue.d.ts +52 -0
- package/dist/types/form/ZephyrFormItem.vue.d.ts +26 -0
- package/dist/types/form/index.d.ts +3 -0
- package/dist/types/form/types.d.ts +29 -0
- package/dist/types/index.d.ts +4 -3
- package/dist/zephyr-ui.es.js +1314 -330
- package/dist/zephyr-ui.umd.js +13 -2
- package/package.json +46 -45
package/dist/zephyr-ui.umd.js
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(S);function j(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}return t.default=n,Object.freeze(t)}const y=j(P),Z={name:"ZzButton"},$=e.defineComponent({...Z,props:{type:{type:String,default:"primary"}},setup(n){return(t,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["zz-button",`zz-button--${n.type}`])},[e.renderSlot(t.$slots,"default",{},void 0,!0)],2))}}),C=(n,t)=>{const o=n.__vccOpts||n;for(const[a,i]of t)o[a]=i;return o},V=C($,[["__scopeId","data-v-7c55743a"]]);V.install=n=>{n.component("ZzButton",V)};class I{highlighter=null;constructor(){}async init(){try{const t=await U.createHighlighter({themes:["github-dark","vitesse-dark"],langs:["ts","vue"]});this.highlighter=t}catch(t){console.log("高亮器初始化失败",t)}}getHighlighter(){return this.highlighter}getLanguages(){return this.highlighter?.getLoadedLanguages()||[]}getThemes(){return this.highlighter?.getLoadedThemes()||[]}registerLanguage(t){return new Promise((o,a)=>{try{this.highlighter&&!this.getLanguages().includes(t)&&this.highlighter.loadLanguage(t),o(!0)}catch(i){a(i)}})}registerTheme(t){return new Promise((o,a)=>{try{this.highlighter&&!this.getThemes().includes(t)&&this.highlighter.loadTheme(t),o(!0)}catch(i){a(i)}})}}const L={name:"ZephyrEditor"},D=e.defineComponent({...L,props:{modelValue:{type:String,default:""},options:{type:Object,default:null}},emits:["update:modelValue","load"],setup(n,{expose:t,emit:o}){const a=n,i=o;let r=null;const l=e.ref(null);let c=null;const u=(s,h)=>{c&&y.languages.registerCompletionItemProvider(s,h)},d=s=>{if(r)return r.registerTheme(s).then(()=>{y.editor.setTheme(s)}).catch(h=>{console.error(h)})},f=s=>{if(r)return r.registerLanguage(s).then(()=>{y.languages.register(s)})};return e.onMounted(async()=>{if(l.value){r=new I;try{await r.init();const s=r.getHighlighter();if(!s)return;a.options?.language&&(await r.registerLanguage(a.options?.language),y.languages.register({id:a.options?.language})),a.options?.theme&&(await r.registerTheme(a.options?.theme),y.editor.setTheme(a.options?.theme)),A.shikiToMonaco(s,y),c=y.editor.create(l.value,{value:a.modelValue,...a.options||{}}),c.onDidChangeModelContent(()=>{i("update:modelValue",c?.getValue())}),i("load",{state:"success",editor:c,highlighter:r,highlighterInstance:s})}catch(s){console.log("editor is init failed",s),i("load",{state:"error",error:s})}}}),e.onUnmounted(()=>{c&&c.dispose()}),t({registerCompletionItemProvider:u,changeTheme:d,registerLanguage:f}),(s,h)=>(e.openBlock(),e.createElementBlock("div",{class:"zephyr-editor_container",ref_key:"monacoEditorRef",ref:l},null,512))}}),k=C(D,[["__scopeId","data-v-3ceef597"]]);k.install=n=>{n.component("ZzButton",k)};const W=e.defineComponent({name:"wrapperHelper",props:{is:{type:[String,Object,Function],default:null},show:{type:Boolean,default:!0},isProps:{type:Object,default:()=>({})}},setup(n,{slots:t}){return()=>{const{is:o,show:a,isProps:i}=n;if(!a)return null;if(!o)return t.default?.();let r=null,l={...i},c={};if(e.isVNode(o))r=o.type,l={...o.props,...i},c=o.children||{};else if(typeof o=="function"){const d=o();e.isVNode(d)?(r=d.type,l={...d.props,...i},c=d.children||{}):r=d}else(typeof o=="object"||typeof o=="string")&&(r=o);const u={};t.default&&(u.default=()=>t.default());for(const d in t)d!=="default"&&(u[d]=()=>t[d]());return typeof c=="object"&&Object.assign(u,c),e.h(r,l,u)}}});function F(n,t){return e.getCurrentScope()?(e.onScopeDispose(n,t),!0):!1}const H=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function q(n){return Array.isArray(n)?n:[n]}function G(n){return e.getCurrentInstance()}function X(n,t=!0,o){G()?e.onMounted(n,o):t?n():e.nextTick(n)}const B=H?window:void 0;function x(n){var t;const o=e.toValue(n);return(t=o?.$el)!==null&&t!==void 0?t:o}function Y(){const n=e.shallowRef(!1),t=e.getCurrentInstance();return t&&e.onMounted(()=>{n.value=!0},t),n}function J(n){const t=Y();return e.computed(()=>(t.value,!!n()))}function Q(n,t,o={}){const{window:a=B,...i}=o;let r;const l=J(()=>a&&"ResizeObserver"in a),c=()=>{r&&(r.disconnect(),r=void 0)},u=e.watch(e.computed(()=>{const f=e.toValue(n);return Array.isArray(f)?f.map(s=>x(s)):[x(f)]}),f=>{if(c(),l.value&&a){r=new ResizeObserver(t);for(const s of f)s&&r.observe(s,i)}},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return F(d),{isSupported:l,stop:d}}function K(n,t={width:0,height:0},o={}){const{window:a=B,box:i="content-box"}=o,r=e.computed(()=>{var s;return(s=x(n))===null||s===void 0||(s=s.namespaceURI)===null||s===void 0?void 0:s.includes("svg")}),l=e.shallowRef(t.width),c=e.shallowRef(t.height),{stop:u}=Q(n,([s])=>{const h=i==="border-box"?s.borderBoxSize:i==="content-box"?s.contentBoxSize:s.devicePixelContentBoxSize;if(a&&r.value){const g=x(n);if(g){const b=g.getBoundingClientRect();l.value=b.width,c.value=b.height}}else if(h){const g=q(h);l.value=g.reduce((b,{inlineSize:_})=>b+_,0),c.value=g.reduce((b,{blockSize:_})=>b+_,0)}else l.value=s.contentRect.width,c.value=s.contentRect.height},o);X(()=>{const s=x(n);s&&(l.value="offsetWidth"in s?s.offsetWidth:t.width,c.value="offsetHeight"in s?s.offsetHeight:t.height)});const d=e.watch(()=>x(n),s=>{l.value=s?t.width:0,c.value=s?t.height:0});function f(){u(),d()}return{width:l,height:c,stop:f}}const ee={class:"zephyr-ui_wrapper"},te={name:"ZephyrWrapper"},E=e.defineComponent({...te,props:{is:{type:[String,Object,Function],default:null},show:{type:Boolean,default:!0},isProps:{type:Object,default:()=>({})}},setup(n){const t=n,o=e.ref(),{height:a}=K(o);return(i,r)=>(e.openBlock(),e.createElementBlock("div",ee,[e.createElementVNode("div",{class:"zephyr-wrapper_container",ref_key:"wrapperRef",ref:o},[e.createVNode(e.unref(W),e.normalizeProps(e.guardReactiveProps(t)),e.createSlots({_:2},[e.renderList(Object.keys(i.$slots),(l,c)=>({name:l,fn:e.withCtx(()=>[e.renderSlot(i.$slots,l)])}))]),1040)],512),e.unref(a)?e.createCommentVNode("",!0):e.renderSlot(i.$slots,"default",{key:0})]))}});E.install=n=>{n.component("ZephyrWrapper",E)};function M(n){return new Promise(async t=>{const o=await n.arrayBuffer(),a=new AudioContext,i=await a.decodeAudioData(o);a.close(),t(i)})}const T={weak:{radius:.6,elevation:.1},medium:{radius:1.5,elevation:.3},strong:{radius:3,elevation:.6}};function R(n,t,o,a,i){const l=t%o/o*Math.PI*2;switch(n){case"left-to-right":return{x:Math.cos(l)*a,y:0,z:0};case"right-to-left":return{x:-Math.cos(l)*a,y:0,z:0};case"circle":return{x:Math.cos(l)*a,y:i,z:Math.sin(l)*a};case"front-back":return{x:0,y:0,z:Math.cos(l)*a}}}async function ne(n,t){const{mode:o,strength:a,period:i}=t,r=new OfflineAudioContext(n.numberOfChannels,n.length,n.sampleRate),l=r.createBufferSource();l.buffer=n;const c=r.createPanner();c.panningModel="HRTF",c.distanceModel="inverse",l.connect(c).connect(r.destination);const{radius:u,elevation:d}=T[a],f=n.duration,s=.05;for(let h=0;h<=f;h+=s){const g=R(o,h,i,u,d);c.positionX.setValueAtTime(g.x,h),c.positionY.setValueAtTime(g.y,h),c.positionZ.setValueAtTime(g.z,h)}return l.start(0),await r.startRendering()}function oe(n){const t=n.numberOfChannels,o=n.length*t*2+44,a=new ArrayBuffer(o),i=new DataView(a);let r=0;const l=c=>{for(let u=0;u<c.length;u++)i.setUint8(r++,c.charCodeAt(u))};l("RIFF"),i.setUint32(r,o-8,!0),r+=4,l("WAVE"),l("fmt "),i.setUint32(r,16,!0),r+=4,i.setUint16(r,1,!0),r+=2,i.setUint16(r,t,!0),r+=2,i.setUint32(r,n.sampleRate,!0),r+=4,i.setUint32(r,n.sampleRate*t*2,!0),r+=4,i.setUint16(r,t*2,!0),r+=2,i.setUint16(r,16,!0),r+=2,l("data"),i.setUint32(r,o-r-4,!0),r+=4;for(let c=0;c<n.length;c++)for(let u=0;u<t;u++){const d=n.getChannelData(u)[c];i.setInt16(r,Math.max(-1,Math.min(1,d))*32767,!0),r+=2}return new Blob([a],{type:"audio/wav"})}function re(n,t){const o=new AudioContext,a=o.createBufferSource();a.buffer=n,a.loop=!0;const i=o.createPanner();i.panningModel="HRTF",i.distanceModel="inverse",a.connect(i).connect(o.destination);const{radius:r,elevation:l}=T[t.strength],c=o.currentTime;let u=0;function d(){const f=o.currentTime-c,s=R(t.mode,f,t.period,r,l);i.positionX.value=s.x,i.positionY.value=s.y,i.positionZ.value=s.z,u=requestAnimationFrame(d)}return{play(){o.resume(),a.start(),d()},stop(){cancelAnimationFrame(u),a.stop(),o.close()}}}const ae={class:"zephyr-card"},ie={class:"upload-left"},se={class:"text"},le={class:"panel"},ce={class:"row"},de={class:"row"},pe={class:"row"},ue={class:"inline"},fe={class:"actions"},he=["disabled"],me=["disabled"],ge=["disabled"],be={key:0,class:"loading"},z=C(e.defineComponent({__name:"ZephyrAudioConverter",setup(n){const t=e.ref(null),o=e.ref(""),a=e.ref("left-to-right"),i=e.ref("medium"),r=e.ref(5),l=e.ref(!1),c=e.ref(!1),u=e.ref(null);let d=null;function f(){return{mode:a.value,strength:i.value,period:Math.max(3,r.value)}}function s(){u.value?.click()}function h(v){const p=v.target;p.files?.[0]&&(b(),t.value=p.files[0],o.value=p.files[0].name)}async function g(){if(!(!t.value||c.value)){l.value=!0;try{const v=await M(t.value);d?.stop(),d=re(v,f()),d.play(),c.value=!0}finally{l.value=!1}}}function b(){d?.stop(),d=null,c.value=!1}async function _(){if(t.value){b(),l.value=!0;try{const v=await M(t.value),p=await ne(v,f()),w=oe(p),O=URL.createObjectURL(w),N=document.createElement("a");N.href=O,N.download=`spatial-${o.value||"audio"}.wav`,N.click(),URL.revokeObjectURL(O)}finally{l.value=!1}}}return e.onBeforeUnmount(b),(v,p)=>(e.openBlock(),e.createElementBlock("div",ae,[p[10]||(p[10]=e.createElementVNode("header",{class:"header"},[e.createElementVNode("div",{class:"title"},"Zephyr Spatial Audio"),e.createElementVNode("div",{class:"sub"},"生成固定空间轨迹的 3D 音频")],-1)),e.createElementVNode("div",{class:"upload-box",onClick:s},[e.createElementVNode("div",ie,[p[3]||(p[3]=e.createElementVNode("span",{class:"icon"},"🎧",-1)),e.createElementVNode("span",se,e.toDisplayString(o.value||"选择一首音乐文件"),1)]),e.createElementVNode("button",{class:"upload-btn",type:"button",onClick:e.withModifiers(s,["stop"])}," 选择文件 "),e.createElementVNode("input",{ref_key:"fileInputRef",ref:u,class:"file-input",type:"file",accept:"audio/*",onChange:h},null,544)]),e.createElementVNode("div",le,[e.createElementVNode("div",ce,[p[5]||(p[5]=e.createElementVNode("label",null,"空间模式",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":p[0]||(p[0]=w=>a.value=w)},[...p[4]||(p[4]=[e.createElementVNode("option",{value:"left-to-right"},"左 → 右",-1),e.createElementVNode("option",{value:"right-to-left"},"右 → 左",-1),e.createElementVNode("option",{value:"circle"},"环绕",-1),e.createElementVNode("option",{value:"front-back"},"前 ↔ 后",-1)])],512),[[e.vModelSelect,a.value]])]),e.createElementVNode("div",de,[p[7]||(p[7]=e.createElementVNode("label",null,"空间强度",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":p[1]||(p[1]=w=>i.value=w)},[...p[6]||(p[6]=[e.createElementVNode("option",{value:"weak"},"弱",-1),e.createElementVNode("option",{value:"medium"},"中",-1),e.createElementVNode("option",{value:"strong"},"强",-1)])],512),[[e.vModelSelect,i.value]])]),e.createElementVNode("div",pe,[p[9]||(p[9]=e.createElementVNode("label",null,"空间周期",-1)),e.createElementVNode("div",ue,[e.withDirectives(e.createElementVNode("input",{type:"number",min:"3",step:"1","onUpdate:modelValue":p[2]||(p[2]=w=>r.value=w)},null,512),[[e.vModelText,r.value,void 0,{number:!0}]]),p[8]||(p[8]=e.createElementVNode("span",{class:"unit"},"秒 / 次",-1))])])]),e.createElementVNode("div",fe,[e.createElementVNode("button",{class:"btn ghost",disabled:!t.value||l.value||c.value,onClick:g}," 试听 ",8,he),e.createElementVNode("button",{class:"btn ghost",disabled:!c.value,onClick:b}," 停止 ",8,me),e.createElementVNode("button",{class:"btn primary",disabled:!t.value||l.value,onClick:_}," 生成空间音频 ",8,ge)]),l.value?(e.openBlock(),e.createElementBlock("div",be,"处理中…")):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-80ce589e"]]);z.install=n=>{n.component("ZephyrAudioConverter",z)};const ye=[V,k,E,z],we={install(n){ye.forEach(t=>n.component(t.name||"ZzButton",t))}};m.ZephyrAudioConverter=z,m.ZephyrEditor=k,m.ZephyrWrapper=E,m.ZzButton=V,m.default=we,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(O,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("monaco-editor-core"),require("@shikijs/monaco"),require("shiki")):typeof define=="function"&&define.amd?define(["exports","vue","monaco-editor-core","@shikijs/monaco","shiki"],a):(O=typeof globalThis<"u"?globalThis:O||self,a(O.ZephyrUI={},O.Vue,O.monaco,O.monaco$1,O.shiki))})(this,(function(O,a,ze,Pe,Re){"use strict";var oe=document.createElement("style");oe.textContent=`.zz-button[data-v-7c55743a]{padding:8px 16px;border:none;border-radius:4px;cursor:pointer;font-weight:500;transition:.2s}.zz-button--primary[data-v-7c55743a]{background:#409eff;color:#fff}.zz-button--success[data-v-7c55743a]{background:#67c23a;color:#fff}.zz-button--warning[data-v-7c55743a]{background:#e6a23c;color:#fff}.zz-button--danger[data-v-7c55743a]{background:#f56c6c;color:#fff}.zephyr-editor_container[data-v-3ceef597]{width:100%;height:100%}[data-v-80ce589e]{box-sizing:border-box}.zephyr-card[data-v-80ce589e]{width:100%;max-width:420px;padding:16px;background:#fafafa;border-radius:10px;font-family:system-ui,-apple-system,BlinkMacSystemFont,sans-serif;color:#1f2937}.header[data-v-80ce589e]{margin-bottom:12px}.title[data-v-80ce589e]{font-size:15px;font-weight:600}.sub[data-v-80ce589e]{font-size:12px;color:#6b7280}.upload-box[data-v-80ce589e]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;cursor:pointer}.upload-left[data-v-80ce589e]{display:flex;align-items:center;gap:8px;min-width:0}.upload-left .text[data-v-80ce589e]{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.upload-btn[data-v-80ce589e]{padding:6px 12px;font-size:12px;border-radius:14px;background:#ec4141;color:#fff;border:none;cursor:pointer}.file-input[data-v-80ce589e]{display:none}.panel[data-v-80ce589e]{margin-top:12px;padding:12px;background:#fff;border-radius:8px;display:grid;gap:12px}.row[data-v-80ce589e]{display:flex;align-items:center;justify-content:space-between;gap:12px}.row label[data-v-80ce589e]{font-size:12px;color:#6b7280;flex-shrink:0}.row select[data-v-80ce589e],.row input[data-v-80ce589e]{width:140px;padding:6px 8px;font-size:13px;border-radius:6px;border:1px solid #e5e7eb}.inline[data-v-80ce589e]{display:flex;align-items:center;gap:6px}.unit[data-v-80ce589e]{font-size:12px;color:#9ca3af}.actions[data-v-80ce589e]{display:grid;grid-template-columns:1fr 1fr 1.4fr;gap:8px;margin-top:14px}.btn[data-v-80ce589e]{padding:10px 0;font-size:13px;border-radius:6px;cursor:pointer}.btn.primary[data-v-80ce589e]{background:#ec4141;color:#fff;border:none}.btn.ghost[data-v-80ce589e]{background:#fff;border:1px solid #e5e7eb}.btn[data-v-80ce589e]:disabled{opacity:.5;cursor:not-allowed}.loading[data-v-80ce589e]{margin-top:10px;font-size:12px;color:#ec4141}@media(max-width:480px){.row[data-v-80ce589e]{flex-direction:column;align-items:stretch}.row select[data-v-80ce589e],.row input[data-v-80ce589e]{width:100%}.actions[data-v-80ce589e]{grid-template-columns:1fr}.btn[data-v-80ce589e]{font-size:14px}}@media(max-width:360px){.upload-btn[data-v-80ce589e]{display:none}}.form-error[data-v-d52709c1]{color:#cd4949;font-size:12px}.zephyr-form[data-v-2254561b]{box-sizing:border-box;width:100%;height:100%;padding:10px 20px 16px;background-color:#fff;border-radius:4px;overflow:auto}.zephyr-form .form-node_container+.form-node_container[data-v-2254561b]{margin-top:10px}.zephyr-form .form-node_container[data-v-2254561b]{position:relative;display:flex;align-items:start}.zephyr-form .form-node_container .form-node_label[data-v-2254561b]{color:#293358;margin-right:6px;font-size:14px;font-weight:500;white-space:nowrap}.zephyr-form .form-node_container.is-vertical[data-v-2254561b]{flex-direction:column;align-items:flex-start}.zephyr-form .form-node_container.is-vertical .form-node_label[data-v-2254561b]{margin-bottom:6px}.zephyr-form .form-node_container.is-vertical .form-node_content[data-v-2254561b]{width:100%}.zephyr-form .form-node_container.is-required[data-v-2254561b]:before{position:absolute;content:"*";color:#cd4949}.zephyr-form .form-node_container.is-required .form-node_label[data-v-2254561b]{padding-left:10px}.zephyr-form .form-node_container:has(.form-error) .form-node_label[data-v-2254561b]{color:#cd4949}.zephyr-form .form-node_content[data-v-2254561b]{display:flex;flex:1;flex-wrap:wrap;column-gap:12px;row-gap:10px}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(oe);function Ne(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const N=Ne(ze),je={name:"ZzButton"},Be=a.defineComponent({...je,props:{type:{type:String,default:"primary"}},setup(n){return(e,t)=>(a.openBlock(),a.createElementBlock("button",{class:a.normalizeClass(["zz-button",`zz-button--${n.type}`])},[a.renderSlot(e.$slots,"default",{},void 0,!0)],2))}}),M=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},U=M(Be,[["__scopeId","data-v-7c55743a"]]);U.install=n=>{n.component("ZzButton",U)};class Te{highlighter=null;constructor(){}async init(){try{const e=await Re.createHighlighter({themes:["github-dark","vitesse-dark"],langs:["ts","vue"]});this.highlighter=e}catch(e){console.log("高亮器初始化失败",e)}}getHighlighter(){return this.highlighter}getLanguages(){return this.highlighter?.getLoadedLanguages()||[]}getThemes(){return this.highlighter?.getLoadedThemes()||[]}registerLanguage(e){return new Promise((t,r)=>{try{this.highlighter&&!this.getLanguages().includes(e)&&this.highlighter.loadLanguage(e),t(!0)}catch(i){r(i)}})}registerTheme(e){return new Promise((t,r)=>{try{this.highlighter&&!this.getThemes().includes(e)&&this.highlighter.loadTheme(e),t(!0)}catch(i){r(i)}})}}const Ce={name:"ZephyrEditor"},Se=a.defineComponent({...Ce,props:{modelValue:{type:String,default:""},options:{type:Object,default:null}},emits:["update:modelValue","load"],setup(n,{expose:e,emit:t}){const r=n,i=t;let o=null;const s=a.ref(null);let c=null;const l=(f,y)=>{c&&N.languages.registerCompletionItemProvider(f,y)},u=f=>{if(o)return o.registerTheme(f).then(()=>{N.editor.setTheme(f)}).catch(y=>{console.error(y)})},h=f=>{if(o)return o.registerLanguage(f).then(()=>{N.languages.register(f)})};return a.onMounted(async()=>{if(s.value){o=new Te;try{await o.init();const f=o.getHighlighter();if(!f)return;r.options?.language&&(await o.registerLanguage(r.options?.language),N.languages.register({id:r.options?.language})),r.options?.theme&&(await o.registerTheme(r.options?.theme),N.editor.setTheme(r.options?.theme)),Pe.shikiToMonaco(f,N),c=N.editor.create(s.value,{value:r.modelValue,...r.options||{}}),c.onDidChangeModelContent(()=>{i("update:modelValue",c?.getValue())}),i("load",{state:"success",editor:c,highlighter:o,highlighterInstance:f})}catch(f){console.log("editor is init failed",f),i("load",{state:"error",error:f})}}}),a.onUnmounted(()=>{c&&c.dispose()}),e({registerCompletionItemProvider:l,changeTheme:u,registerLanguage:h}),(f,y)=>(a.openBlock(),a.createElementBlock("div",{class:"zephyr-editor_container",ref_key:"monacoEditorRef",ref:s},null,512))}}),W=M(Se,[["__scopeId","data-v-3ceef597"]]);W.install=n=>{n.component("ZzButton",W)};const Me=a.defineComponent({name:"wrapperHelper",props:{is:{type:[String,Object,Function],default:null},show:{type:Boolean,default:!0},isProps:{type:Object,default:()=>({})}},setup(n,{slots:e}){return()=>{const{is:t,show:r,isProps:i}=n;if(!r)return null;if(!t)return e.default?.();let o=null,s={...i},c={};if(a.isVNode(t))o=t.type,s={...t.props,...i},c=t.children||{};else if(typeof t=="function"){const u=t();a.isVNode(u)?(o=u.type,s={...u.props,...i},c=u.children||{}):o=u}else(typeof t=="object"||typeof t=="string")&&(o=t);const l={};e.default&&(l.default=()=>e.default());for(const u in e)u!=="default"&&(l[u]=()=>e[u]());return typeof c=="object"&&Object.assign(l,c),a.h(o,s,l)}}});function $e(n,e){return a.getCurrentScope()?(a.onScopeDispose(n,e),!0):!1}const Le=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function De(n){return Array.isArray(n)?n:[n]}function Ie(n){return a.getCurrentInstance()}function Ze(n,e=!0,t){Ie()?a.onMounted(n,t):e?n():a.nextTick(n)}const ae=Le?window:void 0;function B(n){var e;const t=a.toValue(n);return(e=t?.$el)!==null&&e!==void 0?e:t}function Ue(){const n=a.shallowRef(!1),e=a.getCurrentInstance();return e&&a.onMounted(()=>{n.value=!0},e),n}function We(n){const e=Ue();return a.computed(()=>(e.value,!!n()))}function He(n,e,t={}){const{window:r=ae,...i}=t;let o;const s=We(()=>r&&"ResizeObserver"in r),c=()=>{o&&(o.disconnect(),o=void 0)},l=a.watch(a.computed(()=>{const h=a.toValue(n);return Array.isArray(h)?h.map(f=>B(f)):[B(h)]}),h=>{if(c(),s.value&&r){o=new ResizeObserver(e);for(const f of h)f&&o.observe(f,i)}},{immediate:!0,flush:"post"}),u=()=>{c(),l()};return $e(u),{isSupported:s,stop:u}}function se(n,e={width:0,height:0},t={}){const{window:r=ae,box:i="content-box"}=t,o=a.computed(()=>{var f;return(f=B(n))===null||f===void 0||(f=f.namespaceURI)===null||f===void 0?void 0:f.includes("svg")}),s=a.shallowRef(e.width),c=a.shallowRef(e.height),{stop:l}=He(n,([f])=>{const y=i==="border-box"?f.borderBoxSize:i==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(r&&o.value){const v=B(n);if(v){const _=v.getBoundingClientRect();s.value=_.width,c.value=_.height}}else if(y){const v=De(y);s.value=v.reduce((_,{inlineSize:g})=>_+g,0),c.value=v.reduce((_,{blockSize:g})=>_+g,0)}else s.value=f.contentRect.width,c.value=f.contentRect.height},t);Ze(()=>{const f=B(n);f&&(s.value="offsetWidth"in f?f.offsetWidth:e.width,c.value="offsetHeight"in f?f.offsetHeight:e.height)});const u=a.watch(()=>B(n),f=>{s.value=f?e.width:0,c.value=f?e.height:0});function h(){l(),u()}return{width:s,height:c,stop:h}}function Ge(n,e){const{containerStyle:t,wrapperProps:r,scrollTo:i,calculateRange:o,currentList:s,containerRef:c}="itemHeight"in e?Xe(e,n):Je(e,n);return{list:s,scrollTo:i,containerProps:{ref:c,onScroll:()=>{o()},style:t},wrapperProps:r}}function ce(n){const e=a.shallowRef(null),t=se(e),r=a.ref([]),i=a.shallowRef(n);return{state:a.ref({start:0,end:10}),source:i,currentList:r,size:t,containerRef:e}}function le(n,e,t){return r=>{if(typeof t=="number")return Math.ceil(r/t);const{start:i=0}=n.value;let o=0,s=0;for(let c=i;c<e.value.length;c++){const l=t(c);if(o+=l,s=c,o>r)break}return s-i}}function fe(n,e){return t=>{if(typeof e=="number")return Math.floor(t/e)+1;let r=0,i=0;for(let o=0;o<n.value.length;o++){const s=e(o);if(r+=s,r>=t){i=o;break}}return i+1}}function de(n,e,t,r,{containerRef:i,state:o,currentList:s,source:c}){return()=>{const l=i.value;if(l){const u=t(n==="vertical"?l.scrollTop:l.scrollLeft),h=r(n==="vertical"?l.clientHeight:l.clientWidth),f=u-e,y=u+h+e;o.value={start:f<0?0:f,end:y>c.value.length?c.value.length:y},s.value=c.value.slice(o.value.start,o.value.end).map((v,_)=>({data:v,index:_+o.value.start}))}}}function ue(n,e){return t=>typeof n=="number"?t*n:e.value.slice(0,t).reduce((r,i,o)=>r+n(o),0)}function pe(n,e,t,r){a.watch([n.width,n.height,()=>a.toValue(e),t],()=>{r()})}function me(n,e){return a.computed(()=>typeof n=="number"?e.value.length*n:e.value.reduce((t,r,i)=>t+n(i),0))}const Ye={horizontal:"scrollLeft",vertical:"scrollTop"};function he(n,e,t,r){return i=>{r.value&&(r.value[Ye[n]]=t(i),e())}}function Je(n,e){const t=ce(e),{state:r,source:i,currentList:o,size:s,containerRef:c}=t,l={overflowX:"auto"},{itemWidth:u,overscan:h=5}=n,f=le(r,i,u),y=de("horizontal",h,fe(i,u),f,t),v=ue(u,i),_=a.computed(()=>v(r.value.start)),g=me(u,i);return pe(s,e,c,y),{scrollTo:he("horizontal",y,v,c),calculateRange:y,wrapperProps:a.computed(()=>({style:{height:"100%",width:`${g.value-_.value}px`,marginLeft:`${_.value}px`,display:"flex"}})),containerStyle:l,currentList:o,containerRef:c}}function Xe(n,e){const t=ce(e),{state:r,source:i,currentList:o,size:s,containerRef:c}=t,l={overflowY:"auto"},{itemHeight:u,overscan:h=5}=n,f=le(r,i,u),y=de("vertical",h,fe(i,u),f,t),v=ue(u,i),_=a.computed(()=>v(r.value.start)),g=me(u,i);return pe(s,e,c,y),{calculateRange:y,scrollTo:he("vertical",y,v,c),containerStyle:l,wrapperProps:a.computed(()=>({style:{width:"100%",height:`${g.value-_.value}px`,marginTop:`${_.value}px`}})),currentList:o,containerRef:c}}const Ke={class:"zephyr-ui_wrapper"},Qe={name:"ZephyrWrapper"},H=a.defineComponent({...Qe,props:{is:{type:[String,Object,Function],default:null},show:{type:Boolean,default:!0},isProps:{type:Object,default:()=>({})}},setup(n){const e=n,t=a.ref(),{height:r}=se(t);return(i,o)=>(a.openBlock(),a.createElementBlock("div",Ke,[a.createElementVNode("div",{class:"zephyr-wrapper_container",ref_key:"wrapperRef",ref:t},[a.createVNode(a.unref(Me),a.normalizeProps(a.guardReactiveProps(e)),a.createSlots({_:2},[a.renderList(Object.keys(i.$slots),(s,c)=>({name:s,fn:a.withCtx(()=>[a.renderSlot(i.$slots,s)])}))]),1040)],512),a.unref(r)?a.createCommentVNode("",!0):a.renderSlot(i.$slots,"default",{key:0})]))}});H.install=n=>{n.component("ZephyrWrapper",H)};function ge(n){return new Promise(async e=>{const t=await n.arrayBuffer(),r=new AudioContext,i=await r.decodeAudioData(t);r.close(),e(i)})}const ye={weak:{radius:.6,elevation:.1},medium:{radius:1.5,elevation:.3},strong:{radius:3,elevation:.6}};function ve(n,e,t,r,i){const s=e%t/t*Math.PI*2;switch(n){case"left-to-right":return{x:Math.cos(s)*r,y:0,z:0};case"right-to-left":return{x:-Math.cos(s)*r,y:0,z:0};case"circle":return{x:Math.cos(s)*r,y:i,z:Math.sin(s)*r};case"front-back":return{x:0,y:0,z:Math.cos(s)*r}}}async function et(n,e){const{mode:t,strength:r,period:i}=e,o=new OfflineAudioContext(n.numberOfChannels,n.length,n.sampleRate),s=o.createBufferSource();s.buffer=n;const c=o.createPanner();c.panningModel="HRTF",c.distanceModel="inverse",s.connect(c).connect(o.destination);const{radius:l,elevation:u}=ye[r],h=n.duration,f=.05;for(let y=0;y<=h;y+=f){const v=ve(t,y,i,l,u);c.positionX.setValueAtTime(v.x,y),c.positionY.setValueAtTime(v.y,y),c.positionZ.setValueAtTime(v.z,y)}return s.start(0),await o.startRendering()}function tt(n){const e=n.numberOfChannels,t=n.length*e*2+44,r=new ArrayBuffer(t),i=new DataView(r);let o=0;const s=c=>{for(let l=0;l<c.length;l++)i.setUint8(o++,c.charCodeAt(l))};s("RIFF"),i.setUint32(o,t-8,!0),o+=4,s("WAVE"),s("fmt "),i.setUint32(o,16,!0),o+=4,i.setUint16(o,1,!0),o+=2,i.setUint16(o,e,!0),o+=2,i.setUint32(o,n.sampleRate,!0),o+=4,i.setUint32(o,n.sampleRate*e*2,!0),o+=4,i.setUint16(o,e*2,!0),o+=2,i.setUint16(o,16,!0),o+=2,s("data"),i.setUint32(o,t-o-4,!0),o+=4;for(let c=0;c<n.length;c++)for(let l=0;l<e;l++){const u=n.getChannelData(l)[c];i.setInt16(o,Math.max(-1,Math.min(1,u))*32767,!0),o+=2}return new Blob([r],{type:"audio/wav"})}function rt(n,e){const t=new AudioContext,r=t.createBufferSource();r.buffer=n,r.loop=!0;const i=t.createPanner();i.panningModel="HRTF",i.distanceModel="inverse",r.connect(i).connect(t.destination);const{radius:o,elevation:s}=ye[e.strength],c=t.currentTime;let l=0;function u(){const h=t.currentTime-c,f=ve(e.mode,h,e.period,o,s);i.positionX.value=f.x,i.positionY.value=f.y,i.positionZ.value=f.z,l=requestAnimationFrame(u)}return{play(){t.resume(),r.start(),u()},stop(){cancelAnimationFrame(l),r.stop(),t.close()}}}const nt={class:"zephyr-card"},it={class:"upload-left"},ot={class:"text"},at={class:"panel"},st={class:"row"},ct={class:"row"},lt={class:"row"},ft={class:"inline"},dt={class:"actions"},ut=["disabled"],pt=["disabled"],mt=["disabled"],ht={key:0,class:"loading"},G=M(a.defineComponent({__name:"ZephyrAudioConverter",setup(n){const e=a.ref(null),t=a.ref(""),r=a.ref("left-to-right"),i=a.ref("medium"),o=a.ref(5),s=a.ref(!1),c=a.ref(!1),l=a.ref(null);let u=null;function h(){return{mode:r.value,strength:i.value,period:Math.max(3,o.value)}}function f(){l.value?.click()}function y(E){const d=E.target;d.files?.[0]&&(_(),e.value=d.files[0],t.value=d.files[0].name)}async function v(){if(!(!e.value||c.value)){s.value=!0;try{const E=await ge(e.value);u?.stop(),u=rt(E,h()),u.play(),c.value=!0}finally{s.value=!1}}}function _(){u?.stop(),u=null,c.value=!1}async function g(){if(e.value){_(),s.value=!0;try{const E=await ge(e.value),d=await et(E,h()),V=tt(d),p=URL.createObjectURL(V),m=document.createElement("a");m.href=p,m.download=`spatial-${t.value||"audio"}.wav`,m.click(),URL.revokeObjectURL(p)}finally{s.value=!1}}}return a.onBeforeUnmount(_),(E,d)=>(a.openBlock(),a.createElementBlock("div",nt,[d[10]||(d[10]=a.createElementVNode("header",{class:"header"},[a.createElementVNode("div",{class:"title"},"Zephyr Spatial Audio"),a.createElementVNode("div",{class:"sub"},"生成固定空间轨迹的 3D 音频")],-1)),a.createElementVNode("div",{class:"upload-box",onClick:f},[a.createElementVNode("div",it,[d[3]||(d[3]=a.createElementVNode("span",{class:"icon"},"🎧",-1)),a.createElementVNode("span",ot,a.toDisplayString(t.value||"选择一首音乐文件"),1)]),a.createElementVNode("button",{class:"upload-btn",type:"button",onClick:a.withModifiers(f,["stop"])}," 选择文件 "),a.createElementVNode("input",{ref_key:"fileInputRef",ref:l,class:"file-input",type:"file",accept:"audio/*",onChange:y},null,544)]),a.createElementVNode("div",at,[a.createElementVNode("div",st,[d[5]||(d[5]=a.createElementVNode("label",null,"空间模式",-1)),a.withDirectives(a.createElementVNode("select",{"onUpdate:modelValue":d[0]||(d[0]=V=>r.value=V)},[...d[4]||(d[4]=[a.createElementVNode("option",{value:"left-to-right"},"左 → 右",-1),a.createElementVNode("option",{value:"right-to-left"},"右 → 左",-1),a.createElementVNode("option",{value:"circle"},"环绕",-1),a.createElementVNode("option",{value:"front-back"},"前 ↔ 后",-1)])],512),[[a.vModelSelect,r.value]])]),a.createElementVNode("div",ct,[d[7]||(d[7]=a.createElementVNode("label",null,"空间强度",-1)),a.withDirectives(a.createElementVNode("select",{"onUpdate:modelValue":d[1]||(d[1]=V=>i.value=V)},[...d[6]||(d[6]=[a.createElementVNode("option",{value:"weak"},"弱",-1),a.createElementVNode("option",{value:"medium"},"中",-1),a.createElementVNode("option",{value:"strong"},"强",-1)])],512),[[a.vModelSelect,i.value]])]),a.createElementVNode("div",lt,[d[9]||(d[9]=a.createElementVNode("label",null,"空间周期",-1)),a.createElementVNode("div",ft,[a.withDirectives(a.createElementVNode("input",{type:"number",min:"3",step:"1","onUpdate:modelValue":d[2]||(d[2]=V=>o.value=V)},null,512),[[a.vModelText,o.value,void 0,{number:!0}]]),d[8]||(d[8]=a.createElementVNode("span",{class:"unit"},"秒 / 次",-1))])])]),a.createElementVNode("div",dt,[a.createElementVNode("button",{class:"btn ghost",disabled:!e.value||s.value||c.value,onClick:v}," 试听 ",8,ut),a.createElementVNode("button",{class:"btn ghost",disabled:!c.value,onClick:_}," 停止 ",8,pt),a.createElementVNode("button",{class:"btn primary",disabled:!e.value||s.value,onClick:g}," 生成空间音频 ",8,mt)]),s.value?(a.openBlock(),a.createElementBlock("div",ht,"处理中…")):a.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-80ce589e"]]);G.install=n=>{n.component("ZephyrAudioConverter",G)};function j(){return j=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},j.apply(this,arguments)}function gt(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,$(n,e)}function X(n){return X=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},X(n)}function $(n,e){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$(n,e)}function yt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Y(n,e,t){return yt()?Y=Reflect.construct.bind():Y=function(i,o,s){var c=[null];c.push.apply(c,o);var l=Function.bind.apply(i,c),u=new l;return s&&$(u,s.prototype),u},Y.apply(null,arguments)}function vt(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function K(n){var e=typeof Map=="function"?new Map:void 0;return K=function(r){if(r===null||!vt(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return Y(r,arguments,X(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),$(i,r)},K(n)}var bt=/%[sdj%]/g,be=function(){};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(be=function(e,t){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&t.every(function(r){return typeof r=="string"})&&console.warn(e,t)});function Q(n){if(!n||!n.length)return null;var e={};return n.forEach(function(t){var r=t.field;e[r]=e[r]||[],e[r].push(t)}),e}function P(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];var i=0,o=t.length;if(typeof n=="function")return n.apply(null,t);if(typeof n=="string"){var s=n.replace(bt,function(c){if(c==="%%")return"%";if(i>=o)return c;switch(c){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch{return"[Circular]"}break;default:return c}});return s}return n}function wt(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}function F(n,e){return!!(n==null||e==="array"&&Array.isArray(n)&&!n.length||wt(e)&&typeof n=="string"&&!n)}function xt(n,e,t){var r=[],i=0,o=n.length;function s(c){r.push.apply(r,c||[]),i++,i===o&&t(r)}n.forEach(function(c){e(c,s)})}function we(n,e,t){var r=0,i=n.length;function o(s){if(s&&s.length){t(s);return}var c=r;r=r+1,c<i?e(n[c],o):t([])}o([])}function _t(n){var e=[];return Object.keys(n).forEach(function(t){e.push.apply(e,n[t]||[])}),e}var xe=(function(n){gt(e,n);function e(t,r){var i;return i=n.call(this,"Async Validation Error")||this,i.errors=t,i.fields=r,i}return e})(K(Error));function Et(n,e,t,r,i){if(e.first){var o=new Promise(function(y,v){var _=function(d){return r(d),d.length?v(new xe(d,Q(d))):y(i)},g=_t(n);we(g,t,_)});return o.catch(function(y){return y}),o}var s=e.firstFields===!0?Object.keys(n):e.firstFields||[],c=Object.keys(n),l=c.length,u=0,h=[],f=new Promise(function(y,v){var _=function(E){if(h.push.apply(h,E),u++,u===l)return r(h),h.length?v(new xe(h,Q(h))):y(i)};c.length||(r(h),y(i)),c.forEach(function(g){var E=n[g];s.indexOf(g)!==-1?we(E,t,_):xt(E,t,_)})});return f.catch(function(y){return y}),f}function Ft(n){return!!(n&&n.message!==void 0)}function Vt(n,e){for(var t=n,r=0;r<e.length;r++){if(t==null)return t;t=t[e[r]]}return t}function _e(n,e){return function(t){var r;return n.fullFields?r=Vt(e,n.fullFields):r=e[t.field||n.fullField],Ft(t)?(t.field=t.field||n.fullField,t.fieldValue=r,t):{message:typeof t=="function"?t():t,fieldValue:r,field:t.field||n.fullField}}}function Ee(n,e){if(e){for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];typeof r=="object"&&typeof n[t]=="object"?n[t]=j({},n[t],r):n[t]=r}}return n}var Fe=function(e,t,r,i,o,s){e.required&&(!r.hasOwnProperty(e.field)||F(t,s||e.type))&&i.push(P(o.messages.required,e.fullField))},qt=function(e,t,r,i,o){(/^\s+$/.test(t)||t==="")&&i.push(P(o.messages.whitespace,e.fullField))},J,Ot=(function(){if(J)return J;var n="[a-fA-F\\d:]",e=function(m){return m&&m.includeBoundaries?"(?:(?<=\\s|^)(?="+n+")|(?<="+n+")(?=\\s|$))":""},t="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=(`
|
|
3
|
+
(?:
|
|
4
|
+
(?:`+r+":){7}(?:"+r+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
5
|
+
(?:`+r+":){6}(?:"+t+"|:"+r+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
6
|
+
(?:`+r+":){5}(?::"+t+"|(?::"+r+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
|
7
|
+
(?:`+r+":){4}(?:(?::"+r+"){0,1}:"+t+"|(?::"+r+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
|
8
|
+
(?:`+r+":){3}(?:(?::"+r+"){0,2}:"+t+"|(?::"+r+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
|
9
|
+
(?:`+r+":){2}(?:(?::"+r+"){0,3}:"+t+"|(?::"+r+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
10
|
+
(?:`+r+":){1}(?:(?::"+r+"){0,4}:"+t+"|(?::"+r+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
11
|
+
(?::(?:(?::`+r+"){0,5}:"+t+"|(?::"+r+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
12
|
+
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
13
|
+
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+t+"$)|(?:^"+i+"$)"),s=new RegExp("^"+t+"$"),c=new RegExp("^"+i+"$"),l=function(m){return m&&m.exact?o:new RegExp("(?:"+e(m)+t+e(m)+")|(?:"+e(m)+i+e(m)+")","g")};l.v4=function(p){return p&&p.exact?s:new RegExp(""+e(p)+t+e(p),"g")},l.v6=function(p){return p&&p.exact?c:new RegExp(""+e(p)+i+e(p),"g")};var u="(?:(?:[a-z]+:)?//)",h="(?:\\S+(?::\\S*)?@)?",f=l.v4().source,y=l.v6().source,v="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",_="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",g="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",E="(?::\\d{2,5})?",d='(?:[/?#][^\\s"]*)?',V="(?:"+u+"|www\\.)"+h+"(?:localhost|"+f+"|"+y+"|"+v+_+g+")"+E+d;return J=new RegExp("(?:^"+V+"$)","i"),J}),Ve={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},L={integer:function(e){return L.number(e)&&parseInt(e,10)===e},float:function(e){return L.number(e)&&!L.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!L.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(Ve.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(Ot())},hex:function(e){return typeof e=="string"&&!!e.match(Ve.hex)}},kt=function(e,t,r,i,o){if(e.required&&t===void 0){Fe(e,t,r,i,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],c=e.type;s.indexOf(c)>-1?L[c](t)||i.push(P(o.messages.types[c],e.fullField,e.type)):c&&typeof t!==e.type&&i.push(P(o.messages.types[c],e.fullField,e.type))},At=function(e,t,r,i,o){var s=typeof e.len=="number",c=typeof e.min=="number",l=typeof e.max=="number",u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,h=t,f=null,y=typeof t=="number",v=typeof t=="string",_=Array.isArray(t);if(y?f="number":v?f="string":_&&(f="array"),!f)return!1;_&&(h=t.length),v&&(h=t.replace(u,"_").length),s?h!==e.len&&i.push(P(o.messages[f].len,e.fullField,e.len)):c&&!l&&h<e.min?i.push(P(o.messages[f].min,e.fullField,e.min)):l&&!c&&h>e.max?i.push(P(o.messages[f].max,e.fullField,e.max)):c&&l&&(h<e.min||h>e.max)&&i.push(P(o.messages[f].range,e.fullField,e.min,e.max))},T="enum",zt=function(e,t,r,i,o){e[T]=Array.isArray(e[T])?e[T]:[],e[T].indexOf(t)===-1&&i.push(P(o.messages[T],e.fullField,e[T].join(", ")))},Pt=function(e,t,r,i,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||i.push(P(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||i.push(P(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},w={required:Fe,whitespace:qt,type:kt,range:At,enum:zt,pattern:Pt},Rt=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t,"string")&&!e.required)return r();w.required(e,t,i,s,o,"string"),F(t,"string")||(w.type(e,t,i,s,o),w.range(e,t,i,s,o),w.pattern(e,t,i,s,o),e.whitespace===!0&&w.whitespace(e,t,i,s,o))}r(s)},Nt=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t)&&!e.required)return r();w.required(e,t,i,s,o),t!==void 0&&w.type(e,t,i,s,o)}r(s)},jt=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(t===""&&(t=void 0),F(t)&&!e.required)return r();w.required(e,t,i,s,o),t!==void 0&&(w.type(e,t,i,s,o),w.range(e,t,i,s,o))}r(s)},Bt=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t)&&!e.required)return r();w.required(e,t,i,s,o),t!==void 0&&w.type(e,t,i,s,o)}r(s)},Tt=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t)&&!e.required)return r();w.required(e,t,i,s,o),F(t)||w.type(e,t,i,s,o)}r(s)},Ct=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t)&&!e.required)return r();w.required(e,t,i,s,o),t!==void 0&&(w.type(e,t,i,s,o),w.range(e,t,i,s,o))}r(s)},St=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t)&&!e.required)return r();w.required(e,t,i,s,o),t!==void 0&&(w.type(e,t,i,s,o),w.range(e,t,i,s,o))}r(s)},Mt=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(t==null&&!e.required)return r();w.required(e,t,i,s,o,"array"),t!=null&&(w.type(e,t,i,s,o),w.range(e,t,i,s,o))}r(s)},$t=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t)&&!e.required)return r();w.required(e,t,i,s,o),t!==void 0&&w.type(e,t,i,s,o)}r(s)},Lt="enum",Dt=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t)&&!e.required)return r();w.required(e,t,i,s,o),t!==void 0&&w[Lt](e,t,i,s,o)}r(s)},It=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t,"string")&&!e.required)return r();w.required(e,t,i,s,o),F(t,"string")||w.pattern(e,t,i,s,o)}r(s)},Zt=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t,"date")&&!e.required)return r();if(w.required(e,t,i,s,o),!F(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),w.type(e,l,i,s,o),l&&w.range(e,l.getTime(),i,s,o)}}r(s)},Ut=function(e,t,r,i,o){var s=[],c=Array.isArray(t)?"array":typeof t;w.required(e,t,i,s,o,c),r(s)},ee=function(e,t,r,i,o){var s=e.type,c=[],l=e.required||!e.required&&i.hasOwnProperty(e.field);if(l){if(F(t,s)&&!e.required)return r();w.required(e,t,i,c,o,s),F(t,s)||w.type(e,t,i,c,o)}r(c)},Wt=function(e,t,r,i,o){var s=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(F(t)&&!e.required)return r();w.required(e,t,i,s,o)}r(s)},D={string:Rt,method:Nt,number:jt,boolean:Bt,regexp:Tt,integer:Ct,float:St,array:Mt,object:$t,enum:Dt,pattern:It,date:Zt,url:ee,hex:ee,email:ee,required:Ut,any:Wt};function te(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var re=te(),I=(function(){function n(t){this.rules=null,this._messages=re,this.define(t)}var e=n.prototype;return e.define=function(r){var i=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(o){var s=r[o];i.rules[o]=Array.isArray(s)?s:[s]})},e.messages=function(r){return r&&(this._messages=Ee(te(),r)),this._messages},e.validate=function(r,i,o){var s=this;i===void 0&&(i={}),o===void 0&&(o=function(){});var c=r,l=i,u=o;if(typeof l=="function"&&(u=l,l={}),!this.rules||Object.keys(this.rules).length===0)return u&&u(null,c),Promise.resolve(c);function h(g){var E=[],d={};function V(m){if(Array.isArray(m)){var b;E=(b=E).concat.apply(b,m)}else E.push(m)}for(var p=0;p<g.length;p++)V(g[p]);E.length?(d=Q(E),u(E,d)):u(null,c)}if(l.messages){var f=this.messages();f===re&&(f=te()),Ee(f,l.messages),l.messages=f}else l.messages=this.messages();var y={},v=l.keys||Object.keys(this.rules);v.forEach(function(g){var E=s.rules[g],d=c[g];E.forEach(function(V){var p=V;typeof p.transform=="function"&&(c===r&&(c=j({},c)),d=c[g]=p.transform(d)),typeof p=="function"?p={validator:p}:p=j({},p),p.validator=s.getValidationMethod(p),p.validator&&(p.field=g,p.fullField=p.fullField||g,p.type=s.getType(p),y[g]=y[g]||[],y[g].push({rule:p,value:d,source:c,field:g}))})});var _={};return Et(y,l,function(g,E){var d=g.rule,V=(d.type==="object"||d.type==="array")&&(typeof d.fields=="object"||typeof d.defaultField=="object");V=V&&(d.required||!d.required&&g.value),d.field=g.field;function p(x,A){return j({},A,{fullField:d.fullField+"."+x,fullFields:d.fullFields?[].concat(d.fullFields,[x]):[x]})}function m(x){x===void 0&&(x=[]);var A=Array.isArray(x)?x:[x];!l.suppressWarning&&A.length&&n.warning("async-validator:",A),A.length&&d.message!==void 0&&(A=[].concat(d.message));var R=A.map(_e(d,c));if(l.first&&R.length)return _[d.field]=1,E(R);if(!V)E(R);else{if(d.required&&!g.value)return d.message!==void 0?R=[].concat(d.message).map(_e(d,c)):l.error&&(R=[l.error(d,P(l.messages.required,d.field))]),E(R);var q={};d.defaultField&&Object.keys(g.value).map(function(k){q[k]=d.defaultField}),q=j({},q,g.rule.fields);var C={};Object.keys(q).forEach(function(k){var z=q[k],Z=Array.isArray(z)?z:[z];C[k]=Z.map(p.bind(null,k))});var S=new n(C);S.messages(l.messages),g.rule.options&&(g.rule.options.messages=l.messages,g.rule.options.error=l.error),S.validate(g.value,g.rule.options||l,function(k){var z=[];R&&R.length&&z.push.apply(z,R),k&&k.length&&z.push.apply(z,k),E(z.length?z:null)})}}var b;if(d.asyncValidator)b=d.asyncValidator(d,g.value,m,g.source,l);else if(d.validator){try{b=d.validator(d,g.value,m,g.source,l)}catch(x){console.error?.(x),l.suppressValidatorError||setTimeout(function(){throw x},0),m(x.message)}b===!0?m():b===!1?m(typeof d.message=="function"?d.message(d.fullField||d.field):d.message||(d.fullField||d.field)+" fails"):b instanceof Array?m(b):b instanceof Error&&m(b.message)}b&&b.then&&b.then(function(){return m()},function(x){return m(x)})},function(g){h(g)},c)},e.getType=function(r){if(r.type===void 0&&r.pattern instanceof RegExp&&(r.type="pattern"),typeof r.validator!="function"&&r.type&&!D.hasOwnProperty(r.type))throw new Error(P("Unknown rule type %s",r.type));return r.type||"string"},e.getValidationMethod=function(r){if(typeof r.validator=="function")return r.validator;var i=Object.keys(r),o=i.indexOf("message");return o!==-1&&i.splice(o,1),i.length===1&&i[0]==="required"?D.required:D[this.getType(r)]||void 0},n})();I.register=function(e,t){if(typeof t!="function")throw new Error("Cannot register a validator by type, validator is not a function");D[e]=t},I.warning=be,I.messages=re,I.validators=D;const Ht={key:0,class:"form-error"},qe=M(a.defineComponent({__name:"ZephyrFormItem",props:{label:{},prop:{},rules:{}},setup(n,{expose:e}){const t=n,r=a.inject("ZephyrForm");if(!r)throw new Error("ZephyrFormItem must be used inside ZephyrForm");const i=a.ref(""),o=a.ref(!1);async function s(h){if(!t.rules?.length||!t.prop)return!0;const f=t.rules.filter(v=>!v.trigger||!h?!0:Array.isArray(v.trigger)?v.trigger.includes(h):v.trigger===h);if(!f.length)return!0;const y=new I({[t.prop]:f});try{return await y.validate({[t.prop]:r?.model[t.prop]}),o.value=!1,i.value="",!0}catch(v){return o.value=!0,i.value=v.errors?.[0]?.message??"校验失败",!1}}const c=()=>{i.value=""},l=()=>{t.prop&&(r.model[t.prop]=void 0,c())},u={prop:t.prop,validate:s,clearValidate:c,resetField:l,setError:h=>i.value=h};return a.onMounted(()=>r.addField(u)),a.onBeforeUnmount(()=>r.removeField(u)),a.watch(()=>r.model[t.prop],()=>s("change")),e({validate:s,clearValidate(){o.value=!1,i.value=""}}),(h,f)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(h.$attrs,{class:"zephyr-form-item"}),[a.renderSlot(h.$slots,"default",{},void 0,!0),i.value?(a.openBlock(),a.createElementBlock("div",Ht,a.toDisplayString(i.value),1)):a.createCommentVNode("",!0)],16))}}),[["__scopeId","data-v-d52709c1"]]),Gt={key:0,class:"form-node_label"},Yt={class:"form-node_content"},Jt=72,Oe=M(a.defineComponent({__name:"ZephyrForm",props:{formItems:{type:Array,required:!0},layout:{type:String,default:"vertical"},virtual:{type:Boolean,default:!1},rules:{type:Object,default:()=>({})}},setup(n,{expose:e}){const t=n,r=a.ref({}),i=a.reactive({}),o=[];function s(p){o.push(p)}function c(p){const m=o.indexOf(p);m!==-1&&o.splice(m,1)}async function l(){return(await Promise.all(o.map(m=>m.validate()))).every(Boolean)}a.provide("ZephyrForm",{model:i,addField:s,removeField:c});function u(p){const m=new Set;return p.forEach(b=>{b.trigger&&(Array.isArray(b.trigger)?b.trigger.forEach(x=>m.add(x)):m.add(b.trigger))}),Array.from(m)}function h(p,m){const b=o.find(x=>x.prop===p);b&&b.validate(m)}const f=a.computed(()=>{const p=i;return t.formItems.map((m,b)=>{const A=(m.children?.length?m.children:[m]).map((q,C)=>{const S=typeof q.attr=="function"?q.attr(p):q.attr??{},k={...S},z=t.rules?.[q.prop]??[],Z=q.rules??[],ne=S?.rules??[],ke=[...Array.isArray(z)?z:[z],...Array.isArray(Z)?Z:[Z],...Array.isArray(ne)?ne:[ne]].filter(Boolean);return u(ke).forEach(ie=>{const Ae="on"+ie.charAt(0).toUpperCase()+ie.slice(1),Qt=S?.[Ae];k[Ae]=(...er)=>{Qt?.(...er),h(q.prop,ie)}}),delete k.rules,{...q,key:q.prop||`node_${b}_${C}`,attr:k,rules:ke,hidden:k.hidden===!0,style:k.style??{width:"100%"}}}),R=typeof m.attr=="function"?m.attr(p):m.attr??{};return{...m,key:m.prop||`item_${b}`,hidden:R?.hidden===!0,required:A.some(q=>q.rules?.some(C=>C.required)),nodes:A}})}),y=a.computed(()=>f.value.filter(p=>!p.hidden)),{list:v,containerProps:_,wrapperProps:g}=Ge(y,{itemHeight:Jt,overscan:2});function E(){const p={};t.formItems.forEach(m=>{(m.children?.length?m.children:[m]).forEach(x=>{x.prop&&!(x.prop in p)&&(p[x.prop]=x.defaultValue??void 0)})}),Object.keys(i).forEach(m=>delete i[m]),Object.assign(i,p)}a.watch(()=>t.formItems,()=>E(),{immediate:!0});function d(p){Object.assign(i,p)}async function V({required:p}={required:!1}){return p&&!await l()?Promise.reject("表单校验失败"):{...a.toRaw(i)}}return e({setDefaultValues:d,getValues:V,formInstances:r}),(p,m)=>(a.openBlock(),a.createElementBlock("form",a.mergeProps({class:"zephyr-form"},n.virtual?a.unref(_):{}),[a.createElementVNode("div",a.normalizeProps(a.guardReactiveProps(n.virtual?a.unref(g):{})),[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.virtual?a.unref(v):y.value,b=>(a.openBlock(),a.createElementBlock("div",{key:n.virtual?b.data.key:b.key,class:a.normalizeClass(["form-node_container",{"is-required":n.virtual?b.data.required:b.required,"is-vertical":n.layout==="vertical"}])},[(n.virtual?b.data.label:b.label)?(a.openBlock(),a.createElementBlock("div",Gt,a.toDisplayString(n.virtual?b.data.label:b.label),1)):a.createCommentVNode("",!0),a.createElementVNode("div",Yt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.virtual?b.data.nodes:b.nodes,x=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:x.key},[x.hidden?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(qe,{key:0,prop:x.prop,rules:x.rules,style:a.normalizeStyle(x.style)},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(x.is),a.mergeProps({ref_for:!0},x.attr,{ref_for:!0,ref:A=>r.value[x.prop]=A,modelValue:i[x.prop],"onUpdate:modelValue":A=>i[x.prop]=A}),null,16,["modelValue","onUpdate:modelValue"]))]),_:2},1032,["prop","rules","style"]))],64))),128))])],2))),128))],16)],16))}}),[["__scopeId","data-v-2254561b"]]),Xt=[U,W,H,G,Oe,qe],Kt={install(n){Xt.forEach(e=>n.component(e.name||"ZzButton",e))}};O.ZephyrAudioConverter=G,O.ZephyrEditor=W,O.ZephyrForm=Oe,O.ZephyrWrapper=H,O.ZzButton=U,O.default=Kt,Object.defineProperties(O,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/package.json
CHANGED
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zephyr_zz/zephyr-ui",
|
|
3
|
-
"private": false,
|
|
4
|
-
"main": "dist/zephyr-ui.umd.js",
|
|
5
|
-
"module": "dist/zephyr-ui.es.js",
|
|
6
|
-
"types": "dist/types/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"import": "./dist/zephyr-ui.es.js",
|
|
10
|
-
"require": "./dist/zephyr-ui.umd.js",
|
|
11
|
-
"types": "./dist/types/index.d.ts"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"version": "0.0.
|
|
15
|
-
"type": "module",
|
|
16
|
-
"scripts": {
|
|
17
|
-
"dev": "vite",
|
|
18
|
-
"build": "vite build",
|
|
19
|
-
"preview": "vite preview"
|
|
20
|
-
},
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@shikijs/monaco": "1.29.2",
|
|
23
|
-
"@vueuse/core": "^14.0.0",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"@
|
|
30
|
-
"@vitejs/plugin-vue
|
|
31
|
-
"@vue
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"sass
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"vite
|
|
38
|
-
"vite-plugin-
|
|
39
|
-
"
|
|
40
|
-
"vue
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@zephyr_zz/zephyr-ui",
|
|
3
|
+
"private": false,
|
|
4
|
+
"main": "dist/zephyr-ui.umd.js",
|
|
5
|
+
"module": "dist/zephyr-ui.es.js",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/zephyr-ui.es.js",
|
|
10
|
+
"require": "./dist/zephyr-ui.umd.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"version": "0.0.22",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev": "vite",
|
|
18
|
+
"build": "vite build",
|
|
19
|
+
"preview": "vite preview"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@shikijs/monaco": "1.29.2",
|
|
23
|
+
"@vueuse/core": "^14.0.0",
|
|
24
|
+
"async-validator": "^4.2.5",
|
|
25
|
+
"monaco-editor-core": "0.52.2",
|
|
26
|
+
"shiki": "1.29.2"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^24.6.0",
|
|
30
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
31
|
+
"@vitejs/plugin-vue-jsx": "^5.1.1",
|
|
32
|
+
"@vue/tsconfig": "^0.8.1",
|
|
33
|
+
"element-plus": "^2.11.5",
|
|
34
|
+
"sass": "^1.93.2",
|
|
35
|
+
"sass-embedded": "^1.93.2",
|
|
36
|
+
"typescript": "~5.9.3",
|
|
37
|
+
"vite": "^7.1.7",
|
|
38
|
+
"vite-plugin-dts": "^4.5.4",
|
|
39
|
+
"vite-plugin-libcss": "^1.1.2",
|
|
40
|
+
"vue": "^3.5.22",
|
|
41
|
+
"vue-tsc": "^3.1.0"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
]
|
|
46
|
+
}
|