@fieldia/core 0.26.1 → 0.27.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 (415) hide show
  1. package/README.md +307 -3
  2. package/package.json +1 -1
  3. package/schema/page.schema.json +227 -23
  4. package/src/index.d.mts +8 -2
  5. package/src/index.d.ts +8 -2
  6. package/src/index.js +22 -1
  7. package/src/index.js.map +1 -1
  8. package/src/index.mjs +9 -2
  9. package/src/index.mjs.map +1 -1
  10. package/src/lib/expression/app-functions.d.mts +47 -0
  11. package/src/lib/expression/app-functions.d.ts +47 -0
  12. package/src/lib/expression/app-functions.js +64 -0
  13. package/src/lib/expression/app-functions.js.map +1 -0
  14. package/src/lib/expression/app-functions.mjs +58 -0
  15. package/src/lib/expression/app-functions.mjs.map +1 -0
  16. package/src/lib/expression/dates.d.mts +21 -0
  17. package/src/lib/expression/dates.d.ts +21 -0
  18. package/src/lib/expression/dates.js +73 -0
  19. package/src/lib/expression/dates.js.map +1 -0
  20. package/src/lib/expression/dates.mjs +67 -0
  21. package/src/lib/expression/dates.mjs.map +1 -0
  22. package/src/lib/expression/evaluator.js +12 -6
  23. package/src/lib/expression/evaluator.js.map +1 -1
  24. package/src/lib/expression/evaluator.mjs +12 -6
  25. package/src/lib/expression/evaluator.mjs.map +1 -1
  26. package/src/lib/expression/expression.d.mts +7 -3
  27. package/src/lib/expression/expression.d.ts +7 -3
  28. package/src/lib/expression/expression.js +8 -2
  29. package/src/lib/expression/expression.js.map +1 -1
  30. package/src/lib/expression/expression.mjs +7 -2
  31. package/src/lib/expression/expression.mjs.map +1 -1
  32. package/src/lib/expression/functions-part.d.mts +7 -0
  33. package/src/lib/expression/functions-part.d.ts +7 -0
  34. package/src/lib/expression/functions-part.js +13 -0
  35. package/src/lib/expression/functions-part.js.map +1 -0
  36. package/src/lib/expression/functions-part.mjs +8 -0
  37. package/src/lib/expression/functions-part.mjs.map +1 -0
  38. package/src/lib/expression/functions.d.mts +60 -3
  39. package/src/lib/expression/functions.d.ts +60 -3
  40. package/src/lib/expression/functions.js +109 -15
  41. package/src/lib/expression/functions.js.map +1 -1
  42. package/src/lib/expression/functions.mjs +103 -16
  43. package/src/lib/expression/functions.mjs.map +1 -1
  44. package/src/lib/expression/kinds.d.mts +31 -0
  45. package/src/lib/expression/kinds.d.ts +31 -0
  46. package/src/lib/expression/kinds.js +159 -0
  47. package/src/lib/expression/kinds.js.map +1 -0
  48. package/src/lib/expression/kinds.mjs +151 -0
  49. package/src/lib/expression/kinds.mjs.map +1 -0
  50. package/src/lib/expression/modifier.d.mts +4 -3
  51. package/src/lib/expression/modifier.d.ts +4 -3
  52. package/src/lib/expression/modifier.js +4 -3
  53. package/src/lib/expression/modifier.js.map +1 -1
  54. package/src/lib/expression/modifier.mjs +4 -3
  55. package/src/lib/expression/modifier.mjs.map +1 -1
  56. package/src/lib/expression/more-functions.d.mts +8 -0
  57. package/src/lib/expression/more-functions.d.ts +8 -0
  58. package/src/lib/expression/more-functions.js +235 -0
  59. package/src/lib/expression/more-functions.js.map +1 -0
  60. package/src/lib/expression/more-functions.mjs +230 -0
  61. package/src/lib/expression/more-functions.mjs.map +1 -0
  62. package/src/lib/expression/parser.d.mts +4 -1
  63. package/src/lib/expression/parser.d.ts +4 -1
  64. package/src/lib/expression/parser.js +6 -3
  65. package/src/lib/expression/parser.js.map +1 -1
  66. package/src/lib/expression/parser.mjs +6 -3
  67. package/src/lib/expression/parser.mjs.map +1 -1
  68. package/src/lib/expression/reads.d.mts +2 -2
  69. package/src/lib/expression/reads.d.ts +2 -2
  70. package/src/lib/expression/reads.js +6 -4
  71. package/src/lib/expression/reads.js.map +1 -1
  72. package/src/lib/expression/reads.mjs +6 -4
  73. package/src/lib/expression/reads.mjs.map +1 -1
  74. package/src/lib/format/actions.d.mts +16 -16
  75. package/src/lib/format/actions.d.ts +16 -16
  76. package/src/lib/format/check-page.d.mts +7 -2
  77. package/src/lib/format/check-page.d.ts +7 -2
  78. package/src/lib/format/check-page.js +10 -4
  79. package/src/lib/format/check-page.js.map +1 -1
  80. package/src/lib/format/check-page.mjs +10 -4
  81. package/src/lib/format/check-page.mjs.map +1 -1
  82. package/src/lib/format/choice-options.d.mts +34 -0
  83. package/src/lib/format/choice-options.d.ts +34 -0
  84. package/src/lib/format/choice-options.js +60 -0
  85. package/src/lib/format/choice-options.js.map +1 -0
  86. package/src/lib/format/choice-options.mjs +51 -0
  87. package/src/lib/format/choice-options.mjs.map +1 -0
  88. package/src/lib/format/endings-checks.d.mts +8 -0
  89. package/src/lib/format/endings-checks.d.ts +8 -0
  90. package/src/lib/format/endings-checks.js +23 -0
  91. package/src/lib/format/endings-checks.js.map +1 -0
  92. package/src/lib/format/endings-checks.mjs +20 -0
  93. package/src/lib/format/endings-checks.mjs.map +1 -0
  94. package/src/lib/format/endings.d.mts +40 -0
  95. package/src/lib/format/endings.d.ts +40 -0
  96. package/src/lib/format/endings.js +15 -0
  97. package/src/lib/format/endings.js.map +1 -0
  98. package/src/lib/format/endings.mjs +12 -0
  99. package/src/lib/format/endings.mjs.map +1 -0
  100. package/src/lib/format/field.d.mts +151 -16
  101. package/src/lib/format/field.d.ts +151 -16
  102. package/src/lib/format/field.js +64 -11
  103. package/src/lib/format/field.js.map +1 -1
  104. package/src/lib/format/field.mjs +63 -10
  105. package/src/lib/format/field.mjs.map +1 -1
  106. package/src/lib/format/head-checks.d.mts +2 -0
  107. package/src/lib/format/head-checks.d.ts +2 -0
  108. package/src/lib/format/head-checks.js +2 -59
  109. package/src/lib/format/head-checks.js.map +1 -1
  110. package/src/lib/format/head-checks.mjs +1 -58
  111. package/src/lib/format/head-checks.mjs.map +1 -1
  112. package/src/lib/format/later-checks.d.mts +17 -0
  113. package/src/lib/format/later-checks.d.ts +17 -0
  114. package/src/lib/format/later-checks.js +20 -0
  115. package/src/lib/format/later-checks.js.map +1 -0
  116. package/src/lib/format/later-checks.mjs +17 -0
  117. package/src/lib/format/later-checks.mjs.map +1 -0
  118. package/src/lib/format/layout.d.mts +241 -188
  119. package/src/lib/format/layout.d.ts +241 -188
  120. package/src/lib/format/layout.js +33 -28
  121. package/src/lib/format/layout.js.map +1 -1
  122. package/src/lib/format/layout.mjs +13 -3
  123. package/src/lib/format/layout.mjs.map +1 -1
  124. package/src/lib/format/layout.types.d.mts +2 -1
  125. package/src/lib/format/layout.types.d.ts +2 -1
  126. package/src/lib/format/limits-checks.d.mts +14 -0
  127. package/src/lib/format/limits-checks.d.ts +14 -0
  128. package/src/lib/format/limits-checks.js +36 -0
  129. package/src/lib/format/limits-checks.js.map +1 -0
  130. package/src/lib/format/limits-checks.mjs +33 -0
  131. package/src/lib/format/limits-checks.mjs.map +1 -0
  132. package/src/lib/format/limits.d.mts +24 -0
  133. package/src/lib/format/limits.d.ts +24 -0
  134. package/src/lib/format/limits.js +35 -0
  135. package/src/lib/format/limits.js.map +1 -0
  136. package/src/lib/format/limits.mjs +32 -0
  137. package/src/lib/format/limits.mjs.map +1 -0
  138. package/src/lib/format/list-checks.d.mts +44 -0
  139. package/src/lib/format/list-checks.d.ts +44 -0
  140. package/src/lib/format/list-checks.js +340 -0
  141. package/src/lib/format/list-checks.js.map +1 -0
  142. package/src/lib/format/list-checks.mjs +336 -0
  143. package/src/lib/format/list-checks.mjs.map +1 -0
  144. package/src/lib/format/map-checks.d.mts +33 -0
  145. package/src/lib/format/map-checks.d.ts +33 -0
  146. package/src/lib/format/map-checks.js +180 -0
  147. package/src/lib/format/map-checks.js.map +1 -0
  148. package/src/lib/format/map-checks.mjs +175 -0
  149. package/src/lib/format/map-checks.mjs.map +1 -0
  150. package/src/lib/format/mapchecks-part.d.mts +5 -0
  151. package/src/lib/format/mapchecks-part.d.ts +5 -0
  152. package/src/lib/format/mapchecks-part.js +11 -0
  153. package/src/lib/format/mapchecks-part.js.map +1 -0
  154. package/src/lib/format/mapchecks-part.mjs +6 -0
  155. package/src/lib/format/mapchecks-part.mjs.map +1 -0
  156. package/src/lib/format/option-checks.d.mts +16 -0
  157. package/src/lib/format/option-checks.d.ts +16 -0
  158. package/src/lib/format/option-checks.js +39 -0
  159. package/src/lib/format/option-checks.js.map +1 -0
  160. package/src/lib/format/option-checks.mjs +36 -0
  161. package/src/lib/format/option-checks.mjs.map +1 -0
  162. package/src/lib/format/options-part.d.mts +6 -0
  163. package/src/lib/format/options-part.d.ts +6 -0
  164. package/src/lib/format/options-part.js +11 -0
  165. package/src/lib/format/options-part.js.map +1 -0
  166. package/src/lib/format/options-part.mjs +7 -0
  167. package/src/lib/format/options-part.mjs.map +1 -0
  168. package/src/lib/format/page.d.mts +147 -71
  169. package/src/lib/format/page.d.ts +147 -71
  170. package/src/lib/format/page.js +5 -0
  171. package/src/lib/format/page.js.map +1 -1
  172. package/src/lib/format/page.mjs +5 -0
  173. package/src/lib/format/page.mjs.map +1 -1
  174. package/src/lib/format/part-checks.d.mts +20 -0
  175. package/src/lib/format/part-checks.d.ts +20 -0
  176. package/src/lib/format/part-checks.js +3 -0
  177. package/src/lib/format/part-checks.js.map +1 -0
  178. package/src/lib/format/part-checks.mjs +2 -0
  179. package/src/lib/format/part-checks.mjs.map +1 -0
  180. package/src/lib/format/references.d.mts +71 -65
  181. package/src/lib/format/references.d.ts +71 -65
  182. package/src/lib/format/references.js +194 -631
  183. package/src/lib/format/references.js.map +1 -1
  184. package/src/lib/format/references.mjs +194 -631
  185. package/src/lib/format/references.mjs.map +1 -1
  186. package/src/lib/format/seats-checks.d.mts +3 -0
  187. package/src/lib/format/seats-checks.d.ts +3 -0
  188. package/src/lib/format/seats-checks.js +13 -0
  189. package/src/lib/format/seats-checks.js.map +1 -0
  190. package/src/lib/format/seats-checks.mjs +10 -0
  191. package/src/lib/format/seats-checks.mjs.map +1 -0
  192. package/src/lib/format/sheet-head-checks.d.mts +4 -0
  193. package/src/lib/format/sheet-head-checks.d.ts +4 -0
  194. package/src/lib/format/sheet-head-checks.js +68 -0
  195. package/src/lib/format/sheet-head-checks.js.map +1 -0
  196. package/src/lib/format/sheet-head-checks.mjs +65 -0
  197. package/src/lib/format/sheet-head-checks.mjs.map +1 -0
  198. package/src/lib/format/signature-checks.d.mts +7 -0
  199. package/src/lib/format/signature-checks.d.ts +7 -0
  200. package/src/lib/format/signature-checks.js +32 -0
  201. package/src/lib/format/signature-checks.js.map +1 -0
  202. package/src/lib/format/signature-checks.mjs +29 -0
  203. package/src/lib/format/signature-checks.mjs.map +1 -0
  204. package/src/lib/format/signature-options.d.mts +24 -0
  205. package/src/lib/format/signature-options.d.ts +24 -0
  206. package/src/lib/format/signature-options.js +30 -0
  207. package/src/lib/format/signature-options.js.map +1 -0
  208. package/src/lib/format/signature-options.mjs +26 -0
  209. package/src/lib/format/signature-options.mjs.map +1 -0
  210. package/src/lib/format/slots-checks.d.mts +4 -0
  211. package/src/lib/format/slots-checks.d.ts +4 -0
  212. package/src/lib/format/slots-checks.js +21 -0
  213. package/src/lib/format/slots-checks.js.map +1 -0
  214. package/src/lib/format/slots-checks.mjs +18 -0
  215. package/src/lib/format/slots-checks.mjs.map +1 -0
  216. package/src/lib/format/statusbar-checks.d.mts +8 -0
  217. package/src/lib/format/statusbar-checks.d.ts +8 -0
  218. package/src/lib/format/statusbar-checks.js +35 -0
  219. package/src/lib/format/statusbar-checks.js.map +1 -0
  220. package/src/lib/format/statusbar-checks.mjs +32 -0
  221. package/src/lib/format/statusbar-checks.mjs.map +1 -0
  222. package/src/lib/format/table-checks.d.mts +21 -0
  223. package/src/lib/format/table-checks.d.ts +21 -0
  224. package/src/lib/format/table-checks.js +86 -0
  225. package/src/lib/format/table-checks.js.map +1 -0
  226. package/src/lib/format/table-checks.mjs +82 -0
  227. package/src/lib/format/table-checks.mjs.map +1 -0
  228. package/src/lib/format/translate.js +2 -2
  229. package/src/lib/format/translate.js.map +1 -1
  230. package/src/lib/format/translate.mjs +2 -2
  231. package/src/lib/format/translate.mjs.map +1 -1
  232. package/src/lib/format/upgrade.d.mts +6 -3
  233. package/src/lib/format/upgrade.d.ts +6 -3
  234. package/src/lib/format/upgrade.js +6 -3
  235. package/src/lib/format/upgrade.js.map +1 -1
  236. package/src/lib/format/upgrade.mjs +6 -3
  237. package/src/lib/format/upgrade.mjs.map +1 -1
  238. package/src/lib/format/validate.d.mts +18 -2
  239. package/src/lib/format/validate.d.ts +18 -2
  240. package/src/lib/format/validate.js +36 -3
  241. package/src/lib/format/validate.js.map +1 -1
  242. package/src/lib/format/validate.mjs +35 -3
  243. package/src/lib/format/validate.mjs.map +1 -1
  244. package/src/lib/format/version.d.mts +2 -2
  245. package/src/lib/format/version.d.ts +2 -2
  246. package/src/lib/format/version.js +2 -2
  247. package/src/lib/format/version.js.map +1 -1
  248. package/src/lib/format/version.mjs +2 -2
  249. package/src/lib/format/version.mjs.map +1 -1
  250. package/src/lib/format/words.d.mts +6 -2
  251. package/src/lib/format/words.d.ts +6 -2
  252. package/src/lib/format/words.js +13 -7
  253. package/src/lib/format/words.js.map +1 -1
  254. package/src/lib/format/words.mjs +13 -7
  255. package/src/lib/format/words.mjs.map +1 -1
  256. package/src/lib/parts.d.mts +45 -0
  257. package/src/lib/parts.d.ts +45 -0
  258. package/src/lib/parts.js +60 -0
  259. package/src/lib/parts.js.map +1 -0
  260. package/src/lib/parts.mjs +53 -0
  261. package/src/lib/parts.mjs.map +1 -0
  262. package/src/lib/record/cells.d.mts +3 -3
  263. package/src/lib/record/cells.d.ts +3 -3
  264. package/src/lib/record/cells.js +16 -15
  265. package/src/lib/record/cells.js.map +1 -1
  266. package/src/lib/record/cells.mjs +16 -15
  267. package/src/lib/record/cells.mjs.map +1 -1
  268. package/src/lib/record/compute.d.mts +16 -5
  269. package/src/lib/record/compute.d.ts +16 -5
  270. package/src/lib/record/compute.js +57 -16
  271. package/src/lib/record/compute.js.map +1 -1
  272. package/src/lib/record/compute.mjs +57 -16
  273. package/src/lib/record/compute.mjs.map +1 -1
  274. package/src/lib/record/data-source.d.mts +140 -3
  275. package/src/lib/record/data-source.d.ts +140 -3
  276. package/src/lib/record/data-source.js.map +1 -1
  277. package/src/lib/record/data-source.mjs.map +1 -1
  278. package/src/lib/record/drafts.d.mts +19 -0
  279. package/src/lib/record/drafts.d.ts +19 -0
  280. package/src/lib/record/drafts.js +35 -0
  281. package/src/lib/record/drafts.js.map +1 -0
  282. package/src/lib/record/drafts.mjs +31 -0
  283. package/src/lib/record/drafts.mjs.map +1 -0
  284. package/src/lib/record/env.d.mts +5 -1
  285. package/src/lib/record/env.d.ts +5 -1
  286. package/src/lib/record/env.js +9 -1
  287. package/src/lib/record/env.js.map +1 -1
  288. package/src/lib/record/env.mjs +8 -1
  289. package/src/lib/record/env.mjs.map +1 -1
  290. package/src/lib/record/form-limits.d.mts +81 -0
  291. package/src/lib/record/form-limits.d.ts +81 -0
  292. package/src/lib/record/form-limits.js +231 -0
  293. package/src/lib/record/form-limits.js.map +1 -0
  294. package/src/lib/record/form-limits.mjs +224 -0
  295. package/src/lib/record/form-limits.mjs.map +1 -0
  296. package/src/lib/record/form.d.mts +173 -4
  297. package/src/lib/record/form.d.ts +173 -4
  298. package/src/lib/record/form.js +792 -88
  299. package/src/lib/record/form.js.map +1 -1
  300. package/src/lib/record/form.mjs +792 -88
  301. package/src/lib/record/form.mjs.map +1 -1
  302. package/src/lib/record/limits-part.d.mts +6 -0
  303. package/src/lib/record/limits-part.d.ts +6 -0
  304. package/src/lib/record/limits-part.js +12 -0
  305. package/src/lib/record/limits-part.js.map +1 -0
  306. package/src/lib/record/limits-part.mjs +7 -0
  307. package/src/lib/record/limits-part.mjs.map +1 -0
  308. package/src/lib/record/line-choices.d.mts +30 -0
  309. package/src/lib/record/line-choices.d.ts +30 -0
  310. package/src/lib/record/line-choices.js +42 -0
  311. package/src/lib/record/line-choices.js.map +1 -0
  312. package/src/lib/record/line-choices.mjs +36 -0
  313. package/src/lib/record/line-choices.mjs.map +1 -0
  314. package/src/lib/record/locales/ar.js +10 -0
  315. package/src/lib/record/locales/ar.js.map +1 -1
  316. package/src/lib/record/locales/ar.mjs +10 -0
  317. package/src/lib/record/locales/ar.mjs.map +1 -1
  318. package/src/lib/record/locales/de.js +10 -0
  319. package/src/lib/record/locales/de.js.map +1 -1
  320. package/src/lib/record/locales/de.mjs +10 -0
  321. package/src/lib/record/locales/de.mjs.map +1 -1
  322. package/src/lib/record/locales/fr.js +10 -0
  323. package/src/lib/record/locales/fr.js.map +1 -1
  324. package/src/lib/record/locales/fr.mjs +10 -0
  325. package/src/lib/record/locales/fr.mjs.map +1 -1
  326. package/src/lib/record/memory-data-source.d.mts +44 -3
  327. package/src/lib/record/memory-data-source.d.ts +44 -3
  328. package/src/lib/record/memory-data-source.js +102 -40
  329. package/src/lib/record/memory-data-source.js.map +1 -1
  330. package/src/lib/record/memory-data-source.mjs +101 -40
  331. package/src/lib/record/memory-data-source.mjs.map +1 -1
  332. package/src/lib/record/memory-kept.d.mts +20 -0
  333. package/src/lib/record/memory-kept.d.ts +20 -0
  334. package/src/lib/record/memory-kept.js +46 -0
  335. package/src/lib/record/memory-kept.js.map +1 -0
  336. package/src/lib/record/memory-kept.mjs +43 -0
  337. package/src/lib/record/memory-kept.mjs.map +1 -0
  338. package/src/lib/record/memory-later.d.mts +19 -0
  339. package/src/lib/record/memory-later.d.ts +19 -0
  340. package/src/lib/record/memory-later.js +39 -0
  341. package/src/lib/record/memory-later.js.map +1 -0
  342. package/src/lib/record/memory-later.mjs +35 -0
  343. package/src/lib/record/memory-later.mjs.map +1 -0
  344. package/src/lib/record/memory-part.d.mts +7 -0
  345. package/src/lib/record/memory-part.d.ts +7 -0
  346. package/src/lib/record/memory-part.js +13 -0
  347. package/src/lib/record/memory-part.js.map +1 -0
  348. package/src/lib/record/memory-part.mjs +8 -0
  349. package/src/lib/record/memory-part.mjs.map +1 -0
  350. package/src/lib/record/messages.d.mts +17 -0
  351. package/src/lib/record/messages.d.ts +17 -0
  352. package/src/lib/record/messages.js +10 -0
  353. package/src/lib/record/messages.js.map +1 -1
  354. package/src/lib/record/messages.mjs +10 -0
  355. package/src/lib/record/messages.mjs.map +1 -1
  356. package/src/lib/record/option-rules.d.mts +50 -0
  357. package/src/lib/record/option-rules.d.ts +50 -0
  358. package/src/lib/record/option-rules.js +137 -0
  359. package/src/lib/record/option-rules.js.map +1 -0
  360. package/src/lib/record/option-rules.mjs +134 -0
  361. package/src/lib/record/option-rules.mjs.map +1 -0
  362. package/src/lib/record/rules.d.mts +2 -2
  363. package/src/lib/record/rules.d.ts +2 -2
  364. package/src/lib/record/rules.js +3 -3
  365. package/src/lib/record/rules.js.map +1 -1
  366. package/src/lib/record/rules.mjs +3 -3
  367. package/src/lib/record/rules.mjs.map +1 -1
  368. package/src/lib/record/run.js +9 -7
  369. package/src/lib/record/run.js.map +1 -1
  370. package/src/lib/record/run.mjs +9 -7
  371. package/src/lib/record/run.mjs.map +1 -1
  372. package/src/lib/record/search.d.mts +12 -2
  373. package/src/lib/record/search.d.ts +12 -2
  374. package/src/lib/record/search.js +29 -4
  375. package/src/lib/record/search.js.map +1 -1
  376. package/src/lib/record/search.mjs +29 -4
  377. package/src/lib/record/search.mjs.map +1 -1
  378. package/src/lib/record/set-when.d.mts +3 -3
  379. package/src/lib/record/set-when.d.ts +3 -3
  380. package/src/lib/record/set-when.js +9 -9
  381. package/src/lib/record/set-when.js.map +1 -1
  382. package/src/lib/record/set-when.mjs +9 -9
  383. package/src/lib/record/set-when.mjs.map +1 -1
  384. package/src/lib/record/signed.d.mts +21 -0
  385. package/src/lib/record/signed.d.ts +21 -0
  386. package/src/lib/record/signed.js +62 -0
  387. package/src/lib/record/signed.js.map +1 -0
  388. package/src/lib/record/signed.mjs +57 -0
  389. package/src/lib/record/signed.mjs.map +1 -0
  390. package/src/lib/record/taking.d.mts +60 -0
  391. package/src/lib/record/taking.d.ts +60 -0
  392. package/src/lib/record/taking.js +58 -0
  393. package/src/lib/record/taking.js.map +1 -0
  394. package/src/lib/record/taking.mjs +50 -0
  395. package/src/lib/record/taking.mjs.map +1 -0
  396. package/src/lib/record/value-map.js +11 -4
  397. package/src/lib/record/value-map.js.map +1 -1
  398. package/src/lib/record/value-map.mjs +11 -4
  399. package/src/lib/record/value-map.mjs.map +1 -1
  400. package/src/lib/record/values.d.mts +20 -0
  401. package/src/lib/record/values.d.ts +20 -0
  402. package/src/lib/record/values.js.map +1 -1
  403. package/src/lib/record/values.mjs.map +1 -1
  404. package/src/lib/record/waits.d.mts +6 -1
  405. package/src/lib/record/waits.d.ts +6 -1
  406. package/src/lib/record/waits.js +2 -2
  407. package/src/lib/record/waits.js.map +1 -1
  408. package/src/lib/record/waits.mjs +2 -2
  409. package/src/lib/record/waits.mjs.map +1 -1
  410. package/src/runtime.d.mts +16 -5
  411. package/src/runtime.d.ts +16 -5
  412. package/src/runtime.js +41 -3
  413. package/src/runtime.js.map +1 -1
  414. package/src/runtime.mjs +13 -0
  415. package/src/runtime.mjs.map +1 -1
@@ -1,10 +1,15 @@
1
1
  import type { ActionStep } from '../format/actions';
2
2
  import type { Field, LineField, Option, PropertyDefinition } from '../format/field';
3
3
  import type { Page } from '../format/page';
4
+ import type { PageEnding } from '../format/endings';
4
5
  import type { JsonValue } from '../format/json';
6
+ import { type FunctionTable } from '../expression/functions';
7
+ import { type AppFunctions } from '../expression/app-functions';
8
+ import { type AskedFor } from './compute';
5
9
  import { type FieldTone, type LineState } from './cells';
6
10
  import { type Messages } from './messages';
7
- import { type DataSource, type RecordChanges, type RecordPermissions, type RecordVersion, type ResolvedFilter, type SaveProblem, type BotReport, type SlotsResult, type UploadFile, type DuplicateMatch, type MergeResult } from './data-source';
11
+ import { type DataSource, type RecordChanges, type RecordPermissions, type RecordVersion, type ResolvedFilter, type SaveProblem, type BotReport, type SlotsResult, type UploadFile, type DuplicateMatch, type MergeResult, type SavedDraft } from './data-source';
12
+ import { type FormLimits } from './taking';
8
13
  import { type WaitsFor } from './waits';
9
14
  import { type FileUpload, type UploadHow } from './uploads';
10
15
  import { type Scheduler } from './scheduler';
@@ -40,7 +45,10 @@ export interface FormState {
40
45
  readonly skipped: readonly string[];
41
46
  /** Why the last save was refused, until the next one starts or the form is reset. */
42
47
  readonly saveProblem: SaveProblem | null;
43
- /** The choices loaded from the app's lists, by field: those of a selection with `optionsFrom`, once asked for. */
48
+ /**
49
+ * The choices loaded from the app's lists: those of a selection with `optionsFrom`, once asked for — by field, and a
50
+ * table line's by its cell's path (`field.lineKey.subfield`).
51
+ */
44
52
  readonly choices: Readonly<Record<string, Choices>>;
45
53
  /** The definitions loaded for a properties field with `definitionsFrom`, by field, once asked for. */
46
54
  readonly definitions: Readonly<Record<string, Definitions>>;
@@ -81,6 +89,47 @@ export interface FormState {
81
89
  * value it held as the box was entered; validate and save refuse with the words until the text is fixed.
82
90
  */
83
91
  readonly unread: Readonly<Record<string, UnreadText>>;
92
+ /**
93
+ * A page of responses sent: the answers as they went, with what the app's source answered — the id it gave the
94
+ * response and the values it added (`SubmitResult`). What its ending reads (`form.ending()`, `{id}`). Null until a
95
+ * send, and again once the form starts a new response (`reset`).
96
+ */
97
+ readonly sent?: SentResponse | null;
98
+ /**
99
+ * Values worked out from an app's function that asks its server (`functions`) with no answer yet, by path (a
100
+ * line's `field.lineKey.subfield`): waiting for it (`{}`) — the value empty meanwhile, a save waiting for it — or
101
+ * why it did not come (`failed`), which a save asks again and, failing, is stopped by under its field.
102
+ */
103
+ readonly asked: Readonly<Record<string, AskedFor>>;
104
+ /**
105
+ * Words said under a choice whose chosen options a change of other answers no longer offers — hidden by their
106
+ * condition, no longer picked where they are carried from, or no longer in the app's list as a field it changes with
107
+ * changed — by path (a field, or a table line's `field.lineKey.subfield`): they were taken out of its answer. Until
108
+ * that value is written again, its line goes, or another record is shown.
109
+ */
110
+ readonly takenOut: Readonly<Record<string, string>>;
111
+ /**
112
+ * When the page takes answers and each choice's places, as its `limits`, its options' `seats`, the form's clock and
113
+ * the data source's `limits` tell: whether it takes them now (`state`), when it opens and closes, the responses it
114
+ * takes still, and each choice's places left. Null on a page with neither.
115
+ */
116
+ readonly limits?: FormLimits | null;
117
+ /**
118
+ * The draft kept on the app's server (`saveDraft`) that these answers continue: its `key`, once the source gave one
119
+ * (the viewer's `resume`, or the first draft kept); `missing` when the key the form was given named no draft — it
120
+ * starts empty. Null while none is.
121
+ */
122
+ readonly resume?: {
123
+ readonly key: string;
124
+ readonly missing?: boolean;
125
+ } | null;
126
+ }
127
+ /** A response sent, as `FormState.sent` keeps it. */
128
+ export interface SentResponse {
129
+ /** The id the app's source gave the response ("B-1043"), or null where it gave none. */
130
+ readonly id: RecordId | null;
131
+ /** The answers as they were sent, with the values the source added (`SubmitResult.values`) laid over them. */
132
+ readonly values: Readonly<Values>;
84
133
  }
85
134
  /** How a search for a link's records is asked (`form.search`, `form.searchLine`). */
86
135
  export interface SearchOptions {
@@ -235,6 +284,16 @@ export interface FormEvents {
235
284
  recordId: RecordId | null;
236
285
  message: PostedMessage;
237
286
  };
287
+ /**
288
+ * A draft was kept on the app's server (`saveDraft`): its key — what a link to continue from carries — and whether the
289
+ * person pressed "Continue later" (`later`), with the source's answer.
290
+ */
291
+ draft: {
292
+ key: string;
293
+ savedAt: string;
294
+ later: boolean;
295
+ saved: SavedDraft;
296
+ };
238
297
  }
239
298
  export interface FormOptions {
240
299
  page: Page;
@@ -254,11 +313,24 @@ export interface FormOptions {
254
313
  host?: ActionHost;
255
314
  /** How a question is asked when there is no host. Without either, a question goes on as though answered Yes. */
256
315
  confirm?: (message: string) => boolean | Promise<boolean>;
316
+ /**
317
+ * Keep what is typed as a draft, offered again the next time the page opens: in `store` (the browser's localStorage
318
+ * fits) — or, on a page with `continueLater` whose data source has `saveDraft` and `loadDraft`, on the app's server,
319
+ * the store keeping only its key (such a page keeps its drafts there without this too). A draft keeps the wizard's
320
+ * step and text typed that does not read yet. `restore`: `ask` (the default) offers it, `auto` lays it at once.
321
+ */
257
322
  drafts?: {
258
323
  store: DraftStore;
259
324
  restore?: 'auto' | 'ask';
260
325
  delayMs?: number;
261
326
  };
327
+ /**
328
+ * The key of a draft kept on the app's server (`saveDraft`) to continue from — what the link the app made after
329
+ * "Continue later" carries: loaded through the source's `loadDraft` as the form opens, its answers, its wizard step
330
+ * and its text typed that does not read laid as they were. A key that names none starts the form empty
331
+ * (`resume.missing`). Without the source's `loadDraft`, it is let be.
332
+ */
333
+ resume?: string;
262
334
  autosave?: {
263
335
  delayMs: number;
264
336
  };
@@ -294,6 +366,21 @@ export interface FormOptions {
294
366
  fields: Readonly<Record<string, Field | LineField>>;
295
367
  id?: RecordId | null;
296
368
  };
369
+ /**
370
+ * How a field's value reads inside the page's own words — a `{field}` in a label, a help, a choice, a step's title, a
371
+ * button, an ending — and so inside the form's messages that name a label ("How was your visit to Zamalek? is
372
+ * required"). The viewer gives its own, as each field shows its value at rest: a choice by its label, money with its
373
+ * currency, a day in the page's order. Left out, a choice by its label, a link by its name, a yes or no as Yes or No,
374
+ * anything else as it is held.
375
+ */
376
+ valueWords?: (field: Field, value: Value | undefined, values: Readonly<Values>) => string;
377
+ /**
378
+ * The app's own functions, which the page's expressions call by name besides Fieldia's: `vatRate(country)`. Each a
379
+ * plain function, or `{ call, takes, values, gives, tip }`. One that asks the app's server gives a promise: a value
380
+ * worked out from it waits while it is asked — once for the same values, for the record shown — and a save waits
381
+ * for it; a condition reading it does not hold meanwhile. A name a page cannot call is refused as the form is made.
382
+ */
383
+ functions?: AppFunctions;
297
384
  }
298
385
  /** The person using a form, as the app knows them. */
299
386
  export interface FormUser {
@@ -304,6 +391,16 @@ export interface FormUser {
304
391
  }
305
392
  export interface Form {
306
393
  readonly page: Page;
394
+ /** The app's own functions as the page's expressions call them (`FormOptions.functions`): for what reads its conditions apart. */
395
+ readonly functions?: FunctionTable;
396
+ /**
397
+ * A table line's cell's form (@fieldia/widgets' `lineForm`): the table and the line it is the form of, whose values,
398
+ * choices and words taken out of them are the line's own. Left out of a record's own form.
399
+ */
400
+ readonly line?: {
401
+ readonly field: string;
402
+ readonly key: string;
403
+ };
307
404
  getState(): FormState;
308
405
  subscribe(listener: (state: FormState) => void): () => void;
309
406
  load(): Promise<void>;
@@ -324,7 +421,10 @@ export interface Form {
324
421
  node(id: string): NodeState;
325
422
  /** Whether the record is being edited, as conditions read `editing`: a view that locks it to be read says false, and parts follow. */
326
423
  setEditing(editing: boolean): void;
327
- /** Whether a field is read-only whatever the conditions say: by its definition, or for this person by what the record's source said (`can`). */
424
+ /**
425
+ * Whether a field is read-only whatever the conditions say: by its definition, for this person by what the record's
426
+ * source said (`can`), or signed by a signature kept (`FileValue.signed`).
427
+ */
328
428
  fieldReadonly(name: string): boolean;
329
429
  /** What a field would be told if the form were checked now, or null when it passes. Nothing is shown. */
330
430
  problem(field: string): string | null;
@@ -381,6 +481,20 @@ export interface Form {
381
481
  validate(): boolean;
382
482
  save(): Promise<boolean>;
383
483
  reset(): void;
484
+ /**
485
+ * Words of the page's with each `{field}` showing the value the form holds now, as `valueWords` writes it — a label's,
486
+ * a help's, a step's title, a button's: "How was your visit to {branch}?" reads "How was your visit to Zamalek?". A
487
+ * name that is no field of the page shows nothing.
488
+ */
489
+ words(text: string): string;
490
+ /**
491
+ * The ending a page of responses shows now its answers are sent (`FormState.sent`): the first of the page's
492
+ * `endings` whose `when` holds on the answers as sent, with what the source added and the response's `id`, else the
493
+ * first with no `when`; null before a send, on a page with none, or where none holds.
494
+ */
495
+ ending(): PageEnding | null;
496
+ /** An ending's words, its `{field}`s and `{id}` filled in from the response sent (`FormState.sent`), as `words` writes them. */
497
+ endingWords(text: string): string;
384
498
  changes(): RecordChanges;
385
499
  addLine(field: string, values?: Values): string;
386
500
  updateLine(field: string, key: string, name: string, value: Value): void;
@@ -448,9 +562,32 @@ export interface Form {
448
562
  /**
449
563
  * Load, or load again, the choices of a selection whose options come from
450
564
  * the app's list (`optionsFrom`). Once loaded, they load again by themselves
451
- * when a field they change with changes; the latest answer wins.
565
+ * when a field they change with changes; the latest answer wins, and a
566
+ * choice it no longer offers after the person, a step or the app changed
567
+ * that field is taken out and said (`FormState.takenOut`). A value a record
568
+ * comes in with is kept, and its save says why. A table line's, by its
569
+ * cell's path (`field.lineKey.subfield`), are asked by the line's values and
570
+ * shared with every line where the columns they change with hold the same,
571
+ * for the record shown; once loaded, they follow those columns on that line.
452
572
  */
453
573
  loadChoices(field: string): void;
574
+ /**
575
+ * A table line's choices from the app's list, as they are asked for that line, with `values` laid over it — a row
576
+ * pasted on it, its connection read first. `key` null: a line not added yet, by the values one added now starts with.
577
+ */
578
+ lineChoices(field: string, key: string | null, subfield: string, values?: Values): Promise<Option[]>;
579
+ /**
580
+ * The options a choice offers now: its own — or those its list gave (`optionsFrom.list`), or those picked in the
581
+ * question they are carried from (`optionsFrom.field`), its own after them — less those whose condition hides them
582
+ * (`options[].invisible`). A table line's by its cell's path (`field.lineKey.subfield`), its conditions read on that
583
+ * line. Null for a field that is no choice.
584
+ */
585
+ offered(field: string): readonly Option[] | null;
586
+ /**
587
+ * Whether a choice's options change with the record's answers: a condition on one, or carried from another question.
588
+ * A table line's by its cell's path: a condition on one of its column's options.
589
+ */
590
+ offersChange(field: string): boolean;
454
591
  /**
455
592
  * Load, or load again, the definitions of a properties field whose
456
593
  * definitions come from a linked record (`definitionsFrom`). Once loaded,
@@ -543,6 +680,19 @@ export interface Form {
543
680
  on<E extends keyof FormEvents>(event: E, listener: (event: FormEvents[E]) => void): () => void;
544
681
  restoreDraft(): void;
545
682
  discardDraft(): void;
683
+ /** Whether the page offers "Continue later": it says `continueLater`, and its data source has `saveDraft`. */
684
+ canContinueLater(): boolean;
685
+ /**
686
+ * "Continue later": what is typed read first (`settle`), then the answers so far — their wizard step, text that does
687
+ * not read kept as typed — kept on the app's server through `saveDraft` (`later: true`): its answer, the key, and the
688
+ * link the app made to continue from and its words. Rejects where the source refused, or has no `saveDraft`.
689
+ */
690
+ continueLater(): Promise<SavedDraft>;
691
+ /**
692
+ * Ask the data source's `limits` again — how many responses the page took, this person's, each choice's takers — and
693
+ * show what it tells (`limits`). The form asks it itself as it opens, before its answers go, and after they went.
694
+ */
695
+ refreshLimits(): Promise<void>;
546
696
  /**
547
697
  * Whether a file picked for a file or picture field is stored at once,
548
698
  * through the data source's `upload`. False without one: a file then
@@ -551,6 +701,16 @@ export interface Form {
551
701
  canUpload(): boolean;
552
702
  /** Today, as 2026-10-15, on the clock of the page's time zone — the browser's own where it names none — by the form's clock (`now`). */
553
703
  today(): string;
704
+ /** Now, by the form's clock (`now`): the computer's own where the app gave none. A signature's when. */
705
+ now(): Date;
706
+ /** The person using the form, as the app named them (`user`); null where it named none. */
707
+ user(): FormUser | null;
708
+ /**
709
+ * The answers shown now, by field, in the page's order: a field placed on the page — or a saved form's answers, by its
710
+ * name — not hidden by its condition, its roles or the record's source, nor in a step passed over with Skip. What a
711
+ * signature that signs every answer signs.
712
+ */
713
+ shownFields(): string[];
554
714
  /**
555
715
  * A record of the page's model as conditions read it, the form's own way: its values (a link as its id), its `id`,
556
716
  * the person using the form (`user`), the app's `context`, and `editing` false — for what reads conditions on records
@@ -581,6 +741,15 @@ export interface Form {
581
741
  * record shown as it was asked (`recordShown`).
582
742
  */
583
743
  findDuplicates(): Promise<DuplicateMatch[]>;
744
+ /** Whether the source keeps "It's someone new" itself, on the app's server: it has `notDuplicates` and `markNotDuplicate`, both. */
745
+ keepsNotDuplicates(): boolean;
746
+ /**
747
+ * The records said to be someone else for the record shown, asked of the source's `notDuplicates`: none while it is
748
+ * new. Rejects where the source has no `notDuplicates`. Its answer is for the record shown as it was asked.
749
+ */
750
+ notDuplicates(): Promise<RecordId[]>;
751
+ /** Keep that `matchId` is someone else for the record shown, through the source's `markNotDuplicate`: refused while it is new. */
752
+ markNotDuplicate(matchId: RecordId): Promise<void>;
584
753
  /** Whether records of the page's model can be merged: its source has `merge`, and `load` to read the others. */
585
754
  canMerge(): boolean;
586
755
  /** Another record of the page's model, as its source loads it, its values alone: the form is left as it is. For a merge's screen. */