@vit-foundation/ui 0.20.1 → 0.22.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.
@@ -25,7 +25,7 @@
25
25
  <script lang="ts">
26
26
  import { getUiConfig } from '../../config/context.js';
27
27
  import ActionLabel from '../../edit/ActionLabel.svelte';
28
- import type { MilestoneCategory, MilestoneData } from '../../content/types.js';
28
+ import { MILESTONE_CATEGORIES, type MilestoneData } from '../../content/types.js';
29
29
  import EditFrame from '../../edit/chrome/EditFrame.svelte';
30
30
  import EditPanel from '../../edit/chrome/EditPanel.svelte';
31
31
  import Editable from '../../edit/Editable.svelte';
@@ -46,7 +46,7 @@
46
46
 
47
47
  const config = getUiConfig();
48
48
 
49
- const CATEGORIES = Object.keys(MILESTONE_CATEGORY_COLOR) as MilestoneCategory[];
49
+ // The set's own order, not a colour map's key order and not a cast.
50
50
 
51
51
  /**
52
52
  * The panel rows, zipped from the map's descriptors and this milestone's
@@ -58,7 +58,7 @@
58
58
  edit?.occurredOn && { descriptor: edit.occurredOn, value: milestone.occurredOn },
59
59
  edit?.category && {
60
60
  descriptor: {
61
- options: CATEGORIES.map((category) => ({
61
+ options: MILESTONE_CATEGORIES.map((category) => ({
62
62
  value: category,
63
63
  label: milestoneCategoryLabel(category, config.messages)
64
64
  })),
@@ -20,7 +20,7 @@ export interface MilestoneEditMap {
20
20
  kind: 'remove';
21
21
  }>;
22
22
  }
23
- import type { MilestoneData } from '../../content/types.js';
23
+ import { type MilestoneData } from '../../content/types.js';
24
24
  interface Props {
25
25
  milestone: MilestoneData;
26
26
  /** Marks fields editable where an edit adapter is active. */
@@ -1,4 +1,4 @@
1
1
  export { renderBody } from './richtext.js';
2
2
  export type { RichTextBlock } from './richtext.js';
3
- export { CONTACT_CATEGORIES, REACTIONS } from './types.js';
3
+ export { CONTACT_CATEGORIES, MILESTONE_CATEGORIES, PROJECT_KINDS, REACTIONS } from './types.js';
4
4
  export type { CollaboratorData, CommentData, CommentThreadData, ContactCategory, FieldConstraint, FormFailReason, JobOpeningData, MilestoneCategory, MilestoneData, ProjectCardData, ProjectKind, Reaction, ReactionSummary, ReactionTarget, SortDirection, TeamMemberData, WeeklyCardData } from './types.js';
@@ -1,2 +1,2 @@
1
1
  export { renderBody } from './richtext.js';
2
- export { CONTACT_CATEGORIES, REACTIONS } from './types.js';
2
+ export { CONTACT_CATEGORIES, MILESTONE_CATEGORIES, PROJECT_KINDS, REACTIONS } from './types.js';
@@ -28,7 +28,9 @@ export interface WeeklyCardData {
28
28
  excerpt: string;
29
29
  imageUrl: string;
30
30
  }
31
- export type ProjectKind = 'collaboration' | 'passion';
31
+ /** The kinds a project can have, in display order — a host's enum derives from this. */
32
+ export declare const PROJECT_KINDS: readonly ["collaboration", "passion"];
33
+ export type ProjectKind = (typeof PROJECT_KINDS)[number];
32
34
  /** A project as its card shows it. */
33
35
  export interface ProjectCardData {
34
36
  id: number;
@@ -43,7 +45,23 @@ export interface ProjectCardData {
43
45
  externalUrl: string | null;
44
46
  hasStory: boolean;
45
47
  }
46
- export type MilestoneCategory = 'education' | 'lab' | 'foundation' | 'collaboration' | 'press';
48
+ /**
49
+ * The timeline's categories, in DISPLAY ORDER — every select that offers them
50
+ * and every host enum derives from this.
51
+ *
52
+ * The order was an emergent property of two unrelated literals before: the
53
+ * panel select read `Object.keys(MILESTONE_CATEGORY_COLOR)` while vit-brain's
54
+ * record form spelled its own array, so one CMS offered the same field in two
55
+ * orders and seeded a new row with the third member of one of them. The order
56
+ * kept here is the colour map's, which is the one with a reason attached (its
57
+ * slots are fixed and never reordered).
58
+ *
59
+ * A tuple rather than a union for the reason `CONTACT_CATEGORIES` is one: a
60
+ * `satisfies readonly MilestoneCategory[]` binds the element type and never
61
+ * the list, so a host could drop a member and still compile.
62
+ */
63
+ export declare const MILESTONE_CATEGORIES: readonly ["foundation", "lab", "education", "collaboration", "press"];
64
+ export type MilestoneCategory = (typeof MILESTONE_CATEGORIES)[number];
47
65
  /** One timeline milestone. */
48
66
  export interface MilestoneData {
49
67
  id: number;
@@ -3,6 +3,30 @@
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
+ /** The kinds a project can have, in display order — a host's enum derives from this. */
7
+ export const PROJECT_KINDS = ['collaboration', 'passion'];
8
+ /**
9
+ * The timeline's categories, in DISPLAY ORDER — every select that offers them
10
+ * and every host enum derives from this.
11
+ *
12
+ * The order was an emergent property of two unrelated literals before: the
13
+ * panel select read `Object.keys(MILESTONE_CATEGORY_COLOR)` while vit-brain's
14
+ * record form spelled its own array, so one CMS offered the same field in two
15
+ * orders and seeded a new row with the third member of one of them. The order
16
+ * kept here is the colour map's, which is the one with a reason attached (its
17
+ * slots are fixed and never reordered).
18
+ *
19
+ * A tuple rather than a union for the reason `CONTACT_CATEGORIES` is one: a
20
+ * `satisfies readonly MilestoneCategory[]` binds the element type and never
21
+ * the list, so a host could drop a member and still compile.
22
+ */
23
+ export const MILESTONE_CATEGORIES = [
24
+ 'foundation',
25
+ 'lab',
26
+ 'education',
27
+ 'collaboration',
28
+ 'press'
29
+ ];
6
30
  /** The reactions a weekly or comment can carry, in display order. */
7
31
  export const REACTIONS = ['like', 'love', 'clap'];
8
32
  /** The contact form's reasons, in display order — the host schema derives its enum from this. */
@@ -21,7 +21,9 @@ export * from './content/index.js';
21
21
  export { MILESTONE_CATEGORY_COLOR, matchesMilestoneFilter, milestoneCategoryLabel } from './utils/milestones.js';
22
22
  export { createUrlFilters } from './utils/url-filters.svelte.js';
23
23
  export type { UrlFilters, UrlFiltersConfig } from './utils/url-filters.svelte.js';
24
- export { createWeeklyList, WEEKLY_LIST_DEFAULTS } from './utils/weekly-list.svelte.js';
25
- export type { WeeklyList, WeeklyListConfig, WeeklyListFilters, WeeklyListPage, WeeklyListServerData } from './utils/weekly-list.svelte.js';
24
+ export { createWeeklyList } from './utils/weekly-list.svelte.js';
25
+ export type { WeeklyList, WeeklyListConfig } from './utils/weekly-list.svelte.js';
26
+ export { WEEKLY_LIST_DEFAULTS } from './utils/weekly-list-contract.js';
27
+ export type { WeeklyListFilters, WeeklyListPage, WeeklyListServerData } from './utils/weekly-list-contract.js';
26
28
  export { contactCategoryLabel } from './utils/contact.js';
27
29
  export { formatDate, yearOf } from './utils/dates.js';
@@ -15,6 +15,9 @@ export * from './content/index.js';
15
15
  export { MILESTONE_CATEGORY_COLOR, matchesMilestoneFilter, milestoneCategoryLabel } from './utils/milestones.js';
16
16
  // The two list rules: URL-mirrored filters, and the weeklies index over them.
17
17
  export { createUrlFilters } from './utils/url-filters.svelte.js';
18
- export { createWeeklyList, WEEKLY_LIST_DEFAULTS } from './utils/weekly-list.svelte.js';
18
+ export { createWeeklyList } from './utils/weekly-list.svelte.js';
19
+ // The list's contract is component-free on purpose, so ./contract carries it
20
+ // too — a host's +page.server.ts reads these without loading the grid.
21
+ export { WEEKLY_LIST_DEFAULTS } from './utils/weekly-list-contract.js';
19
22
  export { contactCategoryLabel } from './utils/contact.js';
20
23
  export { formatDate, yearOf } from './utils/dates.js';
@@ -20,6 +20,22 @@
20
20
  * It adds nothing. Every name below is already exported from a semantic
21
21
  * subpath and stays there — this is a second door into the same rooms, not a
22
22
  * new floor, and the barrel remains the surface a component host reads.
23
+ *
24
+ * It was cut to fit ONE consumer, and the second one did not fit through it.
25
+ * vit-brain's four restatements were the motive, so the first version carried
26
+ * the locale vocabulary, the edit contract and REACTIONS — and of the fifteen
27
+ * names fndvit-website's SERVER modules take from the barrel, it covered
28
+ * exactly one. Its `schemas/{common,auth,comment,contact}.ts` and
29
+ * `remote/result.ts` are read by `server/auth.ts`, `server/form-action.ts` and
30
+ * eleven repositories, so that site reaches a sixty-component graph to obtain
31
+ * string bounds and a hidden field's name.
32
+ *
33
+ * The fix moved no files, which is the tell that the seam was in the right
34
+ * place and merely too narrow: `forms/constraints.ts`, `forms/transport.ts`,
35
+ * `forms/types.ts` and `utils/paths.ts` were ALREADY component-free leaves —
36
+ * they import nothing but `content/types.js`, or nothing at all. They were
37
+ * what this subpath promises, with no door onto them. Now there is one, and
38
+ * the guard walks them like the rest.
23
39
  */
24
40
  export { LOCALES, BASE_LOCALE } from './config/types.js';
25
41
  export type { Locale, NotParameterized, ParameterizedKey, ParameterlessKey, SiteLink, UiMessages } from './config/types.js';
@@ -27,3 +43,25 @@ export { localize } from './edit/types.js';
27
43
  export type { CollectionRef, ContentRef, EditableEntity, EditDescriptor, EntityOp, LocalizedText, PropertyDescriptor, PropertyOption, PropertyType, PropertyValue } from './edit/types.js';
28
44
  export { REACTIONS } from './content/types.js';
29
45
  export type { Reaction, ReactionSummary, SortDirection } from './content/types.js';
46
+ export { MILESTONE_CATEGORIES, PROJECT_KINDS } from './content/types.js';
47
+ export type { MilestoneCategory, ProjectKind } from './content/types.js';
48
+ export { WEEKLY_LIST_DEFAULTS } from './utils/weekly-list-contract.js';
49
+ export type { WeeklyListFilters, WeeklyListPage, WeeklyListServerData } from './utils/weekly-list-contract.js';
50
+ export { CONTACT_CATEGORIES } from './content/types.js';
51
+ export type { ContactCategory, FieldConstraint, FormFailReason } from './content/types.js';
52
+ export { COMMENT_BODY, CONTACT_MESSAGE, CONTACT_NAME, DISPLAY_NAME, EMAIL, LOGIN_PASSWORD, PASSWORD } from './forms/constraints.js';
53
+ export { hasNewsletterIntent, HONEYPOT_FIELD, isNewsletterIntent, NEWSLETTER_INTENT_PARAM, NEWSLETTER_INTENT_VALUE, withNewsletterIntent } from './forms/transport.js';
54
+ export type { FormFail, FormFieldIssue, FormResultLike, FormResultOf, KeyedRemoteForms, RemoteField, RemoteFormAttributes, RemoteFormInstance } from './forms/types.js';
55
+ export { buildQueryString, isExternalUrl, isInternalPath, isPathUnder } from './utils/paths.js';
56
+ /**
57
+ * The descriptor factories. `edit/helpers.ts` imports nothing but types from
58
+ * two modules this subpath already anchors, so it needed a door rather than a
59
+ * split.
60
+ *
61
+ * They were reachable only beside the components, which cost vit-brain an
62
+ * eslint exception that switched `no-restricted-imports` off WHOLESALE for the
63
+ * two files calling one factory each — and one of those, `mirror.ts`, is
64
+ * already reached from a server repository by `import type`. A per-specifier
65
+ * door replaces a per-file hole.
66
+ */
67
+ export { chromeEdit, chromeProperty, collectionOf, entityEdit, entityProperty, pageCopyEdit } from './edit/helpers.js';
package/dist/contract.js CHANGED
@@ -20,7 +20,44 @@
20
20
  * It adds nothing. Every name below is already exported from a semantic
21
21
  * subpath and stays there — this is a second door into the same rooms, not a
22
22
  * new floor, and the barrel remains the surface a component host reads.
23
+ *
24
+ * It was cut to fit ONE consumer, and the second one did not fit through it.
25
+ * vit-brain's four restatements were the motive, so the first version carried
26
+ * the locale vocabulary, the edit contract and REACTIONS — and of the fifteen
27
+ * names fndvit-website's SERVER modules take from the barrel, it covered
28
+ * exactly one. Its `schemas/{common,auth,comment,contact}.ts` and
29
+ * `remote/result.ts` are read by `server/auth.ts`, `server/form-action.ts` and
30
+ * eleven repositories, so that site reaches a sixty-component graph to obtain
31
+ * string bounds and a hidden field's name.
32
+ *
33
+ * The fix moved no files, which is the tell that the seam was in the right
34
+ * place and merely too narrow: `forms/constraints.ts`, `forms/transport.ts`,
35
+ * `forms/types.ts` and `utils/paths.ts` were ALREADY component-free leaves —
36
+ * they import nothing but `content/types.js`, or nothing at all. They were
37
+ * what this subpath promises, with no door onto them. Now there is one, and
38
+ * the guard walks them like the rest.
23
39
  */
24
40
  export { LOCALES, BASE_LOCALE } from './config/types.js';
25
41
  export { localize } from './edit/types.js';
26
42
  export { REACTIONS } from './content/types.js';
43
+ // The two content vocabularies a host's zod enum derives from, the way its
44
+ // contact form already derives from CONTACT_CATEGORIES below. Values, because
45
+ // a type cannot be the source of an enum.
46
+ export { MILESTONE_CATEGORIES, PROJECT_KINDS } from './content/types.js';
47
+ export { WEEKLY_LIST_DEFAULTS } from './utils/weekly-list-contract.js';
48
+ export { CONTACT_CATEGORIES } from './content/types.js';
49
+ export { COMMENT_BODY, CONTACT_MESSAGE, CONTACT_NAME, DISPLAY_NAME, EMAIL, LOGIN_PASSWORD, PASSWORD } from './forms/constraints.js';
50
+ export { hasNewsletterIntent, HONEYPOT_FIELD, isNewsletterIntent, NEWSLETTER_INTENT_PARAM, NEWSLETTER_INTENT_VALUE, withNewsletterIntent } from './forms/transport.js';
51
+ export { buildQueryString, isExternalUrl, isInternalPath, isPathUnder } from './utils/paths.js';
52
+ /**
53
+ * The descriptor factories. `edit/helpers.ts` imports nothing but types from
54
+ * two modules this subpath already anchors, so it needed a door rather than a
55
+ * split.
56
+ *
57
+ * They were reachable only beside the components, which cost vit-brain an
58
+ * eslint exception that switched `no-restricted-imports` off WHOLESALE for the
59
+ * two files calling one factory each — and one of those, `mirror.ts`, is
60
+ * already reached from a server repository by `import type`. A per-specifier
61
+ * door replaces a per-file hole.
62
+ */
63
+ export { chromeEdit, chromeProperty, collectionOf, entityEdit, entityProperty, pageCopyEdit } from './edit/helpers.js';
@@ -5,6 +5,11 @@ import type { MilestoneCategory } from '../content/types.js';
5
5
  * teal, slots are never reordered). Labels always accompany the color dot,
6
6
  * so color is never the only encoding. The --series-* tokens ship in
7
7
  * tokens.css.
8
+ *
9
+ * Keyed, not positional, so a member added to `MILESTONE_CATEGORIES` fails to
10
+ * compile here rather than silently taking slot 6 — and so the display order
11
+ * is `MILESTONE_CATEGORIES`' to decide, not a side effect of this literal's
12
+ * key order, which is what the panel select used to read.
8
13
  */
9
14
  export declare const MILESTONE_CATEGORY_COLOR: Record<MilestoneCategory, string>;
10
15
  /**
@@ -3,6 +3,11 @@
3
3
  * teal, slots are never reordered). Labels always accompany the color dot,
4
4
  * so color is never the only encoding. The --series-* tokens ship in
5
5
  * tokens.css.
6
+ *
7
+ * Keyed, not positional, so a member added to `MILESTONE_CATEGORIES` fails to
8
+ * compile here rather than silently taking slot 6 — and so the display order
9
+ * is `MILESTONE_CATEGORIES`' to decide, not a side effect of this literal's
10
+ * key order, which is what the panel select used to read.
6
11
  */
7
12
  export const MILESTONE_CATEGORY_COLOR = {
8
13
  foundation: 'var(--series-1)',
@@ -0,0 +1,66 @@
1
+ import type { SortDirection, WeeklyCardData } from '../content/types.js';
2
+ /**
3
+ * The weeklies index's contract, without the view that runs it.
4
+ *
5
+ * `createWeeklyList` needs the Svelte compiler — four `$state` cells, an
6
+ * `$effect` and three `$derived` — so it lives in a `.svelte.ts` rune module.
7
+ * These four names do not: they are what a HOST has to agree with this
8
+ * package about before any of that runs, and a host agrees with them on the
9
+ * server. `+page.server.ts` builds `WeeklyListServerData`, a query schema
10
+ * takes its defaults from `WEEKLY_LIST_DEFAULTS`, and a repository answers
11
+ * `WeeklyListPage`.
12
+ *
13
+ * They were in the rune module, which put them behind `./content` — eight
14
+ * components — and, worse, out of reach of `./contract` altogether, because
15
+ * that subpath's guard refuses a rune module by name (they need the
16
+ * compiler, so a server import of one is the defect the guard exists to
17
+ * catch). So the release that gave `pageSize` an owner, to end a restatement
18
+ * in two repositories that cannot import each other, shipped it where
19
+ * neither host's server could import it: fndvit-website's
20
+ * `schemas/weekly.ts` reaches it through `./content` and is itself read by
21
+ * `routes/weeklies/+page.server.ts`.
22
+ *
23
+ * Splitting the file is the whole fix. Nothing moves for a component host —
24
+ * `./content` still exports every name from here — and the four facts a
25
+ * server needs stop being locked behind a graph it must not load.
26
+ */
27
+ /**
28
+ * The weeklies index's URL defaults: the value a param stands for when it is
29
+ * absent. Both halves of the URL contract — `createWeeklyList` omitting a
30
+ * default, the host's query schema supplying one — must name the same values,
31
+ * so a host derives its schema defaults from here rather than restating them.
32
+ *
33
+ * `pageSize` is here for the same reason one step further out. It is not a
34
+ * URL param: it is what a page of this list HOLDS, which the grid this
35
+ * package renders decides. Every host was spelling its own — fndvit-website
36
+ * as `WEEKLIES_PAGE_SIZE`, vit-brain's mirror as a bare `12` in markup — and
37
+ * the two must agree, because the mirror exists to page the same corpus the
38
+ * site pages. Two repositories that cannot import each other were each
39
+ * holding half of one number. `createWeeklyList` still READS the size from
40
+ * `config.server().pageSize`, so a host may still answer something else; this
41
+ * is the value it should answer unless it means to differ.
42
+ */
43
+ export declare const WEEKLY_LIST_DEFAULTS: {
44
+ readonly sort: "desc";
45
+ readonly page: 1;
46
+ readonly pageSize: 12;
47
+ };
48
+ /** A type alias, not an interface: createUrlFilters needs an index signature. */
49
+ export type WeeklyListFilters = {
50
+ q: string;
51
+ theme: string | null;
52
+ sort: SortDirection;
53
+ };
54
+ /** One page of the list plus the unpaged total (for the pagination). */
55
+ export interface WeeklyListPage {
56
+ items: WeeklyCardData[];
57
+ total: number;
58
+ }
59
+ /** The server-rendered page, re-read on every navigation. */
60
+ export interface WeeklyListServerData {
61
+ weeklies: WeeklyCardData[];
62
+ total: number;
63
+ page: number;
64
+ pageSize: number;
65
+ query: WeeklyListFilters;
66
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The weeklies index's contract, without the view that runs it.
3
+ *
4
+ * `createWeeklyList` needs the Svelte compiler — four `$state` cells, an
5
+ * `$effect` and three `$derived` — so it lives in a `.svelte.ts` rune module.
6
+ * These four names do not: they are what a HOST has to agree with this
7
+ * package about before any of that runs, and a host agrees with them on the
8
+ * server. `+page.server.ts` builds `WeeklyListServerData`, a query schema
9
+ * takes its defaults from `WEEKLY_LIST_DEFAULTS`, and a repository answers
10
+ * `WeeklyListPage`.
11
+ *
12
+ * They were in the rune module, which put them behind `./content` — eight
13
+ * components — and, worse, out of reach of `./contract` altogether, because
14
+ * that subpath's guard refuses a rune module by name (they need the
15
+ * compiler, so a server import of one is the defect the guard exists to
16
+ * catch). So the release that gave `pageSize` an owner, to end a restatement
17
+ * in two repositories that cannot import each other, shipped it where
18
+ * neither host's server could import it: fndvit-website's
19
+ * `schemas/weekly.ts` reaches it through `./content` and is itself read by
20
+ * `routes/weeklies/+page.server.ts`.
21
+ *
22
+ * Splitting the file is the whole fix. Nothing moves for a component host —
23
+ * `./content` still exports every name from here — and the four facts a
24
+ * server needs stop being locked behind a graph it must not load.
25
+ */
26
+ /**
27
+ * The weeklies index's URL defaults: the value a param stands for when it is
28
+ * absent. Both halves of the URL contract — `createWeeklyList` omitting a
29
+ * default, the host's query schema supplying one — must name the same values,
30
+ * so a host derives its schema defaults from here rather than restating them.
31
+ *
32
+ * `pageSize` is here for the same reason one step further out. It is not a
33
+ * URL param: it is what a page of this list HOLDS, which the grid this
34
+ * package renders decides. Every host was spelling its own — fndvit-website
35
+ * as `WEEKLIES_PAGE_SIZE`, vit-brain's mirror as a bare `12` in markup — and
36
+ * the two must agree, because the mirror exists to page the same corpus the
37
+ * site pages. Two repositories that cannot import each other were each
38
+ * holding half of one number. `createWeeklyList` still READS the size from
39
+ * `config.server().pageSize`, so a host may still answer something else; this
40
+ * is the value it should answer unless it means to differ.
41
+ */
42
+ export const WEEKLY_LIST_DEFAULTS = { sort: 'desc', page: 1, pageSize: 12 };
@@ -1,45 +1,6 @@
1
1
  import type { Locale } from '../config/types.js';
2
2
  import type { SortDirection, WeeklyCardData } from '../content/types.js';
3
- /**
4
- * The weeklies index's URL defaults: the value a param stands for when it is
5
- * absent. Both halves of the URL contract — this module omitting a default,
6
- * the host's query schema supplying one — must name the same values, so a
7
- * host derives its schema defaults from here rather than restating them.
8
- *
9
- * `pageSize` is here for the same reason one step further out. It is not a
10
- * URL param: it is what a page of this list HOLDS, which the grid this
11
- * package renders decides. Every host was spelling its own — fndvit-website
12
- * as `WEEKLIES_PAGE_SIZE`, vit-brain's mirror as a bare `12` in markup — and
13
- * the two must agree, because the mirror exists to page the same corpus the
14
- * site pages. Two repositories that cannot import each other were each
15
- * holding half of one number. `createWeeklyList` still READS the size from
16
- * `config.server().pageSize`, so a host may still answer something else; this
17
- * is the value it should answer unless it means to differ.
18
- */
19
- export declare const WEEKLY_LIST_DEFAULTS: {
20
- readonly sort: "desc";
21
- readonly page: 1;
22
- readonly pageSize: 12;
23
- };
24
- /** A type alias, not an interface: createUrlFilters needs an index signature. */
25
- export type WeeklyListFilters = {
26
- q: string;
27
- theme: string | null;
28
- sort: SortDirection;
29
- };
30
- /** One page of the list plus the unpaged total (for the pagination). */
31
- export interface WeeklyListPage {
32
- items: WeeklyCardData[];
33
- total: number;
34
- }
35
- /** The server-rendered page, re-read on every navigation. */
36
- export interface WeeklyListServerData {
37
- weeklies: WeeklyCardData[];
38
- total: number;
39
- page: number;
40
- pageSize: number;
41
- query: WeeklyListFilters;
42
- }
3
+ import type { WeeklyListFilters, WeeklyListPage, WeeklyListServerData } from './weekly-list-contract.js';
43
4
  export interface WeeklyListConfig {
44
5
  /** Reads the route's `data`; called inside an effect, so it tracks it. */
45
6
  server: () => WeeklyListServerData;
@@ -1,22 +1,6 @@
1
1
  import { buildQueryString } from './paths.js';
2
2
  import { createUrlFilters } from './url-filters.svelte.js';
3
- /**
4
- * The weeklies index's URL defaults: the value a param stands for when it is
5
- * absent. Both halves of the URL contract — this module omitting a default,
6
- * the host's query schema supplying one — must name the same values, so a
7
- * host derives its schema defaults from here rather than restating them.
8
- *
9
- * `pageSize` is here for the same reason one step further out. It is not a
10
- * URL param: it is what a page of this list HOLDS, which the grid this
11
- * package renders decides. Every host was spelling its own — fndvit-website
12
- * as `WEEKLIES_PAGE_SIZE`, vit-brain's mirror as a bare `12` in markup — and
13
- * the two must agree, because the mirror exists to page the same corpus the
14
- * site pages. Two repositories that cannot import each other were each
15
- * holding half of one number. `createWeeklyList` still READS the size from
16
- * `config.server().pageSize`, so a host may still answer something else; this
17
- * is the value it should answer unless it means to differ.
18
- */
19
- export const WEEKLY_LIST_DEFAULTS = { sort: 'desc', page: 1, pageSize: 12 };
3
+ import { WEEKLY_LIST_DEFAULTS } from './weekly-list-contract.js';
20
4
  /** The index's path, shared by the mirrored URL and the paging hrefs. */
21
5
  const WEEKLIES_PATH = '/weeklies';
22
6
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vit-foundation/ui",
3
- "version": "0.20.1",
3
+ "version": "0.22.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
@@ -1,2 +0,0 @@
1
- export { default as JobList } from './JobList.svelte';
2
- export type { JobEditMap } from './JobList.svelte';
@@ -1 +0,0 @@
1
- export { default as JobList } from './JobList.svelte';
@@ -1,3 +0,0 @@
1
- export { default as Footer } from './Footer.svelte';
2
- export { default as Nav } from './Nav.svelte';
3
- export { default as PageShell } from './PageShell.svelte';
@@ -1,3 +0,0 @@
1
- export { default as Footer } from './Footer.svelte';
2
- export { default as Nav } from './Nav.svelte';
3
- export { default as PageShell } from './PageShell.svelte';
@@ -1,2 +0,0 @@
1
- export { default as ProjectCard } from './ProjectCard.svelte';
2
- export type { ProjectEditMap } from './ProjectCard.svelte';
@@ -1 +0,0 @@
1
- export { default as ProjectCard } from './ProjectCard.svelte';
@@ -1,3 +0,0 @@
1
- export { default as CollaboratorList } from './CollaboratorList.svelte';
2
- export { default as TeamMemberCard } from './TeamMemberCard.svelte';
3
- export type { TeamMemberEditMap } from './TeamMemberCard.svelte';
@@ -1,2 +0,0 @@
1
- export { default as CollaboratorList } from './CollaboratorList.svelte';
2
- export { default as TeamMemberCard } from './TeamMemberCard.svelte';
@@ -1,3 +0,0 @@
1
- export { default as Timeline } from './Timeline.svelte';
2
- export { default as TimelineMilestone } from './TimelineMilestone.svelte';
3
- export type { MilestoneEditMap } from './TimelineMilestone.svelte';
@@ -1,2 +0,0 @@
1
- export { default as Timeline } from './Timeline.svelte';
2
- export { default as TimelineMilestone } from './TimelineMilestone.svelte';
@@ -1,20 +0,0 @@
1
- export { default as Button } from './Button.svelte';
2
- export { default as CardMedia } from './CardMedia.svelte';
3
- export { default as CardTitle } from './CardTitle.svelte';
4
- export { default as CopyIntro } from './CopyIntro.svelte';
5
- export { default as DateText } from './DateText.svelte';
6
- export { default as DecorShapes } from './DecorShapes.svelte';
7
- export { default as Field } from './Field.svelte';
8
- export { default as FilterChips } from './FilterChips.svelte';
9
- export { default as FormErrorFeedback } from './FormErrorFeedback.svelte';
10
- export { default as FormFeedback } from './FormFeedback.svelte';
11
- export { default as FormResultSlot } from './FormResultSlot.svelte';
12
- export { default as GhostButton } from './GhostButton.svelte';
13
- export { default as Honeypot } from './Honeypot.svelte';
14
- export { default as Link } from './Link.svelte';
15
- export { default as LocaleField } from './LocaleField.svelte';
16
- export { default as NewsletterIntentField } from './NewsletterIntentField.svelte';
17
- export { default as Pagination } from './Pagination.svelte';
18
- export { default as RichText } from './RichText.svelte';
19
- export { default as SearchInput } from './SearchInput.svelte';
20
- export { default as ShareRow } from './ShareRow.svelte';
@@ -1,20 +0,0 @@
1
- export { default as Button } from './Button.svelte';
2
- export { default as CardMedia } from './CardMedia.svelte';
3
- export { default as CardTitle } from './CardTitle.svelte';
4
- export { default as CopyIntro } from './CopyIntro.svelte';
5
- export { default as DateText } from './DateText.svelte';
6
- export { default as DecorShapes } from './DecorShapes.svelte';
7
- export { default as Field } from './Field.svelte';
8
- export { default as FilterChips } from './FilterChips.svelte';
9
- export { default as FormErrorFeedback } from './FormErrorFeedback.svelte';
10
- export { default as FormFeedback } from './FormFeedback.svelte';
11
- export { default as FormResultSlot } from './FormResultSlot.svelte';
12
- export { default as GhostButton } from './GhostButton.svelte';
13
- export { default as Honeypot } from './Honeypot.svelte';
14
- export { default as Link } from './Link.svelte';
15
- export { default as LocaleField } from './LocaleField.svelte';
16
- export { default as NewsletterIntentField } from './NewsletterIntentField.svelte';
17
- export { default as Pagination } from './Pagination.svelte';
18
- export { default as RichText } from './RichText.svelte';
19
- export { default as SearchInput } from './SearchInput.svelte';
20
- export { default as ShareRow } from './ShareRow.svelte';
@@ -1,7 +0,0 @@
1
- export { default as CommentSection } from './CommentSection.svelte';
2
- export type { CommentFormInstance } from './CommentSection.svelte';
3
- export { default as ReactionBar } from './ReactionBar.svelte';
4
- export type { CommentReactionChip, ReactionBarForms, WeeklyReactionChip } from './ReactionBar.svelte';
5
- export { default as SortSelect } from './SortSelect.svelte';
6
- export { default as WeeklieCard } from './WeeklieCard.svelte';
7
- export type { WeeklyEditMap } from './WeeklieCard.svelte';
@@ -1,4 +0,0 @@
1
- export { default as CommentSection } from './CommentSection.svelte';
2
- export { default as ReactionBar } from './ReactionBar.svelte';
3
- export { default as SortSelect } from './SortSelect.svelte';
4
- export { default as WeeklieCard } from './WeeklieCard.svelte';