@morphemecms/cms 0.13.0 → 0.14.0-next-20261107093528

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 (166) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/defaults/editor.ts +3 -14
  3. package/icons/lucide/dots-three-vertical.svg +1 -0
  4. package/icons/material-symbols/dots-three-vertical.svg +1 -0
  5. package/icons/phosphor/dots-three-vertical.svg +1 -0
  6. package/lib/appChanges.d.mts +16 -0
  7. package/lib/appChanges.mjs +20 -0
  8. package/lib/appChanges.test.mjs +30 -0
  9. package/lib/apps.d.mts +2 -2
  10. package/lib/apps.mjs +13 -7
  11. package/lib/appsFile.d.mts +20 -0
  12. package/lib/appsFile.mjs +57 -0
  13. package/lib/appsFile.test.mjs +53 -0
  14. package/lib/build-settings.mjs +1 -1
  15. package/lib/changelog.d.mts +7 -0
  16. package/lib/changelog.mjs +16 -5
  17. package/lib/footerClearance.d.mts +1 -0
  18. package/lib/footerClearance.mjs +9 -0
  19. package/lib/footerClearance.test.mjs +24 -0
  20. package/lib/footerLinks.d.mts +12 -0
  21. package/lib/footerLinks.mjs +26 -0
  22. package/lib/footerLinks.test.mjs +32 -0
  23. package/lib/google-result.test.mjs +40 -9
  24. package/lib/menu.mjs +1 -1
  25. package/lib/menu.test.mjs +9 -8
  26. package/lib/releaseNotes.d.mts +136 -0
  27. package/lib/releaseNotes.mjs +249 -0
  28. package/lib/releaseNotes.test.mjs +267 -0
  29. package/lib/serviceFeed.d.mts +2 -0
  30. package/lib/serviceFeed.mjs +13 -0
  31. package/lib/serviceFeed.test.mjs +53 -0
  32. package/lib/serviceStatus.d.mts +72 -0
  33. package/lib/serviceStatus.mjs +143 -0
  34. package/lib/serviceStatus.test.mjs +136 -0
  35. package/lib/strayDividers.d.mts +6 -0
  36. package/lib/strayDividers.mjs +15 -0
  37. package/lib/strayDividers.test.mjs +25 -0
  38. package/package.json +5 -3
  39. package/release-notes/i18n/da-DK/pending/apps-turn-off.json +6 -0
  40. package/release-notes/i18n/da-DK/pending/apps-turn-off.webp +0 -0
  41. package/release-notes/i18n/da-DK/pending/developer-menu.json +5 -0
  42. package/release-notes/i18n/da-DK/pending/dynamic-lists-page.json +5 -0
  43. package/release-notes/i18n/da-DK/pending/editor-footer.json +6 -0
  44. package/release-notes/i18n/da-DK/pending/editor-footer.webp +0 -0
  45. package/release-notes/i18n/da-DK/pending/editor-toolbar-dock.json +5 -0
  46. package/release-notes/i18n/da-DK/pending/google-preview-closer.json +6 -0
  47. package/release-notes/i18n/da-DK/pending/google-preview-closer.webp +0 -0
  48. package/release-notes/i18n/da-DK/pending/morpheme-connection-page.json +5 -0
  49. package/release-notes/i18n/da-DK/pending/quiet-lamps-wander.json +6 -0
  50. package/release-notes/i18n/da-DK/pending/quiet-lamps-wander.webp +0 -0
  51. package/release-notes/i18n/en-US/pending/apps-turn-off.json +6 -0
  52. package/release-notes/i18n/en-US/pending/apps-turn-off.webp +0 -0
  53. package/release-notes/i18n/en-US/pending/developer-menu.json +5 -0
  54. package/release-notes/i18n/en-US/pending/dynamic-lists-page.json +5 -0
  55. package/release-notes/i18n/en-US/pending/editor-footer.json +6 -0
  56. package/release-notes/i18n/en-US/pending/editor-footer.webp +0 -0
  57. package/release-notes/i18n/en-US/pending/editor-toolbar-dock.json +5 -0
  58. package/release-notes/i18n/en-US/pending/google-preview-closer.json +6 -0
  59. package/release-notes/i18n/en-US/pending/google-preview-closer.webp +0 -0
  60. package/release-notes/i18n/en-US/pending/morpheme-connection-page.json +5 -0
  61. package/release-notes/i18n/en-US/pending/quiet-lamps-wander.json +6 -0
  62. package/release-notes/i18n/en-US/pending/quiet-lamps-wander.webp +0 -0
  63. package/scripts/app-screenshots.mjs +4 -4
  64. package/scripts/build-settings-problems.mjs +1 -1
  65. package/scripts/built-site.mjs +1 -1
  66. package/scripts/check-content.mjs +1 -1
  67. package/scripts/check-release-notes.mjs +12 -0
  68. package/scripts/check-worker.mjs +1 -1
  69. package/scripts/editor-screens.mjs +32 -16
  70. package/scripts/release-notes-pending.mjs +46 -0
  71. package/scripts/release-notes.mjs +39 -0
  72. package/site/apps.ts +10 -4
  73. package/site/consent.ts +3 -3
  74. package/site/defineSite.mjs +1 -1
  75. package/site/icons.d.mts +4 -0
  76. package/site/icons.mjs +2 -0
  77. package/site/pageColors.ts +3 -3
  78. package/site/siteCsp.d.mts +1 -1
  79. package/site/siteCsp.mjs +3 -2
  80. package/src/ActionParts.tsx +1 -1
  81. package/src/Advanced.tsx +4 -4
  82. package/src/App.tsx +22 -17
  83. package/src/AppEnabledSwitch.tsx +21 -0
  84. package/src/AppList.tsx +47 -19
  85. package/src/AppSettingsTab.tsx +9 -5
  86. package/src/BlockParts.tsx +7 -7
  87. package/src/BlockSettings.tsx +3 -3
  88. package/src/CmsPage.tsx +11 -10
  89. package/src/Colors.tsx +2 -2
  90. package/src/CommunicationParts.tsx +18 -2
  91. package/src/ContainmentParts.tsx +1 -1
  92. package/src/DataForm.tsx +1 -0
  93. package/src/EditorFooter.tsx +19 -9
  94. package/src/EntryForm.tsx +1 -0
  95. package/src/FooterCopyright.tsx +7 -0
  96. package/src/FooterDivider.tsx +5 -0
  97. package/src/FooterLink.tsx +18 -0
  98. package/src/FooterLinks.tsx +34 -0
  99. package/src/Library.tsx +21 -10
  100. package/src/MainDrawerParts.tsx +1 -1
  101. package/src/MarkdownEditor.tsx +1 -1
  102. package/src/ModalSheetSample.tsx +1 -1
  103. package/src/MorphemeConnection.tsx +30 -0
  104. package/src/MorphemeLogo.tsx +9 -0
  105. package/src/NavigationParts.tsx +1 -1
  106. package/src/NavigationRestParts.tsx +1 -1
  107. package/src/Parts.tsx +9 -9
  108. package/src/PartsShown.tsx +1 -1
  109. package/src/PickerParts.tsx +1 -1
  110. package/src/ReleaseNoteCard.tsx +17 -0
  111. package/src/ReleaseNotes.tsx +52 -0
  112. package/src/Screen.tsx +21 -12
  113. package/src/SearchPreview.tsx +37 -14
  114. package/src/SelectionParts.tsx +1 -1
  115. package/src/ServiceStatus.tsx +59 -0
  116. package/src/SideColumn.tsx +2 -2
  117. package/src/StoreConnectNotice.tsx +1 -1
  118. package/src/StoreConnectedRow.tsx +20 -14
  119. package/src/StoreStatus.tsx +2 -10
  120. package/src/ThemeStoreScreen.tsx +1 -2
  121. package/src/Tokens.tsx +2 -2
  122. package/src/apps.ts +16 -14
  123. package/src/buildSettings.ts +1 -1
  124. package/src/cmsView.d.mts +1 -0
  125. package/src/cmsView.mjs +4 -2
  126. package/src/cmsView.test.mjs +6 -0
  127. package/src/editor.css +13 -2
  128. package/src/examples.ts +2 -2
  129. package/src/fabPresence.tsx +24 -0
  130. package/src/googleResult.d.mts +12 -1
  131. package/src/googleResult.mjs +19 -2
  132. package/src/i18n/da-DK/apps.ts +5 -1
  133. package/src/i18n/da-DK/cms.ts +3 -0
  134. package/src/i18n/da-DK/common.ts +3 -2
  135. package/src/i18n/da-DK/footer.ts +26 -0
  136. package/src/i18n/da-DK/index.ts +2 -0
  137. package/src/i18n/da-DK/parts.ts +5 -0
  138. package/src/i18n/en-US/advanced.ts +1 -1
  139. package/src/i18n/en-US/apps.ts +6 -1
  140. package/src/i18n/en-US/cms.ts +5 -2
  141. package/src/i18n/en-US/common.ts +6 -4
  142. package/src/i18n/en-US/footer.ts +24 -0
  143. package/src/i18n/en-US/index.ts +2 -0
  144. package/src/i18n/en-US/parts.ts +8 -3
  145. package/src/menuChildren.ts +6 -14
  146. package/src/movedRoutes.mjs +12 -8
  147. package/src/movedRoutes.test.mjs +13 -10
  148. package/src/r2Caching.ts +1 -1
  149. package/src/registry.tsx +2 -2
  150. package/src/schema.ts +1 -1
  151. package/src/site.ts +2 -2
  152. package/src/statusReport.ts +24 -0
  153. package/src/store.ts +4 -8
  154. package/src/themeUi.ts +7 -7
  155. package/src/ui.tsx +4 -2
  156. package/src/useFooterClearance.ts +30 -0
  157. package/src/useStrayDividers.ts +24 -0
  158. package/theme/components/AppSlot.astro +4 -4
  159. package/theme/styles/global.css +10 -0
  160. package/theme/styles/ui.css +13 -0
  161. package/theme/ui/Badge.tsx +9 -3
  162. package/worker/cms-update.js +49 -12
  163. package/worker/index.js +10 -4
  164. package/worker/plan-status.js +1 -1
  165. package/worker/r2-status.js +1 -1
  166. package/worker/service-status.js +18 -0
@@ -1,5 +1,5 @@
1
- // "Dele" › "UI-komponenter" (#appearance/parts/ui), "Dele" › "Blokke" (#appearance/parts/blocks) and "Dele" › a list of kinds
2
- // ("Promovering", #appearance/parts/list/<id>): how the site looks, every part in every version, to see and agree on it.
1
+ // "Parts" › "UI-komponenter" (#developer/parts/ui), "Parts" › "Blokke" (#developer/parts/blocks) and "Parts" › a list of kinds
2
+ // ("Promovering", #developer/parts/list/<id>): how the site looks, every part in every version, to see and agree on it.
3
3
  // "UI-komponenter" also has the active theme's coverage (summary, mark on each part, filter by style) and the site frame's parts.
4
4
  // "UI-komponenter" has the theme's UI components (its buttons and icon buttons, text fields and checkboxes …,
5
5
  // packages/editor/theme/ui/, through @site/editor) in every kind, size and state; "Blokke" every block, the standard
@@ -52,7 +52,7 @@ import { t } from './i18n';
52
52
  import { Svg } from './icon';
53
53
 
54
54
  const { screens } = t.parts;
55
- const back = { href: '#appearance/parts', label: t.common.parts.editorParts };
55
+ const back = { href: '#developer/parts', label: t.common.parts.editorParts };
56
56
 
57
57
  // The fields filled in with the plain picture where they have none (a card's, a list's items').
58
58
  function pictured(fields: Field[], props: BlockProps): BlockProps {
@@ -520,7 +520,7 @@ function CardParts() {
520
520
  );
521
521
  }
522
522
 
523
- /** "Dele" › "UI-komponenter" (#appearance/parts/ui): the theme's UI components in every kind, size and state. */
523
+ /** "Parts" › "UI-komponenter" (#developer/parts/ui): the theme's UI components in every kind, size and state. */
524
524
  export function ComponentParts() {
525
525
  const groups = [
526
526
  { id: 'ui', title: screens.ui },
@@ -587,7 +587,7 @@ export function ComponentParts() {
587
587
  );
588
588
  }
589
589
 
590
- /** "Dele" › "Blokke" (#appearance/parts/blocks): every block, the standard ones and then the apps', each a group of its
590
+ /** "Parts" › "Blokke" (#developer/parts/blocks): every block, the standard ones and then the apps', each a group of its
591
591
  * own, in all its versions. */
592
592
  export function BlocksParts() {
593
593
  const data = useMemo(exampleData, []);
@@ -613,10 +613,10 @@ export function BlocksParts() {
613
613
  );
614
614
  }
615
615
 
616
- /** The lists of kinds ("Promovering"), each a screen of "Dele". */
616
+ /** The lists of kinds ("Promovering"), each a screen of "Parts". */
617
617
  export const kindLists = () => collections.filter((c): c is FolderCollection => c.kind === 'folder' && !!c.kinds && !!c.fields?.length);
618
618
 
619
- /** "Dele" › a list of kinds ("Promovering", #appearance/parts/list/<id>): each of its kinds as the site draws it, its own
619
+ /** "Parts" › a list of kinds ("Promovering", #developer/parts/list/<id>): each of its kinds as the site draws it, its own
620
620
  * (FolderCollection.draws: the pop-up, the bars) and the apps' (AppKind: Mailchimp's signup, once for each of its
621
621
  * states), each a group of its own, as a new one of the kind with the made-up texts (kindExample). */
622
622
  export function KindParts({ id }: { id: string }) {
@@ -44,7 +44,7 @@ import { byText } from './schema';
44
44
  import { exampleOf, type BlockData, type BlockProps, type SiteBlock } from './blocks';
45
45
  import { blocksIn } from '../lib/blocks.mjs';
46
46
  import { apps, offBlocks, preview, siteBlocks } from './registry';
47
- import { installedApps, kindDraw, kindKey, type SiteApp } from './apps';
47
+ import { activeApps, kindDraw, kindKey, type SiteApp } from './apps';
48
48
  import { entriesOf, kindsOf } from './AppList';
49
49
  import { asWritten, collections } from './site';
50
50
  import { examplePicture, kindExample as newOfKind } from './examples';
@@ -92,7 +92,7 @@ function example(
92
92
  }
93
93
 
94
94
  /** An app's kind of a list for its preview: drawn with the fields of its first entry (one that is on, if any), with
95
- * the entry's name, else with the example "Dele" draws it with (kindExample in examples.ts); in its first state
95
+ * the entry's name, else with the example "Parts" draws it with (kindExample in examples.ts); in its first state
96
96
  * (Mailchimp's before a signup). None when it has no drawing. */
97
97
  function kindExample(app: SiteApp, list: string, files: RepoFile[], data: BlockData): { node: ReactNode; on?: string } | null {
98
98
  const kind = app.kinds![list];
@@ -299,7 +299,7 @@ export default function BlockSettings({ env, files }: { env: Env; files: RepoFil
299
299
  />
300
300
  ),
301
301
  });
302
- const installed = installedApps(files);
302
+ const installed = activeApps(files);
303
303
  // A group for each installed app, under its name, in alphabetical order: its blocks and its kinds.
304
304
  const fromApps = apps
305
305
  .filter((a) => installed.includes(a.id))
package/src/CmsPage.tsx CHANGED
@@ -1,8 +1,12 @@
1
- // "Morpheme" (#morpheme), under "Indstillinger": the CMS version the site runs, a newer one with its notes, why it is
2
- // not taken by itself, and an update's progress. Exposes CMS_ROUTE and the page. Depends on cmsView.mjs and the Worker's /api/cms.
1
+ // "Morpheme" (#morpheme), under "Indstillinger": the CMS version the site runs, the notes of the update just installed,
2
+ // a newer one with its notes, why it is not taken by itself, and an update's progress, and the site's connection to the
3
+ // Morpheme store (MorphemeConnection) as its last group. Exposes CMS_ROUTE and the page. Depends on cmsView.mjs,
4
+ // ReleaseNotes (the notes as cards), MorphemeConnection and the Worker's /api/cms.
3
5
  import { useCallback, useEffect, useState } from 'react';
4
6
  import { CheckCircle, Clock, Info, Sparkle, WarningCircle } from '@phosphor-icons/react';
5
7
  import Screen from './Screen';
8
+ import { MorphemeConnection } from './MorphemeConnection';
9
+ import { ReleaseNotes, type VersionNotes } from './ReleaseNotes';
6
10
  import { Button, EmptyNote, Group, ListItem, ProblemNote } from './ui';
7
11
  import { backFrom } from './site';
8
12
  import { cmsView } from './cmsView.mjs';
@@ -18,7 +22,8 @@ type View = {
18
22
  running: string;
19
23
  checkedAt: string | null;
20
24
  latest: string | null;
21
- notes: { version: string; text: string }[];
25
+ notes: VersionNotes[];
26
+ installed: VersionNotes[];
22
27
  action: 'update' | 'try-again' | null;
23
28
  npmCommand: string | null;
24
29
  update: { state: UpdateState; to: string; at: string } | null;
@@ -102,6 +107,7 @@ export default function CmsPage() {
102
107
  {!view && !problem && <EmptyNote busy>{t.app.loading}</EmptyNote>}
103
108
  {view && (
104
109
  <>
110
+ {view.installed.length > 0 && <ReleaseNotes title={t.cms.newInYourVersion} entries={view.installed} />}
105
111
  <Group>
106
112
  <ListItem icon={Info} headline={t.cms.running(view.running)} supporting={view.latest ? undefined : t.cms.upToDate} />
107
113
  <ListItem icon={Clock} headline={view.checkedAt ? t.cms.checked(when(new Date(view.checkedAt))) : t.cms.notChecked} />
@@ -117,15 +123,10 @@ export default function CmsPage() {
117
123
  {view.action === 'update' ? t.cms.update : t.cms.tryAgain}
118
124
  </Button>
119
125
  )}
120
- {view.notes.length > 0 && (
121
- <Group title={t.cms.whatsNew}>
122
- {view.notes.map((n) => (
123
- <ListItem key={n.version} headline={t.cms.running(n.version)} supporting={n.text} />
124
- ))}
125
- </Group>
126
- )}
126
+ {view.notes.length > 0 && <ReleaseNotes title={t.cms.whatsNew} entries={view.notes} />}
127
127
  </>
128
128
  )}
129
+ <MorphemeConnection />
129
130
  </Screen>
130
131
  );
131
132
  }
package/src/Colors.tsx CHANGED
@@ -68,7 +68,7 @@ import { colorsInPicture, pickImage, shownAt } from './images';
68
68
  import { holdTheme, shownMode } from './theme';
69
69
  import { locale, siteT, t } from './i18n';
70
70
  import { colorFields, colorPairs, apps as siteApps } from './site';
71
- import { appSettings, installedApps, type SiteApp } from './apps';
71
+ import { activeApps, appSettings, type SiteApp } from './apps';
72
72
  import { settingsRoute } from './AppList';
73
73
  import { splitPicture } from '../lib/crop.mjs';
74
74
 
@@ -116,7 +116,7 @@ export const FALLBACK_ROUTE = 'appearance/colors/fallback-colors';
116
116
 
117
117
  /** The apps installed that change the pages' colours (hooks/page-colors.ts). */
118
118
  const colorApps = (files: RepoFile[]) => {
119
- const installed = installedApps(files);
119
+ const installed = activeApps(files);
120
120
  return siteApps.filter((a) => installed.includes(a.id) && a.needs.changes?.includes('page-colors'));
121
121
  };
122
122
 
@@ -1,5 +1,5 @@
1
- // "Dele" › "UI-komponenter" (BlockParts.tsx), the group "Communication": the theme's parts that tell the visitor something
2
- // (packages/editor/theme/ui/, through @site/editor) as the site draws them, with made-up texts: badges (a dot and a number,
1
+ // "Parts" › "UI-komponenter" (BlockParts.tsx), the group "Communication": the theme's parts that tell the visitor something
2
+ // (packages/editor/theme/ui/, through @site/editor) as the site draws them, with made-up texts: badges (a dot, the four status tones and a number,
3
3
  // on an icon, an icon button and a navigation drawer's item), the loading indicator with and without its container,
4
4
  // the progress indicators with a value and without (flat and wavy, and thick), snackbars (one line, two lines, with
5
5
  // an action, with a longer action, with a close button and with links) and tooltips (plain and rich, shown open). Only
@@ -65,6 +65,22 @@ export default function CommunicationParts() {
65
65
  </SiteBadge>
66
66
  </div>
67
67
  </Example>
68
+ <Example name={say.statusTones}>
69
+ <div className="flex gap-4">
70
+ <SiteBadge tone="ok" label={say.toneOk}>
71
+ <Svg name="envelope-simple" size={24} />
72
+ </SiteBadge>
73
+ <SiteBadge tone="minor" label={say.toneMinor}>
74
+ <Svg name="envelope-simple" size={24} />
75
+ </SiteBadge>
76
+ <SiteBadge tone="major" label={say.toneMajor}>
77
+ <Svg name="envelope-simple" size={24} />
78
+ </SiteBadge>
79
+ <SiteBadge tone="unknown" label={say.toneUnknown}>
80
+ <Svg name="envelope-simple" size={24} />
81
+ </SiteBadge>
82
+ </div>
83
+ </Example>
68
84
  </div>
69
85
  <SiteNavigationDrawer>
70
86
  <SiteNavigationDrawerRow>
@@ -1,4 +1,4 @@
1
- // "Dele" › "UI-komponenter" (BlockParts.tsx), the group "Dialoger, ark og karrusel": the theme's dialog, bottom sheet and
1
+ // "Parts" › "UI-komponenter" (BlockParts.tsx), the group "Dialoger, ark og karrusel": the theme's dialog, bottom sheet and
2
2
  // carousel (packages/editor/theme/ui/, through @site/editor) as the site draws them, with made-up texts and the plain
3
3
  // picture: a basic dialog, one with an icon, a list and a divider, the container alone (a pop-up's box) and a
4
4
  // full-screen one; the modal bottom sheet, three times, one per wide (a button opens it in a real dialog: on a phone at
package/src/DataForm.tsx CHANGED
@@ -252,6 +252,7 @@ function Form({
252
252
  siteName={sharing.name}
253
253
  title={result.title}
254
254
  description={result.description}
255
+ keyword={String(values.keyword ?? '')}
255
256
  />
256
257
  )}
257
258
  <FieldList fields={seoFields} value={values} onChange={(v) => setValues(v as Record<string, unknown>)} />
@@ -1,18 +1,28 @@
1
1
  // The editor's footer: at the bottom of every screen (Screen.tsx), under the content, or at the bottom of the window when
2
- // the content is short (the start screen): a divider and the link to "Licenser" (#licenses, Licenses.tsx). Exposes
3
- // EditorFooter. Uses LinkButton from ui.tsx and the theme's Divider; the safe area at the bottom is Screen's main.
4
- import { t } from './i18n';
5
- import { LinkButton } from './ui';
2
+ // the content is short (the start screen): a divider and one row with the links and the copyright line (FooterLinks.tsx).
3
+ // Exposes EditorFooter. Fetches the services' status (statusReport.ts, kept for a minute) for the dot.
4
+ import { useEffect, useState } from 'react';
6
5
  import { SiteDivider } from './themeUi';
6
+ import FooterLinks from './FooterLinks';
7
+ import { serviceStatus } from './statusReport';
8
+ import type { ServiceState } from '../lib/serviceStatus.mjs';
7
9
 
8
10
  export default function EditorFooter() {
11
+ // Unknown while the report loads and when it can't be fetched.
12
+ const [state, setState] = useState<ServiceState>('unknown');
13
+ useEffect(() => {
14
+ let on = true;
15
+ serviceStatus().then((report) => on && setState(report?.state ?? 'unknown'));
16
+ return () => {
17
+ on = false;
18
+ };
19
+ }, []);
20
+
9
21
  return (
10
- <footer className="mt-auto pt-12">
22
+ <footer className="mt-auto pt-6">
11
23
  <SiteDivider />
12
- <div className="flex justify-center pt-4">
13
- <LinkButton href="#licenses" kind="text" size="small">
14
- {t.common.parts.licenses}
15
- </LinkButton>
24
+ <div className="pt-1">
25
+ <FooterLinks state={state} />
16
26
  </div>
17
27
  </footer>
18
28
  );
package/src/EntryForm.tsx CHANGED
@@ -681,6 +681,7 @@ function Form({
681
681
  title={result.title}
682
682
  description={result.description}
683
683
  date={post ? String(values.date ?? '') : undefined}
684
+ keyword={String(values.keyword ?? '')}
684
685
  />
685
686
  {collection.fields.filter(inSection('seo')).map(field)}
686
687
  </div>
@@ -0,0 +1,7 @@
1
+ // The copyright line at the end of the editor's footer row: body-medium in the on-surface-variant colour, as tall as a link
2
+ // so the row stays level. Exposes FooterCopyright. Uses copyright from lib/footerLinks.mjs, with the current year.
3
+ import { copyright } from '../lib/footerLinks.mjs';
4
+
5
+ export default function FooterCopyright() {
6
+ return <span className="inline-flex min-h-6 items-center type-body-medium text-muted">{copyright(new Date().getFullYear())}</span>;
7
+ }
@@ -0,0 +1,5 @@
1
+ // The thin vertical divider between two items in the editor's footer row (1px wide, 16px high, the outline-variant
2
+ // colour), with space on both sides. Exposes FooterDivider. Used by FooterLinks, which hides the ones at the ends of a line (useStrayDividers.ts: data-divider).
3
+ export default function FooterDivider() {
4
+ return <span aria-hidden="true" data-divider className="mx-3 h-4 w-px shrink-0 bg-line" />;
5
+ }
@@ -0,0 +1,18 @@
1
+ // One link in the editor's footer: a plain text link (body-medium, the on-surface colour, underlined on hover and focus) with
2
+ // a target 24px high (WCAG 2.5.8). It opens in the same tab (a screen of the editor) or, for a link out of the editor, in a
3
+ // new one. Exposes FooterLink. Uses isExternal from lib/footerLinks.mjs.
4
+ import type { ReactNode } from 'react';
5
+ import { isExternal } from '../lib/footerLinks.mjs';
6
+
7
+ /** `children`: its label, and what follows it (the status dot). */
8
+ export default function FooterLink({ href, children }: { href: string; children: ReactNode }) {
9
+ return (
10
+ <a
11
+ href={href}
12
+ className="inline-flex min-h-6 items-center gap-1 type-body-medium text-ink hover:underline focus-visible:underline"
13
+ {...(isExternal(href) ? { target: '_blank', rel: 'noopener noreferrer' } : {})}
14
+ >
15
+ {children}
16
+ </a>
17
+ );
18
+ }
@@ -0,0 +1,34 @@
1
+ // The editor's footer row: support, system status (with a dot for how the services are), the legal links and "Licenses", then
2
+ // the copyright line, with a thin divider between each, centred and wrapping (a divider at the start or end of a line is hidden:
3
+ // useStrayDividers.ts). Exposes FooterLinks. Uses FooterLink, FooterDivider, FooterCopyright, the theme's Badge and
4
+ // FOOTER_LINKS from lib/footerLinks.mjs.
5
+ import { Fragment, useRef } from 'react';
6
+ import { t } from './i18n';
7
+ import FooterLink from './FooterLink';
8
+ import FooterDivider from './FooterDivider';
9
+ import FooterCopyright from './FooterCopyright';
10
+ import useStrayDividers from './useStrayDividers';
11
+ import { SiteBadge } from './themeUi';
12
+ import { FOOTER_LINKS, visibleLinks } from '../lib/footerLinks.mjs';
13
+ import type { ServiceState } from '../lib/serviceStatus.mjs';
14
+
15
+ /** `state`: how the services are, as the dot after "System status" shows it. */
16
+ export default function FooterLinks({ state }: { state: ServiceState }) {
17
+ const row = useRef<HTMLElement>(null);
18
+ useStrayDividers(row);
19
+ return (
20
+ <nav ref={row} className="flex flex-wrap items-center justify-center">
21
+ {visibleLinks(FOOTER_LINKS).map(({ id, href }, i) => (
22
+ <Fragment key={id}>
23
+ {i > 0 && <FooterDivider />}
24
+ <FooterLink href={href}>
25
+ {id === 'licenses' ? t.common.parts.licenses : t.footer[id]}
26
+ {id === 'status' && <SiteBadge tone={state} label={t.footer.state[state]} />}
27
+ </FooterLink>
28
+ </Fragment>
29
+ ))}
30
+ <FooterDivider />
31
+ <FooterCopyright />
32
+ </nav>
33
+ );
34
+ }
package/src/Library.tsx CHANGED
@@ -96,7 +96,7 @@ import { ask } from './ask';
96
96
  import { pagesWith } from './BlockSettings';
97
97
  import { filesOf, mediaOf } from './Media';
98
98
  import { restorable } from './Deleted';
99
- import { installedApps, kindsOffered, tabsOf } from './apps';
99
+ import { activeApps, kindsOffered, tabsOf } from './apps';
100
100
  import { appPartsIn, DeveloperRow } from './AppList';
101
101
  import { kindLists } from './BlockParts';
102
102
  import {
@@ -151,7 +151,6 @@ export function partOf(id: string, files: RepoFile[]): { label: string; href: st
151
151
  motion: parts.motion,
152
152
  'side-column': parts.sideColumn,
153
153
  colors: parts.colors,
154
- parts: parts.editorParts,
155
154
  }[id];
156
155
  const appearancePart = appearanceLabel ?? appearance.find((p) => p.id === id)?.label;
157
156
  if (appearancePart) return { label: appearancePart, href: `#appearance/${id}`, count: null };
@@ -161,7 +160,7 @@ export function partOf(id: string, files: RepoFile[]): { label: string; href: st
161
160
  if (own) return { label: own.label, href: own.href ?? `#${screen.id}/${id}`, count: null };
162
161
  }
163
162
  if (id === 'morpheme') return { label: parts.morpheme, href: `#${CMS_ROUTE}`, count: null };
164
- if (id === 'advanced') return { label: parts.advanced, href: '#advanced', count: null };
163
+ if (id === 'developer') return { label: parts.developer, href: `#${DEV_MENU_ROUTE}`, count: null };
165
164
  if (id === 'licenses') return { label: parts.licenses, href: '#licenses', count: null };
166
165
  const screen = partScreens.find((s) => s.id === id);
167
166
  if (screen) return { label: screen.label, href: `#${id}`, count: null };
@@ -226,7 +225,7 @@ export function Company({ part, files }: { part?: Part; files: RepoFile[] }) {
226
225
  // is built with at the end of its row (or, after a swap, until the site is built with the new one, that one), "Ikonpakker"
227
226
  // (IconPacks), with the pack chosen, "Bevægelse" (MotionSchemes), with the scheme chosen, "Sidekolonne" (SideColumn.tsx),
228
227
  // with the block chosen, and the colours (Colors.tsx); then the site's own parts there (appearance in packages/editor/defaults/editor.ts: "Standardsider", a
229
- // screen of its own, CompanyForm.tsx, going back here), and how the editor and the blocks look, their parts ("Dele", PartsHome), each on a
228
+ // screen of its own, CompanyForm.tsx, going back here), and how the editor and the blocks look, their parts ("Parts", PartsHome), each on a
230
229
  // screen of its own, with the icons the site gives them. The logo and icon (BrandForm.tsx) are under "Virksomheden" (Company).
231
230
  // The blocks that can be put in are under "Blokke" ("Blokindstillinger", BlockSettings.tsx).
232
231
  export function Theme({ files }: { files: RepoFile[] }) {
@@ -251,7 +250,6 @@ export function Theme({ files }: { files: RepoFile[] }) {
251
250
  },
252
251
  { id: 'colors', label: t.common.parts.colors, icon: icons.colors, trailing: <ThemeColors files={files} /> },
253
252
  ...appearance,
254
- { id: 'parts', label: t.common.parts.editorParts, icon: icons.parts },
255
253
  ];
256
254
  return <Parts title={t.common.parts.appearance} route="appearance" parts={parts} back={backFrom('appearance')} />;
257
255
  }
@@ -526,7 +524,7 @@ export function ThemePage({ of, env, files }: { of: ThemeInfo; env: Env; files:
526
524
  );
527
525
  }
528
526
 
529
- /** "Dele" (#appearance/parts): the parts the editor and the site are built of, each on a screen of its own: the editor's
527
+ /** "Parts" (#developer/parts): the parts the editor and the site are built of, each on a screen of its own: the editor's
530
528
  * (Parts.tsx), the theme's UI components, the blocks (the standard ones and the apps') and each list of kinds
531
529
  * ("Promovering", its own kinds and the apps'), as the theme shows them (BlockParts.tsx), and the theme's design tokens ("Værdier", Tokens.tsx). */
532
530
  export function PartsHome() {
@@ -537,7 +535,20 @@ export function PartsHome() {
537
535
  ...kindLists().map((c) => ({ id: `list/${c.id}`, label: c.label, icon: icons[c.id] ?? icons.lists })),
538
536
  { id: 'values', label: t.parts.screens.values, icon: Ruler },
539
537
  ];
540
- return <Parts title={t.common.parts.editorParts} route="appearance/parts" parts={parts} back={backToAppearance} />;
538
+ return <Parts title={t.common.parts.editorParts} route="developer/parts" parts={parts} back={backToDeveloper} />;
539
+ }
540
+
541
+ export const DEV_MENU_ROUTE = 'developer';
542
+ export const backToDeveloper = { href: `#${DEV_MENU_ROUTE}`, label: t.common.parts.developer };
543
+
544
+ /** "Developer" (#developer), under "Settings": "Parts" (PartsHome, #developer/parts) and "Caching and builds"
545
+ * (Advanced.tsx, #developer/caching), A–Å by their names. */
546
+ export function Developer() {
547
+ const parts: Part[] = [
548
+ { id: 'parts', label: t.common.parts.editorParts, icon: icons.parts },
549
+ { id: 'caching', label: t.common.parts.caching, icon: icons.developer },
550
+ ].sort((a, b) => byText(a.label, b.label));
551
+ return <Parts title={t.common.parts.developer} route={DEV_MENU_ROUTE} parts={parts} back={backFrom(DEV_MENU_ROUTE)} />;
541
552
  }
542
553
 
543
554
  /** "Søgemaskineoptimering" (#seo), no longer in the menu: "Videresendelser" (Redirects.tsx, #seo/redirects) and then
@@ -755,7 +766,7 @@ export function Account({ user, files, onLogout }: { user: Viewer | null; files:
755
766
  // installed app that sends any, a switch for each of its types (`notifications` in its index.ts).
756
767
  function NotificationChoices({ files }: { files: RepoFile[] }) {
757
768
  const { off, device } = useNotificationChoices();
758
- const installed = installedApps(files);
769
+ const installed = activeApps(files);
759
770
  const choice = (type: string, label: string) => (
760
771
  <SwitchRow
761
772
  key={type}
@@ -1045,9 +1056,9 @@ const capital = (s: string) => s.charAt(0).toLocaleUpperCase(locale) + s.slice(1
1045
1056
 
1046
1057
  export function List({ collection, tab, files, env }: { collection: Collection; tab?: string; files: RepoFile[]; env: Env }) {
1047
1058
  // The kinds a new entry can be: the list's own and those of the apps installed and not turned off (apps.ts).
1048
- const kinds = collection.kind === 'folder' ? kindsOffered(collection, apps, installedApps(files), offBlocks(files)) : [];
1059
+ const kinds = collection.kind === 'folder' ? kindsOffered(collection, apps, activeApps(files), offBlocks(files)) : [];
1049
1060
  // The tabs the apps installed add to it, and the one open (none: the list's own).
1050
- const appTabs = tabsOf(collection.id, apps, installedApps(files));
1061
+ const appTabs = tabsOf(collection.id, apps, activeApps(files));
1051
1062
  const appTab = appTabs.find((a) => a.app.id === tab);
1052
1063
  const [query, setQuery] = useKept(`${collection.id}-search`, '');
1053
1064
  // The move that runs (row and target row, null: none); only its arrow shows busy, all arrows stay disabled meanwhile.
@@ -1,4 +1,4 @@
1
- // The main drawer and its menu button on #appearance/parts/editor (Parts.tsx): the modal drawer in its two levels (sections, and
1
+ // The main drawer and its menu button on #developer/parts/editor (Parts.tsx): the modal drawer in its two levels (sections, and
2
2
  // a section's list with the back row and a fold-out), opened from a button, so it can be tried at any width, and the menu
3
3
  // button open and closed. The drawer's header is a sample user (AccountRow). Exposes MainDrawerSample. Uses MainDrawer and
4
4
  // its parts from ui.tsx.
@@ -1223,7 +1223,7 @@ export default forwardRef<MarkdownHandle, Props>(function MarkdownEditor(
1223
1223
  <Toolbar
1224
1224
  ref={toolbar}
1225
1225
  label={t.text.tools}
1226
- className="editor-tools sticky top-[env(safe-area-inset-top)] z-10 m-2 items-start rounded-panel border border-line"
1226
+ className="editor-tools sticky top-[calc(env(safe-area-inset-top)+--spacing(2))] z-10 m-2 items-start rounded-panel border border-line pb-(--toolbar-docked-padding-block)"
1227
1227
  >
1228
1228
  <div
1229
1229
  ref={line}
@@ -1,4 +1,4 @@
1
- // "Dele" › "UI-komponenter": the modal bottom sheet example (ContainmentParts.tsx). A button opens the theme's modal
1
+ // "Parts" › "UI-komponenter": the modal bottom sheet example (ContainmentParts.tsx). A button opens the theme's modal
2
2
  // sheet in a real <dialog>, as the site does (bottomSheet() in bottomSheetControl.ts), so on a phone it opens at half
3
3
  // height (startAt), is pulled up to full height and pulled down to close. `wide` is what it becomes from the medium
4
4
  // breakpoint (BottomSheet's `wide`: a dialog, a side sheet or a sheet), `label` what the button says.
@@ -0,0 +1,30 @@
1
+ // The "Store connection" group on the Morpheme page (#morpheme): the site's connection to the Morpheme store, as the connected row (with the Morpheme logo) or the connect notice.
2
+ // Exposes MorphemeConnection(); uses StoreRound and useStoreKey (StoreStatus.tsx), StoreConnectedRow, StoreConnectNotice and GroupTitle (ui.tsx).
3
+ import { GroupTitle } from './ui';
4
+ import { StoreConnectedRow } from './StoreConnectedRow';
5
+ import { StoreConnectNotice } from './StoreConnectNotice';
6
+ import { StoreRound, useStoreKey } from './StoreStatus';
7
+ import { t } from './i18n';
8
+
9
+ /** Connecting or disconnecting draws the group again. Shows nothing while the key is read, and nothing when the site is
10
+ * connected another way than the button or the editor may not change it (there is nothing to do then). */
11
+ export function MorphemeConnection() {
12
+ return <StoreRound>{(again) => <Connection again={again} />}</StoreRound>;
13
+ }
14
+
15
+ function Connection({ again }: { again: () => void }) {
16
+ const key = useStoreKey();
17
+ if (!key) return null;
18
+ const body = !key.connected ? (
19
+ <StoreConnectNotice mayChange={key.mayChange} onConnected={again} />
20
+ ) : key.by === 'button' && key.mayChange ? (
21
+ <StoreConnectedRow site={key.site} onDisconnected={again} />
22
+ ) : null;
23
+ if (!body) return null;
24
+ return (
25
+ <section className="mb-8">
26
+ <GroupTitle>{t.cms.storeConnection}</GroupTitle>
27
+ <div className="px-4">{body}</div>
28
+ </section>
29
+ );
30
+ }
@@ -0,0 +1,9 @@
1
+ // The Morpheme logo (the staging site's public/logo.svg) drawn inline in the colour of the text around it; the view box is cut to the drawing, so it fills its box as an icon does.
2
+ // Exposes MorphemeLogo({ size }); no dependencies.
3
+ export function MorphemeLogo({ size = 24 }: { size?: number }) {
4
+ return (
5
+ <svg width={size} height={size} viewBox="2 4 20 15" fill="currentColor" aria-hidden>
6
+ <path d="M2,4V6H4V4H2M20,4V6H22V4H20M2,7V9H4V7H2M5,7V9H7V7H5M14,7V9H16V7H14M17,7V9H19V7H17M20,7V9H22V7H20M2,10V12H4V10H2M5,10V12H7V10H5M8,10V12H10V10H8M11,10V12H13V10H11M14,10V12H16V10H14M17,10V12H19V10H17M20,10V12H22V10H20M2,13V15H4V13H2M5,13V15H7V13H5M8,13V15H10V13H8M11,13V15H13V13H11M14,13V15H16V13H14M17,13V15H19V13H17M20,13V15H22V13H20M5,17V19H7V17H5M8,17V19H10V17H8M11,17V19H13V17H11M14,17V19H16V17H14M17,17V19H19V17H17Z" />
7
+ </svg>
8
+ );
9
+ }
@@ -1,4 +1,4 @@
1
- // "Dele" › "UI-komponenter" (BlockParts.tsx), the group "Navigation": the theme's parts of the header (packages/editor/theme/ui/,
1
+ // "Parts" › "UI-komponenter" (BlockParts.tsx), the group "Navigation": the theme's parts of the header (packages/editor/theme/ui/,
2
2
  // through @site/editor) as the site draws them, with made-up pages: the top app bar as the site's header has it (at the
3
3
  // top and once the page scrolls under it) and in its kinds (search, small, medium and large flexible, at the start and
4
4
  // in the middle, with a subtitle, a long headline and collapsed), a menu (the header's pages, and actions in both
@@ -1,4 +1,4 @@
1
- // "Dele" › "UI-komponenter" (BlockParts.tsx), the group "Bjælker og søgning": the rest of the theme's navigation parts
1
+ // "Parts" › "UI-komponenter" (BlockParts.tsx), the group "Bjælker og søgning": the rest of the theme's navigation parts
2
2
  // (packages/editor/theme/ui/, through @site/editor) as the site draws them, with made-up destinations: the navigation bar
3
3
  // with the open one and its badges, with vertical items, horizontal ones and both by its width, the navigation rail
4
4
  // collapsed and expanded with its menu button and FAB, in sections with a count at each destination's end (the
package/src/Parts.tsx CHANGED
@@ -1,4 +1,4 @@
1
- // "Udseende" › "Dele" › "Editor" (#appearance/parts/editor): the parts only the editor has (ui.tsx: the SEO rating, the
1
+ // "Developer" › "Parts" › "Editor" (#developer/parts/editor): the parts only the editor has (ui.tsx: the SEO rating, the
2
2
  // colour field, the choices of pages and icons, the form's layout …) in every state, on one screen, to see and agree on
3
3
  // how the editor looks, and below them the form fields (fields.tsx), one of each type with the settings it can have.
4
4
  // The parts the theme has too (buttons, fields, switches, lists, sheets …) are the theme's, shown under "UI-komponenter"
@@ -155,7 +155,7 @@ export default function Parts({ env }: { env: Env }) {
155
155
  const page = useMemo(() => exampleData().relations.pages[1].value, []);
156
156
 
157
157
  return (
158
- <Screen title={t.parts.screens.editor} back={{ href: '#appearance/parts', label: t.common.parts.editorParts }}>
158
+ <Screen title={t.parts.screens.editor} back={{ href: '#developer/parts', label: t.common.parts.editorParts }}>
159
159
  <div className="space-y-10">
160
160
  <p className="text-muted">{t.parts.intro('packages/editor/src/ui.tsx')}</p>
161
161
  <PartsShown groups={GROUPS} keep="parts">
@@ -199,7 +199,7 @@ export default function Parts({ env }: { env: Env }) {
199
199
  { value: 'top', label: sample.top },
200
200
  { value: 'list', label: sample.inList },
201
201
  ]}
202
- href="#appearance/parts/editor"
202
+ href="#developer/parts/editor"
203
203
  onChange={setPlacement}
204
204
  />
205
205
  </div>
@@ -273,7 +273,7 @@ export default function Parts({ env }: { env: Env }) {
273
273
  max={3}
274
274
  footer={(close) => (
275
275
  <SheetLink
276
- href="#appearance/parts/editor"
276
+ href="#developer/parts/editor"
277
277
  onClick={(e) => {
278
278
  e.preventDefault();
279
279
  close();
@@ -393,10 +393,10 @@ export default function Parts({ env }: { env: Env }) {
393
393
  { icon: FolderSimple, label: sample.media, count: 42 },
394
394
  { icon: PencilSimple, label: sample.pages, count: 12 },
395
395
  ].map((p) => (
396
- <ListItem key={p.label} href="#appearance/parts/editor" icon={p.icon} headline={p.label} count={p.count} arrow />
396
+ <ListItem key={p.label} href="#developer/parts/editor" icon={p.icon} headline={p.label} count={p.count} arrow />
397
397
  ))}
398
398
  {/* With a text under its name: the icon beside the first two lines. */}
399
- <ListItem href="#appearance/parts/editor" icon={Gear} headline={sample.cookieBanner} supporting={sample.cookieHint} arrow />
399
+ <ListItem href="#developer/parts/editor" icon={Gear} headline={sample.cookieBanner} supporting={sample.cookieHint} arrow />
400
400
  {/* With a picture before its name (the picture a page's colours came from). */}
401
401
  <ListItem
402
402
  leading={<LeadingImage src={examplePicture} />}
@@ -409,7 +409,7 @@ export default function Parts({ env }: { env: Env }) {
409
409
  />
410
410
  }
411
411
  />
412
- {/* With a sample of one of the theme's tokens before its name ("Dele" › "Værdier"). */}
412
+ {/* With a sample of one of the theme's tokens before its name ("Parts" › "Værdier"). */}
413
413
  <ListItem leading={<LeadingToken kind="shape" value="var(--radius)" />} headline={sample.corners} supporting="--radius" />
414
414
  </Group>
415
415
  <div className={row}>
@@ -459,7 +459,7 @@ export default function Parts({ env }: { env: Env }) {
459
459
  <Part name="UnfoldButton, subListClass" use={use.unfold}>
460
460
  <ul className={listClass}>
461
461
  <ListItem
462
- href="#appearance/parts/editor"
462
+ href="#developer/parts/editor"
463
463
  headline={sample.pages}
464
464
  actions={
465
465
  <span className="shrink-0 pr-1.5">
@@ -477,7 +477,7 @@ export default function Parts({ env }: { env: Env }) {
477
477
  <li className="pb-2">
478
478
  <ul className={subListClass}>
479
479
  {[1, 2, 3].map((n) => (
480
- <ListItem key={n} tone="sub" href="#appearance/parts/editor" headline={sample.subpage(n)} />
480
+ <ListItem key={n} tone="sub" href="#developer/parts/editor" headline={sample.subpage(n)} />
481
481
  ))}
482
482
  </ul>
483
483
  </li>
@@ -1,4 +1,4 @@
1
- // The parts of a screen that shows parts in every state ("Dele": Parts.tsx, BlockParts.tsx), with the search, the order and the filters of the editor's lists ("Standardblokke",
1
+ // The parts of a screen that shows parts in every state ("Parts": Parts.tsx, BlockParts.tsx), with the search, the order and the filters of the editor's lists ("Standardblokke",
2
2
  // Library.tsx): a search in the parts' names and what they are for, the order (by group, A–Å or Å–A,
3
3
  // kept in this browser; A–Å under the first letter of the names) and the funnel with the filter by
4
4
  // group, the one picked as a chip that removes it. A screen can add the filter by style (how much of a part
@@ -1,4 +1,4 @@
1
- // "Dele" › "UI-komponenter" (BlockParts.tsx), the group "Valg af dato og tid": the theme's date and time pickers
1
+ // "Parts" › "UI-komponenter" (BlockParts.tsx), the group "Valg af dato og tid": the theme's date and time pickers
2
2
  // (packages/editor/theme/ui/, through @site/editor) as the site draws them: the fields (docked, modal, a range, typed
3
3
  // wrong), and what opens from them in each state: the docked picker's month and its list of years, the modal one's
4
4
  // month with a day picked, its years, a range and the input mode with an error; the time picker's dial on the hours and
@@ -0,0 +1,17 @@
1
+ // One release note card on the Morpheme page (#morpheme): the theme's outlined card with the note's screenshot on top (when it
2
+ // has one, whole at the card's width and its own height), its title and its text. Exposes ReleaseNoteCard. Depends on the theme's card (themeUi.ts) and the ReleaseNote
3
+ // type of lib/releaseNotes.mjs.
4
+ import { SiteCard } from './themeUi';
5
+ import type { ReleaseNote } from '../lib/releaseNotes.mjs';
6
+
7
+ export function ReleaseNoteCard({ note }: { note: Extract<ReleaseNote, { kind: 'card' }> }) {
8
+ return (
9
+ <SiteCard kind="outlined" as="article" className="space-y-3 overflow-hidden [--card-padding:0_0_1rem]">
10
+ {note.image && <img src={note.image} alt={note.title} loading="lazy" className="block h-auto w-full" />}
11
+ <div className="space-y-2 px-4">
12
+ <h3 className="text-lg font-medium">{note.title}</h3>
13
+ <p className="text-base">{note.text}</p>
14
+ </div>
15
+ </SiteCard>
16
+ );
17
+ }