@iebh/tera-fy 1.4.1 → 1.4.2
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/CHANGELOG.md +7 -0
- package/dist/plugin.vue2.es2019.js +1 -1
- package/package.json +1 -1
- package/plugins/vue2.js +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.2](https://github.com/IEBH/TERA-fy/compare/v1.4.1...v1.4.2) (2024-05-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **plugins/vue2:** Deep Vue.set() for recursive objects ([9321d6f](https://github.com/IEBH/TERA-fy/commit/9321d6fbc54e4cf113c6fdce861a4a52d0a4b983))
|
|
9
|
+
|
|
3
10
|
## [1.4.1](https://github.com/IEBH/TERA-fy/compare/v1.4.0...v1.4.1) (2024-05-02)
|
|
4
11
|
|
|
5
12
|
# [1.4.0](https://github.com/IEBH/TERA-fy/compare/v1.3.2...v1.4.0) (2024-04-26)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var fr=Object.defineProperty;var sr=(t,e,r)=>e in t?fr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var k=(t,e,r)=>(sr(t,typeof e!="symbol"?e+"":e,r),r);var pr=typeof global=="object"&&global&&global.Object===Object&&global,q=pr;var ir=typeof self=="object"&&self&&self.Object===Object&&self,nr=q||ir||Function("return this")(),u=nr;var ur=u.Symbol,g=ur;var _t=Object.prototype,mr=_t.hasOwnProperty,lr=_t.toString,V=g?g.toStringTag:void 0;function dr(t){var e=mr.call(t,V),r=t[V];try{t[V]=void 0;var o=!0}catch{}var a=lr.call(t);return o&&(e?t[V]=r:delete t[V]),a}var At=dr;var cr=Object.prototype,xr=cr.toString;function gr(t){return xr.call(t)}var wt=gr;var hr="[object Null]",yr="[object Undefined]",St=g?g.toStringTag:void 0;function br(t){return t==null?t===void 0?yr:hr:St&&St in Object(t)?At(t):wt(t)}var h=br;function vr(t){return t!=null&&typeof t=="object"}var c=vr;var jr=Array.isArray,C=jr;function Tr(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var x=Tr;var Or="[object AsyncFunction]",_r="[object Function]",Ar="[object GeneratorFunction]",wr="[object Proxy]";function Sr(t){if(!x(t))return!1;var e=h(t);return e==_r||e==Ar||e==Or||e==wr}var H=Sr;var Ir=u["__core-js_shared__"],$=Ir;var It=function(){var t=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Pr(t){return!!It&&It in t}var Pt=Pr;var Cr=Function.prototype,Er=Cr.toString;function Br(t){if(t!=null){try{return Er.call(t)}catch{}try{return t+""}catch{}}return""}var y=Br;var Lr=/[\\^$.*+?()[\]{}|]/g,Mr=/^\[object .+?Constructor\]$/,Dr=Function.prototype,Fr=Object.prototype,Nr=Dr.toString,Rr=Fr.hasOwnProperty,Ur=RegExp("^"+Nr.call(Rr).replace(Lr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gr(t){if(!x(t)||Pt(t))return!1;var e=H(t)?Ur:Mr;return e.test(y(t))}var Ct=Gr;function Wr(t,e){return t==null?void 0:t[e]}var Et=Wr;function Vr(t,e){var r=Et(t,e);return Ct(r)?r:void 0}var m=Vr;var Kr=m(u,"WeakMap"),J=Kr;var Bt=Object.create,zr=function(){function t(){}return function(e){if(!x(e))return{};if(Bt)return Bt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Lt=zr;function kr(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var Mt=kr;var qr=function(){try{var t=m(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ct=qr;function Hr(t,e){for(var r=-1,o=t==null?0:t.length;++r<o&&e(t[r],r,t)!==!1;);return t}var Dt=Hr;var $r=9007199254740991,Jr=/^(?:0|[1-9]\d*)$/;function Yr(t,e){var r=typeof t;return e=e==null?$r:e,!!e&&(r=="number"||r!="symbol"&&Jr.test(t))&&t>-1&&t%1==0&&t<e}var Ft=Yr;function Xr(t,e,r){e=="__proto__"&&ct?ct(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Y=Xr;function Zr(t,e){return t===e||t!==t&&e!==e}var X=Zr;var Qr=Object.prototype,to=Qr.hasOwnProperty;function eo(t,e,r){var o=t[e];(!(to.call(t,e)&&X(o,r))||r===void 0&&!(e in t))&&Y(t,e,r)}var Z=eo;function ro(t,e,r,o){var a=!r;r||(r={});for(var f=-1,s=e.length;++f<s;){var n=e[f],l=o?o(r[n],t[n],n,r,t):void 0;l===void 0&&(l=t[n]),a?Y(r,n,l):Z(r,n,l)}return r}var T=ro;var oo=9007199254740991;function ao(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=oo}var Q=ao;function fo(t){return t!=null&&Q(t.length)&&!H(t)}var tt=fo;var so=Object.prototype;function po(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||so;return t===r}var E=po;function io(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var Nt=io;var no="[object Arguments]";function uo(t){return c(t)&&h(t)==no}var xt=uo;var Rt=Object.prototype,mo=Rt.hasOwnProperty,lo=Rt.propertyIsEnumerable,co=xt(function(){return arguments}())?xt:function(t){return c(t)&&mo.call(t,"callee")&&!lo.call(t,"callee")},Ut=co;function xo(){return!1}var Gt=xo;var Kt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wt=Kt&&typeof module=="object"&&module&&!module.nodeType&&module,go=Wt&&Wt.exports===Kt,Vt=go?u.Buffer:void 0,ho=Vt?Vt.isBuffer:void 0,yo=ho||Gt,et=yo;var bo="[object Arguments]",vo="[object Array]",jo="[object Boolean]",To="[object Date]",Oo="[object Error]",_o="[object Function]",Ao="[object Map]",wo="[object Number]",So="[object Object]",Io="[object RegExp]",Po="[object Set]",Co="[object String]",Eo="[object WeakMap]",Bo="[object ArrayBuffer]",Lo="[object DataView]",Mo="[object Float32Array]",Do="[object Float64Array]",Fo="[object Int8Array]",No="[object Int16Array]",Ro="[object Int32Array]",Uo="[object Uint8Array]",Go="[object Uint8ClampedArray]",Wo="[object Uint16Array]",Vo="[object Uint32Array]",i={};i[Mo]=i[Do]=i[Fo]=i[No]=i[Ro]=i[Uo]=i[Go]=i[Wo]=i[Vo]=!0;i[bo]=i[vo]=i[Bo]=i[jo]=i[Lo]=i[To]=i[Oo]=i[_o]=i[Ao]=i[wo]=i[So]=i[Io]=i[Po]=i[Co]=i[Eo]=!1;function Ko(t){return c(t)&&Q(t.length)&&!!i[h(t)]}var zt=Ko;function zo(t){return function(e){return t(e)}}var B=zo;var kt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,K=kt&&typeof module=="object"&&module&&!module.nodeType&&module,ko=K&&K.exports===kt,gt=ko&&q.process,qo=function(){try{var t=K&&K.require&&K.require("util").types;return t||gt&>.binding&>.binding("util")}catch{}}(),b=qo;var qt=b&&b.isTypedArray,Ho=qt?B(qt):zt,Ht=Ho;var $o=Object.prototype,Jo=$o.hasOwnProperty;function Yo(t,e){var r=C(t),o=!r&&Ut(t),a=!r&&!o&&et(t),f=!r&&!o&&!a&&Ht(t),s=r||o||a||f,n=s?Nt(t.length,String):[],l=n.length;for(var d in t)(e||Jo.call(t,d))&&!(s&&(d=="length"||a&&(d=="offset"||d=="parent")||f&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ft(d,l)))&&n.push(d);return n}var rt=Yo;function Xo(t,e){return function(r){return t(e(r))}}var ot=Xo;var Zo=ot(Object.keys,Object),$t=Zo;var Qo=Object.prototype,ta=Qo.hasOwnProperty;function ea(t){if(!E(t))return $t(t);var e=[];for(var r in Object(t))ta.call(t,r)&&r!="constructor"&&e.push(r);return e}var Jt=ea;function ra(t){return tt(t)?rt(t):Jt(t)}var L=ra;function oa(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Yt=oa;var aa=Object.prototype,fa=aa.hasOwnProperty;function sa(t){if(!x(t))return Yt(t);var e=E(t),r=[];for(var o in t)o=="constructor"&&(e||!fa.call(t,o))||r.push(o);return r}var Xt=sa;function pa(t){return tt(t)?rt(t,!0):Xt(t)}var M=pa;var ia=m(Object,"create"),v=ia;function na(){this.__data__=v?v(null):{},this.size=0}var Zt=na;function ua(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Qt=ua;var ma="__lodash_hash_undefined__",la=Object.prototype,da=la.hasOwnProperty;function ca(t){var e=this.__data__;if(v){var r=e[t];return r===ma?void 0:r}return da.call(e,t)?e[t]:void 0}var te=ca;var xa=Object.prototype,ga=xa.hasOwnProperty;function ha(t){var e=this.__data__;return v?e[t]!==void 0:ga.call(e,t)}var ee=ha;var ya="__lodash_hash_undefined__";function ba(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=v&&e===void 0?ya:e,this}var re=ba;function D(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}D.prototype.clear=Zt;D.prototype.delete=Qt;D.prototype.get=te;D.prototype.has=ee;D.prototype.set=re;var ht=D;function va(){this.__data__=[],this.size=0}var oe=va;function ja(t,e){for(var r=t.length;r--;)if(X(t[r][0],e))return r;return-1}var O=ja;var Ta=Array.prototype,Oa=Ta.splice;function _a(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():Oa.call(e,r,1),--this.size,!0}var ae=_a;function Aa(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var fe=Aa;function wa(t){return O(this.__data__,t)>-1}var se=wa;function Sa(t,e){var r=this.__data__,o=O(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var pe=Sa;function F(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}F.prototype.clear=oe;F.prototype.delete=ae;F.prototype.get=fe;F.prototype.has=se;F.prototype.set=pe;var _=F;var Ia=m(u,"Map"),A=Ia;function Pa(){this.size=0,this.__data__={hash:new ht,map:new(A||_),string:new ht}}var ie=Pa;function Ca(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var ne=Ca;function Ea(t,e){var r=t.__data__;return ne(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=Ea;function Ba(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var ue=Ba;function La(t){return w(this,t).get(t)}var me=La;function Ma(t){return w(this,t).has(t)}var le=Ma;function Da(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var de=Da;function N(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=ie;N.prototype.delete=ue;N.prototype.get=me;N.prototype.has=le;N.prototype.set=de;var ce=N;function Fa(t,e){for(var r=-1,o=e.length,a=t.length;++r<o;)t[a+r]=e[r];return t}var at=Fa;var Na=ot(Object.getPrototypeOf,Object),ft=Na;function Ra(){this.__data__=new _,this.size=0}var xe=Ra;function Ua(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var ge=Ua;function Ga(t){return this.__data__.get(t)}var he=Ga;function Wa(t){return this.__data__.has(t)}var ye=Wa;var Va=200;function Ka(t,e){var r=this.__data__;if(r instanceof _){var o=r.__data__;if(!A||o.length<Va-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new ce(o)}return r.set(t,e),this.size=r.size,this}var be=Ka;function R(t){var e=this.__data__=new _(t);this.size=e.size}R.prototype.clear=xe;R.prototype.delete=ge;R.prototype.get=he;R.prototype.has=ye;R.prototype.set=be;var ve=R;function za(t,e){return t&&T(e,L(e),t)}var je=za;function ka(t,e){return t&&T(e,M(e),t)}var Te=ka;var we=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Oe=we&&typeof module=="object"&&module&&!module.nodeType&&module,qa=Oe&&Oe.exports===we,_e=qa?u.Buffer:void 0,Ae=_e?_e.allocUnsafe:void 0;function Ha(t,e){if(e)return t.slice();var r=t.length,o=Ae?Ae(r):new t.constructor(r);return t.copy(o),o}var Se=Ha;function $a(t,e){for(var r=-1,o=t==null?0:t.length,a=0,f=[];++r<o;){var s=t[r];e(s,r,t)&&(f[a++]=s)}return f}var Ie=$a;function Ja(){return[]}var st=Ja;var Ya=Object.prototype,Xa=Ya.propertyIsEnumerable,Pe=Object.getOwnPropertySymbols,Za=Pe?function(t){return t==null?[]:(t=Object(t),Ie(Pe(t),function(e){return Xa.call(t,e)}))}:st,U=Za;function Qa(t,e){return T(t,U(t),e)}var Ce=Qa;var tf=Object.getOwnPropertySymbols,ef=tf?function(t){for(var e=[];t;)at(e,U(t)),t=ft(t);return e}:st,pt=ef;function rf(t,e){return T(t,pt(t),e)}var Ee=rf;function of(t,e,r){var o=e(t);return C(t)?o:at(o,r(t))}var it=of;function af(t){return it(t,L,U)}var Be=af;function ff(t){return it(t,M,pt)}var Le=ff;var sf=m(u,"DataView"),nt=sf;var pf=m(u,"Promise"),ut=pf;var nf=m(u,"Set"),mt=nf;var Me="[object Map]",uf="[object Object]",De="[object Promise]",Fe="[object Set]",Ne="[object WeakMap]",Re="[object DataView]",mf=y(nt),lf=y(A),df=y(ut),cf=y(mt),xf=y(J),I=h;(nt&&I(new nt(new ArrayBuffer(1)))!=Re||A&&I(new A)!=Me||ut&&I(ut.resolve())!=De||mt&&I(new mt)!=Fe||J&&I(new J)!=Ne)&&(I=function(t){var e=h(t),r=e==uf?t.constructor:void 0,o=r?y(r):"";if(o)switch(o){case mf:return Re;case lf:return Me;case df:return De;case cf:return Fe;case xf:return Ne}return e});var G=I;var gf=Object.prototype,hf=gf.hasOwnProperty;function yf(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&hf.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Ue=yf;var bf=u.Uint8Array,yt=bf;function vf(t){var e=new t.constructor(t.byteLength);return new yt(e).set(new yt(t)),e}var W=vf;function jf(t,e){var r=e?W(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Ge=jf;var Tf=/\w*$/;function Of(t){var e=new t.constructor(t.source,Tf.exec(t));return e.lastIndex=t.lastIndex,e}var We=Of;var Ve=g?g.prototype:void 0,Ke=Ve?Ve.valueOf:void 0;function _f(t){return Ke?Object(Ke.call(t)):{}}var ze=_f;function Af(t,e){var r=e?W(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var ke=Af;var wf="[object Boolean]",Sf="[object Date]",If="[object Map]",Pf="[object Number]",Cf="[object RegExp]",Ef="[object Set]",Bf="[object String]",Lf="[object Symbol]",Mf="[object ArrayBuffer]",Df="[object DataView]",Ff="[object Float32Array]",Nf="[object Float64Array]",Rf="[object Int8Array]",Uf="[object Int16Array]",Gf="[object Int32Array]",Wf="[object Uint8Array]",Vf="[object Uint8ClampedArray]",Kf="[object Uint16Array]",zf="[object Uint32Array]";function kf(t,e,r){var o=t.constructor;switch(e){case Mf:return W(t);case wf:case Sf:return new o(+t);case Df:return Ge(t,r);case Ff:case Nf:case Rf:case Uf:case Gf:case Wf:case Vf:case Kf:case zf:return ke(t,r);case If:return new o;case Pf:case Bf:return new o(t);case Cf:return We(t);case Ef:return new o;case Lf:return ze(t)}}var qe=kf;function qf(t){return typeof t.constructor=="function"&&!E(t)?Lt(ft(t)):{}}var He=qf;var Hf="[object Map]";function $f(t){return c(t)&&G(t)==Hf}var $e=$f;var Je=b&&b.isMap,Jf=Je?B(Je):$e,Ye=Jf;var Yf="[object Set]";function Xf(t){return c(t)&&G(t)==Yf}var Xe=Xf;var Ze=b&&b.isSet,Zf=Ze?B(Ze):Xe,Qe=Zf;var Qf=1,ts=2,es=4,tr="[object Arguments]",rs="[object Array]",os="[object Boolean]",as="[object Date]",fs="[object Error]",er="[object Function]",ss="[object GeneratorFunction]",ps="[object Map]",is="[object Number]",rr="[object Object]",ns="[object RegExp]",us="[object Set]",ms="[object String]",ls="[object Symbol]",ds="[object WeakMap]",cs="[object ArrayBuffer]",xs="[object DataView]",gs="[object Float32Array]",hs="[object Float64Array]",ys="[object Int8Array]",bs="[object Int16Array]",vs="[object Int32Array]",js="[object Uint8Array]",Ts="[object Uint8ClampedArray]",Os="[object Uint16Array]",_s="[object Uint32Array]",p={};p[tr]=p[rs]=p[cs]=p[xs]=p[os]=p[as]=p[gs]=p[hs]=p[ys]=p[bs]=p[vs]=p[ps]=p[is]=p[rr]=p[ns]=p[us]=p[ms]=p[ls]=p[js]=p[Ts]=p[Os]=p[_s]=!0;p[fs]=p[er]=p[ds]=!1;function lt(t,e,r,o,a,f){var s,n=e&Qf,l=e&ts,d=e&es;if(r&&(s=a?r(t,o,a,f):r(t)),s!==void 0)return s;if(!x(t))return t;var vt=C(t);if(vt){if(s=Ue(t),!n)return Mt(t,s)}else{var P=G(t),jt=P==er||P==ss;if(et(t))return Se(t,n);if(P==rr||P==tr||jt&&!a){if(s=l||jt?{}:He(t),!n)return l?Ee(t,Te(s,t)):Ce(t,je(s,t))}else{if(!p[P])return a?t:{};s=qe(t,P,n)}}f||(f=new ve);var Tt=f.get(t);if(Tt)return Tt;f.set(t,s),Qe(t)?t.forEach(function(j){s.add(lt(j,e,r,j,t,f))}):Ye(t)&&t.forEach(function(j,S){s.set(S,lt(j,e,r,S,t,f))});var ar=d?l?Le:Be:l?M:L,Ot=vt?void 0:ar(t);return Dt(Ot||t,function(j,S){Ot&&(S=j,j=t[S]),Z(s,S,lt(j,e,r,S,t,f))}),s}var or=lt;var As=1,ws=4;function Ss(t){return or(t,As|ws)}var dt=Ss;var z=class{init(){}constructor(e,r){}};var bt=class extends z{constructor(){super(...arguments);k(this,"Vue");k(this,"projects");k(this,"state",null)}bindProjectState(r){let o={component:null,componentKey:null,autoRequire:!0,write:!0,...r};return Promise.resolve().then(()=>Promise.all([this.getProjectState({autoRequire:o.autoRequire}),(()=>{if(!o.componentKey){for(let a=0;a<50;a++){let f=`terafy_${a}`;if(!Object.hasOwnProperty(o.component,f)){o.componentKey=f;return}}throw new Error("Unable to find unique key to allocate against Vue2 component")}})()])).then(([a])=>{this.debug("INFO",2,"Got project snapshot",a);let f=this.Vue.observable(a);o.component[o.componentKey]=f;let s=0;if(o.read&&this.events.on(`update:projects/${f.id}`,n=>{s++,this.merge(f,n)}),o.write){if(!o.component)throw new Error("bindProjectState requires a VueComponent specified as `component`");let n=dt(a);o.component.$watch(o.componentKey,l=>{if(s>0){s--;return}this.createProjectStatePatch(l,n),n=dt(a)},{deep:!0})}return f})}merge(r,...o){return o.forEach(a=>Object.keys(a).forEach(f=>this.Vue.set(r,f,a[f]))),r}init(r){let o={app:null,Vue:null,globalName:"$tera",requireProject:!0,subscribeState:!0,subscribeProjects:!0,stateOptions:{read:!0,write:!0},...r};if(!o.Vue)throw new Error("Vue instance to use must be specified in init options as `Vue`");if(this.Vue=r.Vue,!this.settings.app)throw new Error("Need to specify the root level Vue2 app during init");return o.stateOptions.app=this.settings.app,this.projects=this.Vue.observable([]),o.globalName&&(this.Vue.prototype[o.globalName]=this),this.state=null,Promise.resolve().then(()=>o.requireProject&&this.requireProject()).then(()=>Promise.all([o.subscribeState&&this.bindProjectState({...o.stateOptions,component:this.settings.app.$root}).then(a=>this.state=a).then(()=>this.debug("INFO",1,"Loaded initial project state",this.state)),o.subscribeProjects&&this.getProjects().then(a=>this.projects=this.Vue.observable(a)).then(()=>this.debug("INFO",2,"Loaded project list",this.projects))])).then(()=>this.debug("INFO",1,"Ready"))}};export{bt as default};
|
|
1
|
+
var fr=Object.defineProperty;var sr=(t,e,r)=>e in t?fr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var q=(t,e,r)=>(sr(t,typeof e!="symbol"?e+"":e,r),r);var pr=typeof global=="object"&&global&&global.Object===Object&&global,k=pr;var ir=typeof self=="object"&&self&&self.Object===Object&&self,nr=k||ir||Function("return this")(),u=nr;var ur=u.Symbol,h=ur;var At=Object.prototype,mr=At.hasOwnProperty,lr=At.toString,W=h?h.toStringTag:void 0;function dr(t){var e=mr.call(t,W),r=t[W];try{t[W]=void 0;var o=!0}catch{}var a=lr.call(t);return o&&(e?t[W]=r:delete t[W]),a}var _t=dr;var cr=Object.prototype,xr=cr.toString;function hr(t){return xr.call(t)}var wt=hr;var gr="[object Null]",yr="[object Undefined]",St=h?h.toStringTag:void 0;function br(t){return t==null?t===void 0?yr:gr:St&&St in Object(t)?_t(t):wt(t)}var g=br;function vr(t){return t!=null&&typeof t=="object"}var c=vr;var jr=Array.isArray,C=jr;function Tr(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var x=Tr;var Or="[object AsyncFunction]",Ar="[object Function]",_r="[object GeneratorFunction]",wr="[object Proxy]";function Sr(t){if(!x(t))return!1;var e=g(t);return e==Ar||e==_r||e==Or||e==wr}var H=Sr;var Ir=u["__core-js_shared__"],$=Ir;var It=function(){var t=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Pr(t){return!!It&&It in t}var Pt=Pr;var Cr=Function.prototype,Er=Cr.toString;function Br(t){if(t!=null){try{return Er.call(t)}catch{}try{return t+""}catch{}}return""}var y=Br;var Lr=/[\\^$.*+?()[\]{}|]/g,Mr=/^\[object .+?Constructor\]$/,Dr=Function.prototype,Fr=Object.prototype,Nr=Dr.toString,Rr=Fr.hasOwnProperty,Ur=RegExp("^"+Nr.call(Rr).replace(Lr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gr(t){if(!x(t)||Pt(t))return!1;var e=H(t)?Ur:Mr;return e.test(y(t))}var Ct=Gr;function Vr(t,e){return t==null?void 0:t[e]}var Et=Vr;function Wr(t,e){var r=Et(t,e);return Ct(r)?r:void 0}var m=Wr;var Kr=m(u,"WeakMap"),J=Kr;var Bt=Object.create,zr=function(){function t(){}return function(e){if(!x(e))return{};if(Bt)return Bt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Lt=zr;function qr(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var Mt=qr;var kr=function(){try{var t=m(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ct=kr;function Hr(t,e){for(var r=-1,o=t==null?0:t.length;++r<o&&e(t[r],r,t)!==!1;);return t}var Dt=Hr;var $r=9007199254740991,Jr=/^(?:0|[1-9]\d*)$/;function Yr(t,e){var r=typeof t;return e=e==null?$r:e,!!e&&(r=="number"||r!="symbol"&&Jr.test(t))&&t>-1&&t%1==0&&t<e}var Ft=Yr;function Xr(t,e,r){e=="__proto__"&&ct?ct(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Y=Xr;function Zr(t,e){return t===e||t!==t&&e!==e}var X=Zr;var Qr=Object.prototype,to=Qr.hasOwnProperty;function eo(t,e,r){var o=t[e];(!(to.call(t,e)&&X(o,r))||r===void 0&&!(e in t))&&Y(t,e,r)}var Z=eo;function ro(t,e,r,o){var a=!r;r||(r={});for(var f=-1,s=e.length;++f<s;){var n=e[f],l=o?o(r[n],t[n],n,r,t):void 0;l===void 0&&(l=t[n]),a?Y(r,n,l):Z(r,n,l)}return r}var T=ro;var oo=9007199254740991;function ao(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=oo}var Q=ao;function fo(t){return t!=null&&Q(t.length)&&!H(t)}var tt=fo;var so=Object.prototype;function po(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||so;return t===r}var E=po;function io(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var Nt=io;var no="[object Arguments]";function uo(t){return c(t)&&g(t)==no}var xt=uo;var Rt=Object.prototype,mo=Rt.hasOwnProperty,lo=Rt.propertyIsEnumerable,co=xt(function(){return arguments}())?xt:function(t){return c(t)&&mo.call(t,"callee")&&!lo.call(t,"callee")},Ut=co;function xo(){return!1}var Gt=xo;var Kt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vt=Kt&&typeof module=="object"&&module&&!module.nodeType&&module,ho=Vt&&Vt.exports===Kt,Wt=ho?u.Buffer:void 0,go=Wt?Wt.isBuffer:void 0,yo=go||Gt,et=yo;var bo="[object Arguments]",vo="[object Array]",jo="[object Boolean]",To="[object Date]",Oo="[object Error]",Ao="[object Function]",_o="[object Map]",wo="[object Number]",So="[object Object]",Io="[object RegExp]",Po="[object Set]",Co="[object String]",Eo="[object WeakMap]",Bo="[object ArrayBuffer]",Lo="[object DataView]",Mo="[object Float32Array]",Do="[object Float64Array]",Fo="[object Int8Array]",No="[object Int16Array]",Ro="[object Int32Array]",Uo="[object Uint8Array]",Go="[object Uint8ClampedArray]",Vo="[object Uint16Array]",Wo="[object Uint32Array]",i={};i[Mo]=i[Do]=i[Fo]=i[No]=i[Ro]=i[Uo]=i[Go]=i[Vo]=i[Wo]=!0;i[bo]=i[vo]=i[Bo]=i[jo]=i[Lo]=i[To]=i[Oo]=i[Ao]=i[_o]=i[wo]=i[So]=i[Io]=i[Po]=i[Co]=i[Eo]=!1;function Ko(t){return c(t)&&Q(t.length)&&!!i[g(t)]}var zt=Ko;function zo(t){return function(e){return t(e)}}var B=zo;var qt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,K=qt&&typeof module=="object"&&module&&!module.nodeType&&module,qo=K&&K.exports===qt,ht=qo&&k.process,ko=function(){try{var t=K&&K.require&&K.require("util").types;return t||ht&&ht.binding&&ht.binding("util")}catch{}}(),b=ko;var kt=b&&b.isTypedArray,Ho=kt?B(kt):zt,Ht=Ho;var $o=Object.prototype,Jo=$o.hasOwnProperty;function Yo(t,e){var r=C(t),o=!r&&Ut(t),a=!r&&!o&&et(t),f=!r&&!o&&!a&&Ht(t),s=r||o||a||f,n=s?Nt(t.length,String):[],l=n.length;for(var d in t)(e||Jo.call(t,d))&&!(s&&(d=="length"||a&&(d=="offset"||d=="parent")||f&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ft(d,l)))&&n.push(d);return n}var rt=Yo;function Xo(t,e){return function(r){return t(e(r))}}var ot=Xo;var Zo=ot(Object.keys,Object),$t=Zo;var Qo=Object.prototype,ta=Qo.hasOwnProperty;function ea(t){if(!E(t))return $t(t);var e=[];for(var r in Object(t))ta.call(t,r)&&r!="constructor"&&e.push(r);return e}var Jt=ea;function ra(t){return tt(t)?rt(t):Jt(t)}var L=ra;function oa(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Yt=oa;var aa=Object.prototype,fa=aa.hasOwnProperty;function sa(t){if(!x(t))return Yt(t);var e=E(t),r=[];for(var o in t)o=="constructor"&&(e||!fa.call(t,o))||r.push(o);return r}var Xt=sa;function pa(t){return tt(t)?rt(t,!0):Xt(t)}var M=pa;var ia=m(Object,"create"),v=ia;function na(){this.__data__=v?v(null):{},this.size=0}var Zt=na;function ua(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Qt=ua;var ma="__lodash_hash_undefined__",la=Object.prototype,da=la.hasOwnProperty;function ca(t){var e=this.__data__;if(v){var r=e[t];return r===ma?void 0:r}return da.call(e,t)?e[t]:void 0}var te=ca;var xa=Object.prototype,ha=xa.hasOwnProperty;function ga(t){var e=this.__data__;return v?e[t]!==void 0:ha.call(e,t)}var ee=ga;var ya="__lodash_hash_undefined__";function ba(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=v&&e===void 0?ya:e,this}var re=ba;function D(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}D.prototype.clear=Zt;D.prototype.delete=Qt;D.prototype.get=te;D.prototype.has=ee;D.prototype.set=re;var gt=D;function va(){this.__data__=[],this.size=0}var oe=va;function ja(t,e){for(var r=t.length;r--;)if(X(t[r][0],e))return r;return-1}var O=ja;var Ta=Array.prototype,Oa=Ta.splice;function Aa(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():Oa.call(e,r,1),--this.size,!0}var ae=Aa;function _a(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var fe=_a;function wa(t){return O(this.__data__,t)>-1}var se=wa;function Sa(t,e){var r=this.__data__,o=O(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var pe=Sa;function F(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}F.prototype.clear=oe;F.prototype.delete=ae;F.prototype.get=fe;F.prototype.has=se;F.prototype.set=pe;var A=F;var Ia=m(u,"Map"),_=Ia;function Pa(){this.size=0,this.__data__={hash:new gt,map:new(_||A),string:new gt}}var ie=Pa;function Ca(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var ne=Ca;function Ea(t,e){var r=t.__data__;return ne(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=Ea;function Ba(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var ue=Ba;function La(t){return w(this,t).get(t)}var me=La;function Ma(t){return w(this,t).has(t)}var le=Ma;function Da(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var de=Da;function N(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=ie;N.prototype.delete=ue;N.prototype.get=me;N.prototype.has=le;N.prototype.set=de;var ce=N;function Fa(t,e){for(var r=-1,o=e.length,a=t.length;++r<o;)t[a+r]=e[r];return t}var at=Fa;var Na=ot(Object.getPrototypeOf,Object),ft=Na;function Ra(){this.__data__=new A,this.size=0}var xe=Ra;function Ua(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var he=Ua;function Ga(t){return this.__data__.get(t)}var ge=Ga;function Va(t){return this.__data__.has(t)}var ye=Va;var Wa=200;function Ka(t,e){var r=this.__data__;if(r instanceof A){var o=r.__data__;if(!_||o.length<Wa-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new ce(o)}return r.set(t,e),this.size=r.size,this}var be=Ka;function R(t){var e=this.__data__=new A(t);this.size=e.size}R.prototype.clear=xe;R.prototype.delete=he;R.prototype.get=ge;R.prototype.has=ye;R.prototype.set=be;var ve=R;function za(t,e){return t&&T(e,L(e),t)}var je=za;function qa(t,e){return t&&T(e,M(e),t)}var Te=qa;var we=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Oe=we&&typeof module=="object"&&module&&!module.nodeType&&module,ka=Oe&&Oe.exports===we,Ae=ka?u.Buffer:void 0,_e=Ae?Ae.allocUnsafe:void 0;function Ha(t,e){if(e)return t.slice();var r=t.length,o=_e?_e(r):new t.constructor(r);return t.copy(o),o}var Se=Ha;function $a(t,e){for(var r=-1,o=t==null?0:t.length,a=0,f=[];++r<o;){var s=t[r];e(s,r,t)&&(f[a++]=s)}return f}var Ie=$a;function Ja(){return[]}var st=Ja;var Ya=Object.prototype,Xa=Ya.propertyIsEnumerable,Pe=Object.getOwnPropertySymbols,Za=Pe?function(t){return t==null?[]:(t=Object(t),Ie(Pe(t),function(e){return Xa.call(t,e)}))}:st,U=Za;function Qa(t,e){return T(t,U(t),e)}var Ce=Qa;var tf=Object.getOwnPropertySymbols,ef=tf?function(t){for(var e=[];t;)at(e,U(t)),t=ft(t);return e}:st,pt=ef;function rf(t,e){return T(t,pt(t),e)}var Ee=rf;function of(t,e,r){var o=e(t);return C(t)?o:at(o,r(t))}var it=of;function af(t){return it(t,L,U)}var Be=af;function ff(t){return it(t,M,pt)}var Le=ff;var sf=m(u,"DataView"),nt=sf;var pf=m(u,"Promise"),ut=pf;var nf=m(u,"Set"),mt=nf;var Me="[object Map]",uf="[object Object]",De="[object Promise]",Fe="[object Set]",Ne="[object WeakMap]",Re="[object DataView]",mf=y(nt),lf=y(_),df=y(ut),cf=y(mt),xf=y(J),I=g;(nt&&I(new nt(new ArrayBuffer(1)))!=Re||_&&I(new _)!=Me||ut&&I(ut.resolve())!=De||mt&&I(new mt)!=Fe||J&&I(new J)!=Ne)&&(I=function(t){var e=g(t),r=e==uf?t.constructor:void 0,o=r?y(r):"";if(o)switch(o){case mf:return Re;case lf:return Me;case df:return De;case cf:return Fe;case xf:return Ne}return e});var G=I;var hf=Object.prototype,gf=hf.hasOwnProperty;function yf(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&gf.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Ue=yf;var bf=u.Uint8Array,yt=bf;function vf(t){var e=new t.constructor(t.byteLength);return new yt(e).set(new yt(t)),e}var V=vf;function jf(t,e){var r=e?V(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Ge=jf;var Tf=/\w*$/;function Of(t){var e=new t.constructor(t.source,Tf.exec(t));return e.lastIndex=t.lastIndex,e}var Ve=Of;var We=h?h.prototype:void 0,Ke=We?We.valueOf:void 0;function Af(t){return Ke?Object(Ke.call(t)):{}}var ze=Af;function _f(t,e){var r=e?V(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var qe=_f;var wf="[object Boolean]",Sf="[object Date]",If="[object Map]",Pf="[object Number]",Cf="[object RegExp]",Ef="[object Set]",Bf="[object String]",Lf="[object Symbol]",Mf="[object ArrayBuffer]",Df="[object DataView]",Ff="[object Float32Array]",Nf="[object Float64Array]",Rf="[object Int8Array]",Uf="[object Int16Array]",Gf="[object Int32Array]",Vf="[object Uint8Array]",Wf="[object Uint8ClampedArray]",Kf="[object Uint16Array]",zf="[object Uint32Array]";function qf(t,e,r){var o=t.constructor;switch(e){case Mf:return V(t);case wf:case Sf:return new o(+t);case Df:return Ge(t,r);case Ff:case Nf:case Rf:case Uf:case Gf:case Vf:case Wf:case Kf:case zf:return qe(t,r);case If:return new o;case Pf:case Bf:return new o(t);case Cf:return Ve(t);case Ef:return new o;case Lf:return ze(t)}}var ke=qf;function kf(t){return typeof t.constructor=="function"&&!E(t)?Lt(ft(t)):{}}var He=kf;var Hf="[object Map]";function $f(t){return c(t)&&G(t)==Hf}var $e=$f;var Je=b&&b.isMap,Jf=Je?B(Je):$e,Ye=Jf;var Yf="[object Set]";function Xf(t){return c(t)&&G(t)==Yf}var Xe=Xf;var Ze=b&&b.isSet,Zf=Ze?B(Ze):Xe,Qe=Zf;var Qf=1,ts=2,es=4,tr="[object Arguments]",rs="[object Array]",os="[object Boolean]",as="[object Date]",fs="[object Error]",er="[object Function]",ss="[object GeneratorFunction]",ps="[object Map]",is="[object Number]",rr="[object Object]",ns="[object RegExp]",us="[object Set]",ms="[object String]",ls="[object Symbol]",ds="[object WeakMap]",cs="[object ArrayBuffer]",xs="[object DataView]",hs="[object Float32Array]",gs="[object Float64Array]",ys="[object Int8Array]",bs="[object Int16Array]",vs="[object Int32Array]",js="[object Uint8Array]",Ts="[object Uint8ClampedArray]",Os="[object Uint16Array]",As="[object Uint32Array]",p={};p[tr]=p[rs]=p[cs]=p[xs]=p[os]=p[as]=p[hs]=p[gs]=p[ys]=p[bs]=p[vs]=p[ps]=p[is]=p[rr]=p[ns]=p[us]=p[ms]=p[ls]=p[js]=p[Ts]=p[Os]=p[As]=!0;p[fs]=p[er]=p[ds]=!1;function lt(t,e,r,o,a,f){var s,n=e&Qf,l=e&ts,d=e&es;if(r&&(s=a?r(t,o,a,f):r(t)),s!==void 0)return s;if(!x(t))return t;var vt=C(t);if(vt){if(s=Ue(t),!n)return Mt(t,s)}else{var P=G(t),jt=P==er||P==ss;if(et(t))return Se(t,n);if(P==rr||P==tr||jt&&!a){if(s=l||jt?{}:He(t),!n)return l?Ee(t,Te(s,t)):Ce(t,je(s,t))}else{if(!p[P])return a?t:{};s=ke(t,P,n)}}f||(f=new ve);var Tt=f.get(t);if(Tt)return Tt;f.set(t,s),Qe(t)?t.forEach(function(j){s.add(lt(j,e,r,j,t,f))}):Ye(t)&&t.forEach(function(j,S){s.set(S,lt(j,e,r,S,t,f))});var ar=d?l?Le:Be:l?M:L,Ot=vt?void 0:ar(t);return Dt(Ot||t,function(j,S){Ot&&(S=j,j=t[S]),Z(s,S,lt(j,e,r,S,t,f))}),s}var or=lt;var _s=1,ws=4;function Ss(t){return or(t,_s|ws)}var dt=Ss;var z=class{init(){}constructor(e,r){}};var bt=class extends z{constructor(){super(...arguments);q(this,"Vue");q(this,"projects");q(this,"state",null)}bindProjectState(r){let o={component:null,componentKey:null,autoRequire:!0,write:!0,...r};return Promise.resolve().then(()=>Promise.all([this.getProjectState({autoRequire:o.autoRequire}),(()=>{if(!o.componentKey){for(let a=0;a<50;a++){let f=`terafy_${a}`;if(!Object.hasOwnProperty(o.component,f)){o.componentKey=f;return}}throw new Error("Unable to find unique key to allocate against Vue2 component")}})()])).then(([a])=>{this.debug("INFO",2,"Got project snapshot",a);let f=this.Vue.observable(a);o.component[o.componentKey]=f;let s=0;if(o.read&&this.events.on(`update:projects/${f.id}`,n=>{s++,this.merge(f,n)}),o.write){if(!o.component)throw new Error("bindProjectState requires a VueComponent specified as `component`");let n=dt(a);o.component.$watch(o.componentKey,l=>{if(s>0){s--;return}this.createProjectStatePatch(l,n),n=dt(a)},{deep:!0})}return f})}merge(r,...o){return o.forEach(a=>Object.keys(a).forEach(f=>{typeof a[f]=="object"?(f in r||this.Vue.set(r,f,Array.isArray(a[f])?[]:{}),this.merge(r[f],a[f])):this.Vue.set(r,f,a[f])})),r}init(r){let o={app:null,Vue:null,globalName:"$tera",requireProject:!0,subscribeState:!0,subscribeProjects:!0,stateOptions:{read:!0,write:!0},...r};if(!o.Vue)throw new Error("Vue instance to use must be specified in init options as `Vue`");if(this.Vue=r.Vue,!this.settings.app)throw new Error("Need to specify the root level Vue2 app during init");return o.stateOptions.app=this.settings.app,this.projects=this.Vue.observable([]),o.globalName&&(this.Vue.prototype[o.globalName]=this),this.state=null,Promise.resolve().then(()=>o.requireProject&&this.requireProject()).then(()=>Promise.all([o.subscribeState&&this.bindProjectState({...o.stateOptions,component:this.settings.app.$root}).then(a=>this.state=a).then(()=>this.debug("INFO",1,"Loaded initial project state",this.state)),o.subscribeProjects&&this.getProjects().then(a=>this.projects=this.Vue.observable(a)).then(()=>this.debug("INFO",2,"Loaded project list",this.projects))])).then(()=>this.debug("INFO",1,"Ready"))}};export{bt as default};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
lodash-es/lodash.js:
|
package/package.json
CHANGED
package/plugins/vue2.js
CHANGED
|
@@ -139,9 +139,16 @@ export default class TeraFyPluginVue2 extends TeraFyPluginBase {
|
|
|
139
139
|
merge(target, ...payload) {
|
|
140
140
|
payload.forEach(pl =>
|
|
141
141
|
Object.keys(pl)
|
|
142
|
-
.forEach(k =>
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
.forEach(k => {
|
|
143
|
+
if (typeof pl[k] == 'object') { // Setting sub-objects - need to recurse these in Vue2
|
|
144
|
+
if (!(k in target)) // Destination to merge doesn't exist yet - create it
|
|
145
|
+
this.Vue.set(target, k, Array.isArray(pl[k]) ? [] : {});
|
|
146
|
+
|
|
147
|
+
this.merge(target[k], pl[k]);
|
|
148
|
+
} else {
|
|
149
|
+
this.Vue.set(target, k, pl[k])
|
|
150
|
+
}
|
|
151
|
+
})
|
|
145
152
|
);
|
|
146
153
|
|
|
147
154
|
return target;
|