graview 0.1.35 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/{chunk.3C4RJIJU.js → chunk.272ZJXQP.js} +1 -1
- package/dist/preview/{chunk.H243UV3Z.js → chunk.27TLAVRR.js} +1 -1
- package/dist/preview/{chunk.GF7LA4QG.js → chunk.2A2DLMT3.js} +1 -1
- package/dist/preview/{chunk.FBY5IUGU.js → chunk.2B4WVCVV.js} +1 -1
- package/dist/preview/{chunk.ZE4CTZQ3.js → chunk.3PT55HXT.js} +1 -1
- package/dist/preview/{chunk.DPP7ITTU.js → chunk.3SM2CHKF.js} +1 -1
- package/dist/preview/{chunk.VWHMYPLL.js → chunk.3ZIOAPI5.js} +1 -1
- package/dist/preview/{chunk.5B7NWF7C.js → chunk.42WJ6VJZ.js} +1 -1
- package/dist/preview/{chunk.RIW7SQH4.js → chunk.4B73P2WA.js} +1 -1
- package/dist/preview/{chunk.JMQ6YLQX.js → chunk.4GXXD4NG.js} +1 -1
- package/dist/preview/chunk.4Q56V7GS.js +1 -0
- package/dist/preview/{chunk.SBBNIYVB.js → chunk.4STIUIT6.js} +1 -1
- package/dist/preview/chunk.53IKY7UP.js +1 -0
- package/dist/preview/chunk.56BPXB6E.js +1 -0
- package/dist/preview/{chunk.LRRVBM4F.js → chunk.5PU3RWYY.js} +2 -2
- package/dist/preview/chunk.64MJ5FRL.js +1 -0
- package/dist/preview/{chunk.UWIYKGYK.js → chunk.6II4BONS.js} +1 -1
- package/dist/preview/{chunk.VMGWYCXU.js → chunk.6KMXLUOS.js} +1 -1
- package/dist/preview/{chunk.AINNENYD.js → chunk.6QDFBCV4.js} +2 -2
- package/dist/preview/{chunk.IHFNLKXV.js → chunk.6W7J76TK.js} +1 -1
- package/dist/preview/{chunk.5VB7DJTL.js → chunk.6ZZZBDEG.js} +1 -1
- package/dist/preview/{chunk.CHJZ7LST.js → chunk.7CO7S6QM.js} +1 -1
- package/dist/preview/chunk.7G3B5QPH.js +1 -0
- package/dist/preview/chunk.7TBSVQSH.js +1 -0
- package/dist/preview/{chunk.QVKKXMNK.js → chunk.7YQYWOZR.js} +1 -1
- package/dist/preview/{chunk.4K5QCJFH.js → chunk.AAZFVCSP.js} +1 -1
- package/dist/preview/{chunk.ZSW74NVJ.js → chunk.ACEYGWMO.js} +1 -1
- package/dist/preview/{chunk.TIBZZ2WY.js → chunk.ACXA55GW.js} +1 -1
- package/dist/preview/{chunk.Y5Z4ZDTO.js → chunk.BZ5VLPKB.js} +2 -2
- package/dist/preview/chunk.CE3NOADH.js +1 -0
- package/dist/preview/chunk.CNJENUPC.js +1 -0
- package/dist/preview/{chunk.DMNXYMLC.js → chunk.CRPT3ZT3.js} +1 -1
- package/dist/preview/{chunk.2OBIO5Y6.js → chunk.CUCNT7MG.js} +1 -1
- package/dist/preview/{chunk.6J7DR7XQ.js → chunk.D6RDTUX3.js} +1 -1
- package/dist/preview/{chunk.UHQD3NTK.js → chunk.DANDYIB5.js} +1 -1
- package/dist/preview/{chunk.OEDCAHII.js → chunk.DSP62QYK.js} +1 -1
- package/dist/preview/chunk.E77K6KBX.js +1 -0
- package/dist/preview/{chunk.HPD5ZDZH.js → chunk.EBLKEQ7O.js} +1 -1
- package/dist/preview/{chunk.EQWOQOFJ.js → chunk.EDSPYKR4.js} +1 -1
- package/dist/preview/chunk.EQIGKXIG.js +1 -0
- package/dist/preview/{chunk.ZHXX22AT.js → chunk.ER5ILWKY.js} +2 -2
- package/dist/preview/{chunk.KYH4QIVI.js → chunk.ET76FISZ.js} +1 -1
- package/dist/preview/{chunk.X7W27IRI.js → chunk.F5BCCGFK.js} +5 -5
- package/dist/preview/{chunk.OZ5KJLA2.js → chunk.FERBNBDE.js} +1 -1
- package/dist/preview/{chunk.FUQVNXLB.js → chunk.FQKH67BP.js} +1 -1
- package/dist/preview/{chunk.577PGFUT.js → chunk.FUR4IHWG.js} +1 -1
- package/dist/preview/chunk.FWBQVPMI.js +1 -0
- package/dist/preview/{chunk.3QXHII5W.js → chunk.GOCUBIRW.js} +1 -1
- package/dist/preview/{chunk.A3F7MFDR.js → chunk.GUDKPK42.js} +1 -1
- package/dist/preview/{chunk.QVUL2FSI.js → chunk.GXLAZGYT.js} +1 -1
- package/dist/preview/{chunk.Z7ZCR4LN.js → chunk.GZLYTPE7.js} +1 -1
- package/dist/preview/{chunk.EAM4NAQH.js → chunk.H4T56OXM.js} +1 -1
- package/dist/preview/{chunk.SECORXDP.js → chunk.HPX3F7XX.js} +1 -1
- package/dist/preview/{chunk.PJ2DF6C7.js → chunk.HZPTBPJY.js} +1 -1
- package/dist/preview/{chunk.PW7YH6JV.js → chunk.IB32NOV5.js} +1 -1
- package/dist/preview/{chunk.FSAHO3LV.js → chunk.IMRCAU4T.js} +1 -1
- package/dist/preview/{chunk.FX6GH57T.js → chunk.ITXIFDQ7.js} +1 -1
- package/dist/preview/{chunk.LWSTEZIP.js → chunk.J3TEJBI5.js} +1 -1
- package/dist/preview/{chunk.B2KITMSD.js → chunk.JLXQ6ZLI.js} +1 -1
- package/dist/preview/{chunk.ZZTDQKM2.js → chunk.JZMA2AV7.js} +1 -1
- package/dist/preview/{chunk.FIVLFXFB.js → chunk.K5NJTE3F.js} +1 -1
- package/dist/preview/{chunk.3P4IIXIT.js → chunk.KBJG5SI2.js} +1 -1
- package/dist/preview/{chunk.3H4NVUWV.js → chunk.KU6NIMQX.js} +1 -1
- package/dist/preview/{chunk.LAF6GTBN.js → chunk.LA7535VO.js} +1 -1
- package/dist/preview/{chunk.D4WQEBWV.js → chunk.LMVCWYYG.js} +1 -1
- package/dist/preview/{chunk.2YGQVI6T.js → chunk.LNNFNJKN.js} +1 -1
- package/dist/preview/{chunk.BL6VDLAW.js → chunk.M4FQ7SSM.js} +1 -1
- package/dist/preview/{chunk.BGW7XTMH.js → chunk.MXJS67W4.js} +1 -1
- package/dist/preview/{chunk.LIIC25G6.js → chunk.NJ62C2GU.js} +1 -1
- package/dist/preview/{chunk.VZHV25JE.js → chunk.NNCTJSD3.js} +1 -1
- package/dist/preview/{chunk.GO4QBFED.js → chunk.NWYOLGQ3.js} +1 -1
- package/dist/preview/{chunk.DNDHDDM6.js → chunk.O3OALXCI.js} +2 -2
- package/dist/preview/{chunk.JLMLKDVX.js → chunk.O6ROFVFD.js} +1 -1
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.OF34OZ4V.js} +1 -1
- package/dist/preview/{chunk.GCVO6N26.js → chunk.OFJH7LDC.js} +1 -1
- package/dist/preview/{chunk.Q7TP4RFE.js → chunk.OH5BBE2B.js} +1 -1
- package/dist/preview/{chunk.PKKA6JWA.js → chunk.OREMUXB5.js} +1 -1
- package/dist/preview/{chunk.CDMV6L5I.js → chunk.OXZRGP53.js} +1 -1
- package/dist/preview/chunk.OZR5NI4J.js +1 -0
- package/dist/preview/{chunk.PPUAPAWR.js → chunk.P75TPZWT.js} +1 -1
- package/dist/preview/{chunk.QRMWFEEH.js → chunk.PWOVXARZ.js} +1 -1
- package/dist/preview/chunk.Q63RPNUS.js +1 -0
- package/dist/preview/{chunk.KWCML3BF.js → chunk.QDHUDLJB.js} +1 -1
- package/dist/preview/{chunk.4NZBMZC7.js → chunk.QEALNWWL.js} +3 -3
- package/dist/preview/{chunk.APNN6BKF.js → chunk.QLMUGC7R.js} +1 -1
- package/dist/preview/{chunk.DQ5HAB3N.js → chunk.QTITRX5Q.js} +1 -1
- package/dist/preview/{chunk.GMOTRAKJ.js → chunk.R45BF6JV.js} +1 -1
- package/dist/preview/{chunk.U5EJSTST.js → chunk.R7LRJS6B.js} +2 -2
- package/dist/preview/{chunk.2QQAOJET.js → chunk.RKHEZ6KZ.js} +1 -1
- package/dist/preview/{chunk.G2ZPQUXM.js → chunk.S6GJGTJE.js} +1 -1
- package/dist/preview/{chunk.MVN6H65Q.js → chunk.SG23JC6D.js} +1 -1
- package/dist/preview/chunk.SSRP5SBR.js +1 -0
- package/dist/preview/{chunk.FVPOSGNG.js → chunk.T2CN7UTZ.js} +2 -2
- package/dist/preview/{chunk.5FZQI2US.js → chunk.T47DLH5Z.js} +1 -1
- package/dist/preview/{chunk.RTB4MMF6.js → chunk.TGEF6TMM.js} +1 -1
- package/dist/preview/{chunk.JAPYJ53U.js → chunk.UJR3Y7MP.js} +1 -1
- package/dist/preview/{chunk.52QAIGCD.js → chunk.VHWUGSFW.js} +1 -1
- package/dist/preview/{chunk.6K2HASOH.js → chunk.W42P7NOL.js} +1 -1
- package/dist/preview/{chunk.SD33BD7A.js → chunk.WGI5G6NM.js} +1 -1
- package/dist/preview/{chunk.IX6RNGAT.js → chunk.WHTQHU3M.js} +1 -1
- package/dist/preview/{chunk.TWWFWHK3.js → chunk.WJ2TWU2I.js} +1 -1
- package/dist/preview/{chunk.GCGITEON.js → chunk.XBTZXWJX.js} +1 -1
- package/dist/preview/{chunk.747GGBPR.js → chunk.XRCGADKC.js} +1 -1
- package/dist/preview/{chunk.XSYBNUXF.js → chunk.Y3IJDWNS.js} +1 -1
- package/dist/preview/{chunk.5MCC54VM.js → chunk.YNE5QR7Q.js} +1 -1
- package/dist/preview/{chunk.5EAQDBBE.js → chunk.ZDNJK2SX.js} +1 -1
- package/dist/preview/{chunk.QU356VB2.js → chunk.ZEW2OOZ5.js} +1 -1
- package/dist/preview/chunk.ZNS3LYJU.js +1 -0
- package/dist/preview/{chunk.YT2CYCVT.js → chunk.ZSSOTIFL.js} +1 -1
- package/dist/preview/{chunk.DLT3EE4D.js → chunk.ZVMIHXVK.js} +1 -1
- package/dist/preview/{chunk.DUUARGPE.js → chunk.ZWZ5SEXT.js} +1 -1
- package/dist/preview/index.html +42 -42
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.4J75WRDG.js +0 -1
- package/dist/preview/chunk.656N5BHG.js +0 -1
- package/dist/preview/chunk.6P7P2AW7.js +0 -1
- package/dist/preview/chunk.AEHPDVLQ.js +0 -1
- package/dist/preview/chunk.DTR5I4BI.js +0 -1
- package/dist/preview/chunk.FHXXYWL3.js +0 -1
- package/dist/preview/chunk.M5HADQPP.js +0 -1
- package/dist/preview/chunk.O36ZDLWC.js +0 -1
- package/dist/preview/chunk.PQPTYNW2.js +0 -1
- package/dist/preview/chunk.RHYA742Q.js +0 -1
- package/dist/preview/chunk.TPX6AVJL.js +0 -1
- package/dist/preview/chunk.U2PYW5MS.js +0 -1
- package/dist/preview/chunk.ZFWV4JAJ.js +0 -1
- package/dist/preview/chunk.ZKXK22AH.js +0 -1
- package/dist/preview/chunk.ZQNLC33L.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./chunk.TI4OSTQV.js";import{
|
|
1
|
+
import{a as g}from"./chunk.TI4OSTQV.js";import{Eb as c,Ib as y,Ua as p}from"./chunk.F5BCCGFK.js";function h(t,i=()=>!0){let e=c(t),n=new Set(t.map(o=>o.lineage?.suggestion));return t.filter(o=>o.suggests&&!o.withheld&&!e.has(o.id)&&!n.has(o.id)).map(({id:o,batch:s,suggests:r,intent:x,author:b,lineage:d,at:O})=>{let l=new Set;return JSON.stringify(r.map(u=>u.args),(u,a)=>(typeof a=="string"&&i(a)&&l.add(a),a)),{id:o,batch:s,calls:r,intent:x,author:b,...d?{lineage:d}:{},at:O,about:[...l]}})}function S(t,i){return t.ops.length>0&&t.ops.every(e=>e.suggests!==void 0||e.undoes!==void 0&&i(e.undoes)?.suggests!==void 0)}var f=t=>JSON.stringify([t.kind,t.id??"",t.name??""]);function I(t,i=()=>{}){let e=[];for(let n of t){if(S(n,i))continue;let o=e.at(-1);if(!y(n.author)){e.push({batch:n});continue}if(o&&"digest"in o&&f(o.digest.author)===f(n.author)){let s=[...o.digest.batches,n];e[e.length-1]={digest:{author:o.digest.author,batches:s,things:m(s),at:n.at}}}else e.push({digest:{author:n.author,batches:[n],things:m([n]),at:n.at}})}return e}var m=t=>t.reduce((i,e)=>i+(e.undone?0:e.ops.length),0);function j(t,i=new Date().toISOString().slice(0,10)){let e=t.at.slice(0,10),n=e===i?"today":`on ${new Date(`${e}T12:00:00Z`).toLocaleDateString("en-US",{month:"short",day:"numeric",timeZone:"UTC"})}`;return`Tidied ${t.things===1?"one thing":`${t.things} things`} ${n}`}var A=t=>t;function v(t,i){let e=g(t),n=e?.store??t,o=i??e?.principal,s=(o!==void 0?n.seenBy(o):n).log.all();return h(s,r=>n.graph.has(r))}function w(t,i,e){let n=v(t,e).find(o=>o.id===i);if(!n)throw new p("That suggestion is no longer waiting: it was accepted or declined, or it is not one you can see.");return n}function D(t,i,e={}){let n=g(t)?.store??t,o=e.author??A(n).by,s=w(n,i,o);return n.applyAll(s.calls,{...e,author:o,lineage:{...s.lineage,suggestion:i}})}function L(t,i,e={}){let n=g(t)?.store??t,o=e.author??A(n).by,s=w(n,i,o);return n.undo(s.batch,{...e,author:o})}export{I as a,j as b,v as c,D as d,L as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as C,e as re}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{d as C,e as re}from"./chunk.ZDNJK2SX.js";import{e as ee}from"./chunk.ZSSOTIFL.js";import{b as S}from"./chunk.IMRCAU4T.js";import{m as X}from"./chunk.BZ5VLPKB.js";import{F as se,Q as Z,a as K,sa as V,wa as J,xa as Q}from"./chunk.6II4BONS.js";import{K as Y,N as M,X as U}from"./chunk.F5BCCGFK.js";import{b as D}from"./chunk.AJZBJBMO.js";var h=D(se(),1);var n=D(Z(),1),Re=9,le=40,ge=2;function de(e){let r=new Map;for(let i of e.allNodes())r.set(i.kind,(r.get(i.kind)??0)+1);return r}var ue=(e,r)=>(e.far??[]).reduce((i,a)=>i+(r.get(a)??0),0);function ce(e,r,i){if(i)return i.flatMap(s=>e.filters.filter(u=>u.key===s));let a=de(r),o=new Set(e.filters.filter(s=>s.about==="edge"&&ue(s,a)>le).map(s=>s.key));return e.filters.filter(s=>s.about==="edge"?!o.has(s.key):s.about==="via"?o.has(s.key.split(".")[0]):!0)}function pe(e,r){let i=e.filter(a=>a.about==="field"&&a.type==="choice"&&(a.options?.length??0)>0);return r?i:i.slice(0,ge)}var fe=520;function ye(e,r,i,a){let o=i.filters.find(s=>s.key===a.key);if(!o)return`${a.key}: ${a.value}`;if(o.about==="is")return a.value.charAt(0).toUpperCase()+a.value.slice(1);if(o.about==="via")return`${o.label}: ${S(e.tryDefinition(o.far?.[0]??""),o.key.split(".")[1],a.value)}`;if(o.about==="edge"){if(a.value==="*")return`${o.label}: anything`;if(a.value==="none")return`${o.label}: nothing`;let s=r.getNode(a.value);return`${o.label}: ${s?U(e.tryDefinition(s.kind),s):a.value}`}if(o.type==="date"){let[s,u]=a.value.split(":");return`${o.label} ${s} ${u?Y(u):""}`.trim()}if(o.type==="boolean")return`${o.label}: ${a.value==="true"?"yes":"no"}`;if(o.type==="number"){let s=a.value.lastIndexOf(":"),u=a.value.slice(0,Math.max(0,s));if(u==="at-most"||u==="at-least")return`${o.label}: ${u==="at-most"?"at most":"at least"} ${S(e.tryDefinition(i.kind),o.key,Number(a.value.slice(s+1)))}`}return o.type==="text"?`${o.label}: ${a.value}`:`${o.label}: ${S(e.tryDefinition(i.kind),o.key,a.value)}`}var P=e=>/^[A-Z][a-z]/.test(e)?e.charAt(0).toLowerCase()+e.slice(1):e;function me(e){return e?.type==="date"?{asc:"Earliest first",desc:"Latest first"}:e?.type==="number"?{asc:"Lowest first",desc:"Highest first"}:e?.type==="boolean"?{asc:"No first",desc:"Yes first"}:e?.type==="choice"?{asc:"In their order",desc:"In reverse order"}:{asc:"A to Z",desc:"Z to A"}}var x=Q(K(()=>(__graviewPreload(import.meta.url,["./chunk.27TLAVRR.js","./chunk.OREMUXB5.js","./chunk.ZDNJK2SX.js","./chunk.ZSSOTIFL.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.K5NJTE3F.js")))),N=x.part((e,r)=>(0,n.jsx)(e.ArrangeLists,{...r}),{what:"This list",quiet:!0}),he=x.part((e,r)=>(0,n.jsx)(e.ArrangeChips,{...r}),{what:"This list",quiet:!0}),Te=()=>x.load(),q=new Map;function Ie(e){let{schema:r,graph:i,kind:a,arrangement:o,onChange:s}=e,u=e.offers??ee(r,a),g=e.testId??"arrange",y=C(e.allow,"sort")&&u.sorts.length>1,m=C(e.allow,"group")&&u.groups.length>0,F=C(e.allow,"filter")?ce(u,i,e.filters):[],L=e.chips?pe(F,e.filters):[],H=F.filter(t=>!L.includes(t)),G=H.length>0,_=e.query!==!1&&e.allow!==!1,w=we(e.noun,e.kept),v=e.past&&e.past.count>0?e.past:null;if(!y&&!m&&!G&&!_&&!w&&!v)return null;let z=t=>JSON.stringify(re(t)),O=`${g}|${a}`,p={current:q.get(O)??{words:new Set,latest:null,at:0}};q.set(O,p.current),p.current.latest&&Date.now()-p.current.at>1500&&!p.current.words.has(z(o))&&(p.current={words:new Set,latest:null,at:0},q.set(O,p.current));let d=p.current.latest??o,b=t=>{let l={...p.current.latest??o,...t};for(let c of Object.keys(l))l[c]===void 0&&delete l[c];p.current.latest=l,p.current.at=Date.now(),p.current.words.add(z(l)),s(l)},f=d.filter??[],R=t=>{let l=f.filter((c,I)=>I!==t);b({filter:l.length>0?l:void 0})},A=t=>f.some(l=>l.key===t.key&&l.value===t.value),te=t=>A(t)?R(f.findIndex(l=>l.key===t.key&&l.value===t.value)):b({filter:[...f,t]}),T=d.sort?u.sorts.find(t=>t.key===d.sort.by):void 0,j=d.group?u.groups.find(t=>t.key===d.group.by):void 0,ne=me(T),k={schema:r,graph:i,offers:{...u,filters:H},arrangement:d,set:b,toggle:te,has:A,testId:g},ae=(t,l)=>A({key:t,value:l})?R(f.findIndex(c=>c.key===t&&c.value===l)):b({filter:[...f.filter(c=>c.key!==t),{key:t,value:l}]}),oe=d.sort?(0,n.jsxs)(n.Fragment,{children:["Sorted by ",P(T?.label??d.sort.by),(0,n.jsx)("span",{"aria-hidden":"true",children:d.sort.direction==="desc"?" \u2193":" \u2191"})]}):"Sort",ie=d.group?.bucket&&j?.buckets?`, a ${d.group.bucket} each`:"",B=d.group?`Grouped by ${P(j?.label??d.group.by)}${ie}`:"Group";return(0,n.jsxs)("div",{"data-testid":`${g}-bar`,role:"group","aria-label":"Arrange",className:"graview-arrange",style:e.style,onPointerEnter:x.prefetch,onFocus:x.prefetch,children:[(0,n.jsx)("style",{children:xe}),(0,n.jsxs)("div",{className:"graview-arrange-line",children:[w?(0,n.jsxs)("span",{className:"graview-arrange-count","data-testid":`${g}-count`,children:[w.kept?(0,n.jsx)("span",{"data-testid":`${g}-kept`,children:w.kept}):null,w.words]}):null,v?(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":`${g}-past`,title:`${M(v.count)} more behind the horizon \u2014 press to widen the view to the past`,onClick:t=>{let l=t.currentTarget.closest("[data-graview-view]"),c=t.currentTarget;v.widen();let I=0,W=()=>{if(document.activeElement!==c&&document.activeElement!==document.body&&c.isConnected)return;let $=l?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if($&&$!==c&&$.isConnected)return $.focus({preventScroll:!0});++I<120&&requestAnimationFrame(W)};requestAnimationFrame(W)},children:["+",M(v.count)," past"]}):null,f.map((t,l)=>{let c=ye(r,i,u,t);return(0,n.jsxs)("span",{className:"graview-arrange-token","data-testid":`${g}-condition`,children:[c,(0,n.jsx)("button",{type:"button","aria-label":`Remove: ${c}`,title:"Remove",onClick:()=>R(l),children:"\xD7"})]},`${t.key}:${t.value}`)}),y?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-sort`,value:d.sort?.by??"",set:d.sort!==void 0,label:"Sort",name:d.sort?`Sorted by ${P(T?.label??d.sort.by)}, ${ne[d.sort.direction].toLowerCase()}`:"Sort",list:t=>(0,n.jsx)(N,{which:"sort",done:t,...k}),children:oe})}):null,m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-group`,value:d.group?.by??"",set:d.group!==void 0,label:"Group",name:B,list:t=>(0,n.jsx)(N,{which:"group",done:t,...k}),children:B})}):null,G?(0,n.jsx)("span",{className:"graview-arrange-part",children:(0,n.jsx)(E,{testId:`${g}-add`,value:"",set:!1,label:"Filter",name:f.length>0?`Filter \u2014 ${f.length} on`:"Filter",list:t=>(0,n.jsx)(N,{which:"filter",done:t,...k}),children:"Filter"})}):null,y||m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-all",children:(0,n.jsx)(E,{testId:`${g}-all`,value:"",set:!1,label:"Arrange",name:"Arrange: sort and group",list:t=>(0,n.jsx)(N,{which:"all",done:t,parts:{sort:y,group:m,filter:!1},...k}),children:"Arrange"})}):null,_?(0,n.jsxs)("label",{className:"graview-arrange-words-at",children:[(0,n.jsx)("span",{style:X,children:"Find"}),(0,n.jsx)("input",{type:"search",className:"graview-arrange-words","data-testid":`${g}-query`,value:d.query??"",placeholder:"Find\u2026",onChange:t=>b({query:t.target.value.length>0?t.target.value:void 0})})]}):null,L.length>0&&e.chips?(0,n.jsx)(h.Suspense,{fallback:null,children:(0,n.jsx)(he,{offers:L,chips:e.chips,schema:r,graph:i,kind:a,arrangement:d,has:A,choose:ae,testId:g})}):null]})]})}function we(e,r){if(!r)return null;let i=r.shown!==r.of;if(!e)return i?{words:"",kept:`${r.shown} of ${r.of}`}:null;let a=r.of===1?e.one:e.many;return i?{words:` ${a}`,kept:`${r.shown} of ${r.of}`}:{words:`${r.of} ${a}`}}function E({testId:e,value:r,set:i,label:a,name:o,list:s,children:u}){let g=J("arrange",{align:"start"}),y=(0,h.useRef)(null);return(0,h.useEffect)(()=>{g.open&&y.current?.querySelector('[aria-pressed="true"]')?.focus({preventScroll:!0})},[g.open]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":e,"data-set":i?"":void 0,value:r,"aria-label":o,...g.trigger,onClick:g.toggle,children:[u,(0,n.jsx)(be,{})]}),g.open?(0,n.jsx)("div",{...g.pane,ref:m=>{g.pane.ref(m),y.current=m},role:"group","aria-label":a,"data-testid":"arrange-list","data-arrange":e,className:"graview-arrange-list",style:V,onKeyDown:ve,children:s(()=>g.setOpen(!1))}):null]})}function ve(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let r=[...e.currentTarget.querySelectorAll("button:not([disabled]), input")];if(r.length===0)return;let i=r.indexOf(document.activeElement);if(document.activeElement instanceof HTMLInputElement&&document.activeElement.type==="date"&&(e.key==="ArrowUp"||e.key==="ArrowDown"))return;e.preventDefault();let a=e.key==="Home"?0:e.key==="End"?r.length-1:e.key==="ArrowDown"?(i+1)%r.length:(i-1+r.length)%r.length;r[a].focus()}function be(){return(0,n.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto",opacity:.7},children:(0,n.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var xe=`
|
|
2
2
|
.graview-arrange{container-type:inline-size;box-sizing:border-box;width:100%;min-width:0;max-width:100%}
|
|
3
3
|
.graview-arrange-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0;font-size:.875rem;line-height:1.35;color:var(--graview-ink-muted)}
|
|
4
4
|
.graview-arrange-count{margin-right:2px;color:var(--graview-ink-muted)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as y}from"./chunk.
|
|
1
|
+
import{m as y}from"./chunk.BZ5VLPKB.js";import{F as N,Q as u,S as f}from"./chunk.6II4BONS.js";import{b as g}from"./chunk.AJZBJBMO.js";var p=g(N(),1);var n=g(u(),1);var R={default:{background:"var(--graview-panel, #ffffff)",color:"var(--graview-ink, #1a1a1a)"},muted:{background:"var(--graview-panel-muted, #f7f5f1)",color:"var(--graview-ink, #1a1a1a)"},warning:{background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)"}},T={color:"var(--graview-ink-muted, #55514a)"},C={color:"var(--graview-ink-faint, #625d55)"};function H(e){let[l,a]=(0,p.useState)(z);return(0,p.useEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let t=()=>{let i=W(r,parseFloat(getComputedStyle(r).paddingBottom)||0);a(s=>s.overflowing===i.overflowing&&s.above===i.above&&s.below===i.below?s:i)};t();let d=new ResizeObserver(t);d.observe(r);for(let i of r.children)d.observe(i);return r.addEventListener("scroll",t,{passive:!0}),()=>{d.disconnect(),r.removeEventListener("scroll",t)}}),l}var z={overflowing:!1,above:!1,below:!1};function W(e,l=0){let a=e.scrollHeight>e.clientHeight+1,r=e.scrollWidth>e.clientWidth+1;return{overflowing:a||r,above:a&&e.scrollTop>1,below:a&&e.scrollTop+e.clientHeight<e.scrollHeight-l-1}}var A=(0,p.createContext)(null),I=(0,p.createContext)(null);function O({level:e,said:l=!0,style:a,children:r}){if(e===void 0)return(0,n.jsx)("strong",{style:a,...l?{}:{"aria-hidden":!0},children:r});let t=`h${e}`;return(0,n.jsx)(t,{style:{margin:0,...a},children:r})}function E({title:e,subtitle:l,meta:a,selected:r,tone:t="default",children:d,style:i,fit:s=!1,variant:h,heading:w}){let c=(0,p.useRef)(null),{overflowing:b,above:x,below:S}=H(c),P=f(),o=(h??(P==="fullscreen"?"page":"card"))==="page",k=(0,p.useContext)(A),v=(0,p.useContext)(I);return(0,n.jsxs)("div",{"data-graview-primitive":"panel","data-graview-variant":o?"page":"card","data-selected":r||void 0,style:{display:"flex",flexDirection:"column",gap:o?12:"var(--graview-gap, 7px)",height:o||s?"auto":"100%",maxHeight:o?"none":"100%",padding:o?0:"var(--graview-pad, 15px)",boxSizing:"border-box",borderRadius:o?0:"var(--graview-radius, 12px)",border:o?"none":`1px solid ${r?"var(--graview-accent, #2f6f5e)":"var(--graview-edge, #e4e0d8)"}`,boxShadow:o?"none":r?"0 0 0 1px var(--graview-accent-dim), var(--graview-lift-low)":"var(--graview-lift-low)",overflow:o?"visible":"hidden",...R[t],...o?{background:"transparent"}:{},...i},children:[t==="warning"?(0,n.jsx)("span",{"data-graview-broken":"",style:y,children:"Implicated in a problem."}):null,e===void 0||e===k?null:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:8,minWidth:0},children:[t==="warning"?(0,n.jsx)("span",{"aria-hidden":"true",title:"Implicated in a problem",style:{color:"var(--graview-warn)",flex:"0 0 auto"},children:"\u26A0"}):null,(0,n.jsx)(O,{level:w,said:v===null||e!==v,style:{fontFamily:"var(--graview-font-display, inherit)",fontSize:o?"1.5625rem":"0.9375rem",lineHeight:o?1.15:1.25,fontWeight:o?600:560,letterSpacing:o?"-0.012em":"0.005em",minWidth:0,overflowWrap:"anywhere"},children:e}),a===void 0?null:(0,n.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",letterSpacing:"0.08em",textTransform:"uppercase",minWidth:0,overflowWrap:"anywhere",...C},children:a})]}),l===void 0?null:(0,n.jsx)("div",{style:{fontSize:o?"0.90625rem":"0.8125rem",lineHeight:1.5,...T},children:l}),(0,n.jsx)("div",{ref:c,className:o?void 0:"graview-scroll",...b&&!o?{tabIndex:0,role:"region",...typeof e=="string"?{"aria-label":e}:{}}:{},style:{display:"flex",flexDirection:"column",gap:o?22:"var(--graview-gap, 7px)",flex:"1 1 auto",...o?{overflow:"visible"}:{marginBottom:"calc(-1 * var(--graview-pad, 15px))",paddingBottom:"var(--graview-pad, 15px)"}},"data-graview-more-above":x&&!o?"":void 0,"data-graview-more-below":S&&!o?"":void 0,children:d})]})}function m({label:e,hue:l,selected:a,title:r,pickId:t,emphasis:d}){let i=typeof e=="string"?e:void 0,s=l===void 0?void 0:Math.round(l);return(0,n.jsxs)("span",{"data-graview-primitive":"chip","data-selected":a||void 0,"data-graview-pick":t,"data-graview-emphasis":d,title:r??i,style:{cursor:t?"pointer":void 0,display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",maxWidth:"min(28ch, 100%)",overflow:"hidden",letterSpacing:"0.01em",border:`1px solid ${a?"var(--graview-accent)":s===void 0?"var(--graview-edge)":`hsl(${s} 55% var(--graview-tint-lightness) / 0.45)`}`,background:s===void 0?"var(--graview-panel-muted)":`hsl(${s} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * 0.65))`,color:"var(--graview-ink, #1a1a1a)",boxShadow:a?"0 0 14px -4px var(--graview-accent)":void 0},children:[s===void 0?null:(0,n.jsx)("span",{"aria-hidden":"true",style:{width:9,height:6,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",flex:"0 0 auto",marginRight:6,background:`hsl(${s} 55% var(--graview-tint-lightness) / 0.9)`}}),(0,n.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]})}function L({items:e,max:l=8,selectedIds:a=[],pick:r=!1}){let t=e.slice(0,l),d=e.length-t.length;return(0,n.jsxs)("div",{"data-graview-primitive":"roster",style:{display:"flex",flexWrap:"wrap",gap:6,alignContent:"flex-start"},children:[t.map(i=>(0,n.jsx)(m,{label:i.label,...i.hue===void 0?{}:{hue:i.hue},...r?{pickId:i.id}:{},...i.emphasis===void 0?{}:{emphasis:i.emphasis},selected:a.includes(i.id)},i.id)),d>0?(0,n.jsx)(m,{label:`+${d} more`}):null]})}function F({label:e,count:l,items:a,onExpand:r,flagged:t,problems:d}){return(0,n.jsx)(E,{title:e,meta:d?(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[d,(0,n.jsx)("span",{children:l})]}):l,tone:t?"warning":"muted",style:r?{cursor:"zoom-in"}:void 0,children:a&&a.length>0?(0,n.jsx)(L,{items:a,max:6,pick:!0}):null})}export{A as a,I as b,E as c,m as d,L as e,F as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as F,l as b}from"./chunk.
|
|
1
|
+
import{g as F,l as b}from"./chunk.AAZFVCSP.js";function L(t,o){return o===1&&["every","some","sum","min","max","sort"].includes(t.fn)}function M(t){let o=new Set,e=new Set,r=[],s=[],a=new Set(F),i=(l,f)=>{switch(l.t){case"lit":return;case"ident":f||o.add(l.name);return;case"list":l.items.forEach(c=>i(c,f));return;case"member":i(l.object,f);return;case"unary":i(l.operand,f);return;case"binary":i(l.left,f),i(l.right,f);return;case"where":i(l.set,f),i(l.filter,!0);return;case"call":{e.add(l.fn);let c=(l.fn==="out"||l.fn==="in")&&l.args.length===2?l.args[1]:l.args[0],m=c?.t==="lit"&&typeof c.value=="string"?c.value:void 0;l.fn==="all"&&m&&r.push(m),(l.fn==="out"||l.fn==="in")&&m&&s.push(m),l.args.forEach((v,k)=>i(v,f||L(l,k)));return}}};return i(t,!1),{names:o,functions:e,unknownFunctions:[...e].filter(l=>!a.has(l)),sweeps:r,edges:s}}var p=class extends Error{constructor(e,r,s){super(`${e} (at character ${r+1} of "${s}")`);this.sentence=e;this.at=r;this.source=s}},D=["||","&&","==","!=","<=",">=","<",">","!","|","&","+","-","*","/","%","(",")","[","]",",","."],j={and:"&&",or:"||",not:"!"},T=2e3;function H(t){let o=[],e=0;for(;e<t.length;){let r=t[e];if(r===" "||r===" "||r===`
|
|
2
2
|
`||r==="\r"){e++;continue}if(r>="0"&&r<="9"){let a=e;for(;e<t.length&&/[0-9.]/.test(t[e]);)e++;let i=t.slice(a,e),l=Number(i);if(!Number.isFinite(l)||i.split(".").length>2)throw new p(`"${i}" is not a number`,a,t);o.push({k:"num",v:l,at:a});continue}if(r==="'"||r==='"'){let a=e++,i="";for(;e<t.length&&t[e]!==r;)t[e]==="\\"&&e+1<t.length&&e++,i+=t[e++];if(e>=t.length)throw new p("a quoted word is never closed",a,t);e++,o.push({k:"str",v:i,at:a});continue}if(/[A-Za-z_]/.test(r)){let a=e;for(;e<t.length&&/[A-Za-z0-9_]/.test(t[e]);)e++;let i=t.slice(a,e),l=Object.hasOwn(j,i)?j[i]:void 0;o.push(l?{k:"op",v:l,at:a}:{k:"id",v:i,at:a});continue}let s=D.find(a=>t.startsWith(a,e));if(!s)throw new p(`"${r}" is not part of the rule language`,e,t);o.push({k:"op",v:s,at:e}),e+=s.length}return o.push({k:"end",at:t.length}),o}function w(t){if(t.length>T)throw new p(`an expression may be at most ${T} characters`,0,t.slice(0,40));let o=H(t),e=0,r=()=>o[e],s=n=>{let d=r();return d.k==="op"&&d.v===n},a=n=>{let d=r();return d.k==="id"&&d.v===n},i=(n,d)=>{if(!s(n))throw new p(`expected ${d}`,r().at,t);e++},l=0,f=(n,d)=>{if(++l>64)throw new p("the expression nests too deeply",n,t);try{return d()}finally{l--}},c=(n,d)=>()=>{let g=d();for(;;){let y=r(),S=y.k==="op"?n.find(q=>q===y.v):y.k==="id"&&y.v==="in"&&n.includes("in")?"in":void 0;if(!S)return g;e++,g={t:"binary",op:S,left:g,right:d(),at:y.at}}},m=()=>{let n=r();if(n.k==="num")return e++,{t:"lit",value:n.v,at:n.at};if(n.k==="str")return e++,{t:"lit",value:n.v,at:n.at};if(n.k==="id"){if(e++,n.v==="true"||n.v==="false")return{t:"lit",value:n.v==="true",at:n.at};if(n.v==="null")return{t:"lit",value:null,at:n.at};if(s("(")){e++;let d=[];if(!s(")"))for(;;){if(d.push(h()),s(",")){e++;continue}break}return i(")",`")" to close ${n.v}(\u2026)`),{t:"call",fn:n.v,args:d,at:n.at}}return{t:"ident",name:n.v,at:n.at}}if(n.k==="op"&&n.v==="("){e++;let d=f(n.at,h);return i(")",'a ")"'),d}if(n.k==="op"&&n.v==="["){e++;let d=[];if(!s("]"))for(;;){if(d.push(h()),s(",")){e++;continue}break}return i("]",'a "]" to close the list'),{t:"list",items:d,at:n.at}}throw n.k==="end"?new p("the expression ends too soon",n.at,t):new p(`"${n.k==="op"?n.v:""}" cannot start a value here`,n.at,t)},v=()=>{let n=m();for(;;){if(s(".")){let d=r();e++;let g=r();if(g.k!=="id")throw new p('expected a field name after "."',g.at,t);e++,n={t:"member",object:n,name:g.v,at:d.at};continue}if(a("where")){let d=r().at;e++,n={t:"where",set:n,filter:f(d,h),at:d};continue}return n}},k=()=>{let n=r();return n.k==="op"&&(n.v==="!"||n.v==="-")?(e++,{t:"unary",op:n.v,operand:f(n.at,k),at:n.at}):v()},P=c(["*","/","%"],k),z=c(["+","-"],P),N=c(["&"],z),R=c(["|"],N),_=()=>{let n=R(),d=r(),g=d.k==="op"&&["==","!=","<","<=",">",">="].includes(d.v)?d.v:d.k==="id"&&d.v==="in"?"in":void 0;return g?(e++,{t:"binary",op:g,left:n,right:R(),at:d.at}):n},O=()=>{let n=r();return n.k==="op"&&n.v==="!"?(e++,{t:"unary",op:"!",operand:f(n.at,O),at:n.at}):_()},B=c(["&&"],O),I=c(["||"],B);function h(){return I()}let K=h();if(r().k!=="end")throw new p("there is more after the end of the expression",r().at,t);return K}function E(t){let o,e=-1,r=0;for(let s=0;s<t.length;s++){let a=t[s];if(o){a==="\\"?s++:a===o&&(o=void 0);continue}a==="'"||a==='"'?o=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:a==="|"&&r===0&&(t[s+1]==="|"?s++:e=s)}if(e>0&&t.slice(e+1).trim()===x){let s=E(t.slice(0,e));if(s>=0)return s}return e}var x="capital",$=/\s*(?:'((?:[^'\\]|\\.)*)'|"((?:[^"\\]|\\.)*)")\s*(,|$)/y;function U(t){let o=E(t);if(o>=0){if(t.slice(o+1).trim()!==x)throw new u('only "capital" may follow another formatter, like {n | words | capital}');let e=t.slice(0,o);if(e.trim()===x)throw new u('"capital" is said once');return{...C(e),capital:!0}}return t.trim()===x?{args:[],capital:!0}:C(t)}function C(t){let o=t.indexOf(":"),e=(o>=0?t.slice(0,o):t).trim();if(!b.includes(e))throw new u(`"${e}" is not a formatter; use one of ${[...b,x].join(", ")}`);let r=[];if(o>=0&&e==="excerpt"){let s=t.slice(o+1).trim();if(!/^\d+$/.test(s)||Number(s)<20||Number(s)>1e3)throw new u("excerpt is told at most how many characters, 20 to 1000: {summary | excerpt: 80}");r.push(s)}else if(o>=0){let s=t.slice(o+1),a=0;for(;a<s.length;){$.lastIndex=a;let i=$.exec(s);if(!i)throw new u(`"${e}" is told quoted words, like ${e}: 'offer'`);if(r.push((i[1]??i[2]??"").replace(/\\(.)/g,"$1")),a=$.lastIndex,i[3]==="")break}}if(e==="plural"&&(r.length<1||r.length>2))throw new u("plural is told its noun, like {count | plural: 'offer'}, and its plural where English does not make it: plural: 'person', 'people'");if(e!=="plural"&&e!=="excerpt"&&r.length>0)throw new u(`"${e}" takes nothing after it`);return{format:e,args:r}}var u=class extends Error{constructor(e){super(e);this.sentence=e}};function Y(t){let o=[],e=0;for(;e<t.length;){let r=t.indexOf("{",e);if(r<0){o.push({text:t.slice(e)});break}r>e&&o.push({text:t.slice(e,r)});let s=t.indexOf("}",r);if(s<0)throw new u(`a "{" at character ${r+1} is never closed`);let a=t.slice(r+1,s),i=E(a),l=(i>=0?a.slice(0,i):a).trim(),f=i>=0?U(a.slice(i+1)):void 0,c=E(l);if(c>=0&&b.includes(l.slice(c+1).split(":")[0].trim()))throw new u('only "capital" may follow another formatter, like {n | words | capital}');o.push({expr:w(l),source:l,...f?.format?{format:f.format}:{},...f&&f.args.length>0?{formatArgs:f.args}:{},...f?.capital?{capital:!0}:{}}),e=s+1}return o}function A(t){let o=new Map;for(let[e,r]of Object.entries(t?.computed??{}))o.set(e,typeof r=="string"?{expr:r}:r);return o}function re(t){let o=A(t);if(o.size===0)return;let e=new Map;for(let[r,s]of o)try{e.set(r,w(s.expr))}catch(a){if(!(a instanceof p))throw a}return e}function Z(t,o,e=new Set){let r=A(t).get(o);if(!r||e.has(o))return!1;let s;try{s=w(r.expr)}catch{return!1}let a=M(s);if(a.edges.length>0||a.sweeps.length>0||[...a.functions].some(c=>c==="out"||c==="in"||c==="all"))return!1;let i=t.fields,l=c=>i instanceof Set?i.has(c):Object.hasOwn(i,c),f=new Set([...e,o]);return[...a.names].every(c=>l(c)||Z(t,c,f))}export{M as a,p as b,w as c,u as d,Y as e,A as f,re as g,Z as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,d as J}from"./chunk.
|
|
1
|
+
import{c as b,d as J}from"./chunk.GZLYTPE7.js";import{a as O,f as q}from"./chunk.IMRCAU4T.js";import{Ab as P,B as m,Bb as w,Fa as j,Ga as A,Qa as v,ab as D,bb as L,cb as N,ic as Z,jc as k,ka as R,na as x,ua as S,wb as M}from"./chunk.F5BCCGFK.js";var E=n=>n.safeParse?.(void 0).success??!1,T=n=>b(n).shape,F=n=>{let s=b(n);if(m(s)?.type!=="literal")return;let e=m(s)?.values;return e&&e.length===1&&typeof e[0]=="string"?e[0]:void 0};function g(n,s){let e=E(s),o=b(s),r=m(o)?.type,l=M(s);if(l)return{control:"node",name:n,optional:e,kinds:l};let y=S(s);if(y)return{control:"linked",name:n,optional:e,relation:y};if(A(s)){let a=j(n);return{control:"repeat",name:n,optional:e,...a?{of:a}:{}}}if(r==="boolean")return{control:"boolean",name:n,optional:e};let p=R(o);if(p)return{control:"file",name:n,optional:e,...p==="image"?{image:!0}:{}};if(r==="object"){let a=o.shape??{};return{control:"group",name:n,optional:e,fields:Object.entries(a).map(([c,d])=>g(c,d))}}if(r==="union"){let a=m(o)?.options??[],c=a.map(t=>T(t));if(c.every(t=>t!==void 0)){let t=Object.keys(c[0]??{}).find(f=>c.every(u=>F(u?.[f])!==void 0));if(t)return{control:"variant",name:n,optional:e,tag:t,options:a.map((f,u)=>({value:F(c[u]?.[t])??"",fields:Object.entries(c[u]??{}).filter(([h])=>h!==t).map(([h,z])=>g(h,z))}))}}let d=a.map(t=>F(t));return d.every(t=>t!==void 0)?{control:"choice",name:n,optional:e,options:d}:{control:"opaque",name:n,optional:e}}if(r==="array"){let a=m(o)?.element;return a!==void 0?{control:"list",name:n,optional:e,item:g(n,a)}:{control:"opaque",name:n,optional:e}}let i=J(s);return i.type==="text"?{control:"text",name:n,optional:e,...i.long?{long:!0}:{},...x(o)?{app:!0}:{},...O(o)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:e,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:e,...i.time?{time:!0}:{},...i.instant?{instant:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:e,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step},...i.amount?{amount:i.amount}:{}}:i.type==="choice"?{control:"choice",name:n,optional:e,options:i.options}:{control:"opaque",name:n,optional:e}}function B(n){let s=n.shape;return s?Object.entries(s).map(([e,o])=>g(e,o)):[]}function K(n,s){let e={...s};for(let o of n){let r=s[o.name];r===void 0&&!o.optional&&(o.control==="list"||o.control==="boolean")&&(e[o.name]=o.control==="list"?[]:!1),o.control==="text"&&o.holds&&typeof r=="string"&&(e[o.name]=r.trim()===""?void 0:o.holds==="duration"?q(r)??r:r.trim()),o.control==="group"&&r!==void 0&&typeof r=="object"&&r!==null&&(e[o.name]=K(o.fields,r))}return e}function C(n,s,e){let o=n.derived?.act==="edit"&&n.subject?e[n.subject.arg]:void 0,r=typeof o=="string"?s.getNode(o):void 0;return r?Object.fromEntries((n.writes??[]).filter(l=>r[l]!==void 0&&r[l]!==null).map(l=>[l,r[l]])):{}}function I(n,s){return Object.fromEntries(Object.entries(n).filter(([e,o])=>!Object.hasOwn(s,e)||JSON.stringify(o)!==JSON.stringify(s[e])))}function _(n,s,e,o){let r=Z.keptFrom?.(n,s),l=new Set;if(!r)return l;let y=Object.keys(e.input.shape??{});for(let c of e.creates??[]){let d=r({id:"\0new",kind:c});for(let t of y)d?.(t)&&l.add(t)}let p=o===void 0?void 0:n.graph.getNode(o),i=p&&n.schema.tryDefinition(p.kind),a=p&&r(p);if(i&&a)for(let c of w(e,i))a(c)&&y.includes(c)&&l.add(c);return l}function dn(n,s,e,o){let r=new Set,l=s?.sees??[];if(L(e)||!l.some(k))return r;let y=D(e),p=(d,t)=>{let f=l.filter(u=>u.kinds.includes(d)&&N(u,y));return f.some(k)?v.has(t)||f.some(u=>!k(u)||(u.fields===void 0||u.fields.includes(t))&&!u.hide?.includes(t)):!0},i=Object.keys(o.input.shape??{}),a=new Map,c=(d,t)=>a.set(d,a.get(d)===!0||t);for(let d of o.creates??[]){let t=Object.keys(n.tryDefinition(d)?.fields.shape??{});for(let f of i)t.includes(f)&&c(f,p(d,f))}for(let d of P(n,o)){let t=n.tryDefinition(d);if(t)for(let f of w(o,t))i.includes(f)&&c(f,p(d,f))}for(let[d,t]of a)t||r.add(d);return r}export{B as a,K as b,C as c,I as d,_ as e,dn as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ce,c as ge,d as ye,f as he}from"./chunk.
|
|
1
|
+
import{a as ce,c as ge,d as ye,f as he}from"./chunk.E77K6KBX.js";import{f as T,i as k,j as pe,k as ue,q as fe,r as me}from"./chunk.GZLYTPE7.js";import{b as de}from"./chunk.4B73P2WA.js";import{c as se,f as le}from"./chunk.IMRCAU4T.js";import{F as Ae,Q as ae,Z as ie,i as re,v as oe}from"./chunk.6II4BONS.js";import{Fa as ne,Ga as te,X as Q,Z as X,ea as Z,ua as ee}from"./chunk.F5BCCGFK.js";import{b as M}from"./chunk.AJZBJBMO.js";var l=M(Ae(),1),i=M(ae(),1);function He({affordance:n,onApply:a,onCancel:p,store:b}){let y=ie(),s=b??y?.store,[S,B]=(0,l.useState)({}),[f,C]=(0,l.useState)(""),[F,I]=(0,l.useState)(q),[G,J]=(0,l.useState)(void 0),_=(0,l.useId)(),P=(0,l.useRef)(null),x=n.open.filter(e=>!(e.name in S)),o=x[0],w=s.allMutations().find(e=>e.name===n.mutation),j=(0,l.useMemo)(()=>Oe(w,s,n.args??{}),[w,s,n.args]),d=o?j[o.name]:void 0,$=me(n.open.filter(e=>e.shape?.type==="date").map(e=>e.name)),we=(()=>{if(!$||o?.name!==$.end||o.shape?.type!=="date")return;let e=S[$.start];if(typeof e!="string")return;let r=j[$.start];return fe(typeof r=="string"?r:void 0,e,typeof d=="string"?d:void 0,{time:o.shape.time===!0,instant:o.shape.instant===!0})})();if((0,l.useEffect)(()=>{C(we??be(d,o?.shape)),I(Array.isArray(d)?d:q),J(d)},[o?.name]),(0,l.useEffect)(()=>{P.current?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[o?.name]),(0,l.useLayoutEffect)(()=>{let e=P.current,r=typeof document>"u"?null:document.activeElement;if(!e||r&&r!==document.body&&!e.contains(r))return;let u=e.querySelector("form input, [role=group] button:not([disabled])");u&&u!==r&&u.focus()},[o?.name]),!o)return null;let h=e=>{let r=d!==void 0&&JSON.stringify(e)===JSON.stringify(d)?void 0:e,u={...S,[o.name]:r};if(n.open.filter(R=>!(R.name in u)).length===0){let R=a(Object.fromEntries(Object.entries(u).filter(([,K])=>K!==void 0)));R&&R.length>0&&B(Object.fromEntries(Object.entries(u).filter(([K])=>!R.includes(K))))}else B(u)},A=o.optional?(0,i.jsx)("button",{type:"button",onClick:()=>h(void 0),style:{fontSize:"0.8125rem"},children:"Skip"}):null,t=o.shape??{type:"unknown"},c=t.type==="number"?t.amount:void 0,g=Ne(o,t),m=T(s.schema,w,o.name),U=ee((w?.input?.shape??{})[o.name]),ve=te((w?.input?.shape??{})[o.name]),O=ne(o.name),ke=typeof d=="boolean"?d?"yes":"no":d,[W,Se]=(0,l.useState)(""),V=(0,l.useMemo)(()=>{let e=g.map(r=>s.graph.getNode(r)).filter(r=>r!==void 0);return de(e,r=>s.schema.tryDefinition(r))},[g,s]),L=e=>{let r=Ce(s,t,e),u=t.type==="choice"||t.type==="several"&&t.of.type==="choice"?m.option(e):r,N=V.get(e);return N?`${u} \xB7 ${N}`:u},z=(0,l.useMemo)(()=>{let e=W.trim().toLowerCase();return e===""?g:g.filter(r=>L(r).toLowerCase().includes(e))},[g,W,s,t,V]),v=t.type==="several",Y=t.type==="file"?t:t.type==="several"&&t.of.type==="file"?t.of:void 0,H=v&&g.length===0,D=o.kinds&&o.kinds.length>0&&!o.kinds.includes("*")?o.kinds.map(e=>X(Z(s.schema.tryDefinition(e),e))).join(" or "):m.label,xe=n.open.length>1?`${D} \xB7 ${n.open.length-x.length+1} of ${n.open.length}`:D;return(0,i.jsxs)("div",{ref:P,"data-graview-asking":n.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,padding:"5px 0 2px"},children:[n.open.length>1||g.length>0?(0,i.jsx)("span",{id:_,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:xe}):null,g.length>E?(0,i.jsx)("input",{type:"search",value:W,onChange:e=>Se(e.target.value),placeholder:`Filter ${g.length}\u2026`,"aria-label":`Filter ${D}`,"data-testid":"ask-filter",style:{font:"inherit",fontSize:"0.8125rem",minWidth:0,padding:"3px 7px"}}):null,ve?(0,i.jsxs)("form",{style:{display:"grid",gap:4},onSubmit:e=>{e.preventDefault(),h(G??(d===void 0?void 0:null))},children:[(0,i.jsx)(ye,{value:G,onChange:J,start:O?S[O]??j[O]:void 0,label:`${O?T(s.schema,w,O).label:m.label} repeats`,name:o.name}),(0,i.jsxs)("span",{style:{display:"flex",gap:4},children:[(0,i.jsx)("button",{type:"submit",style:{fontSize:"0.8125rem"},children:x.length>1?"Next":"Apply"}),A]})]}):U?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ge,{relation:U,value:d,onChange:h,label:m.label}),A]}):Y?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ce,{as:"control",value:d,onChange:h,several:v,image:Y.image===!0,label:m.label}),A]}):g.length>0?(0,i.jsxs)("div",{role:"group","aria-labelledby":_,style:{display:"flex",flexWrap:"wrap",gap:4},children:[z.slice(0,E).map(e=>{let r=v?F.includes(e):e===ke;return(0,i.jsx)("button",{type:"button","aria-label":`${D}: ${L(e)}`,...v?{"aria-pressed":r}:r?{"aria-current":!0}:{},style:{padding:"3px 9px",fontSize:"0.8125rem",...r?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},onClick:()=>v?I(u=>u.includes(e)?u.filter(N=>N!==e):[...u,e]):h(t.type==="boolean"?e==="yes":e),children:L(e)},e)}),z.length>E?(0,i.jsxs)("span",{"data-testid":"ask-more",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[z.length-E," more \u2014 type to narrow"]}):null,z.length===0?(0,i.jsxs)("span",{"data-testid":"ask-none",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["None of the ",g.length," match that."]}):null,v?(0,i.jsx)("button",{type:"button",disabled:F.length===0,style:{fontSize:"0.8125rem"},onClick:()=>{let e=F;I(q),h(e)},children:x.length>1?"Next":"Apply"}):null,A]}):(0,i.jsxs)("form",{style:{display:"flex",flexWrap:"wrap",gap:4},onSubmit:e=>{if(e.preventDefault(),d!==void 0&&f===be(d,t)){h(void 0);return}if(H){h(f.split(/[,\n]/).map(r=>r.trim()).filter(Boolean));return}if(f.trim().length!==0){if(c){let r=ue(f,c);r!==void 0&&h(r);return}h(t.type==="number"?t.duration?le(f)??f:Number(f):f)}},children:[t.type==="text"&&t.long?(0,i.jsx)("textarea",{autoFocus:!0,name:o.name,"aria-label":m.label,placeholder:m.label,value:f,rows:4,onChange:e=>C(e.target.value),onKeyDown:e=>{e.key==="Escape"?p():e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},style:{flex:"1 1 100%",minWidth:0,font:"inherit",fontSize:"0.875rem",lineHeight:1.45,padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",resize:"vertical",fieldSizing:"content",minHeight:"5.5em",maxHeight:"40vh"}}):t.type==="date"?(0,i.jsx)(he,{autoFocus:!0,name:o.name,label:m.label,value:f===""?void 0:f,time:t.time===!0,instant:t.instant===!0,onChange:e=>C(e??""),onCancel:p,boxStyle:{fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):(0,i.jsx)("input",{autoFocus:!0,type:t.type==="number"&&!t.duration&&!c?"number":t.type==="text"&&t.holds==="phone"?"tel":"text",...c?{inputMode:"decimal","data-graview-amount":c.format??"unit"}:{},name:o.name,"aria-label":m.label,placeholder:H?`${m.label}, separated by commas`:c?`${m.label}, ${k(c).hint} \u2014 ${k(c).prefix??""}${k(c).placeholder}${k(c).suffix?` ${k(c).suffix}`:""}`:m.label,value:f,...t.type==="number"&&t.min!==void 0?{min:t.min}:{},...t.type==="number"&&t.max!==void 0?{max:t.max}:{},...t.type==="number"&&t.step!==void 0?{step:t.step}:{},onChange:e=>C(e.target.value),onKeyDown:e=>{e.key==="Escape"&&p()},style:{flex:1,minWidth:0,font:"inherit",fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}),(0,i.jsx)("button",{type:"submit",disabled:!H&&f.trim().length===0,style:{fontSize:"0.8125rem"},children:x.length>1?"Next":"Apply"}),A]})]})}var q=[];function Oe(n,a,p){let b=n?.derived?.act==="edit"&&n.subject?p[n.subject.arg]:void 0,y=typeof b=="string"?a.graph.getNode(b):void 0;return y?Object.fromEntries((n.writes??[]).filter(s=>y[s]!==void 0&&y[s]!==null).map(s=>[s,y[s]])):{}}function be(n,a){return typeof n=="number"?a?.type==="number"&&a.amount?pe(n,a.amount):String(n):Array.isArray(n)?n.every(p=>typeof p=="string")?n.join(", "):"":typeof n!="string"?"":n}var E=10;function Ne(n,a){return n.candidates&&n.candidates.length>0?n.candidates:a.type==="choice"?a.options:a.type==="several"&&a.of.type==="choice"?a.of.options:a.type==="boolean"?Re:[]}var Re=["yes","no"];function Ce(n,a,p){return a.type==="boolean"||a.type==="choice"||a.type==="several"&&a.of.type==="choice"?p:$e(n,p)}function $e(n,a){let p=re(a);if(p){let s=se(n.schema,n.graph.getNode(p.from)?.kind??"",p.kind,"out");return s.charAt(0).toUpperCase()+s.slice(1)}let b=oe(a);if(b.length>0)return b.map(s=>n.schema.tryDefinition(s)?.plural??`${s}s`).join(" + ");let y=n.graph.getNode(a);return y?Q(n.schema.tryDefinition(y.kind),y):a}export{He as a,$e as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as q,g as Z,h as ee}from"./chunk.DLT3EE4D.js";import{a as Q,b as X}from"./chunk.3C4RJIJU.js";import{b}from"./chunk.DPP7ITTU.js";import{d as D}from"./chunk.GF7LA4QG.js";import{a as K}from"./chunk.UT6642FC.js";import{h as A}from"./chunk.Z7ZCR4LN.js";import{m as J}from"./chunk.Y5Z4ZDTO.js";import{F,I as P,N as L,O as T,Q as U,Y as m,a as $,ea as G,sa as V,wa as Y,xa as _}from"./chunk.UWIYKGYK.js";import{La as z,X as B,Z as E,fb as R}from"./chunk.X7W27IRI.js";import{b as W}from"./chunk.AJZBJBMO.js";var u=W(F(),1);var te=W(F(),1);function ne(){let{ai:i,aiDesk:n}=m(),{entries:a}=P(n),r=i.off===!0;return(0,te.useEffect)(()=>{r||n.load()},[n,r]),r?[]:a}var e=W(U(),1),ae=_($(()=>(__graviewPreload(import.meta.url,["./chunk.RTB4MMF6.js","./chunk.6J7DR7XQ.js","./chunk.Y5Z4ZDTO.js","./chunk.UWIYKGYK.js","./chunk.X7W27IRI.js","./chunk.AJZBJBMO.js"]),import("./chunk.4J75WRDG.js")))),pe=ae.part((i,n)=>(0,e.jsx)(i.InteractionRow,{...n}),{quiet:!0,as:"li"}),ge=ae.part((i,n)=>(0,e.jsx)(i.ActivityFilter,{...n}),{quiet:!0,as:"div"}),ie=(i,n)=>({intent:n.intent,author:n.author.kind,...n.author.id?{authorId:n.author.id}:{},by:n.author,...n.ops[0]?.via?{via:n.ops[0].via}:{},...n.lineage?{basis:K(n.lineage)}:{},touched:[...new Set(n.ops.filter(a=>!R(a)).flatMap(a=>a.writes))],...he(i,n.ops.filter(a=>!R(a))),batch:n.id,at:n.at,...n.lineage?.interaction?{interaction:n.lineage.interaction}:{},seq:n.ops.at(-1).seq+1,...n.ops.every(R)?{withheld:!0}:{}});function ue(i=4){let{store:n,principal:a}=m(),r=T(n,a),d=r.log.length;return(0,u.useMemo)(()=>Q(r.batches(),s=>r.log.get(s)).reverse().slice(0,i).map(s=>{if("batch"in s)return ie(r,s.batch);let o=[...s.digest.batches].reverse().map(l=>ie(r,l));return{intent:X(s.digest,new Date().toISOString().slice(0,10)),author:s.digest.author.kind,...s.digest.author.id?{authorId:s.digest.author.id}:{},by:s.digest.author,touched:[...new Set(o.flatMap(l=>l.touched))],batch:"",...o[0]?.at?{at:o[0].at}:{},seq:o[0]?.seq??0,digest:o}}),[r,d,i])}function he(i,n){let a={};for(let r of n)for(let d of r.primitives)d.op==="remove-node"&&d.node&&(a[d.node.id]=B(i.schema.tryDefinition(d.node.kind),d.node));return Object.keys(a).length>0?{removed:a}:{}}function ce({change:i}){let{store:n,principal:a,seats:r,people:d}=m();return(0,e.jsxs)("strong",{style:{fontWeight:600},children:[i.author==="human"&&i.by?.onBehalfOf===void 0&&(i.authorId===void 0||a.id===void 0||i.authorId===a.id)?"you":z(i.by??{kind:i.author,id:i.authorId},{graph:n.graph,schema:n.schema,seats:r,people:d}),A(i.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",A(i.via)]}):null]})}function ye({change:i,goes:n}){let{store:a}=m(),[r,d]=(0,u.useState)(!1),s=i.digest??[];return(0,e.jsxs)("li",{"data-testid":"activity-digest",style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)(ce,{change:i})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:i.intent})]}),(0,e.jsx)("button",{type:"button","data-testid":"digest-toggle","aria-expanded":r,onClick:()=>d(o=>!o),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:r?"Hide":"Show each"})]}),r?(0,e.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:s.map(o=>(0,e.jsxs)("li",{"data-testid":"digest-change",style:{display:"grid",gap:3},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:o.intent}),o.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",o.basis]}):null]}),o.withheld?null:(0,e.jsx)(M,{batch:o.batch})]}),o.touched.length>0?(0,e.jsx)("div",{"data-touched":o.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:o.touched.slice(0,4).map(l=>(0,e.jsx)(O,{id:l,label:a.graph.has(l)?b(a,l):o.removed?.[l]??b(a,l),go:n(l)},l))}):null]},o.batch))}):null]})}function M({batch:i}){let{store:n,principal:a,noteSeat:r}=m(),d=T(n,a),s=L()?.open??!1,o=d.log.length,[l,v]=(0,u.useState)(null),c=(0,u.useMemo)(()=>d.canUndo(i),[d,i,o]);if(s||!c.ok&&c.ops.length===0)return null;let w=!c.ok,k=w?c.includeBatches:[];return(0,e.jsxs)("span",{style:{marginLeft:"auto",flex:"0 0 auto",display:"grid",justifyItems:"end",gap:2},children:[(0,e.jsx)("button",{type:"button","data-testid":"undo-turn",title:w?`${c.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{v(null);try{let f=d.log.all().find(x=>x.batch===i&&x.author.kind==="agent");d.undo(w?[i,...k]:i,{author:a}),f&&r({type:"home",author:f.author})}catch(f){v(f instanceof Error?f.message:String(f))}},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem",...w?{borderColor:"var(--graview-warn)",color:"var(--graview-warn)"}:{}},children:w?`undo +${k.length}`:"undo"}),l?(0,e.jsx)("span",{"data-testid":"undo-refused",role:"alert",style:{fontSize:"0.75rem",lineHeight:1.4,color:"var(--graview-warn)",maxWidth:260,textAlign:"right"},children:l}):null]})}function fe({seq:i,intent:n}){let a=L();if(!a)return null;let r=a.past?.seq===i;return(0,e.jsx)("button",{type:"button","data-testid":"show-past","aria-label":`Show the app as it was after \u201C${n}\u201D`,title:"Show the app as it was here","aria-pressed":r,onPointerEnter:q,onFocus:q,onClick:()=>a.show(i),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minHeight:24,minWidth:24,padding:"1px 6px",fontSize:"0.75rem",flex:"0 0 auto"},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("path",{d:"M2.5 8 a5.5 5.5 0 1 0 1.6-3.9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,e.jsx)("path",{d:"M2 2.5 V5.5 H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M8 5 V8 L10 9.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}function me(){let i=()=>{let n=new URL(window.location.href);return n.searchParams.set("fresh","1"),n.toString()};return(0,e.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:n=>{n.preventDefault(),window.location.assign(i())},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3},children:"Start fresh"})}function O({id:i,label:n,go:a}){return a?(0,e.jsx)("button",{type:"button","data-testid":"activity-record","data-record":i,title:`Go to ${n}`,onClick:()=>a(i),style:{all:"unset",display:"inline-flex",cursor:"pointer",borderRadius:7},className:"graview-activity-record",children:(0,e.jsx)(D,{label:n})}):(0,e.jsx)(D,{label:n})}function Oe({calls:i,seat:n,remembers:a=!1}){let r=ue(),{store:d,principal:s,seats:o,people:l}=m(),v=ne(),[c,w]=(0,u.useState)("all"),[k,f]=(0,u.useState)(!1),x=t=>t!==void 0&&(t.id===s.id||t.onBehalfOf?.id===s.id)&&s.id!==void 0,re=new Set(v.map(t=>t.id)),oe=r.filter(t=>!(t.interaction!==void 0&&re.has(t.interaction))&&(!k||x(t.by))),se=v.filter(t=>!k||x(t.by)).slice(0,4),I=[...c==="ai"?[]:oe.map(t=>({at:t.at??"",change:t})),...c==="changes"?[]:se.map(t=>({at:t.at,entry:t}))].sort((t,h)=>t.at<h.at?1:t.at>h.at?-1:0),y=T(d,s),H=i.some(t=>t.phase==="running"),de=Z(),S=Y("activity"),N=S.open,le=G(),j=L(),C=t=>y.graph.has(t)?h=>{S.setOpen(!1),j?.past&&j.show(null),le.record(h)}:null;return n===void 0&&i.length===0&&r.length===0&&v.length===0&&!a&&de===0?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"activity-button",...S.trigger,onClick:S.toggle,title:H?"An agent is working":"What has happened",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:H?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[H?(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,background:"var(--graview-accent)"}}):null,r.length>0?r.length:"",(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("circle",{cx:"8",cy:"8",r:"5.75",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),(0,e.jsx)("path",{d:"M8 4.75 V8 L10.25 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Activity"})]}),!N&&n!==void 0?(0,e.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:n}):null,N?(0,e.jsxs)("section",{...S.pane,"aria-label":"Activity","data-testid":"activity","data-graview-offstage":"",style:{...V,width:300,maxHeight:"min(52cqh, 460px)",overflow:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...J,margin:0},children:"Activity"}),n!==void 0?(0,e.jsxs)("div",{"data-testid":"agent-seat-row",style:{display:"grid",gap:5,paddingBottom:i.length>0||I.length>0?9:0,...i.length>0||I.length>0?{borderBottom:"1px solid var(--graview-edge)"}:{}},children:[(0,e.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"The agent's seat"}),n]}):null,i.length>0?(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:7},children:i.slice(0,6).map((t,h)=>(0,e.jsxs)("li",{style:{display:"grid",gap:2,fontSize:"0.8125rem",lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,flex:"0 0 auto",background:t.phase==="running"?"var(--graview-accent)":t.phase==="failed"?"var(--graview-warn)":"var(--graview-edge-bright)"}}),(0,e.jsxs)("span",{style:{color:"var(--graview-ink)"},children:[t.mutating?"changed":"read"," \xB7"," ",y.allMutations().find(p=>p.name===t.name)?.title??E(t.name)]})]}),!t.mutating&&t.reads&&t.reads.length>0?(0,e.jsxs)("div",{"data-testid":"activity-reads",style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:[[...new Set(t.reads)].slice(0,3).map(p=>(0,e.jsx)(O,{id:p,label:b(y,p),go:C(p)},p)),new Set(t.reads).size>3?(0,e.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["+",new Set(t.reads).size-3]}):null]}):Object.values(t.args).some(p=>typeof p=="string")?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:Object.entries(t.args).filter(p=>typeof p[1]=="string").slice(0,3).map(([p,g])=>(0,e.jsx)(O,{id:g,label:b(y,g),go:C(g)},p))}):null,t.error?(0,e.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:t.error}):null]},`${t.at}:${h}`))}):null,v.length>0?(0,e.jsx)(u.Suspense,{fallback:null,children:(0,e.jsx)(ge,{shows:c,onShows:w,mine:k,onMine:f})}):null,I.length>0?(0,e.jsx)("ol",{"data-testid":"diff-log",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem"},children:I.map(({change:t,entry:h},p)=>h!==void 0?(0,e.jsx)(u.Suspense,{fallback:null,children:(0,e.jsx)(pe,{entry:h,undo:g=>(0,e.jsx)(M,{batch:g})})},`ai:${h.id}`):t.digest?(0,e.jsx)(ye,{change:t,goes:C},`digest:${t.digest[0]?.batch??p}`):t.withheld?(0,e.jsx)("li",{"data-testid":"withheld-change",style:{display:"grid",gap:3,lineHeight:1.45},children:(0,e.jsx)("span",{"data-touched":"",style:{color:"var(--graview-ink-muted)",fontStyle:"italic"},children:t.intent})},`change:${p}`):(0,e.jsxs)("li",{"data-batch":t.batch,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsxs)("strong",{style:{fontWeight:600},children:[t.author==="human"&&t.by?.onBehalfOf===void 0&&(t.authorId===void 0||s.id===void 0||t.authorId===s.id)?"you":z(t.by??{kind:t.author,id:t.authorId},{graph:y.graph,schema:y.schema,seats:o,people:l}),A(t.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",A(t.via)]}):null]})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.intent}),t.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.basis]}):null]}),t.batch?(0,e.jsx)(fe,{seq:t.seq,intent:t.intent}):null,t.batch?(0,e.jsx)(M,{batch:t.batch}):null]}),(0,e.jsx)("div",{"data-touched":t.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:t.touched.slice(0,4).map(g=>(0,e.jsx)(O,{id:g,label:y.graph.has(g)?b(y,g):t.removed?.[g]??b(y,g),go:C(g)},g))})]},`change:${p}`))}):null,(0,e.jsx)(ee,{style:{paddingTop:8,borderTop:"1px solid var(--graview-edge)"}}),a?(0,e.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,e.jsx)("span",{children:"Remembered in this browser"}),(0,e.jsx)(me,{})]}):null]}):null]})}export{M as a,Oe as b};
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as q,g as Z,h as ee}from"./chunk.ZVMIHXVK.js";import{a as Q,b as X}from"./chunk.272ZJXQP.js";import{b}from"./chunk.3SM2CHKF.js";import{d as D}from"./chunk.2A2DLMT3.js";import{a as K}from"./chunk.UT6642FC.js";import{h as A}from"./chunk.GZLYTPE7.js";import{m as J}from"./chunk.BZ5VLPKB.js";import{F,I as P,N as L,O as T,Q as U,Y as m,a as $,ea as G,sa as V,wa as Y,xa as _}from"./chunk.6II4BONS.js";import{Ma as z,X as B,Z as E,gb as R}from"./chunk.F5BCCGFK.js";import{b as W}from"./chunk.AJZBJBMO.js";var u=W(F(),1);var te=W(F(),1);function ne(){let{ai:i,aiDesk:n}=m(),{entries:a}=P(n),r=i.off===!0;return(0,te.useEffect)(()=>{r||n.load()},[n,r]),r?[]:a}var e=W(U(),1),ae=_($(()=>(__graviewPreload(import.meta.url,["./chunk.TGEF6TMM.js","./chunk.D6RDTUX3.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.EQIGKXIG.js")))),pe=ae.part((i,n)=>(0,e.jsx)(i.InteractionRow,{...n}),{quiet:!0,as:"li"}),ge=ae.part((i,n)=>(0,e.jsx)(i.ActivityFilter,{...n}),{quiet:!0,as:"div"}),ie=(i,n)=>({intent:n.intent,author:n.author.kind,...n.author.id?{authorId:n.author.id}:{},by:n.author,...n.ops[0]?.via?{via:n.ops[0].via}:{},...n.lineage?{basis:K(n.lineage)}:{},touched:[...new Set(n.ops.filter(a=>!R(a)).flatMap(a=>a.writes))],...he(i,n.ops.filter(a=>!R(a))),batch:n.id,at:n.at,...n.lineage?.interaction?{interaction:n.lineage.interaction}:{},seq:n.ops.at(-1).seq+1,...n.ops.every(R)?{withheld:!0}:{}});function ue(i=4){let{store:n,principal:a}=m(),r=T(n,a),d=r.log.length;return(0,u.useMemo)(()=>Q(r.batches(),s=>r.log.get(s)).reverse().slice(0,i).map(s=>{if("batch"in s)return ie(r,s.batch);let o=[...s.digest.batches].reverse().map(l=>ie(r,l));return{intent:X(s.digest,new Date().toISOString().slice(0,10)),author:s.digest.author.kind,...s.digest.author.id?{authorId:s.digest.author.id}:{},by:s.digest.author,touched:[...new Set(o.flatMap(l=>l.touched))],batch:"",...o[0]?.at?{at:o[0].at}:{},seq:o[0]?.seq??0,digest:o}}),[r,d,i])}function he(i,n){let a={};for(let r of n)for(let d of r.primitives)d.op==="remove-node"&&d.node&&(a[d.node.id]=B(i.schema.tryDefinition(d.node.kind),d.node));return Object.keys(a).length>0?{removed:a}:{}}function ce({change:i}){let{store:n,principal:a,seats:r,people:d}=m();return(0,e.jsxs)("strong",{style:{fontWeight:600},children:[i.author==="human"&&i.by?.onBehalfOf===void 0&&(i.authorId===void 0||a.id===void 0||i.authorId===a.id)?"you":z(i.by??{kind:i.author,id:i.authorId},{graph:n.graph,schema:n.schema,seats:r,people:d}),A(i.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",A(i.via)]}):null]})}function ye({change:i,goes:n}){let{store:a}=m(),[r,d]=(0,u.useState)(!1),s=i.digest??[];return(0,e.jsxs)("li",{"data-testid":"activity-digest",style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)(ce,{change:i})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:i.intent})]}),(0,e.jsx)("button",{type:"button","data-testid":"digest-toggle","aria-expanded":r,onClick:()=>d(o=>!o),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:r?"Hide":"Show each"})]}),r?(0,e.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:s.map(o=>(0,e.jsxs)("li",{"data-testid":"digest-change",style:{display:"grid",gap:3},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:o.intent}),o.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",o.basis]}):null]}),o.withheld?null:(0,e.jsx)(M,{batch:o.batch})]}),o.touched.length>0?(0,e.jsx)("div",{"data-touched":o.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:o.touched.slice(0,4).map(l=>(0,e.jsx)(O,{id:l,label:a.graph.has(l)?b(a,l):o.removed?.[l]??b(a,l),go:n(l)},l))}):null]},o.batch))}):null]})}function M({batch:i}){let{store:n,principal:a,noteSeat:r}=m(),d=T(n,a),s=L()?.open??!1,o=d.log.length,[l,v]=(0,u.useState)(null),c=(0,u.useMemo)(()=>d.canUndo(i),[d,i,o]);if(s||!c.ok&&c.ops.length===0)return null;let w=!c.ok,k=w?c.includeBatches:[];return(0,e.jsxs)("span",{style:{marginLeft:"auto",flex:"0 0 auto",display:"grid",justifyItems:"end",gap:2},children:[(0,e.jsx)("button",{type:"button","data-testid":"undo-turn",title:w?`${c.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{v(null);try{let f=d.log.all().find(x=>x.batch===i&&x.author.kind==="agent");d.undo(w?[i,...k]:i,{author:a}),f&&r({type:"home",author:f.author})}catch(f){v(f instanceof Error?f.message:String(f))}},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem",...w?{borderColor:"var(--graview-warn)",color:"var(--graview-warn)"}:{}},children:w?`undo +${k.length}`:"undo"}),l?(0,e.jsx)("span",{"data-testid":"undo-refused",role:"alert",style:{fontSize:"0.75rem",lineHeight:1.4,color:"var(--graview-warn)",maxWidth:260,textAlign:"right"},children:l}):null]})}function fe({seq:i,intent:n}){let a=L();if(!a)return null;let r=a.past?.seq===i;return(0,e.jsx)("button",{type:"button","data-testid":"show-past","aria-label":`Show the app as it was after \u201C${n}\u201D`,title:"Show the app as it was here","aria-pressed":r,onPointerEnter:q,onFocus:q,onClick:()=>a.show(i),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minHeight:24,minWidth:24,padding:"1px 6px",fontSize:"0.75rem",flex:"0 0 auto"},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("path",{d:"M2.5 8 a5.5 5.5 0 1 0 1.6-3.9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,e.jsx)("path",{d:"M2 2.5 V5.5 H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M8 5 V8 L10 9.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}function me(){let i=()=>{let n=new URL(window.location.href);return n.searchParams.set("fresh","1"),n.toString()};return(0,e.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:n=>{n.preventDefault(),window.location.assign(i())},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3},children:"Start fresh"})}function O({id:i,label:n,go:a}){return a?(0,e.jsx)("button",{type:"button","data-testid":"activity-record","data-record":i,title:`Go to ${n}`,onClick:()=>a(i),style:{all:"unset",display:"inline-flex",cursor:"pointer",borderRadius:7},className:"graview-activity-record",children:(0,e.jsx)(D,{label:n})}):(0,e.jsx)(D,{label:n})}function Oe({calls:i,seat:n,remembers:a=!1}){let r=ue(),{store:d,principal:s,seats:o,people:l}=m(),v=ne(),[c,w]=(0,u.useState)("all"),[k,f]=(0,u.useState)(!1),x=t=>t!==void 0&&(t.id===s.id||t.onBehalfOf?.id===s.id)&&s.id!==void 0,re=new Set(v.map(t=>t.id)),oe=r.filter(t=>!(t.interaction!==void 0&&re.has(t.interaction))&&(!k||x(t.by))),se=v.filter(t=>!k||x(t.by)).slice(0,4),I=[...c==="ai"?[]:oe.map(t=>({at:t.at??"",change:t})),...c==="changes"?[]:se.map(t=>({at:t.at,entry:t}))].sort((t,h)=>t.at<h.at?1:t.at>h.at?-1:0),y=T(d,s),H=i.some(t=>t.phase==="running"),de=Z(),S=Y("activity"),N=S.open,le=G(),j=L(),C=t=>y.graph.has(t)?h=>{S.setOpen(!1),j?.past&&j.show(null),le.record(h)}:null;return n===void 0&&i.length===0&&r.length===0&&v.length===0&&!a&&de===0?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"activity-button",...S.trigger,onClick:S.toggle,title:H?"An agent is working":"What has happened",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:H?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[H?(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,background:"var(--graview-accent)"}}):null,r.length>0?r.length:"",(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("circle",{cx:"8",cy:"8",r:"5.75",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),(0,e.jsx)("path",{d:"M8 4.75 V8 L10.25 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Activity"})]}),!N&&n!==void 0?(0,e.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:n}):null,N?(0,e.jsxs)("section",{...S.pane,"aria-label":"Activity","data-testid":"activity","data-graview-offstage":"",style:{...V,width:300,maxHeight:"min(52cqh, 460px)",overflow:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...J,margin:0},children:"Activity"}),n!==void 0?(0,e.jsxs)("div",{"data-testid":"agent-seat-row",style:{display:"grid",gap:5,paddingBottom:i.length>0||I.length>0?9:0,...i.length>0||I.length>0?{borderBottom:"1px solid var(--graview-edge)"}:{}},children:[(0,e.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"The agent's seat"}),n]}):null,i.length>0?(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:7},children:i.slice(0,6).map((t,h)=>(0,e.jsxs)("li",{style:{display:"grid",gap:2,fontSize:"0.8125rem",lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,flex:"0 0 auto",background:t.phase==="running"?"var(--graview-accent)":t.phase==="failed"?"var(--graview-warn)":"var(--graview-edge-bright)"}}),(0,e.jsxs)("span",{style:{color:"var(--graview-ink)"},children:[t.mutating?"changed":"read"," \xB7"," ",y.allMutations().find(p=>p.name===t.name)?.title??E(t.name)]})]}),!t.mutating&&t.reads&&t.reads.length>0?(0,e.jsxs)("div",{"data-testid":"activity-reads",style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:[[...new Set(t.reads)].slice(0,3).map(p=>(0,e.jsx)(O,{id:p,label:b(y,p),go:C(p)},p)),new Set(t.reads).size>3?(0,e.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["+",new Set(t.reads).size-3]}):null]}):Object.values(t.args).some(p=>typeof p=="string")?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:Object.entries(t.args).filter(p=>typeof p[1]=="string").slice(0,3).map(([p,g])=>(0,e.jsx)(O,{id:g,label:b(y,g),go:C(g)},p))}):null,t.error?(0,e.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:t.error}):null]},`${t.at}:${h}`))}):null,v.length>0?(0,e.jsx)(u.Suspense,{fallback:null,children:(0,e.jsx)(ge,{shows:c,onShows:w,mine:k,onMine:f})}):null,I.length>0?(0,e.jsx)("ol",{"data-testid":"diff-log",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem"},children:I.map(({change:t,entry:h},p)=>h!==void 0?(0,e.jsx)(u.Suspense,{fallback:null,children:(0,e.jsx)(pe,{entry:h,undo:g=>(0,e.jsx)(M,{batch:g})})},`ai:${h.id}`):t.digest?(0,e.jsx)(ye,{change:t,goes:C},`digest:${t.digest[0]?.batch??p}`):t.withheld?(0,e.jsx)("li",{"data-testid":"withheld-change",style:{display:"grid",gap:3,lineHeight:1.45},children:(0,e.jsx)("span",{"data-touched":"",style:{color:"var(--graview-ink-muted)",fontStyle:"italic"},children:t.intent})},`change:${p}`):(0,e.jsxs)("li",{"data-batch":t.batch,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsxs)("strong",{style:{fontWeight:600},children:[t.author==="human"&&t.by?.onBehalfOf===void 0&&(t.authorId===void 0||s.id===void 0||t.authorId===s.id)?"you":z(t.by??{kind:t.author,id:t.authorId},{graph:y.graph,schema:y.schema,seats:o,people:l}),A(t.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",A(t.via)]}):null]})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.intent}),t.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.basis]}):null]}),t.batch?(0,e.jsx)(fe,{seq:t.seq,intent:t.intent}):null,t.batch?(0,e.jsx)(M,{batch:t.batch}):null]}),(0,e.jsx)("div",{"data-touched":t.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:t.touched.slice(0,4).map(g=>(0,e.jsx)(O,{id:g,label:y.graph.has(g)?b(y,g):t.removed?.[g]??b(y,g),go:C(g)},g))})]},`change:${p}`))}):null,(0,e.jsx)(ee,{style:{paddingTop:8,borderTop:"1px solid var(--graview-edge)"}}),a?(0,e.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,e.jsx)("span",{children:"Remembered in this browser"}),(0,e.jsx)(me,{})]}):null]}):null]})}export{M as a,Oe as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I,c as x}from"./chunk.
|
|
1
|
+
import{a as I,c as x}from"./chunk.JZMA2AV7.js";import"./chunk.BZ5VLPKB.js";import{c as b,d as A,k as v,r as w,t as O,w as G}from"./chunk.6II4BONS.js";import{Cc as k,Rc as E,Xc as S,Yc as W}from"./chunk.F5BCCGFK.js";import"./chunk.AJZBJBMO.js";var F=(e,i)=>k(e,i).slice(1);function j(e,i){let l=e.split("/").filter(Boolean);return l.length===i.length&&l.every((s,h)=>s.startsWith(":")||s==="*"||s===i[h])}var $=["problems","search","map","places"];function R(e,i,l,s,h=[]){let{schema:r}=i,o=r.kinds,f=t=>{if(t.startsWith(w))return(t.slice(w.length).split("|")[0]??"").split("+").every(V=>o.includes(V));let y=O(t);return y!==null?o.includes(y):t.startsWith("edge:")||l.graph.getNode(t)!==void 0},[p="/",u]=e.path.split("?"),n=p.split("/").filter(Boolean),m=u?`?${u}`:"",d=n.length>0&&!$.includes(n[0])?o.find(t=>F(r,t)===n[0]):void 0,c=e.path;if(n[0]==="places"&&n.length===2)`/places/${n[1]}`!==E&&!s.some(t=>t.as===decodeURIComponent(n[1]))&&(c="/");else if(d){let t=n[1]===void 0?void 0:decodeURIComponent(n[1]);c=`/${F(r,d)}${t!==void 0&&l.graph.getNode(t)?.kind===d?`/${n[1]}`:""}${m}`}else n.length>0&&n.length<=2&&!$.includes(n[0])&&!h.some(t=>j(t.path,n))&&(c="/");let g=A(e.stop),P=g.within?.view,U=P!==void 0&&!s.some(t=>t.as===P),a=g;if(U){let{view:t,...y}=g.within??{};a={...a,within:y}}if(g.focusId&&!f(g.focusId)){let t=e.kind&&o.includes(e.kind)?G(e.kind):null;a={...v(a,t),zoom:!1}}return a={...a,relation:a.relation&&(o.includes(a.relation)||r.edgeKinds.includes(a.relation))?a.relation:null,expanded:a.expanded.filter(f),pins:Object.fromEntries(Object.entries(a.pins).filter(([t])=>f(t))),...a.selection?{selection:a.selection.filter(f)}:{}},{face:e.face,path:c,stop:b(a),...e.kind?{kind:e.kind}:{}}}function B(e,i,l){let s=e.at,h=e.pages?.routes()??[];if(e.routing!=="address"||typeof window>"u")return R(s,e.app,i,l,h);let{pathname:r,search:o,hash:f}=window.location,p=W(r,e.basePath),u=I({routing:"address",...e.basePath===void 0?{}:{basePath:e.basePath},face:s.face}),n=u==="pages",m={...s,face:u,...p===null?{}:n?{path:p+o}:{stop:x(e.basePath)??s.stop}},d=R(m,e.app,i,l,h),c=n?d.path===m.path?null:S(d.path,e.basePath===void 0?{}:{basePath:e.basePath}):d.stop===b(A(m.stop))?null:r+o+d.stop;return p!==null&&c!==null&&c!==r+o+f&&window.history.replaceState(window.history.state,"",c),d}export{R as settle,B as settleAt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ee,b as E,d as oe,g as se,h as re,i as ie}from"./chunk.
|
|
1
|
+
import{a as ee,b as E,d as oe,g as se,h as re,i as ie}from"./chunk.IMRCAU4T.js";import{Ca as T,E as I,F as w,Ga as Q,H as P,Ia as V,K as b,Ka as X,L as K,M as Y,P as v,R as H,X as $,ca as U,ea as B,ja as G,na as Z,rb as ne,sa as q,tb as te,ua as J}from"./chunk.F5BCCGFK.js";var ce=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,fe={day:"day",week:"week",month:"month",year:"year"},R=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function ye(t,e,n){let o=e.interval??1,i=fe[e.every],a=t.slice(0,10),c=o===1?`Every ${i}`:o===2?`Every other ${i}`:`Every ${o} ${i}s`,d;if(e.every==="week"){let f=(e.on?.length?e.on:[T[new Date(`${a}T00:00:00Z`).getUTCDay()]]).map(l=>H(T.indexOf(l),"long",n));d=o===1?`Every ${R(f)}`:o===2?`Every other ${R(f)}`:`${c} on ${R(f)}`}else if(e.every==="month"){let f=(e.on?.length?e.on:[+a.slice(8,10)]).map(l=>l===-1?"the last day":`the ${ce(Number(l))}`);d=`${c} on ${R(f)}`}else e.every==="year"?d=`${c} on ${v(a,n)}`:d=c;return w.test(t)&&(d+=` at ${Y(t,n)}`),e.until&&(d+=`, until ${b(e.until,n)}`),e.count&&(d+=`, ${e.count===1?"once":`${e.count} times`}`),d}function de(t,e,n={}){if(!V(e)||typeof t!="string")return;let o=n.today??P(),i=X(t,e,o),a=ye(t,e,n.locale),c=i.slice(0,4)===o.slice(0,4)?v(i.slice(0,10),n.locale):b(i.slice(0,10),n.locale);return i.slice(0,10)<o?`${a}, last ${c}`:`${a}, next ${c}`}function Pe(t,e){let n=new Map,o=new Map;for(let i of t){let a=$(e(i.kind),i).trim().toLowerCase();o.set(a,[...o.get(a)??[],i])}for(let i of o.values()){if(i.length<2)continue;let a=new Map;for(let c of i)a.set(c.kind,[...a.get(c.kind)??[],c]);for(let[c,d]of a){if(d.length===1){n.set(d[0].id,B(e(c),c));continue}let f=d.map(y=>new Map(pe(y,e(y.kind)).map(r=>[r.key,r.alone]))),l=[...new Set(f.flatMap(y=>[...y.keys()]))],p=y=>f.every(r=>!/\d/.test(r.get(y)??"")),A=[...l.filter(p),...l.filter(y=>!p(y))].find(y=>new Set(f.map(r=>r.get(y)??"")).size===d.length);d.forEach((y,r)=>{let s=A?f[r].get(A):void 0;n.set(y.id,s??y.id)})}}return n}function Ke(t,e){return t?.describe?t.describe(e):`${e.kind} ${$(t,e)}`}var ue=new Set(["id","kind","label"]);function ge(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function pe(t,e,n={}){let o=e?.display,i=new Set([...ue,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!$(e,t).includes(t.label)&&i.delete("label");let a=(n.said??[]).filter(r=>!!r),c=a.filter(r=>r.endsWith("\u2026")).map(r=>r.replace(/…$/,"").trim()).filter(r=>r.length>12),d=[],f=e?.fields?.shape,l=e?.fieldRoles,p=n.glance?o?.glance??[l?.who,l?.when].filter(r=>!!r):ae(o?.page),M=n.glance&&o?.glance!==void 0,y=[...new Set(M?p:[...p,...be(e),...Object.keys(t)])].filter(r=>Object.hasOwn(t,r)).map(r=>[r,t[r]]);for(let[r,s]of y){if(i.has(r)||s===void 0||s===null)continue;let u=o?.format?.[r],k=u?[]:G(s);if(k[0]&&n.glance)continue;let O=e?.fields?.shape?.[r],_=!u&&typeof s=="string"&&Z(O)?s:void 0,x=!u&&typeof s=="string"&&ee(O);if(_&&n.glance)continue;let S=u?void 0:J(O),m=S?{relation:S,refs:q(s,S)}:void 0;if(m&&(n.glance||m.refs.length===0)||!k[0]&&typeof s=="object"&&(!Array.isArray(s)||s.some(g=>typeof g=="object"&&g!==null))&&u===void 0)continue;let j=typeof s=="string"&&!u?de(s,t[`${r}Repeat`],{locale:n.locale}):void 0,F=k[0]?k.map(g=>g.caption?`${g.name} \u2014 ${g.caption}`:g.name).join(", "):Array.isArray(s)?s.join(", "):typeof s=="boolean"?s?"Yes":"No":String(s),N=u?void 0:se(e,r),L=ie(N,s),W=!u&&!N&&typeof s=="number"?ne(e?.fields?.shape?.[r]):void 0,z=m?m.refs.length>1?`${m.refs.length} linked records`:"linked record":u?u(s):W?te(s,W):re(N,s,n.locale)??(Array.isArray(s)||typeof s=="boolean"?F:typeof s=="string"&&j!==void 0?j:typeof s=="string"&&I.test(s)?b(s,n.locale):typeof s=="string"&&w.test(s)?K(s,n.locale):typeof s=="string"&&ke(e,r)?E(e,r,s):F),C=typeof s=="string"&&Ae(e,r,z),h=(n.glance||n.excerpt)&&!u&&(C||x)?oe(z,{markdown:x}):z;if(a.includes(h)||c.some(g=>h.startsWith(g))||n.glance&&(typeof s=="string"||typeof s=="number")&&a.some(g=>ge(g,h)))continue;let D=U(e,r),le=typeof s=="number"?`${D} ${h}`:typeof s=="boolean"&&!u?`${D}: ${h.toLowerCase()}`:h;if(d.push({key:r,label:D,value:h,stored:F,alone:le,long:C,...x?{markdown:!0}:{},...k[0]?{files:k}:{},..._?{app:_}:{},...m?{linked:m}:{},...L?{href:L}:{},...Q(f?.[`${r}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&d.length>=n.limit)break}return me(d,e)}function me(t,e){let n=new Map;for(let o of t){let i=he(e,o.key);i&&n.set(o.key,new Set(i.map(a=>E(e,o.key,a).toLowerCase())))}return n.size<2?t:t.map(o=>{let i=n.get(o.key);return i!==void 0&&[...n].some(([c,d])=>c!==o.key&&[...i].some(f=>d.has(f)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function he(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function ke(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function be(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function ae(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var we=500,$e=160;function Re(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function Ae(t,e,n){return Re(t?.fields?.shape?.[e])?.checks?.some(i=>i._zod?.def?.check==="max_length"&&(i._zod.def.maximum??0)>we)?!0:typeof n=="string"&&(n.includes(`
|
|
2
2
|
`)||n.length>$e)}function Ye(t,e){let n=t?.display?.page,o=n?.groups??[],i=new Map(e.map(l=>[l.key,l])),a=new Set(ae(n)),c=l=>l.flatMap(p=>i.has(p)?[i.get(p)]:[]),d=e.filter(l=>!a.has(l.key));return[{fields:[...c(n?.fields??[]),...o.length>0?[]:d]},...o.map(l=>({title:l.title,fields:c(l.fields)})),...o.length>0?[{title:"Details",fields:d}]:[]].filter(l=>l.fields.length>0)}export{ye as a,Pe as b,Ke as c,pe as d,Ye as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.5A4AOFOA.js";import"./chunk.
|
|
1
|
+
import"./chunk.5A4AOFOA.js";import"./chunk.OF34OZ4V.js";import"./chunk.NNCTJSD3.js";import"./chunk.GXLAZGYT.js";import{a as L,b as R,c as E}from"./chunk.HPX3F7XX.js";import{b as T}from"./chunk.7CO7S6QM.js";import"./chunk.6QDFBCV4.js";import"./chunk.R7LRJS6B.js";import"./chunk.IB32NOV5.js";import"./chunk.4STIUIT6.js";import"./chunk.WHTQHU3M.js";import"./chunk.KU6NIMQX.js";import"./chunk.Y3IJDWNS.js";import"./chunk.OFJH7LDC.js";import"./chunk.5PU3RWYY.js";import"./chunk.27TLAVRR.js";import"./chunk.OREMUXB5.js";import"./chunk.ZDNJK2SX.js";import"./chunk.ZSSOTIFL.js";import"./chunk.HJCQ6I3S.js";import"./chunk.ZWZ5SEXT.js";import"./chunk.FQKH67BP.js";import"./chunk.LA7535VO.js";import"./chunk.ZEW2OOZ5.js";import"./chunk.7YQYWOZR.js";import"./chunk.ACEYGWMO.js";import"./chunk.3PT55HXT.js";import"./chunk.272ZJXQP.js";import"./chunk.3SM2CHKF.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.EBLKEQ7O.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import{r as A}from"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{F as S,H as $,Q as p,Y as x,_ as C}from"./chunk.6II4BONS.js";import{W as h,gc as k}from"./chunk.F5BCCGFK.js";import{b as i}from"./chunk.AJZBJBMO.js";var r=i(S(),1);var l=i(S(),1);var g=i(p(),1);var m={font:"inherit",fontSize:"0.875rem",minHeight:24,padding:0,border:0,borderRadius:2,background:"transparent",boxShadow:"none",color:"var(--graview-accent)",textDecoration:"underline",textUnderlineOffset:3,textAlign:"start",cursor:"pointer"};var e=i(p(),1);function Y({page:n=!1,go:D,onPick:y,onDiscard:M}){let{store:d,seatTalk:c}=x(),u=$(c),N=E(),b=D??N,{keep:P}=L(b),[H,f]=(0,r.useState)(!1);C();let t=u.draft;(0,r.useEffect)(()=>f(!1),[t]),(0,r.useEffect)(()=>{n||R(!1)},[n]);let v=(0,r.useRef)(null),w=t!==null&&!n;if((0,r.useLayoutEffect)(()=>{let s=v.current;if(!w||!s?.parentElement)return;let o=[];for(let a=s.previousElementSibling;a;a=a.previousElementSibling)a instanceof HTMLElement&&!a.inert&&a.tagName!=="STYLE"&&(a.inert=!0,o.push(a));return()=>{for(let a of o)a.inert=!1}},[w]),!t)return null;let G=T(t.drawn),F=d.schema.tryDefinition(t.kind),q=d.graph.nodesOfKind(t.kind).filter(s=>h(F,s)),z=()=>{c.setDraft(null),M?.()};return(0,e.jsxs)("section",{ref:v,"data-testid":"draft-frame","data-graview-draft-frame":n?"page":"scene","aria-label":`Draft: ${t.title}`,style:n?{display:"grid",gap:12,minWidth:0}:{position:"absolute",inset:12,zIndex:k("rail"),display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:12,boxShadow:"var(--graview-lift-high)",overflow:"hidden",minHeight:0},children:[(0,e.jsxs)("p",{"data-testid":"draft-line",style:{...K,...n?{}:{padding:"10px 16px"}},children:[n?(0,e.jsx)("span",{children:"Draft"}):(0,e.jsxs)("span",{children:["Draft \u2014 ",(0,e.jsx)("span",{"data-testid":"draft-title",style:{color:"var(--graview-ink)",fontWeight:600},children:t.title})]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-keep",disabled:H,title:`Keep \u201C${t.title}\u201D as a lens: a place of its own`,onClick:()=>{f(!0),P(t).finally(()=>f(!1))},style:m,children:"Keep as a lens"}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-discard",onClick:z,style:m,children:"Discard"})]}),u.draftNote?(0,e.jsx)("p",{"data-testid":"draft-note",role:"status",style:{margin:0,padding:n?0:"0 16px 8px",fontSize:"0.8125rem",color:"var(--graview-warn)"},children:u.draftNote}):(0,e.jsx)("span",{}),(0,e.jsx)("div",{"data-testid":"draft-lens","data-graview-draft":t.lens.name,style:n?{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",scrollbarGutter:"stable",border:"1px solid var(--graview-edge)",borderRadius:12,background:"var(--graview-panel)"}:{minHeight:0,overflow:"auto",scrollbarGutter:"stable",display:"grid",gridTemplateRows:"minmax(0, 1fr)"},onClick:s=>{let o=s.target?.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(!o||!d.graph.getNode(o))return;s.preventDefault();let a=d.graph.getNode(o);y?(c.setDraft(null),y(o)):b({to:"record",id:o,kind:a.kind,label:o,address:"",said:""})},children:(0,e.jsx)(A,{kind:t.kind,view:t.title,children:(0,e.jsx)(G,{nodes:q,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})]})}var K={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};export{Y as DraftFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"./chunk.IB32NOV5.js";import"./chunk.ZEW2OOZ5.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.F5BCCGFK.js";import"./chunk.AJZBJBMO.js";export{f as columnActs,c as columnMoves,b as columnOf,d as columnReach,e as columnSteps,h as describePlace,i as placeText,g as resolveFor,a as statusColumns};
|