@usefillo/dom 0.8.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 CHANGED
@@ -1,9 +1,23 @@
1
- # @usefillo/dom
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/dom"><img src="https://img.shields.io/npm/v/@usefillo/dom" alt="npm version" /></a>
16
+ <img src="https://img.shields.io/npm/l/@usefillo/dom" alt="MIT license" />
17
+ </p>
2
18
 
3
19
  Framework-agnostic DOM renderer, web component, and standalone browser bundle for [Fillo](https://fillo.so) — forms that render **inside your own product**, no iframe. Use it with Vue, Svelte, Astro, or plain browser JavaScript.
4
20
 
5
- ### 📚 Full documentation → **[fillo.so/docs](https://fillo.so/docs)**
6
-
7
21
  ```sh
8
22
  npm i @usefillo/dom
9
23
  ```
@@ -51,14 +65,9 @@ Or drop it in with a single script tag — the bundle exposes a global `Fillo`:
51
65
  </script>
52
66
  ```
53
67
 
54
- For tiny feedback widgets, set `settings.submitMode: "auto"` on a select/rating/checkbox/dropdown/linear scale form. The default renderer hides the first submit button, submits after a complete discrete answer, and brings the submit button back if that answer opens a text or upload follow-up. Add `responseLimit: { by: "browser", onRepeat: "keep" }` for browser-scoped one-response feedback.
55
-
56
68
  The default stylesheet follows system dark mode for unthemed embeds. Pass `theme: { colorScheme: "dark" }` or `"light"` when the host surface is known.
57
69
 
58
- Re-exports the core pieces used by DOM integrations from
59
- [`@usefillo/core`](https://www.npmjs.com/package/@usefillo/core), including
60
- `createClient`, `defineForm`, `FilloClient`, `createFormController`, and the
61
- schema/value types.
70
+ Every rendered part carries `data-*` state attributes (`data-selected`, `data-invalid`, …) for utility CSS, and the default stylesheet is cascade-layered so your own styles win. On Tailwind v3 or reset-heavy sites import `@usefillo/dom/styles.unlayered.css` instead. Styling contract: [fillo.so/docs/styling](https://fillo.so/docs/styling).
62
71
 
63
72
  ## Links
64
73
 
@@ -66,8 +75,3 @@ schema/value types.
66
75
  - **Website:** [fillo.so](https://fillo.so)
67
76
 
68
77
  MIT licensed.
69
-
70
- On Tailwind v3 or reset-heavy sites, import `@usefillo/dom/styles.unlayered.css`
71
- instead — the cascade-layered default loses to unlayered CSS by design.
72
- State is exposed as `data-*` attributes (`data-selected`, `data-invalid`, …)
73
- for utility CSS.
package/dist/index.d.ts CHANGED
@@ -62,6 +62,21 @@ interface RenderFormOptions {
62
62
  onChange?: (data: ResponseData) => void;
63
63
  onSubmitted?: (responseId: string | undefined, data: ResponseData) => void;
64
64
  onError?: (error: FilloError) => void;
65
+ /**
66
+ * Show the developer chrome on a surface Fillo doesn't detect as local
67
+ * development — a tunnel, a staging deploy, a production build you're
68
+ * smoke-testing. COSMETIC ONLY: it renders the dev notices, developer-grade
69
+ * submit failures, and a visible "Preview" badge, and it never changes
70
+ * where submissions go or whether they are accepted (test submissions
71
+ * authenticate with a credential, never a prop).
72
+ */
73
+ preview?: boolean;
74
+ /**
75
+ * Set false to hide the built-in dev notices (draft/staged/sync/no-client)
76
+ * when your page provides its own context. The explicit Preview badge and
77
+ * the production fail-closed states are unaffected.
78
+ */
79
+ devNotices?: boolean;
65
80
  renderSuccess?: (api: FilloDomApi) => HTMLElement;
66
81
  renderError?: (error: FilloError) => HTMLElement;
67
82
  }
@@ -107,6 +122,11 @@ declare class FilloFormElement extends HTMLElementBase {
107
122
  set theme(value: FormTheme | undefined);
108
123
  set initialData(value: ResponseData | undefined);
109
124
  private scheduleMount;
125
+ /** data-preview is on when present UNLESS its value says off ("false"/"0"):
126
+ * frameworks stringify booleans onto data-* attributes rather than omitting
127
+ * them, and a stringified `false` must never enable dev chrome for real
128
+ * respondents. Disable by removing the attribute or setting it to "false". */
129
+ private previewAttrEnabled;
110
130
  private mount;
111
131
  }
112
132
  declare function registerFilloElement(name?: string): void;