@vit-foundation/ui 0.24.2 → 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.
Files changed (32) hide show
  1. package/README.md +11 -11
  2. package/dist/components/pages/GetInvolvedPage.svelte +139 -0
  3. package/dist/components/pages/GetInvolvedPage.svelte.d.ts +36 -0
  4. package/dist/components/pages/HomePage.svelte +256 -0
  5. package/dist/components/pages/HomePage.svelte.d.ts +36 -0
  6. package/dist/components/pages/LegalPage.svelte +39 -0
  7. package/dist/components/pages/LegalPage.svelte.d.ts +14 -0
  8. package/dist/components/pages/ProjectPage.svelte +128 -0
  9. package/dist/components/pages/ProjectPage.svelte.d.ts +17 -0
  10. package/dist/components/pages/TransparencyPage.svelte +164 -0
  11. package/dist/components/pages/TransparencyPage.svelte.d.ts +40 -0
  12. package/dist/components/pages/WeekliesPage.svelte +184 -0
  13. package/dist/components/pages/WeekliesPage.svelte.d.ts +46 -0
  14. package/dist/components/pages/WeeklyPage.svelte +203 -0
  15. package/dist/components/pages/WeeklyPage.svelte.d.ts +35 -0
  16. package/dist/components/pages/WhatWeDoPage.svelte +107 -0
  17. package/dist/components/pages/WhatWeDoPage.svelte.d.ts +27 -0
  18. package/dist/components/pages/WhoWeArePage.svelte +108 -0
  19. package/dist/components/pages/WhoWeArePage.svelte.d.ts +32 -0
  20. package/dist/config/messages.js +22 -0
  21. package/dist/config/types.d.ts +36 -0
  22. package/dist/content/index.d.ts +3 -1
  23. package/dist/content/index.js +1 -0
  24. package/dist/content/pages.d.ts +64 -0
  25. package/dist/content/pages.js +71 -0
  26. package/dist/content/types.d.ts +45 -0
  27. package/dist/content/types.js +0 -5
  28. package/dist/content-components.d.ts +18 -0
  29. package/dist/content-components.js +12 -0
  30. package/dist/contract.d.ts +3 -0
  31. package/dist/contract.js +4 -0
  32. package/package.json +1 -1
@@ -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
+ };
@@ -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;
@@ -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.
@@ -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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vit-foundation/ui",
3
- "version": "0.24.2",
3
+ "version": "0.25.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",