add Block + Component, add TextComponent with min, max and regex validators and early NumberComponent

This commit is contained in:
2026-02-12 15:47:52 +00:00
parent 4f77702125
commit 6099538fa8
16 changed files with 488 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package block
import (
"blocky/internal/block/validation"
"encoding/json"
)
type ComponentType int8
const (
_ ComponentType = iota
TextComponentType
NumberComponentType
Date
)
type Component interface {
Type() ComponentType
Identifier() string
Name() string
NewInstance() ComponentInstance
Validators() []validation.Validator
}
type ComponentInstance interface {
FromJSON(component Component, data json.RawMessage) error
}