-
-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathplugin.js
1 lines (1 loc) · 19 KB
/
plugin.js
1
module.exports=function(t){function e(e){for(var i,s,l=e[0],r=e[1],c=e[2],d=0,u=[];d<l.length;d++)s=l[d],o[s]&&u.push(o[s][0]),o[s]=0;for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);for(p&&p(e);u.length;)u.shift()();return a.push.apply(a,c||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],i=!0,l=1;l<n.length;l++){var r=n[l];0!==o[r]&&(i=!1)}i&&(a.splice(e--,1),t=s(s.s=n[0]))}return t}var i={},o={main:0},a=[];function s(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=t,s.c=i,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)s.d(n,i,function(e){return t[e]}.bind(null,i));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="";var l=window.webpackJsonp=window.webpackJsonp||[],r=l.push.bind(l);l.push=e,l=l.slice();for(var c=0;c<l.length;c++)e(l[c]);var p=r;return a.push([32,"vendors~main"]),n()}([,,function(t,e){t.exports=require("uxp")},function(t,e,n){"use strict";n.r(e),e.default={id:"NotesAndAnnotations",version:"1.0.0",helpUrl:"https://tourdexd.com/plugin/notes-and-annotations/"}},,,function(t,e,n){"use strict";var i=n(7),o=n.n(i);e.default=o.a},function(t,e){t.exports={mounted(){},methods:{}}},function(t,e,n){var i=n(34);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,n(5).default)("4732e0e8",i,!1,{})},function(t,e,n){"use strict";var i=n(10),o=n.n(i);e.default=o.a},function(t,e){t.exports={props:["value","size","height"]}},function(t,e,n){var i=n(36);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,n(5).default)("1988085b",i,!1,{})},function(t,e,n){"use strict";var i=n(13),o=n.n(i);e.default=o.a},function(t,e){},function(t,e,n){var i=n(38);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,n(5).default)("17ac618a",i,!1,{})},function(t,e,n){"use strict";n.r(e);var i=n(16),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,function(){return i[t]})}(a);e.default=o.a},function(t,e,n){n(2).storage.localFileSystem;t.exports={data:()=>({actionList_data:[{icon:"./assets/NotesAndAnnotations/ui/IconShow.png",title:"Show Notes",description:"",value:"show"},{icon:"./assets/NotesAndAnnotations/ui/IconHide.png",title:"Hide Notes",description:"",value:"hide"}],tplList_data:[{icon:"./files/NotesAndAnnotations/Annotation_LinesSet.png",title:"Annotaions Line Set",description:"Different styles",value:"Annotation_LinesSet"},{icon:"./files/NotesAndAnnotations/Annotations_Mobile.png",title:"Annotaions Sample",description:"Mobile screen with annotations",value:"Annotations_Mobile"},{icon:"./files/NotesAndAnnotations/Annotation_S_Circle.png",title:"Line with Circle",description:"Circle head",value:"Annotation_S_Circle"},{icon:"./files/NotesAndAnnotations/Annotation_S_Arrow.png",title:"Line with Arrow",description:"Arrow head",value:"Annotation_S_Arrow"},{icon:"./files/NotesAndAnnotations/Annotation_S_WithText.png",title:"Line with Text",description:"Template",value:"Annotation_S_WithText"},{icon:"./files/NotesAndAnnotations/Annotations_Grid.png",title:"Grid Template",description:"Template for custom lines",value:"Annotations_Grid"},{icon:"./files/NotesAndAnnotations/BasicNote.png",title:"Basic Note",description:"White",value:"BasicNote"},{icon:"./files/NotesAndAnnotations/ColoredNote_Yellow.png",title:"Color Note",description:"Yellow",value:"ColoredNote_Yellow"},{icon:"./files/NotesAndAnnotations/ColoredNote_Red.png",title:"Color Note",description:"Red",value:"ColoredNote_Red"},{icon:"./files/NotesAndAnnotations/ColoredNote_Blue.png",title:"Color Note",description:"Blue",value:"ColoredNote_Blue"},{icon:"./files/NotesAndAnnotations/ColoredNote_Green.png",title:"Color Note",description:"Green",value:"ColoredNote_Green"},{icon:"./files/NotesAndAnnotations/ColoredPersonaNote_Yellow.png",title:"Persona Note",description:"Yellow",value:"ColoredPersonaNote_Yellow"},{icon:"./files/NotesAndAnnotations/ColoredPersonaNote_Red.png",title:"Persona Note",description:"Red",value:"ColoredPersonaNote_Red"},{icon:"./files/NotesAndAnnotations/ColoredPersonaNote_Blue.png",title:"Persona Note",description:"Blue",value:"ColoredPersonaNote_Blue"},{icon:"./files/NotesAndAnnotations/ColoredPersonaNote_Green.png",title:"Persona Note",description:"Green",value:"ColoredPersonaNote_Green"}]}),methods:{on_actionList_select(t,e){this.toggleNotes("hide"!==e.value)},on_tplList_select(t,e){this.place(e.value)},async place(t){if(!XDC.scenegraph.executePanelCommand)return new Promise(async(e,n)=>{let i=new XDC.XdTpl;await i.place(`files/NotesAndAnnotations/${t}.xdtpl`,{position:"aboveleft",offsetY:100}),e()});XDC.scenegraph.executePanelCommand(async()=>new Promise(async(e,n)=>{let i=new XDC.XdTpl;await i.place(`files/NotesAndAnnotations/${t}.xdtpl`,{position:"aboveleft",offsetY:100}),e()}))},async toggleNotes(t){if(console.log("toggleNotes",t),!XDC.scenegraph.executePanelCommand)return new Promise(async(e,n)=>{XDC.query.query(XDC.root,{name:/.note/}).forEach(e=>{"Artboard"!=e.node.constructor.name&&(e.node.visible=null!=t?t:!e.node.visible)}),e()});XDC.scenegraph.executePanelCommand(async()=>new Promise(async(e,n)=>{XDC.query.query(XDC.root,{name:/.note/}).forEach(e=>{"Artboard"!=e.node.constructor.name&&(e.node.visible=null!=t?t:!e.node.visible)}),e()}))}}}},function(t,e,n){"use strict";var i=n(18),o=n.n(i);e.default=o.a},function(t,e,n){const i=n(3).default,o=n(21).default,a=n(2).shell,s=n(39);t.exports={components:{"notes-and-annotations-view":o},data:()=>({helpUrl:i.helpUrl}),mounted(){this.interimBanner()},methods:{async interimBanner(){const t=await s("https://tourdexd.com/api_plugin_personas_feed").catch(t=>{console.log("feed error",t)});t&&t.cta1&&(this.$refs.interimBanner.setAttribute("src",t.cta1.banner),this.$refs.interimBanner.addEventListener("click",e=>{n(2).shell.openExternal(t.cta1.url)}))},openHelp(t){console.log("this.helpUrl",this.helpUrl),console.log("PluginManifest",i),a.openExternal(this.helpUrl)},close(t){(function t(e){return"DIALOG"==e.tagName?e:e.parentNode?t(e.parentNode):void 0})(this.$el).close()}}}},function(t,e,n){var i=n(41);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,n(5).default)("697641e5",i,!1,{})},,function(t,e,n){"use strict";n.r(e);var i=n(28),o=n(15);for(var a in o)"default"!==a&&function(t){n.d(e,t,function(){return o[t]})}(a);var s=n(0),l=Object(s.a)(o.default,i.a,i.b,!1,null,null,null);l.options.__file="src/modules/NotesAndAnnotations/ui/panels/DefaultPanel.vue",e.default=l.exports},function(t,e,n){"use strict";var i=n(27),o=n(6),a=(n(33),n(0)),s=Object(a.a)(o.default,i.a,i.b,!1,null,null,null);s.options.__file="shell/src/ui/panels/DefaultPanelShell.vue",e.default=s.exports},function(t,e,n){"use strict";var i=n(29),o=n(9),a=(n(35),n(0)),s=Object(a.a)(o.default,i.a,i.b,!1,null,null,null);s.options.__file="shell/src/ui/components/XpList.vue",e.default=s.exports},function(t,e,n){"use strict";var i=n(26),o=n(12),a=(n(37),n(0)),s=Object(a.a)(o.default,i.a,i.b,!1,null,null,null);s.options.__file="shell/src/ui/components/XpSectionTitle.vue",e.default=s.exports},function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{"margin-left":"24px"},attrs:{id:"dialog"}},[n("form",{staticStyle:{"margin-top":"20px"},attrs:{method:"dialog"}},[n("div",{staticClass:"express--dialog-header"},[n("img",{staticClass:"express-dialog-logo",attrs:{src:"assets/NotesAndAnnotations/ui/logo_tiny.png"}}),t._v(" "),n("div",{staticClass:"express--dialog-title"},[t._v("Notes and Annotations")]),t._v(" "),n("img",{staticClass:"express-dialog-help",attrs:{src:"assets/NotesAndAnnotations/ui/help_icon.png"},on:{click:t.openHelp}})]),t._v(" "),n("notes-and-annotations-view"),t._v(" "),n("footer",[n("button",{attrs:{"uxp-variant":"primary"},on:{click:t.close}},[t._v("Close")])]),t._v(" "),n("div",{attrs:{id:"interim-banner"}},[n("img",{ref:"interimBanner",attrs:{src:"",width:"460"}})])],1)])},o=[];i._withStripped=!0,n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o})},function(t,e,n){"use strict";var i=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"xp-section-title"},[this._t("default")],2)},o=[];i._withStripped=!0,n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o})},function(t,e,n){"use strict";var i=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticStyle:{margin:"-15px"},attrs:{id:"app"}},[e("default-panel")],1)},o=[];i._withStripped=!0,n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o})},function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("xp-section-title",[t._v("ACTIONS")]),t._v(" "),n("xp-list",{attrs:{size:"xsmall"},on:{select:t.on_actionList_select},model:{value:t.actionList_data,callback:function(e){t.actionList_data=e},expression:"actionList_data"}}),t._v(" "),n("xp-section-title",[t._v("TEMPLATES")]),t._v(" "),n("xp-list",{attrs:{size:"medium",height:"240px"},on:{select:t.on_tplList_select},model:{value:t.tplList_data,callback:function(e){t.tplList_data=e},expression:"tplList_data"}})],1)},o=[];i._withStripped=!0,n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o})},function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"xp-list",style:{height:t.height?t.height:"auto"}},[n("div",{staticClass:"xp-list-content"},t._l(t.value,function(e){return n("div",{staticClass:"item",class:{xsmall:"xsmall"==t.size,small:"small"==t.size,medium:"medium"==t.size,large:"large"==t.size}},[e.icon?n("div",{staticClass:"preview"},[n("div",{staticClass:"icon",staticStyle:{"background-size":"contain"},style:{backgroundImage:"url("+e.icon+")"}})]):t._e(),t._v(" "),n("div",{staticClass:"label"},[n("div",{staticClass:"express-font title"},[t._v(t._s(e.title))]),t._v(" "),n("div",{staticClass:"express-font description"},[t._v(t._s(e.description))])]),t._v(" "),n("div",{staticClass:"dreamcatcher",attrs:{id:"random-"+Math.round(1e9*Math.random()),editLabel:e.title},on:{click:function(n){t.$emit("select",n,e)}}})])}),0)])},o=[];i._withStripped=!0,n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o})},function(t,e){t.exports=require("application")},function(t,e,n){"use strict";var i=n(25),o=n(17),a=(n(40),n(0)),s=Object(a.a)(o.default,i.a,i.b,!1,null,null,null);s.options.__file="src/modules/NotesAndAnnotations/ui/dialogs/DefaultDialog.vue",e.default=s.exports},function(t,e,n){t.exports=n(45)},function(t,e,n){"use strict";var i=n(8);n.n(i).a},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,'*, body {\n font-family: "Helvetica Neue", Arial;\n font-size: 11px;\n color: #9F9F9F;\n}\n.dreamcatcher {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: rgba(0, 0, 0, 0);\n opacity: 0;\n}\n.express-font {\n font-size: 10px;\n color: #9F9F9F;\n}\n.express-font.title {\n font-weight: bold;\n}\n.express-font.description {\n font-weight: normal;\n font-size: 10px;\n opacity: 0.7;\n}\n',""])},function(t,e,n){"use strict";var i=n(11);n.n(i).a},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,".xp-list {\n overflow: auto;\n}\n.xp-list .xp-list-content {\n width: 100%;\n display: flex;\n flex-wrap: wrap;\n align-items: stretch;\n}\n.xp-list .xp-list-content .item {\n position: relative;\n display: flex;\n align-items: center;\n padding: 4px 2px;\n background-color: white;\n border-radius: 3px;\n border: 1px solid #EDEFF0;\n width: 50%;\n min-width: 180px;\n flex: 1 0 auto;\n}\n.xp-list .xp-list-content .item:hover {\n border: 1px solid #ACCEEF;\n}\n.xp-list .xp-list-content .item.xsmall {\n padding: 0px 0px;\n}\n.xp-list .xp-list-content .item.xsmall .preview {\n flex: 0 0 20px;\n}\n.xp-list .xp-list-content .item.xsmall .preview .icon {\n width: 20px;\n height: 20px;\n}\n.xp-list .xp-list-content .item.small .preview {\n flex: 0 0 30px;\n}\n.xp-list .xp-list-content .item.small .preview .icon {\n width: 30px;\n height: 30px;\n}\n.xp-list .xp-list-content .item.medium .preview {\n flex: 0 0 60px;\n}\n.xp-list .xp-list-content .item.medium .preview .icon {\n width: 60px;\n height: 60px;\n}\n.xp-list .xp-list-content .item.large .preview {\n flex: 0 0 100px;\n}\n.xp-list .xp-list-content .item.large .preview .icon {\n width: 100px;\n height: 100px;\n}\n.xp-list .xp-list-content .item .preview {\n flex: 0 0 30px;\n margin-left: 4px;\n flex: 0 0 30px;\n}\n.xp-list .xp-list-content .item .preview .icon {\n width: 30px;\n height: 30px;\n}\n.xp-list .xp-list-content .item .preview.xsmall {\n flex: 0 0 20px;\n}\n.xp-list .xp-list-content .item .preview.xsmall .icon {\n width: 20px;\n height: 20px;\n}\n.xp-list .xp-list-content .item .preview.small {\n flex: 0 0 30px;\n}\n.xp-list .xp-list-content .item .preview.small .icon {\n width: 30px;\n height: 30px;\n}\n.xp-list .xp-list-content .item .preview.medium {\n flex: 0 0 60px;\n}\n.xp-list .xp-list-content .item .preview.medium .icon {\n width: 60px;\n height: 60px;\n}\n.xp-list .xp-list-content .item .preview.large {\n flex: 0 0 100px;\n}\n.xp-list .xp-list-content .item .preview.large .icon {\n width: 100px;\n height: 100px;\n}\n.xp-list .xp-list-content .item .label {\n padding: 6px;\n}\n",""])},function(t,e,n){"use strict";var i=n(14);n.n(i).a},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,".xp-section-title {\n font-size: 9px;\n color: #9F9F9F;\n letter-spacing: 1px;\n margin-bottom: 10px;\n margin-top: 16px;\n padding-top: 10px;\n border-top: 2px solid #E4E4E4;\n}\n",""])},function(t,e,n){const i=n(30);t.exports=async function(t){let e=new Promise((e,n)=>{try{var o=new XMLHttpRequest;o.addEventListener("progress",t=>{}),o.addEventListener("error",()=>{n({code:"CC400",message:"No internet connection."})}),o.addEventListener("load",()=>{if(200===o.status){let t=JSON.parse(o.response);e(t)}else 404===o.status?n({code:"CC401",message:"Feed server not found..."}):n({code:"CC402",message:"Error during request (XMLHttpRequest failed)"})});i&&i.appLanguage&&i.appLanguage;o.open("GET",t),o.send()}catch(t){console.error(t.toString()),n({code:"CC299",message:`Error during request (${t.toString()})`})}});return await e}},function(t,e,n){"use strict";var i=n(19);n.n(i).a},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,".express--dialog-header {\n display: flex;\n}\n.express--dialog-header .express-dialog-logo {\n width: 23px;\n height: 23px;\n flex: 0;\n}\n.express--dialog-header .express--dialog-title {\n color: black;\n font-size: 18px;\n margin-left: 6px;\n flex: 1;\n}\n.express--dialog-header .express-dialog-help {\n width: 23px;\n height: 23px;\n flex: 0;\n opacity: 0.5;\n}\n.express--dialog-header .express-dialog-help:hover {\n opacity: 1;\n}\n#dialog {\n width: 460px;\n}\n#interim-banner {\n border-top: 2px solid #E4E4E4;\n margin-top: 20px;\n padding-top: 10px;\n height: 75px;\n}\n#interim-banner img {\n margin: auto;\n}\n",""])},,,,function(t,e,n){"use strict";n.r(e);var i=n(1),o=n(22),a=n(23),s=n(24),l=n(21),r=n(31);const c=n(2).storage.localFileSystem,p=n(2).storage.formats;let d,u;const f=n(2).storage.localFileSystem;n(2).storage.localFileSystem;const x=n(2).storage.localFileSystem,g=n(30);var h=class{static async launch(t){const e=await x.getDataFolder();await e.getEntry("nolog").catch(()=>{})||this._log(t)}static async _log(t){try{const e=await x.getDataFolder(),n=await e.getEntry(`installed_${t.version}`).catch(()=>{}),i=await n.read().catch(()=>{}),o="https://tourdexd.com/api_check_updates/?"+`plugin_name=${t.id}`+`&v=${t.version}`+`&lang=${g.appLanguage}`+`&id=${i}`;await fetch(o).then(function(t){return t.json()})}catch(t){}}},v=n(3);(class{static async install(t,e,n){e&&console.log("(DEBUG) InstallService::forceInstall is activated. Disable this in production mode...");const i=await f.getDataFolder(),o="installed_"+t.version;await i.getEntry(o).catch(()=>{})&&!e||await this._install(t,n)}static async _install(t,e){console.log(""),console.log(""),console.log("################################"),console.log(`## ${t.id} Installing...`),console.log("################################");const n=await f.getDataFolder(),i=(await f.getPluginFolder(),"installed_"+t.version),o=await n.createEntry(i,{overwrite:!0}),a=(new Date).getTime()+"$"+Math.round(1e4*Math.random());await o.write(a),await class{static async getPluginFolder(){return d||(d=await c.getPluginFolder()),d}static async getDataFolder(){return u||(u=await c.getDataFolder()),u}static async readDataFile(t){return await(await(await FileService.getDataFolder()).getEntry(t).catch(e=>{console.log("Error in FileService::readDataFile : fileName: ",t," // ",e.message,e.stack)})).read()}static async writeDataFile(t,e){const n=await(await FileService.getDataFolder()).createFile(t,{overwrite:!0});await n.write(e,{format:p.utf8})}static async deepCopyFilesFolder(){try{const t=await this.getPluginFolder(),e=await this.getDataFolder(),n=async(t,e)=>{if(t.isFile&&await t.copyTo(e,{overwrite:!0}),t.isFolder){let i=await e.getEntry(t.name).catch(t=>{});i||(i=await e.createFolder(t.name));const o=await t.getEntries();for(let t=0;t<o.length;t++){let e=o[t];n(e,i)}}};await n(await t.getEntry("files"),e)}catch(t){console.error("[ FileService ] Error in deepCopyFolder()",t)}}}.deepCopyFilesFolder(),e&&await e.install(t)}}).install(v.default,!1,class{static async install(t){try{console.log(`[ ${t.id} ] Custom Install`)}catch(e){console.error(`[ ${t.id} ]`,e)}}});const m={},w={};e.default=class{static commands(){return{dialogDefault:async function(){return new Promise((t,e)=>{const n=m;n.node||(n.node=document.createElement("dialog"),n.node.innerHTML='<div id="app"></div>',h.launch(v.default)),document.appendChild(n.node),n.vue||(i.a.component("default-panel",r.default),i.a.component("xp-list",a.default),i.a.component("xp-section-title",s.default),n.vue=new i.a({el:"#app",render:t=>t(o.default,{props:{}})})),n.node.showModal().catch(t=>{}),n.node.addEventListener("close",function e(){n.node.removeEventListener("close",e),t()})})}}}static panels(){return{default:{show:function(t){const e=w;e.node||(e.node=document.createElement("panel"),e.node.innerHTML='<div id="app"></div>',h.launch(v.default)),t.node.appendChild(e.node),e.vue||(i.a.component("default-panel",l.default),i.a.component("xp-list",a.default),i.a.component("xp-section-title",s.default),e.vue=new i.a({el:"#app",render:t=>t(o.default,{props:{}})}))},hide:function(t){const e=w;t.node.removeChild(e.node)},update:function(){}}}}}}]).default;