@5cover/lectern 0.2.0 → 0.2.1

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.
@@ -0,0 +1,119 @@
1
+ // src/client/entry.ts
2
+ import mermaid from "mermaid";
3
+ import Reveal from "reveal.js";
4
+ import RevealHighlight from "reveal.js/plugin/highlight";
5
+ import RevealNotes from "reveal.js/plugin/notes";
6
+ import "reveal.js/plugin/highlight/monokai.css";
7
+ import "reveal.js/reveal.css";
8
+ function readConfig() {
9
+ const el = document.getElementById("lectern-config");
10
+ if (!el?.textContent) return {};
11
+ try {
12
+ return JSON.parse(el.textContent);
13
+ } catch {
14
+ return {};
15
+ }
16
+ }
17
+ function cssVar(name, fallback) {
18
+ const root = document.querySelector(".reveal") ?? document.documentElement;
19
+ const v = getComputedStyle(root).getPropertyValue(name).trim();
20
+ return v || fallback;
21
+ }
22
+ async function main() {
23
+ const config = readConfig();
24
+ const revealEl = document.querySelector(".reveal");
25
+ if (config.profile && revealEl && !revealEl.classList.contains(`profile-${config.profile}`)) {
26
+ revealEl.classList.add(`profile-${config.profile}`);
27
+ }
28
+ const brand = cssVar("--lectern-brand", "#007bc5");
29
+ const brandStrong = cssVar("--lectern-brand-strong", "#004573");
30
+ const ink = cssVar("--lectern-ink", "#232d35");
31
+ const line = cssVar("--lectern-line", "#d6dde2");
32
+ const bgSoft = cssVar("--lectern-bg-soft", "#f6f8f9");
33
+ const font = getComputedStyle(revealEl ?? document.documentElement).fontFamily || "sans-serif";
34
+ mermaid.initialize({
35
+ startOnLoad: false,
36
+ securityLevel: "loose",
37
+ theme: "base",
38
+ fontFamily: font,
39
+ flowchart: { htmlLabels: false, useMaxWidth: false, padding: 10, nodeSpacing: 50, rankSpacing: 55 },
40
+ themeVariables: {
41
+ fontFamily: font,
42
+ primaryColor: bgSoft,
43
+ primaryBorderColor: brand,
44
+ primaryTextColor: ink,
45
+ lineColor: brandStrong,
46
+ secondaryColor: "#ffffff",
47
+ tertiaryColor: bgSoft,
48
+ tertiaryBorderColor: line,
49
+ clusterBkg: "#ffffff",
50
+ clusterBorder: line
51
+ }
52
+ });
53
+ const deck = new Reveal({
54
+ width: 1280,
55
+ height: 720,
56
+ // Let the presentation fill any viewport. A deck may still explicitly
57
+ // cap either value through its `reveal` configuration.
58
+ minScale: 0,
59
+ maxScale: Infinity,
60
+ hash: true,
61
+ // In PDF export, keep one page per slide (show all fragments) instead of one page per fragment step: better for a handout.
62
+ pdfSeparateFragments: false,
63
+ transition: config.transition ?? "slide",
64
+ plugins: [RevealHighlight, RevealNotes],
65
+ ...config.reveal ?? {}
66
+ });
67
+ await deck.initialize();
68
+ const viewport = revealEl?.closest(".reveal-viewport");
69
+ if (config.profile && viewport) viewport.classList.add(`profile-${config.profile}`);
70
+ async function renderMermaid(scope) {
71
+ const nodes = Array.from((scope ?? document).querySelectorAll(".mermaid:not([data-processed])"));
72
+ if (!nodes.length) return;
73
+ const slides = document.querySelector(".reveal .slides");
74
+ const transform = slides?.style.transform;
75
+ if (slides && transform?.includes("scale(")) {
76
+ slides.style.transform = transform.replace(/scale\([^)]*\)/, "scale(1)");
77
+ }
78
+ try {
79
+ await mermaid.run({ nodes });
80
+ } catch (err) {
81
+ console.error("[lectern] mermaid render error", err);
82
+ } finally {
83
+ if (slides && transform !== void 0) {
84
+ slides.style.transform = transform;
85
+ }
86
+ }
87
+ document.querySelectorAll("body > .mermaidTooltip").forEach((tooltip) => {
88
+ tooltip.style.position = "fixed";
89
+ });
90
+ deck.layout();
91
+ }
92
+ const isPrint = /print-pdf/.test(location.search);
93
+ if (isPrint) {
94
+ const formatPdfSlideNumbers = () => {
95
+ const pages = Array.from(document.querySelectorAll(".pdf-page"));
96
+ pages.forEach((page, index) => {
97
+ const number = page.querySelector(".slide-number-pdf");
98
+ if (number) number.textContent = `${index + 1} / ${pages.length}`;
99
+ });
100
+ };
101
+ deck.on("pdf-ready", formatPdfSlideNumbers);
102
+ await renderMermaid(document);
103
+ formatPdfSlideNumbers();
104
+ } else {
105
+ await renderMermaid(deck.getCurrentSlide());
106
+ deck.on("slidechanged", (event) => {
107
+ void renderMermaid(event.currentSlide);
108
+ });
109
+ }
110
+ if (document.querySelector("[data-lectern-infograph-discovery]")) {
111
+ const { initInfographDiscovery } = await import("./graph-CUYNIBIQ.js");
112
+ const infographReady = initInfographDiscovery(deck);
113
+ if (isPrint) await infographReady;
114
+ }
115
+ ;
116
+ window.Reveal = deck;
117
+ }
118
+ void main();
119
+ //# sourceMappingURL=entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/entry.ts"],"sourcesContent":["/*\n * Browser runtime for a `lectern` deck. Bundled by Vite (dev + build).\n * Imports every core asset so the built output is fully self-contained:\n * reveal.js core + plugins and Mermaid. The active profile's stylesheet is\n * imported after this module by the CLI. Reads deck config from the\n * `#lectern-config` JSON script tag.\n */\nimport mermaid from 'mermaid'\nimport Reveal from 'reveal.js'\nimport RevealHighlight from 'reveal.js/plugin/highlight'\nimport RevealNotes from 'reveal.js/plugin/notes'\n\nimport 'reveal.js/plugin/highlight/monokai.css'\nimport 'reveal.js/reveal.css'\n\ninterface PresentConfig {\n profile?: string\n transition?: string\n reveal?: Record<string, unknown>\n}\n\nfunction readConfig(): PresentConfig {\n const el = document.getElementById('lectern-config')\n if (!el?.textContent) return {}\n try {\n return JSON.parse(el.textContent) as PresentConfig\n } catch {\n return {}\n }\n}\n\n// Profile tokens live on the `.reveal.profile-<name>` element, not :root.\nfunction cssVar(name: string, fallback: string): string {\n const root = document.querySelector('.reveal') ?? document.documentElement\n const v = getComputedStyle(root).getPropertyValue(name).trim()\n return v || fallback\n}\n\nasync function main() {\n const config = readConfig()\n\n // Ensure the active profile class is lectern (the renderer sets it server-side).\n const revealEl = document.querySelector('.reveal')\n if (config.profile && revealEl && !revealEl.classList.contains(`profile-${config.profile}`)) {\n revealEl.classList.add(`profile-${config.profile}`)\n }\n\n // Theme Mermaid to match the active profile before rendering.\n const brand = cssVar('--lectern-brand', '#007bc5')\n const brandStrong = cssVar('--lectern-brand-strong', '#004573')\n const ink = cssVar('--lectern-ink', '#232d35')\n const line = cssVar('--lectern-line', '#d6dde2')\n const bgSoft = cssVar('--lectern-bg-soft', '#f6f8f9')\n // The profile's *resolved* font stack (from Fluid) — we don't invent a font.\n // Mermaid pins labels to this value in its generated stylesheet, so measured\n // and rendered widths agree.\n const font = getComputedStyle(revealEl ?? document.documentElement).fontFamily || 'sans-serif'\n\n mermaid.initialize({\n startOnLoad: false,\n securityLevel: 'loose',\n theme: 'base',\n fontFamily: font,\n flowchart: { htmlLabels: false, useMaxWidth: false, padding: 10, nodeSpacing: 50, rankSpacing: 55 },\n themeVariables: {\n fontFamily: font,\n primaryColor: bgSoft,\n primaryBorderColor: brand,\n primaryTextColor: ink,\n lineColor: brandStrong,\n secondaryColor: '#ffffff',\n tertiaryColor: bgSoft,\n tertiaryBorderColor: line,\n clusterBkg: '#ffffff',\n clusterBorder: line,\n },\n })\n\n const deck = new Reveal({\n width: 1280,\n height: 720,\n // Let the presentation fill any viewport. A deck may still explicitly\n // cap either value through its `reveal` configuration.\n minScale: 0,\n maxScale: Infinity,\n hash: true,\n // In PDF export, keep one page per slide (show all fragments) instead of one page per fragment step: better for a handout.\n pdfSeparateFragments: false,\n transition: (config.transition as 'slide') ?? 'slide',\n plugins: [RevealHighlight, RevealNotes],\n ...(config.reveal ?? {}),\n })\n\n await deck.initialize()\n\n // Reveal marks its viewport during initialization; tag it with the profile so\n // profile CSS can style the area around the scaled canvas.\n const viewport = revealEl?.closest('.reveal-viewport')\n if (config.profile && viewport) viewport.classList.add(`profile-${config.profile}`)\n\n // Mermaid must render while its slide is VISIBLE: a diagram rendered inside a `display:none` slide collapses to zero size. So we render lazily: all at once for PDF (every slide is shown), otherwise per-slide on navigation.\n async function renderMermaid(scope: ParentNode | null) {\n const nodes = Array.from((scope ?? document).querySelectorAll<HTMLElement>('.mermaid:not([data-processed])'))\n if (!nodes.length) return\n // Mermaid measures SVG labels in screen coordinates. Reveal scales the\n // `.slides` canvas with a CSS transform, which would make Mermaid bake\n // that scale into node dimensions and then scale them a second time.\n // Render in the unscaled 1280×720 coordinate system, then restore\n // Reveal's transform for display.\n const slides = document.querySelector<HTMLElement>('.reveal .slides')\n const transform = slides?.style.transform\n if (slides && transform?.includes('scale(')) {\n slides.style.transform = transform.replace(/scale\\([^)]*\\)/, 'scale(1)')\n }\n try {\n await mermaid.run({ nodes })\n } catch (err) {\n console.error('[lectern] mermaid render error', err)\n } finally {\n if (slides && transform !== undefined) {\n slides.style.transform = transform\n }\n }\n // Mermaid appends a shared tooltip to <body>. Its default absolute\n // position extends the document by a few pixels, which becomes a\n // trailing blank PDF page in print mode. Keep it available for hover\n // interactions without letting it participate in document height.\n document.querySelectorAll<HTMLElement>('body > .mermaidTooltip').forEach(tooltip => {\n tooltip.style.position = 'fixed'\n })\n deck.layout()\n }\n\n const isPrint = /print-pdf/.test(location.search)\n if (isPrint) {\n const formatPdfSlideNumbers = () => {\n const pages = Array.from(document.querySelectorAll<HTMLElement>('.pdf-page'))\n pages.forEach((page, index) => {\n const number = page.querySelector<HTMLElement>('.slide-number-pdf')\n if (number) number.textContent = `${index + 1} / ${pages.length}`\n })\n }\n deck.on('pdf-ready', formatPdfSlideNumbers)\n await renderMermaid(document)\n // Reveal's PDF renderer ignores the `c/t` slide-number format and\n // injects a bare sequential number into each generated `.pdf-page`.\n // Its asynchronous `pdf-ready` event is the point at which the total\n // number of exported pages is known.\n formatPdfSlideNumbers()\n } else {\n await renderMermaid(deck.getCurrentSlide())\n deck.on('slidechanged', event => {\n void renderMermaid((event as unknown as { currentSlide: HTMLElement }).currentSlide)\n })\n }\n\n // Opt-in infograph discovery. Dynamic import keeps Cytoscape out of decks\n // that do not embed the component; in PDF mode it renders the seed graph\n // without an interactive surface.\n if (document.querySelector('[data-lectern-infograph-discovery]')) {\n const { initInfographDiscovery } = await import('./graph')\n const infographReady = initInfographDiscovery(deck as unknown as Parameters<typeof initInfographDiscovery>[0])\n if (isPrint) await infographReady\n }\n\n // Expose for tooling (PDF export waits on this).\n ;(window as unknown as { Reveal: unknown }).Reveal = deck\n}\n\nvoid main()\n"],"mappings":";AAOA,OAAO,aAAa;AACpB,OAAO,YAAY;AACnB,OAAO,qBAAqB;AAC5B,OAAO,iBAAiB;AAExB,OAAO;AACP,OAAO;AAQP,SAAS,aAA4B;AACnC,QAAM,KAAK,SAAS,eAAe,gBAAgB;AACnD,MAAI,CAAC,IAAI,YAAa,QAAO,CAAC;AAC9B,MAAI;AACF,WAAO,KAAK,MAAM,GAAG,WAAW;AAAA,EAClC,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACF;AAGA,SAAS,OAAO,MAAc,UAA0B;AACtD,QAAM,OAAO,SAAS,cAAc,SAAS,KAAK,SAAS;AAC3D,QAAM,IAAI,iBAAiB,IAAI,EAAE,iBAAiB,IAAI,EAAE,KAAK;AAC7D,SAAO,KAAK;AACd;AAEA,eAAe,OAAO;AACpB,QAAM,SAAS,WAAW;AAG1B,QAAM,WAAW,SAAS,cAAc,SAAS;AACjD,MAAI,OAAO,WAAW,YAAY,CAAC,SAAS,UAAU,SAAS,WAAW,OAAO,OAAO,EAAE,GAAG;AAC3F,aAAS,UAAU,IAAI,WAAW,OAAO,OAAO,EAAE;AAAA,EACpD;AAGA,QAAM,QAAQ,OAAO,mBAAmB,SAAS;AACjD,QAAM,cAAc,OAAO,0BAA0B,SAAS;AAC9D,QAAM,MAAM,OAAO,iBAAiB,SAAS;AAC7C,QAAM,OAAO,OAAO,kBAAkB,SAAS;AAC/C,QAAM,SAAS,OAAO,qBAAqB,SAAS;AAIpD,QAAM,OAAO,iBAAiB,YAAY,SAAS,eAAe,EAAE,cAAc;AAElF,UAAQ,WAAW;AAAA,IACjB,aAAa;AAAA,IACb,eAAe;AAAA,IACf,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,WAAW,EAAE,YAAY,OAAO,aAAa,OAAO,SAAS,IAAI,aAAa,IAAI,aAAa,G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AM,WAAW;AAAA,IAC3B,CAAC;AACD,SAAK,OAAO;AAAA,EACd;AAEA,QAAM,UAAU,YAAY,KAAK,SAAS,MAAM;AAChD,MAAI,SAAS;AACX,UAAM,wBAAwB,MAAM;AAClC,YAAM,QAAQ,MAAM,KAAK,SAAS,iBAA8B,WAAW,CAAC;AAC5E,YAAM,QAAQ,CAAC,MAAM,UAAU;AAC7B,cAAM,SAAS,KAAK,cAA2B,mBAAmB;AAClE,YAAI,OAAQ,QAAO,cAAc,GAAG,QAAQ,CAAC,MAAM,MAAM,MAAM;AAAA,MACjE,CAAC;AAAA,IACH;AACA,SAAK,GAAG,aAAa,qBAAqB;AAC1C,UAAM,cAAc,QAAQ;AAK5B,0BAAsB;AAAA,EACxB,OAAO;AACL,UAAM,cAAc,KAAK,gBAAgB,CAAC;AAC1C,SAAK,GAAG,gBAAgB,WAAS;AAC/B,WAAK,cAAe,MAAmD,YAAY;AAAA,IACrF,CAAC;AAAA,EACH;AAKA,MAAI,SAAS,cAAc,oCAAoC,GAAG;AAChE,UAAM,EAAE,uBAAuB,IAAI,MAAM,OAAO,qBAAS;AACzD,UAAM,iBAAiB,uBAAuB,IAA+D;AAC7G,QAAI,QAAS,OAAM;AAAA,EACrB;AAGA;AAAC,EAAC,OAA0C,SAAS;AACvD;AAEA,KAAK,KAAK;","names":[]}
@@ -0,0 +1,407 @@
1
+ // src/client/graph.tsx
2
+ import cytoscape from "cytoscape";
3
+ import fcose from "cytoscape-fcose";
4
+ import { render } from "preact";
5
+
6
+ // src/infographDiscovery.ts
7
+ function selectDiscoveryRelations(payload, selection) {
8
+ const nodeByKey = new Map(payload.nodes.map((node) => [node.key, node]));
9
+ const edgeByKey = new Map(payload.edges.map((edge) => [edge.key, edge]));
10
+ const selectedEdge = selection.type === "edge" ? edgeByKey.get(selection.key) : void 0;
11
+ const roots = selection.type === "node" ? [selection.key] : selectedEdge ? [selectedEdge.from, selectedEdge.to] : [];
12
+ const incidence = countIncidence(payload);
13
+ const adjacency = /* @__PURE__ */ new Map();
14
+ for (const edge of payload.edges) {
15
+ add(adjacency, edge.from, edge);
16
+ add(adjacency, edge.to, edge);
17
+ }
18
+ const queue = roots.map((key) => ({ key, distance: 0 }));
19
+ const nodeDistance = new Map(roots.map((key) => [key, 0]));
20
+ const seenEdges = /* @__PURE__ */ new Set();
21
+ const result = [];
22
+ if (selectedEdge) {
23
+ seenEdges.add(selectedEdge.key);
24
+ result.push({ edge: selectedEdge, distance: 0 });
25
+ }
26
+ for (let cursor = 0; cursor < queue.length; cursor++) {
27
+ const current = queue[cursor];
28
+ const edges = [...adjacency.get(current.key) ?? []].sort(
29
+ (left, right) => compareEdges(left, right, current.key, nodeByKey, incidence)
30
+ );
31
+ for (const edge of edges) {
32
+ if (seenEdges.has(edge.key)) continue;
33
+ seenEdges.add(edge.key);
34
+ const neighbor = edge.from === current.key ? edge.to : edge.from;
35
+ const distance = current.distance + 1;
36
+ result.push({ edge, distance });
37
+ if (!nodeDistance.has(neighbor)) {
38
+ nodeDistance.set(neighbor, distance);
39
+ queue.push({ key: neighbor, distance });
40
+ }
41
+ }
42
+ }
43
+ return result;
44
+ }
45
+ function add(map, key, value) {
46
+ const values = map.get(key);
47
+ if (values) values.push(value);
48
+ else map.set(key, [value]);
49
+ }
50
+ function countIncidence(payload) {
51
+ const incidence = new Map(payload.nodes.map((node) => [node.key, 0]));
52
+ for (const edge of payload.edges) {
53
+ incidence.set(edge.from, (incidence.get(edge.from) ?? 0) + 1);
54
+ incidence.set(edge.to, (incidence.get(edge.to) ?? 0) + 1);
55
+ }
56
+ return incidence;
57
+ }
58
+ function compareEdges(left, right, current, nodes, incidence) {
59
+ const leftNeighbor = left.from === current ? left.to : left.from;
60
+ const rightNeighbor = right.from === current ? right.to : right.from;
61
+ const importance = importanceRank(nodes.get(rightNeighbor)?.importance?.is) - importanceRank(nodes.get(leftNeighbor)?.importance?.is);
62
+ if (importance !== 0) return importance;
63
+ const degree = (incidence.get(rightNeighbor) ?? 0) - (incidence.get(leftNeighbor) ?? 0);
64
+ if (degree !== 0) return degree;
65
+ const title = (nodes.get(leftNeighbor)?.title ?? leftNeighbor).localeCompare(
66
+ nodes.get(rightNeighbor)?.title ?? rightNeighbor
67
+ );
68
+ if (title !== 0) return title;
69
+ const verb = left.verb.localeCompare(right.verb);
70
+ return verb !== 0 ? verb : left.key.localeCompare(right.key);
71
+ }
72
+ function importanceRank(value) {
73
+ switch (value) {
74
+ case "central":
75
+ return 4;
76
+ case "major":
77
+ return 3;
78
+ case "useful":
79
+ return 2;
80
+ case "minor":
81
+ return 1;
82
+ default:
83
+ return 0;
84
+ }
85
+ }
86
+ function searchLabel(node) {
87
+ return `${node.title} \xB7 ${node.key}`;
88
+ }
89
+
90
+ // src/jsx-runtime.ts
91
+ import { Fragment, jsx, jsx as jsx2, jsxs } from "preact/jsx-runtime";
92
+
93
+ // src/infographDiscoveryView.tsx
94
+ function InfographDiscoveryDetails({ payload, selection, searchId, onSearch }) {
95
+ const nodes = new Map(payload.nodes.map((node) => [node.key, node]));
96
+ const edges = new Map(payload.edges.map((edge) => [edge.key, edge]));
97
+ const selected = selection.type === "node" ? nodes.get(selection.key) : edges.get(selection.key);
98
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
99
+ /* @__PURE__ */ jsx(Search, { payload, id: searchId, onSearch }),
100
+ /* @__PURE__ */ jsx("div", { class: "lectern-infograph-details", children: selection.type === "node" ? /* @__PURE__ */ jsx(NodeDetails, { node: selected }) : /* @__PURE__ */ jsx(EdgeDetails, { edge: selected, nodes }) })
101
+ ] });
102
+ }
103
+ function Search({
104
+ payload,
105
+ id,
106
+ onSearch
107
+ }) {
108
+ const listId = `${id}-options`;
109
+ return /* @__PURE__ */ jsxs("div", { class: "lectern-infograph-search-slot", children: [
110
+ /* @__PURE__ */ jsx("label", { class: "lectern-infograph-discovery-search-label", for: id, children: "Acc\xE9der \xE0 un n\u0153ud" }),
111
+ /* @__PURE__ */ jsx(
112
+ "input",
113
+ {
114
+ class: "lectern-infograph-discovery-search",
115
+ id,
116
+ type: "search",
117
+ list: listId,
118
+ placeholder: "Rechercher un projet, un outil, un acteur\u2026",
119
+ onChange: (event) => onSearch?.(event.currentTarget.value)
120
+ }
121
+ ),
122
+ /* @__PURE__ */ jsx("datalist", { id: listId, children: payload.nodes.slice().sort((left, right) => left.title.localeCompare(right.title) || left.key.localeCompare(right.key)).map((node) => /* @__PURE__ */ jsx("option", { value: searchLabel(node) })) })
123
+ ] });
124
+ }
125
+ function NodeDetails({ node }) {
126
+ if (!node) return /* @__PURE__ */ jsx("p", { class: "lectern-infograph-empty", children: "N\u0153ud introuvable." });
127
+ return /* @__PURE__ */ jsxs("div", { class: "lectern-infograph-detail", children: [
128
+ /* @__PURE__ */ jsxs("div", { style: "position:relative", children: [
129
+ /* @__PURE__ */ jsx("span", { style: "position:absolute", class: "lectern-infograph-kind", children: node.kind }),
130
+ /* @__PURE__ */ jsx("span", { style: "display:inline-block;width:100%;text-align:center;", children: node.title })
131
+ ] }),
132
+ node.summary ? /* @__PURE__ */ jsx("p", { class: "lectern-infograph-summary", children: node.summary }) : null,
133
+ /* @__PURE__ */ jsx(Metadata, { value: node }),
134
+ /* @__PURE__ */ jsx(Claims, { claims: node.claim }),
135
+ /* @__PURE__ */ jsx(Sources, { sources: node.source })
136
+ ] });
137
+ }
138
+ function EdgeDetails({ edge, nodes }) {
139
+ if (!edge) return /* @__PURE__ */ jsx("p", { class: "lectern-infograph-empty", children: "Relation introuvable." });
140
+ return /* @__PURE__ */ jsxs("div", { class: "lectern-infograph-detail", children: [
141
+ /* @__PURE__ */ jsxs("div", { style: "gap:1em;display:flex;justify-content:space-between;align-items:center", children: [
142
+ /* @__PURE__ */ jsxs("span", { children: [
143
+ nodes.get(edge.from)?.title,
144
+ " ",
145
+ /* @__PURE__ */ jsx("span", { style: "font-weight:bold", children: edge.verb }),
146
+ " ",
147
+ nodes.get(edge.to)?.title
148
+ ] }),
149
+ /* @__PURE__ */ jsx("span", { class: "lectern-infograph-key", style: "text-align:right", children: edge.key })
150
+ ] }),
151
+ /* @__PURE__ */ jsx(Metadata, { value: edge }),
152
+ /* @__PURE__ */ jsx(Claims, { claims: edge.claim })
153
+ ] });
154
+ }
155
+ function Metadata({ value }) {
156
+ const period = value.date && (value.date.from === value.date.to ? value.date.from : /* @__PURE__ */ jsxs(Fragment, { children: [
157
+ value.date.from,
158
+ " \u2013 ",
159
+ value.date.to
160
+ ] }));
161
+ return /* @__PURE__ */ jsxs("dl", { class: "lectern-infograph-metadata", children: [
162
+ period ? /* @__PURE__ */ jsx(MetadataRow, { label: "P\xE9riode", children: period }) : null,
163
+ /* @__PURE__ */ jsx(Reason, { label: "Complexit\xE9", value: value.complexity }),
164
+ value.importance ? /* @__PURE__ */ jsx(Reason, { label: "Importance", value: value.importance }) : null,
165
+ value.technicality ? /* @__PURE__ */ jsx(Reason, { label: "Technicit\xE9", value: value.technicality }) : null,
166
+ value.tag?.length ? /* @__PURE__ */ jsx(MetadataRow, { label: "Tags", children: value.tag.join(" ") }) : null
167
+ ] });
168
+ }
169
+ function MetadataRow({ label, children }) {
170
+ return /* @__PURE__ */ jsxs("div", { children: [
171
+ /* @__PURE__ */ jsx("dt", { children: label }),
172
+ /* @__PURE__ */ jsx("dd", { children })
173
+ ] });
174
+ }
175
+ function Reason({ label, value }) {
176
+ return /* @__PURE__ */ jsxs(MetadataRow, { label, children: [
177
+ /* @__PURE__ */ jsx("strong", { children: value.is }),
178
+ /* @__PURE__ */ jsx(FlexList, { onePrefix: " : ", of: value.why })
179
+ ] });
180
+ }
181
+ function Claims({ claims }) {
182
+ if (!claims?.length) return null;
183
+ return /* @__PURE__ */ jsxs("div", { class: "lectern-infograph-section", "aria-label": "Claims", children: [
184
+ /* @__PURE__ */ jsx("h4", { children: "Claims" }),
185
+ /* @__PURE__ */ jsx(
186
+ FlexList,
187
+ {
188
+ of: claims.map((claim) => /* @__PURE__ */ jsxs(Fragment, { children: [
189
+ /* @__PURE__ */ jsx("strong", { children: claim.type }),
190
+ " : ",
191
+ claim.content
192
+ ] }))
193
+ }
194
+ )
195
+ ] });
196
+ }
197
+ function Sources({ sources }) {
198
+ if (!sources?.length) return null;
199
+ return /* @__PURE__ */ jsxs("div", { class: "lectern-infograph-section", "aria-label": "Sources", children: [
200
+ /* @__PURE__ */ jsx("h4", { children: "Sources" }),
201
+ /* @__PURE__ */ jsx(
202
+ FlexList,
203
+ {
204
+ of: sources.map((source) => /* @__PURE__ */ jsxs(Fragment, { children: [
205
+ /* @__PURE__ */ jsx("strong", { children: source.is }),
206
+ /* @__PURE__ */ jsx(FlexList, { onePrefix: " : ", of: source.why })
207
+ ] }))
208
+ }
209
+ )
210
+ ] });
211
+ }
212
+ function FlexList({ of, onePrefix = null }) {
213
+ return of.length > 1 ? /* @__PURE__ */ jsx("ul", { class: "lectern-infograph-reason", children: of.map((it) => /* @__PURE__ */ jsx("li", { children: it })) }) : of[0] ? /* @__PURE__ */ jsxs(Fragment, { children: [
214
+ onePrefix,
215
+ of[0]
216
+ ] }) : null;
217
+ }
218
+
219
+ // src/client/graph.tsx
220
+ cytoscape.use(fcose);
221
+ var kindColor = {
222
+ actor: "#0891b2",
223
+ challenge: "#e0533d",
224
+ constraint: "#e0533d",
225
+ decision: "#d97706",
226
+ event: "#8b5cf6",
227
+ finding: "#a855f7",
228
+ jargon: "#a855f7",
229
+ learning: "#16a34a",
230
+ method: "#0d9488",
231
+ model: "#6c4796",
232
+ objective: "#16a34a",
233
+ problem: "#e0533d",
234
+ process: "#0d9488",
235
+ product: "#06b6d4",
236
+ project: "#0b57d0",
237
+ requirement: "#d97706",
238
+ skill: "#5b6b7a",
239
+ task: "#3b82f6",
240
+ tool: "#5b6b7a"
241
+ };
242
+ function initInfographDiscovery(deck) {
243
+ const initialLayouts = [];
244
+ const isPrint = /print-pdf/.test(location.search);
245
+ document.querySelectorAll("[data-lectern-infograph-discovery]").forEach((root) => {
246
+ const data = root.querySelector(".lectern-infograph-data");
247
+ const details = root.querySelector(".lectern-infograph-details-panel");
248
+ const graphContainer = root.querySelector(".lectern-infograph-graph");
249
+ const searchId = root.querySelector(".lectern-infograph-discovery-search")?.id;
250
+ const seed = root.dataset.discoverySeed;
251
+ if (!data?.textContent || !details || !graphContainer || !searchId || !seed) return;
252
+ let payload;
253
+ try {
254
+ payload = JSON.parse(data.textContent);
255
+ } catch {
256
+ return;
257
+ }
258
+ const budget = Number(root.dataset.relationBudget ?? 16);
259
+ const nodesBySearchLabel = new Map(payload.nodes.map((node) => [searchLabel(node), node.key]));
260
+ const slide = root.closest("section");
261
+ let selection = { type: "node", key: seed };
262
+ let cy;
263
+ let initialLayoutFinished = false;
264
+ let finishInitialLayout;
265
+ const initialLayout = new Promise((resolve) => {
266
+ finishInitialLayout = resolve;
267
+ });
268
+ initialLayouts.push(initialLayout);
269
+ const updateDetails = () => {
270
+ render(
271
+ /* @__PURE__ */ jsx(
272
+ InfographDiscoveryDetails,
273
+ {
274
+ payload,
275
+ selection,
276
+ searchId,
277
+ onSearch: (value) => {
278
+ const key = nodesBySearchLabel.get(value) ?? payload.nodes.find((node) => node.key === value || node.title === value)?.key;
279
+ if (key) select({ type: "node", key });
280
+ }
281
+ }
282
+ ),
283
+ details
284
+ );
285
+ };
286
+ const draw = () => {
287
+ if (!graphContainer.clientWidth) return;
288
+ cy?.destroy();
289
+ const relations = selectDiscoveryRelations(payload, selection).slice(0, budget);
290
+ const nodeKeys = new Set(relations.flatMap((relation) => [relation.edge.from, relation.edge.to]));
291
+ if (selection.type === "node") nodeKeys.add(selection.key);
292
+ const selectedEdge = selection.type === "edge" ? payload.edges.find((edge) => edge.key === selection.key) : void 0;
293
+ const activeNodeKeys = new Set(
294
+ selection.type === "node" ? [selection.key] : selectedEdge ? [selectedEdge.from, selectedEdge.to] : []
295
+ );
296
+ const nodes = payload.nodes.filter((node) => nodeKeys.has(node.key));
297
+ const elements = [
298
+ ...nodes.map((node) => ({
299
+ data: { id: node.key, label: node.title, kind: node.kind },
300
+ classes: activeNodeKeys.has(node.key) ? "is-active" : ""
301
+ })),
302
+ ...relations.map(({ edge }) => ({
303
+ data: { id: edge.key, source: edge.from, target: edge.to, label: edge.verb }
304
+ }))
305
+ ];
306
+ cy = cytoscape({
307
+ container: graphContainer,
308
+ elements,
309
+ style: [
310
+ {
311
+ selector: "node",
312
+ style: {
313
+ "background-color": (element) => kindColor[element.data("kind")] ?? "#5b6b7a",
314
+ label: "data(label)",
315
+ color: "#000000",
316
+ "font-size": 9,
317
+ "font-weight": 400,
318
+ "text-wrap": "wrap",
319
+ "text-max-width": "88px",
320
+ "text-valign": "bottom",
321
+ "text-halign": "center",
322
+ "text-margin-y": 3,
323
+ width: 18,
324
+ height: 18
325
+ }
326
+ },
327
+ { selector: "node.is-active", style: { "font-weight": 700 } },
328
+ {
329
+ selector: "edge",
330
+ style: {
331
+ width: 1.5,
332
+ "line-color": "#9aa7b0",
333
+ "target-arrow-color": "#9aa7b0",
334
+ "target-arrow-shape": "triangle",
335
+ "arrow-scale": 0.7,
336
+ "curve-style": "straight",
337
+ label: "data(label)",
338
+ "font-size": 8,
339
+ color: "#4d5c66",
340
+ "text-rotation": "autorotate",
341
+ "text-background-color": "#ffffff",
342
+ "text-background-opacity": 1,
343
+ "text-background-padding": "1px"
344
+ }
345
+ },
346
+ { selector: "node:selected", style: { "border-width": 3, "border-color": "#00b8de" } },
347
+ { selector: "edge:selected", style: { width: 3, "line-color": "#00b8de", "target-arrow-color": "#00b8de" } }
348
+ ],
349
+ layout: { name: "grid", animate: false }
350
+ });
351
+ const layoutOptions = {
352
+ name: "fcose",
353
+ animate: false,
354
+ idealEdgeLength: () => 50,
355
+ nodeRepulsion: () => 7e3,
356
+ padding: 10,
357
+ nodeDimensionsIncludeLabels: true
358
+ };
359
+ const layout = cy.layout(layoutOptions);
360
+ layout.one("layoutstop", () => {
361
+ cy?.fit(void 0, 24);
362
+ if (initialLayoutFinished) return;
363
+ initialLayoutFinished = true;
364
+ requestAnimationFrame(
365
+ () => requestAnimationFrame(() => {
366
+ if (isPrint && cy) {
367
+ const snapshot = new Image();
368
+ snapshot.src = cy.png({ full: true, scale: 2, bg: "#ffffff" });
369
+ void snapshot.decode().finally(() => {
370
+ graphContainer.replaceChildren();
371
+ graphContainer.style.background = `center / contain no-repeat url("${snapshot.src}")`;
372
+ requestAnimationFrame(finishInitialLayout);
373
+ });
374
+ } else {
375
+ finishInitialLayout();
376
+ }
377
+ })
378
+ );
379
+ });
380
+ layout.run();
381
+ cy.on("tap", "node", (event) => select({ type: "node", key: event.target.id() }));
382
+ cy.on("tap", "edge", (event) => select({ type: "edge", key: event.target.id() }));
383
+ };
384
+ const select = (next) => {
385
+ selection = next;
386
+ updateDetails();
387
+ draw();
388
+ };
389
+ const renderWhenVisible = () => {
390
+ if (/print-pdf/.test(location.search) || deck.getCurrentSlide() === slide) draw();
391
+ };
392
+ updateDetails();
393
+ renderWhenVisible();
394
+ deck.on("slidechanged", renderWhenVisible);
395
+ window.addEventListener("resize", () => {
396
+ if (cy) {
397
+ cy.resize();
398
+ cy.fit(void 0, 24);
399
+ }
400
+ });
401
+ });
402
+ return Promise.all(initialLayouts).then(() => void 0);
403
+ }
404
+ export {
405
+ initInfographDiscovery
406
+ };
407
+ //# sourceMappingURL=graph-CUYNIBIQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/graph.tsx","../../src/infographDiscovery.ts","../../src/jsx-runtime.ts","../../src/infographDiscoveryView.tsx"],"sourcesContent":["import cytoscape from 'cytoscape'\nimport fcose from 'cytoscape-fcose'\ncytoscape.use(fcose)\nimport { render } from 'preact'\nimport { InfographDiscoveryDetails } from '../infographDiscoveryView'\nimport {\n searchLabel,\n selectDiscoveryRelations,\n type DiscoveryPayload,\n type DiscoverySelection,\n} from '../infographDiscovery'\n\nconst kindColor: Record<string, string> = {\n actor: '#0891b2',\n challenge: '#e0533d',\n constraint: '#e0533d',\n decision: '#d97706',\n event: '#8b5cf6',\n finding: '#a855f7',\n jargon: '#a855f7',\n learning: '#16a34a',\n method: '#0d9488',\n model: '#6c4796',\n objective: '#16a34a',\n problem: '#e0533d',\n process: '#0d9488',\n product: '#06b6d4',\n project: '#0b57d0',\n requirement: '#d97706',\n skill: '#5b6b7a',\n task: '#3b82f6',\n tool: '#5b6b7a',\n}\n\ninterface RevealLike {\n getCurrentSlide: () => Element | undefined\n on: (event: string, callback: () => void) => void\n}\n\nexport function initInfographDiscovery(deck: RevealLike): Promise<void> {\n const initialLayouts: Promise<void>[] = []\n const isPrint = /print-pdf/.test(location.search)\n document.querySelectorAll<HTMLElement>('[data-lectern-infograph-discovery]').forEach(root => {\n const data = root.querySelector<HTMLScriptElement>('.lectern-infograph-data')\n const details = root.querySelector<HTMLElement>('.lectern-infograph-details-panel')\n const graphContainer = root.querySelector<HTMLElement>('.lectern-infograph-graph')\n const searchId = root.querySelector<HTMLInputElement>('.lectern-infograph-discovery-search')?.id\n const seed = root.dataset.discoverySeed\n if (!data?.textContent || !details || !graphContainer || !searchId || !seed) return\n\n let payload: DiscoveryPayload\n try {\n payload = JSON.parse(data.textContent) as DiscoveryPayload\n } catch {\n return\n }\n\n const budget = Number(root.dataset.relationBudget ?? 16)\n const nodesBySearchLabel = new Map(payload.nodes.map(node => [searchLabel(node), node.key]))\n const slide = root.closest('section')\n let selection: DiscoverySelection = { type: 'node', key: seed }\n let cy: cytoscape.Core | undefined\n let initialLayoutFinished = false\n let finishInitialLayout: () => void\n const initialLayout = new Promise<void>(resolve => {\n finishInitialLayout = resolve\n })\n initialLayouts.push(initialLayout)\n\n const updateDetails = () => {\n render(\n <InfographDiscoveryDetails\n payload={payload}\n selection={selection}\n searchId={searchId}\n onSearch={value => {\n const key =\n nodesBySearchLabel.get(value) ??\n payload.nodes.find(node => node.key === value || node.title === value)?.key\n if (key) select({ type: 'node', key })\n }}\n />,\n details\n )\n }\n\n const draw = () => {\n if (!graphContainer.clientWidth) return\n cy?.destroy()\n const relations = selectDiscoveryRelations(payload, selection).slice(0, budget)\n const nodeKeys = new Set(relations.flatMap(relation => [relation.edge.from, relation.edge.to]))\n if (selection.type === 'node') nodeKeys.add(selection.key)\n const selectedEdge =\n selection.type === 'edge' ? payload.edges.find(edge => edge.key === selection.key) : undefined\n const activeNodeKeys = new Set(\n selection.type === 'node' ? [selection.key] : selectedEdge ? [selectedEdge.from, selectedEdge.to] : []\n )\n const nodes = payload.nodes.filter(node => nodeKeys.has(node.key))\n const elements: cytoscape.ElementDefinition[] = [\n ...nodes.map(node => ({\n data: { id: node.key, label: node.title, kind: node.kind },\n classes: activeNodeKeys.has(node.key) ? 'is-active' : '',\n })),\n ...relations.map(({ edge }) => ({\n data: { id: edge.key, source: edge.from, target: edge.to, label: edge.verb },\n })),\n ]\n cy = cytoscape({\n container: graphContainer,\n elements,\n style: [\n {\n selector: 'node',\n style: {\n 'background-color': (element: cytoscape.NodeSingular) => kindColor[element.data('kind')] ?? '#5b6b7a',\n label: 'data(label)',\n color: '#000000',\n 'font-size': 9,\n 'font-weight': 400,\n 'text-wrap': 'wrap',\n 'text-max-width': '88px',\n 'text-valign': 'bottom',\n 'text-halign': 'center',\n 'text-margin-y': 3,\n width: 18,\n height: 18,\n },\n },\n { selector: 'node.is-active', style: { 'font-weight': 700 } },\n {\n selector: 'edge',\n style: {\n width: 1.5,\n 'line-color': '#9aa7b0',\n 'target-arrow-color': '#9aa7b0',\n 'target-arrow-shape': 'triangle',\n 'arrow-scale': 0.7,\n 'curve-style': 'straight',\n label: 'data(label)',\n 'font-size': 8,\n color: '#4d5c66',\n 'text-rotation': 'autorotate',\n 'text-background-color': '#ffffff',\n 'text-background-opacity': 1,\n 'text-background-padding': '1px',\n },\n },\n { selector: 'node:selected', style: { 'border-width': 3, 'border-color': '#00b8de' } },\n { selector: 'edge:selected', style: { width: 3, 'line-color': '#00b8de', 'target-arrow-color': '#00b8de' } },\n ] satisfies cytoscape.StylesheetStyle[],\n layout: { name: 'grid', animate: false },\n })\n const layoutOptions: fcose.FcoseLayoutOptions = {\n name: 'fcose',\n animate: false,\n idealEdgeLength: () => 50,\n nodeRepulsion: () => 7000,\n padding: 10,\n nodeDimensionsIncludeLabels: true,\n }\n const layout = cy.layout(layoutOptions)\n layout.one('layoutstop', () => {\n cy?.fit(undefined, 24)\n if (initialLayoutFinished) return\n initialLayoutFinished = true\n requestAnimationFrame(() =>\n requestAnimationFrame(() => {\n if (isPrint && cy) {\n const snapshot = new Image()\n snapshot.src = cy.png({ full: true, scale: 2, bg: '#ffffff' })\n void snapshot.decode().finally(() => {\n graphContainer.replaceChildren()\n graphContainer.style.background = `center / contain no-repeat url(\"${snapshot.src}\")`\n requestAnimationFrame(finishInitialLayout)\n })\n } else {\n finishInitialLayout()\n }\n })\n )\n })\n layout.run()\n cy.on('tap', 'node', event => select({ type: 'node', key: event.target.id() }))\n cy.on('tap', 'edge', event => select({ type: 'edge', key: event.target.id() }))\n }\n\n const select = (next: DiscoverySelection) => {\n selection = next\n updateDetails()\n draw()\n }\n\n const renderWhenVisible = () => {\n if (/print-pdf/.test(location.search) || deck.getCurrentSlide() === slide) draw()\n }\n\n updateDetails()\n renderWhenVisible()\n deck.on('slidechanged', renderWhenVisible)\n window.addEventListener('resize', () => {\n if (cy) {\n cy.resize()\n cy.fit(undefined, 24)\n }\n })\n })\n return Promise.all(initialLayouts).then(() => undefined)\n}\n","import type { BaseKeys, Infograph } from 'infograph'\n\nexport type DiscoveryClaim = {\n type: string\n content: string\n}\n\nexport type DiscoveryReason = {\n is: string\n why: string[]\n}\n\nexport type DiscoveryNode = {\n key: string\n kind: string\n id: string\n title: string\n summary?: string\n claim?: DiscoveryClaim[]\n date?: { from: string; to: string }\n importance?: DiscoveryReason\n complexity: DiscoveryReason\n technicality?: DiscoveryReason\n source?: DiscoveryReason[]\n tag?: string[]\n}\n\nexport type DiscoveryEdge = {\n key: string\n from: string\n to: string\n verb: string\n complexity: DiscoveryReason\n technicality?: DiscoveryReason\n claim?: DiscoveryClaim[]\n}\n\nexport type DiscoveryPayload = {\n nodes: DiscoveryNode[]\n edges: DiscoveryEdge[]\n}\n\nexport type DiscoverySelection = { type: 'node'; key: string } | { type: 'edge'; key: string }\n\nexport type DiscoveryRelation = {\n edge: DiscoveryEdge\n distance: number\n}\n\nexport function toDiscoveryPayload<Keys extends BaseKeys>(infograph: Infograph<Keys>): DiscoveryPayload {\n return {\n nodes: [...infograph.nodes].map(([key, node]) => {\n const [kind, id] = key.split(' ', 2)\n return {\n key,\n kind,\n id,\n title: node.title,\n ...(node.summary ? { summary: node.summary } : {}),\n ...(node.claim ? { claim: node.claim } : {}),\n ...(node.date ? { date: { from: dateText(node.date.from), to: dateText(node.date.to) } } : {}),\n ...(node.importance ? { importance: node.importance } : {}),\n complexity: node.complexity,\n ...(node.technicality ? { technicality: node.technicality } : {}),\n ...(node.source ? { source: node.source } : {}),\n ...(node.tag ? { tag: node.tag } : {}),\n }\n }),\n edges: infograph.edges.map(edge => ({\n key: `${edge.from} ${edge.verb} ${edge.to}`,\n from: edge.from,\n to: edge.to,\n verb: edge.verb,\n complexity: edge.info.complexity,\n ...(edge.info.technicality ? { technicality: edge.info.technicality } : {}),\n ...(edge.info.claim ? { claim: edge.info.claim } : {}),\n })),\n }\n}\n\nexport function validateDiscoverySeed(payload: DiscoveryPayload, seed: string): void {\n if (!payload.nodes.some(node => node.key === seed)) throw new Error(`InfographDiscovery seed does not exist: ${seed}`)\n}\n\nexport function selectDiscoveryRelations(\n payload: DiscoveryPayload,\n selection: DiscoverySelection\n): DiscoveryRelation[] {\n const nodeByKey = new Map(payload.nodes.map(node => [node.key, node]))\n const edgeByKey = new Map(payload.edges.map(edge => [edge.key, edge]))\n const selectedEdge = selection.type === 'edge' ? edgeByKey.get(selection.key) : undefined\n const roots = selection.type === 'node' ? [selection.key] : selectedEdge ? [selectedEdge.from, selectedEdge.to] : []\n const incidence = countIncidence(payload)\n const adjacency = new Map<string, DiscoveryEdge[]>()\n for (const edge of payload.edges) {\n add(adjacency, edge.from, edge)\n add(adjacency, edge.to, edge)\n }\n\n const queue = roots.map(key => ({ key, distance: 0 }))\n const nodeDistance = new Map(roots.map(key => [key, 0]))\n const seenEdges = new Set<string>()\n const result: DiscoveryRelation[] = []\n\n if (selectedEdge) {\n seenEdges.add(selectedEdge.key)\n result.push({ edge: selectedEdge, distance: 0 })\n }\n\n for (let cursor = 0; cursor < queue.length; cursor++) {\n const current = queue[cursor]!\n const edges = [...(adjacency.get(current.key) ?? [])].sort((left, right) =>\n compareEdges(left, right, current.key, nodeByKey, incidence)\n )\n for (const edge of edges) {\n if (seenEdges.has(edge.key)) continue\n seenEdges.add(edge.key)\n const neighbor = edge.from === current.key ? edge.to : edge.from\n const distance = current.distance + 1\n result.push({ edge, distance })\n if (!nodeDistance.has(neighbor)) {\n nodeDistance.set(neighbor, distance)\n queue.push({ key: neighbor, distance })\n }\n }\n }\n return result\n}\n\nfunction add<K, V>(map: Map<K, V[]>, key: K, value: V) {\n const values = map.get(key)\n if (values) values.push(value)\n else map.set(key, [value])\n}\n\nfunction countIncidence(payload: DiscoveryPayload): Map<string, number> {\n const incidence = new Map(payload.nodes.map(node => [node.key, 0]))\n for (const edge of payload.edges) {\n incidence.set(edge.from, (incidence.get(edge.from) ?? 0) + 1)\n incidence.set(edge.to, (incidence.get(edge.to) ?? 0) + 1)\n }\n return incidence\n}\n\nfunction compareEdges(\n left: DiscoveryEdge,\n right: DiscoveryEdge,\n current: string,\n nodes: Map<string, DiscoveryNode>,\n incidence: Map<string, number>\n): number {\n const leftNeighbor = left.from === current ? left.to : left.from\n const rightNeighbor = right.from === current ? right.to : right.from\n const importance =\n importanceRank(nodes.get(rightNeighbor)?.importance?.is) - importanceRank(nodes.get(leftNeighbor)?.importance?.is)\n if (importance !== 0) return importance\n const degree = (incidence.get(rightNeighbor) ?? 0) - (incidence.get(leftNeighbor) ?? 0)\n if (degree !== 0) return degree\n const title = (nodes.get(leftNeighbor)?.title ?? leftNeighbor).localeCompare(\n nodes.get(rightNeighbor)?.title ?? rightNeighbor\n )\n if (title !== 0) return title\n const verb = left.verb.localeCompare(right.verb)\n return verb !== 0 ? verb : left.key.localeCompare(right.key)\n}\n\nfunction importanceRank(value: string | undefined): number {\n switch (value) {\n case 'central':\n return 4\n case 'major':\n return 3\n case 'useful':\n return 2\n case 'minor':\n return 1\n default:\n return 0\n }\n}\n\nfunction dateText(date: Date): string {\n return date.toISOString().slice(0, 10)\n}\n\nexport function searchLabel(node: DiscoveryNode): string {\n return `${node.title} · ${node.key}`\n}\n","// Lectern owns the automatic JSX runtime used by decks. Re-exporting Preact's\n// JSX namespace is required for TypeScript to type intrinsic elements.\nexport { Fragment, jsx, jsx as jsxDEV, jsxs } from 'preact/jsx-runtime'\nexport type { JSX } from 'preact/jsx-runtime'\n","import type { ComponentChildren } from 'preact'\nimport type {\n DiscoveryClaim,\n DiscoveryEdge,\n DiscoveryNode,\n DiscoveryPayload,\n DiscoveryReason,\n DiscoverySelection,\n} from './infographDiscovery'\nimport { searchLabel } from './infographDiscovery'\n\nexport interface InfographDiscoveryDetailsProps {\n payload: DiscoveryPayload\n selection: DiscoverySelection\n searchId: string\n onSearch?: (value: string) => void\n}\n\nexport function InfographDiscoveryDetails({ payload, selection, searchId, onSearch }: InfographDiscoveryDetailsProps) {\n const nodes = new Map(payload.nodes.map(node => [node.key, node]))\n const edges = new Map(payload.edges.map(edge => [edge.key, edge]))\n const selected = selection.type === 'node' ? nodes.get(selection.key) : edges.get(selection.key)\n return (\n <>\n <Search payload={payload} id={searchId} onSearch={onSearch} />\n <div class=\"lectern-infograph-details\">\n {selection.type === 'node' ? (\n <NodeDetails node={selected as DiscoveryNode | undefined} />\n ) : (\n <EdgeDetails edge={selected as DiscoveryEdge | undefined} nodes={nodes} />\n )}\n </div>\n </>\n )\n}\n\nfunction Search({\n payload,\n id,\n onSearch,\n}: {\n payload: DiscoveryPayload\n id: string\n onSearch?: (value: string) => void\n}) {\n const listId = `${id}-options`\n return (\n <div class=\"lectern-infograph-search-slot\">\n <label class=\"lectern-infograph-discovery-search-label\" for={id}>\n Accéder à un nœud\n </label>\n <input\n class=\"lectern-infograph-discovery-search\"\n id={id}\n type=\"search\"\n list={listId}\n placeholder=\"Rechercher un projet, un outil, un acteur…\"\n onChange={event => onSearch?.((event.currentTarget as HTMLInputElement).value)}\n />\n <datalist id={listId}>\n {payload.nodes\n .slice()\n .sort((left, right) => left.title.localeCompare(right.title) || left.key.localeCompare(right.key))\n .map(node => (\n <option value={searchLabel(node)} />\n ))}\n </datalist>\n </div>\n )\n}\n\nfunction NodeDetails({ node }: { node?: DiscoveryNode }) {\n if (!node) return <p class=\"lectern-infograph-empty\">Nœud introuvable.</p>\n return (\n <div class=\"lectern-infograph-detail\">\n <div style=\"position:relative\">\n <span style=\"position:absolute\" class=\"lectern-infograph-kind\">{node.kind}</span>\n <span style=\"display:inline-block;width:100%;text-align:center;\">{node.title}</span>\n </div>\n {node.summary ? <p class=\"lectern-infograph-summary\">{node.summary}</p> : null}\n <Metadata value={node} />\n <Claims claims={node.claim} />\n <Sources sources={node.source} />\n </div>\n )\n}\n\nfunction EdgeDetails({ edge, nodes }: { edge?: DiscoveryEdge; nodes: Map<string, DiscoveryNode> }) {\n if (!edge) return <p class=\"lectern-infograph-empty\">Relation introuvable.</p>\n return (\n <div class=\"lectern-infograph-detail\">\n <div style=\"gap:1em;display:flex;justify-content:space-between;align-items:center\">\n <span>\n {nodes.get(edge.from)?.title} <span style=\"font-weight:bold\">{edge.verb}</span> {nodes.get(edge.to)?.title}\n </span>\n <span class=\"lectern-infograph-key\" style=\"text-align:right\">\n {edge.key}\n </span>\n </div>\n <Metadata value={edge} />\n <Claims claims={edge.claim} />\n </div>\n )\n}\n\ntype MetadataValue = {\n date?: { from: string; to: string }\n tag?: string[]\n importance?: DiscoveryReason\n complexity: DiscoveryReason\n technicality?: DiscoveryReason\n}\n\nfunction Metadata({ value }: { value: MetadataValue }) {\n const period =\n value.date &&\n (value.date.from === value.date.to ? (\n value.date.from\n ) : (\n <>\n {value.date.from} &ndash; {value.date.to}\n </>\n ))\n return (\n <dl class=\"lectern-infograph-metadata\">\n {period ? <MetadataRow label=\"Période\">{period}</MetadataRow> : null}\n <Reason label=\"Complexité\" value={value.complexity} />\n {value.importance ? <Reason label=\"Importance\" value={value.importance} /> : null}\n {value.technicality ? <Reason label=\"Technicité\" value={value.technicality} /> : null}\n {value.tag?.length ? <MetadataRow label=\"Tags\">{value.tag.join(' ')}</MetadataRow> : null}\n </dl>\n )\n}\n\nfunction MetadataRow({ label, children }: { label: string; children: ComponentChildren }) {\n return (\n <div>\n <dt>{label}</dt>\n <dd>{children}</dd>\n </div>\n )\n}\n\nfunction Reason({ label, value }: { label: string; value: DiscoveryReason }) {\n return (\n <MetadataRow label={label}>\n <strong>{value.is}</strong>\n <FlexList onePrefix=\" : \" of={value.why}></FlexList>\n </MetadataRow>\n )\n}\n\nfunction Claims({ claims }: { claims?: DiscoveryClaim[] }) {\n if (!claims?.length) return null\n return (\n <div class=\"lectern-infograph-section\" aria-label=\"Claims\">\n <h4>Claims</h4>\n <FlexList\n of={claims.map(claim => (\n <>\n <strong>{claim.type}</strong> : {claim.content}\n </>\n ))}\n />\n </div>\n )\n}\n\nfunction Sources({ sources }: { sources?: DiscoveryReason[] }) {\n if (!sources?.length) return null\n return (\n <div class=\"lectern-infograph-section\" aria-label=\"Sources\">\n <h4>Sources</h4>\n <FlexList\n of={sources.map(source => (\n <>\n <strong>{source.is}</strong>\n <FlexList onePrefix=\" : \" of={source.why} />\n </>\n ))}\n />\n </div>\n )\n}\n\nfunction FlexList({ of, onePrefix = null }: { of: ComponentChildren[]; onePrefix?: ComponentChildren }) {\n return of.length > 1 ? (\n <ul class=\"lectern-infograph-reason\">\n {of.map(it => (\n <li>{it}</li>\n ))}\n </ul>\n ) : of[0] ? (\n <>\n {onePrefix}\n {of[0]}\n </>\n ) : null\n}\n"],"mappings":";AAAA,OAAO,eAAe;AACtB,OAAO,WAAW;AAElB,SAAS,cAAc;;;ACiFhB,SAAS,yBACd,SACA,WACqB;AACrB,QAAM,YAAY,IAAI,IAAI,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AI,EAAE,MAAM,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC;AAC7D,mBAAK,SAAS,OAAO,EAAE,QAAQ,MAAM;AACnC,+BAAe,gBAAgB;AAC/B,+BAAe,MAAM,aAAa,mCAAmC,SAAS,GAAG;AACjF,sCAAsB,mBAAmB;AAAA,cAC3C,CAAC;AAAA,YACH,OAAO;AACL,kCAAoB;AAAA,YACtB;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF,CAAC;AACD,aAAO,IAAI;AACX,SAAG,GAAG,OAAO,QAAQ,WAAS,OAAO,EAAE,MAAM,QAAQ,KAAK,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC;AAC9E,SAAG,GAAG,OAAO,QAAQ,WAAS,OAAO,EAAE,MAAM,QAAQ,KAAK,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC;AAAA,IAChF;AAEA,UAAM,SAAS,CAAC,SAA6B;AAC3C,kBAAY;AACZ,oBAAc;AACd,WAAK;AAAA,IACP;AAEA,UAAM,oBAAoB,MAAM;AAC9B,UAAI,YAAY,KAAK,SAAS,MAAM,KAAK,KAAK,gBAAgB,MAAM,MAAO,MAAK;AAAA,IAClF;AAEA,kBAAc;AACd,sBAAkB;AAClB,SAAK,GAAG,gBAAgB,iBAAiB;AACzC,WAAO,iBAAiB,UAAU,MAAM;AACtC,UAAI,IAAI;AACN,WAAG,OAAO;AACV,WAAG,IAAI,QAAW,EAAE;AAAA,MACtB;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACD,SAAO,QAAQ,IAAI,cAAc,EAAE,KAAK,MAAM,MAAS;AACzD;","names":["jsx"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5cover/lectern",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Author professional reveal.js slide decks as typed TSX components, styled by the ENGIE Fluid design system.",
5
5
  "type": "module",
6
6
  "license": "MIT",