From 17ce38f8ab1a319e69a25619795bfb959e83195a Mon Sep 17 00:00:00 2001 From: cha0s Date: Wed, 24 Jun 2020 03:07:53 -0500 Subject: [PATCH] chore: desc --- packages/behavior/types.hooks.js | 57 ++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/packages/behavior/types.hooks.js b/packages/behavior/types.hooks.js index af5b61a..ee6b287 100644 --- a/packages/behavior/types.hooks.js +++ b/packages/behavior/types.hooks.js @@ -1,3 +1,5 @@ +// import {Entity} from '@avocado/entity'; + import Flow from './types/flow'; import Timing from './types/timing'; import Utility from './types/utility'; @@ -15,21 +17,28 @@ export function behaviorTypes() { bool: { defaultLiteral: true, }, - context: { - children: { - add: { - type: 'void', - label: 'Add $2 as $1.', - args: [ - ['key', { - type: 'string', - }], - ['value', { - type: 'any', - }], - ], + context: (context) => { + if (context?._traits) { + debugger; + } + // console.log(context) + return { + ...(context ? context.description() : {}), + children: { + add: { + type: 'void', + label: 'Add $2 as $1.', + args: [ + ['key', { + type: 'string', + }], + ['value', { + type: 'any', + }], + ], + }, }, - }, + }; }, Flow: { children: { @@ -90,6 +99,11 @@ export function behaviorTypes() { }, Utility: { children: { + log: { + type: 'void', + label: 'Log.', + args: [], + }, makeArray: { type: 'array', label: 'Make array.', @@ -100,10 +114,17 @@ export function behaviorTypes() { label: 'Make object.', args: [], }, - log: { - type: 'void', - label: 'Log.', - args: [], + makeVector: { + type: 'vector', + label: 'Make vector.', + args: [ + ['x', { + type: 'number', + }], + ['y', { + type: 'number', + }], + ], }, merge: { type: 'object',