graview 0.1.71 → 0.1.72

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.
Files changed (212) hide show
  1. package/dist/preview/chunk.2IOJNFCR.js +1 -0
  2. package/dist/preview/{chunk.5EQRIZ6I.js → chunk.2Q4ZXP7P.js} +1 -1
  3. package/dist/preview/{chunk.MEAUTBVM.js → chunk.2TTKQAWQ.js} +1 -1
  4. package/dist/preview/{chunk.6BBUTKFC.js → chunk.2YSE3SQN.js} +3 -3
  5. package/dist/preview/{chunk.CGRX6SDE.js → chunk.2ZPR6FRI.js} +1 -1
  6. package/dist/preview/chunk.3BE4SHZD.js +1 -0
  7. package/dist/preview/{chunk.TSZ2S3VG.js → chunk.43HWCHBN.js} +1 -1
  8. package/dist/preview/{chunk.TQ3MNB6K.js → chunk.45OLF6BK.js} +1 -1
  9. package/dist/preview/{chunk.ZY3NAJDM.js → chunk.47QWCVZD.js} +1 -1
  10. package/dist/preview/{chunk.WU6D3SPL.js → chunk.4A7BRBEA.js} +1 -1
  11. package/dist/preview/chunk.4EPCI6VY.js +1 -0
  12. package/dist/preview/{chunk.UZKBFI52.js → chunk.4PB5UFUJ.js} +1 -1
  13. package/dist/preview/{chunk.MKJV3BM5.js → chunk.4TDYDIIM.js} +1 -1
  14. package/dist/preview/{chunk.HXRHEPPJ.js → chunk.4VX7GPFS.js} +1 -1
  15. package/dist/preview/{chunk.OUF2QFZL.js → chunk.523X2YEQ.js} +1 -1
  16. package/dist/preview/{chunk.KBJ3UUER.js → chunk.53GQQETN.js} +1 -1
  17. package/dist/preview/{chunk.DHO3QZYK.js → chunk.5MKZTHU2.js} +1 -1
  18. package/dist/preview/{chunk.F5O3HR7X.js → chunk.5ZT4R227.js} +1 -1
  19. package/dist/preview/{chunk.LHCGC3K6.js → chunk.65SI77M7.js} +1 -1
  20. package/dist/preview/chunk.6ESAFTWB.js +1 -0
  21. package/dist/preview/chunk.6GUIFP2A.js +1 -0
  22. package/dist/preview/{chunk.D6ODKMOV.js → chunk.6GZYKHEN.js} +1 -1
  23. package/dist/preview/{chunk.F7KVEWFH.js → chunk.6YKKZI4H.js} +1 -1
  24. package/dist/preview/{chunk.Z2BCOZDZ.js → chunk.73RMM4W7.js} +1 -1
  25. package/dist/preview/{chunk.4O64QV2Y.js → chunk.7DCBIMOI.js} +1 -1
  26. package/dist/preview/chunk.7JE3J7H4.js +1 -0
  27. package/dist/preview/{chunk.RDUGUC7R.js → chunk.7QGDWAHH.js} +1 -1
  28. package/dist/preview/{chunk.7PWLRRUS.js → chunk.7VCYVCYM.js} +2 -2
  29. package/dist/preview/{chunk.GFBE4VNT.js → chunk.A4TBVXHQ.js} +1 -1
  30. package/dist/preview/{chunk.LDWWUKKX.js → chunk.A6LJPXJ3.js} +1 -1
  31. package/dist/preview/chunk.AAPXF6NP.js +1 -0
  32. package/dist/preview/{chunk.UJ7RTNT4.js → chunk.APUICV5Z.js} +1 -1
  33. package/dist/preview/chunk.ASNVH2G4.js +25 -0
  34. package/dist/preview/{chunk.OKHXXIMN.js → chunk.CJHCUHVN.js} +1 -1
  35. package/dist/preview/chunk.CUEPNS3Z.js +1 -0
  36. package/dist/preview/{chunk.H33XWGAY.js → chunk.CUJRWBPX.js} +1 -1
  37. package/dist/preview/{chunk.4YZ2A6SJ.js → chunk.D5PW6YWF.js} +3 -3
  38. package/dist/preview/chunk.DCIYOZYP.js +1 -0
  39. package/dist/preview/{chunk.3CLTABGP.js → chunk.DEBW4FH6.js} +1 -1
  40. package/dist/preview/{chunk.UQZ2P6KD.js → chunk.DYPSFTRP.js} +1 -1
  41. package/dist/preview/{chunk.BWMPC7LK.js → chunk.E6QZUT4L.js} +1 -1
  42. package/dist/preview/{chunk.MEBKTW7H.js → chunk.E7QZZRAQ.js} +1 -1
  43. package/dist/preview/chunk.EHCMBAZO.js +3 -0
  44. package/dist/preview/chunk.EXTD5JWD.js +1 -0
  45. package/dist/preview/{chunk.S2BMI23H.js → chunk.EZF2T3XQ.js} +1 -1
  46. package/dist/preview/chunk.EZSST3IU.js +1 -0
  47. package/dist/preview/{chunk.7THS3DLZ.js → chunk.F2BZ4SC4.js} +1 -1
  48. package/dist/preview/chunk.F2I7ERGM.js +1 -0
  49. package/dist/preview/{chunk.VUDNQOOX.js → chunk.FCV3NX6L.js} +1 -1
  50. package/dist/preview/{chunk.QVBP4UZG.js → chunk.FFTBUXKX.js} +2 -2
  51. package/dist/preview/{chunk.7MDGPTYF.js → chunk.FILBI7XA.js} +1 -1
  52. package/dist/preview/{chunk.D4F6QX5L.js → chunk.FKSI5522.js} +1 -1
  53. package/dist/preview/{chunk.QNWGDG2Z.js → chunk.FQ2QUDZS.js} +1 -1
  54. package/dist/preview/{chunk.O5RPSUXV.js → chunk.G2ZDDO3C.js} +1 -1
  55. package/dist/preview/{chunk.IPKODEOZ.js → chunk.GAVEWSXU.js} +1 -1
  56. package/dist/preview/chunk.GH6QX7JR.js +87 -0
  57. package/dist/preview/chunk.GMHBAS45.js +1 -0
  58. package/dist/preview/{chunk.OYMN3IFX.js → chunk.GXK5PI7I.js} +1 -1
  59. package/dist/preview/{chunk.DDSAFU3B.js → chunk.GYP3EF6Z.js} +1 -1
  60. package/dist/preview/chunk.H2RVMT4Y.js +111 -0
  61. package/dist/preview/chunk.HCHGKI64.js +1 -0
  62. package/dist/preview/chunk.HE7SAJKZ.js +1 -0
  63. package/dist/preview/{chunk.JLNTE5CH.js → chunk.HIIYDKFC.js} +2 -2
  64. package/dist/preview/chunk.HPDUGKEF.js +32 -0
  65. package/dist/preview/{chunk.H4BPTMED.js → chunk.HQRPOGTS.js} +1 -1
  66. package/dist/preview/chunk.HUJLELZ3.js +1 -0
  67. package/dist/preview/chunk.HVRUHRXR.js +1 -0
  68. package/dist/preview/{chunk.QJJWAYHB.js → chunk.I46VNAMS.js} +1 -1
  69. package/dist/preview/{chunk.QK4QZVQG.js → chunk.ID4GOKT6.js} +1 -1
  70. package/dist/preview/{chunk.64K5ELSQ.js → chunk.IZKCTF2R.js} +1 -1
  71. package/dist/preview/{chunk.4HU2ILFY.js → chunk.IZUAZ6EV.js} +1 -1
  72. package/dist/preview/{chunk.5PQV7GFE.js → chunk.J3CUBMUZ.js} +1 -1
  73. package/dist/preview/{chunk.P43LPXXJ.js → chunk.J4D4BIB4.js} +1 -1
  74. package/dist/preview/{chunk.NI4OPHTL.js → chunk.J7GH2CGV.js} +1 -1
  75. package/dist/preview/{chunk.5WCSQFS5.js → chunk.JE4RBRKH.js} +1 -1
  76. package/dist/preview/{chunk.ARGEGV5T.js → chunk.JJSZLCNU.js} +1 -1
  77. package/dist/preview/{chunk.WS5ORRGS.js → chunk.JKX4J3KG.js} +1 -1
  78. package/dist/preview/{chunk.ZONRIOIA.js → chunk.JMXBMLKH.js} +1 -1
  79. package/dist/preview/{chunk.6ZRVVRDQ.js → chunk.JOB3EKS6.js} +1 -1
  80. package/dist/preview/{chunk.PQTXM4VY.js → chunk.JP33TNCH.js} +1 -1
  81. package/dist/preview/{chunk.Z3TK2LJM.js → chunk.K6EN2YR4.js} +1 -1
  82. package/dist/preview/chunk.K6YKXTKC.js +1 -0
  83. package/dist/preview/{chunk.VPFUOTY7.js → chunk.KAIZDIRK.js} +1 -1
  84. package/dist/preview/{chunk.KZUHXOZU.js → chunk.KAQGSLC6.js} +3 -3
  85. package/dist/preview/{chunk.WGH2P2YL.js → chunk.KFYSKZC4.js} +1 -1
  86. package/dist/preview/chunk.KHVW6Q3T.js +1 -0
  87. package/dist/preview/chunk.KMFH26SS.js +1 -0
  88. package/dist/preview/{chunk.67S2UWBT.js → chunk.L3ST2YKI.js} +1 -1
  89. package/dist/preview/{chunk.V5JB5UJS.js → chunk.L6BLZJ6K.js} +1 -1
  90. package/dist/preview/{chunk.MQNW3O67.js → chunk.LG2BQ5LB.js} +1 -1
  91. package/dist/preview/{chunk.T6KOL7TW.js → chunk.LLYHHG67.js} +1 -1
  92. package/dist/preview/{chunk.MWWNKM3I.js → chunk.LPWANRBL.js} +1 -1
  93. package/dist/preview/{chunk.EJC7ACZT.js → chunk.LSS64NAA.js} +1 -1
  94. package/dist/preview/{chunk.NH3VXTGX.js → chunk.MFNWHXGL.js} +1 -1
  95. package/dist/preview/{chunk.DG3YNOH3.js → chunk.MNH3WUAB.js} +1 -1
  96. package/dist/preview/chunk.MQ7AB5N4.js +1 -0
  97. package/dist/preview/{chunk.KJPLX72N.js → chunk.MU5JK5TK.js} +1 -1
  98. package/dist/preview/{chunk.L6P55HFW.js → chunk.N5CACZ5F.js} +1 -1
  99. package/dist/preview/{chunk.W3TJF4EH.js → chunk.NFC2TYA6.js} +1 -1
  100. package/dist/preview/{chunk.VL3YDD7D.js → chunk.NKRDVOLJ.js} +1 -1
  101. package/dist/preview/{chunk.SGYZM6ZU.js → chunk.NNK2E2EP.js} +1 -1
  102. package/dist/preview/{chunk.W332P5T3.js → chunk.NVPKYWMF.js} +1 -1
  103. package/dist/preview/{chunk.EEGVI266.js → chunk.NWJ7ELHN.js} +1 -1
  104. package/dist/preview/{chunk.7KX36ENH.js → chunk.O5P6LXHF.js} +1 -1
  105. package/dist/preview/{chunk.DX7RGK5G.js → chunk.OFK6673S.js} +1 -1
  106. package/dist/preview/{chunk.HPFEYMGP.js → chunk.OG6FEP3K.js} +1 -1
  107. package/dist/preview/{chunk.EA2KYBBR.js → chunk.OHGAZ3D5.js} +1 -1
  108. package/dist/preview/{chunk.SPJ34VHA.js → chunk.ONVYKLRX.js} +1 -1
  109. package/dist/preview/chunk.OQ3FKUP2.js +1 -0
  110. package/dist/preview/chunk.OUJV4CYS.js +1 -0
  111. package/dist/preview/{chunk.CVN2XFMF.js → chunk.OWHH7JDV.js} +1 -1
  112. package/dist/preview/{chunk.G767NLBH.js → chunk.OXDCGGZV.js} +1 -1
  113. package/dist/preview/{chunk.VVIQSFM4.js → chunk.P3Z4ZCL3.js} +1 -1
  114. package/dist/preview/{chunk.FNSVGSZI.js → chunk.PF7XQ5R5.js} +1 -1
  115. package/dist/preview/chunk.PH547SON.js +1 -0
  116. package/dist/preview/{chunk.N3MXLORL.js → chunk.PS765ODQ.js} +1 -1
  117. package/dist/preview/{chunk.NXHEOHRR.js → chunk.PVAYYFT2.js} +1 -1
  118. package/dist/preview/{chunk.Z22C2JJ4.js → chunk.Q6WOIE5I.js} +1 -1
  119. package/dist/preview/{chunk.CEJIH3CN.js → chunk.QE257AXE.js} +1 -1
  120. package/dist/preview/chunk.QKNC5OUC.js +1 -0
  121. package/dist/preview/{chunk.W6L2VAJG.js → chunk.QMGBAKX6.js} +1 -1
  122. package/dist/preview/{chunk.DJGZOPAS.js → chunk.QNFX5VHW.js} +1 -1
  123. package/dist/preview/chunk.QPCDAQTW.js +1 -0
  124. package/dist/preview/{chunk.Y5WQD6KV.js → chunk.QPTQIGLX.js} +1 -1
  125. package/dist/preview/{chunk.IXYG65TM.js → chunk.R5YGW5ZX.js} +1 -1
  126. package/dist/preview/{chunk.7FI75ZVE.js → chunk.RJ6KEVZC.js} +1 -1
  127. package/dist/preview/{chunk.OVSKPBPS.js → chunk.RKVMRP7B.js} +1 -1
  128. package/dist/preview/{chunk.7TACFS7Q.js → chunk.S7U2CHHG.js} +1 -1
  129. package/dist/preview/{chunk.HT35PAHI.js → chunk.SD2UYSV6.js} +2 -2
  130. package/dist/preview/{chunk.LQ5J6YQW.js → chunk.SI5GGFQR.js} +1 -1
  131. package/dist/preview/{chunk.U5KJQFAP.js → chunk.SMF5S4DQ.js} +1 -1
  132. package/dist/preview/{chunk.RO3D2RNP.js → chunk.SNDFIJVX.js} +1 -1
  133. package/dist/preview/{chunk.CEOQY5KS.js → chunk.STHWM422.js} +2 -2
  134. package/dist/preview/{chunk.X7U3JMBR.js → chunk.SV75TRCH.js} +1 -1
  135. package/dist/preview/{chunk.Q6GEPVQ7.js → chunk.SXGPRFA4.js} +1 -1
  136. package/dist/preview/{chunk.6TBQV3NO.js → chunk.T3RFZ66S.js} +1 -1
  137. package/dist/preview/{chunk.VGYG2IBZ.js → chunk.T6ISUVUP.js} +1 -1
  138. package/dist/preview/{chunk.L3MLGFIS.js → chunk.TBLOBXZ2.js} +1 -1
  139. package/dist/preview/{chunk.MT252WP4.js → chunk.TDWJU6GW.js} +1 -1
  140. package/dist/preview/{chunk.EPSYX2SF.js → chunk.THLT6NVO.js} +1 -1
  141. package/dist/preview/{chunk.W5O5F4FT.js → chunk.TQCVEKPH.js} +1 -1
  142. package/dist/preview/{chunk.4ZEHLUXV.js → chunk.TQF5XCUS.js} +1 -1
  143. package/dist/preview/{chunk.VICBF3MQ.js → chunk.TWXYI5AP.js} +1 -1
  144. package/dist/preview/{chunk.LNKY6MT4.js → chunk.UOUQZYVD.js} +1 -1
  145. package/dist/preview/{chunk.FIUPDGUZ.js → chunk.UPL3D3ZO.js} +1 -1
  146. package/dist/preview/{chunk.GFOZVQBQ.js → chunk.UXW43HNW.js} +1 -1
  147. package/dist/preview/{chunk.MM7MLBGB.js → chunk.V4GSVXSV.js} +1 -1
  148. package/dist/preview/chunk.VCEDSOAK.js +1 -0
  149. package/dist/preview/{chunk.3RRK6UTN.js → chunk.VE4AQFLW.js} +1 -1
  150. package/dist/preview/{chunk.QDDDKEBH.js → chunk.VGQDPEB5.js} +1 -1
  151. package/dist/preview/{chunk.XTHSPLZZ.js → chunk.VMYXBFPE.js} +1 -1
  152. package/dist/preview/{chunk.EHLV3LND.js → chunk.VNI6HZEF.js} +2 -2
  153. package/dist/preview/chunk.VQRY2NQ6.js +1 -0
  154. package/dist/preview/{chunk.MFMC35ET.js → chunk.VUE6ILQV.js} +1 -1
  155. package/dist/preview/{chunk.BSWR5SGX.js → chunk.W2VSEEKX.js} +1 -1
  156. package/dist/preview/{chunk.4QMAYVPU.js → chunk.WAPY4RCS.js} +1 -1
  157. package/dist/preview/chunk.WFRSGGU5.js +1 -0
  158. package/dist/preview/{chunk.QKRQPUCE.js → chunk.WIVNFOQR.js} +1 -1
  159. package/dist/preview/chunk.WRIBFLVG.js +1 -0
  160. package/dist/preview/{chunk.RHIP2UYE.js → chunk.WWD2TS47.js} +1 -1
  161. package/dist/preview/{chunk.7XGU6KVF.js → chunk.WWFOQDPR.js} +2 -2
  162. package/dist/preview/{chunk.JNK5WBSU.js → chunk.X5MCAUFX.js} +1 -1
  163. package/dist/preview/{chunk.G5AF5IXL.js → chunk.XBWFQ54R.js} +1 -1
  164. package/dist/preview/{chunk.7LPHWJB4.js → chunk.XMBGT6UT.js} +1 -1
  165. package/dist/preview/{chunk.FOHZPYUV.js → chunk.XP4IVKKR.js} +1 -1
  166. package/dist/preview/chunk.XYBWBMNU.js +1 -0
  167. package/dist/preview/{chunk.OPMGQS5J.js → chunk.YC2IDHQX.js} +1 -1
  168. package/dist/preview/{chunk.JAPTTM6Y.js → chunk.YCYJHPWS.js} +1 -1
  169. package/dist/preview/{chunk.T6UJEXFL.js → chunk.YF5GCOSZ.js} +1 -1
  170. package/dist/preview/{chunk.VDFQFLTU.js → chunk.YGGBGHZU.js} +1 -1
  171. package/dist/preview/{chunk.U6V4KZF5.js → chunk.YRC6PKXP.js} +1 -1
  172. package/dist/preview/{chunk.EJIQDMLU.js → chunk.YRN67Z5K.js} +1 -1
  173. package/dist/preview/{chunk.6L6RUOSF.js → chunk.ZDUKVXBI.js} +1 -1
  174. package/dist/preview/index.html +55 -55
  175. package/dist/preview/page.js +2 -2
  176. package/package.json +6 -6
  177. package/dist/preview/chunk.23DATB5Y.js +0 -1
  178. package/dist/preview/chunk.2INDKSJI.js +0 -1
  179. package/dist/preview/chunk.45HUV56Z.js +0 -1
  180. package/dist/preview/chunk.4LWWXIM4.js +0 -1
  181. package/dist/preview/chunk.4UDST6IF.js +0 -1
  182. package/dist/preview/chunk.6A3KTD66.js +0 -1
  183. package/dist/preview/chunk.6IMRCKB4.js +0 -1
  184. package/dist/preview/chunk.7ZLCA3WK.js +0 -1
  185. package/dist/preview/chunk.CPK6CYKN.js +0 -111
  186. package/dist/preview/chunk.DGYWNM5U.js +0 -1
  187. package/dist/preview/chunk.EOSN5DWW.js +0 -1
  188. package/dist/preview/chunk.EUXAIG73.js +0 -1
  189. package/dist/preview/chunk.EZQK23AB.js +0 -1
  190. package/dist/preview/chunk.F6MY6WJ4.js +0 -1
  191. package/dist/preview/chunk.FW6M6GIU.js +0 -32
  192. package/dist/preview/chunk.GKYJQE5A.js +0 -1
  193. package/dist/preview/chunk.HLKDYI6J.js +0 -1
  194. package/dist/preview/chunk.IZDB777E.js +0 -1
  195. package/dist/preview/chunk.JCKIJSW7.js +0 -25
  196. package/dist/preview/chunk.JREA2XDG.js +0 -1
  197. package/dist/preview/chunk.MJ4T6YXI.js +0 -1
  198. package/dist/preview/chunk.ML4X7VVK.js +0 -1
  199. package/dist/preview/chunk.NNGG7RCO.js +0 -1
  200. package/dist/preview/chunk.OOQG2AEF.js +0 -1
  201. package/dist/preview/chunk.RJ7VSWTA.js +0 -87
  202. package/dist/preview/chunk.RSMCTI2N.js +0 -1
  203. package/dist/preview/chunk.TBEKEHFS.js +0 -1
  204. package/dist/preview/chunk.TO3ZKCA2.js +0 -1
  205. package/dist/preview/chunk.TTM5GQ2U.js +0 -1
  206. package/dist/preview/chunk.TUBY6SV3.js +0 -1
  207. package/dist/preview/chunk.UJPX3BUV.js +0 -1
  208. package/dist/preview/chunk.X2UYEA7H.js +0 -1
  209. package/dist/preview/chunk.XSM4OTF4.js +0 -1
  210. package/dist/preview/chunk.YXVUJ3NB.js +0 -1
  211. package/dist/preview/chunk.ZGLOXN7O.js +0 -1
  212. package/dist/preview/chunk.ZLQIGZXO.js +0 -3
@@ -0,0 +1 @@
1
+ import{a as K,c as R,d as S}from"./chunk.AAPXF6NP.js";import{a as N}from"./chunk.QDVGHI7R.js";import{L as M,P as O,S as V,gb as W,hb as G,jb as I}from"./chunk.ZDUKVXBI.js";function E(e,t,n){let s=e.schema.tryDefinition(t)?.fields?.shape?.[n];return s===void 0?void 0:N(s)}function Z(e,t){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=[],i=new Set(t.schema.kinds);for(let s of e){let{kind:d,field:o}=s??{};typeof d!="string"||typeof o!="string"?n.push(`Each of the view's accepts is { "kind": <a kind>, "field": <its image, video or file field> }.`):i.has(d)?E(t,d,o)?t.allMutations().some(a=>(a.creates??[]).includes(d)&&Object.hasOwn(a.input?.shape??{},o))||n.push(`No act of this app makes a "${d}" with its "${o}", so a file dropped could become nothing.`):n.push(`The view accepts files into ${d}'s "${o}", which holds no picture, video or file.`):n.push(`The view accepts files for "${d}", which is no kind of this app.`)}return n}function _(e,t,n){if(e===void 0||e===!0)return[];let i=`The view's pictures is true; the kinds whose pictures it draws, ["circuit"]; or { "width": <the widest it draws a picture, in pixels> } with the fields it draws them from, by kind, { "circuit": "photo" }.`;if(typeof e!="object"||e===null)return[i];let s=new Set([...n.attach==="home"?[]:[n.attach],...n.reads?.kinds??[]]),d=new Set(t.schema.kinds),o=[],a=c=>{if(!d.has(c))return void o.push(`The view's pictures chooses "${c}", which is no kind of this app.`);s.has(c)||o.push(`The view's pictures chooses "${c}", whose records it is not handed: add "${c}" to its reads.kinds.`)};if(Array.isArray(e)){if(e.length===0||!e.every(c=>typeof c=="string"))return[i];for(let c of e)a(c);return o}for(let[c,l]of Object.entries(e)){if(c==="records"&&typeof l!="string"&&!Array.isArray(l)){let{subject:u,ids:p,...k}=typeof l=="object"&&l!==null?l:{rest:!0},g=p===void 0||Array.isArray(p)&&p.length>0&&p.length<=200&&p.every(m=>typeof m=="string"&&m.length>0&&m.length<=200);Object.keys(k).length>0||u!==void 0&&u!==!0||!g||u===void 0&&p===void 0?o.push(`The view's pictures records is { "subject": true } \u2014 the record it is drawn over and the records linked to it by an edge it reads \u2014 and/or { "ids": [<1 to 200 record ids>] } (view-pictures-records).`):u===!0&&(n.attach==="home"||n.cardinality!=="one")&&o.push(`The view's pictures records { "subject": true } is the record a view of one is drawn over and the records linked to it: a view of many, or the home, is drawn over no one record, so list the records by "ids", or cap its pictures with "most" (view-pictures-records).`);continue}if(c==="most"&&typeof l!="string"&&!Array.isArray(l)){Number.isInteger(l)&&l>=1&&l<=500||o.push("The view's pictures most is a whole number from 1 to 500: the most pictures it is handed, in the order its records are handed (view-pictures-most).");continue}if(c==="width"&&typeof l!="string"&&!Array.isArray(l)){Number.isInteger(l)&&l>=16&&l<=4096||o.push("The view's pictures width is a whole number of pixels from 16 to 4096.");continue}let w=typeof l=="string"?[l]:Array.isArray(l)&&l.length>0&&l.every(u=>typeof u=="string")?l:void 0;if(!w){o.push(`The view's pictures says "${c}": beside "width", it names a kind and the field it draws pictures from, "circuit": "photo", or its fields, "circuit": ["photo", "map"].`);continue}let y=o.length;if(a(c),!(o.length>y))for(let u of w){let p=E(t,c,u);p?p.as==="video"&&o.push(`The view's pictures chooses ${c}'s "${u}", which holds videos: the host plays a video where the view places it, and hands no picture of it.`):o.push(`The view's pictures chooses ${c}'s "${u}", which holds no picture.`)}}return o}function B(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:t,...n}=e,i=[];return Object.keys(n).length>0&&i.push(`The view's scene says ${Object.keys(n).map(s=>`"${s}"`).join(", ")}: only "maxHeight" is read.`),t!==void 0&&!(Number.isInteger(t)&&t>=80&&t<=4e3)&&i.push("The view's scene maxHeight is a whole number of pixels from 80 to 4000."),i}function F(e){return(e.acts??[]).map(t=>typeof t=="string"?{act:t}:t)}function ee(e,t){let n=[],i=new Set(t.schema.kinds),s=new Set(t.schema.edgeKinds),d=new Set(t.allMutations().map(a=>a.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"&&!i.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"&&n.push(`The home's view is the home already: replaces "page" is for a view of a kind, of one record (its page) or of many (its list).`),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"&&e.bleed!=="full"&&n.push(`The view's bleed is "${String(e.bleed)}": it is true, "full", or left out.`),e.heading!==void 0&&(e.heading!=="own"||e.attach==="home"||(e.cardinality==="many"?e.title===void 0:e.replaces!=="page"))&&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 on a view of one record that replaces its page (replaces "page"), 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(...B(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(..._(e.pictures,t,e)),n.push(...Z(e.accepts,t));for(let a of e.reads?.kinds??[])i.has(a)||n.push(`The view reads "${a}", which is no kind of this app.`);for(let a of e.reads?.edges??[])s.has(a)||n.push(`The view reads the edge "${a}", which no kind of this app declares.`);let o=new Set;for(let a of F(e)){d.has(a.act)||n.push(`The view asks for the act "${a.act}", which this app does not declare.`);let c=a.as??a.act;o.has(c)&&n.push(`Two of the view's acts are called "${c}".`),o.add(c)}return n}function q(e,t,n){let i=[...new Set([...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]])];if(i.length<2)return[];let s=new Set(t.reads?.edges??[]),d=o=>new RegExp(`(["'\`])${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\1`).test(n);return e.schema.edgeKinds.filter(o=>{let a=e.schema.edge(o);return!s.has(o)&&a!==void 0&&a.from.some(c=>i.includes(c))&&(a.to==="*"||a.to.some(c=>i.includes(c)))&&d(o)})}function ne(e,t,n){let i=q(e,t,n);if(i.length===0)return;let s=(d,o)=>d.length<2?d[0]??"":`${d.slice(0,-1).join(", ")} ${o} ${d[d.length-1]}`;return`"${t.name}" names ${s(i,"and")} but does not read ${i.length>1?"them":"it"}, so the view is handed no such links: add ${s(i.map(d=>`"${d}"`),"and")} to its manifest's reads.edges.`}function J(e,t){let n=t.attach;return n==="home"||t.cardinality!=="one"||(t.reads?.kinds??[]).includes(n)?[]:(t.reads?.edges??[]).filter(i=>{let s=e.schema.edge(i);return s!==void 0&&s.from.includes(n)&&s.to!=="*"&&s.to.includes(n)})}function L(e,t){let n=new Set([...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]]),i=[];for(let s of t.reads?.edges??[]){let d=e.schema.edge(s);if(!d)continue;let o=d.from.some(l=>n.has(l))?[]:d.from,a=d.to==="*"||d.to.some(l=>n.has(l))?[]:d.to,c=[...new Set([...o,...a])];c.length>0?i.push({edge:s,kinds:c}):d.to==="*"&&t.attach!=="home"&&t.cardinality==="one"&&(t.reads?.kinds??[]).length===0&&i.push({edge:s,kinds:[]})}return i}function te(e,t){return L(e,t).map(({edge:n,kinds:i})=>{let s=e.schema.edge(n),d=`${s.from.join(" or ")} to ${s.to==="*"?"any kind":s.to.join(" or ")}`;return i.length===0?`"${t.name}" reads the relation "${n}", from ${d}, and is handed no other kind, so no link of it reaches the view: name the kinds it links to in its manifest's reads.kinds.`:`"${t.name}" reads the relation "${n}", from ${d}, and is handed no ${i.join(" or ")}, so no link of it reaches the view: add ${i.map(o=>`"${o}"`).join(" or ")} to its manifest's reads.kinds.`})}function ie(e,t){return[...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]].some(i=>Object.keys(e.schema.tryDefinition(i)?.computed??{}).length>0)}function se(e,t,n){let{manifest:i}=n,s=n.input??{},o=e.seenBy(t).graph,a=i.attach==="home"?void 0:i.attach,c=a&&i.cardinality==="one"&&s.node?o.getNode(s.node.id):void 0,l=c&&c.kind===a?[c]:[],w=a&&i.cardinality==="many"?s.nodes?s.nodes.flatMap(r=>{let h=o.getNode(r.id);return h&&h.kind===a?[h]:[]}):o.nodesOfKind(a):[],y=l[0],u=y?J(e,i).flatMap(r=>[...o.outEdges(y.id,r).map(h=>h.to),...o.inEdges(y.id,r).map(h=>h.from)].flatMap(h=>{let f=h===y.id?void 0:o.getNode(h);return f&&f.kind===a?[f]:[]})):[],p=new Set([...l,...w,...u].map(r=>r.id)),k=K(o,p,{kinds:(i.reads?.kinds??[]).filter(r=>r!==a||i.cardinality==="one"),edges:i.reads?.edges??[]}),g=new Map;for(let r of[...w,...u,...k.nodes])l.some(h=>h.id===r.id)||g.set(r.id,r);let m=new Set([...l.map(r=>r.id),...g.keys()]),H=[...k.edges],C=new Set(F(i).map(r=>r.act)),D=e.permittedMutations(t).filter(r=>C.has(r.name)).map(r=>({name:r.name,title:r.title??r.name,...r.description!==void 0?{description:r.description}:{},...r.subject?{subject:{kinds:r.subject.kinds,arg:r.subject.arg}}:{}})),x=r=>r?.filter(h=>m.has(h)),A=n.computed,T=r=>A?{...S(e,r),...A(o,r)}:S(e,r),j=W(t),v=G(t),$=!I(t)&&v!==void 0?o.getNode(v):void 0,b=$&&e.schema.tryDefinition($.kind)?.people?$:void 0,P=j?{...e.schema.definitions.some(r=>r.people)?{id:v}:{},name:j.name}:b?{id:b.id,name:S(e,b).label??b.id}:void 0;return{view:i.name,...l[0]?{node:T(l[0])}:{},nodes:[...g.values()].map(T),edges:H,...i.title!==void 0?{label:i.title}:s.label!==void 0?{label:s.label}:{},cardinality:i.cardinality,...s.fidelity!==void 0?{fidelity:s.fidelity}:{},...s.mode!==void 0?{mode:s.mode}:{},...s.selected!==void 0?{selected:s.selected}:{},...s.implicated?{implicated:x(s.implicated)}:{},...s.flagged?{flagged:x(s.flagged)}:{},acts:D,...P?{me:P}:{},...n.theme?{theme:n.theme}:{},locale:O(),timeZone:V(),today:e.today()??M(),...R(e.schema,[...l,...g.values()]),...n.places?{places:n.places.filter((r,h,f)=>f.findIndex(z=>z.as===r.as)===h).map(({as:r,title:h,kind:f})=>({as:r,title:h,kind:f}))}:{}}}export{E as a,F as b,ee as c,q as d,ne as e,J as f,L as g,te as h,ie as i,se as j};
@@ -1 +1 @@
1
- import{a as v,b as w,c as x}from"./chunk.MB7LKKUD.js";import"./chunk.RJ7VSWTA.js";import"./chunk.P43LPXXJ.js";import{G as R,Y as y,Ya as g,_a as h}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import{wb as b,zd as m}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as p}from"./chunk.AJZBJBMO.js";var c=p(R(),1);var r=p(y(),1);function W({notices:e,anchor:n,board:a,report:i}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="banner"),at:"top",anchor:n,board:a,report:i}),(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="toast"),at:"foot",anchor:n,board:a,report:i})]})}var E={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"},C={info:"i",good:"\u2713",warn:"!",bad:"!"};function k({notices:e,at:n,anchor:a,board:i,report:s}){let l=(0,c.useRef)(null),t=e.length>0;return(0,c.useLayoutEffect)(()=>{let o=l.current;if(!t||!o)return;if(typeof o.showPopover=="function"&&!g(o))try{o.showPopover()}catch{}let d=()=>(n==="top"?x:w)(o,a());d(),n==="foot"&&i.hold?.(()=>o.matches(":hover")||o.contains(document.activeElement));let N=h(o);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(v,d);let u=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return u?.observe(o),()=>{if(N(),u?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(v,d),o.isConnected&&g(o))try{o.hidePopover()}catch{}}},[t,n,a,i]),t?(0,r.jsx)("div",{ref:l,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:m("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:e.map(o=>(0,r.jsx)(O,{notice:o,board:i,report:s},o.id))}):null}var T=e=>e.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or "),H=e=>/^.*?[.!?](?=\s|$)/.exec(e.trim())?.[0]??e.trim(),L=e=>e.from==="framework"&&(e.tone==="bad"||e.tone==="warn");function O({notice:e,board:n,report:a}){let i=e.tone??"info",s=[...e.action?[e.action]:[],...e.actions??[]],l=()=>n.dismiss(e.id);return(0,r.jsxs)("div",{"data-testid":"notice","data-kind":e.kind,"data-tone":i,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:e.kind==="banner"?"8px 10px 8px 12px":"10px 12px 10px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,r.jsx)("span",{"aria-hidden":"true","data-testid":"notice-chip",style:{width:20,height:20,borderRadius:"var(--graview-radius-sm, 6px)",flex:"0 0 auto",display:"inline-grid",placeItems:"center",fontSize:"0.75rem",fontWeight:700,lineHeight:1,color:"var(--graview-ink)",background:`color-mix(in srgb, ${E[i]} 22%, transparent)`},children:C[i]}),(0,r.jsx)("span",{"data-testid":"notice-sentence",style:{flex:"1 1 16rem",minWidth:0},children:e.sentence}),s.length>0?(0,r.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:s.map((t,o)=>t.href!==void 0?(0,r.jsx)("a",{href:t.href,...t.target?{target:t.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{t.onSelect?.(),l()},style:{...f,...o===0?S:{}},children:t.label},t.label):(0,r.jsx)("button",{type:"button","data-testid":"notice-action",...t.keys?{"aria-keyshortcuts":t.keys,title:`${t.label} \u2014 ${T(t.keys)}`}:{},onClick:()=>{l(),t.onSelect?.()},style:{...f,...o===0?S:{}},children:t.label},t.label))}):null,a&&L(e)?(0,r.jsx)("button",{type:"button","data-testid":"notice-report","aria-label":`Report this: ${H(e.sentence)}`,onClick:()=>a.tell({message:e.sentence,...e.code?{code:e.code}:{},...a.where(),version:b}),style:f,children:"Report this"}):null,(0,r.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${e.sentence}`,title:"Dismiss",onClick:l,style:z,children:"\xD7"})]})}var f={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},S={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},z={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{W as NoticeStacks,H as firstSentenceOf,L as reportable};
1
+ import{a as v,b as w,c as x}from"./chunk.MB7LKKUD.js";import"./chunk.GH6QX7JR.js";import"./chunk.J4D4BIB4.js";import{G as R,_ as y,_a as g,ab as h}from"./chunk.ASNVH2G4.js";import"./chunk.SDO3U72B.js";import{wb as b,zd as m}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as p}from"./chunk.AJZBJBMO.js";var c=p(R(),1);var r=p(y(),1);function W({notices:e,anchor:n,board:a,report:i}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="banner"),at:"top",anchor:n,board:a,report:i}),(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="toast"),at:"foot",anchor:n,board:a,report:i})]})}var E={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"},C={info:"i",good:"\u2713",warn:"!",bad:"!"};function k({notices:e,at:n,anchor:a,board:i,report:s}){let l=(0,c.useRef)(null),t=e.length>0;return(0,c.useLayoutEffect)(()=>{let o=l.current;if(!t||!o)return;if(typeof o.showPopover=="function"&&!g(o))try{o.showPopover()}catch{}let d=()=>(n==="top"?x:w)(o,a());d(),n==="foot"&&i.hold?.(()=>o.matches(":hover")||o.contains(document.activeElement));let N=h(o);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(v,d);let u=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return u?.observe(o),()=>{if(N(),u?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(v,d),o.isConnected&&g(o))try{o.hidePopover()}catch{}}},[t,n,a,i]),t?(0,r.jsx)("div",{ref:l,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:m("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:e.map(o=>(0,r.jsx)(O,{notice:o,board:i,report:s},o.id))}):null}var T=e=>e.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or "),H=e=>/^.*?[.!?](?=\s|$)/.exec(e.trim())?.[0]??e.trim(),L=e=>e.from==="framework"&&(e.tone==="bad"||e.tone==="warn");function O({notice:e,board:n,report:a}){let i=e.tone??"info",s=[...e.action?[e.action]:[],...e.actions??[]],l=()=>n.dismiss(e.id);return(0,r.jsxs)("div",{"data-testid":"notice","data-kind":e.kind,"data-tone":i,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:e.kind==="banner"?"8px 10px 8px 12px":"10px 12px 10px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,r.jsx)("span",{"aria-hidden":"true","data-testid":"notice-chip",style:{width:20,height:20,borderRadius:"var(--graview-radius-sm, 6px)",flex:"0 0 auto",display:"inline-grid",placeItems:"center",fontSize:"0.75rem",fontWeight:700,lineHeight:1,color:"var(--graview-ink)",background:`color-mix(in srgb, ${E[i]} 22%, transparent)`},children:C[i]}),(0,r.jsx)("span",{"data-testid":"notice-sentence",style:{flex:"1 1 16rem",minWidth:0},children:e.sentence}),s.length>0?(0,r.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:s.map((t,o)=>t.href!==void 0?(0,r.jsx)("a",{href:t.href,...t.target?{target:t.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{t.onSelect?.(),l()},style:{...f,...o===0?S:{}},children:t.label},t.label):(0,r.jsx)("button",{type:"button","data-testid":"notice-action",...t.keys?{"aria-keyshortcuts":t.keys,title:`${t.label} \u2014 ${T(t.keys)}`}:{},onClick:()=>{l(),t.onSelect?.()},style:{...f,...o===0?S:{}},children:t.label},t.label))}):null,a&&L(e)?(0,r.jsx)("button",{type:"button","data-testid":"notice-report","aria-label":`Report this: ${H(e.sentence)}`,onClick:()=>a.tell({message:e.sentence,...e.code?{code:e.code}:{},...a.where(),version:b}),style:f,children:"Report this"}):null,(0,r.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${e.sentence}`,title:"Dismiss",onClick:l,style:z,children:"\xD7"})]})}var f={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},S={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},z={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{W as NoticeStacks,H as firstSentenceOf,L as reportable};
@@ -1 +1 @@
1
- import{a as B,b as ve}from"./chunk.OKHXXIMN.js";import{a as ye,c as he,d as be,f as we}from"./chunk.6IMRCKB4.js";import{b as S,c as fe,d as me}from"./chunk.6TBQV3NO.js";import{k as ce,l as ge}from"./chunk.MT252WP4.js";import{b as pe,k as q}from"./chunk.VVIQSFM4.js";import{b as de,e as ue}from"./chunk.TQ3MNB6K.js";import{G as Re,Y as se,h as ae,ha as le,u as ie}from"./chunk.JCKIJSW7.js";import{Oa as te,Za as re,_a as oe,ha as Z,ma as ee,va as ne}from"./chunk.6L6RUOSF.js";import{b as W}from"./chunk.AJZBJBMO.js";var l=W(Re(),1);var i=W(se(),1);function qe({affordance:n,onApply:a,onCancel:u,store:w}){let y=le(),s=w??y?.store,[x,_]=(0,l.useState)({}),[p,D]=(0,l.useState)(""),[I,F]=(0,l.useState)(G),[J,V]=(0,l.useState)(void 0),U=(0,l.useId)(),L=(0,l.useRef)(null),A=n.open.filter(e=>!(e.name in x)),o=A[0],v=s.allMutations().find(e=>e.name===n.mutation),P=(0,l.useMemo)(()=>De(v,s,n.args??{}),[v,s,n.args]),d=o?P[o.name]:void 0,E=ge(n.open.filter(e=>e.shape?.type==="date").map(e=>e.name)),Se=(()=>{if(!E||o?.name!==E.end||o.shape?.type!=="date")return;let e=x[E.start];if(typeof e!="string")return;let r=P[E.start];return ce(typeof r=="string"?r:void 0,e,typeof d=="string"?d:void 0,{time:o.shape.time===!0,instant:o.shape.instant===!0})})();(0,l.useEffect)(()=>{D(Se??ke(d,o?.shape)),F(Array.isArray(d)?d:G),V(d)},[o?.name]),(0,l.useEffect)(()=>{L.current?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[o?.name]),(0,l.useLayoutEffect)(()=>{let e=L.current,r=typeof document>"u"?null:document.activeElement,f=r instanceof HTMLElement&&r.getAttribute("data-affordance")===n.id;if(!e||r&&r!==document.body&&!e.contains(r)&&!f)return;let b=e.querySelector('[data-testid="ask-filter"], form input, [role=group] button:not([disabled])');b&&b!==r&&b.focus()},[o?.name]);let Y=ve({flow:"both",letters:!0});if(!o)return null;let h=e=>{let r=d!==void 0&&JSON.stringify(e)===JSON.stringify(d)?void 0:e,f={...x,[o.name]:r};if(n.open.filter(R=>!(R.name in f)).length===0){let R=a(Object.fromEntries(Object.entries(f).filter(([,M])=>M!==void 0)));R&&R.length>0&&_(Object.fromEntries(Object.entries(f).filter(([M])=>!R.includes(M))))}else _(f)},O=o.optional?(0,i.jsx)("button",{type:"button",onClick:()=>h(void 0),style:{fontSize:"0.8125rem"},children:"Skip"}):null,t=o.shape??{type:"unknown"},c=t.type==="number"?t.amount:void 0,g=Ee(o,t),m=q(s.schema,v,o.name),Q=te((v?.input?.shape??{})[o.name]),xe=oe((v?.input?.shape??{})[o.name]),N=re(o.name),Ae=typeof d=="boolean"?d?"yes":"no":d,[T,Oe]=(0,l.useState)(""),X=(0,l.useMemo)(()=>{let e=g.map(r=>s.graph.getNode(r)).filter(r=>r!==void 0);return pe(e,r=>s.schema.tryDefinition(r))},[g,s]),j=e=>{let r=Ce(s,t,e),f=t.type==="choice"||t.type==="several"&&t.of.type==="choice"?m.option(e):r,b=X.get(e);return b?`${f} \xB7 ${b}`:f},$=(0,l.useMemo)(()=>{let e=T.trim().toLowerCase();return e===""?g:g.filter(r=>j(r).toLowerCase().includes(e))},[g,T,s,t,X]),k=t.type==="several",H=t.type==="file"?t:t.type==="several"&&t.of.type==="file"?t.of:void 0,K=k&&g.length===0,C=o.kinds&&o.kinds.length>0&&!o.kinds.includes("*")?o.kinds.map(e=>Z(ne(s.schema.tryDefinition(e),e))).join(" or "):m.label,Ne=n.open.length>1?`${C} \xB7 ${n.open.length-A.length+1} of ${n.open.length}`:C;return(0,i.jsxs)("div",{ref:L,"data-graview-asking":n.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,padding:"5px 0 2px"},children:[n.open.length>1||g.length>0?(0,i.jsx)("span",{id:U,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:Ne}):null,g.length>z?(0,i.jsx)("input",{type:"search",value:T,onChange:e=>Oe(e.target.value),placeholder:`Filter ${g.length}\u2026`,"aria-label":`Filter ${C}`,"data-testid":"ask-filter",onKeyDown:e=>{if(e.key!=="ArrowDown"||e.metaKey||e.ctrlKey||e.altKey)return;let r=Y.ref.current?.querySelector(`[${B}][tabindex="0"]`);r&&(e.preventDefault(),r.focus())},style:{font:"inherit",fontSize:"0.8125rem",minWidth:0,padding:"3px 7px"}}):null,xe?(0,i.jsxs)("form",{style:{display:"grid",gap:4},onSubmit:e=>{e.preventDefault(),h(J??(d===void 0?void 0:null))},children:[(0,i.jsx)(be,{value:J,onChange:V,start:N?x[N]??P[N]:void 0,label:`${N?q(s.schema,v,N).label:m.label} repeats`,name:o.name}),(0,i.jsxs)("span",{style:{display:"flex",gap:4},children:[(0,i.jsx)("button",{type:"submit",style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]}):Q?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(he,{relation:Q,value:d,onChange:h,label:m.label}),O]}):H?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ye,{as:"control",value:d,onChange:h,several:k,image:H.image===!0,video:H.video===!0,label:m.label}),O]}):g.length>0?(0,i.jsxs)("div",{...Y,role:"group","aria-labelledby":U,style:{display:"flex",flexWrap:"wrap",gap:4},children:[$.slice(0,z).map(e=>{let r=k?I.includes(e):e===Ae;return(0,i.jsx)("button",{type:"button",[B]:"","aria-label":`${C}: ${j(e)}`,...k?{"aria-pressed":r}:r?{"aria-current":!0}:{},style:{padding:"3px 9px",fontSize:"0.8125rem",...r?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},onClick:()=>k?F(f=>f.includes(e)?f.filter(b=>b!==e):[...f,e]):h(t.type==="boolean"?e==="yes":e),children:j(e)},e)}),$.length>z?(0,i.jsxs)("span",{"data-testid":"ask-more",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[$.length-z," more \u2014 type to narrow"]}):null,$.length===0?(0,i.jsxs)("span",{"data-testid":"ask-none",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["None of the ",g.length," match that."]}):null,k?(0,i.jsx)("button",{type:"button",disabled:I.length===0,style:{fontSize:"0.8125rem"},onClick:()=>{let e=I;F(G),h(e)},children:A.length>1?"Next":"Apply"}):null,O]}):(0,i.jsxs)("form",{style:{display:"flex",flexWrap:"wrap",gap:4},onSubmit:e=>{if(e.preventDefault(),d!==void 0&&p===ke(d,t)){h(void 0);return}if(K){h(p.split(/[,\n]/).map(r=>r.trim()).filter(Boolean));return}if(p.trim().length!==0){if(c){let r=me(p,c);r!==void 0&&h(r);return}h(t.type==="number"?t.duration?ue(p)??p:Number(p):p)}},children:[t.type==="text"&&t.long?(0,i.jsx)("textarea",{autoFocus:!0,name:o.name,"aria-label":m.label,placeholder:m.label,value:p,rows:4,onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"?u():e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},style:{flex:"1 1 100%",minWidth:0,font:"inherit",fontSize:"0.875rem",lineHeight:1.45,padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",resize:"vertical",fieldSizing:"content",minHeight:"5.5em",maxHeight:"40vh"}}):t.type==="date"?(0,i.jsx)(we,{autoFocus:!0,name:o.name,label:m.label,value:p===""?void 0:p,time:t.time===!0,instant:t.instant===!0,partial:t.partial===!0,onChange:e=>D(e??""),onCancel:u,boxStyle:{fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):(0,i.jsx)("input",{autoFocus:!0,type:t.type==="number"&&!t.duration&&!c?"number":t.type==="text"&&t.holds==="phone"?"tel":"text",...c?{inputMode:"decimal","data-graview-amount":c.format??"unit"}:{},name:o.name,"aria-label":m.label,placeholder:K?`${m.label}, separated by commas`:c?`${m.label}, ${S(c).hint} \u2014 ${S(c).prefix??""}${S(c).placeholder}${S(c).suffix?` ${S(c).suffix}`:""}`:m.label,value:p,...t.type==="number"&&t.min!==void 0?{min:t.min}:{},...t.type==="number"&&t.max!==void 0?{max:t.max}:{},...t.type==="number"&&t.step!==void 0?{step:t.step}:{},onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"&&u()},style:{flex:1,minWidth:0,font:"inherit",fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}),(0,i.jsx)("button",{type:"submit",disabled:!K&&p.trim().length===0,style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]})}var G=[];function De(n,a,u){let w=n?.derived?.act==="edit"&&n.subject?u[n.subject.arg]:void 0,y=typeof w=="string"?a.graph.getNode(w):void 0;return y?Object.fromEntries((n.writes??[]).filter(s=>y[s]!==void 0&&y[s]!==null).map(s=>[s,y[s]])):{}}function ke(n,a){return typeof n=="number"?a?.type==="number"&&a.amount?fe(n,a.amount):String(n):Array.isArray(n)?n.every(u=>typeof u=="string")?n.join(", "):"":typeof n!="string"?"":n}var z=10;function Ee(n,a){return n.candidates&&n.candidates.length>0?n.candidates:a.type==="choice"?a.options:a.type==="several"&&a.of.type==="choice"?a.of.options:a.type==="boolean"?$e:[]}var $e=["yes","no"];function Ce(n,a,u){return a.type==="boolean"||a.type==="choice"||a.type==="several"&&a.of.type==="choice"?u:ze(n,u)}function ze(n,a){let u=ae(a);if(u){let s=de(n.schema,n.graph.getNode(u.from)?.kind??"",u.kind,"out");return s.charAt(0).toUpperCase()+s.slice(1)}let w=ie(a);if(w.length>0)return w.map(s=>n.schema.tryDefinition(s)?.plural??`${s}s`).join(" + ");let y=n.graph.getNode(a);return y?ee(n.schema.tryDefinition(y.kind),y):a}export{qe as a,ze as b};
1
+ import{a as B,b as ve}from"./chunk.CJHCUHVN.js";import{a as ye,c as he,d as be,f as we}from"./chunk.DCIYOZYP.js";import{b as S,c as fe,d as me}from"./chunk.T3RFZ66S.js";import{k as ce,l as ge}from"./chunk.TDWJU6GW.js";import{b as pe,k as q}from"./chunk.P3Z4ZCL3.js";import{b as de,e as ue}from"./chunk.45OLF6BK.js";import{G as Re,_ as se,h as ae,ja as le,u as ie}from"./chunk.ASNVH2G4.js";import{Oa as te,Za as re,_a as oe,ha as Z,ma as ee,va as ne}from"./chunk.ZDUKVXBI.js";import{b as W}from"./chunk.AJZBJBMO.js";var l=W(Re(),1);var i=W(se(),1);function qe({affordance:n,onApply:a,onCancel:u,store:w}){let y=le(),s=w??y?.store,[x,_]=(0,l.useState)({}),[p,D]=(0,l.useState)(""),[I,F]=(0,l.useState)(G),[J,V]=(0,l.useState)(void 0),U=(0,l.useId)(),L=(0,l.useRef)(null),A=n.open.filter(e=>!(e.name in x)),o=A[0],v=s.allMutations().find(e=>e.name===n.mutation),P=(0,l.useMemo)(()=>De(v,s,n.args??{}),[v,s,n.args]),d=o?P[o.name]:void 0,E=ge(n.open.filter(e=>e.shape?.type==="date").map(e=>e.name)),Se=(()=>{if(!E||o?.name!==E.end||o.shape?.type!=="date")return;let e=x[E.start];if(typeof e!="string")return;let r=P[E.start];return ce(typeof r=="string"?r:void 0,e,typeof d=="string"?d:void 0,{time:o.shape.time===!0,instant:o.shape.instant===!0})})();(0,l.useEffect)(()=>{D(Se??ke(d,o?.shape)),F(Array.isArray(d)?d:G),V(d)},[o?.name]),(0,l.useEffect)(()=>{L.current?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[o?.name]),(0,l.useLayoutEffect)(()=>{let e=L.current,r=typeof document>"u"?null:document.activeElement,f=r instanceof HTMLElement&&r.getAttribute("data-affordance")===n.id;if(!e||r&&r!==document.body&&!e.contains(r)&&!f)return;let b=e.querySelector('[data-testid="ask-filter"], form input, [role=group] button:not([disabled])');b&&b!==r&&b.focus()},[o?.name]);let Y=ve({flow:"both",letters:!0});if(!o)return null;let h=e=>{let r=d!==void 0&&JSON.stringify(e)===JSON.stringify(d)?void 0:e,f={...x,[o.name]:r};if(n.open.filter(R=>!(R.name in f)).length===0){let R=a(Object.fromEntries(Object.entries(f).filter(([,M])=>M!==void 0)));R&&R.length>0&&_(Object.fromEntries(Object.entries(f).filter(([M])=>!R.includes(M))))}else _(f)},O=o.optional?(0,i.jsx)("button",{type:"button",onClick:()=>h(void 0),style:{fontSize:"0.8125rem"},children:"Skip"}):null,t=o.shape??{type:"unknown"},c=t.type==="number"?t.amount:void 0,g=Ee(o,t),m=q(s.schema,v,o.name),Q=te((v?.input?.shape??{})[o.name]),xe=oe((v?.input?.shape??{})[o.name]),N=re(o.name),Ae=typeof d=="boolean"?d?"yes":"no":d,[T,Oe]=(0,l.useState)(""),X=(0,l.useMemo)(()=>{let e=g.map(r=>s.graph.getNode(r)).filter(r=>r!==void 0);return pe(e,r=>s.schema.tryDefinition(r))},[g,s]),j=e=>{let r=Ce(s,t,e),f=t.type==="choice"||t.type==="several"&&t.of.type==="choice"?m.option(e):r,b=X.get(e);return b?`${f} \xB7 ${b}`:f},$=(0,l.useMemo)(()=>{let e=T.trim().toLowerCase();return e===""?g:g.filter(r=>j(r).toLowerCase().includes(e))},[g,T,s,t,X]),k=t.type==="several",H=t.type==="file"?t:t.type==="several"&&t.of.type==="file"?t.of:void 0,K=k&&g.length===0,C=o.kinds&&o.kinds.length>0&&!o.kinds.includes("*")?o.kinds.map(e=>Z(ne(s.schema.tryDefinition(e),e))).join(" or "):m.label,Ne=n.open.length>1?`${C} \xB7 ${n.open.length-A.length+1} of ${n.open.length}`:C;return(0,i.jsxs)("div",{ref:L,"data-graview-asking":n.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,padding:"5px 0 2px"},children:[n.open.length>1||g.length>0?(0,i.jsx)("span",{id:U,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:Ne}):null,g.length>z?(0,i.jsx)("input",{type:"search",value:T,onChange:e=>Oe(e.target.value),placeholder:`Filter ${g.length}\u2026`,"aria-label":`Filter ${C}`,"data-testid":"ask-filter",onKeyDown:e=>{if(e.key!=="ArrowDown"||e.metaKey||e.ctrlKey||e.altKey)return;let r=Y.ref.current?.querySelector(`[${B}][tabindex="0"]`);r&&(e.preventDefault(),r.focus())},style:{font:"inherit",fontSize:"0.8125rem",minWidth:0,padding:"3px 7px"}}):null,xe?(0,i.jsxs)("form",{style:{display:"grid",gap:4},onSubmit:e=>{e.preventDefault(),h(J??(d===void 0?void 0:null))},children:[(0,i.jsx)(be,{value:J,onChange:V,start:N?x[N]??P[N]:void 0,label:`${N?q(s.schema,v,N).label:m.label} repeats`,name:o.name}),(0,i.jsxs)("span",{style:{display:"flex",gap:4},children:[(0,i.jsx)("button",{type:"submit",style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]}):Q?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(he,{relation:Q,value:d,onChange:h,label:m.label}),O]}):H?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ye,{as:"control",value:d,onChange:h,several:k,image:H.image===!0,video:H.video===!0,label:m.label}),O]}):g.length>0?(0,i.jsxs)("div",{...Y,role:"group","aria-labelledby":U,style:{display:"flex",flexWrap:"wrap",gap:4},children:[$.slice(0,z).map(e=>{let r=k?I.includes(e):e===Ae;return(0,i.jsx)("button",{type:"button",[B]:"","aria-label":`${C}: ${j(e)}`,...k?{"aria-pressed":r}:r?{"aria-current":!0}:{},style:{padding:"3px 9px",fontSize:"0.8125rem",...r?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},onClick:()=>k?F(f=>f.includes(e)?f.filter(b=>b!==e):[...f,e]):h(t.type==="boolean"?e==="yes":e),children:j(e)},e)}),$.length>z?(0,i.jsxs)("span",{"data-testid":"ask-more",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[$.length-z," more \u2014 type to narrow"]}):null,$.length===0?(0,i.jsxs)("span",{"data-testid":"ask-none",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["None of the ",g.length," match that."]}):null,k?(0,i.jsx)("button",{type:"button",disabled:I.length===0,style:{fontSize:"0.8125rem"},onClick:()=>{let e=I;F(G),h(e)},children:A.length>1?"Next":"Apply"}):null,O]}):(0,i.jsxs)("form",{style:{display:"flex",flexWrap:"wrap",gap:4},onSubmit:e=>{if(e.preventDefault(),d!==void 0&&p===ke(d,t)){h(void 0);return}if(K){h(p.split(/[,\n]/).map(r=>r.trim()).filter(Boolean));return}if(p.trim().length!==0){if(c){let r=me(p,c);r!==void 0&&h(r);return}h(t.type==="number"?t.duration?ue(p)??p:Number(p):p)}},children:[t.type==="text"&&t.long?(0,i.jsx)("textarea",{autoFocus:!0,name:o.name,"aria-label":m.label,placeholder:m.label,value:p,rows:4,onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"?u():e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},style:{flex:"1 1 100%",minWidth:0,font:"inherit",fontSize:"0.875rem",lineHeight:1.45,padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",resize:"vertical",fieldSizing:"content",minHeight:"5.5em",maxHeight:"40vh"}}):t.type==="date"?(0,i.jsx)(we,{autoFocus:!0,name:o.name,label:m.label,value:p===""?void 0:p,time:t.time===!0,instant:t.instant===!0,partial:t.partial===!0,onChange:e=>D(e??""),onCancel:u,boxStyle:{fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):(0,i.jsx)("input",{autoFocus:!0,type:t.type==="number"&&!t.duration&&!c?"number":t.type==="text"&&t.holds==="phone"?"tel":"text",...c?{inputMode:"decimal","data-graview-amount":c.format??"unit"}:{},name:o.name,"aria-label":m.label,placeholder:K?`${m.label}, separated by commas`:c?`${m.label}, ${S(c).hint} \u2014 ${S(c).prefix??""}${S(c).placeholder}${S(c).suffix?` ${S(c).suffix}`:""}`:m.label,value:p,...t.type==="number"&&t.min!==void 0?{min:t.min}:{},...t.type==="number"&&t.max!==void 0?{max:t.max}:{},...t.type==="number"&&t.step!==void 0?{step:t.step}:{},onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"&&u()},style:{flex:1,minWidth:0,font:"inherit",fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}),(0,i.jsx)("button",{type:"submit",disabled:!K&&p.trim().length===0,style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]})}var G=[];function De(n,a,u){let w=n?.derived?.act==="edit"&&n.subject?u[n.subject.arg]:void 0,y=typeof w=="string"?a.graph.getNode(w):void 0;return y?Object.fromEntries((n.writes??[]).filter(s=>y[s]!==void 0&&y[s]!==null).map(s=>[s,y[s]])):{}}function ke(n,a){return typeof n=="number"?a?.type==="number"&&a.amount?fe(n,a.amount):String(n):Array.isArray(n)?n.every(u=>typeof u=="string")?n.join(", "):"":typeof n!="string"?"":n}var z=10;function Ee(n,a){return n.candidates&&n.candidates.length>0?n.candidates:a.type==="choice"?a.options:a.type==="several"&&a.of.type==="choice"?a.of.options:a.type==="boolean"?$e:[]}var $e=["yes","no"];function Ce(n,a,u){return a.type==="boolean"||a.type==="choice"||a.type==="several"&&a.of.type==="choice"?u:ze(n,u)}function ze(n,a){let u=ae(a);if(u){let s=de(n.schema,n.graph.getNode(u.from)?.kind??"",u.kind,"out");return s.charAt(0).toUpperCase()+s.slice(1)}let w=ie(a);if(w.length>0)return w.map(s=>n.schema.tryDefinition(s)?.plural??`${s}s`).join(" + ");let y=n.graph.getNode(a);return y?ee(n.schema.tryDefinition(y.kind),y):a}export{qe as a,ze as b};