@jointhedots/ui 2.0.20 → 2.0.21
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/{chunk.IWVPDTNR.js → chunk.4OZ7ZS3K.js} +1 -1
- package/{chunk.NOVIDUKC.js → chunk.6DTI5JDB.js} +1 -1
- package/{chunk.TB7PTJUW.js → chunk.6ZS7PC7C.js} +1 -1
- package/{chunk.SOVKFN6E.js → chunk.B25CG3PJ.js} +1 -1
- package/chunk.JBXYN3HT.js +35 -0
- package/{chunk.S2ABQ2TE.js → chunk.NJTGJCJ4.js} +1 -1
- package/{chunk.NZRTZDOB.js → chunk.W7LG3C4Y.js} +1 -1
- package/{chunk.7FLBFFZJ.js → chunk.YL2ZXJZH.js} +1 -1
- package/export.applicationboard.js +1 -1
- package/export.componentslibrary.js +1 -1
- package/export.dialog.js +1 -1
- package/export.icon.js +1 -1
- package/export.inputs.js +1 -1
- package/export.items.js +1 -1
- package/export.layouts.js +1 -1
- package/export.notifications.js +1 -1
- package/export.servicepoint.js +1 -1
- package/lambda.src.applicationboard.component.js +1 -1
- package/package.json +22 -22
- package/types.d.ts +9 -0
- package/chunk.OW3MI2XU.js +0 -35
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as J}from"./chunk.
|
|
1
|
+
import{e as J}from"./chunk.B25CG3PJ.js";import{a as j,b as $}from"./chunk.VLRB3H3F.js";import{a as q}from"./chunk.W7LG3C4Y.js";import{c as b,f,j as R,p as T,q as O}from"./chunk.6ZS7PC7C.js";import{a as L,b as F}from"./chunk.NJTGJCJ4.js";import{k as B}from"./chunk.JBXYN3HT.js";import{useMemo as Z,useRef as Ae,useState as E}from"react";import{toast as Ne}from"react-toastify";import{acquireComponent as De,ComponentControllerKey as A,EditorKey as ee,unregisterComponent as _e,saveComponentManifest as te,acquireFutureComponent as Be}from"@jointhedots/core";import{ModalContent as Le,Button as X}from"react-lightning-design-system";import Fe from"@rjsf/core";import Re from"@rjsf/validator-ajv8";import ye,{useCallback as K,useEffect as ge,useMemo as be}from"react";import{ComponentsRegistry as he,createComponentFilter as P,acquireComponent as k,deleteComponent as xe}from"@jointhedots/core";import{useAsyncMemo as we,useAsyncState as Se}from"@jointhedots/core/react";var ce=`.jtd-input_wrapper {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L,g as F,o as z,p as k}from"./chunk.
|
|
1
|
+
import{a as L,g as F,o as z,p as k}from"./chunk.4OZ7ZS3K.js";import{c as B}from"./chunk.B25CG3PJ.js";import{d as y,e as x,f as R,i as N,o as I,p as _}from"./chunk.6ZS7PC7C.js";import{a as P}from"./chunk.NJTGJCJ4.js";import{k as M}from"./chunk.JBXYN3HT.js";import{useEffect as fe,useState as Se}from"react";import{fetchComponentsPublications as U,ServicePoints as ge,getServicePoint as be,getSettings as J,listenSettings as he,unlistenSettings as Ce}from"@jointhedots/core";import{useAsyncMemo as K}from"@jointhedots/core/react";import{blue as Pe,cyan as ye,deepOrange as xe,green as De,pink as _e,purple as ke,deepPurple as we,orange as Ae}from"@mui/material/colors";import{useCallback as O,useEffect as te,useState as H}from"react";import{ComponentsRegistry as oe,createComponentFilter as ne,listenServicePoints as ie,unlistenServicePoints as re,failedComponentPublication as se,acquireComponent as ce}from"@jointhedots/core";import{useAsyncState as le}from"@jointhedots/core/react";import{jsx as ee}from"react/jsx-runtime";function W(i){let{content:e,data:t,children:o}=i,n=y(async()=>({content:e instanceof Function?await e(t):e}),[t,e]);return ee("div",{onMouseEnter:c=>n.open(x(c)),onMouseLeave:()=>n.close(),children:o})}import{ButtonGroup as ae}from"@salesforce/design-system-react";import{Fragment as me,jsx as a,jsxs as w}from"react/jsx-runtime";var pe={grouped:!1,small:!1,allowEdit:!0,allowDelete:!0};function q(i){let{cnx:e,selected:t,onSelect:o,onActivate:n}=i;return a(F,{entry:e,selected:t,display:pe,onSelect:o&&(()=>o(e)),onActivate:n&&(()=>n(e))})}function de(i,e,t){let o=[...i.providers];if(e){let n=o.indexOf(t);n<0?o.push(t):o.splice(n,1)}else i.providers?.[0]===t?o=[]:o=[t];return{...i,providers:o}}function ue(i,e,t){let o=[...i.providers];if(e){let n=o.indexOf(t);n>=0&&(o[n]=o[0]),o[0]=t}else o=[t];return{...i,providers:o}}function ve(i){let{servicePoint:e,hasSelectMode:t,multiple:o,colormap:n,onChange:c}=i,[l,p]=H(!1),r=le(async()=>{let[s,m]=e.id.split("/"),v=oe.components_provider,C=ne({services:[s]}),f=await v.search_component_publications(C),b=[];for(let S of f)S&&!e.providers.includes(S.id)&&S.services.includes(s)&&b.push(S);for(let S of e.providers)f.find(D=>D.id===S)||f.push(se(S));return{providers:f,remains:b}},[e],null),u=s=>{c(de(e,o,s.id),!l)},g=s=>{c(ue(e,o,s.id),!l)};return a(me,{children:r.waiting(({providers:s,remains:m})=>{let[v,C]=e.id.split("/");return s.length===0&&m.length===0?a(z,{service:v,onCreate:g}):w(R,{vertical:!0,style:{minWidth:200},children:[e.providers.map((f,b)=>{let S=s.find(D=>D.id===f);return S&&a("div",{style:n&&{"--item-shape-color":n[b]||"red"},children:a(q,{cnx:S,selectable:l&&t,selected:l?5:1,onSelect:u,onActivate:g})},b)}),m.map((f,b)=>a("div",{children:a(q,{cnx:f,selectable:l&&t,selected:l?6:2,onSelect:u,onActivate:g})},b)),t?w(ae,{children:[a(k,{label:"New Connexion",service:v,onCreate:g}),a(P,{style:{flex:1},icon:"bi:pencil-square",label:"Selection",variant:l?"brand":void 0,onClick:()=>p(!l)})]}):a(k,{label:"New Connexion",service:v,onCreate:g})]})})})}function A(i){let{servicePoint:e,compact:t,providers:o,colormap:n,hasSelectMode:c,onChange:l}=i,p=B(()=>o.map(s=>ce(s.id).getLogStats()),[o]),r=y(s=>({icon:"",title:"",content:a(ve,{servicePoint:e,multiple:!0,colormap:n,hasSelectMode:c,onChange:(m,v)=>{v&&s.close(),l(m)}})}),[e,n]),u=O(s=>{r.open(x(s))},[r]),g=O(async s=>w("div",{children:[a(_,{name:s.title,icon:s.icon},s.id),a(L,{entry:s})]}),[e]);if(e){if(o.length===0)return a(P,{variant:"base",onClick:u,children:"Connect"});{let s=t?I:_;return a(P,{variant:"base",onClick:u,children:o.map((m,v)=>{let C=[],f=p?.[v]?.error_count||0;return n&&C.push({type:"shape",color:n[v]}),f>0&&C.push({type:"badge",name:"bi:exclamation-triangle-fill"}),a(W,{content:g,data:m,children:a(s,{name:m.title,icon:m.icon,decorations:C},m.id)},v)})})}}else return a(P,{variant:"destructive",children:"Invalid service point"})}function G(i){let[e,t]=H(i?.descriptor);return te(()=>{if(i){let o=ie(n=>{n===i&&t(n.descriptor)});return()=>re(o)}return null},[i]),e}import{Fragment as Me,jsx as h,jsxs as T}from"react/jsx-runtime";var Ee=[De,_e,Pe,ye,xe,ke,we,Ae].map(i=>i.A700);function ft(i){let{servicePoint:e}=i,t=G(e),o=K(()=>U(t?.providers),[],[t?.providers]),n=c=>{J().set("service_points",e.id,c)};return h(A,{compact:!0,hasSelectMode:!0,colormap:o.length>1?Ee:void 0,servicePoint:t,providers:o,onChange:n})}function E(i){let{label:e,value:t,onChange:o}=i,n=be(t.id)?.failure,c=K(()=>U(t.providers),[],[t.providers]);return T("div",{className:n?"slds-form-element slds-has-error":"slds-form-element",children:[h("label",{className:"slds-form-element__label",children:e||t.id}),T("div",{className:"slds-form-element__control",children:[h("div",{className:"slds-input",children:h(A,{servicePoint:t,providers:c,onChange:o})}),n&&h("div",{className:"slds-form-element__help",id:"error-id",children:n.message})]})]})}function St(i){let{showAll:e}=i,t=J(),[o,n]=Se(null),c=[];fe(()=>{let p=he(r=>{r==="service_points"&&n({})});return()=>Ce(p)},[]);let l=p=>r=>{t.set("service_points",p,r)};for(let p of t.list("service_points"))if(e||ge.has(p)){let r=t.get("service_points",p);c.push(h(E,{label:r.properties?.title||p,value:r,onChange:l(p)},p))}return h(Me,{children:c})}import Re,{useCallback as Ne,useEffect as Ie,useRef as Be,useState as X}from"react";import{getSettings as Le}from"@jointhedots/core";import{Button as Y}from"react-lightning-design-system";import{MissingServiceError as Z,registerErrorDisplayer as Fe,useServicesListener as ze}from"@jointhedots/core/react";import{Fragment as We,jsx as d,jsxs as j}from"react/jsx-runtime";function Q(i){let e=Le(),{services:t,onApply:o}=i,[n,c]=X(()=>t.reduce((r,u)=>(r[u.id]=u.descriptor,r),{}));o&&ze(o);let l=[];for(let r in n){let u=n[r],g=s=>{c({...n,[r]:s})};l.push(d(E,{label:u.title||r,value:u,onChange:g},r))}let p=Ne(async()=>{for(let r of t)e.set("service_points",r.id,n[r.id]);for(let r of t)await r.fetch();o?.()},[o,n]);return j("div",{style:{display:"flex",flexDirection:"column",gap:20,padding:10,maxWidth:400,margin:"auto"},children:[d("div",{style:{fontSize:"150%",borderBottom:"dotted thin #aaaa"},children:"Following services are required"}),l,d(Y,{type:"brand",onClick:p,children:"Apply"})]})}function $(i){let e=Be(),[t,o]=X(0);Ie(()=>{let c=e.current,l=new ResizeObserver(()=>{c.clientWidth<400&&c.clientHeight<300?o(1):o(2)});return l.observe(c),()=>l.unobserve(c)},[e]);let n=()=>{N(c=>d(Q,{...i,onApply:c})).then(i.onApply)};return d("div",{ref:e,style:{overflow:"hidden"},children:t==2?d("div",{style:{borderRadius:10,maxWidth:400,border:"solid thin grey",margin:"auto"},children:d(Q,{...i})}):t==1?d("div",{style:{maxWidth:400,padding:5,margin:"auto"},children:j(Y,{type:"destructive",onClick:n,children:[d(M,{name:"bi:exclamation-diamond"}),"Settings"]})}):null})}var V=class extends Re.Component{state={};componentDidCatch(e){if(e instanceof Z)this.setState({error:e});else throw e}render(){let{error:e}=this.state;return e?d($,{services:e.missings,onApply:()=>this.setState({error:void 0})}):d(We,{children:this.props.children})}};function Mt(){Fe(Z,i=>{let{error:e,onRetry:t}=i;return d($,{services:e.missings,onApply:t})})}export{Ee as a,ft as b,E as c,St as d,$ as e,V as f,Mt as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as y}from"./chunk.
|
|
1
|
+
import{b as y}from"./chunk.NJTGJCJ4.js";import{d as z,k as H}from"./chunk.JBXYN3HT.js";import{useEffect as Me,useMemo as je}from"react";import{areSimilarObjects as Ce}from"@jointhedots/core";import ke from"react-dom/client";import{useState as Y,useEffect as we}from"react";var g=[];function w(e){return((e+1)*1e3+1e7).toString()}var k=class{stack=[];main=null;appendPanel(t){let o=this.stack.indexOf(t);if(o>0&&(this.stack.splice(o,1),this.main&&this.stack.push(this.main)),this.main!==t){let n=this.main;this.main=t,this.updateStack(n)}else o>0&&this.updateStack(this.main);G("open",null)}removePanel(t){let o=this.stack.indexOf(t);o>0?(this.stack.splice(o,1),this.updateStack(this.main)):t===this.main&&(this.main=this.stack.pop(),this.updateStack(t))}refresh(t){this.stack.indexOf(t)>0?this.updateStack(this.main):t===this.main&&this.updateStack(t)}},M=new Set;function G(e,t){for(let o of M)o(e,t)}function X(e){M.size===0&&window.addEventListener("mousedown",t=>{G("mouse",t.target)},{capture:!0}),M.add(e)}function V(e){M.delete(e)}import W from"react";var de=`.jtd-menu-item {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as g,q as x}from"./chunk.
|
|
1
|
+
import{d as g,q as x}from"./chunk.6ZS7PC7C.js";import{a as y,b}from"./chunk.NJTGJCJ4.js";import{e as h}from"./chunk.JBXYN3HT.js";import{useCallback as O,useEffect as j,useState as f}from"react";import{acquireComponent as T,queryLogInfos as P,queryLogObjects as w,registerLogCollector as I,unregisterLogCollector as E}from"@jointhedots/core";import{executeCommand as z}from"@jointhedots/core/commands";var C=`.empty-list-placeholder {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: center;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import{f as b}from"./chunk.J7UOQR25.js";import v from"react";import{jsx as S}from"react/jsx-runtime";var d=class{constructor(e){this.baseUrl=e}setup(e){let{name:o}=e;Object.assign(e.style,L),e.style.backgroundImage=`url(${this.baseUrl}${o})`}draw(e){let{className:o,style:s}=e;return S("div",{className:o,style:s})}},L={height:"1em",width:"1em",minHeight:"1em",minWidth:"1em",backgroundRepeat:"no-repeat",backgroundPosition:"center"};import{jsx as N}from"react/jsx-runtime";var p=class{setup(e){Object.assign(e.style,j)}draw(e){let{name:o,className:s,style:n}=e,i=`[Bad icon '${o}']`;return N("div",{title:i,className:s,style:n})}},f=class{setup(e){}draw(e){let{className:o,style:s}=e;return N("div",{className:o,style:s})}},j={height:"1em",width:"1em",background:"repeating-linear-gradient(45deg,#0000,#0000 1px,#f00 2px,#f00 3px)"};var C=(n=>(n.xs="0.8em",n.sm="1.0em",n.md="1.5em",n.lg="2.0em",n))(C||{});function g(t,e){m[t]=e}function re(t,e){return t||(e?"avatar:"+e:null)}function E(t){let{name:e,size:o,inverse:s,className:n,style:i}=t,l=v.useContext(b),r=H(e),c=s?l.contrastTheme:l,I=[];for(let y of r.elements)I.push(y.collection.draw(y,c));return v.createElement("div",{...t,name:void 0,inversed:void 0,className:n&&r.className?`${n} ${r.className}`:n||r.className,style:{fontSize:o&&(C[o]||o),...i,...r.style}},...I)}var m={blank:new f,"?":new p},x=new Map,z={error:a("red"),warn:a("gold"),info:a("grey"),primary:a("#36f"),secondary:a("#666"),success:a("#6d0"),badge:{style:{fontSize:"0.6em",top:"-0.3em",right:"-0.3em",left:"unset",bottom:"unset"}},RT:{style:{fontSize:"0.6em",top:"-0.3em",right:"-0.3em",left:"unset",bottom:"unset"}},RB:{style:{fontSize:"0.6em",bottom:"-0.3em",right:"-0.3em",left:"unset",top:"unset"}},LT:{style:{fontSize:"0.6em",top:"-0.3em",left:"-0.3em",right:"unset",bottom:"unset"}},LB:{style:{fontSize:"0.6em",bottom:"-0.3em",left:"-0.3em",right:"unset",top:"unset"}}},U=/^(?:\[(?<options>[^\]]*)\])?(?<elements>.*)$/,O=/^(?:(?<set>[a-z0-9-_@]+):)?(?<name>[^\[]+)(?:\[(?<options>[^\]]*)\])?$/;g("data",new d(""));function a(t){return{style:{color:t,"--color":t}}}function k(t,e){if(e){let o=t.style||{},s=[];t.className&&s.push(t.className);for(let n of e.split(",")){let[i,l]=n.split("=");if(l)o["--"+i]=l;else{let r=z[i];r?(s.push(r.className),Object.assign(o,r.style)):console.error(`Icon '${name}' has invalid flag '${i}'`)}}t.className=s.join(" "),t.style=o}}function A(t,e){let o=null,s=e.match(O);if(s&&s.groups){let{set:n,name:i,options:l}=s.groups;o={collection:(n?m[n]:m[i])||m["?"],name:i,className:"",style:{}},k(o,l)}else o={collection:m["?"],name:e,className:"",style:{}},console.error(`Icon element '${e}' is invalid`);o.collection.setup(o),t.elements.push(o)}function B(t){let e={elements:[],className:"jtd-icon"},o=t.match(U);if(o&&o.groups){let{options:s,elements:n}=o.groups;k(e,s);for(let i of n.split("|"))A(e,i)}else{console.error(`Icon '${t}' is invalid`);let s=m["?"];e.elements.push({collection:s,name:t})}return e}function H(t){let e=x.get(t);return e||(typeof t!="string"&&(t===void 0||t===null?t="blank":typeof t=="number"?t=`badge:${t}`:t=`error:typeof ${typeof t}`),e=B(t),x.set(t,e)),e}var W=`.jtd-icons-avatar {
|
|
2
|
+
width: 1em;
|
|
3
|
+
height: 1em;
|
|
4
|
+
min-width: 1em;
|
|
5
|
+
min-height: 1em;
|
|
6
|
+
border-radius: 50%;
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
background-color: var(--avatar-bgcolor);
|
|
11
|
+
user-select: none;
|
|
12
|
+
}
|
|
13
|
+
.jtd-icons-avatar > * {
|
|
14
|
+
color: white;
|
|
15
|
+
font-family: "Segoe UI", "Tahoma", "Geneva", "Verdana", sans-serif;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
font-size: 0.5em;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.jtd-icon {
|
|
21
|
+
position: relative;
|
|
22
|
+
height: 1em;
|
|
23
|
+
width: 1em;
|
|
24
|
+
min-height: 1em;
|
|
25
|
+
min-width: 1em;
|
|
26
|
+
max-height: 1em;
|
|
27
|
+
max-width: 1em;
|
|
28
|
+
}
|
|
29
|
+
.jtd-icon > * {
|
|
30
|
+
position: absolute;
|
|
31
|
+
left: 0;
|
|
32
|
+
top: 0;
|
|
33
|
+
right: 0;
|
|
34
|
+
top: 0;
|
|
35
|
+
}`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(W));import{jsx as w}from"react/jsx-runtime";var h=class{setup(e){let{name:o}=e;e.className=`jtd-icons-avatar ${e.className}`,e.style["--avatar-bgcolor"]="#888",e.value=""+o}draw(e){let{value:o,className:s,style:n}=e;return w("div",{className:s,style:n,children:w("div",{children:o})})}};g("badge",new h);import{jsx as R}from"react/jsx-runtime";var u=class{setup(e){let{name:o}=e,s=_(o);e.className=`jtd-icons-avatar ${e.className}`,e.style["--avatar-bgcolor"]=D(o),e.tag=s}draw(e){let{tag:o,className:s,style:n}=e;return R("div",{className:s,style:n,children:R("div",{children:o})})}};function _(t){t=t.trim();let e=t.charAt(0),o=t.charAt(t.length-1),s=t.charAt(t.length-2);if(!isNaN(parseInt(o))&&isNaN(parseInt(s)))e+=o;else for(let n of t.matchAll(/[\-_ ]([a-zA-Z])/g))if(e+=n[1],e.length>=2)break;return e.toUpperCase()}function D(t){let e=F(t);return Z(e*360)}function F(t,e=0){if(t==null)return Math.random();{let o=3735928559^e,s=1103547991^e;for(let i=0,l;i<t.length;i++)l=t.charCodeAt(i),o=Math.imul(o^l,2654435761),s=Math.imul(s^l,1597334677);return o=Math.imul(o^o>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),(4294967296*(2097151&s)+(o>>>0)&65535)/65535}}function Z(t){let e=.7,o=.5,s=(1-Math.abs(2*o-1))*e,n=s*(1-Math.abs(t/60%2-1)),i=o-s/2,l,r,c;return t>=0&&t<60?(l=s,r=n,c=0):t>=60&&t<120?(l=n,r=s,c=0):t>=120&&t<180?(l=0,r=s,c=n):t>=180&&t<240?(l=0,r=n,c=s):t>=240&&t<300?(l=n,r=0,c=s):t>=300&&t<360&&(l=s,r=0,c=n),l=Math.round((l+i)*255),r=Math.round((r+i)*255),c=Math.round((c+i)*255),`rgb(${l}, ${r}, ${c})`}g("avatar",new u);import{jsx as G}from"react/jsx-runtime";var $=class{constructor(e){this.classPrefix=e}setup(e){let{name:o}=e;e.className=`${this.classPrefix+o} ${e.className}`,Object.assign(e.style,q)}draw(e){let{className:o,style:s}=e;return G("i",{className:o,style:s})}},q={height:"1em",width:"1em",display:"inline-flex",flexDirection:"row",alignItems:"center"};import{jsx as Q}from"react/jsx-runtime";var T=class{constructor(e){this.defaultIcon=e}lights={};darks={};addIcon(e,o,s){this.lights[e]=`url(${o})`,this.darks[e]=`url(${s})`}setup(e){Object.assign(e.style,K)}draw(e,o){let{name:s,className:n,style:i}=e,l=o.lighting===1?this.lights[s]||this.lights[this.defaultIcon]:this.darks[s]||this.darks[this.defaultIcon];return Q("div",{className:n,style:{backgroundImage:l,...i}})}},K={height:"1em",width:"1em",minHeight:"1em",minWidth:"1em",backgroundRepeat:"no-repeat",backgroundPosition:"center"};import{jsx as M}from"react/jsx-runtime";var P=class{constructor(e,o,s){this.light_url=e;this.dark_url=o;this.classNamer=s;this.lightRef=`${e}#`,this.darkRef=`${o}#`}lightRef;darkRef;setup(e){let{classNamer:o}=this;e.className=o?o(e):e.className,Object.assign(e.style,X)}draw(e,o){let{name:s,className:n,style:i}=e,l=o.lighting===1?this.lightRef:this.darkRef;return M("svg",{className:n,style:i,children:M("use",{xlinkHref:l+s})})}},X={height:"1em",width:"1em",minHeight:"1em",minWidth:"1em",backgroundRepeat:"no-repeat",backgroundPosition:"center"};var Le=E;export{d as a,C as b,g as c,re as d,E as e,h as f,u as g,$ as h,T as i,P as j,Le as k};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as f,e as b,
|
|
1
|
+
import{b as f,e as b,k as v}from"./chunk.JBXYN3HT.js";import M,{useState as T}from"react";import I from"classnames";import{Tooltip as B}from"@salesforce/design-system-react";var N=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget"]);function x(r){return Object.keys(r).reduce((t,e)=>((N.has(e)||e.startsWith("aria-")||e.startsWith("data-"))&&(t[e]=r[e]),t),{})}import"@salesforce-ux/design-system/assets/styles/salesforce-lightning-design-system.min.css";var E=`.jtd-button-icon {
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as t}from"./chunk.
|
|
1
|
+
import{i as t}from"./chunk.6ZS7PC7C.js";import s from"@rjsf/core";import d from"@rjsf/validator-ajv8";import{Button as e,Modal as c,ModalContent as u,ModalHeader as f}from"react-lightning-design-system";import{jsx as o,jsxs as m}from"react/jsx-runtime";function M(a){return t(r=>m("div",{className:"slds-m-around_small",children:[o("div",{className:"slds-m-vertical_small",children:a}),o(e,{type:"brand",onClick:()=>r(!0),children:"Yes"}),o(e,{type:"neutral",onClick:()=>r(!1),children:"No"})]}))}function N(a,r,n){return t(i=>m(c,{children:[o(f,{title:a}),o(u,{children:o(s,{formData:n,schema:r,validator:d,onSubmit:l=>i(l.formData),onError:()=>i(n)})})]}))}export{M as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as T,d as L}from"./chunk.
|
|
1
|
+
import{b as T,d as L}from"./chunk.6DTI5JDB.js";import{i as w,q as B}from"./chunk.4OZ7ZS3K.js";import{d as k}from"./chunk.B25CG3PJ.js";import{n as b,p as S}from"./chunk.6ZS7PC7C.js";import{k as C}from"./chunk.JBXYN3HT.js";import{createComponentFilter as me,acquireServicePoint as ge}from"@jointhedots/core";import{useEffect as j,useMemo as W,useRef as J,useState as R}from"react";import{createComponentFilter as Q,acquireServicePoint as X}from"@jointhedots/core";import{useCurrentView as Y}from"@jointhedots/core/react";import{getViewReferenceFrom as Z,gotoURLView as N}from"@jointhedots/core/view";import{Fragment as te,jsx as e,jsxs as f}from"react/jsx-runtime";var V=o=>{let n=J(null);return j(()=>{let t=i=>{n.current&&!n.current.contains(i.target)&&o()};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[o]),n};function G(o,n){return Z(o?.view)===n}function H(o,n,t){if(n&&n.pages)for(let i in n.pages){let s=H(i,n.pages[i],t);if(s)return s}else if(G(n,t))return o;return null}function ee(o){let{title:n,entry:t,active:i,onGoto:s}=o,[r,a]=R(!1),c=V(()=>a(!1)),d=H(n,t,i),m=t.pages,u=d||n;return f("li",{className:`slds-context-bar__item slds-context-bar__dropdown-trigger slds-dropdown-trigger slds-dropdown-trigger_click slds-is-open ${d?"slds-is-active":""}`,children:[e("a",{className:"slds-context-bar__label-action",title:"Menu Item",onClick:()=>a(!r),children:e("span",{className:"slds-truncate",title:u,children:u})}),n&&e("div",{className:"slds-context-bar__icon-action slds-p-left_none",onClick:()=>a(!r),children:f("button",{className:"slds-button slds-button_icon slds-button_icon slds-context-bar__button","aria-haspopup":"true",title:`Open ${n}`,children:[e(C,{className:"slds-button__icon",name:"utility:chevrondown"}),e("span",{className:"slds-assistive-text",children:"Open menu item submenu"})]})}),r&&e("div",{ref:c,className:"slds-dropdown slds-dropdown_left",children:e("ul",{className:"slds-dropdown__list",role:"menu",children:m&&Object.keys(m).map((g,_)=>{let P=m[g];return e("li",{className:"slds-dropdown__item slds-p-horizontal_xx-small",role:"presentation",children:e(S,{name:g,icon:P.icon||"blank",summary:P.description||g,onSelect:(()=>{a(!1),s(P)})})},_)})})})]})}function ne(o){let{toolings:n,origin:t,onClose:i}=o,s=V(i),r=W(()=>Q({services:["view.react"],types:["jtd:application.board.component"]}),[]),a=c=>{i(),N({name:c.id})};return f("div",{ref:s,className:"slds-dropdown slds-dropdown_left",children:[f("div",{style:{display:"flex",fontSize:"130%",justifyContent:"flex-start",paddingLeft:5,borderBottom:"solid thin #0005"},children:[e(b,{icon:"bi:person-gear",name:"Configuration",onActivate:()=>{N({name:"settings"},t)}}),Array.isArray(n)&&e(M,{toolings:n,anchor:"menu"})]}),e(w,{filter:r,onSelect:a})]})}function I(o){let{panel:n,descriptor:t,active:i,origin:s}=o,[r,a]=R(!1),{title:c,pages:d,toolings:m}=t,u=p=>{p.view&&N(p.view,s)};return f("div",{className:"slds-context-bar",children:[e("div",{className:"slds-context-bar__primary",children:f("div",{className:"slds-context-bar__item slds-context-bar__dropdown-trigger slds-dropdown-trigger slds-dropdown-trigger_click slds-no-hover slds-is-open",children:[e("div",{className:"slds-context-bar__icon-action",children:f("button",{className:"slds-button slds-icon-waffle_container slds-context-bar__button",onClick:()=>a(!r),title:"Settings",children:[f("span",{className:"slds-icon-waffle",children:[e("span",{className:"slds-r1"}),e("span",{className:"slds-r2"}),e("span",{className:"slds-r3"}),e("span",{className:"slds-r4"}),e("span",{className:"slds-r5"}),e("span",{className:"slds-r6"}),e("span",{className:"slds-r7"}),e("span",{className:"slds-r8"}),e("span",{className:"slds-r9"})]}),e("span",{className:"slds-assistive-text",children:"Open App Launcher"})]})}),r&&e(ne,{toolings:m,origin:s,onClose:()=>a(!1)}),!n&&c&&e("span",{className:"slds-context-bar__label-action slds-context-bar__app-name",children:e("span",{className:"slds-truncate",title:"App Name",children:c})})]})}),f("nav",{className:"slds-context-bar__secondary",role:"navigation",children:[e("ul",{className:"slds-grid",children:d&&Object.keys(d).map(p=>{let g=d[p];if(g.pages)return e(ee,{title:p,entry:g,active:i,onGoto:u},p);{let _=`slds-context-bar__item ${G(g,i)?"slds-is-active":""}`;return e("li",{className:_,children:e("a",{title:p,className:"slds-context-bar__label-action",onClick:()=>u(g),children:e("span",{className:"slds-truncate",title:g.description||p,children:p})})},p)}})}),e("div",{style:{flexGrow:1,display:"flex"},children:e("div",{style:{flexGrow:1}})})]}),e("div",{style:{display:"flex",alignItems:"center",gap:5,paddingRight:5},children:Array.isArray(m)&&e(M,{toolings:m,anchor:"status"})})]})}function M(o){let{toolings:n,anchor:t}=o,i=Y();return e(te,{children:n.map((s,r)=>{if(s.anchor!==t)return null;if(s.type==="servicePoint"){let a=X(s.id);if(a)return e(T,{servicePoint:a},r)}else{if(s.type==="notifications")return e(k,{},r);if(s.type==="link"){let{url:a,view:c,title:d,icon:m}=s;if(a)return e(b,{icon:m,name:d,onActivate:()=>{window.open(a,"_blank")}},r);if(c)return e(b,{icon:m,name:d,onActivate:()=>{N(c,i)}},r)}}return null})})}import{Button as ue}from"react-lightning-design-system";import{ButtonGroup as oe,PageHeader as ie,PageHeaderDetail as se,PageHeaderHeading as re,Button as ae}from"react-lightning-design-system";import{Fragment as ce,jsx as v,jsxs as O}from"react/jsx-runtime";function D({children:o,icon:n,title:t,onClose:i,legend:s,buttons:r,info:a,minHeight:c}){return O(ie,{children:[v(re,{figure:n,info:a,legend:s||"",title:t,rightActions:O(oe,{children:[i&&v(ae,{type:"neutral",onClick:()=>i(),icon:"close",title:"Close"}),r]})}),v(se,{children:v(y,{sx:{backgroundColor:"white",margin:"0 -1rem -1rem",padding:le()?"0":"1rem",borderRadius:"0 0 0.25rem 0.25rem",width:"100%",minHeight:c||"85vh"},children:o})})]})}function le(){return window.location.href.indexOf("embedded=true")>-1}function q({children:o,component_id:n}){return v(ce,{children:o})}function y(o){let{children:n,className:t,sx:i}=o;return v("div",{className:t,style:i,children:n})}function A(o){let{children:n,className:t,sx:i}=o;return v("div",{className:t,style:i,children:n})}import{InvokeView as K,useAsyncMemo as fe,useCurrentView as ve,useLocationHash as ye,UseServicePoints as U}from"@jointhedots/core/react";import"@salesforce-ux/design-system/assets/styles/salesforce-lightning-design-system.min.css";import{Tab as F,Tabs as pe}from"react-lightning-design-system";import{jsx as x,jsxs as de}from"react/jsx-runtime";function E(){return x("div",{style:{margin:10,display:"grid"},children:de(pe,{defaultActiveKey:"0",onSelect:function(){},type:"default",children:[x(F,{title:"Service Points",eventKey:"0",children:x(L,{})}),x(F,{title:"Components",eventKey:"1",children:x(B,{title:"Components"})})]})})}import{getViewReferenceFrom as xe,getViewInfosFrom as z,gotoURLView as $}from"@jointhedots/core/view";import{useMemo as be}from"react";import{Fragment as we,jsx as l,jsxs as h}from"react/jsx-runtime";function sn(o){let{title:n,page:t,origin:i}=o;return t.view?l(y,{sx:{backgroundColor:"white",minHeight:"90vh",mt:1},children:l(K,{view:t.view})}):t.pages?h(y,{className:"container",children:[n,l(y,{sx:{height:"400px",m:2,textAlign:"center"},children:l(A,{container:!0,spacing:2,children:Object.keys(t.pages).map(s=>{let r=t.pages[s];return l(A,{item:!0,md:4,children:h(D,{title:s,minHeight:"150px",children:[l("p",{children:t.description}),r.view&&l(ue,{type:"brand",onClick:()=>$(r.view,i),children:"Try it"})]})})})})})]}):l("div",{className:"container",children:n})}function rn(o){let{placeholder:n,descriptor:t}=o,{landingPage:i,requirements:s}=t,r=ye(),a=ve(),c=a?.nested||z(i?.view)||z(r),d=xe(c),m=fe(async()=>{let p=[];for(let g in s?.servicePoints)p.push(ge(g));return p},[],[s]),u=null;return c?c.name==="settings"?u=l(E,{}):u=l(q,{component_id:c.name,children:l(y,{sx:{backgroundColor:"white",minHeight:"90vh",mt:1},children:l(U,{requirements:s,configurator:null,children:l(K,{view:c})})})}):u=l(we,{children:n}),h(U,{requireds:m,configurator:null,children:[l(I,{descriptor:o.descriptor,active:d,origin:a}),u]})}function an(){let o=be(()=>me({services:["view.react"],types:["jtd:application.board.component"]}),[]);return l("div",{className:"slds-grid slds-grid_vertical-align-center slds-grid_align-center",style:{minWidth:"100vw",minHeight:"100vh"},children:h("div",{className:"slds-box",children:[l("div",{style:{fontSize:"130%",paddingLeft:5,marginBottom:10,borderBottom:"solid thin #0005"},children:l("span",{children:"Choose an application"})}),l(w,{filter:o,onSelect:t=>{$({name:t.id})}})]})})}export{sn as a,rn as b,an as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk.
|
|
1
|
+
import{a,b,c}from"./chunk.YL2ZXJZH.js";import"./chunk.6DTI5JDB.js";import"./chunk.4OZ7ZS3K.js";import"./chunk.B25CG3PJ.js";import"./chunk.VLRB3H3F.js";import"./chunk.W7LG3C4Y.js";import"./chunk.6ZS7PC7C.js";import"./chunk.NJTGJCJ4.js";import"./chunk.JBXYN3HT.js";import"./chunk.J7UOQR25.js";import"./chunk.73S35ZUP.js";export{b as ApplicationBoard,a as ApplicationPage,c as ApplicationSelector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p}from"./chunk.
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p}from"./chunk.4OZ7ZS3K.js";import"./chunk.B25CG3PJ.js";import"./chunk.VLRB3H3F.js";import"./chunk.W7LG3C4Y.js";import"./chunk.6ZS7PC7C.js";import"./chunk.NJTGJCJ4.js";import"./chunk.JBXYN3HT.js";import"./chunk.J7UOQR25.js";import"./chunk.73S35ZUP.js";export{i as ComponentBrowser,f as ComponentItem,e as ComponentLink,m as ComponentManifestEditor,p as ComponentsConfigurator,h as ComponentsFilteredList,g as ComponentsList,n as CreateComponentSelector,o as NewComponentButton,k as createComponent,l as editComponent,a as getComponentGroupName,d as getComponentIcon,b as getComponentSmallName,c as groupComponentPublications,j as initComponentManifest};
|
package/export.dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk.
|
|
1
|
+
import{a,b}from"./chunk.W7LG3C4Y.js";import"./chunk.6ZS7PC7C.js";import"./chunk.NJTGJCJ4.js";import"./chunk.JBXYN3HT.js";import"./chunk.J7UOQR25.js";import"./chunk.73S35ZUP.js";export{b as askData,a as askQuestion};
|
package/export.icon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j}from"./chunk.
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.JBXYN3HT.js";import"./chunk.J7UOQR25.js";import"./chunk.73S35ZUP.js";export{e as Icon,g as IconAvatarCollection,f as IconBadgeCollection,h as IconFontCollection,i as IconSVGCollection,j as IconSVGInnerCollection,b as IconSize,a as IconUrlCollection,k as default,d as getIconName,c as registerIconCollection};
|
package/export.inputs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk.
|
|
1
|
+
import{a,b,c}from"./chunk.NJTGJCJ4.js";import"./chunk.JBXYN3HT.js";import"./chunk.J7UOQR25.js";import"./chunk.73S35ZUP.js";export{a as Button,b as ButtonIcon,c as InputData};
|
package/export.items.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as a,m as b,n as c,o as d,p as e,q as f}from"./chunk.
|
|
1
|
+
import{l as a,m as b,n as c,o as d,p as e,q as f}from"./chunk.6ZS7PC7C.js";import"./chunk.NJTGJCJ4.js";import"./chunk.JBXYN3HT.js";import"./chunk.J7UOQR25.js";import"./chunk.73S35ZUP.js";export{b as DrawToolingWidgets,d as ItemIcon,f as ItemRowRich,e as ItemRowShort,c as LabelButton,a as LabelSelected};
|
package/export.layouts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.6ZS7PC7C.js";import"./chunk.NJTGJCJ4.js";import"./chunk.JBXYN3HT.js";import"./chunk.J7UOQR25.js";import"./chunk.73S35ZUP.js";export{k as Menu,g as OverflowStack,a as PanelInstance,h as PopupCancel,f as Stack,e as createFloatingDock,c as createPanel,b as getPanelDockFrom,j as openContextualMenu,i as openDialog,d as usePanel};
|
package/export.notifications.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"./chunk.
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk.B25CG3PJ.js";import"./chunk.6ZS7PC7C.js";import"./chunk.NJTGJCJ4.js";import"./chunk.JBXYN3HT.js";import"./chunk.J7UOQR25.js";import"./chunk.73S35ZUP.js";export{f as Notification,d as NotificationsBell,e as NotificationsList,b as useNotificationInfos,a as useNotificationObjects,c as useNotifications};
|
package/export.servicepoint.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"./chunk.
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk.6DTI5JDB.js";import"./chunk.4OZ7ZS3K.js";import"./chunk.B25CG3PJ.js";import"./chunk.VLRB3H3F.js";import"./chunk.W7LG3C4Y.js";import"./chunk.6ZS7PC7C.js";import"./chunk.NJTGJCJ4.js";import"./chunk.JBXYN3HT.js";import"./chunk.J7UOQR25.js";import"./chunk.73S35ZUP.js";export{a as DefaultColorsMap,e as DefaultServiceConfigurator,c as ServicePointInput,b as ServicePointStatus,d as ServicePointsConfigurator,f as ServiceRequirementBoundary,g as registerMissingServiceDisplayer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o}from"./chunk.
|
|
1
|
+
import{b as o}from"./chunk.YL2ZXJZH.js";import"./chunk.6DTI5JDB.js";import"./chunk.4OZ7ZS3K.js";import"./chunk.B25CG3PJ.js";import"./chunk.VLRB3H3F.js";import"./chunk.W7LG3C4Y.js";import"./chunk.6ZS7PC7C.js";import"./chunk.NJTGJCJ4.js";import"./chunk.JBXYN3HT.js";import"./chunk.J7UOQR25.js";import"./chunk.73S35ZUP.js";import{jsx as e}from"react/jsx-runtime";var i={async createComponent(n,t){},async updateComponent(n,t){},async checkDescriptor(n){return null}};function c(n){return function(){return e(o,{descriptor:n.manifest})}}export{i as ApplicationBoardDriver,c as GetApplicationView};
|
package/package.json
CHANGED
|
@@ -1,29 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jointhedots/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@jointhedots/core": "^0.0.0",
|
|
8
|
-
"@mui/material": "^6.4.7",
|
|
9
|
-
"@rjsf/core": "^5.23.2",
|
|
10
|
-
"@rjsf/utils": "^5.23.2",
|
|
11
|
-
"@rjsf/validator-ajv8": "^5.23.2",
|
|
12
|
-
"@salesforce-ux/design-system": "2.25.4",
|
|
13
|
-
"@salesforce/design-system-react": "0.10.64",
|
|
14
|
-
"react-toastify": "^11.0.5"
|
|
15
|
-
},
|
|
16
|
-
"peerDependencies": {
|
|
17
|
-
"monaco-editor": ">=0.52.2",
|
|
18
|
-
"react-lightning-design-system": "^5.9.1",
|
|
19
|
-
"react": ">=18.2.0",
|
|
20
|
-
"react-dom": ">=18.2.0"
|
|
21
|
-
},
|
|
22
|
-
"overrides": {
|
|
23
|
-
"react-lightning-design-system": {
|
|
24
|
-
"react-relative-portal": "../../deps/react-relative-portal-1.3.1.tgz"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
6
|
"exports": {
|
|
28
7
|
"./ApplicationBoard": {
|
|
29
8
|
"import": "./export.applicationboard.js",
|
|
@@ -69,5 +48,26 @@
|
|
|
69
48
|
"import": "./export.theme.js",
|
|
70
49
|
"types": "./types.d.ts"
|
|
71
50
|
}
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@jointhedots/core": "^0.0.0",
|
|
54
|
+
"@mui/material": "^6.4.7",
|
|
55
|
+
"@rjsf/core": "^5.23.2",
|
|
56
|
+
"@rjsf/utils": "^5.23.2",
|
|
57
|
+
"@rjsf/validator-ajv8": "^5.23.2",
|
|
58
|
+
"@salesforce-ux/design-system": "2.25.4",
|
|
59
|
+
"@salesforce/design-system-react": "0.10.64",
|
|
60
|
+
"react-toastify": "^11.0.5"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"monaco-editor": ">=0.52.2",
|
|
64
|
+
"react-lightning-design-system": "^5.9.1",
|
|
65
|
+
"react": ">=18.2.0",
|
|
66
|
+
"react-dom": ">=18.2.0"
|
|
67
|
+
},
|
|
68
|
+
"overrides": {
|
|
69
|
+
"react-lightning-design-system": {
|
|
70
|
+
"react-relative-portal": "../../deps/react-relative-portal-1.3.1.tgz"
|
|
71
|
+
}
|
|
72
72
|
}
|
|
73
73
|
}
|
package/types.d.ts
CHANGED
|
@@ -1126,6 +1126,14 @@ declare module '@jointhedots/ui/src/Icon/Icon' {
|
|
|
1126
1126
|
}, HTMLElement>;
|
|
1127
1127
|
}
|
|
1128
1128
|
|
|
1129
|
+
declare module '@jointhedots/ui/src/Icon/collections/badge' {
|
|
1130
|
+
import { IconCollection, IconElement } from '@jointhedots/ui/src/Icon/Icon';
|
|
1131
|
+
export class IconBadgeCollection implements IconCollection {
|
|
1132
|
+
setup(element: IconElement): void;
|
|
1133
|
+
draw(element: IconElement): import( 'react/jsx-runtime').JSX.Element;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1129
1137
|
declare module '@jointhedots/ui/src/Icon/collections/avatar' {
|
|
1130
1138
|
import { IconCollection, IconElement } from '@jointhedots/ui/src/Icon/Icon';
|
|
1131
1139
|
export class IconAvatarCollection implements IconCollection {
|
|
@@ -1181,6 +1189,7 @@ declare module '@jointhedots/ui/Icon' {
|
|
|
1181
1189
|
import { Icon } from '@jointhedots/ui/src/Icon/Icon';
|
|
1182
1190
|
import 'src/Icon/style.scss';
|
|
1183
1191
|
export * from '@jointhedots/ui/src/Icon/Icon';
|
|
1192
|
+
export * from '@jointhedots/ui/src/Icon/collections/badge';
|
|
1184
1193
|
export * from '@jointhedots/ui/src/Icon/collections/avatar';
|
|
1185
1194
|
export * from '@jointhedots/ui/src/Icon/collections/font';
|
|
1186
1195
|
export * from '@jointhedots/ui/src/Icon/collections/svg';
|
package/chunk.OW3MI2XU.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{f as y}from"./chunk.J7UOQR25.js";import x from"react";import{jsx as M}from"react/jsx-runtime";var g=class{constructor(e){this.baseUrl=e}setup(e){let{name:n}=e;Object.assign(e.style,P),e.style.backgroundImage=`url(${this.baseUrl}${n})`}draw(e){let{className:n,style:s}=e;return M("div",{className:n,style:s})}},P={height:"1em",width:"1em",minHeight:"1em",minWidth:"1em",backgroundRepeat:"no-repeat",backgroundPosition:"center"};import{jsx as b}from"react/jsx-runtime";var d=class{setup(e){Object.assign(e.style,L)}draw(e){let{name:n,className:s,style:o}=e,i=`[Bad icon '${n}']`;return b("div",{title:i,className:s,style:o})}},p=class{setup(e){}draw(e){let{className:n,style:s}=e;return b("div",{className:n,style:s})}},L={height:"1em",width:"1em",background:"repeating-linear-gradient(45deg,#0000,#0000 1px,#f00 2px,#f00 3px)"};var v=(o=>(o.xs="0.8em",o.sm="1.0em",o.md="1.5em",o.lg="2.0em",o))(v||{});function f(t,e){m[t]=e}function le(t,e){return t||(e?"avatar:"+e:null)}function C(t){let{name:e,size:n,inverse:s,className:o,style:i}=t,l=x.useContext(y),r=A(e),c=s?l.contrastTheme:l,u=[];for(let I of r.elements)u.push(I.collection.draw(I,c));return x.createElement("div",{...t,name:void 0,inversed:void 0,className:o&&r.className?`${o} ${r.className}`:o||r.className,style:{fontSize:n&&(v[n]||n),...i,...r.style}},...u)}var m={blank:new p,"?":new d},N=new Map,S={error:a("red"),warn:a("gold"),info:a("grey"),primary:a("#36f"),secondary:a("#666"),success:a("#6d0"),badge:{style:{fontSize:"0.6em",top:"-0.3em",right:"-0.3em",left:"unset",bottom:"unset"}},RT:{style:{fontSize:"0.6em",top:"-0.3em",right:"-0.3em",left:"unset",bottom:"unset"}},RB:{style:{fontSize:"0.6em",bottom:"-0.3em",right:"-0.3em",left:"unset",top:"unset"}},LT:{style:{fontSize:"0.6em",top:"-0.3em",left:"-0.3em",right:"unset",bottom:"unset"}},LB:{style:{fontSize:"0.6em",bottom:"-0.3em",left:"-0.3em",right:"unset",top:"unset"}}},j=/^(?:\[(?<options>[^\]]*)\])?(?<elements>.*)$/,z=/^(?:(?<set>[a-z0-9-_@]+):)?(?<name>[^\[]+)(?:\[(?<options>[^\]]*)\])?$/;f("data",new g(""));function a(t){return{style:{color:t,"--color":t}}}function E(t,e){if(e){let n=t.style||{},s=[];t.className&&s.push(t.className);for(let o of e.split(",")){let[i,l]=o.split("=");if(l)n["--"+i]=l;else{let r=S[i];r?(s.push(r.className),Object.assign(n,r.style)):console.error(`Icon '${name}' has invalid flag '${i}'`)}}t.className=s.join(" "),t.style=n}}function U(t,e){let n=null,s=e.match(z);if(s&&s.groups){let{set:o,name:i,options:l}=s.groups;n={collection:(o?m[o]:m[i])||m["?"],name:i,className:"",style:{}},E(n,l)}else n={collection:m["?"],name:e,className:"",style:{}},console.error(`Icon element '${e}' is invalid`);n.collection.setup(n),t.elements.push(n)}function O(t){let e={elements:[],className:"jtd-icon"},n=t.match(j);if(n&&n.groups){let{options:s,elements:o}=n.groups;E(e,s);for(let i of o.split("|"))U(e,i)}else{console.error(`Icon '${t}' is invalid`);let s=m["?"];e.elements.push({collection:s,name:t})}return e}function A(t){let e=N.get(t);return e||(e=O(t),N.set(t,e)),e}var B=`.jtd-icons-avatar {
|
|
2
|
-
width: 1em;
|
|
3
|
-
height: 1em;
|
|
4
|
-
min-width: 1em;
|
|
5
|
-
min-height: 1em;
|
|
6
|
-
border-radius: 50%;
|
|
7
|
-
display: flex;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
align-items: center;
|
|
10
|
-
background-color: var(--avatar-bgcolor);
|
|
11
|
-
user-select: none;
|
|
12
|
-
}
|
|
13
|
-
.jtd-icons-avatar > * {
|
|
14
|
-
color: white;
|
|
15
|
-
font-family: "Segoe UI", "Tahoma", "Geneva", "Verdana", sans-serif;
|
|
16
|
-
font-weight: bold;
|
|
17
|
-
font-size: 0.5em;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.jtd-icon {
|
|
21
|
-
position: relative;
|
|
22
|
-
height: 1em;
|
|
23
|
-
width: 1em;
|
|
24
|
-
min-height: 1em;
|
|
25
|
-
min-width: 1em;
|
|
26
|
-
max-height: 1em;
|
|
27
|
-
max-width: 1em;
|
|
28
|
-
}
|
|
29
|
-
.jtd-icon > * {
|
|
30
|
-
position: absolute;
|
|
31
|
-
left: 0;
|
|
32
|
-
top: 0;
|
|
33
|
-
right: 0;
|
|
34
|
-
top: 0;
|
|
35
|
-
}`;document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(B));import{jsx as k}from"react/jsx-runtime";var h=class{setup(e){let{name:n}=e,s=H(n);e.className=`jtd-icons-avatar ${e.className}`,e.style["--avatar-bgcolor"]=W(n),e.tag=s}draw(e){let{tag:n,className:s,style:o}=e;return k("div",{className:s,style:o,children:k("div",{children:n})})}};function H(t){t=t.trim();let e=t.charAt(0),n=t.charAt(t.length-1),s=t.charAt(t.length-2);if(!isNaN(parseInt(n))&&isNaN(parseInt(s)))e+=n;else for(let o of t.matchAll(/[\-_ ]([a-zA-Z])/g))if(e+=o[1],e.length>=2)break;return e.toUpperCase()}function W(t){let e=_(t);return D(e*360)}function _(t,e=0){if(t==null)return Math.random();{let n=3735928559^e,s=1103547991^e;for(let i=0,l;i<t.length;i++)l=t.charCodeAt(i),n=Math.imul(n^l,2654435761),s=Math.imul(s^l,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&s)+(n>>>0)&65535)/65535}}function D(t){let e=.7,n=.5,s=(1-Math.abs(2*n-1))*e,o=s*(1-Math.abs(t/60%2-1)),i=n-s/2,l,r,c;return t>=0&&t<60?(l=s,r=o,c=0):t>=60&&t<120?(l=o,r=s,c=0):t>=120&&t<180?(l=0,r=s,c=o):t>=180&&t<240?(l=0,r=o,c=s):t>=240&&t<300?(l=o,r=0,c=s):t>=300&&t<360&&(l=s,r=0,c=o),l=Math.round((l+i)*255),r=Math.round((r+i)*255),c=Math.round((c+i)*255),`rgb(${l}, ${r}, ${c})`}f("avatar",new h);import{jsx as Z}from"react/jsx-runtime";var w=class{constructor(e){this.classPrefix=e}setup(e){let{name:n}=e;e.className=`${this.classPrefix+n} ${e.className}`,Object.assign(e.style,F)}draw(e){let{className:n,style:s}=e;return Z("i",{className:n,style:s})}},F={height:"1em",width:"1em",display:"inline-flex",flexDirection:"row",alignItems:"center"};import{jsx as J}from"react/jsx-runtime";var R=class{constructor(e){this.defaultIcon=e}lights={};darks={};addIcon(e,n,s){this.lights[e]=`url(${n})`,this.darks[e]=`url(${s})`}setup(e){Object.assign(e.style,G)}draw(e,n){let{name:s,className:o,style:i}=e,l=n.lighting===1?this.lights[s]||this.lights[this.defaultIcon]:this.darks[s]||this.darks[this.defaultIcon];return J("div",{className:o,style:{backgroundImage:l,...i}})}},G={height:"1em",width:"1em",minHeight:"1em",minWidth:"1em",backgroundRepeat:"no-repeat",backgroundPosition:"center"};import{jsx as T}from"react/jsx-runtime";var $=class{constructor(e,n,s){this.light_url=e;this.dark_url=n;this.classNamer=s;this.lightRef=`${e}#`,this.darkRef=`${n}#`}lightRef;darkRef;setup(e){let{classNamer:n}=this;e.className=n?n(e):e.className,Object.assign(e.style,K)}draw(e,n){let{name:s,className:o,style:i}=e,l=n.lighting===1?this.lightRef:this.darkRef;return T("svg",{className:o,style:i,children:T("use",{xlinkHref:l+s})})}},K={height:"1em",width:"1em",minHeight:"1em",minWidth:"1em",backgroundRepeat:"no-repeat",backgroundPosition:"center"};var ke=C;export{g as a,v as b,f as c,le as d,C as e,h as f,w as g,R as h,$ as i,ke as j};
|