@actuate-media/sections-react 0.2.12 → 0.2.14

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