UNPKG

@aurigma/ui-framework

Version:

A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.

1 lines 5.84 kB
(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[32],{843:function(t,n){t.exports='<style>\n :host {\n width: 100%;\n height: 100%;\n display: block;\n }\n\n h1 {\n @apply --au-h1-font\n }\n\n h2 {\n @apply --au-h2-font\n }\n\n h3 {\n @apply --au-h3-font\n }\n\n h4 {\n @apply --au-h4-font\n }\n\n .subtitle1 {\n @apply --au-subtitle1-font\n }\n\n .subtitle2 {\n @apply --au-subtitle2-font\n }\n\n div,\n p,\n span {\n @apply --au-body2-font\n }\n\n .body1 {\n @apply --au-body1-font\n }\n\n .button {\n @apply --au-button-font\n }\n\n .caption {\n @apply --au-caption-font\n }\n\n .overline {\n @apply --au-overline-font\n }\n</style>\n<div class="html" id="container"></div>'},844:function(t,n){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var i={transform:function(t,n,e){var r={events:[],html:""},o={events:!1};if(o=i._extend(o,e),void 0!==n||void 0!==t){var a="string"==typeof t?JSON.parse(t):t;r=i._transform(a,n,o)}return o.events?r:r.html},_extend:function(t,n){var e={};for(var i in t)e[i]=t[i];for(var i in n)e[i]=n[i];return e},_append:function(t,n){var e={html:"",event:[]};return void 0!==t&&void 0!==n&&(e.html=t.html+n.html,e.events=t.events.concat(n.events)),e},_isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},_transform:function(t,n,r){var o={events:[],html:""};if(i._isArray(t))for(var a=t.length,s=0;s<a;++s)o=i._append(o,i._apply(t[s],n,s,r));else"object"===e(t)&&(o=i._append(o,i._apply(t,n,void 0,r)));return o},_apply:function(t,n,r,o){var a={events:[],html:""};if(i._isArray(n))for(var s=n.length,c=0;c<s;++c)a=i._append(a,i._apply(t,n[c],r,o));else if("object"===e(n)){var l="<>";if(void 0===n[l]&&(l="tag"),void 0!==n[l]){var u=i._getValue(t,n,l,r);a.html+="<"+u;var p,f={events:[],html:""};for(var d in n)switch(d){case"tag":case"<>":break;case"text":var h=n[d];if(i._isArray(h));else if("function"==typeof h){var v=h.call(t,t,r);if(!i._isArray(v))switch(e(v)){case"function":case"undefined":case"object":break;default:f.html+=i.toText(v)}}else p=i.toText(i._getValue(t,n,d,r));break;case"children":case"html":if(h=n[d],i._isArray(h))f=i._append(f,i._apply(t,h,r,o));else if("function"==typeof h){if(v=h.call(t,t,r),!i._isArray(v))switch(e(v)){case"object":void 0!==v.html&&void 0!==v.events&&(f=i._append(f,v));break;case"function":case"undefined":break;default:f.html+=v}}else p=i._getValue(t,n,d,r);break;default:var y=!1;if(d.length>2&&"on"==d.substring(0,2).toLowerCase()){if(o.events){var b={action:n[d],obj:t,data:o.eventData,index:r},m=i._guid();a.events[a.events.length]={id:m,type:d.substring(2),data:b},a.html+=" json2html-event-id-"+d.substring(2)+"='"+m+"'"}y=!0}if(!y){var g,_=i._getValue(t,n,d,r);void 0!==_&&(g="string"==typeof _?'"'+_.replace(/"/g,"&quot;")+'"':_,a.html+=" "+d+"="+g)}}a.html+=">",p&&(a.html+=p),(a=i._append(a,f)).html+="</"+u+">"}}return a},_guid:function(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+"-"+t()+t()+"-"+t()+t()},_getValue:function(t,n,r,o){var a=n[r],s=e(a);return"function"===s?a.call(t,t,o):"string"===s?new i._tokenizer([/\$\{([^\}\{]+)\}/],(function(n,e,i){return e?n.replace(i,(function(n,e){for(var i=e.split("."),r=t,o="",a=i.length,s=0;s<a&&!(i[s].length>0&&null==(r=r[i[s]]));++s);return null!=r&&(o=r),o})):n})).parse(a).join(""):a},toText:function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;").replace(/\'/g,"&#39;").replace(/\//g,"&#x2F;")},_tokenizer:function(t,n){if(!(this instanceof i._tokenizer))return new i._tokenizer(t,n);this.tokenizers=t.splice?t:[t],n&&(this.doBuild=n),this.parse=function(t){this.src=t,this.ended=!1,this.tokens=[];do{this.next()}while(!this.ended);return this.tokens},this.build=function(t,n){t&&this.tokens.push(this.doBuild?this.doBuild(t,n,this.tkn):t)},this.next=function(){var t,n=this;n.findMin(),t=n.src.slice(0,n.min),n.build(t,!1),n.src=n.src.slice(n.min).replace(n.tkn,(function(t){return n.build(t,!0),""})),n.src||(n.ended=!0)},this.findMin=function(){var t,n,e=this,i=0;for(e.min=-1,e.tkn="";void 0!==(t=e.tokenizers[i++]);)-1!=(n=e.src[t.test?"search":"indexOf"](t))&&(-1==e.min||n<e.min)&&(e.tkn=t,e.min=n);-1==e.min&&(e.min=e.src.length)}}};t.exports=i},901:function(t,n,e){"use strict";e.r(n),e.d(n,"AuWidgetHtml",(function(){return c})),e.d(n,"widget",(function(){return c}));var i=e(0),r=e(843),o=e(160),a=e(844),s=e(2),c=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n._isRestoring=!1,n}return Object(i.d)(n,t),n.prototype.updateParams=function(t){this.data=t.data||{},this.template=t.template,this.$.container.innerHTML=a.transform(this.data,this.template)},n.prototype.exportWidgetData=function(t){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.e)(this,(function(t){return[2,this.$&&this.$.container?{html:this.$.container.innerHTML}:null]}))}))},n.prototype.restoreWidgetFromData=function(t,n){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.e)(this,(function(n){return t&&t.html!==this.$.container.innerHTML&&(this.$.container.innerHTML=t.html),[2]}))}))},Object(i.c)([Object(s.c)(),Object(i.g)("design:type",Object)],n.prototype,"params",void 0),Object(i.c)([Object(s.c)(),Object(i.g)("design:type",Object)],n.prototype,"data",void 0),Object(i.c)([Object(s.c)(),Object(i.g)("design:type",Object)],n.prototype,"template",void 0),Object(i.c)([Object(s.a)("au-widget-html",r)],n)}(o.c)}}]);