diff --git a/packages/xforms-engine/src/client/TextRange.ts b/packages/xforms-engine/src/client/TextRange.ts index b490c2e7..44b54105 100644 --- a/packages/xforms-engine/src/client/TextRange.ts +++ b/packages/xforms-engine/src/client/TextRange.ts @@ -1,4 +1,7 @@ import type { ActiveLanguage } from './FormLanguage.ts'; +import type { AudioMediaResource } from './media/AudioMediaResource.ts'; +import type { ImageMediaResource } from './media/ImageMediaResource.ts'; +import type { VideoMediaResource } from './media/VideoMediaResource.ts'; import type { RootNodeState } from './RootNode.ts'; /** @@ -57,6 +60,19 @@ import type { RootNodeState } from './RootNode.ts'; * opaque (as in, the `jr:itext` implementation is encapsulated in the `xpath` * package, and the engine doesn't really deal with itext translations at the * node level at all). + * + * @todo Once media is parsed ({@link TextRange.audio}, {@link TextRange.image}, + * {@link TextRange.video}), the 'translation' case will be parsed as a node + * rather than as a string. That will unblock output-in-itext. If a minimal + * first pass is to retain the current 'translation' interface, it will need to + * reproduce the bug preventing output-in-itext functionality by identifying the + * (potentially media-adjacent) `` node and casting it back to a string. + * Future iterations could then remove this reproduction-of-bug, allowing + * output-in-itext to work as expected... at which point the design for the + * 'translation' will have increased depth (i.e. establishing {@link TextRange} + * as a tree rather than a list). Alternatively, the 'translation' case could be + * hoisted up to {@link TextRange} to preserve the current depth (until support + * for Markdown would, potentially, establish a tree). */ // prettier-ignore export type TextChunkSource = @@ -147,6 +163,26 @@ export type TextOrigin = * reasoned about differently by clients depending on their role (for instance, * a text range's role may correspond to the "short" or "guidance" `form` of a * {@link https://getodk.github.io/xforms-spec/#languages | translation}). + * + * @todo In following revisions, this could: + * + * - be renamed `RichText` to better represent its semantics + * - support cases with multiple text variants (`