@actuate-media/sections-react 0.2.12 → 0.2.15

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 (3) hide show
  1. package/CHANGELOG.md +217 -0
  2. package/README.md +36 -0
  3. package/package.json +4 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,217 @@
1
+ # @actuate-media/sections-react
2
+
3
+ ## 0.2.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [d6b21e7]
8
+ - @actuate-media/cms-core@0.62.0
9
+
10
+ ## 0.2.14
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [0c3a6eb]
15
+ - @actuate-media/cms-core@0.61.0
16
+
17
+ ## 0.2.13
18
+
19
+ ### Patch Changes
20
+
21
+ - 854152d: Developer experience improvements from external-consumer feedback:
22
+ - Every published package now ships its `CHANGELOG.md` in the npm tarball, and packages that were missing a `README.md` (cli, cms-admin, cms-core, import, platform-vercel, all plugins, sections-react) now have one — so release notes and usage docs are visible on npmjs.com and in `node_modules`.
23
+ - New client-safe form validation entry point: `@actuate-media/cms-core/forms/client` exports `validateFormFieldClient()`, `validateFormValuesClient()`, visibility/conditional helpers, and the exact `FORM_EMAIL_RE` / `FORM_PHONE_RE` regexes the server enforces — zero Node dependencies, so public-site forms can mirror server rules without reimplementing them. The server validator now imports the same primitives, so client and server can never drift.
24
+
25
+ - Updated dependencies [854152d]
26
+ - Updated dependencies [bf5f857]
27
+ - @actuate-media/cms-core@0.60.0
28
+
29
+ ## 0.2.12
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [15b3f45]
34
+ - @actuate-media/cms-core@0.59.1
35
+
36
+ ## 0.2.11
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [f962e2d]
41
+ - Updated dependencies [73a117a]
42
+ - @actuate-media/cms-core@0.59.0
43
+
44
+ ## 0.2.10
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [363bb3e]
49
+ - @actuate-media/cms-core@0.58.0
50
+
51
+ ## 0.2.9
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [a5f8bc0]
56
+ - @actuate-media/cms-core@0.57.1
57
+
58
+ ## 0.2.8
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [8e73cf5]
63
+ - @actuate-media/cms-core@0.57.0
64
+
65
+ ## 0.2.7
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [99565a1]
70
+ - @actuate-media/cms-core@0.56.0
71
+
72
+ ## 0.2.6
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [74662c0]
77
+ - @actuate-media/cms-core@0.55.0
78
+
79
+ ## 0.2.5
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [29f32ba]
84
+ - @actuate-media/cms-core@0.54.0
85
+
86
+ ## 0.2.4
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [aa4bd1a]
91
+ - @actuate-media/cms-core@0.53.0
92
+
93
+ ## 0.2.3
94
+
95
+ ### Patch Changes
96
+
97
+ - Updated dependencies [01eef99]
98
+ - @actuate-media/cms-core@0.52.0
99
+
100
+ ## 0.2.2
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies [aeee3a4]
105
+ - @actuate-media/cms-core@0.51.2
106
+
107
+ ## 0.2.1
108
+
109
+ ### Patch Changes
110
+
111
+ - Updated dependencies [f88a406]
112
+ - @actuate-media/cms-core@0.51.1
113
+
114
+ ## 0.2.0
115
+
116
+ ### Minor Changes
117
+
118
+ - 204da7a: WS-E (E3): media resolution + responsive images in the public render path.
119
+ - **sections-react:** new pluggable `renderImage` `RenderOptions` hook (with
120
+ exported `RenderImage`/`RenderImageProps` types and a `defaultRenderImage`).
121
+ The default emits a lazy, `decoding="async"` `<img>` and forwards intrinsic
122
+ `width`/`height` when known; a Next.js consumer can pass a `next/image`-backed
123
+ renderer for responsive `srcset` + optimization. The `feature`, `gallery`, and
124
+ post-header images now route through it (`<PostHeader>` gains an optional
125
+ `options` prop). The package stays React-only — no `next` dependency.
126
+ - **cms-core:** the `/resolve` endpoint now enriches section images with
127
+ intrinsic `width`/`height` and library `altText`, matched from `actuate_media`
128
+ by stored URL (`storageKey`/`publicUrl`). Additive and best-effort — the
129
+ stored document is never mutated and a lookup failure never breaks resolve.
130
+ `feature` sections gain `imageWidth`/`imageHeight` (+ backfilled `imageAlt`);
131
+ `gallery` rows gain `width`/`height` (+ backfilled `alt`).
132
+ - **create-actuate-cms:** the generated catch-all page renders CMS images via a
133
+ `next/image`-backed `renderImage` (falling back to a fluid `<img>` when the
134
+ CMS doesn't know dimensions), and `next.config` now allow-lists the storage
135
+ host under `images.remotePatterns` so optimization works out of the box.
136
+
137
+ - 2f18c56: WS-E (E2): public form rendering — a built site can now render and submit a CMS form end to end.
138
+ - **sections-react:** new `<ActuateForm>` Client Component fetches the public form
139
+ schema (`GET /api/cms/public/forms/:slug`), renders the fields (text/email/
140
+ url/tel/number/date, textarea, select, checkbox, radio), and submits to the
141
+ schema's `submitPath`. Spam protection is wired automatically: a hidden
142
+ honeypot (keyed from `spam.honeypotFieldKey`), an `elapsedMs` "time to submit"
143
+ timer, and an optional consumer-supplied `captchaToken`. Pre-fetch a schema via
144
+ the `form` prop to skip the round-trip (SSR/streaming). Adds a `baseUrl`
145
+ `RenderOptions` field (defaults to same-origin). Exposes pure, tested helpers
146
+ (`coercePublicForm`, `buildSubmitBody`, `fieldControl`, `firstMissingRequired`).
147
+ - **cms-core:** new canonical `form` section type. Set `content.formSlug` (plus
148
+ optional heading/intro) on any page or post and the matching renderer embeds
149
+ the form. The registry-drift guard now covers it (renderer ↔ type).
150
+ - **cms-admin:** the form Embed panel now shows the real public endpoints
151
+ (`/api/cms/public/forms/:slug` + `/submit`) and a copy-paste `<ActuateForm>`
152
+ snippet, replacing the previously-advertised `/api/forms/*`, iframe, and
153
+ `embed.js` routes that were never implemented. Adds a `mail` section icon.
154
+
155
+ - e2e0bd7: WS-E (E4): public navigation endpoint + navigation rendering in the scaffold.
156
+ - **cms-core:** new unauthenticated `GET /api/cms/public/navigations/:slug` that
157
+ returns a clean `{ name, slug, location, items }` tree. Like globals it is site
158
+ chrome — not status-gated — and safe when the navigation plugin isn't installed
159
+ (no match → 404). A shared, pure `coercePublicNavItems` helper sanitizes the
160
+ open `data.items` JSON: drops unlabeled nodes, strips internal `id`s, caps
161
+ recursion depth, and only passes through `_blank`/`_self` targets. Both
162
+ `createSiteClient` and `createServerSiteClient` gain `getNavigation(slug)`
163
+ returning `PublicNavigation | null`, and `PublicNavigation` / `PublicNavItem`
164
+ are now exported types.
165
+ - **sections-react:** new presentational `<SiteNav>` — an accessible `<nav>`
166
+ landmark whose submenus use native `<details>`/`<summary>` disclosure
167
+ (keyboard-operable, no client JS). New-tab links get
168
+ `rel="noopener noreferrer"`; an empty menu renders nothing. Exports `SiteNav`
169
+ plus `SiteNavProps`/`SiteNavItem`.
170
+ - **create-actuate-cms:** `lib/cms.ts` re-exports `getNavigation`, and the
171
+ generated site layout fetches the `main` menu and renders a header with the
172
+ site name + `<SiteNav>`, degrading gracefully to just the name when no menu
173
+ exists yet.
174
+
175
+ ### Patch Changes
176
+
177
+ - Updated dependencies [a413616]
178
+ - Updated dependencies [204da7a]
179
+ - Updated dependencies [2f18c56]
180
+ - Updated dependencies [e2e0bd7]
181
+ - @actuate-media/cms-core@0.51.0
182
+
183
+ ## 0.1.2
184
+
185
+ ### Patch Changes
186
+
187
+ - Updated dependencies [d7a144c]
188
+ - @actuate-media/cms-core@0.50.0
189
+
190
+ ## 0.1.1
191
+
192
+ ### Patch Changes
193
+
194
+ - Updated dependencies [9ba332c]
195
+ - @actuate-media/cms-core@0.49.0
196
+
197
+ ## 0.1.0
198
+
199
+ ### Minor Changes
200
+
201
+ - 989bd09: New package: a public React renderer for Actuate's canonical page-content
202
+ contract (ADR 0001 — `data.sections: PageSection[]`).
203
+ - `<Sections sections={...} ctx={...} />` renders all 10 built-in section types
204
+ (hero, text, feature, stats, cta, article-body, quote, author-bio,
205
+ related-posts, gallery) with zero hand-written mapper. SSR-first (safe in
206
+ React Server Components).
207
+ - `<PostHeader config={...} ctx={...} />` renders a post header from its
208
+ template config + the post's own fields.
209
+ - Consumer-controlled renderer registry: override any section type per-render
210
+ via the `renderers` prop, or app-wide via `registerSectionRenderer()`.
211
+ Resolution precedence: prop > global registry > built-in default > skip.
212
+ - Rich-text fields go through an injectable `options.sanitizeHtml` hook
213
+ (default identity; Actuate sanitizes on write, pass a sanitizer for
214
+ defense-in-depth or third-party HTML).
215
+ - A registry-drift guard test keeps the renderer map in lockstep with the
216
+ cms-core section registry, so no section type can ship without a renderer
217
+ (and vice-versa).
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # @actuate-media/sections-react
2
+
3
+ Public React renderer for [Actuate CMS](https://github.com/actuate-media/actuatecms)
4
+ page sections — the canonical `PageSection[]` contract — with a
5
+ consumer-controlled renderer registry.
6
+
7
+ ```bash
8
+ npm install @actuate-media/sections-react
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```tsx
14
+ import { SectionList, registerSectionRenderer } from '@actuate-media/sections-react'
15
+
16
+ // Register renderers for your custom section types (built-ins are included)
17
+ registerSectionRenderer('my-hero', ({ section, ctx, options }) => (
18
+ <MyHero {...(section.content as MyHeroContent)} />
19
+ ))
20
+
21
+ // Render a resolved page
22
+ <SectionList sections={page.sections} ctx={{ siteUrl }} />
23
+ ```
24
+
25
+ The same custom types can be made editable in the admin via
26
+ `defineSectionTypes()` + `sections.types` in `actuate.config.ts`, and rendered
27
+ in the editor canvas via `AdminRoot`'s `sectionRenderers` prop.
28
+
29
+ ## Release notes
30
+
31
+ See [CHANGELOG.md](./CHANGELOG.md) (shipped with the package) or the
32
+ [GitHub releases](https://github.com/actuate-media/actuatecms/releases).
33
+
34
+ ## License
35
+
36
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actuate-media/sections-react",
3
- "version": "0.2.12",
3
+ "version": "0.2.15",
4
4
  "description": "Public React renderer for Actuate CMS page sections — the canonical PageSection[] contract — with a consumer-controlled renderer registry.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,10 +22,11 @@
22
22
  }
23
23
  },
24
24
  "files": [
25
- "dist"
25
+ "dist",
26
+ "CHANGELOG.md"
26
27
  ],
27
28
  "dependencies": {
28
- "@actuate-media/cms-core": "0.59.1"
29
+ "@actuate-media/cms-core": "0.62.0"
29
30
  },
30
31
  "peerDependencies": {
31
32
  "react": ">=18.0.0"