@graphlearning/shell 0.2.0 → 0.4.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 CHANGED
@@ -29,6 +29,32 @@ import { getScene } from './scenes'
29
29
  That is the whole integration. A content repo's `src/` is then `content/`, `scenes/`, `main.tsx`
30
30
  and `theme.css`.
31
31
 
32
+ ## The site bar
33
+
34
+ `ConceptApp` renders the platform's header — brand, section nav, an empty actions slot — above its
35
+ catalog page, and nowhere else. It is a port of the bar at graphl.in, class for class, so a reader
36
+ crossing from the catalog into a concept app never leaves "the site". Nothing to pass: a content
37
+ repo is a course, which is the default.
38
+
39
+ It is deliberately platform-coloured, not `--brand`: looking identical on all eight sites is the
40
+ whole reason it exists. It renders on the catalog page ONLY — never on a section, which is a video
41
+ frame — so the recorder cannot see it.
42
+
43
+ An app that is not a course (`python-lab` is a lab) says so, and one that is not a `ConceptApp` at
44
+ all imports the bar directly — the one part of this package that is exported on its own:
45
+
46
+ ```tsx
47
+ <ConceptApp … kind="labs" /> // marks Labs as the current nav item
48
+
49
+ import { SiteHeader } from '@graphlearning/shell'
50
+ <SiteHeader kind="labs" actions={<ThemeToggle />} />
51
+ ```
52
+
53
+ The bar exists **three times** by necessity — `ui-graphl` (buildless vanilla), this package, and
54
+ `python-lab` (which hand-ports it rather than take this package as a dependency; see the invariant
55
+ in CLAUDE.md). One design, three implementations — **when you change one, change all three**, or
56
+ they drift and the seam shows on every crossing.
57
+
32
58
  ## The three contracts
33
59
 
34
60
  **1. Import order.** The three stylesheets cascade: engine, shell, theme. The theme must come last
@@ -1,8 +1,11 @@
1
+ import { type ThemeKey } from '@graphlearning/flow';
1
2
  import type { Course, SceneLookup } from './types';
2
- export declare function ConceptApp({ subject, eyebrow, courses: COURSES, getScene, audioBase, }: {
3
+ export declare function ConceptApp({ subject, eyebrow, courses: COURSES, getScene, audioBase, kind, theme, }: {
3
4
  subject: string;
4
5
  courses: Record<string, Course>;
5
6
  eyebrow?: string;
6
7
  getScene: SceneLookup;
7
8
  audioBase?: string;
9
+ kind?: string;
10
+ theme?: ThemeKey;
8
11
  }): import("react").JSX.Element;
@@ -1,5 +1,8 @@
1
1
  import type { Course } from './types';
2
- export declare function CourseIndex({ courses, subject }: {
2
+ import type { ReactNode } from 'react';
3
+ export declare function CourseIndex({ courses, subject, kind, actions, }: {
3
4
  courses: Course[];
4
5
  subject: string;
6
+ kind?: string;
7
+ actions?: ReactNode;
5
8
  }): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
+ import { type ThemeKey } from '@graphlearning/flow';
1
2
  import type { Section, SceneLookup } from './types';
2
- export declare function SectionView({ section, getScene, capture, eyebrow, index, total, onHome, onPrev, onNext, narrating, onToggleNarration, }: {
3
+ export declare function SectionView({ section, getScene, capture, eyebrow, index, total, onHome, onPrev, onNext, narrating, onToggleNarration, theme, onToggleTheme, }: {
3
4
  section: Section;
4
5
  getScene: SceneLookup;
5
6
  capture?: boolean;
@@ -11,4 +12,6 @@ export declare function SectionView({ section, getScene, capture, eyebrow, index
11
12
  onNext?: () => void;
12
13
  narrating?: boolean;
13
14
  onToggleNarration?: () => void;
15
+ theme?: ThemeKey;
16
+ onToggleTheme?: () => void;
14
17
  }): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare function SiteHeader({ kind, nav, home, actions, }: {
3
+ kind?: string;
4
+ nav?: {
5
+ id: string;
6
+ label: string;
7
+ }[];
8
+ home?: string;
9
+ actions?: ReactNode;
10
+ }): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { ThemeKey } from '@graphlearning/flow';
2
+ export declare function ThemeToggle({ theme, onToggle }: {
3
+ theme: ThemeKey;
4
+ onToggle: () => void;
5
+ }): import("react").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export type { Section, Course, SceneLookup } from './types';
2
2
  export { slugOf, allSections } from './types';
3
3
  export { ConceptApp } from './ConceptApp';
4
+ export { SiteHeader } from './SiteHeader';