@tempots/beatui 0.32.1 → 0.33.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.
Files changed (44) hide show
  1. package/README.md +9 -0
  2. package/dist/{2019-BMZkvreo.cjs → 2019-Bl8v8fjU.cjs} +1 -1
  3. package/dist/{2019-BAbSTPyW.js → 2019-CKKsQZIa.js} +2 -2
  4. package/dist/{2020-BQNEk3m-.js → 2020-BqcGkd5L.js} +2 -2
  5. package/dist/{2020-COaJ7nGc.cjs → 2020-BsHmbyBy.cjs} +1 -1
  6. package/dist/auth/index.cjs.js +1 -1
  7. package/dist/auth/index.es.js +27 -27
  8. package/dist/beatui.css +8 -18
  9. package/dist/beatui.tailwind.css +8 -18
  10. package/dist/{index-DqeaEUPG.cjs → index-BBIdmCak.cjs} +1 -1
  11. package/dist/{index-1_pssujS.cjs → index-BTbThGQK.cjs} +2 -2
  12. package/dist/{index-CDOHHPwQ.js → index-BXjEbt8G.js} +2 -2
  13. package/dist/{index-E76KKV9V.js → index-CiVTODdZ.js} +1 -1
  14. package/dist/{index-CFh4D56e.cjs → index-CvOeci8Y.cjs} +1 -1
  15. package/dist/{index-DfmwsIle.js → index-DKPyYQwK.js} +37 -35
  16. package/dist/{index-B4irUWVb.cjs → index-HIb25Ti2.cjs} +1 -1
  17. package/dist/{index-Caetcp0r.js → index-xdCnysNz.js} +1 -1
  18. package/dist/index.cjs.js +4 -4
  19. package/dist/index.es.js +256 -262
  20. package/dist/json-schema/index.cjs.js +1 -1
  21. package/dist/json-schema/index.es.js +1 -1
  22. package/dist/{modal-eY-3j_zS.js → modal-BnY6iGcL.js} +1 -1
  23. package/dist/{modal-CepbiM3u.cjs → modal-C3d-SRPh.cjs} +1 -1
  24. package/dist/monaco/index.cjs.js +1 -1
  25. package/dist/monaco/index.es.js +1 -1
  26. package/dist/{notice-Ct8ZHvwq.js → notice-Cd9ElXwb.js} +234 -234
  27. package/dist/notice-len8sDjL.cjs +2 -0
  28. package/dist/prosemirror/index.cjs.js +1 -1
  29. package/dist/prosemirror/index.es.js +1 -1
  30. package/dist/theme-B5pmbvQ_.js +37 -0
  31. package/dist/theme-Dt6lCAvY.cjs +1 -0
  32. package/dist/types/components/beatui.d.ts +2 -1
  33. package/dist/types/components/form/controller/color-controller.d.ts +1 -1
  34. package/dist/types/components/form/controller/controller.d.ts +4 -4
  35. package/dist/types/components/form/controller/union-controller.d.ts +1 -1
  36. package/dist/types/components/overlay/ribbon.d.ts +4 -4
  37. package/dist/types/components/theme/theme.d.ts +1 -0
  38. package/dist/utils-BoajYXEP.cjs +1 -0
  39. package/dist/{utils-CuD-_CDx.js → utils-Dl44PfbT.js} +7 -7
  40. package/package.json +1 -1
  41. package/dist/notice-cpODDUvJ.cjs +0 -2
  42. package/dist/theme-B7C5kIJj.cjs +0 -1
  43. package/dist/theme-DsQOxXW1.js +0 -34
  44. package/dist/utils-CCAYvnZh.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-1_pssujS.cjs");exports.JSONSchemaAllOf=e.JSONSchemaAllOf;exports.JSONSchemaAny=e.JSONSchemaAny;exports.JSONSchemaAnyOf=e.JSONSchemaAnyOf;exports.JSONSchemaArray=e.JSONSchemaArray;exports.JSONSchemaBoolean=e.JSONSchemaBoolean;exports.JSONSchemaConst=e.JSONSchemaConst;exports.JSONSchemaControl=e.JSONSchemaControl;exports.JSONSchemaEnum=e.JSONSchemaEnum;exports.JSONSchemaForm=e.JSONSchemaForm;exports.JSONSchemaGenericControl=e.JSONSchemaGenericControl;exports.JSONSchemaInteger=e.JSONSchemaInteger;exports.JSONSchemaNull=e.JSONSchemaNull;exports.JSONSchemaNumber=e.JSONSchemaNumber;exports.JSONSchemaObject=e.JSONSchemaObject;exports.JSONSchemaOneOf=e.JSONSchemaOneOf;exports.JSONSchemaString=e.JSONSchemaString;exports.JSONSchemaUnion=e.JSONSchemaUnion;exports.SchemaContext=e.SchemaContext;exports.ajvErrorsToControllerValidation=e.ajvErrorsToControllerValidation;exports.ajvErrorsToDependencies=e.ajvErrorsToDependencies;exports.buildMessage=e.buildMessage;exports.buildPath=e.buildPath;exports.clearCaches=e.clearCaches;exports.clearCachesForAjv=e.clearCachesForAjv;exports.compileWithCache=e.compileWithCache;exports.composeEffectiveObjectSchema=e.composeEffectiveObjectSchema;exports.createAJVStandardSchema=e.createAJVStandardSchema;exports.evaluateIfThenElseOverlay=e.evaluateIfThenElseOverlay;exports.evaluateNotViolation=e.evaluateNotViolation;exports.getAjvForSchema=e.getAjvForSchema;exports.getCacheStats=e.getCacheStats;exports.getEvaluatedProperties=e.getEvaluatedProperties;exports.jsonPointerToSegments=e.jsonPointerToSegments;exports.mergeAllOf=e.mergeAllOf;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-BTbThGQK.cjs");exports.JSONSchemaAllOf=e.JSONSchemaAllOf;exports.JSONSchemaAny=e.JSONSchemaAny;exports.JSONSchemaAnyOf=e.JSONSchemaAnyOf;exports.JSONSchemaArray=e.JSONSchemaArray;exports.JSONSchemaBoolean=e.JSONSchemaBoolean;exports.JSONSchemaConst=e.JSONSchemaConst;exports.JSONSchemaControl=e.JSONSchemaControl;exports.JSONSchemaEnum=e.JSONSchemaEnum;exports.JSONSchemaForm=e.JSONSchemaForm;exports.JSONSchemaGenericControl=e.JSONSchemaGenericControl;exports.JSONSchemaInteger=e.JSONSchemaInteger;exports.JSONSchemaNull=e.JSONSchemaNull;exports.JSONSchemaNumber=e.JSONSchemaNumber;exports.JSONSchemaObject=e.JSONSchemaObject;exports.JSONSchemaOneOf=e.JSONSchemaOneOf;exports.JSONSchemaString=e.JSONSchemaString;exports.JSONSchemaUnion=e.JSONSchemaUnion;exports.SchemaContext=e.SchemaContext;exports.ajvErrorsToControllerValidation=e.ajvErrorsToControllerValidation;exports.ajvErrorsToDependencies=e.ajvErrorsToDependencies;exports.buildMessage=e.buildMessage;exports.buildPath=e.buildPath;exports.clearCaches=e.clearCaches;exports.clearCachesForAjv=e.clearCachesForAjv;exports.compileWithCache=e.compileWithCache;exports.composeEffectiveObjectSchema=e.composeEffectiveObjectSchema;exports.createAJVStandardSchema=e.createAJVStandardSchema;exports.evaluateIfThenElseOverlay=e.evaluateIfThenElseOverlay;exports.evaluateNotViolation=e.evaluateNotViolation;exports.getAjvForSchema=e.getAjvForSchema;exports.getCacheStats=e.getCacheStats;exports.getEvaluatedProperties=e.getEvaluatedProperties;exports.jsonPointerToSegments=e.jsonPointerToSegments;exports.mergeAllOf=e.mergeAllOf;
@@ -1,4 +1,4 @@
1
- import { V as s, J as S, T as c, P as o, N as t, I as r, X as m, H as h, Y as O, W as n, L as l, O as N, K as J, Q as i, U as v, M as C, R as u, S as A, w as f, v as g, u as d, t as j, x as E, y as b, A as p, E as y, Z as T, F, D as P, B as V, z as x, G as I, s as B, C as D } from "../index-DfmwsIle.js";
1
+ import { V as s, J as S, T as c, P as o, N as t, I as r, X as m, H as h, Y as O, W as n, L as l, O as N, K as J, Q as i, U as v, M as C, R as u, S as A, w as f, v as g, u as d, t as j, x as E, y as b, A as p, E as y, Z as T, F, D as P, B as V, z as x, G as I, s as B, C as D } from "../index-DKPyYQwK.js";
2
2
  export {
3
3
  s as JSONSchemaAllOf,
4
4
  S as JSONSchemaAny,
@@ -1,6 +1,6 @@
1
1
  import { WithElement as P, OnDispose as K, prop as W, attr as h, computedOf as A, WithBrowserCtx as N, Value as z, render as G, html as k, dataAttr as O, aria as F, on as J, When as D, Use as R, Fragment as Q, coalesce as q } from "@tempots/dom";
2
2
  import { g as V, T as I } from "./timer-CQlK5LhW.js";
3
- import { s as X, C as Y } from "./notice-Ct8ZHvwq.js";
3
+ import { s as X, C as Y } from "./notice-Cd9ElXwb.js";
4
4
  import { a as U, B as j } from "./translations-iam7PITs.js";
5
5
  const Z = [
6
6
  "a[href]",
@@ -1 +1 @@
1
- "use strict";const o=require("@tempots/dom"),w=require("./timer-BdH4cK6a.cjs"),$=require("./notice-cpODDUvJ.cjs"),V=require("./translations-DQxg-W9w.cjs"),W=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]',"audio[controls]","video[controls]","details > summary:first-of-type","details[open]"].join(", ");function _(r){return Array.from(r.querySelectorAll(W)).filter(t=>{const s=t;return s.offsetWidth>0&&s.offsetHeight>0&&!s.hasAttribute("inert")&&window.getComputedStyle(s).visibility!=="hidden"})}function B(r={}){const{active:t=!0,escapeDeactivates:s=!0,onEscape:e,initialFocus:a,returnFocus:i,clickOutsideDeactivates:c=!1,onClickOutside:d}=r;return o.WithElement(h=>{let f=t,m=null,u=[];typeof document<"u"&&(m=document.activeElement);const b=()=>{u=_(h)},g=n=>{if(f){if(s&&n.key==="Escape"){n.preventDefault(),e?.();return}if(n.key==="Tab"){if(b(),u.length===0){n.preventDefault();return}const v=u.indexOf(document.activeElement);n.shiftKey?v<=0&&(n.preventDefault(),u[u.length-1]?.focus()):v>=u.length-1&&(n.preventDefault(),u[0]?.focus())}}},p=n=>{if(!f||!c)return;const v=n.target;h.contains(v)||d?.()},y=()=>{if(!f)return;b();let n=null;typeof a=="function"?n=a():a?n=a:u.length>0&&(n=u[0]),n&&setTimeout(()=>{n?.focus()},50),document.addEventListener("keydown",g,!0),c&&document.addEventListener("click",p,!0)},T=()=>{f=!1,document.removeEventListener("keydown",g,!0),document.removeEventListener("click",p,!0);let n=null;typeof i=="function"?n=i():i?n=i:m&&(n=m),n&&document.body.contains(n)&&setTimeout(()=>{n?.focus()},0)};return setTimeout(()=>y(),0),o.OnDispose(()=>{T()})})}function P(r={}){return{activate:()=>B({...r,active:!0}),deactivate:()=>B({...r,active:!1})}}function F({initialStatus:r="closed",openedAfter:t,closedAfter:s}){const e=o.prop(r),a=()=>{e.set("start-opening")},i=()=>{e.set("start-closing")},c=e.map(n=>n!=="closed"&&n!=="start-closing"&&n!=="closing"),d=n=>{n?a():i()},h=()=>{d(!c.value)},f=n=>e.on(v=>{v==="closed"&&n()});let m=()=>{};e.on(n=>{switch(m(),n){case"start-opening":m=w.g(()=>e.set("opening"));break;case"opening":m=t(()=>e.set("opened"));break;case"start-closing":m=w.g(()=>e.set("closing"));break;case"closing":m=s(()=>e.set("closed"));break}}),e.onDispose(()=>m());const u=e.map(n=>n==="closed"),b=e.map(n=>n==="start-opening"),g=e.map(n=>n==="opening"),p=e.map(n=>n==="opened"),y=e.map(n=>n==="closing"),T=e.map(n=>n==="start-closing");return{status:e,open:a,close:i,toggle:h,setOpen:d,display:c,isClosed:u,isStartOpening:b,isOpening:g,isOpened:p,isClosing:y,isStartClosing:T,dispose:()=>e.dispose(),onClosed:f}}function U({initialStatus:r="closed",duration:t,openDuration:s=t??500,closeDuration:e=t??500}={}){return F({initialStatus:r,openedAfter:a=>w.T(a,s),closedAfter:a=>w.T(a,e)})}function q(r,t){let s=!1,e=null;function a(){s||(s=!0,e&&(clearTimeout(e),e=null),t())}function i(f){f.target===r&&a()}function c(f){f.target===r&&a()}const d=()=>{if(typeof r.getAnimations>"u"){e=setTimeout(a,16);return}r.getAnimations().length===0?(r.addEventListener("transitionend",i,{once:!0}),r.addEventListener("animationend",c,{once:!0}),e=setTimeout(a,1e3)):(r.addEventListener("transitionend",i,{once:!0}),r.addEventListener("animationend",c,{once:!0}))},h=w.g(d);return()=>{s=!0,h(),e&&(clearTimeout(e),e=null),r.removeEventListener("transitionend",i),r.removeEventListener("animationend",c)}}function M({initialStatus:r="closed",element:t}={}){let s=t;return{setElement:e=>{s=e},...F({initialStatus:r,openedAfter:e=>s==null?(e(),()=>{}):q(s,e),closedAfter:e=>s==null?(e(),()=>{}):q(s,e)})}}function z(r,t){return o.attr.class(o.computedOf(r,t)((s,e)=>`bc-toggle--animated bc-toggle--${s} bc-toggle--${e}`))}function D(r){return{"~standard":{version:1,vendor:"beatui-custom",validate:s=>{const e=r.validate(s);return e.success?{value:e.data}:{issues:e.errors.map(a=>({message:a.message,path:a.path}))}},types:void 0},safeParse:s=>{const e=r.validate(s);return e.success?{success:!0,data:e.data}:{success:!1,error:{errors:e.errors.map(a=>({message:a.message,path:a.path?.map(i=>typeof i=="object"&&"key"in i?i.key.toString():i.toString())||[]}))}}}}}class x{optional(){return new R(this)}default(t){return new H(this,t)}schema(){return D(this)}}class C extends x{minLength;maxLength;pattern;customValidations=[];validate(t){if(typeof t!="string")return{success:!1,errors:[{message:"Expected string"}]};const s=[];this.minLength!==void 0&&t.length<this.minLength&&s.push({message:`Must be at least ${this.minLength} characters`}),this.maxLength!==void 0&&t.length>this.maxLength&&s.push({message:`Must be at most ${this.maxLength} characters`}),this.pattern&&!this.pattern.test(t)&&s.push({message:"Invalid format"});for(const e of this.customValidations){const a=e(t);a&&s.push({message:a})}return s.length>0?{success:!1,errors:s}:{success:!0,data:t}}min(t,s){const e=new C;return e.minLength=t,e.maxLength=this.maxLength,e.pattern=this.pattern,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>a.length<t?s:null),e}max(t,s){const e=new C;return e.minLength=this.minLength,e.maxLength=t,e.pattern=this.pattern,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>a.length>t?s:null),e}regex(t,s){const e=new C;return e.minLength=this.minLength,e.maxLength=this.maxLength,e.pattern=t,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>t.test(a)?null:s),e}email(t="Please enter a valid email address"){const s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,e=new C;return e.minLength=this.minLength,e.maxLength=this.maxLength,e.pattern=this.pattern,e.customValidations=[...this.customValidations,a=>s.test(a)?null:t],e}refine(t){const s=new C;return s.minLength=this.minLength,s.maxLength=this.maxLength,s.pattern=this.pattern,s.customValidations=[...this.customValidations,t],s}}class A extends x{mustBeTrue=!1;trueMessage;validate(t){return typeof t!="boolean"?{success:!1,errors:[{message:"Expected boolean"}]}:this.mustBeTrue&&t!==!0?{success:!1,errors:[{message:this.trueMessage||"Must be true"}]}:{success:!0,data:t}}refine(t,s){const e=new A;e.mustBeTrue=this.mustBeTrue,e.trueMessage=this.trueMessage;const a=e.validate.bind(e);return e.validate=i=>{const c=a(i);return c.success?t(c.data)?c:{success:!1,errors:[{message:s}]}:c},e}literal(t,s){const e=new A;return e.mustBeTrue=!0,e.trueMessage=s,e}}class R extends x{constructor(t){super(),this.inner=t}validate(t){if(t===void 0)return{success:!0,data:void 0};const s=this.inner.validate(t);return s.success?{success:!0,data:s.data}:{success:!1,errors:s.errors}}}class H extends x{constructor(t,s){super(),this.inner=t,this.defaultValue=s}validate(t){return t===void 0?{success:!0,data:this.defaultValue}:this.inner.validate(t)}}class O extends x{constructor(t){super(),this.shape=t}validate(t){if(typeof t!="object"||t===null||Array.isArray(t))return{success:!1,errors:[{message:"Expected object"}]};const s=t,e={},a=[];for(const[i,c]of Object.entries(this.shape)){const d=c.validate(s[i]);if(d.success)e[i]=d.data;else for(const h of d.errors)a.push({message:h.message,path:[i,...h.path||[]]})}return a.length>0?{success:!1,errors:a}:{success:!0,data:e}}refine(t,s){const e=new O(this.shape),a=e.validate.bind(e);return e.validate=i=>{const c=a(i);if(!c.success)return c;const d=t(c.data);return d?{success:!1,errors:[{message:d,path:s?.path}]}:{success:!0,data:c.data}},e}}const K=()=>new C,N=()=>new A,G=r=>new O(r);function I(r){return o.WithBrowserCtx(t=>{const s=[],e=()=>s.forEach(i=>i());return r(({effect:i="opaque",mode:c="capturing",onClickOutside:d,onEscape:h,content:f,container:m="body"})=>{m==="body"&&(t=t.makePortal("body"));const u=M();u.onClosed(e);let b=()=>{},g=()=>{};const p=E=>{E.key==="Escape"&&(h?.(),u.close())},y=()=>{d?.(),u.close()},T=E=>{b(),g(),E==="capturing"?(document.addEventListener("keydown",p),b=()=>document.removeEventListener("keydown",p),t.element.addEventListener("mousedown",y),g=()=>t.element.removeEventListener("mousedown",y)):(b=()=>{},g=()=>{})},n=o.Value.on(c,T);s.push(n),s.push(()=>{b(),g()});const v=()=>{const E=new Set;for(const l of t.element.querySelectorAll(":scope > :not([data-overlay])"))l.hasAttribute("inert")?E.add(l):l.setAttribute("inert","");return s.push(()=>{for(const l of t.element.querySelectorAll(":scope > :not([data-overlay])"))E.has(l)||l.removeAttribute("inert");E.clear()}),document.activeElement?.blur?.(),o.html.div(o.WithElement(l=>u.setElement(l)),o.dataAttr.status(u.status.map(String)),o.dataAttr.overlay("true"),o.attr.class(o.computedOf(i??"opaque",c)((l,L)=>`bc-overlay bc-overlay--effect-${l} bc-overlay--mode-${L}`)),f)},k=o.render(v(),t.element,{disposeWithParent:!0,clear:!1,providers:t.providers});s.push(k),w.g(()=>u.open())},e)})}function j(r,t){const{size:s="md",dismissable:e=!0,showCloseButton:a=!0,onClose:i,overlayEffect:c="opaque",container:d="body",position:h="center"}=r;return I((f,m)=>{let u=()=>{};return t(p=>{u=m;const y=o.prop("capturing");o.Value.on(e,l=>{y.set(l?"capturing":"non-capturing")});const T=o.computedOf(p.header!=null,a)((l,L)=>l||L),n=$.sessionId("modal"),v=`${n}-header`,k=`${n}-body`,E=o.html.div(o.attr.class(o.computedOf(s,h)((l,L)=>`bc-modal bc-modal--size-${l} bc-modal--container-${d} bc-modal--position-${L}`)),o.attr.role("dialog"),o.aria.modal(!0),...p.header?[o.aria.labelledby(v)]:[],o.aria.describedby(k),o.attr.tabindex(-1),o.attr.id(n),o.dataAttr.focusTrap("true"),o.on.mousedown(l=>l.stopPropagation()),B({escapeDeactivates:!1,initialFocus:()=>{const l=document.getElementById(n);if(!l)return null;const L=l.querySelector('[aria-label="Close modal"]');if(L)return L;const S=l.querySelector('button, input, select, textarea, [tabindex]:not([tabindex="-1"])');return S||l}}),o.html.div(o.attr.class("bc-modal__content"),o.When(T,()=>o.html.div(o.attr.class("bc-modal__header"),o.html.div(o.attr.class("bc-modal__title"),...p.header?[o.attr.id(v)]:[],p.header),o.When(a,()=>o.Use(V.BeatUII18n,l=>$.CloseButton({size:"sm",label:l.$.closeModal,onClick:()=>{u(),m()}}))))),o.html.div(o.attr.class("bc-modal__body"),o.attr.id(k),p.body),p.footer&&o.html.div(o.attr.class("bc-modal__footer"),p.footer)));f({mode:y,effect:c??"opaque",container:d,content:E,onClickOutside:()=>{i?.(),m()},onEscape:()=>{i?.(),m()}})},()=>{u(),m()})})}function J(r,t){const{confirmText:s,cancelText:e,onConfirm:a,onCancel:i,...c}=r;return o.Use(V.BeatUII18n,d=>j({showCloseButton:!1,...c},(h,f)=>{const m=()=>{a?.(),f()},u=()=>{i?.(),f()};return t(g=>{h({body:g,footer:o.Fragment(o.attr.class("bc-modal__actions"),V.Button({variant:"outline",onClick:u},o.coalesce(e,d.$.cancel)),V.Button({color:"primary",variant:"filled",onClick:m},o.coalesce(s,d.$.confirm)))})},f)}))}exports.AnimatedToggleClass=z;exports.BooleanValidator=A;exports.ConfirmModal=J;exports.FocusTrap=B;exports.Modal=j;exports.ObjectValidator=O;exports.Overlay=I;exports.StringValidator=C;exports.boolean=N;exports.createStandardSchema=D;exports.object=G;exports.string=K;exports.useAnimatedElementToggle=M;exports.useAnimatedToggle=F;exports.useFocusTrap=P;exports.useTimedToggle=U;
1
+ "use strict";const o=require("@tempots/dom"),w=require("./timer-BdH4cK6a.cjs"),$=require("./notice-len8sDjL.cjs"),V=require("./translations-DQxg-W9w.cjs"),W=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]',"audio[controls]","video[controls]","details > summary:first-of-type","details[open]"].join(", ");function _(r){return Array.from(r.querySelectorAll(W)).filter(t=>{const s=t;return s.offsetWidth>0&&s.offsetHeight>0&&!s.hasAttribute("inert")&&window.getComputedStyle(s).visibility!=="hidden"})}function B(r={}){const{active:t=!0,escapeDeactivates:s=!0,onEscape:e,initialFocus:a,returnFocus:i,clickOutsideDeactivates:c=!1,onClickOutside:d}=r;return o.WithElement(h=>{let f=t,m=null,u=[];typeof document<"u"&&(m=document.activeElement);const b=()=>{u=_(h)},g=n=>{if(f){if(s&&n.key==="Escape"){n.preventDefault(),e?.();return}if(n.key==="Tab"){if(b(),u.length===0){n.preventDefault();return}const v=u.indexOf(document.activeElement);n.shiftKey?v<=0&&(n.preventDefault(),u[u.length-1]?.focus()):v>=u.length-1&&(n.preventDefault(),u[0]?.focus())}}},p=n=>{if(!f||!c)return;const v=n.target;h.contains(v)||d?.()},y=()=>{if(!f)return;b();let n=null;typeof a=="function"?n=a():a?n=a:u.length>0&&(n=u[0]),n&&setTimeout(()=>{n?.focus()},50),document.addEventListener("keydown",g,!0),c&&document.addEventListener("click",p,!0)},T=()=>{f=!1,document.removeEventListener("keydown",g,!0),document.removeEventListener("click",p,!0);let n=null;typeof i=="function"?n=i():i?n=i:m&&(n=m),n&&document.body.contains(n)&&setTimeout(()=>{n?.focus()},0)};return setTimeout(()=>y(),0),o.OnDispose(()=>{T()})})}function P(r={}){return{activate:()=>B({...r,active:!0}),deactivate:()=>B({...r,active:!1})}}function F({initialStatus:r="closed",openedAfter:t,closedAfter:s}){const e=o.prop(r),a=()=>{e.set("start-opening")},i=()=>{e.set("start-closing")},c=e.map(n=>n!=="closed"&&n!=="start-closing"&&n!=="closing"),d=n=>{n?a():i()},h=()=>{d(!c.value)},f=n=>e.on(v=>{v==="closed"&&n()});let m=()=>{};e.on(n=>{switch(m(),n){case"start-opening":m=w.g(()=>e.set("opening"));break;case"opening":m=t(()=>e.set("opened"));break;case"start-closing":m=w.g(()=>e.set("closing"));break;case"closing":m=s(()=>e.set("closed"));break}}),e.onDispose(()=>m());const u=e.map(n=>n==="closed"),b=e.map(n=>n==="start-opening"),g=e.map(n=>n==="opening"),p=e.map(n=>n==="opened"),y=e.map(n=>n==="closing"),T=e.map(n=>n==="start-closing");return{status:e,open:a,close:i,toggle:h,setOpen:d,display:c,isClosed:u,isStartOpening:b,isOpening:g,isOpened:p,isClosing:y,isStartClosing:T,dispose:()=>e.dispose(),onClosed:f}}function U({initialStatus:r="closed",duration:t,openDuration:s=t??500,closeDuration:e=t??500}={}){return F({initialStatus:r,openedAfter:a=>w.T(a,s),closedAfter:a=>w.T(a,e)})}function q(r,t){let s=!1,e=null;function a(){s||(s=!0,e&&(clearTimeout(e),e=null),t())}function i(f){f.target===r&&a()}function c(f){f.target===r&&a()}const d=()=>{if(typeof r.getAnimations>"u"){e=setTimeout(a,16);return}r.getAnimations().length===0?(r.addEventListener("transitionend",i,{once:!0}),r.addEventListener("animationend",c,{once:!0}),e=setTimeout(a,1e3)):(r.addEventListener("transitionend",i,{once:!0}),r.addEventListener("animationend",c,{once:!0}))},h=w.g(d);return()=>{s=!0,h(),e&&(clearTimeout(e),e=null),r.removeEventListener("transitionend",i),r.removeEventListener("animationend",c)}}function M({initialStatus:r="closed",element:t}={}){let s=t;return{setElement:e=>{s=e},...F({initialStatus:r,openedAfter:e=>s==null?(e(),()=>{}):q(s,e),closedAfter:e=>s==null?(e(),()=>{}):q(s,e)})}}function z(r,t){return o.attr.class(o.computedOf(r,t)((s,e)=>`bc-toggle--animated bc-toggle--${s} bc-toggle--${e}`))}function D(r){return{"~standard":{version:1,vendor:"beatui-custom",validate:s=>{const e=r.validate(s);return e.success?{value:e.data}:{issues:e.errors.map(a=>({message:a.message,path:a.path}))}},types:void 0},safeParse:s=>{const e=r.validate(s);return e.success?{success:!0,data:e.data}:{success:!1,error:{errors:e.errors.map(a=>({message:a.message,path:a.path?.map(i=>typeof i=="object"&&"key"in i?i.key.toString():i.toString())||[]}))}}}}}class x{optional(){return new R(this)}default(t){return new H(this,t)}schema(){return D(this)}}class C extends x{minLength;maxLength;pattern;customValidations=[];validate(t){if(typeof t!="string")return{success:!1,errors:[{message:"Expected string"}]};const s=[];this.minLength!==void 0&&t.length<this.minLength&&s.push({message:`Must be at least ${this.minLength} characters`}),this.maxLength!==void 0&&t.length>this.maxLength&&s.push({message:`Must be at most ${this.maxLength} characters`}),this.pattern&&!this.pattern.test(t)&&s.push({message:"Invalid format"});for(const e of this.customValidations){const a=e(t);a&&s.push({message:a})}return s.length>0?{success:!1,errors:s}:{success:!0,data:t}}min(t,s){const e=new C;return e.minLength=t,e.maxLength=this.maxLength,e.pattern=this.pattern,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>a.length<t?s:null),e}max(t,s){const e=new C;return e.minLength=this.minLength,e.maxLength=t,e.pattern=this.pattern,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>a.length>t?s:null),e}regex(t,s){const e=new C;return e.minLength=this.minLength,e.maxLength=this.maxLength,e.pattern=t,e.customValidations=[...this.customValidations],s&&e.customValidations.push(a=>t.test(a)?null:s),e}email(t="Please enter a valid email address"){const s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,e=new C;return e.minLength=this.minLength,e.maxLength=this.maxLength,e.pattern=this.pattern,e.customValidations=[...this.customValidations,a=>s.test(a)?null:t],e}refine(t){const s=new C;return s.minLength=this.minLength,s.maxLength=this.maxLength,s.pattern=this.pattern,s.customValidations=[...this.customValidations,t],s}}class A extends x{mustBeTrue=!1;trueMessage;validate(t){return typeof t!="boolean"?{success:!1,errors:[{message:"Expected boolean"}]}:this.mustBeTrue&&t!==!0?{success:!1,errors:[{message:this.trueMessage||"Must be true"}]}:{success:!0,data:t}}refine(t,s){const e=new A;e.mustBeTrue=this.mustBeTrue,e.trueMessage=this.trueMessage;const a=e.validate.bind(e);return e.validate=i=>{const c=a(i);return c.success?t(c.data)?c:{success:!1,errors:[{message:s}]}:c},e}literal(t,s){const e=new A;return e.mustBeTrue=!0,e.trueMessage=s,e}}class R extends x{constructor(t){super(),this.inner=t}validate(t){if(t===void 0)return{success:!0,data:void 0};const s=this.inner.validate(t);return s.success?{success:!0,data:s.data}:{success:!1,errors:s.errors}}}class H extends x{constructor(t,s){super(),this.inner=t,this.defaultValue=s}validate(t){return t===void 0?{success:!0,data:this.defaultValue}:this.inner.validate(t)}}class O extends x{constructor(t){super(),this.shape=t}validate(t){if(typeof t!="object"||t===null||Array.isArray(t))return{success:!1,errors:[{message:"Expected object"}]};const s=t,e={},a=[];for(const[i,c]of Object.entries(this.shape)){const d=c.validate(s[i]);if(d.success)e[i]=d.data;else for(const h of d.errors)a.push({message:h.message,path:[i,...h.path||[]]})}return a.length>0?{success:!1,errors:a}:{success:!0,data:e}}refine(t,s){const e=new O(this.shape),a=e.validate.bind(e);return e.validate=i=>{const c=a(i);if(!c.success)return c;const d=t(c.data);return d?{success:!1,errors:[{message:d,path:s?.path}]}:{success:!0,data:c.data}},e}}const K=()=>new C,N=()=>new A,G=r=>new O(r);function I(r){return o.WithBrowserCtx(t=>{const s=[],e=()=>s.forEach(i=>i());return r(({effect:i="opaque",mode:c="capturing",onClickOutside:d,onEscape:h,content:f,container:m="body"})=>{m==="body"&&(t=t.makePortal("body"));const u=M();u.onClosed(e);let b=()=>{},g=()=>{};const p=E=>{E.key==="Escape"&&(h?.(),u.close())},y=()=>{d?.(),u.close()},T=E=>{b(),g(),E==="capturing"?(document.addEventListener("keydown",p),b=()=>document.removeEventListener("keydown",p),t.element.addEventListener("mousedown",y),g=()=>t.element.removeEventListener("mousedown",y)):(b=()=>{},g=()=>{})},n=o.Value.on(c,T);s.push(n),s.push(()=>{b(),g()});const v=()=>{const E=new Set;for(const l of t.element.querySelectorAll(":scope > :not([data-overlay])"))l.hasAttribute("inert")?E.add(l):l.setAttribute("inert","");return s.push(()=>{for(const l of t.element.querySelectorAll(":scope > :not([data-overlay])"))E.has(l)||l.removeAttribute("inert");E.clear()}),document.activeElement?.blur?.(),o.html.div(o.WithElement(l=>u.setElement(l)),o.dataAttr.status(u.status.map(String)),o.dataAttr.overlay("true"),o.attr.class(o.computedOf(i??"opaque",c)((l,L)=>`bc-overlay bc-overlay--effect-${l} bc-overlay--mode-${L}`)),f)},k=o.render(v(),t.element,{disposeWithParent:!0,clear:!1,providers:t.providers});s.push(k),w.g(()=>u.open())},e)})}function j(r,t){const{size:s="md",dismissable:e=!0,showCloseButton:a=!0,onClose:i,overlayEffect:c="opaque",container:d="body",position:h="center"}=r;return I((f,m)=>{let u=()=>{};return t(p=>{u=m;const y=o.prop("capturing");o.Value.on(e,l=>{y.set(l?"capturing":"non-capturing")});const T=o.computedOf(p.header!=null,a)((l,L)=>l||L),n=$.sessionId("modal"),v=`${n}-header`,k=`${n}-body`,E=o.html.div(o.attr.class(o.computedOf(s,h)((l,L)=>`bc-modal bc-modal--size-${l} bc-modal--container-${d} bc-modal--position-${L}`)),o.attr.role("dialog"),o.aria.modal(!0),...p.header?[o.aria.labelledby(v)]:[],o.aria.describedby(k),o.attr.tabindex(-1),o.attr.id(n),o.dataAttr.focusTrap("true"),o.on.mousedown(l=>l.stopPropagation()),B({escapeDeactivates:!1,initialFocus:()=>{const l=document.getElementById(n);if(!l)return null;const L=l.querySelector('[aria-label="Close modal"]');if(L)return L;const S=l.querySelector('button, input, select, textarea, [tabindex]:not([tabindex="-1"])');return S||l}}),o.html.div(o.attr.class("bc-modal__content"),o.When(T,()=>o.html.div(o.attr.class("bc-modal__header"),o.html.div(o.attr.class("bc-modal__title"),...p.header?[o.attr.id(v)]:[],p.header),o.When(a,()=>o.Use(V.BeatUII18n,l=>$.CloseButton({size:"sm",label:l.$.closeModal,onClick:()=>{u(),m()}}))))),o.html.div(o.attr.class("bc-modal__body"),o.attr.id(k),p.body),p.footer&&o.html.div(o.attr.class("bc-modal__footer"),p.footer)));f({mode:y,effect:c??"opaque",container:d,content:E,onClickOutside:()=>{i?.(),m()},onEscape:()=>{i?.(),m()}})},()=>{u(),m()})})}function J(r,t){const{confirmText:s,cancelText:e,onConfirm:a,onCancel:i,...c}=r;return o.Use(V.BeatUII18n,d=>j({showCloseButton:!1,...c},(h,f)=>{const m=()=>{a?.(),f()},u=()=>{i?.(),f()};return t(g=>{h({body:g,footer:o.Fragment(o.attr.class("bc-modal__actions"),V.Button({variant:"outline",onClick:u},o.coalesce(e,d.$.cancel)),V.Button({color:"primary",variant:"filled",onClick:m},o.coalesce(s,d.$.confirm)))})},f)}))}exports.AnimatedToggleClass=z;exports.BooleanValidator=A;exports.ConfirmModal=J;exports.FocusTrap=B;exports.Modal=j;exports.ObjectValidator=O;exports.Overlay=I;exports.StringValidator=C;exports.boolean=N;exports.createStandardSchema=D;exports.object=G;exports.string=K;exports.useAnimatedElementToggle=M;exports.useAnimatedToggle=F;exports.useFocusTrap=P;exports.useTimedToggle=U;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tempots/dom"),A=require("../timer-BdH4cK6a.cjs"),I=require("../link-portal-_tiDFZqh.cjs"),B=require("../theme-B7C5kIJj.cjs"),p="https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/",W=e=>{if(!e||typeof e!="object")return!1;const t=e;return!!(t.editor&&typeof t.editor.create=="function"&&t.languages)};function M(){if(typeof self>"u")return;const e=self.MonacoEnvironment;if(e&&(typeof e.getWorkerUrl=="function"||typeof e.getWorker=="function"))return;const t=()=>{const a=[`self.MonacoEnvironment = { baseUrl: '${p}' };`,`importScripts('${p}vs/base/worker/workerMain.js');`].join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tempots/dom"),A=require("../timer-BdH4cK6a.cjs"),I=require("../link-portal-_tiDFZqh.cjs"),B=require("../theme-Dt6lCAvY.cjs"),p="https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/",W=e=>{if(!e||typeof e!="object")return!1;const t=e;return!!(t.editor&&typeof t.editor.create=="function"&&t.languages)};function M(){if(typeof self>"u")return;const e=self.MonacoEnvironment;if(e&&(typeof e.getWorkerUrl=="function"||typeof e.getWorker=="function"))return;const t=()=>{const a=[`self.MonacoEnvironment = { baseUrl: '${p}' };`,`importScripts('${p}vs/base/worker/workerMain.js');`].join(`
2
2
  `),i=new Blob([a],{type:"text/javascript"});return URL.createObjectURL(i)};self.MonacoEnvironment={getWorkerUrl(a,i){return t()}}}const F=e=>new Promise((t,a)=>{if(document.querySelector(`script[src="${e}"]`))return t();const s=document.createElement("script");s.src=e,s.async=!0;const l=document.querySelector("script[nonce]")?.getAttribute("nonce");l&&s.setAttribute("nonce",l),s.onload=()=>t(),s.onerror=h=>{console.error("[BeatUI] Failed to load script",e,h),a(new Error(`Failed to load script ${e}`))},document.head.appendChild(s)}),R=async()=>{const e=window;if((!e.require||!e.require.config)&&(await F(`${p}vs/loader.js`),await new Promise(t=>setTimeout(t,100)),!e.require))throw new Error("AMD loader failed to initialize");return e.require.config?.({baseUrl:p,paths:{vs:"vs"}}),e.require},$=async()=>{const e=window;if(e.monaco&&W(e.monaco))return e.monaco;M();const t=await R();if(await new Promise((a,i)=>{const s=setTimeout(()=>i(new Error("Timeout loading editor.main")),3e4);try{t(["vs/editor/editor.main"],()=>{clearTimeout(s),a()},l=>{clearTimeout(s),i(l)})}catch(l){clearTimeout(s),i(l)}}),!e.monaco)throw new Error("Monaco failed to initialize after loading editor.main");return e.monaco};let w=null;const v=new Map;let g=!1;async function S(){if(w)return w;!g&&typeof window<"u"&&(M(),g=!0);const e=await $();return w=e,e}async function _(e){if(v.has(e))return v.get(e);const t=(async()=>{const a=await S();switch(e){case"typescript":case"javascript":{a.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),a.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1});break}case"json":{a.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:[],enableSchemaRequest:!0});break}case"css":case"scss":case"less":{a.languages.css.cssDefaults.setOptions({validate:!0});break}case"html":break;case"markdown":break;case"yaml":{a.languages.getLanguages().some(s=>s.id==="yaml")||a.languages.register({id:"yaml",extensions:[".yml",".yaml"]});break}}})();return v.set(e,t),t}async function O(e){const[t]=await Promise.all([S(),_(e)]);return t}function z(e){if(typeof window>"u")return;const t=window;e?(t.MonacoEnvironment={getWorker:e},g=!0):t.MonacoEnvironment||(M(),g=!0)}const N=e=>{const{value:t,onChange:a,onBlur:i,language:s="plaintext",readOnly:l=!1,editorOptions:h,jsonSchemas:V,autofocus:j,class:q,disabled:D,hasError:C,id:L,name:x,placeholder:P}=e,b=o.Value.toSignal(l);return o.Use(B.Theme,({appearance:T})=>o.html.div((e.cssInjection??"none")==="none"?null:o.Task(()=>Promise.resolve().then(()=>require("../styles-url-CZUL_YRT.cjs")),({default:u})=>I.LinkPortal({id:"beatui-monaco-css",href:u})),o.attr.class("bc-monaco-editor-container"),o.attr.class(q),o.attr.class(o.Value.map(C??!1,u=>u?"bc-input-container--error":"")),o.attr.id(L),o.attr.name(x),o.WithElement(u=>{let m=null;const c=[];return(async()=>{try{let d=function(){const n=r.getValue();a?.(n)};const f=o.Value.get(s)??"plaintext";if(m=(await O(f)).editor.create(u,{value:o.Value.get(t)??"",language:f,readOnly:o.Value.get(b)??!1,automaticLayout:!0,minimap:{enabled:!1},...h??{}}),!m)throw new Error("Failed to create Monaco editor");const r=m;c.push(o.effectOf(s,V)(async(n,y)=>{const E=await O(n);if(n==="json"){const U={validate:!0,enableSchemaRequest:!0,schemas:!!(y&&y.length)?y:[]};E.languages.json.jsonDefaults.setDiagnosticsOptions(U)}const k=r.getModel();k&&E.editor.setModelLanguage(k,n)})),c.push(r.onDidChangeModelContent(A.I(500,d)).dispose),c.push(r.onDidBlurEditorText(()=>{d(),i?.()}).dispose),c.push(o.Value.on(t,n=>{n!==r.getValue()&&r.setValue(n??"")})),c.push(o.Value.on(b,n=>{r.updateOptions({readOnly:n??!1})})),c.push(o.Value.on(D??!1,n=>{r.updateOptions({readOnly:n??!1})})),c.push(o.Value.on(j??!1,n=>{n&&r.focus()})),c.push(o.Value.on(P??"",n=>{r.updateOptions({placeholder:n??""})})),c.push(T.on(n=>{r.updateOptions({theme:n==="dark"?"vs-dark":"vs"})}))}catch(d){console.error("[BeatUI] Failed to initialize Monaco editor:",d);const f=u;f.textContent="Failed to load Monaco Editor. Please ensure monaco-editor is installed."}})(),o.OnDispose(()=>{try{c.forEach(d=>d())}catch{}try{m?.dispose()}catch{}})})))};exports.MonacoEditorInput=N;exports.configureMonacoEnvironment=z;
@@ -1,7 +1,7 @@
1
1
  import { Value as c, Use as B, html as I, Task as W, attr as m, WithElement as F, OnDispose as R, effectOf as $ } from "@tempots/dom";
2
2
  import { I as _ } from "../timer-CQlK5LhW.js";
3
3
  import { L as z } from "../link-portal-Cr2l9f3k.js";
4
- import { T as N } from "../theme-DsQOxXW1.js";
4
+ import { T as N } from "../theme-B5pmbvQ_.js";
5
5
  const g = "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/", G = (e) => {
6
6
  if (!e || typeof e != "object") return !1;
7
7
  const o = e;