-
Notifications
You must be signed in to change notification settings - Fork 1
/
f1044143.js
1 lines (1 loc) · 5.02 KB
/
f1044143.js
1
System.register(["./be7cca87.js","./4ef8a15c.js","./6f58b968.js"],(function(t){"use strict";var n,e,o,a,i,s,c,l,d,r,u,p,m,h,b,f,g,v;return{setters:[function(t){n=t._,e=t.a,o=t.i,a=t.b,i=t.k,s=t.f,c=t.g,l=t.p,d=t.q,r=t.t,u=t.N,p=t.aW,m=t.h,h=t.c,b=t.d,f=t.e,g=t.j,v=t.l},function(){},function(){}],execute:function(){var y,k,w=t("HAXCMSOutlineEditorDialog",function(t){function p(){var t;return h(this,p),(t=b(this,p)).__disposer=[],t.manifestItems=[],t.viewMode=!1,t.t=t.t||{},t.t=f(f({},t.t),{},{save:"Save",cancel:"cancel"}),t}return n(p,t),e(p,[{key:"render",value:function(){return i(y||(y=a(['\n <outline-designer\n id="outline"\n edit-mode\n .hidden="','"\n .items="','"\n ></outline-designer>\n <div class="buttons">\n <button @click="','" class="hax-modal-btn">\n ','\n </button>\n <button @click="','" class="cancel hax-modal-btn">\n ',"\n </button>\n </div>\n "])),this.viewMode,this.manifestItems,this._saveTap,this.t.save,this._cancelTap,this.t.cancel)}},{key:"updated",value:function(t){var n=this;s(c(p.prototype),"updated",this)&&s(c(p.prototype),"updated",this).call(this,t),t.forEach((function(t,e){"opened"==e&&n.dispatchEvent(new CustomEvent("opened-changed",{detail:n[e]})),"manifestItems"==e&&(n._manifestItemsChanged(n[e],t),n.dispatchEvent(new CustomEvent("manifest-edit-mode-changed",{detail:n[e]})))}))}},{key:"_manifestItemsChanged",value:function(t){t&&(globalThis.JSONOutlineSchema.requestAvailability().items=t,this.manifestItemsStatic=JSON.stringify(t,null,2))}},{key:"connectedCallback",value:function(){var t=this;s(c(p.prototype),"connectedCallback",this).call(this),l((function(n){t.manifestItems=d(r(u.manifest.items)),setTimeout((function(){t.shadowRoot&&t.shadowRoot.querySelector("#outline").__syncUIAndDataModel()}),500),t.__disposer.push(n)}))}},{key:"disconnectedCallback",value:function(){for(var t in this.__disposer)this.__disposer[t].dispose();s(c(p.prototype),"disconnectedCallback",this).call(this)}},{key:"_saveTap",value:(m=g(v().mark((function t(n){var e,o,a,i,s,c=this;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u.playSound("click"),t.next=3,this.shadowRoot.querySelector("#outline").getData();case 3:e=t.sent,o=0,a=0,i=0,e.items.map((function(t){t.delete?o++:t.new?i++:t.modified&&a++})),(""==(s="".concat(i>0?"‣ ".concat(i," new pages will be created\n"):"").concat(a>0?"‣ ".concat(a," pages will be updated\n"):"").concat(o>0?"‣ ".concat(o," pages will be deleted\n"):""))||globalThis.confirm("Saving will commit the following actions:\n".concat(s,"\nAre you sure?")))&&(globalThis.dispatchEvent(new CustomEvent("haxcms-save-outline",{bubbles:!0,composed:!0,detail:e.items})),setTimeout((function(){c.dispatchEvent(new CustomEvent("simple-modal-hide",{bubbles:!0,composed:!0,cancelable:!1,detail:!1}))}),0));case 12:case"end":return t.stop()}}),t,this)}))),function(t){return m.apply(this,arguments)})},{key:"_cancelTap",value:function(t){u.playSound("error"),this.dispatchEvent(new CustomEvent("simple-modal-hide",{bubbles:!0,composed:!0,cancelable:!1,detail:!1}))}}],[{key:"styles",get:function(){return[o(k||(k=a(["\n :host {\n display: block;\n height: 70vh;\n overflow: auto;\n padding-bottom: 40px;\n padding-top: 16px;\n min-width: 70vw;\n font-family: var(--ddd-font-navigation);\n }\n .buttons {\n position: absolute;\n bottom: 0;\n z-index: 1000000;\n background-color: var(--simple-modal-titlebar-background, #000000);\n left: 0;\n right: 0px;\n padding-left: 8px;\n }\n .buttons button {\n color: black;\n background-color: white;\n }\n simple-icon {\n margin-right: 4px;\n }\n outline-designer:not(:defined) {\n display: none;\n }\n #toggle {\n float: right;\n text-transform: unset;\n }\n button.hax-modal-btn {\n font-size: 30px;\n padding: 8px;\n margin: 4px 8px;\n color: white;\n background-color: green;\n border: 4px solid black;\n border-radius: 8px;\n font-family: sans-serif;\n }\n button.hax-modal-btn.cancel {\n background-color: red;\n }\n button.hax-modal-btn:hover,\n button.hax-modal-btn:focus {\n outline: 2px solid black;\n cursor: pointer;\n background-color: darkgreen;\n }\n button.hax-modal-btn.cancel:hover,\n button.hax-modal-btn.cancel:focus {\n background-color: darkred;\n }\n "])))]}},{key:"tag",get:function(){return"haxcms-outline-editor-dialog"}},{key:"properties",get:function(){return{opened:{type:Boolean},manifestItems:{type:Array},manifestItemsStatic:{type:String,attribute:"manifest-items-static"},viewLabel:{type:String,attribute:"view-label"},viewMode:{type:Boolean,attribute:"view-mode"}}}}]);var m}(p(m)));customElements.define(w.tag,w)}}}));