@flanksource/page-runtime 0.0.0-stage → 0.0.0
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/.vitest/gavel-reporter-3e3dfb64eda19344.mjs +59 -0
- package/.vitest/vitest-report-root-1793958008919344000.json +1 -0
- package/.vitest/vitest-report-root-1793958052786561000.json +1 -0
- package/.vitest/vitest-report-root-1793958143511414000.json +1 -0
- package/.vitest/vitest-report-root-1793958185908019000.json +1 -0
- package/.vitest/vitest-report-root-1793958252687550000.json +1 -0
- package/.vitest/vitest-report-root-1793958260385388000.json +1 -0
- package/.vitest/vitest-report-root-1793958312358683000.json +1 -0
- package/.vitest/vitest-report-root-1793958386118791000.json +1 -0
- package/.vitest/vitest-report-root-1793958388712140000.json +1 -0
- package/.vitest/vitest-report-root-1793958429135603000.json +1 -0
- package/.vitest/vitest-report-root-1793958433387809000.json +1 -0
- package/.vitest/vitest-report-root-1793958517322792000.json +1 -0
- package/.vitest/vitest-report-root-1793958542332252000.json +1 -0
- package/.vitest/vitest-report-root-1793958617698698000.json +1 -0
- package/.vitest/vitest-report-root-1793958676587753000.json +1 -0
- package/.vitest/vitest-report-root-1793958707827469000.json +1 -0
- package/.vitest/vitest-report-root-1793958729745028000.json +1 -0
- package/.vitest/vitest-report-root-1793958736696408000.json +1 -0
- package/.vitest/vitest-report-root-1793958740449993000.json +1 -0
- package/.vitest/vitest-report-root-1793958841510921000.json +1 -0
- package/.vitest/vitest-report-root-1793958847664582000.json +1 -0
- package/.vitest/vitest-report-root-1793958900327643000.json +1 -0
- package/.vitest/vitest-report-root-1793958950822823000.json +1 -0
- package/.vitest/vitest-report-root-1793959013655262000.json +1 -0
- package/.vitest/vitest-report-root-1793959017905881000.json +1 -0
- package/.vitest/vitest-report-root-1793959093169044000.json +1 -0
- package/.vitest/vitest-report-root-1793959093978087000.json +1 -0
- package/.vitest/vitest-report-root-1793959101111925000.json +1 -0
- package/.vitest/vitest-report-root-1793959145317906000.json +1 -0
- package/.vitest/vitest-report-root-1793959190760607000.json +1 -0
- package/.vitest/vitest-report-root-1793959249695805000.json +1 -0
- package/.vitest/vitest-report-root-1793959323191511000.json +1 -0
- package/.vitest/vitest-report-root-1793959453311564000.json +1 -0
- package/.vitest/vitest-report-root-1793959495806182000.json +1 -0
- package/.vitest/vitest-report-root-1793959499945435000.json +1 -0
- package/.vitest/vitest-report-root-1793959546773807000.json +1 -0
- package/.vitest/vitest-report-root-1793959583335593000.json +1 -0
- package/.vitest/vitest-report-root-1793959621479504000.json +1 -0
- package/.vitest/vitest-report-root-1793959651002360000.json +1 -0
- package/.vitest/vitest-report-root-1793959655646061000.json +1 -0
- package/.vitest/vitest-report-root-1793959741176826000.json +1 -0
- package/.vitest/vitest-report-root-1793959744743733000.json +1 -0
- package/.vitest/vitest-report-root-1793959833244182000.json +1 -0
- package/.vitest/vitest-report-root-1793959882131751000.json +1 -0
- package/.vitest/vitest-report-root-1793959887033254000.json +1 -0
- package/.vitest/vitest-report-root-1793960000631977000.json +1 -0
- package/.vitest/vitest-report-root-1793960011938504000.json +1 -0
- package/.vitest/vitest-report-root-1793961370018852000.json +1 -0
- package/.vitest/vitest-report-root-1793961745370827000.json +1 -0
- package/.vitest/vitest-report-root-1793961764143180000.json +1 -0
- package/.vitest/vitest-report-root-1793961835963066000.json +1 -0
- package/.vitest/vitest-report-root-1793961890729922000.json +1 -0
- package/.vitest/vitest-report-root-1793961968680074000.json +1 -0
- package/.vitest/vitest-report-root-1793962066862337000.json +1 -0
- package/.vitest/vitest-report-root-1793962087917497000.json +1 -0
- package/.vitest/vitest-report-root-1793962157254386000.json +1 -0
- package/.vitest/vitest-report-root-1793962171214865000.json +1 -0
- package/.vitest/vitest-report-root-1793962183290533000.json +1 -0
- package/.vitest/vitest-report-root-1793962184809932000.json +1 -0
- package/.vitest/vitest-report-root-1793962197715204000.json +1 -0
- package/.vitest/vitest-report-root-1793962244650717000.json +1 -0
- package/.vitest/vitest-report-root-1793962259802273000.json +1 -0
- package/.vitest/vitest-report-root-1793962278799745000.json +1 -0
- package/.vitest/vitest-report-root-1793962304412974000.json +1 -0
- package/.vitest/vitest-report-root-1793962328411454000.json +1 -0
- package/.vitest/vitest-report-root-1793962355747869000.json +1 -0
- package/.vitest/vitest-report-root-1793962381401572000.json +1 -0
- package/.vitest/vitest-report-root-1793962393326735000.json +1 -0
- package/.vitest/vitest-report-root-1793962393329206000.json +1 -0
- package/.vitest/vitest-report-root-1793962437796768000.json +1 -0
- package/.vitest/vitest-report-root-1793962444190384000.json +1 -0
- package/.vitest/vitest-report-root-1793962445347541000.json +1 -0
- package/.vitest/vitest-report-root-1793962473691143000.json +1 -0
- package/.vitest/vitest-report-root-1793962474291457000.json +1 -0
- package/.vitest/vitest-report-root-1793962499680468000.json +1 -0
- package/.vitest/vitest-report-root-1793962504410483000.json +1 -0
- package/.vitest/vitest-report-root-1793962516850524000.json +1 -0
- package/.vitest/vitest-report-root-1793962536736273000.json +1 -0
- package/.vitest/vitest-report-root-1793962551181783000.json +1 -0
- package/.vitest/vitest-report-root-1793962553575620000.json +1 -0
- package/.vitest/vitest-report-root-1793962555169730000.json +1 -0
- package/.vitest/vitest-report-root-1793962572639765000.json +1 -0
- package/.vitest/vitest-report-root-1793962597102952000.json +1 -0
- package/.vitest/vitest-report-root-1793962637156669000.json +1 -0
- package/.vitest/vitest-report-root-1793962653530027000.json +1 -0
- package/.vitest/vitest-report-root-1793962665824334000.json +1 -0
- package/.vitest/vitest-report-root-1793962682161714000.json +1 -0
- package/.vitest/vitest-report-root-1793962719526168000.json +1 -0
- package/.vitest/vitest-report-root-1793962723853934000.json +1 -0
- package/.vitest/vitest-report-root-1793962741927728000.json +1 -0
- package/.vitest/vitest-report-root-1793962794308371000.json +1 -0
- package/.vitest/vitest-report-root-1793962796334481000.json +1 -0
- package/.vitest/vitest-report-root-1793962798075169000.json +1 -0
- package/.vitest/vitest-report-root-1793962836466676000.json +1 -0
- package/.vitest/vitest-report-root-1793962846507317000.json +1 -0
- package/.vitest/vitest-report-root-1793962876266701000.json +1 -0
- package/.vitest/vitest-report-root-1793962922031308000.json +1 -0
- package/.vitest/vitest-report-root-1793962932957166000.json +1 -0
- package/.vitest/vitest-report-root-1793962946930725000.json +1 -0
- package/.vitest/vitest-report-root-1793963027896350000.json +1 -0
- package/.vitest/vitest-report-root-1793963036618707000.json +1 -0
- package/.vitest/vitest-report-root-1793963067365318000.json +1 -0
- package/.vitest/vitest-report-root-1793963077597641000.json +1 -0
- package/.vitest/vitest-report-root-1793963126365651000.json +1 -0
- package/.vitest/vitest-report-root-1793963208744553000.json +1 -0
- package/.vitest/vitest-report-root-1793963232806450000.json +1 -0
- package/.vitest/vitest-report-root-1793963325077422000.json +1 -0
- package/.vitest/vitest-report-root-1793963392172877000.json +1 -0
- package/.vitest/vitest-report-root-1793963398218324000.json +1 -0
- package/.vitest/vitest-report-root-1793963410749092000.json +1 -0
- package/.vitest/vitest-report-root-1793963437279580000.json +1 -0
- package/.vitest/vitest-report-root-1793963450096193000.json +1 -0
- package/.vitest/vitest-report-root-1793963478908641000.json +1 -0
- package/.vitest/vitest-report-root-1793963507838465000.json +1 -0
- package/.vitest/vitest-report-root-1793963528668174000.json +1 -0
- package/.vitest/vitest-report-root-1793963601860390000.json +1 -0
- package/.vitest/vitest-report-root-1793963611633446000.json +1 -0
- package/.vitest/vitest-report-root-1793963624713406000.json +1 -0
- package/.vitest/vitest-report-root-1793963680656685000.json +1 -0
- package/.vitest/vitest-report-root-1793963705231851000.json +1 -0
- package/.vitest/vitest-report-root-1793963708929500000.json +1 -0
- package/.vitest/vitest-report-root-1793963710267844000.json +1 -0
- package/.vitest/vitest-report-root-1793963713999248000.json +1 -0
- package/.vitest/vitest-report-root-1793963786513455000.json +1 -0
- package/.vitest/vitest-report-root-1793963792518765000.json +1 -0
- package/.vitest/vitest-report-root-1793963804089549000.json +1 -0
- package/.vitest/vitest-report-root-1793963840412921000.json +1 -0
- package/.vitest/vitest-report-root-1793963880361176000.json +1 -0
- package/.vitest/vitest-report-root-1793963935121106000.json +1 -0
- package/.vitest/vitest-report-root-1793963937290698000.json +1 -0
- package/.vitest/vitest-report-root-1793963977050773000.json +1 -0
- package/.vitest/vitest-report-root-1793963981229158000.json +1 -0
- package/.vitest/vitest-report-root-1793963989422080000.json +1 -0
- package/.vitest/vitest-report-root-1793964025924629000.json +1 -0
- package/.vitest/vitest-report-root-1793964027983705000.json +1 -0
- package/.vitest/vitest-report-root-1793964059969386000.json +1 -0
- package/.vitest/vitest-report-root-1793964071524069000.json +1 -0
- package/.vitest/vitest-report-root-1793964076285860000.json +1 -0
- package/.vitest/vitest-report-root-1793964077988100000.json +1 -0
- package/.vitest/vitest-report-root-1793964093289042000.json +1 -0
- package/.vitest/vitest-report-root-1793964102899356000.json +1 -0
- package/.vitest/vitest-report-root-1793964128089691000.json +1 -0
- package/.vitest/vitest-report-root-1793964129495156000.json +1 -0
- package/.vitest/vitest-report-root-1793964182849665000.json +1 -0
- package/.vitest/vitest-report-root-1793964223959893000.json +1 -0
- package/.vitest/vitest-report-root-1793964253351716000.json +1 -0
- package/.vitest/vitest-report-root-1793964290220122000.json +1 -0
- package/.vitest/vitest-report-root-1793964318037006000.json +1 -0
- package/.vitest/vitest-report-root-1793964334676691000.json +1 -0
- package/.vitest/vitest-report-root-1793964378520677000.json +1 -0
- package/.vitest/vitest-report-root-1793964383748994000.json +1 -0
- package/.vitest/vitest-report-root-1793964394042303000.json +1 -0
- package/.vitest/vitest-report-root-1793964466521881000.json +1 -0
- package/.vitest/vitest-report-root-1793964470478175000.json +1 -0
- package/.vitest/vitest-report-root-1793964484499019000.json +1 -0
- package/.vitest/vitest-report-root-1793964527645213000.json +1 -0
- package/.vitest/vitest-report-root-1793964608875865000.json +1 -0
- package/.vitest/vitest-report-root-1793964623608336000.json +1 -0
- package/.vitest/vitest-report-root-1793964629870846000.json +1 -0
- package/.vitest/vitest-report-root-1793964674515564000.json +1 -0
- package/.vitest/vitest-report-root-1793964706923651000.json +1 -0
- package/.vitest/vitest-report-root-1793964712832942000.json +1 -0
- package/.vitest/vitest-report-root-1793964714824633000.json +1 -0
- package/.vitest/vitest-report-root-1793964755433952000.json +1 -0
- package/.vitest/vitest-report-root-1793964783157670000.json +1 -0
- package/.vitest/vitest-report-root-1793964818963246000.json +1 -0
- package/.vitest/vitest-report-root-1793964843818548000.json +1 -0
- package/.vitest/vitest-report-root-1793964929824204000.json +1 -0
- package/.vitest/vitest-report-root-1793964973060713000.json +1 -0
- package/.vitest/vitest-report-root-1793964983122482000.json +1 -0
- package/.vitest/vitest-report-root-1793965107264567000.json +1 -0
- package/.vitest/vitest-report-root-1793965258759177000.json +1 -0
- package/.vitest/vitest-report-root-1793965277212091000.json +1 -0
- package/.vitest/vitest-report-root-1793965420648188000.json +1 -0
- package/.vitest/vitest-report-root-1793965611688414000.json +1 -0
- package/.vitest/vitest-report-root-1793965753407694000.json +1 -0
- package/.vitest/vitest-report-root-1793965766104309000.json +1 -0
- package/.vitest/vitest-report-root-1793965766823098000.json +1 -0
- package/.vitest/vitest-report-root-1793965806066109000.json +1 -0
- package/.vitest/vitest-report-root-1793965824697182000.json +1 -0
- package/.vitest/vitest-report-root-1793965904374564000.json +1 -0
- package/.vitest/vitest-report-root-1793965920838340000.json +1 -0
- package/.vitest/vitest-report-root-1793965932520617000.json +1 -0
- package/.vitest/vitest-report-root-1793965971574656000.json +1 -0
- package/.vitest/vitest-report-root-1793966049815024000.json +1 -0
- package/.vitest/vitest-report-root-1793966057888034000.json +1 -0
- package/.vitest/vitest-report-root-1793966066838868000.json +1 -0
- package/.vitest/vitest-report-root-1793966160347764000.json +1 -0
- package/.vitest/vitest-report-root-1793966196305985000.json +1 -0
- package/.vitest/vitest-report-root-1793966221538043000.json +1 -0
- package/.vitest/vitest-report-root-1793966251519918000.json +1 -0
- package/.vitest/vitest-report-root-1793966447000588000.json +1 -0
- package/.vitest/vitest-report-root-1793966463178249000.json +1 -0
- package/.vitest/vitest-report-root-1793966486995648000.json +1 -0
- package/.vitest/vitest-report-root-1793966726756953000.json +1 -0
- package/.vitest/vitest-report-root-1793966763656807000.json +1 -0
- package/.vitest/vitest-report-root-1793966979409799000.json +1 -0
- package/.vitest/vitest-report-root-1793967385250149000.json +1 -0
- package/.vitest/vitest-report-root-1793967617080163000.json +1 -0
- package/.vitest/vitest-report-root-1793967649428508000.json +1 -0
- package/.vitest/vitest-report-root-1793967773689520000.json +1 -0
- package/.vitest/vitest-report-root-1793968743743508000.json +1 -0
- package/.vitest/vitest-report-root-1793968846470407000.json +1 -0
- package/.vitest/vitest-report-root-1793968880878391000.json +1 -0
- package/.vitest/vitest-report-root-1793969027713529000.json +1 -0
- package/.vitest/vitest-report-root-1793969041841266000.json +1 -0
- package/.vitest/vitest-report-root-1793969142007468000.json +1 -0
- package/.vitest/vitest-report-root-1793969164867379000.json +1 -0
- package/.vitest/vitest-report-root-1793969193145858000.json +1 -0
- package/.vitest/vitest-report-root-1793969246818533000.json +1 -0
- package/.vitest/vitest-report-root-1793969270845486000.json +1 -0
- package/.vitest/vitest-report-root-1793969272514219000.json +1 -0
- package/.vitest/vitest-report-root-1793969302476105000.json +1 -0
- package/.vitest/vitest-report-root-1793969401697799000.json +1 -0
- package/.vitest/vitest-report-root-1793969433222630000.json +1 -0
- package/.vitest/vitest-report-root-1793969453350714000.json +1 -0
- package/.vitest/vitest-report-root-1793969567187400000.json +1 -0
- package/.vitest/vitest-report-root-1793969602230024000.json +1 -0
- package/.vitest/vitest-report-root-1793969633261063000.json +1 -0
- package/.vitest/vitest-report-root-1793969673876404000.json +1 -0
- package/.vitest/vitest-report-root-1793969702287010000.json +1 -0
- package/.vitest/vitest-report-root-1793969745828386000.json +1 -0
- package/.vitest/vitest-report-root-1793969893687205000.json +1 -0
- package/.vitest/vitest-report-root-1793969949642120000.json +1 -0
- package/.vitest/vitest-report-root-1793969981399076000.json +1 -0
- package/.vitest/vitest-report-root-1793970027152713000.json +1 -0
- package/.vitest/vitest-report-root-1793970030585158000.json +1 -0
- package/.vitest/vitest-report-root-1793970160195767000.json +1 -0
- package/.vitest/vitest-report-root-1793970215752422000.json +1 -0
- package/.vitest/vitest-report-root-1793970217114968000.json +1 -0
- package/.vitest/vitest-report-root-1793970329879319000.json +1 -0
- package/.vitest/vitest-report-root-1793970590586994000.json +1 -0
- package/.vitest/vitest-report-root-1793970625359990000.json +1 -0
- package/.vitest/vitest-report-root-1793970672590269000.json +1 -0
- package/.vitest/vitest-report-root-1793970796789022000.json +1 -0
- package/.vitest/vitest-report-root-1793970825710990000.json +1 -0
- package/.vitest/vitest-report-root-1793970884000509000.json +1 -0
- package/.vitest/vitest-report-root-1793970900444617000.json +1 -0
- package/.vitest/vitest-report-root-1793972186024681000.json +1 -0
- package/.vitest/vitest-report-root-1793972227757396000.json +1 -0
- package/.vitest/vitest-report-root-1793972736341600000.json +1 -0
- package/.vitest/vitest-report-root-1793972769249562000.json +1 -0
- package/.vitest/vitest-report-root-1793972859435283000.json +1 -0
- package/.vitest/vitest-report-root-1793972915169294000.json +1 -0
- package/.vitest/vitest-report-root-1793973081515450000.json +1 -0
- package/.vitest/vitest-report-root-1793973111336773000.json +1 -0
- package/.vitest/vitest-report-root-1793973253986969000.json +1 -0
- package/.vitest/vitest-report-root-1793973561283775000.json +1 -0
- package/.vitest/vitest-report-root-1793973593320977000.json +1 -0
- package/.vitest/vitest-report-root-1793973648302867000.json +1 -0
- package/.vitest/vitest-report-root-1793973819657242000.json +1 -0
- package/.vitest/vitest-report-root-1793973952727311000.json +1 -0
- package/.vitest/vitest-report-root-1793974334455876000.json +1 -0
- package/.vitest/vitest-report-root-1793974437074196000.json +1 -0
- package/.vitest/vitest-report-root-1793974437553146000.json +1 -0
- package/.vitest/vitest-report-root-1793974461818626000.json +1 -0
- package/.vitest/vitest-report-root-1793974515255198000.json +1 -0
- package/.vitest/vitest-report-root-1793974516267191000.json +1 -0
- package/.vitest/vitest-report-root-1793974621202824000.json +1 -0
- package/.vitest/vitest-report-root-1793974718450330000.json +1 -0
- package/.vitest/vitest-report-root-1793974834942373000.json +1 -0
- package/.vitest/vitest-report-root-1793974921367314000.json +1 -0
- package/.vitest/vitest-report-root-1793975019367156000.json +1 -0
- package/.vitest/vitest-report-root-1793975048166096000.json +1 -0
- package/.vitest/vitest-report-root-1793975133024339000.json +1 -0
- package/.vitest/vitest-report-root-1793975159711704000.json +1 -0
- package/.vitest/vitest-report-root-1793975517481736000.json +1 -0
- package/.vitest/vitest-report-root-1793975680008825000.json +1 -0
- package/.vitest/vitest-report-root-1793976067648494000.json +1 -0
- package/.vitest/vitest-report-root-1793976314122479000.json +1 -0
- package/.vitest/vitest-report-root-1793976513022402000.json +1 -0
- package/.vitest/vitest-report-root-1793976540410805000.json +1 -0
- package/.vitest/vitest-report-root-1793976555103273000.json +1 -0
- package/.vitest/vitest-report-root-1793976702974407000.json +1 -0
- package/.vitest/vitest-report-root-1793976721093108000.json +1 -0
- package/.vitest/vitest-report-root-1793976955473681000.json +1 -0
- package/.vitest/vitest-report-root-1793977049628483000.json +1 -0
- package/.vitest/vitest-report-root-1793977098467804000.json +1 -0
- package/.vitest/vitest-report-root-1793977132144900000.json +1 -0
- package/.vitest/vitest-report-root-1793977279648191000.json +1 -0
- package/.vitest/vitest-report-root-1793977365312127000.json +1 -0
- package/.vitest/vitest-report-root-1793978227796817000.json +1 -0
- package/.vitest/vitest-report-root-1793978255189735000.json +1 -0
- package/.vitest/vitest-report-root-1793978306509070000.json +1 -0
- package/.vitest/vitest-report-root-1793978418301216000.json +1 -0
- package/.vitest/vitest-report-root-1793978445072573000.json +1 -0
- package/.vitest/vitest-report-root-1793978546605517000.json +1 -0
- package/.vitest/vitest-report-root-1793978576060950000.json +1 -0
- package/.vitest/vitest-report-root-1793978590261408000.json +1 -0
- package/.vitest/vitest-report-root-1793978674733179000.json +1 -0
- package/.vitest/vitest-report-root-1793978718588785000.json +1 -0
- package/.vitest/vitest-report-root-1793978725363453000.json +1 -0
- package/.vitest/vitest-report-root-1793978729967285000.json +1 -0
- package/.vitest/vitest-report-root-1793978755641607000.json +1 -0
- package/.vitest/vitest-report-root-1793978782769802000.json +1 -0
- package/.vitest/vitest-report-root-1793978784870947000.json +1 -0
- package/.vitest/vitest-report-root-1793978806927335000.json +1 -0
- package/.vitest/vitest-report-root-1793978822508324000.json +1 -0
- package/.vitest/vitest-report-root-1793978836339794000.json +1 -0
- package/.vitest/vitest-report-root-1793978837947352000.json +1 -0
- package/.vitest/vitest-report-root-1793978891548295000.json +1 -0
- package/.vitest/vitest-report-root-1793978946172947000.json +1 -0
- package/.vitest/vitest-report-root-1793978947109807000.json +1 -0
- package/.vitest/vitest-report-root-1793979034208662000.json +1 -0
- package/.vitest/vitest-report-root-1793979070583608000.json +1 -0
- package/.vitest/vitest-report-root-1793979081187144000.json +1 -0
- package/.vitest/vitest-report-root-1793979085428673000.json +1 -0
- package/.vitest/vitest-report-root-1793979155097858000.json +1 -0
- package/.vitest/vitest-report-root-1793979233508873000.json +1 -0
- package/.vitest/vitest-report-root-1793979268653273000.json +1 -0
- package/.vitest/vitest-report-root-1793979341978843000.json +1 -0
- package/.vitest/vitest-report-root-1793979345344877000.json +1 -0
- package/.vitest/vitest-report-root-1793979389390374000.json +1 -0
- package/.vitest/vitest-report-root-1793979400063493000.json +1 -0
- package/.vitest/vitest-report-root-1793979432448725000.json +1 -0
- package/.vitest/vitest-report-root-1793979459139430000.json +1 -0
- package/.vitest/vitest-report-root-1793979480341961000.json +1 -0
- package/.vitest/vitest-report-root-1793979510130869000.json +1 -0
- package/.vitest/vitest-report-root-1793979524763924000.json +1 -0
- package/.vitest/vitest-report-root-1793979571563010000.json +1 -0
- package/.vitest/vitest-report-root-1793979627916920000.json +1 -0
- package/.vitest/vitest-report-root-1793979726395379000.json +1 -0
- package/.vitest/vitest-report-root-1793979752029533000.json +1 -0
- package/.vitest/vitest-report-root-1793979753365744000.json +1 -0
- package/.vitest/vitest-report-root-1793979759386206000.json +1 -0
- package/.vitest/vitest-report-root-1793979787819109000.json +1 -0
- package/.vitest/vitest-report-root-1793979827615051000.json +1 -0
- package/.vitest/vitest-report-root-1793979927737393000.json +1 -0
- package/.vitest/vitest-report-root-1793979929836169000.json +1 -0
- package/.vitest/vitest-report-root-1793979955780781000.json +1 -0
- package/.vitest/vitest-report-root-1793980200569636000.json +1 -0
- package/.vitest/vitest-report-root-1793980206045213000.json +1 -0
- package/.vitest/vitest-report-root-1793980285772027000.json +1 -0
- package/.vitest/vitest-report-root-1793980459229828000.json +1 -0
- package/.vitest/vitest-report-root-1793980460545874000.json +1 -0
- package/.vitest/vitest-report-root-1793980554484341000.json +1 -0
- package/.vitest/vitest-report-root-1793980674494388000.json +1 -0
- package/.vitest/vitest-report-root-1793980683752195000.json +1 -0
- package/.vitest/vitest-report-root-1793980947108651000.json +1 -0
- package/.vitest/vitest-report-root-1793981129616629000.json +1 -0
- package/.vitest/vitest-report-root-1793981196611441000.json +1 -0
- package/.vitest/vitest-report-root-1793981226583545000.json +1 -0
- package/.vitest/vitest-report-root-1793981294259721000.json +1 -0
- package/.vitest/vitest-report-root-1793981353393048000.json +1 -0
- package/.vitest/vitest-report-root-1793981424585368000.json +1 -0
- package/.vitest/vitest-report-root-1793981513266687000.json +1 -0
- package/.vitest/vitest-report-root-1793981526418218000.json +1 -0
- package/.vitest/vitest-report-root-1793981540069877000.json +1 -0
- package/.vitest/vitest-report-root-1793981761193625000.json +1 -0
- package/.vitest/vitest-report-root-1793981868520992000.json +1 -0
- package/.vitest/vitest-report-root-1793982048467772000.json +1 -0
- package/.vitest/vitest-report-root-1793982119518020000.json +1 -0
- package/.vitest/vitest-report-root-1793982243473651000.json +1 -0
- package/.vitest/vitest-report-root-1793982406880629000.json +1 -0
- package/.vitest/vitest-report-root-1793982433563632000.json +1 -0
- package/.vitest/vitest-report-root-1793982496753204000.json +1 -0
- package/.vitest/vitest-report-root-1793982500153311000.json +1 -0
- package/.vitest/vitest-report-root-1793982542086095000.json +1 -0
- package/.vitest/vitest-report-root-1793982659482988000.json +1 -0
- package/.vitest/vitest-report-root-1793983799132716000.json +1 -0
- package/.vitest/vitest-report-root-1793983822721833000.json +1 -0
- package/.vitest/vitest-report-root-1793984998618484000.json +1 -0
- package/.vitest/vitest-report-root-1793985050475750000.json +1 -0
- package/.vitest/vitest-report-root-1793985095516077000.json +1 -0
- package/.vitest/vitest-report-root-1793985130729074000.json +1 -0
- package/.vitest/vitest-report-root-1793985177150997000.json +1 -0
- package/.vitest/vitest-report-root-1793985267658626000.json +1 -0
- package/.vitest/vitest-report-root-1793985412705211000.json +1 -0
- package/.vitest/vitest-report-root-1793985433752853000.json +1 -0
- package/.vitest/vitest-report-root-1794087938302852000.json +1 -0
- package/.vitest/vitest-report-root-1794087978339022000.json +1 -0
- package/.vitest/vitest-report-root-1794088095283811000.json +1 -0
- package/.vitest/vitest-report-root-1794088129997065000.json +1 -0
- package/.vitest/vitest-report-root-1794088147336556000.json +1 -0
- package/.vitest/vitest-report-root-1794088173414593000.json +1 -0
- package/.vitest/vitest-report-root-1794088221289657000.json +1 -0
- package/.vitest/vitest-report-root-1794088250766611000.json +1 -0
- package/.vitest/vitest-report-root-1794088365553234000.json +1 -0
- package/.vitest/vitest-report-root-1794088395202655000.json +1 -0
- package/.vitest/vitest-report-root-1794090028732187000.json +1 -0
- package/.vitest/vitest-report-root-1794090054787283000.json +1 -0
- package/.vitest/vitest-report-root-1794090153955794000.json +1 -0
- package/.vitest/vitest-report-root-1794090161850160000.json +1 -0
- package/.vitest/vitest-report-root-1794091755693314000.json +1 -0
- package/.vitest/vitest-report-root-1794091765029349000.json +1 -0
- package/.vitest/vitest-report-root-1794091975649927000.json +1 -0
- package/.vitest/vitest-report-root-1794091994027950000.json +1 -0
- package/.vitest/vitest-report-root-1794092005178771000.json +1 -0
- package/.vitest/vitest-report-root-1794113295302382000.json +1 -0
- package/.vitest/vitest-report-root-1794114156337032000.json +1 -0
- package/.vitest/vitest-report-root-1794114198454137000.json +1 -0
- package/.vitest/vitest-report-root-1794114254064413000.json +1 -0
- package/.vitest/vitest-report-root-1794114280107510000.json +1 -0
- package/.vitest/vitest-report-root-1794114495199837000.json +1 -0
- package/.vitest/vitest-report-root-1794114646604233000.json +1 -0
- package/.vitest/vitest-report-root-1794114666311689000.json +1 -0
- package/.vitest/vitest-report-root-1794114974303438000.json +1 -0
- package/.vitest/vitest-report-root-1794115037361450000.json +1 -0
- package/.vitest/vitest-report-root-1794115097838937000.json +1 -0
- package/.vitest/vitest-report-root-1794115604669388000.json +1 -0
- package/.vitest/vitest-report-root-1794115633814500000.json +1 -0
- package/.vitest/vitest-report-root-1794115648756242000.json +1 -0
- package/.vitest/vitest-report-root-1794115873440741000.json +1 -0
- package/.vitest/vitest-report-root-1794115952930230000.json +1 -0
- package/.vitest/vitest-report-root-1794115963344701000.json +1 -0
- package/.vitest/vitest-report-root-1794116196067450000.json +1 -0
- package/.vitest/vitest-report-root-1794116254301280000.json +1 -0
- package/.vitest/vitest-report-root-1794116259342966000.json +1 -0
- package/.vitest/vitest-report-root-1794118178787879000.json +1 -0
- package/.vitest/vitest-report-root-1794137087891409000.json +1 -0
- package/.vitest/vitest-report-root-1794137100301214000.json +1 -0
- package/.vitest/vitest-report-root-1794137107377813000.json +1 -0
- package/.vitest/vitest-report-root-1794137171230704000.json +1 -0
- package/.vitest/vitest-report-root-1794137317761465000.json +1 -0
- package/.vitest/vitest-report-root-1794137320282368000.json +1 -0
- package/LICENSE +17 -0
- package/PACKAGE_PUBLICATIONS.md +26 -0
- package/builder-package.json +19 -0
- package/package.json +77 -3
- package/scripts/build-builder.ts +27 -0
- package/scripts/build-library-runtime.ts +9 -0
- package/scripts/build-static.ts +75 -0
- package/scripts/build.ts +6 -0
- package/scripts/check-fragment.ts +12 -0
- package/scripts/local-workspaces.test.ts +31 -0
- package/scripts/local-workspaces.ts +55 -0
- package/scripts/release-version-cli.test.ts +40 -0
- package/scripts/release-version.test.ts +29 -0
- package/scripts/release-version.ts +46 -0
- package/scripts/run-package-build.ts +8 -0
- package/scripts/serve-packages.ts +8 -0
- package/spikes/README.md +70 -0
- package/spikes/barrel-rewriting/README.md +97 -0
- package/spikes/barrel-rewriting/measure.ts +134 -0
- package/spikes/barrel-rewriting/readme.ts +174 -0
- package/spikes/barrel-rewriting/results.json +3440 -0
- package/spikes/barrel-rewriting/run.ts +330 -0
- package/spikes/barrel-rewriting/setup.ts +90 -0
- package/spikes/barrel-rewriting/sw.ts +148 -0
- package/spikes/barrel-rewriting/tenant.ts +91 -0
- package/spikes/barrel-rewriting/worker-config.ts +33 -0
- package/spikes/closure-fragments/README.md +157 -0
- package/spikes/closure-fragments/results.json +959 -0
- package/spikes/closure-fragments/run.ts +298 -0
- package/spikes/compiler/README.md +177 -0
- package/spikes/compiler/compile.test.ts +78 -0
- package/spikes/compiler/compile.ts +82 -0
- package/spikes/compiler/facet-redact.d.ts +5 -0
- package/spikes/compiler/markers.ts +88 -0
- package/spikes/compiler/pages.ts +43 -0
- package/spikes/compiler/readme.ts +116 -0
- package/spikes/compiler/reference.ts +81 -0
- package/spikes/compiler/render.ts +113 -0
- package/spikes/compiler/results.json +3310 -0
- package/spikes/compiler/run.ts +250 -0
- package/spikes/compiler/sucrase-parser.d.ts +8 -0
- package/spikes/compiler/sw.ts +62 -0
- package/spikes/diagram-readiness/README.md +134 -0
- package/spikes/diagram-readiness/analysis.test.ts +52 -0
- package/spikes/diagram-readiness/analysis.ts +35 -0
- package/spikes/diagram-readiness/browser.ts +209 -0
- package/spikes/diagram-readiness/readme.ts +65 -0
- package/spikes/diagram-readiness/results.json +30289 -0
- package/spikes/diagram-readiness/run.ts +103 -0
- package/spikes/diagram-readiness/server.ts +53 -0
- package/spikes/esm-sh/README.md +27 -0
- package/spikes/esm-sh/browser-client.ts +18 -0
- package/spikes/esm-sh/browser-server.ts +104 -0
- package/spikes/esm-sh/fixtures/copy-to-clipboard-entry.headers +15 -0
- package/spikes/esm-sh/fixtures/copy-to-clipboard-entry.mjs.txt +3 -0
- package/spikes/esm-sh/fixtures/copy-to-clipboard-module.headers +13 -0
- package/spikes/esm-sh/fixtures/copy-to-clipboard-module.mjs.txt +142 -0
- package/spikes/esm-sh/fixtures/react-copy-to-clipboard-entry.headers +15 -0
- package/spikes/esm-sh/fixtures/react-copy-to-clipboard-entry.mjs.txt +3 -0
- package/spikes/esm-sh/fixtures/react-copy-to-clipboard-module.headers +11 -0
- package/spikes/esm-sh/fixtures/react-copy-to-clipboard-module.mjs.txt +222 -0
- package/spikes/esm-sh/fixtures/toggle-selection-entry.headers +14 -0
- package/spikes/esm-sh/fixtures/toggle-selection-entry.mjs.txt +3 -0
- package/spikes/esm-sh/fixtures/toggle-selection-module.headers +11 -0
- package/spikes/esm-sh/fixtures/toggle-selection-module.mjs.txt +76 -0
- package/spikes/esm-sh/fixtures.ts +54 -0
- package/spikes/esm-sh/redact.ts +1 -0
- package/spikes/frame-commenting/README.md +183 -0
- package/spikes/frame-commenting/agent.ts +110 -0
- package/spikes/frame-commenting/hook.ts +1 -0
- package/spikes/frame-commenting/host.ts +66 -0
- package/spikes/frame-commenting/measure.ts +180 -0
- package/spikes/frame-commenting/model.test.ts +27 -0
- package/spikes/frame-commenting/model.ts +40 -0
- package/spikes/frame-commenting/readme.ts +61 -0
- package/spikes/frame-commenting/results.json +5320 -0
- package/spikes/frame-commenting/run.ts +73 -0
- package/spikes/frame-commenting/setup.ts +125 -0
- package/spikes/lib/barrels.test.ts +107 -0
- package/spikes/lib/barrels.ts +309 -0
- package/spikes/lib/cjs-export-names.mjs +22 -0
- package/spikes/lib/content-types.ts +28 -0
- package/spikes/lib/convert-commonjs.ts +168 -0
- package/spikes/lib/fragment.ts +108 -0
- package/spikes/lib/library-set.ts +194 -0
- package/spikes/lib/module-transform.test.ts +133 -0
- package/spikes/lib/module-transform.ts +351 -0
- package/spikes/lib/origin.ts +140 -0
- package/spikes/lib/pages.ts +290 -0
- package/spikes/lib/report.ts +23 -0
- package/spikes/lib/runtime-server.ts +282 -0
- package/spikes/lib/static-server.ts +82 -0
- package/spikes/lib/trace.ts +384 -0
- package/spikes/local-folder-link/README.md +85 -0
- package/spikes/local-folder-link/checkout.ts +132 -0
- package/spikes/local-folder-link/documents.ts +36 -0
- package/spikes/local-folder-link/readme.ts +42 -0
- package/spikes/local-folder-link/results.json +12815 -0
- package/spikes/local-folder-link/rewrite.test.ts +27 -0
- package/spikes/local-folder-link/rewrite.ts +38 -0
- package/spikes/local-folder-link/run.ts +123 -0
- package/spikes/local-folder-link/server.ts +100 -0
- package/spikes/local-folder-link/sw.ts +97 -0
- package/spikes/origin-isolation/README.md +426 -0
- package/spikes/origin-isolation/browsers.ts +43 -0
- package/spikes/origin-isolation/helper.ts +6 -0
- package/spikes/origin-isolation/host.ts +25 -0
- package/spikes/origin-isolation/measure.ts +118 -0
- package/spikes/origin-isolation/model.test.ts +45 -0
- package/spikes/origin-isolation/model.ts +49 -0
- package/spikes/origin-isolation/proxy.ts +35 -0
- package/spikes/origin-isolation/readme.ts +83 -0
- package/spikes/origin-isolation/results.json +3242 -0
- package/spikes/origin-isolation/run.ts +35 -0
- package/spikes/origin-isolation/server.ts +108 -0
- package/spikes/origin-isolation/sw.ts +28 -0
- package/spikes/origin-isolation/tenant.ts +165 -0
- package/spikes/react-runtime-set/README.md +48 -0
- package/spikes/react-runtime-set/convert.ts +118 -0
- package/spikes/react-runtime-set/export-names.mjs +8 -0
- package/spikes/react-runtime-set/page/page.js +46 -0
- package/spikes/react-runtime-set/results.json +84 -0
- package/spikes/react-runtime-set/run.ts +255 -0
- package/spikes/run.ts +15 -0
- package/spikes/sw-tenant-frame/README.md +95 -0
- package/spikes/sw-tenant-frame/results.json +1348 -0
- package/spikes/sw-tenant-frame/run.ts +373 -0
- package/spikes/sw-tenant-frame/site/frame.html +113 -0
- package/spikes/sw-tenant-frame/site/host.html +25 -0
- package/spikes/sw-tenant-frame/site/sw.js +10 -0
- package/spikes/tailwind-parity/README.md +78 -0
- package/spikes/tailwind-parity/compare.test.ts +70 -0
- package/spikes/tailwind-parity/compare.ts +91 -0
- package/spikes/tailwind-parity/facet-font-scale.d.ts +6 -0
- package/spikes/tailwind-parity/facet-styles.ts +77 -0
- package/spikes/tailwind-parity/results.json +885 -0
- package/spikes/tailwind-parity/run.ts +385 -0
- package/spikes/tailwind-parity/runtime-tailwind.ts +82 -0
- package/src/activity-schema.ts +91 -0
- package/src/activity.test.ts +57 -0
- package/src/build/README.md +94 -0
- package/src/build/barrels.test.ts +107 -0
- package/src/build/barrels.ts +306 -0
- package/src/build/base.ts +2 -0
- package/src/build/check-fragment.ts +45 -0
- package/src/build/cjs-export-names.mjs +24 -0
- package/src/build/commonjs-exports.ts +24 -0
- package/src/build/convert-commonjs.ts +183 -0
- package/src/build/dependencies.ts +4 -0
- package/src/build/dependency-barrels.ts +59 -0
- package/src/build/dependency-cache.ts +40 -0
- package/src/build/dependency-plugin.ts +58 -0
- package/src/build/dependency-runtime.test.ts +121 -0
- package/src/build/dependency-runtime.ts +147 -0
- package/src/build/errors.ts +9 -0
- package/src/build/fragment.ts +89 -0
- package/src/build/index.ts +7 -0
- package/src/build/library-runtime.test.ts +343 -0
- package/src/build/library-runtime.ts +98 -0
- package/src/build/module-utils.ts +11 -0
- package/src/build/recipe-dependencies.ts +14 -0
- package/src/build/runtime-entries.ts +10 -0
- package/src/build/trace.ts +429 -0
- package/src/design-schema.ts +25 -0
- package/src/dev/README.md +48 -0
- package/src/dev/catalog.ts +79 -0
- package/src/dev/cli.test.ts +12 -0
- package/src/dev/cli.ts +25 -0
- package/src/dev/index.ts +115 -0
- package/src/dev/packages.test.ts +175 -0
- package/src/editing.test.tsx +31 -0
- package/src/editing.ts +25 -0
- package/src/frame/activity.browser.ts +34 -0
- package/src/frame/activity.test.ts +27 -0
- package/src/frame/activity.ts +50 -0
- package/src/frame/agent/README.md +47 -0
- package/src/frame/agent/agent.browser.ts +127 -0
- package/src/frame/agent/design.ts +62 -0
- package/src/frame/agent/index.ts +148 -0
- package/src/frame/agent/overlay.test.ts +42 -0
- package/src/frame/agent/overlay.ts +91 -0
- package/src/frame/agent/owner.test.ts +78 -0
- package/src/frame/agent/owner.ts +58 -0
- package/src/frame/agent/provider.tsx +14 -0
- package/src/frame/agent/react-override.ts +55 -0
- package/src/frame/agent/review.browser.ts +65 -0
- package/src/frame/agent/review.ts +107 -0
- package/src/frame/agent/testing/callsite.tsx +5 -0
- package/src/frame/agent/testing/client.ts +99 -0
- package/src/frame/agent/testing/library.ts +3 -0
- package/src/frame/agent/testing/modal.tsx +5 -0
- package/src/frame/agent/testing/review-client.ts +43 -0
- package/src/frame/agent/testing/review-server.ts +31 -0
- package/src/frame/agent/testing/server.ts +72 -0
- package/src/frame/agent/testing/vocabulary-host.ts +20 -0
- package/src/frame/agent/testing/vocabulary.tsx +10 -0
- package/src/frame/agent/vitest.browser.config.ts +6 -0
- package/src/frame/agent/vocabulary.browser.ts +30 -0
- package/src/frame/agent/vocabulary.test.ts +36 -0
- package/src/frame/agent/vocabulary.ts +13 -0
- package/src/frame/agent.ts +2 -0
- package/src/frame/boot-bundle.test.ts +20 -0
- package/src/frame/boot-styles.test.ts +102 -0
- package/src/frame/boot-styles.ts +50 -0
- package/src/frame/boot.test.ts +108 -0
- package/src/frame/boot.ts +205 -0
- package/src/frame/bridge.ts +27 -0
- package/src/frame/devtools-hook.ts +1 -0
- package/src/frame/entry.ts +4 -0
- package/src/frame/export-compiler.test.ts +23 -0
- package/src/frame/export-compiler.ts +18 -0
- package/src/frame/export-page.ts +59 -0
- package/src/frame/export.test.ts +17 -0
- package/src/frame/export.ts +90 -0
- package/src/frame/index.ts +7 -0
- package/src/frame/local-runtime.browser.ts +36 -0
- package/src/frame/page-agent.ts +2 -0
- package/src/frame/readiness.ts +51 -0
- package/src/frame/review-integration.browser.ts +48 -0
- package/src/frame/runtime.browser.ts +71 -0
- package/src/frame/tailwind/README.md +49 -0
- package/src/frame/tailwind/boot-styles.browser.ts +18 -0
- package/src/frame/tailwind/cache.test.ts +53 -0
- package/src/frame/tailwind/cache.ts +20 -0
- package/src/frame/tailwind/load.test.ts +74 -0
- package/src/frame/tailwind/load.ts +66 -0
- package/src/frame/tailwind/recipe.ts +81 -0
- package/src/frame/tailwind/runtime-cache.test.ts +97 -0
- package/src/frame/tailwind/runtime.ts +113 -0
- package/src/frame/tailwind/store.test.ts +104 -0
- package/src/frame/tailwind/store.ts +55 -0
- package/src/frame/tailwind/stylesheets.ts +37 -0
- package/src/frame/tailwind/tailwind.browser.ts +71 -0
- package/src/frame/tailwind/tailwind.test.ts +119 -0
- package/src/frame/tailwind/testing/client.ts +132 -0
- package/src/frame/tailwind/testing/compare.ts +91 -0
- package/src/frame/tailwind/testing/pages.ts +14 -0
- package/src/frame/tailwind/testing/server.ts +89 -0
- package/src/frame/tailwind/vitest.browser.config.ts +7 -0
- package/src/frame/testing/boot-page.ts +3 -0
- package/src/frame/testing/host.ts +60 -0
- package/src/frame/testing/local-host.tsx +33 -0
- package/src/frame/testing/server.ts +120 -0
- package/src/host/BuildLog.test.tsx +40 -0
- package/src/host/BuildLog.tsx +27 -0
- package/src/host/PageFrame.test.tsx +39 -0
- package/src/host/PageFrame.tsx +41 -0
- package/src/host/RuntimeActivity.tsx +75 -0
- package/src/host/activity-state.test.ts +37 -0
- package/src/host/activity-state.ts +69 -0
- package/src/host/agent-source.test.ts +9 -0
- package/src/host/agent-source.ts +14 -0
- package/src/host/agent-validation.test.ts +40 -0
- package/src/host/agent-validation.ts +73 -0
- package/src/host/bridge-request.test.ts +87 -0
- package/src/host/bridge.test.ts +34 -0
- package/src/host/bridge.ts +55 -0
- package/src/host/build-log.test.ts +47 -0
- package/src/host/build-log.ts +29 -0
- package/src/host/clear-cache.test.ts +75 -0
- package/src/host/clear-cache.ts +66 -0
- package/src/host/design-validation.test.ts +38 -0
- package/src/host/design-validation.ts +96 -0
- package/src/host/index.ts +11 -0
- package/src/host/link/index.ts +66 -0
- package/src/host/link/transport.test.ts +10 -0
- package/src/host/link/transport.ts +67 -0
- package/src/host/link/watch.ts +62 -0
- package/src/host/message-values.ts +55 -0
- package/src/host/origin.test.ts +10 -0
- package/src/host/origin.ts +7 -0
- package/src/host/review/README.md +32 -0
- package/src/host/review/index.ts +42 -0
- package/src/host/review/remote.test.ts +21 -0
- package/src/host/review/source.test.ts +19 -0
- package/src/host/review/validation.test.ts +34 -0
- package/src/host/review/validation.ts +55 -0
- package/src/host/runtime-integration.test.ts +29 -0
- package/src/host/source-path.test.ts +14 -0
- package/src/host/validation.ts +111 -0
- package/src/host/vocabulary-validation.test.ts +60 -0
- package/src/link/README.md +115 -0
- package/src/link/barrels.ts +5 -0
- package/src/link/build-cli.ts +12 -0
- package/src/link/build.test.ts +25 -0
- package/src/link/build.ts +99 -0
- package/src/link/commonjs.test.ts +34 -0
- package/src/link/commonjs.ts +39 -0
- package/src/link/examples/server.ts +18 -0
- package/src/link/index.ts +6 -0
- package/src/link/link.browser.ts +66 -0
- package/src/link/local-relay.browser.ts +22 -0
- package/src/link/overrides.test.ts +103 -0
- package/src/link/overrides.ts +69 -0
- package/src/link/page-sources.test.ts +52 -0
- package/src/link/page-sources.ts +69 -0
- package/src/link/source.ts +25 -0
- package/src/link/storage.ts +32 -0
- package/src/link/testing/client.ts +96 -0
- package/src/link/testing/folder.ts +19 -0
- package/src/link/testing/local-client.ts +30 -0
- package/src/link/testing/local-server.ts +26 -0
- package/src/link/testing/local-worker.ts +17 -0
- package/src/link/testing/server.ts +128 -0
- package/src/link/testing/worker.ts +32 -0
- package/src/link/testing-cache.ts +20 -0
- package/src/link/testing-fixtures.ts +16 -0
- package/src/link/types.ts +27 -0
- package/src/link/validation.ts +44 -0
- package/src/link/vitest.browser.config.ts +3 -0
- package/src/markers.ts +18 -0
- package/src/publication/build.ts +27 -0
- package/src/publication/fixtures/build.mjs +2 -0
- package/src/publication/index.ts +3 -0
- package/src/publication/lock.ts +32 -0
- package/src/publication/manifest.ts +14 -0
- package/src/publication/publication.test.ts +89 -0
- package/src/publication/publish.ts +80 -0
- package/src/publication/runtime.ts +28 -0
- package/src/publication/schema.ts +13 -0
- package/src/review-schema.ts +17 -0
- package/src/schema.ts +149 -0
- package/src/storage/db.test.ts +52 -0
- package/src/storage/db.ts +64 -0
- package/src/sw/activity-router.test.ts +53 -0
- package/src/sw/activity.ts +66 -0
- package/src/sw/barrels.ts +44 -0
- package/src/sw/candidates.test.ts +9 -0
- package/src/sw/candidates.ts +14 -0
- package/src/sw/compile.test.ts +152 -0
- package/src/sw/compile.ts +92 -0
- package/src/sw/compiler-columns.ts +44 -0
- package/src/sw/compiler-internals.d.ts +8 -0
- package/src/sw/compiler-plugins.ts +18 -0
- package/src/sw/compiler.test.ts +51 -0
- package/src/sw/compiler.ts +86 -0
- package/src/sw/composition.test.ts +51 -0
- package/src/sw/composition.ts +86 -0
- package/src/sw/content-types.ts +28 -0
- package/src/sw/converted-resolver.test.ts +129 -0
- package/src/sw/converted-router.test.ts +91 -0
- package/src/sw/converted.browser.ts +31 -0
- package/src/sw/converted.test.ts +31 -0
- package/src/sw/converted.ts +64 -0
- package/src/sw/editable-sites.ts +42 -0
- package/src/sw/errors.test.ts +8 -0
- package/src/sw/errors.ts +17 -0
- package/src/sw/index.ts +7 -0
- package/src/sw/integrity.ts +10 -0
- package/src/sw/legacy-storage.ts +18 -0
- package/src/sw/link-activity.test.ts +126 -0
- package/src/sw/link-activity.ts +21 -0
- package/src/sw/link-cache.test.ts +15 -0
- package/src/sw/link-cache.ts +19 -0
- package/src/sw/link-compiler.ts +112 -0
- package/src/sw/link-folder.ts +29 -0
- package/src/sw/link-markdown.test.ts +52 -0
- package/src/sw/link-relay.ts +40 -0
- package/src/sw/link-route.test.ts +150 -0
- package/src/sw/link-route.ts +239 -0
- package/src/sw/link-source.test.ts +31 -0
- package/src/sw/link-source.ts +41 -0
- package/src/sw/markers.test.ts +33 -0
- package/src/sw/markers.ts +128 -0
- package/src/sw/module-transform.test.ts +131 -0
- package/src/sw/module-transform.ts +352 -0
- package/src/sw/package-generation.test.ts +33 -0
- package/src/sw/page-clients.test.ts +37 -0
- package/src/sw/page-clients.ts +45 -0
- package/src/sw/profile.test.ts +21 -0
- package/src/sw/profile.ts +88 -0
- package/src/sw/resolver.test.ts +183 -0
- package/src/sw/resolver.ts +220 -0
- package/src/sw/router-cache.test.ts +78 -0
- package/src/sw/router.ts +320 -0
- package/src/sw/runtime-module.test.ts +61 -0
- package/src/sw/runtime-module.ts +13 -0
- package/src/sw/source-hash.test.ts +7 -0
- package/src/sw/source-hash.ts +37 -0
- package/src/sw/storage.test.ts +108 -0
- package/src/sw/versions.ts +89 -0
- package/src/sw/worker.ts +87 -0
- package/static/README.md +15 -0
- package/static/profile.example.json +15 -0
- package/tsconfig.json +10 -0
- package/vitest.browser.config.ts +4 -0
- package/vitest.config.ts +9 -0
- package/README.md +0 -3
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
5
|
+
import { startAgentTestServer } from "./testing/server.ts";
|
|
6
|
+
import type { AgentFrameMessage } from "../../schema.ts";
|
|
7
|
+
|
|
8
|
+
const exec = promisify(execFile);
|
|
9
|
+
const session = `page-runtime-G-${process.pid}`;
|
|
10
|
+
let server: Awaited<ReturnType<typeof startAgentTestServer>>;
|
|
11
|
+
let launched = false;
|
|
12
|
+
async function browser(...args: string[]) {
|
|
13
|
+
const { stdout } = await exec("agent-browser", ["--engine", "chrome", "--session", session, ...args], { timeout: 45_000, maxBuffer: 2_000_000 });
|
|
14
|
+
return stdout.trim();
|
|
15
|
+
}
|
|
16
|
+
async function events() { return JSON.parse(await browser("get", "text", "#events")) as AgentFrameMessage[]; }
|
|
17
|
+
async function inspection() {
|
|
18
|
+
await browser("click", "#inspect");
|
|
19
|
+
return JSON.parse(await browser("get", "text", "#inspection")) as {
|
|
20
|
+
pins: number; pinColor: string; lightPins: number; overlayInRoot: boolean; highlighted: boolean; position: { left: number; top: number }; overlay: boolean;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
async function open(viewport: { width: number; height: number }) {
|
|
24
|
+
await browser("open", server.url); launched = true;
|
|
25
|
+
await browser("set", "viewport", String(viewport.width), String(viewport.height));
|
|
26
|
+
await browser("wait", "--fn", 'document.title === "AGENT-READY"');
|
|
27
|
+
await browser("wait", "--fn", 'document.querySelector("#target") !== null');
|
|
28
|
+
}
|
|
29
|
+
beforeAll(async () => { server = await startAgentTestServer(); });
|
|
30
|
+
afterAll(async () => { try { if (launched) await browser("close"); } finally { await server?.close(); } });
|
|
31
|
+
|
|
32
|
+
describe.each([{ width: 1920, height: 1080 }, { width: 2560, height: 1440 }])("page agent in Chromium $width x $height", (viewport) => {
|
|
33
|
+
it("picks a real runtime-set Modal portal and tracks its pin after removal", async () => {
|
|
34
|
+
await browser("open", `${server.url}/?modal`); launched = true;
|
|
35
|
+
await browser("set", "viewport", String(viewport.width), String(viewport.height));
|
|
36
|
+
await browser("wait", '[role="dialog"] h2');
|
|
37
|
+
await browser("click", "#pick"); await browser("click", '[role="dialog"] h2');
|
|
38
|
+
await browser("wait", "--fn", 'document.querySelector("#events").textContent.includes("selection") || document.querySelector("#error").textContent !== ""');
|
|
39
|
+
expect(await browser("get", "text", "#error")).toBe("");
|
|
40
|
+
expect((await events()).find((message) => message.type === "selection")).toMatchObject({ selection: { anchor: expect.stringContaining('[role="dialog"][aria-label="Revenue"]'), element: { source: "modal-report.tsx:4:10", componentName: "Modal" } } });
|
|
41
|
+
await browser("click", "#pins");
|
|
42
|
+
await browser("wait", "--fn", 'document.querySelector("[data-page-agent]").shadowRoot.querySelector("button") !== null');
|
|
43
|
+
expect(await inspection()).toMatchObject({ pins: 1, highlighted: false, overlayInRoot: false });
|
|
44
|
+
const position = (await inspection()).position;
|
|
45
|
+
await browser("click", "#modal-move");
|
|
46
|
+
await browser("wait", "--fn", `JSON.parse(document.querySelector("#events").textContent).filter(message => message.type === "anchors").at(-1).anchors[0].rect.top > ${position.top + 20}`);
|
|
47
|
+
expect((await inspection()).position.top).toBeCloseTo(position.top + 30, 0);
|
|
48
|
+
await browser("screenshot", resolve(`../../.tmp/R-runtime-fixes/modal-${viewport.width}.png`));
|
|
49
|
+
await browser("click", "#modal-remove");
|
|
50
|
+
await browser("wait", "--fn", 'document.querySelector("#events").textContent.includes("orphaned")');
|
|
51
|
+
expect((await events()).filter((message) => message.type === "anchors").at(-1)).toMatchObject({ anchors: [{ state: "orphaned", rect: null }] });
|
|
52
|
+
expect((await inspection()).pins).toBe(0);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("picks ordinary HTML with explicitly declared document URL context", async () => {
|
|
56
|
+
await browser("open", `${server.url}/?external`); launched = true;
|
|
57
|
+
await browser("set", "viewport", String(viewport.width), String(viewport.height));
|
|
58
|
+
await browser("wait", "--fn", 'document.title === "AGENT-READY"');
|
|
59
|
+
await browser("click", "#pick"); await browser("click", "#target");
|
|
60
|
+
await browser("wait", "--fn", 'document.querySelector("#events").textContent.includes("selection")');
|
|
61
|
+
expect((await events()).find((message) => message.type === "selection")).toMatchObject({ selection: { anchor: "#target", element: { source: `${server.url}/?external`, sourceContext: { mode: "external-document", url: `${server.url}/?external` } } } });
|
|
62
|
+
expect(await browser("get", "text", "#error")).toBe("");
|
|
63
|
+
});
|
|
64
|
+
it("resolves a compiled composite call site inside a frame and exports without picker or agent hosts", async () => {
|
|
65
|
+
await browser("open", `${server.url}/embedded`); launched = true;
|
|
66
|
+
await browser("set", "viewport", String(viewport.width), String(viewport.height));
|
|
67
|
+
await browser("frame", "#agent-frame");
|
|
68
|
+
await browser("wait", "#target");
|
|
69
|
+
await browser("click", "#pick"); await browser("click", "#target");
|
|
70
|
+
expect((await events()).find((event) => event.type === "selection")).toMatchObject({ selection: { anchor: "#target", element: { source: "report.tsx:4:10", componentName: "StatCard" } } });
|
|
71
|
+
await browser("click", "#pins");
|
|
72
|
+
expect((await inspection()).pins).toBe(1);
|
|
73
|
+
await browser("click", "#export");
|
|
74
|
+
const snapshot = await browser("get", "text", "#snapshot");
|
|
75
|
+
expect(snapshot).toMatch(/^<!doctype html>/);
|
|
76
|
+
expect(snapshot).toContain('id="target"');
|
|
77
|
+
expect(snapshot).not.toMatch(/data-page-agent|data-react-grab(?:=|\s|>)|<script/);
|
|
78
|
+
expect(await browser("get", "text", "#error")).toBe("");
|
|
79
|
+
await browser("frame", "main");
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("picks a library heading through the fork, renders isolated pins, and reports moved then orphaned anchors", async () => {
|
|
83
|
+
await open(viewport);
|
|
84
|
+
await browser("click", "#pick");
|
|
85
|
+
await browser("click", "#target");
|
|
86
|
+
await browser("wait", "--fn", 'document.querySelector("#events").textContent.includes("selection")');
|
|
87
|
+
const picked = (await events()).find((message) => message.type === "selection");
|
|
88
|
+
expect(picked).toMatchObject({ type: "selection", selection: { anchor: "#owner", element: { source: "report.tsx:8:3", componentName: "StatCard" } } });
|
|
89
|
+
await browser("click", "#pins");
|
|
90
|
+
await browser("wait", "--fn", 'document.querySelector("[data-page-agent]").shadowRoot.querySelector("button") !== null');
|
|
91
|
+
const rendered = await inspection();
|
|
92
|
+
expect(rendered).toMatchObject({ pins: 1, pinColor: "rgb(37, 99, 235)", lightPins: 0, overlayInRoot: false });
|
|
93
|
+
const found = (await events()).filter((m) => m.type === "anchors").at(-1);
|
|
94
|
+
expect(found).toMatchObject({ anchors: [{ anchor: "#owner", state: "found" }] });
|
|
95
|
+
const box = found?.type === "anchors" ? found.anchors[0]?.rect : null;
|
|
96
|
+
expect(rendered.position.left).toBeCloseTo(box!.left + box!.width, 0);
|
|
97
|
+
expect(rendered.position.top).toBeCloseTo(box!.top, 0);
|
|
98
|
+
await browser("click", "#focus-pin");
|
|
99
|
+
expect((await events()).some((m) => m.type === "focus" && m.anchor === "#owner")).toBe(true);
|
|
100
|
+
await browser("click", "#move");
|
|
101
|
+
await browser("wait", "--fn", 'document.querySelector("#events").textContent.includes("moved")');
|
|
102
|
+
expect((await events()).filter((m) => m.type === "anchors").at(-1)).toMatchObject({ anchors: [{ state: "moved" }] });
|
|
103
|
+
await browser("click", "#remove");
|
|
104
|
+
await browser("wait", "--fn", 'document.querySelector("#events").textContent.includes("orphaned")');
|
|
105
|
+
expect((await events()).filter((m) => m.type === "anchors").at(-1)).toMatchObject({ anchors: [{ anchor: "#owner", state: "orphaned", rect: null }] });
|
|
106
|
+
expect((await inspection()).pins).toBe(0);
|
|
107
|
+
expect(await browser("get", "text", "#error")).toBe("");
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it("bridges registered component anchors, scrolls, forwards shortcuts, and disposes observers", async () => {
|
|
111
|
+
await open(viewport);
|
|
112
|
+
await browser("click", "#registered-pin");
|
|
113
|
+
await browser("click", "#scroll");
|
|
114
|
+
await browser("wait", "--fn", "window.scrollY > 500");
|
|
115
|
+
expect(await inspection()).toMatchObject({ pins: 1, highlighted: false });
|
|
116
|
+
await browser("click", "#highlight");
|
|
117
|
+
expect(await inspection()).toMatchObject({ pins: 1, highlighted: true });
|
|
118
|
+
expect((await events()).filter((m) => m.type === "geometry").at(-1)).toMatchObject({ scrollY: expect.any(Number) });
|
|
119
|
+
await browser("press", "Alt+c");
|
|
120
|
+
await browser("press", "Escape");
|
|
121
|
+
expect((await events()).filter((m) => m.type === "keys").map((m) => m.key)).toEqual(["c", "Escape"]);
|
|
122
|
+
await browser("click", "#page");
|
|
123
|
+
expect((await events()).filter((m) => m.type === "selection").at(-1)).toMatchObject({ selection: { anchor: "__document__", element: { source: "report.tsx:1:1" } } });
|
|
124
|
+
await browser("click", "#dispose");
|
|
125
|
+
expect((await inspection()).overlay).toBe(false);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { AgentFrameMessage, AgentSelection, DesignHostMessage, JsonValue } from "../../schema.ts";
|
|
2
|
+
import { parseEditableSource } from "../../markers.ts";
|
|
3
|
+
import { isPageSource } from "../../host/agent-source.ts";
|
|
4
|
+
import { fiberOf, overrideCallSite, readCallSiteProps } from "./react-override.ts";
|
|
5
|
+
import { setRemoved } from "../../editing.ts";
|
|
6
|
+
|
|
7
|
+
export function resolveDesignTarget(options: { element: Element; root: Element }): { element: Element; source: string } {
|
|
8
|
+
for (let element: Element | null = options.element; element && options.root.contains(element); element = element.parentElement) {
|
|
9
|
+
const source = element.getAttribute("data-source");
|
|
10
|
+
if (source?.includes("#") && isPageSource(source)) { parseEditableSource(source); return { element, source }; }
|
|
11
|
+
}
|
|
12
|
+
for (let fiber: ReturnType<typeof fiberOf> | null = fiberOf(options.element); fiber; fiber = fiber.return) {
|
|
13
|
+
const source = fiber.memoizedProps?.["data-source"];
|
|
14
|
+
if (typeof source === "string" && source.includes("#") && isPageSource(source)) { parseEditableSource(source); return { element: options.element, source }; }
|
|
15
|
+
}
|
|
16
|
+
throw new Error("Design selection has no editable page call site");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// The panel receives scalar authored props, not React children, event handlers or renderer internals.
|
|
20
|
+
function panelProps(props: Record<string, unknown>): Record<string, JsonValue> {
|
|
21
|
+
return Object.fromEntries(Object.entries(props).filter(([name, value]) => name !== "data-source" && !name.startsWith("on") && (value === null || typeof value === "string" || typeof value === "boolean" || (typeof value === "number" && Number.isFinite(value))))) as Record<string, JsonValue>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function createDesignAgent(options: { root: HTMLElement; page: string; send: (message: AgentFrameMessage) => void }) {
|
|
25
|
+
let selected: { node: Element; source: string } | undefined;
|
|
26
|
+
const pending = new Map<string, { source: string; deletion: boolean }>();
|
|
27
|
+
function nodes(source: string): Element[] {
|
|
28
|
+
if (!selected || selected.source !== source) throw new Error("Design request does not match the live selection");
|
|
29
|
+
const matches = [...new Set([...(options.root.contains(selected.node) ? [selected.node] : []), ...[...options.root.querySelectorAll("[data-source]")].filter((node) => node.getAttribute("data-source") === source)])];
|
|
30
|
+
if (!matches.length) throw new Error("Design target is no longer rendered");
|
|
31
|
+
return matches;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
select(target: { element: Element; source: string }, selection: AgentSelection) {
|
|
35
|
+
const props = panelProps(readCallSiteProps({ node: target.element, source: target.source }));
|
|
36
|
+
selected = { node: target.element, source: target.source };
|
|
37
|
+
options.send({ type: "design-selection", selection, source: target.source, props });
|
|
38
|
+
},
|
|
39
|
+
receive(message: DesignHostMessage) {
|
|
40
|
+
if (message.type === "design-write-result") {
|
|
41
|
+
const attempt = pending.get(message.requestId);
|
|
42
|
+
if (!attempt) throw new Error(`unexpected Design write result ${message.requestId}`);
|
|
43
|
+
pending.delete(message.requestId);
|
|
44
|
+
if (attempt.deletion && message.result.status !== "applied") setRemoved(`source:${attempt.source}`, false);
|
|
45
|
+
options.send(message); return;
|
|
46
|
+
}
|
|
47
|
+
if (message.type === "design-override") {
|
|
48
|
+
try {
|
|
49
|
+
overrideCallSite({ nodes: nodes(message.source), source: message.source, props: Object.fromEntries(Object.entries(message.props).map(([name, value]) => [name, value === null ? undefined : value])) });
|
|
50
|
+
options.send({ type: "design-override-result", requestId: message.requestId, source: message.source, ok: true });
|
|
51
|
+
} catch (error) { options.send({ type: "design-override-result", requestId: message.requestId, source: message.source, ok: false, error: error instanceof Error ? error.message : String(error) }); }
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
nodes(message.source);
|
|
55
|
+
if (pending.has(message.requestId)) throw new Error(`duplicate Design write ${message.requestId}`);
|
|
56
|
+
pending.set(message.requestId, { source: message.source, deletion: message.edit.kind === "delete" });
|
|
57
|
+
if (message.edit.kind === "delete") setRemoved(`source:${message.source}`, true);
|
|
58
|
+
options.send({ type: "design-write-request", requestId: message.requestId, request: { page: message.page, source: message.source, edit: message.edit, ...(message.choose === undefined ? {} : { choose: message.choose }) } });
|
|
59
|
+
},
|
|
60
|
+
dispose() { selected = undefined; pending.clear(); },
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { init } from "@flanksource/react-grab/core";
|
|
2
|
+
import type { ReactGrabAPI } from "@flanksource/react-grab";
|
|
3
|
+
import { getFiberFromHostInstance } from "bippy";
|
|
4
|
+
import {
|
|
5
|
+
captureLocators, commentAnchor, describeElement, COMMENT_ELEMENT_HTML_LIMIT, COMMENT_ELEMENT_HTML_TRUNCATION,
|
|
6
|
+
} from "@flanksource/clicky-ui/comments";
|
|
7
|
+
import type { AgentFrameMessage, AgentHostMessage, AgentSourceContext } from "../../schema.ts";
|
|
8
|
+
import { validateAgentHostMessage } from "../../host/agent-validation.ts";
|
|
9
|
+
import { isPageElement, resolvePageOwner } from "./owner.ts";
|
|
10
|
+
import { elementRect, mountAgentOverlay } from "./overlay.ts";
|
|
11
|
+
import { createDesignAgent, resolveDesignTarget } from "./design.ts";
|
|
12
|
+
import { validateDocumentSource } from "../../host/agent-source.ts";
|
|
13
|
+
import { createReviewAgent } from "./review.ts";
|
|
14
|
+
import { REVIEW_ACTIONS } from "../../host/review/validation.ts";
|
|
15
|
+
import { validatePageSources, type PageSourceContext } from "../../link/page-sources.ts";
|
|
16
|
+
import { captureVocabulary } from "./vocabulary.ts";
|
|
17
|
+
|
|
18
|
+
export type PageAgentOptions = {
|
|
19
|
+
root: HTMLElement;
|
|
20
|
+
page: string;
|
|
21
|
+
send: (message: AgentFrameMessage) => void;
|
|
22
|
+
error: (error: Error) => void;
|
|
23
|
+
picker?: ReactGrabAPI;
|
|
24
|
+
toolbar?: boolean;
|
|
25
|
+
sourceContext?: AgentSourceContext;
|
|
26
|
+
} & PageSourceContext;
|
|
27
|
+
|
|
28
|
+
export function startPageAgent(options: PageAgentOptions) {
|
|
29
|
+
if (!options.root.isConnected || !options.page) throw new Error("page agent requires a mounted root and page path");
|
|
30
|
+
if (options.sourceContext) validateDocumentSource(options.sourceContext.url);
|
|
31
|
+
if (options.pageSources) validatePageSources(options.pageSources);
|
|
32
|
+
const design = createDesignAgent(options);
|
|
33
|
+
const api = options.picker ?? init({ enabled: true, telemetry: false, freezeReactUpdates: false });
|
|
34
|
+
const registered = new Map<string, Element>();
|
|
35
|
+
const overlay = mountAgentOverlay({ root: options.root, send: options.send, registered });
|
|
36
|
+
const review = createReviewAgent({ ...options, componentName: (element) => api.getDisplayName(element), containedAnchors: overlay.containedAnchors });
|
|
37
|
+
const plugin = `page-agent-${crypto.randomUUID()}`;
|
|
38
|
+
const previousAction = api.getToolbarState()?.defaultAction;
|
|
39
|
+
const previousEnabled = api.isEnabled();
|
|
40
|
+
let picking = false;
|
|
41
|
+
let disposed = false;
|
|
42
|
+
let version = 0;
|
|
43
|
+
let mode: "off" | "comment" | "design" = "off";
|
|
44
|
+
|
|
45
|
+
async function select(element: Element) {
|
|
46
|
+
if (element.closest("[data-react-grab-ignore]")) return;
|
|
47
|
+
picking = false;
|
|
48
|
+
const revision = ++version;
|
|
49
|
+
const componentName = api.getDisplayName(element);
|
|
50
|
+
const owner = mode === "design" ? { ...resolveDesignTarget({ element, root: options.root }), componentName: componentName ?? element.tagName.toLowerCase() } : resolvePageOwner({ element, root: options.root, componentName, fiber: getFiberFromHostInstance(element), ...(options.sourceContext ? { sourceContext: options.sourceContext } : {}) });
|
|
51
|
+
const anchor = commentAnchor(owner.element, options.root);
|
|
52
|
+
if (!anchor) throw new Error("selected page element cannot be anchored");
|
|
53
|
+
const html = owner.element.outerHTML;
|
|
54
|
+
const context = {
|
|
55
|
+
source: owner.source, componentName: owner.componentName,
|
|
56
|
+
...(options.sourceContext ? { sourceContext: options.sourceContext } : {}),
|
|
57
|
+
html: html.length <= COMMENT_ELEMENT_HTML_LIMIT ? html : `${html.slice(0, COMMENT_ELEMENT_HTML_LIMIT)}${COMMENT_ELEMENT_HTML_TRUNCATION}`,
|
|
58
|
+
locators: captureLocators(owner.element, options.root),
|
|
59
|
+
};
|
|
60
|
+
api.deactivate();
|
|
61
|
+
if (disposed || version !== revision) return;
|
|
62
|
+
overlay.highlight(mode === "design" ? anchor : null);
|
|
63
|
+
const selection = { anchor, label: describeElement(owner.element), element: context, rect: elementRect(owner.element) };
|
|
64
|
+
if (mode === "design") design.select(owner, selection); else options.send({ type: "selection", selection });
|
|
65
|
+
}
|
|
66
|
+
api.registerPlugin({ name: plugin, ...(options.toolbar === false ? { theme: { toolbar: { enabled: false } } } : {}), actions: REVIEW_ACTIONS.map((action) => ({
|
|
67
|
+
id: `review-${action}`, label: action === "mark" ? "Make reviewable" : action === "approved" ? "Approve" : action === "rejected" ? "Reject with comment" : action === "revision_requested" ? "Request revision" : action === "delete" ? "Delete source and feedback" : "Export review content",
|
|
68
|
+
enabled: ({ element }) => review.enabled() && isPageElement({ element, root: options.root }) && (action === "mark" ? !element.closest("[data-review-id]") : Boolean(element.closest("[data-review-id]"))),
|
|
69
|
+
onAction: ({ element, hideContextMenu, cleanup }) => { hideContextMenu(); cleanup(); review.action(element, action); },
|
|
70
|
+
})), hooks: {
|
|
71
|
+
onElementSelect(element) {
|
|
72
|
+
if (!picking) return;
|
|
73
|
+
void select(element).catch((error: unknown) => options.error(error instanceof Error ? error : new Error(String(error))));
|
|
74
|
+
return true;
|
|
75
|
+
},
|
|
76
|
+
onDeactivate() { picking = false; },
|
|
77
|
+
transformActionContext(context) { return { ...context, enterPromptMode: () => {
|
|
78
|
+
void select(context.element).catch((error: unknown) => options.error(error instanceof Error ? error : new Error(String(error))));
|
|
79
|
+
} }; },
|
|
80
|
+
} });
|
|
81
|
+
function pick() { picking = true; api.setEnabled(true); api.setToolbarState({ defaultAction: "comment" }); api.activate(); }
|
|
82
|
+
function receive(value: AgentHostMessage): void {
|
|
83
|
+
if (disposed) throw new Error("page agent is disposed");
|
|
84
|
+
if (value.type === "review-remove" || value.type === "review-list" || value.type === "review-select" || value.type === "review-visibility" || value.type === "review-action") { review.receive(value); return; }
|
|
85
|
+
const m = validateAgentHostMessage(value);
|
|
86
|
+
switch (m.type) {
|
|
87
|
+
case "mode":
|
|
88
|
+
if (m.mode === "design" && options.sourceContext) throw new Error("Design mode requires runtime page sources");
|
|
89
|
+
mode = m.mode;
|
|
90
|
+
if (mode !== "off") pick(); else { version++; picking = false; api.deactivate(); } break;
|
|
91
|
+
case "design-override": case "design-write": case "design-write-result":
|
|
92
|
+
if (mode !== "design") throw new Error("Design request requires Design mode");
|
|
93
|
+
design.receive(m); break;
|
|
94
|
+
case "pick": pick(); break;
|
|
95
|
+
case "page": {
|
|
96
|
+
version++; picking = false; api.deactivate();
|
|
97
|
+
const html = options.root.outerHTML;
|
|
98
|
+
options.send({ type: "selection", selection: { anchor: "__document__", label: "Whole page", rect: elementRect(options.root), element: {
|
|
99
|
+
source: options.sourceContext?.url ?? `${options.page}:1:1`, ...(options.sourceContext ? { sourceContext: options.sourceContext } : {}), componentName: "Page", locators: [],
|
|
100
|
+
html: html.length <= COMMENT_ELEMENT_HTML_LIMIT ? html : `${html.slice(0, COMMENT_ELEMENT_HTML_LIMIT)}${COMMENT_ELEMENT_HTML_TRUNCATION}`,
|
|
101
|
+
} } }); break;
|
|
102
|
+
}
|
|
103
|
+
case "pins": overlay.update(m.anchors, m.focus); break;
|
|
104
|
+
case "highlight": overlay.highlight(m.anchor); break;
|
|
105
|
+
case "scroll": {
|
|
106
|
+
const element = overlay.target(m.anchor);
|
|
107
|
+
if (!element) throw new Error(`cannot scroll to orphaned anchor ${m.anchor}`);
|
|
108
|
+
element.scrollIntoView({ behavior: m.behavior ?? "smooth", block: m.block ?? "center" });
|
|
109
|
+
if (m.offset !== undefined) window.scrollBy({ top: -m.offset, behavior: "instant" });
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
default: throw new Error(`page agent message ${m.type} requires a dedicated handler`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function keys(event: KeyboardEvent) {
|
|
116
|
+
const toggle = event.key.toLowerCase() === "c" && event.altKey && !event.ctrlKey && !event.metaKey;
|
|
117
|
+
if (event.key !== "Escape" && !toggle) return;
|
|
118
|
+
if (event.isComposing || (toggle && event.composedPath().some((node) => node instanceof Element && node.matches('input,textarea,select,[contenteditable="true"]')))) return;
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
if (event.key === "Escape") { version++; picking = false; api.deactivate(); }
|
|
121
|
+
options.send({ type: "keys", key: event.key === "Escape" ? "Escape" : "c", ctrlKey: event.ctrlKey, metaKey: event.metaKey, altKey: event.altKey, shiftKey: event.shiftKey });
|
|
122
|
+
}
|
|
123
|
+
window.addEventListener("keydown", keys, true);
|
|
124
|
+
return {
|
|
125
|
+
receive,
|
|
126
|
+
captureVocabulary(request: { ready: boolean }) {
|
|
127
|
+
if (disposed) throw new Error("page agent is disposed");
|
|
128
|
+
return captureVocabulary({ ready: request.ready, page: options.page });
|
|
129
|
+
},
|
|
130
|
+
registerAnchor(anchor: string, element: Element | null) {
|
|
131
|
+
if (!anchor || (element && !isPageElement({ element, root: options.root }))) throw new Error("registered anchor must belong to the page root");
|
|
132
|
+
if (element) {
|
|
133
|
+
const existing = registered.get(anchor);
|
|
134
|
+
if (existing && existing !== element && existing.isConnected) throw new Error(`duplicate registered anchor ${anchor}`);
|
|
135
|
+
registered.set(anchor, element);
|
|
136
|
+
} else registered.delete(anchor);
|
|
137
|
+
overlay.schedule();
|
|
138
|
+
},
|
|
139
|
+
focusAnchor(anchor: string) { options.send({ type: "focus", anchor }); },
|
|
140
|
+
dispose() {
|
|
141
|
+
disposed = true; version++; window.removeEventListener("keydown", keys, true); api.deactivate(); api.unregisterPlugin(plugin);
|
|
142
|
+
if (options.picker) { api.setToolbarState({ defaultAction: previousAction ?? "copy" }); api.setEnabled(previousEnabled); } else api.dispose();
|
|
143
|
+
overlay.dispose(); registered.clear(); design.dispose(); review.dispose();
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export type PageAgent = ReturnType<typeof startPageAgent>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { mountAgentOverlay } from "./overlay.ts";
|
|
4
|
+
|
|
5
|
+
describe("comment overlay hover and focus", () => {
|
|
6
|
+
let overlay: ReturnType<typeof mountAgentOverlay>;
|
|
7
|
+
const anchors = [{ anchor: "#target", count: 1, locators: [] }];
|
|
8
|
+
const flush = () => vi.advanceTimersByTime(20);
|
|
9
|
+
const highlight = () => overlay.host.shadowRoot!.querySelector<HTMLElement>(".highlight")!;
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
vi.useFakeTimers();
|
|
13
|
+
vi.stubGlobal("ResizeObserver", class { observe() {} disconnect() {} });
|
|
14
|
+
document.body.innerHTML = '<main><h2 id="target">Revenue</h2></main>';
|
|
15
|
+
overlay = mountAgentOverlay({ root: document.querySelector("main")!, send: vi.fn(), registered: new Map() });
|
|
16
|
+
});
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
overlay.dispose();
|
|
19
|
+
document.body.replaceChildren();
|
|
20
|
+
vi.useRealTimers();
|
|
21
|
+
vi.unstubAllGlobals();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("focuses a pin without highlighting its element", () => {
|
|
25
|
+
overlay.update(anchors, "#target");
|
|
26
|
+
flush();
|
|
27
|
+
expect(highlight().hidden).toBe(true);
|
|
28
|
+
expect(overlay.host.shadowRoot!.querySelector("button")!.getAttribute("aria-pressed")).toBe("true");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("clears hover while retaining pin focus through subsequent updates", () => {
|
|
32
|
+
overlay.update(anchors, "#target");
|
|
33
|
+
overlay.highlight("#target");
|
|
34
|
+
flush();
|
|
35
|
+
expect(highlight().hidden).toBe(false);
|
|
36
|
+
overlay.highlight(null);
|
|
37
|
+
overlay.update(anchors, "#target");
|
|
38
|
+
flush();
|
|
39
|
+
expect(highlight().hidden).toBe(true);
|
|
40
|
+
expect(overlay.host.shadowRoot!.querySelector("button")!.getAttribute("aria-pressed")).toBe("true");
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { describeElement, resolveComment } from "@flanksource/clicky-ui/comments";
|
|
2
|
+
import type { AgentAnchorState, AgentFrameMessage, AgentPin, AgentRect } from "../../schema.ts";
|
|
3
|
+
import { isPageElement } from "./owner.ts";
|
|
4
|
+
|
|
5
|
+
export function elementRect(element: Element): AgentRect {
|
|
6
|
+
const { left, top, width, height } = element.getBoundingClientRect();
|
|
7
|
+
return { left, top, width, height };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function mountAgentOverlay(options: { root: Element; send: (message: AgentFrameMessage) => void; registered: Map<string, Element> }) {
|
|
11
|
+
const host = document.createElement("div");
|
|
12
|
+
host.setAttribute("data-page-agent", "");
|
|
13
|
+
host.setAttribute("data-react-grab-ignore", "");
|
|
14
|
+
const shadow = host.attachShadow({ mode: "open" });
|
|
15
|
+
const style = document.createElement("style");
|
|
16
|
+
style.textContent = `:host{all:initial;position:fixed;inset:0;pointer-events:none;z-index:2147483646}
|
|
17
|
+
button{position:absolute;pointer-events:auto;min-width:22px;height:22px;padding:0 4px;border:1px solid white;border-radius:12px;color:white;background:#2563eb;font:600 12px system-ui;cursor:pointer;transform:translate(-50%,-50%)}
|
|
18
|
+
.highlight{position:absolute;border:2px solid #2563eb;background:#2563eb18;box-sizing:border-box;pointer-events:none}`;
|
|
19
|
+
const pins = document.createElement("div");
|
|
20
|
+
const highlight = document.createElement("div");
|
|
21
|
+
highlight.className = "highlight";
|
|
22
|
+
highlight.hidden = true;
|
|
23
|
+
shadow.append(style, pins, highlight);
|
|
24
|
+
document.documentElement.append(host);
|
|
25
|
+
let saved: AgentPin[] = [];
|
|
26
|
+
let selected: string | null = null;
|
|
27
|
+
let highlighted: string | null = null;
|
|
28
|
+
let pending = 0;
|
|
29
|
+
let last = "";
|
|
30
|
+
|
|
31
|
+
function resolve(pin: AgentPin) {
|
|
32
|
+
const registered = options.registered.get(pin.anchor);
|
|
33
|
+
const match = registered?.isConnected ? { element: registered, matchedBy: "anchor" as const, conflict: false } : resolveComment(options.root, pin.anchor, pin.locators);
|
|
34
|
+
return match && isPageElement({ element: match.element, root: options.root }) ? match : null;
|
|
35
|
+
}
|
|
36
|
+
function target(anchor: string): Element | null {
|
|
37
|
+
if (anchor === "__document__") return options.root;
|
|
38
|
+
return resolve(saved.find((pin) => pin.anchor === anchor) ?? { anchor, count: 1, locators: [] })?.element ?? null;
|
|
39
|
+
}
|
|
40
|
+
function drawPin(pin: AgentPin, index: number): AgentAnchorState {
|
|
41
|
+
const match = resolve(pin);
|
|
42
|
+
if (!match) return { anchor: pin.anchor, state: "orphaned", label: pin.anchor, rect: null };
|
|
43
|
+
const box = elementRect(match.element);
|
|
44
|
+
const button = document.createElement("button");
|
|
45
|
+
button.type = "button";
|
|
46
|
+
button.textContent = String(index + 1);
|
|
47
|
+
button.title = `${describeElement(match.element)} (${pin.count})`;
|
|
48
|
+
button.setAttribute("aria-label", `Open ${pin.count} comments on ${describeElement(match.element)}`);
|
|
49
|
+
button.setAttribute("aria-pressed", String(selected === pin.anchor));
|
|
50
|
+
button.style.left = `${box.left + box.width}px`;
|
|
51
|
+
button.style.top = `${box.top}px`;
|
|
52
|
+
button.addEventListener("click", () => options.send({ type: "focus", anchor: pin.anchor }));
|
|
53
|
+
pins.append(button);
|
|
54
|
+
return { anchor: pin.anchor, state: match.matchedBy === "anchor" && !match.conflict ? "found" : "moved", label: describeElement(match.element), rect: box };
|
|
55
|
+
}
|
|
56
|
+
function recompute() {
|
|
57
|
+
pending = 0;
|
|
58
|
+
pins.replaceChildren();
|
|
59
|
+
const states = saved.map(drawPin);
|
|
60
|
+
const element = highlighted ? target(highlighted) : null;
|
|
61
|
+
highlight.hidden = !element;
|
|
62
|
+
if (element) for (const [key, value] of Object.entries(elementRect(element))) highlight.style.setProperty(key, `${value}px`);
|
|
63
|
+
const geometry = { type: "geometry" as const, scrollX: window.scrollX, scrollY: window.scrollY, width: window.innerWidth, height: window.innerHeight };
|
|
64
|
+
const state = JSON.stringify([states, geometry]);
|
|
65
|
+
if (state !== last) { last = state; options.send({ type: "anchors", anchors: states }); options.send(geometry); }
|
|
66
|
+
}
|
|
67
|
+
function schedule() { if (!pending) pending = requestAnimationFrame(recompute); }
|
|
68
|
+
const observer = new MutationObserver(schedule);
|
|
69
|
+
observer.observe(options.root, { subtree: true, childList: true, characterData: true, attributes: true });
|
|
70
|
+
observer.observe(options.root.ownerDocument.body, { subtree: true, childList: true, characterData: true, attributes: true });
|
|
71
|
+
const resize = new ResizeObserver(schedule);
|
|
72
|
+
resize.observe(options.root);
|
|
73
|
+
window.addEventListener("scroll", schedule, true);
|
|
74
|
+
window.addEventListener("resize", schedule);
|
|
75
|
+
schedule();
|
|
76
|
+
return {
|
|
77
|
+
host, target, schedule,
|
|
78
|
+
containedAnchors(node: Element): string[] {
|
|
79
|
+
return [...new Set(saved.filter((pin) => {
|
|
80
|
+
const element = target(pin.anchor);
|
|
81
|
+
return element !== null && node.contains(element);
|
|
82
|
+
}).map((pin) => pin.anchor))];
|
|
83
|
+
},
|
|
84
|
+
update(anchors: AgentPin[], focus?: string | null) { saved = anchors; if (focus !== undefined) selected = focus; last = ""; schedule(); },
|
|
85
|
+
highlight(anchor: string | null) { highlighted = anchor; schedule(); },
|
|
86
|
+
dispose() {
|
|
87
|
+
observer.disconnect(); resize.disconnect(); cancelAnimationFrame(pending);
|
|
88
|
+
window.removeEventListener("scroll", schedule, true); window.removeEventListener("resize", schedule); host.remove();
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { resolvePageOwner } from "./owner.ts";
|
|
4
|
+
|
|
5
|
+
describe("agent page owner", () => {
|
|
6
|
+
it("resolves a library child to its nearest page marker and keeps the library name", () => {
|
|
7
|
+
document.body.innerHTML = '<main data-source="report.tsx:8:3"><h2>Revenue</h2></main>';
|
|
8
|
+
const element = document.querySelector("h2")!;
|
|
9
|
+
expect(resolvePageOwner({ element, root: document.body, componentName: "StatCard", fiber: null })).toEqual({
|
|
10
|
+
element: element.parentElement, source: "report.tsx:8:3", componentName: "StatCard",
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("uses the library fiber's page call site when there is no marked ancestor", () => {
|
|
15
|
+
document.body.innerHTML = "<h2>Revenue</h2>";
|
|
16
|
+
const element = document.querySelector("h2")!;
|
|
17
|
+
const library = { _debugSource: { fileName: "report.tsx", lineNumber: 12, columnNumber: 7 }, _debugOwner: null };
|
|
18
|
+
expect(resolvePageOwner({ element, root: document.body, componentName: "StatCard", fiber: {
|
|
19
|
+
_debugSource: { fileName: "/node_modules/facet/Card.tsx", lineNumber: 4, columnNumber: 2 }, _debugOwner: library,
|
|
20
|
+
} })).toEqual({ element, source: "report.tsx:12:7", componentName: "StatCard" });
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it.each(["/entry/generated.tsx:1:1", "/node_modules/facet/Card.tsx:2:3", "https://runtime.example/npm/@acme/library@1.0.0/Card.js:2:3", "report.tsx:0:1"])("rejects non-page marker %s", (source) => {
|
|
24
|
+
document.body.innerHTML = `<main data-source="${source}"><h2>Revenue</h2></main>`;
|
|
25
|
+
expect(() => resolvePageOwner({ element: document.querySelector("h2")!, root: document.body, componentName: "StatCard", fiber: null })).toThrow(/page source/);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("rejects picks outside the page root", () => {
|
|
29
|
+
document.body.innerHTML = "<main></main><aside>outside</aside>";
|
|
30
|
+
expect(() => resolvePageOwner({ element: document.querySelector("aside")!, root: document.querySelector("main")!, componentName: null, fiber: null })).toThrow(/outside/);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("resolves a portal through its page fiber while rejecting a different React root", () => {
|
|
34
|
+
document.body.innerHTML = '<main></main><aside data-source="report.tsx:12:7">Portal</aside>';
|
|
35
|
+
const root = document.querySelector("main")!;
|
|
36
|
+
const element = document.querySelector("aside")!;
|
|
37
|
+
const page = { _debugSource: { fileName: "report.tsx", lineNumber: 12, columnNumber: 7 }, return: { stateNode: { containerInfo: root } } };
|
|
38
|
+
expect(resolvePageOwner({ element, root, componentName: "Modal", fiber: { return: page } })).toEqual({ element, source: "report.tsx:12:7", componentName: "Modal" });
|
|
39
|
+
expect(() => resolvePageOwner({ element, root, componentName: "Modal", fiber: { ...page, return: { stateNode: { containerInfo: document.body } } } })).toThrow(/outside/);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it.each(["data-page-agent", "data-react-grab", "data-react-grab-ignore"])("rejects %s DOM even with page fiber metadata", (attribute) => {
|
|
43
|
+
document.body.innerHTML = `<main><aside ${attribute}><h2 data-source="report.tsx:12:7">Overlay</h2></aside></main>`;
|
|
44
|
+
const root = document.querySelector("main")!;
|
|
45
|
+
const host = document.querySelector("aside")!;
|
|
46
|
+
const fiber = { _debugSource: { fileName: "report.tsx", lineNumber: 12, columnNumber: 7 }, return: { stateNode: { containerInfo: root } } };
|
|
47
|
+
expect(() => resolvePageOwner({ element: document.querySelector("h2")!, root, componentName: "Modal", fiber })).toThrow(/outside/);
|
|
48
|
+
const shadowChild = document.createElement("h2");
|
|
49
|
+
host.attachShadow({ mode: "open" }).append(shadowChild);
|
|
50
|
+
expect(() => resolvePageOwner({ element: shadowChild, root, componentName: "Modal", fiber })).toThrow(/outside/);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("rejects an owner call site without a column instead of inventing a source position", () => {
|
|
54
|
+
document.body.innerHTML = "<h2>Revenue</h2>";
|
|
55
|
+
expect(() => resolvePageOwner({ element: document.querySelector("h2")!, root: document.body, componentName: "StatCard", fiber: {
|
|
56
|
+
_debugSource: { fileName: "report.tsx", lineNumber: 12 },
|
|
57
|
+
} })).toThrow(/page source/);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("uses an explicitly declared document URL for ordinary HTML and keeps runtime resolution strict", () => {
|
|
61
|
+
document.body.innerHTML = "<h2>Report</h2>";
|
|
62
|
+
const options = { element: document.querySelector("h2")!, root: document.body, componentName: null, fiber: null };
|
|
63
|
+
const sourceContext = { mode: "external-document" as const, url: "https://example.com/report" };
|
|
64
|
+
expect(resolvePageOwner({ ...options, sourceContext })).toMatchObject({ source: sourceContext.url, element: options.element });
|
|
65
|
+
expect(() => resolvePageOwner(options)).toThrow(/page source/);
|
|
66
|
+
expect(() => resolvePageOwner({ ...options, sourceContext: { ...sourceContext, url: "javascript:alert(1)" } })).toThrow();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("resolves React 19 owner creation stacks and ignores library frames", () => {
|
|
70
|
+
document.body.innerHTML = "<h2>Revenue</h2>";
|
|
71
|
+
const element = document.querySelector("h2")!;
|
|
72
|
+
const stack = new Error("react-stack-top-frame");
|
|
73
|
+
stack.stack = "Error: react-stack-top-frame\n at StatCard (http://runtime.test/node_modules/facet/Card.js:4:2)\n at Report (http://runtime.test/pages/report.tsx:12:7)";
|
|
74
|
+
expect(resolvePageOwner({ element, root: document.body, componentName: "StatCard", fiber: { _debugStack: stack } })).toEqual({
|
|
75
|
+
element, source: "http://runtime.test/pages/report.tsx:12:7", componentName: "StatCard",
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { parseStack } from "bippy/source";
|
|
2
|
+
import { getFiberFromHostInstance } from "bippy";
|
|
3
|
+
import { isPageSource, validateDocumentSource } from "../../host/agent-source.ts";
|
|
4
|
+
import type { AgentSourceContext } from "../../schema.ts";
|
|
5
|
+
|
|
6
|
+
export type OwnerFiber = {
|
|
7
|
+
_debugSource?: { fileName: string; lineNumber: number; columnNumber?: number } | null;
|
|
8
|
+
_debugOwner?: OwnerFiber | null;
|
|
9
|
+
return?: OwnerFiber | null;
|
|
10
|
+
_debugStack?: Error | null;
|
|
11
|
+
stateNode?: Node | { containerInfo: Node } | null;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function isPageElement(options: { element: Element; root: Element; fiber?: OwnerFiber | null }): boolean {
|
|
15
|
+
if (!options.element.isConnected || options.element.ownerDocument !== options.root.ownerDocument) return false;
|
|
16
|
+
for (let element: Element | null = options.element; element; ) {
|
|
17
|
+
if (element.closest("[data-page-agent],[data-react-grab],[data-react-grab-ignore]")) return false;
|
|
18
|
+
const tree = element.getRootNode();
|
|
19
|
+
element = tree instanceof ShadowRoot ? tree.host : null;
|
|
20
|
+
}
|
|
21
|
+
if (options.root.contains(options.element)) return true;
|
|
22
|
+
const visited = new Set<OwnerFiber>();
|
|
23
|
+
for (let fiber: OwnerFiber | null | undefined = options.fiber === undefined ? getFiberFromHostInstance(options.element) : options.fiber; fiber && !visited.has(fiber); fiber = fiber.return) {
|
|
24
|
+
visited.add(fiber);
|
|
25
|
+
const node = fiber.stateNode;
|
|
26
|
+
if (node instanceof Node && options.root.contains(node)) return true;
|
|
27
|
+
if (node && "containerInfo" in node && node.containerInfo === options.root) return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function resolvePageOwner(options: { element: Element; root: Element; componentName: string | null; fiber: OwnerFiber | null; sourceContext?: AgentSourceContext }) {
|
|
33
|
+
if (!isPageElement(options)) throw new Error("picker selected outside the page root");
|
|
34
|
+
if (options.sourceContext) {
|
|
35
|
+
validateDocumentSource(options.sourceContext.url);
|
|
36
|
+
return { element: options.element, source: options.sourceContext.url, componentName: options.componentName ?? options.element.tagName.toLowerCase() };
|
|
37
|
+
}
|
|
38
|
+
for (let element: Element | null = options.element; element && isPageElement({ element, root: options.root }); element = element.parentElement) {
|
|
39
|
+
const source = element.getAttribute("data-source");
|
|
40
|
+
if (source && isPageSource(source)) return { element, source, componentName: options.componentName ?? element.tagName.toLowerCase() };
|
|
41
|
+
}
|
|
42
|
+
const pending = [options.fiber];
|
|
43
|
+
const visited = new Set<OwnerFiber>();
|
|
44
|
+
while (pending.length) {
|
|
45
|
+
const fiber = pending.shift();
|
|
46
|
+
if (!fiber || visited.has(fiber)) continue;
|
|
47
|
+
visited.add(fiber);
|
|
48
|
+
const source = fiber._debugSource;
|
|
49
|
+
const location = source ? `${source.fileName}:${source.lineNumber}:${source.columnNumber}` : "";
|
|
50
|
+
if (isPageSource(location)) return { element: options.element, source: location, componentName: options.componentName ?? options.element.tagName.toLowerCase() };
|
|
51
|
+
if (fiber._debugStack?.stack) {
|
|
52
|
+
const frame = parseStack(fiber._debugStack.stack).find((frame) => isPageSource(`${frame.fileName}:${frame.lineNumber}:${frame.columnNumber}`));
|
|
53
|
+
if (frame) return { element: options.element, source: `${frame.fileName}:${frame.lineNumber}:${frame.columnNumber}`, componentName: options.componentName ?? options.element.tagName.toLowerCase() };
|
|
54
|
+
}
|
|
55
|
+
pending.push(fiber._debugOwner ?? null, fiber.return ?? null);
|
|
56
|
+
}
|
|
57
|
+
throw new Error("picker could not resolve a page source location for the selected element");
|
|
58
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { CommentAnchorBridge, CommentProvider, strictAnchorResolver } from "@flanksource/clicky-ui/comments";
|
|
3
|
+
import type { PageAgent } from "./index.ts";
|
|
4
|
+
|
|
5
|
+
export function PageAgentProvider({ agent, children }: { agent: PageAgent; children: ReactNode }) {
|
|
6
|
+
return (
|
|
7
|
+
<CommentProvider comments={[]} config={{ statuses: [] }} resolveAnchor={strictAnchorResolver}
|
|
8
|
+
onScrollToAnchor={(anchor, options) => { agent.receive({ type: "scroll", anchor, ...options }); return true; }}>
|
|
9
|
+
<CommentAnchorBridge registerAnchor={agent.registerAnchor} focusAnchor={agent.focusAnchor}>
|
|
10
|
+
{children}
|
|
11
|
+
</CommentAnchorBridge>
|
|
12
|
+
</CommentProvider>
|
|
13
|
+
);
|
|
14
|
+
}
|