@vit-foundation/ui 0.19.0 → 0.20.1

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 CHANGED
@@ -31,6 +31,7 @@ Everything exports flat from the root, and again grouped by role:
31
31
  | [`/community`](./docs/components/community.md) | AuthPageShell, LoginForm, SignupForm, GoogleAuthForm, AccountPanel, NewsletterSignup, CommentSection, ReactionBar, ContactForm |
32
32
  | [`/edit`](./docs/edit-mode.md) | Editable, setEditAdapter/getEditAdapter, descriptors and helpers, collectionEditing, LocalizedText |
33
33
  | [`/config`](./docs/getting-started.md#wiring-an-app-uiprovider) | UiProvider, UiConfig, the locale set, the default Catalan messages |
34
+ | `/contract` | The component-free half: LOCALES, BASE_LOCALE, localize, REACTIONS and the edit-descriptor types — the one subpath a host may import from SERVER code |
34
35
  | `/testing` | createRemoteFormMock — the remote-form stand-in for stories and tests |
35
36
 
36
37
  Every component renders standalone (Catalan copy, identity hrefs); an app
@@ -83,5 +84,8 @@ diffable against history. The public structure is the semantic entry points
83
84
  above, assembled in `src/lib/{primitives,chrome,content-components,community}.ts`
84
85
  and `src/lib/forms/index.ts`.
85
86
 
86
- Releases: bump with `npm version`, push the `v*` tag, and the release
87
- workflow publishes to npm (requires the `NPM_TOKEN` secret).
87
+ Releases are MANUAL: bump with `npm version`, then `npm publish`. The
88
+ workflow this paragraph used to describe fired on every `v*` tag, had no
89
+ `NPM_TOKEN` and no lint, check or test step, so it failed every time and was
90
+ deleted; `prepublishOnly` (lint, check, unit tests) is the only publish gate
91
+ now. Push the tag by all means — nothing reads it.
@@ -9,7 +9,14 @@ import type { EditMessages } from './edit-messages.js';
9
9
  */
10
10
  export declare const LOCALES: readonly ["ca", "en", "es"];
11
11
  export type Locale = (typeof LOCALES)[number];
12
- export declare const BASE_LOCALE: Locale;
12
+ /**
13
+ * Declared as the LITERAL, not widened to `Locale`. `Exclude<Locale, typeof
14
+ * BASE_LOCALE>` is how a host names "the locales that are not canonical" —
15
+ * the set a translations editor fills from the canonical one — and the
16
+ * annotation threw that away, resolving it to `never`. A consumer that wants
17
+ * the wide type can still write `const l: Locale = BASE_LOCALE`.
18
+ */
19
+ export declare const BASE_LOCALE = "ca";
13
20
  /** One primary-navigation entry, rendered by Nav and repeated by Footer. */
14
21
  export interface SiteLink {
15
22
  /** Present only where the nav is editable — structural ops need identity. */
@@ -6,4 +6,11 @@
6
6
  * consumer option.
7
7
  */
8
8
  export const LOCALES = ['ca', 'en', 'es'];
9
+ /**
10
+ * Declared as the LITERAL, not widened to `Locale`. `Exclude<Locale, typeof
11
+ * BASE_LOCALE>` is how a host names "the locales that are not canonical" —
12
+ * the set a translations editor fills from the canonical one — and the
13
+ * annotation threw that away, resolving it to `never`. A consumer that wants
14
+ * the wide type can still write `const l: Locale = BASE_LOCALE`.
15
+ */
9
16
  export const BASE_LOCALE = 'ca';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The contract, without the components: the vocabularies and the one reading
3
+ * rule a host needs on the SERVER, where a `.svelte` import cannot go.
4
+ *
5
+ * Every other subpath mixes the two. `./edit` exports `localize` beside
6
+ * `Editable.svelte`; `./config` exports `LOCALES` and `BASE_LOCALE` beside
7
+ * `UiProvider.svelte`; `./content` exports `REACTIONS` beside the cards. A
8
+ * host whose server code wants those VALUES has to import the barrel that
9
+ * drags a component graph into a server bundle, so vit-brain imported the
10
+ * types only and restated the values: `WEBSITE_LOCALES`, `CANONICAL_LOCALE`,
11
+ * its own `REACTIONS`, and a `hasLocalizedText` re-derived from `localize`'s
12
+ * body — four facts this package owns, one of them (the canonical locale)
13
+ * with no binding at all.
14
+ *
15
+ * So this subpath is the seam that restatement was standing in for. It is
16
+ * component-free BY TEST (`contract.test.ts` walks its import graph), which
17
+ * is what makes it a promise rather than a description: adding a `.svelte`
18
+ * anywhere beneath it fails here rather than in a consumer's server build.
19
+ *
20
+ * It adds nothing. Every name below is already exported from a semantic
21
+ * subpath and stays there — this is a second door into the same rooms, not a
22
+ * new floor, and the barrel remains the surface a component host reads.
23
+ */
24
+ export { LOCALES, BASE_LOCALE } from './config/types.js';
25
+ export type { Locale, NotParameterized, ParameterizedKey, ParameterlessKey, SiteLink, UiMessages } from './config/types.js';
26
+ export { localize } from './edit/types.js';
27
+ export type { CollectionRef, ContentRef, EditableEntity, EditDescriptor, EntityOp, LocalizedText, PropertyDescriptor, PropertyOption, PropertyType, PropertyValue } from './edit/types.js';
28
+ export { REACTIONS } from './content/types.js';
29
+ export type { Reaction, ReactionSummary, SortDirection } from './content/types.js';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The contract, without the components: the vocabularies and the one reading
3
+ * rule a host needs on the SERVER, where a `.svelte` import cannot go.
4
+ *
5
+ * Every other subpath mixes the two. `./edit` exports `localize` beside
6
+ * `Editable.svelte`; `./config` exports `LOCALES` and `BASE_LOCALE` beside
7
+ * `UiProvider.svelte`; `./content` exports `REACTIONS` beside the cards. A
8
+ * host whose server code wants those VALUES has to import the barrel that
9
+ * drags a component graph into a server bundle, so vit-brain imported the
10
+ * types only and restated the values: `WEBSITE_LOCALES`, `CANONICAL_LOCALE`,
11
+ * its own `REACTIONS`, and a `hasLocalizedText` re-derived from `localize`'s
12
+ * body — four facts this package owns, one of them (the canonical locale)
13
+ * with no binding at all.
14
+ *
15
+ * So this subpath is the seam that restatement was standing in for. It is
16
+ * component-free BY TEST (`contract.test.ts` walks its import graph), which
17
+ * is what makes it a promise rather than a description: adding a `.svelte`
18
+ * anywhere beneath it fails here rather than in a consumer's server build.
19
+ *
20
+ * It adds nothing. Every name below is already exported from a semantic
21
+ * subpath and stays there — this is a second door into the same rooms, not a
22
+ * new floor, and the barrel remains the surface a component host reads.
23
+ */
24
+ export { LOCALES, BASE_LOCALE } from './config/types.js';
25
+ export { localize } from './edit/types.js';
26
+ export { REACTIONS } from './content/types.js';
@@ -5,10 +5,21 @@ import type { SortDirection, WeeklyCardData } from '../content/types.js';
5
5
  * absent. Both halves of the URL contract — this module omitting a default,
6
6
  * the host's query schema supplying one — must name the same values, so a
7
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.
8
18
  */
9
19
  export declare const WEEKLY_LIST_DEFAULTS: {
10
20
  readonly sort: "desc";
11
21
  readonly page: 1;
22
+ readonly pageSize: 12;
12
23
  };
13
24
  /** A type alias, not an interface: createUrlFilters needs an index signature. */
14
25
  export type WeeklyListFilters = {
@@ -5,8 +5,18 @@ import { createUrlFilters } from './url-filters.svelte.js';
5
5
  * absent. Both halves of the URL contract — this module omitting a default,
6
6
  * the host's query schema supplying one — must name the same values, so a
7
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.
8
18
  */
9
- export const WEEKLY_LIST_DEFAULTS = { sort: 'desc', page: 1 };
19
+ export const WEEKLY_LIST_DEFAULTS = { sort: 'desc', page: 1, pageSize: 12 };
10
20
  /** The index's path, shared by the mirrored URL and the paging hrefs. */
11
21
  const WEEKLIES_PATH = '/weeklies';
12
22
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vit-foundation/ui",
3
- "version": "0.19.0",
3
+ "version": "0.20.1",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
@@ -69,6 +69,11 @@
69
69
  "svelte": "./dist/edit/index.js",
70
70
  "default": "./dist/edit/index.js"
71
71
  },
72
+ "./contract": {
73
+ "types": "./dist/contract.d.ts",
74
+ "svelte": "./dist/contract.js",
75
+ "default": "./dist/contract.js"
76
+ },
72
77
  "./config": {
73
78
  "types": "./dist/config/index.d.ts",
74
79
  "svelte": "./dist/config/index.js",