domma-cms 1.32.0 → 1.34.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 (113) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/CLAUDE.md +1 -1
  3. package/admin/js/lib/admin-brand.js +1 -1
  4. package/admin/js/lib/admin-theme.js +1 -1
  5. package/admin/js/lib/shortcode-context-menu.js +2 -2
  6. package/admin/js/lib/shortcode-registry.js +1 -1
  7. package/admin/js/lib/sidebar-frequent.js +1 -1
  8. package/admin/js/lib/sidebar-notify.js +1 -1
  9. package/admin/js/lib/sidebar-renderer.js +4 -4
  10. package/admin/js/lib/site-settings-arrange.js +2 -2
  11. package/admin/js/lib/theme-aware-logo.js +1 -0
  12. package/admin/js/templates/settings.html +7 -1
  13. package/admin/js/views/settings.js +2 -2
  14. package/docs/markdown-shortcodes.md +13 -0
  15. package/docs/starter-blocks.md +37 -1
  16. package/package.json +1 -1
  17. package/plugins/_lib/admin/mail/body-menu.js +1 -1
  18. package/plugins/_lib/admin/mail/cms-host.js +1 -1
  19. package/plugins/_lib/admin/mail/compose-window.js +1 -1
  20. package/plugins/_lib/admin/mail/contacts.js +1 -1
  21. package/plugins/_lib/admin/mail/diagnostics-section.js +1 -1
  22. package/plugins/_lib/admin/mail/drag-drop.js +1 -1
  23. package/plugins/_lib/admin/mail/folder-tree.js +1 -1
  24. package/plugins/_lib/admin/mail/font-controls.js +1 -1
  25. package/plugins/_lib/admin/mail/fonts.js +1 -1
  26. package/plugins/_lib/admin/mail/host-context.js +1 -1
  27. package/plugins/_lib/admin/mail/identity.js +1 -1
  28. package/plugins/_lib/admin/mail/image-senders-section.js +1 -1
  29. package/plugins/_lib/admin/mail/keyboard.js +1 -1
  30. package/plugins/_lib/admin/mail/mail.html +1 -1
  31. package/plugins/_lib/admin/mail/message-actions.js +1 -1
  32. package/plugins/_lib/admin/mail/oauth-panel.js +1 -1
  33. package/plugins/_lib/admin/mail/panes.js +1 -1
  34. package/plugins/_lib/admin/mail/reader-kit.js +1 -1
  35. package/plugins/_lib/admin/mail/reader-runtime.js +2 -1
  36. package/plugins/_lib/admin/mail/reader-view.js +1 -1
  37. package/plugins/_lib/admin/mail/resizable.js +1 -1
  38. package/plugins/_lib/admin/mail/restore-spam.js +1 -1
  39. package/plugins/_lib/admin/mail/rules.js +1 -1
  40. package/plugins/_lib/admin/mail/scheduling.js +1 -1
  41. package/plugins/_lib/admin/mail/section-kit.js +1 -1
  42. package/plugins/_lib/admin/mail/security-note.js +1 -1
  43. package/plugins/_lib/admin/mail/settings-section.js +12 -4
  44. package/plugins/_lib/admin/mail/templates.js +1 -1
  45. package/plugins/_lib/admin/mail/threads.js +1 -1
  46. package/plugins/_lib/admin/mail/vacation.js +1 -1
  47. package/plugins/_lib/admin/mail/when-closed.js +1 -1
  48. package/plugins/_lib/admin/ui/dates.js +1 -1
  49. package/plugins/_lib/admin/ui/resizable.js +1 -1
  50. package/plugins/_lib/domma-mail.lock.json +80 -80
  51. package/plugins/_lib/mail/accountFileStore.js +1 -1
  52. package/plugins/_lib/mail/accountRepository.js +23 -2
  53. package/plugins/_lib/mail/accountRoutes.js +1 -1
  54. package/plugins/_lib/mail/accounts.js +1 -1
  55. package/plugins/_lib/mail/bodyTokenProvider.js +1 -1
  56. package/plugins/_lib/mail/bodyTokens.js +1 -1
  57. package/plugins/_lib/mail/compose.js +1 -1
  58. package/plugins/_lib/mail/defaults.js +1 -1
  59. package/plugins/_lib/mail/envelope.js +1 -1
  60. package/plugins/_lib/mail/folderActions.js +1 -1
  61. package/plugins/_lib/mail/folderRuntime.js +1 -1
  62. package/plugins/_lib/mail/folders.js +1 -1
  63. package/plugins/_lib/mail/imapPoolRuntime.js +1 -1
  64. package/plugins/_lib/mail/mbox.js +1 -1
  65. package/plugins/_lib/mail/message-action.js +1 -1
  66. package/plugins/_lib/mail/messageSecurity.js +1 -1
  67. package/plugins/_lib/mail/messageSecurityProvider.js +1 -1
  68. package/plugins/_lib/mail/networkAddresses.js +1 -1
  69. package/plugins/_lib/mail/networkPolicy.js +1 -1
  70. package/plugins/_lib/mail/oauthAccounts.js +1 -1
  71. package/plugins/_lib/mail/oauthRouteRuntime.js +1 -1
  72. package/plugins/_lib/mail/oauthRuntime.js +1 -1
  73. package/plugins/_lib/mail/pollSchedule.js +1 -1
  74. package/plugins/_lib/mail/poller.js +1 -1
  75. package/plugins/_lib/mail/pollerRuntime.js +1 -1
  76. package/plugins/_lib/mail/priority.js +1 -1
  77. package/plugins/_lib/mail/publicMailbox.js +1 -1
  78. package/plugins/_lib/mail/readRuntime.js +1 -1
  79. package/plugins/_lib/mail/render.js +1 -1
  80. package/plugins/_lib/mail/ruleRunner.js +1 -1
  81. package/plugins/_lib/mail/schedulerRuntime.js +1 -1
  82. package/plugins/_lib/mail/secretProvider.js +1 -1
  83. package/plugins/_lib/mail/secretbox.js +1 -1
  84. package/plugins/_lib/mail/senderAuth.js +1 -1
  85. package/plugins/_lib/mail/sieve.js +1 -1
  86. package/plugins/_lib/mail/smtpService.js +1 -1
  87. package/plugins/_lib/mail/snoozeRuntime.js +1 -1
  88. package/plugins/_lib/mail/store.js +1 -1
  89. package/plugins/_lib/mail/subscriptions.js +1 -1
  90. package/plugins/_lib/mail/syncPlan.js +1 -1
  91. package/plugins/_lib/mail/syncRuntime.js +1 -1
  92. package/plugins/_lib/mail/syncSelection.js +8 -3
  93. package/plugins/_lib/mail/unreadBadge.js +1 -1
  94. package/plugins/_lib/mail/unsubscribe.js +1 -1
  95. package/plugins/_lib/mail/vacationRuntime.js +1 -1
  96. package/plugins/_lib/mail/write.js +1 -1
  97. package/server/blocks/catalog.json +24 -0
  98. package/server/blocks/domma-block-comparison-card.css +20 -0
  99. package/server/blocks/domma-block-comparison-card.html +18 -0
  100. package/server/blocks/domma-block-comparison-card.meta.json +7 -0
  101. package/server/blocks/domma-block-cta-card.css +20 -0
  102. package/server/blocks/domma-block-cta-card.html +15 -0
  103. package/server/blocks/domma-block-cta-card.meta.json +7 -0
  104. package/server/blocks/domma-block-feature-card.css +20 -0
  105. package/server/blocks/domma-block-feature-card.html +15 -0
  106. package/server/blocks/domma-block-feature-card.meta.json +7 -0
  107. package/server/blocks/domma-block-image-card.css +20 -0
  108. package/server/blocks/domma-block-image-card.html +17 -0
  109. package/server/blocks/domma-block-image-card.meta.json +7 -0
  110. package/server/services/adminBrand.js +4 -1
  111. package/server/services/embedCsp.js +1 -1
  112. package/server/services/markdown.js +65 -6
  113. package/server/services/sidebarFrequent.js +1 -1
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.20.0, packages/core/src/mail/vacationRuntime.js.
1
+ // Source: @domma-mail/core 0.21.0, packages/core/src/mail/vacationRuntime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  import {randomUUID} from 'node:crypto';
4
4
  import {autoReplyHeaders, isActive, normaliseVacation, replySubject, shouldAutoReply, replyHistory} from '../admin/mail/vacation.js';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.20.0, packages/core/src/mail/write.js.
1
+ // Source: @domma-mail/core 0.21.0, packages/core/src/mail/write.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Changing mail, rather than reading it.
@@ -100,5 +100,29 @@
100
100
  "category": "cards",
101
101
  "description": "A softly rounded card with a raised rim and inset panel.",
102
102
  "example": "[domma-block-cushion-card heading=\"Make yourself at home\" /]"
103
+ },
104
+ {
105
+ "name": "domma-block-feature-card",
106
+ "category": "cards",
107
+ "description": "Feature card with an icon, description and optional link.",
108
+ "example": "[domma-block-feature-card header=\"Everything in one place\" icon=\"grid\" blurb=\"Explore the features included with your site.\" link=\"/features\" label=\"See the features\" /]"
109
+ },
110
+ {
111
+ "name": "domma-block-comparison-card",
112
+ "category": "cards",
113
+ "description": "Comparison card with two labelled choices.",
114
+ "example": "[domma-block-comparison-card header=\"Find your fit\" icon=\"layers\" first_label=\"Choose a hosted builder\" first=\"For a quick template website.\" second_label=\"Choose a CMS\" second=\"For more control over your content.\" /]"
115
+ },
116
+ {
117
+ "name": "domma-block-image-card",
118
+ "category": "cards",
119
+ "description": "Image card with a heading, description and optional link.",
120
+ "example": "[domma-block-image-card header=\"Our work\" blurb=\"Take a closer look at a recent project.\" image=\"/media/project.jpg\" alt=\"A recent project\" link=\"/showcase\" label=\"View the project\" /]"
121
+ },
122
+ {
123
+ "name": "domma-block-cta-card",
124
+ "category": "cards",
125
+ "description": "Compact call-to-action card with a heading and link.",
126
+ "example": "[domma-block-cta-card header=\"Let us help\" icon=\"mail\" blurb=\"Tell us what you have in mind.\" link=\"/contact\" label=\"Get in touch\" /]"
103
127
  }
104
128
  ]
@@ -0,0 +1,20 @@
1
+ /* Shared default card proportions; colour is opt-in and intentionally light. */
2
+ .db-card { --db-accent: var(--dm-primary, #486b82); box-sizing: border-box; height: 100%; display: flex; flex-direction: column; gap: .9rem; padding: 1.5rem; border: 1px solid var(--dm-border, #d5e0e5); border-radius: var(--dm-radius-lg, .75rem); background: var(--dm-card-bg, #fff); color: var(--dm-text, #152832); overflow-wrap: anywhere; }
3
+ .db-card[data-tone="blue"] { --db-accent: #547d99; }
4
+ .db-card[data-tone="teal"] { --db-accent: #50857b; }
5
+ .db-card[data-tone="violet"] { --db-accent: #837298; }
6
+ .db-card[data-tone="warm"] { --db-accent: #a37b59; }
7
+ .db-card:is([data-tone="blue"], [data-tone="teal"], [data-tone="violet"], [data-tone="warm"]) { background: color-mix(in srgb, var(--db-accent) 4%, var(--dm-card-bg, #fff)); border-color: color-mix(in srgb, var(--db-accent) 22%, var(--dm-border, #d5e0e5)); }
8
+ .db-card .db-card-icon { box-sizing: border-box; width: 2.5rem; height: 2.5rem; padding: .55rem; border-radius: .6rem; background: color-mix(in srgb, var(--db-accent) 10%, var(--dm-card-bg, #fff)); color: var(--db-accent); }
9
+ .db-card-icon[data-icon=""] { display: none; }
10
+ .db-card h3 { margin: 0; font-size: 1.2rem; font-weight: 650; line-height: 1.35; color: inherit; }
11
+ .db-card p { margin: 0; color: var(--dm-text-secondary, #465865); font-size: 1rem; line-height: 1.65; white-space: pre-line; }
12
+ .db-card p:empty { display: none; }
13
+ .db-card-choice { display: grid; gap: .35rem; }
14
+ .db-card-choice strong { font-size: .9rem; font-weight: 600; }
15
+ .db-card-choice + .db-card-choice { padding-top: .9rem; border-top: 1px solid var(--dm-border, #d5e0e5); }
16
+ .db-card .db-card-link { margin-top: auto; padding-top: .25rem; color: var(--dm-primary, #486b82); font-weight: 600; text-underline-offset: .2em; }
17
+ .db-card-link[href=""], .db-card-link:empty { display: none; }
18
+ .db-card-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
19
+ .db-card-image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--dm-radius-md, .5rem); }
20
+ .db-card-image[src=""] { display: none; }
@@ -0,0 +1,18 @@
1
+ <!--
2
+ domma-block-comparison-card - Comparison card with two labelled choices.
3
+
4
+ Parameters:
5
+ header - Card heading
6
+ icon - Optional Domma icon name
7
+ tone - Optional subtle accent: blue, teal, violet or warm; omitted is neutral
8
+ link - Optional link destination
9
+ label - Optional link text
10
+ first_label - First choice label
11
+ first - First choice description as plain text
12
+ second_label - Second choice label
13
+ second - Second choice description as plain text
14
+
15
+ Example:
16
+ [domma-block-comparison-card header="Find your fit" icon="layers" first_label="Choose a hosted builder" first="For a quick template website." second_label="Choose a CMS" second="For more control over your content." /]
17
+ -->
18
+ <article class="db-card" data-tone="{{tone}}"><span class="db-card-icon" data-icon="{{icon}}"></span><h3>{{header}}</h3><div class="db-card-choice"><strong>{{first_label}}</strong><p>{{first}}</p></div><div class="db-card-choice"><strong>{{second_label}}</strong><p>{{second}}</p></div><a class="db-card-link" href="{{link}}">{{label}}</a></article>
@@ -0,0 +1,7 @@
1
+ {
2
+ "bundled": true,
3
+ "adminTags": [
4
+ "domma-blocks",
5
+ "cards"
6
+ ]
7
+ }
@@ -0,0 +1,20 @@
1
+ /* Shared default card proportions; colour is opt-in and intentionally light. */
2
+ .db-card { --db-accent: var(--dm-primary, #486b82); box-sizing: border-box; height: 100%; display: flex; flex-direction: column; gap: .9rem; padding: 1.5rem; border: 1px solid var(--dm-border, #d5e0e5); border-radius: var(--dm-radius-lg, .75rem); background: var(--dm-card-bg, #fff); color: var(--dm-text, #152832); overflow-wrap: anywhere; }
3
+ .db-card[data-tone="blue"] { --db-accent: #547d99; }
4
+ .db-card[data-tone="teal"] { --db-accent: #50857b; }
5
+ .db-card[data-tone="violet"] { --db-accent: #837298; }
6
+ .db-card[data-tone="warm"] { --db-accent: #a37b59; }
7
+ .db-card:is([data-tone="blue"], [data-tone="teal"], [data-tone="violet"], [data-tone="warm"]) { background: color-mix(in srgb, var(--db-accent) 4%, var(--dm-card-bg, #fff)); border-color: color-mix(in srgb, var(--db-accent) 22%, var(--dm-border, #d5e0e5)); }
8
+ .db-card .db-card-icon { box-sizing: border-box; width: 2.5rem; height: 2.5rem; padding: .55rem; border-radius: .6rem; background: color-mix(in srgb, var(--db-accent) 10%, var(--dm-card-bg, #fff)); color: var(--db-accent); }
9
+ .db-card-icon[data-icon=""] { display: none; }
10
+ .db-card h3 { margin: 0; font-size: 1.2rem; font-weight: 650; line-height: 1.35; color: inherit; }
11
+ .db-card p { margin: 0; color: var(--dm-text-secondary, #465865); font-size: 1rem; line-height: 1.65; white-space: pre-line; }
12
+ .db-card p:empty { display: none; }
13
+ .db-card-choice { display: grid; gap: .35rem; }
14
+ .db-card-choice strong { font-size: .9rem; font-weight: 600; }
15
+ .db-card-choice + .db-card-choice { padding-top: .9rem; border-top: 1px solid var(--dm-border, #d5e0e5); }
16
+ .db-card .db-card-link { margin-top: auto; padding-top: .25rem; color: var(--dm-primary, #486b82); font-weight: 600; text-underline-offset: .2em; }
17
+ .db-card-link[href=""], .db-card-link:empty { display: none; }
18
+ .db-card-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
19
+ .db-card-image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--dm-radius-md, .5rem); }
20
+ .db-card-image[src=""] { display: none; }
@@ -0,0 +1,15 @@
1
+ <!--
2
+ domma-block-cta-card - Compact call-to-action card with a heading and link.
3
+
4
+ Parameters:
5
+ header - Card heading
6
+ icon - Optional Domma icon name
7
+ tone - Optional subtle accent: blue, teal, violet or warm; omitted is neutral
8
+ link - Optional link destination
9
+ label - Optional link text
10
+ blurb - Short invitation as plain text
11
+
12
+ Example:
13
+ [domma-block-cta-card header="Let us help" icon="mail" blurb="Tell us what you have in mind." link="/contact" label="Get in touch" /]
14
+ -->
15
+ <article class="db-card" data-tone="{{tone}}"><span class="db-card-icon" data-icon="{{icon}}"></span><h3>{{header}}</h3><p>{{blurb}}</p><a class="db-card-link" href="{{link}}">{{label}}</a></article>
@@ -0,0 +1,7 @@
1
+ {
2
+ "bundled": true,
3
+ "adminTags": [
4
+ "domma-blocks",
5
+ "cards"
6
+ ]
7
+ }
@@ -0,0 +1,20 @@
1
+ /* Shared default card proportions; colour is opt-in and intentionally light. */
2
+ .db-card { --db-accent: var(--dm-primary, #486b82); box-sizing: border-box; height: 100%; display: flex; flex-direction: column; gap: .9rem; padding: 1.5rem; border: 1px solid var(--dm-border, #d5e0e5); border-radius: var(--dm-radius-lg, .75rem); background: var(--dm-card-bg, #fff); color: var(--dm-text, #152832); overflow-wrap: anywhere; }
3
+ .db-card[data-tone="blue"] { --db-accent: #547d99; }
4
+ .db-card[data-tone="teal"] { --db-accent: #50857b; }
5
+ .db-card[data-tone="violet"] { --db-accent: #837298; }
6
+ .db-card[data-tone="warm"] { --db-accent: #a37b59; }
7
+ .db-card:is([data-tone="blue"], [data-tone="teal"], [data-tone="violet"], [data-tone="warm"]) { background: color-mix(in srgb, var(--db-accent) 4%, var(--dm-card-bg, #fff)); border-color: color-mix(in srgb, var(--db-accent) 22%, var(--dm-border, #d5e0e5)); }
8
+ .db-card .db-card-icon { box-sizing: border-box; width: 2.5rem; height: 2.5rem; padding: .55rem; border-radius: .6rem; background: color-mix(in srgb, var(--db-accent) 10%, var(--dm-card-bg, #fff)); color: var(--db-accent); }
9
+ .db-card-icon[data-icon=""] { display: none; }
10
+ .db-card h3 { margin: 0; font-size: 1.2rem; font-weight: 650; line-height: 1.35; color: inherit; }
11
+ .db-card p { margin: 0; color: var(--dm-text-secondary, #465865); font-size: 1rem; line-height: 1.65; white-space: pre-line; }
12
+ .db-card p:empty { display: none; }
13
+ .db-card-choice { display: grid; gap: .35rem; }
14
+ .db-card-choice strong { font-size: .9rem; font-weight: 600; }
15
+ .db-card-choice + .db-card-choice { padding-top: .9rem; border-top: 1px solid var(--dm-border, #d5e0e5); }
16
+ .db-card .db-card-link { margin-top: auto; padding-top: .25rem; color: var(--dm-primary, #486b82); font-weight: 600; text-underline-offset: .2em; }
17
+ .db-card-link[href=""], .db-card-link:empty { display: none; }
18
+ .db-card-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
19
+ .db-card-image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--dm-radius-md, .5rem); }
20
+ .db-card-image[src=""] { display: none; }
@@ -0,0 +1,15 @@
1
+ <!--
2
+ domma-block-feature-card - Feature card with an icon, description and optional link.
3
+
4
+ Parameters:
5
+ header - Card heading
6
+ icon - Optional Domma icon name
7
+ tone - Optional subtle accent: blue, teal, violet or warm; omitted is neutral
8
+ link - Optional link destination
9
+ label - Optional link text
10
+ blurb - Description as plain text
11
+
12
+ Example:
13
+ [domma-block-feature-card header="Everything in one place" icon="grid" blurb="Explore the features included with your site." link="/features" label="See the features" /]
14
+ -->
15
+ <article class="db-card" data-tone="{{tone}}"><span class="db-card-icon" data-icon="{{icon}}"></span><h3>{{header}}</h3><p>{{blurb}}</p><a class="db-card-link" href="{{link}}">{{label}}</a></article>
@@ -0,0 +1,7 @@
1
+ {
2
+ "bundled": true,
3
+ "adminTags": [
4
+ "domma-blocks",
5
+ "cards"
6
+ ]
7
+ }
@@ -0,0 +1,20 @@
1
+ /* Shared default card proportions; colour is opt-in and intentionally light. */
2
+ .db-card { --db-accent: var(--dm-primary, #486b82); box-sizing: border-box; height: 100%; display: flex; flex-direction: column; gap: .9rem; padding: 1.5rem; border: 1px solid var(--dm-border, #d5e0e5); border-radius: var(--dm-radius-lg, .75rem); background: var(--dm-card-bg, #fff); color: var(--dm-text, #152832); overflow-wrap: anywhere; }
3
+ .db-card[data-tone="blue"] { --db-accent: #547d99; }
4
+ .db-card[data-tone="teal"] { --db-accent: #50857b; }
5
+ .db-card[data-tone="violet"] { --db-accent: #837298; }
6
+ .db-card[data-tone="warm"] { --db-accent: #a37b59; }
7
+ .db-card:is([data-tone="blue"], [data-tone="teal"], [data-tone="violet"], [data-tone="warm"]) { background: color-mix(in srgb, var(--db-accent) 4%, var(--dm-card-bg, #fff)); border-color: color-mix(in srgb, var(--db-accent) 22%, var(--dm-border, #d5e0e5)); }
8
+ .db-card .db-card-icon { box-sizing: border-box; width: 2.5rem; height: 2.5rem; padding: .55rem; border-radius: .6rem; background: color-mix(in srgb, var(--db-accent) 10%, var(--dm-card-bg, #fff)); color: var(--db-accent); }
9
+ .db-card-icon[data-icon=""] { display: none; }
10
+ .db-card h3 { margin: 0; font-size: 1.2rem; font-weight: 650; line-height: 1.35; color: inherit; }
11
+ .db-card p { margin: 0; color: var(--dm-text-secondary, #465865); font-size: 1rem; line-height: 1.65; white-space: pre-line; }
12
+ .db-card p:empty { display: none; }
13
+ .db-card-choice { display: grid; gap: .35rem; }
14
+ .db-card-choice strong { font-size: .9rem; font-weight: 600; }
15
+ .db-card-choice + .db-card-choice { padding-top: .9rem; border-top: 1px solid var(--dm-border, #d5e0e5); }
16
+ .db-card .db-card-link { margin-top: auto; padding-top: .25rem; color: var(--dm-primary, #486b82); font-weight: 600; text-underline-offset: .2em; }
17
+ .db-card-link[href=""], .db-card-link:empty { display: none; }
18
+ .db-card-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
19
+ .db-card-image { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--dm-radius-md, .5rem); }
20
+ .db-card-image[src=""] { display: none; }
@@ -0,0 +1,17 @@
1
+ <!--
2
+ domma-block-image-card - Image card with a heading, description and optional link.
3
+
4
+ Parameters:
5
+ header - Card heading
6
+ icon - Optional Domma icon name
7
+ tone - Optional subtle accent: blue, teal, violet or warm; omitted is neutral
8
+ link - Optional link destination
9
+ label - Optional link text
10
+ blurb - Description as plain text
11
+ image - Image address from your Media library
12
+ alt - Image description
13
+
14
+ Example:
15
+ [domma-block-image-card header="Our work" blurb="Take a closer look at a recent project." image="/media/project.jpg" alt="A recent project" link="/showcase" label="View the project" /]
16
+ -->
17
+ <article class="db-card" data-tone="{{tone}}"><img class="db-card-image" src="{{image}}" alt="{{alt}}" loading="lazy" decoding="async"><span class="db-card-icon" data-icon="{{icon}}"></span><h3>{{header}}</h3><p>{{blurb}}</p><a class="db-card-link" href="{{link}}">{{label}}</a></article>
@@ -0,0 +1,7 @@
1
+ {
2
+ "bundled": true,
3
+ "adminTags": [
4
+ "domma-blocks",
5
+ "cards"
6
+ ]
7
+ }
@@ -16,18 +16,21 @@ export const DEFAULT_ADMIN_TITLE = 'Domma CMS';
16
16
 
17
17
  /**
18
18
  * @param {object} [site] - config/site.json
19
- * @returns {{title: string, logo: string, icon: string}}
19
+ * @returns {{title: string, logo: string, logoDark: string, icon: string}}
20
20
  */
21
21
  export function adminBrandFor(site = {}) {
22
22
  const own = site?.adminBrand && typeof site.adminBrand === 'object' ? site.adminBrand : {};
23
23
  // Whitespace collapsed: a title reads back that way from the browser tab.
24
24
  const str = (v) => (typeof v === 'string' ? v.replace(/[ \t\n\f\r]+/g, ' ').trim() : '');
25
25
  const logo = str(own.logo);
26
+ const logoDark = str(own.logoDark);
26
27
  return {
27
28
  enabled: own.enabled !== false,
28
29
  title: (str(own.title) || str(site?.title) || DEFAULT_ADMIN_TITLE).slice(0, 120),
29
30
  // Same rule as the sidebar header: a site path or an http(s) address, nothing else.
30
31
  logo: /^(?:\/(?!\/)|https?:\/\/)/i.test(logo) ? logo : '',
32
+ // Optional: the logo for a dark admin theme (lib/theme-aware-logo.js picks one by the theme's background).
33
+ logoDark: /^(?:\/(?!\/)|https?:\/\/)/i.test(logoDark) ? logoDark : '',
31
34
  icon: /^[a-z0-9-]{1,40}$/.test(str(own.icon)) ? str(own.icon) : ''
32
35
  };
33
36
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
  /** The players [embed] always uses. */
17
17
  // youtube.com too: the HTML sanitiser lets its iframes through, so the policy must agree.
18
- export const ALWAYS_FRAMED = ['https://www.youtube-nocookie.com', 'https://www.youtube.com', 'https://youtube.com', 'https://player.vimeo.com'];
18
+ export const ALWAYS_FRAMED = ['https://www.youtube-nocookie.com', 'https://www.youtube.com', 'https://youtube.com', 'https://player.vimeo.com', 'https://www.google.com'];
19
19
 
20
20
  /** A bare hostname, or nothing: a host in embeds.json must never smuggle in a scheme, path or wildcard. */
21
21
  const HOST_RE = /^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/;
@@ -39,7 +39,7 @@ const BLOCKS_DIR = path.resolve(__dirname_md, '../../content/blocks');
39
39
  export const BUILTIN_SHORTCODES = new Set([
40
40
  'block', 'collection', 'view', 'dconfig', 'component', 'tabs', 'tab',
41
41
  'accordion', 'item', 'carousel', 'slide', 'countdown', 'timeline',
42
- 'event', 'listgroup', 'spacer', 'center', 'icon', 'demo', 'embed', 'image', 'form', 'hero', 'table', 'badge',
42
+ 'event', 'listgroup', 'spacer', 'center', 'icon', 'demo', 'embed', 'map', 'image', 'form', 'hero', 'table', 'badge',
43
43
  'text', 'button', 'link', 'cta', 'grid', 'row', 'col', 'card', 'box',
44
44
  'banner', 'slideover', 'menu',
45
45
  // effects
@@ -2111,7 +2111,9 @@ async function processPluginShortcodes(markdown) {
2111
2111
 
2112
2112
  const {scrubbed, restore} = scrubCodeRegions(markdown);
2113
2113
  let result = scrubbed;
2114
- const context = {parseShortcodeAttrs, scrubCodeRegions, marked, processCardBlocks, processGridBlocks, escapeAttr};
2114
+ // renderMap tells a plugin with its own [map] (Blog Pro: OpenStreetMap by lat/lon) that the CMS has one too, so it can
2115
+ // hand back the tags it cannot draw (an address, a postcode) for processMapBlocks.
2116
+ const context = {parseShortcodeAttrs, scrubCodeRegions, marked, processCardBlocks, processGridBlocks, escapeAttr, renderMap};
2115
2117
 
2116
2118
  async function replaceAsync(input, regex, mapMatch) {
2117
2119
  const matches = [];
@@ -2135,13 +2137,14 @@ async function processPluginShortcodes(markdown) {
2135
2137
  // Self-closing: [name attrs /]
2136
2138
  result = await replaceAsync(
2137
2139
  result,
2138
- new RegExp(`\\[${name}([^\\]]*)\\s*\\/\\]`, 'gi'),
2140
+ // The name must end there: [map] is not [map-guess].
2141
+ new RegExp(`\\[${name}(?=[\\s/\\]])([^\\]]*)\\s*\\/\\]`, 'gi'),
2139
2142
  (_, attrStr) => handler(attrStr, null, context)
2140
2143
  );
2141
2144
  // Wrapping: [name attrs]...[/name]
2142
2145
  result = await replaceAsync(
2143
2146
  result,
2144
- new RegExp(`\\[${name}([^\\]]*)\\]([\\s\\S]*?)\\[\\/${name}\\]`, 'gi'),
2147
+ new RegExp(`\\[${name}(?=[\\s/\\]])([^\\]]*)\\]([\\s\\S]*?)\\[\\/${name}\\]`, 'gi'),
2145
2148
  (_, attrStr, body) => handler(attrStr, body, context)
2146
2149
  );
2147
2150
  }
@@ -4485,6 +4488,61 @@ function processEmbedBlocks(markdown) {
4485
4488
  ));
4486
4489
  }
4487
4490
 
4491
+ // ─── [map] - responsive Google Maps location embed ─────────────────────────
4492
+
4493
+ /** Build a safe map iframe from a location, postcode, or coordinate pin. */
4494
+ export function renderMap(attrs = {}) {
4495
+ const pin = typeof attrs.pin === 'string' ? attrs.pin.trim() : '';
4496
+ const lat = typeof attrs.lat === 'string' ? attrs.lat.trim() : '';
4497
+ const lonRaw = attrs.lon ?? attrs.lng;
4498
+ const lon = typeof lonRaw === 'string' ? lonRaw.trim() : '';
4499
+ const coordinates = pin || (lat && lon ? `${lat},${lon}` : '');
4500
+ const address = typeof attrs.address === 'string' ? attrs.address.trim() : '';
4501
+ const postcode = typeof attrs.postcode === 'string' ? attrs.postcode.trim() : '';
4502
+ const query = coordinates || address || postcode;
4503
+ if (!query || query.length > 500 || /[\u0000-\u001f]/.test(query)) {
4504
+ return _embedBlocked('Add a valid map pin, address, or postcode.');
4505
+ }
4506
+ if (coordinates && !/^[-+]?\d{1,3}(?:\.\d+)?\s*,\s*[-+]?\d{1,3}(?:\.\d+)?$/.test(coordinates)) {
4507
+ return _embedBlocked('Map pins must be latitude, longitude coordinates.');
4508
+ }
4509
+ if (coordinates) {
4510
+ const [latitude, longitude] = coordinates.split(',').map(Number);
4511
+ if (!Number.isFinite(latitude) || !Number.isFinite(longitude) || Math.abs(latitude) > 90 || Math.abs(longitude) > 180) {
4512
+ return _embedBlocked('Map pin coordinates are outside the valid range.');
4513
+ }
4514
+ }
4515
+ const parsedZoom = Number.parseInt(attrs.zoom, 10);
4516
+ const zoom = Number.isFinite(parsedZoom) ? Math.max(1, Math.min(20, parsedZoom)) : 14;
4517
+ // Use the direct embed endpoint. The /maps?q=... URL redirects here, and
4518
+ // Google marks that redirect SAMEORIGIN, which browsers can block in iframes.
4519
+ const encodedQuery = encodeURIComponent(query).replace(/%20/g, '+');
4520
+ const src = `https://www.google.com/maps/embed?origin=mfe&pb=!1m3!2m1!1s${encodedQuery}!6i${zoom}`;
4521
+ const ratio = _embedRatio(attrs.ratio);
4522
+ const titleText = String(attrs.title || address || postcode || 'Map');
4523
+ const title = escapeAttr(titleText);
4524
+ const styles = ['margin:1.5rem 0'];
4525
+ if (attrs.width) {
4526
+ const w = /^\d+%$/.test(attrs.width) ? attrs.width : `${parseInt(attrs.width, 10) || 0}px`;
4527
+ if (w !== '0px') styles.push(`max-width:${w}`);
4528
+ }
4529
+ const align = String(attrs.align || '').toLowerCase();
4530
+ if (align === 'center') styles.push('margin-left:auto', 'margin-right:auto');
4531
+ else if (align === 'right') styles.push('margin-left:auto');
4532
+ const caption = attrs.caption || attrs.title;
4533
+ return `<figure class="dm-map" style="${styles.join(';')}"><div class="dm-map-frame" style="position:relative;width:100%;aspect-ratio:${ratio}">`
4534
+ + `<iframe src="${escapeAttr(src)}" title="${title}" loading="lazy" referrerpolicy="strict-origin-when-cross-origin"`
4535
+ + ` style="position:absolute;inset:0;width:100%;height:100%;border:0" allowfullscreen></iframe></div>`
4536
+ + (caption ? `<figcaption class="dm-embed-caption">${escapeAttr(caption)}</figcaption>` : '')
4537
+ + '</figure>';
4538
+ }
4539
+
4540
+ function processMapBlocks(markdown) {
4541
+ const {scrubbed, restore} = scrubCodeRegions(markdown);
4542
+ return restore(scrubbed.replace(/\[map(?=[\s/\]])([^\]]*?)\/?\]/gi,
4543
+ (_, attrStr) => '\n' + renderMap(parseShortcodeAttrs(attrStr || '')) + '\n'));
4544
+ }
4545
+
4488
4546
  // ─── [image] - a picture with options, optionally zoomable ─────────────────
4489
4547
 
4490
4548
  const IMAGE_ALIGNS = ['left', 'center', 'right', 'float-left', 'float-right'];
@@ -5231,7 +5289,7 @@ export function sanitizePageHtml(html) {
5231
5289
  // host allow-list).
5232
5290
  allowedIframeHostnames: [
5233
5291
  'www.youtube-nocookie.com', 'www.youtube.com', 'youtube.com',
5234
- 'player.vimeo.com',
5292
+ 'player.vimeo.com', 'www.google.com',
5235
5293
  ...getEmbedAllowedHosts(),
5236
5294
  ],
5237
5295
  // sanitize-html drops a RELATIVE iframe src whenever allowedIframeHostnames
@@ -5361,7 +5419,8 @@ export async function parseMarkdown(raw, opts = {}) {
5361
5419
  const withIcon = processIconBlocks(withCenter);
5362
5420
  const withDemo = processDemoBlocks(withIcon);
5363
5421
  const withEmbed = processImageBlocks(processEmbedBlocks(withDemo));
5364
- const withForm = await processFormBlocks(withEmbed, tagSet);
5422
+ const withMap = processMapBlocks(withEmbed);
5423
+ const withForm = await processFormBlocks(withMap, tagSet);
5365
5424
  const withHero = processHeroBlocks(withForm);
5366
5425
  const withTable = processTableBlocks(withHero);
5367
5426
  const withBadge = processBadgeBlocks(withTable);
@@ -13,7 +13,7 @@ import fs from 'fs/promises';
13
13
  import path from 'path';
14
14
 
15
15
  /** As FREQUENT_MAX in admin/js/lib/sidebar-frequent.js. */
16
- export const FREQUENT_MAX = 12;
16
+ export const FREQUENT_MAX = 16;
17
17
  const URL_MAX = 500;
18
18
  const USER_ID_RE = /^[A-Za-z0-9_-]{1,80}$/;
19
19