graview 0.1.52 → 0.1.53
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.2IKVO743.js +1 -0
- package/dist/preview/{chunk.C4EPMV7O.js → chunk.2LQ37DC2.js} +1 -1
- package/dist/preview/{chunk.IVI3HRSF.js → chunk.3377DLPA.js} +1 -1
- package/dist/preview/chunk.34Q7OKK3.js +1 -0
- package/dist/preview/{chunk.3FKP32RG.js → chunk.36XV4ZMC.js} +2 -2
- package/dist/preview/{chunk.LESRQN3Y.js → chunk.3FRVG6JW.js} +1 -1
- package/dist/preview/{chunk.XLM4ONUB.js → chunk.3FUFVVR4.js} +1 -1
- package/dist/preview/chunk.3Y7BDRP3.js +1 -0
- package/dist/preview/{chunk.7FZY5E2U.js → chunk.4DCPB67O.js} +1 -1
- package/dist/preview/chunk.4DFO43VM.js +1 -0
- package/dist/preview/chunk.4QVZXCV5.js +1 -0
- package/dist/preview/chunk.4SVAHPJA.js +1 -0
- package/dist/preview/chunk.52Y37IAD.js +1 -0
- package/dist/preview/chunk.56UFDIX5.js +1 -0
- package/dist/preview/chunk.5E4UGVAD.js +1 -0
- package/dist/preview/chunk.5H3VCAPN.js +1 -0
- package/dist/preview/chunk.5K5D4IMM.js +1 -0
- package/dist/preview/{chunk.C4UNAJWC.js → chunk.5XFRWXYQ.js} +1 -1
- package/dist/preview/{chunk.ULAMIQ52.js → chunk.65F3DF5Q.js} +1 -1
- package/dist/preview/{chunk.QWQBPJ4U.js → chunk.6CVW53WA.js} +1 -1
- package/dist/preview/chunk.6ESAZJBN.js +1 -0
- package/dist/preview/chunk.6S3B4XC4.js +1 -0
- package/dist/preview/{chunk.VOHRQXCF.js → chunk.6W2DUW5S.js} +2 -2
- package/dist/preview/{chunk.7EA7THSM.js → chunk.72Q4R7N6.js} +1 -1
- package/dist/preview/chunk.7BXOQEUP.js +1 -0
- package/dist/preview/{chunk.7UJZP3YK.js → chunk.7NFCI4LH.js} +2 -2
- package/dist/preview/{chunk.4LI73QOY.js → chunk.7R6GXJS4.js} +1 -1
- package/dist/preview/chunk.A2RQFAZ6.js +1 -0
- package/dist/preview/{chunk.J2R55TM7.js → chunk.AQJD23AN.js} +1 -1
- package/dist/preview/{chunk.7XJ3XQZD.js → chunk.ASCTAUFD.js} +1 -1
- package/dist/preview/chunk.B3T4N2XM.js +25 -0
- package/dist/preview/chunk.B3WVCSW5.js +1 -0
- package/dist/preview/{chunk.NAPTE3S6.js → chunk.BB5XKTVC.js} +1 -1
- package/dist/preview/{chunk.Y37DXEHG.js → chunk.BG2SC77J.js} +1 -1
- package/dist/preview/{chunk.7UXDIEPK.js → chunk.BPPDBPTL.js} +1 -1
- package/dist/preview/chunk.BQHRZJ5Z.js +1 -0
- package/dist/preview/{chunk.BJL6EL6B.js → chunk.CANTHIRO.js} +1 -1
- package/dist/preview/chunk.CIUQWCU4.js +1 -0
- package/dist/preview/{chunk.SZCZD2GM.js → chunk.CSA6SWTI.js} +1 -1
- package/dist/preview/{chunk.52J42KR5.js → chunk.CWPRQSED.js} +1 -1
- package/dist/preview/{chunk.5DDHFNZM.js → chunk.CYP5KXIQ.js} +1 -1
- package/dist/preview/chunk.D3A24PQ6.js +1 -0
- package/dist/preview/{chunk.CBGKWYGI.js → chunk.DQPEVPKQ.js} +1 -1
- package/dist/preview/{chunk.R7ZZJOJW.js → chunk.DUZS52WX.js} +1 -1
- package/dist/preview/chunk.E52UTLQ2.js +1 -0
- package/dist/preview/{chunk.QPP3OJVR.js → chunk.E647LWH5.js} +1 -1
- package/dist/preview/chunk.EG2N5F6L.js +1 -0
- package/dist/preview/{chunk.T2Q3AAQI.js → chunk.EZXGVTT2.js} +1 -1
- package/dist/preview/chunk.F5RN6YXG.js +4 -0
- package/dist/preview/chunk.FBRARPGR.js +4 -0
- package/dist/preview/{chunk.J263VQF5.js → chunk.FCAKLO5U.js} +1 -1
- package/dist/preview/{chunk.3TME4BG3.js → chunk.FGJM4LJO.js} +1 -1
- package/dist/preview/{chunk.OS3WZV6C.js → chunk.FJN4OGAS.js} +1 -1
- package/dist/preview/chunk.FXNUR5JI.js +88 -0
- package/dist/preview/chunk.G226CUJQ.js +1 -0
- package/dist/preview/chunk.G6DISMVT.js +67 -0
- package/dist/preview/{chunk.LTJYKQJG.js → chunk.GANAZIRD.js} +1 -1
- package/dist/preview/{chunk.KFTZLNHY.js → chunk.GBIVIHGD.js} +19 -14
- package/dist/preview/chunk.GGHZEAAT.js +1 -0
- package/dist/preview/chunk.GPYZR6HE.js +1 -0
- package/dist/preview/{chunk.7KZ44FEU.js → chunk.GYO57LKD.js} +1 -1
- package/dist/preview/{chunk.NHIPVAGR.js → chunk.GZBODS7Z.js} +1 -1
- package/dist/preview/chunk.GZWC72HS.js +1 -0
- package/dist/preview/{chunk.FJEXINFF.js → chunk.H2B3SEI7.js} +1 -1
- package/dist/preview/{chunk.R6FHEEJ7.js → chunk.H6EMDQP5.js} +1 -1
- package/dist/preview/chunk.HAIHXBVX.js +1 -0
- package/dist/preview/{chunk.BHPZK4WJ.js → chunk.HBVURYWY.js} +2 -2
- package/dist/preview/{chunk.VKOCD5CL.js → chunk.HDXDYS4C.js} +1 -1
- package/dist/preview/chunk.HE545Z6I.js +1 -0
- package/dist/preview/chunk.HIDLE6BN.js +18 -0
- package/dist/preview/chunk.HIFLBWQJ.js +9 -0
- package/dist/preview/chunk.I62MCBQM.js +1 -0
- package/dist/preview/chunk.I6SUHXJF.js +1 -0
- package/dist/preview/chunk.I6W3IQ4W.js +1 -0
- package/dist/preview/chunk.ICYJ7QJG.js +2 -0
- package/dist/preview/{chunk.C7EEYSAM.js → chunk.IYVBJDR7.js} +1 -1
- package/dist/preview/{chunk.RWCWRJJC.js → chunk.J6OT74RM.js} +1 -1
- package/dist/preview/{chunk.GZHEGKPF.js → chunk.JCJ7NTW4.js} +1 -1
- package/dist/preview/{chunk.P5PXWOHI.js → chunk.JKCLYLT4.js} +1 -1
- package/dist/preview/chunk.JQTO52Q7.js +1 -0
- package/dist/preview/chunk.JRU5BT7K.js +5 -0
- package/dist/preview/{chunk.I43ONAEL.js → chunk.K7WME4P4.js} +1 -1
- package/dist/preview/{chunk.FLNYLE6S.js → chunk.KAKJYAHM.js} +1 -1
- package/dist/preview/chunk.KCM2VOC7.js +1 -0
- package/dist/preview/{chunk.LSL25VXW.js → chunk.KWMBRB6O.js} +1 -1
- package/dist/preview/{chunk.KVEDMKUN.js → chunk.KY7QD22S.js} +1 -1
- package/dist/preview/{chunk.RBWYXVUW.js → chunk.LAOZEYYQ.js} +1 -1
- package/dist/preview/{chunk.JQBP6QWQ.js → chunk.LCG3VLCB.js} +1 -1
- package/dist/preview/{chunk.7FMS57QO.js → chunk.LDLWYAHK.js} +1 -1
- package/dist/preview/chunk.LEKML4S4.js +1 -0
- package/dist/preview/{chunk.73EKJ4JN.js → chunk.MDIAWTNK.js} +1 -1
- package/dist/preview/chunk.MKWVNW4Q.js +35 -0
- package/dist/preview/{chunk.VGTEEANA.js → chunk.MSPRCR3Q.js} +1 -1
- package/dist/preview/{chunk.CV4QA4ZF.js → chunk.MT45H2T5.js} +1 -1
- package/dist/preview/chunk.MXTDQXVW.js +1 -0
- package/dist/preview/{chunk.M33LUF3Q.js → chunk.N6A3DIOY.js} +1 -1
- package/dist/preview/{chunk.DXZ5VYCQ.js → chunk.NAEEPUWJ.js} +1 -1
- package/dist/preview/{chunk.HSGUXMAO.js → chunk.NCTTPW7A.js} +1 -1
- package/dist/preview/chunk.OCWZJNZF.js +1 -0
- package/dist/preview/chunk.OP3ZUI4W.js +1 -0
- package/dist/preview/{chunk.J6IB2HUZ.js → chunk.OPKXCL5R.js} +1 -1
- package/dist/preview/chunk.OXLYDXQV.js +1 -0
- package/dist/preview/{chunk.DGWNVDZB.js → chunk.OZYZBRWO.js} +1 -1
- package/dist/preview/{chunk.CHMUL36A.js → chunk.P2W727C7.js} +1 -1
- package/dist/preview/{chunk.I2W7HSBU.js → chunk.P7FN3SFB.js} +1 -1
- package/dist/preview/{chunk.INL4OZI7.js → chunk.PEA4D66Y.js} +1 -1
- package/dist/preview/chunk.Q5JVKSEN.js +1 -0
- package/dist/preview/chunk.QATG5HNV.js +1 -0
- package/dist/preview/{chunk.KPUX27ZT.js → chunk.R3DWF35R.js} +1 -1
- package/dist/preview/{chunk.XZLKTOJE.js → chunk.RIS3OKAI.js} +1 -1
- package/dist/preview/{chunk.R77TACXU.js → chunk.RUTZEEBR.js} +1 -1
- package/dist/preview/{chunk.OYRZ2DEI.js → chunk.S2ATSY6P.js} +1 -1
- package/dist/preview/{chunk.NB6WN4DO.js → chunk.S6TN3MLY.js} +1 -1
- package/dist/preview/{chunk.FJC6PMOG.js → chunk.T56SOSIR.js} +4 -4
- package/dist/preview/chunk.THL67D77.js +1 -0
- package/dist/preview/{chunk.GL3YVGAP.js → chunk.TLQTDKOL.js} +2 -2
- package/dist/preview/{chunk.5WU2UTP7.js → chunk.TRPPN2GD.js} +1 -1
- package/dist/preview/{chunk.YKACMLLU.js → chunk.TTFYXKLI.js} +1 -1
- package/dist/preview/{chunk.FEBCIEI3.js → chunk.TXEWSZGO.js} +1 -1
- package/dist/preview/chunk.U4T4Y2MT.js +1 -0
- package/dist/preview/chunk.ULTYDYTS.js +19 -0
- package/dist/preview/chunk.UQ4CASST.js +1 -0
- package/dist/preview/chunk.UQENE3VE.js +1 -0
- package/dist/preview/chunk.USAGE5C6.js +28 -0
- package/dist/preview/{chunk.ZK42LPF5.js → chunk.UVMLX4US.js} +1 -1
- package/dist/preview/{chunk.G7XKQNOL.js → chunk.UXNZPPWR.js} +1 -1
- package/dist/preview/chunk.UYCPQ6IW.js +1 -0
- package/dist/preview/chunk.V6X3U3JF.js +1 -0
- package/dist/preview/{chunk.2K3YQJW3.js → chunk.VOHDRH3P.js} +1 -1
- package/dist/preview/{chunk.R7CRV2FE.js → chunk.VRJ4TULC.js} +1 -1
- package/dist/preview/{chunk.QRCTTDDQ.js → chunk.VTCPA4V4.js} +1 -1
- package/dist/preview/chunk.VTRI2MT2.js +2 -0
- package/dist/preview/chunk.W54NXXC5.js +293 -0
- package/dist/preview/{chunk.NVNQSZ43.js → chunk.WDEMPWS4.js} +1 -1
- package/dist/preview/chunk.XBNASVTY.js +1 -0
- package/dist/preview/{chunk.EIWTZC4A.js → chunk.XDEKL6TJ.js} +1 -1
- package/dist/preview/chunk.XE72DFBV.js +13 -0
- package/dist/preview/{chunk.N7D5LKBI.js → chunk.XFIZLWYA.js} +1 -1
- package/dist/preview/{chunk.U6PCKJ26.js → chunk.XXCT6DLX.js} +1 -1
- package/dist/preview/{chunk.7354O67H.js → chunk.Y4VOCJ7R.js} +1 -1
- package/dist/preview/chunk.YA7ZMGOL.js +1 -0
- package/dist/preview/{chunk.D62V3TBW.js → chunk.YI7WHBAD.js} +2 -2
- package/dist/preview/{chunk.6CY3EA6U.js → chunk.Z4YSCHZT.js} +1 -1
- package/dist/preview/{chunk.MBNZ2HK7.js → chunk.ZQWKS6K5.js} +1 -1
- package/dist/preview/{chunk.7IOC6U3C.js → chunk.ZYYM52N5.js} +1 -1
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2EB7COX5.js +0 -1
- package/dist/preview/chunk.2X3UZJWI.js +0 -1
- package/dist/preview/chunk.337JMOTL.js +0 -1
- package/dist/preview/chunk.3ZQAPPJ5.js +0 -18
- package/dist/preview/chunk.4VI3EYDL.js +0 -1
- package/dist/preview/chunk.4ZLCMATU.js +0 -2
- package/dist/preview/chunk.5LWPNOJA.js +0 -1
- package/dist/preview/chunk.63SRVTG2.js +0 -19
- package/dist/preview/chunk.6BA6RUK7.js +0 -1
- package/dist/preview/chunk.6JERQFZI.js +0 -1
- package/dist/preview/chunk.6NIE3ILA.js +0 -1
- package/dist/preview/chunk.6QNBUBGD.js +0 -1
- package/dist/preview/chunk.7OAXW7QF.js +0 -1
- package/dist/preview/chunk.7SNIX56B.js +0 -1
- package/dist/preview/chunk.AI2HBKVP.js +0 -359
- package/dist/preview/chunk.BDQ4FUKO.js +0 -1
- package/dist/preview/chunk.BRDAO2OF.js +0 -4
- package/dist/preview/chunk.CC7E6NUQ.js +0 -1
- package/dist/preview/chunk.D2T563AA.js +0 -1
- package/dist/preview/chunk.DC7M56NM.js +0 -9
- package/dist/preview/chunk.DIS7JS7X.js +0 -1
- package/dist/preview/chunk.DVLWSCIC.js +0 -35
- package/dist/preview/chunk.EHOEMVQP.js +0 -1
- package/dist/preview/chunk.EME5HQ3H.js +0 -1
- package/dist/preview/chunk.G446PWV6.js +0 -1
- package/dist/preview/chunk.HST7BYFW.js +0 -1
- package/dist/preview/chunk.JOWJNIWH.js +0 -4
- package/dist/preview/chunk.JV7FLVUV.js +0 -1
- package/dist/preview/chunk.KQSD5MLY.js +0 -1
- package/dist/preview/chunk.KSJ3J5UN.js +0 -1
- package/dist/preview/chunk.LXJW2Z2M.js +0 -1
- package/dist/preview/chunk.MCFLCC42.js +0 -12
- package/dist/preview/chunk.MYKRJ4SV.js +0 -1
- package/dist/preview/chunk.NICCIJV4.js +0 -1
- package/dist/preview/chunk.NQPNK6I5.js +0 -1
- package/dist/preview/chunk.NWK4E7TJ.js +0 -1
- package/dist/preview/chunk.NZB5S5UO.js +0 -1
- package/dist/preview/chunk.PRCWGE7A.js +0 -1
- package/dist/preview/chunk.PXHBPLTQ.js +0 -1
- package/dist/preview/chunk.PXVJBL2C.js +0 -1
- package/dist/preview/chunk.Q3XKNZQW.js +0 -1
- package/dist/preview/chunk.Q5IAXTF5.js +0 -25
- package/dist/preview/chunk.QXCYAFRT.js +0 -1
- package/dist/preview/chunk.RMRO5JZX.js +0 -1
- package/dist/preview/chunk.S4ZWBCYC.js +0 -1
- package/dist/preview/chunk.SELLAVIQ.js +0 -1
- package/dist/preview/chunk.SM6HTPYF.js +0 -1
- package/dist/preview/chunk.T6KKNWZT.js +0 -1
- package/dist/preview/chunk.UEPVA6IS.js +0 -1
- package/dist/preview/chunk.UMS7XRPO.js +0 -1
- package/dist/preview/chunk.VGIWQNJB.js +0 -1
- package/dist/preview/chunk.W5UJLKIT.js +0 -1
- package/dist/preview/chunk.WUEU3QBL.js +0 -1
- package/dist/preview/chunk.WWUMSCYC.js +0 -1
- package/dist/preview/chunk.XPR3QFF4.js +0 -1
- package/dist/preview/chunk.YKXUDACI.js +0 -28
- package/dist/preview/chunk.YUEOUV7G.js +0 -5
- package/dist/preview/chunk.YYWLYVAW.js +0 -1
- package/dist/preview/chunk.Z2JMTRF4.js +0 -1
- package/dist/preview/chunk.Z2UFPOAN.js +0 -88
- package/dist/preview/chunk.ZEKKIMKI.js +0 -1
- package/dist/preview/chunk.ZZGXVYW2.js +0 -1
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import{G as P}from"./chunk.B3T4N2XM.js";import{Jc as O,Lc as S,Oc as T,Pc as E,tc as b,uc as $,vc as y,wc as k,xc as _}from"./chunk.6W2DUW5S.js";import{a as x}from"./chunk.AJZBJBMO.js";var D=x(l=>{"use strict";var U=P();function C(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var s={d:{f:d,r:function(){throw Error(C(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},V=Symbol.for("react.portal");function j(r,e,a){var t=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:V,key:t==null?null:""+t,children:r,containerInfo:e,implementation:a}}var u=U.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s;l.createPortal=function(r,e){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(C(299));return j(r,e,null,a)};l.flushSync=function(r){var e=u.T,a=s.p;try{if(u.T=null,s.p=2,r)return r()}finally{u.T=e,s.p=a,s.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,s.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&s.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var a=e.as,t=h(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?s.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:t,integrity:n,fetchPriority:i}):a==="script"&&s.d.X(r,{crossOrigin:t,integrity:n,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=h(e.as,e.crossOrigin);s.d.M(r,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&s.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,t=h(a,e.crossOrigin);s.d.L(r,a,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var a=h(e.as,e.crossOrigin);s.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else s.d.m(r)};l.requestFormReset=function(r){s.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,a){return u.H.useFormState(r,e,a)};l.useFormStatus=function(){return u.H.useHostTransitionStatus()};l.version="19.2.8"});var W=x((X,L)=>{"use strict";function N(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(N)}catch(r){console.error(r)}}N(),L.exports=D()});var I={name:"Graview",typography:{body:y.body,mono:y.mono},schemes:$},R={ground:"--graview-ground",groundDeep:"--graview-ground-deep",wash:"--graview-wash",panel:"--graview-panel",panelMuted:"--graview-panel-muted",panelWarning:"--graview-panel-warning",edge:"--graview-edge",edgeBright:"--graview-edge-bright",ink:"--graview-ink",inkMuted:"--graview-ink-muted",inkFaint:"--graview-ink-faint",accent:"--graview-accent",accentDim:"--graview-accent-dim",accentInk:"--graview-accent-ink",warn:"--graview-warn",good:"--graview-good",bad:"--graview-bad",glow:"--graview-glow",bar:"--graview-bar",float:"--graview-float",liftLow:"--graview-lift-low",liftHigh:"--graview-lift-high",tintAlpha:"--graview-tint-alpha",tintLightness:"--graview-tint-lightness",gridAlpha:"--graview-grid-alpha"};function B(r){return Object.keys(R).map(e=>` ${R[e]}: ${r[e]};`).join(`
|
|
2
|
+
`)}function A(r,e){let a=r===e?r:`${r} ${e}`;return` ${a} [data-graview-view] { transition: none; }
|
|
3
|
+
${a} [data-graview-touched] > * { animation: none; }
|
|
4
|
+
${a} [data-graview-view][data-graview-wrote] > *,
|
|
5
|
+
${a} [data-graview-view][data-graview-read] > * {
|
|
6
|
+
animation: none;
|
|
7
|
+
box-shadow: 0 0 0 2px var(--graview-activity);
|
|
8
|
+
}
|
|
9
|
+
${a} [data-graview-view][data-graview-read] > * { box-shadow: 0 0 0 1px var(--graview-activity); }
|
|
10
|
+
${a} [data-graview-connector][data-graview-activity] { animation: none; stroke-opacity: 1; }`}function q(r="dark",e=I,a={}){let t=G(r,e,a);return a.scope===void 0?t:H(t,a.scope)}function H(r,e){let a=`:where(${e}) `,t=o=>o===e||o.startsWith(`${e} `)||o.startsWith(`${e}:`)||o.startsWith(`${e}[`)||o.startsWith(":root")&&o.includes(` ${e} `),n=o=>{let c=o.match(/^\s*/)[0],v=z(o.trim()).map(g=>t(g)?g:`${a}${g}`);return`${c}${v.join(", ")} `},i=o=>{let c="",v=0;for(;v<o.length;){let g=o.indexOf("{",v);if(g===-1)return c+o.slice(v);let f=M(o,g),w=o.slice(v,g),m=o.slice(g+1,f),p=w.trim().startsWith("@")?w.trim().split(/[\s(]/)[0]:null;p===null?c+=`${n(w)}{${m}}`:p==="@media"||p==="@supports"||p==="@container"||p==="@layer"?c+=`${w}{${i(m)}}`:c+=`${w}{${m}}`,v=f+1}return c};return i(r)}function M(r,e){let a=0,t=null;for(let n=e;n<r.length;n++){let i=r[n];if(t)i==="\\"?n++:i===t&&(t=null);else if(i==='"'||i==="'")t=i;else if(i==="/"&&r[n+1]==="*")n=r.indexOf("*/",n+2)+1||r.length;else if(i==="{")a++;else if(i==="}"&&--a===0)return n}return r.length}function z(r){let e=[],a=0,t=null,n="";for(let i of r){if(t)i===t&&(t=null);else if(i==='"'||i==="'")t=i;else if(i==="("||i==="[")a++;else if(i===")"||i==="]")a--;else if(i===","&&a===0){e.push(n.trim()),n="";continue}n+=i}return n.trim()&&e.push(n.trim()),e}function G(r,e,a){let t=e.schemes[r],n=a.scope??":root",i=a.scope??"html, body",o=a.scope??"body",c=":root",v=k(e),g=_(e),f=O(e.kit);return`${n} {
|
|
11
|
+
${B(t)}
|
|
12
|
+
${S(f)}
|
|
13
|
+
|
|
14
|
+
${E()}
|
|
15
|
+
--graview-font-body: ${g.body};
|
|
16
|
+
--graview-font-display: ${g.display};
|
|
17
|
+
--graview-font-mono: ${g.mono};
|
|
18
|
+
|
|
19
|
+
--graview-weight-display: ${g.weights.display};
|
|
20
|
+
--graview-weight-body: ${g.weights.body};
|
|
21
|
+
--graview-weight-label: ${g.weights.label};
|
|
22
|
+
|
|
23
|
+
--graview-text-small: .833rem;
|
|
24
|
+
--graview-text-body: 1rem;
|
|
25
|
+
--graview-text-heading: 1.2rem;
|
|
26
|
+
--graview-text-title: 1.728rem;
|
|
27
|
+
|
|
28
|
+
--graview-space-1: 4px;
|
|
29
|
+
--graview-space-2: 8px;
|
|
30
|
+
--graview-space-3: 12px;
|
|
31
|
+
--graview-space-4: 16px;
|
|
32
|
+
--graview-space-5: 24px;
|
|
33
|
+
--graview-space-6: 32px;
|
|
34
|
+
--graview-space-7: 48px;
|
|
35
|
+
|
|
36
|
+
--graview-radius: ${v.radius}px;
|
|
37
|
+
--graview-radius-sm: ${v.radiusSmall}px;
|
|
38
|
+
--graview-pad: ${v.pad}px;
|
|
39
|
+
--graview-pad-sm: ${v.padSmall}px;
|
|
40
|
+
--graview-gap: ${v.gap}px;
|
|
41
|
+
color-scheme: ${r};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media (max-width: 480px) { ${n} { --graview-text-title: 1.44rem; } }
|
|
45
|
+
|
|
46
|
+
${i} {
|
|
47
|
+
margin: 0;
|
|
48
|
+
background: var(--graview-ground-deep);
|
|
49
|
+
color: var(--graview-ink);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
${o} {
|
|
54
|
+
font: 0.875rem/1.55 var(--graview-font-body);
|
|
55
|
+
font-weight: var(--graview-weight-body);
|
|
56
|
+
font-variant-numeric: tabular-nums;
|
|
57
|
+
-webkit-font-smoothing: antialiased;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
h1, h2, h3, h4 { font-family: var(--graview-font-display); font-weight: var(--graview-weight-display); }
|
|
62
|
+
h1, h2 { letter-spacing: ${b}; }
|
|
63
|
+
|
|
64
|
+
.graview-logo > svg, .graview-logo-face > svg { display: block; height: 100%; width: auto; }
|
|
65
|
+
.graview-logo-face { display: inline-flex; height: 100%; width: auto; }
|
|
66
|
+
|
|
67
|
+
${n} [data-graview-scheme-only="${r==="dark"?"light":"dark"}"] { display: none; }
|
|
68
|
+
${r==="dark"?`${n} [data-graview-logo-fallback="invert"] { filter: invert(1) hue-rotate(180deg); mix-blend-mode: screen; }`:""}
|
|
69
|
+
code, kbd, samp { font-family: var(--graview-font-mono); }
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
[data-graview-figure] > svg {
|
|
73
|
+
width: 100%;
|
|
74
|
+
height: 100%;
|
|
75
|
+
display: block;
|
|
76
|
+
overflow: visible;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@property --graview-altitude {
|
|
81
|
+
syntax: "<number>";
|
|
82
|
+
inherits: true;
|
|
83
|
+
initial-value: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
.graview-ground {
|
|
88
|
+
position: relative;
|
|
89
|
+
|
|
90
|
+
isolation: isolate;
|
|
91
|
+
z-index: ${T("scene")};
|
|
92
|
+
background: var(--graview-wash), var(--graview-ground);
|
|
93
|
+
--graview-altitude: 0;
|
|
94
|
+
transition: --graview-altitude 640ms cubic-bezier(0.33, 0, 0.2, 1);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
.graview-ground > .graview-measure {
|
|
100
|
+
position: absolute;
|
|
101
|
+
inset: 0;
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
background-image:
|
|
104
|
+
linear-gradient(var(--graview-edge) 1px, transparent 1px),
|
|
105
|
+
linear-gradient(90deg, var(--graview-edge) 1px, transparent 1px);
|
|
106
|
+
background-size: var(--graview-kit-grid-size, 64px) var(--graview-kit-grid-size, 64px);
|
|
107
|
+
background-position: calc(var(--graview-world-x, 0px) + var(--graview-hand-x, 0px)) calc(var(--graview-world-y, 0px) + var(--graview-hand-y, 0px));
|
|
108
|
+
opacity: calc(var(--graview-kit-grid, 1) * var(--graview-grid-alpha) * (1 - var(--graview-altitude)));
|
|
109
|
+
mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, transparent 78%);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
.graview-scroll {
|
|
114
|
+
overflow: auto;
|
|
115
|
+
min-height: 0;
|
|
116
|
+
--graview-scroll-shade: ${r==="light"?"rgba(20,30,32,0.22)":"rgba(0,0,0,0.55)"};
|
|
117
|
+
}
|
|
118
|
+
.graview-scroll[data-graview-more-below] {
|
|
119
|
+
box-shadow: inset 0 -12px 10px -10px var(--graview-scroll-shade);
|
|
120
|
+
}
|
|
121
|
+
.graview-scroll[data-graview-more-above] {
|
|
122
|
+
box-shadow: inset 0 12px 10px -10px var(--graview-scroll-shade);
|
|
123
|
+
}
|
|
124
|
+
.graview-scroll[data-graview-more-above][data-graview-more-below] {
|
|
125
|
+
box-shadow: inset 0 12px 10px -10px var(--graview-scroll-shade), inset 0 -12px 10px -10px var(--graview-scroll-shade);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
.graview-ground > .graview-lattice {
|
|
133
|
+
position: absolute;
|
|
134
|
+
inset: 0;
|
|
135
|
+
pointer-events: none;
|
|
136
|
+
--graview-lattice-tile: var(--graview-lattice-cell, calc(var(--graview-kit-lattice-size, 46px) * 2.2361));
|
|
137
|
+
--graview-lattice-line: var(--graview-edge);
|
|
138
|
+
background-image:
|
|
139
|
+
linear-gradient(to top right, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
|
|
140
|
+
linear-gradient(to top left, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
|
|
141
|
+
linear-gradient(to top right, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
|
|
142
|
+
linear-gradient(to top left, transparent calc(50% - 0.5px), var(--graview-lattice-line) calc(50% - 0.5px), var(--graview-lattice-line) calc(50% + 0.5px), transparent calc(50% + 0.5px));
|
|
143
|
+
|
|
144
|
+
--graview-lattice-rise: calc(var(--graview-lattice-tile) * var(--graview-lattice-tilt, 0.5));
|
|
145
|
+
background-size:
|
|
146
|
+
var(--graview-lattice-tile) var(--graview-lattice-rise),
|
|
147
|
+
var(--graview-lattice-tile) var(--graview-lattice-rise),
|
|
148
|
+
calc(var(--graview-lattice-tile) / 2) calc(var(--graview-lattice-rise) / 2),
|
|
149
|
+
calc(var(--graview-lattice-tile) / 2) calc(var(--graview-lattice-rise) / 2);
|
|
150
|
+
|
|
151
|
+
background-position: calc(var(--graview-lattice-x, 0px) + var(--graview-hand-x, 0px)) calc(var(--graview-lattice-y, 0px) + var(--graview-hand-y, 0px));
|
|
152
|
+
|
|
153
|
+
opacity: calc(var(--graview-kit-lattice, 1) * var(--graview-grid-alpha) * 2 * var(--graview-altitude));
|
|
154
|
+
mask-image: linear-gradient(to top, #000 42%, rgba(0,0,0,0.35) 70%, transparent 92%);
|
|
155
|
+
-webkit-mask-image: linear-gradient(to top, #000 42%, rgba(0,0,0,0.35) 70%, transparent 92%);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
.graview-profile-keeping { display: grid; gap: 6px; }
|
|
160
|
+
.graview-profile-keeping:not(:has(button, a)) { display: none; }
|
|
161
|
+
.graview-profile-keeping > * { justify-self: start; }
|
|
162
|
+
|
|
163
|
+
.graview-host-action:hover,
|
|
164
|
+
.graview-host-action:focus-visible {
|
|
165
|
+
background: var(--graview-wash);
|
|
166
|
+
color: var(--graview-accent);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
@keyframes graview-settle {
|
|
172
|
+
from { opacity: 0; transform: translateY(7px); }
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
[data-graview-pick] {
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
transition: filter 140ms ease, box-shadow 140ms ease;
|
|
179
|
+
}
|
|
180
|
+
[data-graview-pick]:hover {
|
|
181
|
+
filter: brightness(${r==="light"?.96:1.18});
|
|
182
|
+
}
|
|
183
|
+
[data-graview-pick]:focus-visible {
|
|
184
|
+
outline: 2px solid var(--graview-accent);
|
|
185
|
+
outline-offset: 2px;
|
|
186
|
+
border-radius: 7px;
|
|
187
|
+
}
|
|
188
|
+
.graview-activity-record:hover > [data-graview-primitive="chip"] {
|
|
189
|
+
filter: brightness(${r==="light"?.96:1.18});
|
|
190
|
+
}
|
|
191
|
+
.graview-activity-record:focus-visible {
|
|
192
|
+
outline: 2px solid var(--graview-accent);
|
|
193
|
+
outline-offset: 2px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
[data-graview-slot]:focus-visible {
|
|
197
|
+
outline: none;
|
|
198
|
+
}
|
|
199
|
+
[data-graview-slot]:focus-visible > span:first-of-type {
|
|
200
|
+
box-shadow: 0 0 0 2px var(--graview-ground), 0 0 0 4px var(--graview-accent);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
[data-graview-view] { cursor: pointer; }
|
|
205
|
+
[data-graview-view]:hover { filter: brightness(${r==="light"?.985:1.12}); }
|
|
206
|
+
[data-graview-view]:focus-visible {
|
|
207
|
+
outline: 2px solid var(--graview-accent);
|
|
208
|
+
outline-offset: 3px;
|
|
209
|
+
border-radius: var(--graview-radius);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
button {
|
|
213
|
+
font: inherit;
|
|
214
|
+
font-weight: var(--graview-weight-label);
|
|
215
|
+
color: var(--graview-ink);
|
|
216
|
+
padding: 7px 13px;
|
|
217
|
+
border: 1px solid var(--graview-edge);
|
|
218
|
+
border-radius: var(--graview-radius-sm, 8px);
|
|
219
|
+
background: var(--graview-panel);
|
|
220
|
+
box-shadow: ${r==="light"?"0 1px 2px rgba(24,33,58,0.05)":"none"};
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
button:hover:not(:disabled) {
|
|
226
|
+
border-color: var(--graview-edge-bright);
|
|
227
|
+
box-shadow: ${r==="light"?"0 1px 2px rgba(24,33,58,0.06), 0 6px 16px -8px rgba(24,33,58,0.2)":"0 0 0 1px var(--graview-accent-dim)"};
|
|
228
|
+
}
|
|
229
|
+
button:focus-visible {
|
|
230
|
+
outline: 2px solid var(--graview-accent);
|
|
231
|
+
outline-offset: 2px;
|
|
232
|
+
}
|
|
233
|
+
button:disabled { opacity: 0.45; cursor: default; }
|
|
234
|
+
|
|
235
|
+
code { color: var(--graview-ink-muted); font-size: 0.8125rem; letter-spacing: 0.02em; }
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
[data-graview-view] {
|
|
239
|
+
transition: filter 260ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
[data-graview-stage="dom"] [data-graview-view],
|
|
244
|
+
[data-graview-stage="dom"] [data-graview-view] > [data-graview-natural] {
|
|
245
|
+
pointer-events: none;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
@keyframes graview-touched {
|
|
251
|
+
0% { box-shadow: 0 0 0 0 var(--graview-accent-dim); }
|
|
252
|
+
35% { box-shadow: 0 0 26px 3px var(--graview-accent-dim); }
|
|
253
|
+
100% { box-shadow: 0 0 0 0 transparent; }
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@keyframes graview-landed {
|
|
257
|
+
0% { box-shadow: 0 0 0 0 var(--graview-activity); opacity: 0.55; }
|
|
258
|
+
30% { box-shadow: 0 0 30px 4px var(--graview-activity); opacity: 1; }
|
|
259
|
+
100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
@keyframes graview-considered {
|
|
264
|
+
0% { outline-color: transparent; }
|
|
265
|
+
25% { outline-color: var(--graview-activity); }
|
|
266
|
+
100% { outline-color: transparent; }
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
@keyframes graview-relation {
|
|
271
|
+
0% { stroke-opacity: 0.28; stroke-width: 1.4; }
|
|
272
|
+
30% { stroke-opacity: 1; stroke-width: 3; }
|
|
273
|
+
100% { stroke-opacity: 0.28; stroke-width: 1.4; }
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
@media (prefers-reduced-motion: reduce) {
|
|
278
|
+
${A(`${c}:not([data-graview-motion='full'])`,o)}
|
|
279
|
+
}
|
|
280
|
+
${A(`${c}[data-graview-motion='reduce']`,o)}`}export{q as a,H as b,W as c};
|
|
281
|
+
/*! Bundled license information:
|
|
282
|
+
|
|
283
|
+
react-dom/cjs/react-dom.production.js:
|
|
284
|
+
(**
|
|
285
|
+
* @license React
|
|
286
|
+
* react-dom.production.js
|
|
287
|
+
*
|
|
288
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the MIT license found in the
|
|
291
|
+
* LICENSE file in the root directory of this source tree.
|
|
292
|
+
*)
|
|
293
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,c as h}from"./chunk.
|
|
1
|
+
import{a as v,c as h}from"./chunk.H2B3SEI7.js";import{L as b,N as S}from"./chunk.6W2DUW5S.js";var P=Symbol.for("@graview/core:file"),T=Symbol.for("@graview/core:node-ref"),p=e=>typeof e=="object"&&e!==null?e._zod?.def:void 0;function w(e){let i=p(e);return i?.[P]??(i?.innerType?w(i.innerType):void 0)}function x(e){let i=w(e);if(i)return{as:i,list:!1};let n=p(e);for(;n?.innerType;)n=p(n.innerType);let s=n?.type==="array"?w(n.element):void 0;return s?{as:s,list:!0}:void 0}function A(e){if(typeof e!="object"||e===null)return;let i=e[T];if(i)return i;let n=p(e);return n?.[T]??(n?.innerType?A(n.innerType):void 0)}function H(e){let i=e?.shape??{};return Object.entries(i).flatMap(([n,s])=>{let r=A(s);return r?[{name:n,kinds:r}]:[]})}var K=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.href=="string"&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.bytes=="number",W=e=>(Array.isArray(e)?e:[e]).filter(K);function I(e,i,n){let r=e.schema.tryDefinition(i)?.fields?.shape?.[n];return r===void 0?void 0:x(r)}function N(e,i){if(e===void 0)return[];if(!Array.isArray(e))return[`The view's accepts is a list of { "kind": <a kind>, "field": <its image, video or file field> }.`];let n=[],s=new Set(i.schema.kinds);for(let r of e){let{kind:l,field:a}=r??{};typeof l!="string"||typeof a!="string"?n.push(`Each of the view's accepts is { "kind": <a kind>, "field": <its image, video or file field> }.`):s.has(l)?I(i,l,a)?i.allMutations().some(o=>(o.creates??[]).includes(l)&&Object.hasOwn(o.input?.shape??{},a))||n.push(`No act of this app makes a "${l}" with its "${a}", so a file dropped could become nothing.`):n.push(`The view accepts files into ${l}'s "${a}", which holds no picture, video or file.`):n.push(`The view accepts files for "${l}", which is no kind of this app.`)}return n}function D(e){if(e===void 0||e===!0)return[];if(typeof e!="object"||e===null||Array.isArray(e))return[`The view's pictures is true, or { "width": <the widest it draws a picture, in pixels> }.`];let{width:i,...n}=e,s=[];return Object.keys(n).length>0&&s.push(`The view's pictures says ${Object.keys(n).map(r=>`"${r}"`).join(", ")}: only "width" is read.`),i!==void 0&&!(Number.isInteger(i)&&i>=16&&i<=4096)&&s.push("The view's pictures width is a whole number of pixels from 16 to 4096."),s}function E(e){if(e===void 0)return[];if(typeof e!="object"||e===null||Array.isArray(e))return[`The view's scene is { "maxHeight": <the tallest its preview on the Scene is drawn, in pixels> }.`];let{maxHeight:i,...n}=e,s=[];return Object.keys(n).length>0&&s.push(`The view's scene says ${Object.keys(n).map(r=>`"${r}"`).join(", ")}: only "maxHeight" is read.`),i!==void 0&&!(Number.isInteger(i)&&i>=80&&i<=4e3)&&s.push("The view's scene maxHeight is a whole number of pixels from 80 to 4000."),s}function F(e){return(e.acts??[]).map(i=>typeof i=="string"?{act:i}:i)}function B(e,i){let n=[],s=new Set(i.schema.kinds),r=new Set(i.schema.edgeKinds),l=new Set(i.allMutations().map(o=>o.name));(typeof e.name!="string"||!/^[a-z0-9][a-z0-9-]{0,62}$/.test(e.name))&&n.push(`The view's name "${String(e.name)}" is not lower-case letters, digits and hyphens.`),e.title!==void 0&&(typeof e.title!="string"||e.title.trim()===""||e.title.length>80)&&n.push("The view's title is empty or longer than 80 characters."),e.attach!=="home"&&!s.has(e.attach)&&n.push(`The view attaches to "${e.attach}", which is no kind of this app.`),e.cardinality!=="one"&&e.cardinality!=="many"&&n.push(`The view's cardinality is "${String(e.cardinality)}", not one or many.`),e.attach==="home"&&e.cardinality!=="many"&&n.push("A view of the home draws many records: its cardinality is many."),e.replaces!==void 0&&e.replaces!=="page"?n.push(`The view's replaces is "${String(e.replaces)}": the one thing a view replaces is "page", or leave it out to draw the view above the record's own fields.`):e.replaces==="page"&&(e.attach==="home"||e.cardinality!=="one")&&n.push('Only a view of one record replaces its page: replaces "page" needs cardinality one on a kind.'),e.gestures!==void 0&&typeof e.gestures!="boolean"&&n.push(`The view's gestures is "${String(e.gestures)}": it is true, or left out.`),e.bleed!==void 0&&typeof e.bleed!="boolean"&&n.push(`The view's bleed is "${String(e.bleed)}": it is true, or left out.`),e.heading!==void 0&&(e.heading!=="own"||e.attach==="home"||e.cardinality!=="many"||e.title===void 0)&&n.push(`The view's heading is "${String(e.heading)}": it is "own" on a view that is a place (a title, cardinality many), or left out.`),e.flows!==void 0&&typeof e.flows!="boolean"?n.push(`The view's flows is "${String(e.flows)}": it is false for a view that keeps its place's frame, or left out.`):e.flows===!1&&(e.attach==="home"||e.cardinality!=="many"||e.title===void 0)&&n.push("Only a view that is a place keeps a frame: flows false needs a title and cardinality many on a kind."),n.push(...E(e.scene)),e.scene!==void 0&&(e.attach==="home"||e.cardinality!=="many")&&n.push("Only a view of a kind's members is drawn on the Scene as a card: scene needs cardinality many on a kind."),n.push(...D(e.pictures)),n.push(...N(e.accepts,i));for(let o of e.reads?.kinds??[])s.has(o)||n.push(`The view reads "${o}", which is no kind of this app.`);for(let o of e.reads?.edges??[])r.has(o)||n.push(`The view reads the edge "${o}", which no kind of this app declares.`);let a=new Set;for(let o of F(e)){l.has(o.act)||n.push(`The view asks for the act "${o.act}", which this app does not declare.`);let c=o.as??o.act;a.has(c)&&n.push(`Two of the view's acts are called "${c}".`),a.add(c)}return n}function L(e,i,n){let{manifest:s}=n,r=n.input??{},a=e.seenBy(i).graph,o=s.attach==="home"?void 0:s.attach,c=o&&s.cardinality==="one"&&r.node?a.getNode(r.node.id):void 0,f=c&&c.kind===o?[c]:[],g=o&&s.cardinality==="many"?r.nodes?r.nodes.flatMap(t=>{let d=a.getNode(t.id);return d&&d.kind===o?[d]:[]}):a.nodesOfKind(o):[],$=new Set([...f,...g].map(t=>t.id)),k=v(a,$,{kinds:(s.reads?.kinds??[]).filter(t=>t!==o||s.cardinality==="one"),edges:s.reads?.edges??[]}),u=new Map;for(let t of[...g,...k.nodes])f.some(d=>d.id===t.id)||u.set(t.id,t);let j=new Set([...f.map(t=>t.id),...u.keys()]),O=[...k.edges],M=new Set(F(s).map(t=>t.act)),V=e.permittedMutations(i).filter(t=>M.has(t.name)).map(t=>({name:t.name,title:t.title??t.name,...t.description!==void 0?{description:t.description}:{},...t.subject?{subject:{kinds:t.subject.kinds,arg:t.subject.arg}}:{}})),m=t=>t?.filter(d=>j.has(d));return{view:s.name,...f[0]?{node:h(e,f[0])}:{},nodes:[...u.values()].map(t=>h(e,t)),edges:O,...s.title!==void 0?{label:s.title}:r.label!==void 0?{label:r.label}:{},cardinality:s.cardinality,...r.fidelity!==void 0?{fidelity:r.fidelity}:{},...r.mode!==void 0?{mode:r.mode}:{},...r.selected!==void 0?{selected:r.selected}:{},...r.implicated?{implicated:m(r.implicated)}:{},...r.flagged?{flagged:m(r.flagged)}:{},acts:V,...n.theme?{theme:n.theme}:{},locale:b(),timeZone:S(),...n.places?{places:n.places.filter((t,d,y)=>y.findIndex(G=>G.as===t.as)===d).map(({as:t,title:d,kind:y})=>({as:t,title:d,kind:y}))}:{}}}export{H as a,K as b,W as c,I as d,F as e,B as f,L as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./chunk.G6DISMVT.js";import{G as N,T as f,X as y}from"./chunk.B3T4N2XM.js";import{b as g}from"./chunk.AJZBJBMO.js";var p=g(N(),1);var a=g(f(),1);var R={default:{background:"var(--graview-panel, #ffffff)",color:"var(--graview-ink, #1a1a1a)"},muted:{background:"var(--graview-panel-muted, #f7f5f1)",color:"var(--graview-ink, #1a1a1a)"},warning:{background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)"}},T={color:"var(--graview-ink-muted, #55514a)"},C={color:"var(--graview-ink-faint, #625d55)"};function H(e){let[l,o]=(0,p.useState)(z);return(0,p.useEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let t=()=>{let i=W(r,parseFloat(getComputedStyle(r).paddingBottom)||0);o(s=>s.overflowing===i.overflowing&&s.above===i.above&&s.below===i.below?s:i)};t();let d=new ResizeObserver(t);d.observe(r);for(let i of r.children)d.observe(i);return r.addEventListener("scroll",t,{passive:!0}),()=>{d.disconnect(),r.removeEventListener("scroll",t)}}),l}var z={overflowing:!1,above:!1,below:!1};function W(e,l=0){let o=e.scrollHeight>e.clientHeight+1,r=e.scrollWidth>e.clientWidth+1;return{overflowing:o||r,above:o&&e.scrollTop>1,below:o&&e.scrollTop+e.clientHeight<e.scrollHeight-l-1}}var A=(0,p.createContext)(null),I=(0,p.createContext)(null);function O({level:e,said:l=!0,style:o,children:r}){if(e===void 0)return(0,a.jsx)("strong",{style:o,...l?{}:{"aria-hidden":!0},children:r});let t=`h${e}`;return(0,a.jsx)(t,{style:{margin:0,...o},children:r})}function E({title:e,subtitle:l,meta:o,selected:r,tone:t="default",children:d,style:i,fit:s=!1,variant:w,heading:b}){let c=(0,p.useRef)(null),{overflowing:v,above:x,below:S}=H(c),P=y(),n=(w??(P==="fullscreen"?"page":"card"))==="page",k=(0,p.useContext)(A),u=(0,p.useContext)(I);return(0,a.jsxs)("div",{"data-graview-primitive":"panel","data-graview-variant":n?"page":"card","data-selected":r||void 0,style:{display:"flex",flexDirection:"column",gap:n?12:"var(--graview-gap, 7px)",height:n||s?"auto":"100%",maxHeight:n?"none":"100%",padding:n?0:"var(--graview-pad, 15px)",boxSizing:"border-box",borderRadius:n?0:"var(--graview-radius, 12px)",border:n?"none":`1px solid ${r?"var(--graview-accent, #2f6f5e)":"var(--graview-edge, #e4e0d8)"}`,boxShadow:n?"none":r?"0 0 0 1px var(--graview-accent-dim), var(--graview-lift-low)":"var(--graview-lift-low)",overflow:n?"visible":"hidden",...R[t],...n?{background:"transparent"}:{},...i},children:[t==="warning"?(0,a.jsx)("span",{"data-graview-broken":"",style:m,children:"Implicated in a problem."}):null,e===void 0||e===k?null:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:8,minWidth:0},children:[t==="warning"?(0,a.jsx)("span",{"aria-hidden":"true",title:"Implicated in a problem",style:{color:"var(--graview-warn)",flex:"0 0 auto"},children:"\u26A0"}):null,(0,a.jsx)(O,{level:b,said:u===null||e!==u,style:{fontFamily:"var(--graview-font-display, inherit)",fontSize:n?"1.5625rem":"0.9375rem",lineHeight:n?1.15:1.25,fontWeight:n?600:560,letterSpacing:n?"-0.012em":"0.005em",minWidth:0,overflowWrap:"anywhere"},children:e}),o===void 0?null:(0,a.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",letterSpacing:"0.08em",textTransform:"uppercase",minWidth:0,overflowWrap:"anywhere",...C},children:o})]}),l===void 0?null:(0,a.jsx)("div",{style:{fontSize:n?"0.90625rem":"0.8125rem",lineHeight:1.5,...T},children:l}),(0,a.jsx)("div",{ref:c,className:n?void 0:"graview-scroll",...v&&!n?{tabIndex:0,role:"region",...typeof e=="string"?{"aria-label":e}:{}}:{},style:{display:"flex",flexDirection:"column",gap:n?22:"var(--graview-gap, 7px)",flex:"1 1 auto",...n?{overflow:"visible"}:{marginBottom:"calc(-1 * var(--graview-pad, 15px))",paddingBottom:"var(--graview-pad, 15px)"},...!n&&!v?{overflow:"hidden"}:{}},"data-graview-more-above":x&&!n?"":void 0,"data-graview-more-below":S&&!n?"":void 0,children:d})]})}function h({label:e,hue:l,selected:o,title:r,pickId:t,emphasis:d}){let i=typeof e=="string"?e:void 0,s=l===void 0?void 0:Math.round(l);return(0,a.jsxs)("span",{"data-graview-primitive":"chip","data-selected":o||void 0,"data-graview-pick":t,"data-graview-emphasis":d,title:r??i,style:{cursor:t?"pointer":void 0,display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",maxWidth:"min(28ch, 100%)",overflow:"hidden",letterSpacing:"0.01em",border:`1px solid ${o?"var(--graview-accent)":s===void 0?"var(--graview-edge)":`hsl(${s} 55% var(--graview-tint-lightness) / 0.45)`}`,background:s===void 0?"var(--graview-panel-muted)":`hsl(${s} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * 0.65))`,color:"var(--graview-ink, #1a1a1a)",boxShadow:o?"0 0 14px -4px var(--graview-accent)":void 0},children:[s===void 0?null:(0,a.jsx)("span",{"aria-hidden":"true",style:{width:9,height:6,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",flex:"0 0 auto",marginRight:6,background:`hsl(${s} 55% var(--graview-tint-lightness) / 0.9)`}}),(0,a.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]})}function L({items:e,max:l=8,selectedIds:o=[],pick:r=!1}){let t=e.slice(0,l),d=e.length-t.length;return(0,a.jsxs)("div",{"data-graview-primitive":"roster",style:{display:"flex",flexWrap:"wrap",gap:6,alignContent:"flex-start"},children:[t.map(i=>(0,a.jsx)(h,{label:i.label,...i.hue===void 0?{}:{hue:i.hue},...r?{pickId:i.id}:{},...i.emphasis===void 0?{}:{emphasis:i.emphasis},selected:o.includes(i.id)},i.id)),d>0?(0,a.jsx)(h,{label:`+${d} more`}):null]})}function F({label:e,count:l,items:o,onExpand:r,flagged:t,problems:d}){return(0,a.jsx)(E,{title:e,meta:d?(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[d,(0,a.jsx)("span",{children:l})]}):l,tone:t?"warning":"muted",style:r?{cursor:"zoom-in"}:void 0,children:o&&o.length>0?(0,a.jsx)(L,{items:o,max:6,pick:!0}):null})}export{A as a,I as b,E as c,h as d,L as e,F as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y,b as h}from"./chunk.
|
|
1
|
+
import{a as y,b as h}from"./chunk.RIS3OKAI.js";import"./chunk.DUZS52WX.js";import"./chunk.MDIAWTNK.js";import"./chunk.PEA4D66Y.js";import"./chunk.TRPPN2GD.js";import{Zc as b}from"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";var k=(d,i)=>({id:i.id,said:h(d,i),when:i.when,...i.alsoMine?{alsoMine:!0}:{}});async function A(d,i,t){let a=b(t.principal);if(a.id===void 0)return{ok:!1,error:"This seat acts for nobody the app knows by id, so there is nobody to tell. Nothing was kept."};let r=t.store.seenBy(a),p=async()=>(await t.subscriptions.list(a.id)).filter(n=>n.app===t.app);if(d==="list_subscriptions")return{ok:!0,data:{subscriptions:(await p()).map(n=>k(r,n))}};if(d==="unsubscribe"){let n=String(i.id??"");return(await p()).some(g=>g.id===n)?(await t.subscriptions.remove(n),{ok:!0,data:{removed:n}}):{ok:!1,error:`No subscription "${n}" of yours. list_subscriptions says which there are.`}}let o=String(i.on??""),c=n=>typeof i[n]=="string"&&i[n].trim()!==""?i[n].trim():void 0,e=c("record");if(e!==void 0&&!r.graph.getNode(e)){let n=t.store.resolveRef({name:"record",kinds:["*"]},e,a);if(!n.ok)return{ok:!1,error:`${n.message} Nothing was kept.`};e=n.id}let s=c("kind")??(e!==void 0&&o!=="act"?r.graph.getNode(e)?.kind:void 0),f=c("act"),m=c("condition"),u=o==="act"?{on:o,...f!==void 0?{act:f}:{},...e!==void 0?{record:e}:{}}:o==="created"&&s!==void 0?{on:o,kind:s}:o==="changed"?{on:o,...s!==void 0&&e===void 0?{kind:s}:{},...e!==void 0?{record:e}:{}}:o==="reaches"&&s!==void 0?{on:o,kind:s,condition:m??"",...e!==void 0?{record:e}:{}}:void 0;if(!u)return{ok:!1,error:'Say what to be told of: on is "act", "created", "changed" or "reaches", with a kind (or a record) for all but act. Nothing was kept.'};let l=y({schema:r.schema,allMutations:()=>t.store.allMutations(),graph:r.graph},u);if(l)return{ok:!1,error:`${l} Nothing was kept.`};let S=await t.subscriptions.add({who:a,app:t.app,when:u,...i.alsoMine===!0?{alsoMine:!0}:{}});return{ok:!0,data:{subscription:k(r,S)}}}export{A as runSubscriptionTool};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{a as _,b as C,c as I,d as j,e as P,f as F,g as T,i as M}from"./chunk.F5RN6YXG.js";import"./chunk.AJZBJBMO.js";var J=0,q=1,Q=2,Z=3,H=1,ee=2,B=3,te=1,ne=3,re=8,G="~",N=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),U=new Set(["input","select","textarea","option"]),oe=new Set(["value","checked","selected"]),V=["aria-label","aria-labelledby","title"],ie=r=>V.some(t=>(r.getAttribute(t)??"").trim()!=="");function W(r,t){let u=r.ownerDocument??r,p=t.maxNodes??5e3,g=[],m=new Map,w=new WeakMap,k={dom:r,name:"div",namespace:"html",children:[],id:G};m.set(G,k);let x=0,D=!1,O=new WeakMap,R=new Map,n=e=>{g.push(e),g.length>200&&g.shift(),t.onRefused?.(e)},a=()=>({dom:u.createComment(""),children:[],refused:!0}),f=(e,l)=>{if(e.namespace==="html"&&e.name&&U.has(e.name))return e.dom;if(l?.namespace==="html"&&l.name==="textarea")return l.dom},E=(e,l)=>{let d=e.dom,s=O.get(d)??d.getAttribute("role");if(s===null||!s.split(/\s+/).some(i=>_.includes(i.toLowerCase())))return void O.delete(d);if(ie(d)){O.delete(d),d.getAttribute("role")!==s&&d.setAttribute("role",s);return}O.set(d,s),d.removeAttribute("role"),l&&n({reason:"value",element:e.name,name:"role"})},b=(e,l,d,s=!0)=>{let i=e.dom;if(d!=null&&typeof d!="string")return n({reason:"value",element:e.name,name:l});let o=M(e.namespace,e.name,l,d??null,t);if("refused"in o){let S=M(e.namespace,e.name,l,null,t);return"refused"in S||i.removeAttribute(S.name),!("refused"in S)&&S.name==="role"&&O.delete(i),n(o.refused)}for(let S of o.dropped??[])n(S);let v=e.namespace==="html"&&oe.has(o.name)&&U.has(e.name),c=i,y=v?o.name==="value"?c.value:o.name==="checked"?c.checked:c.selected:void 0;o.name==="role"&&O.delete(i),o.value===null?i.removeAttribute(o.name):i.setAttribute(o.name,o.value),s&&(o.name==="role"||V.includes(o.name))&&E(e,o.name==="role"),t.onAttribute?.(i,o.name),v&&(o.name==="value"&&"value"in c?(c.value=o.value??"",y!==c.value&&t.onFieldSet?.(i)):o.name==="checked"&&"checked"in c?(c.checked=o.value!==null,y!==c.checked&&t.onFieldSet?.(i)):o.name==="selected"&&"selected"in c&&(c.selected=o.value!==null,y!==c.selected&&t.onFieldSet?.(i.parentElement?.closest("select")??i)))},h=e=>{if(!e.refused){x-=1,e.id!==void 0&&m.delete(e.id);for(let l of e.children)h(l)}},A=(e,l)=>{if(!N(e)||typeof e.id!="string"||m.has(e.id))return n({reason:"record"}),a();if(x>=p)return n({reason:"budget"}),D||(D=!0,t.onOverBudget?.()),a();let d=e.id;if(e.type===re)return a();if(e.type===ne){if(T(l.namespace,l.name))return n({reason:"child",element:l.name}),a();let c=u.createTextNode(String(e.data??"").slice(0,C)),y={dom:c,children:[],text:!0,id:d,parent:l};return m.set(d,y),w.set(c,d),x+=1,y}if(e.type!==te)return n({reason:"record"}),a();let s=String(e.element);if(T(l.namespace,l.name))return n({reason:"child",element:s}),a();let i=F(s,l.namespace);if("refused"in i)return n(i.refused),a();let o=u.createElementNS(i.namespace==="svg"?j:I,i.name);i.as&&o.setAttribute("data-graview-as",i.as),i.namespace==="html"&&i.name==="img"&&o.setAttribute("referrerpolicy","no-referrer"),i.namespace==="html"&&i.name==="a"&&(o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"),o.setAttribute("referrerpolicy","no-referrer"));let v={dom:o,name:i.name,namespace:i.namespace,children:[],id:d,parent:l};if(m.set(d,v),w.set(o,d),x+=1,N(e.attributes)){for(let[c,y]of Object.entries(e.attributes))b(v,c,y,!1);E(v,!0)}if(t.decorate?.(o,i.name,i.namespace),N(e.properties))for(let c of Object.keys(e.properties))n({reason:"attribute",element:i.name,name:c});if(N(e.eventListeners))for(let c of Object.keys(e.eventListeners))e.eventListeners[c]!=null&&n({reason:"attribute",element:i.name,name:`on${c}`});if(Array.isArray(e.children))for(let c of e.children){let y=A(c,v);v.children.push(y),o.appendChild(y.dom)}return v},L=e=>{if(!Array.isArray(e))return n({reason:"record"});let[l,d]=e,s=typeof d=="string"?m.get(d):void 0;if(!s)return n({reason:"record"});switch(l){case J:{if(s.text)return n({reason:"record"});let i=Number(e[3]),o=Number.isInteger(i)&&i>=0&&i<=s.children.length?i:s.children.length,v=e[2],c=N(v)&&typeof v.id=="string"?R.get(v.id):void 0,y;c&&c.parent?.namespace===s.namespace&&!T(s.namespace,s.name)?(R.delete(v.id),c.parent=s,y=c):y=A(v,s),s.dom.insertBefore(y.dom,s.children[o]?.dom??null),s.children.splice(o,0,y),s.namespace==="html"&&s.name==="textarea"&&t.onFieldSet?.(s.dom);return}case q:{let i=Number(e[2]),o=s.children[i];if(!o)return n({reason:"record"});s.children.splice(i,1),o.dom.parentNode?.removeChild(o.dom),o.id!==void 0&&!o.refused?R.set(o.id,o):h(o);return}case Q:{if(!s.text)return n({reason:"record"});s.dom.data=String(e[2]??"").slice(0,C);let i=f(s,s.parent);i&&t.onFieldSet?.(i);return}case Z:{if(s===k||s.text)return n({reason:"record"});let i=String(e[2]),o=e[4]??H;return o===ee?b(s,i,e[3]):n(o===H||o===B?{reason:"attribute",element:s.name,name:o===B?`on${i}`:i}:{reason:"record"})}default:return n({reason:"record"})}};return{apply(e,l){if(!Array.isArray(e))return n({reason:"record"}),!0;try{for(let d=0;d<e.length;d+=1){if(l&&d%32===0&&l())return!1;L(e[d])}return!0}finally{for(let d of R.values())h(d);R.clear()}},get refused(){return g},get size(){return x},idOf:e=>w.get(e),elementOf(e){let l=m.get(e);return l&&!l.text&&l!==k?l.dom:void 0},dispose(){for(let e of k.children)h(e);for(k.children.length=0;r.firstChild;)r.removeChild(r.firstChild)}}}var $=["https:","mailto:","tel:"];function K(r){if(!(typeof r!="string"||r.length>2e3||/[\s<>"]/.test(r.trim())||r.trim()!==r))try{let t=new URL(r);return!$.includes(t.protocol)||t.protocol==="https:"&&(t.hostname===""||t.username!==""||t.password!=="")?void 0:t.href}catch{return}}function ae(r){let t=new Set,u=p=>{if(typeof p!="string"||!/^(https|mailto|tel):/i.test(p))return;let g=K(p);g&&t.add(g)};for(let p of[...r?.node?[r.node]:[],...r?.nodes??[]])for(let[g,m]of Object.entries(p))g==="id"||g==="kind"||(Array.isArray(m)?m.forEach(u):u(m));return t}function z(r){return(r??[]).flatMap(t=>{try{let u=new URL(t);return u.protocol==="https:"&&u.hostname!==""&&u.username===""&&u.password===""?[u.origin]:[]}catch{return[]}})}function se(r,t){let u=K(r);if(u&&(t.handed.has(u)||u.startsWith("https:")&&z(t.origins).includes(new URL(u).origin)))return u}function de(r,t){let u=r.length>120?`${r.slice(0,119)}\u2026`:r,p="";try{p=new URL(r).protocol}catch{p=""}if(!$.includes(p))return`The link "${u}" was not drawn: a view links only to an https:, mailto: or tel: address.`;let g=z(t);return`The link "${u}" was not drawn: it is no address this view was handed. A view links out only to an address a record it was shown holds (a url field), as the record holds it${g.length>0?`, or an https: address on ${g.join(", ")}`:""}; a record or a place of this app is <a data-record> or <a data-place>.`}var le=`
|
|
2
|
+
:host { display: block; position: relative; contain: layout paint style; isolation: isolate; overflow: clip; min-width: 0; }
|
|
3
|
+
:host(:focus-within) { overflow-clip-margin: var(--graview-ring-reach, 4px); }
|
|
4
|
+
[data-graview-view-root] { display: flow-root; color: var(--graview-ink, CanvasText); font-family: var(--graview-font-body, system-ui, sans-serif); line-height: 1.45; }
|
|
5
|
+
:where([data-graview-view-root]) :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: inherit; appearance: none; cursor: pointer; }
|
|
6
|
+
:where([data-graview-view-root]) :where(a[data-graview-link]) { color: inherit; text-decoration: none; }
|
|
7
|
+
[data-graview-view-root] :is([data-graview-link], [data-graview-press]) { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: rgb(128 128 128 / 0.16); }
|
|
8
|
+
[data-graview-view-root] :focus-visible { outline: max(2px, var(--graview-focus-width, 2px)) solid var(--graview-focus-color, var(--graview-accent, Highlight)) !important; outline-offset: var(--graview-focus-offset, 2px) !important; }
|
|
9
|
+
[data-graview-view-root] [data-graview-ring-inside]:focus-visible { outline-offset: calc(-1 * max(2px, var(--graview-focus-width, 2px))) !important; }
|
|
10
|
+
[data-graview-view-root] .graview-sr { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
|
|
11
|
+
[data-graview-view-root] a[href]:not([data-graview-link])::after { content: " \u2197" !important; content: " \u2197" / " (opens in a new tab)" !important; }
|
|
12
|
+
@layer graview-motion { @media (prefers-reduced-motion: reduce) { [data-graview-view-root] *, [data-graview-view-root] ::before, [data-graview-view-root] ::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-timeline: auto !important; transition-duration: 1ms !important; scroll-behavior: auto !important; } } }
|
|
13
|
+
`,X=4,ce=16;function ue(r){let t=r.ownerDocument.defaultView?.getComputedStyle(r);if(!t)return X;let u=Number.parseFloat(t.outlineWidth)||0,p=Math.max(0,Number.parseFloat(t.outlineOffset)||0);return Math.min(ce,Math.max(X,Math.ceil(u+p)))}var fe=new Set(["Enter"," ","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),Y=["click","input","change","keydown"];function we(r,t){let u=r.ownerDocument,p=u.createElement("style");p.setAttribute("data-graview-region",""),p.textContent=le;let g=u.createElement("style");g.setAttribute("data-graview-view-style","");let m=u.createElement("div");m.setAttribute("data-graview-view-root",""),r.append(p,g,m);let w=W(m,{origin:t.origin,...t.asset?{asset:t.asset}:{},...t.imageOrigins?{imageOrigins:t.imageOrigins}:{},...t.picture?{picture:t.picture}:{},...t.link?{link:t.link}:{},...t.onRefused?{onRefused:t.onRefused}:{},...t.maxNodes!==void 0?{maxNodes:t.maxNodes}:{},...t.onOverBudget?{onOverBudget:t.onOverBudget}:{},decorate:(n,a,f)=>{f==="html"&&a==="button"&&n.setAttribute("type","button"),f==="html"&&(a==="input"||a==="textarea"||a==="select")&&n.setAttribute("autocomplete","off"),t.decorate?.(n,a,f)},...t.onFieldSet?{onFieldSet:t.onFieldSet}:{},...t.onAttribute?{onAttribute:t.onAttribute}:{}}),k=[],x="",D=n=>{for(let a=n.composedPath()[0];a&&a!==m&&a!==r;a=a.parentNode)if(a.nodeType===1&&w.idOf(a)!==void 0)return a},O=n=>{let a=D(n);if(!a||n.type==="keydown"&&!fe.has(n.key))return;let f=t.before?.(n,a,m);if(f===!1)return;let E=a,b=a.namespaceURI==="http://www.w3.org/1999/xhtml"&&["input","select","textarea"].includes(a.localName);t.send({type:"dom-event",target:w.idOf(a),event:n.type,...b?{value:String(E.value??"")}:{},...b&&(E.type==="checkbox"||E.type==="radio")?{checked:E.checked}:{},...n.type==="keydown"?{key:n.key}:{},...f??{}});let h=n.type==="keydown"?n.key:void 0;(h==="Enter"||h===" ")&&a.hasAttribute("data-graview-press")&&n.composedPath()[0]===a&&(n.preventDefault(),t.send({type:"dom-event",target:w.idOf(a),event:"click"}))};for(let n of Y)r.addEventListener(n,O);r.addEventListener("toggle",O,!0);let R=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("overflow-clip-margin","4px");return r.addEventListener("focusin",n=>{let a=n.composedPath()[0],f=r.host;if(!a||a.nodeType!==1||!m.contains(a))return;let E=ue(a);if(R){f.style.setProperty("--graview-ring-reach",`${E}px`);return}let b=f.getBoundingClientRect(),h=a.getBoundingClientRect(),A=E*(f.offsetWidth>0?b.width/f.offsetWidth:1),L=h.left-b.left<A||b.right-h.right<A||h.top-b.top<A||b.bottom-h.bottom<A;a.toggleAttribute("data-graview-ring-inside",L)}),{apply(n,a){let f=r.activeElement,E=f?w.idOf(f):void 0,b=w.apply(n,a);if(E!==void 0&&r.activeElement!==f){let h=w.elementOf(E);h?.isConnected&&typeof h.focus=="function"&&h.focus({preventScroll:!0})}return b},style(n){let a=P(n);k.length=0;for(let f of a.refused)k.push({reason:"css",name:"stylesheet",css:f}),k.length>200&&k.shift();x=a.css,g.textContent=x},renderer:w,get refused(){return[...w.refused,...k]},get css(){return x},dispose(){for(let n of Y)r.removeEventListener(n,O);r.removeEventListener("toggle",O,!0),w.dispose(),r.replaceChildren()}}}export{le as REGION_CSS,we as createOpenDrawing,ae as handedLinks,se as judgeLink,de as linkRefusedWords,ue as ringReach};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as z,b as Y,d as ee}from"./chunk.
|
|
1
|
+
import{a as z,b as Y,d as ee}from"./chunk.WDEMPWS4.js";import"./chunk.H2B3SEI7.js";import{bc as J,da as Q,ha as U,ma as X,qa as _}from"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import"./chunk.AJZBJBMO.js";function ce(t){let r=t?.indexOf(":")??-1;if(!(!t||r<=0||r===t.length-1))return{relation:t.slice(0,r),record:t.slice(r+1)}}function ne(t,r){if(t.length===0)return!0;let d=`${r.split("/")[0]}/*`;return t.some(a=>a==="*"||a==="*/*"||a===r||a===d)}function re(t,r){let d=r.startsWith("image/")?"image":r.startsWith("video/")?"video":"file";return t.find(a=>a.as===d)??t.find(a=>a.as==="file")}function fe(t,r){let d=new Set(t.map(k=>k.as==="image"?"image/":k.as==="video"?"video/":""));if(d.has("")||r.kinds.length===0)return r.kinds.join(",");let a=[];for(let k of d){let m=r.kinds.filter(l=>l.startsWith(k));a.push(...m.length>0?m:[`${k}*`])}return a.join(",")}var T=t=>t.input?.shape??{},ie=(t,r)=>T(t)[r]?.safeParse(void 0).success===!1;function ae(t,r){let d=new Set(z(t.input).map(a=>a.name));return Object.keys(T(t)).filter(a=>!r.has(a)&&!d.has(a)&&ie(t,a)&&T(t)[a].safeParse("a name").success&&!T(t)[a].safeParse(1).success)}var ue=t=>t.replace(/\.[a-z0-9]{1,5}$/i,"")||t,se=(t,r)=>{let d=Number.isFinite(Date.parse(r))?new Date(Date.parse(r)).toISOString():r;return[r,d,d.replace(/\.\d{3}Z$/,"Z"),r.slice(0,10)].find(a=>t.safeParse(a).success)},pe="2026-01-01T00:00:00.000Z";function te(t,r){let d=T(t),a=new Set(ae(t,r)),k=Object.keys(d).filter(l=>!r.has(l)&&!a.has(l)&&ie(t,l)),m=k.filter(l=>se(d[l],pe)!==void 0);return{timed:m,left:k.filter(l=>!m.includes(l))}}function oe(t,r,d,a,k){let m=e=>({ok:!1,says:e}),{kind:l}=a,R=(d.accepts??[]).filter(e=>e.kind===l&&(a.field===void 0||e.field===a.field));if(R.length===0)return m(a.field===void 0?`The view's accepts names no field of "${l}", so nothing dropped there can become one.`:`The view's accepts does not name ${l}'s "${a.field}".`);let A=k.files;if(!A||!(A.maxBytes>0))return m("This host takes no files.");let j=R.flatMap(e=>{let n=ee(t,e.kind,e.field);return n?[{field:e.field,...n}]:[]}),w=j.filter(e=>e.as==="file"||A.kinds.length===0||A.kinds.some(n=>n==="*"||n==="*/*"||n.startsWith(e.as==="image"?"image/":"video/")));if(w.length===0)return m(`This host takes none of what ${l}'s ${j.map(e=>`"${e.field}"`).join(" or ")} holds.`);let c=a.connect===void 0?void 0:ce(a.connect);if(a.connect!==void 0&&(!c||k.shown.has(a.connect)))return m(`data-drop-connect is "<relation>:<record id>", not "${a.connect}".`);if(c&&!k.shown.has(c.record))return m(`data-drop-connect names "${c.record}", which this view was not shown.`);let g=c?t.seenBy(r).graph.getNode(c.record):void 0;if(c&&!g)return m(`data-drop-connect names "${c.record}", which this seat does not see.`);let $=e=>Object.hasOwn(t.schema.tryDefinition(e)?.edges??{},c.relation),E=c?$(l):!1;if(c&&!E&&!$(g.kind))return m(`Neither a "${l}" nor a "${g.kind}" has the relation "${c.relation}".`);let H=t.allMutations(),F=e=>t.permits(e,r).ok,Z=e=>w.every(n=>Object.hasOwn(T(e),n.field)),V=H.filter(e=>(e.creates??[]).includes(l)&&Z(e)),x=X(t.schema.tryDefinition(l),l),O=U(t.schema,l).toLowerCase(),S=g?Q(t.schema.tryDefinition(g.kind),g):void 0,G=e=>`${e===1?`a ${x}`:`${e} ${O}`}${S?` to ${S}`:""}`,K=e=>`Add ${G(e)}`,L=e=>`Added ${G(e)}.`,B=`Drop to add ${O}${S?` to ${S}`:""}.`,N=(e,n,u,v)=>{let I=new Set(Object.keys(n)),D=_(u.at)??v??new Date().toISOString();for(let C of te(e,I).timed)n[C]=se(T(e)[C],D);for(let C of ae(e,I))n[C]=ue(u.name);return n},q=(e,...n)=>new Set([...w.map(u=>u.field),...n,...z(e.input).map(u=>u.name)]),P=(e,...n)=>te(e,q(e,...n)).left,i=(e,n)=>m(`"${e.title??e.name}" asks for ${n.map(u=>`"${u}"`).join(" and ")}, which no dropped file says, so nothing dropped here can become a ${x}.`),o=(e,n)=>e.list?[n]:n,f={ok:!0,kind:l,fields:w,accept:fe(w,A),...c?{connect:c}:{},intent:K,invite:B,added:L};if(!c){let e=V.find(n=>!n.subject&&F({name:n.name,args:{}}));return e?P(e).length>0?i(e,P(e)):{...f,calls:n=>[{name:e.name,args:N(e,{[n.field]:o(w.find(u=>u.field===n.field),n.value)},n.value,n.at)}]}:m(`This seat may not make a "${l}" here.`)}let s=V.find(e=>e.subject&&(e.subject.kinds==="*"||e.subject.kinds.includes(g.kind))&&(e.connects??[]).includes(c.relation)&&F({name:e.name,args:{[e.subject.arg]:c.record}}));if(s){let e=s.subject.arg;return P(s,e).length>0?i(s,P(s,e)):{...f,calls:n=>[{name:s.name,args:N(s,{[e]:c.record,[n.field]:o(w.find(u=>u.field===n.field),n.value)},n.value,n.at)}]}}let p=V.find(e=>!e.subject&&F({name:e.name,args:{}}));if(!p)return m(`This seat may not make a "${l}" here.`);if(P(p).length>0)return i(p,P(p));let y=E?l:g.kind,W=E?g.kind:l,M=H.find(e=>{if(!(e.connects??[]).includes(c.relation)||!e.subject)return!1;let n=e.subject.kinds;if(n!=="*"&&!n.includes(y))return!1;let u=z(e.input).find(v=>v.name!==e.subject.arg&&(v.kinds.includes("*")||v.kinds.includes(W)));return u?F({name:e.name,args:E?{[u.name]:c.record}:{[e.subject.arg]:c.record}}):!1});if(!M)return m(`This seat may not link a "${l}" to ${c.record} by "${c.relation}".`);let h=M.subject.arg,b=z(M.input).find(e=>e.name!==h&&(e.kinds.includes("*")||e.kinds.includes(W))).name;return{...f,calls:(e,n)=>[{name:p.name,args:N(p,{[e.field]:o(w.find(u=>u.field===e.field),e.value)},e.value,e.at)},{name:M.name,args:E?{[h]:J(n*2),[b]:c.record}:{[h]:c.record,[b]:J(n*2)}}]}}var de=t=>t.type.startsWith("image/"),me=t=>t.type.startsWith("video/"),ge=`
|
|
2
2
|
[data-graview-drop-over] { outline: 2px dashed var(--graview-accent, Highlight) !important; outline-offset: 2px !important; background-color: color-mix(in srgb, var(--graview-accent, Highlight) 10%, transparent) !important; }
|
|
3
3
|
[data-graview-drop-status], [data-graview-drop-refused] { margin: 4px 0 0; font: 0.8125rem/1.4 var(--graview-font-body, system-ui, sans-serif); color: var(--graview-ink-muted, GrayText); }
|
|
4
4
|
[data-graview-drop-refused] { color: var(--graview-warn, var(--graview-ink, CanvasText)); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as on,c as an,d as re,e as sn,f as oe,h as Oe,i as dn,n as cn,r as ie}from"./chunk.5WU2UTP7.js";import{Ab as U,B as ue,C as te,Ca as Be,Db as Qe,Ea as _e,F as ke,Fc as tn,Gc as rn,H as Ce,Hb as Xe,I as Ze,Ia as we,Ja as ve,Mb as en,Pa as He,Sa as Ue,b as De,ba as Ke,bb as We,c as Te,d as $e,db as Je,e as K,fa as Ve,g as ce,h as M,i as Pe,ib as xe,j as Ge,jb as Ye,k as le,l as Me,la as Ie,m as Le,o as Fe,p as fe,q as he,uc as nn,v as Ne,wa as be,x as ne,z as pe,za as qe}from"./chunk.VOHRQXCF.js";function ln(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let s=e,n=b=>typeof s[b]=="string"?s[b]:void 0,t=n("light")??n("src");if(t===void 0)return;let[o,m,u]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...o!==void 0?{dark:o}:{},...m!==void 0?{alt:m}:{},...u!==void 0?{darkFallback:u}:{}}}function Gn(e,s){let n=e.brand??{},t=n.accent?rn(n.accent):void 0;t&&!t.ok&&s.push(dn("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${t.why}`,"pick a color further from orange-red, or a darker one"));let o=ln(n.logo),m=n.name??e.name,u=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,b])=>typeof b=="string"&&!/url\(|@import|[;{}<>\\]/i.test(b)).map(([b,L])=>[b,tn(L)])):void 0;return{name:m,schemes:t?.ok?t.schemes:nn,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...o?{logo:o.dark||o.darkFallback==="invert"?{light:o.light,...o.dark?{dark:o.dark}:{darkFallback:"invert"}}:o.light,logoAlt:o.alt??m}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...u?{typography:u}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function fn(e){let{currency:s,locale:n,timeZone:t}=e.brand??{};return{...s?{currency:s}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var wn=Symbol.for("@graview/core:typed-field"),pn=(e,s)=>(/^(phone|place|duration)$/.test(s)&&(te(e)[wn]=s),e),un=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function mn(e){let s=M().check(K(300),pe(t=>Be(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?s:fe(s).check(K(200));return _e(e.description?n.check(ue(e.description)):n,e)}var xn=new WeakMap;function gn(e,s){xn.set(e,s)}var On=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function yn(e,s=On){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let o of s)t=Re(t,o.where.split("."),o,"",n);return{document:t,respelled:n}}function Re(e,s,n,t,o){if(s.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;o.push(`${t}${n.was}`);let{[n.was]:T,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:T}}if(!V(e))return e;let[m,...u]=s,b=m.endsWith("[]"),L=b?m.slice(0,-2):m,F=e[L],B=F;if(!b)B=Re(F,u,n,`${t}${L}.`,o);else if(Array.isArray(F)){let T=F.map((N,W)=>Re(N,u,n,`${t}${L}.${W}.`,o));B=T.some((N,W)=>N!==F[W])?T:F}return B===F?e:{...e,[L]:B}}var hn="graview-compiled@1";function Rn(e,s){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(s)))?.[0]}var q="id",me=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function kn(e){let s=Object.entries(e.fields),n=t=>["name","title","label"].find(o=>t.some(([m])=>m===o))??t[0]?.[0];return n(s.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(s.filter(([,t])=>t.type==="string"))}function bn(e,s,n){let t;switch(e.type){case"string":case"place":t=M().check(K(500));break;case"phone":t=M().check(K(40),ce(un,"a phone number"));break;case"text":t=M().check(K(2e4)),e.format&&(te(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let m=e.min??(e.type==="duration"?0:void 0),u=[...e.type==="number"?[]:[Me()],...m===void 0?[]:[Te(m)],...e.max===void 0?[]:[De(e.max)],...e.step===void 0?[]:[$e(e.step)]];t=u.length>0?le().check(...u):le();break}case"boolean":t=Le();break;case"date":t=M().check(ce(ke,"a date like 2026-10-02"));break;case"datetime":t=M().check(pe(Ce,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ne(e.options);break;case"list":t=fe(e.of==="number"?le():e.of==="date"?M().check(ce(ke)):e.of==="image"||e.of==="video"||e.of==="file"?be(e.of):M().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=be(e.type);break;case"app-link":t=qe();break;case"url":t=Ge();break;case"email":t=Pe();break}let o=e.type==="number"||e.type==="integer";return pn(t,o&&e.format==="duration"?"duration":e.type),e.collaborative!==void 0&&(e.type==="text"||e.type==="string")&&(te(t)[Symbol.for("@graview/core:collaborative")]=e.collaborative?1:0),e.description&&(t=t.check(ue(e.description))),o&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&Xe(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),s?ne(t):t}var ae=e=>{throw new U(`there is no record "${e}"`,"invalid")},zn=(e,s)=>"field"in e?bn(e.field,e.optional,s):"ref"in e?en(e.ref):ne(Fe()),An=new WeakMap;var ze=(e,s)=>V(s)&&Object.keys(e??{}).length===Object.keys(s).length&&Object.keys(e??{}).every(n=>Object.hasOwn(s,n));function it(e,s={}){let n=V(e)?e.format:void 0;if(n!==hn)return{ok:!1,findings:[Oe("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${hn}`,"compile the document instead")]};let t=e,o=yn(t.document).document,m=o===t.document?t:{...t,document:o},u=V(o)&&typeof o.name=="string"&&V(o.kinds)&&ze(o.kinds,m.kinds)&&ze(o.acts,m.acts)&&ze(o.rules,m.rules)&&Array.isArray(m.edges)&&Array.isArray(m.findings),b={ok:!1,findings:[Oe("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!u)return b;try{return Sn(m,s)}catch{return b}}function Sn(e,s={}){let{document:n}=e,t=n.brand?.timeZone,o=s.today??(()=>Ze(t)),m=new Map(e.edges.map(([h,r])=>[h,r])),u=new Map;for(let[h,r]of Object.entries(n.kinds)){let z=e.kinds[h]?.computed,R=ve(r.edges);u.set(h,{fields:new Set([...Object.keys(r.fields),...R.keys()]),edges:new Map(Object.entries(we(r.edges)).map(([j,$])=>[j,$.cardinality??"many"])),...z?{computed:new Map(z)}:{},...R.size>0?{linked:R}:{}})}e.facts&&u.set(an,{computed:new Map(e.facts)});let b=fn(n),L=new Map,F=Object.entries(n.kinds).map(([h,r])=>{let z={};for(let[i,g]of Object.entries(r.fields))z[i]=bn(g,!g.required,b),g.repeats&&(z[He(i)]=ne(Ue()));for(let[i,g]of ve(r.edges))z[i]=ne(mn(g));let{label:R,describe:j,durations:$}=e.kinds[h]??{},P=Object.entries(r.computed??{}).map(([i,g])=>[i,typeof g=="string"?{expr:g}:g]),J=Object.hasOwn(r.fields,"label")&&!r.fields.label.label&&!/\{\s*label\b/.test(r.label??`{${kn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,i])=>i.label).map(([i,g])=>[i,g.label]),...P.filter(([,i])=>i.label).map(([i,g])=>[i,g.label])]),A=Object.keys(_).length>0,l=Object.fromEntries(Object.entries(r.fields).filter(([,i])=>i.default!==void 0).map(([i,g])=>[i,g.default]));L.set(h,l);let D=Object.fromEntries(Object.entries(we(r.edges)).map(([i,{renamedFrom:g,...I}])=>[i,I])),S=i=>r[i]?{[i]:r[i]}:{};return Ke(h,{fields:he(z),edges:D,...S("plural"),...S("noun"),...S("description"),...R?{label:i=>ie(R,{node:i,kinds:u,today:o(),money:b})||i.id}:{},...j?{describe:i=>ie(j,{node:i,kinds:u,today:o(),money:b})}:{},...S("lifecycle"),...S("figure"),...S("fieldRoles"),...S("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([i,g])=>[i,$?.includes(i)?{...g,as:"duration"}:r.computed[i]]))}:{},...A||r.glance||r.page?{display:{...A?{labels:_}:{},...r.glance?{glance:[...r.glance]}:{},...r.page?{page:r.page}:{}}}:{},...Object.keys(l).length>0?{defaults:l}:{}})}),B=We(F,n.computed);function T(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...L.get(h)}),W=[];for(let[h,r]of Object.entries(n.acts??{})){let z=e.acts[h],{title:R,effects:j,guard:$,refusal:P,destructive:J,idempotent:_,creates:A,connects:l,severs:D,writes:S,writesOther:i,sets:g}=z,I=new Map(z.args),se={};for(let[d,x]of I)se[d]=zn(x,b);let w=[r.on??[]].flat(),C=new Map(z.exprs),G=j.find(d=>"create"in d),Y=(d,x,f,v=null)=>{if(V(d)&&"expr"in d)return oe(C.get(d.expr),{graph:f,subject:v,kinds:u,bindings:x,today:o()});let k=me(d);return k===void 0?typeof d=="string"&&d.startsWith("$$")?d.slice(1):d:k==="now"?new Date().toISOString():k==="today"?o():x[k]},Ee=(d,x)=>{if(!G)return"";let f=n.kinds[G.create].fields,v=N(G.create),k=[];for(let[O,ee]of Object.entries(G.set??{})){try{v[O]=Y(ee,d,x)??v[O]}catch{}let Q=me(ee);Q&&d[Q]!==void 0&&k.push(O)}let Z=T(v).trim(),H=k.filter(O=>v[O]!==!1&&f[O].type!=="text"&&!(/[^]{41}/.test(v[O])||/ .*[.!?]$/.test(v[O])&&!/[ .][A-Z]\w{0,3}\.$/.test(v[O]))&&T({...v,[O]:void 0}).trim()===Z).map(O=>v[O]===!0?f[O].label??Ve(O):cn(v[O],f[O].format,o(),[],b));return Z&&H.length>0?`${Z} (${H.join(", ")})`:Z};W.push(Qe(h,{input:he(se),title:R,...r.description?{description:r.description}:{},...r.fromTheOtherEnd?{fromTheOtherEnd:r.fromTheOtherEnd}:{},...I.has(q)?{subject:{kinds:w.length>0?w:"*",arg:q}}:{},...J?{destructive:!0}:{},..._?{idempotent:!0}:{},...A.length>0?{creates:A}:{},...l.length>0?{connects:l}:{},...D.length>0?{severs:D}:{},writes:S,...Object.keys(i).length>0?{writesOther:i}:{},...Object.keys(g).length>0?{sets:g}:{},describe:(d,x)=>{let f=typeof d[q]=="string"?x.getNode(d[q]):void 0,v=f?T(f):Ee(d,x);return v?`${R}: ${v}`:R},apply(d,x){let f=d.graph,v=typeof x[q]=="string"?x[q]:void 0,k=v?f.getNode(v):void 0;if(v&&!k&&ae(v),k&&w.length>0&&!w.includes(k.kind))throw new U(`"${R}" acts on ${w.join(" or ")}, not on ${Ie(k.kind)}`,"invalid");let Z={};for(let[a,c]of Object.entries(x))c!==void 0&&(Z[a]=c);if($&&k){let a;try{a=oe($,{graph:f,subject:k,kinds:u,bindings:Z,today:o()})}catch(c){throw c instanceof re?new U(`"${R}" could not be judged: ${c.sentence}`):c}if(a!==!0)throw new U(P?ie(P,{node:k,kinds:u,graph:f,bindings:Z,today:o(),money:b}):`"${R}" is not allowed for ${T(k)} right now`)}let H=new Map,O=a=>f.has(a)||[...H.values()].includes(a),ee=new Set,Q=a=>{let c=Je(a);ee.has(c)||(ee.add(c),d.removeEdge(a))},X=(a,c)=>{let p=me(a);if(p==="subject")return v;if(p==="me"){let y=d.me;if(y&&n.kinds[f.getNode(y)?.kind]?.people)return y;throw new U(`"${R}" is done as you, and you have no record here`)}if(H.has(p))return H.get(p);try{return Y(a,Z,f,c??k??null)}catch(y){throw y instanceof re?new U(`"${R}" could not work out a value: ${y.sentence}`):y}};for(let a of j)if("create"in a){let c=n.kinds[a.create],p=N(a.create);for(let[ye,de]of Object.entries(a.set??{})){let je=X(de,void 0);je!==void 0&&(p[ye]=je)}let y=kn(c),E=d.freshId(String((y&&p[y])??a.create),a.create);d.addNode({...p,id:E}),a.as&&H.set(a.as,E)}else if("connect"in a||"sever"in a){let c="connect"in a?a.connect:a.sever,p=String(X(a.from,void 0)??""),y=String(X(a.to,void 0)??"");if(O(p)||ae(p),O(y)||ae(y),"connect"in a){if(m.get(c)?.cardinality==="one")for(let E of f.out(p,c))E.id!==y&&Q({kind:c,from:p,to:E.id});f.out(p,c).some(E=>E.id===y)||d.addEdge({kind:c,from:p,to:y})}else Q({kind:c,from:p,to:y})}else if("set"in a){let c=String(X(a.target??"$subject",void 0)??""),p=f.getNode(c);!p&&!O(c)&&ae(c);let y={};for(let[E,ye]of Object.entries(a.set)){let de=X(ye,p);de!==void 0&&(y[E]=de)}Object.keys(y).length>0&&d.patchNode(c,y)}else if("remove"in a){let c=String(X(a.remove,void 0)??"");f.has(c)||ae(c),d.removeNode(c)}else if("replace"in a&&k){let c=x.to;for(let p of a.replace){let y=m.get(p)?.from.includes(k.kind)??!0;for(let E of y?f.out(k.id,p):f.in(k.id,p))p===a.keep&&E.id===c||Q(y?{kind:p,from:k.id,to:E.id}:{kind:p,from:E.id,to:k.id})}}}}))}let Ae=[];for(let[h,r]of Object.entries(n.rules??{})){let{title:z,require:R,when:j,says:$}=e.rules[h],P=r.repairs??[],J=(A,l,D=o(),S)=>{let i=[],g={graph:A,subject:l,kinds:u,today:D,...S?{linked:S}:{},onUnread:w=>i.push(w)},I;try{if(j&&oe(j,g)!==!0)return[];if(I=oe(R,g)===!0,!I&&i.length>0)throw new re(`it reads ${on(i[0])}`,0)}catch(w){throw w instanceof sn?new Ye(w.sentence):w instanceof re?new Error(w.sentence):w}if(I)return[];let se=P.flatMap(w=>{let C=n.acts?.[w.act],G={},Y=l&&C?.on&&C.fromTheOtherEnd&&![C.on].flat().includes(l.kind)?Rn(e.acts[w.act].args,l.kind):void 0;Y?G[Y]=l.id:l&&(C?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(w.act))&&(G[q]=l.id);for(let[x,f]of Object.entries(w.args??{}))G[x]=me(f)==="subject"?l?.id:f;let d=(C?e.acts[w.act].args:[]).filter(([x,f])=>f.required&&G[x]===void 0).map(([x])=>x);return[{mutation:w.act,label:w.label??(Y?C.fromTheOtherEnd:C?.title)??w.act.replace(/-/g," "),args:G,...d.length>0?{missing:d}:{}}]});return[{invariant:h,...l?{subjectId:l.id}:{},label:z,message:$?ie($,{node:l,kinds:u,graph:A,today:D,money:b}):l?`${T(l)}: ${z}`:z,nodeIds:l?[l.id]:[],repairs:se}]},_={label:z,shape:{over:r.over,require:R,when:j,says:$,declared:n.kinds,money:b,kinds:u,today:o},judgment:{require:r.require,...r.when?{when:r.when}:{},...r.says?{says:r.says}:{}},...r.description?{description:r.description}:{},...P.length>0?{repairs:P.map(A=>A.act)}:{}};Ae.push(r.over==="graph"?xe(h,{scope:"graph",..._,evaluate:({graph:A,today:l,context:D})=>J(A,null,l,D?.linked)}):xe(h,{scope:{kind:r.over},..._,evaluate:({graph:A,subject:l,today:D,context:S})=>J(A,l,D,S?.linked)}))}let Se=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:W,invariants:Ae,...Se?{policy:Se}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...n.publishing?{publishing:n.publishing}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return gn(ge,n),An.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:u}}export{yn as a,Gn as b,hn as c,q as d,me as e,kn as f,it as g,Sn as h};
|
|
1
|
+
import{b as on,c as an,d as re,e as sn,f as oe,h as Oe,i as dn,n as cn,r as ie}from"./chunk.TRPPN2GD.js";import{Ab as U,B as ue,C as te,Ca as Be,Db as Qe,Ea as _e,F as ke,Fc as tn,Gc as rn,H as Ce,Hb as Xe,I as Ze,Ia as we,Ja as ve,Mb as en,Pa as He,Sa as Ue,b as De,ba as Ke,bb as We,c as Te,d as $e,db as Je,e as K,fa as Ve,g as ce,h as M,i as Pe,ib as xe,j as Ge,jb as Ye,k as le,l as Me,la as Ie,m as Le,o as Fe,p as fe,q as he,uc as nn,v as Ne,wa as be,x as ne,z as pe,za as qe}from"./chunk.6W2DUW5S.js";function ln(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let s=e,n=b=>typeof s[b]=="string"?s[b]:void 0,t=n("light")??n("src");if(t===void 0)return;let[o,m,u]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...o!==void 0?{dark:o}:{},...m!==void 0?{alt:m}:{},...u!==void 0?{darkFallback:u}:{}}}function Gn(e,s){let n=e.brand??{},t=n.accent?rn(n.accent):void 0;t&&!t.ok&&s.push(dn("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${t.why}`,"pick a color further from orange-red, or a darker one"));let o=ln(n.logo),m=n.name??e.name,u=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,b])=>typeof b=="string"&&!/url\(|@import|[;{}<>\\]/i.test(b)).map(([b,L])=>[b,tn(L)])):void 0;return{name:m,schemes:t?.ok?t.schemes:nn,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...o?{logo:o.dark||o.darkFallback==="invert"?{light:o.light,...o.dark?{dark:o.dark}:{darkFallback:"invert"}}:o.light,logoAlt:o.alt??m}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...u?{typography:u}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function fn(e){let{currency:s,locale:n,timeZone:t}=e.brand??{};return{...s?{currency:s}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var wn=Symbol.for("@graview/core:typed-field"),pn=(e,s)=>(/^(phone|place|duration)$/.test(s)&&(te(e)[wn]=s),e),un=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function mn(e){let s=M().check(K(300),pe(t=>Be(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?s:fe(s).check(K(200));return _e(e.description?n.check(ue(e.description)):n,e)}var xn=new WeakMap;function gn(e,s){xn.set(e,s)}var On=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function yn(e,s=On){if(!V(e))return{document:e,respelled:[]};let n=[],t=e;for(let o of s)t=Re(t,o.where.split("."),o,"",n);return{document:t,respelled:n}}function Re(e,s,n,t,o){if(s.length===0){if(!V(e)||!Object.hasOwn(e,n.was))return e;o.push(`${t}${n.was}`);let{[n.was]:T,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:T}}if(!V(e))return e;let[m,...u]=s,b=m.endsWith("[]"),L=b?m.slice(0,-2):m,F=e[L],B=F;if(!b)B=Re(F,u,n,`${t}${L}.`,o);else if(Array.isArray(F)){let T=F.map((N,W)=>Re(N,u,n,`${t}${L}.${W}.`,o));B=T.some((N,W)=>N!==F[W])?T:F}return B===F?e:{...e,[L]:B}}var hn="graview-compiled@1";function Rn(e,s){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(s)))?.[0]}var q="id",me=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function kn(e){let s=Object.entries(e.fields),n=t=>["name","title","label"].find(o=>t.some(([m])=>m===o))??t[0]?.[0];return n(s.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(s.filter(([,t])=>t.type==="string"))}function bn(e,s,n){let t;switch(e.type){case"string":case"place":t=M().check(K(500));break;case"phone":t=M().check(K(40),ce(un,"a phone number"));break;case"text":t=M().check(K(2e4)),e.format&&(te(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let m=e.min??(e.type==="duration"?0:void 0),u=[...e.type==="number"?[]:[Me()],...m===void 0?[]:[Te(m)],...e.max===void 0?[]:[De(e.max)],...e.step===void 0?[]:[$e(e.step)]];t=u.length>0?le().check(...u):le();break}case"boolean":t=Le();break;case"date":t=M().check(ce(ke,"a date like 2026-10-02"));break;case"datetime":t=M().check(pe(Ce,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ne(e.options);break;case"list":t=fe(e.of==="number"?le():e.of==="date"?M().check(ce(ke)):e.of==="image"||e.of==="video"||e.of==="file"?be(e.of):M().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=be(e.type);break;case"app-link":t=qe();break;case"url":t=Ge();break;case"email":t=Pe();break}let o=e.type==="number"||e.type==="integer";return pn(t,o&&e.format==="duration"?"duration":e.type),e.collaborative!==void 0&&(e.type==="text"||e.type==="string")&&(te(t)[Symbol.for("@graview/core:collaborative")]=e.collaborative?1:0),e.description&&(t=t.check(ue(e.description))),o&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&Xe(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),s?ne(t):t}var ae=e=>{throw new U(`there is no record "${e}"`,"invalid")},zn=(e,s)=>"field"in e?bn(e.field,e.optional,s):"ref"in e?en(e.ref):ne(Fe()),An=new WeakMap;var ze=(e,s)=>V(s)&&Object.keys(e??{}).length===Object.keys(s).length&&Object.keys(e??{}).every(n=>Object.hasOwn(s,n));function it(e,s={}){let n=V(e)?e.format:void 0;if(n!==hn)return{ok:!1,findings:[Oe("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${hn}`,"compile the document instead")]};let t=e,o=yn(t.document).document,m=o===t.document?t:{...t,document:o},u=V(o)&&typeof o.name=="string"&&V(o.kinds)&&ze(o.kinds,m.kinds)&&ze(o.acts,m.acts)&&ze(o.rules,m.rules)&&Array.isArray(m.edges)&&Array.isArray(m.findings),b={ok:!1,findings:[Oe("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!u)return b;try{return Sn(m,s)}catch{return b}}function Sn(e,s={}){let{document:n}=e,t=n.brand?.timeZone,o=s.today??(()=>Ze(t)),m=new Map(e.edges.map(([h,r])=>[h,r])),u=new Map;for(let[h,r]of Object.entries(n.kinds)){let z=e.kinds[h]?.computed,R=ve(r.edges);u.set(h,{fields:new Set([...Object.keys(r.fields),...R.keys()]),edges:new Map(Object.entries(we(r.edges)).map(([j,$])=>[j,$.cardinality??"many"])),...z?{computed:new Map(z)}:{},...R.size>0?{linked:R}:{}})}e.facts&&u.set(an,{computed:new Map(e.facts)});let b=fn(n),L=new Map,F=Object.entries(n.kinds).map(([h,r])=>{let z={};for(let[i,g]of Object.entries(r.fields))z[i]=bn(g,!g.required,b),g.repeats&&(z[He(i)]=ne(Ue()));for(let[i,g]of ve(r.edges))z[i]=ne(mn(g));let{label:R,describe:j,durations:$}=e.kinds[h]??{},P=Object.entries(r.computed??{}).map(([i,g])=>[i,typeof g=="string"?{expr:g}:g]),J=Object.hasOwn(r.fields,"label")&&!r.fields.label.label&&!/\{\s*label\b/.test(r.label??`{${kn(r)??""}}`),_=Object.fromEntries([...J?[["label","Label"]]:[],...Object.entries(r.fields).filter(([,i])=>i.label).map(([i,g])=>[i,g.label]),...P.filter(([,i])=>i.label).map(([i,g])=>[i,g.label])]),A=Object.keys(_).length>0,l=Object.fromEntries(Object.entries(r.fields).filter(([,i])=>i.default!==void 0).map(([i,g])=>[i,g.default]));L.set(h,l);let D=Object.fromEntries(Object.entries(we(r.edges)).map(([i,{renamedFrom:g,...I}])=>[i,I])),S=i=>r[i]?{[i]:r[i]}:{};return Ke(h,{fields:he(z),edges:D,...S("plural"),...S("noun"),...S("description"),...R?{label:i=>ie(R,{node:i,kinds:u,today:o(),money:b})||i.id}:{},...j?{describe:i=>ie(j,{node:i,kinds:u,today:o(),money:b})}:{},...S("lifecycle"),...S("figure"),...S("fieldRoles"),...S("people"),archives:r.archives,...r.tidying?{tidying:r.tidying}:{},...P.length>0?{computed:Object.fromEntries(P.map(([i,g])=>[i,$?.includes(i)?{...g,as:"duration"}:r.computed[i]]))}:{},...A||r.glance||r.page?{display:{...A?{labels:_}:{},...r.glance?{glance:[...r.glance]}:{},...r.page?{page:r.page}:{}}}:{},...Object.keys(l).length>0?{defaults:l}:{}})}),B=We(F,n.computed);function T(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...L.get(h)}),W=[];for(let[h,r]of Object.entries(n.acts??{})){let z=e.acts[h],{title:R,effects:j,guard:$,refusal:P,destructive:J,idempotent:_,creates:A,connects:l,severs:D,writes:S,writesOther:i,sets:g}=z,I=new Map(z.args),se={};for(let[d,x]of I)se[d]=zn(x,b);let w=[r.on??[]].flat(),C=new Map(z.exprs),G=j.find(d=>"create"in d),Y=(d,x,f,v=null)=>{if(V(d)&&"expr"in d)return oe(C.get(d.expr),{graph:f,subject:v,kinds:u,bindings:x,today:o()});let k=me(d);return k===void 0?typeof d=="string"&&d.startsWith("$$")?d.slice(1):d:k==="now"?new Date().toISOString():k==="today"?o():x[k]},Ee=(d,x)=>{if(!G)return"";let f=n.kinds[G.create].fields,v=N(G.create),k=[];for(let[O,ee]of Object.entries(G.set??{})){try{v[O]=Y(ee,d,x)??v[O]}catch{}let Q=me(ee);Q&&d[Q]!==void 0&&k.push(O)}let Z=T(v).trim(),H=k.filter(O=>v[O]!==!1&&f[O].type!=="text"&&!(/[^]{41}/.test(v[O])||/ .*[.!?]$/.test(v[O])&&!/[ .][A-Z]\w{0,3}\.$/.test(v[O]))&&T({...v,[O]:void 0}).trim()===Z).map(O=>v[O]===!0?f[O].label??Ve(O):cn(v[O],f[O].format,o(),[],b));return Z&&H.length>0?`${Z} (${H.join(", ")})`:Z};W.push(Qe(h,{input:he(se),title:R,...r.description?{description:r.description}:{},...r.fromTheOtherEnd?{fromTheOtherEnd:r.fromTheOtherEnd}:{},...I.has(q)?{subject:{kinds:w.length>0?w:"*",arg:q}}:{},...J?{destructive:!0}:{},..._?{idempotent:!0}:{},...A.length>0?{creates:A}:{},...l.length>0?{connects:l}:{},...D.length>0?{severs:D}:{},writes:S,...Object.keys(i).length>0?{writesOther:i}:{},...Object.keys(g).length>0?{sets:g}:{},describe:(d,x)=>{let f=typeof d[q]=="string"?x.getNode(d[q]):void 0,v=f?T(f):Ee(d,x);return v?`${R}: ${v}`:R},apply(d,x){let f=d.graph,v=typeof x[q]=="string"?x[q]:void 0,k=v?f.getNode(v):void 0;if(v&&!k&&ae(v),k&&w.length>0&&!w.includes(k.kind))throw new U(`"${R}" acts on ${w.join(" or ")}, not on ${Ie(k.kind)}`,"invalid");let Z={};for(let[a,c]of Object.entries(x))c!==void 0&&(Z[a]=c);if($&&k){let a;try{a=oe($,{graph:f,subject:k,kinds:u,bindings:Z,today:o()})}catch(c){throw c instanceof re?new U(`"${R}" could not be judged: ${c.sentence}`):c}if(a!==!0)throw new U(P?ie(P,{node:k,kinds:u,graph:f,bindings:Z,today:o(),money:b}):`"${R}" is not allowed for ${T(k)} right now`)}let H=new Map,O=a=>f.has(a)||[...H.values()].includes(a),ee=new Set,Q=a=>{let c=Je(a);ee.has(c)||(ee.add(c),d.removeEdge(a))},X=(a,c)=>{let p=me(a);if(p==="subject")return v;if(p==="me"){let y=d.me;if(y&&n.kinds[f.getNode(y)?.kind]?.people)return y;throw new U(`"${R}" is done as you, and you have no record here`)}if(H.has(p))return H.get(p);try{return Y(a,Z,f,c??k??null)}catch(y){throw y instanceof re?new U(`"${R}" could not work out a value: ${y.sentence}`):y}};for(let a of j)if("create"in a){let c=n.kinds[a.create],p=N(a.create);for(let[ye,de]of Object.entries(a.set??{})){let je=X(de,void 0);je!==void 0&&(p[ye]=je)}let y=kn(c),E=d.freshId(String((y&&p[y])??a.create),a.create);d.addNode({...p,id:E}),a.as&&H.set(a.as,E)}else if("connect"in a||"sever"in a){let c="connect"in a?a.connect:a.sever,p=String(X(a.from,void 0)??""),y=String(X(a.to,void 0)??"");if(O(p)||ae(p),O(y)||ae(y),"connect"in a){if(m.get(c)?.cardinality==="one")for(let E of f.out(p,c))E.id!==y&&Q({kind:c,from:p,to:E.id});f.out(p,c).some(E=>E.id===y)||d.addEdge({kind:c,from:p,to:y})}else Q({kind:c,from:p,to:y})}else if("set"in a){let c=String(X(a.target??"$subject",void 0)??""),p=f.getNode(c);!p&&!O(c)&&ae(c);let y={};for(let[E,ye]of Object.entries(a.set)){let de=X(ye,p);de!==void 0&&(y[E]=de)}Object.keys(y).length>0&&d.patchNode(c,y)}else if("remove"in a){let c=String(X(a.remove,void 0)??"");f.has(c)||ae(c),d.removeNode(c)}else if("replace"in a&&k){let c=x.to;for(let p of a.replace){let y=m.get(p)?.from.includes(k.kind)??!0;for(let E of y?f.out(k.id,p):f.in(k.id,p))p===a.keep&&E.id===c||Q(y?{kind:p,from:k.id,to:E.id}:{kind:p,from:E.id,to:k.id})}}}}))}let Ae=[];for(let[h,r]of Object.entries(n.rules??{})){let{title:z,require:R,when:j,says:$}=e.rules[h],P=r.repairs??[],J=(A,l,D=o(),S)=>{let i=[],g={graph:A,subject:l,kinds:u,today:D,...S?{linked:S}:{},onUnread:w=>i.push(w)},I;try{if(j&&oe(j,g)!==!0)return[];if(I=oe(R,g)===!0,!I&&i.length>0)throw new re(`it reads ${on(i[0])}`,0)}catch(w){throw w instanceof sn?new Ye(w.sentence):w instanceof re?new Error(w.sentence):w}if(I)return[];let se=P.flatMap(w=>{let C=n.acts?.[w.act],G={},Y=l&&C?.on&&C.fromTheOtherEnd&&![C.on].flat().includes(l.kind)?Rn(e.acts[w.act].args,l.kind):void 0;Y?G[Y]=l.id:l&&(C?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(w.act))&&(G[q]=l.id);for(let[x,f]of Object.entries(w.args??{}))G[x]=me(f)==="subject"?l?.id:f;let d=(C?e.acts[w.act].args:[]).filter(([x,f])=>f.required&&G[x]===void 0).map(([x])=>x);return[{mutation:w.act,label:w.label??(Y?C.fromTheOtherEnd:C?.title)??w.act.replace(/-/g," "),args:G,...d.length>0?{missing:d}:{}}]});return[{invariant:h,...l?{subjectId:l.id}:{},label:z,message:$?ie($,{node:l,kinds:u,graph:A,today:D,money:b}):l?`${T(l)}: ${z}`:z,nodeIds:l?[l.id]:[],repairs:se}]},_={label:z,shape:{over:r.over,require:R,when:j,says:$,declared:n.kinds,money:b,kinds:u,today:o},judgment:{require:r.require,...r.when?{when:r.when}:{},...r.says?{says:r.says}:{}},...r.description?{description:r.description}:{},...P.length>0?{repairs:P.map(A=>A.act)}:{}};Ae.push(r.over==="graph"?xe(h,{scope:"graph",..._,evaluate:({graph:A,today:l,context:D})=>J(A,null,l,D?.linked)}):xe(h,{scope:{kind:r.over},..._,evaluate:({graph:A,subject:l,today:D,context:S})=>J(A,l,D,S?.linked)}))}let Se=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:W,invariants:Ae,...Se?{policy:Se}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...n.publishing?{publishing:n.publishing}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return gn(ge,n),An.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:u}}export{yn as a,Gn as b,hn as c,q as d,me as e,kn as f,it as g,Sn as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Xa as g}from"./chunk.
|
|
1
|
+
import{Xa as g}from"./chunk.6W2DUW5S.js";function y(e){return[`based on \u201C${e.basis}\u201D`,...e.confidence!==void 0?[`${Math.round(e.confidence*100)}% sure`]:[],...e.model?[e.model]:[]].join(" \xB7 ")}var u=e=>`Not yet kept by a person. ${e.by.name??e.by.id??"Something"} made it${e.lineage?`, ${y(e.lineage)}`:""}.`,p=e=>`${e.kind}\0${e.from}\0${e.to}`;function k(e,o){let r=new Map;for(let n of e){if(n.undoes!==void 0||o.has(n.id)||n.withheld)continue;let l=g(n.author),s=l==="human"||l==="visitor",c=new Map;for(let t of n.primitives){if(t.op!=="add-edge"&&t.op!=="remove-edge")continue;let i=p(t.edge),a=r.get(i)??c.get(i);if(r.delete(i),t.op==="remove-edge")a&&c.set(i,a);else if(a&&(s||!n.lineage))r.set(i,s?{...a,provisional:!1,keptBy:n.id}:a);else{let d=n.lineage;r.set(i,{edge:t.edge,made:n.id,by:n.author,...d?{lineage:d}:{},provisional:!s&&(d?.confidence??1)<1})}}}return r}var f=new WeakMap;function v({log:e}){let o=e.all(),r=`${e.horizon}:${o.length}:${o.at(-1)?.id}`,n=f.get(e);return n?.at!==r&&f.set(e,n={at:r,links:k(o,e.undoneIds())}),n.links}var L=(e,o)=>v(e).get(p(o));var m=e=>[...v(e).values()].filter(o=>o.provisional);export{y as a,u as b,L as c,m as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk.G6DISMVT.js";import"./chunk.W54NXXC5.js";import{G as W,T as x}from"./chunk.B3T4N2XM.js";import"./chunk.SDO3U72B.js";import"./chunk.6W2DUW5S.js";import"./chunk.SLBWPVIY.js";import{b as D}from"./chunk.AJZBJBMO.js";var g=D(W(),1);var o=D(x(),1),v=864e5,l=t=>Date.UTC(+t.slice(0,4),+t.slice(5,7)-1,+t.slice(8,10)),I=t=>new Date(t).toISOString().slice(0,10),s=(t,i)=>I(l(t)+i*v),m=(t,i)=>{let a=new Date(l(t)),u=a.getUTCMonth()+i,d=Date.UTC(a.getUTCFullYear(),u,1),w=new Date(Date.UTC(a.getUTCFullYear(),u+1,0)).getUTCDate();return I(d+(Math.min(a.getUTCDate(),w)-1)*v)};function p(t,i,a){try{return new Intl.DateTimeFormat(t??"en-US",{...i,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en-US",{...i,timeZone:"UTC"}).format(a)}}function F(t){try{let i=new Intl.Locale(t??"en-US"),a=i.getWeekInfo?.().firstDay??i.weekInfo?.firstDay;if(a!==void 0)return a%7}catch{return 0}return/^en-US|^en$|-(US|CA|JP|BR|IL|MX|PH)$/.test(t??"en-US")?0:1}function L({id:t,label:i,selected:a,today:u,locale:d,onPick:w,onClose:T}){let[r,f]=(0,g.useState)(a??u),U=(0,g.useRef)(null),y=F(d),b=`${r.slice(0,7)}-01`,M=(new Date(l(b)).getUTCDay()-y+7)%7,P=s(b,-M),A=Array.from({length:6},(e,n)=>Array.from({length:7},(S,c)=>s(P,n*7+c))),$=p(d,{month:"long",year:"numeric"},l(b)),h=(0,g.useRef)(!0);(0,g.useEffect)(()=>{h.current&&U.current?.querySelector(`[data-day="${r}"]`)?.focus(),h.current=!1},[r]);let E=e=>{let n={ArrowLeft:()=>s(r,-1),ArrowRight:()=>s(r,1),ArrowUp:()=>s(r,-7),ArrowDown:()=>s(r,7),PageUp:()=>m(r,e.shiftKey?-12:-1),PageDown:()=>m(r,e.shiftKey?12:1),Home:()=>s(r,-((new Date(l(r)).getUTCDay()-y+7)%7)),End:()=>s(r,6-(new Date(l(r)).getUTCDay()-y+7)%7)};n[e.key]?(e.preventDefault(),h.current=!0,f(n[e.key]())):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},R=Array.from({length:7},(e,n)=>l("1970-01-04")+(y+n)%7*v),C={minWidth:32,minHeight:32,padding:"0 8px",borderRadius:6};return(0,o.jsxs)("div",{id:t,role:"group","aria-label":`Pick a date for ${i}`,"data-graview-part":"when-month",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},style:{flexBasis:"100%",width:"min(100%, 20rem)",boxSizing:"border-box",padding:8,border:"1px solid var(--graview-edge)",borderRadius:8,background:"var(--graview-panel)",color:"var(--graview-ink)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:6},children:[(0,o.jsx)("button",{type:"button","aria-label":"Previous month",onClick:()=>f(m(r,-1)),style:C,children:"\u2039"}),(0,o.jsx)("span",{id:`${t}-title`,"aria-live":"polite",style:{fontWeight:600,fontSize:"0.875rem"},children:$}),(0,o.jsx)("button",{type:"button","aria-label":"Next month",onClick:()=>f(m(r,1)),style:C,children:"\u203A"})]}),(0,o.jsxs)("table",{ref:U,role:"grid","aria-labelledby":`${t}-title`,onKeyDown:E,style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed",fontSize:"0.8125rem"},children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:R.map(e=>(0,o.jsx)("th",{scope:"col",abbr:p(d,{weekday:"long"},e),style:{fontWeight:500,color:"var(--graview-ink-faint)",padding:"2px 0"},children:p(d,{weekday:"narrow"},e)},e))})}),(0,o.jsx)("tbody",{children:A.map(e=>(0,o.jsx)("tr",{children:e.map(n=>{let S=n.slice(0,7)===b.slice(0,7),c=n===a,k=n===u;return(0,o.jsx)("td",{role:"gridcell","aria-selected":c||void 0,style:{padding:1,textAlign:"center"},children:(0,o.jsx)("button",{type:"button","data-day":n,tabIndex:n===r?0:-1,"aria-label":`${p(d,{weekday:"long",year:"numeric",month:"long",day:"numeric"},l(n))}${k?", today":""}${c?", selected":""}`,...k?{"aria-current":"date"}:{},onClick:()=>w(n),onFocus:()=>n!==r&&f(n),style:{width:"100%",minHeight:36,padding:0,borderRadius:6,border:k?"1px solid var(--graview-accent)":"1px solid transparent",background:c?"var(--graview-accent)":"transparent",color:c?"var(--graview-accent-ink)":S?"var(--graview-ink)":"var(--graview-ink-faint)",fontWeight:c?600:400},children:Number(n.slice(8,10))})},n)})},e[0]))})]})]})}export{L as WhenMonth};
|