@@ -1,39 +0,0 @@
1−import UrbitApi from '@urbit/http-api';
2−const api: UrbitApi = new UrbitApi('');
3−
4−async function getDoc(path) {
5− return api.scry<any>({ app: 'astrolabe', path: `/doc/${path}` });
6−}
7−
8−export default function doc(node, path: string) {
9− // Determine the title to show. We want to prefer
10− // the custom content passed in first, then the
11− // HTML title attribute then the aria-label
12− // in that order.
13− const custom = params.content;
14− const title = node.title;
15− const label = node.getAttribute("aria-label");
16− const content = custom || title || label;
17−
18− // Let's make sure the "aria-label" attribute
19− // is set so our element is accessible:
20− // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute
21− if (!label) node.setAttribute("aria-label", content);
22−
23− // Clear out the HTML title attribute since
24− // we don't want the default behavior of it
25− // showing up on hover.
26− node.title = "";
27−
28− // Support any of the Tippy props by forwarding all "params":
29− // https://atomiks.github.io/tippyjs/v6/all-props/
30− const tip: any = tippy(node, mergeParams(content, params));
31−
32− return {
33− // If the props change, let's update the Tippy instance:
34− update: (newParams) => tip.setProps(mergeParams(content, newParams)),
35−
36− // Clean up the Tippy instance on unmount:
37− destroy: () => tip.destroy(),
38− };
39−};