/** * Headless entrypoint for the SDC engine, published as `@aehrc/smart-forms-renderer/engine`. * * The package root (`@aehrc/smart-forms-renderer`) is a DOM renderer: importing it pulls in * Material UI, Emotion, react-dom, react-markdown and the drag-and-drop libraries. Consumers * that only need the form engine cannot use that barrel, so they have been deep-importing * internal `lib/...` paths instead. * * Scope of "headless" here: no DOM and no UI library in the runtime graph, which is what makes * the engine usable from a React Native host or a test. It does not mean the package is * loadable by Node directly. The build emits `module: ES2020` with extensionless relative * specifiers and the package does not set `"type": "module"`, so every entrypoint including * this one is bundler-only. That is pre-existing and unchanged here. * * This entrypoint is the supported alternative. Its contents are the subset of the root * barrel's public API that has no DOM or UI-library dependency, plus the vanilla Zustand * stores that hold form state. Every name exported here is also exported from the package * root (a test enforces this), so nothing becomes public by appearing here alone. It * intentionally re-exports nothing from `src/components`, `src/hooks` or `src/theme`. * * Two consequences of being headless are worth stating: * - Nothing here renders. `buildForm` and the stores drive form state; drawing it is the * host's job. * - `RendererConfig` is exported as a type only, because `BuildFormParams` accepts it. Its * values describe DOM layout and have no effect without the DOM renderer. */ export type { QuestionnaireStoreType } from './stores/questionnaireStore'; export { questionnaireStore, useQuestionnaireStore } from './stores/questionnaireStore'; export type { QuestionnaireResponseStoreType } from './stores/questionnaireResponseStore'; export { questionnaireResponseStore, useQuestionnaireResponseStore } from './stores/questionnaireResponseStore'; export type { TerminologyServerStoreType } from './stores/terminologyServerStore'; export { terminologyServerStore, useTerminologyServerStore } from './stores/terminologyServerStore'; export type { SmartConfigStoreType } from './stores/smartConfigStore'; export { smartConfigStore, useSmartConfigStore } from './stores/smartConfigStore'; export type { RendererConfig } from './stores/rendererConfigStore'; export type { BuildFormParams, RepopulateFormParams } from './utils/manageForm'; export { buildForm, repopulateForm, destroyForm, getResponse, removeEmptyAnswersFromResponse, removeInternalIdsFromResponse } from './utils/manageForm'; export { initialiseQuestionnaireResponse } from './utils/initialise'; export { createEmptyQrItem, createEmptyQrGroup, updateQrItemsInGroup } from './utils/qrItem'; export { mapQItemsIndex, getQrItemsIndex } from './utils/mapItem'; export { isRepeatItemAndNotCheckbox, isHiddenByEnableWhen } from './utils/qItem'; export { isSpecificItemControl, getDecimalPrecision } from './utils/extensions'; export { getQuestionnaireItem, getSectionHeading } from './utils/misc'; export { parseDecimalStringToFloat, parseDecimalStringWithPrecision } from './utils/parseInputs'; export type { ItemToRepopulate } from './utils/repopulateItems'; export { generateItemsToRepopulate } from './utils/repopulateItems'; export { repopulateResponse } from './utils/repopulateIntoResponse'; export { extractObservationBased, canBeObservationExtracted, buildBundleFromObservationArray } from './utils/extractObservation';