@theredhead — Frontend Library - v0.2.1
    Preparing search index...

    Signal-based engine that maintains the mutable designer state and produces a readonly FormSchema snapshot on demand.

    All mutations go through public methods so the UI stays in sync via Angular's signal-based change detection.

    const engine = new FormDesignerEngine();
    engine.addGroup();
    engine.addField(engine.groups()[0].uid, 'text');
    const schema = engine.schema();
    Index

    Constructors

    Properties

    formDescription: WritableSignal<string> = ...

    Form description.

    formId: WritableSignal<string> = ...

    Form ID.

    formTitle: WritableSignal<string> = ...

    Form title.

    groups: WritableSignal<MutableGroupDefinition[]> = ...

    Ordered list of mutable group definitions.

    schema: Signal<FormSchema> = ...

    Produces a readonly FormSchema snapshot from the current mutable state. Fully JSON-serializable.

    selectedField: Signal<MutableFieldDefinition | null> = ...

    The currently selected mutable field (convenience).

    selectedGroup: Signal<MutableGroupDefinition | null> = ...

    The currently selected mutable group (convenience).

    selection: WritableSignal<DesignerSelection | null> = ...

    Currently selected item in the canvas.

    Methods

    • Add a new field to a group. Returns the new field's uid.

      Parameters

      • groupUid: string

        — Target group

      • component: string

        — Field component key (e.g. "text", "select")

      • OptionalatIndex: number

        — Optional insertion index (appends if omitted)

      Returns string

    • Add a new empty group at the end. Returns the new group's uid.

      Returns string

    • Clear the selection.

      Returns void

    • Duplicate a field within its group (inserted right after the original).

      Parameters

      • groupUid: string
      • fieldUid: string

      Returns string | null

    • Load an existing FormSchema into the designer, replacing all current state.

      Parameters

      Returns void

    • Move a field to a new position within its group, or to another group.

      Parameters

      • sourceGroupUid: string
      • fieldUid: string
      • targetGroupUid: string
      • targetIndex: number

      Returns void

    • Move a group to a new index.

      Parameters

      • uid: string
      • newIndex: number

      Returns void

    • Remove a field by uid from its containing group.

      Parameters

      • groupUid: string
      • fieldUid: string

      Returns void

    • Remove a group by uid. Clears selection if it pointed at the group.

      Parameters

      • uid: string

      Returns void

    • Select a field for editing in the inspector.

      Parameters

      • groupUid: string
      • fieldUid: string

      Returns void

    • Select the form-level properties for editing.

      Returns void

    • Select a group for editing in the inspector.

      Parameters

      • groupUid: string

      Returns void

    • Produce a pretty-printed JSON string of the current schema.

      Returns string