@getodk/xforms-engine 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/dist/client/BaseNode.d.ts +69 -4
  2. package/dist/client/EngineConfig.d.ts +0 -1
  3. package/dist/client/GroupNode.d.ts +4 -3
  4. package/dist/client/ModelValueNode.d.ts +36 -0
  5. package/dist/client/NodeAppearances.d.ts +1 -2
  6. package/dist/client/NoteNode.d.ts +52 -0
  7. package/dist/client/RootNode.d.ts +4 -3
  8. package/dist/client/SelectNode.d.ts +6 -5
  9. package/dist/client/StringNode.d.ts +6 -5
  10. package/dist/client/SubtreeNode.d.ts +3 -2
  11. package/dist/client/TextRange.d.ts +85 -3
  12. package/dist/client/TriggerNode.d.ts +25 -0
  13. package/dist/client/constants.d.ts +8 -0
  14. package/dist/client/hierarchy.d.ts +19 -10
  15. package/dist/client/index.d.ts +0 -1
  16. package/dist/client/node-types.d.ts +3 -1
  17. package/dist/client/{RepeatRangeNode.d.ts → repeat/BaseRepeatRangeNode.d.ts} +18 -18
  18. package/dist/client/{RepeatInstanceNode.d.ts → repeat/RepeatInstanceNode.d.ts} +9 -9
  19. package/dist/client/repeat/RepeatRangeControlledNode.d.ts +18 -0
  20. package/dist/client/repeat/RepeatRangeUncontrolledNode.d.ts +19 -0
  21. package/dist/client/unsupported/RangeNode.d.ts +9 -0
  22. package/dist/client/unsupported/RankNode.d.ts +9 -0
  23. package/dist/client/unsupported/UnsupportedControlNode.d.ts +32 -0
  24. package/dist/client/unsupported/UploadNode.d.ts +9 -0
  25. package/dist/client/validation.d.ts +162 -0
  26. package/dist/index.d.ts +14 -6
  27. package/dist/index.js +39696 -36151
  28. package/dist/index.js.map +1 -1
  29. package/dist/instance/Group.d.ts +3 -2
  30. package/dist/instance/ModelValue.d.ts +39 -0
  31. package/dist/instance/Note.d.ts +41 -0
  32. package/dist/instance/Root.d.ts +5 -4
  33. package/dist/instance/SelectField.d.ts +11 -6
  34. package/dist/instance/StringField.d.ts +12 -7
  35. package/dist/instance/Subtree.d.ts +2 -1
  36. package/dist/instance/TriggerControl.d.ts +40 -0
  37. package/dist/instance/abstract/DescendantNode.d.ts +8 -10
  38. package/dist/instance/abstract/InstanceNode.d.ts +3 -2
  39. package/dist/instance/abstract/UnsupportedControl.d.ts +46 -0
  40. package/dist/instance/children.d.ts +0 -1
  41. package/dist/instance/hierarchy.d.ts +15 -6
  42. package/dist/instance/index.d.ts +0 -1
  43. package/dist/instance/internal-api/EvaluationContext.d.ts +0 -1
  44. package/dist/instance/internal-api/InstanceConfig.d.ts +0 -1
  45. package/dist/instance/internal-api/SubscribableDependency.d.ts +0 -1
  46. package/dist/instance/internal-api/TranslationContext.d.ts +0 -1
  47. package/dist/instance/internal-api/ValidationContext.d.ts +28 -0
  48. package/dist/instance/internal-api/ValueContext.d.ts +3 -4
  49. package/dist/instance/{RepeatRange.d.ts → repeat/BaseRepeatRange.d.ts} +46 -46
  50. package/dist/instance/{RepeatInstance.d.ts → repeat/RepeatInstance.d.ts} +13 -13
  51. package/dist/instance/repeat/RepeatRangeControlled.d.ts +15 -0
  52. package/dist/instance/repeat/RepeatRangeUncontrolled.d.ts +34 -0
  53. package/dist/instance/resource.d.ts +0 -1
  54. package/dist/instance/text/TextChunk.d.ts +0 -1
  55. package/dist/instance/text/TextRange.d.ts +4 -5
  56. package/dist/instance/unsupported/RangeControl.d.ts +4 -0
  57. package/dist/instance/unsupported/RankControl.d.ts +4 -0
  58. package/dist/instance/unsupported/UploadControl.d.ts +4 -0
  59. package/dist/lib/TokenListParser.d.ts +3 -3
  60. package/dist/lib/dom/query.d.ts +1 -2
  61. package/dist/lib/reactivity/createChildrenState.d.ts +0 -1
  62. package/dist/lib/reactivity/createComputedExpression.d.ts +7 -3
  63. package/dist/lib/reactivity/createNoteReadonlyThunk.d.ts +4 -0
  64. package/dist/lib/reactivity/createSelectItems.d.ts +0 -1
  65. package/dist/lib/reactivity/createValueState.d.ts +0 -1
  66. package/dist/lib/reactivity/materializeCurrentStateChildren.d.ts +0 -1
  67. package/dist/lib/reactivity/node-state/createClientState.d.ts +0 -1
  68. package/dist/lib/reactivity/node-state/createCurrentState.d.ts +0 -1
  69. package/dist/lib/reactivity/node-state/createEngineState.d.ts +0 -1
  70. package/dist/lib/reactivity/node-state/createSharedNodeState.d.ts +1 -2
  71. package/dist/lib/reactivity/node-state/createSpecifiedPropertyDescriptor.d.ts +0 -1
  72. package/dist/lib/reactivity/node-state/createSpecifiedState.d.ts +1 -2
  73. package/dist/lib/reactivity/node-state/representations.d.ts +0 -1
  74. package/dist/lib/reactivity/scope.d.ts +0 -1
  75. package/dist/lib/reactivity/text/createFieldHint.d.ts +3 -4
  76. package/dist/lib/reactivity/text/createNodeLabel.d.ts +3 -4
  77. package/dist/lib/reactivity/text/createNoteText.d.ts +24 -0
  78. package/dist/lib/reactivity/text/createTextRange.d.ts +5 -8
  79. package/dist/lib/reactivity/types.d.ts +0 -1
  80. package/dist/lib/reactivity/validation/createAggregatedViolations.d.ts +8 -0
  81. package/dist/lib/reactivity/validation/createValidation.d.ts +17 -0
  82. package/dist/{XFormDOM.d.ts → parse/XFormDOM.d.ts} +1 -2
  83. package/dist/{XFormDataType.d.ts → parse/XFormDataType.d.ts} +2 -4
  84. package/dist/{XFormDefinition.d.ts → parse/XFormDefinition.d.ts} +2 -3
  85. package/dist/{body → parse/body}/BodyDefinition.d.ts +15 -10
  86. package/dist/{body → parse/body}/BodyElementDefinition.d.ts +8 -7
  87. package/dist/{body → parse/body}/RepeatElementDefinition.d.ts +4 -5
  88. package/dist/{body → parse/body}/UnsupportedBodyElementDefinition.d.ts +0 -1
  89. package/dist/{body → parse/body}/appearance/inputAppearanceParser.d.ts +1 -2
  90. package/dist/{body → parse/body}/appearance/selectAppearanceParser.d.ts +1 -2
  91. package/dist/{body → parse/body}/appearance/structureElementAppearanceParser.d.ts +1 -2
  92. package/dist/parse/body/appearance/unknownAppearanceParser.d.ts +3 -0
  93. package/dist/{body → parse/body}/control/ControlDefinition.d.ts +3 -4
  94. package/dist/{body → parse/body}/control/InputDefinition.d.ts +1 -2
  95. package/dist/parse/body/control/RangeControlDefinition.d.ts +11 -0
  96. package/dist/parse/body/control/RankControlDefinition.d.ts +11 -0
  97. package/dist/parse/body/control/TriggerControlDefinition.d.ts +11 -0
  98. package/dist/parse/body/control/UploadControlDefinition.d.ts +11 -0
  99. package/dist/{body → parse/body}/control/select/ItemDefinition.d.ts +3 -4
  100. package/dist/{body → parse/body}/control/select/ItemsetDefinition.d.ts +7 -7
  101. package/dist/{body → parse/body}/control/select/ItemsetNodesetContext.d.ts +2 -3
  102. package/dist/{body → parse/body}/control/select/SelectDefinition.d.ts +3 -12
  103. package/dist/{body → parse/body}/group/BaseGroupDefinition.d.ts +3 -5
  104. package/dist/{body → parse/body}/group/LogicalGroupDefinition.d.ts +0 -1
  105. package/dist/{body → parse/body}/group/PresentationGroupDefinition.d.ts +1 -2
  106. package/dist/{body → parse/body}/group/StructuralGroupDefinition.d.ts +0 -1
  107. package/dist/{model/BindComputation.d.ts → parse/expression/BindComputationExpression.d.ts} +5 -6
  108. package/dist/{body/control/select → parse/expression}/ItemsetNodesetExpression.d.ts +2 -3
  109. package/dist/{body/control/select → parse/expression}/ItemsetValueExpression.d.ts +2 -3
  110. package/dist/parse/expression/RepeatCountControlExpression.d.ts +18 -0
  111. package/dist/parse/expression/TextLiteralExpression.d.ts +9 -0
  112. package/dist/parse/expression/TextOutputExpression.d.ts +7 -0
  113. package/dist/parse/expression/TextReferenceExpression.d.ts +7 -0
  114. package/dist/parse/expression/TextTranslationExpression.d.ts +8 -0
  115. package/dist/{expression → parse/expression/abstract}/DependencyContext.d.ts +0 -1
  116. package/dist/{expression → parse/expression/abstract}/DependentExpression.d.ts +13 -10
  117. package/dist/parse/expression/abstract/TextChunkExpression.d.ts +17 -0
  118. package/dist/parse/model/BindDefinition.d.ts +39 -0
  119. package/dist/{model → parse/model}/BindElement.d.ts +1 -0
  120. package/dist/{model → parse/model}/DescendentNodeDefinition.d.ts +0 -1
  121. package/dist/{model/ValueNodeDefinition.d.ts → parse/model/LeafNodeDefinition.d.ts} +3 -4
  122. package/dist/{model → parse/model}/ModelBindMap.d.ts +0 -1
  123. package/dist/{model → parse/model}/ModelDefinition.d.ts +1 -2
  124. package/dist/{model → parse/model}/NodeDefinition.d.ts +8 -9
  125. package/dist/parse/model/NoteNodeDefinition.d.ts +30 -0
  126. package/dist/{model → parse/model}/RepeatInstanceDefinition.d.ts +3 -4
  127. package/dist/{model → parse/model}/RepeatRangeDefinition.d.ts +14 -5
  128. package/dist/{model → parse/model}/RepeatTemplateDefinition.d.ts +2 -3
  129. package/dist/{model → parse/model}/RootDefinition.d.ts +2 -3
  130. package/dist/{model → parse/model}/SubtreeDefinition.d.ts +1 -2
  131. package/dist/parse/text/HintDefinition.d.ts +8 -0
  132. package/dist/parse/text/ItemLabelDefinition.d.ts +8 -0
  133. package/dist/parse/text/ItemsetLabelDefinition.d.ts +12 -0
  134. package/dist/parse/text/LabelDefinition.d.ts +14 -0
  135. package/dist/parse/text/MessageDefinition.d.ts +14 -0
  136. package/dist/parse/text/abstract/TextElementDefinition.d.ts +22 -0
  137. package/dist/parse/text/abstract/TextRangeDefinition.d.ts +34 -0
  138. package/dist/parse/xpath/dependency-analysis.d.ts +40 -0
  139. package/dist/parse/xpath/path-resolution.d.ts +69 -0
  140. package/dist/parse/xpath/predicate-analysis.d.ts +29 -0
  141. package/dist/parse/xpath/reference-parsing.d.ts +17 -0
  142. package/dist/parse/xpath/semantic-analysis.d.ts +97 -0
  143. package/dist/parse/xpath/syntax-traversal.d.ts +68 -0
  144. package/dist/solid.js +8745 -5186
  145. package/dist/solid.js.map +1 -1
  146. package/package.json +15 -16
  147. package/src/client/BaseNode.ts +74 -8
  148. package/src/client/GroupNode.ts +4 -2
  149. package/src/client/ModelValueNode.ts +40 -0
  150. package/src/client/NodeAppearances.ts +1 -1
  151. package/src/client/NoteNode.ts +74 -0
  152. package/src/client/README.md +1 -0
  153. package/src/client/RootNode.ts +4 -2
  154. package/src/client/SelectNode.ts +6 -4
  155. package/src/client/StringNode.ts +6 -4
  156. package/src/client/SubtreeNode.ts +3 -1
  157. package/src/client/TextRange.ts +98 -2
  158. package/src/client/TriggerNode.ts +29 -0
  159. package/src/client/constants.ts +10 -0
  160. package/src/client/hierarchy.ts +43 -15
  161. package/src/client/node-types.ts +17 -2
  162. package/src/client/{RepeatRangeNode.ts → repeat/BaseRepeatRangeNode.ts} +18 -19
  163. package/src/client/{RepeatInstanceNode.ts → repeat/RepeatInstanceNode.ts} +10 -8
  164. package/src/client/repeat/RepeatRangeControlledNode.ts +20 -0
  165. package/src/client/repeat/RepeatRangeUncontrolledNode.ts +21 -0
  166. package/src/client/unsupported/RangeNode.ts +14 -0
  167. package/src/client/unsupported/RankNode.ts +14 -0
  168. package/src/client/unsupported/UnsupportedControlNode.ts +40 -0
  169. package/src/client/unsupported/UploadNode.ts +14 -0
  170. package/src/client/validation.ts +199 -0
  171. package/src/index.ts +21 -9
  172. package/src/instance/Group.ts +10 -4
  173. package/src/instance/ModelValue.ts +104 -0
  174. package/src/instance/Note.ts +142 -0
  175. package/src/instance/Root.ts +16 -6
  176. package/src/instance/SelectField.ts +29 -7
  177. package/src/instance/StringField.ts +36 -10
  178. package/src/instance/Subtree.ts +9 -3
  179. package/src/instance/TriggerControl.ts +134 -0
  180. package/src/instance/abstract/DescendantNode.ts +9 -10
  181. package/src/instance/abstract/InstanceNode.ts +29 -7
  182. package/src/instance/abstract/UnsupportedControl.ts +151 -0
  183. package/src/instance/children.ts +113 -16
  184. package/src/instance/hierarchy.ts +42 -5
  185. package/src/instance/index.ts +1 -1
  186. package/src/instance/internal-api/EvaluationContext.ts +1 -1
  187. package/src/instance/internal-api/ValidationContext.ts +32 -0
  188. package/src/instance/internal-api/ValueContext.ts +3 -3
  189. package/src/instance/{RepeatRange.ts → repeat/BaseRepeatRange.ts} +114 -99
  190. package/src/instance/{RepeatInstance.ts → repeat/RepeatInstance.ts} +27 -22
  191. package/src/instance/repeat/RepeatRangeControlled.ts +82 -0
  192. package/src/instance/repeat/RepeatRangeUncontrolled.ts +67 -0
  193. package/src/instance/text/TextRange.ts +10 -4
  194. package/src/instance/unsupported/RangeControl.ts +5 -0
  195. package/src/instance/unsupported/RankControl.ts +5 -0
  196. package/src/instance/unsupported/UploadControl.ts +5 -0
  197. package/src/lib/TokenListParser.ts +11 -7
  198. package/src/lib/dom/query.ts +1 -1
  199. package/src/lib/reactivity/createComputedExpression.ts +25 -27
  200. package/src/lib/reactivity/createNoteReadonlyThunk.ts +33 -0
  201. package/src/lib/reactivity/createSelectItems.ts +23 -16
  202. package/src/lib/reactivity/createValueState.ts +3 -3
  203. package/src/lib/reactivity/node-state/createSharedNodeState.ts +1 -1
  204. package/src/lib/reactivity/node-state/createSpecifiedState.ts +1 -1
  205. package/src/lib/reactivity/text/createFieldHint.ts +9 -7
  206. package/src/lib/reactivity/text/createNodeLabel.ts +8 -6
  207. package/src/lib/reactivity/text/createNoteText.ts +72 -0
  208. package/src/lib/reactivity/text/createTextRange.ts +17 -90
  209. package/src/lib/reactivity/validation/createAggregatedViolations.ts +75 -0
  210. package/src/lib/reactivity/validation/createValidation.ts +196 -0
  211. package/src/{XFormDataType.ts → parse/XFormDataType.ts} +1 -3
  212. package/src/{XFormDefinition.ts → parse/XFormDefinition.ts} +2 -2
  213. package/src/{body → parse/body}/BodyDefinition.ts +44 -27
  214. package/src/{body → parse/body}/BodyElementDefinition.ts +13 -6
  215. package/src/{body → parse/body}/RepeatElementDefinition.ts +10 -20
  216. package/src/{body → parse/body}/appearance/inputAppearanceParser.ts +1 -1
  217. package/src/{body → parse/body}/appearance/selectAppearanceParser.ts +1 -1
  218. package/src/{body → parse/body}/appearance/structureElementAppearanceParser.ts +1 -1
  219. package/src/parse/body/appearance/unknownAppearanceParser.ts +5 -0
  220. package/src/{body → parse/body}/control/ControlDefinition.ts +5 -4
  221. package/src/parse/body/control/RangeControlDefinition.ts +26 -0
  222. package/src/parse/body/control/RankControlDefinition.ts +27 -0
  223. package/src/parse/body/control/TriggerControlDefinition.ts +26 -0
  224. package/src/parse/body/control/UploadControlDefinition.ts +26 -0
  225. package/src/{body → parse/body}/control/select/ItemDefinition.ts +4 -4
  226. package/src/parse/body/control/select/ItemsetDefinition.ts +53 -0
  227. package/src/{body → parse/body}/control/select/ItemsetNodesetContext.ts +2 -2
  228. package/src/{body → parse/body}/control/select/SelectDefinition.ts +3 -11
  229. package/src/{body → parse/body}/group/BaseGroupDefinition.ts +11 -21
  230. package/src/{body → parse/body}/group/PresentationGroupDefinition.ts +1 -1
  231. package/src/{model/BindComputation.ts → parse/expression/BindComputationExpression.ts} +8 -12
  232. package/src/parse/expression/ItemsetNodesetExpression.ts +8 -0
  233. package/src/{body/control/select → parse/expression}/ItemsetValueExpression.ts +2 -2
  234. package/src/parse/expression/RepeatCountControlExpression.ts +44 -0
  235. package/src/parse/expression/TextLiteralExpression.ts +19 -0
  236. package/src/parse/expression/TextOutputExpression.ts +25 -0
  237. package/src/parse/expression/TextReferenceExpression.ts +14 -0
  238. package/src/parse/expression/TextTranslationExpression.ts +38 -0
  239. package/src/{expression → parse/expression/abstract}/DependentExpression.ts +46 -28
  240. package/src/parse/expression/abstract/TextChunkExpression.ts +38 -0
  241. package/src/{model → parse/model}/BindDefinition.ts +30 -27
  242. package/src/{model → parse/model}/BindElement.ts +1 -0
  243. package/src/{model/ValueNodeDefinition.ts → parse/model/LeafNodeDefinition.ts} +4 -4
  244. package/src/{model → parse/model}/ModelBindMap.ts +4 -0
  245. package/src/{model → parse/model}/NodeDefinition.ts +12 -12
  246. package/src/parse/model/NoteNodeDefinition.ts +70 -0
  247. package/src/{model → parse/model}/RepeatInstanceDefinition.ts +2 -2
  248. package/src/parse/model/RepeatRangeDefinition.ts +94 -0
  249. package/src/{model → parse/model}/RootDefinition.ts +8 -4
  250. package/src/parse/text/HintDefinition.ts +25 -0
  251. package/src/parse/text/ItemLabelDefinition.ts +25 -0
  252. package/src/parse/text/ItemsetLabelDefinition.ts +44 -0
  253. package/src/parse/text/LabelDefinition.ts +61 -0
  254. package/src/parse/text/MessageDefinition.ts +49 -0
  255. package/src/parse/text/abstract/TextElementDefinition.ts +71 -0
  256. package/src/parse/text/abstract/TextRangeDefinition.ts +70 -0
  257. package/src/parse/xpath/dependency-analysis.ts +105 -0
  258. package/src/parse/xpath/path-resolution.ts +475 -0
  259. package/src/parse/xpath/predicate-analysis.ts +61 -0
  260. package/src/parse/xpath/reference-parsing.ts +90 -0
  261. package/src/parse/xpath/semantic-analysis.ts +466 -0
  262. package/src/parse/xpath/syntax-traversal.ts +129 -0
  263. package/dist/body/text/HintDefinition.d.ts +0 -11
  264. package/dist/body/text/LabelDefinition.d.ts +0 -22
  265. package/dist/body/text/TextElementDefinition.d.ts +0 -33
  266. package/dist/body/text/TextElementOutputPart.d.ts +0 -13
  267. package/dist/body/text/TextElementPart.d.ts +0 -13
  268. package/dist/body/text/TextElementReferencePart.d.ts +0 -7
  269. package/dist/body/text/TextElementStaticPart.d.ts +0 -7
  270. package/dist/lib/xpath/analysis.d.ts +0 -23
  271. package/dist/model/BindDefinition.d.ts +0 -32
  272. package/src/body/control/select/ItemsetDefinition.ts +0 -36
  273. package/src/body/control/select/ItemsetNodesetExpression.ts +0 -8
  274. package/src/body/text/HintDefinition.ts +0 -26
  275. package/src/body/text/LabelDefinition.ts +0 -68
  276. package/src/body/text/TextElementDefinition.ts +0 -97
  277. package/src/body/text/TextElementOutputPart.ts +0 -27
  278. package/src/body/text/TextElementPart.ts +0 -31
  279. package/src/body/text/TextElementReferencePart.ts +0 -21
  280. package/src/body/text/TextElementStaticPart.ts +0 -26
  281. package/src/lib/xpath/analysis.ts +0 -241
  282. package/src/model/RepeatRangeDefinition.ts +0 -53
  283. package/src/{XFormDOM.ts → parse/XFormDOM.ts} +0 -0
  284. package/src/{body → parse/body}/UnsupportedBodyElementDefinition.ts +0 -0
  285. package/src/{body → parse/body}/control/InputDefinition.ts +1 -1
  286. /package/src/{body → parse/body}/group/LogicalGroupDefinition.ts +0 -0
  287. /package/src/{body → parse/body}/group/StructuralGroupDefinition.ts +0 -0
  288. /package/src/{expression → parse/expression/abstract}/DependencyContext.ts +0 -0
  289. /package/src/{model → parse/model}/DescendentNodeDefinition.ts +0 -0
  290. /package/src/{model → parse/model}/ModelDefinition.ts +0 -0
  291. /package/src/{model → parse/model}/RepeatTemplateDefinition.ts +0 -0
  292. /package/src/{model → parse/model}/SubtreeDefinition.ts +0 -0
@@ -1,19 +1,19 @@
1
1
  import { Accessor } from 'solid-js';
2
- import { RepeatRangeNode, RepeatRangeNodeAppearances } from '../client/RepeatRangeNode.ts';
3
- import { MaterializedChildren } from '../lib/reactivity/materializeCurrentStateChildren.ts';
4
- import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
5
- import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
6
- import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
7
- import { RepeatRangeDefinition } from '../model/RepeatRangeDefinition.ts';
8
- import { RepeatDefinition, RepeatInstance } from './RepeatInstance.ts';
9
- import { Root } from './Root.ts';
10
- import { DescendantNodeSharedStateSpec, DescendantNode } from './abstract/DescendantNode.ts';
11
- import { GeneralParentNode } from './hierarchy.ts';
12
- import { NodeID } from './identity.ts';
13
- import { EvaluationContext } from './internal-api/EvaluationContext.ts';
14
- import { SubscribableDependency } from './internal-api/SubscribableDependency.ts';
15
- import { TextRange } from './text/TextRange.ts';
16
-
2
+ import { NodeAppearances } from '../../client/NodeAppearances.ts';
3
+ import { BaseRepeatRangeNode } from '../../client/repeat/BaseRepeatRangeNode.ts';
4
+ import { TextRange } from '../../client/TextRange.ts';
5
+ import { AncestorNodeValidationState } from '../../client/validation.ts';
6
+ import { ChildrenState } from '../../lib/reactivity/createChildrenState.ts';
7
+ import { MaterializedChildren } from '../../lib/reactivity/materializeCurrentStateChildren.ts';
8
+ import { CurrentState } from '../../lib/reactivity/node-state/createCurrentState.ts';
9
+ import { EngineState } from '../../lib/reactivity/node-state/createEngineState.ts';
10
+ import { SharedNodeState } from '../../lib/reactivity/node-state/createSharedNodeState.ts';
11
+ import { AnyRepeatRangeDefinition, ControlledRepeatRangeDefinition } from '../../parse/model/RepeatRangeDefinition.ts';
12
+ import { DescendantNodeParent, DescendantNodeSharedStateSpec, DescendantNode } from '../abstract/DescendantNode.ts';
13
+ import { NodeID } from '../identity.ts';
14
+ import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
15
+ import { SubscribableDependency } from '../internal-api/SubscribableDependency.ts';
16
+ import { RepeatInstance, RepeatDefinition } from './RepeatInstance.ts';
17
17
  interface RepeatRangeStateSpec extends DescendantNodeSharedStateSpec {
18
18
  readonly hint: null;
19
19
  readonly label: Accessor<TextRange<'label'> | null>;
@@ -21,7 +21,8 @@ interface RepeatRangeStateSpec extends DescendantNodeSharedStateSpec {
21
21
  readonly valueOptions: null;
22
22
  readonly value: null;
23
23
  }
24
- export declare class RepeatRange extends DescendantNode<RepeatRangeDefinition, RepeatRangeStateSpec, RepeatInstance> implements RepeatRangeNode, EvaluationContext, SubscribableDependency {
24
+ type BaseRepeatRangeNodeType<Definition extends AnyRepeatRangeDefinition> = Definition extends ControlledRepeatRangeDefinition ? 'repeat-range:controlled' : 'repeat-range:uncontrolled';
25
+ export declare abstract class BaseRepeatRange<Definition extends AnyRepeatRangeDefinition> extends DescendantNode<Definition, RepeatRangeStateSpec, RepeatInstance> implements BaseRepeatRangeNode, EvaluationContext, SubscribableDependency {
25
26
  /**
26
27
  * A repeat range doesn't have a corresponding primary instance element of its
27
28
  * own, and its instances are appended to the range's parent element. During
@@ -44,8 +45,27 @@ export declare class RepeatRange extends DescendantNode<RepeatRangeDefinition, R
44
45
  * {@link https://developer.mozilla.org/en-US/docs/Web/API/Range | DOM Range}
45
46
  * instead?
46
47
  */
47
- private readonly anchorNode;
48
- private readonly childrenState;
48
+ protected readonly anchorNode: Comment;
49
+ protected readonly childrenState: ChildrenState<RepeatInstance>;
50
+ /**
51
+ * Provides an {@link EvaluationContext} from which to evaluate expressions
52
+ * where some LocationPath sub-expressions may be **relative to the repeat
53
+ * range itself**. This is useful for evaluation of expressions where:
54
+ *
55
+ * - the expression is typically contextualized to any of its
56
+ * {@link RepeatInstance} children, but it presently has none (i.e.
57
+ * `relevant`)
58
+ *
59
+ * - the expression is conceptually intended to be evaluated in the context of
60
+ * the repeat range itself (i.e. `jr:count`)
61
+ */
62
+ protected readonly selfEvaluationContext: EvaluationContext & {
63
+ readonly contextNode: Comment;
64
+ };
65
+ /**
66
+ * @see {@link isSelfRelevant}
67
+ */
68
+ protected readonly isEmptyRangeSelfRelevant: Accessor<boolean>;
49
69
  protected readonly state: SharedNodeState<RepeatRangeStateSpec>;
50
70
  protected engineState: EngineState<RepeatRangeStateSpec>;
51
71
  /**
@@ -55,11 +75,6 @@ export declare class RepeatRange extends DescendantNode<RepeatRangeDefinition, R
55
75
  * @see {@link isSelfRelevant}
56
76
  */
57
77
  isSelfReadonly: Accessor<boolean>;
58
- private readonly emptyRangeEvaluationContext;
59
- /**
60
- * @see {@link isSelfRelevant}
61
- */
62
- private readonly isEmptyRangeSelfRelevant;
63
78
  /**
64
79
  * A repeat range does not exist in the primary instance tree. A `relevant`
65
80
  * expression applies to each {@link RepeatInstance} child of the repeat
@@ -94,7 +109,7 @@ export declare class RepeatRange extends DescendantNode<RepeatRangeDefinition, R
94
109
  * theory it could vary depending on form structure and runtime state).
95
110
  */
96
111
  readonly isSelfRelevant: Accessor<boolean>;
97
- readonly nodeType = "repeat-range";
112
+ abstract readonly nodeType: BaseRepeatRangeNodeType<Definition>;
98
113
  /**
99
114
  * @todo RepeatRange*, RepeatInstance* (and RepeatTemplate*) all share the
100
115
  * same body element, and thus all share the same definition `bodyElement`. As
@@ -128,31 +143,16 @@ export declare class RepeatRange extends DescendantNode<RepeatRangeDefinition, R
128
143
  * All of the above creates considerable ambiguity about where "repeat
129
144
  * appearances" should apply, under which circumstances.
130
145
  */
131
- readonly appearances: RepeatRangeNodeAppearances;
146
+ abstract readonly appearances: NodeAppearances<Definition>;
132
147
  readonly currentState: MaterializedChildren<CurrentState<RepeatRangeStateSpec>, RepeatInstance>;
133
- constructor(parent: GeneralParentNode, definition: RepeatRangeDefinition);
134
- private getLastIndex;
148
+ abstract readonly validationState: AncestorNodeValidationState;
149
+ constructor(parent: DescendantNodeParent<Definition>, definition: Definition);
150
+ protected getLastIndex(): number;
135
151
  protected initializeContextNode(parentContextNode: Element): Element;
136
152
  getInstanceIndex(instance: RepeatInstance): number;
137
- addInstances(afterIndex?: number, count?: number, definition?: RepeatDefinition): Root;
138
- /**
139
- * Removes the {@link RepeatInstance}s corresponding to the specified range of
140
- * indexes, and then removes those repeat instances from the repeat range's
141
- * own children state in that order:
142
- *
143
- * 1. Identify the set of {@link RepeatInstance}s to be removed.
144
- *
145
- * 2. For each {@link RepeatInstance} pending removal, perform that node's
146
- * removal logic. @see {@link RepeatInstance.remove} for more detail.
147
- *
148
- * 3. Finalize update to the repeat range's own {@link childrenState},
149
- * omitting those {@link RepeatInstance}s which were removed.
150
- *
151
- * This ordering ensures a consistent representation of state is established
152
- * prior to any downstream reactive updates, and ensures that removed nodes'
153
- * reactivity is cleaned up.
154
- */
155
- removeInstances(startIndex: number, count?: number): Root;
153
+ private createChildren;
154
+ protected addChildren(afterIndex: number, definitions: readonly RepeatDefinition[]): readonly RepeatInstance[];
155
+ protected removeChildren(startIndex: number, count: number): readonly RepeatInstance[];
156
156
  subscribe(): void;
157
157
  getChildren(): readonly RepeatInstance[];
158
158
  }
@@ -1,17 +1,16 @@
1
1
  import { Accessor } from 'solid-js';
2
- import { RepeatDefinition, RepeatInstanceNode, RepeatInstanceNodeAppearances } from '../client/RepeatInstanceNode.ts';
3
- import { TextRange } from '../index.ts';
4
- import { MaterializedChildren } from '../lib/reactivity/materializeCurrentStateChildren.ts';
5
- import { CurrentState } from '../lib/reactivity/node-state/createCurrentState.ts';
6
- import { EngineState } from '../lib/reactivity/node-state/createEngineState.ts';
7
- import { SharedNodeState } from '../lib/reactivity/node-state/createSharedNodeState.ts';
8
- import { RepeatRange } from './RepeatRange.ts';
9
- import { DescendantNodeSharedStateSpec, DescendantNode } from './abstract/DescendantNode.ts';
10
- import { AnyChildNode, GeneralChildNode } from './hierarchy.ts';
11
- import { NodeID } from './identity.ts';
12
- import { EvaluationContext } from './internal-api/EvaluationContext.ts';
13
- import { SubscribableDependency } from './internal-api/SubscribableDependency.ts';
14
-
2
+ import { RepeatDefinition, RepeatInstanceNode, RepeatInstanceNodeAppearances } from '../../client/repeat/RepeatInstanceNode.ts';
3
+ import { TextRange } from '../../client/TextRange.ts';
4
+ import { AncestorNodeValidationState } from '../../client/validation.ts';
5
+ import { MaterializedChildren } from '../../lib/reactivity/materializeCurrentStateChildren.ts';
6
+ import { CurrentState } from '../../lib/reactivity/node-state/createCurrentState.ts';
7
+ import { EngineState } from '../../lib/reactivity/node-state/createEngineState.ts';
8
+ import { SharedNodeState } from '../../lib/reactivity/node-state/createSharedNodeState.ts';
9
+ import { DescendantNodeSharedStateSpec, DescendantNode } from '../abstract/DescendantNode.ts';
10
+ import { AnyChildNode, GeneralChildNode, RepeatRange } from '../hierarchy.ts';
11
+ import { NodeID } from '../identity.ts';
12
+ import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
13
+ import { SubscribableDependency } from '../internal-api/SubscribableDependency.ts';
15
14
  export type { RepeatDefinition };
16
15
  interface RepeatInstanceStateSpec extends DescendantNodeSharedStateSpec {
17
16
  readonly label: Accessor<TextRange<'label'> | null>;
@@ -57,6 +56,7 @@ export declare class RepeatInstance extends DescendantNode<RepeatDefinition, Rep
57
56
  */
58
57
  readonly appearances: RepeatInstanceNodeAppearances;
59
58
  readonly currentState: MaterializedChildren<CurrentState<RepeatInstanceStateSpec>, GeneralChildNode>;
59
+ readonly validationState: AncestorNodeValidationState;
60
60
  constructor(parent: RepeatRange, definition: RepeatDefinition, options: RepeatInstanceOptions);
61
61
  protected initializeContextNode(parentContextNode: Element, nodeName: string): Element;
62
62
  subscribe(): void;
@@ -0,0 +1,15 @@
1
+ import { RepeatRangeNodeAppearances } from '../../client/repeat/BaseRepeatRangeNode.ts';
2
+ import { RepeatRangeControlledNode } from '../../client/repeat/RepeatRangeControlledNode.ts';
3
+ import { AncestorNodeValidationState } from '../../client/validation.ts';
4
+ import { ControlledRepeatRangeDefinition } from '../../parse/model/RepeatRangeDefinition.ts';
5
+ import { GeneralParentNode } from '../hierarchy.ts';
6
+ import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
7
+ import { SubscribableDependency } from '../internal-api/SubscribableDependency.ts';
8
+ import { BaseRepeatRange } from './BaseRepeatRange.ts';
9
+ export declare class RepeatRangeControlled extends BaseRepeatRange<ControlledRepeatRangeDefinition> implements RepeatRangeControlledNode, EvaluationContext, SubscribableDependency {
10
+ readonly nodeType = "repeat-range:controlled";
11
+ readonly appearances: RepeatRangeNodeAppearances;
12
+ readonly validationState: AncestorNodeValidationState;
13
+ constructor(parent: GeneralParentNode, definition: ControlledRepeatRangeDefinition);
14
+ private initializeControlledChildrenState;
15
+ }
@@ -0,0 +1,34 @@
1
+ import { RepeatRangeNodeAppearances } from '../../client/repeat/BaseRepeatRangeNode.ts';
2
+ import { RepeatRangeUncontrolledNode } from '../../client/repeat/RepeatRangeUncontrolledNode.ts';
3
+ import { AncestorNodeValidationState } from '../../client/validation.ts';
4
+ import { UncontrolledRepeatRangeDefinition } from '../../parse/model/RepeatRangeDefinition.ts';
5
+ import { GeneralParentNode } from '../hierarchy.ts';
6
+ import { EvaluationContext } from '../internal-api/EvaluationContext.ts';
7
+ import { SubscribableDependency } from '../internal-api/SubscribableDependency.ts';
8
+ import { Root } from '../Root.ts';
9
+ import { BaseRepeatRange } from './BaseRepeatRange.ts';
10
+ export declare class RepeatRangeUncontrolled extends BaseRepeatRange<UncontrolledRepeatRangeDefinition> implements RepeatRangeUncontrolledNode, EvaluationContext, SubscribableDependency {
11
+ readonly nodeType = "repeat-range:uncontrolled";
12
+ readonly appearances: RepeatRangeNodeAppearances;
13
+ readonly validationState: AncestorNodeValidationState;
14
+ constructor(parent: GeneralParentNode, definition: UncontrolledRepeatRangeDefinition);
15
+ addInstances(afterIndex?: number, count?: number): Root;
16
+ /**
17
+ * Removes the {@link RepeatInstance}s corresponding to the specified range of
18
+ * indexes, and then removes those repeat instances from the repeat range's
19
+ * own children state in that order:
20
+ *
21
+ * 1. Identify the set of {@link RepeatInstance}s to be removed.
22
+ *
23
+ * 2. For each {@link RepeatInstance} pending removal, perform that node's
24
+ * removal logic. @see {@link RepeatInstance.remove} for more detail.
25
+ *
26
+ * 3. Finalize update to the repeat range's own {@link childrenState},
27
+ * omitting those {@link RepeatInstance}s which were removed.
28
+ *
29
+ * This ordering ensures a consistent representation of state is established
30
+ * prior to any downstream reactive updates, and ensures that removed nodes'
31
+ * reactivity is cleaned up.
32
+ */
33
+ removeInstances(startIndex: number, count?: number): Root;
34
+ }
@@ -1,6 +1,5 @@
1
1
  import { FetchResource, FetchResourceResponse } from '../client/EngineConfig.ts';
2
2
  import { FormResource } from '../client/index.ts';
3
-
4
3
  export type { FetchResource, FetchResourceResponse, FormResource };
5
4
  export interface ResourceOptions {
6
5
  readonly fetchResource: FetchResource;
@@ -1,7 +1,6 @@
1
1
  import { ActiveLanguage } from '../../client/FormLanguage.ts';
2
2
  import { TextChunk as ClientTextChunk, TextChunkSource } from '../../client/TextRange.ts';
3
3
  import { TranslationContext } from '../internal-api/TranslationContext.ts';
4
-
5
4
  export declare class TextChunk implements ClientTextChunk {
6
5
  readonly context: TranslationContext;
7
6
  readonly source: TextChunkSource;
@@ -1,11 +1,10 @@
1
- import { TextRange as ClientTextRange, TextChunk } from '../../client/TextRange.ts';
2
-
3
- export type TextRole = 'hint' | 'label';
4
- export declare class TextRange<Role extends TextRole> implements ClientTextRange<Role> {
1
+ import { TextRange as ClientTextRange, TextChunk, TextOrigin, TextRole } from '../../client/TextRange.ts';
2
+ export declare class TextRange<Role extends TextRole, Origin extends TextOrigin> implements ClientTextRange<Role, Origin> {
3
+ readonly origin: Origin;
5
4
  readonly role: Role;
6
5
  protected readonly chunks: readonly TextChunk[];
7
6
  [Symbol.iterator](): Generator<TextChunk, void, undefined>;
8
7
  get formatted(): Record<PropertyKey, unknown>;
9
8
  get asString(): string;
10
- constructor(role: Role, chunks: readonly TextChunk[]);
9
+ constructor(origin: Origin, role: Role, chunks: readonly TextChunk[]);
11
10
  }
@@ -0,0 +1,4 @@
1
+ import { UnsupportedControl } from '../abstract/UnsupportedControl.ts';
2
+ export declare class RangeControl extends UnsupportedControl<'range'> {
3
+ readonly nodeType = "range";
4
+ }
@@ -0,0 +1,4 @@
1
+ import { UnsupportedControl } from '../abstract/UnsupportedControl.ts';
2
+ export declare class RankControl extends UnsupportedControl<'rank'> {
3
+ readonly nodeType = "rank";
4
+ }
@@ -0,0 +1,4 @@
1
+ import { UnsupportedControl } from '../abstract/UnsupportedControl.ts';
2
+ export declare class UploadControl extends UnsupportedControl<'upload'> {
3
+ readonly nodeType = "upload";
4
+ }
@@ -1,12 +1,12 @@
1
1
  import { PartiallyKnownString } from '../../../common/types/string/PartiallyKnownString.ts';
2
-
3
2
  type SymbolIterator = typeof Symbol.iterator;
4
3
  type TokenListKey<CanonicalToken extends string> = PartiallyKnownString<CanonicalToken> | SymbolIterator;
5
4
  type TokenListIterator<CanonicalToken extends string> = IterableIterator<PartiallyKnownString<CanonicalToken>>;
5
+ type PassthroughTokenList = Readonly<Record<string, boolean>>;
6
6
  /**
7
7
  * @see {@link TokenListParser}
8
8
  */
9
- export type TokenList<CanonicalToken extends string = string> = {
9
+ export type TokenList<CanonicalToken extends string = string> = PassthroughTokenList & {
10
10
  readonly [Key in TokenListKey<CanonicalToken>]: Key extends SymbolIterator ? () => TokenListIterator<CanonicalToken> : boolean;
11
11
  };
12
12
  interface TokenListAlias<CanonicalToken extends string> {
@@ -77,7 +77,7 @@ type TokenListAttributeName = PartiallyKnownString<'appearance' | 'class'>;
77
77
  export declare class TokenListParser<CanonicalToken extends string, TokenAlias extends CanonicalToken = CanonicalToken> {
78
78
  readonly canonicalTokens: readonly CanonicalToken[];
79
79
  private readonly aliases;
80
- constructor(canonicalTokens: readonly CanonicalToken[], options?: TokenListParserOptions<TokenAlias>);
80
+ constructor(canonicalTokens?: readonly CanonicalToken[], options?: TokenListParserOptions<TokenAlias>);
81
81
  parseFrom(element: Element, attributeName: TokenListAttributeName): TokenList<CanonicalToken>;
82
82
  }
83
83
  export type ParsedTokenList<Parser extends TokenListParser<any>> = Parser extends TokenListParser<infer CanonicalToken> ? TokenList<CanonicalToken> : never;
@@ -1,6 +1,5 @@
1
1
  import { KnownAttributeLocalNamedElement, LocalNamedElement } from '../../../../common/types/dom.ts';
2
- import { SelectElement } from '../../body/control/select/SelectDefinition';
3
-
2
+ import { SelectElement } from '../../parse/body/control/select/SelectDefinition';
4
3
  export interface HintElement extends LocalNamedElement<'hint'> {
5
4
  }
6
5
  export interface ItemElement extends LocalNamedElement<'item'> {
@@ -1,7 +1,6 @@
1
1
  import { Accessor, Setter, Signal } from 'solid-js';
2
2
  import { AnyChildNode, AnyParentNode } from '../../instance/hierarchy.ts';
3
3
  import { NodeID } from '../../instance/identity.ts';
4
-
5
4
  export interface ChildrenState<Child extends AnyChildNode> {
6
5
  readonly children: Signal<readonly Child[]>;
7
6
  readonly getChildren: Accessor<readonly Child[]>;
@@ -1,13 +1,17 @@
1
1
  import { Accessor } from 'solid-js';
2
- import { DependentExpression, DependentExpressionResultType } from '../../expression/DependentExpression.ts';
3
2
  import { EvaluationContext } from '../../instance/internal-api/EvaluationContext.ts';
4
-
3
+ import { SubscribableDependency } from '../../instance/internal-api/SubscribableDependency.ts';
4
+ import { DependentExpression, DependentExpressionResultType } from '../../parse/expression/abstract/DependentExpression.ts';
5
5
  interface ComputedExpressionResults {
6
6
  readonly boolean: boolean;
7
7
  readonly nodes: Node[];
8
+ readonly number: number;
8
9
  readonly string: string;
9
10
  }
10
11
  type EvaluatedExpression<Type extends DependentExpressionResultType> = ComputedExpressionResults[Type];
11
12
  type ComputedExpression<Type extends DependentExpressionResultType> = Accessor<EvaluatedExpression<Type>>;
12
- export declare const createComputedExpression: <Type extends "string" | "boolean" | "nodes">(context: EvaluationContext, dependentExpression: DependentExpression<Type>) => ComputedExpression<Type>;
13
+ interface CreateComputedExpressionOptions {
14
+ readonly arbitraryDependencies?: readonly SubscribableDependency[];
15
+ }
16
+ export declare const createComputedExpression: <Type extends DependentExpressionResultType>(context: EvaluationContext, dependentExpression: DependentExpression<Type>, options?: CreateComputedExpressionOptions) => ComputedExpression<Type>;
13
17
  export {};
@@ -0,0 +1,4 @@
1
+ import { Accessor } from 'solid-js';
2
+ import { EvaluationContext } from '../../instance/internal-api/EvaluationContext.ts';
3
+ import { BindComputationExpression } from '../../parse/expression/BindComputationExpression.ts';
4
+ export declare const createNoteReadonlyThunk: (context: EvaluationContext, readonlyDefinition: BindComputationExpression<"readonly">) => Accessor<true>;
@@ -1,7 +1,6 @@
1
1
  import { Accessor } from 'solid-js';
2
2
  import { SelectItem } from '../../index.ts';
3
3
  import { SelectField } from '../../instance/SelectField.ts';
4
-
5
4
  /**
6
5
  * Creates a reactive computation of a {@link SelectField}'s
7
6
  * {@link SelectItem}s, in support of the field's `valueOptions`.
@@ -1,6 +1,5 @@
1
1
  import { ValueContext } from '../../instance/internal-api/ValueContext.ts';
2
2
  import { SimpleAtomicState } from './types.ts';
3
-
4
3
  type InitialValueSource = 'FORM_DEFAULT' | 'PRIMARY_INSTANCE';
5
4
  export interface ValueStateOptions {
6
5
  /**
@@ -2,7 +2,6 @@ import { AnyChildNode } from '../../instance/hierarchy.ts';
2
2
  import { NodeID } from '../../instance/identity.ts';
3
3
  import { ChildrenState } from './createChildrenState.ts';
4
4
  import { ReactiveScope } from './scope.ts';
5
-
6
5
  export interface EncodedParentState {
7
6
  readonly children: readonly NodeID[];
8
7
  }
@@ -4,7 +4,6 @@ import { ReactiveScope } from '../scope.ts';
4
4
  import { EngineState } from './createEngineState.ts';
5
5
  import { SpecifiedState, StateSpec } from './createSpecifiedState.ts';
6
6
  import { InternalClientRepresentation } from './representations.ts';
7
-
8
7
  export type SpecifiedClientStateFactory<Factory extends OpaqueReactiveObjectFactory, Spec extends StateSpec> = ShallowMutable<SpecifiedState<Spec>> extends Parameters<Factory>[0] ? Factory : never;
9
8
  export type ClientState<Spec extends StateSpec> = InternalClientRepresentation<SpecifiedState<Spec>>;
10
9
  export declare const createClientState: <Factory extends OpaqueReactiveObjectFactory, Spec extends StateSpec>(scope: ReactiveScope, engineState: EngineState<Spec>, clientStateFactory: SpecifiedClientStateFactory<Factory, Spec>) => ClientState<Spec>;
@@ -2,6 +2,5 @@ import { ReactiveScope } from '../scope.ts';
2
2
  import { ClientState } from './createClientState.ts';
3
3
  import { SpecifiedState, StateSpec } from './createSpecifiedState.ts';
4
4
  import { ReadonlyClientRepresentation } from './representations.ts';
5
-
6
5
  export type CurrentState<Spec extends StateSpec> = ReadonlyClientRepresentation<SpecifiedState<Spec>>;
7
6
  export declare const createCurrentState: <Spec extends StateSpec>(scope: ReactiveScope, clientState: ClientState<Spec>) => CurrentState<Spec>;
@@ -1,6 +1,5 @@
1
1
  import { ReactiveScope } from '../scope.ts';
2
2
  import { SpecifiedState, StateSpec } from './createSpecifiedState.ts';
3
3
  import { EngineRepresentation } from './representations.ts';
4
-
5
4
  export type EngineState<Spec extends StateSpec> = EngineRepresentation<SpecifiedState<Spec>>;
6
5
  export declare const createEngineState: <Spec extends StateSpec>(scope: ReactiveScope, spec: Spec) => EngineState<Spec>;
@@ -4,7 +4,6 @@ import { ClientState, SpecifiedClientStateFactory } from './createClientState.ts
4
4
  import { CurrentState } from './createCurrentState.ts';
5
5
  import { EngineState } from './createEngineState.ts';
6
6
  import { MutablePropertySpec, SpecifiedState, StateSpec } from './createSpecifiedState.ts';
7
-
8
7
  type MutableKeyOf<Spec extends StateSpec> = {
9
8
  [K in string & keyof Spec]: Spec[K] extends MutablePropertySpec<any> ? K : never;
10
9
  }[string & keyof Spec];
@@ -16,7 +15,7 @@ export interface SharedNodeState<Spec extends StateSpec> {
16
15
  readonly currentState: CurrentState<Spec>;
17
16
  readonly setProperty: SetEnginePropertyState<Spec>;
18
17
  }
19
- interface SharedNodeStateOptions<Factory extends OpaqueReactiveObjectFactory, Spec extends StateSpec> {
18
+ export interface SharedNodeStateOptions<Factory extends OpaqueReactiveObjectFactory, Spec extends StateSpec> {
20
19
  readonly clientStateFactory: SpecifiedClientStateFactory<Factory, Spec>;
21
20
  }
22
21
  export declare const createSharedNodeState: <Factory extends OpaqueReactiveObjectFactory, Spec extends StateSpec>(scope: ReactiveScope, spec: Spec, options: SharedNodeStateOptions<Factory, Spec>) => SharedNodeState<Spec>;
@@ -1,5 +1,4 @@
1
1
  import { StatePropertySpec } from './createSpecifiedState.ts';
2
-
3
2
  export interface SpecifiedPropertyDescriptor<T = any> extends TypedPropertyDescriptor<T> {
4
3
  readonly configurable: true;
5
4
  readonly enumerable: true;
@@ -1,6 +1,5 @@
1
1
  import { Accessor, Signal } from 'solid-js';
2
2
  import { SimpleAtomicState } from '../types.ts';
3
-
4
3
  /**
5
4
  * Specifies a state object's property as mutable. Basic usage:
6
5
  *
@@ -110,7 +109,7 @@ export type StaticPropertySpec<T> = Exclude<T, NonStaticValue>;
110
109
  export type StatePropertySpec<T = any> = MutablePropertySpec<T> | ComputedPropertySpec<T> | StaticPropertySpec<T>;
111
110
  export declare const isMutablePropertySpec: <T>(propertySpec: StatePropertySpec<T>) => propertySpec is MutablePropertySpec<T>;
112
111
  export declare const isComputedPropertySpec: <T>(propertySpec: StatePropertySpec<T>) => propertySpec is ComputedPropertySpec<T>;
113
- export declare const isStaticPropertySpec: <T>(propertySpec: StatePropertySpec<T>) => propertySpec is Exclude<T, NonStaticValue>;
112
+ export declare const isStaticPropertySpec: <T>(propertySpec: StatePropertySpec<T>) => propertySpec is StaticPropertySpec<T>;
114
113
  export type StateSpec = Record<string, StatePropertySpec>;
115
114
  type SpecifiedStatePropertyValue<PropertySpec extends StatePropertySpec> = PropertySpec extends StatePropertySpec<infer T> ? T : never;
116
115
  type DerivedMutableKeys<Spec extends StateSpec> = {
@@ -1,5 +1,4 @@
1
1
  import { ShallowMutable } from '../../../../../common/types/helpers.js';
2
-
3
2
  declare const ENGINE_REPRESENTATION: unique symbol;
4
3
  type ENGINE_REPRESENTATION = typeof ENGINE_REPRESENTATION;
5
4
  declare const INTERNAL_CLIENT_REPRESENTATION: unique symbol;
@@ -1,5 +1,4 @@
1
1
  import { Owner } from 'solid-js';
2
-
3
2
  type ReactiveScopeTask<T> = (scope: ReactiveScope) => T;
4
3
  type RunReactiveScopeTask = <T>(task: ReactiveScopeTask<T>) => T;
5
4
  export interface ReactiveScope {
@@ -1,6 +1,5 @@
1
1
  import { Accessor } from 'solid-js';
2
+ import { TextRange } from '../../../client/TextRange.ts';
2
3
  import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
3
- import { TextRange } from '../../../instance/text/TextRange.ts';
4
- import { ValueNodeDefinition } from '../../../model/ValueNodeDefinition.ts';
5
-
6
- export declare const createFieldHint: (context: EvaluationContext, definition: ValueNodeDefinition) => Accessor<TextRange<'hint'> | null>;
4
+ import { LeafNodeDefinition } from '../../../parse/model/LeafNodeDefinition.ts';
5
+ export declare const createFieldHint: (context: EvaluationContext, definition: LeafNodeDefinition) => Accessor<TextRange<"hint", "form"> | null>;
@@ -1,6 +1,5 @@
1
1
  import { Accessor } from 'solid-js';
2
+ import { TextRange } from '../../../client/TextRange.ts';
2
3
  import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
3
- import { TextRange } from '../../../instance/text/TextRange.ts';
4
- import { AnyNodeDefinition } from '../../../model/NodeDefinition.ts';
5
-
6
- export declare const createNodeLabel: (context: EvaluationContext, definition: AnyNodeDefinition) => Accessor<TextRange<'label'> | null>;
4
+ import { AnyNodeDefinition } from '../../../parse/model/NodeDefinition.ts';
5
+ export declare const createNodeLabel: (context: EvaluationContext, definition: AnyNodeDefinition) => Accessor<TextRange<"label", "form"> | null>;
@@ -0,0 +1,24 @@
1
+ import { Accessor } from 'solid-js';
2
+ import { TextRange } from '../../../client/TextRange.ts';
3
+ import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
4
+ import { NoteTextDefinition } from '../../../parse/model/NoteNodeDefinition.ts';
5
+ export type NoteTextRole = 'label' | 'hint';
6
+ export type ComputedNoteText<Role extends NoteTextRole = NoteTextRole> = Accessor<TextRange<Role, 'form'>>;
7
+ interface BaseNoteText {
8
+ readonly role: NoteTextRole;
9
+ readonly label: ComputedNoteText<'label'> | null;
10
+ readonly hint: ComputedNoteText<'hint'> | null;
11
+ }
12
+ interface LabelNoteText extends BaseNoteText {
13
+ readonly role: 'label';
14
+ readonly label: ComputedNoteText<'label'>;
15
+ readonly hint: null;
16
+ }
17
+ interface HintNoteText extends BaseNoteText {
18
+ readonly role: 'hint';
19
+ readonly label: null;
20
+ readonly hint: ComputedNoteText<'hint'>;
21
+ }
22
+ export type NoteTextComputation = LabelNoteText | HintNoteText;
23
+ export declare const createNoteText: (context: EvaluationContext, noteTextDefinition: NoteTextDefinition) => NoteTextComputation;
24
+ export {};
@@ -1,12 +1,9 @@
1
1
  import { Accessor } from 'solid-js';
2
- import { TextElementDefinition } from '../../../body/text/TextElementDefinition.ts';
2
+ import { TextRole } from '../../../client/TextRange.ts';
3
3
  import { EvaluationContext } from '../../../instance/internal-api/EvaluationContext.ts';
4
- import { TextRange, TextRole } from '../../../instance/text/TextRange.ts';
5
-
6
- interface CreateTextRangeOptions<FallbackValue extends string | null> {
7
- readonly fallbackValue?: FallbackValue;
8
- }
9
- type ComputedTextRange<Role extends TextRole, Definition extends TextElementDefinition<Role> | null, FallbackValue extends string | null> = Accessor<Definition extends null ? FallbackValue extends null ? TextRange<Role> | null : TextRange<Role> : TextRange<Role>>;
4
+ import { TextRange } from '../../../instance/text/TextRange.ts';
5
+ import { TextRangeDefinition } from '../../../parse/text/abstract/TextRangeDefinition.ts';
6
+ type ComputedFormTextRange<Role extends TextRole> = Accessor<TextRange<Role, 'form'>>;
10
7
  /**
11
8
  * Creates a text range (e.g. label or hint) from the provided definition,
12
9
  * reactive to:
@@ -16,5 +13,5 @@ type ComputedTextRange<Role extends TextRole, Definition extends TextElementDefi
16
13
  *
17
14
  * @todo This does not yet handle itext translations **with** outputs!
18
15
  */
19
- export declare const createTextRange: <Role extends TextRole, Definition extends TextElementDefinition<Role> | null, FallbackValue extends string | null = null>(context: EvaluationContext, role: Role, definition: Definition, options?: CreateTextRangeOptions<FallbackValue>) => ComputedTextRange<Role, Definition, FallbackValue>;
16
+ export declare const createTextRange: <Role extends TextRole>(context: EvaluationContext, role: Role, definition: TextRangeDefinition<Role>) => ComputedFormTextRange<Role>;
20
17
  export {};
@@ -1,5 +1,4 @@
1
1
  import { Accessor, Setter } from 'solid-js';
2
-
3
2
  /**
4
3
  * A write interface to reactive atomic state. This type is intended to be used
5
4
  * as a relaxed version of {@link Setter}, where its callback form isn't
@@ -0,0 +1,8 @@
1
+ import { OpaqueReactiveObjectFactory } from '../../../client/OpaqueReactiveObjectFactory.ts';
2
+ import { AncestorNodeValidationState } from '../../../client/validation.ts';
3
+ import { AnyParentNode } from '../../../instance/hierarchy.ts';
4
+ interface AggregatedViolationsOptions {
5
+ readonly clientStateFactory: OpaqueReactiveObjectFactory<AncestorNodeValidationState>;
6
+ }
7
+ export declare const createAggregatedViolations: (context: AnyParentNode, options: AggregatedViolationsOptions) => AncestorNodeValidationState;
8
+ export {};
@@ -0,0 +1,17 @@
1
+ import { Accessor } from 'solid-js';
2
+ import { OpaqueReactiveObjectFactory } from '../../../client/OpaqueReactiveObjectFactory.ts';
3
+ import { AnyViolation, ConditionValidation, ValidationCondition } from '../../../client/validation.ts';
4
+ import { ValidationContext } from '../../../instance/internal-api/ValidationContext.ts';
5
+ import { SharedNodeState, SharedNodeStateOptions } from '../node-state/createSharedNodeState.ts';
6
+ type ComputedConditionValidation<Condition extends ValidationCondition> = Accessor<ConditionValidation<Condition>>;
7
+ type ComputedViolation = Accessor<AnyViolation | null>;
8
+ interface ValidationStateSpec {
9
+ readonly constraint: ComputedConditionValidation<'constraint'>;
10
+ readonly required: ComputedConditionValidation<'required'>;
11
+ readonly violation: ComputedViolation;
12
+ }
13
+ export type SharedValidationState = SharedNodeState<ValidationStateSpec>;
14
+ interface ValidationStateOptions<Factory extends OpaqueReactiveObjectFactory> extends SharedNodeStateOptions<Factory, ValidationStateSpec> {
15
+ }
16
+ export declare const createValidationState: <Factory extends OpaqueReactiveObjectFactory>(context: ValidationContext, options: ValidationStateOptions<Factory>) => SharedValidationState;
17
+ export {};
@@ -1,5 +1,4 @@
1
1
  import { XFormsXPathEvaluator } from '@getodk/xpath';
2
-
3
2
  interface XFormDOMNormalizationOptions {
4
3
  readonly isNormalized: boolean;
5
4
  }
@@ -19,7 +18,7 @@ export declare class XFormDOM {
19
18
  readonly body: Element;
20
19
  protected constructor(sourceXML: string, options: XFormDOMNormalizationOptions);
21
20
  createInstance(): XFormDOM;
22
- toJSON(): Omit<this, "xformDocument" | "html" | "rootEvaluator" | "primaryInstanceEvaluator" | "head" | "title" | "model" | "primaryInstance" | "primaryInstanceRoot" | "createInstance" | "toJSON"> & {
21
+ toJSON(): Omit<this, "head" | "html" | "title" | "toJSON" | "model" | "primaryInstanceRoot" | "xformDocument" | "rootEvaluator" | "primaryInstanceEvaluator" | "primaryInstance" | "createInstance"> & {
23
22
  xformDocument: string;
24
23
  html: string;
25
24
  head: string;
@@ -1,5 +1,4 @@
1
- import { CollectionValues } from '../../common/types/collections/CollectionValues.ts';
2
-
1
+ import { CollectionValues } from '../../../common/types/collections/CollectionValues.ts';
3
2
  /**
4
3
  * Like JavaRosa. Presumably for explicit types which aren't impelemnted?
5
4
  */
@@ -8,8 +7,7 @@ export type UnsupportedDataType = typeof UNSUPPORTED_DATA_TYPE;
8
7
  /**
9
8
  * Like JavaRosa. Presumably for e.g. groups with explicit binds (`relevant` etc)?
10
9
  */
11
- declare const NULL_DATA_TYPE = "NULL";
12
- export type NullDataType = typeof NULL_DATA_TYPE;
10
+ export type NullDataType = 'NULL';
13
11
  /**
14
12
  * As in ODK XForms Spec.
15
13
  *