@@ -390,6 +401,13 @@ function StringSuffix({ path, getValues, config, node, value, lang, states }: No
}
}
+type MenuAction = {
+ label: string,
+ description?: string,
+ icon: keyof typeof Octicon,
+ onSelect: () => unknown,
+}
+
type TreeNodeProps = {
schema: INode
,
path: ModelPath,
@@ -399,9 +417,10 @@ type TreeNodeProps = {
ctx: Record,
compare?: any,
label?: string,
+ actions?: MenuAction[],
children?: ComponentChildren,
}
-function TreeNode({ label, schema, path, value, lang, states, ctx, children }: TreeNodeProps) {
+function TreeNode({ label, schema, path, value, lang, states, ctx, actions, children }: TreeNodeProps) {
const type = schema.type(path)
const category = schema.category(path)
const context = path.getContext().join('.')
@@ -416,18 +435,21 @@ function TreeNode({ label, schema, path, value, lang, states, ctx, children }: T
delete newCtx.index
const [prefix, suffix, body] = schema.hook(renderHtml, path, value, lang, states, newCtx)
return
-