katalyst-koi 5.0.0.beta.2 → 5.0.0.beta.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8edf091caf3ac18e5641a79a8954b4cfb521e5aba0d430d73f146284fc84d01f
4
- data.tar.gz: 0ca30571a7bb95edfd286986d1d484be0a18092fba143de9571b154ebf623f08
3
+ metadata.gz: 9bcc5dd5ebf6cb6ed2d0a989801f666af7e8bb0ab8eae889fbd12e8e6df8b5ac
4
+ data.tar.gz: 25211eab3e9f3609d8b9923eac4408164b915873d625848050aa0f8b732deede
5
5
  SHA512:
6
- metadata.gz: b23db6b834923adc7e201f8517bb16289505b8100ee90e63d719b6ae01d82e4da6a69b1b6579094683dd63280fe63b4b63977cba41bc87aec9e38170bb6d6169
7
- data.tar.gz: 4b886e649c95405d8145714cf252359cd86fd1d1bfecac864fb35d60805a91c86cd00b4412bd6852408f5e856755bacf185adaa1c43f7279a7dba445aac085b7
6
+ metadata.gz: '093d937e07a64eead13e4982b3155c83c91bcd9082683085786e38b294c061518dbcf00ec77f93645a9fd5d431802a7a329767fdea35fc52261aab6c20e4a18e'
7
+ data.tar.gz: 87cb1bba9cf759973dce88c017701c91921f523f2d4945d13c3172bffc8173cf30399344b64170b93cd29fb5c57e01367146c38da6e92883b597b0c585a320ea
@@ -7,6 +7,7 @@ import content from '@katalyst/content';
7
7
  import navigation from '@katalyst/navigation';
8
8
  import tables from '@katalyst/tables';
9
9
  import { get, parseRequestOptionsFromJSON, create, parseCreationOptionsFromJSON } from '@github/webauthn-json/browser-ponyfill';
10
+ import HwComboboxController from 'controllers/hw_combobox_controller';
10
11
  import { eagerLoadControllersFrom } from '@hotwired/stimulus-loading';
11
12
 
12
13
  const application = Application.start();
@@ -765,6 +766,10 @@ const Definitions = [
765
766
  identifier: "form-request-submit",
766
767
  controllerConstructor: FormRequestSubmitController,
767
768
  },
769
+ {
770
+ identifier: "hw-combobox",
771
+ controllerConstructor: HwComboboxController,
772
+ },
768
773
  {
769
774
  identifier: "index-actions",
770
775
  controllerConstructor: IndexActionsController,
@@ -7,6 +7,7 @@ import content from '@katalyst/content';
7
7
  import navigation from '@katalyst/navigation';
8
8
  import tables from '@katalyst/tables';
9
9
  import { get, parseRequestOptionsFromJSON, create, parseCreationOptionsFromJSON } from '@github/webauthn-json/browser-ponyfill';
10
+ import HwComboboxController from 'controllers/hw_combobox_controller';
10
11
  import { eagerLoadControllersFrom } from '@hotwired/stimulus-loading';
11
12
 
12
13
  const application = Application.start();
@@ -765,6 +766,10 @@ const Definitions = [
765
766
  identifier: "form-request-submit",
766
767
  controllerConstructor: FormRequestSubmitController,
767
768
  },
769
+ {
770
+ identifier: "hw-combobox",
771
+ controllerConstructor: HwComboboxController,
772
+ },
768
773
  {
769
774
  identifier: "index-actions",
770
775
  controllerConstructor: IndexActionsController,
@@ -1,2 +1,2 @@
1
- import"@hotwired/turbo-rails";import t,{initAll as e}from"@katalyst/govuk-formbuilder";import"@rails/actiontext";import"trix";import{Application as s,Controller as r}from"@hotwired/stimulus";import i from"@katalyst/content";import a from"@katalyst/navigation";import n from"@katalyst/tables";import{get as o,parseRequestOptionsFromJSON as l,create as c,parseCreationOptionsFromJSON as h}from"@github/webauthn-json/browser-ponyfill";import{eagerLoadControllersFrom as u}from"@hotwired/stimulus-loading";const d=s.start();class g{constructor(t,e){const{delay:s}=this._setDefaults(e);this.target=t,this.runner=new p(this,s),this.properties=[],this.startingCallbacks=[],this.startedCallbacks=[],this.completeCallbacks=[]}add(t){return this.properties.push(t),this}addCallback(t,e){switch(t){case"starting":this.startingCallbacks.push(e);break;case"started":this.startedCallbacks.push(e);break;case"complete":this.completeCallbacks.push(e)}return this}collapse(){return this.add(new m("max-height",`${this.target.scrollHeight}px`,"0px"))}expand(){return this.add(new m("max-height","0px",`${this.target.scrollHeight}px`))}slideOut(t){return this.add(new m(t,"0px",`-${this.target.scrollWidth}px`))}slideIn(t){return this.add(new m(t,`-${this.target.scrollWidth}px`,"0px"))}fadeOut(){return this.add(new m("opacity","100%","0%"))}fadeIn(){return this.add(new m("opacity","0%","100%"))}start(t=null){return requestAnimationFrame(()=>{this.runner.start(this.target),t&&t()}),this}cancel(){return this.runner.stop(this.target),this}_starting(){const t=new Event("transition:starting");this.startingCallbacks.forEach(e=>e(t)),this.target.dispatchEvent(t)}_started(){const t=new Event("transition:started");this.startedCallbacks.forEach(e=>e(t)),this.target.dispatchEvent(t)}_complete(){const t=new Event("transition:complete");this.completeCallbacks.forEach(e=>e(t)),this.target.dispatchEvent(t)}_setDefaults(t){return Object.assign({delay:250},t)}}class p{constructor(t,e){this.transition=t,this.running=null,this.delay=e}start(t){this.transition.properties.forEach(e=>e.onStarting(t)),requestAnimationFrame(()=>this.onStarted(t)),this.running=setTimeout(()=>this.stop(t,!0),this.delay),this.transition._starting()}onStarted(t){t.style.transitionProperty=this.transition.properties.map(t=>t.property).join(","),t.style.transitionDuration=`${this.delay}ms`,this.transition.properties.forEach(e=>e.onStarted(t)),this.transition._started()}stop(t,e=!1){this.running&&(e||clearTimeout(this.running),this.running=null,t.style.removeProperty("transition-property"),t.style.removeProperty("transition-duration"),this.transition.properties.forEach(e=>e.onComplete(t)),this.transition._complete())}}class m{constructor(t,e,s){this.property=t,this.from=e,this.to=s}onStarting(t){t.style.setProperty(this.property,this.from)}onStarted(t){t.style.setProperty(this.property,this.to)}onComplete(t){t.style.removeProperty(this.property)}}d.load(i),d.load(t),d.load(a),d.load(n);const f=[{identifier:"clipboard",controllerConstructor:class extends r{static targets=["source"];static classes=["supported"];connect(){"clipboard"in navigator&&this.element.classList.add(this.supportedClass)}copy(t){t.preventDefault(),navigator.clipboard.writeText(this.sourceTarget.value),this.element.classList.add("copied"),setTimeout(()=>{this.element.classList.remove("copied")},2e3)}}},{identifier:"flash",controllerConstructor:class extends r{close(t){t.target.closest("li").remove(),0===this.element.children.length&&this.element.remove()}}},{identifier:"form-request-submit",controllerConstructor:class extends r{requestSubmit(){this.element.requestSubmit()}}},{identifier:"index-actions",controllerConstructor:class extends r{static targets=["create","search","sort"];initialize(){var t,e;this.update=(t=this,e=this.update,(...s)=>{clearTimeout(t.timer),t.timer=setTimeout(()=>{e.apply(t,...s)},300)})}disconnect(){clearTimeout(this.timer)}create(){this.createTarget.click()}search(){this.searchTarget.focus()}clear(){this.searchTarget.value="",this.searchTarget.closest("form").requestSubmit()}update(){this.searchTarget.closest("form").requestSubmit()}submit(){const t=document.activeElement===this.searchTarget;""===this.searchTarget.value&&(this.searchTarget.disabled=!0),""===this.sortTarget.value&&(this.sortTarget.disabled=!0),Promise.resolve().then(()=>{this.searchTarget.disabled=!1,this.sortTarget.disabled=!1,t&&this.searchTarget.focus()})}}},{identifier:"keyboard",controllerConstructor:class extends r{static values={mapping:String,depth:{type:Number,default:2}};event(t){if(function(t){if(!(t instanceof HTMLElement))return!1;const e=t.nodeName.toLowerCase(),s=(t.getAttribute("type")||"").toLowerCase();return"select"===e||"textarea"===e||"trix-editor"===e||"input"===e&&"submit"!==s&&"reset"!==s&&"checkbox"!==s&&"radio"!==s&&"file"!==s||t.isContentEditable}(t.target)||this.#t(t))return;const e=this.describeEvent(t);this.buffer=[...this.buffer||[],e].slice(0-this.depthValue);const s=this.buffer.reduceRight((t,e)=>"string"==typeof t||void 0===t?t:t[e],this.mappings);if("string"!=typeof s)return;this.buffer=[],t.preventDefault();const r=new CustomEvent(s,{detail:{cause:t},bubbles:!0});t.target.dispatchEvent(r)}describeEvent(t){return[t.ctrlKey&&"C",t.metaKey&&"M",t.altKey&&"A",t.shiftKey&&"S",t.code].filter(t=>t).join("-")}get mappings(){const t=this.mappingValue.replaceAll(/\s+/g," ").split(" ").filter(t=>t.length>0),e={};return t.forEach(t=>this.#e(e,t)),Object.defineProperty(this,"mappings",{value:e,writable:!1}),e}#e(t,e){const[s,r]=e.split("->"),i=s.split("+"),a=i.shift();(t=i.reduceRight((t,e)=>t[e]||={},t))[a]=r}#t(t){switch(t.code){case"ControlLeft":case"ControlRight":case"MetaLeft":case"MetaRight":case"ShiftLeft":case"ShiftRight":case"AltLeft":case"AltRight":return!0;default:return!1}}}},{identifier:"modal",controllerConstructor:class extends r{static targets=["dialog"];connect(){this.element.addEventListener("turbo:submit-end",this.onSubmit)}disconnect(){this.element.removeEventListener("turbo:submit-end",this.onSubmit)}outside(t){"DIALOG"===t.target.tagName&&this.dismiss()}dismiss(){this.dialogTarget&&(this.dialogTarget.open||this.dialogTarget.close(),this.element.removeAttribute("src"),this.dialogTarget.remove())}dialogTargetConnected(t){t.showModal()}onSubmit=t=>{t.detail.success&&"closeDialog"in t.detail.formSubmission?.submitter?.dataset&&(this.dialogTarget.close(),this.element.removeAttribute("src"),this.dialogTarget.remove())}}},{identifier:"navigation",controllerConstructor:class extends r{static targets=["filter"];filter(){const t=this.filterTarget.value;this.clearFilter(t),t.length>0&&this.applyFilter(t)}go(){this.element.querySelector("li:not([hidden]) > a").click()}clear(){0===this.filterTarget.value.length&&this.filterTarget.blur()}applyFilter(t){this.links.filter(e=>!this.prefixSearch(t.toLowerCase(),e.innerText.toLowerCase())).forEach(t=>{t.toggleAttribute("hidden",!0)}),this.menus.filter(t=>!t.matches("li:has(li:not([hidden]) > a)")).forEach(t=>{t.toggleAttribute("hidden",!0)})}clearFilter(t){this.element.querySelectorAll("li").forEach(t=>{t.toggleAttribute("hidden",!1)})}prefixSearch(t,e){const s=e.length,r=t.length;if(r>s)return!1;if(r===s)return t===e;t:for(let i=0,a=0;i<r;i++){const r=t.charCodeAt(i);if(32!==r){for(;a<s;){if(e.charCodeAt(a++)===r)continue t;for(;a<s&&32!==e.charCodeAt(a++););}return!1}for(;a<s&&32!==e.charCodeAt(a++););}return!0}toggle(){this.element.open?this.close():this.open()}open(){this.element.open||this.element.showModal()}close(){this.element.open&&this.element.close()}click(t){t.target===this.element&&this.close()}onMorphAttribute=t=>{if(t.target===this.element&&"open"===t.detail.attributeName)t.preventDefault()};get links(){return Array.from(this.element.querySelectorAll("li:has(> a)"))}get menus(){return Array.from(this.element.querySelectorAll("li:has(> ul)"))}}},{identifier:"navigation-toggle",controllerConstructor:class extends r{trigger(){this.dispatch("toggle",{prefix:"navigation",bubbles:!0})}}},{identifier:"pagy-nav",controllerConstructor:class extends r{connect(){document.addEventListener("shortcut:page-prev",this.prevPage),document.addEventListener("shortcut:page-next",this.nextPage)}disconnect(){document.removeEventListener("shortcut:page-prev",this.prevPage),document.removeEventListener("shortcut:page-next",this.nextPage)}nextPage=()=>{this.element.querySelector("a:last-child").click()};prevPage=()=>{this.element.querySelector("a:first-child").click()}}},{identifier:"show-hide",controllerConstructor:class extends r{static targets=["content"];toggle(){const t=this.contentTarget,e=t.toggleAttribute("data-collapsed");this.transition&&this.transition.cancel();const s=this.transition=new g(t).addCallback("starting",function(){t.setAttribute("data-collapsed-transitioning","true")}).addCallback("complete",function(){t.removeAttribute("data-collapsed-transitioning")});e?s.collapse():s.expand(),s.start()}}},{identifier:"sluggable",controllerConstructor:class extends r{static targets=["source","slug"];static values={slug:String};sourceChanged(t){""===this.slugValue&&(this.slugTarget.value=this.sourceTarget.value.toLowerCase().replace(/'/g,"-").replace(/[^-\w\s]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""))}slugChanged(t){this.slugValue=this.slugTarget.value}}},{identifier:"webauthn-authentication",controllerConstructor:class extends r{static targets=["response"];static values={options:Object};authenticate(){o(this.options).then(t=>{this.responseTarget.value=JSON.stringify(t),this.element.requestSubmit()})}get options(){return l(this.optionsValue)}}},{identifier:"webauthn-registration",controllerConstructor:class extends r{static values={options:Object,response:String};static targets=["intro","nickname","response"];submit(t){""===this.responseTarget.value&&"dialog"!==t.submitter.formMethod&&(t.preventDefault(),this.createCredential())}async createCredential(){const t=await c(this.options);this.responseValue=JSON.stringify(t),this.responseTarget.value=JSON.stringify(t)}responseValueChanged(t){const e=""!==t;this.introTarget.toggleAttribute("hidden",e),this.nicknameTarget.toggleAttribute("hidden",!e)}get options(){return h(this.optionsValue)}}}];d.load(f),u("admin/controllers",d);class b extends HTMLElement{constructor(){super(),this.setAttribute("role","toolbar")}}customElements.define("koi-toolbar",b),window.addEventListener("turbo:load",()=>{document.body.classList.toggle("js-enabled",!0),document.body.classList.toggle("govuk-frontend-supported","noModule"in HTMLScriptElement.prototype),e()});
1
+ import"@hotwired/turbo-rails";import t,{initAll as e}from"@katalyst/govuk-formbuilder";import"@rails/actiontext";import"trix";import{Application as s,Controller as r}from"@hotwired/stimulus";import i from"@katalyst/content";import a from"@katalyst/navigation";import o from"@katalyst/tables";import{get as n,parseRequestOptionsFromJSON as l,create as c,parseCreationOptionsFromJSON as h}from"@github/webauthn-json/browser-ponyfill";import u from"controllers/hw_combobox_controller";import{eagerLoadControllersFrom as d}from"@hotwired/stimulus-loading";const g=s.start();class p{constructor(t,e){const{delay:s}=this._setDefaults(e);this.target=t,this.runner=new m(this,s),this.properties=[],this.startingCallbacks=[],this.startedCallbacks=[],this.completeCallbacks=[]}add(t){return this.properties.push(t),this}addCallback(t,e){switch(t){case"starting":this.startingCallbacks.push(e);break;case"started":this.startedCallbacks.push(e);break;case"complete":this.completeCallbacks.push(e)}return this}collapse(){return this.add(new f("max-height",`${this.target.scrollHeight}px`,"0px"))}expand(){return this.add(new f("max-height","0px",`${this.target.scrollHeight}px`))}slideOut(t){return this.add(new f(t,"0px",`-${this.target.scrollWidth}px`))}slideIn(t){return this.add(new f(t,`-${this.target.scrollWidth}px`,"0px"))}fadeOut(){return this.add(new f("opacity","100%","0%"))}fadeIn(){return this.add(new f("opacity","0%","100%"))}start(t=null){return requestAnimationFrame(()=>{this.runner.start(this.target),t&&t()}),this}cancel(){return this.runner.stop(this.target),this}_starting(){const t=new Event("transition:starting");this.startingCallbacks.forEach(e=>e(t)),this.target.dispatchEvent(t)}_started(){const t=new Event("transition:started");this.startedCallbacks.forEach(e=>e(t)),this.target.dispatchEvent(t)}_complete(){const t=new Event("transition:complete");this.completeCallbacks.forEach(e=>e(t)),this.target.dispatchEvent(t)}_setDefaults(t){return Object.assign({delay:250},t)}}class m{constructor(t,e){this.transition=t,this.running=null,this.delay=e}start(t){this.transition.properties.forEach(e=>e.onStarting(t)),requestAnimationFrame(()=>this.onStarted(t)),this.running=setTimeout(()=>this.stop(t,!0),this.delay),this.transition._starting()}onStarted(t){t.style.transitionProperty=this.transition.properties.map(t=>t.property).join(","),t.style.transitionDuration=`${this.delay}ms`,this.transition.properties.forEach(e=>e.onStarted(t)),this.transition._started()}stop(t,e=!1){this.running&&(e||clearTimeout(this.running),this.running=null,t.style.removeProperty("transition-property"),t.style.removeProperty("transition-duration"),this.transition.properties.forEach(e=>e.onComplete(t)),this.transition._complete())}}class f{constructor(t,e,s){this.property=t,this.from=e,this.to=s}onStarting(t){t.style.setProperty(this.property,this.from)}onStarted(t){t.style.setProperty(this.property,this.to)}onComplete(t){t.style.removeProperty(this.property)}}g.load(i),g.load(t),g.load(a),g.load(o);const b=[{identifier:"clipboard",controllerConstructor:class extends r{static targets=["source"];static classes=["supported"];connect(){"clipboard"in navigator&&this.element.classList.add(this.supportedClass)}copy(t){t.preventDefault(),navigator.clipboard.writeText(this.sourceTarget.value),this.element.classList.add("copied"),setTimeout(()=>{this.element.classList.remove("copied")},2e3)}}},{identifier:"flash",controllerConstructor:class extends r{close(t){t.target.closest("li").remove(),0===this.element.children.length&&this.element.remove()}}},{identifier:"form-request-submit",controllerConstructor:class extends r{requestSubmit(){this.element.requestSubmit()}}},{identifier:"hw-combobox",controllerConstructor:u},{identifier:"index-actions",controllerConstructor:class extends r{static targets=["create","search","sort"];initialize(){var t,e;this.update=(t=this,e=this.update,(...s)=>{clearTimeout(t.timer),t.timer=setTimeout(()=>{e.apply(t,...s)},300)})}disconnect(){clearTimeout(this.timer)}create(){this.createTarget.click()}search(){this.searchTarget.focus()}clear(){this.searchTarget.value="",this.searchTarget.closest("form").requestSubmit()}update(){this.searchTarget.closest("form").requestSubmit()}submit(){const t=document.activeElement===this.searchTarget;""===this.searchTarget.value&&(this.searchTarget.disabled=!0),""===this.sortTarget.value&&(this.sortTarget.disabled=!0),Promise.resolve().then(()=>{this.searchTarget.disabled=!1,this.sortTarget.disabled=!1,t&&this.searchTarget.focus()})}}},{identifier:"keyboard",controllerConstructor:class extends r{static values={mapping:String,depth:{type:Number,default:2}};event(t){if(function(t){if(!(t instanceof HTMLElement))return!1;const e=t.nodeName.toLowerCase(),s=(t.getAttribute("type")||"").toLowerCase();return"select"===e||"textarea"===e||"trix-editor"===e||"input"===e&&"submit"!==s&&"reset"!==s&&"checkbox"!==s&&"radio"!==s&&"file"!==s||t.isContentEditable}(t.target)||this.#t(t))return;const e=this.describeEvent(t);this.buffer=[...this.buffer||[],e].slice(0-this.depthValue);const s=this.buffer.reduceRight((t,e)=>"string"==typeof t||void 0===t?t:t[e],this.mappings);if("string"!=typeof s)return;this.buffer=[],t.preventDefault();const r=new CustomEvent(s,{detail:{cause:t},bubbles:!0});t.target.dispatchEvent(r)}describeEvent(t){return[t.ctrlKey&&"C",t.metaKey&&"M",t.altKey&&"A",t.shiftKey&&"S",t.code].filter(t=>t).join("-")}get mappings(){const t=this.mappingValue.replaceAll(/\s+/g," ").split(" ").filter(t=>t.length>0),e={};return t.forEach(t=>this.#e(e,t)),Object.defineProperty(this,"mappings",{value:e,writable:!1}),e}#e(t,e){const[s,r]=e.split("->"),i=s.split("+"),a=i.shift();(t=i.reduceRight((t,e)=>t[e]||={},t))[a]=r}#t(t){switch(t.code){case"ControlLeft":case"ControlRight":case"MetaLeft":case"MetaRight":case"ShiftLeft":case"ShiftRight":case"AltLeft":case"AltRight":return!0;default:return!1}}}},{identifier:"modal",controllerConstructor:class extends r{static targets=["dialog"];connect(){this.element.addEventListener("turbo:submit-end",this.onSubmit)}disconnect(){this.element.removeEventListener("turbo:submit-end",this.onSubmit)}outside(t){"DIALOG"===t.target.tagName&&this.dismiss()}dismiss(){this.dialogTarget&&(this.dialogTarget.open||this.dialogTarget.close(),this.element.removeAttribute("src"),this.dialogTarget.remove())}dialogTargetConnected(t){t.showModal()}onSubmit=t=>{t.detail.success&&"closeDialog"in t.detail.formSubmission?.submitter?.dataset&&(this.dialogTarget.close(),this.element.removeAttribute("src"),this.dialogTarget.remove())}}},{identifier:"navigation",controllerConstructor:class extends r{static targets=["filter"];filter(){const t=this.filterTarget.value;this.clearFilter(t),t.length>0&&this.applyFilter(t)}go(){this.element.querySelector("li:not([hidden]) > a").click()}clear(){0===this.filterTarget.value.length&&this.filterTarget.blur()}applyFilter(t){this.links.filter(e=>!this.prefixSearch(t.toLowerCase(),e.innerText.toLowerCase())).forEach(t=>{t.toggleAttribute("hidden",!0)}),this.menus.filter(t=>!t.matches("li:has(li:not([hidden]) > a)")).forEach(t=>{t.toggleAttribute("hidden",!0)})}clearFilter(t){this.element.querySelectorAll("li").forEach(t=>{t.toggleAttribute("hidden",!1)})}prefixSearch(t,e){const s=e.length,r=t.length;if(r>s)return!1;if(r===s)return t===e;t:for(let i=0,a=0;i<r;i++){const r=t.charCodeAt(i);if(32!==r){for(;a<s;){if(e.charCodeAt(a++)===r)continue t;for(;a<s&&32!==e.charCodeAt(a++););}return!1}for(;a<s&&32!==e.charCodeAt(a++););}return!0}toggle(){this.element.open?this.close():this.open()}open(){this.element.open||this.element.showModal()}close(){this.element.open&&this.element.close()}click(t){t.target===this.element&&this.close()}onMorphAttribute=t=>{if(t.target===this.element&&"open"===t.detail.attributeName)t.preventDefault()};get links(){return Array.from(this.element.querySelectorAll("li:has(> a)"))}get menus(){return Array.from(this.element.querySelectorAll("li:has(> ul)"))}}},{identifier:"navigation-toggle",controllerConstructor:class extends r{trigger(){this.dispatch("toggle",{prefix:"navigation",bubbles:!0})}}},{identifier:"pagy-nav",controllerConstructor:class extends r{connect(){document.addEventListener("shortcut:page-prev",this.prevPage),document.addEventListener("shortcut:page-next",this.nextPage)}disconnect(){document.removeEventListener("shortcut:page-prev",this.prevPage),document.removeEventListener("shortcut:page-next",this.nextPage)}nextPage=()=>{this.element.querySelector("a:last-child").click()};prevPage=()=>{this.element.querySelector("a:first-child").click()}}},{identifier:"show-hide",controllerConstructor:class extends r{static targets=["content"];toggle(){const t=this.contentTarget,e=t.toggleAttribute("data-collapsed");this.transition&&this.transition.cancel();const s=this.transition=new p(t).addCallback("starting",function(){t.setAttribute("data-collapsed-transitioning","true")}).addCallback("complete",function(){t.removeAttribute("data-collapsed-transitioning")});e?s.collapse():s.expand(),s.start()}}},{identifier:"sluggable",controllerConstructor:class extends r{static targets=["source","slug"];static values={slug:String};sourceChanged(t){""===this.slugValue&&(this.slugTarget.value=this.sourceTarget.value.toLowerCase().replace(/'/g,"-").replace(/[^-\w\s]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""))}slugChanged(t){this.slugValue=this.slugTarget.value}}},{identifier:"webauthn-authentication",controllerConstructor:class extends r{static targets=["response"];static values={options:Object};authenticate(){n(this.options).then(t=>{this.responseTarget.value=JSON.stringify(t),this.element.requestSubmit()})}get options(){return l(this.optionsValue)}}},{identifier:"webauthn-registration",controllerConstructor:class extends r{static values={options:Object,response:String};static targets=["intro","nickname","response"];submit(t){""===this.responseTarget.value&&"dialog"!==t.submitter.formMethod&&(t.preventDefault(),this.createCredential())}async createCredential(){const t=await c(this.options);this.responseValue=JSON.stringify(t),this.responseTarget.value=JSON.stringify(t)}responseValueChanged(t){const e=""!==t;this.introTarget.toggleAttribute("hidden",e),this.nicknameTarget.toggleAttribute("hidden",!e)}get options(){return h(this.optionsValue)}}}];g.load(b),d("admin/controllers",g);class v extends HTMLElement{constructor(){super(),this.setAttribute("role","toolbar")}}customElements.define("koi-toolbar",v),window.addEventListener("turbo:load",()=>{document.body.classList.toggle("js-enabled",!0),document.body.classList.toggle("govuk-frontend-supported","noModule"in HTMLScriptElement.prototype),e()});
2
2
  //# sourceMappingURL=koi.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"koi.min.js","sources":["../../../javascript/koi/controllers/application.js","../../../javascript/koi/utils/transition.js","../../../javascript/koi/controllers/index.js","../../../javascript/koi/controllers/clipboard_controller.js","../../../javascript/koi/controllers/flash_controller.js","../../../javascript/koi/controllers/form_request_submit_controller.js","../../../javascript/koi/controllers/index_actions_controller.js","../../../javascript/koi/controllers/keyboard_controller.js","../../../javascript/koi/controllers/modal_controller.js","../../../javascript/koi/controllers/navigation_controller.js","../../../javascript/koi/controllers/navigation_toggle_controller.js","../../../javascript/koi/controllers/pagy_nav_controller.js","../../../javascript/koi/controllers/show_hide_controller.js","../../../javascript/koi/controllers/sluggable_controller.js","../../../javascript/koi/controllers/webauthn_authentication_controller.js","../../../javascript/koi/controllers/webauthn_registration_controller.js","../../../javascript/koi/elements/toolbar.js","../../../javascript/koi/application.js"],"sourcesContent":["import { Application } from \"@hotwired/stimulus\";\n\nconst application = Application.start();\n\nexport { application };\n","const DEFAULT_DELAY = 250;\n\n/**\n * A utility class for managing CSS transition animations.\n *\n * Transition uses Javascript timers to track state instead of relying on\n * CSS transition events, which is a more complicated API. Please call `cancel`\n * when the node being animated is detached from the DOM to avoid unexpected\n * errors or animation glitches.\n *\n * Transition assumes that CSS already specifies styles to achieve the expected\n * start and end states. Transition adds temporary overrides and then animates\n * between those values using CSS transitions. For example, to use the collapse\n * transition:\n *\n * @example\n * // CSS:\n * target {\n * max-height: unset;\n * overflow: 0;\n * }\n * target.hidden {\n * max-height: 0;\n * }\n *\n * @example\n * // Javascript\n * target.addClass(\"hidden\");\n * new Transition(target).collapse().start();\n */\nclass Transition {\n constructor(target, options) {\n const { delay } = this._setDefaults(options);\n\n this.target = target;\n this.runner = new Runner(this, delay);\n this.properties = [];\n\n this.startingCallbacks = [];\n this.startedCallbacks = [];\n this.completeCallbacks = [];\n }\n\n add(property) {\n this.properties.push(property);\n return this;\n }\n\n /** Adds callback for transition events */\n addCallback(type, callback) {\n switch (type) {\n case \"starting\":\n this.startingCallbacks.push(callback);\n break;\n case \"started\":\n this.startedCallbacks.push(callback);\n break;\n case \"complete\":\n this.completeCallbacks.push(callback);\n break;\n }\n return this;\n }\n\n /** Collapse an element in place, assumes overflow is set appropriately, margin is not collapsed */\n collapse() {\n return this.add(\n new PropertyTransition(\n \"max-height\",\n `${this.target.scrollHeight}px`,\n \"0px\",\n ),\n );\n }\n\n /** Restore a collapsed element */\n expand() {\n return this.add(\n new PropertyTransition(\n \"max-height\",\n \"0px\",\n `${this.target.scrollHeight}px`,\n ),\n );\n }\n\n /** Slide an element left or right by its scroll width, assumes position relative */\n slideOut(direction) {\n return this.add(\n new PropertyTransition(direction, \"0px\", `-${this.target.scrollWidth}px`),\n );\n }\n\n /** Restore an element that has been slid */\n slideIn(direction) {\n return this.add(\n new PropertyTransition(direction, `-${this.target.scrollWidth}px`, \"0px\"),\n );\n }\n\n /** Cause an element to become transparent by transforming opacity */\n fadeOut() {\n return this.add(new PropertyTransition(\"opacity\", \"100%\", \"0%\"));\n }\n\n /** Cause a transparent element to become visible again */\n fadeIn() {\n return this.add(new PropertyTransition(\"opacity\", \"0%\", \"100%\"));\n }\n\n start(callback = null) {\n // start the runner on next tick so that any side-effects of the current execution can occur first\n requestAnimationFrame(() => {\n this.runner.start(this.target);\n if (callback) callback();\n });\n return this;\n }\n\n cancel() {\n this.runner.stop(this.target);\n return this;\n }\n\n _starting() {\n const event = new Event(\"transition:starting\");\n this.startingCallbacks.forEach((cb) => cb(event));\n this.target.dispatchEvent(event);\n }\n\n _started() {\n const event = new Event(\"transition:started\");\n this.startedCallbacks.forEach((cb) => cb(event));\n this.target.dispatchEvent(event);\n }\n\n _complete() {\n const event = new Event(\"transition:complete\");\n this.completeCallbacks.forEach((cb) => cb(event));\n this.target.dispatchEvent(event);\n }\n\n _setDefaults(options) {\n return Object.assign({ delay: DEFAULT_DELAY }, options);\n }\n}\n\n/**\n * Encapsulates internal execution and timing functionality for `Transition`\n */\nclass Runner {\n constructor(transition, delay) {\n this.transition = transition;\n this.running = null;\n this.delay = delay;\n }\n\n start(target) {\n // 1. Set the initial state(s)\n this.transition.properties.forEach((t) => t.onStarting(target));\n\n // 2. On next update, set transition and final state(s)\n requestAnimationFrame(() => this.onStarted(target));\n\n // 3. After transition has finished, clean up\n this.running = setTimeout(() => this.stop(target, true), this.delay);\n\n this.transition._starting();\n }\n\n onStarted(target) {\n target.style.transitionProperty = this.transition.properties\n .map((t) => t.property)\n .join(\",\");\n target.style.transitionDuration = `${this.delay}ms`;\n this.transition.properties.forEach((t) => t.onStarted(target));\n\n this.transition._started();\n }\n\n stop(target, timeout = false) {\n if (!this.running) return;\n if (!timeout) clearTimeout(this.running);\n\n this.running = null;\n\n target.style.removeProperty(\"transition-property\");\n target.style.removeProperty(\"transition-duration\");\n this.transition.properties.forEach((t) => t.onComplete(target));\n\n this.transition._complete();\n }\n}\n\n/**\n * Represents animation of a single CSS property. Currently only CSS animations\n * are supported, but this could be a natural extension point for Javascript\n * animations in the future.\n */\nclass PropertyTransition {\n constructor(property, from, to) {\n this.property = property;\n this.from = from;\n this.to = to;\n }\n\n onStarting(target) {\n target.style.setProperty(this.property, this.from);\n }\n\n onStarted(target) {\n target.style.setProperty(this.property, this.to);\n }\n\n onComplete(target) {\n target.style.removeProperty(this.property);\n }\n}\n\nexport { Transition };\n","import { application } from \"./application\";\n\nimport content from \"@katalyst/content\";\napplication.load(content);\n\nimport govuk from \"@katalyst/govuk-formbuilder\";\napplication.load(govuk);\n\nimport navigation from \"@katalyst/navigation\";\napplication.load(navigation);\n\nimport tables from \"@katalyst/tables\";\napplication.load(tables);\n\nimport ClipboardController from \"./clipboard_controller\";\nimport FlashController from \"./flash_controller\";\nimport FormRequestSubmitController from \"./form_request_submit_controller\";\nimport IndexActionsController from \"./index_actions_controller\";\nimport KeyboardController from \"./keyboard_controller\";\nimport ModalController from \"./modal_controller\";\nimport NavigationController from \"./navigation_controller\";\nimport NavigationToggleController from \"./navigation_toggle_controller\";\nimport PagyNavController from \"./pagy_nav_controller\";\nimport ShowHideController from \"./show_hide_controller\";\nimport SluggableController from \"./sluggable_controller\";\nimport WebauthnAuthenticationController from \"./webauthn_authentication_controller\";\nimport WebauthnRegistrationController from \"./webauthn_registration_controller\";\n\nconst Definitions = [\n {\n identifier: \"clipboard\",\n controllerConstructor: ClipboardController,\n },\n {\n identifier: \"flash\",\n controllerConstructor: FlashController,\n },\n {\n identifier: \"form-request-submit\",\n controllerConstructor: FormRequestSubmitController,\n },\n {\n identifier: \"index-actions\",\n controllerConstructor: IndexActionsController,\n },\n {\n identifier: \"keyboard\",\n controllerConstructor: KeyboardController,\n },\n {\n identifier: \"modal\",\n controllerConstructor: ModalController,\n },\n {\n identifier: \"navigation\",\n controllerConstructor: NavigationController,\n },\n {\n identifier: \"navigation-toggle\",\n controllerConstructor: NavigationToggleController,\n },\n {\n identifier: \"pagy-nav\",\n controllerConstructor: PagyNavController,\n },\n {\n identifier: \"show-hide\",\n controllerConstructor: ShowHideController,\n },\n {\n identifier: \"sluggable\",\n controllerConstructor: SluggableController,\n },\n {\n identifier: \"webauthn-authentication\",\n controllerConstructor: WebauthnAuthenticationController,\n },\n {\n identifier: \"webauthn-registration\",\n controllerConstructor: WebauthnRegistrationController,\n },\n];\n\napplication.load(Definitions);\n\n// Eager load all controllers defined in the import map under controllers/admin/**/*_controller\nimport { eagerLoadControllersFrom } from \"@hotwired/stimulus-loading\";\n\neagerLoadControllersFrom(\"admin/controllers\", application);\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class ClipboardController extends Controller {\n static targets = [\"source\"];\n\n static classes = [\"supported\"];\n\n connect() {\n if (\"clipboard\" in navigator) {\n this.element.classList.add(this.supportedClass);\n }\n }\n\n copy(event) {\n event.preventDefault();\n navigator.clipboard.writeText(this.sourceTarget.value);\n\n this.element.classList.add(\"copied\");\n setTimeout(() => {\n this.element.classList.remove(\"copied\");\n }, 2000);\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class FlashController extends Controller {\n close(e) {\n e.target.closest(\"li\").remove();\n\n // remove the flash container if there are no more flashes\n if (this.element.children.length === 0) {\n this.element.remove();\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\n/**\n A stimulus controller to request form submissions.\n This controller should be attached to a form element.\n */\nexport default class FormRequestSubmitController extends Controller {\n requestSubmit() {\n this.element.requestSubmit();\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class IndexActionsController extends Controller {\n static targets = [\"create\", \"search\", \"sort\"];\n\n initialize() {\n // debounce search\n this.update = debounce(this, this.update);\n }\n\n disconnect() {\n clearTimeout(this.timer);\n }\n\n create() {\n this.createTarget.click();\n }\n\n search() {\n this.searchTarget.focus();\n }\n\n clear() {\n this.searchTarget.value = \"\";\n this.searchTarget.closest(\"form\").requestSubmit();\n }\n\n update() {\n this.searchTarget.closest(\"form\").requestSubmit();\n }\n\n submit() {\n const shouldFocus = document.activeElement === this.searchTarget;\n\n if (this.searchTarget.value === \"\") {\n this.searchTarget.disabled = true;\n }\n if (this.sortTarget.value === \"\") {\n this.sortTarget.disabled = true;\n }\n\n // restore state and focus after submit\n Promise.resolve().then(() => {\n this.searchTarget.disabled = false;\n this.sortTarget.disabled = false;\n if (shouldFocus) {\n this.searchTarget.focus();\n }\n });\n }\n}\n\nfunction debounce(self, f) {\n return (...args) => {\n clearTimeout(self.timer);\n self.timer = setTimeout(() => {\n f.apply(self, ...args);\n }, 300);\n };\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nconst DEBUG = false;\n\nexport default class KeyboardController extends Controller {\n static values = {\n mapping: String,\n depth: { type: Number, default: 2 },\n };\n\n event(cause) {\n if (isFormField(cause.target) || this.#ignore(cause)) return;\n\n const key = this.describeEvent(cause);\n\n this.buffer = [...(this.buffer || []), key].slice(0 - this.depthValue);\n\n if (DEBUG) console.debug(\"[keyboard] buffer:\", ...this.buffer);\n\n // test whether the tail of the buffer matches any of the configured chords\n const action = this.buffer.reduceRight((mapping, key) => {\n if (typeof mapping === \"string\" || typeof mapping === \"undefined\") {\n return mapping;\n } else {\n return mapping[key];\n }\n }, this.mappings);\n\n // if we don't have a string we may have a miss or an incomplete chord\n if (typeof action !== \"string\") return;\n\n // clear the buffer and prevent the key from being consumed elsewhere\n this.buffer = [];\n cause.preventDefault();\n\n if (DEBUG) console.debug(\"[keyboard] event: %s\", action);\n\n // fire the configured event\n const event = new CustomEvent(action, {\n detail: { cause: cause },\n bubbles: true,\n });\n cause.target.dispatchEvent(event);\n }\n\n /**\n * @param event KeyboardEvent input event to describe\n * @return String description of keyboard event, e.g. 'C-KeyV' (CTRL+V)\n */\n describeEvent(event) {\n return [\n event.ctrlKey && \"C\",\n event.metaKey && \"M\",\n event.altKey && \"A\",\n event.shiftKey && \"S\",\n event.code,\n ]\n .filter((w) => w)\n .join(\"-\");\n }\n\n /**\n * Build a tree for efficiently looking up key chords, where the last key in the sequence\n * is the first key in tree.\n */\n get mappings() {\n const inputs = this.mappingValue\n .replaceAll(/\\s+/g, \" \")\n .split(\" \")\n .filter((f) => f.length > 0);\n const mappings = {};\n\n inputs.forEach((mapping) => this.#parse(mappings, mapping));\n\n // memoize the result\n Object.defineProperty(this, \"mappings\", {\n value: mappings,\n writable: false,\n });\n\n return mappings;\n }\n\n /**\n * Parse a key chord pattern and an event and store it in the inverted tree lookup structure.\n *\n * @param mappings inverted tree lookup for key chords\n * @param mapping input definition, e.g. \"C-KeyC+C-KeyV->paste\"\n */\n #parse(mappings, mapping) {\n const [pattern, event] = mapping.split(\"->\");\n const keys = pattern.split(\"+\");\n const first = keys.shift();\n\n mappings = keys.reduceRight(\n (mappings, key) => (mappings[key] ||= {}),\n mappings,\n );\n mappings[first] = event;\n }\n\n /**\n * Ignore modifier keys, as they will be captured in normal key presses.\n *\n * @param event KeyboardEvent\n * @returns {boolean} true if key event should be ignored\n */\n #ignore(event) {\n switch (event.code) {\n case \"ControlLeft\":\n case \"ControlRight\":\n case \"MetaLeft\":\n case \"MetaRight\":\n case \"ShiftLeft\":\n case \"ShiftRight\":\n case \"AltLeft\":\n case \"AltRight\":\n return true;\n default:\n return false;\n }\n }\n}\n\n/**\n * Detect input nodes where we should not listen for events.\n *\n * Credit: github.com\n */\nfunction isFormField(element) {\n if (!(element instanceof HTMLElement)) {\n return false;\n }\n\n const name = element.nodeName.toLowerCase();\n const type = (element.getAttribute(\"type\") || \"\").toLowerCase();\n return (\n name === \"select\" ||\n name === \"textarea\" ||\n name === \"trix-editor\" ||\n (name === \"input\" &&\n type !== \"submit\" &&\n type !== \"reset\" &&\n type !== \"checkbox\" &&\n type !== \"radio\" &&\n type !== \"file\") ||\n element.isContentEditable\n );\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class ModalController extends Controller {\n static targets = [\"dialog\"];\n\n connect() {\n this.element.addEventListener(\"turbo:submit-end\", this.onSubmit);\n }\n\n disconnect() {\n this.element.removeEventListener(\"turbo:submit-end\", this.onSubmit);\n }\n\n outside(e) {\n if (e.target.tagName === \"DIALOG\") this.dismiss();\n }\n\n dismiss() {\n if (!this.dialogTarget) return;\n if (!this.dialogTarget.open) this.dialogTarget.close();\n\n this.element.removeAttribute(\"src\");\n this.dialogTarget.remove();\n }\n\n dialogTargetConnected(dialog) {\n dialog.showModal();\n }\n\n onSubmit = (event) => {\n if (\n event.detail.success &&\n \"closeDialog\" in event.detail.formSubmission?.submitter?.dataset\n ) {\n this.dialogTarget.close();\n this.element.removeAttribute(\"src\");\n this.dialogTarget.remove();\n }\n };\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class NavigationController extends Controller {\n static targets = [\"filter\"];\n\n filter() {\n const filter = this.filterTarget.value;\n this.clearFilter(filter);\n\n if (filter.length > 0) {\n this.applyFilter(filter);\n }\n }\n\n go() {\n this.element.querySelector(\"li:not([hidden]) > a\").click();\n }\n\n clear() {\n if (this.filterTarget.value.length === 0) this.filterTarget.blur();\n }\n\n applyFilter(filter) {\n // hide items that don't match the search filter\n this.links\n .filter(\n (li) =>\n !this.prefixSearch(filter.toLowerCase(), li.innerText.toLowerCase()),\n )\n .forEach((li) => {\n li.toggleAttribute(\"hidden\", true);\n });\n\n this.menus\n .filter((li) => !li.matches(\"li:has(li:not([hidden]) > a)\"))\n .forEach((li) => {\n li.toggleAttribute(\"hidden\", true);\n });\n }\n\n clearFilter(filter) {\n this.element.querySelectorAll(\"li\").forEach((li) => {\n li.toggleAttribute(\"hidden\", false);\n });\n }\n\n prefixSearch(needle, haystack) {\n const haystackLength = haystack.length;\n const needleLength = needle.length;\n if (needleLength > haystackLength) {\n return false;\n }\n if (needleLength === haystackLength) {\n return needle === haystack;\n }\n outer: for (let i = 0, j = 0; i < needleLength; i++) {\n const needleChar = needle.charCodeAt(i);\n if (needleChar === 32) {\n // skip ahead to next space in the haystack\n while (j < haystackLength && haystack.charCodeAt(j++) !== 32) {}\n continue;\n }\n while (j < haystackLength) {\n if (haystack.charCodeAt(j++) === needleChar) continue outer;\n // skip ahead to the next space in the haystack\n while (j < haystackLength && haystack.charCodeAt(j++) !== 32) {}\n }\n return false;\n }\n return true;\n }\n\n toggle() {\n this.element.open ? this.close() : this.open();\n }\n\n open() {\n if (!this.element.open) this.element.showModal();\n }\n\n close() {\n if (this.element.open) this.element.close();\n }\n\n click(e) {\n if (e.target === this.element) this.close();\n }\n\n onMorphAttribute = (e) => {\n if (e.target !== this.element) return;\n\n switch (e.detail.attributeName) {\n case \"open\":\n e.preventDefault();\n }\n };\n\n get links() {\n return Array.from(this.element.querySelectorAll(\"li:has(> a)\"));\n }\n\n get menus() {\n return Array.from(this.element.querySelectorAll(\"li:has(> ul)\"));\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class NavigationToggleController extends Controller {\n trigger() {\n this.dispatch(\"toggle\", { prefix: \"navigation\", bubbles: true });\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class PagyNavController extends Controller {\n connect() {\n document.addEventListener(\"shortcut:page-prev\", this.prevPage);\n document.addEventListener(\"shortcut:page-next\", this.nextPage);\n }\n\n disconnect() {\n document.removeEventListener(\"shortcut:page-prev\", this.prevPage);\n document.removeEventListener(\"shortcut:page-next\", this.nextPage);\n }\n\n nextPage = () => {\n this.element.querySelector(\"a:last-child\").click();\n };\n\n prevPage = () => {\n this.element.querySelector(\"a:first-child\").click();\n };\n}\n","import { Controller } from \"@hotwired/stimulus\";\nimport { Transition } from \"../utils/transition\";\n\nexport default class ShowHideController extends Controller {\n static targets = [\"content\"];\n\n toggle() {\n const element = this.contentTarget;\n const hide = element.toggleAttribute(\"data-collapsed\");\n\n // cancel previous animation, if any\n if (this.transition) this.transition.cancel();\n\n const transition = (this.transition = new Transition(element)\n .addCallback(\"starting\", function () {\n element.setAttribute(\"data-collapsed-transitioning\", \"true\");\n })\n .addCallback(\"complete\", function () {\n element.removeAttribute(\"data-collapsed-transitioning\");\n }));\n hide ? transition.collapse() : transition.expand();\n\n transition.start();\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\n/**\n * Connect an input (e.g. title) to slug.\n */\nexport default class SluggableController extends Controller {\n static targets = [\"source\", \"slug\"];\n static values = {\n slug: String,\n };\n\n sourceChanged(e) {\n if (this.slugValue === \"\") {\n this.slugTarget.value = parameterize(this.sourceTarget.value);\n }\n }\n\n slugChanged(e) {\n this.slugValue = this.slugTarget.value;\n }\n}\n\nfunction parameterize(input) {\n return input\n .toLowerCase()\n .replace(/'/g, \"-\")\n .replace(/[^-\\w\\s]/g, \"\")\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/(^-|-$)/g, \"\");\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nimport {\n get,\n parseRequestOptionsFromJSON,\n} from \"@github/webauthn-json/browser-ponyfill\";\n\nexport default class WebauthnAuthenticationController extends Controller {\n static targets = [\"response\"];\n static values = { options: Object };\n\n authenticate() {\n get(this.options).then((response) => {\n this.responseTarget.value = JSON.stringify(response);\n\n this.element.requestSubmit();\n });\n }\n\n get options() {\n return parseRequestOptionsFromJSON(this.optionsValue);\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nimport {\n create,\n parseCreationOptionsFromJSON,\n} from \"@github/webauthn-json/browser-ponyfill\";\n\nexport default class WebauthnRegistrationController extends Controller {\n static values = {\n options: Object,\n response: String,\n };\n static targets = [\"intro\", \"nickname\", \"response\"];\n\n submit(e) {\n if (\n this.responseTarget.value === \"\" &&\n e.submitter.formMethod !== \"dialog\"\n ) {\n e.preventDefault();\n this.createCredential();\n }\n }\n\n async createCredential() {\n const response = await create(this.options);\n\n this.responseValue = JSON.stringify(response);\n this.responseTarget.value = JSON.stringify(response);\n }\n\n responseValueChanged(response) {\n const responsePresent = response !== \"\";\n this.introTarget.toggleAttribute(\"hidden\", responsePresent);\n this.nicknameTarget.toggleAttribute(\"hidden\", !responsePresent);\n }\n\n get options() {\n return parseCreationOptionsFromJSON(this.optionsValue);\n }\n}\n","class KoiToolbarElement extends HTMLElement {\n constructor() {\n super();\n\n this.setAttribute(\"role\", \"toolbar\");\n }\n}\n\ncustomElements.define(\"koi-toolbar\", KoiToolbarElement);\n","import \"@hotwired/turbo-rails\";\nimport { initAll } from \"@katalyst/govuk-formbuilder\";\nimport \"@rails/actiontext\";\nimport \"trix\";\n\nimport \"./controllers\";\nimport \"./elements\";\n\n/** Let GOVUK know that we've got JS enabled */\nwindow.addEventListener(\"turbo:load\", () => {\n document.body.classList.toggle(\"js-enabled\", true);\n document.body.classList.toggle(\n \"govuk-frontend-supported\",\n \"noModule\" in HTMLScriptElement.prototype,\n );\n initAll();\n});\n"],"names":["application","Application","start","Transition","constructor","target","options","delay","this","_setDefaults","runner","Runner","properties","startingCallbacks","startedCallbacks","completeCallbacks","add","property","push","addCallback","type","callback","collapse","PropertyTransition","scrollHeight","expand","slideOut","direction","scrollWidth","slideIn","fadeOut","fadeIn","requestAnimationFrame","cancel","stop","_starting","event","Event","forEach","cb","dispatchEvent","_started","_complete","Object","assign","transition","running","t","onStarting","onStarted","setTimeout","style","transitionProperty","map","join","transitionDuration","timeout","clearTimeout","removeProperty","onComplete","from","to","setProperty","load","content","govuk","navigation","tables","Definitions","identifier","controllerConstructor","Controller","static","connect","navigator","element","classList","supportedClass","copy","preventDefault","clipboard","writeText","sourceTarget","value","remove","close","e","closest","children","length","requestSubmit","initialize","self","f","update","args","timer","apply","disconnect","create","createTarget","click","search","searchTarget","focus","clear","submit","shouldFocus","document","activeElement","disabled","sortTarget","Promise","resolve","then","mapping","String","depth","Number","default","cause","HTMLElement","name","nodeName","toLowerCase","getAttribute","isContentEditable","isFormField","ignore","key","describeEvent","buffer","slice","depthValue","action","reduceRight","mappings","CustomEvent","detail","bubbles","ctrlKey","metaKey","altKey","shiftKey","code","filter","w","inputs","mappingValue","replaceAll","split","parse","defineProperty","writable","pattern","keys","first","shift","addEventListener","onSubmit","removeEventListener","outside","tagName","dismiss","dialogTarget","open","removeAttribute","dialogTargetConnected","dialog","showModal","success","formSubmission","submitter","dataset","filterTarget","clearFilter","applyFilter","go","querySelector","blur","links","li","prefixSearch","innerText","toggleAttribute","menus","matches","querySelectorAll","needle","haystack","haystackLength","needleLength","outer","i","j","needleChar","charCodeAt","toggle","onMorphAttribute","attributeName","Array","trigger","dispatch","prefix","prevPage","nextPage","contentTarget","hide","setAttribute","slug","sourceChanged","slugValue","slugTarget","replace","slugChanged","authenticate","get","response","responseTarget","JSON","stringify","parseRequestOptionsFromJSON","optionsValue","formMethod","createCredential","responseValue","responseValueChanged","responsePresent","introTarget","nicknameTarget","parseCreationOptionsFromJSON","eagerLoadControllersFrom","KoiToolbarElement","super","customElements","define","window","body","HTMLScriptElement","prototype","initAll"],"mappings":"sfAEA,MAAMA,EAAcC,EAAYC,QC4BhC,MAAMC,EACJ,WAAAC,CAAYC,EAAQC,GAClB,MAAMC,MAAEA,GAAUC,KAAKC,aAAaH,GAEpCE,KAAKH,OAASA,EACdG,KAAKE,OAAS,IAAIC,EAAOH,KAAMD,GAC/BC,KAAKI,WAAa,GAElBJ,KAAKK,kBAAoB,GACzBL,KAAKM,iBAAmB,GACxBN,KAAKO,kBAAoB,EAC7B,CAEE,GAAAC,CAAIC,GAEF,OADAT,KAAKI,WAAW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I,MAAQwI,KAAKC,UAAUH,GAE3CjN,KAAKmE,QAAQe,iBAEnB,CAEE,WAAIpF,GACF,OAAOuN,EAA4BrN,KAAKsN,aAC5C,IZwDE,CACEzJ,WAAY,wBACZC,sBaxEW,cAA6CC,EAC1DC,cAAgB,CACdlE,QAASqC,OACT8K,SAAUrG,QAEZ5C,eAAiB,CAAC,QAAS,WAAY,YAEvC,MAAAkC,CAAOpB,GAE2B,KAA9B9E,KAAKkN,eAAevI,OACO,WAA3BG,EAAEsF,UAAUmD,aAEZzI,EAAEP,iBACFvE,KAAKwN,mBAEX,CAEE,sBAAMA,GACJ,MAAMP,QAAiBtH,EAAO3F,KAAKF,SAEnCE,KAAKyN,cAAgBN,KAAKC,UAAUH,GACpCjN,KAAKkN,eAAevI,MAAQwI,KAAKC,UAAUH,EAC/C,CAEE,oBAAAS,CAAqBT,GACnB,MAAMU,EAA+B,KAAbV,EACxBjN,KAAK4N,YAAY5C,gBAAgB,SAAU2C,GAC3C3N,KAAK6N,eAAe7C,gBAAgB,UAAW2C,EACnD,CAEE,WAAI7N,GACF,OAAOgO,EAA6B9N,KAAKsN,aAC7C,Kb4CA9N,EAAY+D,KAAKK,GAKjBmK,EAAyB,oBAAqBvO,GcxF9C,MAAMwO,UAA0B/G,YAC9B,WAAArH,GACEqO,QAEAjO,KAAKwM,aAAa,OAAQ,UAC9B,EAGA0B,eAAeC,OAAO,cAAeH,GCCrCI,OAAO9E,iBAAiB,aAAc,KACpClD,SAASiI,KAAKjK,UAAUyH,OAAO,cAAc,GAC7CzF,SAASiI,KAAKjK,UAAUyH,OACtB,2BACA,aAAcyC,kBAAkBC,WAElCC"}
1
+ {"version":3,"file":"koi.min.js","sources":["../../../javascript/koi/controllers/application.js","../../../javascript/koi/utils/transition.js","../../../javascript/koi/controllers/index.js","../../../javascript/koi/controllers/clipboard_controller.js","../../../javascript/koi/controllers/flash_controller.js","../../../javascript/koi/controllers/form_request_submit_controller.js","../../../javascript/koi/controllers/index_actions_controller.js","../../../javascript/koi/controllers/keyboard_controller.js","../../../javascript/koi/controllers/modal_controller.js","../../../javascript/koi/controllers/navigation_controller.js","../../../javascript/koi/controllers/navigation_toggle_controller.js","../../../javascript/koi/controllers/pagy_nav_controller.js","../../../javascript/koi/controllers/show_hide_controller.js","../../../javascript/koi/controllers/sluggable_controller.js","../../../javascript/koi/controllers/webauthn_authentication_controller.js","../../../javascript/koi/controllers/webauthn_registration_controller.js","../../../javascript/koi/elements/toolbar.js","../../../javascript/koi/application.js"],"sourcesContent":["import { Application } from \"@hotwired/stimulus\";\n\nconst application = Application.start();\n\nexport { application };\n","const DEFAULT_DELAY = 250;\n\n/**\n * A utility class for managing CSS transition animations.\n *\n * Transition uses Javascript timers to track state instead of relying on\n * CSS transition events, which is a more complicated API. Please call `cancel`\n * when the node being animated is detached from the DOM to avoid unexpected\n * errors or animation glitches.\n *\n * Transition assumes that CSS already specifies styles to achieve the expected\n * start and end states. Transition adds temporary overrides and then animates\n * between those values using CSS transitions. For example, to use the collapse\n * transition:\n *\n * @example\n * // CSS:\n * target {\n * max-height: unset;\n * overflow: 0;\n * }\n * target.hidden {\n * max-height: 0;\n * }\n *\n * @example\n * // Javascript\n * target.addClass(\"hidden\");\n * new Transition(target).collapse().start();\n */\nclass Transition {\n constructor(target, options) {\n const { delay } = this._setDefaults(options);\n\n this.target = target;\n this.runner = new Runner(this, delay);\n this.properties = [];\n\n this.startingCallbacks = [];\n this.startedCallbacks = [];\n this.completeCallbacks = [];\n }\n\n add(property) {\n this.properties.push(property);\n return this;\n }\n\n /** Adds callback for transition events */\n addCallback(type, callback) {\n switch (type) {\n case \"starting\":\n this.startingCallbacks.push(callback);\n break;\n case \"started\":\n this.startedCallbacks.push(callback);\n break;\n case \"complete\":\n this.completeCallbacks.push(callback);\n break;\n }\n return this;\n }\n\n /** Collapse an element in place, assumes overflow is set appropriately, margin is not collapsed */\n collapse() {\n return this.add(\n new PropertyTransition(\n \"max-height\",\n `${this.target.scrollHeight}px`,\n \"0px\",\n ),\n );\n }\n\n /** Restore a collapsed element */\n expand() {\n return this.add(\n new PropertyTransition(\n \"max-height\",\n \"0px\",\n `${this.target.scrollHeight}px`,\n ),\n );\n }\n\n /** Slide an element left or right by its scroll width, assumes position relative */\n slideOut(direction) {\n return this.add(\n new PropertyTransition(direction, \"0px\", `-${this.target.scrollWidth}px`),\n );\n }\n\n /** Restore an element that has been slid */\n slideIn(direction) {\n return this.add(\n new PropertyTransition(direction, `-${this.target.scrollWidth}px`, \"0px\"),\n );\n }\n\n /** Cause an element to become transparent by transforming opacity */\n fadeOut() {\n return this.add(new PropertyTransition(\"opacity\", \"100%\", \"0%\"));\n }\n\n /** Cause a transparent element to become visible again */\n fadeIn() {\n return this.add(new PropertyTransition(\"opacity\", \"0%\", \"100%\"));\n }\n\n start(callback = null) {\n // start the runner on next tick so that any side-effects of the current execution can occur first\n requestAnimationFrame(() => {\n this.runner.start(this.target);\n if (callback) callback();\n });\n return this;\n }\n\n cancel() {\n this.runner.stop(this.target);\n return this;\n }\n\n _starting() {\n const event = new Event(\"transition:starting\");\n this.startingCallbacks.forEach((cb) => cb(event));\n this.target.dispatchEvent(event);\n }\n\n _started() {\n const event = new Event(\"transition:started\");\n this.startedCallbacks.forEach((cb) => cb(event));\n this.target.dispatchEvent(event);\n }\n\n _complete() {\n const event = new Event(\"transition:complete\");\n this.completeCallbacks.forEach((cb) => cb(event));\n this.target.dispatchEvent(event);\n }\n\n _setDefaults(options) {\n return Object.assign({ delay: DEFAULT_DELAY }, options);\n }\n}\n\n/**\n * Encapsulates internal execution and timing functionality for `Transition`\n */\nclass Runner {\n constructor(transition, delay) {\n this.transition = transition;\n this.running = null;\n this.delay = delay;\n }\n\n start(target) {\n // 1. Set the initial state(s)\n this.transition.properties.forEach((t) => t.onStarting(target));\n\n // 2. On next update, set transition and final state(s)\n requestAnimationFrame(() => this.onStarted(target));\n\n // 3. After transition has finished, clean up\n this.running = setTimeout(() => this.stop(target, true), this.delay);\n\n this.transition._starting();\n }\n\n onStarted(target) {\n target.style.transitionProperty = this.transition.properties\n .map((t) => t.property)\n .join(\",\");\n target.style.transitionDuration = `${this.delay}ms`;\n this.transition.properties.forEach((t) => t.onStarted(target));\n\n this.transition._started();\n }\n\n stop(target, timeout = false) {\n if (!this.running) return;\n if (!timeout) clearTimeout(this.running);\n\n this.running = null;\n\n target.style.removeProperty(\"transition-property\");\n target.style.removeProperty(\"transition-duration\");\n this.transition.properties.forEach((t) => t.onComplete(target));\n\n this.transition._complete();\n }\n}\n\n/**\n * Represents animation of a single CSS property. Currently only CSS animations\n * are supported, but this could be a natural extension point for Javascript\n * animations in the future.\n */\nclass PropertyTransition {\n constructor(property, from, to) {\n this.property = property;\n this.from = from;\n this.to = to;\n }\n\n onStarting(target) {\n target.style.setProperty(this.property, this.from);\n }\n\n onStarted(target) {\n target.style.setProperty(this.property, this.to);\n }\n\n onComplete(target) {\n target.style.removeProperty(this.property);\n }\n}\n\nexport { Transition };\n","import { application } from \"./application\";\n\nimport content from \"@katalyst/content\";\napplication.load(content);\n\nimport govuk from \"@katalyst/govuk-formbuilder\";\napplication.load(govuk);\n\nimport navigation from \"@katalyst/navigation\";\napplication.load(navigation);\n\nimport tables from \"@katalyst/tables\";\napplication.load(tables);\n\nimport ClipboardController from \"./clipboard_controller\";\nimport FlashController from \"./flash_controller\";\nimport FormRequestSubmitController from \"./form_request_submit_controller\";\nimport IndexActionsController from \"./index_actions_controller\";\nimport KeyboardController from \"./keyboard_controller\";\nimport ModalController from \"./modal_controller\";\nimport NavigationController from \"./navigation_controller\";\nimport NavigationToggleController from \"./navigation_toggle_controller\";\nimport PagyNavController from \"./pagy_nav_controller\";\nimport ShowHideController from \"./show_hide_controller\";\nimport SluggableController from \"./sluggable_controller\";\nimport WebauthnAuthenticationController from \"./webauthn_authentication_controller\";\nimport WebauthnRegistrationController from \"./webauthn_registration_controller\";\n\n// Third party controllers\nimport HwComboboxController from \"controllers/hw_combobox_controller\";\n\nconst Definitions = [\n {\n identifier: \"clipboard\",\n controllerConstructor: ClipboardController,\n },\n {\n identifier: \"flash\",\n controllerConstructor: FlashController,\n },\n {\n identifier: \"form-request-submit\",\n controllerConstructor: FormRequestSubmitController,\n },\n {\n identifier: \"hw-combobox\",\n controllerConstructor: HwComboboxController,\n },\n {\n identifier: \"index-actions\",\n controllerConstructor: IndexActionsController,\n },\n {\n identifier: \"keyboard\",\n controllerConstructor: KeyboardController,\n },\n {\n identifier: \"modal\",\n controllerConstructor: ModalController,\n },\n {\n identifier: \"navigation\",\n controllerConstructor: NavigationController,\n },\n {\n identifier: \"navigation-toggle\",\n controllerConstructor: NavigationToggleController,\n },\n {\n identifier: \"pagy-nav\",\n controllerConstructor: PagyNavController,\n },\n {\n identifier: \"show-hide\",\n controllerConstructor: ShowHideController,\n },\n {\n identifier: \"sluggable\",\n controllerConstructor: SluggableController,\n },\n {\n identifier: \"webauthn-authentication\",\n controllerConstructor: WebauthnAuthenticationController,\n },\n {\n identifier: \"webauthn-registration\",\n controllerConstructor: WebauthnRegistrationController,\n },\n];\n\napplication.load(Definitions);\n\n// Eager load all controllers defined in the import map under controllers/admin/**/*_controller\nimport { eagerLoadControllersFrom } from \"@hotwired/stimulus-loading\";\n\neagerLoadControllersFrom(\"admin/controllers\", application);\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class ClipboardController extends Controller {\n static targets = [\"source\"];\n\n static classes = [\"supported\"];\n\n connect() {\n if (\"clipboard\" in navigator) {\n this.element.classList.add(this.supportedClass);\n }\n }\n\n copy(event) {\n event.preventDefault();\n navigator.clipboard.writeText(this.sourceTarget.value);\n\n this.element.classList.add(\"copied\");\n setTimeout(() => {\n this.element.classList.remove(\"copied\");\n }, 2000);\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class FlashController extends Controller {\n close(e) {\n e.target.closest(\"li\").remove();\n\n // remove the flash container if there are no more flashes\n if (this.element.children.length === 0) {\n this.element.remove();\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\n/**\n A stimulus controller to request form submissions.\n This controller should be attached to a form element.\n */\nexport default class FormRequestSubmitController extends Controller {\n requestSubmit() {\n this.element.requestSubmit();\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class IndexActionsController extends Controller {\n static targets = [\"create\", \"search\", \"sort\"];\n\n initialize() {\n // debounce search\n this.update = debounce(this, this.update);\n }\n\n disconnect() {\n clearTimeout(this.timer);\n }\n\n create() {\n this.createTarget.click();\n }\n\n search() {\n this.searchTarget.focus();\n }\n\n clear() {\n this.searchTarget.value = \"\";\n this.searchTarget.closest(\"form\").requestSubmit();\n }\n\n update() {\n this.searchTarget.closest(\"form\").requestSubmit();\n }\n\n submit() {\n const shouldFocus = document.activeElement === this.searchTarget;\n\n if (this.searchTarget.value === \"\") {\n this.searchTarget.disabled = true;\n }\n if (this.sortTarget.value === \"\") {\n this.sortTarget.disabled = true;\n }\n\n // restore state and focus after submit\n Promise.resolve().then(() => {\n this.searchTarget.disabled = false;\n this.sortTarget.disabled = false;\n if (shouldFocus) {\n this.searchTarget.focus();\n }\n });\n }\n}\n\nfunction debounce(self, f) {\n return (...args) => {\n clearTimeout(self.timer);\n self.timer = setTimeout(() => {\n f.apply(self, ...args);\n }, 300);\n };\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nconst DEBUG = false;\n\nexport default class KeyboardController extends Controller {\n static values = {\n mapping: String,\n depth: { type: Number, default: 2 },\n };\n\n event(cause) {\n if (isFormField(cause.target) || this.#ignore(cause)) return;\n\n const key = this.describeEvent(cause);\n\n this.buffer = [...(this.buffer || []), key].slice(0 - this.depthValue);\n\n if (DEBUG) console.debug(\"[keyboard] buffer:\", ...this.buffer);\n\n // test whether the tail of the buffer matches any of the configured chords\n const action = this.buffer.reduceRight((mapping, key) => {\n if (typeof mapping === \"string\" || typeof mapping === \"undefined\") {\n return mapping;\n } else {\n return mapping[key];\n }\n }, this.mappings);\n\n // if we don't have a string we may have a miss or an incomplete chord\n if (typeof action !== \"string\") return;\n\n // clear the buffer and prevent the key from being consumed elsewhere\n this.buffer = [];\n cause.preventDefault();\n\n if (DEBUG) console.debug(\"[keyboard] event: %s\", action);\n\n // fire the configured event\n const event = new CustomEvent(action, {\n detail: { cause: cause },\n bubbles: true,\n });\n cause.target.dispatchEvent(event);\n }\n\n /**\n * @param event KeyboardEvent input event to describe\n * @return String description of keyboard event, e.g. 'C-KeyV' (CTRL+V)\n */\n describeEvent(event) {\n return [\n event.ctrlKey && \"C\",\n event.metaKey && \"M\",\n event.altKey && \"A\",\n event.shiftKey && \"S\",\n event.code,\n ]\n .filter((w) => w)\n .join(\"-\");\n }\n\n /**\n * Build a tree for efficiently looking up key chords, where the last key in the sequence\n * is the first key in tree.\n */\n get mappings() {\n const inputs = this.mappingValue\n .replaceAll(/\\s+/g, \" \")\n .split(\" \")\n .filter((f) => f.length > 0);\n const mappings = {};\n\n inputs.forEach((mapping) => this.#parse(mappings, mapping));\n\n // memoize the result\n Object.defineProperty(this, \"mappings\", {\n value: mappings,\n writable: false,\n });\n\n return mappings;\n }\n\n /**\n * Parse a key chord pattern and an event and store it in the inverted tree lookup structure.\n *\n * @param mappings inverted tree lookup for key chords\n * @param mapping input definition, e.g. \"C-KeyC+C-KeyV->paste\"\n */\n #parse(mappings, mapping) {\n const [pattern, event] = mapping.split(\"->\");\n const keys = pattern.split(\"+\");\n const first = keys.shift();\n\n mappings = keys.reduceRight(\n (mappings, key) => (mappings[key] ||= {}),\n mappings,\n );\n mappings[first] = event;\n }\n\n /**\n * Ignore modifier keys, as they will be captured in normal key presses.\n *\n * @param event KeyboardEvent\n * @returns {boolean} true if key event should be ignored\n */\n #ignore(event) {\n switch (event.code) {\n case \"ControlLeft\":\n case \"ControlRight\":\n case \"MetaLeft\":\n case \"MetaRight\":\n case \"ShiftLeft\":\n case \"ShiftRight\":\n case \"AltLeft\":\n case \"AltRight\":\n return true;\n default:\n return false;\n }\n }\n}\n\n/**\n * Detect input nodes where we should not listen for events.\n *\n * Credit: github.com\n */\nfunction isFormField(element) {\n if (!(element instanceof HTMLElement)) {\n return false;\n }\n\n const name = element.nodeName.toLowerCase();\n const type = (element.getAttribute(\"type\") || \"\").toLowerCase();\n return (\n name === \"select\" ||\n name === \"textarea\" ||\n name === \"trix-editor\" ||\n (name === \"input\" &&\n type !== \"submit\" &&\n type !== \"reset\" &&\n type !== \"checkbox\" &&\n type !== \"radio\" &&\n type !== \"file\") ||\n element.isContentEditable\n );\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class ModalController extends Controller {\n static targets = [\"dialog\"];\n\n connect() {\n this.element.addEventListener(\"turbo:submit-end\", this.onSubmit);\n }\n\n disconnect() {\n this.element.removeEventListener(\"turbo:submit-end\", this.onSubmit);\n }\n\n outside(e) {\n if (e.target.tagName === \"DIALOG\") this.dismiss();\n }\n\n dismiss() {\n if (!this.dialogTarget) return;\n if (!this.dialogTarget.open) this.dialogTarget.close();\n\n this.element.removeAttribute(\"src\");\n this.dialogTarget.remove();\n }\n\n dialogTargetConnected(dialog) {\n dialog.showModal();\n }\n\n onSubmit = (event) => {\n if (\n event.detail.success &&\n \"closeDialog\" in event.detail.formSubmission?.submitter?.dataset\n ) {\n this.dialogTarget.close();\n this.element.removeAttribute(\"src\");\n this.dialogTarget.remove();\n }\n };\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class NavigationController extends Controller {\n static targets = [\"filter\"];\n\n filter() {\n const filter = this.filterTarget.value;\n this.clearFilter(filter);\n\n if (filter.length > 0) {\n this.applyFilter(filter);\n }\n }\n\n go() {\n this.element.querySelector(\"li:not([hidden]) > a\").click();\n }\n\n clear() {\n if (this.filterTarget.value.length === 0) this.filterTarget.blur();\n }\n\n applyFilter(filter) {\n // hide items that don't match the search filter\n this.links\n .filter(\n (li) =>\n !this.prefixSearch(filter.toLowerCase(), li.innerText.toLowerCase()),\n )\n .forEach((li) => {\n li.toggleAttribute(\"hidden\", true);\n });\n\n this.menus\n .filter((li) => !li.matches(\"li:has(li:not([hidden]) > a)\"))\n .forEach((li) => {\n li.toggleAttribute(\"hidden\", true);\n });\n }\n\n clearFilter(filter) {\n this.element.querySelectorAll(\"li\").forEach((li) => {\n li.toggleAttribute(\"hidden\", false);\n });\n }\n\n prefixSearch(needle, haystack) {\n const haystackLength = haystack.length;\n const needleLength = needle.length;\n if (needleLength > haystackLength) {\n return false;\n }\n if (needleLength === haystackLength) {\n return needle === haystack;\n }\n outer: for (let i = 0, j = 0; i < needleLength; i++) {\n const needleChar = needle.charCodeAt(i);\n if (needleChar === 32) {\n // skip ahead to next space in the haystack\n while (j < haystackLength && haystack.charCodeAt(j++) !== 32) {}\n continue;\n }\n while (j < haystackLength) {\n if (haystack.charCodeAt(j++) === needleChar) continue outer;\n // skip ahead to the next space in the haystack\n while (j < haystackLength && haystack.charCodeAt(j++) !== 32) {}\n }\n return false;\n }\n return true;\n }\n\n toggle() {\n this.element.open ? this.close() : this.open();\n }\n\n open() {\n if (!this.element.open) this.element.showModal();\n }\n\n close() {\n if (this.element.open) this.element.close();\n }\n\n click(e) {\n if (e.target === this.element) this.close();\n }\n\n onMorphAttribute = (e) => {\n if (e.target !== this.element) return;\n\n switch (e.detail.attributeName) {\n case \"open\":\n e.preventDefault();\n }\n };\n\n get links() {\n return Array.from(this.element.querySelectorAll(\"li:has(> a)\"));\n }\n\n get menus() {\n return Array.from(this.element.querySelectorAll(\"li:has(> ul)\"));\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class NavigationToggleController extends Controller {\n trigger() {\n this.dispatch(\"toggle\", { prefix: \"navigation\", bubbles: true });\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class PagyNavController extends Controller {\n connect() {\n document.addEventListener(\"shortcut:page-prev\", this.prevPage);\n document.addEventListener(\"shortcut:page-next\", this.nextPage);\n }\n\n disconnect() {\n document.removeEventListener(\"shortcut:page-prev\", this.prevPage);\n document.removeEventListener(\"shortcut:page-next\", this.nextPage);\n }\n\n nextPage = () => {\n this.element.querySelector(\"a:last-child\").click();\n };\n\n prevPage = () => {\n this.element.querySelector(\"a:first-child\").click();\n };\n}\n","import { Controller } from \"@hotwired/stimulus\";\nimport { Transition } from \"../utils/transition\";\n\nexport default class ShowHideController extends Controller {\n static targets = [\"content\"];\n\n toggle() {\n const element = this.contentTarget;\n const hide = element.toggleAttribute(\"data-collapsed\");\n\n // cancel previous animation, if any\n if (this.transition) this.transition.cancel();\n\n const transition = (this.transition = new Transition(element)\n .addCallback(\"starting\", function () {\n element.setAttribute(\"data-collapsed-transitioning\", \"true\");\n })\n .addCallback(\"complete\", function () {\n element.removeAttribute(\"data-collapsed-transitioning\");\n }));\n hide ? transition.collapse() : transition.expand();\n\n transition.start();\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\n/**\n * Connect an input (e.g. title) to slug.\n */\nexport default class SluggableController extends Controller {\n static targets = [\"source\", \"slug\"];\n static values = {\n slug: String,\n };\n\n sourceChanged(e) {\n if (this.slugValue === \"\") {\n this.slugTarget.value = parameterize(this.sourceTarget.value);\n }\n }\n\n slugChanged(e) {\n this.slugValue = this.slugTarget.value;\n }\n}\n\nfunction parameterize(input) {\n return input\n .toLowerCase()\n .replace(/'/g, \"-\")\n .replace(/[^-\\w\\s]/g, \"\")\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/(^-|-$)/g, \"\");\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nimport {\n get,\n parseRequestOptionsFromJSON,\n} from \"@github/webauthn-json/browser-ponyfill\";\n\nexport default class WebauthnAuthenticationController extends Controller {\n static targets = [\"response\"];\n static values = { options: Object };\n\n authenticate() {\n get(this.options).then((response) => {\n this.responseTarget.value = JSON.stringify(response);\n\n this.element.requestSubmit();\n });\n }\n\n get options() {\n return parseRequestOptionsFromJSON(this.optionsValue);\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nimport {\n create,\n parseCreationOptionsFromJSON,\n} from \"@github/webauthn-json/browser-ponyfill\";\n\nexport default class WebauthnRegistrationController extends Controller {\n static values = {\n options: Object,\n response: String,\n };\n static targets = [\"intro\", \"nickname\", \"response\"];\n\n submit(e) {\n if (\n this.responseTarget.value === \"\" &&\n e.submitter.formMethod !== \"dialog\"\n ) {\n e.preventDefault();\n this.createCredential();\n }\n }\n\n async createCredential() {\n const response = await create(this.options);\n\n this.responseValue = JSON.stringify(response);\n this.responseTarget.value = JSON.stringify(response);\n }\n\n responseValueChanged(response) {\n const responsePresent = response !== \"\";\n this.introTarget.toggleAttribute(\"hidden\", responsePresent);\n this.nicknameTarget.toggleAttribute(\"hidden\", !responsePresent);\n }\n\n get options() {\n return parseCreationOptionsFromJSON(this.optionsValue);\n }\n}\n","class KoiToolbarElement extends HTMLElement {\n constructor() {\n super();\n\n this.setAttribute(\"role\", \"toolbar\");\n }\n}\n\ncustomElements.define(\"koi-toolbar\", KoiToolbarElement);\n","import \"@hotwired/turbo-rails\";\nimport { initAll } from \"@katalyst/govuk-formbuilder\";\nimport \"@rails/actiontext\";\nimport \"trix\";\n\nimport \"./controllers\";\nimport \"./elements\";\n\n/** Let GOVUK know that we've got JS enabled */\nwindow.addEventListener(\"turbo:load\", () => {\n document.body.classList.toggle(\"js-enabled\", true);\n document.body.classList.toggle(\n \"govuk-frontend-supported\",\n \"noModule\" in HTMLScriptElement.prototype,\n );\n initAll();\n});\n"],"names":["application","Application","start","Transition","constructor","target","options","delay","this","_setDefaults","runner","Runner","properties","startingCallbacks","startedCallbacks","completeCallbacks","add","property","push","addCallback","type","callback","collapse","PropertyTransition","scrollHeight","expand","slideOut","direction","scrollWidth","slideIn","fadeOut","fadeIn","requestAnimationFrame","cancel","stop","_starting","event","Event","forEach","cb","dispatchEvent","_started","_complete","Object","assign","transition","running","t","onStarting","onStarted","setTimeout","style","transitionProperty","map","join","transitionDuration","timeout","clearTimeout","removeProperty","onComplete","from","to","setProperty","load","content","govuk","navigation","tables","Definitions","identifier","controllerConstructor","Controller","static","connect","navigator","element","classList","supportedClass","copy","preventDefault","clipboard","writeText","sourceTarget","value","remove","close","e","closest","children","length","requestSubmit","HwComboboxController","initialize","self","f","update","args","timer","apply","disconnect","create","createTarget","click","search","searchTarget","focus","clear","submit","shouldFocus","document","activeElement","disabled","sortTarget","Promise","resolve","then","mapping","String","depth","Number","default","cause","HTMLElement","name","nodeName","toLowerCase","getAttribute","isContentEditable","isFormField","ignore","key","describeEvent","buffer","slice","depthValue","action","reduceRight","mappings","CustomEvent","detail","bubbles","ctrlKey","metaKey","altKey","shiftKey","code","filter","w","inputs","mappingValue","replaceAll","split","parse","defineProperty","writable","pattern","keys","first","shift","addEventListener","onSubmit","removeEventListener","outside","tagName","dismiss","dialogTarget","open","removeAttribute","dialogTargetConnected","dialog","showModal","success","formSubmission","submitter","dataset","filterTarget","clearFilter","applyFilter","go","querySelector","blur","links","li","prefixSearch","innerText","toggleAttribute","menus","matches","querySelectorAll","needle","haystack","haystackLength","needleLength","outer","i","j","needleChar","charCodeAt","toggle","onMorphAttribute","attributeName","Array","trigger","dispatch","prefix","prevPage","nextPage","contentTarget","hide","setAttribute","slug","sourceChanged","slugValue","slugTarget","replace","slugChanged","authenticate","get","response","responseTarget","JSON","stringify","parseRequestOptionsFromJSON","optionsValue","formMethod","createCredential","responseValue","responseValueChanged","responsePresent","introTarget","nicknameTarget","parseCreationOptionsFromJSON","eagerLoadControllersFrom","KoiToolbarElement","super","customElements","define","window","body","HTMLScriptElement","prototype","initAll"],"mappings":"wiBAEA,MAAMA,EAAcC,EAAYC,QC4BhC,MAAMC,EACJ,WAAAC,CAAYC,EAAQC,GAClB,MAAMC,MAAEA,GAAUC,KAAKC,aAAaH,GAEpCE,KAAKH,OAASA,EACdG,KAAKE,OAAS,IAAIC,EAAOH,KAAMD,GAC/BC,KAAKI,WAAa,GAElBJ,KAAKK,kBAAoB,GACzBL,KAAKM,iBAAmB,GACxBN,KAAKO,kBAAoB,EAC7B,CAEE,GAAAC,CAAIC,GAEF,OADAT,KAAKI,WAAWM,KAAKD,GACdT,IACX,CAGE,WAAAW,CAAY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,KAAKC,UAAUH,GAE3ClN,KAAKmE,QAAQe,iBAEnB,CAEE,WAAIpF,GACF,OAAOwN,EAA4BtN,KAAKuN,aAC5C,IZ+DE,CACE1J,WAAY,wBACZC,sBa/EW,cAA6CC,EAC1DC,cAAgB,CACdlE,QAASqC,OACT+K,SAAUrG,QAEZ7C,eAAiB,CAAC,QAAS,WAAY,YAEvC,MAAAmC,CAAOrB,GAE2B,KAA9B9E,KAAKmN,eAAexI,OACO,WAA3BG,EAAEuF,UAAUmD,aAEZ1I,EAAEP,iBACFvE,KAAKyN,mBAEX,CAEE,sBAAMA,GACJ,MAAMP,QAAiBtH,EAAO5F,KAAKF,SAEnCE,KAAK0N,cAAgBN,KAAKC,UAAUH,GACpClN,KAAKmN,eAAexI,MAAQyI,KAAKC,UAAUH,EAC/C,CAEE,oBAAAS,CAAqBT,GACnB,MAAMU,EAA+B,KAAbV,EACxBlN,KAAK6N,YAAY5C,gBAAgB,SAAU2C,GAC3C5N,KAAK8N,eAAe7C,gBAAgB,UAAW2C,EACnD,CAEE,WAAI9N,GACF,OAAOiO,EAA6B/N,KAAKuN,aAC7C,KbmDA/N,EAAY+D,KAAKK,GAKjBoK,EAAyB,oBAAqBxO,Gc/F9C,MAAMyO,UAA0B/G,YAC9B,WAAAtH,GACEsO,QAEAlO,KAAKyM,aAAa,OAAQ,UAC9B,EAGA0B,eAAeC,OAAO,cAAeH,GCCrCI,OAAO9E,iBAAiB,aAAc,KACpClD,SAASiI,KAAKlK,UAAU0H,OAAO,cAAc,GAC7CzF,SAASiI,KAAKlK,UAAU0H,OACtB,2BACA,aAAcyC,kBAAkBC,WAElCC"}
@@ -3,13 +3,19 @@
3
3
  class WellKnownsController < ApplicationController
4
4
  before_action :set_well_known
5
5
 
6
+ attr_reader :well_known
7
+
6
8
  def show
7
- render renderable: @well_known
9
+ if well_known.present?
10
+ render renderable: @well_known
11
+ else
12
+ head :not_found
13
+ end
8
14
  end
9
15
 
10
16
  private
11
17
 
12
18
  def set_well_known
13
- @well_known = WellKnown.find_by!(name: params[:name])
19
+ @well_known = WellKnown.find_by(name: params[:name])
14
20
  end
15
21
  end
@@ -26,6 +26,9 @@ import SluggableController from "./sluggable_controller";
26
26
  import WebauthnAuthenticationController from "./webauthn_authentication_controller";
27
27
  import WebauthnRegistrationController from "./webauthn_registration_controller";
28
28
 
29
+ // Third party controllers
30
+ import HwComboboxController from "controllers/hw_combobox_controller";
31
+
29
32
  const Definitions = [
30
33
  {
31
34
  identifier: "clipboard",
@@ -39,6 +42,10 @@ const Definitions = [
39
42
  identifier: "form-request-submit",
40
43
  controllerConstructor: FormRequestSubmitController,
41
44
  },
45
+ {
46
+ identifier: "hw-combobox",
47
+ controllerConstructor: HwComboboxController,
48
+ },
42
49
  {
43
50
  identifier: "index-actions",
44
51
  controllerConstructor: IndexActionsController,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-koi
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.beta.2
4
+ version: 5.0.0.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive