@canonical/dataviews-core 0.47.0 → 0.49.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 (597) hide show
  1. package/README.md +27 -19
  2. package/dist/esm/lib/assertion/assertInvariant.js +14 -0
  3. package/dist/esm/lib/assertion/assertInvariant.js.map +1 -0
  4. package/dist/esm/lib/assertion/index.js +2 -0
  5. package/dist/esm/lib/assertion/index.js.map +1 -0
  6. package/dist/esm/lib/bindings/index.js +6 -20
  7. package/dist/esm/lib/bindings/index.js.map +1 -1
  8. package/dist/esm/lib/coordinator/createQueryCoordinator.js +65 -6
  9. package/dist/esm/lib/coordinator/createQueryCoordinator.js.map +1 -1
  10. package/dist/esm/lib/coordinator/index.js +2 -0
  11. package/dist/esm/lib/coordinator/index.js.map +1 -1
  12. package/dist/esm/lib/coordinator/isClauseReplaced.js +27 -0
  13. package/dist/esm/lib/coordinator/isClauseReplaced.js.map +1 -0
  14. package/dist/esm/lib/coordinator/readWithheld.js +13 -0
  15. package/dist/esm/lib/coordinator/readWithheld.js.map +1 -0
  16. package/dist/esm/lib/display/constants.js +2 -1
  17. package/dist/esm/lib/display/constants.js.map +1 -1
  18. package/dist/esm/lib/display/resolveDisplayStatus.js +24 -4
  19. package/dist/esm/lib/display/resolveDisplayStatus.js.map +1 -1
  20. package/dist/esm/lib/filter/createFilterInput.js +50 -16
  21. package/dist/esm/lib/filter/createFilterInput.js.map +1 -1
  22. package/dist/esm/lib/filter/createFilterInputs.js +116 -29
  23. package/dist/esm/lib/filter/createFilterInputs.js.map +1 -1
  24. package/dist/esm/lib/geometry/buildColumnTemplate.js +2 -2
  25. package/dist/esm/lib/geometry/buildColumnTemplate.js.map +1 -1
  26. package/dist/esm/lib/geometry/createColumnLayout.js +7 -10
  27. package/dist/esm/lib/geometry/createColumnLayout.js.map +1 -1
  28. package/dist/esm/lib/geometry/createGridInteraction.js +8 -5
  29. package/dist/esm/lib/geometry/createGridInteraction.js.map +1 -1
  30. package/dist/esm/lib/geometry/resolveColumns.js +5 -5
  31. package/dist/esm/lib/geometry/resolveColumns.js.map +1 -1
  32. package/dist/esm/lib/index.js +1 -1
  33. package/dist/esm/lib/index.js.map +1 -1
  34. package/dist/esm/lib/indexeddb/createIndexedDBViewStore.js +2 -2
  35. package/dist/esm/lib/indexeddb/createIndexedDBViewStore.js.map +1 -1
  36. package/dist/esm/lib/indexeddb/readSavedView.js +6 -2
  37. package/dist/esm/lib/indexeddb/readSavedView.js.map +1 -1
  38. package/dist/esm/lib/location/createMemoryLocation.js +2 -0
  39. package/dist/esm/lib/location/createMemoryLocation.js.map +1 -1
  40. package/dist/esm/lib/location/createPlatformLocation.js +3 -0
  41. package/dist/esm/lib/location/createPlatformLocation.js.map +1 -1
  42. package/dist/esm/lib/messages/composeStatus.js +10 -0
  43. package/dist/esm/lib/messages/composeStatus.js.map +1 -0
  44. package/dist/esm/lib/messages/constants.js +323 -0
  45. package/dist/esm/lib/messages/constants.js.map +1 -1
  46. package/dist/esm/lib/messages/resolveMessages.js +1 -1
  47. package/dist/esm/lib/messages/resolveMessages.js.map +1 -1
  48. package/dist/esm/lib/observable/createChannel.js +4 -2
  49. package/dist/esm/lib/observable/createChannel.js.map +1 -1
  50. package/dist/esm/lib/presentation/constants.js +5 -12
  51. package/dist/esm/lib/presentation/constants.js.map +1 -1
  52. package/dist/esm/lib/presentation/createMemoryPresentation.js +12 -0
  53. package/dist/esm/lib/presentation/createMemoryPresentation.js.map +1 -0
  54. package/dist/esm/lib/presentation/createPresentation.js +3 -3
  55. package/dist/esm/lib/presentation/createPresentation.js.map +1 -1
  56. package/dist/esm/lib/presentation/hideColumn.js +7 -6
  57. package/dist/esm/lib/presentation/hideColumn.js.map +1 -1
  58. package/dist/esm/lib/presentation/index.js +4 -1
  59. package/dist/esm/lib/presentation/index.js.map +1 -1
  60. package/dist/esm/lib/presentation/isTableKey.js +9 -0
  61. package/dist/esm/lib/presentation/isTableKey.js.map +1 -0
  62. package/dist/esm/lib/presentation/moveColumn.js +7 -7
  63. package/dist/esm/lib/presentation/moveColumn.js.map +1 -1
  64. package/dist/esm/lib/presentation/pickTableKeys.js +6 -0
  65. package/dist/esm/lib/presentation/pickTableKeys.js.map +1 -0
  66. package/dist/esm/lib/presentation/resetColumnArrangement.js +8 -12
  67. package/dist/esm/lib/presentation/resetColumnArrangement.js.map +1 -1
  68. package/dist/esm/lib/presentation/resolveArrangementParams.js +7 -12
  69. package/dist/esm/lib/presentation/resolveArrangementParams.js.map +1 -1
  70. package/dist/esm/lib/presentation/resolveColumnArrangement.js +9 -8
  71. package/dist/esm/lib/presentation/resolveColumnArrangement.js.map +1 -1
  72. package/dist/esm/lib/presentation/showColumn.js +5 -4
  73. package/dist/esm/lib/presentation/showColumn.js.map +1 -1
  74. package/dist/esm/lib/presentation/spellColumnArrangement.js +5 -9
  75. package/dist/esm/lib/presentation/spellColumnArrangement.js.map +1 -1
  76. package/dist/esm/lib/presentation/spellWidthKey.js +4 -4
  77. package/dist/esm/lib/presentation/spellWidthKey.js.map +1 -1
  78. package/dist/esm/lib/provider/constants.js +3 -22
  79. package/dist/esm/lib/provider/constants.js.map +1 -1
  80. package/dist/esm/lib/provider/createDataViewsProvider.js +46 -19
  81. package/dist/esm/lib/provider/createDataViewsProvider.js.map +1 -1
  82. package/dist/esm/lib/provider/createQueryCommands.js +32 -20
  83. package/dist/esm/lib/provider/createQueryCommands.js.map +1 -1
  84. package/dist/esm/lib/provider/createRecordTyping.js +14 -12
  85. package/dist/esm/lib/provider/createRecordTyping.js.map +1 -1
  86. package/dist/esm/lib/provider/createRequestCompleter.js +8 -3
  87. package/dist/esm/lib/provider/createRequestCompleter.js.map +1 -1
  88. package/dist/esm/lib/provider/isDataViewsProvider.js +4 -2
  89. package/dist/esm/lib/provider/isDataViewsProvider.js.map +1 -1
  90. package/dist/esm/lib/provider/isSameQuery.js +13 -0
  91. package/dist/esm/lib/provider/isSameQuery.js.map +1 -0
  92. package/dist/esm/lib/provider/listCarriedIssues.js +20 -0
  93. package/dist/esm/lib/provider/listCarriedIssues.js.map +1 -0
  94. package/dist/esm/lib/provider/observePorts.js +2 -2
  95. package/dist/esm/lib/provider/observePorts.js.map +1 -1
  96. package/dist/esm/lib/provider/readCommandCause.js +28 -0
  97. package/dist/esm/lib/provider/readCommandCause.js.map +1 -0
  98. package/dist/esm/lib/provider/readLocatedArrangement.js +15 -13
  99. package/dist/esm/lib/provider/readLocatedArrangement.js.map +1 -1
  100. package/dist/esm/lib/provider/readProviderHost.js +2 -2
  101. package/dist/esm/lib/provider/readProviderHost.js.map +1 -1
  102. package/dist/esm/lib/provider/readProviderRegistry.js +20 -0
  103. package/dist/esm/lib/provider/readProviderRegistry.js.map +1 -0
  104. package/dist/esm/lib/provider/readStartingPoint.js +2 -1
  105. package/dist/esm/lib/provider/readStartingPoint.js.map +1 -1
  106. package/dist/esm/lib/provider/registerProviderHost.js +2 -2
  107. package/dist/esm/lib/provider/registerProviderHost.js.map +1 -1
  108. package/dist/esm/lib/provider/resolveHistoryPolicy.js +7 -7
  109. package/dist/esm/lib/provider/resolveHistoryPolicy.js.map +1 -1
  110. package/dist/esm/lib/provider/runSource.js +13 -8
  111. package/dist/esm/lib/provider/runSource.js.map +1 -1
  112. package/dist/esm/lib/provider/shouldAdoptLocation.js +15 -0
  113. package/dist/esm/lib/provider/shouldAdoptLocation.js.map +1 -0
  114. package/dist/esm/lib/provider/spellLocation.js +7 -3
  115. package/dist/esm/lib/provider/spellLocation.js.map +1 -1
  116. package/dist/esm/lib/provider/syncLocation.js +61 -31
  117. package/dist/esm/lib/provider/syncLocation.js.map +1 -1
  118. package/dist/esm/lib/query/applyQueryCommand.js +129 -38
  119. package/dist/esm/lib/query/applyQueryCommand.js.map +1 -1
  120. package/dist/esm/lib/query/areListsEqual.js +1 -1
  121. package/dist/esm/lib/query/areListsEqual.js.map +1 -1
  122. package/dist/esm/lib/query/canonicalizeSlice.js +14 -17
  123. package/dist/esm/lib/query/canonicalizeSlice.js.map +1 -1
  124. package/dist/esm/lib/query/compareConjuncts.js +44 -0
  125. package/dist/esm/lib/query/compareConjuncts.js.map +1 -0
  126. package/dist/esm/lib/query/constants.js +6 -2
  127. package/dist/esm/lib/query/constants.js.map +1 -1
  128. package/dist/esm/lib/query/index.js +2 -0
  129. package/dist/esm/lib/query/index.js.map +1 -1
  130. package/dist/esm/lib/query/listConjuncts.js +13 -0
  131. package/dist/esm/lib/query/listConjuncts.js.map +1 -0
  132. package/dist/esm/lib/query/readCondition.js +36 -0
  133. package/dist/esm/lib/query/readCondition.js.map +1 -0
  134. package/dist/esm/lib/query/rejectOperandArity.js +2 -4
  135. package/dist/esm/lib/query/rejectOperandArity.js.map +1 -1
  136. package/dist/esm/lib/result/areFieldFacetsEqual.js +7 -1
  137. package/dist/esm/lib/result/areFieldFacetsEqual.js.map +1 -1
  138. package/dist/esm/lib/rows/constants.js +1 -1
  139. package/dist/esm/lib/rows/constants.js.map +1 -1
  140. package/dist/esm/lib/rows/createRowModel.js +2 -2
  141. package/dist/esm/lib/rows/createRowModel.js.map +1 -1
  142. package/dist/esm/lib/rows/createRowScopes.js +5 -2
  143. package/dist/esm/lib/rows/createRowScopes.js.map +1 -1
  144. package/dist/esm/lib/schema/createSchema.js +21 -10
  145. package/dist/esm/lib/schema/createSchema.js.map +1 -1
  146. package/dist/esm/lib/schema/parseNumberWithUnit.js +72 -0
  147. package/dist/esm/lib/schema/parseNumberWithUnit.js.map +1 -0
  148. package/dist/esm/lib/schema/resolveFieldKind.js +88 -29
  149. package/dist/esm/lib/schema/resolveFieldKind.js.map +1 -1
  150. package/dist/esm/lib/selection/createSelection.js +4 -2
  151. package/dist/esm/lib/selection/createSelection.js.map +1 -1
  152. package/dist/esm/lib/source/copyCapabilities.js +0 -1
  153. package/dist/esm/lib/source/copyCapabilities.js.map +1 -1
  154. package/dist/esm/lib/source/createArraySource.js +11 -8
  155. package/dist/esm/lib/source/createArraySource.js.map +1 -1
  156. package/dist/esm/lib/source/createPage.js +0 -1
  157. package/dist/esm/lib/source/createPage.js.map +1 -1
  158. package/dist/esm/lib/source/createQuerySource.js +32 -13
  159. package/dist/esm/lib/source/createQuerySource.js.map +1 -1
  160. package/dist/esm/lib/source/createRefusal.js +5 -0
  161. package/dist/esm/lib/source/createRefusal.js.map +1 -0
  162. package/dist/esm/lib/source/createRelaySource.js +49 -60
  163. package/dist/esm/lib/source/createRelaySource.js.map +1 -1
  164. package/dist/esm/lib/source/declareCapabilities.js +0 -1
  165. package/dist/esm/lib/source/declareCapabilities.js.map +1 -1
  166. package/dist/esm/lib/source/executeSlice.js +1 -0
  167. package/dist/esm/lib/source/executeSlice.js.map +1 -1
  168. package/dist/esm/lib/source/foldText.js +3 -0
  169. package/dist/esm/lib/source/foldText.js.map +1 -1
  170. package/dist/esm/lib/source/index.js +3 -1
  171. package/dist/esm/lib/source/index.js.map +1 -1
  172. package/dist/esm/lib/source/listFilterRefusals.js +30 -0
  173. package/dist/esm/lib/source/listFilterRefusals.js.map +1 -0
  174. package/dist/esm/lib/source/listGroupRefusals.js +22 -0
  175. package/dist/esm/lib/source/listGroupRefusals.js.map +1 -0
  176. package/dist/esm/lib/source/listOfferedOperators.js +25 -0
  177. package/dist/esm/lib/source/listOfferedOperators.js.map +1 -0
  178. package/dist/esm/lib/source/listQueryRefusals.js +35 -0
  179. package/dist/esm/lib/source/listQueryRefusals.js.map +1 -0
  180. package/dist/esm/lib/source/listSortRefusals.js +27 -0
  181. package/dist/esm/lib/source/listSortRefusals.js.map +1 -0
  182. package/dist/esm/lib/source/listWindowRefusals.js +20 -0
  183. package/dist/esm/lib/source/listWindowRefusals.js.map +1 -0
  184. package/dist/esm/lib/source/orderRows.js +36 -12
  185. package/dist/esm/lib/source/orderRows.js.map +1 -1
  186. package/dist/esm/lib/source/readFacets.js +30 -15
  187. package/dist/esm/lib/source/readFacets.js.map +1 -1
  188. package/dist/esm/lib/source/readRelayPage.js +55 -0
  189. package/dist/esm/lib/source/readRelayPage.js.map +1 -0
  190. package/dist/esm/lib/source/readSlice.js +5 -3
  191. package/dist/esm/lib/source/readSlice.js.map +1 -1
  192. package/dist/esm/lib/source/resolveErrorDelivery.js +27 -0
  193. package/dist/esm/lib/source/resolveErrorDelivery.js.map +1 -0
  194. package/dist/esm/lib/source/selectRows.js +72 -16
  195. package/dist/esm/lib/source/selectRows.js.map +1 -1
  196. package/dist/esm/lib/views/createViewCommands.js +6 -3
  197. package/dist/esm/lib/views/createViewCommands.js.map +1 -1
  198. package/dist/esm/lib/views/readStoredQuery.js +2 -1
  199. package/dist/esm/lib/views/readStoredQuery.js.map +1 -1
  200. package/dist/esm/lib/virtualization/createSizeIndex.js +19 -10
  201. package/dist/esm/lib/virtualization/createSizeIndex.js.map +1 -1
  202. package/dist/esm/lib/virtualization/createVirtualRange.js +30 -28
  203. package/dist/esm/lib/virtualization/createVirtualRange.js.map +1 -1
  204. package/dist/esm/lib/wire/areQueryIssuesEqual.js +12 -0
  205. package/dist/esm/lib/wire/areQueryIssuesEqual.js.map +1 -0
  206. package/dist/esm/lib/wire/constants.js +56 -36
  207. package/dist/esm/lib/wire/constants.js.map +1 -1
  208. package/dist/esm/lib/wire/decodeQuery.js +140 -168
  209. package/dist/esm/lib/wire/decodeQuery.js.map +1 -1
  210. package/dist/esm/lib/wire/encodeCarryingQuery.js +294 -0
  211. package/dist/esm/lib/wire/encodeCarryingQuery.js.map +1 -0
  212. package/dist/esm/lib/wire/encodeQuery.js +8 -76
  213. package/dist/esm/lib/wire/encodeQuery.js.map +1 -1
  214. package/dist/esm/lib/wire/index.js +6 -1
  215. package/dist/esm/lib/wire/index.js.map +1 -1
  216. package/dist/esm/lib/wire/isNarrowingIssue.js +15 -0
  217. package/dist/esm/lib/wire/isNarrowingIssue.js.map +1 -0
  218. package/dist/esm/lib/wire/isOwnedKey.js +6 -2
  219. package/dist/esm/lib/wire/isOwnedKey.js.map +1 -1
  220. package/dist/esm/lib/wire/isReservedKey.js +9 -0
  221. package/dist/esm/lib/wire/isReservedKey.js.map +1 -0
  222. package/dist/esm/lib/wire/readArrangementParams.js +18 -14
  223. package/dist/esm/lib/wire/readArrangementParams.js.map +1 -1
  224. package/dist/esm/lib/wire/readKeyPredicate.js +146 -0
  225. package/dist/esm/lib/wire/readKeyPredicate.js.map +1 -0
  226. package/dist/esm/lib/wire/readTableKey.js +21 -0
  227. package/dist/esm/lib/wire/readTableKey.js.map +1 -0
  228. package/dist/esm/lib/wire/readUndeclaredField.js +19 -0
  229. package/dist/esm/lib/wire/readUndeclaredField.js.map +1 -0
  230. package/dist/esm/lib/wire/readWireKey.js +38 -0
  231. package/dist/esm/lib/wire/readWireKey.js.map +1 -0
  232. package/dist/esm/lib/wire/recordConjunct.js +48 -0
  233. package/dist/esm/lib/wire/recordConjunct.js.map +1 -0
  234. package/dist/esm/lib/wire/rejectWireName.js +3 -2
  235. package/dist/esm/lib/wire/rejectWireName.js.map +1 -1
  236. package/dist/esm/lib/wire/spellArrangementKey.js +7 -0
  237. package/dist/esm/lib/wire/spellArrangementKey.js.map +1 -0
  238. package/dist/esm/lib/wire/spellArrangementParams.js +12 -15
  239. package/dist/esm/lib/wire/spellArrangementParams.js.map +1 -1
  240. package/dist/esm/lib/wire/spellOperand.js +33 -0
  241. package/dist/esm/lib/wire/spellOperand.js.map +1 -0
  242. package/dist/esm/lib/wire/spellTableId.js +12 -0
  243. package/dist/esm/lib/wire/spellTableId.js.map +1 -0
  244. package/dist/esm/lib/wire/spellWireKey.js +7 -4
  245. package/dist/esm/lib/wire/spellWireKey.js.map +1 -1
  246. package/dist/esm/lib/wire/spellWireValues.js +18 -0
  247. package/dist/esm/lib/wire/spellWireValues.js.map +1 -0
  248. package/dist/esm/testing/answerWith.js +10 -0
  249. package/dist/esm/testing/buildFailedResult.js +12 -0
  250. package/dist/esm/testing/buildPage.js +19 -0
  251. package/dist/esm/testing/buildRefusedResult.js +18 -0
  252. package/dist/esm/testing/buildRowModel.js +15 -0
  253. package/dist/esm/testing/buildSettledPage.js +22 -0
  254. package/dist/esm/testing/buildStoredView.js +19 -0
  255. package/dist/esm/testing/classifyInitializer.js +50 -0
  256. package/dist/esm/testing/countAtLeast.js +9 -0
  257. package/dist/esm/testing/countExactly.js +9 -0
  258. package/dist/esm/testing/createCountedRows.js +28 -0
  259. package/dist/esm/testing/createCountingViewStore.js +36 -0
  260. package/dist/esm/testing/createDeferred.js +9 -0
  261. package/dist/esm/testing/createManualSource.js +56 -0
  262. package/dist/esm/testing/createRecordingLocation.js +53 -0
  263. package/dist/esm/testing/createStandInPresentationStore.js +15 -0
  264. package/dist/esm/testing/createStandInViewStore.js +23 -0
  265. package/dist/esm/testing/declare.js +10 -0
  266. package/dist/esm/testing/declareSort.js +17 -0
  267. package/dist/esm/testing/filterStatusBy.js +13 -0
  268. package/dist/esm/testing/fixtures.js +694 -0
  269. package/dist/esm/testing/flushPresentation.js +16 -0
  270. package/dist/esm/testing/index.js +35 -0
  271. package/dist/esm/testing/installFakeClock.js +18 -0
  272. package/dist/esm/testing/isMovableForm.js +7 -0
  273. package/dist/esm/testing/isWrappedInitializer.js +33 -0
  274. package/dist/esm/testing/isWrapperCallee.js +10 -0
  275. package/dist/esm/testing/judgeExports.js +54 -0
  276. package/dist/esm/testing/listBracedExports.js +45 -0
  277. package/dist/esm/testing/listExports.js +68 -0
  278. package/dist/esm/testing/listFileRuleFindings.js +76 -0
  279. package/dist/esm/testing/listUnmarkedNames.js +40 -0
  280. package/dist/esm/testing/maskSource.js +149 -0
  281. package/dist/esm/testing/observeUntilFinished.js +15 -0
  282. package/dist/esm/testing/openIndexedDBTab.js +20 -0
  283. package/dist/esm/testing/orderNodesByName.js +31 -0
  284. package/dist/esm/testing/readDeclarationDoc.js +15 -0
  285. package/dist/esm/testing/readDeclarationExport.js +41 -0
  286. package/dist/esm/testing/readDefaultExport.js +55 -0
  287. package/dist/esm/testing/readDisplayStatus.js +14 -0
  288. package/dist/esm/testing/readFileRole.js +16 -0
  289. package/dist/esm/testing/readGroup.js +8 -0
  290. package/dist/esm/testing/readId.js +9 -0
  291. package/dist/esm/testing/readIssuedRequest.js +12 -0
  292. package/dist/esm/testing/readLocalBinding.js +44 -0
  293. package/dist/esm/testing/readSucceededPage.js +7 -0
  294. package/dist/esm/testing/relayTypes.js +5 -0
  295. package/dist/esm/testing/respellLink.js +27 -0
  296. package/dist/esm/testing/runFailureHandlers.js +26 -0
  297. package/dist/esm/testing/settleCalls.js +11 -0
  298. package/dist/esm/testing/skipBalanced.js +20 -0
  299. package/dist/esm/testing/skipTypeAnnotation.js +33 -0
  300. package/dist/esm/testing/types.js +2 -0
  301. package/dist/esm/testing/waitForState.js +40 -0
  302. package/dist/types/lib/assertion/assertInvariant.d.ts +9 -0
  303. package/dist/types/lib/assertion/assertInvariant.d.ts.map +1 -0
  304. package/dist/types/lib/assertion/index.d.ts +2 -0
  305. package/dist/types/lib/assertion/index.d.ts.map +1 -0
  306. package/dist/types/lib/bindings/index.d.ts +6 -20
  307. package/dist/types/lib/bindings/index.d.ts.map +1 -1
  308. package/dist/types/lib/coordinator/createQueryCoordinator.d.ts.map +1 -1
  309. package/dist/types/lib/coordinator/index.d.ts +2 -0
  310. package/dist/types/lib/coordinator/index.d.ts.map +1 -1
  311. package/dist/types/lib/coordinator/isClauseReplaced.d.ts +12 -0
  312. package/dist/types/lib/coordinator/isClauseReplaced.d.ts.map +1 -0
  313. package/dist/types/lib/coordinator/readWithheld.d.ts +9 -0
  314. package/dist/types/lib/coordinator/readWithheld.d.ts.map +1 -0
  315. package/dist/types/lib/coordinator/types.d.ts +34 -11
  316. package/dist/types/lib/coordinator/types.d.ts.map +1 -1
  317. package/dist/types/lib/display/constants.d.ts.map +1 -1
  318. package/dist/types/lib/display/resolveDisplayStatus.d.ts +6 -0
  319. package/dist/types/lib/display/resolveDisplayStatus.d.ts.map +1 -1
  320. package/dist/types/lib/display/types.d.ts +22 -16
  321. package/dist/types/lib/display/types.d.ts.map +1 -1
  322. package/dist/types/lib/filter/createFilterInput.d.ts.map +1 -1
  323. package/dist/types/lib/filter/createFilterInputs.d.ts +4 -2
  324. package/dist/types/lib/filter/createFilterInputs.d.ts.map +1 -1
  325. package/dist/types/lib/filter/types.d.ts +55 -2
  326. package/dist/types/lib/filter/types.d.ts.map +1 -1
  327. package/dist/types/lib/geometry/createColumnLayout.d.ts +3 -6
  328. package/dist/types/lib/geometry/createColumnLayout.d.ts.map +1 -1
  329. package/dist/types/lib/geometry/createGridInteraction.d.ts +3 -0
  330. package/dist/types/lib/geometry/createGridInteraction.d.ts.map +1 -1
  331. package/dist/types/lib/geometry/types.d.ts +3 -1
  332. package/dist/types/lib/geometry/types.d.ts.map +1 -1
  333. package/dist/types/lib/index.d.ts +7 -7
  334. package/dist/types/lib/index.d.ts.map +1 -1
  335. package/dist/types/lib/indexeddb/createIndexedDBViewStore.d.ts.map +1 -1
  336. package/dist/types/lib/indexeddb/readSavedView.d.ts +4 -1
  337. package/dist/types/lib/indexeddb/readSavedView.d.ts.map +1 -1
  338. package/dist/types/lib/indexeddb/types.d.ts +7 -0
  339. package/dist/types/lib/indexeddb/types.d.ts.map +1 -1
  340. package/dist/types/lib/location/createMemoryLocation.d.ts +2 -0
  341. package/dist/types/lib/location/createMemoryLocation.d.ts.map +1 -1
  342. package/dist/types/lib/location/createPlatformLocation.d.ts +3 -0
  343. package/dist/types/lib/location/createPlatformLocation.d.ts.map +1 -1
  344. package/dist/types/lib/messages/composeStatus.d.ts +6 -0
  345. package/dist/types/lib/messages/composeStatus.d.ts.map +1 -0
  346. package/dist/types/lib/messages/constants.d.ts +27 -1
  347. package/dist/types/lib/messages/constants.d.ts.map +1 -1
  348. package/dist/types/lib/messages/types.d.ts +381 -88
  349. package/dist/types/lib/messages/types.d.ts.map +1 -1
  350. package/dist/types/lib/observable/createChannel.d.ts +2 -0
  351. package/dist/types/lib/observable/createChannel.d.ts.map +1 -1
  352. package/dist/types/lib/presentation/constants.d.ts +4 -12
  353. package/dist/types/lib/presentation/constants.d.ts.map +1 -1
  354. package/dist/types/lib/presentation/createMemoryPresentation.d.ts +10 -0
  355. package/dist/types/lib/presentation/createMemoryPresentation.d.ts.map +1 -0
  356. package/dist/types/lib/presentation/hideColumn.d.ts +2 -2
  357. package/dist/types/lib/presentation/hideColumn.d.ts.map +1 -1
  358. package/dist/types/lib/presentation/index.d.ts +4 -1
  359. package/dist/types/lib/presentation/index.d.ts.map +1 -1
  360. package/dist/types/lib/presentation/isTableKey.d.ts +6 -0
  361. package/dist/types/lib/presentation/isTableKey.d.ts.map +1 -0
  362. package/dist/types/lib/presentation/moveColumn.d.ts +2 -3
  363. package/dist/types/lib/presentation/moveColumn.d.ts.map +1 -1
  364. package/dist/types/lib/presentation/pickTableKeys.d.ts +4 -0
  365. package/dist/types/lib/presentation/pickTableKeys.d.ts.map +1 -0
  366. package/dist/types/lib/presentation/resetColumnArrangement.d.ts +3 -8
  367. package/dist/types/lib/presentation/resetColumnArrangement.d.ts.map +1 -1
  368. package/dist/types/lib/presentation/resolveArrangementParams.d.ts +3 -9
  369. package/dist/types/lib/presentation/resolveArrangementParams.d.ts.map +1 -1
  370. package/dist/types/lib/presentation/resolveColumnArrangement.d.ts +3 -2
  371. package/dist/types/lib/presentation/resolveColumnArrangement.d.ts.map +1 -1
  372. package/dist/types/lib/presentation/showColumn.d.ts +1 -1
  373. package/dist/types/lib/presentation/showColumn.d.ts.map +1 -1
  374. package/dist/types/lib/presentation/spellColumnArrangement.d.ts +3 -7
  375. package/dist/types/lib/presentation/spellColumnArrangement.d.ts.map +1 -1
  376. package/dist/types/lib/presentation/spellWidthKey.d.ts +2 -2
  377. package/dist/types/lib/presentation/spellWidthKey.d.ts.map +1 -1
  378. package/dist/types/lib/presentation/types.d.ts +6 -2
  379. package/dist/types/lib/presentation/types.d.ts.map +1 -1
  380. package/dist/types/lib/provider/constants.d.ts +3 -15
  381. package/dist/types/lib/provider/constants.d.ts.map +1 -1
  382. package/dist/types/lib/provider/createDataViewsProvider.d.ts.map +1 -1
  383. package/dist/types/lib/provider/createQueryCommands.d.ts.map +1 -1
  384. package/dist/types/lib/provider/createRecordTyping.d.ts.map +1 -1
  385. package/dist/types/lib/provider/createRequestCompleter.d.ts.map +1 -1
  386. package/dist/types/lib/provider/isDataViewsProvider.d.ts.map +1 -1
  387. package/dist/types/lib/provider/isSameQuery.d.ts +8 -0
  388. package/dist/types/lib/provider/isSameQuery.d.ts.map +1 -0
  389. package/dist/types/lib/provider/listCarriedIssues.d.ts +10 -0
  390. package/dist/types/lib/provider/listCarriedIssues.d.ts.map +1 -0
  391. package/dist/types/lib/provider/readCommandCause.d.ts +10 -0
  392. package/dist/types/lib/provider/readCommandCause.d.ts.map +1 -0
  393. package/dist/types/lib/provider/readLocatedArrangement.d.ts +3 -5
  394. package/dist/types/lib/provider/readLocatedArrangement.d.ts.map +1 -1
  395. package/dist/types/lib/provider/readProviderRegistry.d.ts +10 -0
  396. package/dist/types/lib/provider/readProviderRegistry.d.ts.map +1 -0
  397. package/dist/types/lib/provider/readStartingPoint.d.ts.map +1 -1
  398. package/dist/types/lib/provider/runSource.d.ts.map +1 -1
  399. package/dist/types/lib/provider/shouldAdoptLocation.d.ts +19 -0
  400. package/dist/types/lib/provider/shouldAdoptLocation.d.ts.map +1 -0
  401. package/dist/types/lib/provider/spellLocation.d.ts +10 -1
  402. package/dist/types/lib/provider/spellLocation.d.ts.map +1 -1
  403. package/dist/types/lib/provider/syncLocation.d.ts.map +1 -1
  404. package/dist/types/lib/provider/types.d.ts +91 -36
  405. package/dist/types/lib/provider/types.d.ts.map +1 -1
  406. package/dist/types/lib/query/applyQueryCommand.d.ts +7 -2
  407. package/dist/types/lib/query/applyQueryCommand.d.ts.map +1 -1
  408. package/dist/types/lib/query/canonicalizeSlice.d.ts +4 -2
  409. package/dist/types/lib/query/canonicalizeSlice.d.ts.map +1 -1
  410. package/dist/types/lib/query/compareConjuncts.d.ts +14 -0
  411. package/dist/types/lib/query/compareConjuncts.d.ts.map +1 -0
  412. package/dist/types/lib/query/constants.d.ts +2 -2
  413. package/dist/types/lib/query/constants.d.ts.map +1 -1
  414. package/dist/types/lib/query/index.d.ts +2 -0
  415. package/dist/types/lib/query/index.d.ts.map +1 -1
  416. package/dist/types/lib/query/listConjuncts.d.ts +11 -0
  417. package/dist/types/lib/query/listConjuncts.d.ts.map +1 -0
  418. package/dist/types/lib/query/readCondition.d.ts +14 -0
  419. package/dist/types/lib/query/readCondition.d.ts.map +1 -0
  420. package/dist/types/lib/query/rejectOperandArity.d.ts +2 -2
  421. package/dist/types/lib/query/rejectOperandArity.d.ts.map +1 -1
  422. package/dist/types/lib/query/types.d.ts +89 -16
  423. package/dist/types/lib/query/types.d.ts.map +1 -1
  424. package/dist/types/lib/result/areFieldFacetsEqual.d.ts +7 -1
  425. package/dist/types/lib/result/areFieldFacetsEqual.d.ts.map +1 -1
  426. package/dist/types/lib/result/types.d.ts +66 -24
  427. package/dist/types/lib/result/types.d.ts.map +1 -1
  428. package/dist/types/lib/rows/createRowScopes.d.ts +3 -0
  429. package/dist/types/lib/rows/createRowScopes.d.ts.map +1 -1
  430. package/dist/types/lib/rows/types.d.ts +3 -3
  431. package/dist/types/lib/rows/types.d.ts.map +1 -1
  432. package/dist/types/lib/schema/createSchema.d.ts.map +1 -1
  433. package/dist/types/lib/schema/parseNumberWithUnit.d.ts +15 -0
  434. package/dist/types/lib/schema/parseNumberWithUnit.d.ts.map +1 -0
  435. package/dist/types/lib/schema/resolveFieldKind.d.ts.map +1 -1
  436. package/dist/types/lib/schema/types.d.ts +93 -29
  437. package/dist/types/lib/schema/types.d.ts.map +1 -1
  438. package/dist/types/lib/selection/createSelection.d.ts +2 -0
  439. package/dist/types/lib/selection/createSelection.d.ts.map +1 -1
  440. package/dist/types/lib/source/copyCapabilities.d.ts.map +1 -1
  441. package/dist/types/lib/source/createArraySource.d.ts +5 -2
  442. package/dist/types/lib/source/createArraySource.d.ts.map +1 -1
  443. package/dist/types/lib/source/createPage.d.ts.map +1 -1
  444. package/dist/types/lib/source/createQuerySource.d.ts +7 -0
  445. package/dist/types/lib/source/createQuerySource.d.ts.map +1 -1
  446. package/dist/types/lib/source/createRefusal.d.ts +4 -0
  447. package/dist/types/lib/source/createRefusal.d.ts.map +1 -0
  448. package/dist/types/lib/source/createRelaySource.d.ts +7 -1
  449. package/dist/types/lib/source/createRelaySource.d.ts.map +1 -1
  450. package/dist/types/lib/source/declareCapabilities.d.ts.map +1 -1
  451. package/dist/types/lib/source/executeSlice.d.ts.map +1 -1
  452. package/dist/types/lib/source/foldText.d.ts +3 -0
  453. package/dist/types/lib/source/foldText.d.ts.map +1 -1
  454. package/dist/types/lib/source/index.d.ts +3 -1
  455. package/dist/types/lib/source/index.d.ts.map +1 -1
  456. package/dist/types/lib/source/listFilterRefusals.d.ts +11 -0
  457. package/dist/types/lib/source/listFilterRefusals.d.ts.map +1 -0
  458. package/dist/types/lib/source/listGroupRefusals.d.ts +10 -0
  459. package/dist/types/lib/source/listGroupRefusals.d.ts.map +1 -0
  460. package/dist/types/lib/source/listOfferedOperators.d.ts +14 -0
  461. package/dist/types/lib/source/listOfferedOperators.d.ts.map +1 -0
  462. package/dist/types/lib/source/{refusalsOf.d.ts → listQueryRefusals.d.ts} +3 -3
  463. package/dist/types/lib/source/listQueryRefusals.d.ts.map +1 -0
  464. package/dist/types/lib/source/listSortRefusals.d.ts +10 -0
  465. package/dist/types/lib/source/listSortRefusals.d.ts.map +1 -0
  466. package/dist/types/lib/source/listWindowRefusals.d.ts +9 -0
  467. package/dist/types/lib/source/listWindowRefusals.d.ts.map +1 -0
  468. package/dist/types/lib/source/orderRows.d.ts +10 -5
  469. package/dist/types/lib/source/orderRows.d.ts.map +1 -1
  470. package/dist/types/lib/source/readFacets.d.ts +1 -1
  471. package/dist/types/lib/source/readFacets.d.ts.map +1 -1
  472. package/dist/types/lib/source/readRelayPage.d.ts +19 -0
  473. package/dist/types/lib/source/readRelayPage.d.ts.map +1 -0
  474. package/dist/types/lib/source/readSlice.d.ts +5 -3
  475. package/dist/types/lib/source/readSlice.d.ts.map +1 -1
  476. package/dist/types/lib/source/resolveErrorDelivery.d.ts +9 -0
  477. package/dist/types/lib/source/resolveErrorDelivery.d.ts.map +1 -0
  478. package/dist/types/lib/source/selectRows.d.ts +4 -2
  479. package/dist/types/lib/source/selectRows.d.ts.map +1 -1
  480. package/dist/types/lib/source/types.d.ts +36 -17
  481. package/dist/types/lib/source/types.d.ts.map +1 -1
  482. package/dist/types/lib/views/createViewCommands.d.ts.map +1 -1
  483. package/dist/types/lib/views/readStoredQuery.d.ts.map +1 -1
  484. package/dist/types/lib/views/types.d.ts +1 -1
  485. package/dist/types/lib/views/types.d.ts.map +1 -1
  486. package/dist/types/lib/virtualization/createSizeIndex.d.ts +3 -0
  487. package/dist/types/lib/virtualization/createSizeIndex.d.ts.map +1 -1
  488. package/dist/types/lib/virtualization/createVirtualRange.d.ts +4 -1
  489. package/dist/types/lib/virtualization/createVirtualRange.d.ts.map +1 -1
  490. package/dist/types/lib/virtualization/types.d.ts +4 -4
  491. package/dist/types/lib/virtualization/types.d.ts.map +1 -1
  492. package/dist/types/lib/wire/areQueryIssuesEqual.d.ts +7 -0
  493. package/dist/types/lib/wire/areQueryIssuesEqual.d.ts.map +1 -0
  494. package/dist/types/lib/wire/constants.d.ts +54 -18
  495. package/dist/types/lib/wire/constants.d.ts.map +1 -1
  496. package/dist/types/lib/wire/decodeQuery.d.ts +7 -4
  497. package/dist/types/lib/wire/decodeQuery.d.ts.map +1 -1
  498. package/dist/types/lib/wire/encodeCarryingQuery.d.ts +9 -0
  499. package/dist/types/lib/wire/encodeCarryingQuery.d.ts.map +1 -0
  500. package/dist/types/lib/wire/encodeQuery.d.ts.map +1 -1
  501. package/dist/types/lib/wire/index.d.ts +6 -1
  502. package/dist/types/lib/wire/index.d.ts.map +1 -1
  503. package/dist/types/lib/wire/isNarrowingIssue.d.ts +13 -0
  504. package/dist/types/lib/wire/isNarrowingIssue.d.ts.map +1 -0
  505. package/dist/types/lib/wire/isOwnedKey.d.ts +3 -1
  506. package/dist/types/lib/wire/isOwnedKey.d.ts.map +1 -1
  507. package/dist/types/lib/wire/isReservedKey.d.ts +6 -0
  508. package/dist/types/lib/wire/isReservedKey.d.ts.map +1 -0
  509. package/dist/types/lib/wire/readArrangementParams.d.ts +4 -8
  510. package/dist/types/lib/wire/readArrangementParams.d.ts.map +1 -1
  511. package/dist/types/lib/wire/readKeyPredicate.d.ts +9 -0
  512. package/dist/types/lib/wire/readKeyPredicate.d.ts.map +1 -0
  513. package/dist/types/lib/wire/readTableKey.d.ts +13 -0
  514. package/dist/types/lib/wire/readTableKey.d.ts.map +1 -0
  515. package/dist/types/lib/wire/readUndeclaredField.d.ts +11 -0
  516. package/dist/types/lib/wire/readUndeclaredField.d.ts.map +1 -0
  517. package/dist/types/lib/wire/readWireKey.d.ts +11 -0
  518. package/dist/types/lib/wire/readWireKey.d.ts.map +1 -0
  519. package/dist/types/lib/wire/recordConjunct.d.ts +10 -0
  520. package/dist/types/lib/wire/recordConjunct.d.ts.map +1 -0
  521. package/dist/types/lib/wire/rejectWireName.d.ts.map +1 -1
  522. package/dist/types/lib/wire/spellArrangementKey.d.ts +4 -0
  523. package/dist/types/lib/wire/spellArrangementKey.d.ts.map +1 -0
  524. package/dist/types/lib/wire/spellArrangementParams.d.ts +3 -9
  525. package/dist/types/lib/wire/spellArrangementParams.d.ts.map +1 -1
  526. package/dist/types/lib/wire/spellOperand.d.ts +4 -0
  527. package/dist/types/lib/wire/spellOperand.d.ts.map +1 -0
  528. package/dist/types/lib/wire/spellTableId.d.ts +6 -0
  529. package/dist/types/lib/wire/spellTableId.d.ts.map +1 -0
  530. package/dist/types/lib/wire/spellWireKey.d.ts +4 -4
  531. package/dist/types/lib/wire/spellWireKey.d.ts.map +1 -1
  532. package/dist/types/lib/wire/spellWireValues.d.ts +13 -0
  533. package/dist/types/lib/wire/spellWireValues.d.ts.map +1 -0
  534. package/dist/types/lib/wire/types.d.ts +68 -31
  535. package/dist/types/lib/wire/types.d.ts.map +1 -1
  536. package/dist/types/testing/answerWith.d.ts +9 -0
  537. package/dist/types/testing/buildFailedResult.d.ts +10 -0
  538. package/dist/types/testing/buildPage.d.ts +8 -0
  539. package/dist/types/testing/buildRefusedResult.d.ts +10 -0
  540. package/dist/types/testing/buildRowModel.d.ts +9 -0
  541. package/dist/types/testing/buildSettledPage.d.ts +17 -0
  542. package/dist/types/testing/buildStoredView.d.ts +8 -0
  543. package/dist/types/testing/classifyInitializer.d.ts +6 -0
  544. package/dist/types/testing/countAtLeast.d.ts +8 -0
  545. package/dist/types/testing/countExactly.d.ts +8 -0
  546. package/dist/types/testing/createCountedRows.d.ts +13 -0
  547. package/dist/types/testing/createCountingViewStore.d.ts +10 -0
  548. package/dist/types/testing/createDeferred.d.ts +8 -0
  549. package/dist/types/testing/createManualSource.d.ts +16 -0
  550. package/dist/types/testing/createRecordingLocation.d.ts +20 -0
  551. package/dist/types/testing/createStandInPresentationStore.d.ts +9 -0
  552. package/dist/types/testing/createStandInViewStore.d.ts +9 -0
  553. package/dist/types/testing/declare.d.ts +8 -0
  554. package/dist/types/testing/declareSort.d.ts +9 -0
  555. package/dist/types/testing/filterStatusBy.d.ts +8 -0
  556. package/dist/types/testing/fixtures.d.ts +117 -0
  557. package/dist/types/testing/flushPresentation.d.ts +13 -0
  558. package/dist/types/testing/index.d.ts +37 -0
  559. package/dist/types/testing/installFakeClock.d.ts +14 -0
  560. package/dist/types/testing/isMovableForm.d.ts +6 -0
  561. package/dist/types/testing/isWrappedInitializer.d.ts +6 -0
  562. package/dist/types/testing/isWrapperCallee.d.ts +2 -0
  563. package/dist/types/testing/judgeExports.d.ts +8 -0
  564. package/dist/types/testing/listBracedExports.d.ts +6 -0
  565. package/dist/types/testing/listExports.d.ts +7 -0
  566. package/dist/types/testing/listFileRuleFindings.d.ts +12 -0
  567. package/dist/types/testing/listUnmarkedNames.d.ts +10 -0
  568. package/dist/types/testing/maskSource.d.ts +6 -0
  569. package/dist/types/testing/observeUntilFinished.d.ts +12 -0
  570. package/dist/types/testing/openIndexedDBTab.d.ts +12 -0
  571. package/dist/types/testing/orderNodesByName.d.ts +11 -0
  572. package/dist/types/testing/readDeclarationDoc.d.ts +6 -0
  573. package/dist/types/testing/readDeclarationExport.d.ts +6 -0
  574. package/dist/types/testing/readDefaultExport.d.ts +6 -0
  575. package/dist/types/testing/readDisplayStatus.d.ts +8 -0
  576. package/dist/types/testing/readFileRole.d.ts +3 -0
  577. package/dist/types/testing/readGroup.d.ts +2 -0
  578. package/dist/types/testing/readId.d.ts +8 -0
  579. package/dist/types/testing/readIssuedRequest.d.ts +7 -0
  580. package/dist/types/testing/readLocalBinding.d.ts +6 -0
  581. package/dist/types/testing/readSucceededPage.d.ts +3 -0
  582. package/dist/types/testing/relayTypes.d.ts +38 -0
  583. package/dist/types/testing/respellLink.d.ts +12 -0
  584. package/dist/types/testing/runFailureHandlers.d.ts +12 -0
  585. package/dist/types/testing/settleCalls.d.ts +15 -0
  586. package/dist/types/testing/skipBalanced.d.ts +5 -0
  587. package/dist/types/testing/skipTypeAnnotation.d.ts +5 -0
  588. package/dist/types/testing/types.d.ts +228 -0
  589. package/dist/types/testing/waitForState.d.ts +11 -0
  590. package/package.json +19 -9
  591. package/dist/esm/lib/messages/DEFAULT_MESSAGES.js +0 -194
  592. package/dist/esm/lib/messages/DEFAULT_MESSAGES.js.map +0 -1
  593. package/dist/esm/lib/source/refusalsOf.js +0 -74
  594. package/dist/esm/lib/source/refusalsOf.js.map +0 -1
  595. package/dist/types/lib/messages/DEFAULT_MESSAGES.d.ts +0 -10
  596. package/dist/types/lib/messages/DEFAULT_MESSAGES.d.ts.map +0 -1
  597. package/dist/types/lib/source/refusalsOf.d.ts.map +0 -1
package/README.md CHANGED
@@ -14,20 +14,20 @@ bun add @canonical/dataviews-core
14
14
 
15
15
  Under active development; both DataViews packages are unpublished, so the surface changes without compatibility. The root exports what an application calls — `createCollection` and `createSchema`, `createDataViewsProvider`, the sources `createArraySource`, `createQuerySource` and `createRelaySource`, the adapter helpers `declareCapabilities`, `readSlice` and `createPage`, the locations `createMemoryLocation` and `createPlatformLocation`, the wire grammar `encodeQuery` and `decodeQuery`, and the two query constants `EMPTY_SLICE` and `DEFAULT_WINDOW` — together with the grammar, collection, schema, result, refusal, count, capability, provider, action and saved-view types anyone writing a source or reading a result must name (`Slice`, `ResultWindow`, `Query`, `SourcePage`, `Completion`, `SourceCapabilities`, `DisplayStatus`, `ViewStore`, `Collection`, `Selection`, `ActionRun` and friends). What the provider builds and owns — the coordinator, the action run, the row model, the selection, the channels, and the source and location loops — is not exported. Three further entry points carry bytes or an audience the root does not:
16
16
 
17
- - `@canonical/dataviews-core/bindings` — the machinery every framework binding shares and no application calls: the column geometry (`resolveColumns`, `buildColumnTemplate`, `createColumnLayout`, `createGridInteraction`, `areSizingsEqual`, `readSizingBounds`), the arrangement a table places its columns by (`resolveColumnArrangement`), the row channels a body renders from (`createRowScopes`), the table's status, the entries of its body and the pagination facts a bar offers, each projected from the published state (`resolveDisplayStatus`, `areDisplayStatusesEqual`, `DISPLAY_STATUS_PHASES`, `listDisplayEntries`, `resolvePagination`), the filter records a root builds (`createFilterInputs`), the provider check (`isDataViewsProvider`) and the provider's internal host (`readProviderHost`), the list comparison (`areListsEqual`), and the wire key a form control is named by (`spellWireKey`).
17
+ - `@canonical/dataviews-core/bindings` — the machinery every framework binding shares and no application calls: the column geometry (`resolveColumns`, `buildColumnTemplate`, `createColumnLayout`, `createGridInteraction`, `areSizingsEqual`, `readSizingBounds`), the arrangement a table places its columns by (`resolveColumnArrangement`), the row channels a body renders from (`createRowScopes`), the table's status, the entries of its body and the pagination facts a bar offers, each projected from the published state (`resolveDisplayStatus`, `areDisplayStatusesEqual`, `DISPLAY_STATUS_PHASES`, `listDisplayEntries`, `resolvePagination`), the filter records a root builds (`createFilterInputs`), the provider check (`isDataViewsProvider`) and the provider's internal host (`readProviderHost`), the list comparison (`areListsEqual`), the wire key a form control is named by (`spellWireKey`), the parameters a query's members are spelled under (`QUERY_KEYS`), and which of a followed link's refused clauses narrow the result (`isNarrowingIssue`).
18
18
  - `@canonical/dataviews-core/indexeddb` — the local-first IndexedDB saved-view store.
19
19
  - `@canonical/dataviews-core/virtualization` — the virtual range a virtualized table mounts its rows by.
20
20
 
21
21
  - **The collection** — `createCollection({ fields, identify, discriminator? })`, declared once at module scope: the schema, the required record identity — the record type is inferred from `identify`'s parameter, so neither is spelled by hand — and the record types, when the records come in several. It holds no state, so one object serves every request and every root, and it is the witness the provider is built over and the framework hooks compare by reference.
22
22
  - **Genuine providers** — a root checks what it is handed with `isDataViewsProvider` (from `./bindings`), which answers for the providers this package built and rejects structural copies: a spread of a provider is not one.
23
- - **Query grammar** — `Slice` (filters, search, ordered sort terms, ordered grouping levels) and `ResultWindow` (page, size, cursor token, collapsed group paths), paired as `Query`; semantic equality is the provider's own — `isAny` and `isNone` operands are sets, sort order is never reordered, empty search is no search — and `EMPTY_SLICE` and `DEFAULT_WINDOW` — the query that restricts nothing and the window a collection starts on — as the two halves of a `Query` to encode — a link to the first page of failed machines is `encodeQuery({ schema: machines.schema, slice: { ...EMPTY_SLICE, filter: [{ field: "status", operator: "isAny", operands: ["failed"] }] }, window: DEFAULT_WINDOW })`.
24
- - **Schema** — `collection.schema`, built by `createSchema` from the collection's field list: the one coherent construction path; field kinds (`choices`, `number`, `flag`, `date`, `text`) decide legal operators, how an ordered term over the field compares, and inferred applied types; inputs and direct operands are validated against option membership, numeric range and ISO-8601 dates. A `choices` field is filtered by `isAny` — its value is one of the operands — and `isNone` — its value is present, a string or a number, and none of them; an absent or null value is neither. A `text` field is ordered, and filtered by `contains` and `startsWith`: its value holds the operand, or begins with it, once both are folded — normalised to NFC, lowercased without a locale, final sigma read as sigma, and normalised to NFC again. The operand is taken literally, and `schema.listOperators("name")` is `["contains", "startsWith"]`.
23
+ - **Query grammar** — `Slice` (filters, search, ordered sort terms, ordered grouping levels) and `ResultWindow` (page, size, cursor token, collapsed group paths), paired as `Query`, the filter's conjuncts all ANDed and named by their `nth` (`PredicateRef`); semantic equality is the provider's own — `isAny` and `isNone` operands are sets, sort order is never reordered, empty search is no search — and `EMPTY_SLICE` and `DEFAULT_WINDOW` — the query that restricts nothing and the window a collection starts on — as the two halves of a `Query` to encode — a link to the first page of failed machines is `encodeQuery({ schema: machines.schema, slice: { ...EMPTY_SLICE, filter: [{ field: "status", operator: "isAny", operands: ["failed"] }] }, window: DEFAULT_WINDOW })`. The host's `addPredicate` adds a conjunct beside those at its address, and one the filter already holds changes nothing, since A AND A is A. `readCondition(predicate)` names what a predicate asserts about a record — `inclusion`, `exclusion`, `match`, `range` or `presence`, with `isSet` `false` as exclusion — so every control shows a clause's condition from one mapping.
24
+ - **Schema** — `collection.schema`, built by `createSchema` from the collection's field list: the one coherent construction path; field kinds (`choices`, `number`, `presence`, `date`, `text`) decide legal operators, how an ordered term over the field compares, and inferred applied types; inputs and direct operands are validated against option membership, numeric range and ISO-8601 dates. A `choices` field is filtered by `isAny` — its value is one of the operands — and `isNone` — its value is present, a string or a number, and none of them; an absent or null value is neither. With `multiple: true` a `choices` record holds a list, and both match by element. A `text` field is ordered, and filtered by `is`, `contains`, `startsWith` and `endsWith`: its value equals the operand, holds it, begins or ends with it, once both are folded — normalised to NFC, lowercased without a locale, final sigma read as sigma, and normalised to NFC again; `isNot` and `notContains` hold exactly where `is` and `contains` do not, so a record without text matches them. The operand is taken literally, and `schema.listOperators("name")` is `["is", "isNot", "contains", "notContains", "startsWith", "endsWith"]`. A `presence` field is filtered by `isSet` with `true` or `false`. A `number` field may declare `units`, its base unit and the display units a value may be typed in, so `16 GiB` reads as `16384` where the base is MiB.
25
25
  - **Observation** — every record publishes its state on a `ReadonlyChannel`, and what it hands outward is a frozen read-only view at runtime — `get` and `subscribe`, no `set` to find or cast to — so the writable channel stays with its publisher. `provider.selection` holds explicit record identities with a valid empty state.
26
- - **Provider** — `createDataViewsProvider({ collection, source, location?, history?, views?, presentation?, snapshot?, facets? })`: the one owner a UI binds to. It assembles the coordinator, the selection, the row model and the record typing over the collection, reads the source's `capabilities` once into a frozen copy — one declaration, nothing for the application to keep in step, never null — and drives the ports it is handed itself. Construction reads the location once and starts nothing: no subscription and no request. `observe()` is ref-counted: the first observer adopts the location, starts source execution, the location loop and the saved views, and asks for a page when nothing is pending after that — the first page from idle, or the current one again after a problem, while ready rows nothing ran — drawn before hydrating, or left by a released observation — are taken up without a new request; the last release stops all of it, and the next observer starts it again. Every mount that reads the provider calls `observe()` in an effect, so two roots on one provider do not race, a rehearsal mount and unmount leaves a working provider, and a server render — which runs no effect — subscribes to nothing. There is no `dispose`. Its commands — `navigateWindow`, `setSort`, `setSearch`, `setGroup`, `setCollapsed` — each answer with the refusals the query would incur, empty when applied: a command the source cannot execute is refused at the boundary and publishes nothing, requests nothing and writes nothing. `refusals(query)` is the same check for a control deciding what to offer; `runAction(request)` runs a declared action over the given identities or the selection and resolves with the settled `ActionRun`; `refresh()` asks again, and while nothing observes the provider — on a server, or in a browser before hydration — it reads the source within the call through `readDelivery`, starting and subscribing to nothing, so a source that can answer from what it holds, as the array source does, has published its page and a render that follows draws rows, while one that cannot leaves the request pending for the first observer; `readSnapshot()` hands the collection over as one serialisable `DataViewsSnapshot` — the query and its window as canonical text, and the arrangement in force, never the selection — which a server embeds in the page for the client's provider to start from through `snapshot`, which an application keeps to put a collection back, and of which every saved view is one; `reset()` begins the next generation, returning to the snapshot's query with no saved view open. What the ports and the framework bindings drive — adopt, complete, the predicate commands, the record-type readers, the transitions the location loop hears, `spellQuery` for the destination a link or a form leads to, and the read side of the location — lives on the internal `ProviderHost`, reached through `readProviderHost` on `./bindings` and by nothing an application writes.
26
+ - **Provider** — `createDataViewsProvider({ collection, source, location?, history?, views?, presentation?, snapshot?, facets? })`: the one owner a UI binds to. It assembles the coordinator, the selection, the row model and the record typing over the collection, reads the source's `capabilities` once into a frozen copy — one declaration, nothing for the application to keep in step, never null — and drives the ports it is handed itself. Construction reads the location once and starts nothing: no subscription and no request. `observe()` is ref-counted: the first observer adopts the location, starts source execution, the location loop and the saved views, and asks for a page when nothing is pending after that — the first page from idle, or the current one again after a problem, while ready rows nothing ran — drawn before hydrating, or left by a released observation — are taken up without a new request; the last release stops all of it, and the next observer starts it again. Every mount that reads the provider calls `observe()` in an effect, so two roots on one provider do not race, a rehearsal mount and unmount leaves a working provider, and a server render — which runs no effect — subscribes to nothing. There is no `dispose`. Its commands — `navigateWindow`, `setSort`, `setSearch`, `clear`, `setGroup`, `setCollapsed` — each answer with the refusals the query would incur, empty when applied: a command the source cannot execute is refused at the boundary and publishes nothing, requests nothing and writes nothing. `clear(paths)` empties the filter, the search or both in one transition. `listRefusals(query)` is the same check for a control deciding what to offer; `runAction(request)` runs a declared action over the given identities or the selection and resolves with the settled `ActionRun`; `refresh()` asks again, and while nothing observes the provider — on a server, or in a browser before hydration — it reads the source within the call through `readDelivery`, starting and subscribing to nothing, so a source that can answer from what it holds, as the array source does, has published its page and a render that follows draws rows, while one that cannot leaves the request pending for the first observer; `readSnapshot()` hands the collection over as one serialisable `DataViewsSnapshot` — the query and its window as canonical text, and the arrangement in force, never the selection — which a server embeds in the page for the client's provider to start from through `snapshot`, which an application keeps to put a collection back, and of which every saved view is one; `reset()` begins the next generation, returning to the snapshot's query with no saved view open. What the ports and the framework bindings drive — adopt, complete, the predicate commands, the record-type readers, the transitions the location loop hears, `spellQuery` for the destination a link or a form leads to, and the read side of the location — lives on the internal `ProviderHost`, reached through `readProviderHost` on `./bindings` and by nothing an application writes.
27
27
  - **Messages** — `DataViewsMessages`, the record of every word a framework binding renders or announces — statuses, summaries, control names, announcements and hints — typed so a whole replacement misses none, and shipped in English, its plurals and ordinals worded through the platform's English rules. A binding resolves an application's messages over English with `resolveMessages` (from `./bindings`), so every binding speaks the same words. Field and option labels are the application's data, not messages.
28
28
  - **Location** — the `QueryLocation` port plus `createMemoryLocation` (local/secondary collections, fixture harness) and `createPlatformLocation` (over a host platform surface such as a router's platform adapter — repeated query parameters survive every read and write). Handed to the provider, it is the live query authority.
29
- - **Wire grammar** — `encodeQuery`/`decodeQuery`: the flat, form-compatible spelling of a query as URL parameters (`status=failed&status=cancelled`, `status__isNone=ready`, `cpu__gte=4`, `owner__isSet=1`, `name__contains=web`, `name__startsWith=api`, `q=yak`, `sort=updated__desc`, `group=status`, `page=2&size=50&cursor=…`). `isAny` is written as the bare field name; `status__isAny=failed` is read as the same predicate, its operands joined to any the bare spelling carries, and written back bare. Values are parsed to their field's own type, operators are checked against the field's kind, and — given the source's capabilities — clauses the source cannot execute are refused too; every refused clause is left out of the query and reported by parameter. Parameters naming no field of the collection are the host's and survive untouched. A host builds its own links, such as no-JS pagination destinations, with `encodeQuery` and the parameters it wants preserved. Given a null window, `encodeQuery` writes the query alone — the text a saved view stores.
30
- - **The location loop** — owned by the provider. The provider reads the location once when it is built, decoded as the loop decodes it, so it stands on the location's query — with its refused clauses on `issues` — before anything observes, and a server render carries it; nothing is subscribed or requested then. The saved view a location has open travels beside the query as `view=<id>`: read with the query at construction, written first in every spelling the loop writes, and moved with the query in one transition, so opening a view is one entry of history and reverting to it, or leaving it, respells that entry in place. `view` asks the source for nothing and never marks the view modified; on load the saved views open the view it names once they are listed, and an id no stored view answers to loses its identity, never the query. On the first `observe()` the location is adopted before anything else runs, so the first request is the location's query and never the snapshot's query followed by a second fetch. After that the loop is driven by the transitions the provider announces, each carrying its cause and the history mode it deserves: search replaces, so typing never floods history; a filter, a sort, a grouping, a window move and a saved view opened push an entry Back returns from; a canonical respelling replaces; adopting the location writes nothing back; collapse has no spelling. `history` on the provider config overrides that — one mode for every transition, or a record per transition (`{ search: "push" }`). The loop keeps the spellings it wrote whose echo it has not heard, in the order it wrote them, to recognise its own echoes — a notification of one lands every write before it too, and where the location stands as the loop subscribes is no move; any other notification — Back, Forward, a pasted URL — is read: its refusals are reported on `provider.issues` with their codes, its query adopted if it differs, its spelling made canonical in place. A location carrying no query takes the snapshot's query; one carrying a clause the grammar, the schema or the source refused is left standing, so the error survives a reload instead of quietly being rewritten to a broader query. Without a location, `issues` reports what the snapshot's query was refused for, and nothing otherwise; with a location carrying no query, those refusals stay reported while neither the provider's query nor the location has moved since — a reset is such a move, and any other transition over the same query — a saved view opened, reverted to or left, a group collapsed — is not. A provider given no views reads a `view=<id>` the location carries as no view, and spells it out of the location.
29
+ - **Wire grammar** — `encodeQuery`/`decodeQuery`: the flat, form-compatible spelling of a query as URL parameters (`status=failed&status=cancelled`, `status__isNone=ready`, `cpu__gte=4`, `owner__isSet=true`, `name__contains=web`, `name__startsWith=api`, `q=yak`, `sort=updated__desc`, `group=status`, `page=2&size=50&cursor=…`). `isAny` is written as the bare field name; `status__isAny=failed` is read as the same predicate, its operands joined to any the bare spelling carries, and written back bare. A further conjunct takes an ordinal, `tags__isAny__1`; the first keeps its old spelling. Values are parsed to their field's own type, operators are checked against the field's kind, and — given the source's capabilities — clauses the source cannot execute are refused too; every refused clause is left out of the query and reported by parameter, with the field it addresses — a filter's field, or null for every other parameter. A key spelled `name__operator` with one of the grammar's operators is a filter even when the collection declares no such field — one since removed — and is refused as `undeclared-field`. Every other parameter naming no field of the collection is the host's and survives untouched. A host builds its own links, such as no-JS pagination destinations, with `encodeQuery` and the parameters it wants preserved. Given a null window, `encodeQuery` writes the query alone — the text a saved view stores. Presence is spelled `true` or `false`, and `owner__isSet=1` still reads as `true`.
30
+ - **The location loop** — owned by the provider. The provider reads the location once when it is built, decoded as the loop decodes it, so it stands on the location's query — with its refused clauses on `issues` — before anything observes, and a server render carries it; nothing is subscribed or requested then. The saved view a location has open travels beside the query as `view=<id>`: read with the query at construction, written first in every spelling the loop writes, and moved with the query in one transition, so opening a view is one entry of history and reverting to it, or leaving it, respells that entry in place. `view` asks the source for nothing and never marks the view modified; on load the saved views open the view it names once they are listed, and an id no stored view answers to loses its identity, never the query. On the first `observe()` the location is adopted before anything else runs, so the first request is the location's query and never the snapshot's query followed by a second fetch. After that the loop is driven by the transitions the provider announces, each carrying its cause and the history mode it deserves: search replaces, so typing never floods history; a filter, a sort, a grouping, a window move and a saved view opened push an entry Back returns from; a canonical respelling replaces; adopting the location writes nothing back; collapse has no spelling. `history` on the provider config overrides that — one mode for every transition, or a record per transition (`{ search: "push" }`). The loop keeps the spellings it wrote whose echo it has not heard, in the order it wrote them, to recognise its own echoes — a notification of one lands every write before it too, and where the location stands as the loop subscribes is no move; any other notification — Back, Forward, a pasted URL — is read: its refusals are reported on `provider.issues` with their codes, its query adopted if it differs, its spelling made canonical in place. A location carrying no query takes the snapshot's query; one carrying a clause the grammar, the schema or the source refused is left standing, so the error survives a reload instead of quietly becoming a broader query. A refused clause that narrows the result — a filter on a field, declared or not, or the search `q`, as `isNarrowingIssue` from `./bindings` reads it — withholds the whole query: no request is sent while it stands, one in flight is obsolete, the rows shown stay as `stale`, and with none the status is `refused`. The result's `problem` is then `{ status: "refused", issues }`: the envelope's refusal, carrying the link's clauses with their codes in place of a source's refusals, and `refresh()` asks for nothing. Every later spelling the loop writes, and every destination `spellQuery` spells — a sort link, a page link, a form's hidden fields — carries the refused parameters as the link spelled them, so changing the sort does not quietly drop `status=melted`; a key refused for some of its values keeps them beside the values written, and keeps only the values the applied query did not supply. A destination that changes a field's predicates, or the search, replaces that refused clause, as the command leading there would, and carries none of it. A clause the source cannot execute is reported under each key that spelled it, so `status__isAny` is carried and cleared as the link holds it. A filter set or removed on the clause's field — the search for a refused `q` — replaces it, a reset removes them all, and the host's `clearRefused(parameter)` removes one parameter from the location, as the link to the URL without it does. A refused ordering, window, grouping or view narrows nothing: it falls back to its default, is reported, and does not withhold. Without a location, `issues` reports what the snapshot's query was refused for, and nothing otherwise; with a location carrying no query, those refusals stay reported while neither the provider's query nor the location has moved since — a reset is such a move, and any other transition over the same query — a saved view opened, reverted to or left, a group collapsed — is not. A provider given no views reads a `view=<id>` the location carries as no view, and spells it out of the location.
31
31
  - **Writing a location adapter** — `QueryLocation` is three functions, and the provider touches the URL through nothing else, so a router other than `@canonical/router-core` needs only an adapter over its own history. In outline, over a history object with `location`, `push`, `replace` and `subscribe` — the shape TanStack Router's and React Router's histories share:
32
32
 
33
33
  ```ts
@@ -52,15 +52,15 @@ Under active development; both DataViews packages are unpublished, so the surfac
52
52
  ```
53
53
 
54
54
  The adapter must let one write reach its own subscribers at most once; the provider recognises the echo by the spelling it wrote and tolerates a router that never echoes, or applies a write after the call returns, provided it notifies as each write lands. Writes land in the order they were made; a write landing after one made later is read as the reader's move. A write must land as it was spelled — its parameters in the order and encoding given — or the provider respells it without end. A router must not drop a write silently: one it skips or abandons notifies of where the location then stands, or throws. A framework whose navigation is a function rather than a history object adapts the same way: `read` from its current URL, `write` through its navigate with its replace flag, `subscribe` through its location listener.
55
- - **Filter records** — per mounted root, not per provider: `createFilterInputs({ host })` from `./bindings` builds one `FilterHandle` per field and legal operator, editing the provider's query through its host. Two roots on one provider share the applied query and never each other's half-typed input. An invalid or incomplete edit keeps the applied predicate; an edit the source refuses keeps it too, with the coded refusals in the feedback; explicit `clear` is distinct from an empty edit.
55
+ - **Filter records** — per mounted root, not per provider: `createFilterInputs({ host })` from `./bindings` builds one `FilterHandle` per field and legal operator, editing the provider's query through its host. Two roots on one provider share the applied query and never each other's half-typed input. A typed value — text, a number or a date — edits in one input session: its first change that moves the query enters history as the filter transition's mode says — push by default — and every later change in the session replaces that entry, so typing a value is one step of history. Typing back to the value applied before the session began still leaves that one entry, identical to the one before it, so Back takes one step more than it seems to need; stepping back through history instead needs a location that can move back, which the location port does not offer yet. An edit that reads as what is applied moves nothing and starts no session. The session ends on the records' `endSessions()`, which a binding calls when the reader leaves the input or submits its form, on a discrete `set` or a `clear`, and on Back, Forward or a pasted URL, which also drops whatever was being typed. An invalid or incomplete edit keeps the applied predicate; an edit the source refuses keeps it too, with the coded refusals in the feedback; explicit `clear` is distinct from an empty edit. A handle publishes its own `nth` and the `others`.
56
56
  - **Action run** — `provider.runAction` resolves with one: targets and the selection revision are captured immutably when the run begins so later selection changes never retarget execution; each target settles once; successful targets leave the selection and failures stay for review.
57
57
  - **Query coordinator** — owned by the provider: addressed commands as coherent query+window transitions (a query change resets the page), request identities whose superseded completions are ignored, atomic publication of rows, group summaries, counts, cursors and provenance, the generation `reset()` begins, and `adopt` for externally authoritative state such as back/forward navigation. Provenance is the request the coordinator issued — the slice and window the rows answer — never anything the source says about them. A refusal or failure over retained rows reports `refresh-failed` while those rows still answer the current query, so a failed refresh is never silent; over rows an earlier query produced it reports `stale`; with no rows at all it reports `failed`.
58
58
  - **Rows** — `provider.rows`, the ordered model of one result, keyed by each record's stable identity rather than its position, carrying unchanged entries across reorders and republications, and answering with a result rather than throwing, so an ambiguous identity fails the completion the rows arrived in instead of the call that built them; `createRowScopes` (from `./bindings`): one observation scope per row identity, shared by every cell of that row, with a channel per observed field so an unchanged value never notifies its cell.
59
- - **Geometry** (from `./bindings`) — `resolveColumns`: fixed columns reserve their declared width, flexible ones share what is left by weight until capped, and declared widths survive an overflow (the container scrolls); `createColumnLayout({ columns, presentation })`: a table's derived view over the presentation — the widths it holds, clamped to the declared bounds, as fixed overrides, with a resize written back through it; `createGridInteraction`: one clamped live resize preview that never touches the authority until it commits; `buildColumnTemplate`: the resolved geometry as the one CSS track list a renderer publishes.
60
- - **Writing a source** — `declareCapabilities(collection, declaration)` builds the complete frozen capability record a source publishes, typed against the collection's schema: a filter operator is checked per field kind, so `status: ["gte"]` on a `choices` field does not compile, and a member left out is refused — no filter on that field, no search, no sort, counts unknown, no actions, no facets. A facet is what a source computes over every record the query matches, with that field's own predicates lifted so the other values keep their counts: for a `choices` or `flag` field each value held with its count, for a `number` or `date` field the least and greatest value. A source declares the fields it computes facets for, the provider's `facets` names the ones every request asks for — throwing for one the source does not declare, and for a filterable `choices` field whose options are the server's and whose facet it leaves out — and the page answers them, on `result.facets`. `readSlice(collection, slice)` reads a request's slice by field, typed from the schema — a field whose kind accepts several operators as a record keyed by operator: a `choices` filter as its `isAny` and `isNone` sets, a number or date filter as its bounds, a text filter as the text it `contains` and `startsWith`; a flag as `true` — plus the search text and the ordered sort terms — so an adapter finds the status filter by name instead of scanning predicates. `createPage({ rows, matched, total, more, cursors, facets })` builds the envelope: a count given is exact, a count left out is unknown, and the pageable count is the matched count while nothing collapses rows out of a page.
61
- - **Sources** — the provider runs its source against the coordinator's request lifecycle: it executes exactly the newest request identity, drops completions from released or superseded executions, refuses — before execution, so a refusal costs no round trip — a request the source has not declared support for, holds every count to what the declaration allows, and republishes a later delivery of the same query under a fresh identity so retained rows never carry another request's provenance. A source may also implement `readDelivery(request)`: the delivery it can give within the call from what it already holds, or null when it would have to wait. A provider nothing observes reads it when `refresh()` is called — on a server, or before hydration — and starts nothing; the array source always answers, and a source without it stays pending until the provider is observed. Taking up rows already drawn still executes their request once, so the source follows later changes: a source that answers it from what it holds, as the array source does, costs no round trip, and a remote one without a cache fetches the page on screen again. `createDataViewsProvider` throws when a declared capability has no port to serve it, so a declaration is never a promise the source cannot keep. `createArraySource` is the default and recommended source — complete local input, so all three of its counts are exact rather than one loaded page's. It takes the `collection`, filters each field with the operators its kind accepts, orders by every schema field, runs `defaultSort` when a query states no term of its own, orders each field's empty values `first` or `last` as `empties` places them, and collates text at the root locale with numeric ordering unless `collation` names another tag. `createQuerySource` runs over an observable query client such as TanStack Query, reached through a structural observer surface so no query library is imported here or forced on consumers. `createRelaySource` runs over a forward-paginating Relay connection through a structural environment surface that Relay's own `Environment` satisfies: each request retains its operation, delivers a page already in the store at once, fetches it, and follows every later store change — a mutation or a local update — so Relay's store stays the only cache. It pages forward from each page's end cursor or from a token the window carries, and refuses — structurally, with `code: "unreachable-page"` — a page it can reach neither way, as after a reload onto page three, instead of inventing one. The query pages by its own `first` and `after` arguments: one paging through `@connection` is refused, since Relay merges such a connection's pages into one list. A missing `totalCount` counts nothing, never zero, and a page with a missing record fails rather than being delivered shorter. A control reads `provider.refusals(query)` before offering a destination — it composes the declaration's check with the source's own, which the declaration cannot express — and `provider.capabilities` is the frozen copy of the declaration, for a source whose own object was never frozen.
59
+ - **Geometry** (from `./bindings`) — `resolveColumns`: fixed columns reserve their declared width, flexible ones share what is left by weight until capped, and declared widths survive an overflow (the container scrolls); `createColumnLayout({ table, columns, presentation })`: a table's derived view over the presentation — the widths it holds, clamped to the declared bounds, as fixed overrides, with a resize written back through it; `createGridInteraction`: one clamped live resize preview that never touches the authority until it commits; `buildColumnTemplate`: the resolved geometry as the one CSS track list a renderer publishes.
60
+ - **Writing a source** — `declareCapabilities(collection, declaration)` builds the complete frozen capability record a source publishes, typed against the collection's schema: a filter operator is checked per field kind, so `status: ["gte"]` on a `choices` field does not compile, and a member left out is refused — no filter on that field, no search, no sort, counts unknown, no actions, no facets. `listOfferedOperators(definition, capabilities)`, from `./bindings`, lists the operators a control may offer on one field. A facet is what a source computes over every record the query matches, with that field's own predicates lifted so the other values keep their counts: for a `choices` or `presence` field each value held with its count, for a `number` or `date` field the least and greatest value. A source declares the fields it computes facets for, the provider's `facets` names the ones every request asks for — throwing for one the source does not declare, and for a filterable `choices` field whose options are the server's and whose facet it leaves out — and the page answers them, on `result.facets`. `readSlice(collection, slice)` reads a request's slice by field, typed from the schema — a field whose kind accepts several operators as a record keyed by operator: a `choices` filter as its `isAny` and `isNone` sets, a number or date filter as its bounds, a text filter as its text under each of its operators; a presence field as `true` or `false` — plus the search text and the ordered sort terms — so an adapter finds the status filter by name instead of scanning predicates. `createPage({ rows, matched, more, cursors, facets })` builds the envelope: a count given is exact, a count left out is unknown, and the pageable count is the matched count while nothing collapses rows out of a page.
61
+ - **Sources** — the provider runs its source against the coordinator's request lifecycle: it executes exactly the newest request identity, drops completions from released or superseded executions, refuses — before execution, so a refusal costs no round trip — a request the source has not declared support for, holds every count to what the declaration allows, and republishes a later delivery of the same query under a fresh identity so retained rows never carry another request's provenance. A source may also implement `readDelivery(request)`: the delivery it can give within the call from what it already holds, or null when it would have to wait. A provider nothing observes reads it when `refresh()` is called — on a server, or before hydration — and starts nothing; the array source always answers, and a source without it stays pending until the provider is observed. Taking up rows already drawn still executes their request once, so the source follows later changes: a source that answers it from what it holds, as the array source does, costs no round trip, and a remote one without a cache fetches the page on screen again. `createDataViewsProvider` throws when a declared capability has no port to serve it, so a declaration is never a promise the source cannot keep. `createArraySource` is the default and recommended source — complete local input, so both of its counts are exact rather than one loaded page's. It takes the `collection`, filters each field with the operators its kind accepts, orders by every schema field, runs `defaultSort` when a query states no term of its own, orders each field's empty values `first` or `last` as `empties` places them, and collates text at the root locale with numeric ordering unless `collation` names another tag. `createQuerySource` runs over an observable query client such as TanStack Query, reached through a structural observer surface so no query library is imported here or forced on consumers. `createRelaySource` runs over a forward-paginating Relay connection through a structural environment surface that Relay's own `Environment` satisfies: each request retains its operation, delivers a page already in the store at once, fetches it, and follows every later store change — a mutation or a local update — so Relay's store stays the only cache. It pages forward from each page's end cursor or from a token the window carries, and refuses — structurally, with `code: "unreachable-page"` — a page it can reach neither way, as after a reload onto page three, instead of inventing one. The query pages by its own `first` and `after` arguments: one paging through `@connection` is refused, since Relay merges such a connection's pages into one list. A missing `totalCount` counts nothing, never zero, and a page with a missing record fails rather than being delivered shorter. Both network sources take an optional `isForbidden(error)`: an error it answers true for — a 401 or a 403, as the application reads its client's errors — is delivered as `{ status: "forbidden", cause }`, with no reason, since a server's words about permissions are not rendered; a check that throws leaves the error a failure. A forbidden delivery withdraws every row, count and facet, even rows kept from before, and the table's status is `no-access`, announced once: "You do not have permission to see these rows." Filters, search and the sort stay operable, and a change asks again; the selection, which holds ids, is left alone. A control reads `provider.listRefusals(query)` before offering a destination — it composes the declaration's check with the source's own, which the declaration cannot express — and `provider.capabilities` is the frozen copy of the declaration, for a source whose own object was never frozen.
62
62
 
63
- Rows are opaque to the core: sources execute request identities and deliver one envelope per page — rows, group summaries, three counts each carrying its own exactness, whether more exists, and page cursors — and they own transport, cache, retry and invalidation through the application's existing query library — this package never runs a competing one. Nothing here knows a data source, a router or the DOM.
63
+ Rows are opaque to the core: sources execute request identities and deliver one envelope per page — rows, group summaries, two counts each carrying its own exactness, whether more exists, and page cursors — and they own transport, cache, retry and invalidation through the application's existing query library — this package never runs a competing one. Nothing here knows a data source, a router or the DOM.
64
64
 
65
65
  ## Ordering
66
66
 
@@ -71,7 +71,7 @@ Local execution compares each term through its field's kind:
71
71
  - **text** through an `Intl.Collator` at the locale the *source* declares — the root collation with numeric ordering by default, so `item2` precedes `item10` — never the viewer's, so a server render, a local execution and a shared link agree. A tag the runtime has no data for would resolve to the viewer's locale, so text compares by digit runs instead — numbers numerically, everything else by code point — which is the same everywhere; so does a runtime with no collator at all. A tag that is not well formed names no collation, and text compares by code unit. An empty string carries nothing to order by, so a blank cell goes with the empties rather than ahead of every name;
72
72
  - **choices** by declared option index, so a status column reads as its lifecycle rather than alphabetically; a value the options do not list orders after every one they do;
73
73
  - **date** as instants, so a calendar-date string, an ISO-8601 string with `Z` or an offset, a `Date` and epoch milliseconds interleave chronologically. A time of day carrying no offset has no instant: ECMA-262 reads it as local time, which orders one way on a server and another in a browser;
74
- - **flag** false before true, anything present counting as set;
74
+ - **presence** unset before set, anything but an absent or null value counting as set: `false` and `true` tie, so the next term or the tiebreak orders them. A presence field has no empty value, so only a row of a record type it does not apply to orders with the empties;
75
75
  - **number** numerically.
76
76
 
77
77
  A value the kind has none of — absent, null, a blank cell, or outside its domain — orders after every value that has one, **in both directions**: a reader sorting a column is asking for its values, and the direction is about them. A source whose backend puts them first says so per field in `empties`, and they then order before every value, in both directions alike.
@@ -108,7 +108,7 @@ A REST-backed store is the application's own: it implements the same `ViewStore`
108
108
 
109
109
  ## Presentation
110
110
 
111
- The presentation is what a renderer shows and how — column widths, column order and which columns are hidden — and `provider.presentation` is its one authority: every table on a provider reads the arrangement in force from it and writes a resize to it, so two tables never disagree on a width and a view opened re-arranges them all. It exists on every provider. The arrangement is layered, lowest first and merged key by key: the columns' declared defaults (their sizing and order, every column shown — the renderer's, and beneath everything stored); the viewer's default arrangement; the arrangement the open view was saved with; and the viewer's own changes to that view. A change writes the viewer's own layer — the open view's preferences, or the default arrangement while none is open — so a view stays as it was saved for whoever opens it next; save-as snapshots the arrangement in force into the new view, save writes the query alone, and "modified" never counts the arrangement.
111
+ The presentation is what a renderer shows and how — column widths, column order and which columns are hidden — and `provider.presentation` is its one authority: each table keeps its arrangement in it under its own id, and a view opened re-arranges them all. It exists on every provider. The arrangement is layered, lowest first and merged key by key: the columns' declared defaults (their sizing and order, every column shown — the renderer's, and beneath everything stored); the viewer's default arrangement; the arrangement the open view was saved with; and the viewer's own changes to that view. A change writes the viewer's own layer — the open view's preferences, or the default arrangement while none is open — so a view stays as it was saved for whoever opens it next; save-as snapshots the arrangement in force into the new view, save writes the query alone, and "modified" never counts the arrangement.
112
112
 
113
113
  Where the viewer's layers live is the `presentation` store, a small record-per-key contract of its own — `PresentationStore`, exported from the root:
114
114
 
@@ -122,7 +122,7 @@ type PresentationStore = {
122
122
 
123
123
  An implementation guarantees that `readPresentation` resolves the keys stored at the target, empty for a view that does not exist; that `patchPresentation` applies every key of the patch atomically with the last committed write winning for one key only, so patches of different keys never overwrite each other, and a key patched to `undefined` is removed; that `patchPresentation` resolves `missing` for a view the store does not have, whereupon the presentation drops that view's changes and retries nothing; that storage failures reject and never resolve as saved; and that `subscribe` hears every change, here or in another tab, before the write that made it resolves, so a read begun after a write was called sees it. The IndexedDB store implements it; an application may pass a `localStorage`-backed store or its own server preferences instead, or nothing — then the presentation lives in memory for the session, over the same record and with the same behaviour, and nothing claims it was saved.
124
124
 
125
- Changes apply at once and are written behind, batched per target and flushed when the last observer releases; a change not yet sent when a read began, or whose write failed, wins over that read, and a failed write is reported on `presentationReason` and retried by `refresh()`. The table keys — `table.width.<column id>`, `table.order` (a list of column ids) and `table.hidden` (a list of column ids) — are read by `resolveColumnArrangement` on `./bindings`: an id naming no declared column is ignored, a declared column the order does not name keeps its declared place, a column declared not hideable is never hidden, and at least one column stays visible.
125
+ Changes apply at once and are written behind, batched per target and flushed when the last observer releases; a change not yet sent when a read began, or whose write failed, wins over that read, and a failed write is reported on `presentationReason` and retried by `refresh()`. The table keys — `table.<id>.width.<column id>`, `table.<id>.order` and `table.<id>.hidden` (lists of column ids), `<id>` URI-encoded (`a.b` gives `table.a%2Eb.order`, `order` gives `table.%6Frder.order`) — are read by `resolveColumnArrangement(table, columns, presentation)` on `./bindings`: an id naming no declared column is ignored, a declared column the order does not name keeps its declared place, a column declared not hideable is never hidden, and at least one column stays visible.
126
126
 
127
127
  ## Records of several types
128
128
 
@@ -166,25 +166,25 @@ export const instances = createCollection({
166
166
  empty. It satisfies no predicate, `isSet` included, and reads as absent to
167
167
  ordering, so filtering on a scoped field restricts the result to that field's
168
168
  types by meaning: nothing is added to the query, the URL or a saved view.
169
- The host's `applicability(field, row)` answers which state a cell is in, for
169
+ The host's `readApplicability(field, row)` answers which state a cell is in, for
170
170
  the binding that draws it. This rests on the source writing no value at a
171
171
  scoped key for a row the field does not apply to — the source's obligation,
172
172
  not something checked here.
173
173
  - **Identities stay opaque strings**, unique across types within the
174
174
  provider's scope and minted by the source, which prefixes with the type only
175
175
  where its own backend's identities collide. The UI never parses one.
176
- - **Type memory.** The host's `recordType(id)` answers the type of a selected
176
+ - **Type memory.** The host's `readRecordType(id)` answers the type of a selected
177
177
  identity, taken while the row was displayed and kept until the rows are next
178
178
  replaced after it leaves the selection, so an action's applicability to
179
179
  records selected on an earlier page is decidable without a lookup. The row on display always
180
- answers for itself, so this never contradicts `applicability`, and
180
+ answers for itself, so this never contradicts `readApplicability`, and
181
181
  it changes only with a `rows` or a `selection` publication. An identity a
182
182
  host restored over rows this provider never modelled while they were
183
183
  selected answers null: not loaded, never assumed.
184
184
 
185
185
  **A monomorphic collection declares no `discriminator`, and none of this
186
- reaches it.** `collection.types` is null, `applicability` answers `"applies"`
187
- for every field, `recordType` answers null, no row is ever read for a type,
186
+ reaches it.** `collection.types` is null, `readApplicability` answers `"applies"`
187
+ for every field, `readRecordType` answers null, no row is ever read for a type,
188
188
  and nothing costs anything.
189
189
 
190
190
  ## Words this package uses twice
@@ -208,3 +208,11 @@ import { createVirtualRange } from "@canonical/dataviews-core/virtualization";
208
208
  ```
209
209
 
210
210
  The range works over `listDisplayEntries`, from `./bindings`: the entries a table body displays, in order — its status row, then a row per record — each with an id unique across kinds and its logical row position, the header row being 1. It is arithmetic over estimated and measured entry sizes, keyed by entry id: a binding reports the viewport and the measurements, and scrolls by the corrections the range returns. React applications use `virtualizeRows` from `@canonical/dataviews-react/virtualization` rather than the range itself.
211
+
212
+ ## Test doubles
213
+
214
+ Framework bindings test against the same doubles as the core. They are experimental, from their own entry point:
215
+
216
+ ```ts
217
+ import { createManualSource } from "@canonical/dataviews-core/testing";
218
+ ```
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Return a value the code has proved is there, or throw: a null or
3
+ * undefined here is a broken invariant, never a case to handle.
4
+ *
5
+ * @experimental Pre-release: the whole surface is still settling, and this
6
+ * name may change or move before the first release.
7
+ */
8
+ export default function assertInvariant(value, message) {
9
+ if (value === null || value === undefined) {
10
+ throw new Error(`invariant broken: ${message}`);
11
+ }
12
+ return value;
13
+ }
14
+ //# sourceMappingURL=assertInvariant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertInvariant.js","sourceRoot":"","sources":["../../../../src/lib/assertion/assertInvariant.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,KAA2B,EAC3B,OAAe;IAEf,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,qBAAqB,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as assertInvariant } from "./assertInvariant.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/assertion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,28 +1,14 @@
1
- /**
2
- * The machinery every framework binding shares and no application calls:
3
- * the column geometry a table solves, the arrangement it places its columns
4
- * by and the changes that hide, show, move and reset them, the row channels
5
- * a body renders from, the table's status, the entries of its body and the
6
- * pagination facts a bar offers — each projected from the published state —
7
- * the filter records a root builds, the check a binding tells a provider
8
- * by, the provider's internal host, the query transition a command makes
9
- * with the command and its result, the list comparison, the comparison of
10
- * one field's facet, the ordering in force and the next one a header's activation, or its menu's choice, leads
11
- * to, the wire key a form control is named by, and the parameters a link
12
- * carries an arrangement in, and the words a root speaks — the application's
13
- * messages over the English record. React uses it now; a Svelte binding
14
- * would use the same names rather than solve its own geometry or word its
15
- * own English.
16
- */
1
+ /** Shared machinery for framework bindings; no application calls it. */
2
+ export { assertInvariant } from "../assertion/index.js";
17
3
  export { areDisplayStatusesEqual, DISPLAY_STATUS_PHASES, listDisplayEntries, resolveDisplayStatus, resolvePagination, } from "../display/index.js";
18
4
  export { createFilterInputs } from "../filter/index.js";
19
5
  export { areSizingsEqual, buildColumnTemplate, createColumnLayout, createGridInteraction, readSizingBounds, resolveColumns, } from "../geometry/index.js";
20
6
  export { resolveMessages } from "../messages/index.js";
21
- export { hideColumn, moveColumn, resetColumnArrangement, resolveColumnArrangement, showColumn, spellColumnArrangement, } from "../presentation/index.js";
7
+ export { createMemoryPresentation, hideColumn, moveColumn, resetColumnArrangement, resolveColumnArrangement, showColumn, spellColumnArrangement, } from "../presentation/index.js";
22
8
  export { isDataViewsProvider, readProviderHost } from "../provider/index.js";
23
- export { applyQueryCommand, areListsEqual, cycleSortTerm, placeSortTerm, } from "../query/index.js";
9
+ export { applyQueryCommand, areListsEqual, canonicalizeSlice, cycleSortTerm, listConjuncts, placeSortTerm, } from "../query/index.js";
24
10
  export { areFieldFacetsEqual } from "../result/index.js";
25
11
  export { createRowScopes } from "../rows/index.js";
26
- export { resolveEffectiveOrdering } from "../source/index.js";
27
- export { spellWireKey } from "../wire/index.js";
12
+ export { foldText, listOfferedOperators, resolveEffectiveOrdering, } from "../source/index.js";
13
+ export { isNarrowingIssue, QUERY_KEYS, spellWireKey, spellWireValues, } from "../wire/index.js";
28
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/bindings/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAcxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQvD,OAAO,EACL,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,EACV,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAOzD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/bindings/index.ts"],"names":[],"mappings":"AAAA,wEAAwE;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAcxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQvD,OAAO,EACL,wBAAwB,EACxB,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,EACV,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAOzD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,eAAe,GAChB,MAAM,kBAAkB,CAAC"}
@@ -1,5 +1,7 @@
1
1
  import { applyQueryCommand, DEFAULT_WINDOW, EMPTY_SLICE, rejectWindow, spellQueryKey, spellSliceKey, } from "../query/index.js";
2
2
  import { areFacetsEqual } from "../result/index.js";
3
+ import { areQueryIssuesEqual } from "../wire/index.js";
4
+ import isClauseReplaced from "./isClauseReplaced.js";
3
5
  /** Monotonic instance key: exact cross-instance distinctness, no
4
6
  * environment requirements. */
5
7
  let coordinatorInstances = 0;
@@ -75,6 +77,11 @@ export default function createQueryCoordinator(config = {}) {
75
77
  * against it, and dropped whenever the slice moves. */
76
78
  let sliceKey = null;
77
79
  let result = idleResult;
80
+ /**
81
+ * The narrowing clauses the query in force was refused for, or null while
82
+ * nothing is withheld. Set, no request runs for the query.
83
+ */
84
+ let withholding = null;
78
85
  function buildSnapshot() {
79
86
  return Object.freeze({
80
87
  generation,
@@ -90,6 +97,25 @@ export default function createQueryCoordinator(config = {}) {
90
97
  result = next;
91
98
  snapshot = buildSnapshot();
92
99
  };
100
+ /**
101
+ * Withhold the query in force: no request is pending, so one in flight is
102
+ * obsolete and a late completion cannot publish, and the rows shown, if
103
+ * any, stay as `stale` — they answer no query the reader asked for, even
104
+ * one that reads the same once the refused clauses are left out.
105
+ */
106
+ const withhold = (issues) => {
107
+ withholding = Object.freeze([...issues]);
108
+ lastRequestId = null;
109
+ publishedKey = null;
110
+ publish({
111
+ ...result,
112
+ status: result.rows === null ? "failed" : "stale",
113
+ problem: Object.freeze({ status: "refused", issues: withholding }),
114
+ });
115
+ };
116
+ if (config.withheld !== undefined && config.withheld.length > 0) {
117
+ withhold(config.withheld);
118
+ }
93
119
  const beginRequest = (refreshing) => {
94
120
  counter += 1;
95
121
  lastRequestId = `${instanceKey}:r${counter}`;
@@ -116,7 +142,14 @@ export default function createQueryCoordinator(config = {}) {
116
142
  if (applied.status === "rejected") {
117
143
  return { ...applied, requestId: null };
118
144
  }
119
- if (!applied.sliceChanged && !applied.windowChanged) {
145
+ // The refused clauses this command does not replace stand.
146
+ let standing = null;
147
+ let replaced = false;
148
+ if (withholding !== null) {
149
+ standing = withholding.filter((issue) => !isClauseReplaced(command, issue));
150
+ replaced = standing.length !== withholding.length;
151
+ }
152
+ if (!applied.sliceChanged && !applied.windowChanged && !replaced) {
120
153
  return { ...applied, requestId: null };
121
154
  }
122
155
  // The command layer threads the caller's own predicate, sort-term and
@@ -133,35 +166,54 @@ export default function createQueryCoordinator(config = {}) {
133
166
  // command layer's object and always copied.
134
167
  window = copyWindow(applied.window);
135
168
  currentKey = spellQueryKey({ slice, window });
169
+ if (standing !== null && standing.length > 0) {
170
+ withhold(standing);
171
+ return { ...applied, requestId: null };
172
+ }
173
+ withholding = null;
136
174
  const requestId = beginRequest(false);
137
175
  return { ...applied, requestId };
138
176
  },
139
177
  refresh() {
178
+ if (withholding !== null) {
179
+ throw new Error("a withheld query is not asked for again");
180
+ }
140
181
  // Refreshing is the state of rows kept on display while the same
141
182
  // query is asked again; with no rows there is nothing to keep, and
142
183
  // the first page from idle is simply pending.
143
184
  return beginRequest(result.rows !== null);
144
185
  },
145
- adopt(query) {
186
+ adopt(query, withheld) {
146
187
  const copiedSlice = copySlice(query.slice);
147
188
  const copiedWindow = copyWindow(query.window);
148
189
  const nextKey = spellQueryKey({
149
190
  slice: copiedSlice,
150
191
  window: copiedWindow,
151
192
  });
152
- if (nextKey === currentKey) {
193
+ const copiedSliceKey = spellSliceKey(copiedSlice);
194
+ sliceKey ??= spellSliceKey(slice);
195
+ // Unsaid, what is withheld stands while the slice stays: a move of the
196
+ // window alone does not replace a refused clause.
197
+ const standing = withheld ?? (copiedSliceKey === sliceKey ? (withholding ?? []) : []);
198
+ const sameWithholding = withholding === null
199
+ ? standing.length === 0
200
+ : areQueryIssuesEqual(withholding, standing);
201
+ if (nextKey === currentKey && sameWithholding) {
153
202
  return null;
154
203
  }
155
204
  // A move of the window alone keeps the slice it stood on, so what reads
156
205
  // the slice by identity — the facets it answered — sees no new query.
157
- const copiedSliceKey = spellSliceKey(copiedSlice);
158
- sliceKey ??= spellSliceKey(slice);
159
206
  if (copiedSliceKey !== sliceKey) {
160
207
  slice = copiedSlice;
161
208
  sliceKey = copiedSliceKey;
162
209
  }
163
210
  window = copiedWindow;
164
211
  currentKey = nextKey;
212
+ if (standing.length > 0) {
213
+ withhold(standing);
214
+ return null;
215
+ }
216
+ withholding = null;
165
217
  return beginRequest(false);
166
218
  },
167
219
  complete(requestId, completion) {
@@ -183,7 +235,6 @@ export default function createQueryCoordinator(config = {}) {
183
235
  counts: Object.freeze({
184
236
  pageable: page.counts.pageable,
185
237
  matched: page.counts.matched,
186
- total: page.counts.total,
187
238
  }),
188
239
  // The same facets again keep their identity, so what reads them by
189
240
  // identity — a control showing counts — has nothing to redraw.
@@ -204,6 +255,13 @@ export default function createQueryCoordinator(config = {}) {
204
255
  });
205
256
  return true;
206
257
  }
258
+ if (completion.status === "forbidden") {
259
+ // No access withdraws every row, count and facet, even those kept
260
+ // from before: the source has just refused to show them.
261
+ publishedKey = null;
262
+ publish({ ...idleResult, status: "failed", problem: completion });
263
+ return true;
264
+ }
207
265
  // The completion is the problem: re-keying it would put one fact in
208
266
  // two shapes on the surface.
209
267
  publish({
@@ -216,6 +274,7 @@ export default function createQueryCoordinator(config = {}) {
216
274
  reset() {
217
275
  generation += 1;
218
276
  lastRequestId = null;
277
+ withholding = null;
219
278
  slice = startSlice;
220
279
  sliceKey = null;
221
280
  window = startWindow;
@@ -1 +1 @@
1
- {"version":3,"file":"createQueryCoordinator.js","sourceRoot":"","sources":["../../../../src/lib/coordinator/createQueryCoordinator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,WAAW,EAIX,YAAY,EAEZ,aAAa,EACb,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAmB,MAAM,oBAAoB,CAAC;AAWrE;+BAC+B;AAC/B,IAAI,oBAAoB,GAAG,CAAC,CAAC;AAE7B,MAAM,UAAU,GAAuB,MAAM,CAAC,MAAM,CAAC;IACnD,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,SAAS,GAAG,CAAC,KAAY,EAAS,EAAE,CACxC,MAAM,CAAC,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,CACnB,KAAK,CAAC,MAAM,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MAAM,CAAC;wBAClE,CAAC,CAAC,MAAM,CAAC,MAAM;wBACf,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;oBACvC,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,OAAO,EACL,IAAI,CAAC,OAAO,KAAK,IAAI;wBACnB,CAAC,CAAC,IAAI;wBACN,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;4BACZ,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;4BACvB,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;yBAChC,CAAC;oBACR,2DAA2D;oBAC3D,qCAAqC;oBACrC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;oBACvD,OAAO,EAAE,IAAI;iBACd,CAAC,CAAC;gBACH,OAAO,IAAI,CAAC;YACd,CAAC;YACD,oEAAoE;YACpE,6BAA6B;YAC7B,OAAO,CAAC;gBACN,GAAG,MAAM;gBACT,MAAM,EAAE,oBAAoB,EAAE;gBAC9B,OAAO,EAAE,UAAU;aACpB,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QACd,CAAC;QACD,KAAK;YACH,UAAU,IAAI,CAAC,CAAC;YAChB,aAAa,GAAG,IAAI,CAAC;YACrB,KAAK,GAAG,UAAU,CAAC;YACnB,QAAQ,GAAG,IAAI,CAAC;YAChB,MAAM,GAAG,WAAW,CAAC;YACrB,UAAU,GAAG,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YAC9C,YAAY,GAAG,IAAI,CAAC;YACpB,OAAO,CAAC,UAAU,CAAC,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"createQueryCoordinator.js","sourceRoot":"","sources":["../../../../src/lib/coordinator/createQueryCoordinator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB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,GAAG,IAAI,CAAC;YACnB,KAAK,GAAG,UAAU,CAAC;YACnB,QAAQ,GAAG,IAAI,CAAC;YAChB,MAAM,GAAG,WAAW,CAAC;YACrB,UAAU,GAAG,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YAC9C,YAAY,GAAG,IAAI,CAAC;YACpB,OAAO,CAAC,UAAU,CAAC,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,2 +1,4 @@
1
1
  export { default as createQueryCoordinator } from "./createQueryCoordinator.js";
2
+ export { default as isClauseReplaced } from "./isClauseReplaced.js";
3
+ export { default as readWithheld } from "./readWithheld.js";
2
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/coordinator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/coordinator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Whether a command addresses a refused clause, and so replaces it: a
3
+ * predicate set, added or removed on the clause's field, an edit removing
4
+ * or adding a conjunct on it, the search set for a refused `q`, or a clear
5
+ * emptying the part the clause is in — the filter for every filter's
6
+ * clause, the search for `q`. Every other command leaves the clause
7
+ * standing.
8
+ */
9
+ export default function isClauseReplaced(command, issue) {
10
+ switch (command.kind) {
11
+ case "setPredicate":
12
+ case "addPredicate":
13
+ return command.predicate.field === issue.field;
14
+ case "removePredicate":
15
+ return command.field === issue.field;
16
+ case "editPredicates":
17
+ return (command.remove.some((ref) => ref.field === issue.field) ||
18
+ command.add.some((predicate) => predicate.field === issue.field));
19
+ case "setSearch":
20
+ return issue.field === null;
21
+ case "clear":
22
+ return command.paths.includes(issue.field === null ? "search" : "filter");
23
+ default:
24
+ return false;
25
+ }
26
+ }
27
+ //# sourceMappingURL=isClauseReplaced.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isClauseReplaced.js","sourceRoot":"","sources":["../../../../src/lib/coordinator/isClauseReplaced.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,OAAqB,EACrB,KAAiB;IAEjB,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,cAAc,CAAC;QACpB,KAAK,cAAc;YACjB,OAAO,OAAO,CAAC,SAAS,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC;QACjD,KAAK,iBAAiB;YACpB,OAAO,OAAO,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC;QACvC,KAAK,gBAAgB;YACnB,OAAO,CACL,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC;gBACvD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC,CACjE,CAAC;QACJ,KAAK,WAAW;YACd,OAAO,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC;QAC9B,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC5E;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ const NOTHING_WITHHELD = Object.freeze([]);
2
+ /**
3
+ * The refused clauses of a followed link that a state's query is withheld
4
+ * for: the issues its `refused` problem carries, or none while the query
5
+ * runs. Nothing is asked of the source while any stands.
6
+ */
7
+ export default function readWithheld(state) {
8
+ const { problem } = state.result;
9
+ return problem?.status === "refused" && "issues" in problem
10
+ ? problem.issues
11
+ : NOTHING_WITHHELD;
12
+ }
13
+ //# sourceMappingURL=readWithheld.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readWithheld.js","sourceRoot":"","sources":["../../../../src/lib/coordinator/readWithheld.ts"],"names":[],"mappings":"AAGA,MAAM,gBAAgB,GAA0B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,KAA6B;IAE7B,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IACjC,OAAO,OAAO,EAAE,MAAM,KAAK,SAAS,IAAI,QAAQ,IAAI,OAAO;QACzD,CAAC,CAAC,OAAO,CAAC,MAAM;QAChB,CAAC,CAAC,gBAAgB,CAAC;AACvB,CAAC"}
@@ -9,8 +9,9 @@
9
9
  */
10
10
  export const DISPLAY_STATUS_PHASES = Object.freeze({
11
11
  pending: "transient",
12
- regrouping: "transient",
13
12
  failed: "terminal",
13
+ refused: "terminal",
14
+ "no-access": "terminal",
14
15
  "refresh-failed": "terminal",
15
16
  stale: "terminal",
16
17
  "no-data": "terminal",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/lib/display/constants.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAE9B,MAAM,CAAC,MAAM,CAAC;IAChB,OAAO,EAAE,WAAW;IACpB,UAAU,EAAE,WAAW;IACvB,MAAM,EAAE,UAAU;IAClB,gBAAgB,EAAE,UAAU;IAC5B,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,UAAU;IACrB,YAAY,EAAE,UAAU;CACzB,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/lib/display/constants.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAE9B,MAAM,CAAC,MAAM,CAAC;IAChB,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,UAAU;IACnB,WAAW,EAAE,UAAU;IACvB,gBAAgB,EAAE,UAAU;IAC5B,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,UAAU;IACrB,YAAY,EAAE,UAAU;CACzB,CAAC,CAAC"}
@@ -1,7 +1,14 @@
1
1
  /** One problem as the reason shown above or in place of the rows. */
2
- const describeProblem = (problem) => problem.status === "refused"
3
- ? problem.refusals.map((refusal) => refusal.reason).join("; ")
4
- : problem.failure.reason;
2
+ const describeProblem = (problem) => {
3
+ switch (problem.status) {
4
+ case "refused":
5
+ return "issues" in problem
6
+ ? problem.issues.map((issue) => issue.reason).join("; ")
7
+ : problem.refusals.map((refusal) => refusal.reason).join("; ");
8
+ case "failed":
9
+ return problem.failure.reason;
10
+ }
11
+ };
5
12
  /**
6
13
  * What the table says instead of its rows or above them, or null when the
7
14
  * rows speak for themselves. Decided once, from the published state, so
@@ -14,12 +21,23 @@ const describeProblem = (problem) => problem.status === "refused"
14
21
  * rows that still answer the query, whose refresh failed, are shown under
15
22
  * that reason too — saying nothing there would hide the failure entirely.
16
23
  * The coordinator has already told the two apart; this reads its answer.
24
+ * A refused query — a followed link's clause that would have narrowed it,
25
+ * or a query the source cannot execute — is `refused` with no rows, for
26
+ * nothing ran; `failed` means execution failed. A link's refusal keeps any
27
+ * rows shown as `stale`, so nothing wider than the link asked for runs. A
28
+ * forbidden request is `no-access`, with no reason, whatever rows there
29
+ * were: the core has already withdrawn them.
17
30
  *
18
31
  * @experimental Pre-release: the whole surface is still settling, and this
19
32
  * name may change or move before the first release.
20
33
  */
21
34
  export default function resolveDisplayStatus(state) {
22
35
  const { result } = state;
36
+ // No access withdraws every row, even rows kept from before: saying "you
37
+ // do not have permission" over rows would contradict itself.
38
+ if (result.problem?.status === "forbidden") {
39
+ return { status: "no-access" };
40
+ }
23
41
  const reason = result.problem === null ? null : describeProblem(result.problem);
24
42
  if (result.rows !== null && result.rows.length > 0) {
25
43
  if (reason === null) {
@@ -30,7 +48,9 @@ export default function resolveDisplayStatus(state) {
30
48
  : { status: "refresh-failed", reason };
31
49
  }
32
50
  if (reason !== null) {
33
- return { status: "failed", reason };
51
+ return result.problem?.status === "refused"
52
+ ? { status: "refused", reason }
53
+ : { status: "failed", reason };
34
54
  }
35
55
  // No rows yet, or an earlier query's empty page: neither says anything
36
56
  // about the query now asked, so nothing is claimed until the source