@dmitryvim/form-builder 0.2.29 → 0.2.32
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 +51 -0
- package/dist/browser/formbuilder.min.js +578 -386
- package/dist/browser/formbuilder.v0.2.32.min.js +1148 -0
- package/dist/cjs/index.cjs +1477 -789
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +1449 -775
- package/dist/esm/index.js.map +1 -1
- package/dist/form-builder.js +578 -386
- package/dist/types/components/file/dom.d.ts +4 -5
- package/dist/types/components/file/preview.d.ts +5 -0
- package/dist/types/components/file/render-edit.d.ts +8 -1
- package/dist/types/components/file/render-readonly.d.ts +4 -7
- package/dist/types/components/file/upload.d.ts +6 -0
- package/dist/types/components/markdown/index.d.ts +15 -0
- package/dist/types/components/markdown/render.d.ts +6 -0
- package/dist/types/components/markdown/snarkdown.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/instance/FormBuilderInstance.d.ts +10 -0
- package/dist/types/types/component-operations.d.ts +5 -0
- package/dist/types/types/config.d.ts +4 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/schema.d.ts +22 -1
- package/dist/types/types/state.d.ts +5 -1
- package/dist/types/utils/helpers.d.ts +14 -0
- package/package.json +1 -1
- package/dist/browser/formbuilder.v0.2.29.min.js +0 -956
package/README.md
CHANGED
|
@@ -304,6 +304,7 @@ See [Integration Guide](docs/integration.md) for detailed setup instructions.
|
|
|
304
304
|
- **File**: Single file upload with compact dropzone, tile preview, and type restrictions
|
|
305
305
|
- **Files**: Multiple file upload with 80px tile grid, per-file upload progress, and drag-and-drop
|
|
306
306
|
- **Container**: Nested containers with repeatable array support
|
|
307
|
+
- **Markdown**: Display-only text block rendered from markdown syntax (v0.2.30+); never included in form data output
|
|
307
308
|
|
|
308
309
|
### File Handling
|
|
309
310
|
|
|
@@ -821,6 +822,56 @@ An editable 2D grid with plain-text cells, cell merging, and full keyboard navig
|
|
|
821
822
|
- Readonly mode renders a static `<table>`
|
|
822
823
|
- Full i18n support (6 translation keys: `tableAddRow`, `tableAddColumn`, `tableRemoveRow`, `tableRemoveColumn`, `tableMergeCells`, `tableSplitCell`)
|
|
823
824
|
|
|
825
|
+
### Markdown Element (v0.2.30+)
|
|
826
|
+
|
|
827
|
+
A display-only element that renders markdown as safe HTML. It never appears in `getFormData()` output.
|
|
828
|
+
|
|
829
|
+
**Schema:**
|
|
830
|
+
|
|
831
|
+
```json
|
|
832
|
+
{
|
|
833
|
+
"type": "markdown",
|
|
834
|
+
"content": "# Welcome\n\nPlease fill in **all required fields** below.\n\nSee the [guidelines](https://example.com) for details."
|
|
835
|
+
}
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
**With optional key and conditional visibility:**
|
|
839
|
+
|
|
840
|
+
```json
|
|
841
|
+
{
|
|
842
|
+
"type": "markdown",
|
|
843
|
+
"key": "terms-note",
|
|
844
|
+
"content": "## Terms Apply\n\nBy submitting you agree to our [terms](https://example.com/terms).",
|
|
845
|
+
"enableIf": { "key": "agreed", "equals": "yes" }
|
|
846
|
+
}
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
**Properties:**
|
|
850
|
+
|
|
851
|
+
| Property | Type | Required | Description |
|
|
852
|
+
| ----------- | -------- | -------- | -------------------------------------------------------- |
|
|
853
|
+
| `type` | `string` | Yes | Must be `"markdown"` |
|
|
854
|
+
| `content` | `string` | Yes | Markdown source text |
|
|
855
|
+
| `key` | `string` | No | Optional identifier; field never contributes to form data |
|
|
856
|
+
| `enableIf` | object | No | Conditional visibility (same as other field types) |
|
|
857
|
+
|
|
858
|
+
**Supported markdown syntax:**
|
|
859
|
+
|
|
860
|
+
- Headings: `# H1` through `###### H6`
|
|
861
|
+
- Emphasis: `**bold**`, `*italic*`, `~~strikethrough~~`
|
|
862
|
+
- Inline code: `` `code` ``
|
|
863
|
+
- Fenced code blocks: ` ```language ... ``` `
|
|
864
|
+
- Links: `[text](url)`
|
|
865
|
+
- Lists: ordered (`1.`) and unordered (`-`, `*`)
|
|
866
|
+
- Blockquotes: `> text`
|
|
867
|
+
- Horizontal rules: `---`
|
|
868
|
+
|
|
869
|
+
**XSS Protection:**
|
|
870
|
+
|
|
871
|
+
- Raw `<`, `>`, `&` characters in content are escaped before parsing — HTML tags in markdown source cannot render as DOM elements
|
|
872
|
+
- `javascript:`, `data:`, `vbscript:` href schemes are stripped from all links
|
|
873
|
+
- All rendered links get `target="_blank" rel="noopener noreferrer"`
|
|
874
|
+
|
|
824
875
|
## Documentation
|
|
825
876
|
|
|
826
877
|
- **API Reference** - See above for core methods and theming
|