@singapore-editor/plugin-ui 0.1.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/README.md +27 -0
- package/dist/anchoredSurface.d.ts +48 -0
- package/dist/anchoredSurface.d.ts.map +1 -0
- package/dist/anchoredSurface.js +140 -0
- package/dist/anchoredSurface.js.map +1 -0
- package/dist/codeTokens.d.ts +24 -0
- package/dist/codeTokens.d.ts.map +1 -0
- package/dist/codeTokens.js +78 -0
- package/dist/codeTokens.js.map +1 -0
- package/dist/hoverController.d.ts +30 -0
- package/dist/hoverController.d.ts.map +1 -0
- package/dist/hoverController.js +277 -0
- package/dist/hoverController.js.map +1 -0
- package/dist/hoverParticipant.d.ts +48 -0
- package/dist/hoverParticipant.d.ts.map +1 -0
- package/dist/hoverParticipant.js +2 -0
- package/dist/hoverPlugin.d.ts +14 -0
- package/dist/hoverPlugin.d.ts.map +1 -0
- package/dist/hoverPlugin.js +49 -0
- package/dist/hoverPlugin.js.map +1 -0
- package/dist/hoverRegistry.d.ts +7 -0
- package/dist/hoverRegistry.d.ts.map +1 -0
- package/dist/hoverRegistry.js +24 -0
- package/dist/hoverRegistry.js.map +1 -0
- package/dist/hoverToken.d.ts +9 -0
- package/dist/hoverToken.d.ts.map +1 -0
- package/dist/hoverToken.js +17 -0
- package/dist/hoverToken.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/markdownTooltip.d.ts +12 -0
- package/dist/markdownTooltip.d.ts.map +1 -0
- package/dist/markdownTooltip.js +282 -0
- package/dist/markdownTooltip.js.map +1 -0
- package/dist/offsetRange.d.ts +24 -0
- package/dist/offsetRange.d.ts.map +1 -0
- package/dist/offsetRange.js +81 -0
- package/dist/offsetRange.js.map +1 -0
- package/dist/styles.d.ts +13 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +39 -0
- package/dist/styles.js.map +1 -0
- package/dist/tooltip.d.ts +71 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +786 -0
- package/dist/tooltip.js.map +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":[],"sources":["../src/tooltip.ts"],"sourcesContent":["import type { EditorTheme } from '@singapore-editor/core/rendering'\n\nimport { createAnchoredSurface, type AnchoredSurfacePlacement } from './anchoredSurface'\nimport type { TooltipCodeTokenizer } from './codeTokens'\nimport { renderTooltipMarkdown } from './markdownTooltip'\nimport { HOVER_COLORS, HOVER_THEME_VARIABLES } from './styles'\n\n/** The full pointer-settle delay. Semantic requests begin halfway through it. */\nexport const HOVER_REQUEST_DEBOUNCE_MS = 300\nexport const HOVER_ASYNC_DISPATCH_DELAY_MS = HOVER_REQUEST_DEBOUNCE_MS / 2\nexport const HOVER_LOADING_DELAY_MS = HOVER_REQUEST_DEBOUNCE_MS * 3\nexport const TOOLTIP_HIDE_DELAY_MS = 300\nexport const COPY_BUTTON_RESET_DELAY_MS = 1200\n\nconst TOOLTIP_GAP_PX = 8\nconst TOOLTIP_VIEWPORT_MARGIN_PX = 12\nconst TOOLTIP_MIN_WIDTH_PX = 150\nconst TOOLTIP_MIN_HEIGHT_PX = 32\nconst TOOLTIP_MIN_MAX_HEIGHT_PX = 250\nconst TOOLTIP_MAX_WIDTH_FRACTION = 0.66\nconst TOOLTIP_POINTER_INTENT_TOLERANCE_PX = 4\nconst TOOLTIP_RESIZE_HANDLE_PX = 5\nconst TOOLTIP_SCROLL_STEP_PX = 30\nconst SVG_NS = 'http://www.w3.org/2000/svg'\nconst TOOLTIP_THEME_VARIABLES = [\n '--editor-background',\n '--editor-popup-background',\n '--editor-foreground',\n '--editor-caret-color',\n '--editor-font-family',\n '--editor-font-size',\n '--editor-row-height',\n ...HOVER_THEME_VARIABLES,\n '--editor-syntax-bracket',\n '--editor-syntax-comment',\n '--editor-syntax-keyword',\n '--editor-syntax-number',\n '--editor-syntax-string',\n '--editor-syntax-type',\n] as const\n\ntype TooltipDimensions = {\n readonly width: number\n readonly height: number\n}\n\ntype TooltipResizeEdge = 'right' | 'top' | 'bottom'\n\ntype TooltipResizeState = {\n readonly edge: TooltipResizeEdge\n readonly startX: number\n readonly startY: number\n readonly startWidth: number\n readonly startHeight: number\n readonly maxWidth: number\n readonly maxHeight: number\n}\n\nconst lastTooltipDimensions = new WeakMap<Document, TooltipDimensions>()\n\nexport type TooltipAction = {\n readonly label: string\n readonly run: () => void | Promise<void>\n}\n\n/** A place a note points at, opened by the host: the other half of a duplicate, a related site. */\nexport type TooltipNoteLink = {\n /** What is clicked, such as `file.ts(12, 3): `. */\n readonly label: string\n readonly text: string\n open(): void\n}\n\n/** One line under the hover text, laid out as a VS Code marker: a diagnostic, a warning. */\nexport type TooltipNote = {\n /** Shown as written, so a multi-line message keeps its lines. */\n readonly text: string\n /** Who raised it, and its code, shown muted after the message as VS Code does. */\n readonly source?: string\n readonly code?: string\n /** Makes the code a link to its documentation. */\n readonly codeHref?: string\n readonly related?: readonly TooltipNoteLink[]\n readonly actions?: readonly TooltipAction[]\n}\n\n/** One row group of the tooltip; shown in the order given. */\nexport type TooltipPart = {\n readonly markdown?: string\n readonly notes?: readonly TooltipNote[]\n readonly actions?: readonly TooltipAction[]\n}\n\nexport type TooltipShowOptions = {\n readonly anchor: DOMRect\n /** A single Markdown body, for a surface with one thing to say. */\n readonly hoverText: string | null\n readonly parts?: readonly TooltipPart[]\n readonly theme: EditorTheme | null\n readonly loading?: boolean\n readonly focus?: boolean\n readonly preferredPlacement?: AnchoredSurfacePlacement\n}\n\nexport type TooltipOptions = {\n readonly document: Document\n readonly themeSource: HTMLElement\n readonly reentryElement: HTMLElement\n readonly markdownCodeBackground?: boolean\n readonly classNamespace?: string\n readonly codeTokenizer?: TooltipCodeTokenizer | null\n onDidHide?(): void\n onRequestEditorFocus?(): void\n}\n\nexport type TooltipController = {\n show(options: TooltipShowOptions): void\n reanchor(anchor: DOMRect): void\n hide(): void\n scheduleHide(): void\n cancelHide(): void\n containsTarget(target: EventTarget | null): boolean\n /** Keeps a sticky hover only while the pointer is inside it or is still moving closer to it. */\n shouldKeepForPointer(clientX: number, clientY: number): boolean\n dispose(): void\n}\n\nexport function createTooltipController(options: TooltipOptions): TooltipController {\n const { document, themeSource, reentryElement } = options\n const classNamespace = options.classNamespace ?? 'plugin'\n const tooltip = createTooltipElement(document, classNamespace)\n document.body.append(tooltip)\n\n let actionRows = new WeakMap<TooltipAction, HTMLElement>()\n let hideTimer: ReturnType<typeof setTimeout> | null = null\n let pointerDown = false\n let keyboardFocusOwned = false\n let resize: TooltipResizeState | null = null\n let disposed = false\n let anchorRect: DOMRect | null = null\n let placement: AnchoredSurfacePlacement = 'top'\n let closestPointerDistance: number | null = null\n\n const surface = createAnchoredSurface({\n element: tooltip,\n anchorClassName: tooltipClassName(classNamespace, 'anchor'),\n preferredPlacement: 'top',\n gapPx: TOOLTIP_GAP_PX,\n viewportMarginPx: TOOLTIP_VIEWPORT_MARGIN_PX,\n maxHeightPx: () => tooltipMaximumHeight(reentryElement, document),\n onPlaced: (maxHeightPx, nextPlacement) => {\n placement = nextPlacement\n setTooltipBodyMaxHeight(tooltip, maxHeightPx)\n updateResizeHandles(tooltip, nextPlacement, classNamespace)\n },\n })\n\n const cancelHide = (): void => {\n if (!hideTimer) return\n\n clearTimeout(hideTimer)\n hideTimer = null\n }\n\n const hide = (): void => {\n const restoreFocus = keyboardFocusOwned && tooltip.contains(document.activeElement)\n cancelHide()\n pointerDown = false\n keyboardFocusOwned = false\n resize = null\n closestPointerDistance = null\n tooltip.hidden = true\n anchorRect = null\n surface.release()\n tooltip.replaceChildren()\n actionRows = new WeakMap()\n if (restoreFocus) options.onRequestEditorFocus?.()\n options.onDidHide?.()\n }\n\n const scheduleHide = (): void => {\n if (pointerDown || resize) return\n if (hideTimer) clearTimeout(hideTimer)\n\n // @justification A pointer grace period before the hover goes away, cancelled by re-entry;\n // it schedules no editor work.\n hideTimer = setTimeout(() => {\n hideTimer = null\n hide()\n }, TOOLTIP_HIDE_DELAY_MS)\n }\n\n const show = (showOptions: TooltipShowOptions): void => {\n const focusState = tooltipFocusState(tooltip, document.activeElement)\n const scrollState = tooltipScrollState(tooltip)\n const anchorChanged = !anchorRect || !sameRect(anchorRect, showOptions.anchor)\n if (anchorChanged) closestPointerDistance = null\n anchorRect = showOptions.anchor\n const parts = showOptions.parts ?? []\n const hasNotes = parts.some((part) => part.notes && part.notes.length > 0)\n placement = showOptions.preferredPlacement ?? (hasNotes ? 'bottom' : 'top')\n syncEditorThemeVariables(tooltip, themeSource)\n applyTooltipDimensions(tooltip, reentryElement, tooltip.hidden !== false)\n renderTooltip(tooltip, {\n actionRows,\n hoverText: showOptions.hoverText,\n parts,\n theme: showOptions.theme,\n loading: showOptions.loading ?? false,\n markdownCodeBackground: options.markdownCodeBackground ?? false,\n classNamespace,\n codeTokenizer: options.codeTokenizer ?? null,\n })\n surface.place(showOptions.anchor, placement)\n restoreTooltipScroll(tooltip, scrollState)\n restoreTooltipFocus(tooltip, focusState, showOptions.focus ?? false)\n if (showOptions.focus) keyboardFocusOwned = true\n }\n\n const reanchor = (nextAnchor: DOMRect): void => {\n if (tooltip.hidden) return\n\n anchorRect = nextAnchor\n closestPointerDistance = null\n surface.place(nextAnchor, placement)\n }\n\n const containsTarget = (target: EventTarget | null): boolean => {\n if (!(target instanceof Node)) return false\n return tooltip.contains(target)\n }\n\n const shouldKeepForPointer = (clientX: number, clientY: number): boolean => {\n if (tooltip.hidden || !anchorRect) return false\n if (pointerDown || resize) return true\n if (tooltip.contains(document.activeElement)) return true\n if (selectionInsideTooltip(document, tooltip)) return true\n\n const tooltipRect = tooltip.getBoundingClientRect()\n const distance = pointToRectDistance(tooltipRect, clientX, clientY)\n if (rectContainsPoint(tooltipRect, clientX, clientY)) {\n closestPointerDistance = 0\n return true\n }\n if (rectContainsPoint(anchorRect, clientX, clientY)) {\n closestPointerDistance = distance\n return true\n }\n if (closestPointerDistance === null) return false\n if (distance > closestPointerDistance + TOOLTIP_POINTER_INTENT_TOLERANCE_PX) return false\n\n closestPointerDistance = Math.min(closestPointerDistance, distance)\n return true\n }\n\n const handleTooltipPointerEnter = (): void => cancelHide()\n\n const handleTooltipPointerLeave = (event: PointerEvent): void => {\n if (pointerDown || resize) return\n if (targetInsideElement(reentryElement, event.relatedTarget)) return\n scheduleHide()\n }\n\n const handleTooltipPointerDown = (event: PointerEvent): void => {\n if (event.button !== 0) return\n\n pointerDown = true\n cancelHide()\n const edge = resizeEdgeFromTarget(event.target)\n if (!edge) return\n\n resize = beginTooltipResize(tooltip, reentryElement, event, edge)\n event.preventDefault()\n event.stopPropagation()\n }\n\n const handleDocumentPointerMove = (event: PointerEvent): void => {\n if (!resize) return\n\n applyTooltipResize(tooltip, resize, event)\n if (anchorRect) surface.place(anchorRect, placement)\n event.preventDefault()\n }\n\n const handleDocumentPointerUp = (): void => {\n if (resize) rememberTooltipDimensions(tooltip)\n resize = null\n pointerDown = false\n }\n\n const handleTooltipKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n hide()\n return\n }\n if (isInteractiveKeyboardTarget(event.target)) return\n\n const body = tooltipBody(tooltip)\n if (!body) return\n if (!scrollTooltipBody(body, event.key)) return\n\n event.preventDefault()\n event.stopPropagation()\n }\n\n tooltip.addEventListener('pointerenter', handleTooltipPointerEnter)\n tooltip.addEventListener('pointerleave', handleTooltipPointerLeave)\n tooltip.addEventListener('pointerdown', handleTooltipPointerDown)\n tooltip.addEventListener('keydown', handleTooltipKeyDown)\n document.addEventListener('pointermove', handleDocumentPointerMove)\n document.addEventListener('pointerup', handleDocumentPointerUp)\n document.addEventListener('pointercancel', handleDocumentPointerUp)\n\n const dispose = (): void => {\n if (disposed) return\n\n disposed = true\n cancelHide()\n tooltip.removeEventListener('pointerenter', handleTooltipPointerEnter)\n tooltip.removeEventListener('pointerleave', handleTooltipPointerLeave)\n tooltip.removeEventListener('pointerdown', handleTooltipPointerDown)\n tooltip.removeEventListener('keydown', handleTooltipKeyDown)\n document.removeEventListener('pointermove', handleDocumentPointerMove)\n document.removeEventListener('pointerup', handleDocumentPointerUp)\n document.removeEventListener('pointercancel', handleDocumentPointerUp)\n surface.dispose()\n tooltip.remove()\n }\n\n return {\n show,\n reanchor,\n hide,\n scheduleHide,\n cancelHide,\n containsTarget,\n shouldKeepForPointer,\n dispose,\n }\n}\n\nfunction createTooltipElement(document: Document, classNamespace: string): HTMLDivElement {\n const element = document.createElement('div')\n element.className = tooltipClassName(classNamespace)\n element.hidden = true\n element.tabIndex = -1\n element.setAttribute('role', 'dialog')\n element.setAttribute('aria-label', 'Editor hover')\n Object.assign(element.style, {\n zIndex: '1000',\n width: 'max-content',\n minWidth: `${TOOLTIP_MIN_WIDTH_PX}px`,\n overflow: 'hidden',\n padding: '0',\n border: `1px solid ${HOVER_COLORS.border}`,\n borderRadius: '2px',\n boxSizing: 'border-box',\n background: `var(--editor-popup-background, ${HOVER_COLORS.background})`,\n color: HOVER_COLORS.foreground,\n boxShadow: `0 8px 28px ${HOVER_COLORS.shadow}`,\n // No inline display: it would beat the `hidden` attribute and leave an empty box on the page.\n fontFamily:\n 'var(--editor-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace)',\n fontSize: 'var(--editor-font-size, 13px)',\n lineHeight: '1.45',\n whiteSpace: 'normal',\n pointerEvents: 'auto',\n userSelect: 'text',\n cursor: 'default',\n })\n return element\n}\n\ntype TooltipContent = {\n readonly actionRows: WeakMap<TooltipAction, HTMLElement>\n readonly hoverText: string | null\n readonly parts: readonly TooltipPart[]\n readonly theme?: EditorTheme | null\n readonly loading: boolean\n readonly markdownCodeBackground: boolean\n readonly classNamespace: string\n readonly codeTokenizer: TooltipCodeTokenizer | null\n}\n\nfunction renderTooltip(element: HTMLDivElement, content: TooltipContent): void {\n element.replaceChildren()\n element.setAttribute('aria-busy', String(content.loading))\n const body = createTooltipBody(element.ownerDocument, content.classNamespace)\n const parts = content.hoverText\n ? [{ markdown: content.hoverText }, ...content.parts]\n : content.parts\n let markdownIndex = 0\n for (const part of parts) {\n if (part.markdown) {\n body.append(hoverPart(content, element.ownerDocument, part.markdown, markdownIndex))\n markdownIndex += 1\n }\n // One row per note, as VS Code gives each marker its own hover row.\n for (const note of part.notes ?? []) {\n body.append(noteSection(content, element.ownerDocument, note))\n }\n for (const action of part.actions ?? []) {\n body.append(tooltipAction(element.ownerDocument, content, action))\n }\n }\n if (content.loading) body.append(loadingSection(content, element.ownerDocument))\n const firstRow = body.firstElementChild as HTMLElement | null\n if (firstRow) firstRow.style.borderTop = '0'\n\n element.append(\n body,\n createResizeHandle(element.ownerDocument, content.classNamespace, 'right'),\n createResizeHandle(element.ownerDocument, content.classNamespace, 'top'),\n createResizeHandle(element.ownerDocument, content.classNamespace, 'bottom'),\n )\n element.hidden = false\n}\n\nfunction createTooltipBody(document: Document, classNamespace: string): HTMLDivElement {\n const body = document.createElement('div')\n body.className = tooltipClassName(classNamespace, 'body')\n Object.assign(body.style, {\n width: '100%',\n height: '100%',\n minWidth: '0',\n minHeight: '0',\n overflowX: 'auto',\n overflowY: 'auto',\n scrollbarGutter: 'stable',\n })\n return body\n}\n\nfunction hoverPart(\n content: TooltipContent,\n document: Document,\n markdown: string,\n index: number,\n): HTMLElement {\n const row = createTooltipRow(content, document, 'part')\n row.tabIndex = 0\n row.dataset.hoverPartIndex = String(index)\n row.setAttribute('role', 'document')\n row.setAttribute('aria-label', plainHoverText(markdown) || 'Hover information')\n row.append(\n renderTooltipMarkdown(document, markdown, content.theme, {\n codeBackground: content.markdownCodeBackground,\n classNamespace: content.classNamespace,\n codeTokenizer: content.codeTokenizer,\n }),\n )\n const button = createCopyButton(document, plainHoverText(markdown), content.classNamespace)\n row.append(button)\n installCopyButtonVisibility(row, button)\n return row\n}\n\nfunction createTooltipRow(\n content: TooltipContent,\n document: Document,\n part: string,\n): HTMLDivElement {\n const row = document.createElement('div')\n row.className = tooltipClassName(content.classNamespace, part)\n Object.assign(row.style, {\n position: 'relative',\n minWidth: '0',\n padding: '6px 30px 6px 10px',\n borderTop: `1px solid ${HOVER_COLORS.separator}`,\n boxSizing: 'border-box',\n cursor: 'text',\n })\n return row\n}\n\nfunction noteSection(content: TooltipContent, document: Document, note: TooltipNote): HTMLElement {\n const section = createTooltipRow(content, document, 'notes')\n section.tabIndex = 0\n section.setAttribute('role', 'document')\n section.setAttribute('aria-label', noteCopyText(note))\n section.append(noteRow(document, note))\n for (const action of note.actions ?? []) section.append(tooltipAction(document, content, action))\n const copyText = noteCopyText(note)\n const button = createCopyButton(document, copyText, content.classNamespace)\n section.append(button)\n installCopyButtonVisibility(section, button)\n return section\n}\n\nfunction loadingSection(content: TooltipContent, document: Document): HTMLElement {\n const row = createTooltipRow(content, document, 'loading')\n row.setAttribute('role', 'status')\n row.setAttribute('aria-live', 'polite')\n row.textContent = 'Loading…'\n row.style.color = HOVER_COLORS.secondaryForeground\n row.style.cursor = 'progress'\n return row\n}\n\nfunction createCopyButton(\n document: Document,\n copyText: string,\n classNamespace: string,\n): HTMLButtonElement {\n const button = document.createElement('button')\n button.type = 'button'\n button.className = tooltipClassName(classNamespace, 'copy')\n Object.assign(button.style, {\n position: 'absolute',\n top: '4px',\n right: '5px',\n display: 'inline-grid',\n placeItems: 'center',\n width: '22px',\n height: '22px',\n border: '1px solid transparent',\n borderRadius: '4px',\n padding: '0',\n background: 'transparent',\n color: HOVER_COLORS.secondaryForeground,\n cursor: 'pointer',\n opacity: '0',\n userSelect: 'none',\n })\n setCopyButtonState(button, 'idle')\n button.addEventListener('mouseenter', () => styleCopyButtonHover(button, true))\n button.addEventListener('mouseleave', () => styleCopyButtonHover(button, false))\n button.addEventListener('click', (event) => {\n event.preventDefault()\n event.stopPropagation()\n void handleCopyButtonClick(button, copyText)\n })\n return button\n}\n\nfunction installCopyButtonVisibility(row: HTMLElement, button: HTMLButtonElement): void {\n const show = (): void => {\n button.style.opacity = '1'\n }\n const hide = (event: FocusEvent | MouseEvent): void => {\n if (targetInsideElement(row, event.relatedTarget)) return\n button.style.opacity = '0'\n }\n row.addEventListener('mouseenter', show)\n row.addEventListener('mouseleave', hide)\n row.addEventListener('focusin', show)\n row.addEventListener('focusout', hide)\n}\n\ntype CopyButtonState = 'idle' | 'copied' | 'failed'\n\nfunction setCopyButtonState(button: HTMLButtonElement, state: CopyButtonState): void {\n button.title = copyButtonLabel(state)\n button.setAttribute('aria-label', copyButtonLabel(state))\n button.style.color = copyButtonColor(state)\n button.replaceChildren(copyButtonIcon(button.ownerDocument, state))\n}\n\nfunction styleCopyButtonHover(button: HTMLButtonElement, active: boolean): void {\n Object.assign(button.style, {\n background: active\n ? 'color-mix(in srgb, var(--editor-foreground, #a1a1aa) 14%, transparent)'\n : 'transparent',\n borderColor: active\n ? 'color-mix(in srgb, var(--editor-foreground, #a1a1aa) 22%, transparent)'\n : 'transparent',\n })\n}\n\nfunction copyButtonLabel(state: CopyButtonState): string {\n if (state === 'copied') return 'Copied hover text'\n if (state === 'failed') return 'Copy failed'\n return 'Copy hover text'\n}\n\nfunction copyButtonColor(state: CopyButtonState): string {\n if (state === 'copied') return HOVER_COLORS.actionSuccess\n if (state === 'failed') return HOVER_COLORS.actionFailure\n return HOVER_COLORS.secondaryForeground\n}\n\nfunction copyButtonIcon(document: Document, state: CopyButtonState): SVGSVGElement {\n const icon = document.createElementNS(SVG_NS, 'svg') as SVGSVGElement\n icon.setAttribute('viewBox', '0 0 24 24')\n icon.setAttribute('width', '16')\n icon.setAttribute('height', '16')\n icon.setAttribute('aria-hidden', 'true')\n icon.setAttribute('fill', 'none')\n icon.setAttribute('stroke', 'currentColor')\n icon.setAttribute('stroke-width', '2')\n icon.setAttribute('stroke-linecap', 'round')\n icon.setAttribute('stroke-linejoin', 'round')\n for (const pathData of copyButtonIconPaths(state)) {\n const path = document.createElementNS(SVG_NS, 'path')\n path.setAttribute('d', pathData)\n icon.append(path)\n }\n return icon\n}\n\nfunction copyButtonIconPaths(state: CopyButtonState): readonly string[] {\n if (state === 'copied') return ['M20 6 9 17l-5-5']\n if (state === 'failed') return ['M12 8v5', 'M12 17h.01', 'M10.3 4h3.4L22 19H2L10.3 4Z']\n return ['M8 8h12v12H8Z', 'M4 4h12v2', 'M4 4v12h2']\n}\n\nasync function handleCopyButtonClick(button: HTMLButtonElement, copyText: string): Promise<void> {\n const copied = await copyTextToClipboard(button.ownerDocument, copyText)\n showCopyButtonStatus(button, copied)\n}\n\nfunction showCopyButtonStatus(button: HTMLButtonElement, copied: boolean): void {\n setCopyButtonState(button, copied ? 'copied' : 'failed')\n // @justification Resets the copy button's label after the user has had time to read it; DOM only.\n setTimeout(() => {\n if (!button.isConnected) return\n setCopyButtonState(button, 'idle')\n }, COPY_BUTTON_RESET_DELAY_MS)\n}\n\nasync function copyTextToClipboard(document: Document, text: string): Promise<boolean> {\n const clipboard = document.defaultView?.navigator.clipboard\n if (!clipboard) return copyTextWithTextarea(document, text)\n\n try {\n await clipboard.writeText(text)\n return true\n } catch {\n return copyTextWithTextarea(document, text)\n }\n}\n\nfunction copyTextWithTextarea(document: Document, text: string): boolean {\n const textarea = document.createElement('textarea')\n textarea.value = text\n textarea.setAttribute('readonly', '')\n Object.assign(textarea.style, {\n position: 'fixed',\n top: '-9999px',\n left: '-9999px',\n opacity: '0',\n })\n document.body.append(textarea)\n textarea.select()\n try {\n return document.execCommand('copy')\n } catch {\n return false\n } finally {\n textarea.remove()\n }\n}\n\nfunction plainHoverText(markdown: string): string {\n return markdown\n .replace(/^```[^\\n]*\\n/gm, '')\n .replace(/^```\\s*$/gm, '')\n .trim()\n}\n\nfunction noteCopyText(note: TooltipNote): string {\n const details = noteDetailsText(note)\n const head = `${note.text}${details ? ` ${details}` : ''}`\n const related = (note.related ?? []).map((link) => `${link.label}${link.text}`)\n return [head, ...related].join('\\n').trim()\n}\n\nfunction noteDetailsText(note: TooltipNote): string {\n if (note.source && note.code) return `${note.source}(${note.code})`\n if (note.source) return note.source\n if (note.code) return `(${note.code})`\n return ''\n}\n\n// Laid out as VS Code's marker hover: the message as written, its source and code muted after it,\n// and each related location on its own line below.\nfunction noteRow(document: Document, note: TooltipNote): HTMLElement {\n const row = document.createElement('div')\n row.style.minWidth = '0'\n const message = document.createElement('span')\n message.textContent = note.text\n message.style.whiteSpace = 'pre-wrap'\n row.append(message)\n const details = noteDetails(document, note)\n if (details) row.append(details)\n for (const link of note.related ?? []) row.append(relatedRow(document, link))\n return row\n}\n\nfunction noteDetails(document: Document, note: TooltipNote): HTMLElement | null {\n if (!note.source && !note.code) return null\n\n const details = document.createElement('span')\n details.style.opacity = '0.6'\n details.style.paddingLeft = '6px'\n if (!note.codeHref || !note.code) {\n details.textContent = noteDetailsText(note)\n return details\n }\n\n if (note.source) details.append(note.source)\n const link = document.createElement('a')\n link.href = note.codeHref\n link.target = '_blank'\n link.rel = 'noreferrer'\n link.textContent = `(${note.code})`\n styleNoteLink(link)\n details.append(link)\n return details\n}\n\nfunction relatedRow(document: Document, link: TooltipNoteLink): HTMLElement {\n const row = document.createElement('div')\n row.style.marginTop = '8px'\n const anchor = document.createElement('a')\n anchor.textContent = link.label\n anchor.setAttribute('role', 'button')\n anchor.tabIndex = 0\n styleNoteLink(anchor)\n const open = (event: Event): void => {\n event.preventDefault()\n event.stopPropagation()\n link.open()\n }\n anchor.addEventListener('click', open)\n anchor.addEventListener('keydown', (event) => {\n if (event.key === 'Enter' || event.key === ' ') open(event)\n })\n const text = document.createElement('span')\n text.textContent = link.text\n row.append(anchor, text)\n return row\n}\n\nfunction styleNoteLink(anchor: HTMLAnchorElement): void {\n anchor.style.color = 'var(--editor-caret-color, #93c5fd)'\n anchor.style.textDecoration = 'underline'\n anchor.style.cursor = 'pointer'\n}\n\nfunction createResizeHandle(\n document: Document,\n classNamespace: string,\n edge: TooltipResizeEdge,\n): HTMLDivElement {\n const handle = document.createElement('div')\n handle.className = tooltipClassName(classNamespace, `resize-${edge}`)\n handle.dataset.tooltipResizeEdge = edge\n handle.setAttribute('aria-hidden', 'true')\n Object.assign(handle.style, resizeHandleStyle(edge))\n return handle\n}\n\nfunction resizeHandleStyle(edge: TooltipResizeEdge): Partial<CSSStyleDeclaration> {\n if (edge === 'right') {\n return {\n position: 'absolute',\n top: '0',\n right: '-2px',\n width: `${TOOLTIP_RESIZE_HANDLE_PX}px`,\n height: '100%',\n cursor: 'ew-resize',\n userSelect: 'none',\n }\n }\n return {\n position: 'absolute',\n left: '0',\n width: '100%',\n height: `${TOOLTIP_RESIZE_HANDLE_PX}px`,\n cursor: 'ns-resize',\n userSelect: 'none',\n }\n}\n\nfunction updateResizeHandles(\n tooltip: HTMLElement,\n placement: AnchoredSurfacePlacement,\n classNamespace: string,\n): void {\n const top = tooltip.querySelector<HTMLElement>(\n `.${tooltipClassName(classNamespace, 'resize-top')}`,\n )\n const bottom = tooltip.querySelector<HTMLElement>(\n `.${tooltipClassName(classNamespace, 'resize-bottom')}`,\n )\n if (!top || !bottom) return\n\n top.hidden = placement !== 'bottom'\n top.style.top = '-2px'\n bottom.hidden = placement !== 'top'\n bottom.style.bottom = '-2px'\n}\n\nfunction resizeEdgeFromTarget(target: EventTarget | null): TooltipResizeEdge | null {\n if (!(target instanceof HTMLElement)) return null\n const edge = target.dataset.tooltipResizeEdge\n if (edge === 'right' || edge === 'top' || edge === 'bottom') return edge\n return null\n}\n\nfunction beginTooltipResize(\n tooltip: HTMLElement,\n editor: HTMLElement,\n event: PointerEvent,\n edge: TooltipResizeEdge,\n): TooltipResizeState {\n const rect = tooltip.getBoundingClientRect()\n const styledMaxHeight = Number.parseFloat(tooltip.style.maxHeight)\n return {\n edge,\n startX: event.clientX,\n startY: event.clientY,\n startWidth: rect.width,\n startHeight: rect.height,\n maxWidth: tooltipMaximumWidth(editor, tooltip.ownerDocument),\n maxHeight: Number.isFinite(styledMaxHeight)\n ? styledMaxHeight\n : tooltipMaximumHeight(editor, tooltip.ownerDocument),\n }\n}\n\nfunction applyTooltipResize(\n tooltip: HTMLElement,\n resize: TooltipResizeState,\n event: PointerEvent,\n): void {\n if (resize.edge === 'right') {\n const width = clamp(\n resize.startWidth + event.clientX - resize.startX,\n TOOLTIP_MIN_WIDTH_PX,\n resize.maxWidth,\n )\n tooltip.style.width = `${Math.round(width)}px`\n return\n }\n\n const delta =\n resize.edge === 'top' ? resize.startY - event.clientY : event.clientY - resize.startY\n const height = clamp(resize.startHeight + delta, TOOLTIP_MIN_HEIGHT_PX, resize.maxHeight)\n tooltip.style.height = `${Math.round(height)}px`\n}\n\nfunction rememberTooltipDimensions(tooltip: HTMLElement): void {\n const rect = tooltip.getBoundingClientRect()\n if (rect.width <= 0 || rect.height <= 0) return\n lastTooltipDimensions.set(tooltip.ownerDocument, { width: rect.width, height: rect.height })\n}\n\nfunction applyTooltipDimensions(\n tooltip: HTMLElement,\n editor: HTMLElement,\n resetToRememberedSize: boolean,\n): void {\n const maximumWidth = tooltipMaximumWidth(editor, tooltip.ownerDocument)\n const maximumHeight = tooltipMaximumHeight(editor, tooltip.ownerDocument)\n tooltip.style.maxWidth = `${maximumWidth}px`\n tooltip.style.maxHeight = `${maximumHeight}px`\n if (!resetToRememberedSize) return\n\n const last = lastTooltipDimensions.get(tooltip.ownerDocument)\n tooltip.style.width = last ? `${Math.min(last.width, maximumWidth)}px` : 'max-content'\n tooltip.style.height = last ? `${Math.min(last.height, maximumHeight)}px` : 'auto'\n}\n\nfunction tooltipMaximumWidth(editor: HTMLElement, document: Document): number {\n const viewportWidth = document.defaultView?.innerWidth ?? 0\n const editorWidth = editor.getBoundingClientRect().width\n const desired = Math.max(editorWidth * TOOLTIP_MAX_WIDTH_FRACTION, 750)\n const viewportMaximum = viewportWidth - TOOLTIP_VIEWPORT_MARGIN_PX * 2\n return Math.max(TOOLTIP_MIN_WIDTH_PX, Math.min(desired, viewportMaximum))\n}\n\nfunction tooltipMaximumHeight(editor: HTMLElement, document: Document): number {\n const viewportHeight = document.defaultView?.innerHeight ?? 0\n const editorHeight = editor.getBoundingClientRect().height\n const lastHeight = lastTooltipDimensions.get(document)?.height ?? 0\n const desired = Math.max(editorHeight / 4, TOOLTIP_MIN_MAX_HEIGHT_PX, lastHeight)\n const viewportMaximum = viewportHeight - TOOLTIP_VIEWPORT_MARGIN_PX * 2\n return Math.max(TOOLTIP_MIN_HEIGHT_PX, Math.min(desired, viewportMaximum))\n}\n\nfunction setTooltipBodyMaxHeight(element: HTMLDivElement, maxHeight: number): void {\n const body = tooltipBody(element)\n if (!body) return\n body.style.maxHeight = `${Math.max(1, maxHeight - 2)}px`\n}\n\nfunction tooltipBody(element: HTMLElement): HTMLElement | null {\n return element.querySelector<HTMLElement>(`.${tooltipClassNameForElement(element, 'body')}`)\n}\n\ntype TooltipFocusState = {\n readonly partIndex: string | null\n readonly inside: boolean\n readonly element: HTMLElement | null\n}\ntype TooltipScrollState = { readonly left: number; readonly top: number }\n\nfunction tooltipScrollState(tooltip: HTMLElement): TooltipScrollState {\n const body = tooltipBody(tooltip)\n return { left: body?.scrollLeft ?? 0, top: body?.scrollTop ?? 0 }\n}\n\nfunction restoreTooltipScroll(tooltip: HTMLElement, state: TooltipScrollState): void {\n const body = tooltipBody(tooltip)\n if (!body) return\n body.scrollLeft = state.left\n body.scrollTop = state.top\n}\n\nfunction tooltipFocusState(tooltip: HTMLElement, active: Element | null): TooltipFocusState {\n if (!active || !tooltip.contains(active)) return { partIndex: null, inside: false, element: null }\n const part = active.closest<HTMLElement>('[data-hover-part-index]')\n return {\n partIndex: part?.dataset.hoverPartIndex ?? null,\n inside: true,\n element: active instanceof HTMLElement ? active : null,\n }\n}\n\nfunction restoreTooltipFocus(\n tooltip: HTMLElement,\n previous: TooltipFocusState,\n requested: boolean,\n): void {\n if (!previous.inside && !requested) return\n if (previous.element && tooltip.contains(previous.element)) return previous.element.focus()\n if (previous.partIndex !== null) {\n const part = tooltip.querySelector<HTMLElement>(\n `[data-hover-part-index=\"${previous.partIndex}\"]`,\n )\n if (part) return part.focus()\n }\n const firstPart = tooltip.querySelector<HTMLElement>('[data-hover-part-index], [tabindex=\"0\"]')\n if (firstPart) return firstPart.focus()\n tooltip.focus()\n}\n\nfunction scrollTooltipBody(body: HTMLElement, key: string): boolean {\n if (key === 'ArrowDown') body.scrollTop += TOOLTIP_SCROLL_STEP_PX\n else if (key === 'ArrowUp') body.scrollTop -= TOOLTIP_SCROLL_STEP_PX\n else if (key === 'PageDown') body.scrollTop += Math.max(1, body.clientHeight)\n else if (key === 'PageUp') body.scrollTop -= Math.max(1, body.clientHeight)\n else if (key === 'Home') body.scrollTop = 0\n else if (key === 'End') body.scrollTop = body.scrollHeight\n else return false\n return true\n}\n\nfunction isInteractiveKeyboardTarget(target: EventTarget | null): boolean {\n if (!(target instanceof Element)) return false\n return Boolean(target.closest('button, a, input, textarea, select'))\n}\n\nfunction selectionInsideTooltip(document: Document, tooltip: HTMLElement): boolean {\n const selection = document.getSelection()\n if (!selection || selection.isCollapsed) return false\n return tooltip.contains(selection.anchorNode) || tooltip.contains(selection.focusNode)\n}\n\nfunction syncEditorThemeVariables(target: HTMLElement, source: HTMLElement): void {\n const style = source.ownerDocument.defaultView?.getComputedStyle(source)\n if (!style) return\n for (const variable of TOOLTIP_THEME_VARIABLES) {\n const value =\n source.style.getPropertyValue(variable).trim() || style.getPropertyValue(variable).trim()\n if (value) {\n target.style.setProperty(variable, value)\n continue\n }\n target.style.removeProperty(variable)\n }\n}\n\nfunction tooltipClassName(classNamespace: string, part?: string): string {\n const base = `editor-${classNamespace}-hover`\n return part ? `${base}-${part}` : base\n}\n\nfunction tooltipClassNameForElement(element: HTMLElement, part: string): string {\n const namespace = tooltipNamespaceFromClassName(element.className)\n return tooltipClassName(namespace, part)\n}\n\nfunction tooltipNamespaceFromClassName(className: string): string {\n const match = /^editor-(.+)-hover(?:\\s|$)/.exec(className)\n return match?.[1] ?? 'plugin'\n}\n\nfunction targetInsideElement(element: Element, target: EventTarget | null): boolean {\n if (!(target instanceof Node)) return false\n return element.contains(target)\n}\n\nfunction pointToRectDistance(rect: DOMRect, clientX: number, clientY: number): number {\n const horizontal = Math.max(rect.left - clientX, 0, clientX - rect.right)\n const vertical = Math.max(rect.top - clientY, 0, clientY - rect.bottom)\n return Math.hypot(horizontal, vertical)\n}\n\nfunction rectContainsPoint(rect: DOMRect, clientX: number, clientY: number): boolean {\n if (clientX < rect.left || clientX > rect.right) return false\n if (clientY < rect.top) return false\n return clientY <= rect.bottom\n}\n\nfunction sameRect(left: DOMRect, right: DOMRect): boolean {\n return (\n left.left === right.left &&\n left.top === right.top &&\n left.width === right.width &&\n left.height === right.height\n )\n}\n\nfunction clamp(value: number, minimum: number, maximum: number): number {\n return Math.max(minimum, Math.min(value, maximum))\n}\n\nasync function runTooltipAction(\n button: HTMLButtonElement,\n failure: HTMLElement,\n action: TooltipAction,\n): Promise<void> {\n if (button.getAttribute('aria-disabled') === 'true') return\n button.setAttribute('aria-disabled', 'true')\n button.setAttribute('aria-busy', 'true')\n failure.textContent = ''\n try {\n await action.run()\n } catch (error) {\n failure.textContent = error instanceof Error ? error.message : 'Could not complete action.'\n } finally {\n button.removeAttribute('aria-disabled')\n button.removeAttribute('aria-busy')\n }\n}\n\nfunction tooltipAction(\n document: Document,\n content: TooltipContent,\n action: TooltipAction,\n): HTMLElement {\n const existing = content.actionRows.get(action)\n if (existing) return existing\n const row = createTooltipRow(content, document, 'action')\n content.actionRows.set(action, row)\n const button = document.createElement('button')\n button.type = 'button'\n button.textContent = action.label\n Object.assign(button.style, {\n background: 'transparent',\n border: '0',\n color: 'inherit',\n cursor: 'pointer',\n font: 'inherit',\n textDecoration: 'underline',\n })\n const failure = document.createElement('span')\n failure.setAttribute('role', 'status')\n button.addEventListener('click', () => {\n void runTooltipAction(button, failure, action)\n })\n row.append(button, failure)\n return row\n}\n"],"mappings":";;;;;AAQA,IAAa,4BAA4B;AACzC,IAAa,gCAAA;AACb,IAAa,yBAAA;AACb,IAAa,wBAAwB;AACrC,IAAa,6BAA6B;AAE1C,IAAM,iBAAiB;AACvB,IAAM,6BAA6B;A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;CACxD,QAAQ,WAAW,IAAI,QAAQ,GAAG;CAClC,MAAM,SAAS,SAAS,cAAc,QAAQ;CAC9C,OAAO,OAAO;CACd,OAAO,cAAc,OAAO;CAC5B,OAAO,OAAO,OAAO,OAAO;EAC1B,YAAY;EACZ,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,MAAM;EACN,gBAAgB;CAClB,CAAC;CACD,MAAM,UAAU,SAAS,cAAc,MAAM;CAC7C,QAAQ,aAAa,QAAQ,QAAQ;CACrC,OAAO,iBAAiB,eAAe;EACrC,iBAAsB,QAAQ,SAAS,MAAM;CAC/C,CAAC;CACD,IAAI,OAAO,QAAQ,OAAO;CAC1B,OAAO;AACT"}
|
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@singapore-editor/plugin-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"files": [
|
|
5
|
+
"README.md",
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"type": "module",
|
|
9
|
+
"sideEffects": [
|
|
10
|
+
"./dist/hoverToken.js"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./anchored-surface": {
|
|
19
|
+
"types": "./dist/anchoredSurface.d.ts",
|
|
20
|
+
"import": "./dist/anchoredSurface.js",
|
|
21
|
+
"default": "./dist/anchoredSurface.js"
|
|
22
|
+
},
|
|
23
|
+
"./hover-controller": {
|
|
24
|
+
"types": "./dist/hoverController.d.ts",
|
|
25
|
+
"import": "./dist/hoverController.js",
|
|
26
|
+
"default": "./dist/hoverController.js"
|
|
27
|
+
},
|
|
28
|
+
"./hover-participant": {
|
|
29
|
+
"types": "./dist/hoverParticipant.d.ts",
|
|
30
|
+
"import": "./dist/hoverParticipant.js",
|
|
31
|
+
"default": "./dist/hoverParticipant.js"
|
|
32
|
+
},
|
|
33
|
+
"./hover-plugin": {
|
|
34
|
+
"types": "./dist/hoverPlugin.d.ts",
|
|
35
|
+
"import": "./dist/hoverPlugin.js",
|
|
36
|
+
"default": "./dist/hoverPlugin.js"
|
|
37
|
+
},
|
|
38
|
+
"./hover-registry": {
|
|
39
|
+
"types": "./dist/hoverRegistry.d.ts",
|
|
40
|
+
"import": "./dist/hoverRegistry.js",
|
|
41
|
+
"default": "./dist/hoverRegistry.js"
|
|
42
|
+
},
|
|
43
|
+
"./hover-token": {
|
|
44
|
+
"types": "./dist/hoverToken.d.ts",
|
|
45
|
+
"import": "./dist/hoverToken.js",
|
|
46
|
+
"default": "./dist/hoverToken.js"
|
|
47
|
+
},
|
|
48
|
+
"./markdown-tooltip": {
|
|
49
|
+
"types": "./dist/markdownTooltip.d.ts",
|
|
50
|
+
"import": "./dist/markdownTooltip.js",
|
|
51
|
+
"default": "./dist/markdownTooltip.js"
|
|
52
|
+
},
|
|
53
|
+
"./offset-range": {
|
|
54
|
+
"types": "./dist/offsetRange.d.ts",
|
|
55
|
+
"import": "./dist/offsetRange.js",
|
|
56
|
+
"default": "./dist/offsetRange.js"
|
|
57
|
+
},
|
|
58
|
+
"./styles": {
|
|
59
|
+
"types": "./dist/styles.d.ts",
|
|
60
|
+
"import": "./dist/styles.js",
|
|
61
|
+
"default": "./dist/styles.js"
|
|
62
|
+
},
|
|
63
|
+
"./tooltip": {
|
|
64
|
+
"types": "./dist/tooltip.d.ts",
|
|
65
|
+
"import": "./dist/tooltip.js",
|
|
66
|
+
"default": "./dist/tooltip.js"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public",
|
|
71
|
+
"registry": "https://registry.npmjs.org/"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "bun ../../scripts/build-package.ts",
|
|
75
|
+
"test": "vitest run",
|
|
76
|
+
"typecheck": "tsgo --noEmit",
|
|
77
|
+
"lint": "oxlint .",
|
|
78
|
+
"format": "oxfmt --write .",
|
|
79
|
+
"format:check": "oxfmt --check ."
|
|
80
|
+
},
|
|
81
|
+
"dependencies": {
|
|
82
|
+
"remark-gfm": "^4.0.1",
|
|
83
|
+
"remark-parse": "^11.0.0",
|
|
84
|
+
"remark-stringify": "^11.0.0",
|
|
85
|
+
"unified": "^11.0.5"
|
|
86
|
+
},
|
|
87
|
+
"devDependencies": {
|
|
88
|
+
"@singapore-editor/core": "0.1.2",
|
|
89
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
90
|
+
"@vitest/browser-playwright": "5.0.2",
|
|
91
|
+
"happy-dom": "^20.14.5",
|
|
92
|
+
"oxfmt": "0.70.0",
|
|
93
|
+
"oxlint": "1.85.0",
|
|
94
|
+
"typescript": "~6.0.3",
|
|
95
|
+
"vitest": "^5.0.2"
|
|
96
|
+
},
|
|
97
|
+
"peerDependencies": {
|
|
98
|
+
"@singapore-editor/core": "0.1.2"
|
|
99
|
+
}
|
|
100
|
+
}
|