@marktiderman/genesis-forms 0.2.0 → 0.3.1

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 (42) hide show
  1. package/README.md +113 -13
  2. package/conformance/{after-class-back-after-a-jump.scenario.json → event-feedback-back-after-a-jump.scenario.json} +21 -21
  3. package/conformance/{after-class-contact-yes-completed.scenario.json → event-feedback-contact-yes-completed.scenario.json} +21 -21
  4. package/conformance/{after-class-contact-yes-requires-name-and-email.scenario.json → event-feedback-contact-yes-requires-name-and-email.scenario.json} +19 -19
  5. package/conformance/{after-class-happy-path.scenario.json → event-feedback-happy-path.scenario.json} +24 -24
  6. package/conformance/{after-class-invalid-email-rejected.scenario.json → event-feedback-invalid-email-rejected.scenario.json} +19 -19
  7. package/conformance/{after-class-low-rating-skips-went-well.scenario.json → event-feedback-low-rating-skips-went-well.scenario.json} +21 -21
  8. package/conformance/{after-class-server-drops-unknown-and-hidden-answers.scenario.json → event-feedback-server-drops-unknown-and-hidden-answers.scenario.json} +22 -22
  9. package/conformance/{after-class-server-ignores-a-client-sent-coach.scenario.json → event-feedback-server-ignores-a-client-sent-owner.scenario.json} +24 -24
  10. package/conformance/{monthly-pulse-default-ending.scenario.json → monthly-check-in-default-ending.scenario.json} +6 -6
  11. package/conformance/{monthly-pulse-promoter-ending-via-jump.scenario.json → monthly-check-in-promoter-ending-via-jump.scenario.json} +6 -6
  12. package/dist/destinations.cjs +1235 -0
  13. package/dist/destinations.cjs.map +1 -0
  14. package/dist/destinations.d.cts +465 -0
  15. package/dist/destinations.d.ts +465 -0
  16. package/dist/destinations.js +1193 -0
  17. package/dist/destinations.js.map +1 -0
  18. package/dist/{engine-Coc-gQIB.d.ts → engine-CPLtKVew.d.cts} +2 -1
  19. package/dist/{engine-Bj8-mMVb.d.cts → engine-DOrPgFDw.d.ts} +2 -1
  20. package/dist/index.cjs +322 -24
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +102 -5
  23. package/dist/index.d.ts +102 -5
  24. package/dist/index.js +311 -25
  25. package/dist/index.js.map +1 -1
  26. package/dist/server.cjs +249 -22
  27. package/dist/server.cjs.map +1 -1
  28. package/dist/server.d.cts +3 -2
  29. package/dist/server.d.ts +3 -2
  30. package/dist/server.js +249 -22
  31. package/dist/server.js.map +1 -1
  32. package/dist/testing.cjs +253 -22
  33. package/dist/testing.cjs.map +1 -1
  34. package/dist/testing.d.cts +4 -3
  35. package/dist/testing.d.ts +4 -3
  36. package/dist/testing.js +253 -22
  37. package/dist/testing.js.map +1 -1
  38. package/dist/{validate-BbackAjB.d.cts → types-BBKBQ8sp.d.cts} +2 -29
  39. package/dist/{validate-BbackAjB.d.ts → types-BBKBQ8sp.d.ts} +2 -29
  40. package/dist/validate-BXXqi0fq.d.cts +30 -0
  41. package/dist/validate-BjNwF1UE.d.ts +30 -0
  42. package/package.json +14 -2
@@ -58,7 +58,7 @@ interface HiddenInput {
58
58
  /** Masked in devtools unless revealed, like a sensitive field. */
59
59
  sensitive?: boolean;
60
60
  /**
61
- * Identifies the respondent (a member id, an email). When the form's
61
+ * Identifies the respondent (a user id, an email). When the form's
62
62
  * `settings.anonymous` is true, `validateSubmission` leaves it out of the
63
63
  * stored `hidden` and `context`. Logic still reads it.
64
64
  */
@@ -152,31 +152,4 @@ type FormEvent = {
152
152
  at?: number;
153
153
  };
154
154
 
155
- /** The Standard Schema interface (standardschema.dev), as far as validation needs it. */
156
- interface StandardSchemaV1<T = unknown> {
157
- readonly "~standard": {
158
- readonly version: 1;
159
- readonly vendor: string;
160
- readonly validate: (value: unknown) => {
161
- value: T;
162
- issues?: undefined;
163
- } | {
164
- issues: ReadonlyArray<{
165
- message: string;
166
- }>;
167
- } | Promise<unknown>;
168
- };
169
- }
170
- /** A custom check for one field: a function, or any Standard Schema (Zod, Valibot, ArkType…). */
171
- type FieldValidator = ((value: Json) => string | null) | StandardSchemaV1;
172
- declare const REQUIRED_MESSAGE = "This question needs an answer.";
173
- /**
174
- * Validate one field's value. `requireAnswers: false` (drafts) checks the
175
- * format of what was answered without requiring the rest.
176
- */
177
- declare function validateField(field: FieldBlock, value: Json | undefined, options?: {
178
- requireAnswers?: boolean;
179
- custom?: FieldValidator;
180
- }): string | null;
181
-
182
- export { type Block as B, type ContentBlock as C, type Ending as E, type FieldBlock as F, type HiddenInput as H, type Json as J, type LogicRule as L, type Operator as O, type PageBreakBlock as P, REQUIRED_MESSAGE as R, type StandardSchemaV1 as S, type FormDefinition as a, type FormLayout as b, type FormSettings as c, type Condition as d, type FieldValidator as e, type FormEvent as f, type Operand as g, validateField as v };
155
+ export type { Block as B, ContentBlock as C, Ending as E, FormDefinition as F, HiddenInput as H, Json as J, LogicRule as L, Operator as O, PageBreakBlock as P, FieldBlock as a, FormLayout as b, FormSettings as c, Condition as d, FormEvent as e, Operand as f };
@@ -58,7 +58,7 @@ interface HiddenInput {
58
58
  /** Masked in devtools unless revealed, like a sensitive field. */
59
59
  sensitive?: boolean;
60
60
  /**
61
- * Identifies the respondent (a member id, an email). When the form's
61
+ * Identifies the respondent (a user id, an email). When the form's
62
62
  * `settings.anonymous` is true, `validateSubmission` leaves it out of the
63
63
  * stored `hidden` and `context`. Logic still reads it.
64
64
  */
@@ -152,31 +152,4 @@ type FormEvent = {
152
152
  at?: number;
153
153
  };
154
154
 
155
- /** The Standard Schema interface (standardschema.dev), as far as validation needs it. */
156
- interface StandardSchemaV1<T = unknown> {
157
- readonly "~standard": {
158
- readonly version: 1;
159
- readonly vendor: string;
160
- readonly validate: (value: unknown) => {
161
- value: T;
162
- issues?: undefined;
163
- } | {
164
- issues: ReadonlyArray<{
165
- message: string;
166
- }>;
167
- } | Promise<unknown>;
168
- };
169
- }
170
- /** A custom check for one field: a function, or any Standard Schema (Zod, Valibot, ArkType…). */
171
- type FieldValidator = ((value: Json) => string | null) | StandardSchemaV1;
172
- declare const REQUIRED_MESSAGE = "This question needs an answer.";
173
- /**
174
- * Validate one field's value. `requireAnswers: false` (drafts) checks the
175
- * format of what was answered without requiring the rest.
176
- */
177
- declare function validateField(field: FieldBlock, value: Json | undefined, options?: {
178
- requireAnswers?: boolean;
179
- custom?: FieldValidator;
180
- }): string | null;
181
-
182
- export { type Block as B, type ContentBlock as C, type Ending as E, type FieldBlock as F, type HiddenInput as H, type Json as J, type LogicRule as L, type Operator as O, type PageBreakBlock as P, REQUIRED_MESSAGE as R, type StandardSchemaV1 as S, type FormDefinition as a, type FormLayout as b, type FormSettings as c, type Condition as d, type FieldValidator as e, type FormEvent as f, type Operand as g, validateField as v };
155
+ export type { Block as B, ContentBlock as C, Ending as E, FormDefinition as F, HiddenInput as H, Json as J, LogicRule as L, Operator as O, PageBreakBlock as P, FieldBlock as a, FormLayout as b, FormSettings as c, Condition as d, FormEvent as e, Operand as f };
@@ -0,0 +1,30 @@
1
+ import { J as Json, a as FieldBlock } from './types-BBKBQ8sp.cjs';
2
+
3
+ /** The Standard Schema interface (standardschema.dev), as far as validation needs it. */
4
+ interface StandardSchemaV1<T = unknown> {
5
+ readonly "~standard": {
6
+ readonly version: 1;
7
+ readonly vendor: string;
8
+ readonly validate: (value: unknown) => {
9
+ value: T;
10
+ issues?: undefined;
11
+ } | {
12
+ issues: ReadonlyArray<{
13
+ message: string;
14
+ }>;
15
+ } | Promise<unknown>;
16
+ };
17
+ }
18
+ /** A custom check for one field: a function, or any Standard Schema (Zod, Valibot, ArkType…). */
19
+ type FieldValidator = ((value: Json) => string | null) | StandardSchemaV1;
20
+ declare const REQUIRED_MESSAGE = "This question needs an answer.";
21
+ /**
22
+ * Validate one field's value. `requireAnswers: false` (drafts) checks the
23
+ * format of what was answered without requiring the rest.
24
+ */
25
+ declare function validateField(field: FieldBlock, value: Json | undefined, options?: {
26
+ requireAnswers?: boolean;
27
+ custom?: FieldValidator;
28
+ }): string | null;
29
+
30
+ export { type FieldValidator as F, REQUIRED_MESSAGE as R, type StandardSchemaV1 as S, validateField as v };
@@ -0,0 +1,30 @@
1
+ import { J as Json, a as FieldBlock } from './types-BBKBQ8sp.js';
2
+
3
+ /** The Standard Schema interface (standardschema.dev), as far as validation needs it. */
4
+ interface StandardSchemaV1<T = unknown> {
5
+ readonly "~standard": {
6
+ readonly version: 1;
7
+ readonly vendor: string;
8
+ readonly validate: (value: unknown) => {
9
+ value: T;
10
+ issues?: undefined;
11
+ } | {
12
+ issues: ReadonlyArray<{
13
+ message: string;
14
+ }>;
15
+ } | Promise<unknown>;
16
+ };
17
+ }
18
+ /** A custom check for one field: a function, or any Standard Schema (Zod, Valibot, ArkType…). */
19
+ type FieldValidator = ((value: Json) => string | null) | StandardSchemaV1;
20
+ declare const REQUIRED_MESSAGE = "This question needs an answer.";
21
+ /**
22
+ * Validate one field's value. `requireAnswers: false` (drafts) checks the
23
+ * format of what was answered without requiring the rest.
24
+ */
25
+ declare function validateField(field: FieldBlock, value: Json | undefined, options?: {
26
+ requireAnswers?: boolean;
27
+ custom?: FieldValidator;
28
+ }): string | null;
29
+
30
+ export { type FieldValidator as F, REQUIRED_MESSAGE as R, type StandardSchemaV1 as S, validateField as v };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marktiderman/genesis-forms",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -9,7 +9,9 @@
9
9
  "./dist/server.js",
10
10
  "./dist/server.cjs",
11
11
  "./dist/testing.js",
12
- "./dist/testing.cjs"
12
+ "./dist/testing.cjs",
13
+ "./dist/destinations.js",
14
+ "./dist/destinations.cjs"
13
15
  ],
14
16
  "description": "Genesis Forms engine: a serializable form definition, logic, navigation, validation and server-side checking. Zero dependencies; runs in browsers, React Native, Node and edge runtimes. Part of the Genesis framework.",
15
17
  "repository": {
@@ -47,6 +49,16 @@
47
49
  "default": "./dist/server.cjs"
48
50
  }
49
51
  },
52
+ "./destinations": {
53
+ "import": {
54
+ "types": "./dist/destinations.d.ts",
55
+ "default": "./dist/destinations.js"
56
+ },
57
+ "require": {
58
+ "types": "./dist/destinations.d.cts",
59
+ "default": "./dist/destinations.cjs"
60
+ }
61
+ },
50
62
  "./testing": {
51
63
  "import": {
52
64
  "types": "./dist/testing.d.ts",