@solibo/solibo-ui 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index48.css +1 -1
- package/dist/components/controls/index.cjs +2 -1
- package/dist/components/controls/index.cjs.map +1 -1
- package/dist/components/controls/index.js +57 -54
- package/dist/components/controls/index.js.map +1 -1
- package/dist/components/dropdown/index.cjs +1 -1
- package/dist/components/dropdown/index.js +1 -1
- package/dist/components/editor/index.cjs +1 -1
- package/dist/components/editor/index.js +1 -1
- package/dist/components/graph/index.cjs +1 -1
- package/dist/components/graph/index.js +26 -26
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/message/index.cjs +1 -1
- package/dist/components/message/index.cjs.map +1 -1
- package/dist/components/message/index.js +34 -28
- package/dist/components/message/index.js.map +1 -1
- package/dist/components/nav/index.cjs +1 -1
- package/dist/components/nav/index.js +32 -32
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +1 -1
- package/dist/index-DWDp66fp.cjs +2 -0
- package/dist/{index-CQlMdqOp.cjs.map → index-DWDp66fp.cjs.map} +1 -1
- package/dist/index-Ds-Ocs4L.js +83 -0
- package/dist/{index-CbJ2-IPc.js.map → index-Ds-Ocs4L.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/tokens.json +1 -1
- package/package.json +1 -1
- package/dist/index-CQlMdqOp.cjs +0 -2
- package/dist/index-CbJ2-IPc.js +0 -83
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";require('../../assets/index42.css');var nm=Object.defineProperty;var rm=(n,e,t)=>e in n?nm(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var M=(n,e,t)=>rm(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react/jsx-runtime"),q=require("react"),Wd=require("react-dom"),hi=require("../../classix-5H4IWnMA.cjs"),im=require("../file/index.cjs"),yt=require("../button/index.cjs"),Lt=require("../icon/index.cjs"),oc=require("../../index-
|
|
1
|
+
"use strict";require('../../assets/index42.css');var nm=Object.defineProperty;var rm=(n,e,t)=>e in n?nm(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var M=(n,e,t)=>rm(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react/jsx-runtime"),q=require("react"),Wd=require("react-dom"),hi=require("../../classix-5H4IWnMA.cjs"),im=require("../file/index.cjs"),yt=require("../button/index.cjs"),Lt=require("../icon/index.cjs"),oc=require("../../index-DWDp66fp.cjs"),sm=require("../toolbar/index.cjs");function Hu(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);return t.search=r.toString(),new Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function P(n,...e){throw Hu(n,...e)}function Ga(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function om(){return typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0}const It=om();function um(){return It&&"documentMode"in document?document.documentMode:null}const am=um();function lm(n){return It&&n.test(navigator.platform)}function Hi(n){return It&&n.test(navigator.userAgent)}const Vn=lm(/Mac|iPod|iPhone|iPad/),rn=Hi(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function cm(){return!(!It||!("InputEvent"in window)||am)&&"getTargetRanges"in new window.InputEvent("input")}const Ir=cm();function fm(){return It&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}const Ct=fm(),Hd=Hi(/Android/),Vi=Hi(/Version\/[\d.]+.*Safari/)&&!Hd,Ja=Hi(/^(?=.*Chrome).*/i),Xs=It&&Hd&&Ja,Gi=Hi(/AppleWebKit\/[\d.]+/)&&Vn&&!Ja;function dm(){return 2047}const hm=dm(),Ci=Vi||Ct||Gi?" ":"",$n=`
|
|
2
2
|
|
|
3
3
|
`,Xa=rn?" ":Ci,Ke={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Vd={directionless:1,unmergeable:2},Pr={center:2,end:6,justify:4,left:1,right:3,start:5};function Gd(n){const e={};for(const t of Object.keys(n))e[n[t]]=t;return e}const Jd=Gd(Pr),Ya={normal:0,segmented:2,token:1},Xd=Gd(Ya),Qa="$",gm=Symbol.for("@lexical/ctrlOrOtherKey"),du="$config";function hu(){return Pe()._blockCursorElement}function gu(n){return n!==null&&n.nodeType===1&&n.hasAttribute("data-lexical-slot")}const pm=Gi||Ct||Vi;function uc(){const n=Ie().createElement("img");n.setAttribute("data-lexical-decorator-boundary","true"),n.alt="";for(const[e,t]of[["position","absolute"],["width","0px"],["height","0px"],["border","0px"],["margin","0px"],["padding","0px"]])n.style.setProperty(e,t,"important");return n}function Ys(n){return n!==null&&n.nodeType===1&&n.hasAttribute("data-lexical-decorator-boundary")}class Sr{constructor(e,t,r){M(this,"element");M(this,"before");M(this,"after");this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new Sr(this.element,e,this.after)}withAfter(e){return new Sr(this.element,this.before,e)}withElement(e){return this.element===e?this:new Sr(e,this.before,this.after)}insertChild(e){const t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&P(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&P(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&P(359),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,r){if(this.element===e)return t===e&&r===0?"before":"after";const i=ac(e,this.element);if(i===null)return"after";const s=Array.prototype.indexOf.call(e.childNodes,i);if(s<0)return"after";if(t===e)return r<=s?"before":"after";const o=ac(e,t);if(o===null)return"after";const u=Array.prototype.indexOf.call(e.childNodes,o);return u>=0&&u<=s?"before":"after"}getInsertionAnchor(){return this.before}}function ac(n,e){let t=e;for(;t!==null&&t.parentNode!==n;)t=t.parentNode;return t}let Yd=class Ps extends Sr{withBefore(e){return new Ps(this.element,e,this.after)}withAfter(e){return new Ps(this.element,this.before,e)}withElement(e){return this.element===e?this:new Ps(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor("trailing")}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;gu(t);)e=t,t=t.nextSibling;Ys(t)&&(e=t,t=t.nextSibling);const r=e?e.nextSibling:this.element.firstChild;return r!==null&&r===hu()?r:e}getDecoratorBoundaryAnchor(e){let t;if(e==="leading"){const r=super.getFirstChildAnchor();for(t=r?r.nextSibling:this.element.firstChild;gu(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===hu()&&(t=t.previousSibling);return Ys(t)?t:null}setDecoratorBoundaryAnchor(e,t){const r=this.getDecoratorBoundaryAnchor(e);if(t!==(r!==null))if(r!==null)this.element.removeChild(r);else if(e==="leading"){const i=this.getFirstChildAnchor();this.element.insertBefore(uc(),i?i.nextSibling:this.element.firstChild)}else this.element.insertBefore(uc(),this.before)}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){const t=this.element,r=this.after===null?t.firstChild:this.after.nextSibling,i=e==="empty"&&gu(r)?null:e;if(t.__lexicalLastChildKind!==i)if(t.__lexicalLastChildKind=i,i===null)this.removeManagedLineBreak();else{const s=i==="decorator"&±this.insertManagedLineBreak(s)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before||this.getDecoratorBoundaryAnchor("trailing"),s=Ie().createElement("br");if(s.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(s,i),e){const o=Ie().createElement("img");o.setAttribute("data-lexical-managed-linebreak","true"),o.style.setProperty("display","inline","important"),o.style.setProperty("border","0px","important"),o.style.setProperty("margin","0px","important"),o.alt="",r.insertBefore(o,s),r.__lexicalLineBreak=o}else r.__lexicalLineBreak=s}getFirstChildOffset(){const e=this.getFirstChild(),t=this.getInsertionAnchor();let r=0;for(let i=this.element.firstChild;i!==null&&i!==e&&i!==t;i=i.nextSibling)r++;return r}resolveChildIndex(e,t,r,i){if(r===this.element){const a=this.getFirstChildOffset(),l=hu(),c=this.element.childNodes,h=Math.min(i,c.length);let f=0;for(let d=a;d<h;d++)c[d]!==l&&f++;return[e,Math.min(f,e.getChildrenSize())]}const s=lc(t,r);s.push(i);const o=lc(t,this.element);let u=e.getIndexWithinParent();for(let a=0;a<o.length;a++){const l=s[a],c=o[a];if(l===void 0||l<c)break;if(l>c){u+=1;break}}return[e.getParentOrThrow(),u]}};function lc(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let i=0;for(let s=r.previousSibling;s!==null;s=s.previousSibling)i++;t.push(i)}return r!==n&&P(225),t.reverse()}function mm(){let n;try{n="0.52.0+prod.esm"}catch{}return n??'"<unknown>+source"'}const Qd=mm();let si=class{constructor(){M(this,"_front",new Set);M(this,"_back",new Set);M(this,"_cache")}get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){const e=Array.from(this._front).reverse();for(const t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const Pn=null;function Zd(n,e=1e3){return n instanceof Vu?n.clone():n.size<e?new Map(n):new Vu().init(new Map(n),void 0,n.size)}let Vu=class e0{constructor(){M(this,"_mutable",!1);M(this,"_old");M(this,"_nursery");M(this,"_size",0)}clone(){return this._mutable=!1,new e0().init(this._old,this._nursery,this._size)}init(e,t,r){return this._old=e,this._nursery=t,this._size=r,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){const t=this._nursery&&this._nursery.get(e);return t!==void 0?t:this._old&&this._old.get(e)}get(e){const t=this.getWithTombstone(e);return t===Pn?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){const t=new Map(this._old);for(const[r,i]of this._nursery)i!==Pn?t.set(r,i):t.delete(r);this._old=t,this._nursery=void 0}return this._mutable=!1,this}set(e,t){const r=this.getWithTombstone(e);if(r===t)return this;const i=this.getNursery();return r!==Pn&&r!==void 0||(this._size++,r===Pn&&i.delete(e)),i.set(e,t),this}delete(e){const t=this.has(e);return t&&(this.getNursery().set(e,Pn),this._size--),t}getOrInsert(e,t){const r=this.get(e);return r!==void 0?r:(this.set(e,t),t)}getOrInsertComputed(e,t){const r=this.get(e);if(r!==void 0)return r;const i=t(e);return this.set(e,i),i}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const e of this.entries())yield e[0]}*values(){for(const e of this.entries())yield e[1]}*entries(){const e=this._nursery,t=this._old;if(e){if(t)for(const r of t){const i=r[0],s=e.get(i);s!==Pn&&(s!==void 0&&(r[1]=s),yield r)}for(const r of e)r[1]===Pn||t&&t.has(r[0])||(yield r)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(const[r,i]of this.entries())e(i,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}},gi=!1;function bm(n,e,...t){const r=gi;let i;try{gi=n,i=e()}finally{gi=r}var s;return(s=i)===null||typeof s!="object"&&typeof s!="function"||typeof s.then!="function"||P(421),i}function ym(){return gi}function t0(n){const e=n.exportJSON(gi),t=n.constructor;return e.type!==t.getType()&&P(130,t.name),T(n)&&!Array.isArray(e.children)&&P(59,t.name),e}function Qs(n,e,t,r,i,s){if(T(n)){let o=n.getFirstChild();for(;o!==null;){const u=o.__key;o.__parent===e&&((T(o)||Kn(o)&&o.__slots!==null)&&Qs(o,u,t,r,i,s),t.has(u)||s.delete(u),i.push(u)),o=o.getNextSibling()}}for(const o of Kn(n)&&n.__slots!==null?n.__slots.values():[]){const u=r.get(o);u!==void 0&&er(u)&&u.__slotHost===e&&((T(u)||Kn(u)&&u.__slots!==null)&&Qs(u,o,t,r,i,s),t.has(o)||s.delete(o),i.push(o))}}let Gu=!1,Za=0;function _m(n){Za=n.timeStamp}function pu(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&hr(n,t)!==void 0}function xm(n,e,t){const r=nt(dt(t)),i=r&&ct(r,t._rootElement);let s=null,o=null;i!==null&&i.anchorNode===n&&(s=i.anchorOffset,o=i.focusOffset);const u=n.nodeValue;u!==null&&xl(e,u,s,o,!1)}function vm(n,e,t){if(F(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return Tt(e)&&t.isAttached()}function Sm(n,e,t){for(let r=n;r&&!$h(r);r=nn(r)){const i=hr(r,e);if(i!==void 0){const s=he(i,t);if(s)return ie(s)||!ce(r)?void 0:[r,s]}}}function n0(n,e,t){Gu=!0;const r=performance.now()-Za>100;try{gt(n,()=>{const i=z()||function(h){return h.read("latest",()=>{const f=z();return f!==null?f.clone():null})}(n),s=new Map,o=n._editorState,u=n._blockCursorElement;let a=!1,l="";for(let h=0;h<e.length;h++){const f=e[h],d=f.type,g=f.target,b=Sm(g,n,o);if(!b)continue;const[m,p]=b;if(d==="characterData")r&&B(p)&&Tt(g)&&vm(i,g,p)&&xm(g,p,n);else if(d==="childList"){a=!0;const y=f.addedNodes;for(let S=0;S<y.length;S++){const C=y[S],A=Th(C),O=C.parentNode;if(!(O==null||C===u||A!==null||pu(C,O,n)||Ys(C)||n._slotsUsed&&ce(C)&&C.hasAttribute("data-lexical-slot")||$h(C))){if(rn){const D=(ce(C)?C.innerText:null)||C.nodeValue;D&&(l+=D)}O.removeChild(C)}}const _=f.removedNodes,x=_.length;if(x>0){let S=0;for(let C=0;C<x;C++){const A=_[C];pu(A,g,n)||u===A?(g.appendChild(A),S++):Ys(A)&&S++}x!==S&&s.set(m,p)}}}if(s.size>0)for(const[h,f]of s)f.reconcileObservedMutation(h,n);const c=t.takeRecords();if(c.length>0){for(let h=0;h<c.length;h++){const f=c[h],d=f.addedNodes,g=f.target;for(let b=0;b<d.length;b++){const m=d[b],p=m.parentNode;p==null||m.nodeName!=="BR"||pu(m,g,n)||p.removeChild(m)}}t.takeRecords()}i!==null&&(a&&Me(i),rn&&Dh(n)&&i.insertRawText(l))})}finally{Gu=!1}}function r0(n){const e=n._observer;e!==null&&n0(n,e.takeRecords(),e)}function i0(n){(function(e){Za===0&&dt(e).addEventListener("textInput",_m,!0)})(n),n._observer=new MutationObserver((e,t)=>{n0(n,e,t)})}function s0(n,e,t){const{isEqual:r}=n;return e===t||r!==void 0&&r(e,t)}function el(n,e){return s0(n,e,n.defaultValue)}function Cn(n){return typeof n=="object"&&n!==null}function An(n,e){const t=$o(n,e).getter;return Cn(t)&&t.getterTable!==void 0||P(405,e),tl(t.getterTable)}function ur(n,e){const t=$o(n,e).setter;return Cn(t)&&t.setterTable!==void 0||P(406,e),tl(t.setterTable)}function Zs(n,e,t){let{meta:r}=$o(n,e);for(let i=0;;){if(r.kind==="aliased")return tl(r.aliases);r.kind==="nullable"||r.kind==="optional"?r=r.inner.meta:r.kind==="array"?r=r.item.meta:P(407,e,String(t))}}function ar(n,e){const t=$o(n,e),{setter:r}=t;Cn(r)&&r.setterTable!==void 0||P(408,e);const i=String(t.defaultValue);return vn(r.setterTable,i)||P(409,e,i),r.setterTable[i]}function tl(n){return Object.assign(Object.create(null),n)}function $o(n,e){const t=n.get(e);return t===void 0&&P(410,e),t}function lr(n,e,t,r,i){i!==void 0&&wm.add(i);const s=t===void 0,o=s?n(void 0):t;return s&&u0(o),Object.assign(n,{accepts:i,defaultValue:o,isEqual:r,meta:e})}const wm=new WeakSet,o0=new WeakSet;function Cm(n){return n!==null&&typeof n=="object"&&o0.add(n),n}function u0(n){if(n!==null&&typeof n=="object"&&!Object.isFrozen(n)&&!o0.has(n)){Object.freeze(n);for(const e of Object.values(n))u0(e)}}function a0(n){const{isEqual:e}=n;return e===void 0?void 0:(t,r)=>t==null||r==null?t===r:e(t,r)}function l0(n,e){return t=>e(t)||nl(n,t)}function nl(n,e){const{accepts:t}=n;return t!==void 0?t.call(n,e):function(r,i){const{accepts:s}=r;if(s!==void 0)return nl(r,i)?{parsed:r(i)}:void 0;const o=r(i);return el(r,o)&&i!==r.defaultValue?void 0:{parsed:o}}(n,e)!==void 0}function vn(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function mn(n=""){return lr(e=>typeof e=="string"?e:n,{kind:"string"},void 0,void 0,e=>typeof e=="string")}const Tm=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Tn(n=0,e={}){const{integer:t,clamp:r}=e,i=t&&e.min!==void 0?Math.ceil(e.min):e.min,s=t&&e.max!==void 0?Math.floor(e.max):e.max,o=l=>typeof l=="string"&&Tm.test(l)?Number(l):l,u=l=>typeof l=="number"&&Number.isFinite(l)&&(!t||Number.isInteger(l)),a=l=>u(l)&&(i===void 0||l>=i)&&(s===void 0||l<=s);return lr(l=>{const c=o(l);return r&&u(c)?i!==void 0&&c<i?i:s!==void 0&&c>s?s:c:a(c)?c:n},{clamp:r,integer:t,kind:"number",max:s,min:i},void 0,void 0,l=>r?u(o(l)):a(o(l)))}function c0(n=!1){return lr(e=>typeof e=="boolean"?e:n,{kind:"boolean"},void 0,void 0,e=>typeof e=="boolean")}function Lr(n,...e){const t=Cm(e.length!==0?e[0]:n[0]),r=new Set(n);return lr(i=>i!==void 0&&r.has(i)?i:t,{kind:"enum",values:n},t,void 0,i=>r.has(i)&&(i!==void 0||t===void 0))}function mu(n,e={}){const{defaultAsNull:t}=e;return lr(r=>{if(r==null)return null;const i=n(r);return t&&el(n,i)?null:i},{defaultAsNull:t,inner:n,kind:"nullable"},void 0,a0(n),l0(n,r=>r==null))}function Em(n,e={}){const{omitDefault:t}=e;return lr(r=>{if(r===void 0)return;const i=n(r);return t&&el(n,i)?void 0:i},{inner:n,kind:"optional",omitDefault:t},void 0,a0(n),l0(n,r=>r===void 0))}function cr(){return n=>function(e){return{meta:{fields:e,kind:"node"}}}(n)}function Ju(n,e){const t=r=>typeof r=="string"&&vn(e,r);return lr(r=>t(r)?e[r]:n(r),{aliases:e,inner:n,kind:"aliased"},n.defaultValue,n.isEqual,r=>t(r)||nl(n,r))}function Ze(n,e){return f0(0,n,{getter:{field:e.field,getterTable:e.getterTable,method:e.getter,when:e.when},setter:{field:e.field,method:e.setter,setterTable:e.setterTable}})}function Sn(n,e){return f0(0,n,e)}function f0(n,e,t){return Object.assign(r=>e(r),{accepts:e.accepts,defaultValue:e.defaultValue,getter:t.getter,isEqual:e.isEqual,meta:e.meta,setter:t.setter})}const cc="latest";class Nm{constructor(e,t){M(this,"key");M(this,"parse");M(this,"unparse");M(this,"isEqual");M(this,"defaultValue");M(this,"resetOnCopyNode");M(this,"schema");this.key=e;const r="meta"in(i=t.parse)&&typeof i.meta=="object"&&i.meta!==null&&"kind"in i.meta&&typeof i.meta.kind=="string"&&"defaultValue"in i?t.parse:void 0;var i;this.schema=r,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Mm).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):r!==void 0&&r.isEqual!==void 0?(s,o)=>s0(r,s,o):Object.is,this.defaultValue=r!==void 0?r.defaultValue:this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}}function km(n,e){return new Nm(n,e)}function Am(n,e,t=cc){const r=(t===cc?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function Om(n,e,t){let r;if(Be(),typeof t=="function"){const s=n.getLatest(),o=Am(s,e);if(r=t(o),e.isEqual(o,r))return s}else r=t;const i=n.getWritable();return d0(i).updateFromKnown(e,r),i}function Dm(n){const e=new Map,t=new Set;for(const{ownNodeConfig:r}of Zn(typeof n=="function"?n:n.replace))if(r&&r.stateConfigs)for(const i of r.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&t.add(s.key)):s=i,e.set(s.key,s)}return{flatKeys:t,sharedConfigMap:e}}const fc=new Set(["__proto__","constructor","prototype"]);class rl{constructor(e,t,r=void 0,i=new Map,s=void 0){M(this,"node");M(this,"knownState");M(this,"unknownState");M(this,"sharedNodeState");M(this,"size");this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:o}=this.sharedNodeState,u=s!==void 0?s:function(a,l,c){let h=c.size;if(l)for(const f in l){const d=a.get(f);d&&c.has(d)||h++}return h}(o,r,i);this.size=u}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return dc(e)&&(t[Qa]=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new rl(e,t,function(s,o,u){let a;if(u)for(const[l,c]of Object.entries(u)){if(fc.has(l))continue;const h=s.get(l);h?o.has(h)||o.set(h,h.parse(c)):(a=a||{},a[l]=c)}return a}(t.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(const e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||(s&&(delete s[r],this.unknownState=dc(s)),this.size++),i.set(e,t)}updateFromUnknown(e,t){if(fc.has(e))return;const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}}function d0(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new rl(e,function(r){return r.__state?r.__state.sharedNodeState:Sh(Pe(),r.getType()).sharedNodeState}(e));return e.__state=t,t}function h0(n,e){const t=n.getWritable(),r=e[Qa];return(t.__state||r)&&d0(n).updateFromJSON(r),t}function dc(n){if(n)for(const e in n)return n}function Mm(n){return n}function hc(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const s=t?t.getValue(r):r.defaultValue;if(s!==i&&!r.isEqual(s,i))return!0}return!1}function gc(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[s,o]of Object.entries(r))if(!n.has(s)&&(n.add(s),o!==(i?i[s]:void 0)))return!0}return!1}function pc(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function mc(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,u=e.__style,a=n.__state,l=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===u)&&(n.__state===null||a===l||function(c,h){if(c===h)return!0;const f=new Set;return!(c&&hc(f,c,h)||h&&hc(f,h,c)||c&&gc(f,c,h)||h&&gc(f,h,c))}(a,l))}function bc(n,e){const t=n.mergeWithSibling(e),r=de()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function yc(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&B(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(mc(e,r)){r=bc(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&B(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(mc(r,t)){r=bc(r,t);break}break}t.remove()}}else r.remove()}function Rr(n){return _c(n.anchor),_c(n.focus),n}function _c(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),B(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!T(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}const eo=Symbol.for("@lexical/CachedTextSize");function xc(n,e){return Xu.read(()=>{let t=0,r=n;for(let i=0;i<e&&r!==null;i++){const s=At.get(r);if(s===void 0&&P(345,r),T(s)){const o=Se.get(r);if(o!==void 0&&T(o)&&o.__parent!==s.__parent)t+=s.getTextContentSize();else{const u=Gn.get(r),a=u&&u.__lexicalTextContent;typeof a!="string"&&P(346,s.getType()),t+=a.length}i<e-1&&!s.isInline()&&(t+=2)}else{const o=s[eo];o===void 0&&P(347,s.getType(),r),t+=o}r=s.__next}return t},{editor:le})}function g0(n){T(n)||n[eo]===void 0&&(n[eo]=B(n)?n.__text.length:n.getTextContentSize())}const Im=4;let Ti,le,Ei,se="",Oe=null,Ge=null,We=null;function Ft(){return{firstTextKey:We,format:Oe,style:Ge}}function xt(n){n.firstTextKey!==null&&(Oe=n.format,Ge=n.style,We=n.firstTextKey)}function bu(n){if(We!==null)return;const e=n.__lexicalFirstTextKey;if(e===void 0&&P(348),e===null)return;const t=Se.get(e);B(t)&&(Oe=t.getFormat(),Ge=t.getStyle(),We=e)}let Uo,pi,mi,At,Xu,Se,Gn,Yu,Ni,Jn,Xt=!1,Ls=!1;function bn(n,e){const t=At.get(n),r=Se.has(n);if(e!==null){const i=na(n);i.parentNode===e&&e.removeChild(i)}if(!r){if(le._keyToDOMMap.delete(n),T(t)){const i=wo(t,At);Qu(i,0,i.length-1,null)}if(t!==void 0){for(const i of _t(t).values()){const s=ea(i);bn(i,null),s!==null&&s.remove()}vl(Ni,Ei,Uo,t,"destroyed")}}}function Qu(n,e,t,r){for(let i=e;i<=t;++i){const s=n[i];s!==void 0&&bn(s,r)}}function Ln(n,e){n.setProperty("text-align",e)}const Pm="40px";function p0(n,e){const t=Ti.theme.indent;if(typeof t=="string"){const r=n.classList.contains(t);e>0&&!r?n.classList.add(t):e<1&&r&&n.classList.remove(t)}n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * var(--lexical-indent-base-value, ${Pm}))`),Mi(n,"class"),Mi(n,"style")}function m0(n,e){const t=n.style;e===0?Ln(t,""):e===1?Ln(t,"left"):e===2?Ln(t,"center"):e===3?Ln(t,"right"):e===4?Ln(t,"justify"):e===5?Ln(t,"start"):e===6&&Ln(t,"end"),Mi(n,"style")}function Zu(n,e){const t=function(r){const i=r.__dir;if(i!==null)return i;if(Ee(r))return null;const s=r.getParent();return s===null||pe(s)&&s.__dir===null?"auto":null}(e);t!==null?n.dir=t:n.removeAttribute("dir")}function b0(n){const e=Ie().createElement("div");return e.setAttribute("data-lexical-slot",n),e.style.display="none",e}function y0(n,e,t){e||n.contentEditable==="false"?Nb(t,le):t.removeAttribute("contenteditable")}function vc(n,e,t){const r=se,i=Ft();se="";let s="";const o=ie(n);for(const[u,a]of t){const l=b0(u);y0(e,o,l),e.appendChild(l),se="";const c=Ft();yn(a,ft(n,l,le)),xt(c),_0(n,u,e,l),s+=se}return xt(i),se=r,s}function _t(n){return Kn(n)&&n.__slots!==null?n.__slots:Kh}function _0(n,e,t,r){const i=Jn.$getSlotTargetElement(n,e,t,le);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display="")}function ea(n){const e=Gn.get(n);return e!==void 0?e.parentElement:null}function Sc(n,e,t){const r=_t(n),i=_t(e);for(const[c,h]of r)if(!i.has(c)){const f=ea(h);bn(h,null),f!==null&&f.remove()}const s=se,o=Ft();let u="",a=null;const l=ie(e);for(const[c,h]of i){const f=r.get(c);let d=f!==void 0?ea(f):null;se="";const g=Ft();if(d===null){d=b0(c);let b=null;for(const m of t.children)if(!m.hasAttribute("data-lexical-slot")){b=m;break}t.insertBefore(d,b),yn(h,ft(e,d,le))}else f===h?Qt(h,d):(f!==void 0&&bn(f,d),yn(h,ft(e,d,le)));if(xt(g),y0(t,l,d),_0(e,c,t,d),u+=se,d.parentElement===t){const b=a===null?t.firstChild:a.nextSibling;b!==d&&t.insertBefore(d,b),a=d}}return xt(o),se=s,u}function yn(n,e){const t=Se.get(n);if(t===void 0&&P(60),e!==null){const i=At.get(n);if(i!==void 0){const s=Gn.get(n);if(s!==void 0){const o=er(i)?i.__slotHost:null,u=er(t)?t.__slotHost:null,a=i.__parent!==t.__parent||o!==u,l=u!==null&&s.parentElement!==e.element;if(a||l)return e.insertChild(s),Qt(n,e.element)}}}const r=Jn.$createDOM(t,le);if(function(i,s,o){const u=o._keyToDOMMap;Eh(s,o,i),u.set(i,s)}(n,r,le),B(t)?r.setAttribute("data-lexical-text","true"):ie(t)&&(r.setAttribute("data-lexical-decorator","true"),Eb(r,{captureSelection:!0})),T(t)){const i=t.__indent,s=t.__size;Zu(r,t),i!==0&&p0(r,i);const o=_t(t),u=o.size>0?vc(t,r,o):"";if(s===0)r.__lexicalTextContent=u,r.__lexicalFirstTextKey=null,se+=u,o.size>0&&(r.__lexicalSlotTextLength=u.length);else{const l=se,c=s-1;if(ta(wo(t,Se),t,0,c,ft(t,r,le)),u!==""){const h=r.__lexicalTextContent||"";r.__lexicalTextContent=u+h,se=l+u+h}o.size>0&&(r.__lexicalSlotTextLength=u.length)}const a=t.__format;a!==0&&m0(r,a),t.isInline()||(v0(0,t,r),x0(t,r))}else{const i=t.getTextContent();if(ie(t)){const s=t.decorate(le,Ti);s!==null&&S0(n,s),r.contentEditable="false";const o=_t(t);o.size>0&&vc(t,r,o)}se+=i}return e!==null&&e.insertChild(r),Jn.$decorateDOM(t,null,r,le),g0(t),vl(Ni,Ei,Uo,t,"created"),r}function ta(n,e,t,r,i){const s=se,o=Ft();se="",Oe=null,Ge=null,We=null;let u=t;for(;u<=r;++u){const l=Ft();yn(n[u],i);const c=Se.get(n[u]);c!==null&&B(c)?Oe===null&&(Oe=c.getFormat(),Ge=c.getStyle(),We=c.__key):T(c)&&u<r&&!c.isInline()&&(se+=$n),xt(l)}const a=le._keyToDOMMap.get(e.__key);a===void 0&&P(349,e.__key),a.__lexicalTextContent=se,a.__lexicalFirstTextKey=We,se=s+se,xt(o)}function wc(n,e){if(!n)return!1;const t=e.get(n);return ie(t)&&!t.isInline()}function x0(n,e){const t=ft(n,e,le);t.setDecoratorBoundaryAnchor("leading",wc(n.__first,Se)),t.setDecoratorBoundaryAnchor("trailing",wc(n.__last,Se))}function v0(n,e,t){const r=ft(e,t,le),i=function(s,o){if(s){const u=s.__last;if(u){const a=o.get(u);if(a)return et(a)?"line-break":ie(a)&&a.isInline()?"decorator":null}return"empty"}return null}(e,Se);r.setManagedLineBreak(i)}function Cc(n,e,t){const r=e.__lexicalFirstTextKey;if(r!=null){const i=n.__key;let s=r;for(;s!==null;){const o=Se.get(s);if(o===void 0){s=null;break}if(o.__parent===i)break;s=o.__parent}if(s!==null&&!t.has(s)){const o=Se.get(r);if(B(o))return Oe=o.getFormat(),void(Ge=o.getStyle())}}e.__lexicalFirstTextKey=We}function Qt(n,e){const t=At.get(n);let r=Se.get(n);t!==void 0&&r!==void 0||P(61);const i=Xt||mi.has(n)||pi.has(n),s=Ar(le,n);if(t===r&&!i){let o;if(T(t)){const u=s.__lexicalTextContent;typeof u!="string"&&P(355,t.getType()),o=u,bu(s)}else o=t.getTextContent();return se+=o,s}if(t!==r&&i&&vl(Ni,Ei,Uo,r,"updated"),Jn.$updateDOM(r,t,s,le)){const o=yn(n,null);return e===null&&P(62),e.replaceChild(o,s),bn(n,null),o}if(T(t)){T(r)||P(334,n);const o=r.__indent;(Xt||o!==t.__indent)&&p0(s,o);const u=r.__format;(Xt||u!==t.__format)&&m0(s,u);const a=i&&(_t(r).size>0||_t(t).size>0)?Sc(t,r,s):"";if(i){const l=se;if(function(c,h,f){var d;Oe=null,Ge=null,We=null,function(g,b,m){const p=se,y=g.__size,_=b.__size;se="";const x=m.element,S=le._keyToDOMMap.get(b.__key);S===void 0&&P(351,b.__key);const C=_-y;if(!Xt&&Math.abs(C)<=1&&y>=Im&&g.__first===b.__first&&(C!==0||!le._cloneNotNeeded.has(g.__key))){const A=S.__lexicalTextContent,O=Yu.get(g.__key);if(!Xt&&typeof A=="string"&&O!==void 0){const D=function(k,v){const E=v.size;if(E===0||E>=k.__size)return null;let N=k.__last,R=null,w=0;for(;N!==null&&w<E;){if(!v.has(N))return null;R=N;const L=Se.get(N);if(L===void 0)return null;N=L.__prev,w++}return w!==E||N!==null&&v.has(N)?null:R}(b,O);if(D!==null){const k=O.size;if(C===0){const v=xc(D,k);let E=D,N=0;for(;E!==null&&N<k;){const U=Se.get(E);if(U===void 0)break;const H=Ft();Qt(E,x),B(U)&&Oe===null&&(Oe=U.getFormat(),Ge=U.getStyle(),We=U.__key),xt(H),E=U.__next,N++}let R="";for(E=D,N=0;E!==null&&N<k;){const U=Se.get(E);if(U===void 0)break;let H;if(T(U)){const V=le._keyToDOMMap.get(E),te=V&&V.__lexicalTextContent;typeof te!="string"&&P(352,U.getType()),H=te}else H=U.getTextContent();R+=H,N<k-1&&T(U)&&!U.isInline()&&(R+=$n),E=U.__next,N++}const w=S.__lexicalSlotTextLength||0,L=w>0?A.slice(w):A,I=L.slice(0,L.length-v)+R;return S.__lexicalTextContent=I,se=p+I,void Cc(b,S,O)}if(function(v,E,N,R,w,L,I,U){if(U!==1&&U!==-1||I!==(U===1?2:1))return!1;const H=I-U;let V=v.__last;for(let Q=0;Q<H-1;Q++){if(V===null)return!1;const be=At.get(V);if(be===void 0)return!1;V=be.__prev}if(V===null)return!1;const te=Se.get(L),ge=At.get(V);if(te===void 0||ge===void 0||te.__prev!==ge.__prev)return!1;const j=[];let $=L;for(let Q=0;Q<I;Q++){if($===null)return!1;j.push($);const be=Se.get($);$=be?be.__next:null}const G=[];$=V;for(let Q=0;Q<H;Q++){if($===null)return!1;G.push($);const be=At.get($);$=be?be.__next:null}const X=new Set(G),Z=new Set(j),Ce=[];let Ae=0,ve=0;for(;Ae<H&&ve<I;)if(j[ve]===G[Ae])Ce.push({key:j[ve],kind:"reconcile"}),Ae++,ve++;else if(Z.has(G[Ae])){if(X.has(j[ve]))return!1;Ce.push({key:j[ve],kind:"create",nextIndex:ve}),ve++}else Ce.push({key:G[Ae],kind:"destroy"}),Ae++;for(;Ae<H;)Ce.push({key:G[Ae++],kind:"destroy"});for(;ve<I;)Ce.push({key:j[ve],kind:"create",nextIndex:ve}),ve++;const ii=xc(V,H);for(const Q of Ce){const be=Ft();if(Q.kind==="reconcile")Qt(Q.key,N.element);else if(Q.kind==="destroy")bn(Q.key,N.element);else{let Le=null;for(let Fe=Q.nextIndex+1;Fe<I;Fe++){const it=le._keyToDOMMap.get(j[Fe]);if(it!==void 0){Le=it;break}}yn(Q.key,N.withBefore(Le??N.before))}if(Q.kind!=="destroy"){const Le=Se.get(Q.key);Le&&B(Le)&&Oe===null&&(Oe=Le.getFormat(),Ge=Le.getStyle(),We=Le.__key)}xt(be)}let dn="";for(let Q=0;Q<I;Q++){const be=Se.get(j[Q]);if(be===void 0)return!1;let Le;if(T(be)){const Fe=le._keyToDOMMap.get(j[Q]),it=Fe&&Fe.__lexicalTextContent;typeof it!="string"&&P(350,be.getType()),Le=it}else Le=be.getTextContent();dn+=Le,Q<I-1&&T(be)&&!be.isInline()&&(dn+=$n)}const hn=R.__lexicalSlotTextLength||0,W=hn>0?w.slice(hn):w;return R.__lexicalTextContent=W.slice(0,W.length-ii)+dn,!0}(g,0,m,S,A,D,k,C)){const v=S.__lexicalTextContent;return typeof v!="string"&&P(353),se=p+v,void Cc(b,S,O)}}}if(C===0){let D=g.__first,k=0;for(;D!==null;){const v=Se.get(D);if(v===void 0)break;const E=Xt||mi.has(D)||pi.has(D),N=Ft();if(E)Qt(D,x);else{let R,w;if(T(v)){w=Gn.get(D);const L=w&&w.__lexicalTextContent;typeof L!="string"&&P(354,v.getType()),R=L}else R=v.getTextContent();se+=R,w!==void 0&&bu(w)}B(v)?Oe===null&&(Oe=v.getFormat(),Ge=v.getStyle(),We=v.__key):T(v)&&k<_-1&&!v.isInline()&&(se+=$n),xt(N),D=v.__next,k++}return S.__lexicalTextContent=se,S.__lexicalFirstTextKey=We,void(se=p+se)}}if(y===1&&_===1){const A=g.__first,O=b.__first;if(A===O)Qt(A,x);else{const k=na(A),v=yn(O,null);try{k.parentNode===x?x.replaceChild(v,k):m.insertChild(v)}catch(E){if(typeof E=="object"&&E!=null){const N=`${E.toString()} Parent: ${x.tagName}, new child: {tag: ${v.tagName} key: ${O}}, old child: {tag: ${k.tagName}, key: ${A}}.`;throw new Error(N)}throw E}bn(A,null)}const D=Se.get(O);B(D)&&Oe===null&&(Oe=D.getFormat(),Ge=D.getStyle(),We=D.__key)}else{const A=wo(g,At),O=wo(b,Se);if(A.length!==y&&P(227),O.length!==_&&P(228),y===0)_!==0&&ta(O,b,0,_-1,m);else if(_===0){if(y!==0){const D=m.after==null&&m.before==null&&_t(b).size===0&&m.element.__lexicalLineBreak==null;Qu(A,0,y-1,D?null:x),D&&(x.textContent="")}}else(function(D,k,v,E,N,R){const w=E-1,L=N-1;let I,U,H=R.getFirstChild(),V=0,te=0;for(;V<=w&&te<=L;){const $=k[V],G=v[te],X=Ft();if($===G)H=yu(Qt(G,R.element)),V++,te++;else{if(U===void 0&&(U=Tc(v,te)),I===void 0)I=Tc(k,V);else if(!I.has($)){V++,xt(X);continue}if(!U.has($)){H=yu(na($)),bn($,R.element),V++,I.delete($),xt(X);continue}if(I.has(G)){const Ce=Ar(le,G);Ce!==H&&R.withBefore(H??R.before).insertChild(Ce),H=yu(Qt(G,R.element)),V++,te++}else yn(G,R.withBefore(H??R.before)),te++}const Z=Se.get(G);Z!==null&&B(Z)?Oe===null&&(Oe=Z.getFormat(),Ge=Z.getStyle(),We=Z.__key):T(Z)&&te<=L&&!Z.isInline()&&(se+=$n),xt(X)}const ge=V>w,j=te>L;if(ge&&!j){const $=v[L+1],G=$===void 0?null:le.getElementByKey($);ta(v,D,te,L,R.withBefore(G??R.before))}else j&&!ge&&Qu(k,V,w,R.element)})(b,A,O,y,_,m)}S.__lexicalTextContent=se,S.__lexicalFirstTextKey=We,se=p+se}(c,h,ft(h,f,le)),pe(h)||(d=h,Oe==null||Oe===d.__textFormat||Ls||d.setTextFormat(Oe),function(g){Ge==null||Ge===g.__textStyle||Ls||g.setTextStyle(Ge)}(h))}(t,r,s),r.isInline()||(Ee(r)||v0(0,r,s),x0(r,s)),a!==""){const c=s.__lexicalTextContent||"";s.__lexicalTextContent=a+c,se=l+a+c,s.__lexicalSlotTextLength=a.length}else(_t(r).size>0||_t(t).size>0)&&(s.__lexicalSlotTextLength=0)}else{const l=s.__lexicalTextContent;typeof l!="string"&&P(356,t.getType()),se+=l,bu(s)}if((Xt||r.__dir!==t.__dir||r.__parent!==t.__parent)&&(Zu(s,r),Ee(r)&&!Xt))for(const l of r.getChildren())T(l)&&Zu(Ar(le,l.getKey()),l)}else{const o=r.getTextContent();if(ie(r)){const u=r.decorate(le,Ti);u!==null&&S0(n,u),i&&(_t(r).size>0||_t(t).size>0)&&Sc(t,r,s)}se+=o}if(!Ls&&Ee(r)){const o=r.getLatest();if(o.__cachedText!==se){const u=o.getWritable();u.__cachedText=se,r=u}}return Jn.$decorateDOM(r,t,s,le),g0(r),s}function S0(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=Nh(le)}t[n]=e}function yu(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function Tc(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function Lm(n,e,t,r,i,s){se="",Oe=null,Ge=null,We=null,Xt=r===2,le=t,Ti=t._config,Jn=t._config.dom||po,Ei=t._nodes,Uo=le._listeners.mutation,pi=i,mi=s,At=n._nodeMap,Xu=n,Se=e._nodeMap,Ls=e._readOnly,Gn=Zd(t._keyToDOMMap),Yu=function(){const u=new Map,a=l=>{for(const c of l){const h=Se.get(c);if(h===void 0)continue;const f=h.__parent;if(f===null)continue;let d=u.get(f);d===void 0&&(d=new Set,u.set(f,d)),d.add(c)}};return a(pi.keys()),a(mi),u}();const o=new Map;return Ni=o,Qt("root",null),le=void 0,Ei=void 0,pi=void 0,mi=void 0,At=void 0,Xu=void 0,Se=void 0,Ti=void 0,Gn=void 0,Yu=void 0,Ni=void 0,Jn=po,o}function na(n){const e=Gn.get(n);return e===void 0&&P(75,n),e}function J(n){return{type:n}}const zo=J("SELECTION_CHANGE_COMMAND"),Rm=J("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),w0=J("CLICK_COMMAND"),C0=J("BEFORE_INPUT_COMMAND"),T0=J("INPUT_COMMAND"),E0=J("COMPOSITION_START_COMMAND"),N0=J("COMPOSITION_END_COMMAND"),zn=J("DELETE_CHARACTER_COMMAND"),wr=J("INSERT_LINE_BREAK_COMMAND"),ki=J("INSERT_PARAGRAPH_COMMAND"),Cr=J("CONTROLLED_TEXT_INSERTION_COMMAND"),Ji=J("PASTE_COMMAND"),Rs=J("REMOVE_TEXT_COMMAND"),Ai=J("DELETE_WORD_COMMAND"),Tr=J("DELETE_LINE_COMMAND"),Ot=J("FORMAT_TEXT_COMMAND"),Fm=J("SET_TEXT_FORMAT_COMMAND"),to=J("UNDO_COMMAND"),Oi=J("REDO_COMMAND"),k0=J("KEYDOWN_COMMAND"),A0=J("KEY_ARROW_RIGHT_COMMAND"),ra=J("MOVE_TO_END"),O0=J("KEY_ARROW_LEFT_COMMAND"),ia=J("MOVE_TO_START"),D0=J("KEY_ARROW_UP_COMMAND"),M0=J("KEY_ARROW_DOWN_COMMAND"),il=J("KEY_ENTER_COMMAND"),I0=J("KEY_SPACE_COMMAND"),sl=J("KEY_BACKSPACE_COMMAND"),P0=J("KEY_ESCAPE_COMMAND"),L0=J("KEY_DELETE_COMMAND"),R0=J("KEY_TAB_COMMAND"),Bm=J("INSERT_TAB_COMMAND"),jm=J("INDENT_CONTENT_COMMAND"),Ec=J("OUTDENT_CONTENT_COMMAND"),F0=J("DROP_COMMAND"),$m=J("FORMAT_ELEMENT_COMMAND"),B0=J("DRAGSTART_COMMAND"),j0=J("DRAGOVER_COMMAND"),Um=J("DRAGEND_COMMAND"),qo=J("COPY_COMMAND"),ol=J("CUT_COMMAND"),$0=J("SELECT_ALL_COMMAND"),zm=J("CLEAR_EDITOR_COMMAND"),qm=J("CLEAR_HISTORY_COMMAND"),ds=J("CAN_REDO_COMMAND"),hs=J("CAN_UNDO_COMMAND"),Km=J("FOCUS_COMMAND"),Wm=J("BLUR_COMMAND"),Hm=J("KEY_MODIFIER_COMMAND");function U0(n,e){return{...e,[gm]:n}}const Rn=U0("metaKey",{ctrlKey:!Vn,metaKey:Vn}),Nc=U0("altKey",{altKey:Vn,ctrlKey:!Vn}),kc=[["altKey",1],["ctrlKey",2],["metaKey",4],["shiftKey",8]];function _u(n,e,t){const r=n.get(e);r?r.push(t):n.set(e,[t])}class Vm{constructor(){M(this,"byKey",new Map);M(this,"byCode",new Map)}add(e){const{key:t,modifiers:r={}}=e;t.length>0||P(399);const i=t.toLowerCase();for(const s of function(o){let u=[0];for(const[a,l]of kc){const c=o[a]||!1;c==="any"?u=u.concat(u.map(h=>h|l)):c&&(u=u.map(h=>h|l))}return u}(r))_u(this.byKey,`${s}:${i}`,e),t.length===1&&(/[0-9]/.test(t)?_u(this.byCode,`${s}:Digit${t}`,e):/[a-z]/.test(i)&&_u(this.byCode,`${s}:Key${i.toUpperCase()}`,e));return this}matches(e){const t=e.key;if(!t)return[];const r=function(o){let u=0;for(const[a,l]of kc)o[a]&&(u|=l);return u}(e),i=this.byKey.get(`${r}:${t.toLowerCase()}`),s=i?i.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){const o=this.byCode.get(`${r}:${e.code}`);o&&s.push(...o)}return s}match(e){return this.matches(e)[0]}}function Gm(n){const e=new Vm;for(const t of n)e.add(t);return e}function Jm(n){const e=new Map;return{dispose(){for(const t of e.values())t.dispose();e.clear()},register(t,r){let i=e.get(t);i===void 0&&(i={dispose:n(t,r),holders:new Set},e.set(t,i));const s=()=>{const o=e.get(t);o&&o.holders.delete(s)&&o.holders.size===0&&(e.delete(t),o.dispose())};return i.holders.add(s),s}}}function Xm(n,e,t,r){return n.addEventListener(e,t,r),n.removeEventListener.bind(n,e,t,r)}const Ht=Object.freeze({});let xu;const vu=new WeakMap,Fs=new WeakMap,Ym=Jm(n=>(n.addEventListener("selectionchange",Rc),()=>n.removeEventListener("selectionchange",Rc)));function z0(n,e,t,r,i,s){const o=n.anchor,u=n.focus,a=o.getNode(),l=de();let c;if(s!==void 0)c=s;else{const b=nt(dt(l));c=b!==null?ct(b,l._rootElement):null}const h=c!==null?c.anchorNode:null,f=o.key,d=l.getElementByKey(f),g=t.length;return f!==u.key||!B(a)||(!i&&(!Ir||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||a.isDirty()&&g<2||kh(t))&&o.offset!==u.offset&&!a.isComposing()||St(a)||a.isDirty()&&g>1||(i||!Ir)&&d!==null&&!a.isComposing()&&h!==wn(a,d,l)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||!a.isComposing()&&(a.getFormat()!==n.format||a.getStyle()!==n.style)||function(b,m){if(m.isSegmented())return!0;if(!b.isCollapsed())return!1;const p=b.anchor.offset,y=m.getParentOrThrow(),_=mo(m);return p===0?!m.canInsertTextBefore()||!y.canInsertTextBefore()&&!m.isComposing()||_||function(x){const S=x.getPreviousSibling();return(B(S)||T(S)&&S.isInline())&&!S.canInsertTextAfter()}(m):p===m.getTextContentSize()&&(!m.canInsertTextAfter()||!y.canInsertTextAfter()&&!m.isComposing()||_)}(n,a)}function Ac(n,e){return Tt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function Oc(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=ct(n,e._rootElement),u=e._inputState;if(u.isSelectionChangeFromDOMUpdate){u.isSelectionChangeFromDOMUpdate=!1;const a=u.selectionChangeFromDOMUpdatePoints;if(u.selectionChangeFromDOMUpdatePoints=null,Ac(r,i)&&Ac(s,o)&&!u.postDeleteSelectionToRestore&&(a===null||a.anchorNode===r&&a.anchorOffset===i&&a.focusNode===s&&a.focusOffset===o))return}gt(e,()=>{if(!t)return void Me(null);if(!es(e,r,s))return;let a=z();if(u.postDeleteSelectionToRestore&&F(a)&&a.isCollapsed()){const l=a.anchor,c=u.postDeleteSelectionToRestore.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=u.postDeleteSelectionToRestore.clone(),Me(a))}if(u.postDeleteSelectionToRestore=null,F(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){n.type==="Range"&&r===s&&(a.dirty=!0);const h=dt(e).event,f=h?h.timeStamp:performance.now(),{format:d,style:g,offset:b,key:m,timeStamp:p}=u.collapsedSelectionFormat,y=we(),_=e.isComposing()===!1&&y.getTextContent()==="";if(f<p+200&&l.offset===b&&l.key===m)Bs(a,d,g);else if(l.type==="text")B(c)||P(141),q0(a,c);else if(l.type==="element"&&!_){T(c)||P(259);const x=l.getNode();x.isEmpty()?function(S,C){Bs(S,C.getTextFormat(),C.getTextStyle())}(a,x):Bs(a,a.format,"")}}else{const h=l.key,f=a.focus.key,d=a.getNodes(),g=d.length,b=a.isBackward(),m=b?o:i,p=b?i:o,y=b?f:h,_=b?h:f;let x=hm,S=!1;for(let C=0;C<g;C++){const A=d[C],O=A.getTextContentSize();if(B(A)&&O!==0&&!(C===0&&A.__key===y&&m===O||C===g-1&&A.__key===_&&p===0)&&(S=!0,x&=A.getFormat(),x===0))break}a.format=S?x:0}}(function(l,c,h=!1){(h||mh(l,c))&&l.dispatchCommand(zo)})(e,a,a!==null&&(a.dirty||!F(a)))})}function Bs(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function q0(n,e){Bs(n,e.getFormat(),e.getStyle())}function Qm(n,e){gt(e,()=>{const t=z(),r=nt(dt(e)),i=Yr();if(r){if(F(t)){const s=t.anchor,o=s.getNode();s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Ee(o)&&we().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)&&(r.removeAllRanges(),t.dirty=!0)}else if(n.pointerType==="touch"||n.pointerType==="pen"){const s=ct(r,e._rootElement).anchorNode;(ce(s)||Tt(s))&&Me(uo(i,r,e,n))}}if(rn&&r!==null&&r.rangeCount===0){const s=e._rootElement;if(s!==null&&n.target===s){const o=n.clientY;let u=s.childNodes.length;for(let l=0;l<s.childNodes.length;l++){const c=s.childNodes[l];if(ce(c)){const h=c.getBoundingClientRect();if(o<=(h.top+h.bottom)/2){u=l;break}}}r.setBaseAndExtent(s,u,s,u);const a=uo(i,r,e,n);a!==null?Me(a):r.removeAllRanges()}}Y(e,w0,n)})}function Zm(n,e){const t=Rh(n),r=n.pointerType;Zr(t)&&r!=="touch"&&r!=="pen"&&n.button===0&>(e,()=>{vo(t,e)||(e._inputState.isSelectionChangeFromMouseDown=!0)})}function K0(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Dc(n){const{lastKeyCode:e}=de()._inputState;if(n==null||n.length<=1||e==null)return;const t=e.length===1?e:e==="Enter"?`
|
|
4
4
|
`:e==="Tab"?" ":null;if(!t)return;const r=z();if(!F(r)||!r.isCollapsed())return;const i=r.anchor.getNode();if(!B(i))return;const{offset:s}=r.anchor;if(i.getTextContentSize()===s){const o=i.getNextSibling();if(t===`
|
|
@@ -8,7 +8,7 @@ import { t as _i } from "../../classix-DG18itHa.js";
|
|
|
8
8
|
import { File as ym } from "../file/index.js";
|
|
9
9
|
import { Button as xt } from "../button/index.js";
|
|
10
10
|
import { Icon as $t } from "../icon/index.js";
|
|
11
|
-
import { I as pc } from "../../index-
|
|
11
|
+
import { I as pc } from "../../index-Ds-Ocs4L.js";
|
|
12
12
|
import { Toolbar as _m } from "../toolbar/index.js";
|
|
13
13
|
function ta(n, ...e) {
|
|
14
14
|
const t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index21.css');const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index21.css');const a=require("react/jsx-runtime"),b=require("../../classix-5H4IWnMA.cjs"),j=require("../loading/index.cjs"),q="_graph_plhqd_11",v="_plot_plhqd_20",N="_item_plhqd_34",y="_column_plhqd_40",f="_value_plhqd_48",k="_track_plhqd_58",M="_bar_plhqd_65",V="_label_plhqd_87",l={graph:q,plot:v,item:N,column:y,value:f,track:k,bar:M,label:V,"is-loading":"_is-loading_plhqd_96"},h=e=>Number.isFinite(e)?Math.max(0,e):0,S=({accessibleLabel:e,className:i,height:r,items:n=[],style:p,valueFormatter:d=t=>t.toLocaleString(),...u})=>{const t=n.reduce((s,c)=>Math.max(s,h(c.value)),0),_={...p,"--graph-columns":Math.max(n.length,1),"--graph-height":r||"calc(var(--utils-tokens-unit) * 16)"};return a.jsxs("figure",{className:b.t(l.graph,i),style:_,...u,"data-component":"graph",children:[e&&a.jsx("figcaption",{"data-content":"screen-reader",children:e}),n.length>0?a.jsx("ul",{className:l.plot,children:n.map((s,c)=>{const o=h(s.value),m=t>0?o/t*100:0,g=o>0?Math.max(m,6):0,x={"--bar-color":s.color,"--bar-delay":c*50+"ms","--bar-height":g+"%"};return a.jsxs("li",{className:l.item,"data-component":"graph",children:[a.jsxs("div",{className:l.column,children:[a.jsx("span",{className:l.value,children:d(s.value)}),a.jsx("span",{className:l.track,children:a.jsx("span",{className:l.bar,style:x})})]}),a.jsx("span",{className:l.label,title:s.label,children:s.label})]},s.label+c)})}):a.jsx("div",{className:l["is-loading"],children:a.jsx(j.Loading,{})})]})};exports.Graph=S;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { jsxs as s, jsx as
|
|
2
|
-
import { t as
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { t as q } from "../../classix-DG18itHa.js";
|
|
3
3
|
import { Loading as v } from "../loading/index.js";
|
|
4
|
-
import '../../assets/index21.css';const f = "
|
|
4
|
+
import '../../assets/index21.css';const f = "_graph_plhqd_11", x = "_plot_plhqd_20", k = "_item_plhqd_34", V = "_column_plhqd_40", y = "_value_plhqd_48", M = "_track_plhqd_58", w = "_bar_plhqd_65", j = "_label_plhqd_87", a = {
|
|
5
5
|
graph: f,
|
|
6
6
|
plot: x,
|
|
7
7
|
item: k,
|
|
8
8
|
column: V,
|
|
9
9
|
value: y,
|
|
10
10
|
track: M,
|
|
11
|
-
bar:
|
|
12
|
-
label:
|
|
13
|
-
"is-loading": "_is-
|
|
14
|
-
},
|
|
15
|
-
accessibleLabel:
|
|
16
|
-
className:
|
|
11
|
+
bar: w,
|
|
12
|
+
label: j,
|
|
13
|
+
"is-loading": "_is-loading_plhqd_96"
|
|
14
|
+
}, p = (e) => Number.isFinite(e) ? Math.max(0, e) : 0, G = ({
|
|
15
|
+
accessibleLabel: e,
|
|
16
|
+
className: d,
|
|
17
17
|
height: o,
|
|
18
18
|
items: n = [],
|
|
19
|
-
style:
|
|
20
|
-
valueFormatter:
|
|
21
|
-
...
|
|
19
|
+
style: i,
|
|
20
|
+
valueFormatter: _ = (r) => r.toLocaleString(),
|
|
21
|
+
...m
|
|
22
22
|
}) => {
|
|
23
|
-
const r = n.reduce((
|
|
24
|
-
...
|
|
23
|
+
const r = n.reduce((l, c) => Math.max(l, p(c.value)), 0), u = {
|
|
24
|
+
...i,
|
|
25
25
|
"--graph-columns": Math.max(n.length, 1),
|
|
26
26
|
"--graph-height": o || "calc(var(--utils-tokens-unit) * 16)"
|
|
27
27
|
};
|
|
28
|
-
return /* @__PURE__ */ s("figure", { className:
|
|
29
|
-
|
|
30
|
-
n.length > 0 ? /* @__PURE__ */
|
|
31
|
-
const
|
|
32
|
-
"--bar-color":
|
|
28
|
+
return /* @__PURE__ */ s("figure", { className: q(a.graph, d), style: u, ...m, "data-component": "graph", children: [
|
|
29
|
+
e && /* @__PURE__ */ t("figcaption", { "data-content": "screen-reader", children: e }),
|
|
30
|
+
n.length > 0 ? /* @__PURE__ */ t("ul", { className: a.plot, children: n.map((l, c) => {
|
|
31
|
+
const h = p(l.value), g = r > 0 ? h / r * 100 : 0, b = h > 0 ? Math.max(g, 6) : 0, N = {
|
|
32
|
+
"--bar-color": l.color,
|
|
33
33
|
"--bar-delay": c * 50 + "ms",
|
|
34
|
-
"--bar-height":
|
|
34
|
+
"--bar-height": b + "%"
|
|
35
35
|
};
|
|
36
36
|
return /* @__PURE__ */ s("li", { className: a.item, "data-component": "graph", children: [
|
|
37
37
|
/* @__PURE__ */ s("div", { className: a.column, children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ t("span", { className: a.value, children: _(l.value) }),
|
|
39
|
+
/* @__PURE__ */ t("span", { className: a.track, children: /* @__PURE__ */ t("span", { className: a.bar, style: N }) })
|
|
40
40
|
] }),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
] },
|
|
43
|
-
}) }) : /* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ t("span", { className: a.label, title: l.label, children: l.label })
|
|
42
|
+
] }, l.label + c);
|
|
43
|
+
}) }) : /* @__PURE__ */ t("div", { className: a["is-loading"], children: /* @__PURE__ */ t(v, {}) })
|
|
44
44
|
] });
|
|
45
45
|
};
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
G as Graph
|
|
48
48
|
};
|
|
49
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../classix-5H4IWnMA.cjs");require("react");require("../../icons-Dv_p0bUF.cjs");require("../../use-touched-Bq5Gjbpz.cjs");const e=require("../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../classix-5H4IWnMA.cjs");require("react");require("../../icons-Dv_p0bUF.cjs");require("../../use-touched-Bq5Gjbpz.cjs");const e=require("../../index-DWDp66fp.cjs");exports.Input=e.Input;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index16.css');const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index16.css');const e=require("react/jsx-runtime"),f=require("../../classix-5H4IWnMA.cjs"),h=require("../avatar/index.cjs"),k=require("../icon/index.cjs"),N="_attachments_77ukg_1",w="_footer_77ukg_27",S="_message_77ukg_11",b="_timestamp_77ukg_152",q="_actions_77ukg_157",y="_preview_77ukg_169",s={attachments:N,"message-group":"_message-group_77ukg_11",footer:w,message:S,timestamp:b,actions:q,preview:y},I=({actions:c,appearance:r="default",attachments:i,author:a,authorColor:g,authorImageUrl:l,authorLink:d,authorRole:_,content:u,iconName:p="Info",id:v,preview:x,timestamp:m,timestampText:j,type:t="default"})=>{const n=m?new Date(m):void 0,o=n?e.jsx("time",{className:s.timestamp,dateTime:n.toISOString(),children:j??n.toLocaleString()}):null;return e.jsxs("div",{className:s["message-group"],"data-message-type":t,"data-component":"message",children:[a&&e.jsx(h.Avatar,{accessibleLabel:a,color:g,imageUrl:l,link:d,name:a,role:_}),t==="system"&&o,e.jsxs("div",{className:f.t(s.message,x&&s.preview),"data-appearance":r,"data-id":v,"data-type":t,children:[t=="system"&&e.jsx(k.Icon,{gap:"right",name:p}),u]}),i&&e.jsx("div",{className:s.attachments,children:i}),t!=="system"&&(c?e.jsxs("div",{className:s.footer,children:[o,e.jsx("div",{className:s.actions,"data-message-actions":!0,children:c})]}):o)]})};exports.Message=I;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/message/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport type { IconName } from '@/components/icon';\n\nimport { Avatar, type AvatarColor } from '../avatar';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type MessageOptions = {\n appearance?: 'default' | 'document' | 'file';\n attachments?: React.ReactNode;\n author?: string;\n authorColor?: AvatarColor;\n authorImageUrl?: string;\n authorLink?: string;\n authorRole?: string;\n content: React.ReactNode;\n iconName?: IconName;\n id: string;\n preview?: boolean;\n timestamp?: Date | string;\n timestampText?: React.ReactNode;\n type?: 'default' | 'minimal' | 'system' | 'user';\n};\n\nexport const Message = ({\n appearance = 'default',\n attachments,\n author,\n authorColor,\n authorImageUrl,\n authorLink,\n authorRole,\n content,\n iconName = 'Info',\n id,\n preview,\n timestamp,\n timestampText,\n type = 'default',\n}: MessageOptions) => {\n const date = timestamp ? new Date(timestamp) : undefined;\n const timestampElement = date ? (\n <time\n className={styles.timestamp}\n dateTime={date.toISOString()}\n >\n {timestampText ?? date.toLocaleString()}\n </time>\n ) : null;\n\n return (\n <div\n className={styles['message-group']}\n data-message-type={type}\n >\n {author && (\n <Avatar\n accessibleLabel={author}\n color={authorColor}\n imageUrl={authorImageUrl}\n link={authorLink}\n name={author}\n role={authorRole}\n />\n )}\n {type === 'system' && timestampElement}\n <div\n className={cx(styles.message, preview && styles.preview)}\n data-appearance={appearance}\n data-id={id}\n data-type={type}\n >\n {type == 'system' && (\n <Icon\n gap='right'\n name={iconName}\n />\n )}\n {content}\n </div>\n {attachments && <div className={styles.attachments}>{attachments}</div>}\n {type !== 'system'
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/message/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport type { IconName } from '@/components/icon';\n\nimport { Avatar, type AvatarColor } from '../avatar';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type MessageOptions = {\n /** Controls shown under the message, e.g. a delete button for the author's own message. */\n actions?: React.ReactNode;\n appearance?: 'default' | 'document' | 'file';\n attachments?: React.ReactNode;\n author?: string;\n authorColor?: AvatarColor;\n authorImageUrl?: string;\n authorLink?: string;\n authorRole?: string;\n content: React.ReactNode;\n iconName?: IconName;\n id: string;\n preview?: boolean;\n timestamp?: Date | string;\n timestampText?: React.ReactNode;\n type?: 'default' | 'minimal' | 'system' | 'user';\n};\n\nexport const Message = ({\n actions,\n appearance = 'default',\n attachments,\n author,\n authorColor,\n authorImageUrl,\n authorLink,\n authorRole,\n content,\n iconName = 'Info',\n id,\n preview,\n timestamp,\n timestampText,\n type = 'default',\n}: MessageOptions) => {\n const date = timestamp ? new Date(timestamp) : undefined;\n const timestampElement = date ? (\n <time\n className={styles.timestamp}\n dateTime={date.toISOString()}\n >\n {timestampText ?? date.toLocaleString()}\n </time>\n ) : null;\n\n return (\n <div\n className={styles['message-group']}\n data-message-type={type}\n >\n {author && (\n <Avatar\n accessibleLabel={author}\n color={authorColor}\n imageUrl={authorImageUrl}\n link={authorLink}\n name={author}\n role={authorRole}\n />\n )}\n {type === 'system' && timestampElement}\n <div\n className={cx(styles.message, preview && styles.preview)}\n data-appearance={appearance}\n data-id={id}\n data-type={type}\n >\n {type == 'system' && (\n <Icon\n gap='right'\n name={iconName}\n />\n )}\n {content}\n </div>\n {attachments && <div className={styles.attachments}>{attachments}</div>}\n {type !== 'system' &&\n (actions ? (\n <div className={styles.footer}>\n {timestampElement}\n <div\n className={styles.actions}\n data-message-actions\n >\n {actions}\n </div>\n </div>\n ) : (\n timestampElement\n ))}\n </div>\n );\n};\n"],"names":["Message","actions","appearance","attachments","author","authorColor","authorImageUrl","authorLink","authorRole","content","iconName","id","preview","timestamp","timestampText","type","date","Date","undefined","timestampElement","jsx","styles","toISOString","toLocaleString","jsxs","Avatar","cx","message","Icon","footer"],"mappings":"udA2BaA,EAAUA,CAAC,CACtBC,QAAAA,EACAC,WAAAA,EAAa,UACbC,YAAAA,EACAC,OAAAA,EACAC,YAAAA,EACAC,eAAAA,EACAC,WAAAA,EACAC,WAAAA,EACAC,QAAAA,EACAC,SAAAA,EAAW,OACXC,GAAAA,EACAC,QAAAA,EACAC,UAAAA,EACAC,cAAAA,EACAC,KAAAA,EAAO,SACO,IAAM,CACpB,MAAMC,EAAOH,EAAY,IAAII,KAAKJ,CAAS,EAAIK,OACzCC,EAAmBH,EACvBI,EAAAA,IAAC,OAAA,CACC,UAAWC,EAAOR,UAClB,SAAUG,EAAKM,cAEdR,SAAAA,GAAiBE,EAAKO,eAAAA,EACzB,EACE,KAEJ,OACEC,OAAC,OACC,UAAWH,EAAO,eAAe,EACjC,oBAAmBN,EAAK,iBAAA,UAEvBX,SAAAA,CAAAA,GACCgB,EAAAA,IAACK,EAAAA,OAAA,CACC,gBAAiBrB,EACjB,MAAOC,EACP,SAAUC,EACV,KAAMC,EACN,KAAMH,EACN,KAAMI,EAAW,EAGpBO,IAAS,UAAYI,EACtBK,EAAAA,KAAC,MAAA,CACC,UAAWE,EAAAA,EAAGL,EAAOM,QAASf,GAAWS,EAAOT,OAAO,EACvD,kBAAiBV,EACjB,UAASS,EACT,YAAWI,EAEVA,SAAAA,CAAAA,GAAQ,UACPK,EAAAA,IAACQ,EAAAA,KAAA,CACC,IAAI,QACJ,KAAMlB,EAAS,EAGlBD,CAAAA,EACH,EACCN,GAAeiB,EAAAA,IAAC,MAAA,CAAI,UAAWC,EAAOlB,YAAcA,SAAAA,EAAY,EAChEY,IAAS,WACPd,SACE,MAAA,CAAI,UAAWoB,EAAOQ,OACpBV,SAAAA,CAAAA,QACA,MAAA,CACC,UAAWE,EAAOpB,QAClB,uBAAoB,GAEnBA,SAAAA,CAAAA,CACH,CAAA,CAAA,CACF,EAEAkB,EAAAA,EAEN,CAEJ"}
|
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { t as
|
|
1
|
+
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { t as N } from "../../classix-DG18itHa.js";
|
|
3
3
|
import { Avatar as w } from "../avatar/index.js";
|
|
4
|
-
import { Icon as
|
|
5
|
-
import '../../assets/index16.css';const
|
|
6
|
-
attachments:
|
|
7
|
-
"message-group": "_message-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
import { Icon as x } from "../icon/index.js";
|
|
5
|
+
import '../../assets/index16.css';const I = "_attachments_77ukg_1", S = "_footer_77ukg_27", b = "_message_77ukg_11", j = "_timestamp_77ukg_152", y = "_actions_77ukg_157", L = "_preview_77ukg_169", e = {
|
|
6
|
+
attachments: I,
|
|
7
|
+
"message-group": "_message-group_77ukg_11",
|
|
8
|
+
footer: S,
|
|
9
|
+
message: b,
|
|
10
|
+
timestamp: j,
|
|
11
|
+
actions: y,
|
|
12
|
+
preview: L
|
|
13
|
+
}, O = ({
|
|
14
|
+
actions: n,
|
|
15
|
+
appearance: g = "default",
|
|
16
|
+
attachments: c,
|
|
17
|
+
author: t,
|
|
15
18
|
authorColor: l,
|
|
16
19
|
authorImageUrl: d,
|
|
17
|
-
authorLink:
|
|
20
|
+
authorLink: _,
|
|
18
21
|
authorRole: p,
|
|
19
|
-
content:
|
|
20
|
-
iconName:
|
|
22
|
+
content: u,
|
|
23
|
+
iconName: f = "Info",
|
|
21
24
|
id: v,
|
|
22
25
|
preview: h,
|
|
23
|
-
timestamp:
|
|
26
|
+
timestamp: r,
|
|
24
27
|
timestampText: k,
|
|
25
|
-
type:
|
|
28
|
+
type: s = "default"
|
|
26
29
|
}) => {
|
|
27
|
-
const m =
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
const m = r ? new Date(r) : void 0, o = m ? /* @__PURE__ */ a("time", { className: e.timestamp, dateTime: m.toISOString(), children: k ?? m.toLocaleString() }) : null;
|
|
31
|
+
return /* @__PURE__ */ i("div", { className: e["message-group"], "data-message-type": s, "data-component": "message", children: [
|
|
32
|
+
t && /* @__PURE__ */ a(w, { accessibleLabel: t, color: l, imageUrl: d, link: _, name: t, role: p }),
|
|
33
|
+
s === "system" && o,
|
|
34
|
+
/* @__PURE__ */ i("div", { className: N(e.message, h && e.preview), "data-appearance": g, "data-id": v, "data-type": s, children: [
|
|
35
|
+
s == "system" && /* @__PURE__ */ a(x, { gap: "right", name: f }),
|
|
36
|
+
u
|
|
34
37
|
] }),
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
c && /* @__PURE__ */ a("div", { className: e.attachments, children: c }),
|
|
39
|
+
s !== "system" && (n ? /* @__PURE__ */ i("div", { className: e.footer, children: [
|
|
40
|
+
o,
|
|
41
|
+
/* @__PURE__ */ a("div", { className: e.actions, "data-message-actions": !0, children: n })
|
|
42
|
+
] }) : o)
|
|
37
43
|
] });
|
|
38
44
|
};
|
|
39
45
|
export {
|
|
40
|
-
|
|
46
|
+
O as Message
|
|
41
47
|
};
|
|
42
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/message/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport type { IconName } from '@/components/icon';\n\nimport { Avatar, type AvatarColor } from '../avatar';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type MessageOptions = {\n appearance?: 'default' | 'document' | 'file';\n attachments?: React.ReactNode;\n author?: string;\n authorColor?: AvatarColor;\n authorImageUrl?: string;\n authorLink?: string;\n authorRole?: string;\n content: React.ReactNode;\n iconName?: IconName;\n id: string;\n preview?: boolean;\n timestamp?: Date | string;\n timestampText?: React.ReactNode;\n type?: 'default' | 'minimal' | 'system' | 'user';\n};\n\nexport const Message = ({\n appearance = 'default',\n attachments,\n author,\n authorColor,\n authorImageUrl,\n authorLink,\n authorRole,\n content,\n iconName = 'Info',\n id,\n preview,\n timestamp,\n timestampText,\n type = 'default',\n}: MessageOptions) => {\n const date = timestamp ? new Date(timestamp) : undefined;\n const timestampElement = date ? (\n <time\n className={styles.timestamp}\n dateTime={date.toISOString()}\n >\n {timestampText ?? date.toLocaleString()}\n </time>\n ) : null;\n\n return (\n <div\n className={styles['message-group']}\n data-message-type={type}\n >\n {author && (\n <Avatar\n accessibleLabel={author}\n color={authorColor}\n imageUrl={authorImageUrl}\n link={authorLink}\n name={author}\n role={authorRole}\n />\n )}\n {type === 'system' && timestampElement}\n <div\n className={cx(styles.message, preview && styles.preview)}\n data-appearance={appearance}\n data-id={id}\n data-type={type}\n >\n {type == 'system' && (\n <Icon\n gap='right'\n name={iconName}\n />\n )}\n {content}\n </div>\n {attachments && <div className={styles.attachments}>{attachments}</div>}\n {type !== 'system'
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/message/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport type { IconName } from '@/components/icon';\n\nimport { Avatar, type AvatarColor } from '../avatar';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\n\nexport type MessageOptions = {\n /** Controls shown under the message, e.g. a delete button for the author's own message. */\n actions?: React.ReactNode;\n appearance?: 'default' | 'document' | 'file';\n attachments?: React.ReactNode;\n author?: string;\n authorColor?: AvatarColor;\n authorImageUrl?: string;\n authorLink?: string;\n authorRole?: string;\n content: React.ReactNode;\n iconName?: IconName;\n id: string;\n preview?: boolean;\n timestamp?: Date | string;\n timestampText?: React.ReactNode;\n type?: 'default' | 'minimal' | 'system' | 'user';\n};\n\nexport const Message = ({\n actions,\n appearance = 'default',\n attachments,\n author,\n authorColor,\n authorImageUrl,\n authorLink,\n authorRole,\n content,\n iconName = 'Info',\n id,\n preview,\n timestamp,\n timestampText,\n type = 'default',\n}: MessageOptions) => {\n const date = timestamp ? new Date(timestamp) : undefined;\n const timestampElement = date ? (\n <time\n className={styles.timestamp}\n dateTime={date.toISOString()}\n >\n {timestampText ?? date.toLocaleString()}\n </time>\n ) : null;\n\n return (\n <div\n className={styles['message-group']}\n data-message-type={type}\n >\n {author && (\n <Avatar\n accessibleLabel={author}\n color={authorColor}\n imageUrl={authorImageUrl}\n link={authorLink}\n name={author}\n role={authorRole}\n />\n )}\n {type === 'system' && timestampElement}\n <div\n className={cx(styles.message, preview && styles.preview)}\n data-appearance={appearance}\n data-id={id}\n data-type={type}\n >\n {type == 'system' && (\n <Icon\n gap='right'\n name={iconName}\n />\n )}\n {content}\n </div>\n {attachments && <div className={styles.attachments}>{attachments}</div>}\n {type !== 'system' &&\n (actions ? (\n <div className={styles.footer}>\n {timestampElement}\n <div\n className={styles.actions}\n data-message-actions\n >\n {actions}\n </div>\n </div>\n ) : (\n timestampElement\n ))}\n </div>\n );\n};\n"],"names":["Message","actions","appearance","attachments","author","authorColor","authorImageUrl","authorLink","authorRole","content","iconName","id","preview","timestamp","timestampText","type","date","Date","undefined","timestampElement","jsx","styles","toISOString","toLocaleString","jsxs","Avatar","cx","message","Icon","footer"],"mappings":";;;;;;;;;;;;GA2BaA,IAAUA,CAAC;AAAA,EACtBC,SAAAA;AAAAA,EACAC,YAAAA,IAAa;AAAA,EACbC,aAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,IAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAC,MAAAA,IAAO;AACO,MAAM;AACpB,QAAMC,IAAOH,IAAY,IAAII,KAAKJ,CAAS,IAAIK,QACzCC,IAAmBH,IACvB,gBAAAI,EAAC,QAAA,EACC,WAAWC,EAAOR,WAClB,UAAUG,EAAKM,eAEdR,UAAAA,KAAiBE,EAAKO,eAAAA,GACzB,IACE;AAEJ,SACE,gBAAAC,EAAC,SACC,WAAWH,EAAO,eAAe,GACjC,qBAAmBN,GAAK,kBAAA,WAEvBX,UAAAA;AAAAA,IAAAA,KACC,gBAAAgB,EAACK,GAAA,EACC,iBAAiBrB,GACjB,OAAOC,GACP,UAAUC,GACV,MAAMC,GACN,MAAMH,GACN,MAAMI,GAAW;AAAA,IAGpBO,MAAS,YAAYI;AAAAA,IACtB,gBAAAK,EAAC,OAAA,EACC,WAAWE,EAAGL,EAAOM,SAASf,KAAWS,EAAOT,OAAO,GACvD,mBAAiBV,GACjB,WAASS,GACT,aAAWI,GAEVA,UAAAA;AAAAA,MAAAA,KAAQ,YACP,gBAAAK,EAACQ,GAAA,EACC,KAAI,SACJ,MAAMlB,GAAS;AAAA,MAGlBD;AAAAA,IAAAA,GACH;AAAA,IACCN,KAAe,gBAAAiB,EAAC,OAAA,EAAI,WAAWC,EAAOlB,aAAcA,UAAAA,GAAY;AAAA,IAChEY,MAAS,aACPd,sBACE,OAAA,EAAI,WAAWoB,EAAOQ,QACpBV,UAAAA;AAAAA,MAAAA;AAAAA,wBACA,OAAA,EACC,WAAWE,EAAOpB,SAClB,wBAAoB,IAEnBA,UAAAA,EAAAA,CACH;AAAA,IAAA,EAAA,CACF,IAEAkB;AAAAA,EAAAA,GAEN;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index13.css');const l=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index13.css');const l=require("react/jsx-runtime"),c=require("../../classix-5H4IWnMA.cjs"),b=require("react"),m=require("../../icons-Dv_p0bUF.cjs"),v="_nav_1cda7_3",p="_label_1cda7_9",g="_item_1cda7_17",f="_actions_1cda7_36",N="_highlighted_1cda7_60",x="_horizontal_1cda7_64",j="_sidebar_1cda7_74",w="_tabs_1cda7_131",q="_pills_1cda7_151",a={nav:v,label:p,item:g,actions:f,highlighted:N,horizontal:x,sidebar:j,tabs:w,pills:q},y={default:a.default,pills:a.pills,sidebar:a.sidebar,tabs:a.tabs},z=({className:t,...e})=>l.jsx("span",{className:c.t(t,a.label),...e,"data-component":"navlabel"}),S=({actions:t,children:e,className:o,highlighted:n=!1,...s})=>l.jsxs("div",{className:c.t(a.item,n&&a.highlighted,o),"data-nav-item":!0,...s,"data-component":"navitem",children:[e,t&&l.jsx("span",{className:a.actions,children:t})]}),C=({animation:t,children:e,className:o,horizontal:n=!1,variant:s="default",...d})=>{const[_,r]=b.useState(!1),h={"--icon-svg":m.iconSVG("CaretDown")};return l.jsx("nav",{className:c.t(o,n&&a.horizontal,a.nav,y[s]),"data-animation":t,"data-open":_?"true":"false","data-orientation":n?"horizontal":"vertical",onBlurCapture:i=>{if(s!=="pills"||window.innerWidth>960)return;const u=i.relatedTarget;i.currentTarget.contains(u)||r(!1)},onClick:()=>{s!=="pills"||window.innerWidth>960||r(i=>!i)},style:h,...d,"data-component":"nav",children:e})};exports.Nav=C;exports.NavItem=S;exports.NavLabel=z;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { t as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { i as
|
|
5
|
-
import '../../assets/index13.css';const
|
|
6
|
-
nav:
|
|
7
|
-
label:
|
|
8
|
-
item:
|
|
9
|
-
actions:
|
|
10
|
-
highlighted:
|
|
11
|
-
horizontal:
|
|
12
|
-
sidebar:
|
|
13
|
-
tabs:
|
|
14
|
-
pills:
|
|
1
|
+
import { jsx as l, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { t as c } from "../../classix-DG18itHa.js";
|
|
3
|
+
import { useState as b } from "react";
|
|
4
|
+
import { i as f } from "../../icons-dUP7sKyt.js";
|
|
5
|
+
import '../../assets/index13.css';const v = "_nav_1cda7_3", u = "_label_1cda7_9", g = "_item_1cda7_17", N = "_actions_1cda7_36", w = "_highlighted_1cda7_60", x = "_horizontal_1cda7_64", z = "_sidebar_1cda7_74", C = "_tabs_1cda7_131", j = "_pills_1cda7_151", a = {
|
|
6
|
+
nav: v,
|
|
7
|
+
label: u,
|
|
8
|
+
item: g,
|
|
9
|
+
actions: N,
|
|
10
|
+
highlighted: w,
|
|
11
|
+
horizontal: x,
|
|
12
|
+
sidebar: z,
|
|
13
|
+
tabs: C,
|
|
14
|
+
pills: j
|
|
15
15
|
}, y = {
|
|
16
|
-
default:
|
|
17
|
-
pills:
|
|
18
|
-
sidebar:
|
|
19
|
-
tabs:
|
|
16
|
+
default: a.default,
|
|
17
|
+
pills: a.pills,
|
|
18
|
+
sidebar: a.sidebar,
|
|
19
|
+
tabs: a.tabs
|
|
20
20
|
}, k = ({
|
|
21
|
-
className:
|
|
21
|
+
className: t,
|
|
22
22
|
...n
|
|
23
|
-
}) => /* @__PURE__ */ l("span", { className:
|
|
24
|
-
actions:
|
|
23
|
+
}) => /* @__PURE__ */ l("span", { className: c(t, a.label), ...n, "data-component": "navlabel" }), B = ({
|
|
24
|
+
actions: t,
|
|
25
25
|
children: n,
|
|
26
26
|
className: o,
|
|
27
27
|
highlighted: e = !1,
|
|
28
28
|
...s
|
|
29
|
-
}) => /* @__PURE__ */
|
|
29
|
+
}) => /* @__PURE__ */ p("div", { className: c(a.item, e && a.highlighted, o), "data-nav-item": !0, ...s, "data-component": "navitem", children: [
|
|
30
30
|
n,
|
|
31
|
-
|
|
31
|
+
t && /* @__PURE__ */ l("span", { className: a.actions, children: t })
|
|
32
32
|
] }), D = ({
|
|
33
|
-
animation:
|
|
33
|
+
animation: t,
|
|
34
34
|
children: n,
|
|
35
35
|
className: o,
|
|
36
36
|
horizontal: e = !1,
|
|
37
37
|
variant: s = "default",
|
|
38
|
-
...
|
|
38
|
+
...d
|
|
39
39
|
}) => {
|
|
40
|
-
const [
|
|
41
|
-
"--icon-svg":
|
|
40
|
+
const [_, r] = b(!1), m = {
|
|
41
|
+
"--icon-svg": f("CaretDown")
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */ l("nav", { className:
|
|
43
|
+
return /* @__PURE__ */ l("nav", { className: c(o, e && a.horizontal, a.nav, y[s]), "data-animation": t, "data-open": _ ? "true" : "false", "data-orientation": e ? "horizontal" : "vertical", onBlurCapture: (i) => {
|
|
44
44
|
if (s !== "pills" || window.innerWidth > 960) return;
|
|
45
|
-
const
|
|
46
|
-
i.currentTarget.contains(
|
|
45
|
+
const h = i.relatedTarget;
|
|
46
|
+
i.currentTarget.contains(h) || r(!1);
|
|
47
47
|
}, onClick: () => {
|
|
48
|
-
s !== "pills" || window.innerWidth > 960 ||
|
|
49
|
-
}, style:
|
|
48
|
+
s !== "pills" || window.innerWidth > 960 || r((i) => !i);
|
|
49
|
+
}, style: m, ...d, "data-component": "nav", children: n });
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
52
52
|
D as Nav,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index9.css');const a=require("react/jsx-runtime"),b=require("react"),h=require("../button/index.cjs"),I=require("../checkbox/index.cjs"),T=require("../chip/index.cjs"),H=require("../collapsible/index.cjs"),P=require("../controls/index.cjs"),z=require("../dialog/index.cjs"),A=require("../header/index.cjs"),E=require("../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index9.css');const a=require("react/jsx-runtime"),b=require("react"),h=require("../button/index.cjs"),I=require("../checkbox/index.cjs"),T=require("../chip/index.cjs"),H=require("../collapsible/index.cjs"),P=require("../controls/index.cjs"),z=require("../dialog/index.cjs"),A=require("../header/index.cjs"),E=require("../../index-DWDp66fp.cjs"),J="_search_1rde5_3",K="_controls_1rde5_15",Q="_chips_1rde5_35",S="_radio_1rde5_101",l={search:J,controls:K,chips:Q,"filter-dialog":"_filter-dialog_1rde5_42","filter-groups":"_filter-groups_1rde5_47","filter-group":"_filter-group_1rde5_47","filter-option":"_filter-option_1rde5_83","option-copy":"_option-copy_1rde5_89",radio:S,"collapsible-options":"_collapsible-options_1rde5_128"},U=({filterButtonLabel:x="Filters",filterDialogColumns:k=1,filterDialogTitle:q="Filters",filterGroups:d=[],onChange:M,onSelectedFiltersChange:i,removeFilterLabel:$=c=>`Remove ${c.label} filter`,resetLabel:j="Reset",searchLabel:O="Search",searchPlaceholder:w="Search",selectedFilters:t=[],showResultsLabel:B="Show results",value:D=""})=>{const c=b.useId(),[v,r]=b.useState(!1),R=b.useMemo(()=>new Map(d.flatMap(e=>{var n;return[...e.options,...((n=e.collapsible)==null?void 0:n.options)??[]]}).map(e=>[e.value,e])),[d]),p=t.flatMap(e=>{const n=R.get(e);return n?[n]:[]}),_=(e,n,s)=>{var f;if(!i)return;const m=new Set([...(s==null?void 0:s.options.map(o=>o.value))??[],...((f=s==null?void 0:s.collapsible)==null?void 0:f.options.map(o=>o.value))??[]]),N=t.filter(o=>!m.has(o));if(n&&(s==null?void 0:s.defaultValue)===e){i(N);return}i(n?(s==null?void 0:s.control)==="radio"||(s==null?void 0:s.selectionMode)==="single"?[...N,e]:[...new Set([...t,e])]:t.filter(o=>o!==e))},u=(e,n)=>{var s;return t.includes(e)||n.defaultValue===e&&![...n.options,...((s=n.collapsible)==null?void 0:s.options)??[]].some(m=>t.includes(m.value))},y=(e,n)=>a.jsx("div",{className:l["filter-option"],"data-component":"renderfilter",children:n.control==="radio"?a.jsxs("label",{className:l.radio,children:[a.jsx("input",{checked:u(e.value,n),name:`${c}-filter-${n.label??"group"}`,onChange:s=>_(e.value,s.target.checked,n),type:"radio"}),a.jsxs("span",{className:l["option-copy"],children:[e.label,e.description&&a.jsx("sub",{children:e.description})]})]}):a.jsx(I.Checkbox,{checked:u(e.value,n),label:a.jsxs("span",{className:l["option-copy"],children:[e.label,e.description&&a.jsx("sub",{children:e.description})]}),onChange:s=>_(e.value,s.target.checked,n)})},e.value);return a.jsxs("div",{className:l.search,"data-component":"search",children:[a.jsxs("div",{className:l.controls,children:[a.jsx(E.Input,{"aria-label":O,icon:"MagnifyingGlass",onChange:e=>M(e.target.value),placeholder:w,type:"search",value:D}),d.length>0&&a.jsx(h.Button,{"aria-expanded":v,"aria-haspopup":"dialog",badge:p.length,icon:"Funnel",onClick:()=>r(!0),variant:"tertiary",children:x})]}),p.length>0&&a.jsxs("div",{"aria-label":x,className:l.chips,children:[p.map(e=>a.jsx(T.Chip,{accessibleLabel:$(e),label:e.label,onDelete:()=>_(e.value,!1)},e.value)),a.jsx(h.Button,{onClick:()=>i==null?void 0:i([]),variant:"tertiary",children:j})]}),v&&a.jsx(z.Dialog,{"aria-labelledby":c,className:l["filter-dialog"],controls:a.jsxs(P.Controls,{children:[a.jsx(h.Button,{onClick:()=>{i==null||i([]),r(!1)},children:j}),a.jsx(h.Button,{onClick:()=>r(!1),variant:"primary",children:B})]}),header:a.jsx(A.Header,{children:a.jsx("h2",{id:c,children:q})}),open:!0,setOpen:r,children:a.jsx("div",{className:l["filter-groups"],"data-columns":k,children:d.map((e,n)=>a.jsxs("section",{"aria-labelledby":e.label?`${c}-${n}`:void 0,className:l["filter-group"],"data-column-span":e.columnSpan??1,role:e.control==="radio"?"radiogroup":"group",children:[e.label&&a.jsx("h3",{id:`${c}-${n}`,children:e.label}),e.options.map(s=>y(s,e)),e.collapsible&&a.jsx(H.Collapsible,{summary:e.collapsible.label,children:a.jsx("div",{className:l["collapsible-options"],children:e.collapsible.options.map(s=>y(s,e))})})]},e.label??n))})})]})};exports.Search=U;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -7,7 +7,7 @@ import { Collapsible as E } from "../collapsible/index.js";
|
|
|
7
7
|
import { Controls as J } from "../controls/index.js";
|
|
8
8
|
import { Dialog as K } from "../dialog/index.js";
|
|
9
9
|
import { Header as P } from "../header/index.js";
|
|
10
|
-
import { I as Q } from "../../index-
|
|
10
|
+
import { I as Q } from "../../index-Ds-Ocs4L.js";
|
|
11
11
|
import '../../assets/index9.css';const U = "_search_1rde5_3", V = "_controls_1rde5_15", W = "_chips_1rde5_35", X = "_radio_1rde5_101", o = {
|
|
12
12
|
search: U,
|
|
13
13
|
controls: V,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";require('./assets/index48.css');const e=require("react/jsx-runtime"),m=require("./classix-5H4IWnMA.cjs"),r=require("react"),U=require("./icons-Dv_p0bUF.cjs"),F=require("./use-touched-Bq5Gjbpz.cjs");function W(n){return n&&`${n[0].toLocaleUpperCase()}${n.slice(1)}`}function P(n){const o=W(n);return o&&!o.endsWith(":")?`${o}:`:o}const k="_field_w1cmd_3",A="_input_w1cmd_8",D="_touched_w1cmd_48",J="_label_w1cmd_57",K="_inline_w1cmd_78",O="_error_w1cmd_99",Q="_code_w1cmd_106",t={field:k,input:A,touched:D,label:J,inline:K,error:O,code:Q};function X({className:n,defaultCountryCode:o="+47",disabled:a=!1,errorMessage:j,icon:g,invalid:_=!1,label:f,onBlur:R,placeholder:I,ref:w,required:p,style:B,type:i="text",variant:v="default",...s}){const V=r.useId(),[x,L]=r.useState(""),[l,N]=r.useState(""),{name:q,onChange:u,pattern:y,value:d,...z}=s,{touched:E,onBlur:G}=F.useTouched(d===""),h=g&&i!=="radio"&&i!=="datetime-local"?g:void 0,C=f&&v==="inline"?P(f):f,b=_&&j?V:void 0,S=[s["aria-describedby"],b].filter(Boolean).join(" ")||void 0,T=h?{...B,"--icon-svg":U.iconSVG(h)}:B,$=F.composeEventHandlers(G,R);r.useEffect(()=>{if(u&&i==="tel"){const c={name:q,value:l?(x||o).split(" ").join("")+l.split(" ").join(""):void 0};u({target:c,currentTarget:c})}},[x,o,q,u,l,i]),r.useEffect(()=>{i==="tel"&&!d&&(N(""),L(""))},[i,d]);const H=e.jsxs(e.Fragment,{children:[e.jsx("input",{disabled:a,hidden:!0,onChange:u,pattern:void 0,placeholder:I,ref:w,type:i,value:d}),e.jsx("input",{type:"text",className:m.t(t.code,t.input),disabled:a,maxLength:5,onChange:c=>L(c.target.value),placeholder:o,value:x}),e.jsx("input",{...z,"aria-describedby":S,"aria-invalid":_?!0:s["aria-invalid"],type:"tel",className:m.t(t.input,n,E&&t.touched),"data-icon":h?"true":void 0,disabled:a,maxLength:14,name:void 0,onChange:c=>N(c.target.value),onBlur:$,pattern:y,required:p,style:T,value:l})]});return e.jsxs("div",{className:t.field,"data-component":"input",children:[e.jsxs("label",{className:m.t(t.label,v==="inline"&&t.inline),children:[C&&e.jsx("span",{"data-required":p&&v!=="inline"?!0:void 0,children:C}),i==="tel"?H:e.jsx("input",{...s,"aria-describedby":S,"aria-invalid":_?!0:s["aria-invalid"],ref:w,className:m.t(t.input,n,E&&t.touched),"data-icon":h?"true":void 0,disabled:a,onBlur:$,placeholder:I,required:p,style:T,type:i})]}),b&&e.jsx("span",{className:t.error,id:b,role:"alert",children:j})]})}exports.Input=X;exports.formatInlineLabel=P;
|
|
2
|
+
//# sourceMappingURL=index-DWDp66fp.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-DWDp66fp.cjs","sources":["../src/utils/text.ts","../src/components/input/index.tsx"],"sourcesContent":["export function capitalizeFirstLetter(value: string): string {\n return value ? `${value[0].toLocaleUpperCase()}${value.slice(1)}` : value;\n}\n\nexport function formatInlineLabel(value: string): string {\n const label = capitalizeFirstLetter(value);\n return label && !label.endsWith(':') ? `${label}:` : label;\n}\n","import cx from 'classix';\nimport { useEffect, useId, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { formatInlineLabel } from '@/utils/text';\nimport { useTouched } from '@/utils/use-touched';\n\nimport styles from './styles.module.css';\n\nexport type InputProps = React.ComponentPropsWithRef<'input'> & {\n defaultCountryCode?: string;\n disabled?: boolean;\n errorMessage?: React.ReactNode;\n icon?: IconName;\n invalid?: boolean;\n label?: string;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n placeholder?: string;\n variant?: 'default' | 'inline';\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'radio'\n | 'search'\n | 'tel'\n | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n errorMessage,\n icon,\n invalid = false,\n label,\n onBlur: onBlurProp,\n placeholder,\n ref,\n required,\n style,\n type = 'text',\n variant = 'default',\n ...props\n}: InputProps) {\n const generatedErrorId = useId();\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { name, onChange, pattern, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n const inputIcon = icon && type !== 'radio' && type !== 'datetime-local' ? icon : undefined;\n const displayLabel = label && variant === 'inline' ? formatInlineLabel(label) : label;\n const errorId = invalid && errorMessage ? generatedErrorId : undefined;\n const describedBy = [props['aria-describedby'], errorId].filter(Boolean).join(' ') || undefined;\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars = inputIcon\n ? {\n ...style,\n '--icon-svg': iconSVG(inputIcon),\n }\n : style;\n const handleBlur = composeEventHandlers(onBlur, onBlurProp);\n\n useEffect(() => {\n if (onChange && type === 'tel') {\n const target = {\n name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n\n onChange({ target, currentTarget: target } as React.ChangeEvent<HTMLInputElement>);\n }\n }, [countryCode, defaultCountryCode, name, onChange, phoneNumber, type]);\n\n useEffect(() => {\n if (type === 'tel' && !value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [type, value]);\n\n const telephoneInput = (\n <>\n <input\n disabled={disabled}\n hidden\n onChange={onChange}\n pattern={undefined}\n placeholder={placeholder}\n ref={ref}\n type={type}\n value={value}\n />\n <input\n type='text'\n className={cx(styles.code, styles.input)}\n disabled={disabled}\n maxLength={5}\n onChange={(e) => setCountryCode(e.target.value)}\n placeholder={defaultCountryCode}\n value={countryCode}\n />\n <input\n {...restProps}\n aria-describedby={describedBy}\n aria-invalid={invalid ? true : props['aria-invalid']}\n type='tel'\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={handleBlur}\n pattern={pattern}\n required={required}\n style={withVars}\n value={phoneNumber}\n />\n </>\n );\n\n return (\n <div className={styles.field}>\n <label className={cx(styles.label, variant === 'inline' && styles.inline)}>\n {displayLabel && (\n <span data-required={required && variant !== 'inline' ? true : undefined}>\n {displayLabel}\n </span>\n )}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n {...props}\n aria-describedby={describedBy}\n aria-invalid={invalid ? true : props['aria-invalid']}\n ref={ref}\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n onBlur={handleBlur}\n placeholder={placeholder}\n required={required}\n style={withVars}\n type={type}\n />\n )}\n </label>\n {errorId && (\n <span\n className={styles.error}\n id={errorId}\n role='alert'\n >\n {errorMessage}\n </span>\n )}\n </div>\n );\n}\n"],"names":["capitalizeFirstLetter","value","toLocaleUpperCase","slice","formatInlineLabel","label","endsWith","Input","className","defaultCountryCode","disabled","errorMessage","icon","invalid","onBlur","onBlurProp","placeholder","ref","required","style","type","variant","props","generatedErrorId","useId","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","name","onChange","pattern","restProps","touched","useTouched","inputIcon","undefined","displayLabel","errorId","describedBy","filter","Boolean","join","withVars","iconSVG","handleBlur","composeEventHandlers","useEffect","target","split","currentTarget","telephoneInput","jsxs","Fragment","jsx","cx","styles","code","input","e","field","inline","error"],"mappings":"mLAAO,SAASA,EAAsBC,EAAuB,CAC3D,OAAOA,GAAQ,GAAGA,EAAM,CAAC,EAAEC,mBAAmB,GAAGD,EAAME,MAAM,CAAC,CAAC,EACjE,CAEO,SAASC,EAAkBH,EAAuB,CACvD,MAAMI,EAAQL,EAAsBC,CAAK,EACzC,OAAOI,GAAS,CAACA,EAAMC,SAAS,GAAG,EAAI,GAAGD,CAAK,IAAMA,CACvD,kNCyBO,SAASE,EAAM,CACpBC,UAAAA,EACAC,mBAAAA,EAAqB,MACrBC,SAAAA,EAAW,GACXC,aAAAA,EACAC,KAAAA,EACAC,QAAAA,EAAU,GACVR,MAAAA,EACAS,OAAQC,EACRC,YAAAA,EACAC,IAAAA,EACAC,SAAAA,EACAC,MAAAA,EACAC,KAAAA,EAAO,OACPC,QAAAA,EAAU,UACV,GAAGC,CACO,EAAG,CACb,MAAMC,EAAmBC,EAAAA,MAAAA,EACnB,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,EAAE,EAC3C,CAACC,EAAaC,CAAc,EAAIF,EAAAA,SAAS,EAAE,EAC3C,CAAEG,KAAAA,EAAMC,SAAAA,EAAUC,QAAAA,EAAS/B,MAAAA,EAAO,GAAGgC,CAAAA,EAAcX,EACnD,CAAEY,QAAAA,EAASpB,OAAAA,CAAAA,EAAWqB,EAAAA,WAAWlC,IAAU,EAAE,EAC7CmC,EAAYxB,GAAQQ,IAAS,SAAWA,IAAS,iBAAmBR,EAAOyB,OAC3EC,EAAejC,GAASgB,IAAY,SAAWjB,EAAkBC,CAAK,EAAIA,EAC1EkC,EAAU1B,GAAWF,EAAeY,EAAmBc,OACvDG,EAAc,CAAClB,EAAM,kBAAkB,EAAGiB,CAAO,EAAEE,OAAOC,OAAO,EAAEC,KAAK,GAAG,GAAKN,OAQhFO,EAAqBR,EACvB,CACE,GAAGjB,EACH,aAAc0B,EAAAA,QAAQT,CAAS,CAAA,EAEjCjB,EACE2B,EAAaC,EAAAA,qBAAqBjC,EAAQC,CAAU,EAE1DiC,EAAAA,UAAU,IAAM,CACd,GAAIjB,GAAYX,IAAS,MAAO,CAC9B,MAAM6B,EAAS,CACbnB,KAAAA,EACA7B,MAAO2B,GACFH,GAAehB,GAAoByC,MAAM,GAAG,EAAEP,KAAK,EAAE,EACtDf,EAAYsB,MAAM,GAAG,EAAEP,KAAK,EAAE,EAC9BN,MAAAA,EAGNN,EAAS,CAAEkB,OAAAA,EAAQE,cAAeF,CAAAA,CAA+C,CACnF,CACF,EAAG,CAACxB,EAAahB,EAAoBqB,EAAMC,EAAUH,EAAaR,CAAI,CAAC,EAEvE4B,EAAAA,UAAU,IAAM,CACV5B,IAAS,OAAS,CAACnB,IACrB4B,EAAe,EAAE,EACjBH,EAAe,EAAE,EAErB,EAAG,CAACN,EAAMnB,CAAK,CAAC,EAEhB,MAAMmD,EACJC,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAC,EAAAA,IAAC,QAAA,CACC,SAAA7C,EACA,OAAM,GACN,SAAAqB,EACA,QAASM,OACT,YAAArB,EACA,IAAAC,EACA,KAAAG,EACA,MAAAnB,CAAA,CAAa,EAEfsD,EAAAA,IAAC,QAAA,CACC,KAAK,OACL,UAAWC,IAAGC,EAAOC,KAAMD,EAAOE,KAAK,EACvC,SAAAjD,EACA,UAAW,EACX,SAAWkD,GAAMlC,EAAekC,EAAEX,OAAOhD,KAAK,EAC9C,YAAaQ,EACb,MAAOgB,CAAAA,CAAY,EAErB8B,MAAC,SACC,GAAItB,EACJ,mBAAkBO,EAClB,eAAc3B,EAAU,GAAOS,EAAM,cAAc,EACnD,KAAK,MACL,UAAWkC,EAAAA,EAAGC,EAAOE,MAAOnD,EAAW0B,GAAWuB,EAAOvB,OAAO,EAChE,YAAWE,EAAY,OAASC,OAChC,SAAA3B,EACA,UAAW,GACX,KAAM2B,OACN,SAAWuB,GAAM/B,EAAe+B,EAAEX,OAAOhD,KAAK,EAC9C,OAAQ6C,EACR,QAAAd,EACA,SAAAd,EACA,MAAO0B,EACP,MAAOhB,CAAAA,CAAY,CAAA,EAEvB,EAGF,cACG,MAAA,CAAI,UAAW6B,EAAOI,MAAM,iBAAA,QAC3B,SAAA,CAAAR,EAAAA,KAAC,QAAA,CAAM,UAAWG,EAAAA,EAAGC,EAAOpD,MAAOgB,IAAY,UAAYoC,EAAOK,MAAM,EACrExB,SAAAA,CAAAA,GACCiB,EAAAA,IAAC,QAAK,gBAAerC,GAAYG,IAAY,SAAW,GAAOgB,OAC5DC,SAAAA,CAAAA,CACH,EAEDlB,IAAS,MACRgC,EAEAG,EAAAA,IAAC,QAAA,CACC,GAAIjC,EACJ,mBAAkBkB,EAClB,eAAc3B,EAAU,GAAOS,EAAM,cAAc,EACnD,IAAAL,EACA,UAAWuC,EAAAA,EAAGC,EAAOE,MAAOnD,EAAW0B,GAAWuB,EAAOvB,OAAO,EAChE,YAAWE,EAAY,OAASC,OAChC,SAAA3B,EACA,OAAQoC,EACR,YAAA9B,EACA,SAAAE,EACA,MAAO0B,EACP,KAAAxB,CAAA,CAAW,CAAA,EAGjB,EACCmB,GACCgB,EAAAA,IAAC,OAAA,CACC,UAAWE,EAAOM,MAClB,GAAIxB,EACJ,KAAK,QAEJ5B,SAAAA,CAAAA,CACH,CAAA,EAEJ,CAEJ"}
|