@usefillo/react 0.9.0 → 0.10.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 +25 -18
- package/dist/index.d.ts +32 -1
- package/dist/index.js +674 -382
- package/dist/styles.css +55 -0
- package/dist/styles.unlayered.css +55 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://fillo.so">
|
|
3
|
+
<img src="https://fillo.so/brand/readme-banner.png" alt="Fillo — forms inside your product, with your UI." />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://fillo.so/docs">Docs</a> ·
|
|
9
|
+
<a href="https://fillo.so/guides">Guides</a> ·
|
|
10
|
+
<a href="https://fillo.so/examples">Examples</a> ·
|
|
11
|
+
<a href="https://fillo.so/changelog">Changelog</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://www.npmjs.com/package/@usefillo/react"><img src="https://img.shields.io/npm/v/@usefillo/react" alt="npm version" /></a>
|
|
16
|
+
<img src="https://img.shields.io/npm/l/@usefillo/react" alt="MIT license" />
|
|
17
|
+
</p>
|
|
2
18
|
|
|
3
19
|
React components and hooks for embedding [Fillo](https://fillo.so) forms **natively inside your product** — rendered in your own DOM, with your styles, on your route. No iframe.
|
|
4
20
|
|
|
5
|
-
### 📚 Full documentation → **[fillo.so/docs](https://fillo.so/docs)**
|
|
6
|
-
|
|
7
21
|
```sh
|
|
8
22
|
npm i @usefillo/react
|
|
9
23
|
```
|
|
@@ -36,10 +50,10 @@ export function ContactForm() {
|
|
|
36
50
|
```
|
|
37
51
|
|
|
38
52
|
The first time this runs, the form appears in your Fillo workspace as a draft —
|
|
39
|
-
publish it there and responses,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
publish it there and responses, exports, webhooks, and integrations all work.
|
|
54
|
+
Prefer config over JSX? `defineForm({ id, pages })` is first-class — JSX
|
|
55
|
+
compiles to it exactly. Authoring guide:
|
|
56
|
+
[fillo.so/docs/authoring](https://fillo.so/docs/authoring).
|
|
43
57
|
|
|
44
58
|
## Or embed a form built in the dashboard
|
|
45
59
|
|
|
@@ -67,12 +81,9 @@ import { FilloForm } from "@usefillo/react";
|
|
|
67
81
|
>
|
|
68
82
|
```
|
|
69
83
|
|
|
70
|
-
Every rendered part carries a named slot
|
|
71
|
-
(`data-invalid`, `data-selected`,
|
|
72
|
-
|
|
73
|
-
reset-heavy sites import `@usefillo/react/styles.unlayered.css` instead.
|
|
74
|
-
Localize the shared form chrome (navigation, submit states, errors, and resume
|
|
75
|
-
notices) with the `strings` prop. Styling contract:
|
|
84
|
+
Every rendered part carries a named slot and state attributes
|
|
85
|
+
(`data-invalid`, `data-selected`, …), and the default stylesheet is
|
|
86
|
+
cascade-layered so your utilities always win. Styling contract:
|
|
76
87
|
[fillo.so/docs/styling](https://fillo.so/docs/styling).
|
|
77
88
|
|
|
78
89
|
## Go fully headless
|
|
@@ -83,11 +94,7 @@ Every part is replaceable — and every embed method is free:
|
|
|
83
94
|
- `<FilloProvider>` + `<FormField>` / `useField()` — your layout, Fillo's engine
|
|
84
95
|
- `useFilloController()` — the bare engine for total control
|
|
85
96
|
|
|
86
|
-
|
|
87
|
-
submissions retry safely, and failed submits show a visible, answer-preserving
|
|
88
|
-
error. This package re-exports the embedding surface from
|
|
89
|
-
[`@usefillo/core`](https://www.npmjs.com/package/@usefillo/core) so a single
|
|
90
|
-
import is usually enough.
|
|
97
|
+
Headless guide: [fillo.so/docs/custom-ui](https://fillo.so/docs/custom-ui).
|
|
91
98
|
|
|
92
99
|
## Links
|
|
93
100
|
|
package/dist/index.d.ts
CHANGED
|
@@ -147,6 +147,21 @@ interface FilloFormBaseProps {
|
|
|
147
147
|
onSubmitted?: (responseId: string | undefined, data: ResponseData) => void;
|
|
148
148
|
/** Observe load and code-form sync failures (otherwise only logged). */
|
|
149
149
|
onError?: (error: FilloError) => void;
|
|
150
|
+
/**
|
|
151
|
+
* Show the developer chrome on a surface Fillo doesn't detect as local
|
|
152
|
+
* development — a tunnel, a staging deploy, a production build you're
|
|
153
|
+
* smoke-testing. COSMETIC ONLY: it renders the dev notices, developer-grade
|
|
154
|
+
* submit failures, and a visible "Preview" badge, and it never changes
|
|
155
|
+
* where submissions go or whether they are accepted (test submissions
|
|
156
|
+
* authenticate with a credential, never a prop).
|
|
157
|
+
*/
|
|
158
|
+
preview?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Set false to hide the built-in dev notices (draft/staged/sync/no-client)
|
|
161
|
+
* when your page provides its own context. The explicit Preview badge and
|
|
162
|
+
* the production fail-closed states are unaffected.
|
|
163
|
+
*/
|
|
164
|
+
devNotices?: boolean;
|
|
150
165
|
/**
|
|
151
166
|
* Render the form's own title/description header (default true). Set false
|
|
152
167
|
* when the embedding page already provides a heading, to avoid a second
|
|
@@ -287,6 +302,13 @@ interface ControllerOptions {
|
|
|
287
302
|
surface?: "default" | "headless";
|
|
288
303
|
/** Resolve/verify the canonical submission target immediately before submit. */
|
|
289
304
|
resolveFormId?: () => Promise<string>;
|
|
305
|
+
/**
|
|
306
|
+
* Surface the real resolveFormId failure (message + machine code) in
|
|
307
|
+
* `submitError` instead of the respondent-safe fallback. The built-in
|
|
308
|
+
* renderers set it from their dev-chrome gate (preview prop / dev
|
|
309
|
+
* environment) so integration details never reach production visitors.
|
|
310
|
+
*/
|
|
311
|
+
verboseResolutionErrors?: boolean;
|
|
290
312
|
/**
|
|
291
313
|
* Host-app account context (identify()): who is filling this form, by your
|
|
292
314
|
* own user id. Recorded with the response as an unverified claim so the
|
|
@@ -321,6 +343,15 @@ interface FilloProviderProps extends Omit<ControllerOptions, "form"> {
|
|
|
321
343
|
onError?: (error: FilloError) => void;
|
|
322
344
|
/** Custom unavailable state; receives the full actionable integration error. */
|
|
323
345
|
renderError?: (error: FilloError) => ReactNode;
|
|
346
|
+
/**
|
|
347
|
+
* Apply the developer-chrome behavior on a surface Fillo doesn't detect as
|
|
348
|
+
* local development (a tunnel, staging, a production smoke test): the code
|
|
349
|
+
* form renders and gates like development and failed submits carry the real
|
|
350
|
+
* error + code. COSMETIC ONLY — it never changes where submissions go or
|
|
351
|
+
* whether they are accepted. Headless stays headless: the provider still
|
|
352
|
+
* injects no layout (no badge or notices); the host owns all preview UI.
|
|
353
|
+
*/
|
|
354
|
+
preview?: boolean;
|
|
324
355
|
children: ReactNode;
|
|
325
356
|
}
|
|
326
357
|
/**
|
|
@@ -343,7 +374,7 @@ interface FilloProviderProps extends Omit<ControllerOptions, "form"> {
|
|
|
343
374
|
* defineForm() form and a keyed client, the structure also syncs into your
|
|
344
375
|
* workspace, exactly like <FilloForm>.
|
|
345
376
|
*/
|
|
346
|
-
declare function FilloProvider({ children, form, formId, client, appearance, strings, onError, renderError, ...options }: FilloProviderProps): react.JSX.Element | null;
|
|
377
|
+
declare function FilloProvider({ children, form, formId, client, appearance, strings, onError, renderError, preview, ...options }: FilloProviderProps): react.JSX.Element | null;
|
|
347
378
|
|
|
348
379
|
/**
|
|
349
380
|
* The full form engine — data, errors, pages, submit, status. Use inside a
|