graview 0.1.66 → 0.1.67
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.LSN2IPAI.js → chunk.25QFDTCU.js} +1 -1
- package/dist/preview/{chunk.BFAFCVL4.js → chunk.264PB572.js} +1 -1
- package/dist/preview/chunk.2FHIINXG.js +2 -0
- package/dist/preview/{chunk.HSSIMVVM.js → chunk.2VUX54XH.js} +1 -1
- package/dist/preview/{chunk.CTASTRQN.js → chunk.35KMZHB7.js} +1 -1
- package/dist/preview/{chunk.OWFS2YDQ.js → chunk.37RFCHSS.js} +1 -1
- package/dist/preview/chunk.3ENPWZBG.js +1 -0
- package/dist/preview/{chunk.XMQG2PSM.js → chunk.3GNT5MKP.js} +1 -1
- package/dist/preview/{chunk.BXBEGMPO.js → chunk.3NSV3WKM.js} +2 -2
- package/dist/preview/chunk.3ZODN6BW.js +1 -0
- package/dist/preview/{chunk.OPTYYIGC.js → chunk.47XEJZ3O.js} +1 -1
- package/dist/preview/{chunk.5FNFRVTL.js → chunk.4EMKCKDB.js} +1 -1
- package/dist/preview/{chunk.B6JRTW3A.js → chunk.4UUJHLHR.js} +1 -1
- package/dist/preview/{chunk.FBILPNGH.js → chunk.4W57E7AX.js} +1 -1
- package/dist/preview/chunk.55G4IPOO.js +1 -0
- package/dist/preview/{chunk.72XP2ARZ.js → chunk.5AKZROMR.js} +1 -1
- package/dist/preview/chunk.5J6DVR7S.js +1 -0
- package/dist/preview/{chunk.FXT5CN32.js → chunk.5R744JGZ.js} +1 -1
- package/dist/preview/{chunk.NJRLJEJY.js → chunk.6KJGRM7A.js} +1 -1
- package/dist/preview/{chunk.4AC2QM7T.js → chunk.6N4PE3U5.js} +1 -1
- package/dist/preview/{chunk.LGRVEHXT.js → chunk.6NG76MDA.js} +2 -2
- package/dist/preview/{chunk.4FCFNAA4.js → chunk.6SJEZWH3.js} +1 -1
- package/dist/preview/{chunk.7VADSNPZ.js → chunk.6UQFV53C.js} +1 -1
- package/dist/preview/{chunk.WAB3L3ZI.js → chunk.6W6XMLSF.js} +1 -1
- package/dist/preview/{chunk.4JULYKGD.js → chunk.77C556NM.js} +1 -1
- package/dist/preview/{chunk.IGK7EZCX.js → chunk.7ARRVNUR.js} +1 -1
- package/dist/preview/{chunk.CBXS23YH.js → chunk.7BJRHPE3.js} +2 -2
- package/dist/preview/{chunk.ZQR2SN65.js → chunk.7S6ZRMW4.js} +1 -1
- package/dist/preview/{chunk.IAEHUSQQ.js → chunk.7UHPHEH5.js} +1 -1
- package/dist/preview/chunk.7WHQWLL6.js +1 -0
- package/dist/preview/{chunk.KACSYPEV.js → chunk.A4EZAGG7.js} +1 -1
- package/dist/preview/chunk.A5PSEU3W.js +25 -0
- package/dist/preview/{chunk.VKZIEZ5C.js → chunk.A7GVTE5Y.js} +2 -2
- package/dist/preview/{chunk.45JP6VGJ.js → chunk.AJMVRFYX.js} +2 -2
- package/dist/preview/{chunk.6P6NGZ6D.js → chunk.AKJS2NUM.js} +1 -1
- package/dist/preview/{chunk.CU2WCYMK.js → chunk.ARWO4WOV.js} +1 -1
- package/dist/preview/chunk.B5SJMCTT.js +7 -0
- package/dist/preview/{chunk.JXNVNFV4.js → chunk.B7KZBT27.js} +1 -1
- package/dist/preview/{chunk.E3UL4MCD.js → chunk.BDNQMKDG.js} +1 -1
- package/dist/preview/{chunk.YNEHJWJV.js → chunk.BKYZSV2Y.js} +1 -1
- package/dist/preview/{chunk.5BX66FBP.js → chunk.CKDCTFLU.js} +1 -1
- package/dist/preview/chunk.CTUJZ3IV.js +1 -0
- package/dist/preview/chunk.CY7FFKEZ.js +1 -0
- package/dist/preview/{chunk.3PBTN7RO.js → chunk.D4WJ7OM5.js} +1 -1
- package/dist/preview/{chunk.C2C3AXGI.js → chunk.D7NWMXSX.js} +3 -3
- package/dist/preview/chunk.DEKRFTRN.js +4 -0
- package/dist/preview/{chunk.E7EWNWAN.js → chunk.DKEIEH2D.js} +1 -1
- package/dist/preview/{chunk.I2737CPF.js → chunk.DWM7AR5Y.js} +1 -1
- package/dist/preview/{chunk.ANS2IEEV.js → chunk.DZMIYEHQ.js} +1 -1
- package/dist/preview/{chunk.BMENTGDC.js → chunk.E5PYNAYT.js} +2 -2
- package/dist/preview/chunk.EBKH3ILT.js +1 -0
- package/dist/preview/{chunk.DTCAUPLC.js → chunk.EFVSZKB5.js} +1 -1
- package/dist/preview/{chunk.QOS5T46W.js → chunk.EGPCVMDU.js} +1 -1
- package/dist/preview/{chunk.7ZKBYXUM.js → chunk.EJ2EZL2G.js} +1 -1
- package/dist/preview/{chunk.7VP6Y6D2.js → chunk.EP6Q32WT.js} +1 -1
- package/dist/preview/{chunk.OOSIKCOS.js → chunk.F464JKHZ.js} +1 -1
- package/dist/preview/{chunk.VGHO3VCB.js → chunk.FLJXYESX.js} +1 -1
- package/dist/preview/chunk.FOUBDGL3.js +1 -0
- package/dist/preview/chunk.FPHRAO3R.js +1 -0
- package/dist/preview/{chunk.4FDVINRJ.js → chunk.FRQSLWP4.js} +1 -1
- package/dist/preview/{chunk.2MHNPBHC.js → chunk.FVQKSN33.js} +1 -1
- package/dist/preview/{chunk.PDDIQ6PK.js → chunk.G3GFDVO2.js} +1 -1
- package/dist/preview/{chunk.ZD7T234N.js → chunk.G5GVT6JY.js} +1 -1
- package/dist/preview/{chunk.3L4JMM3P.js → chunk.GFLH7RCI.js} +1 -1
- package/dist/preview/{chunk.OO2OP76C.js → chunk.GMLONS5L.js} +1 -1
- package/dist/preview/{chunk.FK722SHI.js → chunk.GRFD42WM.js} +1 -1
- package/dist/preview/{chunk.2VR7YEJ6.js → chunk.GVT4UUQA.js} +1 -1
- package/dist/preview/{chunk.GME63ZHI.js → chunk.H3EGBDW2.js} +1 -1
- package/dist/preview/{chunk.DQFHIJFN.js → chunk.H6KIEDZN.js} +1 -1
- package/dist/preview/{chunk.5B5SRTUK.js → chunk.HAOB6O72.js} +1 -1
- package/dist/preview/chunk.HB5NWHFP.js +3 -0
- package/dist/preview/{chunk.6EHHMWPP.js → chunk.HJUZMOW2.js} +1 -1
- package/dist/preview/{chunk.6MQ5NT7S.js → chunk.HN4ZJ4B4.js} +1 -1
- package/dist/preview/chunk.HVBKI5ZO.js +1 -0
- package/dist/preview/chunk.I3SDKMQS.js +1 -0
- package/dist/preview/{chunk.QQAZQDRW.js → chunk.IAEGJDF3.js} +1 -1
- package/dist/preview/{chunk.QWNSHISU.js → chunk.IDALEKIW.js} +1 -1
- package/dist/preview/{chunk.QFHWG4LN.js → chunk.ILJDLBPJ.js} +1 -1
- package/dist/preview/{chunk.ZR2TP3BF.js → chunk.J2OPIS3H.js} +1 -1
- package/dist/preview/chunk.J5OLYVZ4.js +1 -0
- package/dist/preview/{chunk.LETAQTLJ.js → chunk.J6HF7IRQ.js} +1 -1
- package/dist/preview/{chunk.RWIN3POV.js → chunk.JEC5FDKX.js} +1 -1
- package/dist/preview/chunk.JKFVNQY7.js +1 -0
- package/dist/preview/{chunk.LLIURXFP.js → chunk.JQ2WNKDW.js} +1 -1
- package/dist/preview/{chunk.Z7Y3R3YR.js → chunk.JQ63N4MZ.js} +1 -1
- package/dist/preview/{chunk.DZFM6GSY.js → chunk.JU6UFWS3.js} +1 -1
- package/dist/preview/{chunk.INHS3KTK.js → chunk.JVB5KDSG.js} +1 -1
- package/dist/preview/{chunk.4U4D7WOI.js → chunk.KFT7JIEH.js} +1 -1
- package/dist/preview/chunk.KGMSSXZL.js +1 -0
- package/dist/preview/{chunk.5CXIEYHY.js → chunk.KX5ZBHMA.js} +2 -2
- package/dist/preview/{chunk.V7W5AQKL.js → chunk.LP2ZMAT2.js} +1 -1
- package/dist/preview/{chunk.BUVTUAB5.js → chunk.LRNFE3UK.js} +1 -1
- package/dist/preview/{chunk.PAGEGBUD.js → chunk.LVOTLGJB.js} +1 -1
- package/dist/preview/{chunk.QHMHUL6B.js → chunk.LYEGRY77.js} +1 -1
- package/dist/preview/{chunk.PPSYUOH7.js → chunk.M7KXQGQL.js} +1 -1
- package/dist/preview/{chunk.7BIPZTJB.js → chunk.MAKCZ6B6.js} +1 -1
- package/dist/preview/{chunk.EQ4OODGO.js → chunk.MJY4SLWA.js} +1 -1
- package/dist/preview/{chunk.EMFOMSMI.js → chunk.MSAYU25L.js} +1 -1
- package/dist/preview/{chunk.F4VB6Q2W.js → chunk.MUSMNKE4.js} +1 -1
- package/dist/preview/{chunk.BGAC3B7X.js → chunk.MW7R5G3C.js} +1 -1
- package/dist/preview/{chunk.AK7NGFEX.js → chunk.N4ZKZ4GM.js} +1 -1
- package/dist/preview/{chunk.TXHYGFIZ.js → chunk.NAXOXBOF.js} +1 -1
- package/dist/preview/{chunk.IWYMKGZZ.js → chunk.NKLPL7QD.js} +1 -1
- package/dist/preview/{chunk.QU52E5RG.js → chunk.NKYWIGC7.js} +1 -1
- package/dist/preview/{chunk.KSIEO5W7.js → chunk.NRURQGXV.js} +1 -1
- package/dist/preview/{chunk.FV72U33M.js → chunk.NSOPYIT4.js} +1 -1
- package/dist/preview/chunk.NXZL5CA2.js +1 -0
- package/dist/preview/{chunk.WVLEGCRI.js → chunk.O2OL6RQQ.js} +1 -1
- package/dist/preview/{chunk.TGEL6EUA.js → chunk.O5VFKVZS.js} +1 -1
- package/dist/preview/{chunk.CEVGND3Y.js → chunk.OCXY5DCD.js} +3 -3
- package/dist/preview/chunk.OHAO6KKH.js +1 -0
- package/dist/preview/{chunk.DSYP43NN.js → chunk.P2EKKKK2.js} +1 -1
- package/dist/preview/chunk.PSNMZBVS.js +1 -0
- package/dist/preview/{chunk.W53YNBSM.js → chunk.PZ7KY6XH.js} +1 -1
- package/dist/preview/{chunk.WSO7JOW5.js → chunk.QAM76AXV.js} +1 -1
- package/dist/preview/{chunk.PSQYDCVM.js → chunk.QF5QB5YR.js} +1 -1
- package/dist/preview/chunk.QNP5OR3P.js +93 -0
- package/dist/preview/{chunk.5LJVOLKR.js → chunk.QRQ5WPZI.js} +1 -1
- package/dist/preview/chunk.QWGWOEBZ.js +90 -0
- package/dist/preview/{chunk.OMT4QUZY.js → chunk.QXLJGHMC.js} +4 -4
- package/dist/preview/{chunk.J2MM6BUW.js → chunk.QZQCQWQG.js} +1 -1
- package/dist/preview/{chunk.6FQW6FNL.js → chunk.R6JBA7UK.js} +1 -1
- package/dist/preview/chunk.R7CRBRD4.js +1 -0
- package/dist/preview/chunk.RD2FSSLV.js +1 -0
- package/dist/preview/{chunk.OEIWIZCP.js → chunk.RG5G6YQD.js} +1 -1
- package/dist/preview/{chunk.PFQBCHQA.js → chunk.RJY7VJBH.js} +1 -1
- package/dist/preview/chunk.RR25BGWP.js +1 -0
- package/dist/preview/{chunk.BZ7QWHAE.js → chunk.RSQ432QN.js} +1 -1
- package/dist/preview/{chunk.MWGZKZD6.js → chunk.SFBHPYRD.js} +1 -1
- package/dist/preview/{chunk.FFOD5B4B.js → chunk.SJQPTDAT.js} +1 -1
- package/dist/preview/{chunk.OTV5XTBB.js → chunk.SNHKYH72.js} +1 -1
- package/dist/preview/{chunk.WSDJPXJD.js → chunk.SO6NT5K7.js} +1 -1
- package/dist/preview/{chunk.FDZE5LTJ.js → chunk.STPA7HBK.js} +2 -2
- package/dist/preview/{chunk.ONYBW45K.js → chunk.SY5ID44D.js} +1 -1
- package/dist/preview/chunk.T27QKVKP.js +1 -0
- package/dist/preview/{chunk.U6TEW6YD.js → chunk.T2OUHRAA.js} +1 -1
- package/dist/preview/chunk.T3WCRS6M.js +1 -0
- package/dist/preview/{chunk.QGIM2WAY.js → chunk.TI5FR2QQ.js} +1 -1
- package/dist/preview/{chunk.HOCD7KIR.js → chunk.TTSGCNPT.js} +1 -1
- package/dist/preview/{chunk.ES63XSIM.js → chunk.TXZQEJ5T.js} +1 -1
- package/dist/preview/{chunk.6LXIEM6B.js → chunk.UDHPMVC4.js} +1 -1
- package/dist/preview/{chunk.KBPJ7X7W.js → chunk.UGQYMN4J.js} +1 -1
- package/dist/preview/{chunk.M6ZN2KUO.js → chunk.UQIPEMJ5.js} +1 -1
- package/dist/preview/{chunk.FIFUMX5X.js → chunk.URQTF5SY.js} +1 -1
- package/dist/preview/{chunk.J7W2OFHY.js → chunk.UW52CMGJ.js} +1 -1
- package/dist/preview/{chunk.LINSO5PN.js → chunk.UWS4RMM3.js} +1 -1
- package/dist/preview/{chunk.QPF4KSAW.js → chunk.V7H4BUEB.js} +1 -1
- package/dist/preview/{chunk.KHRS2SKB.js → chunk.VBHV4TLG.js} +1 -1
- package/dist/preview/{chunk.U3ED7W2U.js → chunk.VBLQJVQ5.js} +1 -1
- package/dist/preview/{chunk.CVPMSPCH.js → chunk.WALVW3KJ.js} +1 -1
- package/dist/preview/{chunk.2KFZHUAC.js → chunk.WEMUKZKH.js} +1 -1
- package/dist/preview/{chunk.YIPXZUTT.js → chunk.X226YATK.js} +1 -1
- package/dist/preview/{chunk.GNEOSHQ6.js → chunk.XFLGSUYO.js} +1 -1
- package/dist/preview/{chunk.W4YDPHCQ.js → chunk.XSWSBTUO.js} +1 -1
- package/dist/preview/{chunk.OJY7VJ7D.js → chunk.YCD4JSXD.js} +1 -1
- package/dist/preview/{chunk.72ZCLEQC.js → chunk.YZPESGCP.js} +1 -1
- package/dist/preview/{chunk.XOE4KNP2.js → chunk.Z27NSSYL.js} +2 -2
- package/dist/preview/{chunk.DEHIR4EG.js → chunk.Z2XUVJAL.js} +1 -1
- package/dist/preview/{chunk.YXEO3Y65.js → chunk.Z3O2VZAJ.js} +1 -1
- package/dist/preview/{chunk.M2JCFNHJ.js → chunk.Z4TY44CD.js} +1 -1
- package/dist/preview/{chunk.EXYCN4WI.js → chunk.ZAPS4J6G.js} +1 -1
- package/dist/preview/{chunk.6TLXFMX2.js → chunk.ZAQ4IDX6.js} +1 -1
- package/dist/preview/{chunk.6HY6ZGEE.js → chunk.ZEZUKRC6.js} +1 -1
- package/dist/preview/{chunk.GEFXU4VO.js → chunk.ZG5VGP5U.js} +1 -1
- package/dist/preview/index.html +56 -56
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.4WGYUYWU.js +0 -2
- package/dist/preview/chunk.5EMIWORS.js +0 -1
- package/dist/preview/chunk.6EVMXBNB.js +0 -1
- package/dist/preview/chunk.BCQWAFGD.js +0 -1
- package/dist/preview/chunk.BOCVLC7X.js +0 -1
- package/dist/preview/chunk.DPJNGFEZ.js +0 -4
- package/dist/preview/chunk.E4VRRWFP.js +0 -1
- package/dist/preview/chunk.EUAO4QNV.js +0 -1
- package/dist/preview/chunk.F7672TKJ.js +0 -1
- package/dist/preview/chunk.FA42HCPW.js +0 -1
- package/dist/preview/chunk.FBJAQPZ6.js +0 -1
- package/dist/preview/chunk.GAFMWOME.js +0 -1
- package/dist/preview/chunk.I4Z7HVRT.js +0 -1
- package/dist/preview/chunk.JMXXA4YG.js +0 -1
- package/dist/preview/chunk.JMYUQNXN.js +0 -6
- package/dist/preview/chunk.K6DFXDPZ.js +0 -1
- package/dist/preview/chunk.KF27ME27.js +0 -1
- package/dist/preview/chunk.L25DCT5S.js +0 -1
- package/dist/preview/chunk.MODLZJD4.js +0 -25
- package/dist/preview/chunk.OJGHDWI6.js +0 -1
- package/dist/preview/chunk.SSF47GUY.js +0 -1
- package/dist/preview/chunk.T6DPWW2K.js +0 -3
- package/dist/preview/chunk.TA36WBHK.js +0 -1
- package/dist/preview/chunk.TTGKX7LT.js +0 -1
- package/dist/preview/chunk.U3HERHAI.js +0 -88
- package/dist/preview/chunk.V5I4GZEY.js +0 -1
- package/dist/preview/chunk.VT2YGDK2.js +0 -1
- package/dist/preview/chunk.XK65Y2KX.js +0 -1
- package/dist/preview/chunk.Z274CL7J.js +0 -1
- package/dist/preview/chunk.ZBVYD4OX.js +0 -90
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,b as m,d as k,e as y}from"./chunk.Q355UPFG.js";import"./chunk.
|
|
1
|
+
import{a as r,b as m,d as k,e as y}from"./chunk.Q355UPFG.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var i="way-back",b='[data-testid="notices-toasts"]';function g(t){let o=document.activeElement;o!==null&&o!==document.body&&!o.closest(b)||(t??document).querySelector('[data-graview-app-bar] [data-testid="app-home"]')?.focus({preventScroll:!0})}function E(t,o,a,d,h){if(t.past)return a?.dismiss(i),()=>{};let c=h?.closest("[data-graview-embed]"),s,f=e=>{if(e!==void 0&&r(t,o)?.batch!==e)return!1;try{let n=k(t,o);return n&&a?.notify({kind:"toast",id:i,sentence:`Took back \u201C${n.intent}\u201D`}),n!==void 0}catch(n){return a?.notify({kind:"toast",id:i,tone:"warn",sentence:n instanceof Error?n.message:String(n)}),!0}},u=()=>{let e=m(t,o,d);if(d=t.batches().length,e){let n=s=e.batch;a?.notify({kind:"toast",id:i,sentence:e.intent,timeout:1e4,action:{label:"Take back",keys:"Meta+Z Control+Z",onSelect:()=>(g(c),f(n))}})}else s&&r(t,o)?.batch!==s&&(s=void 0,a?.dismiss(i))},l=e=>{y(e)&&(!c||c.contains(e.target))&&f()&&e.preventDefault()};u();let p=t.subscribe(u);return document.addEventListener("keydown",l),(e=!1)=>{p(),document.removeEventListener("keydown",l),e&&s&&a?.dismiss(i)}}export{E as sceneWay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as M}from"./chunk.4AC2QM7T.js";import{ga as b}from"./chunk.6HY6ZGEE.js";var k=["owners","status","schedule","budget","places","sources","stock","votes","private","history","publishing","roster","routines","comparison"],y={owners:"people who own things",status:"a status that moves",schedule:"dates it is due by, or a schedule",budget:"money against a budget",places:"places",sources:"sources behind claims",stock:"counts in stock",votes:"votes or picks",private:"private to its owner",history:"a history, a record book",publishing:"content to publish",roster:"a roster of people",routines:"repeating routines",comparison:"a comparison to pick one from"},J={owners:"a person kind (or the people the app has), an owner link, Give it to someone, a rule that every one has somebody on it, and Who has what",status:"a status with named steps (or the one the app has), an act for each step, and a board",schedule:"a due date, Set the date, the on-time rule, and a calendar",budget:"a cost beside the money the app keeps, a budget on the kind it is grouped under, Set the budget, and the over-budget rule",places:"a place kind, a link to one, and a map of where things are",sources:"a source kind, a link from each claim to its source, and the rule that a claim names one",stock:"what is on hand and the reorder level, Count the stock, and the running-low rule",votes:"a vote on each, Vote for it, and a tally",private:"a sight that keeps each person's own records to them",history:"the record book: an era or season each belongs to, and a timeline",publishing:"a published status, Publish it, and what the public sees",roster:"a person kind with the fields a roster keeps, and the list of who is here",routines:"how often each repeats and when it was last done, Mark it done, and the overdue rule",comparison:"a side-by-side of the candidates, one chosen, and Choose it"},U=new Set(["person","people","member","user","player","guest","candidate","participant","traveler","volunteer","interviewer","interviewee","contact","trade","staff","student","employee","teammate","crew","attendee","friend","customer","client","driver","speaker","host","teacher","parent","kid","child","coach","patient","tenant","resident","neighbor","applicant","recruit","contributor","assignee","worker","collaborator","runner"]),K=new Set(["place","venue","location","room","site","building","store","warehouse","city","country","region","address","hall","stadium","office","shelf"]),z=new Set(["source","reference","citation","evidence"]),H=new Set(["season","era","period","epoch","edition","generation","age","campaign","tournament"]),ae=/owner|owned|assign|^lead$|responsible|^by$|^by-|done-?by|interviewer|reviewer|maker|author|keeper|givenby|^for-?person$/i,oe=/due|deadline|until|needed|needby|target|expires|^ends?(on|at)?$|^by$/i,de=/^(date|day|when|at|start|starts|startsat|startson|startdate|scheduled|scheduledfor|scheduledon|happens|happenson|held|heldon|from|time|exchangedate|.*date|.*day)$/i,le=/released|fixed|published|applied|checked|created|added|done|last|first|updated|seen|born|birth|founded|finished|completed|closed/i,X=/status|stage|state|phase|progress/i,W=/budget|limit|cap$|allowance/i,ce=/budget|cost|price|quote|amount|salary|fee|spend|total|paid|owed/i,pe=/^(place|location|venue|address|where|city|town)$/i,B=/reorder|onhand|instock|^stock|quantity|^qty/i,he=/^votes?$|votecount|upvotes|^score$|^points$/i,fe=/^(votes?|votesfor|votedby|voters|picks?|chooses|choices|favorites|likes)$/i,ue=/often|frequency|cadence|^every$|repeat|interval/i,ge=/^last/i,Q=/^(published|live|public)$/i,ye=/count\(.*\bwhere\b.*\)\s*<=\s*1\b/,u=e=>e.toLowerCase(),w=(e,t)=>u(e.kinds[t]?.noun??b(t)),$=(e,t)=>u(e.kinds[t]?.plural??`${w(e,t)}s`),me=e=>e.charAt(0).toUpperCase()+e.slice(1),p=(e,t)=>me($(e,t)),we=e=>/^[aeiou]/i.test(e)?"an":"a",x=(e,t="and")=>e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} ${t} ${e[e.length-1]}`,N=e=>new Set((e??"").split(/[^A-Za-z0-9_-]+/).filter(Boolean)),v=e=>Object.entries(e.kinds),m=(e,t)=>Object.entries(e.acts??{}).filter(([,s])=>[s.on??[]].flat().includes(t)),_=e=>Array.isArray(e.lenses)?e.lenses:[],I=e=>typeof e.title=="string"?e.title:void 0,A=e=>e.bindings&&typeof e.bindings=="object"?e.bindings:{},R=(e,t)=>Array.isArray(t)&&t.length===1&&typeof t[0]=="string"&&e.kinds[t[0]]?t[0]:void 0;function V(e,t){let s=e.kinds[t];if(!s)return!1;let r=n=>u(n).replace(/ll/g,"l");return s.people===!0||U.has(r(t))||U.has(r(w(e,t)))}var Y=(e,t)=>K.has(u(t))||K.has(w(e,t)),ke=(e,t)=>z.has(u(t))||z.has(w(e,t)),be=(e,t)=>H.has(u(t))||H.has(w(e,t)),$e=(e,t)=>(t.type==="number"||t.type==="integer")&&(t.format==="money"||ce.test(e)),j=e=>e.type==="date"||e.type==="datetime";function P(e,t,s,r,n){return _(e).filter(d=>d.name===t&&A(d)[s]?.[r]===n).map(I).filter(d=>d!==void 0)}function D(e,t,s,r){return _(e).filter(n=>n.name==="coverage"&&A(n)[s]?.kind===t&&(r===void 0||A(n).link?.edge===r)).map(I).filter(n=>n!==void 0)}function f(e,t,s){let r=new Set(t);return Object.entries(e.rules??{}).filter(([,n])=>(s===void 0||n.over==="graph"||s.includes(n.over))&&[...N(`${n.when??""} ${n.require??""} ${n.says??""}`)].some(d=>r.has(d))).map(([n])=>n)}var G=class{kinds=new Set;fields=new Set;relations=new Set;rules=new Set;lenses=new Set;acts=new Set;said;add=(t,...s)=>{for(let r of s)this[t].add(r)};say=t=>{this.said??=t};any=()=>this.kinds.size+this.fields.size+this.relations.size+this.rules.size+this.lenses.size+this.acts.size>0;asTrait=t=>({trait:t,words:y[t],said:this.said??y[t],kinds:[...this.kinds],fields:[...this.fields],relations:[...this.relations],rules:[...this.rules],lenses:[...this.lenses],acts:[...this.acts]})};function ve(e){let t;for(let[s,r]of v(e)){let n=Object.keys(r.fields).length+Object.keys(r.edges??{}).length;(!t||n>t.fields)&&(t={kind:s,fields:n})}return t?.kind}function g(e){let t=ve(e);return v(e).sort(([s],[r])=>+(r===t)-+(s===t))}function Z(e,t){let s=e.kinds[t];if(!s)return[];let r=[];for(let[n,d]of Object.entries(s.fields)){if(d.type!=="enum"||!Array.isArray(d.options)||d.options.length<2)continue;let i=m(e,t).filter(([,a])=>typeof a.sets?.[n]=="string"&&d.options.includes(a.sets[n])).map(([a])=>a);((X.test(n)||s.lifecycle?.field===n)&&i.length>=1||i.length>=2)&&r.push({field:n,options:d.options,steps:i})}return r}var ee={owners(e,t){for(let[s,r]of g(e))for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);d.cardinality!=="one"||!i||!V(e,i)||!ae.test(n)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n],[s,i])),t.add("lenses",...D(e,s,"rows",n)),t.add("acts",...m(e,s).filter(([,o])=>o.connects===n||o.severs===n).map(([o])=>o)),t.say(`Each ${w(e,s)} has one of the ${$(e,i)} on it (${n}).`))}},status(e,t){for(let[s]of g(e))for(let{field:r,options:n,steps:d}of Z(e,s))t.add("kinds",s),t.add("fields",`${s}.${r}`),t.add("acts",...d),t.add("rules",...f(e,[r],[s])),t.add("lenses",...P(e,"columns",s,"column",r)),t.say(`${p(e,s)} move through ${x(n.map(u))}.`)},schedule(e,t){for(let[s,r]of g(e))for(let[n,d]of Object.entries(r.fields)){if(!j(d)||le.test(n))continue;let i=P(e,"calendar",s,"start",n),o=oe.test(n);if(!o&&!de.test(n)&&i.length===0)continue;t.add("kinds",s),t.add("fields",`${s}.${n}`),t.add("lenses",...i),t.add("rules",...f(e,[n],[s])),t.add("acts",...m(e,s).filter(([,l])=>(l.writes??[]).includes(n)||l.sets?.[n]!==void 0).map(([l])=>l));let a=/date|day|when|time/i.test(n)?u(b(n)):`date (${n})`;t.say(o?`${p(e,s)} are due by a date (${n}).`:`${p(e,s)} have ${we(a)} ${a}${i.length>0?", on a calendar":""}.`)}},budget(e,t){let s=v(e).flatMap(([o,a])=>Object.entries(a.fields).filter(([l,h])=>(h.type==="number"||h.type==="integer")&&W.test(l)).map(([l])=>({kind:o,name:l})));if(s.length===0)return;let r=g(e).flatMap(([o,a])=>Object.entries(a.fields).filter(([l,h])=>$e(l,h)&&!W.test(l)).map(([l])=>({kind:o,name:l})));if(r.length===0)return;let n=[...s,...r].map(o=>o.name);for(let o of[...s,...r])t.add("kinds",o.kind),t.add("fields",`${o.kind}.${o.name}`),t.add("acts",...m(e,o.kind).filter(([,a])=>(a.writes??[]).includes(o.name)||a.sets?.[o.name]!==void 0).map(([a])=>a));t.add("rules",...f(e,n).filter(o=>s.some(a=>N(e.rules[o].require??"").has(a.name))));let d=r[0],i=s.find(o=>o.kind===d.kind)??s[0];t.say(`${p(e,d.kind)}' ${u(b(d.name))} against ${i.kind===d.kind?"each one's":`each ${w(e,i.kind)}'s`} ${u(b(i.name))}.`)},places(e,t){for(let[s,r]of g(e)){Y(e,s)&&(t.add("kinds",s),t.add("lenses",...D(e,s,"columns")));for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);!i||!Y(e,i)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n],[s,i])),t.say(`${p(e,s)} are at ${$(e,i)} (${n}).`))}for(let[n,d]of Object.entries(r.fields))d.type!=="place"&&!(d.type==="string"&&pe.test(n))||(t.add("kinds",s),t.add("fields",`${s}.${n}`),t.say(`${p(e,s)} say where (${n}).`))}t.any()&&!t.said&&t.say(`${x([...t.kinds].map(s=>p(e,s)))} are places.`)},sources(e,t){for(let[s,r]of g(e)){for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);!i||!ke(e,i)&&!/^cite/i.test(n)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n,i],[s,i])),t.add("acts",...m(e,s).filter(([,o])=>o.connects===n||o.severs===n).map(([o])=>o)),t.say(`${p(e,s)} cite ${$(e,i)} (${n}).`))}for(let[n,d]of Object.entries(r.fields))d.type!=="url"||!/^source/i.test(n)||(t.add("kinds",s),t.add("fields",`${s}.${n}`),t.add("rules",...f(e,[n],[s])),t.say(`${p(e,s)} link to their source (${n}).`))}},stock(e,t){for(let[s,r]of g(e)){let n=Object.entries(r.fields).filter(([a,l])=>(l.type==="number"||l.type==="integer")&&B.test(a)).map(([a])=>a),d=Object.keys(r.computed??{}).filter(a=>B.test(a)),i=n.some(a=>/reorder/i.test(a)),o=v(e).some(([,a])=>Object.entries(a.fields).some(([l,h])=>/^(change|delta|moved)$/i.test(l)&&(h.type==="number"||h.type==="integer")));!i&&!(d.length+n.length>0&&o)||(t.add("kinds",s),t.add("fields",...n.map(a=>`${s}.${a}`),...d.map(a=>`${s}.${a}`)),t.add("rules",...f(e,[...n,...d],[s])),t.add("acts",...m(e,s).filter(([,a])=>n.some(l=>(a.writes??[]).includes(l)||a.sets?.[l]!==void 0)).map(([a])=>a)),t.say(`${p(e,s)} have a count in stock${i?" and a reorder point":""}.`))}},votes(e,t){for(let[s,r]of g(e)){for(let[n,d]of Object.entries(r.fields)){if(d.type!=="number"&&d.type!=="integer"||!he.test(n))continue;let i=m(e,s).filter(([,o])=>o.sets?.[n]!==void 0).map(([o])=>o);i.length!==0&&(t.add("kinds",s),t.add("fields",`${s}.${n}`),t.add("acts",...i),t.add("rules",...f(e,[n],[s])),t.say(`${p(e,s)} collect votes (${n}).`))}for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);!i||!fe.test(n)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n],[s,i])),t.add("acts",...m(e,s).filter(([,o])=>o.connects===n||o.severs===n).map(([o])=>o)),t.say(`${p(e,s)} pick ${$(e,i)} (${n}).`))}}},private(e,t){let s=[];for(let r of e.policy?.sees??[])if(!(!r.own&&!r.via)){for(let n of r.kinds)if(e.kinds[n]&&(t.add("kinds",n),s.includes(n)||s.push(n),r.via))for(let[d,i]of v(e))i.edges?.[r.via]&&t.add("relations",`${d}.${r.via}`)}s.length>0&&t.say(`${x(s.map(r=>p(e,r)))} are seen only by whose they are.`)},history(e,t){for(let[s,r]of g(e))for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);d.cardinality!=="one"||!i||!be(e,i)||!Object.entries(r.fields).some(([a,l])=>j(l)||/year|result|outcome|score|finish/i.test(a))||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n,i],[s,i])),t.add("lenses",...D(e,s,"rows",n),..._(e).filter(a=>a.name==="timeline"&&A(a)[s]!==void 0).map(I).filter(a=>a!==void 0)),t.say(`${p(e,s)} grouped into ${$(e,i)}, a record book.`))}},publishing(e,t){for(let[s,r]of g(e)){let n=Object.entries(r.fields).filter(([,i])=>i.type==="text").map(([i])=>i);if(n.length===0)continue;let d=Z(e,s).map(i=>i.field);for(let[i,o]of Object.entries(r.fields)){if(o.type!=="enum"||!(X.test(i)||d.includes(i))||!(o.options??[]).some(l=>Q.test(l)))continue;let a=(o.options??[]).find(l=>Q.test(l));t.add("kinds",s),t.add("fields",`${s}.${i}`,...n.map(l=>`${s}.${l}`)),t.add("acts",...m(e,s).filter(([,l])=>l.sets?.[i]===a).map(([l])=>l)),t.add("rules",...f(e,[i,...n],[s]).filter(l=>N(`${e.rules[l].when??""} ${e.rules[l].require??""}`).has(a)||n.some(h=>N(e.rules[l].require??"").has(h)))),t.say(`${p(e,s)} go from ${u(o.options[0])} to ${u(a)}, with their words.`)}}},roster(e,t){for(let[s,r]of g(e)){if(!V(e,s))continue;let n=Object.keys(r.fields);n.length<2||(t.add("kinds",s),t.add("fields",...n.map(d=>`${s}.${d}`)),t.add("lenses",...D(e,s,"columns"),...D(e,s,"rows")),t.say(`${p(e,s)}, with ${x(n.slice(1).map(d=>u(b(d))))}.`))}},routines(e,t){for(let[s,r]of g(e)){let n=Object.entries(r.fields).filter(([,a])=>j(a)&&a.repeats===!0).map(([a])=>a),d=Object.entries(r.fields).filter(([a,l])=>(l.type==="enum"||l.type==="string"||l.type==="integer"||l.type==="number")&&ue.test(a)).map(([a])=>a),i=Object.entries(r.fields).filter(([a,l])=>j(l)&&ge.test(a)).map(([a])=>a);if(n.length===0&&!(d.length>0&&i.length>0))continue;let o=[...n,...d,...i];t.add("kinds",s),t.add("fields",...o.map(a=>`${s}.${a}`)),t.add("rules",...f(e,o,[s])),t.add("lenses",...o.flatMap(a=>P(e,"calendar",s,"start",a))),t.add("acts",...m(e,s).filter(([,a])=>o.some(l=>(a.writes??[]).includes(l)||a.sets?.[l]!==void 0)).map(([a])=>a)),t.say(n.length>0?`${p(e,s)} repeat (${n[0]}).`:`${p(e,s)} come round again, each with when it was last done.`)}},comparison(e,t){for(let[s,r]of Object.entries(e.rules??{})){if(!r.require||!ye.test(r.require))continue;let n=r.over==="graph"?void 0:r.over,d=/in\('([^']+)'\)/.exec(r.require)?.[1],i=/all\('([^']+)'/.exec(r.require)?.[1],o=n?d?v(e).find(([,l])=>l.edges?.[d])?.[0]:void 0:i&&e.kinds[i]?i:void 0;if(!o&&!n)continue;let a=/==\s*'([^']+)'/.exec(r.require)?.[1];t.add("kinds",...o?[o]:[],...n?[n]:[]),t.add("rules",s),o&&a&&t.add("acts",...m(e,o).filter(([,l])=>Object.values(l.sets??{}).includes(a)).map(([l])=>l)),t.say(o&&n?`${p(e,o)} compared within each ${w(e,n)}, one ${a??"chosen"}.`:o?`${p(e,o)} compared, one ${a??"chosen"}.`:`One ${a??"chosen"} per ${w(e,n)}.`)}}};function E(e){let t=[];for(let s of k){let r=new G;ee[s](e,r),r.any()&&t.push(r.asTrait(s))}return t}function L(e,t){let s=new G;return ee[t](e,s),s.any()}var Oe=e=>Math.round(Math.max(0,Math.min(1,e))*100)/100;function q(e){return e?.type==="noul"&&Number.isFinite(e.noul)?Oe(e.noul):void 0}var Re={add:.7,drop:.7},Fe="propose_change";function Me(e){return M(e)}var De=e=>e.toLowerCase(),Te=e=>e.charAt(0).toUpperCase()+e.slice(1),O=(e,t="and")=>e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} ${t} ${e[e.length-1]}`,Se=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase(),T=(e,t)=>{let s=e.kinds[t];return De(s?.plural??(s?.noun?`${s.noun}s`:`${Se(t)}s`))},xe=e=>k.includes(e),se=(e,t)=>k.indexOf(e)-k.indexOf(t);function je(e){let t=E(e),s=new Set(t.map(r=>r.trait));return{name:e.name,keeps:Object.keys(e.kinds).map(r=>T(e,r)),"made of":t.map(r=>r.said),lacks:k.filter(r=>!s.has(r)).map(r=>y[r])}}function Ne(e,t){let s=new Set(E(t).map(n=>n.trait)),r={};for(let n of k)s.has(n)||(r[`need:${n}`]={type:"noul",instructions:`Does what they asked for need ${y[n]}, which ${t.name} has no part for yet?`,criteria:{true:`It needs ${y[n]}: they asked for it, or what they asked for cannot be kept without it.`,false:"Not asked for, and not needed to keep what they asked for."}});for(let n of Object.keys(t.kinds)){let d=T(t,n);r[`drop:kind:${n}`]={type:"noul",instructions:`Did they ask ${t.name} to stop keeping ${d}?`,criteria:{true:`They said the ${d} go: to drop them, remove them or stop tracking them.`,false:`${Te(d)} stay: nothing they said asks for them to go.`}}}for(let n of k)s.has(n)&&(r[`drop:trait:${n}`]={type:"noul",instructions:`Did they ask ${t.name} to stop having ${y[n]}?`,criteria:{true:`They said it goes: to drop or stop ${y[n]}.`,false:"It stays: nothing they said asks for it to go."}});return{state:{said:e,app:je(t)},questions:r}}var te=/^drop:(kind|trait):(.+)$/s;function Ae(e,t={}){let s={...Re,...t},r=Object.keys(e);if(r.length===0)throw new Error("readReshape was handed no answers.");let n=r.filter(o=>!/^need:/.test(o)&&!te.test(o));if(n.length>0)throw new Error(`readReshape does not know the question ${n.map(o=>`"${o}"`).join(", ")}: it reads need:<trait>, drop:kind:<name> and drop:trait:<name>.`);let d={},i={};for(let[o,a]of Object.entries(e)){let l=te.exec(o);if(l){i[`${l[1]}:${l[2]}`]=q(a)??0;continue}let h=o.slice(5);xe(h)&&(d[h]=q(a)??0)}return{add:Object.keys(d).filter(o=>d[o]>=s.add).sort(se),drop:Object.entries(i).filter(([,o])=>o>=s.drop).map(([o])=>o.slice(o.indexOf(":")+1)),needs:d,drops:i}}function Ge(e){let{said:t,document:s}=e,r=[...new Set(e.add)].sort(se),n=[...new Set(e.drop)],d=E(s),i=r.filter(c=>!L(s,c)).map(c=>({what:"trait",name:c,words:y[c],brings:J[c]})),o=r.filter(c=>L(s,c)),a=Object.keys(s.kinds).filter(c=>n.includes(c)),l=d.filter(c=>n.includes(c.trait)&&!Object.hasOwn(s.kinds,c.trait)),h=[...a.map(c=>({what:"kind",name:c,words:T(s,c)})),...l.map(c=>({what:"trait",name:c.trait,words:y[c.trait]}))],C=Object.keys(s.kinds).filter(c=>!a.includes(c)).map(c=>({what:"kind",name:c,words:T(s,c)})),ne=[...a.map(c=>`All ${T(s,c)} records go, with their links.`),...l.flatMap(c=>{let F=[...c.fields,...c.relations];return F.length>0?[`What carries ${y[c.trait]} goes: ${O(F)}, with its values and links.`]:[]})],S=[];i.length>0&&S.push(`adds ${O(i.map(c=>c.words))}`),h.length>0&&S.push(`drops ${O(h.map(c=>c.words))}`),C.length>0&&S.push(`keeps ${O(C.map(c=>c.words))}`);let re=i.length+h.length===0?`Nothing in ${s.name} changes for that.`:`This ${O(S)}.`,ie=o.length>0?` ${s.name} already has ${O(o.map(c=>y[c]))}.`:"";return{said:t,add:i.map(c=>c.name),drop:h.map(c=>c.name),card:{said:`${re}${ie}`,adds:i,keeps:C,drops:h,breaking:ne}}}async function Ue(e){let{state:t,questions:s}=Ne(e.said,e.document),{answers:r,usage:n}=await e.decide(t,s),d=Ae(r,e.thresholds??{}),i=d.add.length+d.drop.length===0?null:Ge({said:e.said,document:e.document,add:d.add,drop:d.drop});return{proposal:i&&i.add.length+i.drop.length===0?null:i,reading:d,answers:r,usage:n}}export{Fe as a,Me as b,Ne as c,Ae as d,Ge as e,Ue as f};
|
|
1
|
+
import{c as M}from"./chunk.6N4PE3U5.js";import{ga as b}from"./chunk.ZEZUKRC6.js";var k=["owners","status","schedule","budget","places","sources","stock","votes","private","history","publishing","roster","routines","comparison"],y={owners:"people who own things",status:"a status that moves",schedule:"dates it is due by, or a schedule",budget:"money against a budget",places:"places",sources:"sources behind claims",stock:"counts in stock",votes:"votes or picks",private:"private to its owner",history:"a history, a record book",publishing:"content to publish",roster:"a roster of people",routines:"repeating routines",comparison:"a comparison to pick one from"},J={owners:"a person kind (or the people the app has), an owner link, Give it to someone, a rule that every one has somebody on it, and Who has what",status:"a status with named steps (or the one the app has), an act for each step, and a board",schedule:"a due date, Set the date, the on-time rule, and a calendar",budget:"a cost beside the money the app keeps, a budget on the kind it is grouped under, Set the budget, and the over-budget rule",places:"a place kind, a link to one, and a map of where things are",sources:"a source kind, a link from each claim to its source, and the rule that a claim names one",stock:"what is on hand and the reorder level, Count the stock, and the running-low rule",votes:"a vote on each, Vote for it, and a tally",private:"a sight that keeps each person's own records to them",history:"the record book: an era or season each belongs to, and a timeline",publishing:"a published status, Publish it, and what the public sees",roster:"a person kind with the fields a roster keeps, and the list of who is here",routines:"how often each repeats and when it was last done, Mark it done, and the overdue rule",comparison:"a side-by-side of the candidates, one chosen, and Choose it"},U=new Set(["person","people","member","user","player","guest","candidate","participant","traveler","volunteer","interviewer","interviewee","contact","trade","staff","student","employee","teammate","crew","attendee","friend","customer","client","driver","speaker","host","teacher","parent","kid","child","coach","patient","tenant","resident","neighbor","applicant","recruit","contributor","assignee","worker","collaborator","runner"]),K=new Set(["place","venue","location","room","site","building","store","warehouse","city","country","region","address","hall","stadium","office","shelf"]),z=new Set(["source","reference","citation","evidence"]),H=new Set(["season","era","period","epoch","edition","generation","age","campaign","tournament"]),ae=/owner|owned|assign|^lead$|responsible|^by$|^by-|done-?by|interviewer|reviewer|maker|author|keeper|givenby|^for-?person$/i,oe=/due|deadline|until|needed|needby|target|expires|^ends?(on|at)?$|^by$/i,de=/^(date|day|when|at|start|starts|startsat|startson|startdate|scheduled|scheduledfor|scheduledon|happens|happenson|held|heldon|from|time|exchangedate|.*date|.*day)$/i,le=/released|fixed|published|applied|checked|created|added|done|last|first|updated|seen|born|birth|founded|finished|completed|closed/i,X=/status|stage|state|phase|progress/i,W=/budget|limit|cap$|allowance/i,ce=/budget|cost|price|quote|amount|salary|fee|spend|total|paid|owed/i,pe=/^(place|location|venue|address|where|city|town)$/i,B=/reorder|onhand|instock|^stock|quantity|^qty/i,he=/^votes?$|votecount|upvotes|^score$|^points$/i,fe=/^(votes?|votesfor|votedby|voters|picks?|chooses|choices|favorites|likes)$/i,ue=/often|frequency|cadence|^every$|repeat|interval/i,ge=/^last/i,Q=/^(published|live|public)$/i,ye=/count\(.*\bwhere\b.*\)\s*<=\s*1\b/,u=e=>e.toLowerCase(),w=(e,t)=>u(e.kinds[t]?.noun??b(t)),$=(e,t)=>u(e.kinds[t]?.plural??`${w(e,t)}s`),me=e=>e.charAt(0).toUpperCase()+e.slice(1),p=(e,t)=>me($(e,t)),we=e=>/^[aeiou]/i.test(e)?"an":"a",x=(e,t="and")=>e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} ${t} ${e[e.length-1]}`,N=e=>new Set((e??"").split(/[^A-Za-z0-9_-]+/).filter(Boolean)),v=e=>Object.entries(e.kinds),m=(e,t)=>Object.entries(e.acts??{}).filter(([,s])=>[s.on??[]].flat().includes(t)),_=e=>Array.isArray(e.lenses)?e.lenses:[],I=e=>typeof e.title=="string"?e.title:void 0,A=e=>e.bindings&&typeof e.bindings=="object"?e.bindings:{},R=(e,t)=>Array.isArray(t)&&t.length===1&&typeof t[0]=="string"&&e.kinds[t[0]]?t[0]:void 0;function V(e,t){let s=e.kinds[t];if(!s)return!1;let r=n=>u(n).replace(/ll/g,"l");return s.people===!0||U.has(r(t))||U.has(r(w(e,t)))}var Y=(e,t)=>K.has(u(t))||K.has(w(e,t)),ke=(e,t)=>z.has(u(t))||z.has(w(e,t)),be=(e,t)=>H.has(u(t))||H.has(w(e,t)),$e=(e,t)=>(t.type==="number"||t.type==="integer")&&(t.format==="money"||ce.test(e)),j=e=>e.type==="date"||e.type==="datetime";function P(e,t,s,r,n){return _(e).filter(d=>d.name===t&&A(d)[s]?.[r]===n).map(I).filter(d=>d!==void 0)}function D(e,t,s,r){return _(e).filter(n=>n.name==="coverage"&&A(n)[s]?.kind===t&&(r===void 0||A(n).link?.edge===r)).map(I).filter(n=>n!==void 0)}function f(e,t,s){let r=new Set(t);return Object.entries(e.rules??{}).filter(([,n])=>(s===void 0||n.over==="graph"||s.includes(n.over))&&[...N(`${n.when??""} ${n.require??""} ${n.says??""}`)].some(d=>r.has(d))).map(([n])=>n)}var G=class{kinds=new Set;fields=new Set;relations=new Set;rules=new Set;lenses=new Set;acts=new Set;said;add=(t,...s)=>{for(let r of s)this[t].add(r)};say=t=>{this.said??=t};any=()=>this.kinds.size+this.fields.size+this.relations.size+this.rules.size+this.lenses.size+this.acts.size>0;asTrait=t=>({trait:t,words:y[t],said:this.said??y[t],kinds:[...this.kinds],fields:[...this.fields],relations:[...this.relations],rules:[...this.rules],lenses:[...this.lenses],acts:[...this.acts]})};function ve(e){let t;for(let[s,r]of v(e)){let n=Object.keys(r.fields).length+Object.keys(r.edges??{}).length;(!t||n>t.fields)&&(t={kind:s,fields:n})}return t?.kind}function g(e){let t=ve(e);return v(e).sort(([s],[r])=>+(r===t)-+(s===t))}function Z(e,t){let s=e.kinds[t];if(!s)return[];let r=[];for(let[n,d]of Object.entries(s.fields)){if(d.type!=="enum"||!Array.isArray(d.options)||d.options.length<2)continue;let i=m(e,t).filter(([,a])=>typeof a.sets?.[n]=="string"&&d.options.includes(a.sets[n])).map(([a])=>a);((X.test(n)||s.lifecycle?.field===n)&&i.length>=1||i.length>=2)&&r.push({field:n,options:d.options,steps:i})}return r}var ee={owners(e,t){for(let[s,r]of g(e))for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);d.cardinality!=="one"||!i||!V(e,i)||!ae.test(n)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n],[s,i])),t.add("lenses",...D(e,s,"rows",n)),t.add("acts",...m(e,s).filter(([,o])=>o.connects===n||o.severs===n).map(([o])=>o)),t.say(`Each ${w(e,s)} has one of the ${$(e,i)} on it (${n}).`))}},status(e,t){for(let[s]of g(e))for(let{field:r,options:n,steps:d}of Z(e,s))t.add("kinds",s),t.add("fields",`${s}.${r}`),t.add("acts",...d),t.add("rules",...f(e,[r],[s])),t.add("lenses",...P(e,"columns",s,"column",r)),t.say(`${p(e,s)} move through ${x(n.map(u))}.`)},schedule(e,t){for(let[s,r]of g(e))for(let[n,d]of Object.entries(r.fields)){if(!j(d)||le.test(n))continue;let i=P(e,"calendar",s,"start",n),o=oe.test(n);if(!o&&!de.test(n)&&i.length===0)continue;t.add("kinds",s),t.add("fields",`${s}.${n}`),t.add("lenses",...i),t.add("rules",...f(e,[n],[s])),t.add("acts",...m(e,s).filter(([,l])=>(l.writes??[]).includes(n)||l.sets?.[n]!==void 0).map(([l])=>l));let a=/date|day|when|time/i.test(n)?u(b(n)):`date (${n})`;t.say(o?`${p(e,s)} are due by a date (${n}).`:`${p(e,s)} have ${we(a)} ${a}${i.length>0?", on a calendar":""}.`)}},budget(e,t){let s=v(e).flatMap(([o,a])=>Object.entries(a.fields).filter(([l,h])=>(h.type==="number"||h.type==="integer")&&W.test(l)).map(([l])=>({kind:o,name:l})));if(s.length===0)return;let r=g(e).flatMap(([o,a])=>Object.entries(a.fields).filter(([l,h])=>$e(l,h)&&!W.test(l)).map(([l])=>({kind:o,name:l})));if(r.length===0)return;let n=[...s,...r].map(o=>o.name);for(let o of[...s,...r])t.add("kinds",o.kind),t.add("fields",`${o.kind}.${o.name}`),t.add("acts",...m(e,o.kind).filter(([,a])=>(a.writes??[]).includes(o.name)||a.sets?.[o.name]!==void 0).map(([a])=>a));t.add("rules",...f(e,n).filter(o=>s.some(a=>N(e.rules[o].require??"").has(a.name))));let d=r[0],i=s.find(o=>o.kind===d.kind)??s[0];t.say(`${p(e,d.kind)}' ${u(b(d.name))} against ${i.kind===d.kind?"each one's":`each ${w(e,i.kind)}'s`} ${u(b(i.name))}.`)},places(e,t){for(let[s,r]of g(e)){Y(e,s)&&(t.add("kinds",s),t.add("lenses",...D(e,s,"columns")));for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);!i||!Y(e,i)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n],[s,i])),t.say(`${p(e,s)} are at ${$(e,i)} (${n}).`))}for(let[n,d]of Object.entries(r.fields))d.type!=="place"&&!(d.type==="string"&&pe.test(n))||(t.add("kinds",s),t.add("fields",`${s}.${n}`),t.say(`${p(e,s)} say where (${n}).`))}t.any()&&!t.said&&t.say(`${x([...t.kinds].map(s=>p(e,s)))} are places.`)},sources(e,t){for(let[s,r]of g(e)){for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);!i||!ke(e,i)&&!/^cite/i.test(n)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n,i],[s,i])),t.add("acts",...m(e,s).filter(([,o])=>o.connects===n||o.severs===n).map(([o])=>o)),t.say(`${p(e,s)} cite ${$(e,i)} (${n}).`))}for(let[n,d]of Object.entries(r.fields))d.type!=="url"||!/^source/i.test(n)||(t.add("kinds",s),t.add("fields",`${s}.${n}`),t.add("rules",...f(e,[n],[s])),t.say(`${p(e,s)} link to their source (${n}).`))}},stock(e,t){for(let[s,r]of g(e)){let n=Object.entries(r.fields).filter(([a,l])=>(l.type==="number"||l.type==="integer")&&B.test(a)).map(([a])=>a),d=Object.keys(r.computed??{}).filter(a=>B.test(a)),i=n.some(a=>/reorder/i.test(a)),o=v(e).some(([,a])=>Object.entries(a.fields).some(([l,h])=>/^(change|delta|moved)$/i.test(l)&&(h.type==="number"||h.type==="integer")));!i&&!(d.length+n.length>0&&o)||(t.add("kinds",s),t.add("fields",...n.map(a=>`${s}.${a}`),...d.map(a=>`${s}.${a}`)),t.add("rules",...f(e,[...n,...d],[s])),t.add("acts",...m(e,s).filter(([,a])=>n.some(l=>(a.writes??[]).includes(l)||a.sets?.[l]!==void 0)).map(([a])=>a)),t.say(`${p(e,s)} have a count in stock${i?" and a reorder point":""}.`))}},votes(e,t){for(let[s,r]of g(e)){for(let[n,d]of Object.entries(r.fields)){if(d.type!=="number"&&d.type!=="integer"||!he.test(n))continue;let i=m(e,s).filter(([,o])=>o.sets?.[n]!==void 0).map(([o])=>o);i.length!==0&&(t.add("kinds",s),t.add("fields",`${s}.${n}`),t.add("acts",...i),t.add("rules",...f(e,[n],[s])),t.say(`${p(e,s)} collect votes (${n}).`))}for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);!i||!fe.test(n)||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n],[s,i])),t.add("acts",...m(e,s).filter(([,o])=>o.connects===n||o.severs===n).map(([o])=>o)),t.say(`${p(e,s)} pick ${$(e,i)} (${n}).`))}}},private(e,t){let s=[];for(let r of e.policy?.sees??[])if(!(!r.own&&!r.via)){for(let n of r.kinds)if(e.kinds[n]&&(t.add("kinds",n),s.includes(n)||s.push(n),r.via))for(let[d,i]of v(e))i.edges?.[r.via]&&t.add("relations",`${d}.${r.via}`)}s.length>0&&t.say(`${x(s.map(r=>p(e,r)))} are seen only by whose they are.`)},history(e,t){for(let[s,r]of g(e))for(let[n,d]of Object.entries(r.edges??{})){let i=R(e,d.to);d.cardinality!=="one"||!i||!be(e,i)||!Object.entries(r.fields).some(([a,l])=>j(l)||/year|result|outcome|score|finish/i.test(a))||(t.add("kinds",s,i),t.add("relations",`${s}.${n}`),t.add("rules",...f(e,[n,i],[s,i])),t.add("lenses",...D(e,s,"rows",n),..._(e).filter(a=>a.name==="timeline"&&A(a)[s]!==void 0).map(I).filter(a=>a!==void 0)),t.say(`${p(e,s)} grouped into ${$(e,i)}, a record book.`))}},publishing(e,t){for(let[s,r]of g(e)){let n=Object.entries(r.fields).filter(([,i])=>i.type==="text").map(([i])=>i);if(n.length===0)continue;let d=Z(e,s).map(i=>i.field);for(let[i,o]of Object.entries(r.fields)){if(o.type!=="enum"||!(X.test(i)||d.includes(i))||!(o.options??[]).some(l=>Q.test(l)))continue;let a=(o.options??[]).find(l=>Q.test(l));t.add("kinds",s),t.add("fields",`${s}.${i}`,...n.map(l=>`${s}.${l}`)),t.add("acts",...m(e,s).filter(([,l])=>l.sets?.[i]===a).map(([l])=>l)),t.add("rules",...f(e,[i,...n],[s]).filter(l=>N(`${e.rules[l].when??""} ${e.rules[l].require??""}`).has(a)||n.some(h=>N(e.rules[l].require??"").has(h)))),t.say(`${p(e,s)} go from ${u(o.options[0])} to ${u(a)}, with their words.`)}}},roster(e,t){for(let[s,r]of g(e)){if(!V(e,s))continue;let n=Object.keys(r.fields);n.length<2||(t.add("kinds",s),t.add("fields",...n.map(d=>`${s}.${d}`)),t.add("lenses",...D(e,s,"columns"),...D(e,s,"rows")),t.say(`${p(e,s)}, with ${x(n.slice(1).map(d=>u(b(d))))}.`))}},routines(e,t){for(let[s,r]of g(e)){let n=Object.entries(r.fields).filter(([,a])=>j(a)&&a.repeats===!0).map(([a])=>a),d=Object.entries(r.fields).filter(([a,l])=>(l.type==="enum"||l.type==="string"||l.type==="integer"||l.type==="number")&&ue.test(a)).map(([a])=>a),i=Object.entries(r.fields).filter(([a,l])=>j(l)&&ge.test(a)).map(([a])=>a);if(n.length===0&&!(d.length>0&&i.length>0))continue;let o=[...n,...d,...i];t.add("kinds",s),t.add("fields",...o.map(a=>`${s}.${a}`)),t.add("rules",...f(e,o,[s])),t.add("lenses",...o.flatMap(a=>P(e,"calendar",s,"start",a))),t.add("acts",...m(e,s).filter(([,a])=>o.some(l=>(a.writes??[]).includes(l)||a.sets?.[l]!==void 0)).map(([a])=>a)),t.say(n.length>0?`${p(e,s)} repeat (${n[0]}).`:`${p(e,s)} come round again, each with when it was last done.`)}},comparison(e,t){for(let[s,r]of Object.entries(e.rules??{})){if(!r.require||!ye.test(r.require))continue;let n=r.over==="graph"?void 0:r.over,d=/in\('([^']+)'\)/.exec(r.require)?.[1],i=/all\('([^']+)'/.exec(r.require)?.[1],o=n?d?v(e).find(([,l])=>l.edges?.[d])?.[0]:void 0:i&&e.kinds[i]?i:void 0;if(!o&&!n)continue;let a=/==\s*'([^']+)'/.exec(r.require)?.[1];t.add("kinds",...o?[o]:[],...n?[n]:[]),t.add("rules",s),o&&a&&t.add("acts",...m(e,o).filter(([,l])=>Object.values(l.sets??{}).includes(a)).map(([l])=>l)),t.say(o&&n?`${p(e,o)} compared within each ${w(e,n)}, one ${a??"chosen"}.`:o?`${p(e,o)} compared, one ${a??"chosen"}.`:`One ${a??"chosen"} per ${w(e,n)}.`)}}};function E(e){let t=[];for(let s of k){let r=new G;ee[s](e,r),r.any()&&t.push(r.asTrait(s))}return t}function L(e,t){let s=new G;return ee[t](e,s),s.any()}var Oe=e=>Math.round(Math.max(0,Math.min(1,e))*100)/100;function q(e){return e?.type==="noul"&&Number.isFinite(e.noul)?Oe(e.noul):void 0}var Re={add:.7,drop:.7},Fe="propose_change";function Me(e){return M(e)}var De=e=>e.toLowerCase(),Te=e=>e.charAt(0).toUpperCase()+e.slice(1),O=(e,t="and")=>e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} ${t} ${e[e.length-1]}`,Se=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase(),T=(e,t)=>{let s=e.kinds[t];return De(s?.plural??(s?.noun?`${s.noun}s`:`${Se(t)}s`))},xe=e=>k.includes(e),se=(e,t)=>k.indexOf(e)-k.indexOf(t);function je(e){let t=E(e),s=new Set(t.map(r=>r.trait));return{name:e.name,keeps:Object.keys(e.kinds).map(r=>T(e,r)),"made of":t.map(r=>r.said),lacks:k.filter(r=>!s.has(r)).map(r=>y[r])}}function Ne(e,t){let s=new Set(E(t).map(n=>n.trait)),r={};for(let n of k)s.has(n)||(r[`need:${n}`]={type:"noul",instructions:`Does what they asked for need ${y[n]}, which ${t.name} has no part for yet?`,criteria:{true:`It needs ${y[n]}: they asked for it, or what they asked for cannot be kept without it.`,false:"Not asked for, and not needed to keep what they asked for."}});for(let n of Object.keys(t.kinds)){let d=T(t,n);r[`drop:kind:${n}`]={type:"noul",instructions:`Did they ask ${t.name} to stop keeping ${d}?`,criteria:{true:`They said the ${d} go: to drop them, remove them or stop tracking them.`,false:`${Te(d)} stay: nothing they said asks for them to go.`}}}for(let n of k)s.has(n)&&(r[`drop:trait:${n}`]={type:"noul",instructions:`Did they ask ${t.name} to stop having ${y[n]}?`,criteria:{true:`They said it goes: to drop or stop ${y[n]}.`,false:"It stays: nothing they said asks for it to go."}});return{state:{said:e,app:je(t)},questions:r}}var te=/^drop:(kind|trait):(.+)$/s;function Ae(e,t={}){let s={...Re,...t},r=Object.keys(e);if(r.length===0)throw new Error("readReshape was handed no answers.");let n=r.filter(o=>!/^need:/.test(o)&&!te.test(o));if(n.length>0)throw new Error(`readReshape does not know the question ${n.map(o=>`"${o}"`).join(", ")}: it reads need:<trait>, drop:kind:<name> and drop:trait:<name>.`);let d={},i={};for(let[o,a]of Object.entries(e)){let l=te.exec(o);if(l){i[`${l[1]}:${l[2]}`]=q(a)??0;continue}let h=o.slice(5);xe(h)&&(d[h]=q(a)??0)}return{add:Object.keys(d).filter(o=>d[o]>=s.add).sort(se),drop:Object.entries(i).filter(([,o])=>o>=s.drop).map(([o])=>o.slice(o.indexOf(":")+1)),needs:d,drops:i}}function Ge(e){let{said:t,document:s}=e,r=[...new Set(e.add)].sort(se),n=[...new Set(e.drop)],d=E(s),i=r.filter(c=>!L(s,c)).map(c=>({what:"trait",name:c,words:y[c],brings:J[c]})),o=r.filter(c=>L(s,c)),a=Object.keys(s.kinds).filter(c=>n.includes(c)),l=d.filter(c=>n.includes(c.trait)&&!Object.hasOwn(s.kinds,c.trait)),h=[...a.map(c=>({what:"kind",name:c,words:T(s,c)})),...l.map(c=>({what:"trait",name:c.trait,words:y[c.trait]}))],C=Object.keys(s.kinds).filter(c=>!a.includes(c)).map(c=>({what:"kind",name:c,words:T(s,c)})),ne=[...a.map(c=>`All ${T(s,c)} records go, with their links.`),...l.flatMap(c=>{let F=[...c.fields,...c.relations];return F.length>0?[`What carries ${y[c.trait]} goes: ${O(F)}, with its values and links.`]:[]})],S=[];i.length>0&&S.push(`adds ${O(i.map(c=>c.words))}`),h.length>0&&S.push(`drops ${O(h.map(c=>c.words))}`),C.length>0&&S.push(`keeps ${O(C.map(c=>c.words))}`);let re=i.length+h.length===0?`Nothing in ${s.name} changes for that.`:`This ${O(S)}.`,ie=o.length>0?` ${s.name} already has ${O(o.map(c=>y[c]))}.`:"";return{said:t,add:i.map(c=>c.name),drop:h.map(c=>c.name),card:{said:`${re}${ie}`,adds:i,keeps:C,drops:h,breaking:ne}}}async function Ue(e){let{state:t,questions:s}=Ne(e.said,e.document),{answers:r,usage:n}=await e.decide(t,s),d=Ae(r,e.thresholds??{}),i=d.add.length+d.drop.length===0?null:Ge({said:e.said,document:e.document,add:d.add,drop:d.drop});return{proposal:i&&i.add.length+i.drop.length===0?null:i,reading:d,answers:r,usage:n}}export{Fe as a,Me as b,Ne as c,Ae as d,Ge as e,Ue as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u}from"./chunk.
|
|
1
|
+
import{b as u}from"./chunk.JQ63N4MZ.js";import{na as l}from"./chunk.ZEZUKRC6.js";function a(e,n){let s=new Map;for(let o of e){let t=n(o.from),i=n(o.to);if(t===void 0||i===void 0)continue;let d=`${o.kind}|${t}|${i}`,r=s.get(d);r||s.set(d,r={edge:o.kind,from:t,to:i,links:0,froms:new Set,tos:new Set}),r.links+=1,r.froms.add(o.from),r.tos.add(o.to)}return[...s.entries()].sort(([o],[t])=>o<t?-1:o>t?1:0).map(([o,t])=>({key:o,edge:t.edge,from:t.from,to:t.to,links:t.links,fromCount:t.froms.size,toCount:t.tos.size}))}function m(e,n,s){let o=[],t=[];for(let d of e){let r=f(d);if(r!==null){o.includes(r)||o.push(r);continue}s(d)!==void 0&&t.push(d)}let i=n.overview&&n.focusId!==null?f(n.focusId):null;return n.beside&&n.overview&&i===null&&n.focusId!==null&&t.length===0&&o.length===0&&s(n.focusId)!==void 0&&t.push(n.focusId),{districts:o,records:t,lens:i}}function f(e){return e.startsWith("kind:")?e.slice(5)||null:e.startsWith("aggregate:")&&!e.includes("|")&&e.slice(10)||null}function y(e,n){let s=u(e,n.from,n.edge,"out"),o=n.from===n.to?" of their own":"";return`${l(e,n.from,n.fromCount)} \u2192 ${l(e,n.to,n.toCount)}${o}, ${s}`}export{a,m as b,f as c,y as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{sd as e}from"./chunk.
|
|
1
|
+
import{sd as e}from"./chunk.ZEZUKRC6.js";var i=`
|
|
2
2
|
.graview-spec{display:flex;flex-direction:column;gap:6px;min-width:0;color:var(--graview-ink)}
|
|
3
3
|
|
|
4
4
|
.graview-spec-row{flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px 10px;box-sizing:border-box;max-width:100%;padding:5px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius-sm,8px);background:var(--graview-panel);font-size:.875rem}
|
|
@@ -1,3 +1,3 @@
|
|
|
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{G as f,Ga as u,W as m}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{G as f,Ga as u,W as m}from"./chunk.A5PSEU3W.js";import{b as d}from"./chunk.AJZBJBMO.js";var g=d(f(),1),n=d(m(),1),c=/^\s*(\d{1,6})[.)]\s+(.*)$/s,S=/^\s*[-*•]\s+(.*)$/s;function h(o){let s=[];for(let p of o.replace(/\r\n?/g,`
|
|
2
2
|
`).split(/\n[ \t]*\n+/)){let t=null,a=()=>{t&&(t.t==="p"?t.lines.length>0:t.items.length>0)&&s.push(t),t=null};for(let e of p.split(`
|
|
3
|
-
`)){let i=c.exec(e),l=i?null:S.exec(e);if(i)t?.t!=="ol"&&(a(),t={t:"ol",start:Number(i[1]),items:[]}),t.items.push(i[2]);else if(l)t?.t!=="ul"&&(a(),t={t:"ul",items:[]}),t.items.push(l[1]);else if(t&&t.t!=="p"&&/^\s+\S/.test(e)){let r=t.items;r[r.length-1]=`${r[r.length-1]} ${e.trim()}`}else e.trim().length>0&&(t?.t!=="p"&&(a(),t={t:"p",lines:[]}),t.lines.push(e.trim()))}a()}return s}function P(o){return/[\r\n]/.test(o)}var k={display:"grid",gap:"0.7em",minWidth:0,overflowWrap:"anywhere"},x={margin:0},y={margin:0,paddingInlineStart:"1.6em",display:"grid",gap:"0.3em"},B=u(()=>(__graviewPreload(import.meta.url,["./chunk.
|
|
3
|
+
`)){let i=c.exec(e),l=i?null:S.exec(e);if(i)t?.t!=="ol"&&(a(),t={t:"ol",start:Number(i[1]),items:[]}),t.items.push(i[2]);else if(l)t?.t!=="ul"&&(a(),t={t:"ul",items:[]}),t.items.push(l[1]);else if(t&&t.t!=="p"&&/^\s+\S/.test(e)){let r=t.items;r[r.length-1]=`${r[r.length-1]} ${e.trim()}`}else e.trim().length>0&&(t?.t!=="p"&&(a(),t={t:"p",lines:[]}),t.lines.push(e.trim()))}a()}return s}function P(o){return/[\r\n]/.test(o)}var k={display:"grid",gap:"0.7em",minWidth:0,overflowWrap:"anywhere"},x={margin:0},y={margin:0,paddingInlineStart:"1.6em",display:"grid",gap:"0.3em"},B=u(()=>(__graviewPreload(import.meta.url,["./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.UW52CMGJ.js")));function b({text:o,className:s,style:p,markdown:t,headingsFrom:a}){return t?(0,n.jsx)(g.Suspense,{fallback:(0,n.jsx)(b,{text:o,...s?{className:s}:{},...p?{style:p}:{}}),children:(0,n.jsx)(B,{text:o,...s?{className:s}:{},...p?{style:p}:{},...a?{headingsFrom:a}:{}})}):(0,n.jsx)("div",{"data-graview-text-body":"",...s?{className:s}:{},style:{...k,...p},children:h(o).map((e,i)=>e.t==="p"?(0,n.jsx)("p",{style:x,children:e.lines.map((l,r)=>(0,n.jsxs)("span",{children:[r>0?(0,n.jsx)("br",{}):null,l]},r))},i):e.t==="ol"?(0,n.jsx)("ol",{start:e.start,style:y,children:e.items.map((l,r)=>(0,n.jsx)("li",{children:l},r))},i):(0,n.jsx)("ul",{style:y,children:e.items.map((l,r)=>(0,n.jsx)("li",{children:l},r))},i))})}export{P as a,b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.MIE4TJRW.js";import{o as D}from"./chunk.
|
|
1
|
+
import"./chunk.MIE4TJRW.js";import{o as D}from"./chunk.QRQ5WPZI.js";import"./chunk.RD2FSSLV.js";import"./chunk.37RFCHSS.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import{a as $}from"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{G as P,W as C}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import{$a as c,Va as w,Xa as R,ba as S}from"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as k}from"./chunk.AJZBJBMO.js";var m=k(P(),1);var e=k(C(),1),W=[["","Does not repeat"],["day","Daily"],["week","Weekly"],["month","Monthly"],["year","Yearly"]],E=r=>`${r}${r%100>=11&&r%100<=13?"th":["th","st","nd","rd"][r%10]??"th"}`,v={display:"flex",flexWrap:"wrap",gap:"6px 12px",alignItems:"center"};function N({value:r,onChange:d,start:p,label:s,name:l="repeat"}){let f=(0,m.useId)(),a=c(r)?r:void 0,i=typeof p=="string"&&/^\d{4}-\d{2}-\d{2}/.test(p)?p:void 0,u=i?w[new Date(`${i.slice(0,10)}T00:00:00Z`).getUTCDay()]:void 0,o=t=>{let n={...a??{every:"week"},...t};for(let b of Object.keys(n))n[b]===void 0&&delete n[b];d(n)},y=a?.every??"week",g=a?.on??(u?[u]:[]);return(0,e.jsxs)("fieldset",{"data-graview-part":"field","data-graview-field":"repeat","data-graview-repeat":l,style:{display:"grid",gap:8,border:"1px solid var(--graview-edge)",borderRadius:8,padding:"8px 12px",margin:0,minWidth:0},children:[(0,e.jsx)("legend",{"data-graview-part":"label",style:{padding:"0 4px"},children:s}),(0,e.jsxs)("div",{style:v,children:[(0,e.jsx)("label",{htmlFor:`${f}-every`,children:"Repeats"}),(0,e.jsx)("select",{id:`${f}-every`,name:`${l}.every`,value:a?.every??"",onChange:t=>{let n=t.target.value;d(n===""?void 0:{...a?.interval?{interval:a.interval}:{},...a?.until?{until:a.until}:{},every:n})},"data-graview-part":"control",children:W.map(([t,n])=>(0,e.jsx)("option",{value:t,children:n},t))}),a?(0,e.jsxs)("label",{style:v,children:["every",(0,e.jsx)("input",{type:"number",min:1,max:99,name:`${l}.interval`,"aria-label":`Every how many ${y}s`,value:a.interval??1,onChange:t=>o({interval:Number(t.target.value)>1?Math.min(99,Math.round(Number(t.target.value))):void 0}),style:{width:"4.5em"},"data-graview-part":"control"}),y,(a.interval??1)>1?"s":""]}):null]}),a?.every==="week"?(0,e.jsxs)("div",{role:"group","aria-label":"On",style:v,children:[(0,e.jsx)("span",{"aria-hidden":"true",children:"On"}),w.map((t,n)=>(0,e.jsxs)("label",{style:{display:"inline-flex",gap:4,alignItems:"center",minHeight:24},children:[(0,e.jsx)("input",{type:"checkbox",name:`${l}.on`,value:t,checked:g.includes(t),onChange:b=>{let h=w.filter(x=>x===t?b.target.checked:g.includes(x));o({on:h.length===0||h.length===1&&h[0]===u?void 0:h})}}),S(n,"short")]},t))]}):null,a?.every==="month"?(0,e.jsxs)("label",{style:v,children:["On",(0,e.jsxs)("select",{name:`${l}.on`,value:a.on?.[0]===-1?"last":"",onChange:t=>o({on:t.target.value==="last"?[-1]:void 0}),"data-graview-part":"control",children:[(0,e.jsx)("option",{value:"",children:i?`the ${E(Number(i.slice(8,10)))}`:"the same day"}),(0,e.jsx)("option",{value:"last",children:"the last day"})]})]}):null,a?(0,e.jsxs)("label",{style:v,children:["Until",(0,e.jsx)("input",{type:"date",name:`${l}.until`,value:a.until??"",onChange:t=>o({until:t.target.value||void 0}),"data-graview-part":"control"})]}):null,(0,e.jsx)("p",{"aria-live":"polite","data-graview-repeat-said":"",style:{margin:0,color:"var(--graview-ink-dim)",fontSize:"0.8125rem"},children:a?$(i??"",a):"Does not repeat"})]})}function K({nodeId:r,field:d,start:p,value:s,label:l}){let{fields:f,commit:a}=D(r),i=f.find(t=>t.field===R(d)&&t.takesValue&&t.open.length===0),[u,o]=(0,m.useState)(!1),[y,g]=(0,m.useState)(c(s)?s:void 0);return i?u?(0,e.jsxs)("form",{onSubmit:t=>{t.preventDefault(),o(!1),a(i,y??null)},style:{display:"grid",gap:6,marginTop:6},children:[(0,e.jsx)(N,{value:y,onChange:g,start:p,label:l,name:R(d)}),(0,e.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,e.jsx)("button",{type:"submit","data-graview-repeat-keep":d,children:"Keep"}),(0,e.jsx)("button",{type:"button",onClick:()=>o(!1),children:"Cancel"})]})]}):(0,e.jsx)("button",{type:"button","data-graview-repeat-open":d,onClick:()=>(g(c(s)?s:void 0),o(!0)),style:{marginInlineStart:8,fontSize:"0.75rem",padding:"1px 8px",borderRadius:999,minHeight:24},children:c(s)?"Change how it repeats":"Repeat\u2026"}):null}export{K as RepeatEditor,N as RepeatPicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as o}from"./chunk.
|
|
1
|
+
import{C as o}from"./chunk.ZEZUKRC6.js";var r=Symbol.for("@graview/core:markdown");function t(e){let n=o(e);return!!n&&(n[r]===1||t(n.innerType))}export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as U,b as Y,c as G,d as D}from"./chunk.
|
|
1
|
+
import{a as U,b as Y,c as G,d as D}from"./chunk.4UUJHLHR.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{G as ae,R as L,S as F,W as V,fa as _}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import{W as H,db as K,eb as B,td as M}from"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as R}from"./chunk.AJZBJBMO.js";function O(n,t){let r=K(n);return r==="agent"?"agent":r!=="human"&&r!=="visitor"?"app":n.onBehalfOf!==void 0?"person":n.id===void 0||t?.id===void 0||n.id===t.id?"you":"person"}var re=n=>n.ops.filter(t=>t.withheld!==!0);function X(n,t={}){let r=[];for(let e of n.batches()){let s=e.ops[0],d=e.ops.at(-1),l=re(e).length===0,h=l?void 0:Y(e.ops),c=r.at(-1);if(h&&c?.typed&&c.author&&U(c.author,e.author)&&c.typed.node===h.node&&c.typed.field===h.field){let S=G(c.typed,h);r[r.length-1]={...c,seq:d.seq+1,at:d.at,batch:e.id,batches:[...c.batches??[],e.id],typed:S,said:D(S,n.schema,n.graph,!1)};continue}r.push({seq:d.seq+1,from:s.seq,at:d.at,batch:e.id,maker:l?"person":O(e.author,t.me),author:l?void 0:e.author,said:h?D(h,n.schema,n.graph,!1):e.intent,declaration:!1,withheld:l,...h?{batches:[e.id],typed:h}:{}})}let i=[...n.log.epochs().filter(e=>e.change!==void 0).map(e=>({seq:e.seq,sentence:e.change,...e.at?{at:e.at}:{}})),...t.declarations??[]];for(let e of i){if(e.seq<n.log.horizon||e.seq>n.log.length)continue;let s=r.findIndex(d=>d.seq===e.seq);if(s>=0&&!r[s].withheld){r[s]={...r[s],declaration:!0,said:e.sentence};continue}r.push({seq:e.seq,from:e.seq,at:e.at,batch:void 0,maker:e.author?O(e.author,t.me):"app",author:e.author,said:e.sentence,declaration:!0,withheld:!1})}return r.sort((e,s)=>e.seq-s.seq||+(e.batch!==void 0)-+(s.batch!==void 0))}function J(n,t){let r=n.log.all(),i=new Map(r.map(e=>[e.id,e.seq]));return n.batches().filter(e=>!e.undone&&e.ops[0].seq>=t).filter(e=>!e.ops.every(s=>s.sentOut!==void 0)).filter(e=>!e.ops.every(s=>s.undoes!==void 0&&(i.get(s.undoes)??-1)>=t)).map(e=>e.id)}function Q(n,t){return n.withheld?"Someone":n.maker==="you"?"you":n.author?B(n.author,t):"the app"}var p=R(ae(),1);var o=R(V(),1),oe={kind:"human"},ie=[1,2,4,8],se=900,E={you:"You",person:"A person",agent:"An agent",app:"The app"},Z={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function de(n,t,r){return[...new Set([...r,t,...n.map(i=>i.seq)])].sort((i,e)=>i-e)}function le(n,t){let r=n.withheld===!0;return{seq:n.seq+1,from:n.seq,at:n.at,batch:n.batch,maker:r?"person":O(n.author,t),author:r?void 0:n.author,said:n.batchIntent??n.intent,declaration:!1,withheld:r}}function ce(n,t){let r=0;for(let i=0;i<n.length;i++)n[i]<=t&&(r=i);return r}function pe(n,t,r){let i=J(n,t);if(i.length===0)return null;let e=n.canUndo(i);if(!e.ok)return null;let s=new Set(n.permittedMutations(r).map(d=>d.name));return e.ops.every(d=>d.mutation!==null&&s.has(d.mutation.name))?i:null}function we({face:n}){let t=L(),r=_(),i=r?.principal??oe,e=F(t.live,i),s=e.log.length,d=(0,p.useMemo)(()=>X(e,{me:i,...t.host?.declarations?{declarations:t.host.declarations}:{}}),[e,i,t.host,s]),l=e.log.horizon,h=l>0&&t.host?.archived!==void 0,c=t.kept,S=(0,p.useMemo)(()=>h?c?.stops??Array.from({length:l},(a,g)=>g):[],[h,c,l]),m=(0,p.useMemo)(()=>de(d,l,S),[d,l,S]),f=t.archive,y=f?.seq??t.past?.seq??s,x=t.host?.kept&&(f?.behindKept||c!==void 0&&(y<=c.through||c.from>0&&y<=c.from))?t.host.kept:void 0,w=ce(m,y),b=m.length-1,j=y<l&&t.past?.seq===y?t.past.store.log.all().at(-1):void 0,q=j?le(j,i):y<l?void 0:[...d].reverse().find(a=>a.seq<=y&&a.seq>(m[w-1]??-1))??[...d].reverse().find(a=>a.seq<=y),[k,A]=(0,p.useState)(!1),[T,ee]=(0,p.useState)(1),[C,W]=(0,p.useState)(null);(0,p.useEffect)(()=>{if(!k)return;if(w>=b){A(!1);return}let a=setTimeout(()=>t.show(m[w+1]),se/T);return()=>clearTimeout(a)},[k,w,b,T,m,t]);let z=(0,p.useMemo)(()=>t.past&&!f&&y>=l?pe(e,y,i):null,[t.past,f,e,y,l,i,s]),N=a=>Q(a,{graph:e.graph,schema:e.schema,...r?.seats?{seats:r.seats}:{},...r?.people?{people:r.people}:{}}),v=t.past?t.past.at?H(t.past.at,r?.locale):"the start":null,$=f?f.refused?"The archive could not be read":f.behindKept?"Nothing this far back is kept":"Reading the older changes from the archive\u2026":q?`${N(q)==="you"?"You":N(q)}: ${q.said}`:"Nothing had happened yet",I=(0,p.useRef)(null);(0,p.useLayoutEffect)(()=>{let a=I.current,g=a?.parentElement;if(n!=="scene"||!a||!g)return;let u=()=>g.style.setProperty("--graview-sheet",`${Math.ceil(a.getBoundingClientRect().height)+24}px`);u();let P=typeof ResizeObserver>"u"?null:new ResizeObserver(u);return P?.observe(a),()=>{P?.disconnect(),g.style.removeProperty("--graview-sheet")}},[n]);let te=n==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:M("rail")}:{position:"sticky",top:0,zIndex:M("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,o.jsxs)("section",{ref:I,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":t.past?String(t.past.seq):"now","data-graview-offstage":"",style:{...te,boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontSize:"0.8125rem"},children:[(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,o.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:f?"Archived changes":v?`As of ${v}`:"Now"}),(0,o.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:$}),v?(0,o.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,o.jsxs)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:[h?(0,o.jsx)("span",{"data-testid":"timeline-archived",title:"Changes read from the archive as you scrub back",style:{position:"absolute",left:0,bottom:0,height:6,width:`${b===0?0:m.indexOf(l)/b*100}%`,borderRadius:2,background:"var(--graview-edge)"}}):null,m.slice(1).map((a,g)=>{let u=[...d].reverse().find(ne=>ne.seq===a);if(!u)return null;let P=b===0?0:(g+1)/b*100;return(0,o.jsx)("span",{"data-graview-tick":a,"data-maker":u.maker,...u.declaration?{"data-declaration":""}:{},title:`${E[u.maker]}: ${u.said}`,style:{position:"absolute",left:`calc(${P}% - 1px)`,bottom:0,width:u.declaration?4:2,height:u.declaration?22:12,borderRadius:2,background:u.declaration?"var(--graview-ink)":Z[u.maker],opacity:a<=y?1:.45}},`${a}:${u.batch??"declaration"}`)})]}),(0,o.jsx)("input",{type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:b,step:1,value:w,"aria-valuetext":v?`As of ${v}. ${$}`:`Now. ${$}`,onChange:a=>{A(!1),t.show(m[Number(a.currentTarget.value)]??s)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,o.jsx)("button",{type:"button","data-testid":"play","aria-pressed":k,onClick:()=>{!k&&w>=b&&t.show(m[0]),A(!k)},style:{minHeight:28,minWidth:64},children:k?"Pause":"Play"}),(0,o.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,o.jsx)("select",{"data-testid":"speed",value:T,onChange:a=>ee(Number(a.currentTarget.value)),style:{minHeight:28},children:ie.map(a=>(0,o.jsxs)("option",{value:a,children:[a,"\xD7"]},a))})]}),(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(E).filter(a=>d.some(g=>g.maker===a)).map(a=>(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,o.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:Z[a]}}),E[a]]},a))}),(0,o.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[z?(0,o.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{W(null);try{e.undo([...z],{author:i,intent:v?`Restore to ${v}`:"Restore"}),t.show(null)}catch(a){W(a instanceof Error?a.message:String(a))}},style:{minHeight:28},children:"Restore to here"}):null,(0,o.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>t.show(null),style:{minHeight:28},children:"Back to now"})]})]}),C?(0,o.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:C}):null,f?.refused?(0,o.jsx)("span",{role:"alert","data-testid":"archive-refused",style:{color:"var(--graview-warn)"},children:f.refused}):null,x?(0,o.jsxs)("span",{"data-testid":"timeline-kept",style:{color:"var(--graview-ink-faint)"},children:[x.sentence,x.action?(0,o.jsxs)(o.Fragment,{children:[" ",(0,o.jsx)("a",{"data-testid":"timeline-kept-action",href:x.action.href,style:{color:"var(--graview-ink-muted)"},children:x.action.label})]}):null]}):null,l>0&&!h?(0,o.jsx)("span",{"data-testid":"timeline-horizon",style:{color:"var(--graview-ink-faint)"},children:"The changes before the timeline's start were archived."}):null]})}export{we as Timeline};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as S,e as w,f as I}from"./chunk.
|
|
1
|
+
import{d as S,e as w,f as I}from"./chunk.SFBHPYRD.js";import{d as k,g as h,h as b}from"./chunk.ILJDLBPJ.js";import"./chunk.X226YATK.js";import"./chunk.BJUUSIQY.js";import"./chunk.MSAYU25L.js";import{a as A}from"./chunk.QF5QB5YR.js";import"./chunk.EGPCVMDU.js";import"./chunk.M7KXQGQL.js";import"./chunk.XOZU4OFA.js";import"./chunk.H3EGBDW2.js";import"./chunk.6KJGRM7A.js";import"./chunk.SO6NT5K7.js";import"./chunk.MUSMNKE4.js";import"./chunk.SJQPTDAT.js";import"./chunk.JQ63N4MZ.js";import"./chunk.Z3O2VZAJ.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{G as M,W as f}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as d}from"./chunk.AJZBJBMO.js";var n=d(M(),1);var r=d(f(),1),C="several";function T({chosen:c,acts:p,onAct:N}){let t=A(),u=(0,n.useMemo)(()=>[...c].sort(),[c]),i=u.join(`
|
|
2
2
|
`),o=(0,n.useMemo)(()=>({on:"selection",ids:u}),[i]),l=(0,n.useMemo)(()=>p.filter(e=>e.open.length===0&&!e.more&&!e.destructive),[p]),g=(0,n.useMemo)(()=>new Map(l.map(e=>[h(e.id),e])),[l]),v=S(t,o,C),[y,x]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(v!==void 0)return;let e=!0;return w(t,o,{by:C,ask:()=>b(t.ai,{store:t.store,target:o,principal:t.principal,interaction:k(),places:t.places,selection:t.selection,...t.place?{place:t.place}:{},shared:l.map(a=>({id:a.id,label:a.label,mutation:a.mutation,args:a.args}))})}).then(a=>{e&&x({key:i,result:a})}),()=>{e=!1}},[i]);let s=v??(y?.key===i?y.result:void 0);if(s===void 0)return(0,r.jsx)("span",{role:"status",className:"graview-several-quiet","data-testid":"several-ai-thinking",style:{textDecoration:"none"},children:"AI: thinking\u2026"});let m=s.offers.filter(e=>e.type!=="act"||g.has(e.id));if(m.length===0)return null;let E=e=>{let a=g.get(e.id);if(a){t.desk.record({...s.interaction,outcome:"accepted",accepted:[e.id]}),N(a);return}I(t,s,e)};return(0,r.jsx)("div",{role:"group","aria-label":"Suggested by AI",className:"graview-several-acts","data-testid":"several-ai",children:m.map(e=>(0,r.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-ai-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>E(e),children:[e.label,(0,r.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontWeight:400},children:" \xB7 suggested"})]},e.id))})}export{T as SeveralAi};
|
|
@@ -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{b as v}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{b as v}from"./chunk.Z27NSSYL.js";import"./chunk.QNP5OR3P.js";import"./chunk.4W57E7AX.js";import{G as S,V as y,W as b}from"./chunk.A5PSEU3W.js";import"./chunk.SDO3U72B.js";import"./chunk.ZEZUKRC6.js";import"./chunk.FQLNBIQ5.js";import{b as u}from"./chunk.AJZBJBMO.js";var r=u(S(),1);var t=u(b(),1);function E(o){let a=(0,r.useContext)(y),l=(0,t.jsx)(C,{...o});return!a||o.nodeId===void 0?l:(0,t.jsx)(P,{nodeId:o.nodeId,field:o.field,label:o.label,...o.markdown?{markdown:!0}:{},live:a,onDone:d=>o.onDone?o.onDone(d):o.onCancel(),writtenWhole:l})}var P=(0,r.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.Z27NSSYL.js","./chunk.QNP5OR3P.js","./chunk.4W57E7AX.js","./chunk.A5PSEU3W.js","./chunk.SDO3U72B.js","./chunk.ZEZUKRC6.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.MAKCZ6B6.js")));function C({field:o,label:a,value:l,markdown:d,onSave:s,onCancel:c}){let[i,h]=(0,r.useState)(l),[n,w]=(0,r.useState)(!1),f=(0,r.useRef)(null);return(0,r.useEffect)(()=>f.current?.focus(),[n]),(0,r.useLayoutEffect)(()=>{let e=f.current;if(!e||n||typeof CSS<"u"&&CSS.supports?.("field-sizing","content"))return;let p=()=>{e.style.height="auto";let m=getComputedStyle(e);e.style.height=`${e.scrollHeight+parseFloat(m.borderTopWidth)+parseFloat(m.borderBottomWidth)}px`};p();let x=requestAnimationFrame(p);return()=>cancelAnimationFrame(x)},[i,n]),(0,t.jsxs)("form",{style:{display:"grid",gap:8,minWidth:0},onSubmit:e=>{e.preventDefault(),s(i,!1)},children:[n?(0,t.jsx)("div",{"data-graview-preview":o,"aria-label":`${a}, as it will read`,role:"region",style:k,children:(0,t.jsx)(v,{text:i,markdown:!0})}):(0,t.jsx)("textarea",{ref:f,"aria-label":a,"data-graview-field":o,value:i,rows:3,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),c()):e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),s(i,!1))},onBlur:e=>{e.relatedTarget instanceof Node&&e.currentTarget.form?.contains(e.relatedTarget)||s(i,!0)},style:T}),(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,t.jsx)("button",{type:"submit",style:g,children:"Save"}),(0,t.jsx)("button",{type:"button",onClick:c,style:g,children:"Cancel"}),d?(0,t.jsx)("button",{type:"button","aria-pressed":n,onClick:()=>w(!n),style:g,children:n?"Write":"Preview"}):null,(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"Ctrl or \u2318 Enter saves \xB7 Esc puts it back"})]})]})}var k={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},g={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},T={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)",borderRadius:6};export{E as default};
|