visibleNodes
Returns the marks a reader can see right now: flatNodes, except that a presence cue which has not fired, or has been cued back out, takes its contents with it.
@internote/canvas-sdkOn this page
import { visibleNodes } from '@internote/canvas-sdk';Anything that puts a control in front of the reader has to ask this rather than flatNodes, or a control written inside a cue hands out its slider from the first step while the mark it drives is still off the surface. The attention cues leave presence alone, so their contents are always here.
#Signature
<N extends NodeLike>(
children: readonly N[],
nodeVisible: (node: N) => boolean,
): N[]#Parameters
childrenAn environment's children, as
childNodes returns them.nodeVisibleWhether a cue's content is present at this moment. Pass
ctx.animation.nodeVisible, so the answer is the one the anchors give.#Returns
The visible marks in source order.
#Example
const shown = visibleNodes(childNodes(ctx.node.body), (node) => ctx.animation.nodeVisible(node));Declared in packages/canvas-sdk/src/environment/nodes.ts:157.