@davidsouther/jiffies 1.1.0 → 2.0.2

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 (384) hide show
  1. package/build/pico.css +2466 -0
  2. package/build/pico.css.map +1 -0
  3. package/{build → lib/cjs}/assert.d.ts +23 -23
  4. package/lib/cjs/assert.js +40 -0
  5. package/{build → lib/cjs}/case.d.ts +1 -1
  6. package/lib/cjs/case.js +9 -0
  7. package/{build → lib/cjs}/components/button_bar.d.ts +8 -8
  8. package/lib/cjs/components/button_bar.js +29 -0
  9. package/{build → lib/cjs}/components/inline_edit.d.ts +12 -12
  10. package/lib/cjs/components/inline_edit.js +51 -0
  11. package/{build → lib/cjs}/components/logger.d.ts +6 -6
  12. package/lib/cjs/components/logger.js +27 -0
  13. package/lib/cjs/components/select.d.ts +10 -0
  14. package/lib/cjs/components/select.js +6 -0
  15. package/lib/cjs/components/test.d.ts +1 -0
  16. package/lib/cjs/components/test.js +7 -0
  17. package/{build → lib/cjs}/components/virtual_scroll.d.ts +40 -40
  18. package/lib/cjs/components/virtual_scroll.js +102 -0
  19. package/{build → lib/cjs}/components/virtual_scroll.test.d.ts +1 -1
  20. package/lib/cjs/components/virtual_scroll.test.js +22 -0
  21. package/{build → lib/cjs}/context.d.ts +15 -15
  22. package/lib/cjs/context.js +48 -0
  23. package/{build → lib/cjs}/context.test.d.ts +1 -1
  24. package/lib/cjs/context.test.js +48 -0
  25. package/lib/cjs/debounce.d.ts +1 -0
  26. package/lib/cjs/debounce.js +12 -0
  27. package/lib/cjs/diff.d.ts +15 -0
  28. package/lib/cjs/diff.js +58 -0
  29. package/{build/components/test.d.ts → lib/cjs/diff.test.d.ts} +1 -1
  30. package/lib/cjs/diff.test.js +41 -0
  31. package/{build → lib/cjs}/display.d.ts +5 -5
  32. package/lib/cjs/display.js +16 -0
  33. package/{build → lib/cjs}/dom/css/border.d.ts +11 -11
  34. package/lib/cjs/dom/css/border.js +33 -0
  35. package/{build → lib/cjs}/dom/css/constants.d.ts +31 -31
  36. package/lib/cjs/dom/css/constants.js +31 -0
  37. package/{build → lib/cjs}/dom/css/core.d.ts +5 -5
  38. package/lib/cjs/dom/css/core.js +31 -0
  39. package/{build → lib/cjs}/dom/css/fstyle.d.ts +5 -5
  40. package/lib/cjs/dom/css/fstyle.js +36 -0
  41. package/{build → lib/cjs}/dom/css/sizing.d.ts +5 -5
  42. package/lib/cjs/dom/css/sizing.js +14 -0
  43. package/{build → lib/cjs}/dom/dom.d.ts +27 -26
  44. package/lib/cjs/dom/dom.js +110 -0
  45. package/{build → lib/cjs}/dom/fc.d.ts +14 -14
  46. package/lib/cjs/dom/fc.js +39 -0
  47. package/{build → lib/cjs}/dom/fc.test.d.ts +1 -1
  48. package/lib/cjs/dom/fc.test.js +23 -0
  49. package/{build → lib/cjs}/dom/form/form.app.d.ts +1 -1
  50. package/lib/cjs/dom/form/form.app.js +27 -0
  51. package/{build → lib/cjs}/dom/form/form.d.ts +26 -26
  52. package/lib/cjs/dom/form/form.js +49 -0
  53. package/{build → lib/cjs}/dom/form/form.test.d.ts +0 -0
  54. package/{build → lib/cjs}/dom/form/form.test.js +1 -1
  55. package/{build → lib/cjs}/dom/html.d.ts +113 -113
  56. package/lib/cjs/dom/html.js +119 -0
  57. package/{build → lib/cjs}/dom/html.test.d.ts +1 -1
  58. package/lib/cjs/dom/html.test.js +60 -0
  59. package/lib/cjs/dom/observable.d.ts +2 -0
  60. package/lib/cjs/dom/observable.js +10 -0
  61. package/{build/observable → lib/cjs/dom}/observable.test.d.ts +1 -1
  62. package/lib/cjs/dom/observable.test.js +35 -0
  63. package/{build → lib/cjs}/dom/provide.d.ts +3 -3
  64. package/lib/cjs/dom/provide.js +12 -0
  65. package/{build → lib/cjs}/dom/router/link.d.ts +6 -6
  66. package/lib/cjs/dom/router/link.js +7 -0
  67. package/{build → lib/cjs}/dom/router/router.d.ts +12 -12
  68. package/lib/cjs/dom/router/router.js +52 -0
  69. package/{build → lib/cjs}/dom/svg.d.ts +64 -64
  70. package/lib/cjs/dom/svg.js +69 -0
  71. package/lib/cjs/dom/test.d.ts +1 -0
  72. package/lib/cjs/dom/test.js +13 -0
  73. package/{build → lib/cjs}/dom/types/css.d.ts +6612 -6612
  74. package/lib/cjs/dom/types/css.js +24 -0
  75. package/{build → lib/cjs}/dom/types/dom.d.ts +0 -0
  76. package/{build → lib/cjs}/dom/types/dom.js +1 -1
  77. package/{build → lib/cjs}/dom/types/html.d.ts +616 -616
  78. package/lib/cjs/dom/types/html.js +2 -0
  79. package/{build → lib/cjs}/dom/xml.d.ts +1 -1
  80. package/lib/cjs/dom/xml.js +8 -0
  81. package/{build → lib/cjs}/equal.d.ts +5 -5
  82. package/lib/cjs/equal.js +43 -0
  83. package/{build → lib/cjs}/equal.test.d.ts +1 -1
  84. package/lib/cjs/equal.test.js +22 -0
  85. package/{build → lib/cjs}/flags.d.ts +7 -7
  86. package/lib/cjs/flags.js +52 -0
  87. package/{build → lib/cjs}/flags.test.d.ts +1 -1
  88. package/lib/cjs/flags.test.js +37 -0
  89. package/{build → lib/cjs}/fs.d.ts +48 -48
  90. package/lib/cjs/fs.js +152 -0
  91. package/{build → lib/cjs}/fs.test.d.ts +1 -1
  92. package/lib/cjs/fs.test.js +45 -0
  93. package/{build → lib/cjs}/generator.d.ts +1 -1
  94. package/lib/cjs/generator.js +14 -0
  95. package/{build → lib/cjs}/generator.test.d.ts +1 -1
  96. package/lib/cjs/generator.test.js +26 -0
  97. package/{build → lib/cjs}/is_browser.d.ts +1 -1
  98. package/lib/cjs/is_browser.js +4 -0
  99. package/{build → lib/cjs}/loader.d.mts +22 -22
  100. package/lib/cjs/loader.mjs +40 -0
  101. package/{build → lib/cjs}/lock.d.ts +1 -1
  102. package/lib/cjs/lock.js +27 -0
  103. package/{build → lib/cjs}/lock.test.d.ts +1 -1
  104. package/lib/cjs/lock.test.js +18 -0
  105. package/{build → lib/cjs}/log.d.ts +26 -26
  106. package/lib/cjs/log.js +54 -0
  107. package/lib/cjs/observable/event.d.ts +35 -0
  108. package/lib/cjs/observable/event.js +61 -0
  109. package/lib/cjs/observable/observable.d.ts +132 -0
  110. package/lib/cjs/observable/observable.js +363 -0
  111. package/lib/cjs/observable/observable.test.d.ts +1 -0
  112. package/lib/cjs/observable/observable.test.js +65 -0
  113. package/{build → lib/cjs}/range.d.ts +1 -1
  114. package/lib/cjs/range.js +11 -0
  115. package/{build → lib/cjs}/result.d.ts +31 -31
  116. package/lib/cjs/result.js +80 -0
  117. package/{build → lib/cjs}/result.test.d.ts +1 -1
  118. package/lib/cjs/result.test.js +73 -0
  119. package/{build → lib/cjs}/safe.d.ts +1 -1
  120. package/lib/cjs/safe.js +14 -0
  121. package/{build → lib/cjs}/scope/describe.d.ts +18 -18
  122. package/lib/cjs/scope/describe.js +73 -0
  123. package/{build → lib/cjs}/scope/display/console.d.ts +2 -2
  124. package/lib/cjs/scope/display/console.js +25 -0
  125. package/{build → lib/cjs}/scope/display/dom.d.ts +3 -3
  126. package/lib/cjs/scope/display/dom.js +30 -0
  127. package/{build → lib/cjs}/scope/display/junit.d.ts +2 -2
  128. package/lib/cjs/scope/display/junit.js +21 -0
  129. package/{build → lib/cjs}/scope/execute.d.ts +12 -12
  130. package/lib/cjs/scope/execute.js +91 -0
  131. package/{build → lib/cjs}/scope/expect.d.ts +23 -23
  132. package/lib/cjs/scope/expect.js +114 -0
  133. package/{build → lib/cjs}/scope/fix.d.ts +4 -4
  134. package/lib/cjs/scope/fix.js +26 -0
  135. package/{build → lib/cjs}/scope/index.d.ts +3 -3
  136. package/lib/cjs/scope/index.js +15 -0
  137. package/{build → lib/cjs}/scope/scope.d.ts +17 -17
  138. package/lib/cjs/scope/scope.js +2 -0
  139. package/lib/cjs/scope/state.d.ts +1 -0
  140. package/lib/cjs/scope/state.js +11 -0
  141. package/{build → lib/cjs}/server/http/apps.d.ts +5 -5
  142. package/lib/cjs/server/http/apps.js +27 -0
  143. package/{build → lib/cjs}/server/http/css.d.ts +5 -5
  144. package/lib/cjs/server/http/css.js +54 -0
  145. package/{build → lib/cjs}/server/http/index.d.ts +21 -21
  146. package/lib/cjs/server/http/index.js +77 -0
  147. package/{build → lib/cjs}/server/http/response.d.ts +4 -4
  148. package/lib/cjs/server/http/response.js +45 -0
  149. package/{build → lib/cjs}/server/http/sitemap.d.ts +2 -2
  150. package/lib/cjs/server/http/sitemap.js +46 -0
  151. package/{build → lib/cjs}/server/http/static.d.ts +2 -2
  152. package/lib/cjs/server/http/static.js +25 -0
  153. package/{build → lib/cjs}/server/http/typescript.d.ts +5 -5
  154. package/lib/cjs/server/http/typescript.js +44 -0
  155. package/{build → lib/cjs}/server/main.d.ts +2 -2
  156. package/lib/cjs/server/main.js +14 -0
  157. package/{build → lib/cjs}/test.d.mts +2 -2
  158. package/lib/cjs/test.mjs +28 -0
  159. package/{build → lib/cjs}/test_all.d.ts +9 -7
  160. package/lib/cjs/test_all.js +30 -0
  161. package/{build → lib/cjs}/transpile.d.mts +3 -3
  162. package/lib/cjs/transpile.mjs +22 -0
  163. package/lib/cjs/tsconfig.tsbuildinfo +1 -0
  164. package/lib/esm/assert.d.ts +23 -0
  165. package/{build → lib/esm}/assert.js +33 -33
  166. package/lib/esm/case.d.ts +1 -0
  167. package/{build → lib/esm}/case.js +5 -5
  168. package/lib/esm/components/button_bar.d.ts +8 -0
  169. package/{build → lib/esm}/components/button_bar.js +27 -27
  170. package/lib/esm/components/inline_edit.d.ts +12 -0
  171. package/{build → lib/esm}/components/inline_edit.js +48 -48
  172. package/lib/esm/components/logger.d.ts +6 -0
  173. package/{build → lib/esm}/components/logger.js +22 -22
  174. package/lib/esm/components/select.d.ts +10 -0
  175. package/{build → lib/esm}/components/select.js +3 -3
  176. package/lib/esm/components/test.d.ts +1 -0
  177. package/lib/esm/components/test.js +3 -0
  178. package/lib/esm/components/virtual_scroll.d.ts +40 -0
  179. package/{build → lib/esm}/components/virtual_scroll.js +94 -94
  180. package/lib/esm/components/virtual_scroll.test.d.ts +1 -0
  181. package/{build → lib/esm}/components/virtual_scroll.test.js +20 -21
  182. package/lib/esm/context.d.ts +15 -0
  183. package/{build → lib/esm}/context.js +43 -43
  184. package/lib/esm/context.test.d.ts +1 -0
  185. package/{build → lib/esm}/context.test.js +46 -46
  186. package/lib/esm/debounce.d.ts +1 -0
  187. package/{build → lib/esm}/debounce.js +8 -7
  188. package/lib/esm/diff.d.ts +15 -0
  189. package/lib/esm/diff.js +54 -0
  190. package/lib/esm/diff.test.d.ts +1 -0
  191. package/lib/esm/diff.test.js +39 -0
  192. package/lib/esm/display.d.ts +5 -0
  193. package/{build → lib/esm}/display.js +11 -11
  194. package/lib/esm/dom/css/border.d.ts +11 -0
  195. package/{build → lib/esm}/dom/css/border.js +27 -27
  196. package/lib/esm/dom/css/constants.d.ts +31 -0
  197. package/{build → lib/esm}/dom/css/constants.js +28 -28
  198. package/lib/esm/dom/css/core.d.ts +5 -0
  199. package/{build → lib/esm}/dom/css/core.js +24 -24
  200. package/lib/esm/dom/css/fstyle.d.ts +5 -0
  201. package/{build → lib/esm}/dom/css/fstyle.js +32 -32
  202. package/lib/esm/dom/css/sizing.d.ts +5 -0
  203. package/{build → lib/esm}/dom/css/sizing.js +10 -10
  204. package/lib/esm/dom/dom.d.ts +27 -0
  205. package/{build → lib/esm}/dom/dom.js +104 -95
  206. package/lib/esm/dom/fc.d.ts +14 -0
  207. package/{build → lib/esm}/dom/fc.js +35 -36
  208. package/lib/esm/dom/fc.test.d.ts +1 -0
  209. package/{build → lib/esm}/dom/fc.test.js +21 -21
  210. package/lib/esm/dom/form/form.app.d.ts +1 -0
  211. package/{build → lib/esm}/dom/form/form.app.js +23 -23
  212. package/lib/esm/dom/form/form.d.ts +26 -0
  213. package/{build → lib/esm}/dom/form/form.js +34 -34
  214. package/lib/esm/dom/form/form.test.d.ts +0 -0
  215. package/lib/esm/dom/form/form.test.js +1 -0
  216. package/lib/esm/dom/html.d.ts +113 -0
  217. package/{build → lib/esm}/dom/html.js +114 -114
  218. package/lib/esm/dom/html.test.d.ts +1 -0
  219. package/{build → lib/esm}/dom/html.test.js +58 -58
  220. package/lib/esm/dom/observable.d.ts +2 -0
  221. package/lib/esm/dom/observable.js +6 -0
  222. package/lib/esm/dom/observable.test.d.ts +1 -0
  223. package/lib/esm/dom/observable.test.js +33 -0
  224. package/lib/esm/dom/provide.d.ts +3 -0
  225. package/{build → lib/esm}/dom/provide.js +7 -7
  226. package/lib/esm/dom/router/link.d.ts +6 -0
  227. package/{build → lib/esm}/dom/router/link.js +3 -3
  228. package/lib/esm/dom/router/router.d.ts +12 -0
  229. package/{build → lib/esm}/dom/router/router.js +49 -49
  230. package/lib/esm/dom/svg.d.ts +64 -0
  231. package/{build → lib/esm}/dom/svg.js +65 -65
  232. package/lib/esm/dom/test.d.ts +1 -0
  233. package/lib/esm/dom/test.js +9 -0
  234. package/lib/esm/dom/types/css.d.ts +6612 -0
  235. package/{build → lib/esm}/dom/types/css.js +23 -23
  236. package/lib/esm/dom/types/dom.d.ts +0 -0
  237. package/lib/esm/dom/types/dom.js +1 -0
  238. package/lib/esm/dom/types/html.d.ts +616 -0
  239. package/{build → lib/esm}/dom/types/html.js +1 -1
  240. package/lib/esm/dom/xml.d.ts +1 -0
  241. package/{build → lib/esm}/dom/xml.js +4 -4
  242. package/lib/esm/equal.d.ts +5 -0
  243. package/{build → lib/esm}/equal.js +37 -37
  244. package/lib/esm/equal.test.d.ts +1 -0
  245. package/{build → lib/esm}/equal.test.js +20 -20
  246. package/lib/esm/flags.d.ts +7 -0
  247. package/{build → lib/esm}/flags.js +48 -48
  248. package/lib/esm/flags.test.d.ts +1 -0
  249. package/{build → lib/esm}/flags.test.js +35 -35
  250. package/lib/esm/fs.d.ts +48 -0
  251. package/{build → lib/esm}/fs.js +145 -144
  252. package/lib/esm/fs.test.d.ts +1 -0
  253. package/{build → lib/esm}/fs.test.js +43 -43
  254. package/lib/esm/generator.d.ts +1 -0
  255. package/{build → lib/esm}/generator.js +10 -10
  256. package/lib/esm/generator.test.d.ts +1 -0
  257. package/{build → lib/esm}/generator.test.js +24 -24
  258. package/lib/esm/is_browser.d.ts +1 -0
  259. package/{build → lib/esm}/is_browser.js +1 -1
  260. package/lib/esm/loader.d.mts +22 -0
  261. package/{build → lib/esm}/loader.mjs +35 -35
  262. package/lib/esm/lock.d.ts +1 -0
  263. package/{build → lib/esm}/lock.js +23 -23
  264. package/lib/esm/lock.test.d.ts +1 -0
  265. package/{build → lib/esm}/lock.test.js +16 -16
  266. package/lib/esm/log.d.ts +26 -0
  267. package/{build → lib/esm}/log.js +46 -46
  268. package/lib/esm/observable/event.d.ts +35 -0
  269. package/lib/esm/observable/event.js +46 -0
  270. package/lib/esm/observable/observable.d.ts +132 -0
  271. package/lib/esm/observable/observable.js +343 -0
  272. package/lib/esm/observable/observable.test.d.ts +1 -0
  273. package/lib/esm/observable/observable.test.js +63 -0
  274. package/lib/esm/range.d.ts +1 -0
  275. package/{build → lib/esm}/range.js +7 -7
  276. package/lib/esm/result.d.ts +31 -0
  277. package/{build → lib/esm}/result.js +65 -65
  278. package/lib/esm/result.test.d.ts +1 -0
  279. package/{build → lib/esm}/result.test.js +71 -71
  280. package/lib/esm/safe.d.ts +1 -0
  281. package/{build → lib/esm}/safe.js +10 -10
  282. package/lib/esm/scope/describe.d.ts +18 -0
  283. package/{build → lib/esm}/scope/describe.js +60 -61
  284. package/lib/esm/scope/display/console.d.ts +2 -0
  285. package/{build → lib/esm}/scope/display/console.js +21 -21
  286. package/lib/esm/scope/display/dom.d.ts +3 -0
  287. package/{build → lib/esm}/scope/display/dom.js +26 -26
  288. package/lib/esm/scope/display/junit.d.ts +2 -0
  289. package/{build → lib/esm}/scope/display/junit.js +17 -17
  290. package/lib/esm/scope/execute.d.ts +12 -0
  291. package/{build → lib/esm}/scope/execute.js +85 -85
  292. package/lib/esm/scope/expect.d.ts +23 -0
  293. package/{build → lib/esm}/scope/expect.js +108 -108
  294. package/lib/esm/scope/fix.d.ts +4 -0
  295. package/{build → lib/esm}/scope/fix.js +22 -22
  296. package/lib/esm/scope/index.d.ts +3 -0
  297. package/{build → lib/esm}/scope/index.js +3 -3
  298. package/lib/esm/scope/scope.d.ts +17 -0
  299. package/{build → lib/esm}/scope/scope.js +1 -1
  300. package/lib/esm/scope/state.d.ts +1 -0
  301. package/lib/esm/scope/state.js +7 -0
  302. package/lib/esm/server/http/apps.d.ts +5 -0
  303. package/{build → lib/esm}/server/http/apps.js +23 -23
  304. package/lib/esm/server/http/css.d.ts +5 -0
  305. package/{build → lib/esm}/server/http/css.js +50 -50
  306. package/lib/esm/server/http/index.d.ts +21 -0
  307. package/{build → lib/esm}/server/http/index.js +73 -73
  308. package/lib/esm/server/http/response.d.ts +4 -0
  309. package/{build → lib/esm}/server/http/response.js +40 -40
  310. package/lib/esm/server/http/sitemap.d.ts +2 -0
  311. package/{build → lib/esm}/server/http/sitemap.js +42 -42
  312. package/lib/esm/server/http/static.d.ts +2 -0
  313. package/{build → lib/esm}/server/http/static.js +21 -21
  314. package/lib/esm/server/http/typescript.d.ts +5 -0
  315. package/{build → lib/esm}/server/http/typescript.js +40 -40
  316. package/lib/esm/server/main.d.ts +2 -0
  317. package/{build → lib/esm}/server/main.js +12 -9
  318. package/lib/esm/test.d.mts +2 -0
  319. package/lib/esm/test.mjs +26 -0
  320. package/lib/esm/test_all.d.ts +9 -0
  321. package/{build → lib/esm}/test_all.js +28 -18
  322. package/lib/esm/transpile.d.mts +3 -0
  323. package/{build → lib/esm}/transpile.mjs +18 -18
  324. package/lib/esm/tsconfig.tsbuildinfo +1 -0
  325. package/package.json +16 -17
  326. package/src/assert.ts +1 -1
  327. package/src/components/button_bar.ts +3 -3
  328. package/src/components/inline_edit.ts +3 -3
  329. package/src/components/logger.ts +3 -3
  330. package/src/components/select.ts +3 -3
  331. package/src/components/test.js +3 -2
  332. package/src/context.ts +3 -3
  333. package/src/debounce.ts +2 -1
  334. package/src/diff.ts +2 -2
  335. package/src/display.ts +2 -2
  336. package/src/dom/css/border.ts +3 -3
  337. package/src/dom/css/core.ts +1 -1
  338. package/src/dom/css/fstyle.ts +2 -2
  339. package/src/dom/css/sizing.ts +1 -1
  340. package/src/dom/dom.ts +1 -1
  341. package/src/dom/fc.test.ts +3 -3
  342. package/src/dom/fc.ts +1 -1
  343. package/src/dom/form/form.app.ts +2 -2
  344. package/src/dom/form/form.ts +3 -3
  345. package/src/dom/html.test.ts +3 -3
  346. package/src/dom/html.ts +1 -1
  347. package/src/dom/observable.test.ts +6 -6
  348. package/src/dom/observable.ts +1 -1
  349. package/src/dom/provide.ts +1 -1
  350. package/src/dom/router/link.ts +2 -2
  351. package/src/dom/router/router.ts +2 -2
  352. package/src/dom/svg.ts +1 -1
  353. package/src/dom/test.ts +8 -6
  354. package/src/dom/types/html.ts +1 -1
  355. package/src/equal.ts +1 -1
  356. package/src/flags.ts +1 -1
  357. package/src/fs.ts +5 -4
  358. package/src/index.html +6 -6
  359. package/src/observable/event.ts +2 -2
  360. package/src/observable/observable.test.ts +2 -2
  361. package/src/observable/observable.ts +72 -12
  362. package/src/pico/_variables.scss +1 -1
  363. package/src/pico/layout/_sectioning.scss +2 -0
  364. package/src/result.ts +1 -1
  365. package/src/scope/describe.ts +2 -5
  366. package/src/scope/display/console.ts +4 -4
  367. package/src/scope/display/dom.ts +6 -6
  368. package/src/scope/display/junit.ts +3 -3
  369. package/src/scope/execute.ts +2 -2
  370. package/src/scope/expect.ts +3 -3
  371. package/src/scope/state.ts +10 -0
  372. package/src/server/http/sitemap.ts +1 -1
  373. package/src/server/main.ts +9 -2
  374. package/src/test.mjs +22 -18
  375. package/src/test_all.ts +10 -0
  376. package/build/components/select.d.ts +0 -13
  377. package/build/components/test.js +0 -2
  378. package/build/debounce.d.ts +0 -1
  379. package/build/dom/test.d.ts +0 -1
  380. package/build/dom/test.js +0 -2
  381. package/build/observable/observable.d.ts +0 -83
  382. package/build/observable/observable.js +0 -148
  383. package/build/observable/observable.test.js +0 -21
  384. package/build/test.mjs +0 -23
package/src/index.html CHANGED
@@ -23,10 +23,10 @@
23
23
  import("./components/test.js"),
24
24
  ]);
25
25
 
26
- import { execute } from "./scope/execute.js";
27
- import { displayStatistics } from "./scope/display/dom.js";
28
- import { onConsole } from "./scope/display/console.js";
29
- import { asXML } from "./scope/display/junit.js";
26
+ import { execute } from "./scope/execute"
27
+ import { displayStatistics } from "./scope/display/dom"
28
+ import { onConsole } from "./scope/display/console"
29
+ import { asXML } from "./scope/display/junit"
30
30
 
31
31
  function write(id, value) {
32
32
  const start = `--- START_${id.toUpperCase()} ---`;
@@ -46,8 +46,8 @@
46
46
  })();
47
47
  </script>
48
48
  <script type="module">
49
- import { nav, ul, li, strong } from "./dom/html.js";
50
- import { link } from "./dom/router/link.js";
49
+ import { nav, ul, li, strong } from "./dom/html"
50
+ import { link } from "./dom/router/link"
51
51
 
52
52
  const getUrls = async () => {
53
53
  const sitemap = await fetch("/sitemap.json");
@@ -1,5 +1,5 @@
1
- import { display } from "../display.js";
2
- import { Observable } from "./observable.js";
1
+ import { display } from "../display.js"
2
+ import { Observable } from "./observable.js"
3
3
 
4
4
  export interface Next<T> {
5
5
  value: T;
@@ -1,5 +1,5 @@
1
- import { describe, expect, it } from "../scope/index.js";
2
- import { Observable, Subject, filter, map } from "./observable.js";
1
+ import { describe, expect, it } from "../scope/index.js"
2
+ import { Observable, Subject, filter, map } from "./observable.js"
3
3
 
4
4
  describe("Observables", () => {
5
5
  describe("basics", () => {
@@ -1,4 +1,4 @@
1
- import { DEFAULT_LOGGER, Logger } from "../log.js";
1
+ import { DEFAULT_LOGGER, Logger } from "../log.js"
2
2
 
3
3
  export interface FullSubscriber<T, E> {
4
4
  // (t: T): void | Promise<undefined>;
@@ -26,6 +26,7 @@ export interface Observable<T, E = unknown> {
26
26
  o2: Subscriber<T1, E> & Observable<T2, E>
27
27
  ): Observable<T2, E>;
28
28
  filter(fn: (t: T) => boolean): Observable<T, E>;
29
+ distinct(fn?: (t1: T, t2: T) => boolean): Observable<T, E>;
29
30
  map<U>(fn: (t: T) => U): Observable<U, E>;
30
31
  reduce<A>(fn: (acc: A, t: T) => A, init: A): Observable<A, E>;
31
32
  replay(n: number): Observable<T, E>;
@@ -55,11 +56,13 @@ export const Observable = {
55
56
  o2: Observable<T2, E>
56
57
  ): Observable<[T1, T2], E> {
57
58
  let latestSubject = new Subject<[T1, T2], E>();
59
+ let o1LatestSet = false;
58
60
  let o1Latest: T1;
61
+ let o2LatestSet = false;
59
62
  let o2Latest: T2;
60
63
 
61
64
  function next() {
62
- if (o1Latest && o2Latest) {
65
+ if (o1LatestSet && o2LatestSet) {
63
66
  latestSubject.next([o1Latest, o2Latest]);
64
67
  }
65
68
  }
@@ -77,6 +80,7 @@ export const Observable = {
77
80
  let o1sub = o1.subscribe({
78
81
  next(t: T1) {
79
82
  o1Latest = t;
83
+ o1LatestSet = true;
80
84
  next();
81
85
  },
82
86
  error,
@@ -86,6 +90,7 @@ export const Observable = {
86
90
  let o2sub = o2.subscribe({
87
91
  next(t: T2) {
88
92
  o2Latest = t;
93
+ o2LatestSet = true;
89
94
  next();
90
95
  },
91
96
  error,
@@ -96,6 +101,22 @@ export const Observable = {
96
101
  },
97
102
  };
98
103
 
104
+ interface Scheduler {
105
+ execute(fn: () => (void | Promise<undefined>)[]): void | Promise<undefined>;
106
+ }
107
+
108
+ export const AsyncScheduler: Scheduler = {
109
+ execute(fn: () => Promise<undefined>[]): Promise<undefined> {
110
+ return Promise.all(fn()).then(() => undefined);
111
+ },
112
+ };
113
+
114
+ export const SyncScheduler: Scheduler = {
115
+ execute(fn: () => void[]): void {
116
+ fn();
117
+ },
118
+ };
119
+
99
120
  export class Subject<T, E = unknown, T2 = T>
100
121
  implements FullSubscriber<T, E>, Observable<T, E>
101
122
  {
@@ -103,6 +124,10 @@ export class Subject<T, E = unknown, T2 = T>
103
124
  #subscribers = new Set<FullSubscriber<T, E>>();
104
125
  #complete = false;
105
126
 
127
+ get $(): Observable<T, E> {
128
+ return this;
129
+ }
130
+
106
131
  get hot(): boolean {
107
132
  return this.#subscribers.size > 0;
108
133
  }
@@ -111,6 +136,8 @@ export class Subject<T, E = unknown, T2 = T>
111
136
  return !this.hot;
112
137
  }
113
138
 
139
+ constructor(private readonly scheduler: Scheduler = AsyncScheduler) {}
140
+
114
141
  onWarm(fn: Function) {
115
142
  if (this.cold) this.#coldWaiters.add(fn);
116
143
  }
@@ -118,16 +145,16 @@ export class Subject<T, E = unknown, T2 = T>
118
145
  next(t: T | T2): void | Promise<undefined> {
119
146
  if (this.#complete)
120
147
  throw new Error("Cannot call next on a completed subject");
121
- return Promise.all(
148
+ return this.scheduler.execute(() =>
122
149
  [...this.#subscribers].map((s) => s.next?.(t as T))
123
- ).then(() => undefined);
150
+ );
124
151
  }
125
152
 
126
153
  error(e: E): void | Promise<undefined> {
127
154
  if (this.#complete)
128
155
  throw new Error("Cannot call error on a completed subject");
129
- return Promise.all([...this.#subscribers].map((s) => s.error?.(e))).then(
130
- () => undefined
156
+ return this.scheduler.execute(() =>
157
+ [...this.#subscribers].map((s) => s.error?.(e))
131
158
  );
132
159
  }
133
160
 
@@ -135,11 +162,11 @@ export class Subject<T, E = unknown, T2 = T>
135
162
  if (this.#complete)
136
163
  throw new Error("Cannot call complete on a completed subject");
137
164
  this.#complete = true;
138
- const finished = Promise.all(
165
+ const finished = this.scheduler.execute(() =>
139
166
  [...this.#subscribers].map((s) => s.complete?.())
140
167
  );
141
168
  this.#subscribers.clear(); // Free subscribers for garbage collection
142
- return finished.then(() => undefined);
169
+ return finished;
143
170
  }
144
171
 
145
172
  subscribe(subscriber: Subscriber<T, E>): Subscription {
@@ -180,6 +207,10 @@ export class Subject<T, E = unknown, T2 = T>
180
207
  return this.pipe(operator.filter(fn));
181
208
  }
182
209
 
210
+ distinct(fn: (t1: T, t2: T) => boolean = Object.is): Observable<T, E> {
211
+ return this.pipe(operator.distinct(fn));
212
+ }
213
+
183
214
  map<U>(fn: (t: T) => U): Observable<U, E> {
184
215
  return this.pipe(operator.map(fn));
185
216
  }
@@ -200,8 +231,8 @@ export class Subject<T, E = unknown, T2 = T>
200
231
  export class BehaviorSubject<T, E = unknown, T2 = T> extends Subject<T, E, T2> {
201
232
  #current: T;
202
233
 
203
- constructor(t: T) {
204
- super();
234
+ constructor(t: T, scheduler?: Scheduler) {
235
+ super(scheduler);
205
236
  this.#current = t;
206
237
  }
207
238
 
@@ -226,8 +257,8 @@ export class BehaviorSubject<T, E = unknown, T2 = T> extends Subject<T, E, T2> {
226
257
  export class ReplaySubject<T, E = unknown> extends Subject<T, E> {
227
258
  #history: T[] = [];
228
259
 
229
- constructor(private readonly n: number) {
230
- super();
260
+ constructor(private readonly n: number, scheduler?: Scheduler) {
261
+ super(scheduler);
231
262
  }
232
263
 
233
264
  next(t: T) {
@@ -316,6 +347,32 @@ class FilterOperator<T, E>
316
347
  }
317
348
  }
318
349
 
350
+ class DistinctOperator<T, E>
351
+ extends Subject<T, E>
352
+ implements FullSubscriber<T, E>, Observable<T, E>
353
+ {
354
+ #prior: T | undefined = undefined;
355
+
356
+ constructor(
357
+ private readonly distinctFn: (t1: T, t2: T) => boolean = Object.is
358
+ ) {
359
+ super();
360
+ }
361
+
362
+ next(t: T): void | Promise<undefined> {
363
+ if (this.#prior === undefined) {
364
+ this.#prior = t;
365
+ return super.next(t);
366
+ }
367
+ const same = this.distinctFn(this.#prior!, t);
368
+ if (!same) {
369
+ this.#prior = t;
370
+ return super.next(t);
371
+ }
372
+ return undefined;
373
+ }
374
+ }
375
+
319
376
  class ReduceOperator<A, T, E> extends BehaviorSubject<A, E, T> {
320
377
  constructor(private readonly fn: (acc: A, t: T) => A, init: A) {
321
378
  super(init);
@@ -380,6 +437,8 @@ class LastOperator<T, E = Error> extends Subject<T, E> {
380
437
 
381
438
  export const filter = <T, E>(fn: (t: T) => boolean) =>
382
439
  new FilterOperator<T, E>(fn);
440
+ export const distinct = <T, E>(fn?: (t1: T, t2: T) => boolean) =>
441
+ new DistinctOperator<T, E>(fn ?? Object.is);
383
442
  export const first = <T, E>() => new FirstOperator<T, E>();
384
443
  export const last = <T, E>() => new LastOperator<T, E>();
385
444
  export const map = <T1, T2, E>(fn: (t: T1) => T2) =>
@@ -393,6 +452,7 @@ export const tap = <T, E>(fn: Subscriber<T, E>) => new TapOperator<T, E>(fn);
393
452
 
394
453
  export const operator = {
395
454
  filter,
455
+ distinct,
396
456
  first,
397
457
  last,
398
458
  map,
@@ -9,7 +9,7 @@ $enable-class-container: false !default;
9
9
 
10
10
  // Enable a centered viewport for <header>, <main>, <footer> inside <body>
11
11
  // Options are "all" to center all, "main" to only center main, and "none" to treat all as fluid.
12
- $enable-viewport: "main" !default;
12
+ $enable-viewport: "none" !default;
13
13
 
14
14
  // Enable responsive spacings for <header>, <main>, <footer>, <section>, <article>
15
15
  // Fixed spacings if disabled
@@ -16,6 +16,8 @@ main {
16
16
  // Pico
17
17
  // ––––––––––––––––––––
18
18
 
19
+ @import url("../themes/default/styles");
20
+
19
21
  // 1. Remove the margin in all browsers (opinionated)
20
22
  // 2. Body should be at least the height of the viewport (opinionated)
21
23
  body {
package/src/result.ts CHANGED
@@ -8,7 +8,7 @@ export type Err<E = Error> = {
8
8
  export type Ok<T> = { ok: T; map: <U>(fn: (t: T) => Result<U>) => Result<U> };
9
9
  export type Result<T, E = Error> = Ok<T> | Err<E>;
10
10
 
11
- export const isNone = <T>(s: Option<T>): s is None => s == null;
11
+ export const isNone = <T>(s: Option<T>): s is None => s === null;
12
12
  export const isSome = <T>(s: Option<T>): s is Some<T> => s != null;
13
13
 
14
14
  export function None<T = unknown>(_?: T): Option<T> {
@@ -1,6 +1,7 @@
1
1
  import { assert } from "../assert.js";
2
2
  import { getLogger } from "../log.js";
3
3
  import { TestCase } from "./scope.js";
4
+ import * as state from "./state.js";
4
5
 
5
6
  export const beforeall = Symbol("beforeAll");
6
7
  export const beforeeach = Symbol("beforeEach");
@@ -75,9 +76,5 @@ export function cleanState<State extends {}>(
75
76
  init: () => State,
76
77
  runner: (action: () => void) => void = beforeEach
77
78
  ): State {
78
- const state = {};
79
- runner(() => {
80
- Object.assign(state, init());
81
- });
82
- return state as State;
79
+ return state.cleanState(init, runner);
83
80
  }
@@ -1,7 +1,7 @@
1
- import { getLogger } from "../../log.js";
2
- import { getTotalCases } from "../describe.js";
3
- import { flattenResults } from "../execute.js";
4
- import { TestResult } from "../scope.js";
1
+ import { getLogger } from "../../log.js"
2
+ import { getTotalCases } from "../describe.js"
3
+ import { flattenResults } from "../execute.js"
4
+ import { TestResult } from "../scope.js"
5
5
 
6
6
  const logger = getLogger("Scope Test Runner");
7
7
 
@@ -1,9 +1,9 @@
1
- import { isHTMLLogger, makeHTMLLogger } from "../../components/logger.js";
2
- import { DOMElement } from "../../dom/dom.js";
3
- import { DEFAULT_LOGGER, LEVEL } from "../../log.js";
4
- import { getTotalCases } from "../describe.js";
5
- import { flattenResults } from "../execute.js";
6
- import { TestResult } from "../scope.js";
1
+ import { isHTMLLogger, makeHTMLLogger } from "../../components/logger.js"
2
+ import { DOMElement } from "../../dom/dom.js"
3
+ import { DEFAULT_LOGGER, LEVEL } from "../../log.js"
4
+ import { getTotalCases } from "../describe.js"
5
+ import { flattenResults } from "../execute.js"
6
+ import { TestResult } from "../scope.js"
7
7
 
8
8
  export function displayStatistics(
9
9
  results: TestResult,
@@ -1,6 +1,6 @@
1
- import { xml } from "../../dom/xml.js";
2
- import { FlatResult, flattenResults } from "../execute.js";
3
- import { TestResult } from "../scope.js";
1
+ import { xml } from "../../dom/xml.js"
2
+ import { FlatResult, flattenResults } from "../execute.js"
3
+ import { TestResult } from "../scope.js"
4
4
 
5
5
  const cases = (results: TestResult) =>
6
6
  Object.entries(results).filter(
@@ -4,8 +4,8 @@ import {
4
4
  beforeall,
5
5
  beforeeach,
6
6
  rootCases,
7
- } from "./describe.js";
8
- import { TestFailed, TestPassed, TestResult, TestSummary } from "./scope.js";
7
+ } from "./describe.js"
8
+ import { TestFailed, TestPassed, TestResult, TestSummary } from "./scope.js"
9
9
 
10
10
  export async function execute(cases = rootCases()): Promise<TestResult> {
11
11
  const beforeallfn = cases[beforeall] ?? (() => {});
@@ -1,6 +1,6 @@
1
- import { assert } from "../assert.js";
2
- import { display } from "../display.js";
3
- import { equals } from "../equal.js";
1
+ import { assert } from "../assert.js"
2
+ import { display } from "../display.js"
3
+ import { equals } from "../equal.js"
4
4
 
5
5
  export class Matcher<T> {
6
6
  actual: T;
@@ -0,0 +1,10 @@
1
+ export function cleanState<State extends {}>(
2
+ init: () => State,
3
+ runner: (action: () => void) => void
4
+ ): State {
5
+ const state = {};
6
+ runner(() => {
7
+ Object.assign(state, init());
8
+ });
9
+ return state as State;
10
+ }
@@ -1,7 +1,7 @@
1
1
  import * as fs from "fs/promises";
2
2
  import * as path from "path";
3
3
  import { info } from "../../log.js";
4
- import { MiddlewareFactory, StaticMiddleware } from "./index.js";
4
+ import { MiddlewareFactory } from "./index.js";
5
5
  import { contentResponse } from "./response.js";
6
6
 
7
7
  const findSiteMap = async (root: string, prefix = root) => {
@@ -9,5 +9,12 @@ const FLAGS = parse(process.argv);
9
9
  import { makeServer } from "./http/index.js";
10
10
  import * as path from "node:path";
11
11
 
12
- const server = await makeServer({ root: path.join(process.cwd(), "src") });
13
- server.listen(FLAGS.asNumber("port", 8080), FLAGS.asString("host", "0.0.0.0"));
12
+ async function main() {
13
+ const server = await makeServer({ root: path.join(process.cwd(), "src") });
14
+ server.listen(
15
+ FLAGS.asNumber("port", 8080),
16
+ FLAGS.asString("host", "0.0.0.0")
17
+ );
18
+ }
19
+
20
+ main();
package/src/test.mjs CHANGED
@@ -5,25 +5,29 @@ import { execute } from "./scope/execute.js";
5
5
  import { asXML } from "./scope/display/junit.js";
6
6
  import { onConsole } from "./scope/display/console.js";
7
7
 
8
- await import("./test_all.js");
8
+ async function main() {
9
+ await import("./test_all.js");
9
10
 
10
- (async function () {
11
- const results = await execute();
11
+ (async function () {
12
+ const results = await execute();
12
13
 
13
- const FLAGS = parse(process.argv);
14
+ const FLAGS = parse(process.argv);
14
15
 
15
- switch (FLAGS.asString("mode", "console")) {
16
- case "junit":
17
- const xml = asXML(results);
18
- console.log(xml);
19
- break;
20
- case "console":
21
- default:
22
- onConsole(results);
23
- break;
24
- }
16
+ switch (FLAGS.asString("mode", "console")) {
17
+ case "junit":
18
+ const xml = asXML(results);
19
+ console.log(xml);
20
+ break;
21
+ case "console":
22
+ default:
23
+ onConsole(results);
24
+ break;
25
+ }
25
26
 
26
- if (results.failed > 0) {
27
- process.exit(1);
28
- }
29
- })();
27
+ if (results.failed > 0) {
28
+ process.exit(1);
29
+ }
30
+ })();
31
+ }
32
+
33
+ main();
package/src/test_all.ts CHANGED
@@ -21,3 +21,13 @@ import "./generator.test.js";
21
21
  import "./lock.test.js";
22
22
  import "./result.test.js";
23
23
  import "./observable/observable.test.js";
24
+
25
+ import * as components from "./components/test.js";
26
+ import * as dom from "./dom/test.js";
27
+
28
+ if (process?.env.CI?.toLowerCase() !== "true") {
29
+ (async () => {
30
+ await components.loadTests();
31
+ await dom.loadTests();
32
+ })();
33
+ }
@@ -1,13 +0,0 @@
1
- import { EventHandler } from "../dom/dom.js";
2
- export declare const Select: import("../dom/fc.js").FCComponentCtor<{
3
- name: string;
4
- value: string;
5
- events: {
6
- change: EventHandler;
7
- };
8
- disabled: boolean;
9
- options: [
10
- string,
11
- string
12
- ][];
13
- }, {}>;
@@ -1,2 +0,0 @@
1
- await import("./virtual_scroll.test.js");
2
- export {};
@@ -1 +0,0 @@
1
- export declare function debounce(fn: (...args: any[]) => any, ms?: number): (...args: Parameters<typeof fn>) => ReturnType<typeof fn>;
@@ -1 +0,0 @@
1
- export {};
package/build/dom/test.js DELETED
@@ -1,2 +0,0 @@
1
- await Promise.all([import("./html.test.js"), import("./fc.test.js")]);
2
- export {};
@@ -1,83 +0,0 @@
1
- import { Logger } from "../log.js";
2
- export interface Subscriber<T, E> {
3
- next?: (t: T) => void | Promise<undefined>;
4
- error?: (e: E) => void | Promise<undefined>;
5
- complete?: () => void | Promise<undefined>;
6
- }
7
- export interface Subscription {
8
- unsubscribe(): void;
9
- }
10
- export interface Observable<T, E = unknown> {
11
- subscribe(subscriber: Subscriber<T, E>): Subscription;
12
- pipe<T1>(o1: (t: T) => T1): Observable<T1, E>;
13
- pipe<T1, T2>(o1: (t: T) => T1, o2: (t: T) => T2): Observable<T2, E>;
14
- pipe<T1, T2, T3>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3): Observable<T3, E>;
15
- pipe<T1, T2, T3, T4>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3, o4: (t: T3) => T4): Observable<T4, E>;
16
- pipe<T1, T2, T3, T4, T5>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3, o4: (t: T3) => T4, o5: (t: T4) => T5): Observable<T5, E>;
17
- }
18
- export declare const Observable: {
19
- of<T, E>(...T: T[]): void;
20
- combineLatest<T_1, E_1>(...O: Observable<T_1, E_1>[]): void;
21
- from<T_2, E_2>(f: Promise<T_2> | Iterable<T_2> | Observable<T_2, E_2>): void;
22
- fromEvent<T_3, E_3>(element: {
23
- addEventListener<Ev>(fn: (e: Ev) => void): void;
24
- }, eventName: string): void;
25
- };
26
- export declare class Subject<T, E = unknown> implements Subscriber<T, E>, Observable<T, E> {
27
- #private;
28
- next(t: T): Promise<undefined>;
29
- error(e: E): Promise<undefined>;
30
- complete(): Promise<undefined>;
31
- subscribe(subscriber: Subscriber<T, E>): Subscription;
32
- pipe<T1>(o1: (t: T) => T1): Observable<T1, E>;
33
- pipe<T1, T2>(o1: (t: T) => T1, o2: (t: T1) => T2): Observable<T2, E>;
34
- pipe<T1, T2, T3>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3): Observable<T3, E>;
35
- pipe<T1, T2, T3, T4>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3, o4: (t: T3) => T4): Observable<T4, E>;
36
- pipe<T1, T2, T3, T4, T5>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3, o4: (t: T3) => T4, o5: (t: T4) => T5): Observable<T5, E>;
37
- }
38
- export declare class BehaviorSubject<T, E = unknown> extends Subject<T, E> {
39
- #private;
40
- constructor(t: T);
41
- next(t: T): Promise<undefined>;
42
- subscribe(subscriber: Subscriber<T, E>): Subscription;
43
- get current(): T;
44
- }
45
- export declare class ReplaySubject<T, E = unknown> extends Subject<T, E> {
46
- #private;
47
- private readonly n;
48
- constructor(n: number);
49
- next(t: T): Promise<undefined>;
50
- subscribe(subscriber: Subscriber<T, E>): Subscription;
51
- }
52
- export interface Next<T> {
53
- value: T;
54
- completed: false;
55
- failed: false;
56
- }
57
- export interface Error<E> {
58
- error: E;
59
- completed: false;
60
- failed: true;
61
- }
62
- export interface Completed {
63
- completed: true;
64
- failed: false;
65
- }
66
- export interface Failed {
67
- completed: true;
68
- failed: true;
69
- }
70
- export declare type Event<T, E> = Next<T> | Error<E> | Completed | Failed;
71
- export declare const next: <T>(value: T) => Next<T>;
72
- export declare const error: <E>(e: E) => Error<E>;
73
- export declare const completed: () => Completed;
74
- export declare const failed: () => Failed;
75
- export declare const isNext: <T>(event: Event<T, unknown>) => event is Next<T>;
76
- export declare const isError: <E>(event: Event<unknown, E>) => event is Error<E>;
77
- export declare const isCompleted: (event: Event<unknown, unknown>) => event is Completed;
78
- export declare const isFailed: (event: Event<unknown, unknown>) => event is Failed;
79
- export declare const isEvent: <T, E>(t: T | Event<T, E>) => t is Event<T, E>;
80
- export declare const asEvents: <T, E>(a: (T | Event<T, E>)[]) => Event<T, E>[];
81
- export declare const marbles: <T, E>(events: Event<T, E>[]) => string;
82
- export declare const collect: <T, E>(input$: Observable<T, E>) => Event<T, E>[];
83
- export declare const watch: <T, E>(logger?: Logger) => (observable: Observable<T, E>) => void;