@crombolo/api-delivery 0.43.1 → 0.44.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 (2) hide show
  1. package/package.json +4 -4
  2. package/src/forms.ts +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crombolo/api-delivery",
3
- "version": "0.43.1",
3
+ "version": "0.44.0",
4
4
  "description": "Internal to crombolo, with no compatibility promise: use @crombolo/crombolo. Umbraco's Content Delivery API for crombolo: published content and media as JSON, served from the published cache.",
5
5
  "license": "MIT",
6
6
  "author": "Crombolo",
@@ -28,8 +28,8 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@crombolo/core": "0.43.1",
32
- "@crombolo/contracts": "0.43.1",
33
- "@crombolo/render": "0.43.1"
31
+ "@crombolo/core": "0.44.0",
32
+ "@crombolo/contracts": "0.44.0",
33
+ "@crombolo/render": "0.44.0"
34
34
  }
35
35
  }
package/src/forms.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  allFormFields,
9
9
  choiceOptions,
10
10
  FORM_HONEYPOT_FIELD,
11
+ FORM_LIBRARY_FIELD,
11
12
  FORM_PAGE_FIELD,
12
13
  FORM_RENDERED_FIELD,
13
14
  FORM_TOKEN_FIELD,
@@ -89,6 +90,9 @@ export function apiForm(form: SchemaForm, context: ApiFormContext): Record<strin
89
90
  return defined({
90
91
  ...apiFormReference(form),
91
92
  stepPages: form.stepPages ?? false,
93
+ // A Library form's own words (story 239); its recipients stay on the server.
94
+ heading: form.library?.heading,
95
+ introduction: form.library?.introduction,
92
96
  submitLabel: form.submitLabel,
93
97
  nextLabel: form.nextLabel,
94
98
  previousLabel: form.previousLabel,
@@ -116,6 +120,7 @@ export function apiForm(form: SchemaForm, context: ApiFormContext): Record<strin
116
120
  fields: defined({
117
121
  [FORM_TOKEN_FIELD]: context.token,
118
122
  [FORM_RENDERED_FIELD]: String(context.renderedAt),
123
+ [FORM_LIBRARY_FIELD]: form.library?.key,
119
124
  }),
120
125
  // Sent empty: a bot fills it. Absent when the form has no honeypot.
121
126
  honeypot: form.honeypot ? FORM_HONEYPOT_FIELD : undefined,