@morphemecms/cms 0.9.0 → 0.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @morphemecms/cms
2
2
 
3
+ ## 0.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2e5bc1d: Sites type-check again: the header settings screen passes its theme the right data.
8
+
3
9
  ## 0.9.0
4
10
 
5
11
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morphemecms/cms",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Morpheme CMS: the editor for a site built with Astro, its screens, its blocks and the rules a site gives it. See README.md.",
5
5
  "license": "MIT",
6
6
  "author": "Lars Adolfsen",
@@ -2,7 +2,7 @@
2
2
  // (SettingsSections.tsx): a preview of the header as the form has it, on a phone and a computer (partPreview.tsx), over the
3
3
  // sections Main menu (menu.json), Mobile menu (mobile-menu.json), Action button and Menu button (header.json). "Gem
4
4
  // ændringer" saves each changed file in its own commit (useDataFiles.ts). Exposes HeaderSettings (default). Uses
5
- // DataFileFields.tsx, fields.tsx, headerPreview.mjs and headerTheme.tsx.
5
+ // DataFileFields.tsx, fields.tsx, blocks.ts (BlockData), headerPreview.mjs and headerTheme.tsx.
6
6
  import { useMemo, type ReactNode } from 'react';
7
7
  import FormFrame from './FormFrame';
8
8
  import { FieldList, Fields, ObjectFields, WrongField, type FieldContext } from './fields';
@@ -10,6 +10,7 @@ import { DataFileFields } from './DataFileFields';
10
10
  import { useDataFiles, type DataFilePart } from './useDataFiles';
11
11
  import { SettingsSections, useSettingsSections, type SettingsSection } from './SettingsSections';
12
12
  import { PartPreview } from './partPreview';
13
+ import type { BlockData } from './blocks';
13
14
  import { headerDraft, swapHeader } from './headerPreview.mjs';
14
15
  import { headerThemeOf } from './headerTheme';
15
16
  import { collections } from './site';
@@ -60,11 +61,13 @@ export default function HeaderSettings({ env }: { env: Env }) {
60
61
  layout.steer(id);
61
62
  });
62
63
  const context: FieldContext = { relations: env.relations, lists: env.lists, testimonials: env.testimonials, site: env.site };
64
+ // What the theme draws the header's button from (headerThemeOf): the same site data, as the block cards have it.
65
+ const data: BlockData = { lists: env.lists, testimonials: env.testimonials, relations: env.relations, site: env.site };
63
66
 
64
67
  // What the form changes, put into a copy of the site's front page each time it changes.
65
68
  const swap = useMemo(() => {
66
69
  const draft = headerDraft(shapeOf(form.initial), shapeOf(form.values));
67
- return (doc: Document) => swapHeader(doc, draft, headerThemeOf(draft.button, context));
70
+ return (doc: Document) => swapHeader(doc, draft, headerThemeOf(draft.button, data));
68
71
  }, [form.initial, form.values]);
69
72
 
70
73
  const fieldsOf = ({ file, field }: Place): ReactNode => {
@@ -32,7 +32,7 @@
32
32
  "@material-symbols/svg-400": "0.48.2",
33
33
  "@material/material-color-utilities": "^0.3.0",
34
34
  "@milkdown/kit": "^7.22.3",
35
- "@morphemecms/cms": "0.9.0",
35
+ "@morphemecms/cms": "0.9.1",
36
36
  "@phosphor-icons/core": "^2.1.1",
37
37
  "@phosphor-icons/react": "^2.1.10",
38
38
  "@tailwindcss/typography": "^0.5.20",