domma-cms 1.66.9 → 1.67.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 +15 -0
- package/admin/css/admin.css +1 -1
- package/admin/js/lib/actions-arrange.js +1 -1
- package/admin/js/lib/collections-arrange.js +1 -1
- package/admin/js/lib/forms-arrange.js +1 -1
- package/admin/js/lib/menus-arrange.js +1 -1
- package/admin/js/lib/page-editor-reference.js +1 -1
- package/admin/js/lib/projects-arrange.js +1 -1
- package/admin/js/lib/rich-field.js +9 -0
- package/admin/js/lib/views-arrange.js +1 -1
- package/admin/js/templates/docs/usage-shortcodes-components.html +4 -4
- package/admin/js/templates/docs/usage-shortcodes-content.html +1 -1
- package/admin/js/templates/docs/usage-shortcodes-effects.html +23 -6
- package/admin/js/templates/docs/usage-shortcodes-layout.html +3 -3
- package/admin/js/templates/effects.html +1 -1
- package/admin/js/templates/project-detail.html +1 -1
- package/admin/js/templates/view-preview.html +1 -1
- package/admin/js/views/action-editor.js +2 -2
- package/admin/js/views/collection-editor.js +4 -4
- package/admin/js/views/collection-entries.js +4 -4
- package/admin/js/views/form-editor.js +5 -5
- package/admin/js/views/menu-editor.js +5 -5
- package/admin/js/views/project-detail.js +2 -2
- package/admin/js/views/project-settings.js +1 -1
- package/admin/js/views/projects.js +3 -3
- package/admin/js/views/view-editor.js +1 -1
- package/admin/js/views/view-preview.js +1 -1
- package/docs/DommaFeatures.md +8 -0
- package/docs/markdown-shortcodes.md +15 -10
- package/docs/plugin-development.md +27 -0
- package/package.json +1 -1
- package/public/css/site.css +1 -1
- package/public/js/effects.js +1 -1
- package/public/js/rich-text.mjs +9 -0
- package/server/routes/api/forms.js +3 -1
- package/server/services/actions.js +3 -1
- package/server/services/collections.js +6 -1
- package/server/services/forms.js +2 -1
- package/server/services/markdown.js +107 -35
- package/server/services/menus.js +3 -2
- package/server/services/projects.js +3 -2
- package/server/services/richText.js +98 -0
- package/server/services/views.js +3 -1
- package/server/templates/page.html +2 -2
|
@@ -247,8 +247,8 @@ with either, so pick a lighter or darker shade for body text. Anything else in `
|
|
|
247
247
|
text, links, code and footer on it.
|
|
248
248
|
|
|
249
249
|
A header is never drawn: `title`, `subtitle`, `icon`, `image` and `layout` are ignored. Effects that go on a
|
|
250
|
-
`[card]` (`reveal`, `pulse`, …) go on a `[box]` too. A `[card]` can sit inside a `[box]
|
|
251
|
-
`[card]
|
|
250
|
+
`[card]` (`reveal`, `pulse`, …) go on a `[box]` too. A `[card]` can sit inside a `[box]`, a `[box]` inside a
|
|
251
|
+
`[card]`, and a `[box]` inside another `[box]`. `rounded="xs"` is also available on `[card]`.
|
|
252
252
|
|
|
253
253
|
---
|
|
254
254
|
|
|
@@ -562,7 +562,7 @@ The following shortcodes are also available in page Markdown:
|
|
|
562
562
|
```
|
|
563
563
|
|
|
564
564
|
Attributes on `[tabs]`: `style` (`"pills"`, `"bordered"`, or default underline), `align` (`"center"` or `"right"`),
|
|
565
|
-
`fade
|
|
565
|
+
`id`. Panels always fade in - Domma's tabs do it themselves, so there is no switch for it.
|
|
566
566
|
Attributes on `[tab]`: `title`, `icon` (Domma icon name shown before the title).
|
|
567
567
|
|
|
568
568
|
---
|
|
@@ -754,9 +754,10 @@ The site will be read-only on **Sunday** from 8am.
|
|
|
754
754
|
| `class` | Extra CSS classes on the banner |
|
|
755
755
|
|
|
756
756
|
`[banner]` also accepts injected effects (`reveal`, `pulse`, `shake`, `ambient`, `animate`) - see
|
|
757
|
-
[Effect injection](#effect-injection). It is processed late (after `[card]` and `[grid]`),
|
|
758
|
-
|
|
759
|
-
|
|
757
|
+
[Effect injection](#effect-injection). It is processed late (after `[card]` and `[grid]`), when a container has already turned
|
|
758
|
+
its body into HTML, so the opening tag's attributes are put aside before the containers run (`holdBannerTags()`) and
|
|
759
|
+
given back at the banner stage. A banner can therefore sit inside a card, box, column, tab, accordion item or
|
|
760
|
+
slideover. A `[banner]` tag that appears later (from a plugin shortcode, say) is read as written, without that help.
|
|
760
761
|
|
|
761
762
|
---
|
|
762
763
|
|
|
@@ -1706,9 +1707,9 @@ The following shortcodes are provided by the built-in Effects system.
|
|
|
1706
1707
|
| `[pulse]...[/pulse]` | Repeating scale pulse |
|
|
1707
1708
|
| `[shake]...[/shake]` | One-shot shake |
|
|
1708
1709
|
| `[scribe speed="50"]...[/scribe]` | Typewriter - simple mode (text typed letter by letter) |
|
|
1709
|
-
| `[scramble]...[/scramble]`
|
|
1710
|
+
| `[scramble speed loop loop-delay]...[/scramble]` | Character-scramble reveal; `loop` replays it after `loop-delay` ms (default 2000) |
|
|
1710
1711
|
| `[counter to="100" /]` | Animated number counter (self-closing) |
|
|
1711
|
-
| `[ripple]...[/ripple]`
|
|
1712
|
+
| `[ripple colour duration opacity]...[/ripple]` | Click-triggered ripple; `opacity` (0-1) is how strong it starts |
|
|
1712
1713
|
| `[twinkle count="50"]...[/twinkle]` | Particle/star overlay |
|
|
1713
1714
|
| `[ticker-tape palette="festive" /]` | Falling ticker-tape strips - self-closing for full-page, wrapping form for container-scoped |
|
|
1714
1715
|
| `[butterflies palette="meadow" /]` | Flapping butterflies wander and rise - self-closing for full-page, wrapping form for container-scoped |
|
|
@@ -1862,6 +1863,10 @@ Fast, file-based and friendly.
|
|
|
1862
1863
|
[button href="/contact" pulse]Get in touch[/button]
|
|
1863
1864
|
```
|
|
1864
1865
|
|
|
1866
|
+
`animate` and `ambient` are CSS only. As switches they emit the same classes as their tags
|
|
1867
|
+
(`animate-type="zoom-in"` gives `animate-zoom-in`; `ambient-type="wave"` gives `bg-ambient-wave`) rather than a
|
|
1868
|
+
`dm-fx-*` class, and with no type they default to `fade-in` and `aurora`.
|
|
1869
|
+
|
|
1865
1870
|
| Host tag | Effects that can be injected |
|
|
1866
1871
|
|---|---|
|
|
1867
1872
|
| `[card]`, `[box]` | `reveal`, `breathe`, `pulse`, `shake`, `twinkle`, `ambient`, `animate`, `ripple` |
|
|
@@ -1920,8 +1925,8 @@ Container tags render their own bodies as they go: effect wrappers, `[tabs]`, `[
|
|
|
1920
1925
|
`[text]`, `[button]`, `[link]`, `[cta]`) and `[grid]`/`[card]` over their body before Markdown, so those work inside
|
|
1921
1926
|
all of them. `[center]` leaves its body as Markdown for the later stages, so anything processed after it works
|
|
1922
1927
|
inside it. Tags processed before a container (components, collections, views, blocks, menus) are already HTML by
|
|
1923
|
-
the time the container sees them, so they can be nested anywhere. `[banner]` runs after `[card]` and `[grid]`,
|
|
1924
|
-
|
|
1928
|
+
the time the container sees them, so they can be nested anywhere. `[banner]` runs after `[card]` and `[grid]`, but
|
|
1929
|
+
its attributes are held aside before they run, so it nests inside them too. Do not nest `[slideover]` inside another `[slideover]`. Cards, boxes, grids, rows, columns and background sections support balanced nesting.
|
|
1925
1930
|
|
|
1926
1931
|
### Optional Christmas elf scenes
|
|
1927
1932
|
|
|
@@ -764,6 +764,33 @@ nothing was stored (an end-form set not to record) - treat that as not sent. An
|
|
|
764
764
|
`meta.updatedAt` with `meta.createdAt` if the answers must be as sent. When the person's data is erased, use
|
|
765
765
|
`removeFormEntry`, and `formEntriesBy(form, userId)` for the entries they sent but your plugin never used. Feature-detect an older core: `import('../../server/services/formContext.js').catch(() => null)`.
|
|
766
766
|
|
|
767
|
+
## Rich text Description fields
|
|
768
|
+
|
|
769
|
+
A Tool's Description field should be the shared rich text editor, not a bare textarea.
|
|
770
|
+
|
|
771
|
+
**Admin view** - keep the `<textarea>` in your template and, once it is in the page, call:
|
|
772
|
+
|
|
773
|
+
```js
|
|
774
|
+
import {richDescription, showRichText, richTextSummary} from '/admin/js/lib/rich-field.js';
|
|
775
|
+
|
|
776
|
+
richDescription(root.querySelector('#my-description')); // before or after M.applyBindings
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
The textarea stays the field: its `.value` is the editor's HTML (or `''` when empty), `data-model` bindings and `.val()` work as before, and it fires `input` and `change`. Remove any `maxlength` assumptions: the value now includes markup. To show a stored description in the admin use `showRichText(el, value)`; for a list row or a search use `richTextSummary(value, 140)` - never `innerHTML`.
|
|
780
|
+
|
|
781
|
+
**Server** - a description is one string, plain (typed before, or from an API client) or rich (from the editor):
|
|
782
|
+
|
|
783
|
+
```js
|
|
784
|
+
import {cleanRichText, renderRichText, richTextToPlain, richTextSummary} from '../../server/services/richText.js';
|
|
785
|
+
|
|
786
|
+
record.description = cleanRichText(body.description, {max: 4000}); // on save
|
|
787
|
+
const html = renderRichText(record.description); // into a page or an HTML email: already safe, do not escape it again
|
|
788
|
+
const meta = richTextSummary(record.description, 160); // meta description, list row
|
|
789
|
+
const text = richTextToPlain(record.description); // plain email, CSV, ICS, JSON-LD, search
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
Do not collapse whitespace or strip characters from the value before `cleanRichText`, and do not pass it through `escapeHtml` on a page: `renderRichText` escapes a plain description and cleans a rich one. Public scripts can import `/public/js/rich-text.mjs` for `isRichText`, `richTextToPlain` and `richTextSummary`; it does no cleaning, so use the server's `renderRichText` output for anything drawn as HTML.
|
|
793
|
+
|
|
767
794
|
## AI Assist: listing your AI chats
|
|
768
795
|
|
|
769
796
|
A Tool with its own AI chats (the Site Builder's conversations, the Tool Builder's builds) can list them on
|