@vit-foundation/ui 0.24.1 → 0.25.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 +11 -11
- package/dist/components/pages/GetInvolvedPage.svelte +139 -0
- package/dist/components/pages/GetInvolvedPage.svelte.d.ts +36 -0
- package/dist/components/pages/HomePage.svelte +256 -0
- package/dist/components/pages/HomePage.svelte.d.ts +36 -0
- package/dist/components/pages/LegalPage.svelte +39 -0
- package/dist/components/pages/LegalPage.svelte.d.ts +14 -0
- package/dist/components/pages/ProjectPage.svelte +128 -0
- package/dist/components/pages/ProjectPage.svelte.d.ts +17 -0
- package/dist/components/pages/TransparencyPage.svelte +164 -0
- package/dist/components/pages/TransparencyPage.svelte.d.ts +40 -0
- package/dist/components/pages/WeekliesPage.svelte +184 -0
- package/dist/components/pages/WeekliesPage.svelte.d.ts +46 -0
- package/dist/components/pages/WeeklyPage.svelte +203 -0
- package/dist/components/pages/WeeklyPage.svelte.d.ts +35 -0
- package/dist/components/pages/WhatWeDoPage.svelte +107 -0
- package/dist/components/pages/WhatWeDoPage.svelte.d.ts +27 -0
- package/dist/components/pages/WhoWeArePage.svelte +108 -0
- package/dist/components/pages/WhoWeArePage.svelte.d.ts +32 -0
- package/dist/components/ui/Logo.svelte +19 -3
- package/dist/config/messages.js +22 -0
- package/dist/config/types.d.ts +36 -0
- package/dist/content/index.d.ts +3 -1
- package/dist/content/index.js +1 -0
- package/dist/content/pages.d.ts +64 -0
- package/dist/content/pages.js +71 -0
- package/dist/content/types.d.ts +45 -0
- package/dist/content/types.js +0 -5
- package/dist/content-components.d.ts +18 -0
- package/dist/content-components.js +12 -0
- package/dist/contract.d.ts +3 -0
- package/dist/contract.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { EditDescriptor } from '../edit/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Page copy: the editorial blocks of a static page, stored per page and
|
|
4
|
+
* section key in the website's `page_content` table. This module is the
|
|
5
|
+
* only declaration of which keys each page has — the website's `seed.sql`
|
|
6
|
+
* supplies their text and its repository integration test asserts the two
|
|
7
|
+
* agree, so a renamed or dropped row fails that suite instead of silently
|
|
8
|
+
* rendering nothing. vit-brain's `page-copy-keys.test.ts` pins the same set
|
|
9
|
+
* against the live table from the other side.
|
|
10
|
+
*
|
|
11
|
+
* It lived in fndvit-website's `schemas/page-copy.ts` and was restated in
|
|
12
|
+
* vit-brain's `mirror.ts` (with the FORMAT each block edits in — that half
|
|
13
|
+
* stays in brain, ADR-0019). Now that the page modules render from this
|
|
14
|
+
* package, the keys a page reads are the package's fact: a module indexes
|
|
15
|
+
* `copy.hero_title`, so the tuple that makes that compile has to live beside
|
|
16
|
+
* it. Component-free on purpose — `./contract` re-exports it for a host's
|
|
17
|
+
* `+page.server.ts` and a CMS's producer alike.
|
|
18
|
+
*
|
|
19
|
+
* UI chrome (labels, buttons, error messages) is not page copy: it lives in
|
|
20
|
+
* `UiMessages` and ships with the build.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* The "why get in touch" blocks, rendered as one list on /get-involved.
|
|
24
|
+
*
|
|
25
|
+
* Named because a run of keys being a *group* is a fact about the copy, and it
|
|
26
|
+
* needs the same single owner the keys themselves have: the page used to
|
|
27
|
+
* restate these five, so adding a sixth reason here and to the seed left the
|
|
28
|
+
* page silently ignoring it — no type error, no failing test.
|
|
29
|
+
*/
|
|
30
|
+
export declare const GET_INVOLVED_REASON_KEYS: readonly ["reason_collaborate", "reason_event", "reason_press", "reason_brand", "reason_other"];
|
|
31
|
+
export declare const PAGE_COPY_KEYS: {
|
|
32
|
+
readonly home: readonly ["hero_title", "hero_subtitle", "milestones_heading", "weeklies_heading", "weeklies_intro", "know_more_heading"];
|
|
33
|
+
readonly 'what-we-do': readonly ["latest_heading", "collaborations_heading", "collaborations_intro", "passion_heading", "passion_intro"];
|
|
34
|
+
readonly 'who-we-are': readonly ["team_heading", "team_intro", "board_heading", "board_intro", "collaborators_heading"];
|
|
35
|
+
readonly weeklies: readonly ["intro"];
|
|
36
|
+
readonly 'get-involved': readonly ["contact_heading", "contact_intro", "reason_collaborate", "reason_event", "reason_press", "reason_brand", "reason_other", "funding_heading", "funding_body", "careers_heading", "careers_intro"];
|
|
37
|
+
readonly transparency: readonly ["heading", "intro"];
|
|
38
|
+
readonly legal: readonly ["heading", "body"];
|
|
39
|
+
};
|
|
40
|
+
/** A page that has editorial copy. Matches the `page_content.page` column. */
|
|
41
|
+
export type PageId = keyof typeof PAGE_COPY_KEYS;
|
|
42
|
+
/** The section keys declared for one page. */
|
|
43
|
+
export type CopyKey<P extends PageId> = (typeof PAGE_COPY_KEYS)[P][number];
|
|
44
|
+
/**
|
|
45
|
+
* One page's copy, one locale already applied. Every declared key is present:
|
|
46
|
+
* a row missing from the database resolves to an empty string rather than
|
|
47
|
+
* `undefined`.
|
|
48
|
+
*
|
|
49
|
+
* The page modules do NOT guard for that empty string. It is not a state the
|
|
50
|
+
* site is meant to render around — the website's repository integration test
|
|
51
|
+
* asserts that every declared key resolves to non-empty copy, so a dropped or
|
|
52
|
+
* renamed row fails the suite. Guarding at the render site instead puts the
|
|
53
|
+
* decision back at every call site, which is what the assertion exists to
|
|
54
|
+
* avoid (the same answer `CopyIntro` gives).
|
|
55
|
+
*/
|
|
56
|
+
export type PageCopy<P extends PageId> = Record<CopyKey<P>, string>;
|
|
57
|
+
/**
|
|
58
|
+
* How a page module asks for one copy block's edit descriptor: by the key it
|
|
59
|
+
* renders, so a module cannot name a block its page does not declare. A
|
|
60
|
+
* read-only host passes nothing; a CMS answers with a `page-copy` ref for the
|
|
61
|
+
* locale being edited (vit-brain's `pageCopyEditor`), or `undefined` to leave
|
|
62
|
+
* one block alone.
|
|
63
|
+
*/
|
|
64
|
+
export type CopyEditFor<P extends PageId> = (key: CopyKey<P>) => EditDescriptor | undefined;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page copy: the editorial blocks of a static page, stored per page and
|
|
3
|
+
* section key in the website's `page_content` table. This module is the
|
|
4
|
+
* only declaration of which keys each page has — the website's `seed.sql`
|
|
5
|
+
* supplies their text and its repository integration test asserts the two
|
|
6
|
+
* agree, so a renamed or dropped row fails that suite instead of silently
|
|
7
|
+
* rendering nothing. vit-brain's `page-copy-keys.test.ts` pins the same set
|
|
8
|
+
* against the live table from the other side.
|
|
9
|
+
*
|
|
10
|
+
* It lived in fndvit-website's `schemas/page-copy.ts` and was restated in
|
|
11
|
+
* vit-brain's `mirror.ts` (with the FORMAT each block edits in — that half
|
|
12
|
+
* stays in brain, ADR-0019). Now that the page modules render from this
|
|
13
|
+
* package, the keys a page reads are the package's fact: a module indexes
|
|
14
|
+
* `copy.hero_title`, so the tuple that makes that compile has to live beside
|
|
15
|
+
* it. Component-free on purpose — `./contract` re-exports it for a host's
|
|
16
|
+
* `+page.server.ts` and a CMS's producer alike.
|
|
17
|
+
*
|
|
18
|
+
* UI chrome (labels, buttons, error messages) is not page copy: it lives in
|
|
19
|
+
* `UiMessages` and ships with the build.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* The "why get in touch" blocks, rendered as one list on /get-involved.
|
|
23
|
+
*
|
|
24
|
+
* Named because a run of keys being a *group* is a fact about the copy, and it
|
|
25
|
+
* needs the same single owner the keys themselves have: the page used to
|
|
26
|
+
* restate these five, so adding a sixth reason here and to the seed left the
|
|
27
|
+
* page silently ignoring it — no type error, no failing test.
|
|
28
|
+
*/
|
|
29
|
+
export const GET_INVOLVED_REASON_KEYS = [
|
|
30
|
+
'reason_collaborate',
|
|
31
|
+
'reason_event',
|
|
32
|
+
'reason_press',
|
|
33
|
+
'reason_brand',
|
|
34
|
+
'reason_other'
|
|
35
|
+
];
|
|
36
|
+
export const PAGE_COPY_KEYS = {
|
|
37
|
+
home: [
|
|
38
|
+
'hero_title',
|
|
39
|
+
'hero_subtitle',
|
|
40
|
+
'milestones_heading',
|
|
41
|
+
'weeklies_heading',
|
|
42
|
+
'weeklies_intro',
|
|
43
|
+
'know_more_heading'
|
|
44
|
+
],
|
|
45
|
+
'what-we-do': [
|
|
46
|
+
'latest_heading',
|
|
47
|
+
'collaborations_heading',
|
|
48
|
+
'collaborations_intro',
|
|
49
|
+
'passion_heading',
|
|
50
|
+
'passion_intro'
|
|
51
|
+
],
|
|
52
|
+
'who-we-are': [
|
|
53
|
+
'team_heading',
|
|
54
|
+
'team_intro',
|
|
55
|
+
'board_heading',
|
|
56
|
+
'board_intro',
|
|
57
|
+
'collaborators_heading'
|
|
58
|
+
],
|
|
59
|
+
weeklies: ['intro'],
|
|
60
|
+
'get-involved': [
|
|
61
|
+
'contact_heading',
|
|
62
|
+
'contact_intro',
|
|
63
|
+
...GET_INVOLVED_REASON_KEYS,
|
|
64
|
+
'funding_heading',
|
|
65
|
+
'funding_body',
|
|
66
|
+
'careers_heading',
|
|
67
|
+
'careers_intro'
|
|
68
|
+
],
|
|
69
|
+
transparency: ['heading', 'intro'],
|
|
70
|
+
legal: ['heading', 'body']
|
|
71
|
+
};
|
package/dist/content/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* applied. The website's zod-inferred types satisfy these structurally; the
|
|
4
4
|
* package states them itself so consumers owe it no schema library.
|
|
5
5
|
*/
|
|
6
|
+
import type { EditDescriptor } from '../edit/types.js';
|
|
6
7
|
/** The bounds of one form field; Field turns them into length attributes. */
|
|
7
8
|
export interface FieldConstraint {
|
|
8
9
|
min?: number;
|
|
@@ -28,6 +29,26 @@ export interface WeeklyCardData {
|
|
|
28
29
|
excerpt: string;
|
|
29
30
|
imageUrl: string;
|
|
30
31
|
}
|
|
32
|
+
/** A theme a weekly is filed under, as the /weeklies filter chips render it. */
|
|
33
|
+
export interface ThemeData {
|
|
34
|
+
slug: string;
|
|
35
|
+
name: string;
|
|
36
|
+
}
|
|
37
|
+
/** One cited source of a weekly. */
|
|
38
|
+
export interface WeeklySourceData {
|
|
39
|
+
label: string;
|
|
40
|
+
url: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A weekly's OWN page: the card, plus what only the detail renders. The
|
|
44
|
+
* website's `weeklyDetailSchema` carries `related` too; the page module
|
|
45
|
+
* takes that list as its own prop, because vit-brain loads it separately.
|
|
46
|
+
*/
|
|
47
|
+
export interface WeeklyArticleData extends WeeklyCardData {
|
|
48
|
+
body: string | null;
|
|
49
|
+
instagramUrl: string | null;
|
|
50
|
+
sources: WeeklySourceData[];
|
|
51
|
+
}
|
|
31
52
|
/** The kinds a project can have, in display order — a host's enum derives from this. */
|
|
32
53
|
export declare const PROJECT_KINDS: readonly ["collaboration", "passion"];
|
|
33
54
|
export type ProjectKind = (typeof PROJECT_KINDS)[number];
|
|
@@ -45,6 +66,28 @@ export interface ProjectCardData {
|
|
|
45
66
|
externalUrl: string | null;
|
|
46
67
|
hasStory: boolean;
|
|
47
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* A project's OWN page: the card, plus what only the detail renders. The
|
|
71
|
+
* website's `projectDetailSchema` and vit-brain's `toProjectArticle` both
|
|
72
|
+
* answer this shape.
|
|
73
|
+
*/
|
|
74
|
+
export interface ProjectArticleData extends ProjectCardData {
|
|
75
|
+
body: string | null;
|
|
76
|
+
previewImageUrl: string | null;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A weekly's or a project's OWN page: the same localized fields as its card,
|
|
80
|
+
* except that `body` renders as rich text there. Which surface a field is
|
|
81
|
+
* rendered on is the page's fact, and these two are the only pages with one
|
|
82
|
+
* — so the map is shared by `ProjectPage` and `WeeklyPage` and answered by
|
|
83
|
+
* one producer (vit-brain's `articleEdit`). All members optional, like every
|
|
84
|
+
* `*EditMap`: a host may open the body and leave the title alone.
|
|
85
|
+
*/
|
|
86
|
+
export interface ArticleEdit {
|
|
87
|
+
title?: EditDescriptor;
|
|
88
|
+
excerpt?: EditDescriptor;
|
|
89
|
+
body?: EditDescriptor;
|
|
90
|
+
}
|
|
48
91
|
/**
|
|
49
92
|
* The timeline's categories, in DISPLAY ORDER — every select that offers them
|
|
50
93
|
* and every host enum derives from this.
|
|
@@ -75,6 +118,8 @@ export interface MilestoneData {
|
|
|
75
118
|
linkUrl: string | null;
|
|
76
119
|
}
|
|
77
120
|
export interface TeamMemberData {
|
|
121
|
+
/** Present only where the card is editable — a descriptor needs the row (precedent: CollaboratorData). */
|
|
122
|
+
id?: string | number;
|
|
78
123
|
slug: string;
|
|
79
124
|
name: string;
|
|
80
125
|
role: string;
|
package/dist/content/types.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structural shapes of the content the components render, one locale already
|
|
3
|
-
* applied. The website's zod-inferred types satisfy these structurally; the
|
|
4
|
-
* package states them itself so consumers owe it no schema library.
|
|
5
|
-
*/
|
|
6
1
|
/** The kinds a project can have, in display order — a host's enum derives from this. */
|
|
7
2
|
export const PROJECT_KINDS = ['collaboration', 'passion'];
|
|
8
3
|
/**
|
|
@@ -17,6 +17,24 @@ export { default as TimelineMilestone } from './components/timeline/TimelineMile
|
|
|
17
17
|
export type { MilestoneEditMap } from './components/timeline/TimelineMilestone.svelte';
|
|
18
18
|
export { default as WeeklieCard } from './components/weeklies/WeeklieCard.svelte';
|
|
19
19
|
export type { WeeklyEditMap } from './components/weeklies/WeeklieCard.svelte';
|
|
20
|
+
export { default as HomePage } from './components/pages/HomePage.svelte';
|
|
21
|
+
export type { HomePageEdit } from './components/pages/HomePage.svelte';
|
|
22
|
+
export { default as WhoWeArePage } from './components/pages/WhoWeArePage.svelte';
|
|
23
|
+
export type { WhoWeArePageEdit } from './components/pages/WhoWeArePage.svelte';
|
|
24
|
+
export { default as WhatWeDoPage } from './components/pages/WhatWeDoPage.svelte';
|
|
25
|
+
export type { WhatWeDoPageEdit } from './components/pages/WhatWeDoPage.svelte';
|
|
26
|
+
export { default as GetInvolvedPage } from './components/pages/GetInvolvedPage.svelte';
|
|
27
|
+
export type { GetInvolvedPageEdit } from './components/pages/GetInvolvedPage.svelte';
|
|
28
|
+
export { default as TransparencyPage } from './components/pages/TransparencyPage.svelte';
|
|
29
|
+
export type { TransparencyPageEdit } from './components/pages/TransparencyPage.svelte';
|
|
30
|
+
export { default as LegalPage } from './components/pages/LegalPage.svelte';
|
|
31
|
+
export type { LegalPageEdit } from './components/pages/LegalPage.svelte';
|
|
32
|
+
export { default as WeekliesPage } from './components/pages/WeekliesPage.svelte';
|
|
33
|
+
export type { WeekliesPageEdit } from './components/pages/WeekliesPage.svelte';
|
|
34
|
+
export { default as ProjectPage } from './components/pages/ProjectPage.svelte';
|
|
35
|
+
export type { ProjectPageEdit } from './components/pages/ProjectPage.svelte';
|
|
36
|
+
export { default as WeeklyPage } from './components/pages/WeeklyPage.svelte';
|
|
37
|
+
export type { WeeklyPageEdit } from './components/pages/WeeklyPage.svelte';
|
|
20
38
|
export * from './content/index.js';
|
|
21
39
|
export { MILESTONE_CATEGORY_COLOR, matchesMilestoneFilter, milestoneCategoryLabel } from './utils/milestones.js';
|
|
22
40
|
export { createUrlFilters } from './utils/url-filters.svelte.js';
|
|
@@ -11,6 +11,18 @@ export { default as TeamMemberCard } from './components/team/TeamMemberCard.svel
|
|
|
11
11
|
export { default as Timeline } from './components/timeline/Timeline.svelte';
|
|
12
12
|
export { default as TimelineMilestone } from './components/timeline/TimelineMilestone.svelte';
|
|
13
13
|
export { default as WeeklieCard } from './components/weeklies/WeeklieCard.svelte';
|
|
14
|
+
// The nine PAGE modules: a website route is one tag over the site's read
|
|
15
|
+
// projection, and a CMS opens it with the module's `*PageEdit` map. Same door
|
|
16
|
+
// as the cards they compose — a page is content that renders, not chrome.
|
|
17
|
+
export { default as HomePage } from './components/pages/HomePage.svelte';
|
|
18
|
+
export { default as WhoWeArePage } from './components/pages/WhoWeArePage.svelte';
|
|
19
|
+
export { default as WhatWeDoPage } from './components/pages/WhatWeDoPage.svelte';
|
|
20
|
+
export { default as GetInvolvedPage } from './components/pages/GetInvolvedPage.svelte';
|
|
21
|
+
export { default as TransparencyPage } from './components/pages/TransparencyPage.svelte';
|
|
22
|
+
export { default as LegalPage } from './components/pages/LegalPage.svelte';
|
|
23
|
+
export { default as WeekliesPage } from './components/pages/WeekliesPage.svelte';
|
|
24
|
+
export { default as ProjectPage } from './components/pages/ProjectPage.svelte';
|
|
25
|
+
export { default as WeeklyPage } from './components/pages/WeeklyPage.svelte';
|
|
14
26
|
export * from './content/index.js';
|
|
15
27
|
export { MILESTONE_CATEGORY_COLOR, matchesMilestoneFilter, milestoneCategoryLabel } from './utils/milestones.js';
|
|
16
28
|
// The two list rules: URL-mirrored filters, and the weeklies index over them.
|
package/dist/contract.d.ts
CHANGED
|
@@ -47,6 +47,9 @@ export { MILESTONE_CATEGORIES, PROJECT_KINDS } from './content/types.js';
|
|
|
47
47
|
export type { MilestoneCategory, ProjectKind } from './content/types.js';
|
|
48
48
|
export { WEEKLY_LIST_DEFAULTS, WEEKLY_LIST_PARAMS, parseWeeklyListUrl } from './utils/weekly-list-contract.js';
|
|
49
49
|
export type { WeeklyListFilters, WeeklyListPage, WeeklyListServerData } from './utils/weekly-list-contract.js';
|
|
50
|
+
export { GET_INVOLVED_REASON_KEYS, PAGE_COPY_KEYS } from './content/pages.js';
|
|
51
|
+
export type { CopyEditFor, CopyKey, PageCopy, PageId } from './content/pages.js';
|
|
52
|
+
export type { ArticleEdit, ProjectArticleData, ThemeData, WeeklyArticleData, WeeklySourceData } from './content/types.js';
|
|
50
53
|
export { CONTACT_CATEGORIES } from './content/types.js';
|
|
51
54
|
export { COMMENT_STATUSES } from './content/types.js';
|
|
52
55
|
export type { CommentStatus, ContactCategory, FieldConstraint, FormFailReason } from './content/types.js';
|
package/dist/contract.js
CHANGED
|
@@ -49,6 +49,10 @@ export { MILESTONE_CATEGORIES, PROJECT_KINDS } from './content/types.js';
|
|
|
49
49
|
// half had three spellings across two repositories and this package's own test,
|
|
50
50
|
// and the round-trip case guarding them crossed against the test's copy.
|
|
51
51
|
export { WEEKLY_LIST_DEFAULTS, WEEKLY_LIST_PARAMS, parseWeeklyListUrl } from './utils/weekly-list-contract.js';
|
|
52
|
+
// The page-copy vocabulary: which blocks each static page reads. A host's
|
|
53
|
+
// `+page.server.ts` builds `PageCopy<P>` from it and a CMS's producer binds
|
|
54
|
+
// its own per-page format table to it, both on the server.
|
|
55
|
+
export { GET_INVOLVED_REASON_KEYS, PAGE_COPY_KEYS } from './content/pages.js';
|
|
52
56
|
export { CONTACT_CATEGORIES } from './content/types.js';
|
|
53
57
|
export { COMMENT_STATUSES } from './content/types.js';
|
|
54
58
|
export { COMMENT_BODY, CONTACT_MESSAGE, CONTACT_NAME, DISPLAY_NAME, EMAIL, LOGIN_PASSWORD, PASSWORD } from './forms/constraints.js';
|