@5cover/lectern 0.1.0 → 0.2.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 +1 -1
- package/dist/cli/index.js +7 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/package.json +4 -5
- package/src/cli/build.ts +0 -79
- package/src/cli/dev.ts +0 -58
- package/src/cli/index.ts +0 -126
- package/src/cli/paths.ts +0 -81
- package/src/cli/pdf.ts +0 -70
- package/src/cli/render.ts +0 -40
- package/src/cli/rules.ts +0 -31
- package/src/cli/serve.ts +0 -112
- package/src/client/entry.ts +0 -170
- package/src/client/graph.tsx +0 -207
- package/src/components/Deck.tsx +0 -19
- package/src/components/InfographDiscovery.tsx +0 -51
- package/src/components/layout.tsx +0 -145
- package/src/components/mechanics.tsx +0 -74
- package/src/components/util.ts +0 -12
- package/src/index.ts +0 -37
- package/src/infographDiscovery.ts +0 -188
- package/src/infographDiscoveryView.tsx +0 -202
- package/src/jsx-runtime.ts +0 -4
- package/src/profiles/engie/assets/engie-logo-dark.svg +0 -1
- package/src/profiles/engie/assets/engie-logo-white.svg +0 -6
- package/src/profiles/engie/assets.d.ts +0 -4
- package/src/profiles/engie/atoms.tsx +0 -203
- package/src/profiles/engie/index.ts +0 -44
- package/src/profiles/engie/profile.ts +0 -132
- package/src/profiles/engie/slides.tsx +0 -230
- package/src/profiles/index.ts +0 -30
- package/src/profiles/types.ts +0 -49
- package/src/render/renderDeck.tsx +0 -74
- package/src/render/template.ts +0 -68
- package/src/types.ts +0 -53
- /package/{src → dist}/profiles/engie/engie.css +0 -0
package/src/index.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Core `@5cover/lectern` API — the render engine + neutral, profile-agnostic components.
|
|
2
|
-
// Philosophy-bearing components (slides, styled atoms) live in a profile,
|
|
3
|
-
// e.g. `@5cover/lectern/engie`.
|
|
4
|
-
|
|
5
|
-
export { Deck, isDeck } from './components/Deck'
|
|
6
|
-
|
|
7
|
-
// Neutral layout primitives.
|
|
8
|
-
export { Columns, Stack, Grid, Spacer } from './components/layout'
|
|
9
|
-
export type { ColumnsProps, StackProps, GridProps } from './components/layout'
|
|
10
|
-
export { InfographDiscovery } from './components/InfographDiscovery'
|
|
11
|
-
export type { InfographDiscoveryProps } from './components/InfographDiscovery'
|
|
12
|
-
|
|
13
|
-
// Neutral reveal-mechanics components.
|
|
14
|
-
export { Code, Mermaid, Notes, Fragment, Raw } from './components/mechanics'
|
|
15
|
-
export type { CodeProps, FragmentProps } from './components/mechanics'
|
|
16
|
-
|
|
17
|
-
// Shared class helper (useful when building profile components).
|
|
18
|
-
export { cx } from './components/util'
|
|
19
|
-
|
|
20
|
-
// Renderer (used by the CLI, and available programmatically).
|
|
21
|
-
export { renderDeck, renderToHtml } from './render/renderDeck'
|
|
22
|
-
export type { RenderOptions } from './render/renderDeck'
|
|
23
|
-
|
|
24
|
-
// Types.
|
|
25
|
-
export type {
|
|
26
|
-
Transition,
|
|
27
|
-
ProfileName,
|
|
28
|
-
DeckMeta,
|
|
29
|
-
ResolvedDeckMeta,
|
|
30
|
-
DeckProps,
|
|
31
|
-
Slide as SlideNode,
|
|
32
|
-
StyleEscapeHatch,
|
|
33
|
-
} from './types'
|
|
34
|
-
|
|
35
|
-
// Profiles (house styles: look + reveal config + rules).
|
|
36
|
-
export { DEFAULT_PROFILE, getProfile, profileNames, profiles, resolveProfile } from './profiles'
|
|
37
|
-
export type { Profile, Rule, RuleGroup, RuleSeverity } from './profiles/types'
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import type { BaseKeys, Infograph } from 'infograph'
|
|
2
|
-
|
|
3
|
-
export type DiscoveryClaim = {
|
|
4
|
-
type: string
|
|
5
|
-
content: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export type DiscoveryReason = {
|
|
9
|
-
is: string
|
|
10
|
-
why: string[]
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type DiscoveryNode = {
|
|
14
|
-
key: string
|
|
15
|
-
kind: string
|
|
16
|
-
id: string
|
|
17
|
-
title: string
|
|
18
|
-
summary?: string
|
|
19
|
-
claim?: DiscoveryClaim[]
|
|
20
|
-
date?: { from: string; to: string }
|
|
21
|
-
importance?: DiscoveryReason
|
|
22
|
-
complexity: DiscoveryReason
|
|
23
|
-
technicality?: DiscoveryReason
|
|
24
|
-
source?: DiscoveryReason[]
|
|
25
|
-
tag?: string[]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export type DiscoveryEdge = {
|
|
29
|
-
key: string
|
|
30
|
-
from: string
|
|
31
|
-
to: string
|
|
32
|
-
verb: string
|
|
33
|
-
complexity: DiscoveryReason
|
|
34
|
-
technicality?: DiscoveryReason
|
|
35
|
-
claim?: DiscoveryClaim[]
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type DiscoveryPayload = {
|
|
39
|
-
nodes: DiscoveryNode[]
|
|
40
|
-
edges: DiscoveryEdge[]
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type DiscoverySelection = { type: 'node'; key: string } | { type: 'edge'; key: string }
|
|
44
|
-
|
|
45
|
-
export type DiscoveryRelation = {
|
|
46
|
-
edge: DiscoveryEdge
|
|
47
|
-
distance: number
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function toDiscoveryPayload<Keys extends BaseKeys>(infograph: Infograph<Keys>): DiscoveryPayload {
|
|
51
|
-
return {
|
|
52
|
-
nodes: [...infograph.nodes].map(([key, node]) => {
|
|
53
|
-
const [kind, id] = key.split(' ', 2)
|
|
54
|
-
return {
|
|
55
|
-
key,
|
|
56
|
-
kind,
|
|
57
|
-
id,
|
|
58
|
-
title: node.title,
|
|
59
|
-
...(node.summary ? { summary: node.summary } : {}),
|
|
60
|
-
...(node.claim ? { claim: node.claim } : {}),
|
|
61
|
-
...(node.date ? { date: { from: dateText(node.date.from), to: dateText(node.date.to) } } : {}),
|
|
62
|
-
...(node.importance ? { importance: node.importance } : {}),
|
|
63
|
-
complexity: node.complexity,
|
|
64
|
-
...(node.technicality ? { technicality: node.technicality } : {}),
|
|
65
|
-
...(node.source ? { source: node.source } : {}),
|
|
66
|
-
...(node.tag ? { tag: node.tag } : {}),
|
|
67
|
-
}
|
|
68
|
-
}),
|
|
69
|
-
edges: infograph.edges.map(edge => ({
|
|
70
|
-
key: `${edge.from} ${edge.verb} ${edge.to}`,
|
|
71
|
-
from: edge.from,
|
|
72
|
-
to: edge.to,
|
|
73
|
-
verb: edge.verb,
|
|
74
|
-
complexity: edge.info.complexity,
|
|
75
|
-
...(edge.info.technicality ? { technicality: edge.info.technicality } : {}),
|
|
76
|
-
...(edge.info.claim ? { claim: edge.info.claim } : {}),
|
|
77
|
-
})),
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export function validateDiscoverySeed(payload: DiscoveryPayload, seed: string): void {
|
|
82
|
-
if (!payload.nodes.some(node => node.key === seed)) throw new Error(`InfographDiscovery seed does not exist: ${seed}`)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function selectDiscoveryRelations(
|
|
86
|
-
payload: DiscoveryPayload,
|
|
87
|
-
selection: DiscoverySelection
|
|
88
|
-
): DiscoveryRelation[] {
|
|
89
|
-
const nodeByKey = new Map(payload.nodes.map(node => [node.key, node]))
|
|
90
|
-
const edgeByKey = new Map(payload.edges.map(edge => [edge.key, edge]))
|
|
91
|
-
const selectedEdge = selection.type === 'edge' ? edgeByKey.get(selection.key) : undefined
|
|
92
|
-
const roots = selection.type === 'node' ? [selection.key] : selectedEdge ? [selectedEdge.from, selectedEdge.to] : []
|
|
93
|
-
const incidence = countIncidence(payload)
|
|
94
|
-
const adjacency = new Map<string, DiscoveryEdge[]>()
|
|
95
|
-
for (const edge of payload.edges) {
|
|
96
|
-
add(adjacency, edge.from, edge)
|
|
97
|
-
add(adjacency, edge.to, edge)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const queue = roots.map(key => ({ key, distance: 0 }))
|
|
101
|
-
const nodeDistance = new Map(roots.map(key => [key, 0]))
|
|
102
|
-
const seenEdges = new Set<string>()
|
|
103
|
-
const result: DiscoveryRelation[] = []
|
|
104
|
-
|
|
105
|
-
if (selectedEdge) {
|
|
106
|
-
seenEdges.add(selectedEdge.key)
|
|
107
|
-
result.push({ edge: selectedEdge, distance: 0 })
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
for (let cursor = 0; cursor < queue.length; cursor++) {
|
|
111
|
-
const current = queue[cursor]!
|
|
112
|
-
const edges = [...(adjacency.get(current.key) ?? [])].sort((left, right) =>
|
|
113
|
-
compareEdges(left, right, current.key, nodeByKey, incidence)
|
|
114
|
-
)
|
|
115
|
-
for (const edge of edges) {
|
|
116
|
-
if (seenEdges.has(edge.key)) continue
|
|
117
|
-
seenEdges.add(edge.key)
|
|
118
|
-
const neighbor = edge.from === current.key ? edge.to : edge.from
|
|
119
|
-
const distance = current.distance + 1
|
|
120
|
-
result.push({ edge, distance })
|
|
121
|
-
if (!nodeDistance.has(neighbor)) {
|
|
122
|
-
nodeDistance.set(neighbor, distance)
|
|
123
|
-
queue.push({ key: neighbor, distance })
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return result
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function add<K, V>(map: Map<K, V[]>, key: K, value: V) {
|
|
131
|
-
const values = map.get(key)
|
|
132
|
-
if (values) values.push(value)
|
|
133
|
-
else map.set(key, [value])
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function countIncidence(payload: DiscoveryPayload): Map<string, number> {
|
|
137
|
-
const incidence = new Map(payload.nodes.map(node => [node.key, 0]))
|
|
138
|
-
for (const edge of payload.edges) {
|
|
139
|
-
incidence.set(edge.from, (incidence.get(edge.from) ?? 0) + 1)
|
|
140
|
-
incidence.set(edge.to, (incidence.get(edge.to) ?? 0) + 1)
|
|
141
|
-
}
|
|
142
|
-
return incidence
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function compareEdges(
|
|
146
|
-
left: DiscoveryEdge,
|
|
147
|
-
right: DiscoveryEdge,
|
|
148
|
-
current: string,
|
|
149
|
-
nodes: Map<string, DiscoveryNode>,
|
|
150
|
-
incidence: Map<string, number>
|
|
151
|
-
): number {
|
|
152
|
-
const leftNeighbor = left.from === current ? left.to : left.from
|
|
153
|
-
const rightNeighbor = right.from === current ? right.to : right.from
|
|
154
|
-
const importance =
|
|
155
|
-
importanceRank(nodes.get(rightNeighbor)?.importance?.is) - importanceRank(nodes.get(leftNeighbor)?.importance?.is)
|
|
156
|
-
if (importance !== 0) return importance
|
|
157
|
-
const degree = (incidence.get(rightNeighbor) ?? 0) - (incidence.get(leftNeighbor) ?? 0)
|
|
158
|
-
if (degree !== 0) return degree
|
|
159
|
-
const title = (nodes.get(leftNeighbor)?.title ?? leftNeighbor).localeCompare(
|
|
160
|
-
nodes.get(rightNeighbor)?.title ?? rightNeighbor
|
|
161
|
-
)
|
|
162
|
-
if (title !== 0) return title
|
|
163
|
-
const verb = left.verb.localeCompare(right.verb)
|
|
164
|
-
return verb !== 0 ? verb : left.key.localeCompare(right.key)
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function importanceRank(value: string | undefined): number {
|
|
168
|
-
switch (value) {
|
|
169
|
-
case 'central':
|
|
170
|
-
return 4
|
|
171
|
-
case 'major':
|
|
172
|
-
return 3
|
|
173
|
-
case 'useful':
|
|
174
|
-
return 2
|
|
175
|
-
case 'minor':
|
|
176
|
-
return 1
|
|
177
|
-
default:
|
|
178
|
-
return 0
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function dateText(date: Date): string {
|
|
183
|
-
return date.toISOString().slice(0, 10)
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export function searchLabel(node: DiscoveryNode): string {
|
|
187
|
-
return `${node.title} · ${node.key}`
|
|
188
|
-
}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import type { ComponentChildren } from 'preact'
|
|
2
|
-
import type {
|
|
3
|
-
DiscoveryClaim,
|
|
4
|
-
DiscoveryEdge,
|
|
5
|
-
DiscoveryNode,
|
|
6
|
-
DiscoveryPayload,
|
|
7
|
-
DiscoveryReason,
|
|
8
|
-
DiscoverySelection,
|
|
9
|
-
} from './infographDiscovery'
|
|
10
|
-
import { searchLabel } from './infographDiscovery'
|
|
11
|
-
|
|
12
|
-
export interface InfographDiscoveryDetailsProps {
|
|
13
|
-
payload: DiscoveryPayload
|
|
14
|
-
selection: DiscoverySelection
|
|
15
|
-
searchId: string
|
|
16
|
-
onSearch?: (value: string) => void
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function InfographDiscoveryDetails({ payload, selection, searchId, onSearch }: InfographDiscoveryDetailsProps) {
|
|
20
|
-
const nodes = new Map(payload.nodes.map(node => [node.key, node]))
|
|
21
|
-
const edges = new Map(payload.edges.map(edge => [edge.key, edge]))
|
|
22
|
-
const selected = selection.type === 'node' ? nodes.get(selection.key) : edges.get(selection.key)
|
|
23
|
-
return (
|
|
24
|
-
<>
|
|
25
|
-
<Search payload={payload} id={searchId} onSearch={onSearch} />
|
|
26
|
-
<div class="lectern-infograph-details">
|
|
27
|
-
{selection.type === 'node' ? (
|
|
28
|
-
<NodeDetails node={selected as DiscoveryNode | undefined} />
|
|
29
|
-
) : (
|
|
30
|
-
<EdgeDetails edge={selected as DiscoveryEdge | undefined} nodes={nodes} />
|
|
31
|
-
)}
|
|
32
|
-
</div>
|
|
33
|
-
</>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function Search({
|
|
38
|
-
payload,
|
|
39
|
-
id,
|
|
40
|
-
onSearch,
|
|
41
|
-
}: {
|
|
42
|
-
payload: DiscoveryPayload
|
|
43
|
-
id: string
|
|
44
|
-
onSearch?: (value: string) => void
|
|
45
|
-
}) {
|
|
46
|
-
const listId = `${id}-options`
|
|
47
|
-
return (
|
|
48
|
-
<div class="lectern-infograph-search-slot">
|
|
49
|
-
<label class="lectern-infograph-discovery-search-label" for={id}>
|
|
50
|
-
Accéder à un nœud
|
|
51
|
-
</label>
|
|
52
|
-
<input
|
|
53
|
-
class="lectern-infograph-discovery-search"
|
|
54
|
-
id={id}
|
|
55
|
-
type="search"
|
|
56
|
-
list={listId}
|
|
57
|
-
placeholder="Rechercher un projet, un outil, un acteur…"
|
|
58
|
-
onChange={event => onSearch?.((event.currentTarget as HTMLInputElement).value)}
|
|
59
|
-
/>
|
|
60
|
-
<datalist id={listId}>
|
|
61
|
-
{payload.nodes
|
|
62
|
-
.slice()
|
|
63
|
-
.sort((left, right) => left.title.localeCompare(right.title) || left.key.localeCompare(right.key))
|
|
64
|
-
.map(node => (
|
|
65
|
-
<option value={searchLabel(node)} />
|
|
66
|
-
))}
|
|
67
|
-
</datalist>
|
|
68
|
-
</div>
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function NodeDetails({ node }: { node?: DiscoveryNode }) {
|
|
73
|
-
if (!node) return <p class="lectern-infograph-empty">Nœud introuvable.</p>
|
|
74
|
-
return (
|
|
75
|
-
<div class="lectern-infograph-detail">
|
|
76
|
-
<div style="gap:1em;display:flex;justify-content:space-between;align-items:center">
|
|
77
|
-
<span class="lectern-infograph-kind">{node.kind}</span>
|
|
78
|
-
<span style="text-align:center;">{node.title}</span>
|
|
79
|
-
<span class="lectern-infograph-key" style="text-align:right">
|
|
80
|
-
{node.key}
|
|
81
|
-
</span>
|
|
82
|
-
</div>
|
|
83
|
-
{node.summary ? <p class="lectern-infograph-summary">{node.summary}</p> : null}
|
|
84
|
-
<Metadata value={node} />
|
|
85
|
-
<Claims claims={node.claim} />
|
|
86
|
-
<Sources sources={node.source} />
|
|
87
|
-
</div>
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function EdgeDetails({ edge, nodes }: { edge?: DiscoveryEdge; nodes: Map<string, DiscoveryNode> }) {
|
|
92
|
-
if (!edge) return <p class="lectern-infograph-empty">Relation introuvable.</p>
|
|
93
|
-
return (
|
|
94
|
-
<div class="lectern-infograph-detail">
|
|
95
|
-
<div style="gap:1em;display:flex;justify-content:space-between;align-items:center">
|
|
96
|
-
<span>
|
|
97
|
-
{nodes.get(edge.from)?.title} <span style="font-weight:bold">{edge.verb}</span> {nodes.get(edge.to)?.title}
|
|
98
|
-
</span>
|
|
99
|
-
<span class="lectern-infograph-key" style="text-align:right">
|
|
100
|
-
{edge.key}
|
|
101
|
-
</span>
|
|
102
|
-
</div>
|
|
103
|
-
<Metadata value={edge} />
|
|
104
|
-
<Claims claims={edge.claim} />
|
|
105
|
-
</div>
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
type MetadataValue = {
|
|
110
|
-
date?: { from: string; to: string }
|
|
111
|
-
tag?: string[]
|
|
112
|
-
importance?: DiscoveryReason
|
|
113
|
-
complexity: DiscoveryReason
|
|
114
|
-
technicality?: DiscoveryReason
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function Metadata({ value }: { value: MetadataValue }) {
|
|
118
|
-
const period =
|
|
119
|
-
value.date &&
|
|
120
|
-
(value.date.from === value.date.to ? (
|
|
121
|
-
value.date.from
|
|
122
|
-
) : (
|
|
123
|
-
<>
|
|
124
|
-
{value.date.from} – {value.date.to}
|
|
125
|
-
</>
|
|
126
|
-
))
|
|
127
|
-
return (
|
|
128
|
-
<dl class="lectern-infograph-metadata">
|
|
129
|
-
{period ? <MetadataRow label="Période">{period}</MetadataRow> : null}
|
|
130
|
-
<Reason label="Complexité" value={value.complexity} />
|
|
131
|
-
{value.importance ? <Reason label="Importance" value={value.importance} /> : null}
|
|
132
|
-
{value.technicality ? <Reason label="Technicité" value={value.technicality} /> : null}
|
|
133
|
-
{value.tag?.length ? <MetadataRow label="Tags">{value.tag.join(' ')}</MetadataRow> : null}
|
|
134
|
-
</dl>
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function MetadataRow({ label, children }: { label: string; children: ComponentChildren }) {
|
|
139
|
-
return (
|
|
140
|
-
<div>
|
|
141
|
-
<dt>{label}</dt>
|
|
142
|
-
<dd>{children}</dd>
|
|
143
|
-
</div>
|
|
144
|
-
)
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function Reason({ label, value }: { label: string; value: DiscoveryReason }) {
|
|
148
|
-
return (
|
|
149
|
-
<MetadataRow label={label}>
|
|
150
|
-
<strong>{value.is}</strong>
|
|
151
|
-
<FlexList onePrefix=" : " of={value.why}></FlexList>
|
|
152
|
-
</MetadataRow>
|
|
153
|
-
)
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function Claims({ claims }: { claims?: DiscoveryClaim[] }) {
|
|
157
|
-
if (!claims?.length) return null
|
|
158
|
-
return (
|
|
159
|
-
<div class="lectern-infograph-section" aria-label="Claims">
|
|
160
|
-
<h4>Claims</h4>
|
|
161
|
-
<FlexList
|
|
162
|
-
of={claims.map(claim => (
|
|
163
|
-
<>
|
|
164
|
-
<strong>{claim.type}</strong> : {claim.content}
|
|
165
|
-
</>
|
|
166
|
-
))}
|
|
167
|
-
/>
|
|
168
|
-
</div>
|
|
169
|
-
)
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function Sources({ sources }: { sources?: DiscoveryReason[] }) {
|
|
173
|
-
if (!sources?.length) return null
|
|
174
|
-
return (
|
|
175
|
-
<div class="lectern-infograph-section" aria-label="Sources">
|
|
176
|
-
<h4>Sources</h4>
|
|
177
|
-
<FlexList
|
|
178
|
-
of={sources.map(source => (
|
|
179
|
-
<>
|
|
180
|
-
<strong>{source.is}</strong>
|
|
181
|
-
<FlexList onePrefix=" : " of={source.why} />
|
|
182
|
-
</>
|
|
183
|
-
))}
|
|
184
|
-
/>
|
|
185
|
-
</div>
|
|
186
|
-
)
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function FlexList({ of, onePrefix = null }: { of: ComponentChildren[]; onePrefix?: ComponentChildren }) {
|
|
190
|
-
return of.length > 1 ? (
|
|
191
|
-
<ul class="lectern-infograph-reason">
|
|
192
|
-
{of.map(it => (
|
|
193
|
-
<li>{it}</li>
|
|
194
|
-
))}
|
|
195
|
-
</ul>
|
|
196
|
-
) : of[0] ? (
|
|
197
|
-
<>
|
|
198
|
-
{onePrefix}
|
|
199
|
-
{of[0]}
|
|
200
|
-
</>
|
|
201
|
-
) : null
|
|
202
|
-
}
|
package/src/jsx-runtime.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// Lectern owns the automatic JSX runtime used by decks. Re-exporting Preact's
|
|
2
|
-
// JSX namespace is required for TypeScript to type intrinsic elements.
|
|
3
|
-
export { Fragment, jsx, jsx as jsxDEV, jsxs } from 'preact/jsx-runtime'
|
|
4
|
-
export type { JSX } from 'preact/jsx-runtime'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 1077 389" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" stroke-linejoin="round" stroke-miterlimit="2" fill-rule="evenodd" clip-rule="evenodd" xml:space="preserve" overflow="hidden"><g transform="matrix(4.16667 0 0 4.16667 232.582 292.07)"><path d="M0 4.359C2.074-11.486-4.697-22.128-25.432-22.128-41.398-22.128-51.591-14.653-51.591 0.368-51.591 24.373-22.203 26.487-2.255 20.119L-3.985 12.275C-7.067 13.33-35.678 19.113-39.901 4.359L0 4.359ZM-39.902-3.911C-39.902-9.784-33.874-14.123-25.16-14.123-16.543-14.123-10.822-9.784-10.822-3.911L-39.902-3.911Z" fill="#007BC5" fill-rule="nonzero"/></g><g transform="matrix(4.16667 0 0 4.16667 431.384 271.464)"><path d="M0 10.872 0-16.152 10.827-16.152 10.827 27.024 1.222 27.018-28.476-1.208-28.469 27.024-39.297 27.024-39.297-16.152-28.469-16.152 0 10.872Z" fill="#007BC5" fill-rule="nonzero"/></g><g transform="matrix(4.16667 0 0 4.16667 713.267 342.5)"><path d="M0-23.269C-31.696-30.496-37.492-23.042-37.492-11.658-37.492-2.06-29.301 4.104-7.469 1.657L-7.469-7.727-23.606-7.727-23.606-16.029 3.308-16.029 3.308 0.108C3.308 4.086 1.521 6.471-1.236 7.959-5.527 10.276-11.778 10.963-19.608 10.963-35.769 10.963-48.832 3.489-48.832-11.658-48.832-25.09-39.924-34.232-21.491-34.232-12.596-34.232-6.106-33.067 0.003-31.387L0-23.269Z" fill="#007BC5" fill-rule="nonzero"/></g><g transform="matrix(-4.16667 0 0 4.16667 2063.39 -2863.97)"><rect x="301.364" y="747.826" width="10.854" height="31.701" fill="#007BC5"/></g><g transform="matrix(-4.16667 0 0 4.16667 2063.39 -3058.99)"><rect x="301.364" y="783.148" width="10.854" height="7.862" fill="#007BC5"/></g><g transform="matrix(4.16667 0 0 4.16667 1057.03 292.07)"><path d="M0 4.359C2.074-11.486-4.697-22.128-25.432-22.128-41.398-22.128-51.591-14.653-51.591 0.368-51.591 24.373-22.203 26.487-2.255 20.119L-3.985 12.275C-7.067 13.33-35.678 19.113-39.901 4.359L0 4.359ZM-39.902-3.911C-39.902-9.784-33.874-14.123-25.16-14.123-16.543-14.123-10.822-9.784-10.822-3.911L-39.902-3.911Z" fill="#007BC5" fill-rule="nonzero"/></g><g transform="matrix(0 -4.16667 -4.16667 0 616.106 -460.031)"><path d="M-147.865-110.407C-124.55-75.799-110.407-30.658-110.407 18.729-110.407 68.115-124.55 113.257-147.865 147.865-136.316 113.448-128.606 73.205-128.606 18.729-128.606-35.748-136.316-75.99-147.865-110.407" fill="#007BC5"/></g></svg>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 1077 389" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" stroke-linejoin="round" stroke-miterlimit="2" fill-rule="evenodd" clip-rule="evenodd" xml:space="preserve" overflow="hidden"><style>
|
|
2
|
-
.MsftOfcThm_Text1_Fill_v2 {
|
|
3
|
-
fill:#FFFFFF;
|
|
4
|
-
}
|
|
5
|
-
</style>
|
|
6
|
-
<g transform="matrix(4.16667 0 0 4.16667 232.582 292.07)"><path d="M0 4.359C2.074-11.486-4.697-22.128-25.432-22.128-41.398-22.128-51.591-14.653-51.591 0.368-51.591 24.373-22.203 26.487-2.255 20.119L-3.985 12.275C-7.067 13.33-35.678 19.113-39.901 4.359L0 4.359ZM-39.902-3.911C-39.902-9.784-33.874-14.123-25.16-14.123-16.543-14.123-10.822-9.784-10.822-3.911L-39.902-3.911Z" class="MsftOfcThm_Text1_Fill_v2" fill="#FFFFFF" fill-rule="nonzero"/></g><g transform="matrix(4.16667 0 0 4.16667 431.384 271.464)"><path d="M0 10.872 0-16.152 10.827-16.152 10.827 27.024 1.222 27.018-28.476-1.208-28.469 27.024-39.297 27.024-39.297-16.152-28.469-16.152 0 10.872Z" class="MsftOfcThm_Text1_Fill_v2" fill="#FFFFFF" fill-rule="nonzero"/></g><g transform="matrix(4.16667 0 0 4.16667 713.267 342.5)"><path d="M0-23.269C-31.696-30.496-37.492-23.042-37.492-11.658-37.492-2.06-29.301 4.104-7.469 1.657L-7.469-7.727-23.606-7.727-23.606-16.029 3.308-16.029 3.308 0.108C3.308 4.086 1.521 6.471-1.236 7.959-5.527 10.276-11.778 10.963-19.608 10.963-35.769 10.963-48.832 3.489-48.832-11.658-48.832-25.09-39.924-34.232-21.491-34.232-12.596-34.232-6.106-33.067 0.003-31.387L0-23.269Z" class="MsftOfcThm_Text1_Fill_v2" fill="#FFFFFF" fill-rule="nonzero"/></g><g transform="matrix(-4.16667 0 0 4.16667 2063.39 -2863.97)"><rect x="301.364" y="747.826" width="10.854" height="31.701" class="MsftOfcThm_Text1_Fill_v2" fill="#FFFFFF"/></g><g transform="matrix(-4.16667 0 0 4.16667 2063.39 -3058.99)"><rect x="301.364" y="783.148" width="10.854" height="7.862" class="MsftOfcThm_Text1_Fill_v2" fill="#FFFFFF"/></g><g transform="matrix(4.16667 0 0 4.16667 1057.03 292.07)"><path d="M0 4.359C2.074-11.486-4.697-22.128-25.432-22.128-41.398-22.128-51.591-14.653-51.591 0.368-51.591 24.373-22.203 26.487-2.255 20.119L-3.985 12.275C-7.067 13.33-35.678 19.113-39.901 4.359L0 4.359ZM-39.902-3.911C-39.902-9.784-33.874-14.123-25.16-14.123-16.543-14.123-10.822-9.784-10.822-3.911L-39.902-3.911Z" class="MsftOfcThm_Text1_Fill_v2" fill="#FFFFFF" fill-rule="nonzero"/></g><g transform="matrix(0 -4.16667 -4.16667 0 616.106 -460.031)"><path d="M-147.865-110.407C-124.55-75.799-110.407-30.658-110.407 18.729-110.407 68.115-124.55 113.257-147.865 147.865-136.316 113.448-128.606 73.205-128.606 18.729-128.606-35.748-136.316-75.99-147.865-110.407" class="MsftOfcThm_Text1_Fill_v2" fill="#FFFFFF"/></g></svg>
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import type { ComponentChildren } from 'preact'
|
|
2
|
-
import type { StyleEscapeHatch } from '../../types'
|
|
3
|
-
import { cx } from '../../components/util'
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
* ENGIE content atoms — opinionated, styled to the ENGIE house style. A
|
|
7
|
-
* different profile might structure these differently (hence not in the core).
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/** Bulleted or numbered list. */
|
|
11
|
-
export interface BulletsProps extends StyleEscapeHatch {
|
|
12
|
-
items: ComponentChildren[]
|
|
13
|
-
ordered?: boolean
|
|
14
|
-
/** Reveal each item incrementally as a reveal.js fragment. */
|
|
15
|
-
incremental?: boolean
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function Bullets({ items, ordered, incremental, class: cls, style }: BulletsProps) {
|
|
19
|
-
const List = ordered ? 'ol' : 'ul'
|
|
20
|
-
return (
|
|
21
|
-
<List class={cx('lectern-bullets', cls)} style={style}>
|
|
22
|
-
{items.map(item => (
|
|
23
|
-
<li class={cx(incremental && 'fragment')}>{item}</li>
|
|
24
|
-
))}
|
|
25
|
-
</List>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Incremental list — sugar for `<Bullets incremental>`. */
|
|
30
|
-
export function Steps(props: Omit<BulletsProps, 'incremental'>) {
|
|
31
|
-
return <Bullets {...props} incremental />
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface StarItemProps extends StyleEscapeHatch {
|
|
35
|
-
/** Optional short qualifier shown after the STAR label. */
|
|
36
|
-
title?: ComponentChildren
|
|
37
|
-
children: ComponentChildren
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
type StarKind = 'situation' | 'task' | 'action' | 'result'
|
|
41
|
-
|
|
42
|
-
function StarItem({
|
|
43
|
-
kind,
|
|
44
|
-
badge,
|
|
45
|
-
label,
|
|
46
|
-
title,
|
|
47
|
-
children,
|
|
48
|
-
class: cls,
|
|
49
|
-
style,
|
|
50
|
-
}: StarItemProps & { kind: StarKind; badge: string; label: string }) {
|
|
51
|
-
return (
|
|
52
|
-
<div class={cx('lectern-star-item', `is-${kind}`, cls)} style={style}>
|
|
53
|
-
<span class="lectern-star-badge" aria-hidden="true">
|
|
54
|
-
{badge}
|
|
55
|
-
</span>
|
|
56
|
-
<div class="lectern-star-copy">
|
|
57
|
-
<p class="lectern-star-label">
|
|
58
|
-
{label}
|
|
59
|
-
{title ? <> : {title}</> : null}
|
|
60
|
-
</p>
|
|
61
|
-
<div class="lectern-star-body">{children}</div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** STAR stages. Use directly in the normal slide flow, without a parent wrapper. */
|
|
68
|
-
export const Star = {
|
|
69
|
-
Situation: (props: StarItemProps) => <StarItem {...props} kind="situation" badge="S" label="Situation" />,
|
|
70
|
-
Task: (props: StarItemProps) => <StarItem {...props} kind="task" badge="T" label="Tâche" />,
|
|
71
|
-
Action: (props: StarItemProps) => <StarItem {...props} kind="action" badge="A" label="Action" />,
|
|
72
|
-
Result: (props: StarItemProps) => <StarItem {...props} kind="result" badge="R" label="Résultat" />,
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** Editorial SWOT matrix with four contextual quadrants around the S/W/O/T marker. */
|
|
76
|
-
export interface SwotProps extends StyleEscapeHatch {
|
|
77
|
-
strengths: ComponentChildren
|
|
78
|
-
weaknesses: ComponentChildren
|
|
79
|
-
opportunities: ComponentChildren
|
|
80
|
-
threats: ComponentChildren
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function Swot({ strengths, weaknesses, opportunities, threats, class: cls, style }: SwotProps) {
|
|
84
|
-
return (
|
|
85
|
-
<div class={cx('lectern-swot', cls)} style={style}>
|
|
86
|
-
<div class="lectern-swot-cell is-strengths">
|
|
87
|
-
<h3 class="lectern-swot-title">Forces</h3>
|
|
88
|
-
<div class="lectern-swot-reasons">{strengths}</div>
|
|
89
|
-
</div>
|
|
90
|
-
<div class="lectern-swot-cell is-weaknesses">
|
|
91
|
-
<h3 class="lectern-swot-title">Faiblesses</h3>
|
|
92
|
-
<div class="lectern-swot-reasons">{weaknesses}</div>
|
|
93
|
-
</div>
|
|
94
|
-
<div class="lectern-swot-cell is-opportunities">
|
|
95
|
-
<h3 class="lectern-swot-title">Opportunités</h3>
|
|
96
|
-
<div class="lectern-swot-reasons">{opportunities}</div>
|
|
97
|
-
</div>
|
|
98
|
-
<div class="lectern-swot-cell is-threats">
|
|
99
|
-
<h3 class="lectern-swot-title">Menaces</h3>
|
|
100
|
-
<div class="lectern-swot-reasons">{threats}</div>
|
|
101
|
-
</div>
|
|
102
|
-
<div class="lectern-swot-center" aria-hidden="true">
|
|
103
|
-
<span>S</span>
|
|
104
|
-
<span>W</span>
|
|
105
|
-
<span>O</span>
|
|
106
|
-
<span>T</span>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/** KPI card: a large navy figure with a short label (ENGIE "9-10 Md€" style). */
|
|
113
|
-
export interface MetricProps extends StyleEscapeHatch {
|
|
114
|
-
value: ComponentChildren
|
|
115
|
-
label: ComponentChildren
|
|
116
|
-
/** Optional trend/delta text, e.g. "+12%". */
|
|
117
|
-
trend?: ComponentChildren
|
|
118
|
-
tone?: 'positive' | 'negative' | 'neutral'
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export function Metric({ value, label, trend, tone = 'neutral', class: cls, style }: MetricProps) {
|
|
122
|
-
return (
|
|
123
|
-
<div class={cx('lectern-metric', cls)} style={style}>
|
|
124
|
-
<div class="lectern-metric-value">{value}</div>
|
|
125
|
-
<div class="lectern-metric-label">{label}</div>
|
|
126
|
-
{trend ? <div class={cx('lectern-metric-trend', `is-${tone}`)}>{trend}</div> : null}
|
|
127
|
-
</div>
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/** Compact identity card for a person collaborating on the work presented. */
|
|
132
|
-
export interface CollaboratorProps extends StyleEscapeHatch {
|
|
133
|
-
name: ComponentChildren
|
|
134
|
-
role: ComponentChildren
|
|
135
|
-
portrait: string
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export function Collaborator({ name, role, portrait, class: cls, style }: CollaboratorProps) {
|
|
139
|
-
return (
|
|
140
|
-
<div class={cx('lectern-collaborator', cls)} style={style}>
|
|
141
|
-
<img src={portrait} alt={`Portrait de ${typeof name === 'string' ? name : ''}`} />
|
|
142
|
-
<div>
|
|
143
|
-
<strong class="lectern-collaborator-name">{name}</strong>
|
|
144
|
-
<span class="lectern-collaborator-role">{role}</span>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Opinionated **horizontal** timeline: milestones laid out left→right along a
|
|
152
|
-
* rule, each with a date, title and optional description below the node.
|
|
153
|
-
*/
|
|
154
|
-
export interface TimelineItem {
|
|
155
|
-
date: ComponentChildren
|
|
156
|
-
title: ComponentChildren
|
|
157
|
-
description?: ComponentChildren
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export interface TimelineProps extends StyleEscapeHatch {
|
|
161
|
-
items: TimelineItem[]
|
|
162
|
-
/** Reveal milestones one by one. */
|
|
163
|
-
incremental?: boolean
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export function Timeline({ items, incremental, class: cls, style }: TimelineProps) {
|
|
167
|
-
return (
|
|
168
|
-
<ol class={cx('lectern-timeline', cls)} style={style}>
|
|
169
|
-
{items.map(it => (
|
|
170
|
-
<li class={cx('lectern-timeline-item', incremental && 'fragment')}>
|
|
171
|
-
<span class="lectern-timeline-dot" aria-hidden="true" />
|
|
172
|
-
<span class="lectern-timeline-date">{it.date}</span>
|
|
173
|
-
<span class="lectern-timeline-title">{it.title}</span>
|
|
174
|
-
{it.description ? <span class="lectern-timeline-desc">{it.description}</span> : null}
|
|
175
|
-
</li>
|
|
176
|
-
))}
|
|
177
|
-
</ol>
|
|
178
|
-
)
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/** Pull quote with optional attribution. */
|
|
182
|
-
export interface QuoteProps extends StyleEscapeHatch {
|
|
183
|
-
children: ComponentChildren
|
|
184
|
-
cite?: ComponentChildren
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export function Quote({ children, cite, class: cls, style }: QuoteProps) {
|
|
188
|
-
return (
|
|
189
|
-
<blockquote class={cx('lectern-quote', cls)} style={style}>
|
|
190
|
-
<p class="lectern-quote-text">{children}</p>
|
|
191
|
-
{cite ? <footer class="lectern-quote-cite">— {cite}</footer> : null}
|
|
192
|
-
</blockquote>
|
|
193
|
-
)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/** A larger lead paragraph for emphasis. */
|
|
197
|
-
export function Lead({ children, class: cls, style }: { children: ComponentChildren } & StyleEscapeHatch) {
|
|
198
|
-
return (
|
|
199
|
-
<p class={cx('lectern-lead', cls)} style={style}>
|
|
200
|
-
{children}
|
|
201
|
-
</p>
|
|
202
|
-
)
|
|
203
|
-
}
|