graview 0.1.60 → 0.1.61
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.ERFT54HT.js → chunk.2AWVQ5SW.js} +1 -1
- package/dist/preview/{chunk.LQVAABPS.js → chunk.2LNSENPV.js} +1 -1
- package/dist/preview/chunk.2QFKNTAZ.js +1 -0
- package/dist/preview/{chunk.ZXOT3IXJ.js → chunk.2WZAFKJ2.js} +1 -1
- package/dist/preview/{chunk.VZJWJ5XM.js → chunk.2XSIJH5J.js} +1 -1
- package/dist/preview/{chunk.GNBIVVL3.js → chunk.3FUUYYR5.js} +1 -1
- package/dist/preview/{chunk.NHUQ2N6J.js → chunk.3HFUO3DC.js} +1 -1
- package/dist/preview/chunk.3ICWPRRJ.js +1 -0
- package/dist/preview/{chunk.XR6YR6RV.js → chunk.3RW677X6.js} +1 -1
- package/dist/preview/{chunk.FBJARKDT.js → chunk.3SMNWZ3M.js} +1 -1
- package/dist/preview/{chunk.JPONLMU7.js → chunk.4G32374Q.js} +1 -1
- package/dist/preview/{chunk.IGJZ4UH3.js → chunk.4LG34OC2.js} +2 -2
- package/dist/preview/{chunk.3ZT5WQYL.js → chunk.4OEWFPH3.js} +1 -1
- package/dist/preview/{chunk.UITT6JWW.js → chunk.4STDIZVI.js} +1 -1
- package/dist/preview/{chunk.ZP5RT2EK.js → chunk.5POG3G2C.js} +1 -1
- package/dist/preview/{chunk.ULL6ZIJJ.js → chunk.5S7IGASX.js} +1 -1
- package/dist/preview/chunk.5T53SF2K.js +1 -0
- package/dist/preview/{chunk.3MOJF7BA.js → chunk.5X22RKB3.js} +1 -1
- package/dist/preview/{chunk.LSY256J4.js → chunk.65KFZV3A.js} +1 -1
- package/dist/preview/chunk.66IKLMYX.js +104 -0
- package/dist/preview/chunk.6DOOLVT4.js +1 -0
- package/dist/preview/{chunk.TLJOZSDD.js → chunk.6HZY5NRX.js} +1 -1
- package/dist/preview/{chunk.RQOX5YDW.js → chunk.6SO64TUI.js} +1 -1
- package/dist/preview/{chunk.2USDHXB4.js → chunk.6VLCMBRE.js} +1 -1
- package/dist/preview/{chunk.ENL2JJ47.js → chunk.747OH3EE.js} +1 -1
- package/dist/preview/chunk.7CETF4A6.js +1 -0
- package/dist/preview/{chunk.MVWC3VR3.js → chunk.7LZ6JDJA.js} +2 -2
- package/dist/preview/{chunk.PI44XMY2.js → chunk.7R727IKU.js} +1 -1
- package/dist/preview/chunk.A2ZQASQV.js +1 -0
- package/dist/preview/chunk.AVFOTYZR.js +74 -0
- package/dist/preview/{chunk.VUBNBTJP.js → chunk.BDTT4ENI.js} +2 -2
- package/dist/preview/{chunk.SB2PZKN5.js → chunk.BFDJTWGX.js} +1 -1
- package/dist/preview/{chunk.6ZQAR5ZA.js → chunk.BI6DS3PZ.js} +1 -1
- package/dist/preview/{chunk.KI37ZEV3.js → chunk.BJI2C3IZ.js} +1 -1
- package/dist/preview/{chunk.YFSBVZTG.js → chunk.C634A6ZC.js} +1 -1
- package/dist/preview/{chunk.ZYM2SSGW.js → chunk.CRCJ3TAG.js} +1 -1
- package/dist/preview/{chunk.WXUFATY5.js → chunk.CUTLO6DA.js} +1 -1
- package/dist/preview/chunk.D4TA5XDC.js +4 -0
- package/dist/preview/{chunk.HDUO2USQ.js → chunk.D5Q64GA4.js} +1 -1
- package/dist/preview/{chunk.RXYNW5QB.js → chunk.DHJI7LIW.js} +1 -1
- package/dist/preview/{chunk.6HF6POIX.js → chunk.DHY7KOBV.js} +1 -1
- package/dist/preview/chunk.DKXVEVDG.js +1 -0
- package/dist/preview/{chunk.NC7FXY2H.js → chunk.DLDP6OWD.js} +1 -1
- package/dist/preview/{chunk.H45Q3O4F.js → chunk.DP5DUV6F.js} +1 -1
- package/dist/preview/chunk.DXWTM4SH.js +1 -0
- package/dist/preview/{chunk.BQIHNT7C.js → chunk.E6RNMWFN.js} +1 -1
- package/dist/preview/{chunk.A3ZXDG6V.js → chunk.E7UDVC4V.js} +1 -1
- package/dist/preview/{chunk.M4UD4ARP.js → chunk.EN2ABVIP.js} +1 -1
- package/dist/preview/{chunk.7MHCGVGM.js → chunk.EVEHSENK.js} +1 -1
- package/dist/preview/{chunk.SRVQJZRT.js → chunk.F4VHCQNP.js} +1 -1
- package/dist/preview/{chunk.4TCKEG6I.js → chunk.F7IQ4B6A.js} +1 -1
- package/dist/preview/chunk.F7PIW2EM.js +5 -0
- package/dist/preview/{chunk.GTKJJYQH.js → chunk.FJIXSGYU.js} +1 -1
- package/dist/preview/{chunk.HDP3PS7N.js → chunk.FWUG7Y6C.js} +1 -1
- package/dist/preview/chunk.G4VMRYS4.js +1 -0
- package/dist/preview/{chunk.URWAFZHF.js → chunk.GI6XQF5X.js} +1 -1
- package/dist/preview/{chunk.Y5C4RXG7.js → chunk.GIW657OR.js} +1 -1
- package/dist/preview/chunk.GPWYWALF.js +1 -0
- package/dist/preview/{chunk.YZ7FUKAL.js → chunk.GQNSNJTJ.js} +1 -1
- package/dist/preview/chunk.HGVBGSRS.js +6 -0
- package/dist/preview/{chunk.VNDKKTED.js → chunk.HOQMD6WQ.js} +1 -1
- package/dist/preview/{chunk.TKVLNBRD.js → chunk.HQNE4I4M.js} +1 -1
- package/dist/preview/{chunk.A5PDXNY6.js → chunk.HZHNM2KI.js} +1 -1
- package/dist/preview/{chunk.TAT2IQUR.js → chunk.IA5ZBMRD.js} +1 -1
- package/dist/preview/{chunk.VFOON3Z3.js → chunk.ISRQQVS4.js} +1 -1
- package/dist/preview/{chunk.T7LQD67N.js → chunk.ISXNAFRC.js} +2 -2
- package/dist/preview/{chunk.QBLKTFF4.js → chunk.JEQO24GS.js} +1 -1
- package/dist/preview/{chunk.VWJGQDCE.js → chunk.JHAFQNGC.js} +1 -1
- package/dist/preview/chunk.JU3BCCQM.js +1 -0
- package/dist/preview/{chunk.5DD62IOW.js → chunk.K2AC536Q.js} +2 -2
- package/dist/preview/chunk.K3UOXAZS.js +1 -0
- package/dist/preview/{chunk.CC5BJH5A.js → chunk.KRFRREEW.js} +1 -1
- package/dist/preview/chunk.LA2DMHZC.js +1 -0
- package/dist/preview/chunk.LQAT7FA6.js +3 -0
- package/dist/preview/{chunk.UJTE7UAP.js → chunk.LTI5PKTS.js} +1 -1
- package/dist/preview/chunk.MBP7VDYM.js +1 -0
- package/dist/preview/{chunk.EL5ICOOM.js → chunk.MBPOYZ3J.js} +1 -1
- package/dist/preview/chunk.MBU7UH6J.js +1 -0
- package/dist/preview/chunk.MH6CCHEX.js +1 -0
- package/dist/preview/{chunk.DCHQHKSA.js → chunk.MK72IRIY.js} +1 -1
- package/dist/preview/{chunk.VMV464JK.js → chunk.MNRTA2CB.js} +1 -1
- package/dist/preview/chunk.MU3XII7I.js +1 -0
- package/dist/preview/chunk.MYVED5LU.js +1 -0
- package/dist/preview/chunk.N5WDQAIM.js +5 -0
- package/dist/preview/{chunk.4MP72LPR.js → chunk.N7T7VB77.js} +1 -1
- package/dist/preview/{chunk.QHDCTAD7.js → chunk.NUEPFPRA.js} +1 -1
- package/dist/preview/chunk.ODVRO2BJ.js +1 -0
- package/dist/preview/{chunk.5YOLUDVO.js → chunk.OVPFROL3.js} +1 -1
- package/dist/preview/{chunk.W3W54DSX.js → chunk.PGA5TUSN.js} +1 -1
- package/dist/preview/{chunk.TLWT67ON.js → chunk.PJ5AO7CK.js} +1 -1
- package/dist/preview/{chunk.TFWIG6LL.js → chunk.PYVWGTQS.js} +1 -1
- package/dist/preview/{chunk.7OPM55I2.js → chunk.PZXTSWDH.js} +1 -1
- package/dist/preview/chunk.Q5I5M3FR.js +1 -0
- package/dist/preview/chunk.QATUGE34.js +1 -0
- package/dist/preview/{chunk.PFSYXD6Q.js → chunk.QL77K3D4.js} +1 -1
- package/dist/preview/{chunk.7N32AVIJ.js → chunk.R3N73BJO.js} +1 -1
- package/dist/preview/{chunk.P6RORYOT.js → chunk.R5547CJ7.js} +1 -1
- package/dist/preview/chunk.REH6RXNH.js +1 -0
- package/dist/preview/{chunk.UQWTZJBV.js → chunk.RZ5PPQBV.js} +1 -1
- package/dist/preview/{chunk.QDSEVPF3.js → chunk.SAYAFOF6.js} +1 -1
- package/dist/preview/{chunk.FRYBMS3W.js → chunk.SBLYBRDU.js} +1 -1
- package/dist/preview/{chunk.YH63KQ2G.js → chunk.SCGF4ZPP.js} +1 -1
- package/dist/preview/{chunk.HUJ6YTWE.js → chunk.SIYBHZDD.js} +1 -1
- package/dist/preview/{chunk.KDRLUBVF.js → chunk.SJALH7IX.js} +1 -1
- package/dist/preview/{chunk.F6V7RWDK.js → chunk.SKQO467Y.js} +1 -1
- package/dist/preview/chunk.SLAZFFCQ.js +1 -0
- package/dist/preview/chunk.SLPJWOKC.js +1 -0
- package/dist/preview/{chunk.JEYQBH33.js → chunk.TKLYUVMR.js} +1 -1
- package/dist/preview/chunk.TMAZNDA6.js +1 -0
- package/dist/preview/{chunk.IGVASEZU.js → chunk.U2ISOUM2.js} +1 -1
- package/dist/preview/{chunk.VADQ7ZGA.js → chunk.U3JK2DNC.js} +1 -1
- package/dist/preview/chunk.U5P23GO7.js +1 -0
- package/dist/preview/{chunk.KBVTLNS5.js → chunk.UACSX64H.js} +3 -3
- package/dist/preview/{chunk.Z2ERZ4S6.js → chunk.ULHB3RYK.js} +1 -1
- package/dist/preview/{chunk.MSWWWLEA.js → chunk.UO544PZH.js} +1 -1
- package/dist/preview/{chunk.Y7G3OGDE.js → chunk.UXOBUK3C.js} +1 -1
- package/dist/preview/{chunk.BRT27WON.js → chunk.VKHAAH32.js} +1 -1
- package/dist/preview/{chunk.3XGA65Y3.js → chunk.VN7I7XIO.js} +1 -1
- package/dist/preview/{chunk.CFKZXLXS.js → chunk.VOOOIECX.js} +1 -1
- package/dist/preview/chunk.VS6NT5C4.js +1 -0
- package/dist/preview/{chunk.67U6M7OV.js → chunk.VUAOCYG2.js} +1 -1
- package/dist/preview/{chunk.PNW5K7BW.js → chunk.VX65S2FA.js} +1 -1
- package/dist/preview/{chunk.VDMDPZ6U.js → chunk.VYFMUCBT.js} +1 -1
- package/dist/preview/{chunk.FFTYMBBT.js → chunk.W5TVQYAI.js} +1 -1
- package/dist/preview/{chunk.OLFJH4RK.js → chunk.WD4VPMEE.js} +1 -1
- package/dist/preview/{chunk.BXDM3UMN.js → chunk.WICFQROI.js} +1 -1
- package/dist/preview/{chunk.NGTRL5U4.js → chunk.WS7LAT4Z.js} +1 -1
- package/dist/preview/{chunk.IHBUBZQT.js → chunk.X2I3XH2E.js} +1 -1
- package/dist/preview/{chunk.6WHAWOO7.js → chunk.XFSGB6EU.js} +1 -1
- package/dist/preview/{chunk.XGASJAV2.js → chunk.XWWSW3ZV.js} +1 -1
- package/dist/preview/chunk.XZUHFXME.js +1 -0
- package/dist/preview/{chunk.CQT3W2SF.js → chunk.XZWXDQ3N.js} +1 -1
- package/dist/preview/{chunk.IOK4GVJC.js → chunk.Y7H5O2SL.js} +1 -1
- package/dist/preview/chunk.YGIJDHAV.js +2 -0
- package/dist/preview/{chunk.3V4WP7RY.js → chunk.YOT7ESDG.js} +3 -3
- package/dist/preview/{chunk.MJVYWLQQ.js → chunk.ZC3FRCJQ.js} +1 -1
- package/dist/preview/{chunk.AVBTPSQF.js → chunk.ZJCM62GH.js} +1 -1
- package/dist/preview/{chunk.4LR64TPU.js → chunk.ZKAZA6UJ.js} +1 -1
- package/dist/preview/{chunk.3UOKUF5Z.js → chunk.ZQHCNFJK.js} +1 -1
- package/dist/preview/{chunk.6C2MHWSX.js → chunk.ZVG3DR5G.js} +1 -1
- package/dist/preview/chunk.ZYNUMVEC.js +1 -0
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2K4TT2BV.js +0 -1
- package/dist/preview/chunk.37TVS7CA.js +0 -1
- package/dist/preview/chunk.3IZ3ABII.js +0 -1
- package/dist/preview/chunk.7TFLRR7D.js +0 -1
- package/dist/preview/chunk.7VKSXGTX.js +0 -1
- package/dist/preview/chunk.BF6S5UE4.js +0 -1
- package/dist/preview/chunk.BLPYNNR4.js +0 -1
- package/dist/preview/chunk.BYKD5RLA.js +0 -1
- package/dist/preview/chunk.C7OLSEWK.js +0 -1
- package/dist/preview/chunk.CMN6BBAD.js +0 -1
- package/dist/preview/chunk.D7YSL3NK.js +0 -2
- package/dist/preview/chunk.EQXB7LKI.js +0 -1
- package/dist/preview/chunk.FLUK3UXF.js +0 -1
- package/dist/preview/chunk.G3R4BTI7.js +0 -1
- package/dist/preview/chunk.G4YJPKRG.js +0 -5
- package/dist/preview/chunk.GLWSVSQL.js +0 -1
- package/dist/preview/chunk.I4XQBQRC.js +0 -1
- package/dist/preview/chunk.IBOKXVWN.js +0 -1
- package/dist/preview/chunk.JJGCTGWA.js +0 -1
- package/dist/preview/chunk.KGW75Z5L.js +0 -3
- package/dist/preview/chunk.L6AWE76F.js +0 -1
- package/dist/preview/chunk.LGEA5257.js +0 -6
- package/dist/preview/chunk.LLYRFVIN.js +0 -104
- package/dist/preview/chunk.LZIBQ3VX.js +0 -1
- package/dist/preview/chunk.MDJWK5W2.js +0 -1
- package/dist/preview/chunk.PHJ6WPWH.js +0 -1
- package/dist/preview/chunk.QFUMFQJU.js +0 -1
- package/dist/preview/chunk.QI4SLPQ4.js +0 -4
- package/dist/preview/chunk.TY4GQJKC.js +0 -1
- package/dist/preview/chunk.VSCIXAHN.js +0 -5
- package/dist/preview/chunk.WC3DENU4.js +0 -67
- package/dist/preview/chunk.WQ6RCEUQ.js +0 -1
- package/dist/preview/chunk.X6A4VSSD.js +0 -1
- package/dist/preview/chunk.XZPKBHJT.js +0 -1
- package/dist/preview/chunk.YEBGI6ED.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as K}from"./chunk.RQOX5YDW.js";import{Db as V,fc as Y,gc as X,h as P,jb as G,jc as B,k as R,oa as q,q as I,rc as $,sc as N,vb as h,wb as v,x as _}from"./chunk.VSCIXAHN.js";import{a as T,c as C,h as L}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var te=Symbol.for("@graview/core:markdown"),ne=500;function ie(e){let n=e;for(let i=0;i<6;i++){let t=N(n);if(!t)return!1;if(t[$]!==void 0)return t[$]===1;if(t[te]===1)return!0;if(t.type==="string")return(t.checks??[]).some(s=>{let f=N(s);return f?.check==="max_length"&&(f.maximum??0)>ne});if(t.innerType===void 0)return!1;n=t.innerType}return!1}function O(e,n,i){if(n===void 0||i==="id"||i==="kind")return!1;let t=e.tryDefinition(n)?.fields?.shape;return!!t&&Object.prototype.hasOwnProperty.call(t,i)&&ie(t[i])}var re=e=>e>=55296&&e<=56319,oe=e=>e>=56320&&e<=57343;function S(e,n){let i=Math.min(e.length,n.length),t=0;for(;t<i&&e.charCodeAt(t)===n.charCodeAt(t);)t++;t>0&&re(e.charCodeAt(t-1))&&t--;let s=0;for(;s<i-t&&e.charCodeAt(e.length-1-s)===n.charCodeAt(n.length-1-s);)s++;return s>0&&oe(e.charCodeAt(e.length-s))&&s--,{at:t,removed:e.slice(t,e.length-s),inserted:n.slice(t,n.length-s)}}var w=e=>e.at+e.removed.length;function H(e){let n=S(e.removed,e.inserted);return{...n,at:e.at+n.at}}function U(e,n,i){if(w(e)<n.at)return e;if(e.at>w(n))return{...e,at:e.at+n.inserted.length-n.removed.length};let t=Math.min(e.at,n.at),s=w(e)-w(n),f=e.removed.slice(0,n.at-t)+n.inserted+(s>0?e.removed.slice(e.removed.length-s):""),r=n.at<e.at||n.at===e.at&&i;return H({at:t,removed:f,inserted:r?n.inserted+e.inserted:e.inserted+n.inserted})}function b(e,n){return[U(e,n,!1),U(n,e,!0)]}function D(e,n){let i=e.at+e.inserted.length;if(w(n)<e.at||n.at>i)return;let t=Math.min(e.at,n.at),s=w(n)-i,f=n.removed.slice(0,e.at-t),r=s>0?n.removed.slice(n.removed.length-s):"",l=T(f+e.inserted+r,{...n,at:n.at-t});return H({at:t,removed:f+e.removed+r,inserted:l})}function M(e,n,i){switch(e.op){case"patch-node":return e.id===n&&Object.prototype.hasOwnProperty.call(e.after,i);case"add-node":case"remove-node":return e.node.id===n;default:return!1}}function j(e,n,i){if(e.op!=="patch-node"||e.id!==n||!Object.prototype.hasOwnProperty.call(e.after,i))return;let t=e.before[i],s=e.after[i];return typeof s=="string"&&(t===void 0||t===""||C(t))?{at:0,removed:"",inserted:s}:void 0}var J=(e,n,i)=>e.flatMap(t=>t.op==="splice-text"&&t.id===n&&t.field===i?[t]:[]);function E(e,n,i,t,s,f){if(typeof f!="string"||s<n-1)return;let r=[];for(let o of e)if(!(o.seq<=s))for(let p of o.primitives){let a=j(p,i,t);if(a){r.push(a);continue}if(M(p,i,t))return;p.op==="splice-text"&&p.id===i&&p.field===t&&r.push(p)}let l=f;try{for(let o=r.length-1;o>=0;o--){let p=r[o];l=T(l,{at:p.at,removed:p.inserted,inserted:p.removed})}}catch{return}return{then:l,since:r}}function A(e,n){let i=e;for(let t of n)i=b(t,i)[1];return{at:i.at,removed:i.removed,inserted:i.inserted}}function Q(e,n,i){let t=i?A(S(i.then,n),i.since):S(e,n);return t.removed===""&&t.inserted===""?void 0:t}function Z(e){let n=e.schema,i=t=>{throw new V(t,"invalid")};return{name:h,title:"Type text",input:I({node:P(),field:P(),at:R(),remove:R(),insert:P(),rev:_(R())}),subject:{kinds:"*",arg:"node"},writes:[],describe:(t,s)=>{let{node:f,field:r,insert:l,remove:o}=t;return K({node:f,field:r,inserted:[...String(l??"")].length,removed:Number(o)||0},n,s)},apply(t,s){let{node:f,field:r,at:l,remove:o,insert:p,rev:a}=s;(![l,o,a??0].every(k=>Number.isInteger(k)&&k>=-1)||l<0||o<0)&&i("at and remove are whole numbers, none below 0, and rev a revision");let d=t.graph.getNode(f);if(!d)throw new G(f,"\u201CType text\u201D names a record that is not there.");if(O(n,d.kind,r)||i(`${q(n.tryDefinition(d.kind),d.kind)}'s "${r}" is not text typed together: write it whole, as its edit does`),o===0&&p==="")return;let c=d[r];if(typeof c!="string"||c===""){t.patchNode(f,{[r]:p});return}let g=e.graph.getNode(f)?.[r],m=a===void 0?{then:c,since:[]}:E(e.log.all(),e.log.horizon,f,r,Math.max(a,-1),g);m||i(`${r} was written whole since revision ${a}: read it again and type over what it holds now`);let{then:u,since:y}=m;l+o>u.length&&i(`${r} held ${u.length} characters at revision ${a??"now"}, so there is nothing at ${l}${o>0?`\u2013${l+o}`:""} to type over`);let x=A({at:l,removed:u.slice(l,l+o),inserted:p},y);x.removed===""&&x.inserted===""||t.emit({op:"splice-text",id:f,field:r,...x})}}}function ee(e,n,i,t,s=()=>!0){let f=i===void 0?void 0:e.tryDefinition(i);if(!f||typeof t!="string")return[];let r=new Set;for(let l of n)if(!(l.name===h||!Y(e,l).includes(i)||!X(l,f).includes(t))&&s(l)){r.add(l.name);for(let o of B(e,n,l)??[])r.add(o)}return[...r]}function se(e,n,i){if(!n.some(r=>r.op==="patch-node"))return[...n];let t=new Set,s=new Set,f=[];for(let r of n){if(r.op==="add-node"&&t.add(r.node.id),r.op!=="patch-node"||t.has(r.id)){r.op==="splice-text"&&s.add(`${r.id}\0${r.field}`),f.push(r);continue}let l=e.graph.getNode(r.id),o={},p={},a=[];for(let[d,c]of Object.entries(r.after)){let g=l?.[d],m=`${r.id}\0${d}`;if(typeof c=="string"&&typeof g=="string"&&g!==""&&!s.has(m)&&O(e.schema,l?.kind,d)){let u=i?.find(x=>x.node===r.id&&x.field===d),y=Q(g,c,u?E(e.log.all(),e.log.horizon,r.id,d,u.rev,g):void 0);if(y){a.push({op:"splice-text",id:r.id,field:d,...y}),s.add(m);continue}}o[d]=r.before[d],p[d]=c,s.add(m)}Object.keys(p).length>0&&f.push(a.length>0?{op:"patch-node",id:r.id,before:o,after:p}:r),f.push(...a)}return f}function de(e,n){let i=[];return[...n].sort((t,s)=>s.seq-t.seq).map(t=>{let s=L(t);if(!s.some(o=>o.op==="splice-text"))return i.push(...s),{op:t,primitives:s};let f=e.filter(o=>o.seq>t.seq).flatMap(o=>o.primitives),r=t.primitives.length,l=[];return s.forEach((o,p)=>{if(o.op!=="splice-text")return void l.push(o);let a=A(o,J([...t.primitives.slice(r-p),...f,...i,...l],o.id,o.field));(a.removed!==""||a.inserted!=="")&&l.push({op:"splice-text",id:o.id,field:o.field,...a})}),i.push(...l),{op:t,primitives:l}})}function ae(e,n){let i=(t,s)=>e.some(f=>M(f,t,s));return n.undoes!==void 0&&n.primitives.length===0&&e.some(t=>t.op==="splice-text")||n.primitives.length>0&&n.primitives.every(t=>t.op==="splice-text"&&!i(t.id,t.field))?!0:e.flatMap(t=>t.op==="splice-text"&&n.primitives.some(s=>M(s,t.id,t.field))?[t.id]:[])}function le(e,n,i){let t=new Map,s=[],f=new Set;for(let a of e){let d=a.primitives[0],c=a.mutation?.args,g=a.mutation?.name!==h||a.primitives.length!==1||!d?void 0:d.op==="splice-text"?d:j(d,String(c?.node),String(c?.field));g?s.push({batch:a.batch,node:String(c?.node),field:String(c?.field),splice:g}):f.add(a.batch)}if(s.length===0)return t;let r=a=>`${a.node}\0${a.field}`,l=new Set,o=new Set(e.map(a=>a.batch).filter(a=>!i.includes(a))),p=s;for(let a of n){if(o.has(a.batch)){p=p.filter(d=>d.batch!==a.batch);continue}for(let d of a.primitives){if(d.op==="add-edge"||d.op==="remove-edge")continue;let c=d.op==="add-node"||d.op==="remove-node"?d.node.id:d.id;for(let g of new Set(p.filter(m=>m.node===c).map(m=>m.field))){let m=d.op==="splice-text"?d.field===g?d:void 0:j(d,c,g);for(let u of p)u.node!==c||u.field!==g||(m?[m,u.splice]=b(m,u.splice):M(d,u.node,u.field)&&l.add(r(u)))}}}p.forEach((a,d)=>{if(!o.has(a.batch))return;let c={at:a.splice.at,removed:a.splice.inserted,inserted:a.splice.removed};for(let g of p.slice(d+1))r(g)===r(a)&&([c,g.splice]=b(c,g.splice))});for(let a of i){let d=p.filter(c=>c.batch===a);d.length===0||f.has(a)||d.some(c=>l.has(r(c)))||t.set(a,d.map(c=>({name:h,args:{node:c.node,field:c.field,at:c.splice.at,remove:c.splice.removed.length,insert:c.splice.inserted}})))}return t}v.typeText=Z;v.via=ee;v.collaborative=O;v.asSplices=se;v.undone=de;v.aside=ae;v.carried=le;function Ye(e){let{store:n,author:i,pending:t,provisional:s,asked:f}=e,r=new Map,l=(o,p)=>{r.get(o)?.(p),r.delete(o)};return{store:n,apply:(o,p)=>e.appliedAll(o,{...i?{author:i}:{},...p!==void 0?{batch:p}:{}}),hold(o){t.push(o),s.add(o),e.answers.set(o,new Promise(p=>r.set(o,p)))},ask:(o,p)=>void f.set(o,{calls:p}),send(o,p){f.set(o,{calls:p});let a=e.sent(o,p),d=()=>l(o,a);return a.then(c=>{Array.isArray(c?.ops)&&c.ops.length===0&&e.letGo.add(o),d()},d),a},drop(o){e.letGo.add(o),e.settle(o),f.delete(o),e.land([],[o]),l(o)},seen:e.seen,gone:e.gone,ahead(o,p,a){let d=t.indexOf(o),c=n.log.all(),g=m=>c.some(u=>u.batch===m&&u.primitives.some(y=>y.op==="splice-text"&&y.id===p&&y.field===a||y.op==="patch-node"&&y.id===p&&a in y.after));return t.slice(0,Math.max(0,d)).flatMap(m=>{let u=e.answers.get(m);return u&&g(m)?[{batch:m,answer:u}]:[]})}}}var ce=400,pe=/[\s.,;:!?)\]}]$/u,W=e=>typeof e=="string"?e:"";function z(e,n,i,t){let s=e.log.all(),f=s.findIndex(o=>o.batch===n);if(f<0)return;let r=W(e.graph.getNode(i)?.[t]),l;for(let o=s.length-1;o>=f;o--){let p=s[o];p.batch===n&&l===void 0&&(l=r);for(let a=p.primitives.length-1;a>=0;a--){let d=p.primitives[a];d.op==="splice-text"&&d.id===i&&d.field===t?r=T(r,{at:d.at,removed:d.inserted,inserted:d.removed}):d.op==="patch-node"&&d.id===i&&t in d.after&&(r=C(d.before[t])?"":W(d.before[t]))}}if(!(l===void 0||l===r))return S(r,l)}function Xe(e,n,i){let t,s=[],f,r,l=!1,o=new Set,p=c=>({name:h,args:{node:e,field:n,at:c.at,remove:c.removed.length,insert:c.inserted,rev:i.seen()}}),a=()=>{r&&clearTimeout(r),r=void 0,t!==void 0&&s.push(t),t=void 0,d()},d=()=>{if(f!==void 0||l||i.gone())return;let c=s.shift();if(c===void 0)return;let g=i.ahead(c,e,n).filter(u=>!o.has(u.batch));if(g.length>0){s.unshift(c),l=!0,Promise.allSettled(g.map(u=>u.answer)).then(()=>{for(let u of g)o.add(u.batch);l=!1,d()});return}let m=z(i.store,c,e,n);if(!m)return i.drop(c),d();f=c,i.send(c,[p(m)]).finally(()=>{f=void 0,d()})};return{splice(c,g,m){if(i.gone())return;let u=W(i.store.graph.getNode(e)?.[n]),y={at:c,removed:u.slice(c,c+g),inserted:m};if(t!==void 0){let F=z(i.store,t,e,n);(!F||!D(F,y))&&a()}let x=i.apply([{name:h,args:{node:e,field:n,at:c,remove:g,insert:m}}],t);if(x.ops.length===0)return;t===void 0&&(t=x.batch,i.hold(t));let k=z(i.store,t,e,n);if(k&&i.ask(t,[p(k)]),pe.test(m))return a();r&&clearTimeout(r),r=setTimeout(a,ce),r.unref?.()},flush:a,waiting:()=>s.length+(t!==void 0?1:0)+(f!==void 0?1:0)}}function Be(e,n){let i=n.find(l=>l.name===h)?.args;if(typeof i?.node!="string"||typeof i.field!="string")return;let{node:t,field:s}=i,f=()=>e.graph.getNode(t)?.[s],r=f();return{node:t,field:s,yours:r,over:l=>{let o=f();return{name:h,args:{node:t,field:s,at:0,remove:typeof o=="string"?o.length:0,insert:typeof r=="string"?r:"",rev:l}}}}}export{ce as TYPING_IDLE_MS,z as runSplice,Xe as typingOf,Ye as wireOf,Be as yoursOf};
|
|
1
|
+
import{d as K}from"./chunk.6SO64TUI.js";import{Db as V,fc as Y,gc as X,h as P,jb as G,jc as B,k as R,oa as q,q as I,rc as $,sc as N,vb as h,wb as v,x as _}from"./chunk.F7PIW2EM.js";import{a as T,c as C,h as L}from"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var te=Symbol.for("@graview/core:markdown"),ne=500;function ie(e){let n=e;for(let i=0;i<6;i++){let t=N(n);if(!t)return!1;if(t[$]!==void 0)return t[$]===1;if(t[te]===1)return!0;if(t.type==="string")return(t.checks??[]).some(s=>{let f=N(s);return f?.check==="max_length"&&(f.maximum??0)>ne});if(t.innerType===void 0)return!1;n=t.innerType}return!1}function O(e,n,i){if(n===void 0||i==="id"||i==="kind")return!1;let t=e.tryDefinition(n)?.fields?.shape;return!!t&&Object.prototype.hasOwnProperty.call(t,i)&&ie(t[i])}var re=e=>e>=55296&&e<=56319,oe=e=>e>=56320&&e<=57343;function S(e,n){let i=Math.min(e.length,n.length),t=0;for(;t<i&&e.charCodeAt(t)===n.charCodeAt(t);)t++;t>0&&re(e.charCodeAt(t-1))&&t--;let s=0;for(;s<i-t&&e.charCodeAt(e.length-1-s)===n.charCodeAt(n.length-1-s);)s++;return s>0&&oe(e.charCodeAt(e.length-s))&&s--,{at:t,removed:e.slice(t,e.length-s),inserted:n.slice(t,n.length-s)}}var w=e=>e.at+e.removed.length;function H(e){let n=S(e.removed,e.inserted);return{...n,at:e.at+n.at}}function U(e,n,i){if(w(e)<n.at)return e;if(e.at>w(n))return{...e,at:e.at+n.inserted.length-n.removed.length};let t=Math.min(e.at,n.at),s=w(e)-w(n),f=e.removed.slice(0,n.at-t)+n.inserted+(s>0?e.removed.slice(e.removed.length-s):""),r=n.at<e.at||n.at===e.at&&i;return H({at:t,removed:f,inserted:r?n.inserted+e.inserted:e.inserted+n.inserted})}function b(e,n){return[U(e,n,!1),U(n,e,!0)]}function D(e,n){let i=e.at+e.inserted.length;if(w(n)<e.at||n.at>i)return;let t=Math.min(e.at,n.at),s=w(n)-i,f=n.removed.slice(0,e.at-t),r=s>0?n.removed.slice(n.removed.length-s):"",l=T(f+e.inserted+r,{...n,at:n.at-t});return H({at:t,removed:f+e.removed+r,inserted:l})}function M(e,n,i){switch(e.op){case"patch-node":return e.id===n&&Object.prototype.hasOwnProperty.call(e.after,i);case"add-node":case"remove-node":return e.node.id===n;default:return!1}}function j(e,n,i){if(e.op!=="patch-node"||e.id!==n||!Object.prototype.hasOwnProperty.call(e.after,i))return;let t=e.before[i],s=e.after[i];return typeof s=="string"&&(t===void 0||t===""||C(t))?{at:0,removed:"",inserted:s}:void 0}var J=(e,n,i)=>e.flatMap(t=>t.op==="splice-text"&&t.id===n&&t.field===i?[t]:[]);function E(e,n,i,t,s,f){if(typeof f!="string"||s<n-1)return;let r=[];for(let o of e)if(!(o.seq<=s))for(let p of o.primitives){let a=j(p,i,t);if(a){r.push(a);continue}if(M(p,i,t))return;p.op==="splice-text"&&p.id===i&&p.field===t&&r.push(p)}let l=f;try{for(let o=r.length-1;o>=0;o--){let p=r[o];l=T(l,{at:p.at,removed:p.inserted,inserted:p.removed})}}catch{return}return{then:l,since:r}}function A(e,n){let i=e;for(let t of n)i=b(t,i)[1];return{at:i.at,removed:i.removed,inserted:i.inserted}}function Q(e,n,i){let t=i?A(S(i.then,n),i.since):S(e,n);return t.removed===""&&t.inserted===""?void 0:t}function Z(e){let n=e.schema,i=t=>{throw new V(t,"invalid")};return{name:h,title:"Type text",input:I({node:P(),field:P(),at:R(),remove:R(),insert:P(),rev:_(R())}),subject:{kinds:"*",arg:"node"},writes:[],describe:(t,s)=>{let{node:f,field:r,insert:l,remove:o}=t;return K({node:f,field:r,inserted:[...String(l??"")].length,removed:Number(o)||0},n,s)},apply(t,s){let{node:f,field:r,at:l,remove:o,insert:p,rev:a}=s;(![l,o,a??0].every(k=>Number.isInteger(k)&&k>=-1)||l<0||o<0)&&i("at and remove are whole numbers, none below 0, and rev a revision");let d=t.graph.getNode(f);if(!d)throw new G(f,"\u201CType text\u201D names a record that is not there.");if(O(n,d.kind,r)||i(`${q(n.tryDefinition(d.kind),d.kind)}'s "${r}" is not text typed together: write it whole, as its edit does`),o===0&&p==="")return;let c=d[r];if(typeof c!="string"||c===""){t.patchNode(f,{[r]:p});return}let g=e.graph.getNode(f)?.[r],m=a===void 0?{then:c,since:[]}:E(e.log.all(),e.log.horizon,f,r,Math.max(a,-1),g);m||i(`${r} was written whole since revision ${a}: read it again and type over what it holds now`);let{then:u,since:y}=m;l+o>u.length&&i(`${r} held ${u.length} characters at revision ${a??"now"}, so there is nothing at ${l}${o>0?`\u2013${l+o}`:""} to type over`);let x=A({at:l,removed:u.slice(l,l+o),inserted:p},y);x.removed===""&&x.inserted===""||t.emit({op:"splice-text",id:f,field:r,...x})}}}function ee(e,n,i,t,s=()=>!0){let f=i===void 0?void 0:e.tryDefinition(i);if(!f||typeof t!="string")return[];let r=new Set;for(let l of n)if(!(l.name===h||!Y(e,l).includes(i)||!X(l,f).includes(t))&&s(l)){r.add(l.name);for(let o of B(e,n,l)??[])r.add(o)}return[...r]}function se(e,n,i){if(!n.some(r=>r.op==="patch-node"))return[...n];let t=new Set,s=new Set,f=[];for(let r of n){if(r.op==="add-node"&&t.add(r.node.id),r.op!=="patch-node"||t.has(r.id)){r.op==="splice-text"&&s.add(`${r.id}\0${r.field}`),f.push(r);continue}let l=e.graph.getNode(r.id),o={},p={},a=[];for(let[d,c]of Object.entries(r.after)){let g=l?.[d],m=`${r.id}\0${d}`;if(typeof c=="string"&&typeof g=="string"&&g!==""&&!s.has(m)&&O(e.schema,l?.kind,d)){let u=i?.find(x=>x.node===r.id&&x.field===d),y=Q(g,c,u?E(e.log.all(),e.log.horizon,r.id,d,u.rev,g):void 0);if(y){a.push({op:"splice-text",id:r.id,field:d,...y}),s.add(m);continue}}o[d]=r.before[d],p[d]=c,s.add(m)}Object.keys(p).length>0&&f.push(a.length>0?{op:"patch-node",id:r.id,before:o,after:p}:r),f.push(...a)}return f}function de(e,n){let i=[];return[...n].sort((t,s)=>s.seq-t.seq).map(t=>{let s=L(t);if(!s.some(o=>o.op==="splice-text"))return i.push(...s),{op:t,primitives:s};let f=e.filter(o=>o.seq>t.seq).flatMap(o=>o.primitives),r=t.primitives.length,l=[];return s.forEach((o,p)=>{if(o.op!=="splice-text")return void l.push(o);let a=A(o,J([...t.primitives.slice(r-p),...f,...i,...l],o.id,o.field));(a.removed!==""||a.inserted!=="")&&l.push({op:"splice-text",id:o.id,field:o.field,...a})}),i.push(...l),{op:t,primitives:l}})}function ae(e,n){let i=(t,s)=>e.some(f=>M(f,t,s));return n.undoes!==void 0&&n.primitives.length===0&&e.some(t=>t.op==="splice-text")||n.primitives.length>0&&n.primitives.every(t=>t.op==="splice-text"&&!i(t.id,t.field))?!0:e.flatMap(t=>t.op==="splice-text"&&n.primitives.some(s=>M(s,t.id,t.field))?[t.id]:[])}function le(e,n,i){let t=new Map,s=[],f=new Set;for(let a of e){let d=a.primitives[0],c=a.mutation?.args,g=a.mutation?.name!==h||a.primitives.length!==1||!d?void 0:d.op==="splice-text"?d:j(d,String(c?.node),String(c?.field));g?s.push({batch:a.batch,node:String(c?.node),field:String(c?.field),splice:g}):f.add(a.batch)}if(s.length===0)return t;let r=a=>`${a.node}\0${a.field}`,l=new Set,o=new Set(e.map(a=>a.batch).filter(a=>!i.includes(a))),p=s;for(let a of n){if(o.has(a.batch)){p=p.filter(d=>d.batch!==a.batch);continue}for(let d of a.primitives){if(d.op==="add-edge"||d.op==="remove-edge")continue;let c=d.op==="add-node"||d.op==="remove-node"?d.node.id:d.id;for(let g of new Set(p.filter(m=>m.node===c).map(m=>m.field))){let m=d.op==="splice-text"?d.field===g?d:void 0:j(d,c,g);for(let u of p)u.node!==c||u.field!==g||(m?[m,u.splice]=b(m,u.splice):M(d,u.node,u.field)&&l.add(r(u)))}}}p.forEach((a,d)=>{if(!o.has(a.batch))return;let c={at:a.splice.at,removed:a.splice.inserted,inserted:a.splice.removed};for(let g of p.slice(d+1))r(g)===r(a)&&([c,g.splice]=b(c,g.splice))});for(let a of i){let d=p.filter(c=>c.batch===a);d.length===0||f.has(a)||d.some(c=>l.has(r(c)))||t.set(a,d.map(c=>({name:h,args:{node:c.node,field:c.field,at:c.splice.at,remove:c.splice.removed.length,insert:c.splice.inserted}})))}return t}v.typeText=Z;v.via=ee;v.collaborative=O;v.asSplices=se;v.undone=de;v.aside=ae;v.carried=le;function Ye(e){let{store:n,author:i,pending:t,provisional:s,asked:f}=e,r=new Map,l=(o,p)=>{r.get(o)?.(p),r.delete(o)};return{store:n,apply:(o,p)=>e.appliedAll(o,{...i?{author:i}:{},...p!==void 0?{batch:p}:{}}),hold(o){t.push(o),s.add(o),e.answers.set(o,new Promise(p=>r.set(o,p)))},ask:(o,p)=>void f.set(o,{calls:p}),send(o,p){f.set(o,{calls:p});let a=e.sent(o,p),d=()=>l(o,a);return a.then(c=>{Array.isArray(c?.ops)&&c.ops.length===0&&e.letGo.add(o),d()},d),a},drop(o){e.letGo.add(o),e.settle(o),f.delete(o),e.land([],[o]),l(o)},seen:e.seen,gone:e.gone,ahead(o,p,a){let d=t.indexOf(o),c=n.log.all(),g=m=>c.some(u=>u.batch===m&&u.primitives.some(y=>y.op==="splice-text"&&y.id===p&&y.field===a||y.op==="patch-node"&&y.id===p&&a in y.after));return t.slice(0,Math.max(0,d)).flatMap(m=>{let u=e.answers.get(m);return u&&g(m)?[{batch:m,answer:u}]:[]})}}}var ce=400,pe=/[\s.,;:!?)\]}]$/u,W=e=>typeof e=="string"?e:"";function z(e,n,i,t){let s=e.log.all(),f=s.findIndex(o=>o.batch===n);if(f<0)return;let r=W(e.graph.getNode(i)?.[t]),l;for(let o=s.length-1;o>=f;o--){let p=s[o];p.batch===n&&l===void 0&&(l=r);for(let a=p.primitives.length-1;a>=0;a--){let d=p.primitives[a];d.op==="splice-text"&&d.id===i&&d.field===t?r=T(r,{at:d.at,removed:d.inserted,inserted:d.removed}):d.op==="patch-node"&&d.id===i&&t in d.after&&(r=C(d.before[t])?"":W(d.before[t]))}}if(!(l===void 0||l===r))return S(r,l)}function Xe(e,n,i){let t,s=[],f,r,l=!1,o=new Set,p=c=>({name:h,args:{node:e,field:n,at:c.at,remove:c.removed.length,insert:c.inserted,rev:i.seen()}}),a=()=>{r&&clearTimeout(r),r=void 0,t!==void 0&&s.push(t),t=void 0,d()},d=()=>{if(f!==void 0||l||i.gone())return;let c=s.shift();if(c===void 0)return;let g=i.ahead(c,e,n).filter(u=>!o.has(u.batch));if(g.length>0){s.unshift(c),l=!0,Promise.allSettled(g.map(u=>u.answer)).then(()=>{for(let u of g)o.add(u.batch);l=!1,d()});return}let m=z(i.store,c,e,n);if(!m)return i.drop(c),d();f=c,i.send(c,[p(m)]).finally(()=>{f=void 0,d()})};return{splice(c,g,m){if(i.gone())return;let u=W(i.store.graph.getNode(e)?.[n]),y={at:c,removed:u.slice(c,c+g),inserted:m};if(t!==void 0){let F=z(i.store,t,e,n);(!F||!D(F,y))&&a()}let x=i.apply([{name:h,args:{node:e,field:n,at:c,remove:g,insert:m}}],t);if(x.ops.length===0)return;t===void 0&&(t=x.batch,i.hold(t));let k=z(i.store,t,e,n);if(k&&i.ask(t,[p(k)]),pe.test(m))return a();r&&clearTimeout(r),r=setTimeout(a,ce),r.unref?.()},flush:a,waiting:()=>s.length+(t!==void 0?1:0)+(f!==void 0?1:0)}}function Be(e,n){let i=n.find(l=>l.name===h)?.args;if(typeof i?.node!="string"||typeof i.field!="string")return;let{node:t,field:s}=i,f=()=>e.graph.getNode(t)?.[s],r=f();return{node:t,field:s,yours:r,over:l=>{let o=f();return{name:h,args:{node:t,field:s,at:0,remove:typeof o=="string"?o.length:0,insert:typeof r=="string"?r:"",rev:l}}}}}export{ce as TYPING_IDLE_MS,z as runSplice,Xe as typingOf,Ye as wireOf,Be as yoursOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O,b}from"./chunk.
|
|
1
|
+
import{a as O,b}from"./chunk.SKQO467Y.js";import"./chunk.6SO64TUI.js";import"./chunk.PGA5TUSN.js";import"./chunk.7R727IKU.js";import"./chunk.LQAT7FA6.js";import"./chunk.AVFOTYZR.js";import"./chunk.HOQMD6WQ.js";import{G as z,T as M,ba as S}from"./chunk.N7T7VB77.js";import"./chunk.SDO3U72B.js";import{id as A}from"./chunk.F7PIW2EM.js";import"./chunk.FQLNBIQ5.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function $({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[C,x]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='activity-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){x(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),x(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),C?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:C}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function j({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='activity-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{j as NotifiedList,$ as NotifySheet};
|
|
@@ -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 te}from"./chunk.Y5C4RXG7.js";import{o as Se,p as ee,s as $,t as be}from"./chunk.IOK4GVJC.js";import{m as J,n as ye,o as we,p as X,q as Z}from"./chunk.OJGHDWI6.js";import{c as ke}from"./chunk.A5PDXNY6.js";import{a as he,b as U,c as j,e as ve,l as Me}from"./chunk.WC3DENU4.js";import{b as de}from"./chunk.VNDKKTED.js";import{D as z,Ea as fe,F as Y,Fa as ge,G as O,Ga as T,J as pe,Ma as _,O as me,Oa as F,T as M,ba as A,ca as q,da as B,m as le,v as ce,z as ue}from"./chunk.4MP72LPR.js";import{a as E}from"./chunk.SDO3U72B.js";import{Xc as ie,ad as ae,ka as H,xd as se}from"./chunk.VSCIXAHN.js";import{b as y}from"./chunk.AJZBJBMO.js";var P=y(O(),1),x=y(M(),1),ne=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VWJGQDCE.js")))),xe=ne.part(t=>(0,x.jsx)(t.HoverChipDoor,{}),{quiet:!0}),De="A",Q=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.YH63KQ2G.js","./chunk.644FUGSX.js","./chunk.IGVASEZU.js","./chunk.QI4SLPQ4.js","./chunk.FRYBMS3W.js","./chunk.3MOJF7BA.js","./chunk.LZIBQ3VX.js","./chunk.HJCQ6I3S.js","./chunk.QDSEVPF3.js","./chunk.7N32AVIJ.js","./chunk.IHBUBZQT.js","./chunk.PNW5K7BW.js","./chunk.ENL2JJ47.js","./chunk.BQIHNT7C.js","./chunk.3XGA65Y3.js","./chunk.2K4TT2BV.js","./chunk.OLFJH4RK.js","./chunk.67U6M7OV.js","./chunk.ZP5RT2EK.js","./chunk.VZJWJ5XM.js","./chunk.6C2MHWSX.js","./chunk.XOZU4OFA.js","./chunk.GLWSVSQL.js","./chunk.YFVJUHAK.js","./chunk.VFOON3Z3.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.IOK4GVJC.js","./chunk.OJGHDWI6.js","./chunk.TLJOZSDD.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZXOT3IXJ.js"))));var Ce=Q.part((t,e)=>(0,x.jsx)(t.InspectorPane,{...e}),{what:"This card's acts"});function Le(t){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&t()},n=globalThis;if(n.requestIdleCallback){let c=n.requestIdleCallback(e,{timeout:5e3});return()=>n.cancelIdleCallback?.(c)}let i=setTimeout(e,2500);return()=>clearTimeout(i)}var Oe=150,Ne="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function Re(t){if(t.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let e=t.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??t.closest("[data-graview-view]")?.getAttribute("data-graview-view");return e?{face:"scene",on:e,about:[e]}:null}function We(t){let{store:e,principal:n,providers:i,ai:c}=A(),p=be(),h=Y(c),r=(0,P.useRef)({aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h});r.current={aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h},(0,P.useEffect)(()=>{if(typeof document>"u")return;let u=null,w=null,k=null,l=g=>{let m=r.current,b=m.chipsOn?m.aimAt(g):null;b&&(k=g,ne.load().then(G=>{k===g&&G.restOn(b,g)},()=>{}))},f=()=>{u&&clearTimeout(u.timer),u=null},s=g=>{let m=r.current,b=m.aimAt(g);if(!b)return;let G=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,m.store.log.length]);G!==w&&(w=G,m.prepareSections(b),Q.load().then(Pe=>Pe.prepareActs(m.store,b,{principal:m.principal,providers:m.providers}),()=>{}))},o=g=>g.target instanceof Element?g.target.closest(Ne):null,d=g=>{if(g.pointerType==="touch")return;let m=o(g);m!==null&&m===u?.element||(f(),m!==null&&(u={element:m,timer:setTimeout(()=>{u=null,s(m),l(m)},Oe)}))},v=g=>{let m=g.relatedTarget;k!==null&&!(m instanceof Node&&k.contains(m))&&(k=null,ne.current?.leaveRest()),u!==null&&(m instanceof Node&&u.element.contains(m)||f())},S=g=>{if(g.pointerType==="mouse")return;let m=o(g);m&&s(m)},I=g=>{if(!fe())return;let m=o(g);m&&s(m)};return document.addEventListener("pointerover",d,{passive:!0}),document.addEventListener("pointerout",v,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",I),()=>{f(),document.removeEventListener("pointerover",d),document.removeEventListener("pointerout",v),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",I)}},[])}function it({placement:t="float",openActs:e,aimAt:n}={}){let{menuAt:i,setMenuAt:c,registerActsDoor:p,ai:h}=A(),{selection:r}=_();We(n??Re),(0,P.useEffect)(()=>{if(Q.current)return;let f=()=>{v(),Q.prefetch()},s=()=>{},o=ge(()=>void(s=Le(f))),d=["pointerdown","keydown"];for(let S of d)document.addEventListener(S,f,{capture:!0,passive:!0});function v(){o(),s();for(let S of d)document.removeEventListener(S,f,{capture:!0})}return v},[]),(0,P.useEffect)(()=>{if(t==="menu")return p({key:De,open:e??(f=>{let s=f.getBoundingClientRect(),o=f.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??f.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;c({x:Math.round(s.left+Math.min(16,s.width/2)),y:Math.round(Math.min(s.bottom,s.top+36)),...o?{on:o}:{}})})}),()=>p(null)},[t,p,c,e]);let u=i!==null||r.length>0&&e===void 0,[w,k]=(0,P.useState)(u);(0,P.useEffect)(()=>{u&&k(!0)},[u]);let l=Y(h)?(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(xe,{})}):null;return!w&&!u?l:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(Ce,{placement:t,chosen:e===void 0})}),l]})}var K=y(O(),1),V=y(M(),1),Ge=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.YH63KQ2G.js","./chunk.25VJPUDH.js","./chunk.644FUGSX.js","./chunk.IGVASEZU.js","./chunk.UJTE7UAP.js","./chunk.JEYQBH33.js","./chunk.MVWC3VR3.js","./chunk.CC5BJH5A.js","./chunk.QI4SLPQ4.js","./chunk.CFKZXLXS.js","./chunk.Y5C4RXG7.js","./chunk.7MHCGVGM.js","./chunk.FRYBMS3W.js","./chunk.LQVAABPS.js","./chunk.NGTRL5U4.js","./chunk.3MOJF7BA.js","./chunk.LZIBQ3VX.js","./chunk.HJCQ6I3S.js","./chunk.QDSEVPF3.js","./chunk.7N32AVIJ.js","./chunk.IHBUBZQT.js","./chunk.PNW5K7BW.js","./chunk.ENL2JJ47.js","./chunk.BQIHNT7C.js","./chunk.TAT2IQUR.js","./chunk.3XGA65Y3.js","./chunk.BYKD5RLA.js","./chunk.2K4TT2BV.js","./chunk.VUBNBTJP.js","./chunk.OLFJH4RK.js","./chunk.67U6M7OV.js","./chunk.ZP5RT2EK.js","./chunk.VZJWJ5XM.js","./chunk.6C2MHWSX.js","./chunk.XOZU4OFA.js","./chunk.GLWSVSQL.js","./chunk.YFVJUHAK.js","./chunk.VFOON3Z3.js","./chunk.WVUJXDXZ.js","./chunk.7VKSXGTX.js","./chunk.TY4GQJKC.js","./chunk.6ZQAR5ZA.js","./chunk.W3W54DSX.js","./chunk.PI44XMY2.js","./chunk.KGW75Z5L.js","./chunk.GZHZLJBF.js","./chunk.IOK4GVJC.js","./chunk.OJGHDWI6.js","./chunk.TLJOZSDD.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ERFT54HT.js")))),He=Ge.part((t,e)=>{let n=t.DraftFrame;return(0,V.jsx)(n,{...e})},{what:"The view"});function ct(t){let{seatTalk:e}=A();return(0,K.useSyncExternalStore)(e.subscribe,()=>e.get().draft!==null,()=>!1)?(0,V.jsx)(K.Suspense,{fallback:null,children:(0,V.jsx)(He,{...t})}):null}var C=y(O(),1),D=y(M(),1),Ae=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.LZIBQ3VX.js","./chunk.D7YSL3NK.js","./chunk.BJUUSIQY.js","./chunk.ZP5RT2EK.js","./chunk.VZJWJ5XM.js","./chunk.6C2MHWSX.js","./chunk.XOZU4OFA.js","./chunk.GLWSVSQL.js","./chunk.HDUO2USQ.js","./chunk.TY4GQJKC.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FFTYMBBT.js")))),ze=Ae.part((t,e)=>{let n=t.QuickAskCard;return(0,D.jsx)(n,{...e})},{what:"The quick ask"});function gt({face:t,on:e=!0}){let{ai:n,aiDesk:i,selection:c,view:p}=A(),h=me()?.open??!1,r=e&&z(n)&&!h,u=ve(i),w=(0,C.useRef)(null),k=(0,C.useRef)({selection:c,place:p.within?.view});return k.current={selection:c,place:p.within?.view},(0,C.useEffect)(()=>{if(!r)return;let l=he(i);return l.drawn+=1,U(l),()=>{l.drawn=Math.max(0,l.drawn-1),l.drawn===0&&(l.open=null),U(l)}},[r,i]),(0,C.useEffect)(()=>{if(!r)return;let l=f=>{if(f.defaultPrevented||f.key.toLowerCase()!=="k"||!(f.metaKey||f.ctrlKey)||f.altKey||f.shiftKey)return;let s=w.current?.closest("[data-graview-embed]"),o=f.target,d=!(o instanceof Node)||o===document.body||o===document.documentElement;if(s&&!(d||o instanceof Node&&s.contains(o)))return;f.preventDefault(),Ae.prefetch();let v=document.activeElement,{selection:S,place:I}=k.current;j(i,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...I?{place:I}:{}},returnTo:v instanceof HTMLElement&&v!==document.body?v:null})};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[r,i]),r?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{ref:w,hidden:!0,"data-graview-quick-ask":t}),u?(0,D.jsx)(C.Suspense,{fallback:null,children:(0,D.jsx)(ze,{face:t,opening:u,close:()=>j(i,null)},u.at)}):null]}):null}var R=y(O(),1),L=y(M(),1),oe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.D7YSL3NK.js","./chunk.BJUUSIQY.js","./chunk.ZP5RT2EK.js","./chunk.VZJWJ5XM.js","./chunk.6C2MHWSX.js","./chunk.XOZU4OFA.js","./chunk.GLWSVSQL.js","./chunk.HDUO2USQ.js","./chunk.TY4GQJKC.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.IBOKXVWN.js")))),qe=oe.part((t,e)=>{let n=t.InlineAiMenu;return(0,L.jsx)(n,{...e})},{what:"The AI's suggestions"}),Be=oe.part((t,e)=>{let n=t.GhostTray;return(0,L.jsx)(n,{...e})},{quiet:!0});function _e(){let{ai:t}=A(),e=z(t);return(0,R.useMemo)(()=>e?n=>({id:"inline-ai",heading:"AI",render:i=>(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(qe,{target:n,close:i})}),prepare:()=>oe.prefetch()}):null,[e])}var Fe=[];function St({children:t}){let e=_e(),n=(0,R.useMemo)(()=>e?[e]:Fe,[e]);return(0,L.jsx)($,{sections:n,children:t})}function bt(t){let{ai:e,aiDesk:n}=A(),{ghost:i}=pe(n);return i===null||i.onCard||e.off?null:(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(Be,{...t})})}var N=y(O(),1);var Te=y(M(),1),Qe=t=>globalThis[Symbol.for("graview.shown-lists")]?.get(t),Ee=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.XGASJAV2.js"))));function Ve(t){let e=t.about[0];if(t.about.length!==1||!e?.startsWith("aggregate:"))return;let n=e.slice(10).split("+");return n.length===1?n[0]:void 0}function Ke(t,e){return t.filter(n=>n.as!==e.as&&!n.hidden&&(n.kind===e.kind||n.over?.includes(e.kind)===!0)).at(-1)}function Ye(t){let e=q(),n=e?.keptViews,i=e?.views,c=(0,N.useContext)(Me);return(0,N.useMemo)(()=>i?p=>{let h=n?.current(),r=Ve(p),u=s=>s.length>0?{id:"tidy-view",items:s,prepare:()=>Ee.prefetch()}:null,w=(s,...o)=>Ee.load().then(d=>d[s](...o),()=>!1),k=(s,o)=>Qe(s)?.().menu(o,n,c)??[];if(p.place===void 0){if(p.face!=="pages"||r===void 0||p.on!==void 0)return null;let s=h?.may.lenses===!0&&n?.lens!==void 0,o=H(e.store.schema,r),d=i.arrangement?.()?.hide?.includes(r)===!0;return u([...s?[{id:d?"show-list":"hide-list",label:d?"Show":"Hide",hint:d?"Back in the places, for everyone":"Off the places, for everyone; still at its address",run:()=>void w("setListHidden",r,o,n,!d,c)}]:[],...k(`list:${r}`,s)])}let l=i.places().find(s=>s.as===p.place&&(r===void 0||s.kind===r||s.over?.includes(r)===!0));if(!l)return null;let f=n&&h?se(l,h,n):null;return u([...f?[l.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>void w("setHidden",l,f,n,!1,c)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>void w("setHidden",l,f,n,!0,c)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let s=Ke(i.places(),l);w("remove",l,f,n,c).then(o=>o&&t?.(l,s))}}]:[],...k(`place:${l.as}`,f==="lens")])}:null,[n,i,c,t])}var Ue=[];function Dt({children:t}){let{view:e,go:n}=F(),i=(0,N.useCallback)((h,r)=>{let u=e.within?.view;e.focusId===ce(h.kind)&&(u===void 0||u===h.as)&&n(r?ue(e,r.kind,r.as):le(e,!0))},[e,n]),c=Ye(i),p=(0,N.useMemo)(()=>c?[c]:Ue,[c]);return(0,Te.jsx)($,{sections:p,children:t})}function Nt(t={}){return t.scope===void 0?te:de(te,t.scope)}var W=y(O(),1),a=y(M(),1);function Bt({inside:t=!1,widthOf:e}={}){let{store:n,view:i,emphasis:c,setEmphasis:p}=A(),h=Se(),{selection:r,set:u}=_(),{show:w}=F(),k=B(),l=(0,W.useMemo)(()=>{let o=new Map;for(let d of n.graph.allEdges()){let v=o.get(d.kind)??{count:0,ends:new Set};v.count+=1;for(let S of[d.from,d.to]){let I=n.graph.getNode(S);I&&v.ends.add(`kind:${I.kind}`)}o.set(d.kind,v)}return[...o.entries()].sort(([d],[v])=>d.localeCompare(v)).map(([d,v])=>({kind:d,count:v.count,ends:[...v.ends]}))},[n,k]),f=Math.max(0,...l.map(o=>o.count));if((0,W.useEffect)(()=>()=>p(null),[p]),!i.overview&&!t||l.length===0)return null;let s=new Set;for(let o of r){if(o.startsWith("kind:")){s.add(o);continue}let d=n.graph.getNode(o);d&&s.add(`kind:${d.kind}`)}return(0,a.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:ae("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:je,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,a.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:l.length===1?"1 relation":`${l.length} relations`}),e?(0,a.jsx)(Xe,{aloft:i.overview===!0}):null,l.map(({kind:o,count:d,ends:v})=>{let{connector:S,style:I}=ee(h,o),g=Je(n.schema,o),m=c!==null?c===o:s.size===0||v.some(b=>s.has(b));return(0,a.jsxs)("button",{type:"button",title:n.schema.edge(o)?.description===void 0?`${d} of these`:g.words,onMouseEnter:()=>p(o),onMouseLeave:()=>p(null),onFocus:()=>p(o),onBlur:()=>p(null),onClick:()=>{u(v),w(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:m?1:.4},children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:i.overview&&e?(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:e(d,f)}):(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:X(I),strokeWidth:Z(I,!0),strokeDasharray:J[I.pattern],strokeLinecap:"round"})}),(0,a.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":o,children:[(0,a.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,a.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,a.jsx)("span",{"data-graview-quiet":o,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,a.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:d})]},o)})]})}var je="min(280px, calc(100% - 28px))";function Je(t,e,n){let i=t.edge(e)?.from??[],c=new Map;for(let r of n!==void 0&&i.includes(n)?[n]:i.length>0?i:[""]){let u=ke(t,r,e,"out");c.set(u,[...c.get(u)??[],r])}let p=r=>r==="*"?"anything":H(t,r),h=[...c].map(([r,u])=>{let w=u.flatMap(l=>t.tryDefinition(l)?.edges[e]?.to??[]),k=u[0]&&w.length>0?`${u.map(p).join(", ")} \u2192 ${(w.includes("*")?["*"]:[...new Set(w)]).map(p).join(", ")}`:"";return[r.charAt(0).toUpperCase()+r.slice(1),k]});return{words:h.map(([r])=>r).join(" \xB7 "),ends:h.flatMap(([,r])=>r?[r]:[]).join(" \xB7 ")}}function _t({edgeKind:t,kit:e,width:n=30}){let i=q(),c=(0,W.useMemo)(()=>ie(e??i?.brand?.kit),[e,i?.brand?.kit]),{connector:p,style:h}=ee(c,t);return(0,a.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:p.visible?1:.35},children:(0,a.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:X(h),strokeWidth:Z(h,!0),strokeDasharray:J[h.pattern],strokeLinecap:"round"})})}function Xe({aloft:t}){let e={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,a.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:e,"data-graview-manner":"ribbon",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,a.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"record",children:[(0,a.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,a.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"district",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,a.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,a.jsxs)("div",{style:e,"data-graview-manner":"unsure",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:we,strokeWidth:1.8,strokeDasharray:ye,strokeLinecap:"round"})}),(0,a.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var Ie=y(O(),1),re=y(M(),1),Ze=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.25VJPUDH.js","./chunk.PNW5K7BW.js","./chunk.ENL2JJ47.js","./chunk.BQIHNT7C.js","./chunk.3XGA65Y3.js","./chunk.2K4TT2BV.js","./chunk.VZJWJ5XM.js","./chunk.MSWWWLEA.js","./chunk.UITT6JWW.js","./chunk.A5PDXNY6.js","./chunk.WC3DENU4.js","./chunk.VNDKKTED.js","./chunk.4MP72LPR.js","./chunk.SDO3U72B.js","./chunk.VSCIXAHN.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.37TVS7CA.js")))),et=Ze.part(t=>(0,re.jsx)(t.SuggestedTray,{}),{quiet:!0});function Vt(){let{store:t,whileAway:e}=A(),n=B();return(0,Ie.useMemo)(()=>t.log.all().some(c=>c.suggests!==void 0&&!c.withheld),[t,n])||e?.tidied?(0,re.jsx)(et,{}):null}export{it as a,ct as b,gt as c,Bt as d,je as e,_t as f,_e as g,St as h,bt as i,Ye as j,Dt as k,Nt as l,Vt as m};
|
|
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 te}from"./chunk.GIW657OR.js";import{o as Se,p as ee,s as $,t as be}from"./chunk.Y7H5O2SL.js";import{m as J,n as ye,o as we,p as X,q as Z}from"./chunk.OJGHDWI6.js";import{c as ke}from"./chunk.HZHNM2KI.js";import{a as he,b as U,c as j,e as ve,l as Me}from"./chunk.AVFOTYZR.js";import{b as de}from"./chunk.HOQMD6WQ.js";import{D as z,Ea as fe,F as Y,Fa as ge,G as O,Ga as T,J as pe,Ma as _,O as me,Oa as F,T as M,ba as A,ca as q,da as B,m as le,v as ce,z as ue}from"./chunk.N7T7VB77.js";import{a as E}from"./chunk.SDO3U72B.js";import{Xc as ie,ad as ae,ka as H,xd as se}from"./chunk.F7PIW2EM.js";import{b as y}from"./chunk.AJZBJBMO.js";var P=y(O(),1),x=y(M(),1),ne=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JHAFQNGC.js")))),xe=ne.part(t=>(0,x.jsx)(t.HoverChipDoor,{}),{quiet:!0}),De="A",Q=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.SCGF4ZPP.js","./chunk.644FUGSX.js","./chunk.U2ISOUM2.js","./chunk.D4TA5XDC.js","./chunk.SBLYBRDU.js","./chunk.5X22RKB3.js","./chunk.XZUHFXME.js","./chunk.HJCQ6I3S.js","./chunk.SAYAFOF6.js","./chunk.R3N73BJO.js","./chunk.X2I3XH2E.js","./chunk.VX65S2FA.js","./chunk.747OH3EE.js","./chunk.E6RNMWFN.js","./chunk.VN7I7XIO.js","./chunk.MBP7VDYM.js","./chunk.WD4VPMEE.js","./chunk.VUAOCYG2.js","./chunk.5POG3G2C.js","./chunk.2XSIJH5J.js","./chunk.ZVG3DR5G.js","./chunk.XOZU4OFA.js","./chunk.LA2DMHZC.js","./chunk.YFVJUHAK.js","./chunk.ISRQQVS4.js","./chunk.MBU7UH6J.js","./chunk.2QFKNTAZ.js","./chunk.BI6DS3PZ.js","./chunk.PGA5TUSN.js","./chunk.7R727IKU.js","./chunk.LQAT7FA6.js","./chunk.Y7H5O2SL.js","./chunk.OJGHDWI6.js","./chunk.6HZY5NRX.js","./chunk.UO544PZH.js","./chunk.4STDIZVI.js","./chunk.HZHNM2KI.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.2WZAFKJ2.js"))));var Ce=Q.part((t,e)=>(0,x.jsx)(t.InspectorPane,{...e}),{what:"This card's acts"});function Le(t){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&t()},n=globalThis;if(n.requestIdleCallback){let c=n.requestIdleCallback(e,{timeout:5e3});return()=>n.cancelIdleCallback?.(c)}let i=setTimeout(e,2500);return()=>clearTimeout(i)}var Oe=150,Ne="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function Re(t){if(t.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let e=t.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??t.closest("[data-graview-view]")?.getAttribute("data-graview-view");return e?{face:"scene",on:e,about:[e]}:null}function We(t){let{store:e,principal:n,providers:i,ai:c}=A(),p=be(),h=Y(c),r=(0,P.useRef)({aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h});r.current={aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h},(0,P.useEffect)(()=>{if(typeof document>"u")return;let u=null,w=null,k=null,l=g=>{let m=r.current,b=m.chipsOn?m.aimAt(g):null;b&&(k=g,ne.load().then(G=>{k===g&&G.restOn(b,g)},()=>{}))},f=()=>{u&&clearTimeout(u.timer),u=null},s=g=>{let m=r.current,b=m.aimAt(g);if(!b)return;let G=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,m.store.log.length]);G!==w&&(w=G,m.prepareSections(b),Q.load().then(Pe=>Pe.prepareActs(m.store,b,{principal:m.principal,providers:m.providers}),()=>{}))},o=g=>g.target instanceof Element?g.target.closest(Ne):null,d=g=>{if(g.pointerType==="touch")return;let m=o(g);m!==null&&m===u?.element||(f(),m!==null&&(u={element:m,timer:setTimeout(()=>{u=null,s(m),l(m)},Oe)}))},v=g=>{let m=g.relatedTarget;k!==null&&!(m instanceof Node&&k.contains(m))&&(k=null,ne.current?.leaveRest()),u!==null&&(m instanceof Node&&u.element.contains(m)||f())},S=g=>{if(g.pointerType==="mouse")return;let m=o(g);m&&s(m)},I=g=>{if(!fe())return;let m=o(g);m&&s(m)};return document.addEventListener("pointerover",d,{passive:!0}),document.addEventListener("pointerout",v,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",I),()=>{f(),document.removeEventListener("pointerover",d),document.removeEventListener("pointerout",v),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",I)}},[])}function it({placement:t="float",openActs:e,aimAt:n}={}){let{menuAt:i,setMenuAt:c,registerActsDoor:p,ai:h}=A(),{selection:r}=_();We(n??Re),(0,P.useEffect)(()=>{if(Q.current)return;let f=()=>{v(),Q.prefetch()},s=()=>{},o=ge(()=>void(s=Le(f))),d=["pointerdown","keydown"];for(let S of d)document.addEventListener(S,f,{capture:!0,passive:!0});function v(){o(),s();for(let S of d)document.removeEventListener(S,f,{capture:!0})}return v},[]),(0,P.useEffect)(()=>{if(t==="menu")return p({key:De,open:e??(f=>{let s=f.getBoundingClientRect(),o=f.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??f.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;c({x:Math.round(s.left+Math.min(16,s.width/2)),y:Math.round(Math.min(s.bottom,s.top+36)),...o?{on:o}:{}})})}),()=>p(null)},[t,p,c,e]);let u=i!==null||r.length>0&&e===void 0,[w,k]=(0,P.useState)(u);(0,P.useEffect)(()=>{u&&k(!0)},[u]);let l=Y(h)?(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(xe,{})}):null;return!w&&!u?l:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(Ce,{placement:t,chosen:e===void 0})}),l]})}var K=y(O(),1),V=y(M(),1),Ge=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.SCGF4ZPP.js","./chunk.25VJPUDH.js","./chunk.644FUGSX.js","./chunk.U2ISOUM2.js","./chunk.LTI5PKTS.js","./chunk.TKLYUVMR.js","./chunk.7LZ6JDJA.js","./chunk.KRFRREEW.js","./chunk.D4TA5XDC.js","./chunk.VOOOIECX.js","./chunk.GIW657OR.js","./chunk.EVEHSENK.js","./chunk.SBLYBRDU.js","./chunk.2LNSENPV.js","./chunk.WS7LAT4Z.js","./chunk.5X22RKB3.js","./chunk.XZUHFXME.js","./chunk.HJCQ6I3S.js","./chunk.SAYAFOF6.js","./chunk.R3N73BJO.js","./chunk.X2I3XH2E.js","./chunk.VX65S2FA.js","./chunk.747OH3EE.js","./chunk.E6RNMWFN.js","./chunk.IA5ZBMRD.js","./chunk.VN7I7XIO.js","./chunk.REH6RXNH.js","./chunk.MBP7VDYM.js","./chunk.BDTT4ENI.js","./chunk.WD4VPMEE.js","./chunk.VUAOCYG2.js","./chunk.5POG3G2C.js","./chunk.2XSIJH5J.js","./chunk.ZVG3DR5G.js","./chunk.XOZU4OFA.js","./chunk.LA2DMHZC.js","./chunk.YFVJUHAK.js","./chunk.ISRQQVS4.js","./chunk.WVUJXDXZ.js","./chunk.MBU7UH6J.js","./chunk.2QFKNTAZ.js","./chunk.BI6DS3PZ.js","./chunk.PGA5TUSN.js","./chunk.7R727IKU.js","./chunk.LQAT7FA6.js","./chunk.GZHZLJBF.js","./chunk.Y7H5O2SL.js","./chunk.OJGHDWI6.js","./chunk.6HZY5NRX.js","./chunk.UO544PZH.js","./chunk.4STDIZVI.js","./chunk.HZHNM2KI.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.2AWVQ5SW.js")))),He=Ge.part((t,e)=>{let n=t.DraftFrame;return(0,V.jsx)(n,{...e})},{what:"The view"});function ct(t){let{seatTalk:e}=A();return(0,K.useSyncExternalStore)(e.subscribe,()=>e.get().draft!==null,()=>!1)?(0,V.jsx)(K.Suspense,{fallback:null,children:(0,V.jsx)(He,{...t})}):null}var C=y(O(),1),D=y(M(),1),Ae=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.XZUHFXME.js","./chunk.YGIJDHAV.js","./chunk.BJUUSIQY.js","./chunk.5POG3G2C.js","./chunk.2XSIJH5J.js","./chunk.ZVG3DR5G.js","./chunk.XOZU4OFA.js","./chunk.LA2DMHZC.js","./chunk.D5Q64GA4.js","./chunk.2QFKNTAZ.js","./chunk.UO544PZH.js","./chunk.4STDIZVI.js","./chunk.HZHNM2KI.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.W5TVQYAI.js")))),ze=Ae.part((t,e)=>{let n=t.QuickAskCard;return(0,D.jsx)(n,{...e})},{what:"The quick ask"});function gt({face:t,on:e=!0}){let{ai:n,aiDesk:i,selection:c,view:p}=A(),h=me()?.open??!1,r=e&&z(n)&&!h,u=ve(i),w=(0,C.useRef)(null),k=(0,C.useRef)({selection:c,place:p.within?.view});return k.current={selection:c,place:p.within?.view},(0,C.useEffect)(()=>{if(!r)return;let l=he(i);return l.drawn+=1,U(l),()=>{l.drawn=Math.max(0,l.drawn-1),l.drawn===0&&(l.open=null),U(l)}},[r,i]),(0,C.useEffect)(()=>{if(!r)return;let l=f=>{if(f.defaultPrevented||f.key.toLowerCase()!=="k"||!(f.metaKey||f.ctrlKey)||f.altKey||f.shiftKey)return;let s=w.current?.closest("[data-graview-embed]"),o=f.target,d=!(o instanceof Node)||o===document.body||o===document.documentElement;if(s&&!(d||o instanceof Node&&s.contains(o)))return;f.preventDefault(),Ae.prefetch();let v=document.activeElement,{selection:S,place:I}=k.current;j(i,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...I?{place:I}:{}},returnTo:v instanceof HTMLElement&&v!==document.body?v:null})};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[r,i]),r?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{ref:w,hidden:!0,"data-graview-quick-ask":t}),u?(0,D.jsx)(C.Suspense,{fallback:null,children:(0,D.jsx)(ze,{face:t,opening:u,close:()=>j(i,null)},u.at)}):null]}):null}var R=y(O(),1),L=y(M(),1),oe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.YGIJDHAV.js","./chunk.BJUUSIQY.js","./chunk.5POG3G2C.js","./chunk.2XSIJH5J.js","./chunk.ZVG3DR5G.js","./chunk.XOZU4OFA.js","./chunk.LA2DMHZC.js","./chunk.D5Q64GA4.js","./chunk.2QFKNTAZ.js","./chunk.UO544PZH.js","./chunk.4STDIZVI.js","./chunk.HZHNM2KI.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DKXVEVDG.js")))),qe=oe.part((t,e)=>{let n=t.InlineAiMenu;return(0,L.jsx)(n,{...e})},{what:"The AI's suggestions"}),Be=oe.part((t,e)=>{let n=t.GhostTray;return(0,L.jsx)(n,{...e})},{quiet:!0});function _e(){let{ai:t}=A(),e=z(t);return(0,R.useMemo)(()=>e?n=>({id:"inline-ai",heading:"AI",render:i=>(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(qe,{target:n,close:i})}),prepare:()=>oe.prefetch()}):null,[e])}var Fe=[];function St({children:t}){let e=_e(),n=(0,R.useMemo)(()=>e?[e]:Fe,[e]);return(0,L.jsx)($,{sections:n,children:t})}function bt(t){let{ai:e,aiDesk:n}=A(),{ghost:i}=pe(n);return i===null||i.onCard||e.off?null:(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(Be,{...t})})}var N=y(O(),1);var Te=y(M(),1),Qe=t=>globalThis[Symbol.for("graview.shown-lists")]?.get(t),Ee=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.XWWSW3ZV.js"))));function Ve(t){let e=t.about[0];if(t.about.length!==1||!e?.startsWith("aggregate:"))return;let n=e.slice(10).split("+");return n.length===1?n[0]:void 0}function Ke(t,e){return t.filter(n=>n.as!==e.as&&!n.hidden&&(n.kind===e.kind||n.over?.includes(e.kind)===!0)).at(-1)}function Ye(t){let e=q(),n=e?.keptViews,i=e?.views,c=(0,N.useContext)(Me);return(0,N.useMemo)(()=>i?p=>{let h=n?.current(),r=Ve(p),u=s=>s.length>0?{id:"tidy-view",items:s,prepare:()=>Ee.prefetch()}:null,w=(s,...o)=>Ee.load().then(d=>d[s](...o),()=>!1),k=(s,o)=>Qe(s)?.().menu(o,n,c)??[];if(p.place===void 0){if(p.face!=="pages"||r===void 0||p.on!==void 0)return null;let s=h?.may.lenses===!0&&n?.lens!==void 0,o=H(e.store.schema,r),d=i.arrangement?.()?.hide?.includes(r)===!0;return u([...s?[{id:d?"show-list":"hide-list",label:d?"Show":"Hide",hint:d?"Back in the places, for everyone":"Off the places, for everyone; still at its address",run:()=>void w("setListHidden",r,o,n,!d,c)}]:[],...k(`list:${r}`,s)])}let l=i.places().find(s=>s.as===p.place&&(r===void 0||s.kind===r||s.over?.includes(r)===!0));if(!l)return null;let f=n&&h?se(l,h,n):null;return u([...f?[l.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>void w("setHidden",l,f,n,!1,c)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>void w("setHidden",l,f,n,!0,c)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let s=Ke(i.places(),l);w("remove",l,f,n,c).then(o=>o&&t?.(l,s))}}]:[],...k(`place:${l.as}`,f==="lens")])}:null,[n,i,c,t])}var Ue=[];function Dt({children:t}){let{view:e,go:n}=F(),i=(0,N.useCallback)((h,r)=>{let u=e.within?.view;e.focusId===ce(h.kind)&&(u===void 0||u===h.as)&&n(r?ue(e,r.kind,r.as):le(e,!0))},[e,n]),c=Ye(i),p=(0,N.useMemo)(()=>c?[c]:Ue,[c]);return(0,Te.jsx)($,{sections:p,children:t})}function Nt(t={}){return t.scope===void 0?te:de(te,t.scope)}var W=y(O(),1),a=y(M(),1);function Bt({inside:t=!1,widthOf:e}={}){let{store:n,view:i,emphasis:c,setEmphasis:p}=A(),h=Se(),{selection:r,set:u}=_(),{show:w}=F(),k=B(),l=(0,W.useMemo)(()=>{let o=new Map;for(let d of n.graph.allEdges()){let v=o.get(d.kind)??{count:0,ends:new Set};v.count+=1;for(let S of[d.from,d.to]){let I=n.graph.getNode(S);I&&v.ends.add(`kind:${I.kind}`)}o.set(d.kind,v)}return[...o.entries()].sort(([d],[v])=>d.localeCompare(v)).map(([d,v])=>({kind:d,count:v.count,ends:[...v.ends]}))},[n,k]),f=Math.max(0,...l.map(o=>o.count));if((0,W.useEffect)(()=>()=>p(null),[p]),!i.overview&&!t||l.length===0)return null;let s=new Set;for(let o of r){if(o.startsWith("kind:")){s.add(o);continue}let d=n.graph.getNode(o);d&&s.add(`kind:${d.kind}`)}return(0,a.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:ae("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:je,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,a.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:l.length===1?"1 relation":`${l.length} relations`}),e?(0,a.jsx)(Xe,{aloft:i.overview===!0}):null,l.map(({kind:o,count:d,ends:v})=>{let{connector:S,style:I}=ee(h,o),g=Je(n.schema,o),m=c!==null?c===o:s.size===0||v.some(b=>s.has(b));return(0,a.jsxs)("button",{type:"button",title:n.schema.edge(o)?.description===void 0?`${d} of these`:g.words,onMouseEnter:()=>p(o),onMouseLeave:()=>p(null),onFocus:()=>p(o),onBlur:()=>p(null),onClick:()=>{u(v),w(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:m?1:.4},children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:i.overview&&e?(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:e(d,f)}):(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:X(I),strokeWidth:Z(I,!0),strokeDasharray:J[I.pattern],strokeLinecap:"round"})}),(0,a.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":o,children:[(0,a.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,a.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,a.jsx)("span",{"data-graview-quiet":o,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,a.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:d})]},o)})]})}var je="min(280px, calc(100% - 28px))";function Je(t,e,n){let i=t.edge(e)?.from??[],c=new Map;for(let r of n!==void 0&&i.includes(n)?[n]:i.length>0?i:[""]){let u=ke(t,r,e,"out");c.set(u,[...c.get(u)??[],r])}let p=r=>r==="*"?"anything":H(t,r),h=[...c].map(([r,u])=>{let w=u.flatMap(l=>t.tryDefinition(l)?.edges[e]?.to??[]),k=u[0]&&w.length>0?`${u.map(p).join(", ")} \u2192 ${(w.includes("*")?["*"]:[...new Set(w)]).map(p).join(", ")}`:"";return[r.charAt(0).toUpperCase()+r.slice(1),k]});return{words:h.map(([r])=>r).join(" \xB7 "),ends:h.flatMap(([,r])=>r?[r]:[]).join(" \xB7 ")}}function _t({edgeKind:t,kit:e,width:n=30}){let i=q(),c=(0,W.useMemo)(()=>ie(e??i?.brand?.kit),[e,i?.brand?.kit]),{connector:p,style:h}=ee(c,t);return(0,a.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:p.visible?1:.35},children:(0,a.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:X(h),strokeWidth:Z(h,!0),strokeDasharray:J[h.pattern],strokeLinecap:"round"})})}function Xe({aloft:t}){let e={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,a.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:e,"data-graview-manner":"ribbon",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,a.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"record",children:[(0,a.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,a.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"district",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,a.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,a.jsxs)("div",{style:e,"data-graview-manner":"unsure",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:we,strokeWidth:1.8,strokeDasharray:ye,strokeLinecap:"round"})}),(0,a.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var Ie=y(O(),1),re=y(M(),1),Ze=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.25VJPUDH.js","./chunk.6DOOLVT4.js","./chunk.VX65S2FA.js","./chunk.747OH3EE.js","./chunk.E6RNMWFN.js","./chunk.VN7I7XIO.js","./chunk.MBP7VDYM.js","./chunk.2XSIJH5J.js","./chunk.UO544PZH.js","./chunk.4STDIZVI.js","./chunk.HZHNM2KI.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.3ICWPRRJ.js")))),et=Ze.part(t=>(0,re.jsx)(t.SuggestedTray,{}),{quiet:!0});function Vt(){let{store:t,whileAway:e}=A(),n=B();return(0,Ie.useMemo)(()=>t.log.all().some(c=>c.suggests!==void 0&&!c.withheld),[t,n])||e?.tidied?(0,re.jsx)(et,{}):null}export{it as a,ct as b,gt as c,Bt as d,je as e,_t as f,_e as g,St as h,bt as i,Ye as j,Dt as k,Nt as l,Vt as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk.
|
|
1
|
+
import{a as f}from"./chunk.LA2DMHZC.js";import{ga as d}from"./chunk.F7PIW2EM.js";function S(e){let o=e.indexOf("{"),a=e.indexOf("["),t=a!==-1&&(o===-1||a<o)?a:o;if(t===-1)return;let n=e[t],r=n==="["?"]":"}",i=0,u=!1,l=!1;for(let s=t;s<e.length;s++){let c=e[s];if(u){l?l=!1:c==="\\"?l=!0:c==='"'&&(u=!1);continue}if(c==='"')u=!0;else if(c===n)i+=1;else if(c===r&&(i-=1,i===0))try{return JSON.parse(e.slice(t,s+1))}catch{return}}}function w(e,o){let a;try{a=e.mutation(o.mutation)}catch{return o}let t={...o.args},n=!1;for(let r of f(a.input)){if(r.control!=="node")continue;let i=t[r.name];if(typeof i!="string"||i.length===0||e.graph.getNode(i))continue;let u=i.trim().toLowerCase(),l=[...e.graph.allNodes()].filter(s=>(r.kinds.includes("*")||r.kinds.includes(s.kind))&&d(e.schema.tryDefinition(s.kind),s).trim().toLowerCase()===u);l.length===1&&(t[r.name]=l[0].id,n=!0)}return n?{...o,args:t}:o}function x(e,o,a){let t=a===void 0?null:new Set(a),n=[];for(let r of o){if(typeof r.mutation!="string")continue;let i=!0;try{e.mutation(r.mutation)}catch{i=!1}i?t&&!t.has(r.mutation)&&n.push({proposal:r,why:"not-allowed"}):n.push({proposal:r,why:"unknown"})}return n}function v(e,o,a){let t=a===void 0?null:new Set(a);return o.filter(n=>{if(typeof n.mutation!="string"||t&&!t.has(n.mutation))return!1;try{e.mutation(n.mutation)}catch{return!1}return n.args!==null&&typeof n.args=="object"})}export{S as a,w as b,x as c,v as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.A2ZQASQV.js";import"./chunk.U5P23GO7.js";import"./chunk.D5Q64GA4.js";import"./chunk.AVFOTYZR.js";import"./chunk.HOQMD6WQ.js";import"./chunk.N7T7VB77.js";import"./chunk.SDO3U72B.js";import"./chunk.F7PIW2EM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{a as ActivityFilter,b as InteractionRow};
|
package/dist/preview/index.html
CHANGED
|
@@ -5,67 +5,67 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>Graview preview</title>
|
|
7
7
|
<link rel="preload" href="/graview/document" as="fetch" crossorigin="anonymous">
|
|
8
|
-
<link rel="modulepreload" href="/chunk.
|
|
9
|
-
<link rel="modulepreload" href="/chunk.
|
|
10
|
-
<link rel="modulepreload" href="/chunk.
|
|
11
|
-
<link rel="modulepreload" href="/chunk.
|
|
12
|
-
<link rel="modulepreload" href="/chunk.
|
|
13
|
-
<link rel="modulepreload" href="/chunk.
|
|
14
|
-
<link rel="modulepreload" href="/chunk.
|
|
15
|
-
<link rel="modulepreload" href="/chunk.
|
|
16
|
-
<link rel="modulepreload" href="/chunk.
|
|
8
|
+
<link rel="modulepreload" href="/chunk.SIYBHZDD.js">
|
|
9
|
+
<link rel="modulepreload" href="/chunk.QATUGE34.js">
|
|
10
|
+
<link rel="modulepreload" href="/chunk.3RW677X6.js">
|
|
11
|
+
<link rel="modulepreload" href="/chunk.3HFUO3DC.js">
|
|
12
|
+
<link rel="modulepreload" href="/chunk.DXWTM4SH.js">
|
|
13
|
+
<link rel="modulepreload" href="/chunk.LQAT7FA6.js">
|
|
14
|
+
<link rel="modulepreload" href="/chunk.AVFOTYZR.js">
|
|
15
|
+
<link rel="modulepreload" href="/chunk.HOQMD6WQ.js">
|
|
16
|
+
<link rel="modulepreload" href="/chunk.N7T7VB77.js">
|
|
17
17
|
<link rel="modulepreload" href="/chunk.SDO3U72B.js">
|
|
18
|
-
<link rel="modulepreload" href="/chunk.
|
|
18
|
+
<link rel="modulepreload" href="/chunk.F7PIW2EM.js">
|
|
19
19
|
<link rel="modulepreload" href="/chunk.FQLNBIQ5.js">
|
|
20
20
|
<link rel="modulepreload" href="/chunk.AJZBJBMO.js">
|
|
21
|
-
<link rel="modulepreload" href="/chunk.
|
|
22
|
-
<link rel="modulepreload" href="/chunk.
|
|
23
|
-
<link rel="modulepreload" href="/chunk.
|
|
24
|
-
<link rel="modulepreload" href="/chunk.
|
|
25
|
-
<link rel="modulepreload" href="/chunk.
|
|
26
|
-
<link rel="modulepreload" href="/chunk.
|
|
21
|
+
<link rel="modulepreload" href="/chunk.Q5I5M3FR.js">
|
|
22
|
+
<link rel="modulepreload" href="/chunk.YOT7ESDG.js">
|
|
23
|
+
<link rel="modulepreload" href="/chunk.66IKLMYX.js">
|
|
24
|
+
<link rel="modulepreload" href="/chunk.C634A6ZC.js">
|
|
25
|
+
<link rel="modulepreload" href="/chunk.N5WDQAIM.js">
|
|
26
|
+
<link rel="modulepreload" href="/chunk.ZQHCNFJK.js">
|
|
27
27
|
<link rel="modulepreload" href="/chunk.Q355UPFG.js">
|
|
28
28
|
<link rel="modulepreload" href="/chunk.PXQVXBNG.js">
|
|
29
|
-
<link rel="modulepreload" href="/chunk.
|
|
30
|
-
<link rel="modulepreload" href="/chunk.
|
|
31
|
-
<link rel="modulepreload" href="/chunk.
|
|
32
|
-
<link rel="modulepreload" href="/chunk.
|
|
33
|
-
<link rel="modulepreload" href="/chunk.
|
|
34
|
-
<link rel="modulepreload" href="/chunk.
|
|
35
|
-
<link rel="modulepreload" href="/chunk.
|
|
36
|
-
<link rel="modulepreload" href="/chunk.
|
|
37
|
-
<link rel="modulepreload" href="/chunk.
|
|
38
|
-
<link rel="modulepreload" href="/chunk.
|
|
39
|
-
<link rel="modulepreload" href="/chunk.
|
|
40
|
-
<link rel="modulepreload" href="/chunk.
|
|
41
|
-
<link rel="modulepreload" href="/chunk.
|
|
42
|
-
<link rel="modulepreload" href="/chunk.
|
|
43
|
-
<link rel="modulepreload" href="/chunk.
|
|
44
|
-
<link rel="modulepreload" href="/chunk.
|
|
45
|
-
<link rel="modulepreload" href="/chunk.
|
|
46
|
-
<link rel="modulepreload" href="/chunk.
|
|
29
|
+
<link rel="modulepreload" href="/chunk.7LZ6JDJA.js">
|
|
30
|
+
<link rel="modulepreload" href="/chunk.KRFRREEW.js">
|
|
31
|
+
<link rel="modulepreload" href="/chunk.VOOOIECX.js">
|
|
32
|
+
<link rel="modulepreload" href="/chunk.GIW657OR.js">
|
|
33
|
+
<link rel="modulepreload" href="/chunk.EVEHSENK.js">
|
|
34
|
+
<link rel="modulepreload" href="/chunk.SBLYBRDU.js">
|
|
35
|
+
<link rel="modulepreload" href="/chunk.2LNSENPV.js">
|
|
36
|
+
<link rel="modulepreload" href="/chunk.WS7LAT4Z.js">
|
|
37
|
+
<link rel="modulepreload" href="/chunk.5X22RKB3.js">
|
|
38
|
+
<link rel="modulepreload" href="/chunk.XZUHFXME.js">
|
|
39
|
+
<link rel="modulepreload" href="/chunk.GQNSNJTJ.js">
|
|
40
|
+
<link rel="modulepreload" href="/chunk.SJALH7IX.js">
|
|
41
|
+
<link rel="modulepreload" href="/chunk.E6RNMWFN.js">
|
|
42
|
+
<link rel="modulepreload" href="/chunk.IA5ZBMRD.js">
|
|
43
|
+
<link rel="modulepreload" href="/chunk.VN7I7XIO.js">
|
|
44
|
+
<link rel="modulepreload" href="/chunk.REH6RXNH.js">
|
|
45
|
+
<link rel="modulepreload" href="/chunk.MBP7VDYM.js">
|
|
46
|
+
<link rel="modulepreload" href="/chunk.BDTT4ENI.js">
|
|
47
47
|
<link rel="modulepreload" href="/chunk.BJUUSIQY.js">
|
|
48
|
-
<link rel="modulepreload" href="/chunk.
|
|
49
|
-
<link rel="modulepreload" href="/chunk.
|
|
48
|
+
<link rel="modulepreload" href="/chunk.5POG3G2C.js">
|
|
49
|
+
<link rel="modulepreload" href="/chunk.2XSIJH5J.js">
|
|
50
50
|
<link rel="modulepreload" href="/chunk.XOZU4OFA.js">
|
|
51
|
-
<link rel="modulepreload" href="/chunk.
|
|
51
|
+
<link rel="modulepreload" href="/chunk.LA2DMHZC.js">
|
|
52
52
|
<link rel="modulepreload" href="/chunk.MB7LKKUD.js">
|
|
53
53
|
<link rel="modulepreload" href="/chunk.WVUJXDXZ.js">
|
|
54
|
-
<link rel="modulepreload" href="/chunk.
|
|
55
|
-
<link rel="modulepreload" href="/chunk.
|
|
56
|
-
<link rel="modulepreload" href="/chunk.
|
|
57
|
-
<link rel="modulepreload" href="/chunk.
|
|
58
|
-
<link rel="modulepreload" href="/chunk.
|
|
54
|
+
<link rel="modulepreload" href="/chunk.MBU7UH6J.js">
|
|
55
|
+
<link rel="modulepreload" href="/chunk.2QFKNTAZ.js">
|
|
56
|
+
<link rel="modulepreload" href="/chunk.BI6DS3PZ.js">
|
|
57
|
+
<link rel="modulepreload" href="/chunk.PGA5TUSN.js">
|
|
58
|
+
<link rel="modulepreload" href="/chunk.7R727IKU.js">
|
|
59
59
|
<link rel="modulepreload" href="/chunk.GZHZLJBF.js">
|
|
60
|
-
<link rel="modulepreload" href="/chunk.
|
|
60
|
+
<link rel="modulepreload" href="/chunk.Y7H5O2SL.js">
|
|
61
61
|
<link rel="modulepreload" href="/chunk.OJGHDWI6.js">
|
|
62
|
-
<link rel="modulepreload" href="/chunk.
|
|
63
|
-
<link rel="modulepreload" href="/chunk.
|
|
64
|
-
<link rel="modulepreload" href="/chunk.
|
|
65
|
-
<link rel="modulepreload" href="/chunk.
|
|
66
|
-
<link rel="modulepreload" href="/chunk.
|
|
67
|
-
<link rel="modulepreload" href="/chunk.
|
|
68
|
-
<script>(()=>{const later=["/chunk.
|
|
62
|
+
<link rel="modulepreload" href="/chunk.6HZY5NRX.js">
|
|
63
|
+
<link rel="modulepreload" href="/chunk.UO544PZH.js">
|
|
64
|
+
<link rel="modulepreload" href="/chunk.4STDIZVI.js">
|
|
65
|
+
<link rel="modulepreload" href="/chunk.HZHNM2KI.js">
|
|
66
|
+
<link rel="modulepreload" href="/chunk.JU3BCCQM.js">
|
|
67
|
+
<link rel="modulepreload" href="/chunk.BJI2C3IZ.js">
|
|
68
|
+
<script>(()=>{const later=["/chunk.SLPJWOKC.js","/chunk.TKLYUVMR.js","/chunk.D4TA5XDC.js","/chunk.HJCQ6I3S.js","/chunk.SAYAFOF6.js","/chunk.R3N73BJO.js","/chunk.X2I3XH2E.js","/chunk.WD4VPMEE.js","/chunk.VUAOCYG2.js","/chunk.ISRQQVS4.js","/chunk.7CETF4A6.js","/chunk.XZWXDQ3N.js","/chunk.4LG34OC2.js","/chunk.MU3XII7I.js","/chunk.6DOOLVT4.js","/chunk.VX65S2FA.js","/chunk.747OH3EE.js","/chunk.U5P23GO7.js","/chunk.NUEPFPRA.js"],first=[...document.querySelectorAll('link[rel="modulepreload"]')];let left=first.length;const go=()=>{for(const href of later){const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};if(left===0)return go();const one=()=>{if(--left===0)go()};for(const link of first){link.addEventListener("load",one,{once:true});link.addEventListener("error",one,{once:true})}})()</script>
|
|
69
69
|
<style>html,body{margin:0;height:100%}#graview-app{min-height:100dvh}</style>
|
|
70
70
|
</head>
|
|
71
71
|
<body>
|