-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblock.go
More file actions
33 lines (29 loc) · 1 KB
/
block.go
File metadata and controls
33 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package tinkerdown
import "github.com/livetemplate/livetemplate"
// ServerBlock represents author-written server-side code.
// This code is trusted, pre-compiled, and powers interactive blocks.
type ServerBlock struct {
ID string
Language string // Currently only "go"
Content string
Metadata map[string]string
}
// WasmBlock represents student-editable code that runs in the browser.
// This code is untrusted and never sent to the server.
type WasmBlock struct {
ID string
Language string // Currently only "go"
DefaultCode string
ShowRunButton bool
Metadata map[string]string
}
// InteractiveBlock represents a live UI component powered by server state.
// Each block is a mini livetemplate instance.
type InteractiveBlock struct {
ID string
StateRef string // References a ServerBlock ID
Template *livetemplate.Template
Store interface{} // State object with action methods (uses method dispatch)
Content string // Template content
Metadata map[string]string
}