@nocobase/portal-template-default 1.0.17 → 1.0.18
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/.env.example +0 -4
- package/AGENTS.md +2 -0
- package/dist/assets/{LineDraw-BBB5hwuJ.js → LineDraw-B3HsIvjF.js} +1 -1
- package/dist/assets/{SymbolDraw-CKS3uUb_.js → SymbolDraw-C5oA6gYo.js} +1 -1
- package/dist/assets/{VisualMapping-BCwaW3TD.js → VisualMapping-CjyVXYl-.js} +1 -1
- package/dist/assets/{auth-method-demo-BdCCvEEz.js → auth-method-demo-B4sxmO2B.js} +1 -1
- package/dist/assets/auto-login-provider-DPtJmWC-.js +1 -0
- package/dist/assets/{auto-login-provider-DO5Il6Dp.js → auto-login-provider-pxf3kSYY.js} +2 -2
- package/dist/assets/auto-redirect-provider-B51i6R_U.js +1 -0
- package/dist/assets/auto-redirect-provider-CDA_97es.js +1 -0
- package/dist/assets/{auto-redirect-provider-ja-vFPaF.js → auto-redirect-provider-CeJOAYfx.js} +1 -1
- package/dist/assets/{calendar-C7xnRgOT.js → calendar-B41MfAkB.js} +1 -1
- package/dist/assets/{cas-sign-in-button-BZCa4lR6.js → cas-sign-in-button-DmkMYnGb.js} +1 -1
- package/dist/assets/{components-_g-GjQeV.js → components-DLLYm5Qd.js} +1 -1
- package/dist/assets/{configuration-gate-B4XVz7tS.js → configuration-gate-CdktspSj.js} +1 -1
- package/dist/assets/{createClipPathFromCoordSys-z9Kmh-tu.js → createClipPathFromCoordSys-BKzf1iWj.js} +1 -1
- package/dist/assets/createSeriesDataSimply-Dcpkokbc.js +1 -0
- package/dist/assets/{customGraphicKeyframeAnimation-DMU5crAu.js → customGraphicKeyframeAnimation-BYcy-PGj.js} +1 -1
- package/dist/assets/{demo-Bj_Y0RrW.js → demo-BpC2e3zt.js} +1 -1
- package/dist/assets/{demo-DUmWU7ik.js → demo-CEA7jJM2.js} +1 -1
- package/dist/assets/{demo-CXRTPvIx.js → demo-CX_Zf30k.js} +1 -1
- package/dist/assets/{demo-DJuVDu1n.js → demo-CyvGiwq2.js} +1 -1
- package/dist/assets/{demo-NhIzFRE1.js → demo-DJgGXOii.js} +1 -1
- package/dist/assets/{demo-CKPAQOib.js → demo-GTMcYVzl.js} +1 -1
- package/dist/assets/{demo-BPlae2bp.js → demo-O2QwJ70o.js} +1 -1
- package/dist/assets/{dingtalk-sign-in-button-DMPgE5kT.js → dingtalk-sign-in-button-K_2ZYQNC.js} +1 -1
- package/dist/assets/{echarts-preview-R96Pbqmz.js → echarts-preview-CTj0x24f.js} +1 -1
- package/dist/assets/{echarts-runtime-Ce_z2eX_.js → echarts-runtime-BTfAtt-4.js} +3 -3
- package/dist/assets/{echarts-runtime-advanced-Dr80KHJR.js → echarts-runtime-advanced-Xg4WXsLl.js} +1 -1
- package/dist/assets/{echarts-runtime-common-DB95Yfc1.js → echarts-runtime-common-Dfe5ONoi.js} +1 -1
- package/dist/assets/{echarts-runtime-components-DCJEaTJk.js → echarts-runtime-components-BNoMvPY0.js} +1 -1
- package/dist/assets/{echarts-runtime-hierarchy-CezgZs9O.js → echarts-runtime-hierarchy-bEvX8V8l.js} +1 -1
- package/dist/assets/{floating-O9WmiDXk.js → floating-CVEm6jgD.js} +1 -1
- package/dist/assets/{index-WKvygTBp.js → index-0O4dSmNz.js} +1 -1
- package/dist/assets/{index-DgB7uTMs.js → index-Bliz6Sy2.js} +1 -1
- package/dist/assets/{index-Cc6awvdg.js → index-CMoFG_fD.js} +210 -210
- package/dist/assets/{index-CPzehPGe.js → index-N5q0Lo-n.js} +1 -1
- package/dist/assets/{index-DroUAK80.js → index-dDkRfkPI.js} +1 -1
- package/dist/assets/{index-ChA0z9ke.js → index-s-Gc7krA.js} +1 -1
- package/dist/assets/{labelHelper-Dk5jkiD-.js → labelHelper-CSRwI3Ku.js} +1 -1
- package/dist/assets/{ldap-sign-in-form-CKN4l7qM.js → ldap-sign-in-form-BoVMVmwm.js} +1 -1
- package/dist/assets/{oidc-sign-in-button-BIRonrpC.js → oidc-sign-in-button-5pd4bZSW.js} +1 -1
- package/dist/assets/{page-context-DAiW_dId.js → page-context-o6ISleo3.js} +1 -1
- package/dist/assets/prompt-card-xoH-b2hL.js +1 -0
- package/dist/assets/{prompt-output-B4h3uLWf.js → prompt-output-7ZS2-d1_.js} +1 -1
- package/dist/assets/{saml-sign-in-button-B4ugaLIb.js → saml-sign-in-button-CN2l8pSN.js} +1 -1
- package/dist/assets/{sectorHelper-BuxrrJrA.js → sectorHelper-D1jHcZDN.js} +1 -1
- package/dist/assets/{shortcut-BhKXxJLs.js → shortcut-DUGrhOUX.js} +1 -1
- package/dist/assets/{sms-sign-in-form-DKpxRDdZ.js → sms-sign-in-form-ajsTToFF.js} +1 -1
- package/dist/assets/{static.browser-kzzpH0Xt.js → static.browser-exfE5oYi.js} +1 -1
- package/dist/assets/{switch-BdVxPIVU.js → switch-BVTKHDeA.js} +1 -1
- package/dist/assets/{tool-cards-CpczIke-.js → tool-cards-CQklNnUU.js} +1 -1
- package/dist/assets/{use-authenticator-sign-in-CIj210ry.js → use-authenticator-sign-in-B8OPLh-w.js} +1 -1
- package/dist/assets/{use-dingtalk-sign-in-BW4kkXD3.js → use-dingtalk-sign-in-DsX00uPU.js} +1 -1
- package/dist/assets/{use-wecom-sign-in-dIqMtcN9.js → use-wecom-sign-in-Di3WFrU1.js} +1 -1
- package/dist/assets/{wecom-sign-in-button-Dn_2zDab.js → wecom-sign-in-button-BO8h0tS8.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/index.raw.html +1 -1
- package/package.json +1 -1
- package/src/app/route-runtime.ts +29 -2
- package/src/components/data-table/data-table-filter.tsx +7 -4
- package/src/extensions/nocobase-users-example/app-routes.tsx +6 -2
- package/src/extensions/nocobase-users-example/index.ts +0 -1
- package/dist/assets/auto-login-provider-TQ08B6-i.js +0 -1
- package/dist/assets/auto-redirect-provider-ButXp0A3.js +0 -1
- package/dist/assets/auto-redirect-provider-DnGGP2Vn.js +0 -1
- package/dist/assets/createSeriesDataSimply-CPqysF0K.js +0 -1
- package/dist/assets/prompt-card-rGZqpqkF.js +0 -1
- package/src/extensions/nocobase-users-example/layout.tsx +0 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{y as J,j as e,W as Q,X as ee,Y as se,Z as ae,C as x,k as S,l as P,n as T,K as g,_ as M,$ as j,a0 as K,B as E,a1 as te,a2 as ne,a3 as oe,a4 as ie,a5 as re,a6 as R,a7 as _,a8 as D,a9 as F,aa as G,b as l,ab as H,I as le,d as O,e as z,f as U,g as B,i as v,ac as ce,p as de,q as he,t as $,v as k,w as pe,x as I,ad as me}from"./index-
|
|
1
|
+
import{y as J,j as e,W as Q,X as ee,Y as se,Z as ae,C as x,k as S,l as P,n as T,K as g,_ as M,$ as j,a0 as K,B as E,a1 as te,a2 as ne,a3 as oe,a4 as ie,a5 as re,a6 as R,a7 as _,a8 as D,a9 as F,aa as G,b as l,ab as H,I as le,d as O,e as z,f as U,g as B,i as v,ac as ce,p as de,q as he,t as $,v as k,w as pe,x as I,ad as me}from"./index-CMoFG_fD.js";import{A as ue}from"./configuration-gate-CdktspSj.js";import{P as xe}from"./prompt-output-7ZS2-d1_.js";import{S as ge}from"./switch-BVTKHDeA.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ar as t,H as u}from"./echarts-runtime-
|
|
1
|
+
import{ar as t,H as u}from"./echarts-runtime-BTfAtt-4.js";function o(r,l){var e=r.mapDimensionsAll("defaultedLabel"),a=e.length;if(a===1){var n=t(r,l,e[0]);return n!=null?n+"":null}else if(a){for(var s=[],f=0;f<e.length;f++)s.push(t(r,l,e[f]));return s.join(" ")}}function v(r,l){var e=r.mapDimensionsAll("defaultedLabel");if(!u(l))return l+"";for(var a=[],n=0;n<e.length;n++){var s=r.getDimensionIndex(e[n]);s>=0&&a.push(l[s])}return a.join(" ")}export{o as a,v as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i,j as e,o as l,I as x,be as g,K as f}from"./index-
|
|
1
|
+
import{b as i,j as e,o as l,I as x,be as g,K as f}from"./index-CMoFG_fD.js";import{u as j}from"./use-authenticator-sign-in-B8OPLh-w.js";function w(s){return j(s)}function b({authenticator:s,onSignIn:t}){var o;const[n,c]=i.useState(""),[r,d]=i.useState(""),{signIn:p,isPending:u}=w(s.name),m=((o=s.options)==null?void 0:o.autoSignup)===!0;return e.jsxs("form",{className:"space-y-5",onSubmit:a=>{if(a.preventDefault(),t){t({account:n,password:r});return}p({account:n,password:r})},children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:`${s.name}-ldap-account`,children:"Account"}),e.jsx(x,{id:`${s.name}-ldap-account`,value:n,onChange:a=>c(a.target.value),autoComplete:"username",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:`${s.name}-ldap-password`,children:"Password"}),e.jsx(g,{id:`${s.name}-ldap-password`,value:r,onChange:a=>d(a.target.value),autoComplete:"current-password",required:!0})]}),e.jsx(f,{type:"submit",className:"w-full",disabled:!t&&u,children:!t&&u?"Signing in…":"Sign in"}),m&&e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:"An account will be created automatically after the first successful LDAP sign-in."})]})}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b5 as g,b as o,b6 as m,b7 as d,j as t,aN as b,aP as f,aQ as h,K as x,b8 as v,r as p}from"./index-
|
|
1
|
+
import{b5 as g,b as o,b6 as m,b7 as d,j as t,aN as b,aP as f,aQ as h,K as x,b8 as v,r as p}from"./index-CMoFG_fD.js";function w(r){const[e]=g(),[i,a]=o.useState(!1),[n,l]=o.useState(),u=o.useMemo(()=>{if(e.get("authenticator")!==r.name)return;const s=e.get("error");return s?new Error(s):void 0},[r.name,e]);return{signIn:o.useCallback(async()=>{l(void 0),a(!0);try{const s=m(e.get("to")||e.get("redirect")||"/"),c=await d.action("oidc","getAuthUrl",{method:"POST",authenticator:r.name,includeRole:!1,withAclMeta:!1,body:{redirect:s}});if(!c)throw new Error("NocoBase did not return an OIDC authorization URL.");window.location.replace(d.resolveUrl(c))}catch(s){l(s instanceof Error?s:new Error("Unable to start OIDC sign-in.")),a(!1)}},[r.name,e]),isPending:i,error:n??u}}function E({authenticator:r,onSignIn:e}){const{signIn:i,isPending:a,error:n}=w(r);return t.jsxs("div",{className:"space-y-3",children:[n&&t.jsxs(b,{variant:"destructive",children:[t.jsx(f,{children:"OIDC sign-in failed"}),t.jsx(h,{children:n.message})]}),t.jsxs(x,{type:"button",variant:"outline",className:"w-full",disabled:!e&&a,onClick:e??i,children:[t.jsx(v,{}),!e&&a?"Redirecting…":p(r.title||r.authTypeTitle||"OIDC")]})]})}export{E as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aB as F,b as t,j as e,C as j,k as A,l as T,n as P,o as i,I as y,T as U,d as k,e as N,f as C,g as S,i as l,a6 as R,a9 as ce,aa as de,ab as me,a8 as ue,aC as M,B as b,_ as $,$ as B,ae as D,aE as _,aD as J,aJ as he,aK as xe,K as pe,aL as ge}from"./index-
|
|
1
|
+
import{aB as F,b as t,j as e,C as j,k as A,l as T,n as P,o as i,I as y,T as U,d as k,e as N,f as C,g as S,i as l,a6 as R,a9 as ce,aa as de,ab as me,a8 as ue,aC as M,B as b,_ as $,$ as B,ae as D,aE as _,aD as J,aJ as he,aK as xe,K as pe,aL as ge}from"./index-CMoFG_fD.js";import{A as je}from"./configuration-gate-CdktspSj.js";import{S as fe}from"./switch-BVTKHDeA.js";import{P as ve}from"./prompt-card-xoH-b2hL.js";import"./prompt-output-7ZS2-d1_.js";function ye(n,r){for(const[o,c]of Object.entries(r)){const u=o;n.setValue(u,c,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}}const be=n=>!["nathan","dara"].includes(n.toLowerCase());function we(){var X,Y;const{employees:n}=F(),r=n.filter(a=>be(a.username)),[o,c]=t.useState(((X=r[0])==null?void 0:X.username)??((Y=n[0])==null?void 0:Y.username)??""),[u,d]=t.useState("Customer renewal workspace"),[p,g]=t.useState("Show a customer renewal detail with account health, contract value, renewal date, owner, recent activity, and a working AI conversation beside it."),[m,f]=t.useState("Review renewal risk"),[s,I]=t.useState("Review this customer renewal, identify risks, and recommend the next action."),[h,v]=t.useState(!1),[w,K]=t.useState("shortcut"),[x,z]=t.useState("renewal-detail"),[V,ee]=t.useState("Customer renewal detail"),[q,te]=t.useState("context"),[H,se]=t.useState("update_renewal_plan"),[O,ae]=t.useState("Update the renewal risk level and the visible follow-up note on the page."),[W,ne]=t.useState("ASK"),re=t.useMemo(()=>{var Z;const a=((Z=n.find(le=>le.username===o))==null?void 0:Z.nickname)??o,Q=`{ type: "page-element", id: "${x}", title: "${V}" }`,G=w==="manual"?!1:h,oe={shortcut:`Place an AIEmployeeShortcut in the page header, visually separated from the registered business element. Target the embedded chat controller and configure this task on its tasks prop:
|
|
2
2
|
- Title: ${m}
|
|
3
3
|
- User message: ${s}
|
|
4
4
|
- Auto send: ${G}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-CMoFG_fD.js";import{P as p}from"./prompt-output-7ZS2-d1_.js";function x({title:r,description:t,prompt:m}){return o.jsx(p,{title:r,description:t,prompt:m,promptClassName:"max-h-[620px]"})}export{x as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o,j as e,C as f,K as h,G as j,bF as y,c as i}from"./index-
|
|
1
|
+
import{b as o,j as e,C as f,K as h,G as j,bF as y,c as i}from"./index-CMoFG_fD.js";function w({className:c,copiedLabel:n="Copied",copyErrorLabel:p="Clipboard access failed. Select the prompt and copy it manually.",copyLabel:d="Copy prompt",description:l,prompt:t,promptClassName:x,title:m="Generated prompt"}){const[s,a]=o.useState(!1),[u,r]=o.useState(!1);return e.jsxs(f,{className:i("min-w-0 gap-0 overflow-hidden py-0",c),children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium",children:m}),e.jsx("div",{className:"text-xs text-muted-foreground",children:l})]}),e.jsxs(h,{type:"button",size:"sm",className:"shrink-0",onClick:async()=>{try{await navigator.clipboard.writeText(t),r(!1),a(!0),window.setTimeout(()=>a(!1),1500)}catch{r(!0)}},children:[s?e.jsx(j,{}):e.jsx(y,{}),s?n:d]})]}),u?e.jsx("p",{className:"border-b px-4 py-2 text-xs text-destructive",children:p}):null,e.jsx("pre",{className:i("max-h-[560px] overflow-auto whitespace-pre-wrap bg-muted/25 p-5 font-mono text-xs leading-5 text-muted-foreground",x),children:t})]})}export{w as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b5 as m,b as o,b6 as g,b7 as d,j as t,aN as b,aP as f,aQ as h,K as x,b8 as v,r as S}from"./index-
|
|
1
|
+
import{b5 as m,b as o,b6 as g,b7 as d,j as t,aN as b,aP as f,aQ as h,K as x,b8 as v,r as S}from"./index-CMoFG_fD.js";function p(r){const[e]=m(),[i,a]=o.useState(!1),[n,l]=o.useState(),u=o.useMemo(()=>{if(e.get("authenticator")!==r.name)return;const s=e.get("error");return s?new Error(s):void 0},[r.name,e]);return{signIn:o.useCallback(async()=>{l(void 0),a(!0);try{const s=g(e.get("to")||e.get("redirect")||"/"),c=await d.action("saml","getAuthUrl",{method:"POST",authenticator:r.name,includeRole:!1,withAclMeta:!1,body:{redirect:s}});if(!c)throw new Error("NocoBase did not return a SAML authorization URL.");window.location.replace(d.resolveUrl(c))}catch(s){l(s instanceof Error?s:new Error("Unable to start SAML sign-in.")),a(!1)}},[r.name,e]),isPending:i,error:n??u}}function j({authenticator:r,onSignIn:e}){const{signIn:i,isPending:a,error:n}=p(r);return t.jsxs("div",{className:"space-y-3",children:[n&&t.jsxs(b,{variant:"destructive",children:[t.jsx(f,{children:"SAML sign-in failed"}),t.jsx(h,{children:n.message})]}),t.jsxs(x,{type:"button",variant:"outline",className:"w-full",disabled:!e&&a,onClick:e??i,children:[t.jsx(v,{}),!e&&a?"Redirecting…":S(r.title||r.authTypeTitle||"SAML")]})]})}export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as m,P as y,H as A,m as I,aq as R}from"./echarts-runtime-
|
|
1
|
+
import{_ as m,P as y,H as A,m as I,aq as R}from"./echarts-runtime-BTfAtt-4.js";var p=(function(){function u(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return u})(),b=(function(u){m(s,u);function s(a){var r=u.call(this,a)||this;return r.type="sausage",r}return s.prototype.getDefaultShape=function(){return new p},s.prototype.buildPath=function(a,r){var e=r.cx,i=r.cy,o=Math.max(r.r0||0,0),h=Math.max(r.r,0),d=(h-o)*.5,v=o+d,t=r.startAngle,n=r.endAngle,c=r.clockwise,l=Math.PI*2,M=c?n-t<l:t-n<l;M||(t=n-(c?l:-l));var f=Math.cos(t),g=Math.sin(t),P=Math.cos(n),S=Math.sin(n);M?(a.moveTo(f*o+e,g*o+i),a.arc(f*v+e,g*v+i,d,-Math.PI+t,t,!c)):a.moveTo(f*h+e,g*h+i),a.arc(e,i,h,t,n,!c),a.arc(P*v+e,S*v+i,d,n-Math.PI*2,n-Math.PI,!c),o!==0&&a.arc(e,i,o,n,t,c)},s})(y);function k(u,s,a){var r=u.get("borderRadius");if(r==null)return a?{cornerRadius:0}:null;A(r)||(r=[r,r,r,r]);var e=Math.abs(s.r||0-s.r0||0);return{cornerRadius:I(r,function(i){return R(i,e)})}}export{b as S,k as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as c,ah as ye,ai as Pe,aj as Ee,ak as we,al as H,j as e,am as Re,an as $e,ao as Ue,ap as We,aq as ze,ar as de,as as De,at as Be,au as Ne,av as Oe,aw as Ce,ax as Fe,ay as Le,az as Ve,c as Q,F as qe,aA as _e,aB as Se,ae as He,aC as Ge,B as Y,aD as Ke,C as X,aE as ee,a6 as ce,k as te,l as se,n as ae,_ as me,$ as ue,aa as Je,aF as Z,d as O,e as F,f as L,g as V,i as S,I as he,K as J,P as Xe,O as Qe,h as Ye,aG as Ze,T as pe,ab as et,aH as tt,aI as st}from"./index-Cc6awvdg.js";import{S as xe}from"./switch-BdVxPIVU.js";import{P as at}from"./prompt-card-rGZqpqkF.js";import{A as nt}from"./configuration-gate-B4XVz7tS.js";import"./prompt-output-B4h3uLWf.js";const Ae=c.createContext(void 0);function Ie(){const a=c.useContext(Ae);if(a===void 0)throw new Error(ye(10));return a}const ot={value:()=>null},it=c.forwardRef(function(o,m){const{render:x,className:k,disabled:r=!1,hiddenUntilFound:u,keepMounted:i,loopFocus:y,onValueChange:g,multiple:$=!1,orientation:f="vertical",value:R,defaultValue:v,style:z,...w}=o,A=Pe(),I=c.useMemo(()=>{if(R===void 0)return v??[]},[R,v]),N=c.useRef([]),[d,b]=Ee({controlled:R,default:I,name:"Accordion",state:"value"}),M=we((P,D,p)=>{if($)if(D){const j=d.slice();if(j.push(P),g==null||g(j,p),p.isCanceled)return;b(j)}else{const j=d.filter(B=>B!==P);if(g==null||g(j,p),p.isCanceled)return;b(j)}else{const j=d[0]===P?[]:[P];if(g==null||g(j,p),p.isCanceled)return;b(j)}}),h=c.useMemo(()=>({value:d,disabled:r,orientation:f}),[d,r,f]),T=c.useMemo(()=>({disabled:r,handleValueChange:M,hiddenUntilFound:u??!1,keepMounted:i??!1,state:h,value:d}),[r,M,u,i,h,d]),l=H("div",o,{state:h,ref:m,props:[{dir:A},w],stateAttributesMapping:ot});return e.jsx(Ae.Provider,{value:T,children:e.jsx(Re,{elementsRef:N,children:l})})}),Me=c.createContext(void 0);function ne(){const a=c.useContext(Me);if(a===void 0)throw new Error(ye(9));return a}let lt=(function(a){return a.index="data-index",a.disabled="data-disabled",a.open="data-open",a})({});const oe={...Ue,index:a=>Number.isInteger(a)?{[lt.index]:String(a)}:null,...$e,value:()=>null},rt=c.forwardRef(function(o,m){const{className:x,disabled:k=!1,onOpenChange:r,render:u,value:i,style:y,...g}=o,{ref:$,index:f}=We(),R=ze(m,$),{disabled:v,handleValueChange:z,state:w,value:A}=Ie(),I=de(),N=i??I,d=k||v,b=c.useMemo(()=>{if(!A)return!1;for(let E=0;E<A.length;E+=1)if(A[E]===N)return!0;return!1},[A,N]),M=we((E,W)=>{r==null||r(E,W),!W.isCanceled&&z(N,E,W)}),h=De({open:b,onOpenChange:M,disabled:d}),T=c.useMemo(()=>({open:h.open,disabled:h.disabled,transitionStatus:h.transitionStatus}),[h.open,h.disabled,h.transitionStatus]),l=c.useMemo(()=>({...h,onOpenChange:M,state:T}),[h,T,M]),P=c.useMemo(()=>({...w,hidden:!b&&!h.mounted,index:f,disabled:d,open:b}),[h.mounted,d,f,b,w]),D=de(),[p,j]=c.useState(),B=c.useMemo(()=>({open:b,state:P,setTriggerId:j,triggerId:p??D}),[D,b,P,j,p]),q=H("div",o,{state:P,ref:R,props:g,stateAttributesMapping:oe});return e.jsx(Be.Provider,{value:l,children:e.jsx(Me.Provider,{value:B,children:q})})}),dt=c.forwardRef(function(o,m){const{render:x,className:k,style:r,...u}=o,{state:i}=ne();return H("h3",o,{state:i,ref:m,props:u,stateAttributesMapping:oe})}),ct=c.forwardRef(function(o,m){const{disabled:x,className:k,id:r,render:u,nativeButton:i=!0,style:y,...g}=o,{panelId:$,open:f,handleTrigger:R,disabled:v}=Ne(),z=x||v,{getButtonProps:w,buttonRef:A}=Oe({disabled:z,focusableWhenDisabled:!0,native:i}),{state:I,setTriggerId:N,triggerId:d}=ne();return Ce(()=>(r&&N(r),()=>{N(void 0)}),[r,N]),H("button",o,{state:I,ref:[m,A],props:[{"aria-controls":f?$:void 0,"aria-expanded":f,id:d,onClick:R},g,w],stateAttributesMapping:Fe})});let ge=(function(a){return a.accordionPanelHeight="--accordion-panel-height",a.accordionPanelWidth="--accordion-panel-width",a})({});const mt=c.forwardRef(function(o,m){const{className:x,hiddenUntilFound:k,keepMounted:r,id:u,render:i,style:y,...g}=o,{hiddenUntilFound:$,keepMounted:f}=Ie(),{mounted:R,onOpenChange:v,open:z,panelId:w,setMounted:A,setOpen:I,setPanelIdState:N,transitionStatus:d}=Ne(),b=k??$,M=r??f;Ce(()=>{if(u)return N(u),()=>{N(void 0)}},[u,N]);const{height:h,props:T,ref:l,shouldPreventOpenAnimation:P,shouldRender:D,transitionStatus:p,width:j}=Le({externalRef:m,hiddenUntilFound:b,id:u??w,keepMounted:M,mounted:R,onOpenChange:v,open:z,setMounted:A,setOpen:I,transitionStatus:d}),{state:B,triggerId:q}=ne(),E={...B,transitionStatus:p},W=Ve(y,E),G=H("div",{...o,style:void 0},{state:E,ref:l,props:[T,{"aria-labelledby":q,role:"region",style:{[ge.accordionPanelHeight]:h===void 0?"auto":`${h}px`,[ge.accordionPanelWidth]:j===void 0?"auto":`${j}px`}},g,W?{style:W}:void 0,P?{style:{animationName:"none"}}:void 0],stateAttributesMapping:oe});return D?G:null});function ut({className:a,...o}){return e.jsx(it,{"data-slot":"accordion",className:Q("flex w-full flex-col",a),...o})}function ht({className:a,...o}){return e.jsx(rt,{"data-slot":"accordion-item",className:Q("not-last:border-b",a),...o})}function pt({className:a,children:o,...m}){return e.jsx(dt,{className:"flex",children:e.jsxs(ct,{"data-slot":"accordion-trigger",className:Q("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",a),...m,children:[o,e.jsx(qe,{"data-slot":"accordion-trigger-icon",className:"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"}),e.jsx(_e,{"data-slot":"accordion-trigger-icon",className:"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"})]})})}function xt({className:a,children:o,...m}){return e.jsx(mt,{"data-slot":"accordion-content",className:"overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up",...m,children:e.jsx("div",{className:Q("h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",a),children:o})})}const fe={title:"Analyze this ticket",message:{system:"Review the current ticket, identify operational risk, and suggest the next action.",user:"Analyze the current ticket and recommend the next action."},autoSend:!0,model:{llmService:"openai",model:"gpt-5"},webSearch:!0,skillSettings:{skills:["ticket-analysis"],tools:["inspect-record"]}},be={title:"Draft a customer reply",message:{user:"Draft a concise customer reply for the current ticket."},autoSend:!1,skillSettings:{skills:["response-drafting"],tools:["inspect-record"]}},je={title:"Review operational risk",message:{system:"Review the current queue, identify operational risk, and prioritize the next actions.",user:"Review the current ticket queue and identify operational risk."},autoSend:!1,skillSettings:{skills:["ticket-analysis"],tools:["inspect-record"]}},C={id:"TK-1042",title:"Payment callback delayed",status:"Open",requester:"Northwind Finance",createdAt:"July 22, 2026 · 09:42",description:"Payment succeeded, but the callback reached the order service twelve minutes late. The customer needs an impact assessment and a response before the next settlement window."},gt=[C,{id:"TK-1041",title:"Unable to update profile"},{id:"TK-1038",title:"Invoice export formatting"}],Te=a=>!["nathan","dara"].includes(a.username.toLowerCase());function St(){return e.jsx(nt,{children:e.jsx(ft,{})})}function ft(){const{employees:a}=Se(),o=He(),m=a.filter(Te),x=m.find(y=>y.username.toLowerCase()==="atlas")??m[0],k=m.find(y=>y.username!==x.username)??x,r=m.find(y=>y.username.toLowerCase()==="atlas")??m.find(y=>y.username!==x.username)??x,u=Ge({id:"support-ticket-detail",title:`${C.id} · ${C.title}`,kind:"record-detail",getContext:()=>({resource:"supportTickets",record:C})}),i=c.useMemo(()=>({[x.username]:[fe,be],...k.username!==x.username?{[k.username]:[je]}:{}}),[x.username,k.username]);return e.jsxs("div",{className:"space-y-12 pb-12",children:[e.jsx("section",{className:"flex flex-wrap items-start justify-between gap-5 border-b pb-8",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{variant:"secondary",children:"AI Components"}),e.jsx(Y,{variant:"outline",children:"Employee capability"})]}),e.jsx("h1",{className:"mt-4 text-3xl font-semibold tracking-[-0.035em]",children:"Employee tasks"}),e.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-6 text-muted-foreground",children:"Bind reusable tasks to AI employees. Tasks can appear directly inside a chat when the employee is selected, or be triggered from contextual buttons elsewhere in the application."})]})}),e.jsxs("section",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:"Scenario 1 · Multiple tasks"}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:"Trigger employee tasks from a business record"}),e.jsx("p",{className:"mt-1.5 max-w-3xl text-sm leading-6 text-muted-foreground",children:"The Shortcut component can still sit in a detail header and provide the current record as work context. Opening it shows the configured analysis and reply tasks below the employee greeting."})]}),e.jsx(Ke,{context:{type:"page-element",id:"support-ticket-detail",title:`${C.id} · ${C.title}`},children:e.jsxs(X,{ref:u,className:"gap-0 overflow-hidden py-0",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b p-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:C.id}),e.jsx(Y,{variant:"outline",children:C.status})]}),e.jsx("h3",{className:"mt-2 text-lg font-semibold tracking-tight",children:C.title})]}),e.jsx(ee,{aiEmployee:x.username,tasks:[fe,be],label:`Ask ${x.nickname}`,size:34})]}),e.jsxs("div",{className:"grid gap-5 p-5 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Requester"}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:C.requester})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Created"}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:C.createdAt})]})]}),e.jsxs("div",{className:"border-t p-5",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6",children:C.description})]})]})})]}),e.jsxs("section",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:"Scenario 2 · Explicit target"}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:"Send a shortcut task to a designated embedded chat"}),e.jsxs("p",{className:"mt-1.5 max-w-3xl text-sm leading-6 text-muted-foreground",children:["The shortcut receives the embedded chat Controller directly. Its Provider explicitly configures ",r.nickname," and an employee task set. It does not need a global target ID and cannot accidentally trigger another conversation on the same page."]})]}),e.jsx(ce,{id:"shortcut-embedded-chat",controller:o,defaultEmployee:r.username,children:e.jsxs("div",{className:"grid items-stretch gap-5 xl:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs(X,{children:[e.jsx(te,{children:e.jsx(se,{className:"text-base",children:"Risk review workspace"})}),e.jsxs(ae,{className:"space-y-5",children:[e.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:"The embedded chat starts without preset tasks. Clicking the Shortcut injects “Review operational risk” into this specific conversation, where the user can choose it before the request is placed in the composer."}),e.jsx(ee,{aiEmployee:r.username,target:o,tasks:[je],auto:!1,context:[{type:"table",title:"Open ticket queue",content:gt}],label:`Ask ${r.nickname}`,size:36})]})]}),e.jsx(me,{className:"h-[560px] min-h-0",children:e.jsx(ue,{})})]})})]}),e.jsxs("section",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:"Scenario 3 · Chat-bound tasks"}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:"Show tasks when the selected employee changes"}),e.jsx("p",{className:"mt-1.5 max-w-3xl text-sm leading-6 text-muted-foreground",children:"This conversation window binds task lists directly to business AI employees. Starting a new conversation or switching employees in the composer immediately replaces the empty-state tasks. Employees without a binding keep the normal greeting-only state."})]}),e.jsxs("div",{className:"grid items-stretch gap-5 xl:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs(X,{children:[e.jsx(te,{children:e.jsx(se,{className:"text-base",children:"Employee task bindings"})}),e.jsxs(ae,{className:"space-y-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"rounded-lg border bg-muted/25 p-3 font-mono text-xs leading-5",children:[e.jsx("div",{children:x.username}),e.jsx("div",{className:"pl-4",children:"Analyze this ticket"}),e.jsx("div",{className:"pl-4",children:"Draft a customer reply"}),k.username!==x.username?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-2",children:k.username}),e.jsx("div",{className:"pl-4",children:"Review operational risk"})]}):null]}),e.jsx("p",{children:"Switch employees from the bottom of the chat to preview each configured task list."}),e.jsxs("p",{children:["The same ",e.jsx("code",{children:"employeeTasks"})," parameter works in page, embedded, side-panel, dialog, and mobile containers."]})]})]}),e.jsx(ce,{id:"employee-task-scenario-chat",defaultEmployee:x.username,employeeTasks:i,children:e.jsx(me,{className:"h-[620px] min-h-0",children:e.jsx(ue,{})})})]})]}),e.jsx(kt,{embeddedController:o})]})}const bt=[{value:"ticket-analysis",label:"Ticket analysis"},{value:"response-drafting",label:"Response drafting"},{value:"workflow-design",label:"Workflow design"}],jt=[{value:"inspect-record",label:"Inspect record"},{value:"search-records",label:"Search records"},{value:"update-record",label:"Update record"}],ke=[{id:"analyze-ticket",employee:"",title:"Analyze this ticket",background:"Identify operational risk and recommend the next action.",userMessage:"Analyze the current ticket and recommend the next action.",autoSend:!0,workContext:[{type:"page-element",id:"support-ticket-detail",title:`${C.id} · ${C.title}`}],model:"gpt-5",webSearch:!0,skillsMode:"custom",skills:["ticket-analysis"],toolsMode:"custom",tools:["inspect-record"]},{id:"draft-reply",employee:"",title:"Draft a customer reply",background:"Write a concise and helpful response using the ticket context.",userMessage:"Draft a customer reply for the current ticket.",autoSend:!1,workContext:[],model:"default",webSearch:!1,skillsMode:"custom",skills:["response-drafting"],toolsMode:"preset",tools:[]}];function kt({embeddedController:a}){var E,W,G,ie,le;const{employees:o,models:m}=Se(),{registeredCount:x,startPicking:k}=Je(),r=o.filter(Te),u=r.find(t=>t.username.toLowerCase()==="atlas")??r[0],[i,y]=c.useState("shortcut"),[g,$]=c.useState("the ticket detail header actions"),[f,R]=c.useState(u.username),[v,z]=c.useState(u.username),[w,A]=c.useState("global-side-panel"),[I,N]=c.useState("embedded"),[d,b]=c.useState(()=>ke.map(t=>({...t,employee:u.username}))),[M,h]=c.useState(ke[0].id),T=i==="chat-tasks"?d.filter(t=>t.employee===v):d,l=T.find(t=>t.id===M)??T[0],P=c.useMemo(()=>d.map(t=>{const n=Z(m,t.model),s=t.skillsMode==="custom"||t.toolsMode==="custom";return{title:t.title,message:{system:t.background||void 0,user:t.userMessage||void 0,workContext:t.workContext.length?t.workContext:void 0},autoSend:t.autoSend,model:n?{llmService:n.llmService,model:n.value}:void 0,webSearch:t.webSearch,skillSettings:s?{skills:t.skillsMode==="custom"?t.skills:void 0,tools:t.toolsMode==="custom"?t.tools:void 0}:void 0}}),[m,d]),D=c.useMemo(()=>{const t=(s,U)=>{var re;const _=s.model==="default"?"Use the AI employee default":((re=m.find(K=>K.value===s.model))==null?void 0:re.label)??s.model;return`${U+1}. ${s.title}
|
|
1
|
+
import{b as c,ah as ye,ai as Pe,aj as Ee,ak as we,al as H,j as e,am as Re,an as $e,ao as Ue,ap as We,aq as ze,ar as de,as as De,at as Be,au as Ne,av as Oe,aw as Ce,ax as Fe,ay as Le,az as Ve,c as Q,F as qe,aA as _e,aB as Se,ae as He,aC as Ge,B as Y,aD as Ke,C as X,aE as ee,a6 as ce,k as te,l as se,n as ae,_ as me,$ as ue,aa as Je,aF as Z,d as O,e as F,f as L,g as V,i as S,I as he,K as J,P as Xe,O as Qe,h as Ye,aG as Ze,T as pe,ab as et,aH as tt,aI as st}from"./index-CMoFG_fD.js";import{S as xe}from"./switch-BVTKHDeA.js";import{P as at}from"./prompt-card-xoH-b2hL.js";import{A as nt}from"./configuration-gate-CdktspSj.js";import"./prompt-output-7ZS2-d1_.js";const Ae=c.createContext(void 0);function Ie(){const a=c.useContext(Ae);if(a===void 0)throw new Error(ye(10));return a}const ot={value:()=>null},it=c.forwardRef(function(o,m){const{render:x,className:k,disabled:r=!1,hiddenUntilFound:u,keepMounted:i,loopFocus:y,onValueChange:g,multiple:$=!1,orientation:f="vertical",value:R,defaultValue:v,style:z,...w}=o,A=Pe(),I=c.useMemo(()=>{if(R===void 0)return v??[]},[R,v]),N=c.useRef([]),[d,b]=Ee({controlled:R,default:I,name:"Accordion",state:"value"}),M=we((P,D,p)=>{if($)if(D){const j=d.slice();if(j.push(P),g==null||g(j,p),p.isCanceled)return;b(j)}else{const j=d.filter(B=>B!==P);if(g==null||g(j,p),p.isCanceled)return;b(j)}else{const j=d[0]===P?[]:[P];if(g==null||g(j,p),p.isCanceled)return;b(j)}}),h=c.useMemo(()=>({value:d,disabled:r,orientation:f}),[d,r,f]),T=c.useMemo(()=>({disabled:r,handleValueChange:M,hiddenUntilFound:u??!1,keepMounted:i??!1,state:h,value:d}),[r,M,u,i,h,d]),l=H("div",o,{state:h,ref:m,props:[{dir:A},w],stateAttributesMapping:ot});return e.jsx(Ae.Provider,{value:T,children:e.jsx(Re,{elementsRef:N,children:l})})}),Me=c.createContext(void 0);function ne(){const a=c.useContext(Me);if(a===void 0)throw new Error(ye(9));return a}let lt=(function(a){return a.index="data-index",a.disabled="data-disabled",a.open="data-open",a})({});const oe={...Ue,index:a=>Number.isInteger(a)?{[lt.index]:String(a)}:null,...$e,value:()=>null},rt=c.forwardRef(function(o,m){const{className:x,disabled:k=!1,onOpenChange:r,render:u,value:i,style:y,...g}=o,{ref:$,index:f}=We(),R=ze(m,$),{disabled:v,handleValueChange:z,state:w,value:A}=Ie(),I=de(),N=i??I,d=k||v,b=c.useMemo(()=>{if(!A)return!1;for(let E=0;E<A.length;E+=1)if(A[E]===N)return!0;return!1},[A,N]),M=we((E,W)=>{r==null||r(E,W),!W.isCanceled&&z(N,E,W)}),h=De({open:b,onOpenChange:M,disabled:d}),T=c.useMemo(()=>({open:h.open,disabled:h.disabled,transitionStatus:h.transitionStatus}),[h.open,h.disabled,h.transitionStatus]),l=c.useMemo(()=>({...h,onOpenChange:M,state:T}),[h,T,M]),P=c.useMemo(()=>({...w,hidden:!b&&!h.mounted,index:f,disabled:d,open:b}),[h.mounted,d,f,b,w]),D=de(),[p,j]=c.useState(),B=c.useMemo(()=>({open:b,state:P,setTriggerId:j,triggerId:p??D}),[D,b,P,j,p]),q=H("div",o,{state:P,ref:R,props:g,stateAttributesMapping:oe});return e.jsx(Be.Provider,{value:l,children:e.jsx(Me.Provider,{value:B,children:q})})}),dt=c.forwardRef(function(o,m){const{render:x,className:k,style:r,...u}=o,{state:i}=ne();return H("h3",o,{state:i,ref:m,props:u,stateAttributesMapping:oe})}),ct=c.forwardRef(function(o,m){const{disabled:x,className:k,id:r,render:u,nativeButton:i=!0,style:y,...g}=o,{panelId:$,open:f,handleTrigger:R,disabled:v}=Ne(),z=x||v,{getButtonProps:w,buttonRef:A}=Oe({disabled:z,focusableWhenDisabled:!0,native:i}),{state:I,setTriggerId:N,triggerId:d}=ne();return Ce(()=>(r&&N(r),()=>{N(void 0)}),[r,N]),H("button",o,{state:I,ref:[m,A],props:[{"aria-controls":f?$:void 0,"aria-expanded":f,id:d,onClick:R},g,w],stateAttributesMapping:Fe})});let ge=(function(a){return a.accordionPanelHeight="--accordion-panel-height",a.accordionPanelWidth="--accordion-panel-width",a})({});const mt=c.forwardRef(function(o,m){const{className:x,hiddenUntilFound:k,keepMounted:r,id:u,render:i,style:y,...g}=o,{hiddenUntilFound:$,keepMounted:f}=Ie(),{mounted:R,onOpenChange:v,open:z,panelId:w,setMounted:A,setOpen:I,setPanelIdState:N,transitionStatus:d}=Ne(),b=k??$,M=r??f;Ce(()=>{if(u)return N(u),()=>{N(void 0)}},[u,N]);const{height:h,props:T,ref:l,shouldPreventOpenAnimation:P,shouldRender:D,transitionStatus:p,width:j}=Le({externalRef:m,hiddenUntilFound:b,id:u??w,keepMounted:M,mounted:R,onOpenChange:v,open:z,setMounted:A,setOpen:I,transitionStatus:d}),{state:B,triggerId:q}=ne(),E={...B,transitionStatus:p},W=Ve(y,E),G=H("div",{...o,style:void 0},{state:E,ref:l,props:[T,{"aria-labelledby":q,role:"region",style:{[ge.accordionPanelHeight]:h===void 0?"auto":`${h}px`,[ge.accordionPanelWidth]:j===void 0?"auto":`${j}px`}},g,W?{style:W}:void 0,P?{style:{animationName:"none"}}:void 0],stateAttributesMapping:oe});return D?G:null});function ut({className:a,...o}){return e.jsx(it,{"data-slot":"accordion",className:Q("flex w-full flex-col",a),...o})}function ht({className:a,...o}){return e.jsx(rt,{"data-slot":"accordion-item",className:Q("not-last:border-b",a),...o})}function pt({className:a,children:o,...m}){return e.jsx(dt,{className:"flex",children:e.jsxs(ct,{"data-slot":"accordion-trigger",className:Q("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",a),...m,children:[o,e.jsx(qe,{"data-slot":"accordion-trigger-icon",className:"pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"}),e.jsx(_e,{"data-slot":"accordion-trigger-icon",className:"pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"})]})})}function xt({className:a,children:o,...m}){return e.jsx(mt,{"data-slot":"accordion-content",className:"overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up",...m,children:e.jsx("div",{className:Q("h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",a),children:o})})}const fe={title:"Analyze this ticket",message:{system:"Review the current ticket, identify operational risk, and suggest the next action.",user:"Analyze the current ticket and recommend the next action."},autoSend:!0,model:{llmService:"openai",model:"gpt-5"},webSearch:!0,skillSettings:{skills:["ticket-analysis"],tools:["inspect-record"]}},be={title:"Draft a customer reply",message:{user:"Draft a concise customer reply for the current ticket."},autoSend:!1,skillSettings:{skills:["response-drafting"],tools:["inspect-record"]}},je={title:"Review operational risk",message:{system:"Review the current queue, identify operational risk, and prioritize the next actions.",user:"Review the current ticket queue and identify operational risk."},autoSend:!1,skillSettings:{skills:["ticket-analysis"],tools:["inspect-record"]}},C={id:"TK-1042",title:"Payment callback delayed",status:"Open",requester:"Northwind Finance",createdAt:"July 22, 2026 · 09:42",description:"Payment succeeded, but the callback reached the order service twelve minutes late. The customer needs an impact assessment and a response before the next settlement window."},gt=[C,{id:"TK-1041",title:"Unable to update profile"},{id:"TK-1038",title:"Invoice export formatting"}],Te=a=>!["nathan","dara"].includes(a.username.toLowerCase());function St(){return e.jsx(nt,{children:e.jsx(ft,{})})}function ft(){const{employees:a}=Se(),o=He(),m=a.filter(Te),x=m.find(y=>y.username.toLowerCase()==="atlas")??m[0],k=m.find(y=>y.username!==x.username)??x,r=m.find(y=>y.username.toLowerCase()==="atlas")??m.find(y=>y.username!==x.username)??x,u=Ge({id:"support-ticket-detail",title:`${C.id} · ${C.title}`,kind:"record-detail",getContext:()=>({resource:"supportTickets",record:C})}),i=c.useMemo(()=>({[x.username]:[fe,be],...k.username!==x.username?{[k.username]:[je]}:{}}),[x.username,k.username]);return e.jsxs("div",{className:"space-y-12 pb-12",children:[e.jsx("section",{className:"flex flex-wrap items-start justify-between gap-5 border-b pb-8",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{variant:"secondary",children:"AI Components"}),e.jsx(Y,{variant:"outline",children:"Employee capability"})]}),e.jsx("h1",{className:"mt-4 text-3xl font-semibold tracking-[-0.035em]",children:"Employee tasks"}),e.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-6 text-muted-foreground",children:"Bind reusable tasks to AI employees. Tasks can appear directly inside a chat when the employee is selected, or be triggered from contextual buttons elsewhere in the application."})]})}),e.jsxs("section",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:"Scenario 1 · Multiple tasks"}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:"Trigger employee tasks from a business record"}),e.jsx("p",{className:"mt-1.5 max-w-3xl text-sm leading-6 text-muted-foreground",children:"The Shortcut component can still sit in a detail header and provide the current record as work context. Opening it shows the configured analysis and reply tasks below the employee greeting."})]}),e.jsx(Ke,{context:{type:"page-element",id:"support-ticket-detail",title:`${C.id} · ${C.title}`},children:e.jsxs(X,{ref:u,className:"gap-0 overflow-hidden py-0",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b p-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:C.id}),e.jsx(Y,{variant:"outline",children:C.status})]}),e.jsx("h3",{className:"mt-2 text-lg font-semibold tracking-tight",children:C.title})]}),e.jsx(ee,{aiEmployee:x.username,tasks:[fe,be],label:`Ask ${x.nickname}`,size:34})]}),e.jsxs("div",{className:"grid gap-5 p-5 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Requester"}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:C.requester})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Created"}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:C.createdAt})]})]}),e.jsxs("div",{className:"border-t p-5",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6",children:C.description})]})]})})]}),e.jsxs("section",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:"Scenario 2 · Explicit target"}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:"Send a shortcut task to a designated embedded chat"}),e.jsxs("p",{className:"mt-1.5 max-w-3xl text-sm leading-6 text-muted-foreground",children:["The shortcut receives the embedded chat Controller directly. Its Provider explicitly configures ",r.nickname," and an employee task set. It does not need a global target ID and cannot accidentally trigger another conversation on the same page."]})]}),e.jsx(ce,{id:"shortcut-embedded-chat",controller:o,defaultEmployee:r.username,children:e.jsxs("div",{className:"grid items-stretch gap-5 xl:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs(X,{children:[e.jsx(te,{children:e.jsx(se,{className:"text-base",children:"Risk review workspace"})}),e.jsxs(ae,{className:"space-y-5",children:[e.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:"The embedded chat starts without preset tasks. Clicking the Shortcut injects “Review operational risk” into this specific conversation, where the user can choose it before the request is placed in the composer."}),e.jsx(ee,{aiEmployee:r.username,target:o,tasks:[je],auto:!1,context:[{type:"table",title:"Open ticket queue",content:gt}],label:`Ask ${r.nickname}`,size:36})]})]}),e.jsx(me,{className:"h-[560px] min-h-0",children:e.jsx(ue,{})})]})})]}),e.jsxs("section",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:"Scenario 3 · Chat-bound tasks"}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:"Show tasks when the selected employee changes"}),e.jsx("p",{className:"mt-1.5 max-w-3xl text-sm leading-6 text-muted-foreground",children:"This conversation window binds task lists directly to business AI employees. Starting a new conversation or switching employees in the composer immediately replaces the empty-state tasks. Employees without a binding keep the normal greeting-only state."})]}),e.jsxs("div",{className:"grid items-stretch gap-5 xl:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs(X,{children:[e.jsx(te,{children:e.jsx(se,{className:"text-base",children:"Employee task bindings"})}),e.jsxs(ae,{className:"space-y-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"rounded-lg border bg-muted/25 p-3 font-mono text-xs leading-5",children:[e.jsx("div",{children:x.username}),e.jsx("div",{className:"pl-4",children:"Analyze this ticket"}),e.jsx("div",{className:"pl-4",children:"Draft a customer reply"}),k.username!==x.username?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-2",children:k.username}),e.jsx("div",{className:"pl-4",children:"Review operational risk"})]}):null]}),e.jsx("p",{children:"Switch employees from the bottom of the chat to preview each configured task list."}),e.jsxs("p",{children:["The same ",e.jsx("code",{children:"employeeTasks"})," parameter works in page, embedded, side-panel, dialog, and mobile containers."]})]})]}),e.jsx(ce,{id:"employee-task-scenario-chat",defaultEmployee:x.username,employeeTasks:i,children:e.jsx(me,{className:"h-[620px] min-h-0",children:e.jsx(ue,{})})})]})]}),e.jsx(kt,{embeddedController:o})]})}const bt=[{value:"ticket-analysis",label:"Ticket analysis"},{value:"response-drafting",label:"Response drafting"},{value:"workflow-design",label:"Workflow design"}],jt=[{value:"inspect-record",label:"Inspect record"},{value:"search-records",label:"Search records"},{value:"update-record",label:"Update record"}],ke=[{id:"analyze-ticket",employee:"",title:"Analyze this ticket",background:"Identify operational risk and recommend the next action.",userMessage:"Analyze the current ticket and recommend the next action.",autoSend:!0,workContext:[{type:"page-element",id:"support-ticket-detail",title:`${C.id} · ${C.title}`}],model:"gpt-5",webSearch:!0,skillsMode:"custom",skills:["ticket-analysis"],toolsMode:"custom",tools:["inspect-record"]},{id:"draft-reply",employee:"",title:"Draft a customer reply",background:"Write a concise and helpful response using the ticket context.",userMessage:"Draft a customer reply for the current ticket.",autoSend:!1,workContext:[],model:"default",webSearch:!1,skillsMode:"custom",skills:["response-drafting"],toolsMode:"preset",tools:[]}];function kt({embeddedController:a}){var E,W,G,ie,le;const{employees:o,models:m}=Se(),{registeredCount:x,startPicking:k}=Je(),r=o.filter(Te),u=r.find(t=>t.username.toLowerCase()==="atlas")??r[0],[i,y]=c.useState("shortcut"),[g,$]=c.useState("the ticket detail header actions"),[f,R]=c.useState(u.username),[v,z]=c.useState(u.username),[w,A]=c.useState("global-side-panel"),[I,N]=c.useState("embedded"),[d,b]=c.useState(()=>ke.map(t=>({...t,employee:u.username}))),[M,h]=c.useState(ke[0].id),T=i==="chat-tasks"?d.filter(t=>t.employee===v):d,l=T.find(t=>t.id===M)??T[0],P=c.useMemo(()=>d.map(t=>{const n=Z(m,t.model),s=t.skillsMode==="custom"||t.toolsMode==="custom";return{title:t.title,message:{system:t.background||void 0,user:t.userMessage||void 0,workContext:t.workContext.length?t.workContext:void 0},autoSend:t.autoSend,model:n?{llmService:n.llmService,model:n.value}:void 0,webSearch:t.webSearch,skillSettings:s?{skills:t.skillsMode==="custom"?t.skills:void 0,tools:t.toolsMode==="custom"?t.tools:void 0}:void 0}}),[m,d]),D=c.useMemo(()=>{const t=(s,U)=>{var re;const _=s.model==="default"?"Use the AI employee default":((re=m.find(K=>K.value===s.model))==null?void 0:re.label)??s.model;return`${U+1}. ${s.title}
|
|
2
2
|
- Background: ${s.background||"None"}
|
|
3
3
|
- Default user message: ${s.userMessage||"None"}
|
|
4
4
|
- Send automatically: ${s.autoSend}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,b7 as y,j as e,aN as b,aP as j,aQ as A,o as S,I as v,K as w}from"./index-
|
|
1
|
+
import{b as a,b7 as y,j as e,aN as b,aP as j,aQ as A,o as S,I as v,K as w}from"./index-CMoFG_fD.js";import{u as C}from"./use-authenticator-sign-in-B8OPLh-w.js";function E(n){var x;const s=C(n.name),[l,r]=a.useState(!1),[g,d]=a.useState(),[c,t]=a.useState(),[f,m]=a.useState(Date.now()),i=typeof((x=n.options)==null?void 0:x.verifier)=="string"?n.options.verifier:"";a.useEffect(()=>{if(!c||c<=Date.now())return;const u=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(u)},[c]);const h=a.useMemo(()=>c?Math.max(0,Math.ceil((c-f)/1e3)):0,[c,f]);return{sendCode:a.useCallback(async u=>{if(!u)throw new Error("Enter a phone number first.");if(!i)throw new Error("The SMS verifier is not configured.");if(!(h>0)){d(void 0),r(!0);try{const o=await y.action("smsOTP","publicCreate",{method:"POST",authenticator:null,includeRole:!1,withAclMeta:!1,body:{action:"auth:signIn",verifier:i,uuid:u}}),p=o!=null&&o.expiresAt?Date.parse(o.expiresAt):Date.now()+6e4;m(Date.now()),t(p)}catch(o){const p=o instanceof Error?o:new Error("Unable to send the verification code.");throw d(p),p}finally{r(!1)}}},[h,i]),signIn:(u,o)=>s.signIn({uuid:u,code:o}),isSendingCode:l,isSigningIn:s.isPending,retryAfter:h,error:g??s.error}}function M({authenticator:n,onSendCode:s,onSignIn:l}){var m;const[r,g]=a.useState(""),[d,c]=a.useState(""),t=E(n),f=((m=n.options)==null?void 0:m.autoSignup)===!0;return e.jsxs("form",{className:"space-y-5",onSubmit:i=>{if(i.preventDefault(),l){l({phone:r,code:d});return}t.signIn(r,d)},children:[t.error&&e.jsxs(b,{variant:"destructive",children:[e.jsx(j,{children:"SMS sign-in failed"}),e.jsx(A,{children:t.error.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:`${n.name}-phone`,children:"Phone"}),e.jsx(v,{id:`${n.name}-phone`,type:"tel",value:r,onChange:i=>g(i.target.value),autoComplete:"tel",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:`${n.name}-code`,children:"Verification code"}),e.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-2",children:[e.jsx(v,{id:`${n.name}-code`,inputMode:"numeric",value:d,onChange:i=>c(i.target.value),autoComplete:"one-time-code",required:!0}),e.jsx(w,{type:"button",variant:"outline",disabled:!s&&(t.isSendingCode||t.retryAfter>0)||!r,onClick:()=>{if(s){s(r);return}t.sendCode(r).catch(()=>{})},children:!s&&t.isSendingCode?"Sending…":!s&&t.retryAfter>0?`Retry in ${t.retryAfter}s`:"Send code"})]})]}),e.jsx(w,{type:"submit",className:"w-full",disabled:!l&&t.isSigningIn,children:!l&&t.isSigningIn?"Signing in…":"Sign in"}),f&&e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:"An account will be created automatically if this phone number is new."})]})}export{M as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bI as Kc,
|
|
1
|
+
import{bI as Kc,c2 as mc}from"./index-CMoFG_fD.js";function qc(q,Ne){for(var b=0;b<Ne.length;b++){const gn=Ne[b];if(typeof gn!="string"&&!Array.isArray(gn)){for(const vn in gn)if(vn!=="default"&&!(vn in q)){const zn=Object.getOwnPropertyDescriptor(gn,vn);zn&&Object.defineProperty(q,vn,zn.get?zn:{enumerable:!0,get:()=>gn[vn]})}}}return Object.freeze(Object.defineProperty(q,Symbol.toStringTag,{value:"Module"}))}var Le={},Be={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-dom-server.browser.production.js
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as s,ah as ne,aS as de,aT as re,aU as se,aV as ie,aq as le,ar as ce,aW as oe,aj as ue,aX as fe,aw as pe,aY as he,av as be,aZ as ve,a_ as ge,a$ as ke,al as M,j as f,b0 as me,b1 as ye,b2 as xe,b3 as we,b4 as Ce,c as Pe}from"./index-
|
|
1
|
+
import{b as s,ah as ne,aS as de,aT as re,aU as se,aV as ie,aq as le,ar as ce,aW as oe,aj as ue,aX as fe,aw as pe,aY as he,av as be,aZ as ve,a_ as ge,a$ as ke,al as M,j as f,b0 as me,b1 as ye,b2 as xe,b3 as we,b4 as Ce,c as Pe}from"./index-CMoFG_fD.js";const T=s.createContext(void 0);function Ee(){const e=s.useContext(T);if(e===void 0)throw new Error(ne(63));return e}let F=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const V={...de,checked(e){return e?{[F.checked]:""}:{[F.unchecked]:""}}},ze=s.forwardRef(function(d,l){const{checked:y,className:L,defaultChecked:x,"aria-labelledby":g,form:p,id:q,inputRef:N,name:w,nativeButton:h=!1,onCheckedChange:k,readOnly:c=!1,required:b=!1,disabled:H=!1,render:Ie,uncheckedValue:C,value:P,style:Re,...W}=d,{clearErrors:O}=re(),{state:E,setTouched:S,setDirty:U,validityData:Y,setFilled:m,setFocused:z,validationMode:_,disabled:J,name:X,validation:o}=se(),{labelId:Z}=ie(),t=J||H,u=X??w,r=s.useRef(null),$=le(r,N,o.inputRef),v=s.useRef(null),B=ce(),I=oe({id:q,implicit:!1,controlRef:v}),R=h?void 0:I,[n,G]=ue({controlled:y,default:!!x,name:"Switch",state:"checked"});fe(v,B,n,void 0,!t,w),pe(()=>{r.current&&m(r.current.checked)},[r,m]),he(n,()=>{O(u),U(n!==Y.initialValue),m(n),o.change(n)});const{getButtonProps:Q,buttonRef:D}=be({disabled:t,native:h}),A=ve(g,Z,r,!h,R),ee={id:h?I:B,role:"switch","aria-checked":n,"aria-readonly":c||void 0,"aria-required":b||void 0,"aria-labelledby":A,onFocus(){t||z(!0)},onBlur(){const a=r.current;!a||t||(S(!0),z(!1),_==="onBlur"&&o.commit(a.checked))},onClick(a){if(c||t)return;a.preventDefault();const i=r.current;i&&i.dispatchEvent(new(me(i)).PointerEvent("click",{bubbles:!0,shiftKey:a.shiftKey,ctrlKey:a.ctrlKey,altKey:a.altKey,metaKey:a.metaKey}))}},ae=ge({checked:n,disabled:t,form:p,id:R,name:u,required:b,style:u?ye:xe,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:$,onChange(a){if(a.nativeEvent.defaultPrevented)return;if(c){a.preventDefault();return}const i=a.currentTarget.checked,K=we(Ce,a.nativeEvent);k==null||k(i,K),!K.isCanceled&&G(i)},onFocus(){var a;(a=v.current)==null||a.focus()}},a=>o.getValidationProps(t,a),P!==void 0?{value:P}:ke),j=s.useMemo(()=>({...E,checked:n,disabled:t,readOnly:c,required:b}),[E,n,t,c,b]),te=M("span",d,{state:j,ref:[l,v,D],props:[ee,W,Q,a=>o.getValidationProps(t,a)],stateAttributesMapping:V});return f.jsxs(T.Provider,{value:j,children:[te,!n&&u&&C!==void 0&&f.jsx("input",{type:"hidden",form:p,name:u,value:C,disabled:t}),f.jsx("input",{...ae,suppressHydrationWarning:!0})]})}),Be=s.forwardRef(function(d,l){const{render:y,className:L,style:x,...g}=d,p=Ee();return M("span",d,{state:p,ref:l,stateAttributesMapping:V,props:g})});function Ke({className:e,size:d="default",...l}){return f.jsx(ze,{"data-slot":"switch","data-size":d,className:Pe("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...l,children:f.jsx(Be,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}export{Ke as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as i,j as e,B as w,C as u,k as m,l as h,n as x,aR as y,I as k,d as N,e as C,f as T,g as R,i as A,T as S}from"./index-
|
|
1
|
+
import{b as i,j as e,B as w,C as u,k as m,l as h,n as x,aR as y,I as k,d as N,e as C,f as T,g as R,i as A,T as S}from"./index-CMoFG_fD.js";import{P as I}from"./prompt-output-7ZS2-d1_.js";import{S as W}from"./switch-BVTKHDeA.js";const o={suggestions:{type:"dynamic-tool",toolName:"suggestions",toolCallId:"tool-demo-suggestions",state:"input-available",input:{options:["Summarize the operational risks","Draft a weekly support report","Propose the next automation"]}},report:{type:"dynamic-tool",toolName:"businessReportGenerator",toolCallId:"tool-demo-report",state:"output-available",input:{title:"Customer support operations · Weekly review",summary:"Ticket volume remained stable while SLA exposure concentrated in two queues.",markdown:`# Weekly support review
|
|
2
2
|
|
|
3
3
|
## Executive summary
|
|
4
4
|
|
package/dist/assets/{use-authenticator-sign-in-CIj210ry.js → use-authenticator-sign-in-B8OPLh-w.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bf as i}from"./index-
|
|
1
|
+
import{bf as i}from"./index-CMoFG_fD.js";function o(r){const n=i();return{signIn:t=>n.mutateAsync({...t,authenticator:r}),isPending:n.isPending,error:n.error}}export{o as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b5 as g,b as a,b6 as d,b7 as i}from"./index-
|
|
1
|
+
import{b5 as g,b as a,b6 as d,b7 as i}from"./index-CMoFG_fD.js";function w(){return typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("dingtalk")}function b(n){const[r]=g(),[c,o]=a.useState(!1),[l,s]=a.useState(),u=a.useMemo(()=>{if(r.get("authenticator")!==n.name)return;const e=r.get("error");return e?new Error(e):void 0},[n.name,r]);return{signIn:a.useCallback(async()=>{s(void 0),o(!0);try{const e=d(r.get("to")||r.get("redirect")||"/"),t=await i.action("dingtalk","getAuthUrl",{method:"POST",authenticator:n.name,includeRole:!1,withAclMeta:!1,body:{redirect:e}});if(!(t!=null&&t.url))throw new Error("NocoBase did not return a DingTalk authorization URL.");window.location.replace(i.resolveUrl(t.url))}catch(e){s(e instanceof Error?e:new Error("Unable to start DingTalk sign-in.")),o(!1)}},[n.name,r]),isPending:c,error:l??u}}export{w as i,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b5 as m,b as n,b6 as d,b7 as i}from"./index-
|
|
1
|
+
import{b5 as m,b as n,b6 as d,b7 as i}from"./index-CMoFG_fD.js";function g(){return typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("wxwork")}function b(o){const[r]=m(),[c,s]=n.useState(!1),[l,a]=n.useState(),u=n.useMemo(()=>{if(r.get("authenticator")!==o.name)return;const e=r.get("errorMsg");return e?new Error(e):void 0},[o.name,r]);return{signIn:n.useCallback(async()=>{a(void 0),s(!0);try{const e=d(r.get("to")||r.get("redirect")||"/"),t=await i.action("wecom","getAuthUrl",{method:"POST",authenticator:o.name,includeRole:!1,withAclMeta:!1,body:{redirect:e,isWeComBrowser:g()}});if(!(t!=null&&t.url))throw new Error("NocoBase did not return a WeCom authorization URL.");window.location.replace(i.resolveUrl(t.url))}catch(e){a(e instanceof Error?e:new Error("Unable to start WeCom sign-in.")),s(!1)}},[o.name,r]),isPending:c,error:l??u}}export{g as i,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,K as c,bg as d,r as p,aN as x,aP as m,aQ as g,bh as u,bi as j,bj as T}from"./index-
|
|
1
|
+
import{j as s,K as c,bg as d,r as p,aN as x,aP as m,aQ as g,bh as u,bi as j,bj as T}from"./index-CMoFG_fD.js";import{u as b}from"./use-wecom-sign-in-Di3WFrU1.js";function f(e){return typeof e=="string"?e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim():""}function y({authenticator:e,onSignIn:i}){var o;const{signIn:a,isPending:t,error:n}=b(e),r=f((o=e.options)==null?void 0:o.btnTooltip),l=s.jsxs(c,{type:"button",variant:"outline",className:"w-full",disabled:!i&&t,onClick:i??a,children:[s.jsx(d,{}),!i&&t?"Redirecting…":p(e.title||e.authTypeTitle||"Sign in via WeCom")]});return s.jsxs("div",{className:"space-y-3",children:[n&&s.jsxs(x,{variant:"destructive",children:[s.jsx(m,{children:"WeCom sign-in failed"}),s.jsx(g,{children:n.message})]}),r?s.jsxs(u,{children:[s.jsx(j,{render:l}),s.jsx(T,{side:"right",className:"max-w-xs",children:r})]}):l]})}export{y as default};
|
package/dist/index.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
content="/logo-mark.png"
|
|
21
21
|
/>
|
|
22
22
|
<title>NocoBase</title>
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-CMoFG_fD.js"></script>
|
|
24
24
|
<link rel="stylesheet" crossorigin href="/assets/index-BBKV6O5d.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
package/dist/index.raw.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
window.__nocobase_api_client_share_token__ = window.__nocobase_api_client_share_token__ ?? false;
|
|
30
30
|
</script>
|
|
31
31
|
<!-- nocobase-runtime-config:end -->
|
|
32
|
-
<script type="module" crossorigin src="/assets/index-
|
|
32
|
+
<script type="module" crossorigin src="/assets/index-CMoFG_fD.js"></script>
|
|
33
33
|
<link rel="stylesheet" crossorigin href="/assets/index-BBKV6O5d.css">
|
|
34
34
|
</head>
|
|
35
35
|
<body>
|
package/package.json
CHANGED
package/src/app/route-runtime.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { ResourceProps } from "@refinedev/core";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
createElement,
|
|
4
|
+
Fragment,
|
|
5
|
+
type ReactElement,
|
|
6
|
+
type ReactNode,
|
|
7
|
+
} from "react";
|
|
3
8
|
import { Outlet, Route } from "react-router";
|
|
4
9
|
|
|
5
10
|
import type { ResourceAcl, RouteAccessConstraint } from "@/lib/nocobase/acl";
|
|
@@ -18,6 +23,7 @@ type AppRouteBase = {
|
|
|
18
23
|
name: string;
|
|
19
24
|
element?: ReactNode;
|
|
20
25
|
access?: RouteAccessConstraint;
|
|
26
|
+
outlet?: "auto" | "manual";
|
|
21
27
|
};
|
|
22
28
|
|
|
23
29
|
type AppRouteResourceBinding =
|
|
@@ -147,9 +153,30 @@ export function buildRouteResources(
|
|
|
147
153
|
});
|
|
148
154
|
}
|
|
149
155
|
|
|
156
|
+
const hasResourceActionRoute = (routes: AppRouteDefinition[]): boolean =>
|
|
157
|
+
routes.some(
|
|
158
|
+
(route) =>
|
|
159
|
+
Boolean(route.resourceAction) ||
|
|
160
|
+
hasResourceActionRoute(route.children ?? [])
|
|
161
|
+
);
|
|
162
|
+
|
|
150
163
|
export function renderAppRoutes(routes: AppRouteDefinition[]): ReactElement[] {
|
|
151
164
|
return routes.map((route) => {
|
|
152
|
-
|
|
165
|
+
// Resource actions are nested so the list stays mounted behind a drawer or
|
|
166
|
+
// dialog. Own that required outlet here unless a layout deliberately
|
|
167
|
+
// renders or consumes the outlet itself.
|
|
168
|
+
const content =
|
|
169
|
+
route.element &&
|
|
170
|
+
route.resource &&
|
|
171
|
+
route.outlet !== "manual" &&
|
|
172
|
+
hasResourceActionRoute(route.children ?? [])
|
|
173
|
+
? createElement(
|
|
174
|
+
Fragment,
|
|
175
|
+
null,
|
|
176
|
+
route.element,
|
|
177
|
+
createElement(Outlet)
|
|
178
|
+
)
|
|
179
|
+
: route.element ?? createElement(Outlet);
|
|
153
180
|
const element = route.access
|
|
154
181
|
? createElement(RouteAccessGuard, { access: route.access }, content)
|
|
155
182
|
: content;
|
|
@@ -647,6 +647,13 @@ export function DataTableFilterInput<TData>({
|
|
|
647
647
|
return defaultOperatorFromProps || "eq";
|
|
648
648
|
});
|
|
649
649
|
|
|
650
|
+
useEffect(() => {
|
|
651
|
+
columnFromProps.columnDef.meta = {
|
|
652
|
+
...columnFromProps.columnDef.meta,
|
|
653
|
+
filterOperator: operator,
|
|
654
|
+
};
|
|
655
|
+
}, [columnFromProps, operator]);
|
|
656
|
+
|
|
650
657
|
const handleApply = () => {
|
|
651
658
|
columnFromProps.setFilterValue(filterValue);
|
|
652
659
|
};
|
|
@@ -658,10 +665,6 @@ export function DataTableFilterInput<TData>({
|
|
|
658
665
|
|
|
659
666
|
const handleOperatorChange = (value: CrudOperators) => {
|
|
660
667
|
setOperator(value);
|
|
661
|
-
columnFromProps.columnDef.meta = {
|
|
662
|
-
...columnFromProps.columnDef.meta,
|
|
663
|
-
filterOperator: value,
|
|
664
|
-
};
|
|
665
668
|
};
|
|
666
669
|
|
|
667
670
|
return (
|
|
@@ -5,7 +5,7 @@ import { AccessDenied } from "@/components/access-control/access-denied";
|
|
|
5
5
|
import { CanAccess } from "@/components/access-control/can-access";
|
|
6
6
|
import { UserCreate } from "./create";
|
|
7
7
|
import { UserEdit } from "./edit";
|
|
8
|
-
import {
|
|
8
|
+
import { UserList } from "./list";
|
|
9
9
|
import { RoleDetailRoute } from "./role-detail";
|
|
10
10
|
import { userRoutes } from "./routes";
|
|
11
11
|
import { UserShow } from "./show";
|
|
@@ -14,7 +14,11 @@ export const usersExampleRoutes = defineAppRoutes([
|
|
|
14
14
|
{
|
|
15
15
|
name: "users",
|
|
16
16
|
path: userRoutes.list,
|
|
17
|
-
element:
|
|
17
|
+
element: (
|
|
18
|
+
<CanAccess resource="users" action="list" fallback={<AccessDenied />}>
|
|
19
|
+
<UserList />
|
|
20
|
+
</CanAccess>
|
|
21
|
+
),
|
|
18
22
|
resource: {
|
|
19
23
|
meta: {
|
|
20
24
|
label: "Users",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-Cc6awvdg.js";import{A as i}from"./auto-redirect-provider-ja-vFPaF.js";import{i as t}from"./use-wecom-sign-in-dIqMtcN9.js";function n({children:e}){const o=t();return r.jsx(i,{resource:"wecom",action:"checkLogin",enabled:o,query:{isWeComBrowser:o},children:e})}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./index-Cc6awvdg.js";import{A as t}from"./auto-redirect-provider-ja-vFPaF.js";function c({children:r}){return e.jsx(t,{resource:"saml",action:"checkRedirect",children:r})}export{c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./index-Cc6awvdg.js";import{A as t}from"./auto-redirect-provider-ja-vFPaF.js";function c({children:r}){return e.jsx(t,{resource:"oidc",action:"checkRedirect",children:r})}export{c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as t,N as c,as as m,at as o}from"./echarts-runtime-Ce_z2eX_.js";function S(e,a,n){a=t(a)&&{coordDimensions:a}||c({encodeDefine:e.getEncode()},a);var r=e.getSource(),s=m(r,a).dimensions,i=new o(s,e);return i.initData(r,n),i}export{S as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Cc6awvdg.js";import{P as p}from"./prompt-output-B4h3uLWf.js";function x({title:r,description:t,prompt:m}){return o.jsx(p,{title:r,description:t,prompt:m,promptClassName:"max-h-[620px]"})}export{x as P};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CanAccess } from "@/components/access-control/can-access";
|
|
2
|
-
import { Outlet } from "react-router";
|
|
3
|
-
|
|
4
|
-
import { AccessDenied } from "@/components/access-control/access-denied";
|
|
5
|
-
import { UserList } from "./list";
|
|
6
|
-
|
|
7
|
-
export function UserResourceLayout() {
|
|
8
|
-
return (
|
|
9
|
-
<>
|
|
10
|
-
<CanAccess resource="users" action="list" fallback={<AccessDenied />}>
|
|
11
|
-
<UserList />
|
|
12
|
-
</CanAccess>
|
|
13
|
-
<Outlet />
|
|
14
|
-
</>
|
|
15
|
-
);
|
|
16
|
-
}
|