4bd75132 by Adam Heath

Add ReplaceNode(similar to WrapNode), and change the name of the called

function to Component, from Wrapped.
1 parent 3bb5a2fc
......@@ -5,8 +5,9 @@ import Node from './node.astro'
import Replace from './replace.astro'
import External from './external.astro'
import WrapNode from './wrap-node.astro'
import ReplaceNode from './replace-node.astro'
export { Children, Custom, Match, Node, Replace, External, WrapNode }
export { Children, Custom, Match, Node, Replace, External, WrapNode, ReplaceNode }
import type { NodeType } from 'ultrahtml'
type SlotHandler = (string, NodeType) => Promise<Any>
......
---
import Children from './children.astro'
const { props: { Component, args, node, special, ...rest } } = Astro
---
{!special &&
<Component {...node.attributes} {...args}>
<Children parent={node} children={node.children} special={special} {...rest}/>
</Component>
}
---
import Node from './node.astro'
const { props: { Wrapped, args, special, ...rest } } = Astro
const { props: { Component, args, special, ...rest } } = Astro
---
{!special &&
<Wrapped {...args}>
<Component {...args}>
<Node {...rest}/>
</Wrapped>
</Component>
}
......