123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111openCode_mirrormoduleTooltip_view=structtypet=Jv.tinclude(Jv.Id:Jv.CONVwithtypet:=t)letdomt=Jv.gett"dom"|>Brr.El.of_jvtypeoffset={x:int;y:int}typecoords={left:int;right:int;top:int;bottom:int}letoffset_of_jvo={x=Jv.Int.geto"x";y=Jv.Int.geto"y"}letoffset_to_jv{x;y}=leto=Jv.obj[||]inJv.Int.seto"x"x;Jv.Int.seto"y"y;olet_coords_of_jvo={left=Jv.Int.geto"left";right=Jv.Int.geto"right";top=Jv.Int.geto"top";bottom=Jv.Int.geto"bottom";}letcoords_to_jv{left;right;top;bottom}=leto=Jv.obj[||]inJv.Int.seto"left"left;Jv.Int.seto"right"right;Jv.Int.seto"top"top;Jv.Int.seto"bottom"bottom;oletoffsett=Jv.gett"offset"|>offset_of_jvletcreate~dom?offset?get_coords?overlap?mount?update?positioned()=letget_coords=Option.map(funget_coords->Jv.callback~arity:1(funpos->get_coords(Jv.to_intpos)|>coords_to_jv))get_coordsinleto=Jv.obj[||]inJv.seto"dom"(Brr.El.to_jvdom);Jv.set_if_someo"offset"@@Option.mapoffset_to_jvoffset;Jv.set_if_someo"getCoords"get_coords;Jv.Bool.set_if_someo"overlap"overlap;Jv.set_if_someo"mount"@@Option.map(funmount->Jv.callback~arity:1(funview->mount(View.EditorView.of_jvview)))mount;Jv.set_if_someo"update"@@Option.map(funupdate->Jv.callback~arity:1(funview_up->update(View.EditorView.Update.of_jvview_up)))update;Jv.set_if_someo"positioned"@@Option.map(Jv.callback~arity:1)positioned;oendmoduleTooltip=structtypet=Jv.tinclude(Jv.Id:Jv.CONVwithtypet:=t)letpost=Jv.Int.gett"pos"letend_t=Jv.to_optionJv.to_int@@Jv.gett"end"letcreate~pos?end_~create?above?strict_side?arrow()=leto=Jv.obj[||]inJv.Int.seto"pos"pos;Jv.Int.set_if_someo"end"end_;Jv.seto"create"@@Jv.callback~arity:1(funview->create(View.EditorView.of_jvview)|>Tooltip_view.to_jv);Jv.Bool.set_if_someo"above"above;Jv.Bool.set_if_someo"strictSide"strict_side;Jv.Bool.set_if_someo"arrow"arrow;oendtypehover_config=Jv.tlethover_config?hide_on_change?hover_time()=leto=Jv.obj[||]inJv.Bool.set_if_someo"hide_on_change"hide_on_change;Jv.Int.set_if_someo"hover_time"hover_time;olethover_tooltip?configsource=(* let g = Jv.get Jv.global "__CM__hoverTooltip" in *)letsource=Jv.callback~arity:3@@funviewposside->letfut=source~view:(View.EditorView.of_jvview)~pos:(Jv.to_intpos)~side:(Jv.to_intside)inletfut=Fut.map(funv->Okv)futinFut.to_promisefut~ok:(funt->Option.value~default:Jv.null(Option.mapTooltip.to_jvt))inletargs=ifOption.is_noneconfigthen[|source|]else[|source;Option.getconfig|]inJv.callJv.global"__CM__hoverTooltip"args|>Extension.of_jv