bconst

package
v0.24.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

common configuration and constants for tapestry's use of blockly

Index

Constants

View Source
const (
	FieldCheckbox = "field_checkbox"
	FieldDropdown = "field_dropdown"
	FieldText     = "field_input"
	FieldLabel    = "field_label"
	FieldNumber   = "field_number"
	// blocks can stack vertically ( or link horizontally )
	InputStatement = "input_statement"
	// blocks can link horizontally ( or stack vertically )
	InputValue = "input_value"
	// fields are partitioned into rows of inputs;
	// if a row doesnt need connect with other blocks, it can use a dummy input.
	InputDummy = "input_dummy"
)
View Source
const (
	// alternative class for str fields so that open strs with choices can use dropdowns.
	MosaicStrField = "mosaic_str_field"
	// alternative class for text fields so all text can have placeholder text.
	MosaicTextField = "mosaic_text_field"
	// multiline variant of the text field
	MosaicMultilineField = "mosaic_multiline_field"
)
View Source
const ColorMarkup = "blockly-color"

tapestry typespec markup

View Source
const DefaultColor = "TAP_HUE"

yup.

View Source
const InlineBlockMarkup = "mosaic-inline" // a block with no labels
View Source
const RootBlockMarkup = "mosaic-root" // special shapes that have no output.
View Source
const StackMarkup = "blockly-stack"

Variables

This section is empty.

Functions

func BlockColor

func BlockColor(blockType typeinfo.T) (ret string)

func InlineBlock

func InlineBlock(blockType typeinfo.T) (ret bool)

func KeyName

func KeyName(s string) string

underscore name to something else.

func MutatorName

func MutatorName(blockType string) string

transform the passed block name into the name of its corresponding mutator block. ex. _name_mutator

func RootBlock

func RootBlock(blockType typeinfo.T) (ret bool)

func StackedName

func StackedName(blockType string) string

transform the passed block name into the name of its corresponding stacked block. ex. _name_stack

Types

type SlotRule

type SlotRule struct {
	Name   string
	Stack  bool // if false, then: input_value, if true: input_statement
	Colour string
	Type   *typeinfo.Slot
}

func MakeSlotRule

func MakeSlotRule(slot *typeinfo.Slot) SlotRule

func (*SlotRule) InputType

func (slot *SlotRule) InputType() (ret string)

slots are referenced by terms of a flow blockly needs to know whether they stacked or produce a single value note: in blockly, a *block* can only be one or the other while tapestry allows you to produce and discard a value. so, there are some *flows* which can be stackable *or* produce a value. ( fwiw: most languages allow this, including go. ) what we care about here though, is just the slot.

func (*SlotRule) SlotType

func (slot *SlotRule) SlotType() (ret string)

ex. "stacked_story_statement"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL