diff --git a/VERSION.txt b/VERSION.txt index 985701e95dc..d37adef09a7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -7.0.15 \ No newline at end of file +7.0.16 \ No newline at end of file diff --git a/build/es6/node_modules/@lrnwebcomponents/app-hax/app-hax.js b/build/es6/node_modules/@lrnwebcomponents/app-hax/app-hax.js index 4395d02e153..4bc48e1514a 100644 --- a/build/es6/node_modules/@lrnwebcomponents/app-hax/app-hax.js +++ b/build/es6/node_modules/@lrnwebcomponents/app-hax/app-hax.js @@ -1,4 +1,4 @@ -import{css as e,html as t,unsafeCSS as o}from"../../lit/index.js";import{toJS as a,autorun as i}from"../../mobx/dist/mobx.esm.js";import{localStorageSet as n,localStorageGet as s}from"../utils/utils.js";import"../simple-tooltip/simple-tooltip.js";import{SimpleColors as r}from"../simple-colors/simple-colors.js";import{store as l}from"./lib/v1/AppHaxStore.js";import{I18NMixin as p}from"../i18n-manager/lib/I18NMixin.js";import{AppHaxAPI as d}from"./lib/v1/AppHaxBackendAPI.js";import{SimpleTourManager as c}from"../simple-popover/lib/simple-tour.js";import{SuperDaemonInstance as m}from"../super-daemon/super-daemon.js";import"../simple-toolbar/lib/simple-toolbar-button.js";import"../simple-colors-shared-styles/simple-colors-shared-styles.js";import"./lib/v1/AppHaxRouter.js";import"./lib/v1/app-hax-label.js";import"./lib/v1/app-hax-top-bar.js";import{SimpleTourFinder as h}from"../simple-popover/lib/SimpleTourFinder.js";const u=new URL("./lib/assets/images/Logout.svg",import.meta.url).href;function darkToggle(e){e.matches?l.darkMode=!0:l.darkMode=!1}function soundToggle(){l.soundStatus=!a(l.soundStatus),n("app-hax-soundStatus",a(l.soundStatus)),l.appEl.playSound("click")}export class AppHax extends(p(h(r))){static get tag(){return"app-hax"}_openExternalLink(e){window.open(e,"_blank")}async _haxStoreContribute(e,t,o=null){let a="";if("merlin"==e){var i=`[${e}] New command request from HAX daemon`;a=`Location: ${window.location.href}\nMerlin command: ${o}\nWhat did you want merlin to do?\n`}else{i=`[${e}] User report from HAX daemon`;if(a=`Location: ${window.location.href}\nBrowser: ${navigator.userAgent}\nOS: ${navigator.userAgentData.platform} - ${navigator.deviceMemory}GB RAM - ${navigator.hardwareConcurrency} cores\nScreen: ${window.screen.width}x${window.screen.height}\nWindow size: ${window.innerWidth}x${window.innerHeight}\n`,navigator.getBattery){a+=`Battery: ${100*(await navigator.getBattery()).level}%\n`}navigator.connection&&navigator.connection.effectiveType&&(a+=`Connection: ${navigator.connection.effectiveType}\n`),a+=("feature"==e?"Your idea:":"Bug you experienced:")+"\n"}window.open(`https://github.com/elmsln/issues/issues/new?assignees=&labels=${t}&template=issue-report.md&title=${i}&body=${encodeURIComponent(a)}`,"_blank")}playSound(e="coin2"){return new Promise((t=>{if(l.soundStatus&&l.appReady){let o=["click","click2","coin","coin2","hit","success"].includes(e)?e:"hit";this.audio=new Audio(new URL(`./lib/assets/sounds/${o}.mp3`,import.meta.url).href),this.audio.volume=.5,this.audio.onended=e=>{t()},this.audio.play(),setTimeout((()=>{t()}),1e3)}else t()}))}_tokenRefreshFailed(e){window.dispatchEvent(new CustomEvent("jwt-login-logout",{composed:!0,bubbles:!0,cancelable:!1,detail:!0})),setTimeout((()=>{this.reset(!0)}),100)}connectedCallback(){super.connectedCallback(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",darkToggle,{signal:this.windowControllers.signal}),window.addEventListener("jwt-logged-in",this._jwtLoggedIn.bind(this),{signal:this.windowControllers.signal}),window.addEventListener("jwt-login-refresh-error",this._tokenRefreshFailed.bind(this),{signal:this.windowControllers.signal})}goToLocation(e){window.location=e}disconnectedCallback(){this.windowControllers.abort(),super.disconnectedCallback()}constructor(){super(),this.unlockComingSoon=!1,this.unlockTerrible=!1,this.t=this.t||{},this.t={...this.t,selectPage:"Select page",backToSiteList:"Back to site list",listMySites:"List my sites",cancel:"Cancel",editDetails:"Page details",add:"Add",editSettings:"Edit settings",source:"Source",viewSource:"View source",findMedia:"Find media",undo:"Undo",redo:"Redo",media:"Media",outline:"Outline",blocks:"Blocks",addBlock:"Add block",addPage:"Add page",addChildPage:"Add child page",clonePage:"Clone page",importDocxFile:"Import docx file",delete:"Delete page",siteSettings:"Site settings",close:"Close",settings:"Settings",editPage:"Edit page",edit:"Edit",configureBlock:"Configure block",configure:"Configure",save:"Save",home:"Home",saveChanges:"Save changes",startNewJourney:"Start new journey",newJourney:"New Journey",accountInfo:"Account Info",outlineDesigner:"Outline designer",pageOutline:"Page outline",more:"More",siteActions:"Site actions",insights:"Insights dashboard",merlin:"Merlin",summonMerlin:"Summon Merlin",logOut:"Log out",menu:"Menu",showMore:"More"},void 0!==window.speechSynthesis&&(window.SpeechRecognition||window.webkitSpeechRecognition||window.mozSpeechRecognition||window.msSpeechRecognition||window.oSpeechRecognition)&&(m.voiceSearch=!0),m.icon="hax:wizard-hat",m.appendContext("*"),m.allowedCallback=()=>!(!a(l.appReady)||!a(l.isLoggedIn)),m.questionTags=[{value:"*",label:"List everything I can do"},{value:"?",label:"HELP!"}],m.defineOption({title:"Tour of top menu buttons",icon:"help",tags:["Help","ui","tour"],priority:-1e3,value:{target:this,method:"helpClick",args:[]},eventName:"super-daemon-element-method",path:"HAX/app/tour",context:["*","?"]}),m.defineOption({title:"Unlock hidden features",icon:"hax:hax2022",tags:["Developer","features","hidden"],value:{target:this,method:"fireUnlocked",args:[]},eventName:"super-daemon-element-method",path:">developer/hax/unlockAll",context:[">"]}),m.defineOption({title:"Unlock terrible 2000s themes",icon:"hax:table-multiple",tags:["Developer","terrible","2000","tables"],value:{target:this,method:"fireTerrible",args:[]},eventName:"super-daemon-element-method",path:">developer/hax/terrible2000s",context:[">"]}),m.defineOption({title:"Go to site",icon:"hax:hax2022",tags:["Sites","Administration","change"],eventName:"super-daemon-run-program",path:"hax/action/goToSite",value:{name:"Go to site",program:async(e,t)=>{let o=[];return a(l.manifest.items).forEach((async t=>{(""==e||t.metadata.site&&t.metadata.site.name&&t.metadata.site.name.includes(e))&&o.push({title:t.title,icon:t.metadata.theme&&t.metadata.theme.variables&&t.metadata.theme.variables.icon?t.metadata.theme.variables.icon:"hax:hax2022",tags:["site",t.description],value:{target:this,method:"goToLocation",args:[t.slug]},eventName:"super-daemon-element-method",context:["*","hax/action/goToSite/"+t.metadata.site.name],path:"hax/action/goToSite/"+t.metadata.site.name})})),o}},context:["*"]}),m.defineOption({title:"Join our Community",icon:"hax:discord",priority:-100,tags:["community","discord","chat","help"],value:{target:this,method:"_openExternalLink",args:["https://bit.ly/hax-discord"]},eventName:"super-daemon-element-method",path:"HAX/community/join",context:["logged-in","CMS","HAX","?","*"]}),m.defineOption({title:"User Tutorials",icon:"hax:hax2022",priority:-1e3,tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/tutorials"]},eventName:"super-daemon-element-method",path:"HAX/community/tutorials",context:["logged-in","CMS","HAX","?","*"]}),m.defineOption({title:"User Documentation",icon:"hax:hax2022",tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation"]},eventName:"super-daemon-element-method",path:"HAX/community/documentation",context:["logged-in","CMS","HAX","?","*"]}),m.defineOption({title:"HAX Teaching Excellence",icon:"hax:hax2022",tags:["Ontology","community","pedagogy","documentation","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/ontology"]},eventName:"super-daemon-element-method",path:"HAX/community/pedagogy",context:["logged-in","CMS","HAX","?","*"]}),m.defineOption({title:"Bug / issue",icon:"mdi-social:github-circle",tags:["Bug report","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["bug","POP,bug"]},eventName:"super-daemon-element-method",path:"HAX/community/contribute",context:["logged-in","CMS","HAX","?","*"]}),m.defineOption({title:"Idea / Feature request",icon:"mdi-social:github-circle",tags:["Feature request","idea","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["feature","POP,enhancement"]},context:["logged-in","CMS","HAX","?","*"],eventName:"super-daemon-element-method",path:"HAX/community/contribute"}),this.windowControllers=new AbortController,this.__tour=c,this.__tour.registerNewTour({key:"hax",name:"HAX top menu",style:"\n simple-popover-manager::part(simple-popover) {\n max-width: 250px;\n font-family: sans-serif;\n }\n simple-popover-manager button {\n font-family: sans-serif;\n font-size: 12px;\n margin: 0px 2px;\n color: var(--simple-colors-default-theme-grey-12);\n }\n simple-popover-manager p {\n font-family: sans-serif;\n padding: 0;\n margin: 0;\n width: 250px;\n font-size: 10px;\n line-height: 20px;\n }\n simple-popover-manager h1 {\n font-family: sans-serif;\n margin: 0;\n font-size: 12px;\n width: 250px;\n padding: 0;\n }\n simple-popover-manager::part(simple-popover-body),\n simple-popover-manager::part(simple-popover-heading) {\n color: black;\n background-color: white;\n font-family: sans-serif;\n }\n body.dark-mode simple-popover-manager::part(simple-popover-body),\n body.dark-mode simple-popover-manager::part(simple-popover-heading) {\n color: white;\n background-color: black;\n font-family: sans-serif;\n }\n body.dark-mode simple-popover-manager simple-icon-button-lite {\n color: white;\n background-color: black;\n font-family: sans-serif;\n }\n "}),this.tourName="hax",i((()=>{const e=a(l.activeItem);e&&e.title&&l.setPageTitle(e.title)})),i((()=>{this.siteReady=a(l.siteReady)})),i((()=>{const e=a(l.badDevice);!1===e?(import("../rpg-character/rpg-character.js"),import("./lib/random-word/random-word.js")):!0===e&&document.body.classList.add("bad-device")})),this.userMenuOpen=!1,this.courses=[],this.activeItem={},this.phrases={new:["What's ya name?","HAX to the moon","Welcome to the Jungle","We like to party","Build something awesome","Everything is awesome!","Everything is cool","When you're part of the team","When you're living our dream","Welcome to the up-side-down"],return:["Welcome back, take 2?","That wasn't very long","Stranger thiings have happened","Student driven platform","Faculty centered platform","Instructional designer influenced platform","Free, Open, Community driven","One brick at a time..","Sup?","You again? Awesome!","Let's do this","There can only be one ring...","There is another","Fancy that, I love HAX and you show up"]},this.isNewUser=null,this.basePath="/",this.searchTerm="",this.appMode="",this.soundIcon="",this.store=l,this.sound=new Audio,i((()=>{this.isNewUser=a(l.isNewUser),this.isNewUser&&"create"!==a(l.appMode)&&"404"!==a(l.appMode)&&(l.appMode="create",setTimeout((()=>{l.createSiteSteps=!0}),0))})),i((()=>{this.userName=a(l.user.name)})),i((()=>{this.appMode=a(l.appMode)})),i((()=>{this.searchTerm=a(l.searchTerm)})),i((async()=>{const e=a(l.location);e&&e.route&&(e.route.step?(l.appMode="create",l.createSiteSteps=!0):e.route.slug?(this.reset(),setTimeout((()=>{window.location=e.route.slug}),0)):"404"===e.route.name?(l.createSiteSteps=!1,l.appMode="404",setTimeout((()=>{l.toast("the page miss.. it burns!!!",3e3,{fire:!0,walking:!0})}),500)):"home"!==e.route.name&&"search"!==e.route.name||(l.appMode="home",l.createSiteSteps=!1))})),i((()=>{l.routes.length>0&&null===l.location&&(l.location=a(l.routes[0]))})),null===s("app-hax-darkMode",null)&&(l.darkMode=window.matchMedia("(prefers-color-scheme: dark)").matches),i((()=>{n("app-hax-darkMode",a(l.darkMode)),requestAnimationFrame((()=>{a(l.darkMode)?(document.body.classList.add("dark-mode"),l.toast("I'm ascared of the dark",2e3,{fire:!0}),this.dark=!0,m.dark=!0,m.toastInstance.darkMode=!0):(document.body.classList.remove("dark-mode"),l.toast("Sunny day it is",2e3,{hat:"random"}),this.dark=!1,m.dark=!1,m.toastInstance.darkMode=!1)}))})),i((()=>{const e=a(l.appMode);e&&(document.body.classList.remove("app-hax-search"),document.body.classList.remove("app-hax-create"),document.body.classList.remove("app-hax-404"),document.body.classList.remove("app-hax-home"),document.body.classList.add(`app-hax-${e}`))}))}static get properties(){return{...super.properties,unlockComingSoon:{type:Boolean},unlockTerrible:{type:Boolean},courses:{type:Array},userName:{type:String},activeItem:{type:Object},soundIcon:{type:String},searchTerm:{type:String},appMode:{type:String},isNewUser:{type:Boolean},phrases:{type:Object},userMenuOpen:{type:Boolean},siteReady:{type:Boolean},basePath:{type:String,attribute:"base-path"},token:{type:String}}}reset(e=!1){try{window.localStorage.removeItem("app-hax-step"),window.localStorage.removeItem("app-hax-site"),e&&(document.querySelector("base")?window.location=document.querySelector("base").href:window.location.reload())}catch(e){}}fireTerrible(){this.unlockTerrible=!0,l.appEl.playSound("coin").then((()=>{l.appEl.playSound("coin2").then((()=>{l.appEl.playSound("success").then((()=>{m.merlinSpeak("Enjoy these early 2000s table based layouts. May they remind you how never to web, again.")}))}))}))}fireUnlocked(){this.unlockComingSoon=!0,l.appEl.playSound("coin").then((()=>{l.appEl.playSound("coin2").then((()=>{l.appEl.playSound("success").then((()=>{m.merlinSpeak("Unbelievable! You, (Subject Name), must be the pride of (Subject Hometown). Enjoy all locked features as a boon!")}))}))}))}logout(){window.dispatchEvent(new CustomEvent("jwt-login-logout",{composed:!0,bubbles:!0,cancelable:!1,detail:!0})),this.closeMenu(),this.__logoutUserAction=!0}_jwtLoggedIn(e){!1===e.detail&&this.__logoutUserAction&&(this.__logoutUserAction=!1,setTimeout((()=>{this.reset(!0)}),100))}login(){import("./lib/v1/app-hax-site-login.js").then((()=>{const e=document.createElement("app-hax-site-login");if(this.querySelector('[slot="externalproviders"]')){const t=this.querySelector('[slot="externalproviders"]').cloneNode(!0);e.appendChild(t)}import("../simple-modal/simple-modal.js").then((()=>{setTimeout((()=>{this.dispatchEvent(new CustomEvent("simple-modal-show",{bubbles:!0,cancelable:!0,composed:!0,detail:{title:"< login >",elements:{content:e},modal:!0,styles:{"--simple-modal-titlebar-background":"transparent","--simple-modal-titlebar-color":"black","--simple-modal-width":"40vw","--simple-modal-min-width":"300px","--simple-modal-z-index":"100000000","--simple-modal-height":"62vh","--simple-modal-min-height":"400px","--simple-modal-titlebar-height":"64px"}}}))}),0)}))}))}static get styles(){return[...super.styles,e` +import{css as e,html as t,unsafeCSS as o}from"../../lit/index.js";import{toJS as a,autorun as i}from"../../mobx/dist/mobx.esm.js";import{localStorageSet as n,localStorageGet as s}from"../utils/utils.js";import"../simple-tooltip/simple-tooltip.js";import{SimpleColors as r}from"../simple-colors/simple-colors.js";import{store as l}from"./lib/v1/AppHaxStore.js";import{I18NMixin as p}from"../i18n-manager/lib/I18NMixin.js";import{AppHaxAPI as d}from"./lib/v1/AppHaxBackendAPI.js";import{SimpleTourManager as c}from"../simple-popover/lib/simple-tour.js";import{SuperDaemonInstance as m}from"../super-daemon/super-daemon.js";import"../simple-toolbar/lib/simple-toolbar-button.js";import"../simple-colors-shared-styles/simple-colors-shared-styles.js";import"./lib/v1/AppHaxRouter.js";import"./lib/v1/app-hax-label.js";import"./lib/v1/app-hax-top-bar.js";import{SimpleTourFinder as h}from"../simple-popover/lib/SimpleTourFinder.js";const u=new URL("./lib/assets/images/Logout.svg",import.meta.url).href;function darkToggle(e){e.matches?l.darkMode=!0:l.darkMode=!1}function soundToggle(){l.soundStatus=!a(l.soundStatus),n("app-hax-soundStatus",a(l.soundStatus)),l.appEl.playSound("click")}export class AppHax extends(p(h(r))){static get tag(){return"app-hax"}_openExternalLink(e){window.open(e,"_blank")}async _haxStoreContribute(e,t,o=null){let a="";if("merlin"==e){var i=`[${e}] New command request from HAX daemon`;a=`Location: ${window.location.href}\nMerlin command: ${o}\nWhat did you want merlin to do?\n`}else{i=`[${e}] User report from HAX daemon`;if(a=`Location: ${window.location.href}\nBrowser: ${navigator.userAgent}\nOS: ${navigator.userAgentData.platform} - ${navigator.deviceMemory}GB RAM - ${navigator.hardwareConcurrency} cores\nScreen: ${window.screen.width}x${window.screen.height}\nWindow size: ${window.innerWidth}x${window.innerHeight}\n`,navigator.getBattery){a+=`Battery: ${100*(await navigator.getBattery()).level}%\n`}navigator.connection&&navigator.connection.effectiveType&&(a+=`Connection: ${navigator.connection.effectiveType}\n`),a+=("feature"==e?"Your idea:":"Bug you experienced:")+"\n"}window.open(`https://github.com/elmsln/issues/issues/new?assignees=&labels=${t}&template=issue-report.md&title=${i}&body=${encodeURIComponent(a)}`,"_blank")}playSound(e="coin2"){return new Promise((t=>{if(l.soundStatus&&l.appReady){let o=["click","click2","coin","coin2","hit","success"].includes(e)?e:"hit";this.audio=new Audio(new URL(`./lib/assets/sounds/${o}.mp3`,import.meta.url).href),this.audio.volume=.5,this.audio.onended=e=>{t()},this.audio.play(),setTimeout((()=>{t()}),1e3)}else t()}))}_tokenRefreshFailed(e){window.dispatchEvent(new CustomEvent("jwt-login-logout",{composed:!0,bubbles:!0,cancelable:!1,detail:!0})),setTimeout((()=>{this.reset(!0)}),100)}connectedCallback(){super.connectedCallback(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",darkToggle,{signal:this.windowControllers.signal}),window.addEventListener("jwt-logged-in",this._jwtLoggedIn.bind(this),{signal:this.windowControllers.signal}),window.addEventListener("jwt-login-refresh-error",this._tokenRefreshFailed.bind(this),{signal:this.windowControllers.signal})}goToLocation(e){window.location=e}disconnectedCallback(){this.windowControllers.abort(),super.disconnectedCallback()}constructor(){super(),this.unlockComingSoon=!1,this.unlockTerrible=!1,this.t=this.t||{},this.t={...this.t,selectPage:"Select page",backToSiteList:"Back to site list",listMySites:"List my sites",cancel:"Cancel",editDetails:"Page details",add:"Add",editSettings:"Edit settings",source:"Source",viewSource:"View source",findMedia:"Find media",undo:"Undo",redo:"Redo",media:"Media",outline:"Outline",blocks:"Blocks",addBlock:"Add block",addPage:"Add page",addChildPage:"Add child page",clonePage:"Clone page",importDocxFile:"Import docx file",delete:"Delete page",siteSettings:"Site settings",close:"Close",settings:"Settings",editPage:"Edit page",edit:"Edit",configureBlock:"Configure block",configure:"Configure",save:"Save",home:"Home",saveChanges:"Save changes",startNewJourney:"Start new journey",newJourney:"New Journey",accountInfo:"Account Info",outlineDesigner:"Outline designer",pageOutline:"Page outline",more:"More",siteActions:"Site actions",insights:"Insights dashboard",merlin:"Merlin",summonMerlin:"Summon Merlin",logOut:"Log out",menu:"Menu",showMore:"More"},void 0!==window.speechSynthesis&&(window.SpeechRecognition||window.webkitSpeechRecognition||window.mozSpeechRecognition||window.msSpeechRecognition||window.oSpeechRecognition)&&(m.voiceSearch=!0),m.icon="hax:wizard-hat",m.appendContext("*"),m.allowedCallback=()=>!(!a(l.appReady)||!a(l.isLoggedIn)),m.questionTags=[{value:"*",label:"List everything I can do"},{value:"?",label:"HELP!"}],m.defineOption({title:"Tour of top menu buttons",icon:"help",tags:["Help","ui","tour"],priority:-1e3,value:{target:this,method:"helpClick",args:[]},eventName:"super-daemon-element-method",path:"HAX/app/tour",context:["*","?"]}),m.defineOption({title:"Unlock hidden features",icon:"hax:hax2022",tags:["Developer","features","hidden"],value:{target:this,method:"fireUnlocked",args:[]},eventName:"super-daemon-element-method",path:">developer/hax/unlockAll",context:[">"]}),m.defineOption({title:"Unlock terrible 2000s themes",icon:"hax:table-multiple",tags:["Developer","terrible","2000","tables"],value:{target:this,method:"fireTerrible",args:[]},eventName:"super-daemon-element-method",path:">developer/hax/terrible2000s",context:[">"]}),m.defineOption({title:"Go to site",icon:"hax:hax2022",tags:["Sites","Administration","change"],eventName:"super-daemon-run-program",path:"HAX/action/goToSite",value:{name:"Go to site",program:async(e,t)=>{let o=[];return a(l.manifest.items).forEach((async t=>{(""==e||t.metadata.site&&t.metadata.site.name&&t.metadata.site.name.includes(e))&&o.push({title:t.title,icon:t.metadata.theme&&t.metadata.theme.variables&&t.metadata.theme.variables.icon?t.metadata.theme.variables.icon:"hax:hax2022",tags:["site",t.description],value:{target:this,method:"goToLocation",args:[t.slug]},eventName:"super-daemon-element-method",context:["*","HAX/action/goToSite/"+t.metadata.site.name],path:"HAX/action/goToSite/"+t.metadata.site.name})})),o}},context:["*"]}),m.defineOption({title:"Join our Community",icon:"hax:discord",priority:-100,tags:["community","discord","chat","help"],value:{target:this,method:"_openExternalLink",args:["https://bit.ly/hax-discord"]},eventName:"super-daemon-element-method",path:"HAX/community/join",context:["logged-in","CMS","HAX","?","*"]}),m.defineOption({title:"User Tutorials",icon:"hax:hax2022",priority:-1e3,tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/tutorials"]},eventName:"super-daemon-element-method",path:"HAX/community/tutorials",context:["logged-in","CMS","HAX","?","*"]}),m.defineOption({title:"User Documentation",icon:"hax:hax2022",tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation"]},eventName:"super-daemon-element-method",path:"HAX/community/documentation",context:["logged-in","CMS","HAX","?","*"]}),m.defineOption({title:"HAX Teaching Excellence",icon:"hax:hax2022",tags:["Ontology","community","pedagogy","documentation","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/ontology"]},eventName:"super-daemon-element-method",path:"HAX/community/pedagogy",context:["logged-in","CMS","HAX","?","*"]}),m.defineOption({title:"Bug / issue",icon:"mdi-social:github-circle",tags:["Bug report","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["bug","POP,bug"]},eventName:"super-daemon-element-method",path:"HAX/community/contribute",context:["logged-in","CMS","HAX","?","*"]}),m.defineOption({title:"Idea / Feature request",icon:"mdi-social:github-circle",tags:["Feature request","idea","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["feature","POP,enhancement"]},context:["logged-in","CMS","HAX","?","*"],eventName:"super-daemon-element-method",path:"HAX/community/contribute"}),this.windowControllers=new AbortController,this.__tour=c,this.__tour.registerNewTour({key:"hax",name:"HAX top menu",style:"\n simple-popover-manager::part(simple-popover) {\n max-width: 250px;\n font-family: sans-serif;\n }\n simple-popover-manager button {\n font-family: sans-serif;\n font-size: 12px;\n margin: 0px 2px;\n color: var(--simple-colors-default-theme-grey-12);\n }\n simple-popover-manager p {\n font-family: sans-serif;\n padding: 0;\n margin: 0;\n width: 250px;\n font-size: 10px;\n line-height: 20px;\n }\n simple-popover-manager h1 {\n font-family: sans-serif;\n margin: 0;\n font-size: 12px;\n width: 250px;\n padding: 0;\n }\n simple-popover-manager::part(simple-popover-body),\n simple-popover-manager::part(simple-popover-heading) {\n color: black;\n background-color: white;\n font-family: sans-serif;\n }\n body.dark-mode simple-popover-manager::part(simple-popover-body),\n body.dark-mode simple-popover-manager::part(simple-popover-heading) {\n color: white;\n background-color: black;\n font-family: sans-serif;\n }\n body.dark-mode simple-popover-manager simple-icon-button-lite {\n color: white;\n background-color: black;\n font-family: sans-serif;\n }\n "}),this.tourName="hax",i((()=>{const e=a(l.activeItem);e&&e.title&&l.setPageTitle(e.title)})),i((()=>{this.siteReady=a(l.siteReady)})),i((()=>{const e=a(l.badDevice);!1===e?(import("../rpg-character/rpg-character.js"),import("./lib/random-word/random-word.js")):!0===e&&document.body.classList.add("bad-device")})),this.userMenuOpen=!1,this.courses=[],this.activeItem={},this.phrases={new:["What's ya name?","HAX to the moon","Welcome to the Jungle","We like to party","Build something awesome","Everything is awesome!","Everything is cool","When you're part of the team","When you're living our dream","Welcome to the up-side-down"],return:["Welcome back, take 2?","That wasn't very long","Stranger thiings have happened","Student driven platform","Faculty centered platform","Instructional designer influenced platform","Free, Open, Community driven","One brick at a time..","Sup?","You again? Awesome!","Let's do this","There can only be one ring...","There is another","Fancy that, I love HAX and you show up"]},this.isNewUser=null,this.basePath="/",this.searchTerm="",this.appMode="",this.soundIcon="",this.store=l,this.sound=new Audio,i((()=>{this.isNewUser=a(l.isNewUser),this.isNewUser&&"create"!==a(l.appMode)&&"404"!==a(l.appMode)&&(l.appMode="create",setTimeout((()=>{l.createSiteSteps=!0}),0))})),i((()=>{this.userName=a(l.user.name)})),i((()=>{this.appMode=a(l.appMode)})),i((()=>{this.searchTerm=a(l.searchTerm)})),i((async()=>{const e=a(l.location);e&&e.route&&(e.route.step?(l.appMode="create",l.createSiteSteps=!0):e.route.slug?(this.reset(),setTimeout((()=>{window.location=e.route.slug}),0)):"404"===e.route.name?(l.createSiteSteps=!1,l.appMode="404",setTimeout((()=>{l.toast("the page miss.. it burns!!!",3e3,{fire:!0,walking:!0})}),500)):"home"!==e.route.name&&"search"!==e.route.name||(l.appMode="home",l.createSiteSteps=!1))})),i((()=>{l.routes.length>0&&null===l.location&&(l.location=a(l.routes[0]))})),null===s("app-hax-darkMode",null)&&(l.darkMode=window.matchMedia("(prefers-color-scheme: dark)").matches),i((()=>{n("app-hax-darkMode",a(l.darkMode)),requestAnimationFrame((()=>{a(l.darkMode)?(document.body.classList.add("dark-mode"),l.toast("I'm ascared of the dark",2e3,{fire:!0}),this.dark=!0,m.dark=!0,m.toastInstance.darkMode=!0):(document.body.classList.remove("dark-mode"),l.toast("Sunny day it is",2e3,{hat:"random"}),this.dark=!1,m.dark=!1,m.toastInstance.darkMode=!1)}))})),i((()=>{const e=a(l.appMode);e&&(document.body.classList.remove("app-hax-search"),document.body.classList.remove("app-hax-create"),document.body.classList.remove("app-hax-404"),document.body.classList.remove("app-hax-home"),document.body.classList.add(`app-hax-${e}`))}))}static get properties(){return{...super.properties,unlockComingSoon:{type:Boolean},unlockTerrible:{type:Boolean},courses:{type:Array},userName:{type:String},activeItem:{type:Object},soundIcon:{type:String},searchTerm:{type:String},appMode:{type:String},isNewUser:{type:Boolean},phrases:{type:Object},userMenuOpen:{type:Boolean},siteReady:{type:Boolean},basePath:{type:String,attribute:"base-path"},token:{type:String}}}reset(e=!1){try{window.localStorage.removeItem("app-hax-step"),window.localStorage.removeItem("app-hax-site"),e&&(document.querySelector("base")?window.location=document.querySelector("base").href:window.location.reload())}catch(e){}}fireTerrible(){this.unlockTerrible=!0,l.appEl.playSound("coin").then((()=>{l.appEl.playSound("coin2").then((()=>{l.appEl.playSound("success").then((()=>{m.merlinSpeak("Enjoy these early 2000s table based layouts. May they remind you how never to web, again.")}))}))}))}fireUnlocked(){this.unlockComingSoon=!0,l.appEl.playSound("coin").then((()=>{l.appEl.playSound("coin2").then((()=>{l.appEl.playSound("success").then((()=>{m.merlinSpeak("Unbelievable! You, (Subject Name), must be the pride of (Subject Hometown). Enjoy all locked features as a boon!")}))}))}))}logout(){window.dispatchEvent(new CustomEvent("jwt-login-logout",{composed:!0,bubbles:!0,cancelable:!1,detail:!0})),this.closeMenu(),this.__logoutUserAction=!0}_jwtLoggedIn(e){!1===e.detail&&this.__logoutUserAction&&(this.__logoutUserAction=!1,setTimeout((()=>{this.reset(!0)}),100))}login(){import("./lib/v1/app-hax-site-login.js").then((()=>{const e=document.createElement("app-hax-site-login");if(this.querySelector('[slot="externalproviders"]')){const t=this.querySelector('[slot="externalproviders"]').cloneNode(!0);e.appendChild(t)}import("../simple-modal/simple-modal.js").then((()=>{setTimeout((()=>{this.dispatchEvent(new CustomEvent("simple-modal-show",{bubbles:!0,cancelable:!0,composed:!0,detail:{title:"< login >",elements:{content:e},modal:!0,styles:{"--simple-modal-titlebar-background":"transparent","--simple-modal-titlebar-color":"black","--simple-modal-width":"40vw","--simple-modal-min-width":"300px","--simple-modal-z-index":"100000000","--simple-modal-height":"62vh","--simple-modal-min-height":"400px","--simple-modal-titlebar-height":"64px"}}}))}),0)}))}))}static get styles(){return[...super.styles,e` :host { display: block; --app-hax-background-color-active: var(--app-hax-accent-color); diff --git a/build/es6/node_modules/@lrnwebcomponents/drag-n-drop/drag-n-drop.js b/build/es6/node_modules/@lrnwebcomponents/drag-n-drop/drag-n-drop.js deleted file mode 100644 index a38af8d39aa..00000000000 --- a/build/es6/node_modules/@lrnwebcomponents/drag-n-drop/drag-n-drop.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright 2019 The Pennsylvania State University - * @license Apache-2.0, see License.md for full text. - * - * Inspiration from: https://codepen.io/bradtraversy/pen/odmVgN - */ -class DragNDrop extends HTMLElement{get html(){return'\n\n