Genesis

Packages

@marktiderman/genesis-forms-builder

0.6.8Primitive · Forms

A visual builder for Genesis Forms definitions: questions, choices, show/hide and jump logic, endings, hidden inputs and settings, with live validation, path coverage, a live preview and a breaking-change diff between versions. It edits a definition and nothing else, so any app can host it. Part of the Genesis framework.

A visual editor for Genesis Forms definitions, the Typeform / Google Forms style: questions and choices, show/hide and jump logic, endings, hidden inputs and settings, with live checks and a live preview. It edits a `FormDefinition` and stores nothing, so any app can host it and decide where drafts and published versions live.

> **Use with `@marktiderman/genesis-forms` 0.2.0 or later.** Earlier versions store identifying hidden inputs on anonymous forms, which the builder's anonymous setting promises not to. > > **Stability (0.x):** the supported API is `FormBuilder` (its props, `readOnly` included, and `FormBuilderHandle`), `analyze`, `diffDefinitions`, the form operations, `FormTemplate` / `BLANK_TEMPLATE` / `TEMPLATES` / `STARTER_TEMPLATES` / `getTemplate`, `FieldPreset`, and the editor types. The individual panels and other exports may change in minor releases.

pnpm add @marktiderman/genesis-forms-builder

READMEChangelognpm

@marktiderman/genesis-forms-builder

Components (2)

  • FormBuilder

    A visual editor for one form definition: questions, logic, endings, settings, with live checks and a live preview. It stores nothing; the host saves what `onChange` gives it and publishes what `actions` receive.

  • OptionListEditor

    Edit a named option list a host keeps, such as an organization's "Locations": rename it; add, remove and reorder options; edit each one's label, description, picture and attributes; import from pasted CSV or a file with a preview of what...

Hooks (2)

  • useBuilderHistory

    Undoable editing state for a definition.

  • useChecks

    The checks state of the builder around a panel; null when a panel is used on its own (every check shows).

Other exports (106)

AddBlockMenu · addEnding · addHidden · addRule · analyze · ATTRIBUTE_VALUE_SEPARATOR · BLANK_TEMPLATE · blockIdPrefix · BlockInspector · BuilderConfigContext · BUILT_IN_FIELD_EDITORS · CALCULATED_FIELD_EDITOR · ChecksContext · chosenOutputs · clearOutputs · ConditionEditor · conditionFields · conditionHidden · createContent · createField · createPageBreak · createPresetField · DEFAULT_TABLE_COLUMNS · defaultEndingId · defaultPalette · defaultProps · describeRule · diffDefinitions · duplicateBlock · emptyForm · EndingsPanel · FindingsList · flowCheck · FlowMap · formIds · formulaNames · freshId · getTemplate · HIDDEN_OPERATORS · historyReducer · hostListAttributes · hostOptionsOf · insertBlock · isUnchanged · JsonPanel · jumpTarget · LogicAndEndingsPanel · LogicPanel · MAX_HISTORY · mergeOptions · moveBlock · moveRule · newId · newOptionValue · OPERATOR_LABEL · operatorsFor · OPTION_LIST_LIMITS · optionListCsv · outputPropsFor · outputsFor · outputUsedBy · palettePresets · paletteTypes · parseCsvRows · parseOptionListCsv · PATH_FINDINGS · Preview · questionNumbers · QuestionsPanel · removeBlock · removeEnding · removeHidden · removeRule · RESERVED_OUTPUT_PROPS · RowLayoutContext · RuleEditor · RuleKindChip · ruleRefs · RuleSentence · sampleHostOptions · setIdGenerator · setOptions · setOptionsFilter · setOptionsSource · setOutput · setPrefill · SettingsPanel · slugKey · slugOptionValue · STARTER_TEMPLATES · starterCondition · starterRule · starterValue · TEMPLATES · UNARY_OPERATORS · uniqueName · updateBlock · updateEnding · updateForm · updateHidden · updateRule · updateSettings · usesOutput · valueForOperator · visibleFindings · withOptionValues

And 37 types.

@marktiderman/genesis-forms-builder/ops

Other exports (61)

addEnding · addHidden · addRule · ATTRIBUTE_VALUE_SEPARATOR · blockIdPrefix · chosenOutputs · clearOutputs · conditionFields · conditionHidden · createContent · createField · createPageBreak · DEFAULT_TABLE_COLUMNS · defaultEndingId · defaultProps · duplicateBlock · emptyForm · formIds · freshId · HIDDEN_OPERATORS · hostOptionsOf · insertBlock · mergeOptions · moveBlock · moveRule · newId · newOptionValue · operatorsFor · OPTION_LIST_LIMITS · optionListCsv · outputPropsFor · outputsFor · outputUsedBy · parseCsvRows · parseOptionListCsv · removeBlock · removeEnding · removeHidden · removeRule · RESERVED_OUTPUT_PROPS · ruleRefs · setIdGenerator · setOptions · setOptionsFilter · setOptionsSource · setOutput · setPrefill · slugKey · slugOptionValue · starterCondition · starterValue · UNARY_OPERATORS · uniqueName · updateBlock · updateEnding · updateForm · updateHidden · updateRule · updateSettings · usesOutput · withOptionValues

And 9 types.