@form-engine-ts/core 1.1.0 → 2.1.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/README.md +19 -1
- package/dist/index.cjs +432 -89
- package/dist/index.d.cts +71 -11
- package/dist/index.d.ts +71 -11
- package/dist/index.js +431 -89
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,11 +30,29 @@ Add `pages` to partition every field into an accessible wizard and use `validate
|
|
|
30
30
|
for step-scoped validation. Schemas without `pages` remain single-page forms.
|
|
31
31
|
|
|
32
32
|
Store authoring-time translations on forms, fields, options, and pages. `resolveLocalizedSchema` applies them synchronously,
|
|
33
|
-
while `populateSchemaTranslations` fills them through an injected `AsyncTranslationAdapter`.
|
|
33
|
+
while `populateSchemaTranslations` fills them through an injected `AsyncTranslationAdapter`. Population defaults to
|
|
34
|
+
`overwrite: "missing-only"`, accepts per-slot `shouldOverwrite` and `createMetadata` callbacks, and returns
|
|
35
|
+
`{ schema, report }` with updated and skipped translation slots.
|
|
36
|
+
|
|
37
|
+
Forms, pages, fields, options, and submissions accept JSON-only `metadata` and per-locale/property
|
|
38
|
+
`translationMetadata`. These extension values survive sanitization, localization, submission creation, and storage
|
|
39
|
+
round-trips. `completionMessage` is localized with the rest of the form text.
|
|
40
|
+
|
|
41
|
+
`transformFieldType` changes a question's type without discarding source text, translations, conditions, or extension
|
|
42
|
+
metadata. `validateFormSchema(schema, { policy })` applies the framework-independent `FormPolicy`, including field,
|
|
43
|
+
option, text, serialized-byte, allowed-type, and required-locale constraints. Required locales cover every source text
|
|
44
|
+
that exists on the form, its fields, options, and pages.
|
|
45
|
+
|
|
46
|
+
Translation callbacks receive `nodeMetadata` and `existingTranslationMetadata` separately. The deprecated `metadata`
|
|
47
|
+
slot property remains an alias for `nodeMetadata` during migration.
|
|
34
48
|
|
|
35
49
|
`calculateCrossTabulation` builds a two-question frequency matrix from submissions. `dispatchWebhook` posts typed
|
|
36
50
|
`response.submitted` or `schema.updated` events with timeout handling, custom headers, and optional HMAC-SHA256 signing.
|
|
37
51
|
|
|
52
|
+
CSV export neutralizes string cells whose first non-whitespace character is `=`, `+`, `-`, or `@`. This is enabled by
|
|
53
|
+
default; trusted callers can pass `{ neutralizeFormulas: false }`. RFC 4180 quoting and the UTF-8 BOM remain unchanged.
|
|
54
|
+
The columns are exactly `submissionId`, `submittedAt`, `locale`, followed by one column per field in schema order.
|
|
55
|
+
|
|
38
56
|
Storage adapters share inclusive ISO 8601 submission-range filtering:
|
|
39
57
|
|
|
40
58
|
```ts
|