{
+ const li_focused = list_ref.current?.matches(":focus-within") || list_ref.current?.contains(e.relatedTarget)
+
+ if (
+ !li_focused ||
+ // or the focus is on the list itself
+ e.relatedTarget === list_ref.current
+ )
+ setOpen(false)
+ }}
+ >
+ ${open
+ ? html`
+ <${InputContextMenuItem} tag="delete" contents="Delete cell" title="Delete cell" onClick=${on_delete} setOpen=${setOpen} />
+
+ <${InputContextMenuItem}
+ title=${running_disabled ? "Enable and run the cell" : "Disable this cell, and all cells that depend on it"}
+ tag=${running_disabled ? "enable_cell" : "disable_cell"}
+ contents=${running_disabled ? html`Enable cell` : html`Disable cell`}
+ onClick=${toggle_running_disabled}
+ setOpen=${setOpen}
+ />
+ ${any_logs
+ ? html`<${InputContextMenuItem}
+ title=${show_logs ? "Show cell logs" : "Hide cell logs"}
+ tag=${show_logs ? "hide_logs" : "show_logs"}
+ contents=${show_logs ? "Hide logs" : "Show logs"}
+ onClick=${toggle_logs}
+ setOpen=${setOpen}
+ />`
+ : null}
+ ${is_copy_output_supported()
+ ? html`<${InputContextMenuItem}
+ tag="copy_output"
+ contents="Copy output"
+ title="Copy the output of this cell to the clipboard."
+ onClick=${copy_output}
+ setOpen=${setOpen}
+ />`
+ : null}
+
+ <${InputContextMenuItem}
+ title=${skip_as_script
+ ? "This cell is currently stored in the notebook file as a Julia comment. Click here to disable."
+ : "Store this code in the notebook file as a Julia comment. This way, it will not run when the notebook runs as a script outside of Pluto."}
+ tag=${skip_as_script ? "run_as_script" : "skip_as_script"}
+ contents=${skip_as_script ? html`Enable in file` : html`Disable in file`}
+ onClick=${toggle_skip_as_script}
+ setOpen=${setOpen}
+ />
+