Socket
Socket
Sign inDemoInstall

monaco-editor-vue3

Package Overview
Dependencies
23
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.5 to 0.1.6

src/main.ts

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## [0.1.6](https://github.com/bazingaedward/monaco-editor-vue3/compare/v0.1.4...v0.1.6) (2022-08-08)
* fix [v-model:value support](https://github.com/bazingaedward/monaco-editor-vue3/issues/5)
* Docs added Vite Stackblitz Demo
## 0.1.1 (2021-07-01)

@@ -2,0 +6,0 @@

@@ -1,1 +0,683 @@

var t=Object.defineProperty,e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;import*as s from"monaco-editor";function i(t,e){const n=Object.create(null),r=t.split(",");for(let o=0;o<r.length;o++)n[r[o]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}const l=i("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt");function c(t){if(w(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],o=c(M(r)?f(r):r);if(o)for(const t in o)e[t]=o[t]}return e}if(O(t))return t}const a=/;(?![^(]*\))/g,u=/:(.+)/;function f(t){const e={};return t.split(a).forEach((t=>{if(t){const n=t.split(u);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function d(t){let e="";if(M(t))e=t;else if(w(t))for(let n=0;n<t.length;n++){const r=d(t[n]);r&&(e+=r+" ")}else if(O(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const h={},p=[],g=()=>{},_=/^on[^a-z]/,v=t=>_.test(t),y=Object.assign,m=Object.prototype.hasOwnProperty,b=(t,e)=>m.call(t,e),w=Array.isArray,S=t=>"[object Map]"===k(t),x=t=>"function"==typeof t,M=t=>"string"==typeof t,E=t=>"symbol"==typeof t,O=t=>null!==t&&"object"==typeof t,R=Object.prototype.toString,k=t=>R.call(t),C=t=>M(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,j=(t,e)=>t!==e&&(t==t||e==e),$=new WeakMap,I=[];let P;const F=Symbol(""),N=Symbol("");function V(t,e=h){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const n=function(t,e){const n=function(){if(!n.active)return t();if(!I.includes(n)){A(n);try{return D.push(W),W=!0,I.push(n),P=n,t()}finally{I.pop(),U(),P=I[I.length-1]}}};return n.id=z++,n.allowRecurse=!!e.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,e);return e.lazy||n(),n}let z=0;function A(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let W=!0;const D=[];function T(){D.push(W),W=!1}function U(){const t=D.pop();W=void 0===t||t}function B(t,e,n){if(!W||void 0===P)return;let r=$.get(t);r||$.set(t,r=new Map);let o=r.get(n);o||r.set(n,o=new Set),o.has(P)||(o.add(P),P.deps.push(o))}function L(t,e,n,r,o,s){const i=$.get(t);if(!i)return;const l=new Set,c=t=>{t&&t.forEach((t=>{(t!==P||t.allowRecurse)&&l.add(t)}))};if("clear"===e)i.forEach(c);else if("length"===n&&w(t))i.forEach(((t,e)=>{("length"===e||e>=r)&&c(t)}));else switch(void 0!==n&&c(i.get(n)),e){case"add":w(t)?C(n)&&c(i.get("length")):(c(i.get(F)),S(t)&&c(i.get(N)));break;case"delete":w(t)||(c(i.get(F)),S(t)&&c(i.get(N)));break;case"set":S(t)&&c(i.get(F))}l.forEach((t=>{t.options.scheduler?t.options.scheduler(t):t()}))}const K=i("__proto__,__v_isRef,__isVue"),H=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(E)),J=Y(),q=Y(!1,!0),G=Y(!0),Q=Y(!0,!0),X={};function Y(t=!1,e=!1){return function(n,r,o){if("__v_isReactive"===r)return!t;if("__v_isReadonly"===r)return t;if("__v_raw"===r&&o===(t?e?Ot:Et:e?Mt:xt).get(n))return n;const s=w(n);if(!t&&s&&b(X,r))return Reflect.get(X,r,o);const i=Reflect.get(n,r,o);if(E(r)?H.has(r):K(r))return i;if(t||B(n,0,r),e)return i;if(Nt(i)){return!s||!C(r)?i.value:i}return O(i)?t?Ct(i):kt(i):i}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];X[t]=function(...t){const n=Ft(this);for(let e=0,o=this.length;e<o;e++)B(n,0,e+"");const r=e.apply(n,t);return-1===r||!1===r?e.apply(n,t.map(Ft)):r}})),["push","pop","shift","unshift","splice"].forEach((t=>{const e=Array.prototype[t];X[t]=function(...t){T();const n=e.apply(this,t);return U(),n}}));function Z(t=!1){return function(e,n,r,o){let s=e[n];if(!t&&(r=Ft(r),s=Ft(s),!w(e)&&Nt(s)&&!Nt(r)))return s.value=r,!0;const i=w(e)&&C(n)?Number(n)<e.length:b(e,n),l=Reflect.set(e,n,r,o);return e===Ft(o)&&(i?j(r,s)&&L(e,"set",n,r):L(e,"add",n,r)),l}}const tt={get:J,set:Z(),deleteProperty:function(t,e){const n=b(t,e);t[e];const r=Reflect.deleteProperty(t,e);return r&&n&&L(t,"delete",e,void 0),r},has:function(t,e){const n=Reflect.has(t,e);return E(e)&&H.has(e)||B(t,0,e),n},ownKeys:function(t){return B(t,0,w(t)?"length":F),Reflect.ownKeys(t)}},et={get:G,set:(t,e)=>!0,deleteProperty:(t,e)=>!0};y({},tt,{get:q,set:Z(!0)}),y({},et,{get:Q});const nt=t=>O(t)?kt(t):t,rt=t=>O(t)?Ct(t):t,ot=t=>t,st=t=>Reflect.getPrototypeOf(t);function it(t,e,n=!1,r=!1){const o=Ft(t=t.__v_raw),s=Ft(e);e!==s&&!n&&B(o,0,e),!n&&B(o,0,s);const{has:i}=st(o),l=r?ot:n?rt:nt;return i.call(o,e)?l(t.get(e)):i.call(o,s)?l(t.get(s)):void(t!==o&&t.get(e))}function lt(t,e=!1){const n=this.__v_raw,r=Ft(n),o=Ft(t);return t!==o&&!e&&B(r,0,t),!e&&B(r,0,o),t===o?n.has(t):n.has(t)||n.has(o)}function ct(t,e=!1){return t=t.__v_raw,!e&&B(Ft(t),0,F),Reflect.get(t,"size",t)}function at(t){t=Ft(t);const e=Ft(this);return st(e).has.call(e,t)||(e.add(t),L(e,"add",t,t)),this}function ut(t,e){e=Ft(e);const n=Ft(this),{has:r,get:o}=st(n);let s=r.call(n,t);s||(t=Ft(t),s=r.call(n,t));const i=o.call(n,t);return n.set(t,e),s?j(e,i)&&L(n,"set",t,e):L(n,"add",t,e),this}function ft(t){const e=Ft(this),{has:n,get:r}=st(e);let o=n.call(e,t);o||(t=Ft(t),o=n.call(e,t)),r&&r.call(e,t);const s=e.delete(t);return o&&L(e,"delete",t,void 0),s}function dt(){const t=Ft(this),e=0!==t.size,n=t.clear();return e&&L(t,"clear",void 0,void 0),n}function ht(t,e){return function(n,r){const o=this,s=o.__v_raw,i=Ft(s),l=e?ot:t?rt:nt;return!t&&B(i,0,F),s.forEach(((t,e)=>n.call(r,l(t),l(e),o)))}}function pt(t,e,n){return function(...r){const o=this.__v_raw,s=Ft(o),i=S(s),l="entries"===t||t===Symbol.iterator&&i,c="keys"===t&&i,a=o[t](...r),u=n?ot:e?rt:nt;return!e&&B(s,0,c?N:F),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:l?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function gt(t){return function(...e){return"delete"!==t&&this}}const _t={get(t){return it(this,t)},get size(){return ct(this)},has:lt,add:at,set:ut,delete:ft,clear:dt,forEach:ht(!1,!1)},vt={get(t){return it(this,t,!1,!0)},get size(){return ct(this)},has:lt,add:at,set:ut,delete:ft,clear:dt,forEach:ht(!1,!0)},yt={get(t){return it(this,t,!0)},get size(){return ct(this,!0)},has(t){return lt.call(this,t,!0)},add:gt("add"),set:gt("set"),delete:gt("delete"),clear:gt("clear"),forEach:ht(!0,!1)},mt={get(t){return it(this,t,!0,!0)},get size(){return ct(this,!0)},has(t){return lt.call(this,t,!0)},add:gt("add"),set:gt("set"),delete:gt("delete"),clear:gt("clear"),forEach:ht(!0,!0)};function bt(t,e){const n=e?t?mt:vt:t?yt:_t;return(e,r,o)=>"__v_isReactive"===r?!t:"__v_isReadonly"===r?t:"__v_raw"===r?e:Reflect.get(b(n,r)&&r in e?n:e,r,o)}["keys","values","entries",Symbol.iterator].forEach((t=>{_t[t]=pt(t,!1,!1),yt[t]=pt(t,!0,!1),vt[t]=pt(t,!1,!0),mt[t]=pt(t,!0,!0)}));const wt={get:bt(!1,!1)},St={get:bt(!0,!1)},xt=new WeakMap,Mt=new WeakMap,Et=new WeakMap,Ot=new WeakMap;function Rt(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>k(t).slice(8,-1))(t))}function kt(t){return t&&t.__v_isReadonly?t:jt(t,!1,tt,wt,xt)}function Ct(t){return jt(t,!0,et,St,Et)}function jt(t,e,n,r,o){if(!O(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const s=o.get(t);if(s)return s;const i=Rt(t);if(0===i)return t;const l=new Proxy(t,2===i?r:n);return o.set(t,l),l}function $t(t){return It(t)?$t(t.__v_raw):!(!t||!t.__v_isReactive)}function It(t){return!(!t||!t.__v_isReadonly)}function Pt(t){return $t(t)||It(t)}function Ft(t){return t&&Ft(t.__v_raw)||t}function Nt(t){return Boolean(t&&!0===t.__v_isRef)}class Vt{constructor(t,e){this._object=t,this._key=e,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(t){this._object[this._key]=t}}function zt(t,e){return Nt(t[e])?t[e]:new Vt(t,e)}class At{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=V(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,L(Ft(this),"set","value"))}}),this.__v_isReadonly=n}get value(){const t=Ft(this);return t._dirty&&(t._value=this.effect(),t._dirty=!1),B(t,0,"value"),t._value}set value(t){this._setter(t)}}function Wt(t,e,n,r){let o;try{o=r?t(...r):t()}catch(s){Tt(s,e,n)}return o}function Dt(t,e,n,r){if(x(t)){const s=Wt(t,e,n,r);return s&&(O(o=s)&&x(o.then)&&x(o.catch))&&s.catch((t=>{Tt(t,e,n)})),s}var o;const s=[];for(let i=0;i<t.length;i++)s.push(Dt(t[i],e,n,r));return s}function Tt(t,e,n,r=!0){e&&e.vnode;if(e){let r=e.parent;const o=e.proxy,s=n;for(;r;){const e=r.ec;if(e)for(let n=0;n<e.length;n++)if(!1===e[n](t,o,s))return;r=r.parent}const i=e.appContext.config.errorHandler;if(i)return void Wt(i,null,10,[t,o,s])}!function(t,e,n,r=!0){console.error(t)}(t,0,0,r)}let Ut=!1,Bt=!1;const Lt=[];let Kt=0;const Ht=[];let Jt=null,qt=0;const Gt=[];let Qt=null,Xt=0;const Yt=Promise.resolve();let Zt=null,te=null;function ee(t){const e=Zt||Yt;return t?e.then(this?t.bind(this):t):e}function ne(t){if(!(Lt.length&&Lt.includes(t,Ut&&t.allowRecurse?Kt+1:Kt)||t===te)){const e=function(t){let e=Kt+1,n=Lt.length;const r=ie(t);for(;e<n;){const t=e+n>>>1;ie(Lt[t])<r?e=t+1:n=t}return e}(t);e>-1?Lt.splice(e,0,t):Lt.push(t),re()}}function re(){Ut||Bt||(Bt=!0,Zt=Yt.then(le))}function oe(t,e,n,r){w(t)?n.push(...t):e&&e.includes(t,t.allowRecurse?r+1:r)||n.push(t),re()}function se(t,e=null){if(Ht.length){for(te=e,Jt=[...new Set(Ht)],Ht.length=0,qt=0;qt<Jt.length;qt++)Jt[qt]();Jt=null,qt=0,te=null,se(t,e)}}const ie=t=>null==t.id?1/0:t.id;function le(t){Bt=!1,Ut=!0,se(t),Lt.sort(((t,e)=>ie(t)-ie(e)));try{for(Kt=0;Kt<Lt.length;Kt++){const t=Lt[Kt];t&&!1!==t.active&&Wt(t,null,14)}}finally{Kt=0,Lt.length=0,function(t){if(Gt.length){const t=[...new Set(Gt)];if(Gt.length=0,Qt)return void Qt.push(...t);for(Qt=t,Qt.sort(((t,e)=>ie(t)-ie(e))),Xt=0;Xt<Qt.length;Xt++)Qt[Xt]();Qt=null,Xt=0}}(),Ut=!1,Zt=null,(Lt.length||Ht.length||Gt.length)&&le(t)}}const ce={};function ae(t,e,{immediate:n,deep:r,flush:o,onTrack:s,onTrigger:i}=h,l=Ne){let c,a,u=!1,f=!1;if(Nt(t)?(c=()=>t.value,u=!!t._shallow):$t(t)?(c=()=>t,r=!0):w(t)?(f=!0,u=t.some($t),c=()=>t.map((t=>Nt(t)?t.value:$t(t)?fe(t):x(t)?Wt(t,l,2):void 0))):c=x(t)?e?()=>Wt(t,l,2):()=>{if(!l||!l.isUnmounted)return a&&a(),Dt(t,l,3,[d])}:g,e&&r){const t=c;c=()=>fe(t())}let d=t=>{a=y.options.onStop=()=>{Wt(t,l,4)}},p=f?[]:ce;const _=()=>{if(y.active)if(e){const t=y();(r||u||(f?t.some(((t,e)=>j(t,p[e]))):j(t,p)))&&(a&&a(),Dt(e,l,3,[t,p===ce?void 0:p,d]),p=t)}else y()};let v;_.allowRecurse=!!e,v="sync"===o?_:"post"===o?()=>ye(_,l&&l.suspense):()=>{!l||l.isMounted?function(t){oe(t,Jt,Ht,qt)}(_):_()};const y=V(c,{lazy:!0,onTrack:s,onTrigger:i,scheduler:v});return Ve(y,l),e?n?_():p=y():"post"===o?ye(y,l&&l.suspense):y(),()=>{var t;(t=y).active&&(A(t),t.options.onStop&&t.options.onStop(),t.active=!1),l&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(l.effects,y)}}function ue(t,e,n){const r=this.proxy,o=M(t)?t.includes(".")?function(t,e){const n=e.split(".");return()=>{let e=t;for(let t=0;t<n.length&&e;t++)e=e[n[t]];return e}}(r,t):()=>r[t]:t.bind(r,r);let s;return x(e)?s=e:(s=e.handler,n=e),ae(o,s.bind(r),n,this)}function fe(t,e=new Set){if(!O(t)||e.has(t)||t.__v_skip)return t;if(e.add(t),Nt(t))fe(t.value,e);else if(w(t))for(let n=0;n<t.length;n++)fe(t[n],e);else if("[object Set]"===k(t)||S(t))t.forEach((t=>{fe(t,e)}));else if((t=>"[object Object]"===k(t))(t))for(const n in t)fe(t[n],e);return t}function de(t,e,n,r=!1){const{mixins:o,extends:s}=e;s&&de(t,s,n,!0),o&&o.forEach((e=>de(t,e,n,!0)));for(const i in e)if(r&&"expose"===i);else{const r=he[i]||n&&n[i];t[i]=r?r(t[i],e[i]):e[i]}return t}const he={data:pe,props:ve,emits:ve,methods:ve,computed:ve,beforeCreate:_e,created:_e,beforeMount:_e,mounted:_e,beforeUpdate:_e,updated:_e,beforeDestroy:_e,destroyed:_e,activated:_e,deactivated:_e,errorCaptured:_e,serverPrefetch:_e,components:ve,directives:ve,watch:function(t,e){if(!t)return e;if(!e)return t;const n=y(Object.create(null),t);for(const r in e)n[r]=_e(t[r],e[r]);return n},provide:pe,inject:function(t,e){return ve(ge(t),ge(e))}};function pe(t,e){return e?t?function(){return y(x(t)?t.call(this,this):t,x(e)?e.call(this,this):e)}:e:t}function ge(t){if(w(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function _e(t,e){return t?[...new Set([].concat(t,e))]:e}function ve(t,e){return t?y(y(Object.create(null),t),e):e}const ye=function(t,e){e&&e.pendingBranch?w(t)?e.effects.push(...t):e.effects.push(t):oe(t,Qt,Gt,Xt)},me=Symbol(),be=Symbol(void 0),we=Symbol(void 0),Se=Symbol(void 0),xe=[];let Me=null;function Ee(t,e,n,r,o){const s=ke(t,e,n,r,o,!0);return s.dynamicChildren=Me||p,xe.pop(),Me=xe[xe.length-1]||null,Me&&Me.push(s),s}const Oe=({key:t})=>null!=t?t:null,Re=({ref:t})=>null!=t?M(t)||Nt(t)||x(t)?{i:null,r:t}:t:null,ke=function(t,e=null,n=null,r=0,o=null,s=!1){t&&t!==me||(t=Se);if(i=t,i&&!0===i.__v_isVNode){const r=Ce(t,e,!0);return n&&$e(r,n),r}var i;(function(t){return x(t)&&"__vccOpts"in t})(t)&&(t=t.__vccOpts);if(e){(Pt(e)||"__vInternal"in e)&&(e=y({},e));let{class:t,style:n}=e;t&&!M(t)&&(e.class=d(t)),O(n)&&(Pt(n)&&!w(n)&&(n=y({},n)),e.style=c(n))}const l=M(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:O(t)?4:x(t)?2:0,a={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Oe(e),ref:e&&Re(e),scopeId:null,slotScopeIds:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null};$e(a,n),128&l&&t.normalize(a);!s&&Me&&(r>0||6&l)&&32!==r&&Me.push(a);return a};function Ce(t,e,n=!1){const{props:r,ref:o,patchFlag:s,children:i}=t,l=e?function(...t){const e=y({},t[0]);for(let n=1;n<t.length;n++){const r=t[n];for(const t in r)if("class"===t)e.class!==r.class&&(e.class=d([e.class,r.class]));else if("style"===t)e.style=c([e.style,r.style]);else if(v(t)){const n=e[t],o=r[t];n!==o&&(e[t]=n?[].concat(n,o):o)}else""!==t&&(e[t]=r[t])}return e}(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&Oe(l),ref:e&&e.ref?n&&o?w(o)?o.concat(Re(e)):[o,Re(e)]:Re(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:i,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==be?-1===s?16:16|s:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ce(t.ssContent),ssFallback:t.ssFallback&&Ce(t.ssFallback),el:t.el,anchor:t.anchor}}function je(t=" ",e=0){return ke(we,null,t,e)}function $e(t,e){let n=0;const{shapeFlag:r}=t;if(null==e)e=null;else if(w(e))n=16;else if("object"==typeof e){if(1&r||64&r){const n=e.default;return void(n&&(n._c&&(n._d=!1),$e(t,n()),n._c&&(n._d=!0)))}{n=32;const t=e._;t||"__vInternal"in e||(e._ctx=null)}}else x(e)?(e={default:e,_ctx:null},n=32):(e=String(e),64&r?(n=16,e=[je(e)]):n=8);t.children=e,t.shapeFlag|=n}const Ie=t=>t?4&t.vnode.shapeFlag?t.exposed?t.exposed:t.proxy:Ie(t.parent):null,Pe=y(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Ie(t.parent),$root:t=>Ie(t.root),$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=t.appContext,l=s.get(e);let c;return l?c=l:o.length||n||r?(c={},o.length&&o.forEach((t=>de(c,t,i,!0))),de(c,e,i)):c=e,s.set(e,c),c}(t),$forceUpdate:t=>()=>ne(t.update),$nextTick:t=>ee.bind(t.proxy),$watch:t=>ue.bind(t)}),Fe={get({_:t},e){const{ctx:n,setupState:r,data:o,props:s,accessCache:i,type:l,appContext:c}=t;let a;if("$"!==e[0]){const l=i[e];if(void 0!==l)switch(l){case 0:return r[e];case 1:return o[e];case 3:return n[e];case 2:return s[e]}else{if(r!==h&&b(r,e))return i[e]=0,r[e];if(o!==h&&b(o,e))return i[e]=1,o[e];if((a=t.propsOptions[0])&&b(a,e))return i[e]=2,s[e];if(n!==h&&b(n,e))return i[e]=3,n[e];i[e]=4}}const u=Pe[e];let f,d;return u?("$attrs"===e&&B(t,0,e),u(t)):(f=l.__cssModules)&&(f=f[e])?f:n!==h&&b(n,e)?(i[e]=3,n[e]):(d=c.config.globalProperties,b(d,e)?d[e]:void 0)},set({_:t},e,n){const{data:r,setupState:o,ctx:s}=t;if(o!==h&&b(o,e))o[e]=n;else if(r!==h&&b(r,e))r[e]=n;else if(b(t.props,e))return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:o,propsOptions:s}},i){let l;return void 0!==n[i]||t!==h&&b(t,i)||e!==h&&b(e,i)||(l=s[0])&&b(l,i)||b(r,i)||b(Pe,i)||b(o.config.globalProperties,i)}};y({},Fe,{get(t,e){if(e!==Symbol.unscopables)return Fe.get(t,e,t)},has:(t,e)=>"_"!==e[0]&&!l(e)});let Ne=null;function Ve(t,e=Ne){e&&(e.effects||(e.effects=[])).push(t)}function ze(t){const e=function(t){let e,n;return x(t)?(e=t,n=g):(e=t.get,n=t.set),new At(e,n,x(t)||!t.set)}(t);return Ve(e.effect),e}const Ae=(We={name:"MonacoEditor",props:{diffEditor:{type:Boolean,default:!1},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},original:String,value:String,language:{type:String,default:"javascript"},theme:{type:String,default:"vs"},options:{type:Object,default:()=>({})}},emits:["editorWillMount","editorDidMount","change"],setup(t){const{width:e,height:n}=function(t){const e=w(t)?new Array(t.length):{};for(const n in t)e[n]=zt(t,n);return e}(t);return{style:ze((()=>({width:e.value.toString().includes("%")?e.value:`${e.value}px`,height:n.value.toString().includes("%")?n.value:`${n.value}px`,"text-align":"left"})))}},mounted(){this.initMonaco()},beforeDestroy(){this.editor&&this.editor.dispose()},methods:{initMonaco(){this.$emit("editorWillMount",this.monaco);const{value:t,language:i,theme:l,options:c}=this;this.editor=s.editor[this.diffEditor?"createDiffEditor":"create"](this.$el,((t,s)=>{for(var i in s||(s={}))n.call(s,i)&&o(t,i,s[i]);if(e)for(var i of e(s))r.call(s,i)&&o(t,i,s[i]);return t})({value:t,language:i,theme:l},c)),this.diffEditor&&this._setModel(this.value,this.original);const a=this._getEditor();a.onDidChangeModelContent((t=>{const e=a.getValue();this.value!==e&&this.$emit("change",e,t)})),this.$emit("editorDidMount",this.editor)},_setModel(t,e){const{language:n}=this,r=s.editor.createModel(e,n),o=s.editor.createModel(t,n);this.editor.setModel({original:r,modified:o})},_setValue(t){let e=this._getEditor();if(e)return e.setValue(t)},_getValue(){let t=this._getEditor();return t?t.getValue():""},_getEditor(){return this.editor?this.diffEditor?this.editor.modifiedEditor:this.editor:null},_setOriginal(){const{original:t}=this.editor.getModel();t.setValue(this.original)}},watch:{options:{deep:!0,handler(t){this.editor.updateOptions(t)}},value(){this.value!==this._getValue()&&this._setValue(this.value)},original(){this._setOriginal()},language(){if(this.editor)if(this.diffEditor){const{original:t,modified:e}=this.editor.getModel();s.editor.setModelLanguage(t,this.language),s.editor.setModelLanguage(e,this.language)}else s.editor.setModelLanguage(this.editor.getModel(),this.language)},theme(){s.editor.setTheme(this.theme)}}},x(We)?{setup:We,name:We.name}:We);var We;Ae.render=function(t,e,n,r,o,s){return function(t=!1){xe.push(Me=t?null:[])}(),Ee("div",{class:"monaco-editor-vue3",style:t.style},null,4)},Ae.install=t=>{t.component(Ae.name,Ae)};export default Ae;
import * as monaco from "monaco-editor";
function normalizeStyle(value) {
if (isArray(value)) {
const res = {};
for (let i = 0; i < value.length; i++) {
const item = value[i];
const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
if (normalized) {
for (const key in normalized) {
res[key] = normalized[key];
}
}
}
return res;
} else if (isString(value)) {
return value;
} else if (isObject(value)) {
return value;
}
}
const listDelimiterRE = /;(?![^(]*\))/g;
const propertyDelimiterRE = /:(.+)/;
function parseStringStyle(cssText) {
const ret = {};
cssText.split(listDelimiterRE).forEach((item) => {
if (item) {
const tmp = item.split(propertyDelimiterRE);
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
}
});
return ret;
}
function normalizeClass(value) {
let res = "";
if (isString(value)) {
res = value;
} else if (isArray(value)) {
for (let i = 0; i < value.length; i++) {
const normalized = normalizeClass(value[i]);
if (normalized) {
res += normalized + " ";
}
}
} else if (isObject(value)) {
for (const name in value) {
if (value[name]) {
res += name + " ";
}
}
}
return res.trim();
}
const EMPTY_ARR = [];
const NOOP = () => {
};
const onRE = /^on[^a-z]/;
const isOn = (key) => onRE.test(key);
const extend = Object.assign;
const isArray = Array.isArray;
const isFunction = (val) => typeof val === "function";
const isString = (val) => typeof val === "string";
const isObject = (val) => val !== null && typeof val === "object";
let activeEffectScope;
function recordEffectScope(effect, scope = activeEffectScope) {
if (scope && scope.active) {
scope.effects.push(effect);
}
}
const createDep = (effects) => {
const dep = new Set(effects);
dep.w = 0;
dep.n = 0;
return dep;
};
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
const initDepMarkers = ({ deps }) => {
if (deps.length) {
for (let i = 0; i < deps.length; i++) {
deps[i].w |= trackOpBit;
}
}
};
const finalizeDepMarkers = (effect) => {
const { deps } = effect;
if (deps.length) {
let ptr = 0;
for (let i = 0; i < deps.length; i++) {
const dep = deps[i];
if (wasTracked(dep) && !newTracked(dep)) {
dep.delete(effect);
} else {
deps[ptr++] = dep;
}
dep.w &= ~trackOpBit;
dep.n &= ~trackOpBit;
}
deps.length = ptr;
}
};
let effectTrackDepth = 0;
let trackOpBit = 1;
const maxMarkerBits = 30;
let activeEffect;
class ReactiveEffect {
constructor(fn, scheduler = null, scope) {
this.fn = fn;
this.scheduler = scheduler;
this.active = true;
this.deps = [];
this.parent = void 0;
recordEffectScope(this, scope);
}
run() {
if (!this.active) {
return this.fn();
}
let parent = activeEffect;
let lastShouldTrack = shouldTrack;
while (parent) {
if (parent === this) {
return;
}
parent = parent.parent;
}
try {
this.parent = activeEffect;
activeEffect = this;
shouldTrack = true;
trackOpBit = 1 << ++effectTrackDepth;
if (effectTrackDepth <= maxMarkerBits) {
initDepMarkers(this);
} else {
cleanupEffect(this);
}
return this.fn();
} finally {
if (effectTrackDepth <= maxMarkerBits) {
finalizeDepMarkers(this);
}
trackOpBit = 1 << --effectTrackDepth;
activeEffect = this.parent;
shouldTrack = lastShouldTrack;
this.parent = void 0;
if (this.deferStop) {
this.stop();
}
}
}
stop() {
if (activeEffect === this) {
this.deferStop = true;
} else if (this.active) {
cleanupEffect(this);
if (this.onStop) {
this.onStop();
}
this.active = false;
}
}
}
function cleanupEffect(effect) {
const { deps } = effect;
if (deps.length) {
for (let i = 0; i < deps.length; i++) {
deps[i].delete(effect);
}
deps.length = 0;
}
}
let shouldTrack = true;
function trackEffects(dep, debuggerEventExtraInfo) {
let shouldTrack2 = false;
if (effectTrackDepth <= maxMarkerBits) {
if (!newTracked(dep)) {
dep.n |= trackOpBit;
shouldTrack2 = !wasTracked(dep);
}
} else {
shouldTrack2 = !dep.has(activeEffect);
}
if (shouldTrack2) {
dep.add(activeEffect);
activeEffect.deps.push(dep);
}
}
function triggerEffects(dep, debuggerEventExtraInfo) {
const effects = isArray(dep) ? dep : [...dep];
for (const effect of effects) {
if (effect.computed) {
triggerEffect(effect);
}
}
for (const effect of effects) {
if (!effect.computed) {
triggerEffect(effect);
}
}
}
function triggerEffect(effect, debuggerEventExtraInfo) {
if (effect !== activeEffect || effect.allowRecurse) {
if (effect.scheduler) {
effect.scheduler();
} else {
effect.run();
}
}
}
function isReactive(value) {
if (isReadonly(value)) {
return isReactive(value["__v_raw"]);
}
return !!(value && value["__v_isReactive"]);
}
function isReadonly(value) {
return !!(value && value["__v_isReadonly"]);
}
function isProxy(value) {
return isReactive(value) || isReadonly(value);
}
function toRaw(observed) {
const raw = observed && observed["__v_raw"];
return raw ? toRaw(raw) : observed;
}
function trackRefValue(ref) {
if (shouldTrack && activeEffect) {
ref = toRaw(ref);
{
trackEffects(ref.dep || (ref.dep = createDep()));
}
}
}
function triggerRefValue(ref, newVal) {
ref = toRaw(ref);
if (ref.dep) {
{
triggerEffects(ref.dep);
}
}
}
function isRef(r) {
return !!(r && r.__v_isRef === true);
}
function toRefs(object) {
const ret = isArray(object) ? new Array(object.length) : {};
for (const key in object) {
ret[key] = toRef(object, key);
}
return ret;
}
class ObjectRefImpl {
constructor(_object, _key, _defaultValue) {
this._object = _object;
this._key = _key;
this._defaultValue = _defaultValue;
this.__v_isRef = true;
}
get value() {
const val = this._object[this._key];
return val === void 0 ? this._defaultValue : val;
}
set value(newVal) {
this._object[this._key] = newVal;
}
}
function toRef(object, key, defaultValue) {
const val = object[key];
return isRef(val) ? val : new ObjectRefImpl(object, key, defaultValue);
}
class ComputedRefImpl {
constructor(getter, _setter, isReadonly2, isSSR) {
this._setter = _setter;
this.dep = void 0;
this.__v_isRef = true;
this._dirty = true;
this.effect = new ReactiveEffect(getter, () => {
if (!this._dirty) {
this._dirty = true;
triggerRefValue(this);
}
});
this.effect.computed = this;
this.effect.active = this._cacheable = !isSSR;
this["__v_isReadonly"] = isReadonly2;
}
get value() {
const self = toRaw(this);
trackRefValue(self);
if (self._dirty || !self._cacheable) {
self._dirty = false;
self._value = self.effect.run();
}
return self._value;
}
set value(newValue) {
this._setter(newValue);
}
}
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
let getter;
let setter;
const onlyGetter = isFunction(getterOrOptions);
if (onlyGetter) {
getter = getterOrOptions;
setter = NOOP;
} else {
getter = getterOrOptions.get;
setter = getterOrOptions.set;
}
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
return cRef;
}
let currentRenderingInstance = null;
let currentScopeId = null;
const isSuspense = (type) => type.__isSuspense;
function defineComponent(options) {
return isFunction(options) ? { setup: options, name: options.name } : options;
}
const NULL_DYNAMIC_COMPONENT = Symbol();
const isTeleport = (type) => type.__isTeleport;
const Fragment = Symbol(void 0);
const Text = Symbol(void 0);
const Comment = Symbol(void 0);
const blockStack = [];
let currentBlock = null;
function openBlock(disableTracking = false) {
blockStack.push(currentBlock = disableTracking ? null : []);
}
function closeBlock() {
blockStack.pop();
currentBlock = blockStack[blockStack.length - 1] || null;
}
function setupBlock(vnode) {
vnode.dynamicChildren = currentBlock || EMPTY_ARR;
closeBlock();
if (currentBlock) {
currentBlock.push(vnode);
}
return vnode;
}
function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true));
}
function isVNode(value) {
return value ? value.__v_isVNode === true : false;
}
const InternalObjectKey = `__vInternal`;
const normalizeKey = ({ key }) => key != null ? key : null;
const normalizeRef = ({ ref, ref_key, ref_for }) => {
return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
};
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
const vnode = {
__v_isVNode: true,
__v_skip: true,
type,
props,
key: props && normalizeKey(props),
ref: props && normalizeRef(props),
scopeId: currentScopeId,
slotScopeIds: null,
children,
component: null,
suspense: null,
ssContent: null,
ssFallback: null,
dirs: null,
transition: null,
el: null,
anchor: null,
target: null,
targetAnchor: null,
staticCount: 0,
shapeFlag,
patchFlag,
dynamicProps,
dynamicChildren: null,
appContext: null
};
if (needFullChildrenNormalization) {
normalizeChildren(vnode, children);
if (shapeFlag & 128) {
type.normalize(vnode);
}
} else if (children) {
vnode.shapeFlag |= isString(children) ? 8 : 16;
}
if (!isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) {
currentBlock.push(vnode);
}
return vnode;
}
const createVNode = _createVNode;
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
if (!type || type === NULL_DYNAMIC_COMPONENT) {
type = Comment;
}
if (isVNode(type)) {
const cloned = cloneVNode(type, props, true);
if (children) {
normalizeChildren(cloned, children);
}
if (!isBlockNode && currentBlock) {
if (cloned.shapeFlag & 6) {
currentBlock[currentBlock.indexOf(type)] = cloned;
} else {
currentBlock.push(cloned);
}
}
cloned.patchFlag |= -2;
return cloned;
}
if (isClassComponent(type)) {
type = type.__vccOpts;
}
if (props) {
props = guardReactiveProps(props);
let { class: klass, style } = props;
if (klass && !isString(klass)) {
props.class = normalizeClass(klass);
}
if (isObject(style)) {
if (isProxy(style) && !isArray(style)) {
style = extend({}, style);
}
props.style = normalizeStyle(style);
}
}
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true);
}
function guardReactiveProps(props) {
if (!props)
return null;
return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
}
function cloneVNode(vnode, extraProps, mergeRef = false) {
const { props, ref, patchFlag, children } = vnode;
const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
const cloned = {
__v_isVNode: true,
__v_skip: true,
type: vnode.type,
props: mergedProps,
key: mergedProps && normalizeKey(mergedProps),
ref: extraProps && extraProps.ref ? mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref,
scopeId: vnode.scopeId,
slotScopeIds: vnode.slotScopeIds,
children,
target: vnode.target,
targetAnchor: vnode.targetAnchor,
staticCount: vnode.staticCount,
shapeFlag: vnode.shapeFlag,
patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
dynamicProps: vnode.dynamicProps,
dynamicChildren: vnode.dynamicChildren,
appContext: vnode.appContext,
dirs: vnode.dirs,
transition: vnode.transition,
component: vnode.component,
suspense: vnode.suspense,
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
el: vnode.el,
anchor: vnode.anchor
};
return cloned;
}
function createTextVNode(text = " ", flag = 0) {
return createVNode(Text, null, text, flag);
}
function normalizeChildren(vnode, children) {
let type = 0;
const { shapeFlag } = vnode;
if (children == null) {
children = null;
} else if (isArray(children)) {
type = 16;
} else if (typeof children === "object") {
if (shapeFlag & (1 | 64)) {
const slot = children.default;
if (slot) {
slot._c && (slot._d = false);
normalizeChildren(vnode, slot());
slot._c && (slot._d = true);
}
return;
} else {
type = 32;
const slotFlag = children._;
if (!slotFlag && !(InternalObjectKey in children)) {
children._ctx = currentRenderingInstance;
} else if (slotFlag === 3 && currentRenderingInstance) {
if (currentRenderingInstance.slots._ === 1) {
children._ = 1;
} else {
children._ = 2;
vnode.patchFlag |= 1024;
}
}
}
} else if (isFunction(children)) {
children = { default: children, _ctx: currentRenderingInstance };
type = 32;
} else {
children = String(children);
if (shapeFlag & 64) {
type = 16;
children = [createTextVNode(children)];
} else {
type = 8;
}
}
vnode.children = children;
vnode.shapeFlag |= type;
}
function mergeProps(...args) {
const ret = {};
for (let i = 0; i < args.length; i++) {
const toMerge = args[i];
for (const key in toMerge) {
if (key === "class") {
if (ret.class !== toMerge.class) {
ret.class = normalizeClass([ret.class, toMerge.class]);
}
} else if (key === "style") {
ret.style = normalizeStyle([ret.style, toMerge.style]);
} else if (isOn(key)) {
const existing = ret[key];
const incoming = toMerge[key];
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
ret[key] = existing ? [].concat(existing, incoming) : incoming;
}
} else if (key !== "") {
ret[key] = toMerge[key];
}
}
}
return ret;
}
let isInSSRComponentSetup = false;
function isClassComponent(value) {
return isFunction(value) && "__vccOpts" in value;
}
const computed = (getterOrOptions, debugOptions) => {
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
};
var _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _sfc_main = defineComponent({
name: "MonacoEditor",
props: {
diffEditor: { type: Boolean, default: false },
width: { type: [String, Number], default: "100%" },
height: { type: [String, Number], default: "100%" },
original: String,
value: String,
language: { type: String, default: "javascript" },
theme: { type: String, default: "vs" },
options: {
type: Object,
default() {
return {};
}
}
},
emits: ["editorWillMount", "editorDidMount", "change", "update:value"],
setup(props) {
const { width, height } = toRefs(props);
const style = computed(() => {
const fixedWidth = width.value.toString().includes("%") ? width.value : `${width.value}px`;
const fixedHeight = height.value.toString().includes("%") ? height.value : `${height.value}px`;
return {
width: fixedWidth,
height: fixedHeight,
"text-align": "left"
};
});
return {
style
};
},
mounted() {
this.initMonaco();
},
beforeDestroy() {
this.editor && this.editor.dispose();
},
methods: {
initMonaco() {
this.$emit("editorWillMount", monaco);
const { value, language, theme, options } = this;
this.editor = monaco.editor[this.diffEditor ? "createDiffEditor" : "create"](this.$el, {
value,
language,
theme,
...options
});
this.diffEditor && this._setModel(this.value, this.original);
const editor = this._getEditor();
editor && editor.onDidChangeModelContent((event) => {
const value2 = editor.getValue();
if (this.value !== value2) {
this.$emit("change", value2, event);
this.$emit("update:value", value2);
}
});
this.$emit("editorDidMount", this.editor);
},
_setModel(value, original) {
const { language } = this;
const originalModel = monaco.editor.createModel(original, language);
const modifiedModel = monaco.editor.createModel(value, language);
this.editor.setModel({
original: originalModel,
modified: modifiedModel
});
},
_setValue(value) {
let editor = this._getEditor();
if (editor)
return editor.setValue(value);
},
_getValue() {
let editor = this._getEditor();
if (!editor)
return "";
return editor.getValue();
},
_getEditor() {
if (!this.editor)
return null;
return this.diffEditor ? this.editor.modifiedEditor : this.editor;
},
_setOriginal() {
const { original } = this.editor.getModel();
original.setValue(this.original);
}
},
watch: {
options: {
deep: true,
handler(options) {
this.editor.updateOptions(options);
}
},
value() {
this.value !== this._getValue() && this._setValue(this.value);
},
original() {
this._setOriginal();
},
language() {
if (!this.editor)
return;
if (this.diffEditor) {
const { original, modified } = this.editor.getModel();
monaco.editor.setModelLanguage(original, this.language);
monaco.editor.setModelLanguage(modified, this.language);
} else
monaco.editor.setModelLanguage(this.editor.getModel(), this.language);
},
theme() {
monaco.editor.setTheme(this.theme);
}
}
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", {
class: "monaco-editor-vue3",
style: normalizeStyle(_ctx.style)
}, null, 4);
}
var MonacoEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
MonacoEditor.install = (app) => {
app.component(MonacoEditor.name, MonacoEditor);
};
export { MonacoEditor as default };

2

dist/monaco-editor-vue3.umd.js

@@ -1,1 +0,1 @@

var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__spreadValues=(t,e)=>{for(var n in e||(e={}))__hasOwnProp.call(e,n)&&__defNormalProp(t,n,e[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))__propIsEnum.call(e,n)&&__defNormalProp(t,n,e[n]);return t};!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("monaco-editor")):"function"==typeof define&&define.amd?define(["monaco-editor"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["monaco-editor-vue3"]=e(t["monaco-editor"])}(this,(function(t){"use strict";function e(t){if(t&&t.__esModule)return t;var e={__proto__:null,[Symbol.toStringTag]:"Module"};return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var n=e(t);function o(t,e){const n=Object.create(null),o=t.split(",");for(let r=0;r<o.length;r++)n[o[r]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}const r=o("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt");function s(t){if(v(t)){const e={};for(let n=0;n<t.length;n++){const o=t[n],r=s(w(o)?c(o):o);if(r)for(const t in r)e[t]=r[t]}return e}if(O(t))return t}const i=/;(?![^(]*\))/g,l=/:(.+)/;function c(t){const e={};return t.split(i).forEach((t=>{if(t){const n=t.split(l);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function a(t){let e="";if(w(t))e=t;else if(v(t))for(let n=0;n<t.length;n++){const o=a(t[n]);o&&(e+=o+" ")}else if(O(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const u={},f=[],d=()=>{},h=/^on[^a-z]/,p=t=>h.test(t),g=Object.assign,_=Object.prototype.hasOwnProperty,y=(t,e)=>_.call(t,e),v=Array.isArray,m=t=>"[object Map]"===E(t),b=t=>"function"==typeof t,w=t=>"string"==typeof t,S=t=>"symbol"==typeof t,O=t=>null!==t&&"object"==typeof t,x=Object.prototype.toString,E=t=>x.call(t),M=t=>w(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,R=(t,e)=>t!==e&&(t==t||e==e),j=new WeakMap,k=[];let P;const C=Symbol(""),$=Symbol("");function I(t,e=u){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const n=function(t,e){const n=function(){if(!n.active)return t();if(!k.includes(n)){F(n);try{return z.push(V),V=!0,k.push(n),P=n,t()}finally{k.pop(),T(),P=k[k.length-1]}}};return n.id=N++,n.allowRecurse=!!e.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}(t,e);return e.lazy||n(),n}let N=0;function F(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let V=!0;const z=[];function A(){z.push(V),V=!1}function T(){const t=z.pop();V=void 0===t||t}function W(t,e,n){if(!V||void 0===P)return;let o=j.get(t);o||j.set(t,o=new Map);let r=o.get(n);r||o.set(n,r=new Set),r.has(P)||(r.add(P),P.deps.push(r))}function D(t,e,n,o,r,s){const i=j.get(t);if(!i)return;const l=new Set,c=t=>{t&&t.forEach((t=>{(t!==P||t.allowRecurse)&&l.add(t)}))};if("clear"===e)i.forEach(c);else if("length"===n&&v(t))i.forEach(((t,e)=>{("length"===e||e>=o)&&c(t)}));else switch(void 0!==n&&c(i.get(n)),e){case"add":v(t)?M(n)&&c(i.get("length")):(c(i.get(C)),m(t)&&c(i.get($)));break;case"delete":v(t)||(c(i.get(C)),m(t)&&c(i.get($)));break;case"set":m(t)&&c(i.get(C))}l.forEach((t=>{t.options.scheduler?t.options.scheduler(t):t()}))}const U=o("__proto__,__v_isRef,__isVue"),B=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(S)),L=G(),K=G(!1,!0),q=G(!0),H=G(!0,!0),J={};function G(t=!1,e=!1){return function(n,o,r){if("__v_isReactive"===o)return!t;if("__v_isReadonly"===o)return t;if("__v_raw"===o&&r===(t?e?Ot:St:e?wt:bt).get(n))return n;const s=v(n);if(!t&&s&&y(J,o))return Reflect.get(J,o,r);const i=Reflect.get(n,o,r);if(S(o)?B.has(o):U(o))return i;if(t||W(n,0,o),e)return i;if($t(i)){return!s||!M(o)?i.value:i}return O(i)?t?Mt(i):Et(i):i}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];J[t]=function(...t){const n=Ct(this);for(let e=0,r=this.length;e<r;e++)W(n,0,e+"");const o=e.apply(n,t);return-1===o||!1===o?e.apply(n,t.map(Ct)):o}})),["push","pop","shift","unshift","splice"].forEach((t=>{const e=Array.prototype[t];J[t]=function(...t){A();const n=e.apply(this,t);return T(),n}}));function Q(t=!1){return function(e,n,o,r){let s=e[n];if(!t&&(o=Ct(o),s=Ct(s),!v(e)&&$t(s)&&!$t(o)))return s.value=o,!0;const i=v(e)&&M(n)?Number(n)<e.length:y(e,n),l=Reflect.set(e,n,o,r);return e===Ct(r)&&(i?R(o,s)&&D(e,"set",n,o):D(e,"add",n,o)),l}}const X={get:L,set:Q(),deleteProperty:function(t,e){const n=y(t,e);t[e];const o=Reflect.deleteProperty(t,e);return o&&n&&D(t,"delete",e,void 0),o},has:function(t,e){const n=Reflect.has(t,e);return S(e)&&B.has(e)||W(t,0,e),n},ownKeys:function(t){return W(t,0,v(t)?"length":C),Reflect.ownKeys(t)}},Y={get:q,set:(t,e)=>!0,deleteProperty:(t,e)=>!0};g({},X,{get:K,set:Q(!0)}),g({},Y,{get:H});const Z=t=>O(t)?Et(t):t,tt=t=>O(t)?Mt(t):t,et=t=>t,nt=t=>Reflect.getPrototypeOf(t);function ot(t,e,n=!1,o=!1){const r=Ct(t=t.__v_raw),s=Ct(e);e!==s&&!n&&W(r,0,e),!n&&W(r,0,s);const{has:i}=nt(r),l=o?et:n?tt:Z;return i.call(r,e)?l(t.get(e)):i.call(r,s)?l(t.get(s)):void(t!==r&&t.get(e))}function rt(t,e=!1){const n=this.__v_raw,o=Ct(n),r=Ct(t);return t!==r&&!e&&W(o,0,t),!e&&W(o,0,r),t===r?n.has(t):n.has(t)||n.has(r)}function st(t,e=!1){return t=t.__v_raw,!e&&W(Ct(t),0,C),Reflect.get(t,"size",t)}function it(t){t=Ct(t);const e=Ct(this);return nt(e).has.call(e,t)||(e.add(t),D(e,"add",t,t)),this}function lt(t,e){e=Ct(e);const n=Ct(this),{has:o,get:r}=nt(n);let s=o.call(n,t);s||(t=Ct(t),s=o.call(n,t));const i=r.call(n,t);return n.set(t,e),s?R(e,i)&&D(n,"set",t,e):D(n,"add",t,e),this}function ct(t){const e=Ct(this),{has:n,get:o}=nt(e);let r=n.call(e,t);r||(t=Ct(t),r=n.call(e,t)),o&&o.call(e,t);const s=e.delete(t);return r&&D(e,"delete",t,void 0),s}function at(){const t=Ct(this),e=0!==t.size,n=t.clear();return e&&D(t,"clear",void 0,void 0),n}function ut(t,e){return function(n,o){const r=this,s=r.__v_raw,i=Ct(s),l=e?et:t?tt:Z;return!t&&W(i,0,C),s.forEach(((t,e)=>n.call(o,l(t),l(e),r)))}}function ft(t,e,n){return function(...o){const r=this.__v_raw,s=Ct(r),i=m(s),l="entries"===t||t===Symbol.iterator&&i,c="keys"===t&&i,a=r[t](...o),u=n?et:e?tt:Z;return!e&&W(s,0,c?$:C),{next(){const{value:t,done:e}=a.next();return e?{value:t,done:e}:{value:l?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function dt(t){return function(...e){return"delete"!==t&&this}}const ht={get(t){return ot(this,t)},get size(){return st(this)},has:rt,add:it,set:lt,delete:ct,clear:at,forEach:ut(!1,!1)},pt={get(t){return ot(this,t,!1,!0)},get size(){return st(this)},has:rt,add:it,set:lt,delete:ct,clear:at,forEach:ut(!1,!0)},gt={get(t){return ot(this,t,!0)},get size(){return st(this,!0)},has(t){return rt.call(this,t,!0)},add:dt("add"),set:dt("set"),delete:dt("delete"),clear:dt("clear"),forEach:ut(!0,!1)},_t={get(t){return ot(this,t,!0,!0)},get size(){return st(this,!0)},has(t){return rt.call(this,t,!0)},add:dt("add"),set:dt("set"),delete:dt("delete"),clear:dt("clear"),forEach:ut(!0,!0)};function yt(t,e){const n=e?t?_t:pt:t?gt:ht;return(e,o,r)=>"__v_isReactive"===o?!t:"__v_isReadonly"===o?t:"__v_raw"===o?e:Reflect.get(y(n,o)&&o in e?n:e,o,r)}["keys","values","entries",Symbol.iterator].forEach((t=>{ht[t]=ft(t,!1,!1),gt[t]=ft(t,!0,!1),pt[t]=ft(t,!1,!0),_t[t]=ft(t,!0,!0)}));const vt={get:yt(!1,!1)},mt={get:yt(!0,!1)},bt=new WeakMap,wt=new WeakMap,St=new WeakMap,Ot=new WeakMap;function xt(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>E(t).slice(8,-1))(t))}function Et(t){return t&&t.__v_isReadonly?t:Rt(t,!1,X,vt,bt)}function Mt(t){return Rt(t,!0,Y,mt,St)}function Rt(t,e,n,o,r){if(!O(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const s=r.get(t);if(s)return s;const i=xt(t);if(0===i)return t;const l=new Proxy(t,2===i?o:n);return r.set(t,l),l}function jt(t){return kt(t)?jt(t.__v_raw):!(!t||!t.__v_isReactive)}function kt(t){return!(!t||!t.__v_isReadonly)}function Pt(t){return jt(t)||kt(t)}function Ct(t){return t&&Ct(t.__v_raw)||t}function $t(t){return Boolean(t&&!0===t.__v_isRef)}class It{constructor(t,e){this._object=t,this._key=e,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(t){this._object[this._key]=t}}function Nt(t,e){return $t(t[e])?t[e]:new It(t,e)}class Ft{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=I(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,D(Ct(this),"set","value"))}}),this.__v_isReadonly=n}get value(){const t=Ct(this);return t._dirty&&(t._value=this.effect(),t._dirty=!1),W(t,0,"value"),t._value}set value(t){this._setter(t)}}function Vt(t,e,n,o){let r;try{r=o?t(...o):t()}catch(s){At(s,e,n)}return r}function zt(t,e,n,o){if(b(t)){const s=Vt(t,e,n,o);return s&&(O(r=s)&&b(r.then)&&b(r.catch))&&s.catch((t=>{At(t,e,n)})),s}var r;const s=[];for(let i=0;i<t.length;i++)s.push(zt(t[i],e,n,o));return s}function At(t,e,n,o=!0){e&&e.vnode;if(e){let o=e.parent;const r=e.proxy,s=n;for(;o;){const e=o.ec;if(e)for(let n=0;n<e.length;n++)if(!1===e[n](t,r,s))return;o=o.parent}const i=e.appContext.config.errorHandler;if(i)return void Vt(i,null,10,[t,r,s])}!function(t,e,n,o=!0){console.error(t)}(t,0,0,o)}let Tt=!1,Wt=!1;const Dt=[];let Ut=0;const Bt=[];let Lt=null,Kt=0;const qt=[];let Ht=null,Jt=0;const Gt=Promise.resolve();let Qt=null,Xt=null;function Yt(t){const e=Qt||Gt;return t?e.then(this?t.bind(this):t):e}function Zt(t){if(!(Dt.length&&Dt.includes(t,Tt&&t.allowRecurse?Ut+1:Ut)||t===Xt)){const e=function(t){let e=Ut+1,n=Dt.length;const o=oe(t);for(;e<n;){const t=e+n>>>1;oe(Dt[t])<o?e=t+1:n=t}return e}(t);e>-1?Dt.splice(e,0,t):Dt.push(t),te()}}function te(){Tt||Wt||(Wt=!0,Qt=Gt.then(re))}function ee(t,e,n,o){v(t)?n.push(...t):e&&e.includes(t,t.allowRecurse?o+1:o)||n.push(t),te()}function ne(t,e=null){if(Bt.length){for(Xt=e,Lt=[...new Set(Bt)],Bt.length=0,Kt=0;Kt<Lt.length;Kt++)Lt[Kt]();Lt=null,Kt=0,Xt=null,ne(t,e)}}const oe=t=>null==t.id?1/0:t.id;function re(t){Wt=!1,Tt=!0,ne(t),Dt.sort(((t,e)=>oe(t)-oe(e)));try{for(Ut=0;Ut<Dt.length;Ut++){const t=Dt[Ut];t&&!1!==t.active&&Vt(t,null,14)}}finally{Ut=0,Dt.length=0,function(t){if(qt.length){const t=[...new Set(qt)];if(qt.length=0,Ht)return void Ht.push(...t);for(Ht=t,Ht.sort(((t,e)=>oe(t)-oe(e))),Jt=0;Jt<Ht.length;Jt++)Ht[Jt]();Ht=null,Jt=0}}(),Tt=!1,Qt=null,(Dt.length||Bt.length||qt.length)&&re(t)}}let se=null;const ie={};function le(t,e,{immediate:n,deep:o,flush:r,onTrack:s,onTrigger:i}=u,l=Ne){let c,a,f=!1,h=!1;if($t(t)?(c=()=>t.value,f=!!t._shallow):jt(t)?(c=()=>t,o=!0):v(t)?(h=!0,f=t.some(jt),c=()=>t.map((t=>$t(t)?t.value:jt(t)?ae(t):b(t)?Vt(t,l,2):void 0))):c=b(t)?e?()=>Vt(t,l,2):()=>{if(!l||!l.isUnmounted)return a&&a(),zt(t,l,3,[p])}:d,e&&o){const t=c;c=()=>ae(t())}let p=t=>{a=m.options.onStop=()=>{Vt(t,l,4)}},g=h?[]:ie;const _=()=>{if(m.active)if(e){const t=m();(o||f||(h?t.some(((t,e)=>R(t,g[e]))):R(t,g)))&&(a&&a(),zt(e,l,3,[t,g===ie?void 0:g,p]),g=t)}else m()};let y;_.allowRecurse=!!e,y="sync"===r?_:"post"===r?()=>_e(_,l&&l.suspense):()=>{!l||l.isMounted?function(t){ee(t,Lt,Bt,Kt)}(_):_()};const m=I(c,{lazy:!0,onTrack:s,onTrigger:i,scheduler:y});return Fe(m,l),e?n?_():g=m():"post"===r?_e(m,l&&l.suspense):m(),()=>{var t;(t=m).active&&(F(t),t.options.onStop&&t.options.onStop(),t.active=!1),l&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(l.effects,m)}}function ce(t,e,n){const o=this.proxy,r=w(t)?t.includes(".")?function(t,e){const n=e.split(".");return()=>{let e=t;for(let t=0;t<n.length&&e;t++)e=e[n[t]];return e}}(o,t):()=>o[t]:t.bind(o,o);let s;return b(e)?s=e:(s=e.handler,n=e),le(r,s.bind(o),n,this)}function ae(t,e=new Set){if(!O(t)||e.has(t)||t.__v_skip)return t;if(e.add(t),$t(t))ae(t.value,e);else if(v(t))for(let n=0;n<t.length;n++)ae(t[n],e);else if("[object Set]"===E(t)||m(t))t.forEach((t=>{ae(t,e)}));else if((t=>"[object Object]"===E(t))(t))for(const n in t)ae(t[n],e);return t}function ue(t,e,n,o=!1){const{mixins:r,extends:s}=e;s&&ue(t,s,n,!0),r&&r.forEach((e=>ue(t,e,n,!0)));for(const i in e)if(o&&"expose"===i);else{const o=fe[i]||n&&n[i];t[i]=o?o(t[i],e[i]):e[i]}return t}const fe={data:de,props:ge,emits:ge,methods:ge,computed:ge,beforeCreate:pe,created:pe,beforeMount:pe,mounted:pe,beforeUpdate:pe,updated:pe,beforeDestroy:pe,destroyed:pe,activated:pe,deactivated:pe,errorCaptured:pe,serverPrefetch:pe,components:ge,directives:ge,watch:function(t,e){if(!t)return e;if(!e)return t;const n=g(Object.create(null),t);for(const o in e)n[o]=pe(t[o],e[o]);return n},provide:de,inject:function(t,e){return ge(he(t),he(e))}};function de(t,e){return e?t?function(){return g(b(t)?t.call(this,this):t,b(e)?e.call(this,this):e)}:e:t}function he(t){if(v(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function pe(t,e){return t?[...new Set([].concat(t,e))]:e}function ge(t,e){return t?g(g(Object.create(null),t),e):e}const _e=function(t,e){e&&e.pendingBranch?v(t)?e.effects.push(...t):e.effects.push(t):ee(t,Ht,qt,Jt)},ye=Symbol(),ve=Symbol(void 0),me=Symbol(void 0),be=Symbol(void 0),we=[];let Se=null;function Oe(t,e,n,o,r){const s=Re(t,e,n,o,r,!0);return s.dynamicChildren=Se||f,we.pop(),Se=we[we.length-1]||null,Se&&Se.push(s),s}const xe="__vInternal",Ee=({key:t})=>null!=t?t:null,Me=({ref:t})=>null!=t?w(t)||$t(t)||b(t)?{i:se,r:t}:t:null,Re=function(t,e=null,n=null,o=0,r=null,i=!1){t&&t!==ye||(t=be);if(l=t,l&&!0===l.__v_isVNode){const o=je(t,e,!0);return n&&Pe(o,n),o}var l;(function(t){return b(t)&&"__vccOpts"in t})(t)&&(t=t.__vccOpts);if(e){(Pt(e)||xe in e)&&(e=g({},e));let{class:t,style:n}=e;t&&!w(t)&&(e.class=a(t)),O(n)&&(Pt(n)&&!v(n)&&(n=g({},n)),e.style=s(n))}const c=w(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:O(t)?4:b(t)?2:0,u={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Ee(e),ref:e&&Me(e),scopeId:null,slotScopeIds:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null};Pe(u,n),128&c&&t.normalize(u);!i&&Se&&(o>0||6&c)&&32!==o&&Se.push(u);return u};function je(t,e,n=!1){const{props:o,ref:r,patchFlag:i,children:l}=t,c=e?function(...t){const e=g({},t[0]);for(let n=1;n<t.length;n++){const o=t[n];for(const t in o)if("class"===t)e.class!==o.class&&(e.class=a([e.class,o.class]));else if("style"===t)e.style=s([e.style,o.style]);else if(p(t)){const n=e[t],r=o[t];n!==r&&(e[t]=n?[].concat(n,r):r)}else""!==t&&(e[t]=o[t])}return e}(o||{},e):o;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&Ee(c),ref:e&&e.ref?n&&r?v(r)?r.concat(Me(e)):[r,Me(e)]:Me(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:l,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ve?-1===i?16:16|i:i,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&je(t.ssContent),ssFallback:t.ssFallback&&je(t.ssFallback),el:t.el,anchor:t.anchor}}function ke(t=" ",e=0){return Re(me,null,t,e)}function Pe(t,e){let n=0;const{shapeFlag:o}=t;if(null==e)e=null;else if(v(e))n=16;else if("object"==typeof e){if(1&o||64&o){const n=e.default;return void(n&&(n._c&&(n._d=!1),Pe(t,n()),n._c&&(n._d=!0)))}{n=32;const t=e._;t||xe in e||(e._ctx=se)}}else b(e)?(e={default:e,_ctx:se},n=32):(e=String(e),64&o?(n=16,e=[ke(e)]):n=8);t.children=e,t.shapeFlag|=n}const Ce=t=>t?4&t.vnode.shapeFlag?t.exposed?t.exposed:t.proxy:Ce(t.parent):null,$e=g(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Ce(t.parent),$root:t=>Ce(t.root),$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{mixins:n,extends:o}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:i}}=t.appContext,l=s.get(e);let c;return l?c=l:r.length||n||o?(c={},r.length&&r.forEach((t=>ue(c,t,i,!0))),ue(c,e,i)):c=e,s.set(e,c),c}(t),$forceUpdate:t=>()=>Zt(t.update),$nextTick:t=>Yt.bind(t.proxy),$watch:t=>ce.bind(t)}),Ie={get({_:t},e){const{ctx:n,setupState:o,data:r,props:s,accessCache:i,type:l,appContext:c}=t;let a;if("$"!==e[0]){const l=i[e];if(void 0!==l)switch(l){case 0:return o[e];case 1:return r[e];case 3:return n[e];case 2:return s[e]}else{if(o!==u&&y(o,e))return i[e]=0,o[e];if(r!==u&&y(r,e))return i[e]=1,r[e];if((a=t.propsOptions[0])&&y(a,e))return i[e]=2,s[e];if(n!==u&&y(n,e))return i[e]=3,n[e];i[e]=4}}const f=$e[e];let d,h;return f?("$attrs"===e&&W(t,0,e),f(t)):(d=l.__cssModules)&&(d=d[e])?d:n!==u&&y(n,e)?(i[e]=3,n[e]):(h=c.config.globalProperties,y(h,e)?h[e]:void 0)},set({_:t},e,n){const{data:o,setupState:r,ctx:s}=t;if(r!==u&&y(r,e))r[e]=n;else if(o!==u&&y(o,e))o[e]=n;else if(y(t.props,e))return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,propsOptions:s}},i){let l;return void 0!==n[i]||t!==u&&y(t,i)||e!==u&&y(e,i)||(l=s[0])&&y(l,i)||y(o,i)||y($e,i)||y(r.config.globalProperties,i)}};g({},Ie,{get(t,e){if(e!==Symbol.unscopables)return Ie.get(t,e,t)},has:(t,e)=>"_"!==e[0]&&!r(e)});let Ne=null;function Fe(t,e=Ne){e&&(e.effects||(e.effects=[])).push(t)}function Ve(t){const e=function(t){let e,n;return b(t)?(e=t,n=d):(e=t.get,n=t.set),new Ft(e,n,b(t)||!t.set)}(t);return Fe(e.effect),e}const ze=(Ae={name:"MonacoEditor",props:{diffEditor:{type:Boolean,default:!1},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},original:String,value:String,language:{type:String,default:"javascript"},theme:{type:String,default:"vs"},options:{type:Object,default:()=>({})}},emits:["editorWillMount","editorDidMount","change"],setup(t){const{width:e,height:n}=function(t){const e=v(t)?new Array(t.length):{};for(const n in t)e[n]=Nt(t,n);return e}(t);return{style:Ve((()=>({width:e.value.toString().includes("%")?e.value:`${e.value}px`,height:n.value.toString().includes("%")?n.value:`${n.value}px`,"text-align":"left"})))}},mounted(){this.initMonaco()},beforeDestroy(){this.editor&&this.editor.dispose()},methods:{initMonaco(){this.$emit("editorWillMount",this.monaco);const{value:t,language:e,theme:o,options:r}=this;this.editor=n.editor[this.diffEditor?"createDiffEditor":"create"](this.$el,__spreadValues({value:t,language:e,theme:o},r)),this.diffEditor&&this._setModel(this.value,this.original);const s=this._getEditor();s.onDidChangeModelContent((t=>{const e=s.getValue();this.value!==e&&this.$emit("change",e,t)})),this.$emit("editorDidMount",this.editor)},_setModel(t,e){const{language:o}=this,r=n.editor.createModel(e,o),s=n.editor.createModel(t,o);this.editor.setModel({original:r,modified:s})},_setValue(t){let e=this._getEditor();if(e)return e.setValue(t)},_getValue(){let t=this._getEditor();return t?t.getValue():""},_getEditor(){return this.editor?this.diffEditor?this.editor.modifiedEditor:this.editor:null},_setOriginal(){const{original:t}=this.editor.getModel();t.setValue(this.original)}},watch:{options:{deep:!0,handler(t){this.editor.updateOptions(t)}},value(){this.value!==this._getValue()&&this._setValue(this.value)},original(){this._setOriginal()},language(){if(this.editor)if(this.diffEditor){const{original:t,modified:e}=this.editor.getModel();n.editor.setModelLanguage(t,this.language),n.editor.setModelLanguage(e,this.language)}else n.editor.setModelLanguage(this.editor.getModel(),this.language)},theme(){n.editor.setTheme(this.theme)}}},b(Ae)?{setup:Ae,name:Ae.name}:Ae);var Ae;return ze.render=function(t,e,n,o,r,s){return function(t=!1){we.push(Se=t?null:[])}(),Oe("div",{class:"monaco-editor-vue3",style:t.style},null,4)},ze.install=t=>{t.component(ze.name,ze)},ze}));
(function(_,m){typeof exports=="object"&&typeof module!="undefined"?module.exports=m(require("monaco-editor")):typeof define=="function"&&define.amd?define(["monaco-editor"],m):(_=typeof globalThis!="undefined"?globalThis:_||self,_["monaco-editor-vue3"]=m(_["monaco-editor"]))})(this,function(_){"use strict";function m(t){if(t&&t.__esModule)return t;var e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});return t&&Object.keys(t).forEach(function(n){if(n!=="default"){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var f=m(_);function E(t){if(d(t)){const e={};for(let n=0;n<t.length;n++){const i=t[n],s=g(i)?q(i):E(i);if(s)for(const o in s)e[o]=s[o]}return e}else{if(g(t))return t;if(k(t))return t}}const K=/;(?![^(]*\))/g,Y=/:(.+)/;function q(t){const e={};return t.split(K).forEach(n=>{if(n){const i=n.split(Y);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function V(t){let e="";if(g(t))e=t;else if(d(t))for(let n=0;n<t.length;n++){const i=V(t[n]);i&&(e+=i+" ")}else if(k(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const G=[],H=()=>{},U=/^on[^a-z]/,J=t=>U.test(t),I=Object.assign,d=Array.isArray,p=t=>typeof t=="function",g=t=>typeof t=="string",k=t=>t!==null&&typeof t=="object";let Q;function X(t,e=Q){e&&e.active&&e.effects.push(t)}const Z=t=>{const e=new Set(t);return e.w=0,e.n=0,e},x=t=>(t.w&h)>0,N=t=>(t.n&h)>0,tt=({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=h},et=t=>{const{deps:e}=t;if(e.length){let n=0;for(let i=0;i<e.length;i++){const s=e[i];x(s)&&!N(s)?s.delete(t):e[n++]=s,s.w&=~h,s.n&=~h}e.length=n}};let y=0,h=1;const v=30;let u;class nt{constructor(e,n=null,i){this.fn=e,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,X(this,i)}run(){if(!this.active)return this.fn();let e=u,n=M;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=u,u=this,M=!0,h=1<<++y,y<=v?tt(this):T(this),this.fn()}finally{y<=v&&et(this),h=1<<--y,u=this.parent,M=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){u===this?this.deferStop=!0:this.active&&(T(this),this.onStop&&this.onStop(),this.active=!1)}}function T(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let M=!0;function it(t,e){let n=!1;y<=v?N(t)||(t.n|=h,n=!x(t)):n=!t.has(u),n&&(t.add(u),u.deps.push(t))}function st(t,e){const n=d(t)?t:[...t];for(const i of n)i.computed&&j(i);for(const i of n)i.computed||j(i)}function j(t,e){(t!==u||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}function D(t){return $(t)?D(t.__v_raw):!!(t&&t.__v_isReactive)}function $(t){return!!(t&&t.__v_isReadonly)}function z(t){return D(t)||$(t)}function b(t){const e=t&&t.__v_raw;return e?b(e):t}function ot(t){M&&u&&(t=b(t),it(t.dep||(t.dep=Z())))}function lt(t,e){t=b(t),t.dep&&st(t.dep)}function A(t){return!!(t&&t.__v_isRef===!0)}function rt(t){const e=d(t)?new Array(t.length):{};for(const n in t)e[n]=at(t,n);return e}class ct{constructor(e,n,i){this._object=e,this._key=n,this._defaultValue=i,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}}function at(t,e,n){const i=t[e];return A(i)?i:new ct(t,e,n)}class ut{constructor(e,n,i,s){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new nt(e,()=>{this._dirty||(this._dirty=!0,lt(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=i}get value(){const e=b(this);return ot(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function ft(t,e,n=!1){let i,s;const o=p(t);return o?(i=t,s=H):(i=t.get,s=t.set),new ut(i,s,o||!s,n)}let S=null,dt=null;const ht=t=>t.__isSuspense;function gt(t){return p(t)?{setup:t,name:t.name}:t}const _t=Symbol(),pt=t=>t.__isTeleport,B=Symbol(void 0),mt=Symbol(void 0),yt=Symbol(void 0),R=[];let a=null;function St(t=!1){R.push(a=t?null:[])}function Et(){R.pop(),a=R[R.length-1]||null}function kt(t){return t.dynamicChildren=a||G,Et(),a&&a.push(t),t}function Mt(t,e,n,i,s,o){return kt(W(t,e,n,i,s,o,!0))}function bt(t){return t?t.__v_isVNode===!0:!1}const L="__vInternal",P=({key:t})=>t!=null?t:null,C=({ref:t,ref_key:e,ref_for:n})=>t!=null?g(t)||A(t)||p(t)?{i:S,r:t,k:e,f:!!n}:t:null;function W(t,e=null,n=null,i=0,s=null,o=t===B?0:1,l=!1,r=!1){const c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&P(e),ref:e&&C(e),scopeId:dt,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null};return r?(F(c,n),o&128&&t.normalize(c)):n&&(c.shapeFlag|=g(n)?8:16),!l&&a&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&a.push(c),c}const Rt=Ct;function Ct(t,e=null,n=null,i=0,s=null,o=!1){if((!t||t===_t)&&(t=yt),bt(t)){const r=O(t,e,!0);return n&&F(r,n),!o&&a&&(r.shapeFlag&6?a[a.indexOf(t)]=r:a.push(r)),r.patchFlag|=-2,r}if(Ft(t)&&(t=t.__vccOpts),e){e=wt(e);let{class:r,style:c}=e;r&&!g(r)&&(e.class=V(r)),k(c)&&(z(c)&&!d(c)&&(c=I({},c)),e.style=E(c))}const l=g(t)?1:ht(t)?128:pt(t)?64:k(t)?4:p(t)?2:0;return W(t,e,n,i,s,l,o,!0)}function wt(t){return t?z(t)||L in t?I({},t):t:null}function O(t,e,n=!1){const{props:i,ref:s,patchFlag:o,children:l}=t,r=e?vt(i||{},e):i;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:r,key:r&&P(r),ref:e&&e.ref?n&&s?d(s)?s.concat(C(e)):[s,C(e)]:C(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:l,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==B?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&O(t.ssContent),ssFallback:t.ssFallback&&O(t.ssFallback),el:t.el,anchor:t.anchor}}function Vt(t=" ",e=0){return Rt(mt,null,t,e)}function F(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(d(e))n=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),F(t,s()),s._c&&(s._d=!0));return}else{n=32;const s=e._;!s&&!(L in e)?e._ctx=S:s===3&&S&&(S.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else p(e)?(e={default:e,_ctx:S},n=32):(e=String(e),i&64?(n=16,e=[Vt(e)]):n=8);t.children=e,t.shapeFlag|=n}function vt(...t){const e={};for(let n=0;n<t.length;n++){const i=t[n];for(const s in i)if(s==="class")e.class!==i.class&&(e.class=V([e.class,i.class]));else if(s==="style")e.style=E([e.style,i.style]);else if(J(s)){const o=e[s],l=i[s];l&&o!==l&&!(d(o)&&o.includes(l))&&(e[s]=o?[].concat(o,l):l)}else s!==""&&(e[s]=i[s])}return e}let Ot=!1;function Ft(t){return p(t)&&"__vccOpts"in t}const It=(t,e)=>ft(t,e,Ot);var xt=(t,e)=>{const n=t.__vccOpts||t;for(const[i,s]of e)n[i]=s;return n};const Nt=gt({name:"MonacoEditor",props:{diffEditor:{type:Boolean,default:!1},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},original:String,value:String,language:{type:String,default:"javascript"},theme:{type:String,default:"vs"},options:{type:Object,default(){return{}}}},emits:["editorWillMount","editorDidMount","change","update:value"],setup(t){const{width:e,height:n}=rt(t);return{style:It(()=>{const s=e.value.toString().includes("%")?e.value:`${e.value}px`,o=n.value.toString().includes("%")?n.value:`${n.value}px`;return{width:s,height:o,"text-align":"left"}})}},mounted(){this.initMonaco()},beforeDestroy(){this.editor&&this.editor.dispose()},methods:{initMonaco(){this.$emit("editorWillMount",f);const{value:t,language:e,theme:n,options:i}=this;this.editor=f.editor[this.diffEditor?"createDiffEditor":"create"](this.$el,{value:t,language:e,theme:n,...i}),this.diffEditor&&this._setModel(this.value,this.original);const s=this._getEditor();s&&s.onDidChangeModelContent(o=>{const l=s.getValue();this.value!==l&&(this.$emit("change",l,o),this.$emit("update:value",l))}),this.$emit("editorDidMount",this.editor)},_setModel(t,e){const{language:n}=this,i=f.editor.createModel(e,n),s=f.editor.createModel(t,n);this.editor.setModel({original:i,modified:s})},_setValue(t){let e=this._getEditor();if(e)return e.setValue(t)},_getValue(){let t=this._getEditor();return t?t.getValue():""},_getEditor(){return this.editor?this.diffEditor?this.editor.modifiedEditor:this.editor:null},_setOriginal(){const{original:t}=this.editor.getModel();t.setValue(this.original)}},watch:{options:{deep:!0,handler(t){this.editor.updateOptions(t)}},value(){this.value!==this._getValue()&&this._setValue(this.value)},original(){this._setOriginal()},language(){if(!!this.editor)if(this.diffEditor){const{original:t,modified:e}=this.editor.getModel();f.editor.setModelLanguage(t,this.language),f.editor.setModelLanguage(e,this.language)}else f.editor.setModelLanguage(this.editor.getModel(),this.language)},theme(){f.editor.setTheme(this.theme)}}});function Tt(t,e,n,i,s,o){return St(),Mt("div",{class:"monaco-editor-vue3",style:E(t.style)},null,4)}var w=xt(Nt,[["render",Tt]]);return w.install=t=>{t.component(w.name,w)},w});
{
"name": "monaco-editor-vue3",
"version": "0.1.5",
"version": "0.1.6",
"keywords": [

@@ -11,2 +11,3 @@ "Vue3",

"module": "./dist/monaco-editor-vue3.es.js",
"types": "./typings/monaco-editor.d.ts",
"author": {

@@ -24,4 +25,4 @@ "name": "邱凯翔",

"dev": "vite",
"start": "pnpm dev",
"build": "vite build",
"serve": "vite preview",
"test": "jest",

@@ -31,4 +32,5 @@ "version": "conventional-changelog -p angular -i CHANGELOG.md -s"

"dependencies": {
"monaco-editor": "^0.25.2",
"vue": "^3.1.2"
"monaco-editor": "^0.33.0",
"vite-plugin-monaco-editor": "^1.1.0",
"vue": "^3.2.37"
},

@@ -43,3 +45,3 @@ "devDependencies": {

"@rollup/plugin-node-resolve": "^13.0.0",
"@vitejs/plugin-vue": "^1.2.1",
"@vitejs/plugin-vue": "^2.3.3",
"@vue/compiler-sfc": "^3.1.2",

@@ -51,8 +53,10 @@ "@vue/test-utils": "^2.0.0-rc.8",

"jest-css-modules": "^2.1.0",
"postcss": "^8.4.14",
"rollup": "^2.76.0",
"rollup-plugin-monaco-editor": "^0.0.7",
"rollup-plugin-postcss": "^4.0.0",
"sass": "^1.35.1",
"vite": "^2.1.5",
"vite": "^2.9.14",
"vue-jest": "^5.0.0-alpha.10"
}
}

@@ -12,3 +12,3 @@ # Monaco Editor Vue3

```bash
npm install monaco-editor-vue3
pnpm install monaco-editor-vue3
```

@@ -22,2 +22,8 @@

Or
```bash
npm i monaco-editor-vue3
```
## Usage

@@ -51,11 +57,16 @@

<template>
<MonacoEditor
class="editor"
v-model="code"
language="javascript"
/>
<MonacoEditor
theme="vs"
:options="options"
language="javascript"
:width="800"
:height="800"
:diffEditor="true"
:original="original"
v-model:value="value"
></MonacoEditor>
</template>
<script>
import MonacoEditor from 'vue-monaco'
import MonacoEditor from 'monaco-editor-vue3'

@@ -83,2 +94,6 @@ export default {

### Use ESM version with Vite
[See Stackblitz Demo](https://stackblitz.com/edit/vitejs-vite-bfx1bj)
### Use ESM version with rollup

@@ -180,2 +195,9 @@

## Typescript
create `monaco-editor-vue3.d.ts` in your root.
```ts
declare module "monaco-editor-vue3";
```
This will allow ts compilation without errors, but may not include all the types.
## Contributing

@@ -192,2 +214,2 @@

**Monaco Editor Vue3** © [bazingaedward](https://github.com/bazingaedward), Released under the [MIT](./LICENSE) License.<br>
Authored and maintained by egoist with help from contributors ([list](https://github.com/bazingaedward/monaco-editor-vue3/contributors)).
Authored and maintained by egoist with help from contributors ([list](https://github.com/bazingaedward/monaco-editor-vue3/contributors)).
import { createApp } from 'vue'
import App from './App.vue'
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
self.MonacoEnvironment = {
getWorker(_, label) {
if (label === 'json') {
return new jsonWorker()
}
if (label === 'css' || label === 'scss' || label === 'less') {
return new cssWorker()
}
if (label === 'html' || label === 'handlebars' || label === 'razor') {
return new htmlWorker()
}
if (label === 'typescript' || label === 'javascript') {
return new tsWorker()
}
return new editorWorker()
}
}
createApp(App).mount('#app')

@@ -7,2 +7,3 @@ /**

// TODO: add test
describe('monaco editor', ()=>{

@@ -9,0 +10,0 @@

@@ -12,3 +12,3 @@ // vite.config.js

lib: {
entry: path.resolve(__dirname, 'src/main.js'),
entry: path.resolve(__dirname, 'src/main.ts'),
name: 'monaco-editor-vue3',

@@ -28,4 +28,4 @@ formats: ['es', 'umd']

vue(),
]
],
}
export default config

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc