domma-cms 1.6.60 → 1.7.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.
- package/CHANGELOG.md +4344 -0
- package/README.md +1 -1
- package/admin/dist/domma/domma-tools.css +3 -3
- package/admin/dist/domma/domma-tools.min.js +3 -3
- package/admin/js/lib/effect-defs.js +1 -1
- package/admin/js/lib/effects-builder.js +2 -2
- package/admin/js/lib/page-editor-reference.js +5 -5
- package/admin/js/lib/shortcode-tags.js +1 -1
- package/admin/js/templates/docs/usage-shortcodes.html +39 -0
- package/docs/DommaFeatures.md +3005 -0
- package/docs/MultiTenant.md +176 -0
- package/docs/api-reference.md +1667 -0
- package/docs/cache.md +96 -0
- package/docs/configuration.md +1811 -0
- package/docs/editions-and-licences.md +190 -0
- package/docs/getting-started.md +201 -0
- package/docs/guides/form-triggers.md +260 -0
- package/docs/guides/mongodb-storage-adapter.md +282 -0
- package/docs/guides/multi-page-forms.md +121 -0
- package/docs/images/scribe-composer.png +0 -0
- package/docs/markdown-shortcodes.md +1738 -0
- package/docs/pentest-report-2026-04-03.md +181 -0
- package/docs/plans/2026-02-28-admin-topbar-login-forms.md +349 -0
- package/docs/plans/2026-02-28-domma-ui-polish.md +286 -0
- package/docs/plans/2026-02-28-reset-seed-fresh-commands.md +520 -0
- package/docs/plans/2026-03-02-cookie-consent-design.md +86 -0
- package/docs/plans/2026-03-02-cookie-consent-plugin.md +453 -0
- package/docs/plans/2026-03-02-tooltip-sweep-and-back-to-top-plugin-design.md +126 -0
- package/docs/plans/2026-03-02-tooltip-sweep-back-to-top.md +427 -0
- package/docs/plans/2026-03-05-cookie-consent-btt-core.md +115 -0
- package/docs/plans/2026-03-05-custom-css-migrate-to-core-design.md +35 -0
- package/docs/plans/2026-03-05-custom-css-migrate-to-core.md +352 -0
- package/docs/plans/2026-03-05-scribe-script-shortcode.md +373 -0
- package/docs/plans/2026-03-05-user-types-design.md +139 -0
- package/docs/plans/2026-03-05-user-types-implementation.md +1035 -0
- package/docs/plans/2026-03-09-page-editor-view-cta-inserts-design.md +78 -0
- package/docs/plans/2026-03-09-page-editor-view-cta-inserts.md +388 -0
- package/docs/plans/2026-03-09-pro-documentation-design.md +80 -0
- package/docs/plans/2026-03-09-pro-documentation.md +1017 -0
- package/docs/plans/2026-06-10-core-project-design.md +240 -0
- package/docs/plugin-development.md +827 -0
- package/docs/recruitment-recipe.md +501 -0
- package/docs/scaffolding.md +312 -0
- package/docs/screenshots/calculator-floating.png +0 -0
- package/docs/screenshots/calculator-standard.png +0 -0
- package/docs/screenshots/email-settings.png +0 -0
- package/docs/screenshots/messages-count.png +0 -0
- package/docs/structure/user-types.md +107 -0
- package/docs/superpowers/plans/2026-05-25-admin-sidebar-via-menus.md +1112 -0
- package/docs/superpowers/plans/2026-06-08-navbar-mobile-drawer-and-menu-enrichment.md +1161 -0
- package/docs/superpowers/plans/2026-06-25-domma-docs-project.md +695 -0
- package/docs/superpowers/plans/2026-06-26-surveys-HANDOFF.md +68 -0
- package/docs/superpowers/plans/2026-06-26-surveys-pro-plugin.md +1902 -0
- package/docs/superpowers/plans/2026-08-19-collection-context-sort-export.md +1577 -0
- package/docs/superpowers/plans/2026-10-09-content-api.md +1192 -0
- package/docs/superpowers/specs/2026-03-12-form-followup-actions-design.md +152 -0
- package/docs/superpowers/specs/2026-03-12-page-editor-form-insert-and-per-page-theme-design.md +115 -0
- package/docs/superpowers/specs/2026-03-17-nav-hidden-items-design.md +85 -0
- package/docs/superpowers/specs/2026-03-19-accordion-insert-design.md +175 -0
- package/docs/superpowers/specs/2026-03-25-static-block-shortcode-design.md +153 -0
- package/docs/superpowers/specs/2026-03-25-text-shortcode-design.md +168 -0
- package/docs/superpowers/specs/2026-04-05-card-builder-design.md +315 -0
- package/docs/superpowers/specs/2026-04-06-insert-builders-design.md +278 -0
- package/docs/superpowers/specs/2026-04-06-layouts-design.md +226 -0
- package/docs/superpowers/specs/2026-04-07-blog-plugin-design.md +300 -0
- package/docs/superpowers/specs/2026-04-07-calendar-plugin-design.md +538 -0
- package/docs/superpowers/specs/2026-04-17-components-area-design.md +368 -0
- package/docs/superpowers/specs/2026-05-02-effects-slideover-overhaul-design.md +193 -0
- package/docs/superpowers/specs/2026-05-06-dashboard-rebuild-design.md +257 -0
- package/docs/superpowers/specs/2026-05-24-menus-design.md +466 -0
- package/docs/superpowers/specs/2026-05-25-admin-sidebar-via-menus-design.md +358 -0
- package/docs/superpowers/specs/2026-05-25-projects-design.md +380 -0
- package/docs/superpowers/specs/2026-06-08-navbar-mobile-drawer-and-menu-enrichment-design.md +292 -0
- package/docs/superpowers/specs/2026-06-08-sidebar-tools-plugins-folders-design.md +59 -0
- package/docs/superpowers/specs/2026-06-25-domma-docs-project-design.md +192 -0
- package/docs/superpowers/specs/2026-06-26-domma-charts-upstream-proposal.md +44 -0
- package/docs/superpowers/specs/2026-06-26-manager-scheduler-upstream-proposal.md +46 -0
- package/docs/superpowers/specs/2026-06-26-surveys-pro-plugin-design.md +206 -0
- package/docs/superpowers/specs/2026-07-02-shortcode-context-menu-design.md +96 -0
- package/docs/superpowers/specs/2026-08-19-collection-context-sort-export-design.md +330 -0
- package/docs/superpowers/specs/2026-09-22-dcms-marketplace-design.md +1150 -0
- package/docs/superpowers/specs/2026-10-09-content-api-design.md +325 -0
- package/docs/superpowers/specs/plans/2026-03-12-form-followup-actions.md +624 -0
- package/docs/superpowers/specs/plans/2026-03-12-page-editor-form-insert-and-per-page-theme.md +125 -0
- package/docs/superpowers/specs/plans/2026-03-17-nav-hidden-items.md +578 -0
- package/docs/superpowers/specs/plans/2026-03-19-accordion-insert.md +635 -0
- package/docs/superpowers/specs/plans/2026-03-25-text-shortcode.md +545 -0
- package/docs/superpowers/specs/plans/2026-04-05-card-builder.md +1970 -0
- package/docs/superpowers/specs/plans/2026-04-06-insert-builders.md +1049 -0
- package/docs/superpowers/specs/plans/2026-04-06-layouts.md +1015 -0
- package/docs/superpowers/specs/plans/2026-04-07-calendar-plugin.md +1526 -0
- package/docs/superpowers/specs/plans/2026-04-08-plugin-monetisation-split.md +242 -0
- package/docs/superpowers/specs/plans/2026-04-17-components-area.md +2038 -0
- package/docs/superpowers/specs/plans/2026-05-02-effects-slideover-overhaul.md +2335 -0
- package/docs/superpowers/specs/plans/2026-05-06-dashboard-rebuild.md +1999 -0
- package/docs/superpowers/specs/plans/2026-05-17-cache-system.md +1436 -0
- package/docs/superpowers/specs/plans/2026-05-24-menus.md +3096 -0
- package/docs/superpowers/specs/plans/2026-05-25-projects.md +2869 -0
- package/docs/superpowers/specs/plans/2026-09-22-marketplace-step2-consolidation.md +505 -0
- package/docs/superpowers/specs/plans/2026-09-22-marketplace-step3-catalogue-and-key.md +154 -0
- package/docs/superpowers/specs/plans/2026-09-22-tools-promotion.md +260 -0
- package/docs/theming.md +320 -0
- package/package.json +2 -2
- package/public/js/celebrations/core/canvas.js +1 -1
- package/public/js/celebrations/index.js +1 -1
- package/public/js/celebrations/licenses/ABeeZee-Regular-OFL.txt +93 -0
- package/public/js/celebrations/licenses/Allura-Regular-OFL.txt +93 -0
- package/public/js/celebrations/message-attrs.mjs +1 -0
- package/public/js/celebrations/themes/anniversary.js +1 -0
- package/public/js/celebrations/themes/autumn.js +1 -0
- package/public/js/celebrations/themes/birthday.js +1 -0
- package/public/js/celebrations/themes/butterfly-flight.js +1 -0
- package/public/js/celebrations/themes/calendar.js +1 -0
- package/public/js/celebrations/themes/chinese-new-year-dates.js +1 -0
- package/public/js/celebrations/themes/chinese-new-year.js +1 -0
- package/public/js/celebrations/themes/christmas.js +1 -1
- package/public/js/celebrations/themes/easter.js +1 -0
- package/public/js/celebrations/themes/garden-drawing.js +1 -0
- package/public/js/celebrations/themes/garden.js +1 -0
- package/public/js/celebrations/themes/graduation.js +1 -0
- package/public/js/celebrations/themes/greeting.js +1 -0
- package/public/js/celebrations/themes/make-it-rain.js +1 -0
- package/public/js/celebrations/themes/money-rain.js +1 -0
- package/public/js/celebrations/themes/new-year.js +1 -0
- package/public/js/celebrations/themes/occasion-drawing.js +1 -0
- package/public/js/celebrations/themes/occasions.js +1 -0
- package/public/js/celebrations/themes/rain-control.js +1 -0
- package/public/js/celebrations/themes/sparkler-font-data.js +1 -0
- package/public/js/celebrations/themes/sparkler-font.js +1 -0
- package/public/js/celebrations/themes/sparkler-writing.js +1 -0
- package/public/js/celebrations/themes/summer-garden.js +1 -0
- package/public/js/celebrations/themes/winter.js +1 -0
- package/public/js/celebrations/trait-data.mjs +1 -1
- package/public/js/effects.js +1 -1
- package/scripts/build.js +4 -0
- package/server/services/markdown.js +5 -2
- package/server/templates/page.html +1 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Page Editor: Form Insert & Per-Page Theme - Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan.
|
|
4
|
+
|
|
5
|
+
**Goal:** Add a Form shortcode to the page editor Insert dropdown (server-side inline-schema embed) and allow individual pages to override the global site theme via frontmatter.
|
|
6
|
+
|
|
7
|
+
**Architecture:** Feature 1 upgrades the existing processFormBlocks() in markdown.js from a client-side slug reference to a server-side base64-encoded schema embed, adds a Form picker to the admin toolbar, and hydrates the embed in site.js. Feature 2 adds a theme frontmatter field read by renderer.js and a theme select in the page editor UI.
|
|
8
|
+
|
|
9
|
+
**Tech Stack:** Node.js ESM (Fastify 5), Domma SPA (admin), vanilla JS (public site), gray-matter, marked, sanitize-html.
|
|
10
|
+
|
|
11
|
+
**Spec:** docs/superpowers/specs/2026-03-12-page-editor-form-insert-and-per-page-theme-design.md
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Chunk 1: Form Insert Shortcode
|
|
16
|
+
|
|
17
|
+
### Task 1: Upgrade processFormBlocks to server-side inline schema
|
|
18
|
+
|
|
19
|
+
**Files:**
|
|
20
|
+
- Modify: server/services/markdown.js (lines 1082-1095 and 1300)
|
|
21
|
+
|
|
22
|
+
Context: processFormBlocks currently outputs a client-side div placeholder. We need it to read the form JSON from disk and embed the schema as base64 in the HTML, matching the dconfig pattern. readFile is already imported. FORMS_DIR is path.resolve(__dirname_md, '../../content/forms').
|
|
23
|
+
|
|
24
|
+
- [ ] Step 1: Replace the entire processFormBlocks function (lines 1082-1095) with an async version that reads content/forms/{slug}.json, base64-encodes it via Buffer.from(JSON.stringify(form)).toString('base64'), and outputs: <div class="cms-form-embed" data-form-inline="{encoded}"></div>. On file-not-found, output an error placeholder div with the slug visible. Support optional title attribute to override form.title before encoding.
|
|
25
|
+
|
|
26
|
+
- [ ] Step 2: On line 1300, add await before processFormBlocks(withIcon) since it is now async.
|
|
27
|
+
|
|
28
|
+
- [ ] Step 3: Verify with curl - POST to /api/pages/preview with body {"markdown":"[form slug=\"to-do\" /]"} and confirm the response contains data-form-inline= with a base64 string.
|
|
29
|
+
|
|
30
|
+
- [ ] Step 4: Commit: "feat: upgrade processFormBlocks to server-side inline schema embed"
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
### Task 2: Hydrate form embeds in site.js
|
|
35
|
+
|
|
36
|
+
**Files:**
|
|
37
|
+
- Modify: public/js/site.js (append after closing }()); of enhanceCollectionTables at line 412)
|
|
38
|
+
|
|
39
|
+
Context: site.js uses IIFE patterns for progressive enhancement. F.render is the Domma form renderer. The decoded form object has slug, fields, settings. Submissions POST to /api/forms/submit/:slug.
|
|
40
|
+
|
|
41
|
+
- [ ] Step 5: Append a hydrateFormEmbeds IIFE after enhanceCollectionTables. It should: find all [data-form-inline] elements; decode each with atob + JSON.parse; build a blueprint object from form.fields (same field mapping as the admin preview - type, label, required, placeholder, helper, options, spread formConfig); call F.render(el, blueprint, {}, { submitText, layout, columns, onSubmit }) where onSubmit POSTs to /api/forms/submit/{form.slug} with JSON body.
|
|
42
|
+
|
|
43
|
+
- [ ] Step 6: Test in browser - add [form slug="to-do" /] to a published page, save, visit the public URL. Confirm the form renders and a submission creates a collection entry.
|
|
44
|
+
|
|
45
|
+
- [ ] Step 7: Commit: "feat: hydrate cms-form-embed elements in site.js"
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### Task 3: Add Form to the Insert dropdown
|
|
50
|
+
|
|
51
|
+
**Files:**
|
|
52
|
+
- Modify: admin/js/lib/markdown-toolbar.js
|
|
53
|
+
|
|
54
|
+
Context: The toolbar has a handlers map and onXxx(cb) registration pattern. The collection action delegates to handlers.collection(ta). Add the same for form.
|
|
55
|
+
|
|
56
|
+
- [ ] Step 8: Add {label: 'Form', icon: 'file-text', action: 'form'} to the Insert dropdown items array after CTA Button.
|
|
57
|
+
|
|
58
|
+
- [ ] Step 9: Add form: null to the handlers object (line 662).
|
|
59
|
+
|
|
60
|
+
- [ ] Step 10: Add an else-if branch for action === 'form' in executeAction (after the cta branch): call handlers.form(ta) if set, otherwise insert [form slug="" /] as a fallback.
|
|
61
|
+
|
|
62
|
+
- [ ] Step 11: Add onForm(cb) { handlers.form = cb; } to the createToolbar return object after onCta.
|
|
63
|
+
|
|
64
|
+
- [ ] Step 12: Commit: "feat: add Form entry to Insert dropdown in markdown toolbar"
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### Task 4: Wire Form picker modal in page-editor.js
|
|
69
|
+
|
|
70
|
+
**Files:**
|
|
71
|
+
- Modify: admin/js/views/page-editor.js (after toolbar.onCollection callback)
|
|
72
|
+
|
|
73
|
+
Context: The collection picker pattern (lines 969-1070): fetch list, build DOM wrapper, open E.modal with light DOM projection, insert shortcode on confirm. Follow identical pattern for forms - simpler as it only needs a select + insert button.
|
|
74
|
+
|
|
75
|
+
- [ ] Step 13: Confirm insertAtCursor is in the import from markdown-toolbar.js at the top of the file. Add it if missing.
|
|
76
|
+
|
|
77
|
+
- [ ] Step 14: Add toolbar.onForm(async (ta) => { ... }) after toolbar.onCollection closes. The callback should: fetch /forms via api.request('GET', '/forms'); build a div wrapper with a form select (one option per form: value=slug, text=title); add an Insert Form button; open E.modal({title: 'Insert Form', size: 'sm'}) and project the wrapper via modal.element.appendChild(wrapper); on Insert Form click, call insertAtCursor(ta, [form slug="{slug}" /]) and close the modal.
|
|
78
|
+
|
|
79
|
+
- [ ] Step 15: Test: open page editor, click Insert > Form, confirm modal appears with form list, select and insert, confirm shortcode appears in editor.
|
|
80
|
+
|
|
81
|
+
- [ ] Step 16: Commit: "feat: add form picker modal to page editor Insert dropdown"
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Chunk 2: Per-Page Theme
|
|
86
|
+
|
|
87
|
+
### Task 5: Per-page theme in renderer.js
|
|
88
|
+
|
|
89
|
+
**Files:**
|
|
90
|
+
- Modify: server/services/renderer.js (line 75)
|
|
91
|
+
|
|
92
|
+
Context: All page frontmatter fields are on the page object directly (page.title, page.layout, etc.). One-line change to the activeTheme assignment.
|
|
93
|
+
|
|
94
|
+
- [ ] Step 17: Confirm frontmatter fields are top-level on page by reading renderer.js lines 39-55.
|
|
95
|
+
|
|
96
|
+
- [ ] Step 18: Change line 75 from:
|
|
97
|
+
const activeTheme = site.theme || 'charcoal-dark';
|
|
98
|
+
to:
|
|
99
|
+
const activeTheme = page.theme || site.theme || 'charcoal-dark';
|
|
100
|
+
|
|
101
|
+
- [ ] Step 19: Test - manually add "theme: ocean-dark" to a page's frontmatter file, then curl the public page URL and grep for dm-theme-ocean-dark.
|
|
102
|
+
|
|
103
|
+
- [ ] Step 20: Commit: "feat: support per-page theme override via frontmatter"
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### Task 6: Theme select in the page editor admin UI
|
|
108
|
+
|
|
109
|
+
**Files:**
|
|
110
|
+
- Modify: admin/js/templates/page-editor.html (after Visibility row at line 93)
|
|
111
|
+
- Modify: admin/js/views/page-editor.js (populate on load, include in save)
|
|
112
|
+
|
|
113
|
+
Context: Add a Theme Override select with a blank "Use site default" option plus all Domma themes. On save, omit the key when blank to keep frontmatter clean.
|
|
114
|
+
|
|
115
|
+
- [ ] Step 21: In page-editor.html, insert a new row after the Category/Visibility row (line 93) with a select#field-theme. Options: blank "Use site default", then all themes: charcoal-dark/light, ocean-dark/light, forest-dark/light, sunset-dark/light, royal-dark/light, lemon-dark/light, silver-dark/light, grayve-dark/light. Include a small hint: "Overrides the site-wide theme for this page only."
|
|
116
|
+
|
|
117
|
+
- [ ] Step 22: In page-editor.js in the if (page) populate block (around line 749), add:
|
|
118
|
+
$container.find('#field-theme').val(page.theme || '');
|
|
119
|
+
|
|
120
|
+
- [ ] Step 23: In the frontmatter object (around line 1401), add conditional theme spread:
|
|
121
|
+
...(($container.find('#field-theme').val()) ? {theme: $container.find('#field-theme').val()} : {}),
|
|
122
|
+
|
|
123
|
+
- [ ] Step 24: Test full flow: select Ocean Dark in editor, save, visit public page, confirm ocean-dark theme applied. Reset to blank, save, confirm site default restores.
|
|
124
|
+
|
|
125
|
+
- [ ] Step 25: Commit: "feat: add per-page theme override select to page editor"
|