@marktiderman/genesis-forms 0.5.0 → 0.6.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 +128 -0
- package/dist/destinations.cjs +55 -3
- package/dist/destinations.cjs.map +1 -1
- package/dist/destinations.d.cts +1 -1
- package/dist/destinations.d.ts +1 -1
- package/dist/destinations.js +55 -3
- package/dist/destinations.js.map +1 -1
- package/dist/{engine-BDq0XJ21.d.cts → engine-CpfOz8FN.d.ts} +10 -3
- package/dist/{engine-Qzp6bX6O.d.ts → engine-DC4YTPdr.d.cts} +10 -3
- package/dist/index.cjs +484 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -7
- package/dist/index.d.ts +29 -7
- package/dist/index.js +461 -63
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +541 -21
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +193 -3
- package/dist/server.d.ts +193 -3
- package/dist/server.js +522 -22
- package/dist/server.js.map +1 -1
- package/dist/testing.cjs +314 -21
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +4 -4
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +314 -21
- package/dist/testing.js.map +1 -1
- package/dist/{types-BhYUbLJ-.d.cts → types-oAckGR_Z.d.cts} +10 -0
- package/dist/{types-BhYUbLJ-.d.ts → types-oAckGR_Z.d.ts} +10 -0
- package/dist/validate-B5WKHbst.d.cts +322 -0
- package/dist/validate-GpTXPwyl.d.ts +322 -0
- package/package.json +1 -1
- package/dist/validate-Bs1lyoOl.d.ts +0 -131
- package/dist/validate-BsZ0YTQS.d.cts +0 -131
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as FormEvent, J as Json, F as FormDefinition, a as FieldBlock, B as Block } from './types-
|
|
2
|
-
import { F as FieldValidator, H as HostOptions } from './validate-
|
|
1
|
+
import { e as FormEvent, J as Json, F as FormDefinition, a as FieldBlock, B as Block } from './types-oAckGR_Z.js';
|
|
2
|
+
import { F as FieldValidator, H as HostOptions, L as LinkParams } from './validate-GpTXPwyl.js';
|
|
3
3
|
|
|
4
4
|
/** Guards and helpers for event logs and other untrusted JSON. No dependencies. */
|
|
5
5
|
|
|
@@ -65,6 +65,13 @@ interface CreateFormOptions {
|
|
|
65
65
|
* Pass the same lists to `validateSubmission` on the server.
|
|
66
66
|
*/
|
|
67
67
|
hostOptions?: HostOptions | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* The query parameters of the link the form was opened from (a `URLSearchParams` or a record).
|
|
70
|
+
* Choice questions with `props.prefill: { param }` take their parameter's value when it is one
|
|
71
|
+
* of their options (`prefillFromLink`); `initialValues` win over the link. A question with
|
|
72
|
+
* `props.prefill.hideWhenPrefilled` is then stepped over (`hiddenByPrefill`).
|
|
73
|
+
*/
|
|
74
|
+
linkParams?: LinkParams | undefined;
|
|
68
75
|
}
|
|
69
76
|
interface FormEngine {
|
|
70
77
|
/** The definition being filled in, with `hostOptions` filled in (`withHostOptions`). */
|
|
@@ -95,6 +102,6 @@ interface FormEngine {
|
|
|
95
102
|
}
|
|
96
103
|
declare function createForm(definition: FormDefinition, options?: CreateFormOptions): FormEngine;
|
|
97
104
|
/** Rebuild a form's state from its event log. Timestamps are ignored. */
|
|
98
|
-
declare function replay(definition: FormDefinition, events: FormEvent[], options?: Omit<CreateFormOptions, "clock" | "initialValues">): FormEngine;
|
|
105
|
+
declare function replay(definition: FormDefinition, events: FormEvent[], options?: Omit<CreateFormOptions, "clock" | "initialValues" | "linkParams">): FormEngine;
|
|
99
106
|
|
|
100
107
|
export { type CreateFormOptions as C, type FormEngine as F, type FormState as a, isJson as b, createForm as c, compactEvents as d, isFormEvent as i, replay as r };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as FormEvent, J as Json, F as FormDefinition, a as FieldBlock, B as Block } from './types-
|
|
2
|
-
import { F as FieldValidator, H as HostOptions } from './validate-
|
|
1
|
+
import { e as FormEvent, J as Json, F as FormDefinition, a as FieldBlock, B as Block } from './types-oAckGR_Z.cjs';
|
|
2
|
+
import { F as FieldValidator, H as HostOptions, L as LinkParams } from './validate-B5WKHbst.cjs';
|
|
3
3
|
|
|
4
4
|
/** Guards and helpers for event logs and other untrusted JSON. No dependencies. */
|
|
5
5
|
|
|
@@ -65,6 +65,13 @@ interface CreateFormOptions {
|
|
|
65
65
|
* Pass the same lists to `validateSubmission` on the server.
|
|
66
66
|
*/
|
|
67
67
|
hostOptions?: HostOptions | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* The query parameters of the link the form was opened from (a `URLSearchParams` or a record).
|
|
70
|
+
* Choice questions with `props.prefill: { param }` take their parameter's value when it is one
|
|
71
|
+
* of their options (`prefillFromLink`); `initialValues` win over the link. A question with
|
|
72
|
+
* `props.prefill.hideWhenPrefilled` is then stepped over (`hiddenByPrefill`).
|
|
73
|
+
*/
|
|
74
|
+
linkParams?: LinkParams | undefined;
|
|
68
75
|
}
|
|
69
76
|
interface FormEngine {
|
|
70
77
|
/** The definition being filled in, with `hostOptions` filled in (`withHostOptions`). */
|
|
@@ -95,6 +102,6 @@ interface FormEngine {
|
|
|
95
102
|
}
|
|
96
103
|
declare function createForm(definition: FormDefinition, options?: CreateFormOptions): FormEngine;
|
|
97
104
|
/** Rebuild a form's state from its event log. Timestamps are ignored. */
|
|
98
|
-
declare function replay(definition: FormDefinition, events: FormEvent[], options?: Omit<CreateFormOptions, "clock" | "initialValues">): FormEngine;
|
|
105
|
+
declare function replay(definition: FormDefinition, events: FormEvent[], options?: Omit<CreateFormOptions, "clock" | "initialValues" | "linkParams">): FormEngine;
|
|
99
106
|
|
|
100
107
|
export { type CreateFormOptions as C, type FormEngine as F, type FormState as a, isJson as b, createForm as c, compactEvents as d, isFormEvent as i, replay as r };
|