@fayz-ai/plugin-forms 0.1.1 → 0.1.2
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 +47 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @fayz-ai/plugin-forms
|
|
2
|
+
|
|
3
|
+
> Templates, documents, and signatures — the paperwork layer for any vertical.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@fayz-ai/plugin-forms)
|
|
6
|
+
[](https://github.com/FayaLabs/fayz-sdk/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
Every real business runs on forms it never wanted to build: anamnesis sheets, evolution notes, consent contracts, intake docs. plugin-forms kills that busywork. Define a template once, attach a filled document to a person, and the data lives in your tenant — not in a PDF nobody can query.
|
|
9
|
+
|
|
10
|
+
It snaps into a `defineSaas` app as the document engine. A clinic fills health anamnesis, a salon collects consent forms, a studio signs contracts — same plugin, same `frm_*` tables, different templates. Documents surface right inside the person record via a detail-tab widget, and the AI assistant can list templates and a client's documents on demand.
|
|
11
|
+
|
|
12
|
+
## What's inside
|
|
13
|
+
- **Template + document model** backed by Supabase (`frm_*` tables) with a mock provider fallback via `createSafeDataProvider`
|
|
14
|
+
- **Form categories registry** (`frm_categories`, tenant-scoped) seeded with Anamnese, Evolução, Laudo, Contrato, Geral
|
|
15
|
+
- **Person detail widget** — a `person.detail.documents` zone tab that lists and attaches documents to a contact
|
|
16
|
+
- **Settings tab** for managing templates, documents, and categories
|
|
17
|
+
- **Document-type provider API** — `registerDocumentTypeProvider` lets other plugins contribute selectable document/file types
|
|
18
|
+
- **AI tools** — `listFormTemplates` and `listDocuments` (read-only, permission-gated)
|
|
19
|
+
- **Pluggable data layer** — pass your own `dataProvider`, or let it auto-resolve Supabase → mock
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
```bash
|
|
23
|
+
npm install @fayz-ai/plugin-forms
|
|
24
|
+
```
|
|
25
|
+
Peer deps: `react`, `react-dom`. Runtime deps: `@fayz-ai/core`, `@fayz-ai/ui`.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
```tsx
|
|
29
|
+
import { defineSaas } from '@fayz-ai/saas'
|
|
30
|
+
import { createCustomFormsPlugin } from '@fayz-ai/plugin-forms'
|
|
31
|
+
|
|
32
|
+
export const app = defineSaas({
|
|
33
|
+
// ...
|
|
34
|
+
plugins: [
|
|
35
|
+
createCustomFormsPlugin({
|
|
36
|
+
labels: { pageTitle: 'Documents' },
|
|
37
|
+
// dataProvider: myProvider, // optional — defaults to Supabase → mock
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Part of the Fayz SDK
|
|
44
|
+
One of the composable plugins that turn `@fayz-ai/saas` into a real, vertical-specific SaaS — this one owns documents and signatures.
|
|
45
|
+
|
|
46
|
+
## Roadmap & contributing
|
|
47
|
+
Built and evolving in the open. See the [Fayz SDK roadmap](../../docs/ROADMAP.md#plugin-forms) for current gaps, missing features, and good first issues.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fayz-ai/plugin-forms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Fayz SDK — plugin-forms plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@dnd-kit/sortable": "^10.0.0",
|
|
30
30
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
31
31
|
"@dnd-kit/utilities": "^3.2.2",
|
|
32
|
-
"@fayz-ai/
|
|
33
|
-
"@fayz-ai/
|
|
32
|
+
"@fayz-ai/core": "^0.1.7",
|
|
33
|
+
"@fayz-ai/ui": "^0.1.7"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/react": "^18.3.0",
|