@morphemecms/cms 0.7.0 → 0.8.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/defaults/collections.ts +56 -0
  3. package/defaults/company.ts +13 -4
  4. package/defaults/texts.ts +17 -0
  5. package/icons/lucide/LICENSE-phosphor +21 -0
  6. package/icons/lucide/facebook-logo.svg +1 -0
  7. package/icons/lucide/linkedin-logo.svg +1 -0
  8. package/icons/lucide/pack.json +16 -1
  9. package/icons/lucide/pinterest-logo.svg +1 -0
  10. package/icons/lucide/x-logo.svg +1 -0
  11. package/icons/material-symbols/LICENSE-phosphor +21 -0
  12. package/icons/material-symbols/facebook-logo.svg +1 -0
  13. package/icons/material-symbols/linkedin-logo.svg +1 -0
  14. package/icons/material-symbols/pack.json +15 -0
  15. package/icons/material-symbols/pinterest-logo.svg +1 -0
  16. package/icons/material-symbols/x-logo.svg +1 -0
  17. package/icons/phosphor/facebook-logo.svg +1 -0
  18. package/icons/phosphor/linkedin-logo.svg +1 -0
  19. package/icons/phosphor/pinterest-logo.svg +1 -0
  20. package/icons/phosphor/x-logo.svg +1 -0
  21. package/lib/lead.d.mts +5 -0
  22. package/lib/lead.mjs +10 -0
  23. package/lib/lead.test.mjs +65 -0
  24. package/lib/licenses.mjs +1 -1
  25. package/package.json +2 -1
  26. package/scripts/icon-packs.mjs +51 -13
  27. package/scripts/material-fallback.test.mjs +49 -0
  28. package/site/icons.d.mts +13 -0
  29. package/site/icons.mjs +25 -3
  30. package/site/materialSymbols.d.mts +8 -2
  31. package/site/materialSymbols.mjs +27 -11
  32. package/site/materialSymbols.test.mjs +44 -0
  33. package/site/schema.ts +2 -0
  34. package/site/site.ts +9 -2
  35. package/site/social.d.mts +37 -0
  36. package/site/social.mjs +92 -0
  37. package/site/social.test.mjs +80 -0
  38. package/site/theme.d.mts +2 -0
  39. package/site/theme.mjs +28 -11
  40. package/site/themeImport.test.mjs +40 -0
  41. package/src/EntryForm.tsx +21 -58
  42. package/src/FormFrame.tsx +5 -5
  43. package/src/Parts.tsx +8 -30
  44. package/src/Screen.tsx +12 -5
  45. package/src/editor.css +70 -5
  46. package/src/i18n/da-DK/parts.ts +1 -1
  47. package/src/i18n/da-DK/theme.ts +4 -0
  48. package/src/i18n/en-US/parts.ts +1 -1
  49. package/src/i18n/en-US/theme.ts +4 -0
  50. package/src/icon.tsx +1 -1
  51. package/src/materialIcons.ts +5 -7
  52. package/src/pagePreview.tsx +21 -1
  53. package/src/postLead.d.mts +7 -0
  54. package/src/postLead.mjs +9 -0
  55. package/src/postLead.test.mjs +28 -0
  56. package/src/ui.tsx +41 -96
  57. package/src/virtual.d.ts +5 -0
  58. package/starter/package.json +1 -1
  59. package/starter/src/data/social.json +14 -0
  60. package/theme/components/PostAuthor.astro +20 -0
  61. package/theme/components/PostCard.tsx +26 -0
  62. package/theme/components/PostHeader.astro +36 -0
  63. package/theme/components/PostMeta.tsx +27 -2
  64. package/theme/components/RelatedPosts.astro +29 -0
  65. package/theme/components/ShareRow.astro +48 -0
  66. package/theme/layouts/PostLayout.astro +28 -54
  67. package/theme/styles/base.css +164 -127
  68. package/theme/styles/blocks.css +160 -155
  69. package/theme/styles/components.css +43 -34
  70. package/theme/styles/global.css +316 -303
  71. package/theme/styles/ui.css +43 -34
  72. package/theme/ui/copyLink.script.ts +17 -0
@@ -1,4 +1,7 @@
1
1
  /*
2
+ Material is every theme's fallback: its rules that set more than custom properties sit in @layer fallback (declared last in
3
+ base.css), so a theme's own unlayered rules win over them, whatever the specificity. Custom properties stay unlayered.
4
+
2
5
  The theme's UI components, named as Material 3 names them (m3.material.io/components): what the blocks, the apps and
3
6
  the theme's own components (components/, layouts/) draw their controls with, through the parts in ../ui/ (Button.tsx,
4
7
  IconButton.tsx) or, in an Astro component, their classes (buttonClass, iconButtonClass). Only the names, the kinds,
@@ -5387,9 +5390,11 @@
5387
5390
  stroke-dashoffset: -99;
5388
5391
  }
5389
5392
  }
5390
- @media (prefers-reduced-motion: no-preference) {
5391
- .snackbar {
5392
- animation: snackbar-in var(--motion-spatial);
5393
+ @layer fallback {
5394
+ @media (prefers-reduced-motion: no-preference) {
5395
+ .snackbar {
5396
+ animation: snackbar-in var(--motion-spatial);
5397
+ }
5393
5398
  }
5394
5399
  }
5395
5400
  @keyframes snackbar-in {
@@ -5398,34 +5403,36 @@
5398
5403
  transform: translateY(0.5rem);
5399
5404
  }
5400
5405
  }
5401
- /* Reduced motion: slowly, and a value at once. */
5402
- @media (prefers-reduced-motion: reduce) {
5403
- .loading-indicator-shape {
5404
- animation: loading-indicator-turn 6s linear infinite;
5405
- }
5406
- .linear-progress-indicator-active,
5407
- .linear-progress-indicator-track,
5408
- .circular-progress-indicator-active,
5409
- .circular-progress-indicator-track,
5410
- .tooltip {
5411
- transition: none;
5412
- }
5413
- .linear-progress-indicator-indeterminate > .linear-progress-indicator-active,
5414
- .linear-progress-indicator-wavy.linear-progress-indicator-indeterminate .linear-progress-indicator-active,
5415
- .circular-progress-indicator-indeterminate > svg,
5416
- .circular-progress-indicator-indeterminate .circular-progress-indicator-active {
5417
- animation-duration: 6s;
5418
- }
5419
- .linear-progress-indicator-indeterminate > .linear-progress-indicator-active + .linear-progress-indicator-active,
5420
- .linear-progress-indicator-wavy.linear-progress-indicator-indeterminate
5421
- .linear-progress-indicator-active
5422
- + .linear-progress-indicator-active {
5423
- animation-delay: 3.3s;
5424
- }
5425
- /* A wavy one's wave stands still. */
5426
- .linear-progress-indicator-wavy:not(.linear-progress-indicator-indeterminate) .linear-progress-indicator-active,
5427
- .circular-progress-indicator-wavy:not(.circular-progress-indicator-indeterminate) .circular-progress-indicator-active {
5428
- animation: none;
5406
+ @layer fallback {
5407
+ /* Reduced motion: slowly, and a value at once. */
5408
+ @media (prefers-reduced-motion: reduce) {
5409
+ .loading-indicator-shape {
5410
+ animation: loading-indicator-turn 6s linear infinite;
5411
+ }
5412
+ .linear-progress-indicator-active,
5413
+ .linear-progress-indicator-track,
5414
+ .circular-progress-indicator-active,
5415
+ .circular-progress-indicator-track,
5416
+ .tooltip {
5417
+ transition: none;
5418
+ }
5419
+ .linear-progress-indicator-indeterminate > .linear-progress-indicator-active,
5420
+ .linear-progress-indicator-wavy.linear-progress-indicator-indeterminate .linear-progress-indicator-active,
5421
+ .circular-progress-indicator-indeterminate > svg,
5422
+ .circular-progress-indicator-indeterminate .circular-progress-indicator-active {
5423
+ animation-duration: 6s;
5424
+ }
5425
+ .linear-progress-indicator-indeterminate > .linear-progress-indicator-active + .linear-progress-indicator-active,
5426
+ .linear-progress-indicator-wavy.linear-progress-indicator-indeterminate
5427
+ .linear-progress-indicator-active
5428
+ + .linear-progress-indicator-active {
5429
+ animation-delay: 3.3s;
5430
+ }
5431
+ /* A wavy one's wave stands still. */
5432
+ .linear-progress-indicator-wavy:not(.linear-progress-indicator-indeterminate) .linear-progress-indicator-active,
5433
+ .circular-progress-indicator-wavy:not(.circular-progress-indicator-indeterminate) .circular-progress-indicator-active {
5434
+ animation: none;
5435
+ }
5429
5436
  }
5430
5437
  }
5431
5438
 
@@ -6866,8 +6873,10 @@
6866
6873
  opacity: 0;
6867
6874
  }
6868
6875
  }
6869
- @media (prefers-reduced-motion: reduce) {
6870
- .ripple-wave {
6871
- animation: ripple-in 105ms linear;
6876
+ @layer fallback {
6877
+ @media (prefers-reduced-motion: reduce) {
6878
+ .ripple-wave {
6879
+ animation: ripple-in 105ms linear;
6880
+ }
6872
6881
  }
6873
6882
  }
@@ -0,0 +1,17 @@
1
+ // What a copy-link button (ShareRow.astro, [data-copy-link]) does on the site: it writes its address to the clipboard and
2
+ // says so in a snackbar (its text in data-copied). Run on every page by Base.astro (blockScripts, by `ui/copyLink`);
3
+ // without such a button on the page it does nothing.
4
+ import { snackbar } from '@morphemecms/cms/lib/snackbar';
5
+
6
+ export default function copyLinks() {
7
+ document.querySelectorAll<HTMLButtonElement>('button[data-copy-link]').forEach((button) => {
8
+ button.addEventListener('click', async () => {
9
+ try {
10
+ await navigator.clipboard.writeText(button.dataset.copyLink ?? '');
11
+ } catch {
12
+ return;
13
+ }
14
+ snackbar({ text: button.dataset.copied ?? '' });
15
+ });
16
+ });
17
+ }