katalyst-koi 5.7.1 → 5.8.0
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 +4 -4
- data/app/assets/builds/katalyst/koi.esm.js +45 -6
- data/app/assets/builds/katalyst/koi.js +45 -6
- data/app/assets/builds/katalyst/koi.min.js +1 -1
- data/app/assets/builds/katalyst/koi.min.js.map +1 -1
- data/app/assets/stylesheets/koi/forms/checkboxes.css +2 -2
- data/app/assets/stylesheets/koi/forms/combobox.css +2 -2
- data/app/assets/stylesheets/koi/forms/index.css +2 -0
- data/app/assets/stylesheets/koi/forms/input.css +9 -11
- data/app/assets/stylesheets/koi/forms/lexxy.css +53 -0
- data/app/assets/stylesheets/koi/forms/radios.css +2 -2
- data/app/assets/stylesheets/koi/forms/textarea.css +1 -1
- data/app/assets/stylesheets/koi/forms/trix.css +30 -6
- data/app/assets/stylesheets/koi/index.css +1 -0
- data/app/controllers/admin/active_storage/direct_uploads_controller.rb +9 -0
- data/app/controllers/admin/background_jobs_controller.rb +68 -0
- data/app/controllers/admin/feature_flags_controller.rb +67 -0
- data/app/controllers/admin/recurring_tasks_controller.rb +67 -0
- data/app/helpers/admin/background_jobs_helper.rb +15 -0
- data/app/helpers/koi/tags/trix_toolbar.rb +64 -0
- data/app/javascript/koi/application.js +4 -1
- data/app/javascript/koi/utils/lexxy.js +23 -0
- data/app/javascript/koi/utils/trix.js +17 -0
- data/app/models/background_job.rb +98 -0
- data/app/models/feature_flag.rb +128 -0
- data/app/models/recurring_task.rb +31 -0
- data/app/views/admin/background_jobs/_navigation.html.erb +8 -0
- data/app/views/admin/background_jobs/blocked.html.erb +17 -0
- data/app/views/admin/background_jobs/completed.html.erb +17 -0
- data/app/views/admin/background_jobs/failed.html.erb +26 -0
- data/app/views/admin/background_jobs/in_progress.html.erb +17 -0
- data/app/views/admin/background_jobs/index.html.erb +22 -0
- data/app/views/admin/background_jobs/scheduled.html.erb +17 -0
- data/app/views/admin/background_jobs/show.html.erb +41 -0
- data/app/views/admin/feature_flags/index.html.erb +14 -0
- data/app/views/admin/feature_flags/new.html.erb +14 -0
- data/app/views/admin/feature_flags/show.html.erb +30 -0
- data/app/views/admin/recurring_tasks/index.html.erb +20 -0
- data/app/views/admin/recurring_tasks/show.html.erb +33 -0
- data/app/views/layouts/action_text/contents/_content.html.erb +3 -0
- data/config/ci.rb +10 -0
- data/config/importmap.rb +6 -4
- data/config/routes.rb +32 -0
- data/lib/generators/koi/admin_route/templates/initializer.rb.tt +4 -3
- data/lib/koi/action_text.rb +112 -0
- data/lib/koi/config.rb +3 -1
- data/lib/koi/engine.rb +23 -0
- data/lib/koi/form/builder.rb +27 -8
- data/lib/koi/menu.rb +4 -0
- data/lib/koi.rb +12 -6
- metadata +52 -5
- data/lib/koi/form/content.rb +0 -55
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 50571f4d38bdd5a392f56f658c1b2cb4ae11309f0abc141395df929c36f3cfe8
|
|
4
|
+
data.tar.gz: 7d6bbd00b17826a2a62b60a8afc5eb6d50942caad2655ea9ac10d7dcc527b931
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4a95cff03cecdf6e7a16f3ac9222340c099878637644202783f7853f0cc13b129597b4005570f1eb60f662b6ad11645d9e94d78f57811deb25b2523f2ff1ea4
|
|
7
|
+
data.tar.gz: 23960b0dc20345ac729c2d4014fd7d11c032875f0e42a6c8f3fdb8e49b6d1c825d1f95b838714c93866bd61335e7dab531d1503057595cc433444894bf85015c
|
|
@@ -1,13 +1,48 @@
|
|
|
1
1
|
import '@hotwired/turbo-rails';
|
|
2
2
|
import govuk, { initAll } from '@katalyst/govuk-formbuilder';
|
|
3
3
|
import '@rails/actiontext';
|
|
4
|
+
import * as Lexxy from 'lexxy';
|
|
4
5
|
import 'trix';
|
|
5
6
|
import { Application, Controller } from '@hotwired/stimulus';
|
|
6
7
|
import content from '@katalyst/content';
|
|
7
8
|
import navigation from '@katalyst/navigation';
|
|
8
9
|
import tables from '@katalyst/tables';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Lexxy.configure({
|
|
12
|
+
global: {
|
|
13
|
+
authenticatedUploads: true,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// The link toolbar's URL input is type=url, whose checkValidity() rejects
|
|
18
|
+
// schemeless values like #anchor and /relative that lexxy's link node happily
|
|
19
|
+
// preserves. Switch it to type=text with the same pattern Koi applies to the
|
|
20
|
+
// trix link dialog (see Koi::Tags::TrixToolbar::TRIX_DIALOGS_TEMPLATE) so both
|
|
21
|
+
// editors validate link input identically.
|
|
22
|
+
document.addEventListener("lexxy:initialize", ({ target }) => {
|
|
23
|
+
target
|
|
24
|
+
.querySelectorAll("lexxy-link-dropdown input[type=url]")
|
|
25
|
+
.forEach((input) => {
|
|
26
|
+
input.type = "text";
|
|
27
|
+
input.pattern = "(https?|mailto:|tel:|/|#).*?";
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Trix does not provide an export
|
|
32
|
+
const Trix = window.Trix;
|
|
33
|
+
|
|
34
|
+
// Koi uses H4 for headings instead of H1
|
|
35
|
+
Trix.config.blockAttributes["heading4"] = {
|
|
36
|
+
tagName: "h4",
|
|
37
|
+
terminal: true,
|
|
38
|
+
breakOnReturn: true,
|
|
39
|
+
group: false,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Remove H1 from trix list of acceptable tags
|
|
43
|
+
delete Trix.config.blockAttributes.heading1;
|
|
44
|
+
|
|
45
|
+
const application$1 = Application.start();
|
|
11
46
|
|
|
12
47
|
class ClipboardController extends Controller {
|
|
13
48
|
static targets = ["source"];
|
|
@@ -434,10 +469,10 @@ class WebauthnRegistrationController extends Controller {
|
|
|
434
469
|
}
|
|
435
470
|
}
|
|
436
471
|
|
|
437
|
-
application.load(content);
|
|
438
|
-
application.load(govuk);
|
|
439
|
-
application.load(navigation);
|
|
440
|
-
application.load(tables);
|
|
472
|
+
application$1.load(content);
|
|
473
|
+
application$1.load(govuk);
|
|
474
|
+
application$1.load(navigation);
|
|
475
|
+
application$1.load(tables);
|
|
441
476
|
|
|
442
477
|
const Definitions = [
|
|
443
478
|
{
|
|
@@ -492,7 +527,7 @@ await import('controllers/hw_combobox_controller')
|
|
|
492
527
|
})
|
|
493
528
|
.catch(() => null);
|
|
494
529
|
|
|
495
|
-
application.load(Definitions);
|
|
530
|
+
application$1.load(Definitions);
|
|
496
531
|
|
|
497
532
|
class KoiToolbarElement extends HTMLElement {
|
|
498
533
|
constructor() {
|
|
@@ -516,3 +551,7 @@ function initGOVUK() {
|
|
|
516
551
|
|
|
517
552
|
window.addEventListener("turbo:load", initGOVUK);
|
|
518
553
|
if (window.Turbo) initGOVUK();
|
|
554
|
+
|
|
555
|
+
var application = { Lexxy, Trix };
|
|
556
|
+
|
|
557
|
+
export { application as default };
|
|
@@ -1,13 +1,48 @@
|
|
|
1
1
|
import '@hotwired/turbo-rails';
|
|
2
2
|
import govuk, { initAll } from '@katalyst/govuk-formbuilder';
|
|
3
3
|
import '@rails/actiontext';
|
|
4
|
+
import * as Lexxy from 'lexxy';
|
|
4
5
|
import 'trix';
|
|
5
6
|
import { Application, Controller } from '@hotwired/stimulus';
|
|
6
7
|
import content from '@katalyst/content';
|
|
7
8
|
import navigation from '@katalyst/navigation';
|
|
8
9
|
import tables from '@katalyst/tables';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Lexxy.configure({
|
|
12
|
+
global: {
|
|
13
|
+
authenticatedUploads: true,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// The link toolbar's URL input is type=url, whose checkValidity() rejects
|
|
18
|
+
// schemeless values like #anchor and /relative that lexxy's link node happily
|
|
19
|
+
// preserves. Switch it to type=text with the same pattern Koi applies to the
|
|
20
|
+
// trix link dialog (see Koi::Tags::TrixToolbar::TRIX_DIALOGS_TEMPLATE) so both
|
|
21
|
+
// editors validate link input identically.
|
|
22
|
+
document.addEventListener("lexxy:initialize", ({ target }) => {
|
|
23
|
+
target
|
|
24
|
+
.querySelectorAll("lexxy-link-dropdown input[type=url]")
|
|
25
|
+
.forEach((input) => {
|
|
26
|
+
input.type = "text";
|
|
27
|
+
input.pattern = "(https?|mailto:|tel:|/|#).*?";
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Trix does not provide an export
|
|
32
|
+
const Trix = window.Trix;
|
|
33
|
+
|
|
34
|
+
// Koi uses H4 for headings instead of H1
|
|
35
|
+
Trix.config.blockAttributes["heading4"] = {
|
|
36
|
+
tagName: "h4",
|
|
37
|
+
terminal: true,
|
|
38
|
+
breakOnReturn: true,
|
|
39
|
+
group: false,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Remove H1 from trix list of acceptable tags
|
|
43
|
+
delete Trix.config.blockAttributes.heading1;
|
|
44
|
+
|
|
45
|
+
const application$1 = Application.start();
|
|
11
46
|
|
|
12
47
|
class ClipboardController extends Controller {
|
|
13
48
|
static targets = ["source"];
|
|
@@ -434,10 +469,10 @@ class WebauthnRegistrationController extends Controller {
|
|
|
434
469
|
}
|
|
435
470
|
}
|
|
436
471
|
|
|
437
|
-
application.load(content);
|
|
438
|
-
application.load(govuk);
|
|
439
|
-
application.load(navigation);
|
|
440
|
-
application.load(tables);
|
|
472
|
+
application$1.load(content);
|
|
473
|
+
application$1.load(govuk);
|
|
474
|
+
application$1.load(navigation);
|
|
475
|
+
application$1.load(tables);
|
|
441
476
|
|
|
442
477
|
const Definitions = [
|
|
443
478
|
{
|
|
@@ -492,7 +527,7 @@ await import('controllers/hw_combobox_controller')
|
|
|
492
527
|
})
|
|
493
528
|
.catch(() => null);
|
|
494
529
|
|
|
495
|
-
application.load(Definitions);
|
|
530
|
+
application$1.load(Definitions);
|
|
496
531
|
|
|
497
532
|
class KoiToolbarElement extends HTMLElement {
|
|
498
533
|
constructor() {
|
|
@@ -516,3 +551,7 @@ function initGOVUK() {
|
|
|
516
551
|
|
|
517
552
|
window.addEventListener("turbo:load", initGOVUK);
|
|
518
553
|
if (window.Turbo) initGOVUK();
|
|
554
|
+
|
|
555
|
+
var application = { Lexxy, Trix };
|
|
556
|
+
|
|
557
|
+
export { application as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"@hotwired/turbo-rails";import e,{initAll as t}from"@katalyst/govuk-formbuilder";import"@rails/actiontext";import"trix";import{Application as
|
|
1
|
+
import"@hotwired/turbo-rails";import e,{initAll as t}from"@katalyst/govuk-formbuilder";import"@rails/actiontext";import*as i from"lexxy";import"trix";import{Application as r,Controller as s}from"@hotwired/stimulus";import o from"@katalyst/content";import n from"@katalyst/navigation";import a from"@katalyst/tables";i.configure({global:{authenticatedUploads:!0}}),document.addEventListener("lexxy:initialize",({target:e})=>{e.querySelectorAll("lexxy-link-dropdown input[type=url]").forEach(e=>{e.type="text",e.pattern="(https?|mailto:|tel:|/|#).*?"})});const l=window.Trix;l.config.blockAttributes.heading4={tagName:"h4",terminal:!0,breakOnReturn:!0,group:!1},delete l.config.blockAttributes.heading1;const c=r.start();c.load(o),c.load(e),c.load(n),c.load(a);const u=[{identifier:"clipboard",controllerConstructor:class extends s{static targets=["source"];static classes=["supported"];connect(){"clipboard"in navigator&&this.element.classList.add(this.supportedClass)}copy(e){e.preventDefault(),navigator.clipboard.writeText(this.sourceTarget.value),this.element.classList.add("copied"),setTimeout(()=>{this.element.classList.remove("copied")},2e3)}}},{identifier:"flash",controllerConstructor:class extends s{close(e){e.target.closest("li").remove(),0===this.element.children.length&&this.element.remove()}}},{identifier:"keyboard",controllerConstructor:class extends s{static values={mapping:String,depth:{type:Number,default:2}};event(e){if(function(e){if(!(e instanceof HTMLElement))return!1;const t=e.nodeName.toLowerCase(),i=(e.getAttribute("type")||"").toLowerCase();return"select"===t||"textarea"===t||"trix-editor"===t||"input"===t&&"submit"!==i&&"reset"!==i&&"checkbox"!==i&&"radio"!==i&&"file"!==i||e.isContentEditable}(e.target)||this.#e(e))return;const t=this.describeEvent(e);this.buffer=[...this.buffer||[],t].slice(0-this.depthValue);const i=this.buffer.reduceRight((e,t)=>"string"==typeof e||void 0===e?e:e[t],this.mappings);if("string"!=typeof i)return;this.buffer=[],e.preventDefault();const r=new CustomEvent(i,{detail:{cause:e},bubbles:!0});e.target.dispatchEvent(r)}describeEvent(e){return[e.ctrlKey&&"C",e.metaKey&&"M",e.altKey&&"A",e.shiftKey&&"S",e.code].filter(e=>e).join("-")}get mappings(){const e=this.mappingValue.replaceAll(/\s+/g," ").split(" ").filter(e=>e.length>0),t={};return e.forEach(e=>this.#t(t,e)),Object.defineProperty(this,"mappings",{value:t,writable:!1}),t}#t(e,t){const[i,r]=t.split("->"),s=i.split("+"),o=s.shift();(e=s.reduceRight((e,t)=>e[t]||={},e))[o]=r}#e(e){switch(e.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 s{static targets=["dialog"];connect(){this.element.addEventListener("turbo:submit-end",this.onSubmit)}disconnect(){this.element.removeEventListener("turbo:submit-end",this.onSubmit)}outside(e){"DIALOG"===e.target.tagName&&this.dismiss()}dismiss(){this.dialogTarget&&(this.dialogTarget.open||this.dialogTarget.close(),this.element.removeAttribute("src"),this.dialogTarget.remove())}dialogTargetConnected(e){e.showModal()}onSubmit=e=>{e.detail.success&&"closeDialog"in e.detail.formSubmission?.submitter?.dataset&&(this.dialogTarget.close(),this.element.removeAttribute("src"),this.dialogTarget.remove())}}},{identifier:"navigation",controllerConstructor:class extends s{static targets=["filter"];filter(){const e=this.filterTarget.value;this.clearFilter(e),e.length>0&&this.applyFilter(e)}go(){this.element.querySelector("li:not([hidden]) > a").click()}clear(){0===this.filterTarget.value.length&&this.filterTarget.blur()}applyFilter(e){this.links.filter(t=>!this.prefixSearch(e.toLowerCase(),t.innerText.toLowerCase())).forEach(e=>{e.toggleAttribute("hidden",!0)}),this.menus.filter(e=>!e.matches("li:has(li:not([hidden]) > a)")).forEach(e=>{e.toggleAttribute("hidden",!0)})}clearFilter(e){this.element.querySelectorAll("li").forEach(e=>{e.toggleAttribute("hidden",!1)})}prefixSearch(e,t){const i=t.length,r=e.length;if(r>i)return!1;if(r===i)return e===t;e:for(let s=0,o=0;s<r;s++){const r=e.charCodeAt(s);if(32!==r){for(;o<i;){if(t.charCodeAt(o++)===r)continue e;for(;o<i&&32!==t.charCodeAt(o++););}return!1}for(;o<i&&32!==t.charCodeAt(o++););}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(e){e.target===this.element&&this.close()}onMorphAttribute=e=>{if(e.target===this.element&&"open"===e.detail.attributeName)e.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 s{trigger(){this.dispatch("toggle",{prefix:"navigation",bubbles:!0})}}},{identifier:"pagy-nav",controllerConstructor:class extends s{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:"sluggable",controllerConstructor:class extends s{static targets=["source","slug"];static values={slug:String};sourceChanged(e){""===this.slugValue&&(this.slugTarget.value=this.sourceTarget.value.toLowerCase().replace(/'/g,"-").replace(/[^-\w\s]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""))}slugChanged(e){this.slugValue=this.slugTarget.value}}},{identifier:"webauthn-authentication",controllerConstructor:class extends s{static targets=["response"];static values={options:Object};async authenticate(){const e=await navigator.credentials.get(this.options);this.responseTarget.value=JSON.stringify(e.toJSON()),this.element.requestSubmit()}get options(){return{publicKey:PublicKeyCredential.parseRequestOptionsFromJSON(this.optionsValue)}}}},{identifier:"webauthn-registration",controllerConstructor:class extends s{static targets=["response"];static values={options:Object};submit(e){this.responseTarget.value||(e.preventDefault(),this.createCredential().then(()=>{e.target.submit()}))}async createCredential(){const e=await navigator.credentials.create(this.options);this.responseTarget.value=JSON.stringify(e.toJSON())}get options(){return{publicKey:PublicKeyCredential.parseCreationOptionsFromJSON(this.optionsValue)}}}}];await import("controllers/hw_combobox_controller").then(({default:e})=>{u.push({identifier:"hw-combobox",controllerConstructor:e})}).catch(()=>null),c.load(u);class h extends HTMLElement{constructor(){super(),this.setAttribute("role","toolbar")}}function d(){document.body.classList.toggle("js-enabled",!0),document.body.classList.toggle("govuk-frontend-supported","noModule"in HTMLScriptElement.prototype),t()}customElements.define("koi-toolbar",h),window.addEventListener("turbo:load",d),window.Turbo&&d();var g={Lexxy:i,Trix:l};export{g as default};
|
|
2
2
|
//# sourceMappingURL=koi.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koi.min.js","sources":["../../../javascript/koi/controllers/application.js","../../../javascript/koi/controllers/index.js","../../../javascript/koi/controllers/clipboard_controller.js","../../../javascript/koi/controllers/flash_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/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","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 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 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: \"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: \"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\n// dynamically attempt to load hw_combobox_controller, this is an optional dependency\nawait import(\"controllers/hw_combobox_controller\")\n .then(({ default: HwComboboxController }) => {\n Definitions.push({\n identifier: \"hw-combobox\",\n controllerConstructor: HwComboboxController,\n });\n })\n .catch(() => null);\n\napplication.load(Definitions);\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\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\";\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\nexport default class WebauthnAuthenticationController extends Controller {\n static targets = [\"response\"];\n static values = {\n options: Object,\n };\n\n async authenticate() {\n const credential = await navigator.credentials.get(this.options);\n\n this.responseTarget.value = JSON.stringify(credential.toJSON());\n\n this.element.requestSubmit();\n }\n\n get options() {\n return {\n publicKey: PublicKeyCredential.parseRequestOptionsFromJSON(\n this.optionsValue,\n ),\n };\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class WebauthnRegistrationController extends Controller {\n static targets = [\"response\"];\n static values = {\n options: Object,\n };\n\n submit(e) {\n if (this.responseTarget.value) return;\n\n e.preventDefault();\n this.createCredential().then(() => {\n e.target.submit();\n });\n }\n\n async createCredential() {\n const credential = await navigator.credentials.create(this.options);\n this.responseTarget.value = JSON.stringify(credential.toJSON());\n }\n\n get options() {\n return {\n publicKey: PublicKeyCredential.parseCreationOptionsFromJSON(\n this.optionsValue,\n ),\n };\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/** Initialize GOVUK */\nfunction initGOVUK() {\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\nwindow.addEventListener(\"turbo:load\", initGOVUK);\nif (window.Turbo) initGOVUK();\n"],"names":["application","Application","start","load","content","govuk","navigation","tables","Definitions","identifier","controllerConstructor","Controller","static","connect","navigator","this","element","classList","add","supportedClass","copy","event","preventDefault","clipboard","writeText","sourceTarget","value","setTimeout","remove","close","e","target","closest","children","length","mapping","String","depth","type","Number","default","cause","HTMLElement","name","nodeName","toLowerCase","getAttribute","isContentEditable","isFormField","ignore","key","describeEvent","buffer","slice","depthValue","action","reduceRight","mappings","CustomEvent","detail","bubbles","dispatchEvent","ctrlKey","metaKey","altKey","shiftKey","code","filter","w","join","inputs","mappingValue","replaceAll","split","f","forEach","parse","Object","defineProperty","writable","pattern","keys","first","shift","addEventListener","onSubmit","disconnect","removeEventListener","outside","tagName","dismiss","dialogTarget","open","removeAttribute","dialogTargetConnected","dialog","showModal","success","formSubmission","submitter","dataset","filterTarget","clearFilter","applyFilter","go","querySelector","click","clear","blur","links","li","prefixSearch","innerText","toggleAttribute","menus","matches","querySelectorAll","needle","haystack","haystackLength","needleLength","outer","i","j","needleChar","charCodeAt","toggle","onMorphAttribute","attributeName","Array","from","trigger","dispatch","prefix","document","prevPage","nextPage","slug","sourceChanged","slugValue","slugTarget","replace","slugChanged","options","authenticate","credential","credentials","get","responseTarget","JSON","stringify","toJSON","requestSubmit","publicKey","PublicKeyCredential","parseRequestOptionsFromJSON","optionsValue","submit","createCredential","then","create","parseCreationOptionsFromJSON","import","HwComboboxController","push","catch","KoiToolbarElement","constructor","super","setAttribute","initGOVUK","body","HTMLScriptElement","prototype","initAll","customElements","define","window","Turbo"],"mappings":"oSAEA,MAAMA,EAAcC,EAAYC,QCChCF,EAAYG,KAAKC,GAGjBJ,EAAYG,KAAKE,GAGjBL,EAAYG,KAAKG,GAGjBN,EAAYG,KAAKI,GAajB,MAAMC,EAAc,CAClB,CACEC,WAAY,YACZC,sBC1BW,cAAkCC,EAC/CC,eAAiB,CAAC,UAElBA,eAAiB,CAAC,aAElB,OAAAC,GACM,cAAeC,WACjBC,KAAKC,QAAQC,UAAUC,IAAIH,KAAKI,eAEpC,CAEA,IAAAC,CAAKC,GACHA,EAAMC,iBACNR,UAAUS,UAAUC,UAAUT,KAAKU,aAAaC,OAEhDX,KAAKC,QAAQC,UAAUC,IAAI,UAC3BS,WAAW,KACTZ,KAAKC,QAAQC,UA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AK1J,UAAU6G,OAAO,cAAc,GAC7CQ,SAASqC,KAAK1J,UAAU6G,OACtB,2BACA,aAAc8C,kBAAkBC,WAElCC,GACF,CDRAC,eAAeC,OAAO,cAAeV,GCUrCW,OAAO7F,iBAAiB,aAAcsF,GAClCO,OAAOC,OAAOR"}
|
|
1
|
+
{"version":3,"file":"koi.min.js","sources":["../../../javascript/koi/utils/lexxy.js","../../../javascript/koi/utils/trix.js","../../../javascript/koi/controllers/application.js","../../../javascript/koi/controllers/index.js","../../../javascript/koi/controllers/clipboard_controller.js","../../../javascript/koi/controllers/flash_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/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 * as Lexxy from \"lexxy\";\n\nLexxy.configure({\n global: {\n authenticatedUploads: true,\n },\n});\n\n// The link toolbar's URL input is type=url, whose checkValidity() rejects\n// schemeless values like #anchor and /relative that lexxy's link node happily\n// preserves. Switch it to type=text with the same pattern Koi applies to the\n// trix link dialog (see Koi::Tags::TrixToolbar::TRIX_DIALOGS_TEMPLATE) so both\n// editors validate link input identically.\ndocument.addEventListener(\"lexxy:initialize\", ({ target }) => {\n target\n .querySelectorAll(\"lexxy-link-dropdown input[type=url]\")\n .forEach((input) => {\n input.type = \"text\";\n input.pattern = \"(https?|mailto:|tel:|/|#).*?\";\n });\n});\n\nexport default Lexxy;\n","import \"trix\";\n\n// Trix does not provide an export\nconst Trix = window.Trix;\n\n// Koi uses H4 for headings instead of H1\nTrix.config.blockAttributes[\"heading4\"] = {\n tagName: \"h4\",\n terminal: true,\n breakOnReturn: true,\n group: false,\n};\n\n// Remove H1 from trix list of acceptable tags\ndelete Trix.config.blockAttributes.heading1;\n\nexport default Trix;\n","import { Application } from \"@hotwired/stimulus\";\n\nconst application = Application.start();\n\nexport { application };\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 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 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: \"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: \"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\n// dynamically attempt to load hw_combobox_controller, this is an optional dependency\nawait import(\"controllers/hw_combobox_controller\")\n .then(({ default: HwComboboxController }) => {\n Definitions.push({\n identifier: \"hw-combobox\",\n controllerConstructor: HwComboboxController,\n });\n })\n .catch(() => null);\n\napplication.load(Definitions);\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\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\";\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\nexport default class WebauthnAuthenticationController extends Controller {\n static targets = [\"response\"];\n static values = {\n options: Object,\n };\n\n async authenticate() {\n const credential = await navigator.credentials.get(this.options);\n\n this.responseTarget.value = JSON.stringify(credential.toJSON());\n\n this.element.requestSubmit();\n }\n\n get options() {\n return {\n publicKey: PublicKeyCredential.parseRequestOptionsFromJSON(\n this.optionsValue,\n ),\n };\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class WebauthnRegistrationController extends Controller {\n static targets = [\"response\"];\n static values = {\n options: Object,\n };\n\n submit(e) {\n if (this.responseTarget.value) return;\n\n e.preventDefault();\n this.createCredential().then(() => {\n e.target.submit();\n });\n }\n\n async createCredential() {\n const credential = await navigator.credentials.create(this.options);\n this.responseTarget.value = JSON.stringify(credential.toJSON());\n }\n\n get options() {\n return {\n publicKey: PublicKeyCredential.parseCreationOptionsFromJSON(\n this.optionsValue,\n ),\n };\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 Lexxy from \"./utils/lexxy\";\nimport Trix from \"./utils/trix\";\n\nimport \"./controllers\";\nimport \"./elements\";\n\n/** Initialize GOVUK */\nfunction initGOVUK() {\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\nwindow.addEventListener(\"turbo:load\", initGOVUK);\nif (window.Turbo) initGOVUK();\n\nexport default { Lexxy, Trix };\n"],"names":["Lexxy","configure","global","authenticatedUploads","document","addEventListener","target","querySelectorAll","forEach","input","type","pattern","Trix","window","config","blockAttributes","tagName","terminal","breakOnReturn","group","heading1","application","Application","start","load","content","govuk","navigation","tables","Definitions","identifier","controllerConstructor","Controller","static","connect","navigator","this","element","classList","add","supportedClass","copy","event","preventDefault","clipboard","writeText","sourceTarget","value","setTimeout","remove","close","e","closest","children","length","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","dispatchEvent","ctrlKey","metaKey","altKey","shiftKey","code","filter","w","join","inputs","mappingValue","replaceAll","split","f","parse","Object","defineProperty","writable","keys","first","shift","onSubmit","disconnect","removeEventListener","outside","dismiss","dialogTarget","open","removeAttribute","dialogTargetConnected","dialog","showModal","success","formSubmission","submitter","dataset","filterTarget","clearFilter","applyFilter","go","querySelector","click","clear","blur","links","li","prefixSearch","innerText","toggleAttribute","menus","matches","needle","haystack","haystackLength","needleLength","outer","i","j","needleChar","charCodeAt","toggle","onMorphAttribute","attributeName","Array","from","trigger","dispatch","prefix","prevPage","nextPage","slug","sourceChanged","slugValue","slugTarget","replace","slugChanged","options","authenticate","credential","credentials","get","responseTarget","JSON","stringify","toJSON","requestSubmit","publicKey","PublicKeyCredential","parseRequestOptionsFromJSON","optionsValue","submit","createCredential","then","create","parseCreationOptionsFromJSON","import","HwComboboxController","push","catch","KoiToolbarElement","constructor","super","setAttribute","initGOVUK","body","HTMLScriptElement","prototype","initAll","customElements","define","Turbo"],"mappings":"4TAEAA,EAAMC,UAAU,CACdC,OAAQ,CACNC,sBAAsB,KAS1BC,SAASC,iBAAiB,mBAAoB,EAAGC,aAC/CA,EACGC,iBAAiB,uCACjBC,QAASC,IACRA,EAAMC,KAAO,OACbD,EAAME,QAAU,mCCftB,MAAMC,EAAOC,OAAOD,KAGpBA,EAAKE,OAAOC,gBAA0B,SAAI,CACxCC,QAAS,K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AKuI,mBAAmBC,KAAK,KAC3BzH,EAAE7C,OAAOoK,WAEb,CAEA,sBAAMC,GACJ,MAAMb,QAAmB3H,UAAU4H,YAAYc,OAAOzI,KAAKwH,SAC3DxH,KAAK6H,eAAelH,MAAQmH,KAAKC,UAAUL,EAAWM,SACxD,CAEA,WAAIR,GACF,MAAO,CACLU,UAAWC,oBAAoBO,6BAC7B1I,KAAKqI,cAGX,WVyCIM,OAAO,sCACVH,KAAK,EAAGjH,QAASqH,MAChBnJ,EAAYoJ,KAAK,CACfnJ,WAAY,cACZC,sBAAuBiJ,MAG1BE,MAAM,IAAM,MAEf7J,EAAYG,KAAKK,GW9EjB,MAAMsJ,UAA0BtH,YAC9B,WAAAuH,GACEC,QAEAjJ,KAAKkJ,aAAa,OAAQ,UAC5B,ECKF,SAASC,IACPnL,SAASoL,KAAKlJ,UAAUsG,OAAO,cAAc,GAC7CxI,SAASoL,KAAKlJ,UAAUsG,OACtB,2BACA,aAAc6C,kBAAkBC,WAElCC,GACF,CDTAC,eAAeC,OAAO,cAAeV,GCWrCtK,OAAOR,iBAAiB,aAAckL,GAClC1K,OAAOiL,OAAOP,IAElB,IAAAlK,EAAe,CAAErB,QAAOY"}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
margin-block-start: calc(-0.5 * var(--input-size));
|
|
34
34
|
translate: 0 calc(var(--stroke-input-width) + 0.25 * var(--input-size));
|
|
35
35
|
/* Firefox fix - unable to calculate baseline from dynamic height */
|
|
36
|
-
min-
|
|
36
|
+
min-block-size: var(--input-size);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.govuk-checkboxes__item::after {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
cursor: pointer;
|
|
58
58
|
touch-action: manipulation;
|
|
59
59
|
margin-block-end: 0;
|
|
60
|
-
min-
|
|
60
|
+
min-block-size: var(--input-size);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.govuk-checkboxes__hint {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
.hw-combobox__main__wrapper {
|
|
20
20
|
display: flex;
|
|
21
|
-
min-
|
|
21
|
+
min-block-size: var(--input-size);
|
|
22
22
|
align-items: center;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
width: 100%;
|
|
37
37
|
padding: 0;
|
|
38
38
|
height: unset;
|
|
39
|
-
min-
|
|
39
|
+
min-block-size: unset;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/* disabled */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@import url("/lexxy.css");
|
|
1
2
|
@import url("/trix.css");
|
|
2
3
|
|
|
3
4
|
@import url("label.css");
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
@import url("file-upload.css");
|
|
16
17
|
@import url("image-field.css");
|
|
17
18
|
@import url("document-field.css");
|
|
19
|
+
@import url("lexxy.css");
|
|
18
20
|
@import url("radios.css");
|
|
19
21
|
@import url("password.css");
|
|
20
22
|
@import url("select.css");
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
:
|
|
2
|
-
input:not([type="checkbox"], [type="radio"], [type="color"], [type="button"])
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
:where(
|
|
2
|
+
input:not([type="checkbox"], [type="radio"], [type="color"], [type="button"]),
|
|
3
|
+
select,
|
|
4
|
+
textarea
|
|
5
|
+
) {
|
|
6
6
|
background: var(--color-light);
|
|
7
7
|
border-radius: var(--input-radius);
|
|
8
8
|
border: var(--stroke-input);
|
|
9
9
|
color: var(--color-dark);
|
|
10
10
|
padding: var(--space-3xs);
|
|
11
11
|
width: 100%;
|
|
12
|
-
min-
|
|
12
|
+
min-block-size: var(--input-size);
|
|
13
13
|
|
|
14
14
|
&::placeholder {
|
|
15
15
|
color: var(--color-mid);
|
|
@@ -30,15 +30,13 @@ trix-editor {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
:
|
|
34
|
-
trix-editor {
|
|
33
|
+
:where(input, select, textarea) {
|
|
35
34
|
accent-color: var(--color-primary);
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
:
|
|
39
|
-
trix-editor {
|
|
40
|
-
resize: vertical;
|
|
37
|
+
:where(textarea) {
|
|
41
38
|
line-height: var(--leading-fine);
|
|
39
|
+
resize: vertical;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
.govuk-input {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Colors */
|
|
3
|
+
--lexxy-color-ink: var(--color-dark);
|
|
4
|
+
--lexxy-color-ink-medium: var(--color-dark-glare);
|
|
5
|
+
--lexxy-color-ink-light: var(--color-mid);
|
|
6
|
+
--lexxy-color-ink-lighter: var(--color-tint);
|
|
7
|
+
--lexxy-color-ink-lightest: var(--color-tint);
|
|
8
|
+
--lexxy-color-ink-inverted: var(--color-light);
|
|
9
|
+
|
|
10
|
+
/* Typography */
|
|
11
|
+
--lexxy-font-base: var(--font-base);
|
|
12
|
+
--lexxy-font-mono: var(--font-mono);
|
|
13
|
+
--lexxy-text-small: var(--size-step--1);
|
|
14
|
+
--lexxy-content-margin: var(--space-s);
|
|
15
|
+
|
|
16
|
+
/* Focus ring */
|
|
17
|
+
--lexxy-focus-ring-color: var(--focus-color);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:where(lexxy-toolbar) {
|
|
21
|
+
border: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:where(lexxy-editor) {
|
|
25
|
+
--lexxy-editor-padding: var(--space-2xs);
|
|
26
|
+
--lexxy-editor-rows: 5lh;
|
|
27
|
+
|
|
28
|
+
@supports (min-block-size: attr(rows lh)) {
|
|
29
|
+
--lexxy-editor-rows: attr(rows lh, 5lh);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
border: none;
|
|
33
|
+
margin-block-end: var(--flow-space, var(--space-2xs));
|
|
34
|
+
|
|
35
|
+
[role="textbox"] {
|
|
36
|
+
border-radius: var(--input-radius);
|
|
37
|
+
border: var(--stroke-input);
|
|
38
|
+
|
|
39
|
+
&:focus-visible {
|
|
40
|
+
outline: var(--focus-outline);
|
|
41
|
+
outline-offset: 0;
|
|
42
|
+
box-shadow: var(--focus-shadow);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.govuk-rich-textarea--error &:not(:focus-visible) {
|
|
46
|
+
border-color: var(--govuk-error-color);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.govuk-error-message:has(+ lexxy-editor) {
|
|
52
|
+
margin-block-end: unset;
|
|
53
|
+
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
margin-block-start: calc(-0.5 * var(--input-size));
|
|
34
34
|
translate: 0 calc(var(--stroke-input-width) + 0.25 * var(--input-size));
|
|
35
35
|
/* Firefox fix - unable to calculate baseline from dynamic height */
|
|
36
|
-
min-
|
|
36
|
+
min-block-size: var(--input-size);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.govuk-radios__item::after {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
touch-action: manipulation;
|
|
60
60
|
margin-block-end: 0;
|
|
61
|
-
min-
|
|
61
|
+
min-block-size: var(--input-size);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.govuk-radios__hint {
|
|
@@ -13,7 +13,7 @@ trix-toolbar {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.trix-button--dialog {
|
|
16
|
-
min-
|
|
16
|
+
min-block-size: 2.2rem;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.trix-button:not(:first-child) {
|
|
@@ -26,12 +26,36 @@ trix-toolbar {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
trix-editor {
|
|
30
|
+
background: var(--color-light);
|
|
31
|
+
border-radius: var(--input-radius);
|
|
32
|
+
border: var(--stroke-input);
|
|
33
|
+
color: var(--color-dark);
|
|
34
|
+
padding: var(--space-2xs);
|
|
35
|
+
min-block-size: calc(
|
|
31
36
|
var(--size-step-0) * var(--leading-fine) * 5 + var(--space-3xs) * 2
|
|
32
37
|
);
|
|
33
|
-
}
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
&::placeholder {
|
|
40
|
+
color: var(--color-mid);
|
|
41
|
+
opacity: 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:disabled {
|
|
45
|
+
opacity: 0.5;
|
|
46
|
+
color: inherit;
|
|
47
|
+
background-color: transparent;
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:focus-visible {
|
|
52
|
+
outline: var(--focus-outline);
|
|
53
|
+
outline-offset: 0;
|
|
54
|
+
box-shadow: var(--focus-shadow);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Note: turbo-permanent prevents govuk-rich-textarea--error toggle */
|
|
58
|
+
.govuk-form-group--error > &:not(:focus-visible) {
|
|
59
|
+
border-color: var(--govuk-error-color);
|
|
60
|
+
}
|
|
37
61
|
}
|