@davidsouther/jiffies 1.0.0 → 2.0.1

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 (388) 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 +0 -0
  4. package/lib/cjs/assert.js +40 -0
  5. package/{build → lib/cjs}/case.d.ts +0 -0
  6. package/lib/cjs/case.js +9 -0
  7. package/{build → lib/cjs}/components/button_bar.d.ts +1 -1
  8. package/lib/cjs/components/button_bar.js +29 -0
  9. package/{build → lib/cjs}/components/inline_edit.d.ts +1 -1
  10. package/lib/cjs/components/inline_edit.js +51 -0
  11. package/{build → lib/cjs}/components/logger.d.ts +2 -3
  12. package/lib/cjs/components/logger.js +27 -0
  13. package/{build → lib/cjs}/components/select.d.ts +2 -2
  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 +3 -4
  18. package/lib/cjs/components/virtual_scroll.js +102 -0
  19. package/{build → lib/cjs}/components/virtual_scroll.test.d.ts +0 -0
  20. package/lib/cjs/components/virtual_scroll.test.js +22 -0
  21. package/{build → lib/cjs}/context.d.ts +0 -0
  22. package/lib/cjs/context.js +48 -0
  23. package/{build → lib/cjs}/context.test.d.ts +0 -0
  24. package/lib/cjs/context.test.js +48 -0
  25. package/{build → lib/cjs}/debounce.d.ts +0 -0
  26. package/lib/cjs/debounce.js +11 -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} +0 -0
  30. package/lib/cjs/diff.test.js +41 -0
  31. package/{build → lib/cjs}/display.d.ts +0 -0
  32. package/lib/cjs/display.js +16 -0
  33. package/{build → lib/cjs}/dom/css/border.d.ts +0 -0
  34. package/lib/cjs/dom/css/border.js +33 -0
  35. package/{build → lib/cjs}/dom/css/constants.d.ts +0 -0
  36. package/lib/cjs/dom/css/constants.js +31 -0
  37. package/{build → lib/cjs}/dom/css/core.d.ts +0 -0
  38. package/lib/cjs/dom/css/core.js +31 -0
  39. package/{build → lib/cjs}/dom/css/fstyle.d.ts +0 -0
  40. package/lib/cjs/dom/css/fstyle.js +36 -0
  41. package/{build → lib/cjs}/dom/css/sizing.d.ts +0 -0
  42. package/lib/cjs/dom/css/sizing.js +14 -0
  43. package/lib/cjs/dom/dom.d.ts +27 -0
  44. package/lib/cjs/dom/dom.js +110 -0
  45. package/{build → lib/cjs}/dom/fc.d.ts +5 -5
  46. package/lib/cjs/dom/fc.js +39 -0
  47. package/{build → lib/cjs}/dom/fc.test.d.ts +0 -0
  48. package/lib/cjs/dom/fc.test.js +23 -0
  49. package/lib/cjs/dom/form/form.app.d.ts +1 -0
  50. package/lib/cjs/dom/form/form.app.js +27 -0
  51. package/{build → lib/cjs}/dom/form/form.d.ts +9 -9
  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 +0 -0
  55. package/lib/cjs/dom/html.d.ts +113 -0
  56. package/lib/cjs/dom/html.js +119 -0
  57. package/{build → lib/cjs}/dom/html.test.d.ts +0 -0
  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/dom/test.d.ts → lib/cjs/dom/observable.test.d.ts} +0 -0
  62. package/lib/cjs/dom/observable.test.js +35 -0
  63. package/{build → lib/cjs}/dom/provide.d.ts +0 -0
  64. package/lib/cjs/dom/provide.js +12 -0
  65. package/lib/cjs/dom/router/link.d.ts +6 -0
  66. package/lib/cjs/dom/router/link.js +7 -0
  67. package/{build → lib/cjs}/dom/router/router.d.ts +3 -3
  68. package/lib/cjs/dom/router/router.js +52 -0
  69. package/lib/cjs/dom/svg.d.ts +64 -0
  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 +0 -0
  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 +0 -0
  77. package/{build → lib/cjs}/dom/types/html.d.ts +1 -1
  78. package/lib/cjs/dom/types/html.js +2 -0
  79. package/{build → lib/cjs}/dom/xml.d.ts +0 -0
  80. package/lib/cjs/dom/xml.js +8 -0
  81. package/{build → lib/cjs}/equal.d.ts +0 -0
  82. package/lib/cjs/equal.js +43 -0
  83. package/{build → lib/cjs}/equal.test.d.ts +0 -0
  84. package/lib/cjs/equal.test.js +22 -0
  85. package/{build → lib/cjs}/flags.d.ts +0 -0
  86. package/lib/cjs/flags.js +52 -0
  87. package/{build → lib/cjs}/flags.test.d.ts +0 -0
  88. package/lib/cjs/flags.test.js +37 -0
  89. package/{build → lib/cjs}/fs.d.ts +0 -0
  90. package/lib/cjs/fs.js +151 -0
  91. package/{build → lib/cjs}/fs.test.d.ts +0 -0
  92. package/lib/cjs/fs.test.js +45 -0
  93. package/{build → lib/cjs}/generator.d.ts +0 -0
  94. package/lib/cjs/generator.js +14 -0
  95. package/{build → lib/cjs}/generator.test.d.ts +0 -0
  96. package/lib/cjs/generator.test.js +26 -0
  97. package/{build → lib/cjs}/is_browser.d.ts +0 -0
  98. package/lib/cjs/is_browser.js +4 -0
  99. package/{build → lib/cjs}/loader.d.mts +0 -0
  100. package/lib/cjs/loader.mjs +40 -0
  101. package/{build → lib/cjs}/lock.d.ts +0 -0
  102. package/lib/cjs/lock.js +27 -0
  103. package/{build → lib/cjs}/lock.test.d.ts +0 -0
  104. package/lib/cjs/lock.test.js +18 -0
  105. package/{build → lib/cjs}/log.d.ts +0 -0
  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/{build/dom/types/html.js → lib/cjs/observable/observable.test.d.ts} +0 -0
  112. package/lib/cjs/observable/observable.test.js +65 -0
  113. package/{build → lib/cjs}/range.d.ts +0 -0
  114. package/lib/cjs/range.js +11 -0
  115. package/{build → lib/cjs}/result.d.ts +0 -0
  116. package/lib/cjs/result.js +80 -0
  117. package/{build → lib/cjs}/result.test.d.ts +0 -0
  118. package/lib/cjs/result.test.js +73 -0
  119. package/{build → lib/cjs}/safe.d.ts +0 -0
  120. package/lib/cjs/safe.js +14 -0
  121. package/{build → lib/cjs}/scope/describe.d.ts +4 -0
  122. package/lib/cjs/scope/describe.js +73 -0
  123. package/{build → lib/cjs}/scope/display/console.d.ts +0 -0
  124. package/lib/cjs/scope/display/console.js +25 -0
  125. package/{build → lib/cjs}/scope/display/dom.d.ts +2 -2
  126. package/lib/cjs/scope/display/dom.js +30 -0
  127. package/{build → lib/cjs}/scope/display/junit.d.ts +0 -0
  128. package/lib/cjs/scope/display/junit.js +21 -0
  129. package/{build → lib/cjs}/scope/execute.d.ts +1 -1
  130. package/lib/cjs/scope/execute.js +91 -0
  131. package/{build → lib/cjs}/scope/expect.d.ts +0 -0
  132. package/lib/cjs/scope/expect.js +114 -0
  133. package/{build → lib/cjs}/scope/fix.d.ts +0 -0
  134. package/lib/cjs/scope/fix.js +26 -0
  135. package/{build → lib/cjs}/scope/index.d.ts +0 -0
  136. package/lib/cjs/scope/index.js +15 -0
  137. package/{build → lib/cjs}/scope/scope.d.ts +0 -0
  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 +0 -0
  142. package/lib/cjs/server/http/apps.js +27 -0
  143. package/{build → lib/cjs}/server/http/css.d.ts +0 -0
  144. package/lib/cjs/server/http/css.js +54 -0
  145. package/{build → lib/cjs}/server/http/index.d.ts +0 -0
  146. package/lib/cjs/server/http/index.js +77 -0
  147. package/{build → lib/cjs}/server/http/response.d.ts +0 -0
  148. package/lib/cjs/server/http/response.js +45 -0
  149. package/{build → lib/cjs}/server/http/sitemap.d.ts +0 -0
  150. package/lib/cjs/server/http/sitemap.js +46 -0
  151. package/{build → lib/cjs}/server/http/static.d.ts +0 -0
  152. package/lib/cjs/server/http/static.js +25 -0
  153. package/{build → lib/cjs}/server/http/typescript.d.ts +0 -0
  154. package/lib/cjs/server/http/typescript.js +44 -0
  155. package/{build → lib/cjs}/server/main.d.ts +0 -0
  156. package/lib/cjs/server/main.js +14 -0
  157. package/{build → lib/cjs}/test.d.mts +0 -0
  158. package/lib/cjs/test.mjs +28 -0
  159. package/{build → lib/cjs}/test_all.d.ts +2 -0
  160. package/lib/cjs/test_all.js +30 -0
  161. package/{build → lib/cjs}/transpile.d.mts +0 -0
  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 +1 -1
  166. package/lib/esm/case.d.ts +1 -0
  167. package/{build → lib/esm}/case.js +0 -0
  168. package/lib/esm/components/button_bar.d.ts +8 -0
  169. package/{build → lib/esm}/components/button_bar.js +3 -3
  170. package/lib/esm/components/inline_edit.d.ts +12 -0
  171. package/{build → lib/esm}/components/inline_edit.js +3 -3
  172. package/lib/esm/components/logger.d.ts +6 -0
  173. package/{build → lib/esm}/components/logger.js +3 -3
  174. package/lib/esm/components/select.d.ts +10 -0
  175. package/{build → lib/esm}/components/select.js +2 -2
  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 +3 -3
  180. package/{build/scope/scope.js → lib/esm/components/virtual_scroll.test.d.ts} +0 -0
  181. package/{build → lib/esm}/components/virtual_scroll.test.js +3 -4
  182. package/lib/esm/context.d.ts +15 -0
  183. package/{build → lib/esm}/context.js +3 -3
  184. package/lib/esm/context.test.d.ts +1 -0
  185. package/{build → lib/esm}/context.test.js +0 -0
  186. package/lib/esm/debounce.d.ts +1 -0
  187. package/{build → lib/esm}/debounce.js +0 -0
  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 +0 -0
  194. package/lib/esm/dom/css/border.d.ts +11 -0
  195. package/{build → lib/esm}/dom/css/border.js +0 -0
  196. package/lib/esm/dom/css/constants.d.ts +31 -0
  197. package/{build → lib/esm}/dom/css/constants.js +0 -0
  198. package/lib/esm/dom/css/core.d.ts +5 -0
  199. package/{build → lib/esm}/dom/css/core.js +0 -0
  200. package/lib/esm/dom/css/fstyle.d.ts +5 -0
  201. package/{build → lib/esm}/dom/css/fstyle.js +0 -0
  202. package/lib/esm/dom/css/sizing.d.ts +5 -0
  203. package/{build → lib/esm}/dom/css/sizing.js +0 -0
  204. package/lib/esm/dom/dom.d.ts +27 -0
  205. package/{build → lib/esm}/dom/dom.js +44 -35
  206. package/lib/esm/dom/fc.d.ts +14 -0
  207. package/{build → lib/esm}/dom/fc.js +1 -1
  208. package/lib/esm/dom/fc.test.d.ts +1 -0
  209. package/{build → lib/esm}/dom/fc.test.js +0 -0
  210. package/lib/esm/dom/form/form.app.d.ts +1 -0
  211. package/{build → lib/esm}/dom/form/form.app.js +0 -0
  212. package/lib/esm/dom/form/form.d.ts +26 -0
  213. package/{build → lib/esm}/dom/form/form.js +0 -0
  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 +0 -0
  218. package/lib/esm/dom/html.test.d.ts +1 -0
  219. package/{build → lib/esm}/dom/html.test.js +4 -4
  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 +0 -0
  226. package/lib/esm/dom/router/link.d.ts +6 -0
  227. package/{build → lib/esm}/dom/router/link.js +0 -0
  228. package/lib/esm/dom/router/router.d.ts +12 -0
  229. package/{build → lib/esm}/dom/router/router.js +0 -0
  230. package/lib/esm/dom/svg.d.ts +64 -0
  231. package/{build → lib/esm}/dom/svg.js +0 -0
  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 +0 -0
  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/lib/esm/dom/types/html.js +1 -0
  240. package/lib/esm/dom/xml.d.ts +1 -0
  241. package/{build → lib/esm}/dom/xml.js +1 -2
  242. package/lib/esm/equal.d.ts +5 -0
  243. package/{build → lib/esm}/equal.js +1 -1
  244. package/lib/esm/equal.test.d.ts +1 -0
  245. package/{build → lib/esm}/equal.test.js +0 -0
  246. package/lib/esm/flags.d.ts +7 -0
  247. package/{build → lib/esm}/flags.js +1 -1
  248. package/lib/esm/flags.test.d.ts +1 -0
  249. package/{build → lib/esm}/flags.test.js +0 -0
  250. package/lib/esm/fs.d.ts +48 -0
  251. package/{build → lib/esm}/fs.js +4 -4
  252. package/lib/esm/fs.test.d.ts +1 -0
  253. package/{build → lib/esm}/fs.test.js +0 -0
  254. package/lib/esm/generator.d.ts +1 -0
  255. package/{build → lib/esm}/generator.js +0 -0
  256. package/lib/esm/generator.test.d.ts +1 -0
  257. package/{build → lib/esm}/generator.test.js +0 -0
  258. package/lib/esm/is_browser.d.ts +1 -0
  259. package/{build → lib/esm}/is_browser.js +0 -0
  260. package/lib/esm/loader.d.mts +22 -0
  261. package/{build → lib/esm}/loader.mjs +0 -0
  262. package/lib/esm/lock.d.ts +1 -0
  263. package/{build → lib/esm}/lock.js +0 -0
  264. package/lib/esm/lock.test.d.ts +1 -0
  265. package/{build → lib/esm}/lock.test.js +0 -0
  266. package/lib/esm/log.d.ts +26 -0
  267. package/{build → lib/esm}/log.js +0 -0
  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 +0 -0
  276. package/lib/esm/result.d.ts +31 -0
  277. package/{build → lib/esm}/result.js +1 -1
  278. package/lib/esm/result.test.d.ts +1 -0
  279. package/{build → lib/esm}/result.test.js +0 -0
  280. package/lib/esm/safe.d.ts +1 -0
  281. package/{build → lib/esm}/safe.js +0 -0
  282. package/lib/esm/scope/describe.d.ts +18 -0
  283. package/{build → lib/esm}/scope/describe.js +14 -6
  284. package/lib/esm/scope/display/console.d.ts +2 -0
  285. package/{build → lib/esm}/scope/display/console.js +0 -0
  286. package/lib/esm/scope/display/dom.d.ts +3 -0
  287. package/{build → lib/esm}/scope/display/dom.js +0 -0
  288. package/lib/esm/scope/display/junit.d.ts +2 -0
  289. package/{build → lib/esm}/scope/display/junit.js +0 -0
  290. package/lib/esm/scope/execute.d.ts +12 -0
  291. package/{build → lib/esm}/scope/execute.js +2 -2
  292. package/lib/esm/scope/expect.d.ts +23 -0
  293. package/{build → lib/esm}/scope/expect.js +0 -0
  294. package/lib/esm/scope/fix.d.ts +4 -0
  295. package/{build → lib/esm}/scope/fix.js +0 -0
  296. package/{build/scope/index.js → lib/esm/scope/index.d.ts} +0 -0
  297. package/lib/esm/scope/index.js +3 -0
  298. package/lib/esm/scope/scope.d.ts +17 -0
  299. package/lib/esm/scope/scope.js +1 -0
  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 +0 -0
  304. package/lib/esm/server/http/css.d.ts +5 -0
  305. package/{build → lib/esm}/server/http/css.js +3 -0
  306. package/lib/esm/server/http/index.d.ts +21 -0
  307. package/{build → lib/esm}/server/http/index.js +0 -0
  308. package/lib/esm/server/http/response.d.ts +4 -0
  309. package/{build → lib/esm}/server/http/response.js +0 -0
  310. package/lib/esm/server/http/sitemap.d.ts +2 -0
  311. package/{build → lib/esm}/server/http/sitemap.js +0 -0
  312. package/lib/esm/server/http/static.d.ts +2 -0
  313. package/{build → lib/esm}/server/http/static.js +0 -0
  314. package/lib/esm/server/http/typescript.d.ts +5 -0
  315. package/{build → lib/esm}/server/http/typescript.js +0 -0
  316. package/lib/esm/server/main.d.ts +2 -0
  317. package/{build → lib/esm}/server/main.js +5 -2
  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 +17 -7
  322. package/lib/esm/transpile.d.mts +3 -0
  323. package/{build → lib/esm}/transpile.mjs +0 -0
  324. package/lib/esm/tsconfig.tsbuildinfo +1 -0
  325. package/package.json +17 -18
  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 +5 -6
  330. package/src/components/select.ts +3 -3
  331. package/src/components/test.js +3 -2
  332. package/src/components/virtual_scroll.test.ts +4 -4
  333. package/src/components/virtual_scroll.ts +8 -8
  334. package/src/context.ts +3 -3
  335. package/src/diff.test.ts +48 -0
  336. package/src/diff.ts +84 -0
  337. package/src/dom/css/border.ts +3 -3
  338. package/src/dom/css/core.ts +1 -1
  339. package/src/dom/css/fstyle.ts +2 -2
  340. package/src/dom/css/sizing.ts +1 -1
  341. package/src/dom/dom.ts +73 -61
  342. package/src/dom/fc.test.ts +3 -3
  343. package/src/dom/fc.ts +11 -10
  344. package/src/dom/form/form.app.ts +2 -2
  345. package/src/dom/form/form.ts +3 -3
  346. package/src/dom/html.test.ts +8 -8
  347. package/src/dom/html.ts +7 -10
  348. package/src/dom/observable.test.ts +43 -0
  349. package/src/dom/observable.ts +11 -0
  350. package/src/dom/provide.ts +1 -1
  351. package/src/dom/router/link.ts +2 -2
  352. package/src/dom/router/router.ts +5 -5
  353. package/src/dom/svg.ts +1 -1
  354. package/src/dom/test.ts +8 -2
  355. package/src/dom/types/html.ts +1 -1
  356. package/src/dom/xml.ts +1 -2
  357. package/src/equal.ts +1 -1
  358. package/src/flags.ts +1 -1
  359. package/src/fs.ts +4 -4
  360. package/src/index.html +12 -9
  361. package/src/observable/_notes +21 -8
  362. package/src/observable/event.ts +93 -0
  363. package/src/observable/observable.test.ts +73 -0
  364. package/src/observable/observable.ts +463 -0
  365. package/src/pico/_variables.scss +1 -1
  366. package/src/pico/layout/_sectioning.scss +2 -0
  367. package/src/result.ts +1 -1
  368. package/src/scope/describe.ts +16 -6
  369. package/src/scope/display/console.ts +4 -4
  370. package/src/scope/display/dom.ts +7 -7
  371. package/src/scope/display/junit.ts +3 -3
  372. package/src/scope/execute.ts +4 -7
  373. package/src/scope/expect.ts +3 -3
  374. package/src/scope/state.ts +10 -0
  375. package/src/server/http/css.ts +3 -1
  376. package/src/server/http/sitemap.ts +1 -1
  377. package/src/server/main.ts +9 -2
  378. package/src/test.mjs +22 -18
  379. package/src/test_all.ts +20 -8
  380. package/build/components/test.js +0 -2
  381. package/build/dom/dom.d.ts +0 -27
  382. package/build/dom/form/form.app.d.ts +0 -1
  383. package/build/dom/html.d.ts +0 -117
  384. package/build/dom/router/link.d.ts +0 -6
  385. package/build/dom/svg.d.ts +0 -64
  386. package/build/dom/test.js +0 -2
  387. package/build/test.mjs +0 -23
  388. package/src/observable/observable._js +0 -175
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.display = exports.isDisplay = void 0;
4
+ const isDisplay = (/** @type unknown */ a) => typeof a.toString === "function" ||
5
+ typeof a === "string";
6
+ exports.isDisplay = isDisplay;
7
+ const display = (a) => {
8
+ if ((0, exports.isDisplay)(a)) {
9
+ const str = a.toString();
10
+ if (str === "[object Object]")
11
+ return JSON.stringify(a);
12
+ return str;
13
+ }
14
+ return JSON.stringify(a);
15
+ };
16
+ exports.display = display;
File without changes
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inset = exports.border = exports.rounded = void 0;
4
+ const core_js_1 = require("./core.js");
5
+ function rounded(size = "", side = "") {
6
+ if ((0, core_js_1.isSide)(size)) {
7
+ side = size;
8
+ size = "";
9
+ }
10
+ const sized = (0, core_js_1.getSize)(size);
11
+ return (0, core_js_1.getSide)(side).reduce((prev, curr) => {
12
+ if (curr === "") {
13
+ prev.borderRadius = sized;
14
+ }
15
+ else {
16
+ // @ts-ignore
17
+ prev[`border${curr}Radius`] = sized;
18
+ }
19
+ return prev;
20
+ }, {});
21
+ }
22
+ exports.rounded = rounded;
23
+ function border({ side = "", style = "solid", radius = "", width = 1, color = "black", }) {
24
+ return {};
25
+ }
26
+ exports.border = border;
27
+ function inset(width, color1 = "gray", color2 = "lightgray") {
28
+ return {
29
+ ...border({ side: "tl", width, color: color1, radius: "none" }),
30
+ ...border({ side: "br", width, color: color2, radius: "none" }),
31
+ };
32
+ }
33
+ exports.inset = inset;
File without changes
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Widths = exports.Sides = exports.Sizes = void 0;
4
+ exports.Sizes = {
5
+ none: "0px",
6
+ sm: "0.125rem",
7
+ "": "0.25rem",
8
+ md: "0.375rem",
9
+ lg: "0.5rem",
10
+ xl: "0.75rem",
11
+ "2xl": "1rem",
12
+ "3xl": "1.5rem",
13
+ full: "9999px",
14
+ };
15
+ exports.Sides = {
16
+ "": "",
17
+ t: "Top",
18
+ r: "Right",
19
+ l: "Left",
20
+ b: "Bottom",
21
+ tl: "TopLeft",
22
+ tr: "TopRight",
23
+ bl: "BottomLeft",
24
+ br: "BottomRight",
25
+ };
26
+ exports.Widths = {
27
+ "1/4": "25%",
28
+ "1/2": "50%",
29
+ "3/4": "75%",
30
+ full: "100%",
31
+ };
File without changes
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSide = exports.getSize = exports.isSize = exports.isSide = void 0;
4
+ const constants_js_1 = require("./constants.js");
5
+ function isSide(v) {
6
+ return constants_js_1.Sides[v] !== undefined;
7
+ }
8
+ exports.isSide = isSide;
9
+ function isSize(v) {
10
+ return constants_js_1.Sizes[v] !== undefined;
11
+ }
12
+ exports.isSize = isSize;
13
+ function getSize(size) {
14
+ return constants_js_1.Sizes[size];
15
+ }
16
+ exports.getSize = getSize;
17
+ function getSide(side) {
18
+ switch (side) {
19
+ case "t":
20
+ return [...getSide("tl"), ...getSide("tr")];
21
+ case "r":
22
+ return [...getSide("tr"), ...getSide("br")];
23
+ case "b":
24
+ return [...getSide("br"), ...getSide("bl")];
25
+ case "l":
26
+ return [...getSide("tl"), ...getSide("bl")];
27
+ default:
28
+ return [constants_js_1.Sides[side]];
29
+ }
30
+ }
31
+ exports.getSide = getSide;
File without changes
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.compileFStyle = void 0;
4
+ const case_js_1 = require("../../case.js");
5
+ function compileFStyle(fstyle, prefix = "") {
6
+ const properties = [];
7
+ const rules = [];
8
+ for (const [key, value] of Object.entries(fstyle)) {
9
+ if (typeof value == "string") {
10
+ properties.push({ key, value });
11
+ }
12
+ else {
13
+ rules.push({ key, value });
14
+ }
15
+ }
16
+ let rule = "";
17
+ if (properties.length > 0) {
18
+ rule += `${prefix} {\n`;
19
+ for (const { key, value } of properties) {
20
+ rule += ` ${(0, case_js_1.dashCase)(key)}: ${value};\n`;
21
+ }
22
+ rule += "}\n\n";
23
+ }
24
+ for (const { key, value } of rules) {
25
+ if (key.startsWith("@media")) {
26
+ rule += `${key} {\n`;
27
+ rule += compileFStyle(value, " ");
28
+ rule += `}\n\n`;
29
+ }
30
+ else {
31
+ rule += compileFStyle(value, `${prefix} ${key}`);
32
+ }
33
+ }
34
+ return rule;
35
+ }
36
+ exports.compileFStyle = compileFStyle;
File without changes
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.width = void 0;
4
+ const constants_js_1 = require("./constants.js");
5
+ function width(amount, block) {
6
+ if (amount === undefined && constants_js_1.Widths[block] !== undefined) {
7
+ amount = block;
8
+ }
9
+ return {
10
+ ...(block === "inline" ? { display: "inline-block" } : {}),
11
+ width: constants_js_1.Widths[amount] ?? "0",
12
+ };
13
+ }
14
+ exports.width = width;
@@ -0,0 +1,27 @@
1
+ import { Properties } from "./types/css.js";
2
+ declare const Events: unique symbol;
3
+ export declare const CLEAR: unique symbol;
4
+ export declare type EventHandler = EventListenerOrEventListenerObject;
5
+ export declare type DenormChildren = Node | string | typeof CLEAR;
6
+ export declare type DOMElement = Element & DocumentAndElementEventHandlers & ElementCSSInlineStyle;
7
+ export declare type DomAttrs = {
8
+ class: string | string[];
9
+ style: Partial<Properties> | string;
10
+ role: "button" | "list" | "listbox";
11
+ events: Partial<{
12
+ [K in keyof HTMLElementEventMap]: EventHandler | null;
13
+ }>;
14
+ };
15
+ export declare type Attrs<E extends Omit<Element, "update">, S = {}> = Partial<Omit<E, "style"> & S & DomAttrs>;
16
+ export declare type DenormAttrs<E extends Omit<Element, "update">, S = {}> = Attrs<E, S> | DenormChildren;
17
+ declare global {
18
+ interface Element {
19
+ [Events]: Map<string, EventHandler>;
20
+ update(attrs?: DenormAttrs<Element>, ...children: DenormChildren[]): this;
21
+ }
22
+ }
23
+ export declare type DOMUpdates<E extends Element = Element> = [DenormAttrs<E>, ...DenormChildren[]] | DenormChildren[];
24
+ export declare function normalizeArguments<E extends Element>(attrs?: DenormAttrs<E>, children?: DenormChildren[], defaultAttrs?: Attrs<E>): [Attrs<E>, DenormChildren[]];
25
+ export declare function up<E extends Element>(element: Omit<E, "update">, attrs?: DenormAttrs<E>, ...children: DenormChildren[]): E;
26
+ export declare function update(element: Omit<Element, "update">, attrs: Attrs<Element>, children: DenormChildren[]): Element;
27
+ export {};
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = exports.up = exports.normalizeArguments = exports.CLEAR = void 0;
4
+ const Events = Symbol("events");
5
+ exports.CLEAR = Symbol("Clear children");
6
+ function isAttrs(attrs) {
7
+ if (!attrs) {
8
+ return false;
9
+ }
10
+ if (typeof attrs === "object") {
11
+ return !attrs.nodeType;
12
+ }
13
+ return false;
14
+ }
15
+ function normalizeArguments(attrs, children = [], defaultAttrs = {}) {
16
+ let attributes;
17
+ if (isAttrs(attrs)) {
18
+ attributes = attrs;
19
+ }
20
+ else {
21
+ if (attrs !== undefined) {
22
+ children.unshift(attrs);
23
+ }
24
+ attributes = defaultAttrs;
25
+ }
26
+ return [attributes, children.flat()];
27
+ }
28
+ exports.normalizeArguments = normalizeArguments;
29
+ function up(element, attrs, ...children) {
30
+ return update(element, ...normalizeArguments(attrs, children));
31
+ }
32
+ exports.up = up;
33
+ function update(element, attrs, children) {
34
+ // Track events, to remove later
35
+ const $events = (element[Events] ??= new Map());
36
+ const { style = {}, events = {}, ...rest } = attrs;
37
+ Object.entries(events).forEach(([k, v]) => {
38
+ if (v === null) {
39
+ if ($events.has(k)) {
40
+ const listener = $events.get(k);
41
+ element.removeEventListener(k, listener);
42
+ }
43
+ }
44
+ else if (v !== undefined) {
45
+ element.addEventListener(k, v);
46
+ $events.set(k, v);
47
+ }
48
+ });
49
+ const _style = element.style;
50
+ if (_style) {
51
+ if (typeof style === "string") {
52
+ _style.cssText = style;
53
+ }
54
+ else {
55
+ Object.entries(style).forEach(([k, v]) => {
56
+ // @ts-ignore Object.entries is unable to statically look into args
57
+ _style[k] = v;
58
+ });
59
+ }
60
+ }
61
+ Object.entries(rest).forEach(([k, v]) => {
62
+ if (k === "class") {
63
+ v = Array.isArray(v)
64
+ ? v
65
+ : (typeof v === "string" ? v : `${v}`).split(/\s+/m);
66
+ v
67
+ .filter((s) => s !== "")
68
+ .forEach((c) => {
69
+ if (c.startsWith("!")) {
70
+ element.classList.remove(c.substring(1));
71
+ }
72
+ else {
73
+ element.classList.add(c);
74
+ }
75
+ });
76
+ return;
77
+ }
78
+ const useNamespace = element.namespaceURI &&
79
+ element.namespaceURI != "http://www.w3.org/1999/xhtml";
80
+ const remove = !v;
81
+ if (useNamespace) {
82
+ if (remove) {
83
+ element.removeAttributeNS(element.namespaceURI, k);
84
+ }
85
+ else if (v === true) {
86
+ element.setAttributeNS(element.namespaceURI, k, k);
87
+ }
88
+ else {
89
+ element.setAttributeNS(element.namespaceURI, k, v);
90
+ }
91
+ }
92
+ else {
93
+ if (remove) {
94
+ element.removeAttribute(k);
95
+ }
96
+ else if (v === true) {
97
+ element.setAttribute(k, k);
98
+ }
99
+ else {
100
+ element.setAttribute(k, v);
101
+ }
102
+ }
103
+ });
104
+ if (children?.length > 0) {
105
+ element.replaceChildren(...(children[0] === exports.CLEAR ? [] : children));
106
+ }
107
+ element.update ??= (attrs, ...children) => update(element, ...normalizeArguments(attrs, children));
108
+ return element;
109
+ }
110
+ exports.update = update;
@@ -1,12 +1,12 @@
1
- import { DenormChildren, DomAttrs, Updatable } from "./dom.js";
1
+ import { DenormChildren, DomAttrs } from "./dom.js";
2
2
  export declare type Attrs<S> = S & Partial<DomAttrs>;
3
3
  export declare const State: unique symbol;
4
- export interface FCComponent<P extends object, S extends object> extends HTMLElement {
5
- [State]: Partial<S>;
6
- update(attrs?: Partial<Attrs<P>> | DenormChildren, ...children: DenormChildren[]): void;
4
+ export interface FCComponent<P extends object, S extends object> extends Element {
5
+ [State]?: Partial<S>;
6
+ update(attrs?: Partial<Attrs<P> & DomAttrs> | DenormChildren, ...children: DenormChildren[]): this;
7
7
  }
8
8
  export interface RenderFn<P extends object, S extends object> {
9
- (el: FCComponent<P, S>, attrs: Attrs<P>, children: DenormChildren[]): Updatable<Element> | Updatable<Element>[];
9
+ (el: FCComponent<P, S>, attrs: Attrs<P>, children: DenormChildren[]): Element | Element[];
10
10
  }
11
11
  export interface FCComponentCtor<P extends object, S extends object> {
12
12
  (attrs?: Attrs<P> | DenormChildren, ...children: DenormChildren[]): FCComponent<P, S>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FC = exports.State = void 0;
4
+ const dom_js_1 = require("./dom.js");
5
+ exports.State = Symbol();
6
+ function FC(name, component) {
7
+ class FCImpl extends HTMLElement {
8
+ constructor() {
9
+ super();
10
+ }
11
+ [exports.State] = {};
12
+ #attrs = {};
13
+ #children = [];
14
+ update(attrs, ...children) {
15
+ [attrs, children] = (0, dom_js_1.normalizeArguments)(attrs, children);
16
+ if (children[0] === dom_js_1.CLEAR) {
17
+ this.#children = [];
18
+ }
19
+ else if (children.length > 0) {
20
+ this.#children = children;
21
+ }
22
+ this.#attrs = { ...this.#attrs, ...attrs };
23
+ // Apply updates from the attrs to the dom node itself
24
+ (0, dom_js_1.update)(this, this.#attrs, []);
25
+ // Re-run the component function using new element, attrs, and children.
26
+ const replace = [component(this, this.#attrs, this.#children)];
27
+ this.replaceChildren(...replace.flat());
28
+ return this;
29
+ }
30
+ }
31
+ customElements.define(name, FCImpl);
32
+ const ctor = (attrs, ...children) => {
33
+ const element = document.createElement(name);
34
+ element.update(attrs, ...children);
35
+ return element;
36
+ };
37
+ return ctor;
38
+ }
39
+ exports.FC = FC;
File without changes
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_js_1 = require("../scope/index.js");
4
+ const fc_js_1 = require("./fc.js");
5
+ const html_js_1 = require("./html.js");
6
+ (0, index_js_1.describe)("FC", () => {
7
+ (0, index_js_1.it)("creates FCs", () => {
8
+ const Input = (0, fc_js_1.FC)("fc-input", (el, attrs, children) => (0, html_js_1.label)(attrs.placeholder ?? attrs.name, (0, html_js_1.input)(attrs), ...children));
9
+ const f = (0, html_js_1.form)({ action: "#", method: "POST" }, (0, html_js_1.div)({ class: "grid" }, Input({
10
+ name: "firstName",
11
+ placeholder: "First Name",
12
+ required: true,
13
+ }), Input({
14
+ name: "lastName",
15
+ placeholder: "Last Name",
16
+ required: true,
17
+ })), Input({ name: "email", type: "email", placeholder: "E-Mail" }, (0, html_js_1.small)("We'll never share your information.")), (0, html_js_1.button)({ type: "submit" }, "Submit"));
18
+ // document.body.appendChild(f);
19
+ (0, index_js_1.expect)(f.children.length).toBe(3);
20
+ (0, index_js_1.expect)(f.querySelectorAll("input[required]").length).toBe(2);
21
+ (0, index_js_1.expect)(f.querySelectorAll('input[name="firstName"]').length).toBe(1);
22
+ });
23
+ });
@@ -0,0 +1 @@
1
+ export declare const App: () => HTMLElement;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.App = void 0;
4
+ const html_js_1 = require("../html.js");
5
+ const form_js_1 = require("./form.js");
6
+ const App = () => (0, html_js_1.main)({ class: "container" }, (0, html_js_1.article)((0, form_js_1.Form)({
7
+ events: {
8
+ submit(event) {
9
+ console.log("Should see fields for firstname, lastname, email, etc");
10
+ console.log(event);
11
+ },
12
+ },
13
+ }, (0, html_js_1.div)({ class: "grid" }, (0, form_js_1.Input)({ id: "firstname", placeholder: "First name" }), (0, form_js_1.Input)({ id: "lastname", placeholder: "Last name" })), (0, form_js_1.Input)({
14
+ id: "email",
15
+ type: "email",
16
+ placeholder: "Email address",
17
+ required: true,
18
+ }, (0, html_js_1.small)("We will never share your email with anyone.")), (0, html_js_1.button)({ type: "submit" }, "Submit"), (0, html_js_1.div)({ class: "grid" }, (0, form_js_1.Input)({ id: "valid", placeholder: "Valid", "aria-invalid": "false" }), (0, form_js_1.Input)({
19
+ id: "invalid",
20
+ placeholder: "Invalid",
21
+ "aria-invalid": "true",
22
+ }), (0, form_js_1.Input)({ id: "disabled", placeholder: "Disabled", disabled: true }), (0, form_js_1.Input)({ id: "readonly", value: "Readonly", readOnly: true }))
23
+ // Dropdown({id: 'fruit', label: "Fruit", placeholder: "Select a fruit...", options: ['Banana', 'Watermelon', 'Apple', 'Orange', 'Mango']}),
24
+ // Radios({legend: 'Size', options: {small: 'Small', medium: 'Medium', large: 'Large', extralarge: "Extra Large"}, checked: 'small'}),
25
+ // Checkboxes({options: {terms: 'I agree to the Terms and Conditions', termsSharing: {label: 'I agree to share my information with partners', disabled: true, checked: true}}),
26
+ )));
27
+ exports.App = App;
@@ -1,26 +1,26 @@
1
1
  import { DenormChildren } from "../dom.js";
2
2
  import { label } from "../html.js";
3
- import { FormAttributes, InputAttributes, LabelAttributes, OptionAttributes, SelectAttributes } from "../types/html.js";
4
- export declare const Form: (attrs: FormAttributes, ...children: DenormChildren[]) => import("../html.js").UHTMLElement<HTMLFormElement>;
5
- export declare const Input: (attrs: InputAttributes, ...children: DenormChildren[]) => import("../html.js").UHTMLElement<HTMLLabelElement>;
3
+ import { FormAttributes, InputAttributes, LabelAttributes, OptionAttributes, SelectAttributes } from "../types/html";
4
+ export declare const Form: (attrs: FormAttributes, ...children: DenormChildren[]) => HTMLFormElement;
5
+ export declare const Input: (attrs: InputAttributes, ...children: DenormChildren[]) => HTMLLabelElement;
6
6
  export declare const Select: (attrs: {
7
7
  options: string[] | {};
8
8
  selected?: string;
9
- } & SelectAttributes & LabelAttributes) => import("../html.js").UHTMLElement<HTMLLabelElement>;
9
+ } & SelectAttributes & LabelAttributes) => HTMLLabelElement;
10
10
  export declare const Button: () => void;
11
11
  declare const prepareOptions: (attrs: string[] | Record<string, string | {
12
12
  label: string;
13
13
  disabled?: boolean | undefined;
14
14
  selected?: boolean | undefined;
15
15
  }>, selected?: string) => Parameters<typeof Option>[0][];
16
- export declare const Option: (attrs: OptionAttributes) => import("../html.js").UHTMLElement<HTMLOptionElement>;
16
+ export declare const Option: (attrs: OptionAttributes) => HTMLOptionElement;
17
17
  export declare const Dropdown: (attrs: SelectAttributes | {
18
18
  selected?: string;
19
- }, ...options: Parameters<typeof prepareOptions>[0][]) => import("../html.js").UHTMLElement<HTMLLabelElement>;
19
+ }, ...options: Parameters<typeof prepareOptions>[0][]) => HTMLLabelElement;
20
20
  export declare const Radios: () => void;
21
21
  export declare const Checks: () => void;
22
22
  export declare const Switches: () => void;
23
- export declare const Radio: (attrs: Omit<InputAttributes, "type">) => import("../html.js").UHTMLElement<HTMLLabelElement>;
24
- export declare const Checkbox: (attrs: Omit<InputAttributes, "type">) => import("../html.js").UHTMLElement<HTMLLabelElement>;
25
- export declare const Switch: () => import("../html.js").UHTMLElement<HTMLLabelElement>;
23
+ export declare const Radio: (attrs: Omit<InputAttributes, "type">) => HTMLLabelElement;
24
+ export declare const Checkbox: (attrs: Omit<InputAttributes, "type">) => HTMLLabelElement;
25
+ export declare const Switch: () => HTMLLabelElement;
26
26
  export {};
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Switch = exports.Checkbox = exports.Radio = exports.Switches = exports.Checks = exports.Radios = exports.Dropdown = exports.Option = exports.Button = exports.Select = exports.Input = exports.Form = void 0;
4
+ const html_js_1 = require("../html.js");
5
+ const Form = (attrs, ...children) => {
6
+ if (attrs.events?.submit) {
7
+ const submit = attrs.events.submit;
8
+ attrs.events.submit = (event) => {
9
+ event.preventDefault();
10
+ submit(event);
11
+ };
12
+ }
13
+ return (0, html_js_1.form)(attrs, ...children);
14
+ };
15
+ exports.Form = Form;
16
+ const Input = (attrs, ...children) => (0, html_js_1.label)((0, html_js_1.input)(attrs), ...children);
17
+ exports.Input = Input;
18
+ const Select = (attrs) => (0, html_js_1.label)({ style: attrs.style ?? {} }, (0, html_js_1.select)({ events: attrs.events ?? {} }, ...prepareOptions(attrs.options, attrs.selected).map(exports.Option)));
19
+ exports.Select = Select;
20
+ const Button = () => { };
21
+ exports.Button = Button;
22
+ const prepareOptions = (attrs, selected) => Array.isArray(attrs)
23
+ ? attrs.map((value) => ({
24
+ value,
25
+ label: value,
26
+ selected: selected == value,
27
+ }))
28
+ : Object.entries(attrs).map(([value, label]) => typeof label === "string"
29
+ ? { value, label, selected: selected === value }
30
+ : { value, ...label });
31
+ const Option = (attrs) => (0, html_js_1.option)(attrs);
32
+ exports.Option = Option;
33
+ const Dropdown = (attrs, ...options) => (0, exports.Select)({
34
+ ...attrs,
35
+ options: typeof options[0] == "string" ? options : options[0],
36
+ });
37
+ exports.Dropdown = Dropdown;
38
+ const Radios = () => { };
39
+ exports.Radios = Radios;
40
+ const Checks = () => { };
41
+ exports.Checks = Checks;
42
+ const Switches = () => { };
43
+ exports.Switches = Switches;
44
+ const Radio = (attrs) => (0, exports.Input)({ type: "radio" });
45
+ exports.Radio = Radio;
46
+ const Checkbox = (attrs) => (0, exports.Input)({ type: "checkbox" });
47
+ exports.Checkbox = Checkbox;
48
+ const Switch = () => (0, exports.Checkbox)({ role: "switch" });
49
+ exports.Switch = Switch;
File without changes
File without changes