@davidsouther/jiffies 2.2.4 → 2.3.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 (367) hide show
  1. package/LICENSE +1 -1
  2. package/lib/cjs/assert.d.ts +2 -2
  3. package/lib/cjs/awaitable.d.ts +1 -1
  4. package/lib/cjs/components/button_bar.d.ts +2 -2
  5. package/lib/cjs/components/inline_edit.d.ts +2 -2
  6. package/lib/cjs/components/logger.d.ts +1 -1
  7. package/lib/cjs/components/select.d.ts +4 -7
  8. package/lib/cjs/components/test.d.ts +1 -1
  9. package/lib/cjs/components/virtual_scroll.d.ts +6 -4
  10. package/lib/cjs/context.d.ts +5 -9
  11. package/lib/cjs/debounce.d.ts +1 -1
  12. package/lib/cjs/diff.d.ts +2 -2
  13. package/lib/cjs/display.d.ts +1 -1
  14. package/lib/cjs/dom/css/border.d.ts +2 -2
  15. package/lib/cjs/dom/css/constants.d.ts +3 -3
  16. package/lib/cjs/dom/css/core.d.ts +1 -1
  17. package/lib/cjs/dom/css/fstyle.d.ts +2 -2
  18. package/lib/cjs/dom/css/sizing.d.ts +2 -2
  19. package/lib/cjs/dom/dom.d.ts +8 -8
  20. package/lib/cjs/dom/fc.d.ts +8 -12
  21. package/lib/cjs/dom/form/form.d.ts +5 -6
  22. package/lib/cjs/dom/html.d.ts +112 -113
  23. package/lib/cjs/dom/observable.d.ts +1 -1
  24. package/lib/cjs/dom/provide.d.ts +1 -1
  25. package/lib/cjs/dom/router/router.d.ts +2 -2
  26. package/lib/cjs/dom/svg.d.ts +64 -64
  27. package/lib/cjs/dom/types/css.d.ts +10 -32
  28. package/lib/cjs/dom/types/html.d.ts +4 -6
  29. package/lib/cjs/equal.d.ts +8 -5
  30. package/lib/cjs/flags.d.ts +1 -1
  31. package/lib/cjs/fs.d.ts +3 -3
  32. package/lib/cjs/fs_node.d.ts +1 -1
  33. package/lib/cjs/lock.d.ts +1 -1
  34. package/lib/cjs/log.d.ts +9 -9
  35. package/lib/cjs/observable/event.d.ts +2 -2
  36. package/lib/cjs/observable/observable.d.ts +37 -35
  37. package/lib/cjs/result.d.ts +21 -21
  38. package/lib/cjs/safe.d.ts +1 -1
  39. package/lib/cjs/scope/describe.d.ts +4 -4
  40. package/lib/cjs/scope/display/console.d.ts +1 -1
  41. package/lib/cjs/scope/display/dom.d.ts +2 -2
  42. package/lib/cjs/scope/display/junit.d.ts +1 -1
  43. package/lib/cjs/scope/execute.d.ts +2 -2
  44. package/lib/cjs/scope/index.d.ts +3 -3
  45. package/lib/cjs/scope/scope.d.ts +3 -3
  46. package/lib/cjs/scope/state.d.ts +1 -1
  47. package/lib/cjs/server/http/apps.d.ts +1 -1
  48. package/lib/cjs/server/http/css.d.ts +1 -1
  49. package/lib/cjs/server/http/index.d.ts +4 -9
  50. package/lib/cjs/server/http/response.d.ts +3 -3
  51. package/lib/cjs/server/http/sitemap.d.ts +1 -1
  52. package/lib/cjs/server/http/static.d.ts +1 -1
  53. package/lib/cjs/server/http/typescript.d.ts +1 -1
  54. package/lib/cjs/test_all.d.ts +9 -9
  55. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  56. package/lib/esm/assert.d.ts +2 -2
  57. package/lib/esm/awaitable.d.ts +1 -1
  58. package/lib/esm/components/button_bar.d.ts +2 -2
  59. package/lib/esm/components/inline_edit.d.ts +2 -2
  60. package/lib/esm/components/logger.d.ts +1 -1
  61. package/lib/esm/components/select.d.ts +3 -3
  62. package/lib/esm/components/test.d.ts +1 -1
  63. package/lib/esm/components/virtual_scroll.d.ts +6 -4
  64. package/lib/esm/context.d.ts +5 -9
  65. package/lib/esm/debounce.d.ts +1 -2
  66. package/lib/esm/diff.d.ts +2 -2
  67. package/lib/esm/display.d.ts +1 -1
  68. package/lib/esm/dom/css/border.d.ts +2 -2
  69. package/lib/esm/dom/css/constants.d.ts +3 -3
  70. package/lib/esm/dom/css/core.d.ts +1 -1
  71. package/lib/esm/dom/css/fstyle.d.ts +2 -2
  72. package/lib/esm/dom/css/sizing.d.ts +2 -2
  73. package/lib/esm/dom/dom.d.ts +8 -8
  74. package/lib/esm/dom/fc.d.ts +8 -12
  75. package/lib/esm/dom/form/form.d.ts +5 -6
  76. package/lib/esm/dom/html.d.ts +112 -113
  77. package/lib/esm/dom/observable.d.ts +1 -1
  78. package/lib/esm/dom/provide.d.ts +1 -1
  79. package/lib/esm/dom/router/router.d.ts +2 -2
  80. package/lib/esm/dom/svg.d.ts +64 -64
  81. package/lib/esm/dom/types/css.d.ts +10 -32
  82. package/lib/esm/dom/types/html.d.ts +4 -6
  83. package/lib/esm/equal.d.ts +8 -5
  84. package/lib/esm/flags.d.ts +1 -1
  85. package/lib/esm/fs.d.ts +3 -3
  86. package/lib/esm/fs_node.d.ts +1 -1
  87. package/lib/esm/lock.d.ts +1 -1
  88. package/lib/esm/log.d.ts +9 -9
  89. package/lib/esm/observable/event.d.ts +2 -2
  90. package/lib/esm/observable/observable.d.ts +37 -35
  91. package/lib/esm/result.d.ts +21 -21
  92. package/lib/esm/safe.d.ts +1 -1
  93. package/lib/esm/scope/describe.d.ts +4 -4
  94. package/lib/esm/scope/display/console.d.ts +1 -1
  95. package/lib/esm/scope/display/dom.d.ts +2 -2
  96. package/lib/esm/scope/display/junit.d.ts +1 -1
  97. package/lib/esm/scope/execute.d.ts +2 -2
  98. package/lib/esm/scope/index.d.ts +3 -3
  99. package/lib/esm/scope/scope.d.ts +3 -3
  100. package/lib/esm/scope/state.d.ts +1 -1
  101. package/lib/esm/server/http/apps.d.ts +1 -1
  102. package/lib/esm/server/http/css.d.ts +1 -1
  103. package/lib/esm/server/http/index.d.ts +4 -9
  104. package/lib/esm/server/http/response.d.ts +3 -3
  105. package/lib/esm/server/http/sitemap.d.ts +1 -1
  106. package/lib/esm/server/http/static.d.ts +1 -1
  107. package/lib/esm/server/http/typescript.d.ts +1 -1
  108. package/lib/esm/test_all.d.ts +9 -9
  109. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  110. package/package.json +11 -9
  111. package/src/assert.ts +5 -5
  112. package/src/components/button_bar.ts +28 -30
  113. package/src/components/inline_edit.ts +8 -7
  114. package/src/components/logger.ts +6 -6
  115. package/src/components/select.ts +7 -7
  116. package/src/components/test.ts +5 -0
  117. package/src/components/virtual_scroll.test.ts +9 -6
  118. package/src/components/virtual_scroll.ts +29 -24
  119. package/src/context.test.ts +4 -4
  120. package/src/context.ts +16 -11
  121. package/src/debounce.ts +9 -3
  122. package/src/diff.test.ts +4 -4
  123. package/src/diff.ts +14 -16
  124. package/src/dom/css/border.ts +11 -11
  125. package/src/dom/css/core.ts +1 -1
  126. package/src/dom/css/fstyle.ts +4 -4
  127. package/src/dom/css/sizing.ts +1 -1
  128. package/src/dom/dom.ts +57 -47
  129. package/src/dom/fc.test.ts +8 -8
  130. package/src/dom/fc.ts +32 -35
  131. package/src/dom/form/form.app.ts +9 -9
  132. package/src/dom/form/form.ts +25 -16
  133. package/src/dom/form/index.html +3 -2
  134. package/src/dom/html.test.ts +12 -10
  135. package/src/dom/html.ts +2 -3
  136. package/src/dom/observable.test.ts +6 -6
  137. package/src/dom/observable.ts +2 -2
  138. package/src/dom/provide.ts +1 -1
  139. package/src/dom/router/link.ts +3 -3
  140. package/src/dom/router/router.ts +5 -5
  141. package/src/dom/svg.ts +7 -6
  142. package/src/dom/test.ts +3 -0
  143. package/src/dom/types/css.ts +43 -61
  144. package/src/dom/types/html.ts +2 -4
  145. package/src/dom/xml.ts +2 -2
  146. package/src/equal.test.ts +3 -3
  147. package/src/equal.ts +27 -14
  148. package/src/flags.test.ts +2 -2
  149. package/src/flags.ts +2 -2
  150. package/src/fs.test.ts +5 -5
  151. package/src/fs.ts +26 -20
  152. package/src/fs_node.ts +4 -4
  153. package/src/fs_win.test.ts +1 -1
  154. package/src/generator.test.ts +4 -3
  155. package/src/generator.ts +1 -1
  156. package/src/hooks/_notes +4 -1
  157. package/src/index.html +7 -7
  158. package/src/lock.test.ts +4 -4
  159. package/src/lock.ts +8 -7
  160. package/src/log.ts +28 -18
  161. package/src/observable/event.ts +7 -7
  162. package/src/observable/observable.test.ts +3 -3
  163. package/src/observable/observable.ts +71 -52
  164. package/src/result.test.ts +7 -10
  165. package/src/result.ts +51 -47
  166. package/src/safe.ts +1 -1
  167. package/src/scope/describe.ts +12 -11
  168. package/src/scope/display/console.ts +4 -4
  169. package/src/scope/display/dom.ts +9 -9
  170. package/src/scope/display/junit.ts +21 -24
  171. package/src/scope/execute.ts +17 -12
  172. package/src/scope/expect.ts +22 -22
  173. package/src/scope/fix.ts +10 -7
  174. package/src/scope/index.ts +3 -3
  175. package/src/scope/scope.ts +2 -2
  176. package/src/scope/state.ts +2 -2
  177. package/src/server/http/apps.ts +5 -5
  178. package/src/server/http/css.ts +10 -26
  179. package/src/server/http/index.ts +30 -24
  180. package/src/server/http/response.ts +12 -5
  181. package/src/server/http/sitemap.ts +8 -8
  182. package/src/server/http/static.ts +9 -6
  183. package/src/server/http/typescript.ts +25 -25
  184. package/src/server/main.ts +7 -4
  185. package/src/test.mjs +8 -8
  186. package/src/test_all.ts +16 -13
  187. package/src/transpile.mjs +6 -18
  188. package/build/pico.css +0 -2466
  189. package/build/pico.css.map +0 -1
  190. package/lib/cjs/assert.js +0 -46
  191. package/lib/cjs/awaitable.js +0 -2
  192. package/lib/cjs/case.js +0 -9
  193. package/lib/cjs/components/button_bar.js +0 -29
  194. package/lib/cjs/components/inline_edit.js +0 -51
  195. package/lib/cjs/components/logger.js +0 -27
  196. package/lib/cjs/components/select.js +0 -6
  197. package/lib/cjs/components/test.js +0 -7
  198. package/lib/cjs/components/virtual_scroll.js +0 -102
  199. package/lib/cjs/components/virtual_scroll.test.js +0 -22
  200. package/lib/cjs/context.js +0 -48
  201. package/lib/cjs/context.test.js +0 -48
  202. package/lib/cjs/debounce.js +0 -12
  203. package/lib/cjs/diff.js +0 -58
  204. package/lib/cjs/diff.test.js +0 -41
  205. package/lib/cjs/display.js +0 -16
  206. package/lib/cjs/dom/css/border.js +0 -33
  207. package/lib/cjs/dom/css/constants.js +0 -31
  208. package/lib/cjs/dom/css/core.js +0 -31
  209. package/lib/cjs/dom/css/fstyle.js +0 -36
  210. package/lib/cjs/dom/css/sizing.js +0 -14
  211. package/lib/cjs/dom/dom.js +0 -110
  212. package/lib/cjs/dom/fc.js +0 -39
  213. package/lib/cjs/dom/fc.test.js +0 -23
  214. package/lib/cjs/dom/form/form.app.js +0 -27
  215. package/lib/cjs/dom/form/form.js +0 -49
  216. package/lib/cjs/dom/form/form.test.js +0 -1
  217. package/lib/cjs/dom/html.js +0 -119
  218. package/lib/cjs/dom/html.test.js +0 -60
  219. package/lib/cjs/dom/observable.js +0 -10
  220. package/lib/cjs/dom/observable.test.js +0 -35
  221. package/lib/cjs/dom/provide.js +0 -12
  222. package/lib/cjs/dom/router/link.js +0 -7
  223. package/lib/cjs/dom/router/router.js +0 -55
  224. package/lib/cjs/dom/svg.js +0 -69
  225. package/lib/cjs/dom/test.js +0 -13
  226. package/lib/cjs/dom/types/css.js +0 -24
  227. package/lib/cjs/dom/types/dom.js +0 -1
  228. package/lib/cjs/dom/types/html.js +0 -2
  229. package/lib/cjs/dom/xml.js +0 -8
  230. package/lib/cjs/equal.js +0 -48
  231. package/lib/cjs/equal.test.js +0 -22
  232. package/lib/cjs/flags.js +0 -52
  233. package/lib/cjs/flags.test.js +0 -37
  234. package/lib/cjs/fs.js +0 -235
  235. package/lib/cjs/fs.test.js +0 -86
  236. package/lib/cjs/fs_node.js +0 -50
  237. package/lib/cjs/fs_win.test.js +0 -10
  238. package/lib/cjs/generator.js +0 -14
  239. package/lib/cjs/generator.test.js +0 -26
  240. package/lib/cjs/is_browser.js +0 -4
  241. package/lib/cjs/loader-register.d.mts +0 -1
  242. package/lib/cjs/loader-register.d.ts +0 -1
  243. package/lib/cjs/loader-register.js +0 -4
  244. package/lib/cjs/loader-register.mjs +0 -4
  245. package/lib/cjs/loader.d.mts +0 -23
  246. package/lib/cjs/loader.mjs +0 -41
  247. package/lib/cjs/lock.js +0 -27
  248. package/lib/cjs/lock.test.js +0 -18
  249. package/lib/cjs/log.js +0 -98
  250. package/lib/cjs/observable/event.js +0 -61
  251. package/lib/cjs/observable/observable.js +0 -363
  252. package/lib/cjs/observable/observable.test.js +0 -65
  253. package/lib/cjs/package.json +0 -1
  254. package/lib/cjs/range.js +0 -11
  255. package/lib/cjs/result.js +0 -80
  256. package/lib/cjs/result.test.js +0 -78
  257. package/lib/cjs/safe.js +0 -14
  258. package/lib/cjs/scope/describe.js +0 -73
  259. package/lib/cjs/scope/display/console.js +0 -25
  260. package/lib/cjs/scope/display/dom.js +0 -30
  261. package/lib/cjs/scope/display/junit.js +0 -21
  262. package/lib/cjs/scope/execute.js +0 -91
  263. package/lib/cjs/scope/expect.js +0 -110
  264. package/lib/cjs/scope/fix.js +0 -26
  265. package/lib/cjs/scope/index.js +0 -15
  266. package/lib/cjs/scope/scope.js +0 -2
  267. package/lib/cjs/scope/state.js +0 -12
  268. package/lib/cjs/server/http/apps.js +0 -27
  269. package/lib/cjs/server/http/css.js +0 -54
  270. package/lib/cjs/server/http/index.js +0 -77
  271. package/lib/cjs/server/http/response.js +0 -45
  272. package/lib/cjs/server/http/sitemap.js +0 -46
  273. package/lib/cjs/server/http/static.js +0 -25
  274. package/lib/cjs/server/http/typescript.js +0 -44
  275. package/lib/cjs/server/main.js +0 -14
  276. package/lib/cjs/test.mjs +0 -28
  277. package/lib/cjs/test_all.js +0 -30
  278. package/lib/cjs/transpile.mjs +0 -22
  279. package/lib/esm/assert.js +0 -38
  280. package/lib/esm/awaitable.js +0 -1
  281. package/lib/esm/case.js +0 -5
  282. package/lib/esm/components/button_bar.js +0 -27
  283. package/lib/esm/components/inline_edit.js +0 -48
  284. package/lib/esm/components/logger.js +0 -22
  285. package/lib/esm/components/select.js +0 -3
  286. package/lib/esm/components/test.js +0 -3
  287. package/lib/esm/components/virtual_scroll.js +0 -94
  288. package/lib/esm/components/virtual_scroll.test.js +0 -20
  289. package/lib/esm/context.js +0 -43
  290. package/lib/esm/context.test.js +0 -46
  291. package/lib/esm/debounce.js +0 -8
  292. package/lib/esm/diff.js +0 -54
  293. package/lib/esm/diff.test.js +0 -39
  294. package/lib/esm/display.js +0 -11
  295. package/lib/esm/dom/css/border.js +0 -27
  296. package/lib/esm/dom/css/constants.js +0 -28
  297. package/lib/esm/dom/css/core.js +0 -24
  298. package/lib/esm/dom/css/fstyle.js +0 -32
  299. package/lib/esm/dom/css/sizing.js +0 -10
  300. package/lib/esm/dom/dom.js +0 -104
  301. package/lib/esm/dom/fc.js +0 -35
  302. package/lib/esm/dom/fc.test.js +0 -21
  303. package/lib/esm/dom/form/form.app.js +0 -23
  304. package/lib/esm/dom/form/form.js +0 -34
  305. package/lib/esm/dom/form/form.test.js +0 -1
  306. package/lib/esm/dom/html.js +0 -114
  307. package/lib/esm/dom/html.test.js +0 -58
  308. package/lib/esm/dom/observable.js +0 -6
  309. package/lib/esm/dom/observable.test.js +0 -33
  310. package/lib/esm/dom/provide.js +0 -7
  311. package/lib/esm/dom/router/link.js +0 -3
  312. package/lib/esm/dom/router/router.js +0 -52
  313. package/lib/esm/dom/svg.js +0 -65
  314. package/lib/esm/dom/test.js +0 -9
  315. package/lib/esm/dom/types/css.js +0 -23
  316. package/lib/esm/dom/types/dom.js +0 -1
  317. package/lib/esm/dom/types/html.js +0 -1
  318. package/lib/esm/dom/xml.js +0 -4
  319. package/lib/esm/equal.js +0 -41
  320. package/lib/esm/equal.test.js +0 -20
  321. package/lib/esm/flags.js +0 -48
  322. package/lib/esm/flags.test.js +0 -35
  323. package/lib/esm/fs.js +0 -226
  324. package/lib/esm/fs.test.js +0 -84
  325. package/lib/esm/fs_node.js +0 -45
  326. package/lib/esm/fs_win.test.js +0 -8
  327. package/lib/esm/generator.js +0 -10
  328. package/lib/esm/generator.test.js +0 -24
  329. package/lib/esm/is_browser.js +0 -1
  330. package/lib/esm/loader-register.d.mts +0 -1
  331. package/lib/esm/loader-register.mjs +0 -2
  332. package/lib/esm/loader.d.mts +0 -23
  333. package/lib/esm/loader.mjs +0 -36
  334. package/lib/esm/lock.js +0 -23
  335. package/lib/esm/lock.test.js +0 -16
  336. package/lib/esm/log.js +0 -88
  337. package/lib/esm/observable/event.js +0 -46
  338. package/lib/esm/observable/observable.js +0 -343
  339. package/lib/esm/observable/observable.test.js +0 -63
  340. package/lib/esm/range.js +0 -7
  341. package/lib/esm/result.js +0 -65
  342. package/lib/esm/result.test.js +0 -76
  343. package/lib/esm/safe.js +0 -10
  344. package/lib/esm/scope/describe.js +0 -60
  345. package/lib/esm/scope/display/console.js +0 -21
  346. package/lib/esm/scope/display/dom.js +0 -26
  347. package/lib/esm/scope/display/junit.js +0 -17
  348. package/lib/esm/scope/execute.js +0 -85
  349. package/lib/esm/scope/expect.js +0 -104
  350. package/lib/esm/scope/fix.js +0 -22
  351. package/lib/esm/scope/index.js +0 -3
  352. package/lib/esm/scope/scope.js +0 -1
  353. package/lib/esm/scope/state.js +0 -8
  354. package/lib/esm/server/http/apps.js +0 -23
  355. package/lib/esm/server/http/css.js +0 -50
  356. package/lib/esm/server/http/index.js +0 -73
  357. package/lib/esm/server/http/response.js +0 -40
  358. package/lib/esm/server/http/sitemap.js +0 -42
  359. package/lib/esm/server/http/static.js +0 -21
  360. package/lib/esm/server/http/typescript.js +0 -40
  361. package/lib/esm/server/main.js +0 -12
  362. package/lib/esm/test.mjs +0 -26
  363. package/lib/esm/test_all.js +0 -28
  364. package/lib/esm/transpile.mjs +0 -18
  365. package/src/components/test.js +0 -3
  366. package/src/loader-register.mjs +0 -3
  367. package/src/loader.mjs +0 -46
@@ -1,114 +0,0 @@
1
- import { up } from "./dom.js";
2
- const makeHTMLElement = (name) => (attrs, ...children) => up(document.createElement(name), attrs, ...children);
3
- export const a = makeHTMLElement("a");
4
- export const abbr = makeHTMLElement("abbr");
5
- export const address = makeHTMLElement("address");
6
- export const area = makeHTMLElement("area");
7
- export const article = makeHTMLElement("article");
8
- export const aside = makeHTMLElement("aside");
9
- export const audio = makeHTMLElement("audio");
10
- export const b = makeHTMLElement("b");
11
- export const base = makeHTMLElement("base");
12
- export const bdi = makeHTMLElement("bdi");
13
- export const bdo = makeHTMLElement("bdo");
14
- export const blockquote = makeHTMLElement("blockquote");
15
- export const body = makeHTMLElement("body");
16
- export const br = makeHTMLElement("br");
17
- export const button = makeHTMLElement("button");
18
- export const canvas = makeHTMLElement("canvas");
19
- export const caption = makeHTMLElement("caption");
20
- export const cite = makeHTMLElement("cite");
21
- export const code = makeHTMLElement("code");
22
- export const col = makeHTMLElement("col");
23
- export const colgroup = makeHTMLElement("colgroup");
24
- export const data = makeHTMLElement("data");
25
- export const datalist = makeHTMLElement("datalist");
26
- export const dd = makeHTMLElement("dd");
27
- export const del = makeHTMLElement("del");
28
- export const details = makeHTMLElement("details");
29
- export const dfn = makeHTMLElement("dfn");
30
- export const dialog = makeHTMLElement("dialog");
31
- export const div = makeHTMLElement("div");
32
- export const dl = makeHTMLElement("dl");
33
- export const dt = makeHTMLElement("dt");
34
- export const em = makeHTMLElement("em");
35
- export const embed = makeHTMLElement("embed");
36
- export const fieldset = makeHTMLElement("fieldset");
37
- export const figcaption = makeHTMLElement("figcaption");
38
- export const figure = makeHTMLElement("figure");
39
- export const footer = makeHTMLElement("footer");
40
- export const form = makeHTMLElement("form");
41
- export const h1 = makeHTMLElement("h1");
42
- export const h2 = makeHTMLElement("h2");
43
- export const h3 = makeHTMLElement("h3");
44
- export const h4 = makeHTMLElement("h4");
45
- export const h5 = makeHTMLElement("h5");
46
- export const h6 = makeHTMLElement("h6");
47
- export const head = makeHTMLElement("head");
48
- export const header = makeHTMLElement("header");
49
- export const hgroup = makeHTMLElement("hgroup");
50
- export const hr = makeHTMLElement("hr");
51
- export const html = makeHTMLElement("html");
52
- export const i = makeHTMLElement("i");
53
- export const iframe = makeHTMLElement("iframe");
54
- export const img = makeHTMLElement("img");
55
- export const input = makeHTMLElement("input");
56
- export const ins = makeHTMLElement("ins");
57
- export const kbd = makeHTMLElement("kbd");
58
- export const label = makeHTMLElement("label");
59
- export const legend = makeHTMLElement("legend");
60
- export const li = makeHTMLElement("li");
61
- export const link = makeHTMLElement("link");
62
- export const main = makeHTMLElement("main");
63
- export const map = makeHTMLElement("map");
64
- export const mark = makeHTMLElement("mark");
65
- export const menu = makeHTMLElement("menu");
66
- export const meta = makeHTMLElement("meta");
67
- export const meter = makeHTMLElement("meter");
68
- export const nav = makeHTMLElement("nav");
69
- export const noscript = makeHTMLElement("noscript");
70
- export const object = makeHTMLElement("object");
71
- export const ol = makeHTMLElement("ol");
72
- export const optgroup = makeHTMLElement("optgroup");
73
- export const option = makeHTMLElement("option");
74
- export const output = makeHTMLElement("output");
75
- export const p = makeHTMLElement("p");
76
- export const param = makeHTMLElement("param");
77
- export const picture = makeHTMLElement("picture");
78
- export const pre = makeHTMLElement("pre");
79
- export const progress = makeHTMLElement("progress");
80
- export const q = makeHTMLElement("q");
81
- export const rp = makeHTMLElement("rp");
82
- export const rt = makeHTMLElement("rt");
83
- export const ruby = makeHTMLElement("ruby");
84
- export const s = makeHTMLElement("s");
85
- export const samp = makeHTMLElement("samp");
86
- export const script = makeHTMLElement("script");
87
- export const section = makeHTMLElement("section");
88
- export const select = makeHTMLElement("select");
89
- export const slot = makeHTMLElement("slot");
90
- export const small = makeHTMLElement("small");
91
- export const source = makeHTMLElement("source");
92
- export const span = makeHTMLElement("span");
93
- export const strong = makeHTMLElement("strong");
94
- export const style = makeHTMLElement("style");
95
- export const sub = makeHTMLElement("sub");
96
- export const summary = makeHTMLElement("summary");
97
- export const sup = makeHTMLElement("sup");
98
- export const table = makeHTMLElement("table");
99
- export const tbody = makeHTMLElement("tbody");
100
- export const td = makeHTMLElement("td");
101
- export const template = makeHTMLElement("template");
102
- export const textarea = makeHTMLElement("textarea");
103
- export const tfoot = makeHTMLElement("tfoot");
104
- export const th = makeHTMLElement("th");
105
- export const thead = makeHTMLElement("thead");
106
- export const time = makeHTMLElement("time");
107
- export const title = makeHTMLElement("title");
108
- export const tr = makeHTMLElement("tr");
109
- export const track = makeHTMLElement("track");
110
- export const u = makeHTMLElement("u");
111
- export const ul = makeHTMLElement("ul");
112
- export const htmlvar = makeHTMLElement("var"); // var is reserved, export as variable
113
- export const video = makeHTMLElement("video");
114
- export const wbr = makeHTMLElement("wbr");
@@ -1,58 +0,0 @@
1
- import { describe, it } from "../scope/describe.js";
2
- import { expect } from "../scope/expect.js";
3
- import { table, tbody, td, th, thead, tr, button } from "./html.js";
4
- describe("html", () => {
5
- it("creates HTML Elements", () => {
6
- let tableBody;
7
- const myTable = table(thead(tr(th("Col A"), th("Col B"))), (tableBody = tbody()));
8
- for (let x = 1; x <= 3; x++) {
9
- tableBody.appendChild(tr(td(`${x}`), td(`${x * 2}`)));
10
- }
11
- expect(myTable.textContent).toEqual("Col ACol B122436");
12
- });
13
- it("attaches event handlers", () => {
14
- let clicked = 0;
15
- const btn = button({
16
- events: {
17
- click: () => {
18
- clicked += 1;
19
- },
20
- },
21
- });
22
- btn.dispatchEvent(new Event("click"));
23
- expect(clicked).toBe(1);
24
- });
25
- it("removes event handlers", () => {
26
- let clicked = 0;
27
- const btn = button({
28
- events: {
29
- click: () => {
30
- clicked += 1;
31
- },
32
- },
33
- });
34
- btn.dispatchEvent(new Event("click"));
35
- expect(clicked).toBe(1);
36
- btn.update({ events: { click: null } });
37
- btn.dispatchEvent(new Event("click"));
38
- expect(clicked).toBe(1);
39
- });
40
- it("sets style properties", () => {
41
- const btn = button({
42
- style: { flexDirection: "column" },
43
- });
44
- expect(btn.style.flexDirection).toBe("column");
45
- });
46
- it("sets style, attributes, and events together", () => {
47
- let clicked = false;
48
- const btn = button({
49
- class: "test-class",
50
- style: { flexDirection: "column" },
51
- events: { click: () => (clicked = true) },
52
- });
53
- btn.dispatchEvent(new Event("click"));
54
- expect(btn.classList.contains("test-class")).toBe(true);
55
- expect(btn.style.flexDirection).toBe("column");
56
- expect(clicked).toBe(true);
57
- });
58
- });
@@ -1,6 +0,0 @@
1
- export function O(element, observable) {
2
- observable.subscribe((t) => {
3
- element.update(...t);
4
- });
5
- return element;
6
- }
@@ -1,33 +0,0 @@
1
- import { O } from "./observable.js";
2
- import { Subject, map } from "../observable/observable.js";
3
- import { describe, it } from "../scope/describe.js";
4
- import { expect } from "../scope/expect.js";
5
- import { div, span } from "./html.js";
6
- describe("DOM Observable", () => {
7
- it("updates a dom node with observable results", async () => {
8
- const subject = new Subject();
9
- const observable = subject.pipe(map((s) => [s]));
10
- const element = O(div(), observable);
11
- expect(element.innerText).toEqual("");
12
- await subject.next("H");
13
- expect(element.innerText).toEqual("H");
14
- await subject.next("He");
15
- expect(element.innerText).toEqual("He");
16
- });
17
- it("updates a dom node's attributes", async () => {
18
- const classes = new Subject();
19
- const observable = classes.map((c) => [{ class: c.join(" ") }]);
20
- const element = O(span(), observable);
21
- expect(element.classList.contains("warning")).toBe(false);
22
- expect(element.classList.contains("error")).toBe(false);
23
- await classes.next(["warning"]);
24
- expect(element.classList.contains("warning")).toBe(true);
25
- expect(element.classList.contains("error")).toBe(false);
26
- await classes.next(["error"]);
27
- expect(element.classList.contains("warning")).toBe(true);
28
- expect(element.classList.contains("error")).toBe(true);
29
- await classes.next(["!warning", "!error"]);
30
- expect(element.classList.contains("warning")).toBe(false);
31
- expect(element.classList.contains("error")).toBe(false);
32
- });
33
- });
@@ -1,7 +0,0 @@
1
- let registry = {};
2
- export function provide(items) {
3
- registry = { ...registry, ...items };
4
- }
5
- export function retrieve(key) {
6
- return registry[key];
7
- }
@@ -1,3 +0,0 @@
1
- import { a } from "../html.js";
2
- import { Router } from "./router.js";
3
- export const link = ({ href, link }) => a({ href: Router.href(href), events: { click: Router.navigate(href) } }, link);
@@ -1,52 +0,0 @@
1
- let baseURI = `${document.baseURI}`;
2
- const normalizeHref = () => {
3
- return location.href + "/" === baseURI ? baseURI : location.href;
4
- };
5
- let globalRouter;
6
- export const Router = {
7
- local(links, index) {
8
- return Router.for(links, index, false);
9
- },
10
- for(links, index, setGlobalRouter = true) {
11
- let target;
12
- const partialRouter = (t) => {
13
- target = t;
14
- const href = normalizeHref();
15
- const route = href === baseURI ? baseURI + index : href;
16
- doNavigate(route);
17
- window.addEventListener("popstate", () => {
18
- doNavigate(location.href);
19
- });
20
- return target;
21
- };
22
- const doNavigate = (link) => {
23
- link = link.replace(baseURI, "") || index;
24
- if (link === partialRouter.current) {
25
- return false;
26
- }
27
- partialRouter.current = link;
28
- target.update((links.find(({ href }) => link.endsWith(href))?.target ??
29
- (() => undefined))());
30
- return true;
31
- };
32
- const navigate = (url) => {
33
- return (event) => {
34
- event.preventDefault();
35
- if (doNavigate(url || index)) {
36
- history.pushState(null, "", url);
37
- }
38
- };
39
- };
40
- partialRouter.navigate = navigate;
41
- if (setGlobalRouter) {
42
- globalRouter = partialRouter;
43
- }
44
- return partialRouter;
45
- },
46
- href(link) {
47
- return `${baseURI}${link.replace(/^\//, "")}`;
48
- },
49
- navigate(href) {
50
- return globalRouter?.navigate(href);
51
- },
52
- };
@@ -1,65 +0,0 @@
1
- import { up } from "./dom.js";
2
- const makeSVGElement = (name) => (attrs, ...children) => up(document.createElementNS("http://www.w3.org/2000/svg", name), attrs, ...children);
3
- export const a = makeSVGElement("a");
4
- export const animate = makeSVGElement("animate");
5
- export const animateMotion = makeSVGElement("animateMotion");
6
- export const animateTransform = makeSVGElement("animateTransform");
7
- export const circle = makeSVGElement("circle");
8
- export const clipPath = makeSVGElement("clipPath");
9
- export const defs = makeSVGElement("defs");
10
- export const desc = makeSVGElement("desc");
11
- export const ellipse = makeSVGElement("ellipse");
12
- export const feBlend = makeSVGElement("feBlend");
13
- export const feColorMatrix = makeSVGElement("feColorMatrix");
14
- export const feComponentTransfer = makeSVGElement("feComponentTransfer");
15
- export const feComposite = makeSVGElement("feComposite");
16
- export const feConvolveMatrix = makeSVGElement("feConvolveMatrix");
17
- export const feDiffuseLighting = makeSVGElement("feDiffuseLighting");
18
- export const feDisplacementMap = makeSVGElement("feDisplacementMap");
19
- export const feDistantLight = makeSVGElement("feDistantLight");
20
- export const feDropShadow = makeSVGElement("feDropShadow");
21
- export const feFlood = makeSVGElement("feFlood");
22
- export const feFuncA = makeSVGElement("feFuncA");
23
- export const feFuncB = makeSVGElement("feFuncB");
24
- export const feFuncG = makeSVGElement("feFuncG");
25
- export const feFuncR = makeSVGElement("feFuncR");
26
- export const feGaussianBlur = makeSVGElement("feGaussianBlur");
27
- export const feImage = makeSVGElement("feImage");
28
- export const feMerge = makeSVGElement("feMerge");
29
- export const feMergeNode = makeSVGElement("feMergeNode");
30
- export const feMorphology = makeSVGElement("feMorphology");
31
- export const feOffset = makeSVGElement("feOffset");
32
- export const fePointLight = makeSVGElement("fePointLight");
33
- export const feSpecularLighting = makeSVGElement("feSpecularLighting");
34
- export const feSpotLight = makeSVGElement("feSpotLight");
35
- export const feTile = makeSVGElement("feTile");
36
- export const feTurbulence = makeSVGElement("feTurbulence");
37
- export const filter = makeSVGElement("filter");
38
- export const foreignObject = makeSVGElement("foreignObject");
39
- export const g = makeSVGElement("g");
40
- export const image = makeSVGElement("image");
41
- export const line = makeSVGElement("line");
42
- export const linearGradient = makeSVGElement("linearGradient");
43
- export const marker = makeSVGElement("marker");
44
- export const mask = makeSVGElement("mask");
45
- export const metadata = makeSVGElement("metadata");
46
- export const mpath = makeSVGElement("mpath");
47
- export const path = makeSVGElement("path");
48
- export const pattern = makeSVGElement("pattern");
49
- export const polygon = makeSVGElement("polygon");
50
- export const polyline = makeSVGElement("polyline");
51
- export const radialGradient = makeSVGElement("radialGradient");
52
- export const rect = makeSVGElement("rect");
53
- export const script = makeSVGElement("script");
54
- export const set = makeSVGElement("set");
55
- export const stop = makeSVGElement("stop");
56
- export const style = makeSVGElement("style");
57
- export const svg = makeSVGElement("svg");
58
- export const svgswitch = makeSVGElement("switch");
59
- export const symbol = makeSVGElement("symbol");
60
- export const text = makeSVGElement("text");
61
- export const textPath = makeSVGElement("textPath");
62
- export const title = makeSVGElement("title");
63
- export const tspan = makeSVGElement("tspan");
64
- export const use = makeSVGElement("use");
65
- export const view = makeSVGElement("view");
@@ -1,9 +0,0 @@
1
- export async function loadTests() {
2
- if (process?.env.CI?.toLowerCase() === "true")
3
- return;
4
- await Promise.all([
5
- import("./html.test.js"),
6
- import("./fc.test.js"),
7
- import("./observable.test.js"),
8
- ]);
9
- }
@@ -1,23 +0,0 @@
1
- /**
2
- https://github.com/frenic/csstype v3.0.11
3
- Copyright (c) 2017-2018 Fredrik Nicol
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
- */
23
- export {};
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- export function xml(tag, attributes, children = []) {
2
- const attrs = Object.entries(attributes).reduce((attrs, [attr, val]) => `${attrs} ${attr}="${val}"`, "");
3
- return `<${tag} ${attrs}>${children.join("")}</${tag}>`;
4
- }
package/lib/esm/equal.js DELETED
@@ -1,41 +0,0 @@
1
- export function compareArrays(equal) {
2
- return (a, b, partial = false) => a.length === b.length && a.every((e, i) => equal(e, b[i], partial));
3
- }
4
- export const equalArrays = compareArrays(Object.is);
5
- export const matchArrays = compareArrays(equals);
6
- export function asArray(a) {
7
- return Object.entries(a).sort((a, b) => a[0].localeCompare(b[0]));
8
- }
9
- export const matchObjects = (a, b, partial = true) => {
10
- for (const [k, v] of Object.entries(a)) {
11
- if (!b.hasOwnProperty(k) && partial)
12
- continue;
13
- // @ts-ignore
14
- if (!equals(v, b[k], partial))
15
- return false;
16
- }
17
- return true;
18
- };
19
- export function equals(a, b, partial = false) {
20
- // runtime type checking
21
- if (a === null && a === b)
22
- return true;
23
- if (a === undefined && a === b)
24
- return true;
25
- switch (typeof a) {
26
- case "object":
27
- if (b === undefined) {
28
- return false;
29
- }
30
- if (a instanceof Array && b instanceof Array) {
31
- return matchArrays(a, b, partial);
32
- }
33
- else {
34
- return matchObjects(a, b, partial);
35
- }
36
- case "function":
37
- return a.name === b.name;
38
- default:
39
- return Object.is(a, b);
40
- }
41
- }
@@ -1,20 +0,0 @@
1
- import { describe, it, expect } from "./scope/index.js";
2
- import { equalArrays, equals, matchArrays } from "./equal.js";
3
- describe("Equality", () => {
4
- it("compares objects", () => {
5
- expect(equals({ a: 1, b: 2 }, { b: 2, a: 1 })).toBe(true);
6
- expect(equals({ a: 1, b: 2 }, { b: 1, a: 2 })).toBe(false);
7
- });
8
- it("compares primitives", () => {
9
- expect(equals(1, 1)).toBe(true);
10
- expect(equals(1, -1)).toBe(false);
11
- expect(equals(0, -0)).toBe(false);
12
- expect(equals(NaN, NaN)).toBe(true);
13
- });
14
- it("compares arrays", () => {
15
- expect(equalArrays([1, 2, 3], [1, 2, 3])).toBe(true);
16
- expect(equalArrays([1], [2, 3])).toBe(false);
17
- expect(equalArrays([{ a: 1 }], [{ a: 1 }])).toBe(false);
18
- expect(matchArrays([{ a: 1 }], [{ a: 1 }])).toBe(true);
19
- });
20
- });
package/lib/esm/flags.js DELETED
@@ -1,48 +0,0 @@
1
- export const parse = (parseArgs) => {
2
- const fromNode = parseArgs[0].endsWith("node");
3
- const argv = parseArgs[fromNode ? 1 : 0];
4
- const params = new Map();
5
- const flags = new Map();
6
- const args = [];
7
- let index = fromNode ? 2 : 1;
8
- const hasNext = () => index < parseArgs.length;
9
- const peek = () => parseArgs[index];
10
- const advance = () => parseArgs[index++];
11
- const parseLong = (arg) => {
12
- if (arg.substr(0, 3) === "no-") {
13
- flags.set(arg.substr(3), false);
14
- }
15
- else if (!arg.includes("=")) {
16
- flags.set(arg, true);
17
- }
18
- else {
19
- const [param, ...value] = arg.split("=");
20
- params.set(param, value.join("="));
21
- }
22
- };
23
- while (hasNext()) {
24
- if (peek().substr(0, 2) === "--") {
25
- parseLong(advance().substr(2));
26
- }
27
- else {
28
- args.push(advance());
29
- }
30
- }
31
- return {
32
- get argv0() {
33
- return argv;
34
- },
35
- get args() {
36
- return args;
37
- },
38
- get(flag, def = false) {
39
- return flags.get(flag) ?? def;
40
- },
41
- asNumber(param, def = 0) {
42
- return Number.parseFloat(params.get(param) ?? `${def}`);
43
- },
44
- asString(param, def = "") {
45
- return params.get(param) ?? def;
46
- },
47
- };
48
- };
@@ -1,35 +0,0 @@
1
- import { describe, it, expect } from "./scope/index.js";
2
- import { parse } from "./flags.js";
3
- const TEST_CASES = {
4
- SIMPLE: "program",
5
- NODE: "/usr/local/bin/node program",
6
- ONE_FLAG: "program --fun",
7
- ONE_PARAM: "program --fun=100",
8
- ONE_ARG: "program cat",
9
- ONE_NO_FLAG: "program --no-fun",
10
- MIXED: "program --fun=dog cat --port=8080 mouse --hamster --no-bird",
11
- };
12
- const makeFlags = (commandLine) => {
13
- return parse(commandLine.split(" "));
14
- };
15
- describe("Flags", () => {
16
- it("stores the program name", () => {
17
- const flags = makeFlags(TEST_CASES.SIMPLE);
18
- expect(flags.argv0).toEqual("program");
19
- expect(flags.args).toEqual([]);
20
- });
21
- it("stores the program name ignoring node", () => {
22
- const flags = makeFlags(TEST_CASES.NODE);
23
- expect(flags.argv0).toEqual("program");
24
- expect(flags.args).toEqual([]);
25
- });
26
- it("parses a flag", () => {
27
- const flags = makeFlags(TEST_CASES.ONE_FLAG);
28
- expect(flags.get("fun")).toBe(true);
29
- });
30
- it("parses a flag with a default value", () => {
31
- const flags = makeFlags(TEST_CASES.SIMPLE);
32
- expect(flags.get("missing")).toBe(false);
33
- expect(flags.get("missing", true)).toBe(true);
34
- });
35
- });