@bygghammar/cms-platform 0.90.0-m7.4 → 0.90.0-m7.5

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/CHANGELOG.md CHANGED
@@ -8,6 +8,19 @@ matches `package.json` exactly. See
8
8
  Versions 0.1.0 through 0.78.0 predate this repository and were reconstructed
9
9
  from the published npm tarballs.
10
10
 
11
+ ## 0.90.0-m7.5
12
+
13
+ - `BackofficeHost.pages.fns.listPages` is declared. It was what
14
+ `cmsPageDirectory` had always looked for, read through an index cast because
15
+ the contract did not name it — so a site could not register it without a type
16
+ error, and every site that had not silently got a picker with nothing in it.
17
+ The top-level lookup stays for anyone who registered it there anyway.
18
+
19
+ - Requires `@bygghammar/lightweight-popup@>=0.2.0-m7.5`. In `m7.4` an advanced
20
+ path rule could not be typed: the row was reclassified after the first
21
+ keystroke and disappeared. No change here beyond the floor — a site pairing
22
+ this with `m7.4` would get a picker whose rules field does not work.
23
+
11
24
  ## 0.90.0-m7.4
12
25
 
13
26
  - `cmsPageDirectory` takes the site's routing engine and asks it for each
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bygghammar/cms-platform",
3
- "version": "0.90.0-m7.4",
3
+ "version": "0.90.0-m7.5",
4
4
  "description": "Shared CMS platform: blocks, block types, i18n core, UI primitives and design-token contract used by every Bygghammar/Voyara site.",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -263,7 +263,7 @@
263
263
  "@dnd-kit/sortable": ">=3",
264
264
  "@dnd-kit/utilities": ">=3",
265
265
  "zod": ">=3",
266
- "@bygghammar/lightweight-popup": ">=0.2.0-m7.4"
266
+ "@bygghammar/lightweight-popup": ">=0.2.0-m7.5"
267
267
  },
268
268
  "peerDependenciesMeta": {
269
269
  "@supabase/supabase-js": {
@@ -328,7 +328,7 @@
328
328
  "check": "bun run typecheck && bun run test && bun run verify:pack"
329
329
  },
330
330
  "devDependencies": {
331
- "@bygghammar/lightweight-popup": "file:./vendor/bygghammar-lightweight-popup-0.2.0-m7.4.tgz",
331
+ "@bygghammar/lightweight-popup": "file:./vendor/bygghammar-lightweight-popup-0.2.0-m7.5.tgz",
332
332
  "@dnd-kit/core": "^6.3.1",
333
333
  "@dnd-kit/sortable": "^10.0.0",
334
334
  "@dnd-kit/utilities": "^3.2.2",
@@ -208,6 +208,15 @@ export type BackofficeHost = {
208
208
  listPagePublications: HostServerFn;
209
209
  cancelPagePublication: HostServerFn;
210
210
  renamePage: HostServerFn;
211
+ /**
212
+ * The site's pages, listed.
213
+ *
214
+ * Optional because the builder screens do not need it — they open one
215
+ * page by key. What needs it is anything offering a choice of pages,
216
+ * and the popup page picker is the first: without this the picker has
217
+ * nothing to show and falls back to typing addresses, silently.
218
+ */
219
+ listPages?: HostServerFn;
211
220
  };
212
221
  /** Human labels for the locale switch, keyed by locale. */
213
222
  localeLabels?: Record<string, string>;
@@ -160,14 +160,13 @@ export function cmsPageDirectory(
160
160
  ): PageDirectoryPort {
161
161
  return {
162
162
  listPages: async (): Promise<readonly HostPage[]> => {
163
- // Read through an index rather than a named property: the host contract
164
- // is a closed type that does not currently declare a page listing, and a
165
- // site is free to supply one. A host without it simply has no picker.
166
- const host = backofficeHost() as unknown as {
167
- pages?: { fns?: Record<string, unknown> };
168
- fns: Record<string, unknown>;
169
- };
170
- const listPages = host.pages?.fns?.["listPages"] ?? host.fns["listPages"];
163
+ // `pages.fns.listPages` is the declared home for this. The top-level
164
+ // lookup stays for a site that registered it there before the contract
165
+ // named it, and a host with neither simply has no picker.
166
+ const host = backofficeHost();
167
+ const listPages =
168
+ host.pages?.fns.listPages ??
169
+ (host.fns as unknown as Record<string, unknown>)["listPages"];
171
170
  if (typeof listPages !== "function") return [];
172
171
  const rows = asRecords(await (listPages as () => Promise<unknown>)());
173
172
  return rows.flatMap((row) => {