mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 19:16:08 +00:00
ff749611c6
The Templates section of the rail now opens on the decorated templates of the page's kind, covers two to a row and spreads at full width, each card the page renderer drawing the page the click will lay: this page's photos and words in it, in the book theme, a cover in the journey's title and subtitle as the assistant's layout sets it. A row of style chips narrows the set to one archetype. A click is one undo step on the page as it is then, refused for the other kind of page, and opens the photos when frames are left empty. The book's own layouts and the built-in wireframes follow below, and the help guide and the wiki describe the panel as it now is. The panel moved out of StudioSidebar into its own file; the sidebar keeps the rail, and its two physical sides went with the code, so the rtl baseline entry goes too. The Travel panel and a template's map build the journey they draw with one helper.
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import type { BookTravelContext, JourneyStats } from '@trek/shared';
|
|
|
|
/**
|
|
* What the book engine's travel factories read, as the Studio knows it: the
|
|
* journey's figures, its recorded way and the words in the reader's
|
|
* language. The Travel panel builds its tiles with it, and the Templates
|
|
* panel lays a template's map with it, so both draw the same journey.
|
|
*
|
|
* The day word is the engine's template: `t` leaves the `{day}` in it
|
|
* untouched, and `bookDayText` puts the number there.
|
|
*/
|
|
export function studioTravelContext(
|
|
stats: JourneyStats,
|
|
path: [number, number][][],
|
|
locale: string,
|
|
t: (k: string) => string
|
|
): BookTravelContext {
|
|
return {
|
|
locale,
|
|
stats,
|
|
path,
|
|
entries: [],
|
|
labels: {
|
|
day: t('journey.studio.day'),
|
|
stations: t('journey.studio.stations'),
|
|
summary: t('journey.studio.summary'),
|
|
countries: t('journey.studio.countries'),
|
|
distance: t('journey.studio.metric.distance'),
|
|
pros: t('journey.editor.pros'),
|
|
cons: t('journey.editor.cons'),
|
|
},
|
|
};
|
|
}
|