@verbb/formie-core 1.0.13 → 1.0.15

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 (44) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/dist/accessibility.d.ts +5 -0
  3. package/dist/accessibility.d.ts.map +1 -0
  4. package/dist/browser-modules.d.ts +34 -0
  5. package/dist/browser-modules.d.ts.map +1 -0
  6. package/dist/condition-projections.d.ts +6 -0
  7. package/dist/condition-projections.d.ts.map +1 -0
  8. package/dist/condition-state.d.ts +13 -0
  9. package/dist/condition-state.d.ts.map +1 -0
  10. package/dist/conditions.d.ts +21 -7
  11. package/dist/conditions.d.ts.map +1 -1
  12. package/dist/contract.d.ts +4 -0
  13. package/dist/contract.d.ts.map +1 -0
  14. package/dist/date-parts-validation.d.ts +2 -2
  15. package/dist/date-parts-validation.d.ts.map +1 -1
  16. package/dist/event-names.d.ts +1 -1
  17. package/dist/event-names.d.ts.map +1 -1
  18. package/dist/events.d.ts +1 -1
  19. package/dist/events.d.ts.map +1 -1
  20. package/dist/form-instance.d.ts +5 -5
  21. package/dist/form-instance.d.ts.map +1 -1
  22. package/dist/grants.d.ts +3 -0
  23. package/dist/grants.d.ts.map +1 -0
  24. package/dist/graphql.d.ts +9 -4
  25. package/dist/graphql.d.ts.map +1 -1
  26. package/dist/index.d.ts +22 -6
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +1870 -863
  29. package/dist/references.d.ts +43 -0
  30. package/dist/references.d.ts.map +1 -0
  31. package/dist/request-profile.d.ts +9 -0
  32. package/dist/request-profile.d.ts.map +1 -0
  33. package/dist/rest.d.ts +20 -4
  34. package/dist/rest.d.ts.map +1 -1
  35. package/dist/schema.d.ts +22 -22
  36. package/dist/schema.d.ts.map +1 -1
  37. package/dist/text.d.ts.map +1 -1
  38. package/dist/types.d.ts +125 -83
  39. package/dist/types.d.ts.map +1 -1
  40. package/dist/uploads.d.ts +5 -0
  41. package/dist/uploads.d.ts.map +1 -0
  42. package/dist/validation.d.ts +23 -0
  43. package/dist/validation.d.ts.map +1 -0
  44. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.0.15 - 2026-10-15
6
+
7
+ ### Changed
8
+ - Share browser condition and validation types across rendering products.
9
+ - Require canonical client-rendered field metadata instead of accepting obsolete beta runtime definitions.
10
+
11
+ ## 1.0.14 - 2026-10-08
12
+
13
+ ### Added
14
+ - Add the shared, versioned reference grammar and typed browser source diagnostics.
15
+
16
+ ### Changed
17
+ - Expose one canonical payment decision across REST and GraphQL instead of parallel beta response fields.
18
+ - Keep numeric condition semantics separate from decimal-string runtime field types.
19
+ - Version browser-module manifests around one explicit surface, discriminated targets and configured occurrence keys without decorative capabilities.
20
+ - Share versioned tri-state conditions and plain-text validation rules across PHP and browser consumers; enforce recursive hidden-value clearing and server-authoritative navigation.
21
+ - Preserve exact nested submission error paths, return typed page-transition results, and distinguish skipped side effects from invalid condition configuration.
22
+ - Consume the shared completion outcome and preserve the server-owned configuration and query-prefill boundary.
23
+ - Version the client-rendered bootstrap and module contract, enforce explicit request profiles, stage selected files and expose shared browser-module host seams.
24
+ - Describe only non-null normalized field types because `null` is the universal absent value, and keep browser-input defaults separate from public data projections.
25
+ - Support browser-bound progress, purpose-bound grant exchange, revision sessions and portable Save & Continue responses across REST and GraphQL. Clear exchanged tokens from browser history, issue browser-bound upload-creation capabilities and preserve structured upload attachment references.
26
+ - Carry submission versions and typed outcomes through REST and GraphQL; return expected rejection and conflict payloads to renderers.
27
+
28
+ ### Fixed
29
+ - Expose Formie's field-error announcement preference and stable, form-scoped error-region IDs to definition-driven renderers. ([#2954](https://github.com/verbb/formie/issues/2954))
30
+ - Read the field structure metadata emitted by current Craft client bootstrap responses.
31
+
5
32
  ## 1.0.13 - 2026-07-09
6
33
 
7
34
  ### Changed
@@ -25,7 +52,7 @@
25
52
  ## 1.0.9 - 2026-06-25
26
53
 
27
54
  ### Added
28
- - Extend `FrontendSubmitResult` and `submitFormieClientForm` GraphQL selections with payment follow-up fields (`paymentStatus`, `paymentMessage`, `paymentRedirectUrl`, `paymentAction`, `paymentDecision`, `keepSubmitLoading`), plus `quizResult` and `clientEvents`. ([#1375](https://github.com/verbb/formie/issues/1375))
55
+ - Extend `ClientSubmitResult` and `submitFormieClientForm` GraphQL selections with payment follow-up fields (`paymentStatus`, `paymentMessage`, `paymentRedirectUrl`, `paymentAction`, `paymentDecision`, `keepSubmitLoading`), plus `quizResult` and `clientEvents`. ([#1375](https://github.com/verbb/formie/issues/1375))
29
56
 
30
57
  ## 1.0.8 - 2026-06-24
31
58
 
@@ -0,0 +1,5 @@
1
+ import type { ClientFormDefinition, ClientFormSession } from './types';
2
+ export type ClientErrorAriaLive = 'polite' | 'assertive' | 'off';
3
+ export declare function getClientErrorAriaLive(definition: ClientFormDefinition): ClientErrorAriaLive;
4
+ export declare function getClientFieldErrorId(session: ClientFormSession, errorKey: string): string;
5
+ //# sourceMappingURL=accessibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessibility.d.ts","sourceRoot":"","sources":["../src/accessibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;AAEjE,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,oBAAoB,GAAG,mBAAmB,CAE5F;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAI1F"}
@@ -0,0 +1,34 @@
1
+ /** The wire contract is shared by both markup products and CP editing. */
2
+ export declare const BROWSER_MODULE_CONTRACT_VERSION = 2;
3
+ export type BrowserSurface = 'server-rendered' | 'client-rendered' | 'cp-edit';
4
+ export type BrowserModuleKind = 'field' | 'captcha' | 'payment' | 'address' | 'core';
5
+ export type BrowserModuleTarget = {
6
+ type: 'form';
7
+ } | {
8
+ type: 'field';
9
+ uid: string;
10
+ } | {
11
+ type: 'page';
12
+ id: string;
13
+ } | {
14
+ type: 'action';
15
+ action: string;
16
+ } | {
17
+ type: 'selector';
18
+ selector: string;
19
+ };
20
+ export type BrowserModuleEntry = {
21
+ key: string;
22
+ moduleId: string;
23
+ kind: BrowserModuleKind;
24
+ targets: BrowserModuleTarget[];
25
+ config: Record<string, unknown>;
26
+ required: boolean;
27
+ };
28
+ export type BrowserModuleManifest = {
29
+ contractVersion: 2;
30
+ surface: BrowserSurface;
31
+ entries: BrowserModuleEntry[];
32
+ };
33
+ export declare function assertBrowserModuleManifest(value: unknown): asserts value is BrowserModuleManifest;
34
+ //# sourceMappingURL=browser-modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-modules.d.ts","sourceRoot":"","sources":["../src/browser-modules.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,+BAA+B,IAAI,CAAC;AACjD,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,SAAS,CAAC;AAC/E,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AACrF,MAAM,MAAM,mBAAmB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7C,MAAM,MAAM,kBAAkB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG;IAAE,eAAe,EAAE,CAAC,CAAC;IAAC,OAAO,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,kBAAkB,EAAE,CAAA;CAAE,CAAC;AAEnH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,qBAAqB,CA8BlG"}
@@ -0,0 +1,6 @@
1
+ /** Row scopes consume normalized rows; selectors and row identity remain explicit. */
2
+ export declare function selectConditionRows(rows: unknown[], params: Record<string, string>, current?: number): {
3
+ value?: unknown;
4
+ diagnostic?: string;
5
+ };
6
+ //# sourceMappingURL=condition-projections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"condition-projections.d.ts","sourceRoot":"","sources":["../src/condition-projections.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAsB/I"}
@@ -0,0 +1,13 @@
1
+ import type { ConditionEvaluation } from './conditions';
2
+ import type { ClientFieldDefinition, ClientFormState } from './types';
3
+ type Occurrence = {
4
+ field: ClientFieldDefinition;
5
+ key: string;
6
+ path: string[];
7
+ parent?: string;
8
+ };
9
+ export declare function evaluateClientCondition(condition: ClientFieldDefinition['condition'], state: ClientFormState, target?: Occurrence): ConditionEvaluation;
10
+ export declare function clientActionAllowed(state: ClientFormState): boolean;
11
+ export declare function deriveConditionState(state: ClientFormState): ClientFormState;
12
+ export {};
13
+ //# sourceMappingURL=condition-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"condition-state.d.ts","sourceRoot":"","sources":["../src/condition-state.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAsB,MAAM,cAAc,CAAC;AAE5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAItE,KAAK,UAAU,GAAG;IAAE,KAAK,EAAE,qBAAqB,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAsBjG,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,qBAAqB,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,mBAAmB,CAqCvJ;AACD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAKnE;AACD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAmD5E"}
@@ -1,17 +1,31 @@
1
- export type FrontendConditionRule = {
1
+ export type ConditionValueType = 'text' | 'number' | 'boolean' | 'date' | 'time' | 'datetime' | 'collection';
2
+ export type ConditionEvaluation = {
3
+ value: boolean | null;
4
+ diagnostics: Array<{
5
+ code: string;
6
+ rule?: number;
7
+ }>;
8
+ };
9
+ export type BrowserConditionRule = {
2
10
  condition: string;
3
11
  value?: unknown;
12
+ valueType?: ConditionValueType;
13
+ browserSafe?: boolean;
4
14
  };
5
- export type FrontendConditionSettings = {
6
- showRule: 'show' | 'hide';
15
+ export type BrowserConditionSettings = {
16
+ showRule: 'show' | 'hide' | 'enable' | 'disable';
7
17
  conditionRule: 'all' | 'any';
8
- conditions: FrontendConditionRule[];
18
+ conditions: BrowserConditionRule[];
9
19
  };
10
- export declare function evaluateConditionDefinition(condition: FrontendConditionRule, actualValues: string[], options?: {
20
+ export declare function conditionNumber(value: unknown): number | null;
21
+ export declare function evaluateCondition(operator: string, actual: unknown, expected: unknown, type?: ConditionValueType): ConditionEvaluation;
22
+ export declare function combineConditions(mode: string, results: ConditionEvaluation[]): ConditionEvaluation;
23
+ export declare function evaluateConditionDefinition(condition: BrowserConditionRule, actualValues: string[], options?: {
11
24
  visibility?: boolean | null;
12
- }): boolean;
13
- export declare function finalizeConditionEvaluation(settings: Pick<FrontendConditionSettings, 'conditionRule' | 'showRule'>, results: boolean[]): {
25
+ }): ConditionEvaluation;
26
+ export declare function finalizeConditionEvaluation(settings: Pick<BrowserConditionSettings, 'conditionRule' | 'showRule'>, results: Array<ConditionEvaluation | boolean>): {
14
27
  finalResult: boolean;
15
28
  shouldHide: boolean;
29
+ evaluation: ConditionEvaluation;
16
30
  };
17
31
  //# sourceMappingURL=conditions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../src/conditions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,aAAa,EAAE,KAAK,GAAG,KAAK,CAAC;IAC7B,UAAU,EAAE,qBAAqB,EAAE,CAAC;CACvC,CAAC;AAkEF,wBAAgB,2BAA2B,CACvC,SAAS,EAAE,qBAAqB,EAChC,YAAY,EAAE,MAAM,EAAE,EACtB,OAAO,GAAE;IACL,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1B,GACP,OAAO,CAyCT;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,IAAI,CAAC,yBAAy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KnG;AAGD,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CAAO,GAAG,mBAAmB,CAIvK;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,IAAI,CAAC,wBAAwB,EAAE,eAAe,GAAG,UAAU,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,mBAAmB,GAAG,OAAO,CAAC,GAAG;IAAE,WAAW,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,mBAAmB,CAAA;CAAE,CAIjP"}
@@ -0,0 +1,4 @@
1
+ import type { ClientFormBootstrap } from './types';
2
+ export declare const CLIENT_FORM_CONTRACT_VERSION = 1;
3
+ export declare function assertClientFormBootstrap(value: unknown): asserts value is ClientFormBootstrap;
4
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,mBAAmB,CAS9F"}
@@ -1,4 +1,4 @@
1
- import type { FrontendFieldDefinition } from './types';
1
+ import type { ClientFieldDefinition } from './types';
2
2
  export declare function isValidCalendarDate(year: number, month: number, day: number): boolean;
3
- export declare function validateCompositeDateParts(field: FrontendFieldDefinition, value: unknown, errorKey: string, output: Record<string, string[]>): void;
3
+ export declare function validateCompositeDateParts(field: ClientFieldDefinition, value: unknown, errorKey: string, output: Record<string, string[]>): void;
4
4
  //# sourceMappingURL=date-parts-validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-parts-validation.d.ts","sourceRoot":"","sources":["../src/date-parts-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AA4BvD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAUrF;AAaD,wBAAgB,0BAA0B,CACtC,KAAK,EAAE,uBAAuB,EAC9B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACjC,IAAI,CAiDN"}
1
+ {"version":3,"file":"date-parts-validation.d.ts","sourceRoot":"","sources":["../src/date-parts-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA4BrD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAUrF;AAaD,wBAAgB,0BAA0B,CACtC,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACjC,IAAI,CAiDN"}
@@ -1,2 +1,2 @@
1
- export declare const FRONTEND_CLIENT_EVENT_NAMES: readonly ["formie:client:ready", "formie:submit:result", "formie:page:navigate", "formie:page:navigate:error", "formie:session:refreshed", "formie:session:refresh:error", "formie:state:reset"];
1
+ export declare const CLIENT_FORM_EVENT_NAMES: readonly ["formie:client:ready", "formie:submit:result", "formie:page:navigate", "formie:page:navigate:error", "formie:session:refreshed", "formie:session:refresh:error", "formie:state:reset"];
2
2
  //# sourceMappingURL=event-names.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-names.d.ts","sourceRoot":"","sources":["../src/event-names.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,kMAQ9B,CAAC"}
1
+ {"version":3,"file":"event-names.d.ts","sourceRoot":"","sources":["../src/event-names.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,kMAQ1B,CAAC"}
package/dist/events.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  type EventCallback = (payload: unknown) => void;
2
- export declare class FrontendEventEmitter {
2
+ export declare class ClientEventEmitter {
3
3
  private listeners;
4
4
  on(eventName: string, callback: EventCallback): () => void;
5
5
  emit(eventName: string, payload: unknown): void;
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAEhD,qBAAa,oBAAoB;IAC7B,OAAO,CAAC,SAAS,CAAyC;IAE1D,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,MAAM,IAAI;IAc1D,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;CAWlD"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAEhD,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,SAAS,CAAyC;IAE1D,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,MAAM,IAAI;IAc1D,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;CAWlD"}
@@ -1,8 +1,8 @@
1
- import type { FrontendFormEnvelope, FrontendFormInstance, FrontendTransport } from './types';
2
- type CreateFrontendFormInstanceOptions = {
3
- envelope: FrontendFormEnvelope;
4
- transport: FrontendTransport;
1
+ import type { ClientFormBootstrap, ClientFormInstance, ClientTransport } from './types';
2
+ type CreateClientFormInstanceOptions = {
3
+ envelope: ClientFormBootstrap;
4
+ transport: ClientTransport;
5
5
  };
6
- export declare function createFrontendFormInstance({ envelope, transport }: CreateFrontendFormInstanceOptions): FrontendFormInstance;
6
+ export declare function createClientFormInstance({ envelope, transport }: CreateClientFormInstanceOptions): ClientFormInstance;
7
7
  export {};
8
8
  //# sourceMappingURL=form-instance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-instance.d.ts","sourceRoot":"","sources":["../src/form-instance.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAER,oBAAoB,EACpB,oBAAoB,EAIpB,iBAAiB,EACpB,MAAM,SAAS,CAAC;AAEjB,KAAK,iCAAiC,GAAG;IACrC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,SAAS,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAucF,wBAAgB,0BAA0B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iCAAiC,GAAG,oBAAoB,CA8R3H"}
1
+ {"version":3,"file":"form-instance.d.ts","sourceRoot":"","sources":["../src/form-instance.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAER,mBAAmB,EACnB,kBAAkB,EAIlB,eAAe,EAClB,MAAM,SAAS,CAAC;AAEjB,KAAK,+BAA+B,GAAG;IACnC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,SAAS,EAAE,eAAe,CAAC;CAC9B,CAAC;AAoNF,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,+BAA+B,GAAG,kBAAkB,CAiYrH"}
@@ -0,0 +1,3 @@
1
+ /** Remove an exchanged bearer from browser history without changing unrelated query values. */
2
+ export declare function clearExchangedGrant(token?: string): void;
3
+ //# sourceMappingURL=grants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grants.d.ts","sourceRoot":"","sources":["../src/grants.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAWxD"}
package/dist/graphql.d.ts CHANGED
@@ -1,10 +1,15 @@
1
- import type { FrontendFormEnvelope, FrontendTransport } from './types';
2
- export type GraphqlFrontendTransportOptions = {
1
+ import { type BrowserRequestOptions } from './request-profile';
2
+ import type { ClientFormBootstrap, ClientTransport } from './types';
3
+ export type GraphqlClientTransportOptions = BrowserRequestOptions & {
3
4
  endpoint: string;
4
5
  formHandle: string;
5
6
  siteId?: number;
6
7
  credentials?: RequestCredentials;
8
+ grantToken?: string;
9
+ grantPurpose?: 'continue-incomplete' | 'revise-complete';
10
+ draftContext?: string;
11
+ query?: Record<string, string | string[]>;
7
12
  };
8
- export declare function loadGraphqlFrontendEnvelope(options: GraphqlFrontendTransportOptions): Promise<FrontendFormEnvelope>;
9
- export declare function createGraphqlFrontendTransport(options: GraphqlFrontendTransportOptions): FrontendTransport;
13
+ export declare function loadGraphqlClientFormBootstrap(options: GraphqlClientTransportOptions): Promise<ClientFormBootstrap>;
14
+ export declare function createGraphqlClientTransport(options: GraphqlClientTransportOptions): ClientTransport;
10
15
  //# sourceMappingURL=graphql.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../src/graphql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,oBAAoB,EAGpB,iBAAiB,EACpB,MAAM,SAAS,CAAC;AAGjB,MAAM,MAAM,+BAA+B,GAAG;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,kBAAkB,CAAC;CACpC,CAAC;AAkFF,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA2BzH;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,+BAA+B,GAAG,iBAAiB,CAmG1G"}
1
+ {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../src/graphql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG/E,OAAO,KAAK,EAER,mBAAmB,EAGnB,eAAe,EAClB,MAAM,SAAS,CAAC;AAIjB,MAAM,MAAM,6BAA6B,GAAG,qBAAqB,GAAG;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,qBAAqB,GAAG,iBAAiB,CAAC;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAC7C,CAAC;AAqFF,wBAAsB,8BAA8B,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAiCzH;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,6BAA6B,GAAG,eAAe,CAqGpG"}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,27 @@
1
- export { createFrontendFormInstance } from './form-instance';
2
- export { FRONTEND_CLIENT_EVENT_NAMES } from './event-names';
1
+ export { createClientFormInstance } from './form-instance';
2
+ export { CLIENT_FORM_EVENT_NAMES } from './event-names';
3
3
  export { coerceCalculationVariables, evaluateCalculationExpression, formatCalculationValue, getCalculationFormula, getCalculationVariableEntries, readCalculationVariableValue, } from './calculations';
4
4
  export type { CalculationFormula, CalculationOptions, CalculationVariable, CalculationVariableEntry, } from './calculations';
5
5
  export { evaluateConditionDefinition, finalizeConditionEvaluation } from './conditions';
6
- export { createRestFrontendTransport, loadFrontendEnvelope } from './rest';
7
- export { createGraphqlFrontendTransport, loadGraphqlFrontendEnvelope } from './graphql';
8
- export { allFields, compositePartDefinitions, createRepeaterRowValue, defaultValueForField, fieldValueContract, fieldValueStructure, fieldValueAsStrings, findFieldById, findFieldByHandle, isBooleanField, isCompositeField, isEmailField, isFileField, isKnownFrontendFieldType, isMultiValueField, isNumericField, isRepeatableField, repeaterFieldDefinitions, repeaterRowDefinitions, serializeFieldValues, serializeTransportFieldValues, } from './schema';
6
+ export { buildActionUrl, createRestClientTransport, loadClientFormBootstrap } from './rest';
7
+ export { createGraphqlClientTransport, loadGraphqlClientFormBootstrap } from './graphql';
8
+ export { allFields, compositePartDefinitions, createRepeaterRowValue, defaultValueForField, fieldValueContract, fieldValueStructure, fieldValueAsStrings, findFieldById, findFieldByHandle, isBooleanField, isCompositeField, isEmailField, isFileField, isKnownClientFieldType, isMultiValueField, isNumericField, isRepeatableField, repeaterFieldDefinitions, repeaterRowDefinitions, serializeFieldValues, serializeTransportFieldValues, } from './schema';
9
9
  export { countGraphemes, getTextLimitMetrics, getWordCount, normalizeText } from './text';
10
- export type { FrontendFieldDefinition, FrontendFieldValueContract, FrontendFieldValueStructure, FrontendFieldType, FrontendFieldValueClass, FrontendFormDefinition, FrontendFormEnvelope, FrontendFormSession, KnownFrontendFieldType, FrontendPageDefinition, FrontendRowDefinition, FrontendFormEventName, FrontendFormFieldState, FrontendFormInstance, FrontendFormPageState, FrontendFormState, FrontendSubmitAction, FrontendSubmitResult, FrontendTransport, FrontendValidationRule, } from './types';
10
+ export { getClientErrorAriaLive, getClientFieldErrorId } from './accessibility';
11
+ export type { ClientErrorAriaLive } from './accessibility';
12
+ export type { ClientFieldDefinition, ClientFieldValueContract, ClientFieldValueStructure, ClientFieldType, ClientFieldValueType, ClientFormDefinition, ClientFormBootstrap, ClientFormSession, KnownClientFieldType, ClientPageDefinition, ClientRowDefinition, ClientFormEventName, ClientFormFieldState, ClientFormInstance, ClientFormPageState, ClientFormState, ClientSubmitAction, ClientSubmitResult, PaymentDecision, ClientTransport, } from './types';
13
+ export { parseReference, serializeReference } from './references';
14
+ export type { ReferenceExpression } from './references';
15
+ export { resolveReference } from './references';
16
+ export type { ReferenceDefinition, ReferenceContext, ResolvedReference } from './references';
17
+ export * from './browser-modules';
18
+ export * from './contract';
19
+ export type { RequestProfile, BrowserRequestOptions } from './request-profile';
20
+ export { browserRequest, browserRequestHeaders } from './request-profile';
21
+ export { evaluateCondition, combineConditions, conditionNumber } from './conditions';
22
+ export type { BrowserConditionRule, BrowserConditionSettings, ConditionEvaluation, ConditionValueType } from './conditions';
23
+ export { validateBrowserValue, browserValueEmpty, registerBrowserValidationRule } from './validation';
24
+ export type { BrowserValidationRule, BrowserValidationContext } from './validation';
25
+ export { clientActionAllowed, evaluateClientCondition } from './condition-state';
26
+ export { selectConditionRows } from './condition-projections';
11
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EACH,0BAA0B,EAC1B,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,4BAA4B,GAC/B,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACR,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EACH,SAAS,EACT,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,aA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