diff --git a/data-browser-panes.js b/data-browser-panes.js index e0a654e..0072d0f 100644 --- a/data-browser-panes.js +++ b/data-browser-panes.js @@ -10,9 +10,18 @@ // 3. No matching pane → pretty-printed JSON-LD (same as data-browser.js). // // Single file, no build, no framework. Local pane contract (ES module): -// export default { canHandle(node, h) -> boolean, render(node, h) -> htmlString } -// where h = { escape, prop, propAll, first, idOf, types, host, fmtDate, localName }. -// (prop may return an array for multi-valued JSON-LD; use h.first for single values.) +// export default { +// canHandle(node, h) -> boolean, +// render(node, h) -> htmlString | Promise // null/'' declines +// } +// Panes are offered BOTH single resources and containers (h.isContainer marks +// which). A pane that returns null is skipped, so a container pane can decline a +// folder it doesn't recognise and fall through to the folder table. +// h = { escape, prop, propAll, first, idOf, types, host, fmtDate, localName, +// isContainer, path, children, fetchResource(url) } +// - prop may return an array for multi-valued JSON-LD; use h.first for one value. +// - children: parsed [{ url, type, ... }] of a container's members. +// - fetchResource(url): async, returns a child's primary node (for collections). document.head.insertAdjacentHTML('beforeend', ` +
+
+
+
Collection
+
Bookmarks ${items.length}
+
+ +
+
${items.map(card).join('')}
+ +
`; + } +};