@peasant-labs/fairtrade 0.0.42 → 0.0.44

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.
@@ -63,8 +63,11 @@ export function AppPage({ children, as: Tag, className, ...rest }: AppPageProps)
63
63
  */
64
64
  /**
65
65
  * @typedef {Object} AppSidebarAccount
66
- * @property {string} handle shown as @handle; its first letter fills the square avatar.
66
+ * @property {string} handle shown after an at sign; its first letter fills the square avatar. (An at sign
67
+ * opening a word here would start a JSDoc tag and drop every property after it from the types.)
67
68
  * @property {string} [href] makes the account row a link.
69
+ * @property {string} [avatarUrl] the person's picture in the avatar square, decorative (the handle sits beside
70
+ * it); the initial shows instead while it is missing or when it fails to load.
68
71
  * @property {import('./Menu.jsx').MenuItem[]} [items] makes the account row its own menu (profile, settings, sign
69
72
  * out), drawn as the same flat row with no caret and opening above the footer. Takes precedence over href.
70
73
  */
@@ -215,9 +218,24 @@ export type AppSidebarSearch = {
215
218
  };
216
219
  export type AppSidebarAccount = {
217
220
  /**
218
- * shown as
221
+ * shown after an at sign; its first letter fills the square avatar. (An at sign
222
+ * opening a word here would start a JSDoc tag and drop every property after it from the types.)
219
223
  */
220
224
  handle: string;
225
+ /**
226
+ * makes the account row a link.
227
+ */
228
+ href?: string;
229
+ /**
230
+ * the person's picture in the avatar square, decorative (the handle sits beside
231
+ * it); the initial shows instead while it is missing or when it fails to load.
232
+ */
233
+ avatarUrl?: string;
234
+ /**
235
+ * makes the account row its own menu (profile, settings, sign
236
+ * out), drawn as the same flat row with no caret and opening above the footer. Takes precedence over href.
237
+ */
238
+ items?: import("./Menu.jsx").MenuItem[];
221
239
  };
222
240
  export type AppSidebarProps = {
223
241
  /**
@@ -2,5 +2,5 @@
2
2
  * @typedef {import('./types.js').ExploreSurfaceProps} ExploreSurfaceProps
3
3
  */
4
4
  /** @param {ExploreSurfaceProps} props */
5
- export default function Explore({ data, className, onFiltersChange, onOpenTranscript, onOpenProfile, onOpenCollective, transcriptHref, profileHref, collectiveHref, }: ExploreSurfaceProps): import("react").JSX.Element;
5
+ export default function Explore({ data, className, onFiltersChange, onOpenTranscript, onOpenProfile, onOpenCollective, transcriptHref, profileHref, collectiveHref, headingLevel, }: ExploreSurfaceProps): import("react").JSX.Element;
6
6
  export type ExploreSurfaceProps = import("./types.js").ExploreSurfaceProps;
@@ -95,6 +95,12 @@ export type ExploreSurfaceProps = {
95
95
  transcriptHref?: (transcript: ExploreTranscriptPayload) => string;
96
96
  profileHref?: (owner: ExploreOwnerPayload) => string;
97
97
  collectiveHref?: (collective: CollectiveResultPayload) => string;
98
+ /**
99
+ * 2 by default: the page title ("explore transcripts", a transcript's title, a
100
+ * profile's name) is an h2 in a host page. 1 when the host mounts Explore as the whole page: that title is
101
+ * the page's h1 and every heading under it moves up one level.
102
+ */
103
+ headingLevel?: 1 | 2;
98
104
  };
99
105
  /**
100
106
  * The AUTHENTICATED VIEWER's role in a collective — a CollectiveRole, OR the
@@ -80,7 +80,7 @@ export function deriveCodeMapView(payload: import("./types.js").CodeMapPayload |
80
80
  * @property {CodeMapRankMode} rankMode - ranked-entry-list scoring mode.
81
81
  * @property {string|null} scentFilter - one `SCENT_TAGS` member, or null for no filter.
82
82
  */
83
- /** @typedef {{node:import('./types.js').MapNodePayload, depth:number, parentId:string|null, childIds:string[], hasChildren:boolean, canExpand:boolean, forcedOpen:boolean, expanded:boolean}} CodeMapNavigatorRow */
83
+ /** @typedef {{node:import('./types.js').MapNodePayload, depth:number, parentId:string|null, childIds:string[], hasChildren:boolean, canExpand:boolean, forcedOpen:boolean, openByGrain:boolean, expanded:boolean}} CodeMapNavigatorRow */
84
84
  /** @typedef {{orderedIds:string[], rootIds:string[], childIdsByParent:Record<string,string[]>, depthById:Record<string,number>}} CodeMapHierarchy */
85
85
  /** @typedef {{allNodes:import('./types.js').MapNodePayload[], nodes:import('./types.js').MapNodePayload[], visibleIds:string[], selectedId:string|null, grain:CodeMapGrain, expandedIds:string[], viewport:CodeMapViewport|null, hierarchy:CodeMapHierarchy}} CodeMapCanvasView */
86
86
  /** @typedef {{state:CodeMapState, rows:CodeMapNavigatorRow[], focusedId:string|null, selected:import('./types.js').MapNodePayload|null, staleSelectedId:string|null, canvas:CodeMapCanvasView}} CodeMapView */
@@ -212,6 +212,7 @@ export type CodeMapNavigatorRow = {
212
212
  hasChildren: boolean;
213
213
  canExpand: boolean;
214
214
  forcedOpen: boolean;
215
+ openByGrain: boolean;
215
216
  expanded: boolean;
216
217
  };
217
218
  export type CodeMapHierarchy = {
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @param {unknown} level - the composite's `headingLevel` prop.
3
+ * @param {string} component - the composite's name, for the error.
4
+ * @returns {1|2}
5
+ */
6
+ export function pageHeadingLevel(level: unknown, component: string): 1 | 2;
7
+ /**
8
+ * The tag for a heading drawn `depth` levels under the composite's title (0 is the title itself).
9
+ * @param {1|2} pageLevel
10
+ * @param {number} depth
11
+ * @returns {'h1'|'h2'|'h3'|'h4'|'h5'|'h6'}
12
+ */
13
+ export function headingTag(pageLevel: 1 | 2, depth: number): "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
14
+ /** The page-title levels a composite accepts. */
15
+ export const PAGE_HEADING_LEVELS: readonly number[];
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @param {TranscriptViewerProps} props
3
3
  */
4
- export default function TranscriptViewer({ viewModel, capabilities, callbacks, theme: themeProp, onThemeChange, graphSlot, activeTab: activeTabProp, onTabChange, viewMode: viewModeProp, onViewModeChange, leftRailOpen: leftRailOpenProp, onLeftRailOpenChange, rightRailOpen: rightRailOpenProp, onRightRailOpenChange, openTools: openToolsProp, onOpenToolsChange, earlierHistoryOpen: earlierHistoryOpenProp, onEarlierHistoryOpenChange, initialPosition: initialPositionProp, activeTurn: activeTurnProp, onActiveTurnChange, search: searchProp, onSearchChange, filters: filtersProp, onFiltersChange, savedLabels: savedLabelsProp, onSavedLabelsChange, shareOpen: shareOpenProp, onShareOpenChange, moreOpen: moreOpenProp, onMoreOpenChange, breadcrumb, LinkComponent, renderTurnPanel, renderTurnActions, anchorHref, headerActions, streamPrelude, showTail, showOutcome, showSearchTrigger, pullRequests, }: TranscriptViewerProps): import("react").JSX.Element;
4
+ export default function TranscriptViewer({ viewModel, capabilities, callbacks, theme: themeProp, onThemeChange, graphSlot, activeTab: activeTabProp, onTabChange, viewMode: viewModeProp, onViewModeChange, leftRailOpen: leftRailOpenProp, onLeftRailOpenChange, rightRailOpen: rightRailOpenProp, onRightRailOpenChange, openTools: openToolsProp, onOpenToolsChange, earlierHistoryOpen: earlierHistoryOpenProp, onEarlierHistoryOpenChange, initialPosition: initialPositionProp, activeTurn: activeTurnProp, onActiveTurnChange, search: searchProp, onSearchChange, filters: filtersProp, onFiltersChange, savedLabels: savedLabelsProp, onSavedLabelsChange, shareOpen: shareOpenProp, onShareOpenChange, moreOpen: moreOpenProp, onMoreOpenChange, breadcrumb, LinkComponent, renderTurnPanel, renderTurnActions, anchorHref, headerActions, streamPrelude, showTail, showOutcome, showSearchTrigger, pullRequests, headingLevel, }: TranscriptViewerProps): import("react").JSX.Element;
5
5
  export type TranscriptViewerProps = import("./state-capabilities.js").TranscriptViewerProps;
6
6
  export type TranscriptFilters = import("./state-capabilities.js").TranscriptFilters;
7
7
  export type TraceReadingSnapshot = {
@@ -13,8 +13,10 @@
13
13
  * @param {boolean} [props.compact]
14
14
  * @param {boolean} [props.expandAll]
15
15
  * @param {number} [props.revealRequest] explicit search navigation sequence
16
+ * @param {number} [props.headingLevel=4] the turn heading's level: h4 under a viewer whose title is an h2, h3 under one
17
+ * whose title is the page's h1
16
18
  */
17
- export default function TurnCard({ turn, active, openTools, toggleTool, onCopyAnchor, copied, registerRef, onLabel, renderActions, savedLabel, compact, expandAll, revealRequest, }: {
19
+ export default function TurnCard({ turn, active, openTools, toggleTool, onCopyAnchor, copied, registerRef, onLabel, renderActions, savedLabel, compact, expandAll, revealRequest, headingLevel, }: {
18
20
  turn?: TurnVM;
19
21
  active?: boolean;
20
22
  openTools?: Record<string, boolean>;
@@ -31,5 +33,6 @@ export default function TurnCard({ turn, active, openTools, toggleTool, onCopyAn
31
33
  compact?: boolean;
32
34
  expandAll?: boolean;
33
35
  revealRequest?: number;
36
+ headingLevel?: number;
34
37
  }): import("react").JSX.Element;
35
38
  export type TurnVM = import("./view-model.js").TurnVM;
@@ -230,6 +230,10 @@ export type TranscriptViewerProps = {
230
230
  * default false: render a `search this transcript` button at the end of the tab strip that opens search exactly as ⌘F does; independent of `showTail`
231
231
  */
232
232
  showSearchTrigger?: boolean;
233
+ /**
234
+ * default 2: the transcript's title is an h2 in a host page; 1 when the host mounts the viewer as the whole page, so the title is the page's h1 and the phase and turn headings move up one level
235
+ */
236
+ headingLevel?: 1 | 2;
233
237
  /**
234
238
  * host-owned node rendered under the meta row (a pull request list and its own "show all" control); omitted renders nothing
235
239
  */