/* * What the help shows besides its button (help-button.jsx): the help at More (More's "How do I…?" * without the button), the note on More once the reader took the button out of the toolbar, and the * card of "Show me" (help-guide.jsx). Loaded with the help (help-module.js). */ import React, { useEffect } from "react"; import { menuLabels } from "./menus.js"; import { Popover } from "./popover.jsx"; import { GuideCard } from "./help-guide.jsx"; import { HelpPanel, helpReport } from "./help-panel.jsx"; import { HELP_TEXTS, helpText } from "./help-topics.js"; /** * The note on More after the reader took the button out of the toolbar, until the next press or key. * @param {{ text: string, more: React.RefObject, onEnd: () => void }} props */ function MovedNote({ text, more, onEnd }) { useEffect(() => { const doc = more.current?.ownerDocument; if (!doc) { return undefined; } doc.addEventListener("pointerdown", onEnd, true); doc.addEventListener("keydown", onEnd, true); return () => { doc.removeEventListener("pointerdown", onEnd, true); doc.removeEventListener("keydown", onEnd, true); }; }, [more, onEnd]); return ( } */ (more)} onClose={onEnd} role="tooltip" align="end" passive className="pk-help-moved">

{text}

); } /** * The help at More, the note on More and the card of "Show me", as the help's state asks for them. * @param {{ ctx: import("./help-button.jsx").HelpCtx }} props */ export function HelpExtras({ ctx }) { const { help } = ctx.props; const labels = menuLabels(ctx.props.labels); const report = helpReport(ctx); return ( <> {help.atMore ? ( } */ (ctx.more)} onClose={help.closeAtMore} label={labels.helpButton} role="dialog" align="end" className="pk-help-menu"> ) : null} {help.hint ? : null} {help.guide ? help.setGuide({ ...help.guide, at })} onEnd={help.endGuide} /> : null} ); }