@canopy-iiif/app 0.10.23 → 0.10.26

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.
@@ -105,7 +105,7 @@ var Slider = (props) => {
105
105
  } catch (_) {
106
106
  json = "{}";
107
107
  }
108
- return /* @__PURE__ */ React3.createElement("div", { "data-canopy-slider": "1", className: "not-prose" }, /* @__PURE__ */ React3.createElement(
108
+ return /* @__PURE__ */ React3.createElement("div", { className: "canopy-slider", "data-canopy-slider": "1" }, /* @__PURE__ */ React3.createElement(
109
109
  "script",
110
110
  {
111
111
  type: "application/json",
@@ -113,7 +113,7 @@ var Slider = (props) => {
113
113
  }
114
114
  ));
115
115
  }
116
- return /* @__PURE__ */ React3.createElement(CloverSlider, { ...props });
116
+ return /* @__PURE__ */ React3.createElement(CloverSlider, { ...props, className: "canopy-slider" });
117
117
  };
118
118
 
119
119
  // ui/src/iiif/Scroll.jsx
@@ -218,7 +218,13 @@ function MdxRelatedItems(props) {
218
218
  } catch (_) {
219
219
  json = "{}";
220
220
  }
221
- return /* @__PURE__ */ React6.createElement("div", { "data-canopy-related-items": "1", className: "not-prose" }, /* @__PURE__ */ React6.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: json } }));
221
+ return /* @__PURE__ */ React6.createElement("div", { "data-canopy-related-items": "1" }, /* @__PURE__ */ React6.createElement(
222
+ "script",
223
+ {
224
+ type: "application/json",
225
+ dangerouslySetInnerHTML: { __html: json }
226
+ }
227
+ ));
222
228
  }
223
229
 
224
230
  // ui/src/interstitials/index.js
@@ -1587,12 +1593,50 @@ function HeaderScript() {
1587
1593
  }
1588
1594
  );
1589
1595
  }
1596
+ var CONTEXT_KEY = typeof Symbol === "function" ? Symbol.for("__CANOPY_PAGE_CONTEXT__") : "__CANOPY_PAGE_CONTEXT__";
1597
+ function getSharedRoot() {
1598
+ if (typeof globalThis !== "undefined") return globalThis;
1599
+ if (typeof window !== "undefined") return window;
1600
+ if (typeof global !== "undefined") return global;
1601
+ return null;
1602
+ }
1603
+ function getSafePageContext() {
1604
+ const root = getSharedRoot();
1605
+ if (root && root[CONTEXT_KEY]) return root[CONTEXT_KEY];
1606
+ const ctx = React19.createContext({ navigation: null, page: null });
1607
+ if (root) root[CONTEXT_KEY] = ctx;
1608
+ return ctx;
1609
+ }
1590
1610
  function ensureArray(navLinks) {
1591
1611
  if (!Array.isArray(navLinks)) return [];
1592
1612
  return navLinks.filter(
1593
1613
  (link) => link && typeof link === "object" && typeof link.href === "string"
1594
1614
  );
1595
1615
  }
1616
+ function SectionNavList({ root }) {
1617
+ if (!root || !Array.isArray(root.children) || !root.children.length) return null;
1618
+ return /* @__PURE__ */ React19.createElement("ul", { className: "canopy-modal__section-list", role: "list" }, root.children.map((node) => /* @__PURE__ */ React19.createElement(SectionNavItem, { key: node.slug || node.href || node.title, node, depth: 0 })));
1619
+ }
1620
+ function SectionNavItem({ node, depth }) {
1621
+ if (!node) return null;
1622
+ const hasChildren = Array.isArray(node.children) && node.children.length > 0;
1623
+ const Tag = node.href ? "a" : "span";
1624
+ const classes = [
1625
+ "canopy-modal__section-link",
1626
+ `depth-${Math.min(5, Math.max(0, depth + 1))}`
1627
+ ];
1628
+ if (!node.href) classes.push("is-label");
1629
+ if (node.isActive) classes.push("is-active");
1630
+ return /* @__PURE__ */ React19.createElement("li", { className: "canopy-modal__section-item", "data-depth": depth }, /* @__PURE__ */ React19.createElement(
1631
+ Tag,
1632
+ {
1633
+ className: classes.join(" "),
1634
+ href: node.href || void 0,
1635
+ "aria-current": node.isActive ? "page" : void 0
1636
+ },
1637
+ node.title || node.slug
1638
+ ), hasChildren ? /* @__PURE__ */ React19.createElement("ul", { className: "canopy-modal__section-list canopy-modal__section-list--nested", role: "list" }, node.children.map((child) => /* @__PURE__ */ React19.createElement(SectionNavItem, { key: child.slug || child.href || child.title, node: child, depth: depth + 1 }))) : null);
1639
+ }
1596
1640
  function CanopyHeader(props = {}) {
1597
1641
  const {
1598
1642
  navigation: navLinksProp,
@@ -1604,6 +1648,13 @@ function CanopyHeader(props = {}) {
1604
1648
  logo: SiteLogo
1605
1649
  } = props;
1606
1650
  const navLinks = ensureArray(navLinksProp);
1651
+ const PageContext = getSafePageContext();
1652
+ const context = React19.useContext(PageContext);
1653
+ const sectionNavigation = context && context.navigation && context.navigation.root ? context.navigation : null;
1654
+ const sectionHeading = sectionNavigation && sectionNavigation.title || (sectionNavigation && sectionNavigation.root ? sectionNavigation.root.title : "");
1655
+ const hasSectionNav = !!(sectionNavigation && sectionNavigation.root && Array.isArray(sectionNavigation.root.children) && sectionNavigation.root.children.length);
1656
+ const sectionLabel = sectionHeading ? `More in ${sectionHeading}` : "More in this section";
1657
+ const sectionAriaLabel = sectionHeading ? `${sectionHeading} section navigation` : "Section navigation";
1607
1658
  return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
1608
1659
  "header",
1609
1660
  {
@@ -1714,7 +1765,16 @@ function CanopyHeader(props = {}) {
1714
1765
  "aria-label": "Primary navigation"
1715
1766
  },
1716
1767
  navLinks.map((link) => /* @__PURE__ */ React19.createElement("a", { key: link.href, href: link.href }, link.label || link.href))
1717
- )
1768
+ ),
1769
+ hasSectionNav ? /* @__PURE__ */ React19.createElement(
1770
+ "nav",
1771
+ {
1772
+ className: "canopy-modal__section-nav",
1773
+ "aria-label": sectionAriaLabel
1774
+ },
1775
+ /* @__PURE__ */ React19.createElement("div", { className: "canopy-modal__section-label" }, sectionLabel),
1776
+ /* @__PURE__ */ React19.createElement(SectionNavList, { root: sectionNavigation.root })
1777
+ ) : null
1718
1778
  ), /* @__PURE__ */ React19.createElement(
1719
1779
  CanopyModal,
1720
1780
  {
@@ -2241,10 +2301,17 @@ function MarkdownTable({ className = "", ...rest }) {
2241
2301
  const merged = ["markdown-table", className].filter(Boolean).join(" ");
2242
2302
  return /* @__PURE__ */ React31.createElement("div", { className: "markdown-table__frame" }, /* @__PURE__ */ React31.createElement("table", { className: merged, ...rest }));
2243
2303
  }
2304
+
2305
+ // ui/src/docs/Diagram.jsx
2306
+ import React32 from "react";
2307
+ function CanopyDiagram() {
2308
+ return /* @__PURE__ */ React32.createElement("div", { className: "canopy-diagram" }, /* @__PURE__ */ React32.createElement("section", { className: "canopy-diagram__section canopy-diagram__section--collections" }, /* @__PURE__ */ React32.createElement("h3", null, "IIIF Collection(s)"), /* @__PURE__ */ React32.createElement("span", { className: "canopy-diagram__section-summary" }, "Source collections contribute 170 total manifests that Canopy retrieves as-is via IIIF endpoints."), /* @__PURE__ */ React32.createElement("div", { className: "canopy-diagram__grid" }, /* @__PURE__ */ React32.createElement("article", null, /* @__PURE__ */ React32.createElement("h4", null, "Collection A"), /* @__PURE__ */ React32.createElement("ul", null, /* @__PURE__ */ React32.createElement("li", null, "70 Manifests"), /* @__PURE__ */ React32.createElement("li", null, "IIIF Images + A/V"), /* @__PURE__ */ React32.createElement("li", null, "Textual Annotations"))), /* @__PURE__ */ React32.createElement("article", null, /* @__PURE__ */ React32.createElement("h4", null, "Collection B"), /* @__PURE__ */ React32.createElement("ul", null, /* @__PURE__ */ React32.createElement("li", null, "35 Manifests"), /* @__PURE__ */ React32.createElement("li", null, "IIIF Images + A/V"), /* @__PURE__ */ React32.createElement("li", null, "Textual Annotations"))))), /* @__PURE__ */ React32.createElement("div", { className: "canopy-diagram__arrow", "aria-hidden": "true" }, /* @__PURE__ */ React32.createElement("span", { className: "canopy-diagram__arrow-line" }), /* @__PURE__ */ React32.createElement("span", { className: "canopy-diagram__arrow-head" })), /* @__PURE__ */ React32.createElement("section", { className: "canopy-diagram__section canopy-diagram__section--build" }, /* @__PURE__ */ React32.createElement("h3", null, "Canopy Build Process"), /* @__PURE__ */ React32.createElement("span", { className: "canopy-diagram__section-summary" }, "Canopy syncs manifests, authored pages, and annotations before bundling data for the static site."), /* @__PURE__ */ React32.createElement("div", { className: "canopy-diagram__grid" }, /* @__PURE__ */ React32.createElement("article", null, /* @__PURE__ */ React32.createElement("h4", null, "Automated content"), /* @__PURE__ */ React32.createElement("ul", null, /* @__PURE__ */ React32.createElement("li", null, "105 manifests \u2192 105 work pages"), /* @__PURE__ */ React32.createElement("li", null, "One page per manifest"), /* @__PURE__ */ React32.createElement("li", null, "Customize layout per work"))), /* @__PURE__ */ React32.createElement("article", null, /* @__PURE__ */ React32.createElement("h4", null, "Contextual content"), /* @__PURE__ */ React32.createElement("ul", null, /* @__PURE__ */ React32.createElement("li", null, "Markdown & MDX pages"), /* @__PURE__ */ React32.createElement("li", null, "Author narratives & tours"), /* @__PURE__ */ React32.createElement("li", null, "Reference manifests inline"))), /* @__PURE__ */ React32.createElement("article", null, /* @__PURE__ */ React32.createElement("h4", null, "Search index"), /* @__PURE__ */ React32.createElement("ul", null, /* @__PURE__ */ React32.createElement("li", null, "Combines works + pages"), /* @__PURE__ */ React32.createElement("li", null, "FlexSearch powered"), /* @__PURE__ */ React32.createElement("li", null, "Optional annotations"))))), /* @__PURE__ */ React32.createElement("div", { className: "canopy-diagram__arrow", "aria-hidden": "true" }, /* @__PURE__ */ React32.createElement("span", { className: "canopy-diagram__arrow-line" }), /* @__PURE__ */ React32.createElement("span", { className: "canopy-diagram__arrow-head" })), /* @__PURE__ */ React32.createElement("section", { className: "canopy-diagram__section canopy-diagram__section--output" }, /* @__PURE__ */ React32.createElement("h3", null, "Static Digital Project"), /* @__PURE__ */ React32.createElement("span", { className: "canopy-diagram__section-summary" }, "The output is a lightweight bundle of HTML, CSS, JS, and JSON assets that can deploy anywhere."), /* @__PURE__ */ React32.createElement("div", { className: "canopy-diagram__grid" }, /* @__PURE__ */ React32.createElement("article", null, /* @__PURE__ */ React32.createElement("h4", null, "Work pages"), /* @__PURE__ */ React32.createElement("ul", null, /* @__PURE__ */ React32.createElement("li", null, "105 generated HTML pages"), /* @__PURE__ */ React32.createElement("li", null, "Each links back to source manifests"), /* @__PURE__ */ React32.createElement("li", null, "Styled with Canopy components"))), /* @__PURE__ */ React32.createElement("article", null, /* @__PURE__ */ React32.createElement("h4", null, "Custom pages"), /* @__PURE__ */ React32.createElement("ul", null, /* @__PURE__ */ React32.createElement("li", null, "Markdown & MDX-authored content"), /* @__PURE__ */ React32.createElement("li", null, "Reusable layouts for narratives"), /* @__PURE__ */ React32.createElement("li", null, "Embed IIIF media & interstitials"))), /* @__PURE__ */ React32.createElement("article", null, /* @__PURE__ */ React32.createElement("h4", null, "Search bundle"), /* @__PURE__ */ React32.createElement("ul", null, /* @__PURE__ */ React32.createElement("li", null, "Static FlexSearch index"), /* @__PURE__ */ React32.createElement("li", null, "Works + pages share records"), /* @__PURE__ */ React32.createElement("li", null, "Optional annotation dataset"))))));
2309
+ }
2244
2310
  export {
2245
2311
  Button,
2246
2312
  ButtonWrapper,
2247
2313
  CanopyBrand,
2314
+ CanopyDiagram,
2248
2315
  CanopyFooter,
2249
2316
  CanopyHeader,
2250
2317
  CanopyModal,