@formancy/react 0.6.0 → 0.8.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/dist/index.d.mts +10 -21
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +280 -781
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentType, ReactElement, ReactNode } from "react";
|
|
2
2
|
import { ControlProps, FieldSnapshot, FormEngine, Path } from "@formancy/core";
|
|
3
3
|
import { FormText, FormText as FormText$1, FormWordId, FormWordValues, FormWords, FormWordsByLocale, FormWordsByLocale as FormWordsByLocale$1 } from "@formancy/core/words";
|
|
4
|
-
import { FieldType, RemoteOption, RemoteOptionsAnswer, RemoteOptionsAnswer as RemoteOptionsAnswer$1, RemoteOptionsPage, RichCommand } from "@formancy/spec";
|
|
4
|
+
import { FieldType, RemoteOption, RemoteOptionsAnswer, RemoteOptionsAnswer as RemoteOptionsAnswer$1, RemoteOptionsPage, RichCommand, StoredFile, StoredFile as StoredFile$1 } from "@formancy/spec";
|
|
5
5
|
//#region src/context.d.ts
|
|
6
6
|
export declare function FormancyProvider({ engine, words, children }: {
|
|
7
7
|
engine: FormEngine;
|
|
@@ -155,6 +155,11 @@ interface FormancyFormProps {
|
|
|
155
155
|
*/
|
|
156
156
|
layout?: string;
|
|
157
157
|
submitLabel?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Show the answers in words before sending, each with a way back to its question: the last
|
|
160
|
+
* step offers "Check your answers" in place of sending (0204). Off unless asked for.
|
|
161
|
+
*/
|
|
162
|
+
review?: boolean;
|
|
158
163
|
onSubmit?: (outcome: SubmitOutcome) => void;
|
|
159
164
|
}
|
|
160
165
|
//#endregion
|
|
@@ -363,25 +368,6 @@ export declare const ScannerProvider: import("react").Provider<Scanner | undefin
|
|
|
363
368
|
export declare function useScanner(): Scanner | undefined;
|
|
364
369
|
//#endregion
|
|
365
370
|
//#region src/uploads.d.ts
|
|
366
|
-
/**
|
|
367
|
-
* Where a file goes, and what the submission remembers about it.
|
|
368
|
-
*
|
|
369
|
-
* This package has no opinion about the destination: the same field works against local
|
|
370
|
-
* disk, S3 or a customer's own service, and none of them is a dependency of a renderer.
|
|
371
|
-
*
|
|
372
|
-
* **The bytes never pass through the submission.** What is stored is what the file is
|
|
373
|
-
* and where it went, so a submission read back years later is small, readable on its
|
|
374
|
-
* own, and says what was attached even if the object store has since been emptied.
|
|
375
|
-
*/
|
|
376
|
-
interface StoredFile {
|
|
377
|
-
/** Stable within the submission; how a row is keyed and removed. */
|
|
378
|
-
id: string;
|
|
379
|
-
name: string;
|
|
380
|
-
size: number;
|
|
381
|
-
contentType: string;
|
|
382
|
-
/** Where the bytes are, in whatever the host's storage calls a location. */
|
|
383
|
-
storageKey: string;
|
|
384
|
-
}
|
|
385
371
|
/**
|
|
386
372
|
* What the field tells an uploader about the file it is sending.
|
|
387
373
|
*
|
|
@@ -404,11 +390,14 @@ interface UploadOptions {
|
|
|
404
390
|
/**
|
|
405
391
|
* Uploads one file and reports what was stored.
|
|
406
392
|
*
|
|
393
|
+
* This package has no opinion about the destination: the same field works against local
|
|
394
|
+
* disk, S3 or a customer's own service, and none of them is a dependency of a renderer.
|
|
395
|
+
*
|
|
407
396
|
* **Rejecting is a real answer**: the field says so out loud rather than dropping the
|
|
408
397
|
* file, because a submission somebody believes carries their evidence and does not is
|
|
409
398
|
* the worst outcome available here.
|
|
410
399
|
*/
|
|
411
|
-
type Uploader = (file: File, options: UploadOptions) => Promise<StoredFile>;
|
|
400
|
+
type Uploader = (file: File, options: UploadOptions) => Promise<StoredFile$1>;
|
|
412
401
|
export declare const UploaderProvider: import("react").Provider<Uploader | undefined>;
|
|
413
402
|
/**
|
|
414
403
|
* The host's uploader, or undefined when there is none.
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/context.tsx","../src/use-field.ts","../src/use-repeater.ts","../src/use-wizard.ts","../src/use-submit.ts","../src/fields/internals.tsx","../src/form.tsx","../src/error-summary.tsx","../src/rich-text.tsx","../src/options-source.ts","../src/scanning.ts","../src/uploads.ts","../src/rich-text-editor.ts","../src/resume-notice.tsx"],"mappings":";;;;;wBAsBgB,mBACd,QACA,OACA;EAEA,QAAQ;;;;;;;EAOR,QAAQ;EACR,WAAW;oBACZ,IAAA;wBAsBe,iBAAiB;;;;;;;;;wBAkBjB,eAAe;;;UCvEd,qBAAqB;EACpC,SAAS;EACT;;EAEA,cAAc;;EAEd;IAAc;IAAY;;;EAE1B;IAAc;;;;;;;;;;;;;wBAaA,SAAS,eAAe,OAAO;;;UCrB9B;EACf;;EAEA;;EAEA;;EAEA;EACA;EACA,UAAU;;EAEV,QAAQ,cAAc;;;;;;;wBAQR,YAAY,eAAe,OAAO;;;UCrBjC;EACf;EACA;;;EAGA;EACA;;EAEA,QAAQ;EACR;;EAEA,KAAK;;;;;;;wBAQS,aAAa;;;;;;;;;;;wBCTb;EAAqB;EAAa,QAAQ;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/context.tsx","../src/use-field.ts","../src/use-repeater.ts","../src/use-wizard.ts","../src/use-submit.ts","../src/fields/internals.tsx","../src/form.tsx","../src/error-summary.tsx","../src/rich-text.tsx","../src/options-source.ts","../src/scanning.ts","../src/uploads.ts","../src/rich-text-editor.ts","../src/resume-notice.tsx"],"mappings":";;;;;wBAsBgB,mBACd,QACA,OACA;EAEA,QAAQ;;;;;;;EAOR,QAAQ;EACR,WAAW;oBACZ,IAAA;wBAsBe,iBAAiB;;;;;;;;;wBAkBjB,eAAe;;;UCvEd,qBAAqB;EACpC,SAAS;EACT;;EAEA,cAAc;;EAEd;IAAc;IAAY;;;EAE1B;IAAc;;;;;;;;;;;;;wBAaA,SAAS,eAAe,OAAO;;;UCrB9B;EACf;;EAEA;;EAEA;;E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