godown 2.7.6 → 3.0.0-canary.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 (498) hide show
  1. package/README.md +44 -80
  2. package/alert.d.ts +2 -3
  3. package/alert.d.ts.map +1 -1
  4. package/alert.js +5 -4
  5. package/alert.js.map +1 -1
  6. package/avatar.d.ts +2 -3
  7. package/avatar.d.ts.map +1 -1
  8. package/avatar.js +5 -4
  9. package/avatar.js.map +1 -1
  10. package/breath.d.ts +9 -0
  11. package/breath.d.ts.map +1 -0
  12. package/breath.js +6 -0
  13. package/breath.js.map +1 -0
  14. package/button.d.ts +2 -3
  15. package/button.d.ts.map +1 -1
  16. package/button.js +5 -4
  17. package/button.js.map +1 -1
  18. package/card.d.ts +2 -3
  19. package/card.d.ts.map +1 -1
  20. package/card.js +5 -4
  21. package/card.js.map +1 -1
  22. package/carousel.d.ts +2 -3
  23. package/carousel.d.ts.map +1 -1
  24. package/carousel.js +5 -4
  25. package/carousel.js.map +1 -1
  26. package/components/alert.d.ts +50 -0
  27. package/components/alert.d.ts.map +1 -0
  28. package/components/alert.js +167 -0
  29. package/components/alert.js.map +1 -0
  30. package/components/avatar.d.ts +26 -0
  31. package/components/avatar.d.ts.map +1 -0
  32. package/components/avatar.js +62 -0
  33. package/components/avatar.js.map +1 -0
  34. package/components/breath.d.ts +34 -0
  35. package/components/breath.d.ts.map +1 -0
  36. package/components/breath.js +80 -0
  37. package/components/breath.js.map +1 -0
  38. package/{web-components/button → components}/button.d.ts +6 -5
  39. package/components/button.d.ts.map +1 -0
  40. package/components/button.js +167 -0
  41. package/components/button.js.map +1 -0
  42. package/components/card.d.ts +20 -0
  43. package/components/card.d.ts.map +1 -0
  44. package/components/card.js +55 -0
  45. package/components/card.js.map +1 -0
  46. package/components/carousel.d.ts +40 -0
  47. package/components/carousel.d.ts.map +1 -0
  48. package/components/carousel.js +113 -0
  49. package/components/carousel.js.map +1 -0
  50. package/{web-components/details → components}/details.d.ts +5 -3
  51. package/components/details.d.ts.map +1 -0
  52. package/components/details.js +50 -0
  53. package/components/details.js.map +1 -0
  54. package/components/dialog.d.ts +33 -0
  55. package/components/dialog.d.ts.map +1 -0
  56. package/components/dialog.js +92 -0
  57. package/components/dialog.js.map +1 -0
  58. package/components/divider.d.ts +17 -0
  59. package/components/divider.d.ts.map +1 -0
  60. package/components/divider.js +37 -0
  61. package/components/divider.js.map +1 -0
  62. package/{web-components/wrapper → components}/dragbox.d.ts +15 -5
  63. package/components/dragbox.d.ts.map +1 -0
  64. package/{web-components/wrapper → components}/dragbox.js +32 -27
  65. package/components/dragbox.js.map +1 -0
  66. package/components/flex.d.ts +31 -0
  67. package/components/flex.d.ts.map +1 -0
  68. package/components/flex.js +55 -0
  69. package/components/flex.js.map +1 -0
  70. package/{web-components/form → components}/form.d.ts +4 -2
  71. package/components/form.d.ts.map +1 -0
  72. package/{web-components/form → components}/form.js +16 -17
  73. package/components/form.js.map +1 -0
  74. package/components/grid.d.ts +31 -0
  75. package/components/grid.d.ts.map +1 -0
  76. package/components/grid.js +56 -0
  77. package/components/grid.js.map +1 -0
  78. package/components/input.d.ts +20 -0
  79. package/components/input.d.ts.map +1 -0
  80. package/components/input.js +54 -0
  81. package/components/input.js.map +1 -0
  82. package/components/layout.d.ts +29 -0
  83. package/components/layout.d.ts.map +1 -0
  84. package/components/layout.js +48 -0
  85. package/components/layout.js.map +1 -0
  86. package/components/link.d.ts +20 -0
  87. package/components/link.d.ts.map +1 -0
  88. package/components/link.js +43 -0
  89. package/components/link.js.map +1 -0
  90. package/{web-components/progress → components}/progress.d.ts +5 -3
  91. package/components/progress.d.ts.map +1 -0
  92. package/components/progress.js +68 -0
  93. package/components/progress.js.map +1 -0
  94. package/components/range.d.ts +60 -0
  95. package/components/range.d.ts.map +1 -0
  96. package/components/range.js +193 -0
  97. package/components/range.js.map +1 -0
  98. package/{web-components/wrapper → components}/rotate.d.ts +4 -8
  99. package/components/rotate.d.ts.map +1 -0
  100. package/components/rotate.js +57 -0
  101. package/components/rotate.js.map +1 -0
  102. package/components/router.d.ts +121 -0
  103. package/components/router.d.ts.map +1 -0
  104. package/components/router.js +251 -0
  105. package/components/router.js.map +1 -0
  106. package/components/select.d.ts +50 -0
  107. package/components/select.d.ts.map +1 -0
  108. package/components/select.js +211 -0
  109. package/components/select.js.map +1 -0
  110. package/{web-components/skeleton → components}/skeleton.d.ts +6 -6
  111. package/components/skeleton.d.ts.map +1 -0
  112. package/components/skeleton.js +56 -0
  113. package/components/skeleton.js.map +1 -0
  114. package/components/split.d.ts +32 -0
  115. package/components/split.d.ts.map +1 -0
  116. package/components/split.js +121 -0
  117. package/components/split.js.map +1 -0
  118. package/{web-components/input/switch-input.d.ts → components/switch.d.ts} +9 -10
  119. package/components/switch.d.ts.map +1 -0
  120. package/components/switch.js +93 -0
  121. package/components/switch.js.map +1 -0
  122. package/{web-components/text → components}/text.d.ts +5 -3
  123. package/components/text.d.ts.map +1 -0
  124. package/components/text.js +44 -0
  125. package/components/text.js.map +1 -0
  126. package/{web-components/text → components}/time.d.ts +5 -3
  127. package/components/time.d.ts.map +1 -0
  128. package/{web-components/text → components}/time.js +18 -21
  129. package/components/time.js.map +1 -0
  130. package/components/tooltip.d.ts +38 -0
  131. package/components/tooltip.d.ts.map +1 -0
  132. package/components/tooltip.js +67 -0
  133. package/components/tooltip.js.map +1 -0
  134. package/{web-components/text → components}/typewriter.d.ts +5 -3
  135. package/components/typewriter.d.ts.map +1 -0
  136. package/{web-components/text → components}/typewriter.js +24 -48
  137. package/components/typewriter.js.map +1 -0
  138. package/core/global-style.d.ts +21 -0
  139. package/core/global-style.d.ts.map +1 -0
  140. package/core/global-style.js +46 -0
  141. package/core/global-style.js.map +1 -0
  142. package/core/super-anchor.d.ts +15 -0
  143. package/core/super-anchor.d.ts.map +1 -0
  144. package/core/super-anchor.js +39 -0
  145. package/core/super-anchor.js.map +1 -0
  146. package/core/super-input.d.ts +39 -0
  147. package/core/super-input.d.ts.map +1 -0
  148. package/core/super-input.js +115 -0
  149. package/core/super-input.js.map +1 -0
  150. package/{proto → core}/super-openable.d.ts +4 -8
  151. package/core/super-openable.d.ts.map +1 -0
  152. package/{proto → core}/super-openable.js +10 -15
  153. package/core/super-openable.js.map +1 -0
  154. package/custom-elements.json +1 -0
  155. package/details.d.ts +2 -3
  156. package/details.d.ts.map +1 -1
  157. package/details.js +5 -4
  158. package/details.js.map +1 -1
  159. package/dialog.d.ts +2 -3
  160. package/dialog.d.ts.map +1 -1
  161. package/dialog.js +5 -4
  162. package/dialog.js.map +1 -1
  163. package/divider.d.ts +2 -3
  164. package/divider.d.ts.map +1 -1
  165. package/divider.js +5 -4
  166. package/divider.js.map +1 -1
  167. package/dragbox.d.ts +2 -3
  168. package/dragbox.d.ts.map +1 -1
  169. package/dragbox.js +5 -4
  170. package/dragbox.js.map +1 -1
  171. package/flex.d.ts +8 -0
  172. package/flex.d.ts.map +1 -0
  173. package/flex.js +6 -0
  174. package/flex.js.map +1 -0
  175. package/form.d.ts +2 -3
  176. package/form.d.ts.map +1 -1
  177. package/form.js +5 -4
  178. package/form.js.map +1 -1
  179. package/grid.d.ts +8 -0
  180. package/grid.d.ts.map +1 -0
  181. package/grid.js +6 -0
  182. package/grid.js.map +1 -0
  183. package/index.d.ts +28 -32
  184. package/index.d.ts.map +1 -1
  185. package/index.js +57 -33
  186. package/index.js.map +1 -1
  187. package/input.d.ts +3 -3
  188. package/input.d.ts.map +1 -1
  189. package/input.js +5 -4
  190. package/input.js.map +1 -1
  191. package/layout.d.ts +3 -3
  192. package/layout.d.ts.map +1 -1
  193. package/layout.js +5 -4
  194. package/layout.js.map +1 -1
  195. package/link.d.ts +3 -3
  196. package/link.d.ts.map +1 -1
  197. package/link.js +5 -4
  198. package/link.js.map +1 -1
  199. package/package.json +42 -81
  200. package/progress.d.ts +3 -3
  201. package/progress.d.ts.map +1 -1
  202. package/progress.js +5 -4
  203. package/progress.js.map +1 -1
  204. package/range.d.ts +9 -0
  205. package/range.d.ts.map +1 -0
  206. package/range.js +6 -0
  207. package/range.js.map +1 -0
  208. package/rotate.d.ts +3 -3
  209. package/rotate.d.ts.map +1 -1
  210. package/rotate.js +5 -4
  211. package/rotate.js.map +1 -1
  212. package/router.d.ts +3 -3
  213. package/router.d.ts.map +1 -1
  214. package/router.js +5 -4
  215. package/router.js.map +1 -1
  216. package/select.d.ts +9 -0
  217. package/select.d.ts.map +1 -0
  218. package/select.js +6 -0
  219. package/select.js.map +1 -0
  220. package/skeleton.d.ts +3 -3
  221. package/skeleton.d.ts.map +1 -1
  222. package/skeleton.js +5 -4
  223. package/skeleton.js.map +1 -1
  224. package/split.d.ts +9 -0
  225. package/split.d.ts.map +1 -0
  226. package/split.js +6 -0
  227. package/split.js.map +1 -0
  228. package/switch.d.ts +9 -0
  229. package/switch.d.ts.map +1 -0
  230. package/switch.js +6 -0
  231. package/switch.js.map +1 -0
  232. package/text.d.ts +3 -3
  233. package/text.d.ts.map +1 -1
  234. package/text.js +5 -4
  235. package/text.js.map +1 -1
  236. package/time.d.ts +3 -3
  237. package/time.d.ts.map +1 -1
  238. package/time.js +5 -4
  239. package/time.js.map +1 -1
  240. package/tooltip.d.ts +3 -3
  241. package/tooltip.d.ts.map +1 -1
  242. package/tooltip.js +5 -4
  243. package/tooltip.js.map +1 -1
  244. package/typewriter.d.ts +2 -3
  245. package/typewriter.d.ts.map +1 -1
  246. package/typewriter.js +5 -4
  247. package/typewriter.js.map +1 -1
  248. package/vscode.css-custom-data.json +1 -0
  249. package/vscode.html-custom-data.json +1 -0
  250. package/web-types.json +1 -0
  251. package/_deps.d.ts +0 -4
  252. package/_deps.d.ts.map +0 -1
  253. package/_deps.js +0 -4
  254. package/_deps.js.map +0 -1
  255. package/avatar-group.d.ts +0 -9
  256. package/avatar-group.d.ts.map +0 -1
  257. package/avatar-group.js +0 -5
  258. package/avatar-group.js.map +0 -1
  259. package/components.json +0 -194
  260. package/conf.d.ts +0 -12
  261. package/conf.d.ts.map +0 -1
  262. package/conf.js +0 -24
  263. package/conf.js.map +0 -1
  264. package/decorators/godown.d.ts +0 -4
  265. package/decorators/godown.d.ts.map +0 -1
  266. package/decorators/godown.js +0 -9
  267. package/decorators/godown.js.map +0 -1
  268. package/decorators/part.d.ts +0 -7
  269. package/decorators/part.d.ts.map +0 -1
  270. package/decorators/part.js +0 -8
  271. package/decorators/part.js.map +0 -1
  272. package/decorators/styles.d.ts +0 -3
  273. package/decorators/styles.d.ts.map +0 -1
  274. package/decorators/styles.js +0 -8
  275. package/decorators/styles.js.map +0 -1
  276. package/flex-flow.d.ts +0 -9
  277. package/flex-flow.d.ts.map +0 -1
  278. package/flex-flow.js +0 -5
  279. package/flex-flow.js.map +0 -1
  280. package/grid-flow.d.ts +0 -9
  281. package/grid-flow.d.ts.map +0 -1
  282. package/grid-flow.js +0 -5
  283. package/grid-flow.js.map +0 -1
  284. package/label-input.d.ts +0 -9
  285. package/label-input.d.ts.map +0 -1
  286. package/label-input.js +0 -5
  287. package/label-input.js.map +0 -1
  288. package/lib/css.d.ts +0 -13
  289. package/lib/css.d.ts.map +0 -1
  290. package/lib/css.js +0 -29
  291. package/lib/css.js.map +0 -1
  292. package/lib/directives.d.ts +0 -25
  293. package/lib/directives.d.ts.map +0 -1
  294. package/lib/directives.js +0 -40
  295. package/lib/directives.js.map +0 -1
  296. package/lib/event-coll.d.ts +0 -13
  297. package/lib/event-coll.d.ts.map +0 -1
  298. package/lib/event-coll.js +0 -45
  299. package/lib/event-coll.js.map +0 -1
  300. package/lib/icons.d.ts +0 -25
  301. package/lib/icons.d.ts.map +0 -1
  302. package/lib/icons.js +0 -73
  303. package/lib/icons.js.map +0 -1
  304. package/lib/jsx.d.ts +0 -4
  305. package/lib/jsx.d.ts.map +0 -1
  306. package/lib/jsx.js +0 -52
  307. package/lib/jsx.js.map +0 -1
  308. package/lib/route-tree.d.ts +0 -28
  309. package/lib/route-tree.d.ts.map +0 -1
  310. package/lib/route-tree.js +0 -141
  311. package/lib/route-tree.js.map +0 -1
  312. package/lib/utils.d.ts +0 -10
  313. package/lib/utils.d.ts.map +0 -1
  314. package/lib/utils.js +0 -71
  315. package/lib/utils.js.map +0 -1
  316. package/overbreath.d.ts +0 -9
  317. package/overbreath.d.ts.map +0 -1
  318. package/overbreath.js +0 -5
  319. package/overbreath.js.map +0 -1
  320. package/proto/godown-config.d.ts +0 -41
  321. package/proto/godown-config.d.ts.map +0 -1
  322. package/proto/godown-config.js +0 -27
  323. package/proto/godown-config.js.map +0 -1
  324. package/proto/godown-element.d.ts +0 -125
  325. package/proto/godown-element.d.ts.map +0 -1
  326. package/proto/godown-element.js +0 -204
  327. package/proto/godown-element.js.map +0 -1
  328. package/proto/super-a.d.ts +0 -30
  329. package/proto/super-a.d.ts.map +0 -1
  330. package/proto/super-a.js +0 -141
  331. package/proto/super-a.js.map +0 -1
  332. package/proto/super-input.d.ts +0 -44
  333. package/proto/super-input.d.ts.map +0 -1
  334. package/proto/super-input.js +0 -119
  335. package/proto/super-input.js.map +0 -1
  336. package/proto/super-openable.d.ts.map +0 -1
  337. package/proto/super-openable.js.map +0 -1
  338. package/range-input.d.ts +0 -9
  339. package/range-input.d.ts.map +0 -1
  340. package/range-input.js +0 -5
  341. package/range-input.js.map +0 -1
  342. package/react/create.d.ts +0 -5
  343. package/react/create.d.ts.map +0 -1
  344. package/react/create.js +0 -16
  345. package/react/create.js.map +0 -1
  346. package/react/index.d.ts +0 -65
  347. package/react/index.d.ts.map +0 -1
  348. package/react/index.js +0 -132
  349. package/react/index.js.map +0 -1
  350. package/router-link.d.ts +0 -9
  351. package/router-link.d.ts.map +0 -1
  352. package/router-link.js +0 -5
  353. package/router-link.js.map +0 -1
  354. package/search-input.d.ts +0 -9
  355. package/search-input.d.ts.map +0 -1
  356. package/search-input.js +0 -5
  357. package/search-input.js.map +0 -1
  358. package/select-input.d.ts +0 -9
  359. package/select-input.d.ts.map +0 -1
  360. package/select-input.js +0 -5
  361. package/select-input.js.map +0 -1
  362. package/split-input.d.ts +0 -9
  363. package/split-input.d.ts.map +0 -1
  364. package/split-input.js +0 -5
  365. package/split-input.js.map +0 -1
  366. package/styles/colors/presets.d.ts +0 -13
  367. package/styles/colors/presets.d.ts.map +0 -1
  368. package/styles/colors/presets.js +0 -6
  369. package/styles/colors/presets.js.map +0 -1
  370. package/styles/colors/presetsRGB.d.ts +0 -16
  371. package/styles/colors/presetsRGB.d.ts.map +0 -1
  372. package/styles/colors/presetsRGB.js +0 -134
  373. package/styles/colors/presetsRGB.js.map +0 -1
  374. package/styles/global.d.ts +0 -18
  375. package/styles/global.d.ts.map +0 -1
  376. package/styles/global.js +0 -78
  377. package/styles/global.js.map +0 -1
  378. package/styles/inputStyle.d.ts +0 -3
  379. package/styles/inputStyle.d.ts.map +0 -1
  380. package/styles/inputStyle.js +0 -59
  381. package/styles/inputStyle.js.map +0 -1
  382. package/switch-input.d.ts +0 -9
  383. package/switch-input.d.ts.map +0 -1
  384. package/switch-input.js +0 -5
  385. package/switch-input.js.map +0 -1
  386. package/web-components/alert/alert.d.ts +0 -36
  387. package/web-components/alert/alert.d.ts.map +0 -1
  388. package/web-components/alert/alert.js +0 -161
  389. package/web-components/alert/alert.js.map +0 -1
  390. package/web-components/avatar/avatar-group.d.ts +0 -21
  391. package/web-components/avatar/avatar-group.d.ts.map +0 -1
  392. package/web-components/avatar/avatar-group.js +0 -86
  393. package/web-components/avatar/avatar-group.js.map +0 -1
  394. package/web-components/avatar/avatar.d.ts +0 -28
  395. package/web-components/avatar/avatar.d.ts.map +0 -1
  396. package/web-components/avatar/avatar.js +0 -120
  397. package/web-components/avatar/avatar.js.map +0 -1
  398. package/web-components/button/button.d.ts.map +0 -1
  399. package/web-components/button/button.js +0 -256
  400. package/web-components/button/button.js.map +0 -1
  401. package/web-components/card/card.d.ts +0 -9
  402. package/web-components/card/card.d.ts.map +0 -1
  403. package/web-components/card/card.js +0 -75
  404. package/web-components/card/card.js.map +0 -1
  405. package/web-components/carousel/carousel.d.ts +0 -29
  406. package/web-components/carousel/carousel.d.ts.map +0 -1
  407. package/web-components/carousel/carousel.js +0 -185
  408. package/web-components/carousel/carousel.js.map +0 -1
  409. package/web-components/details/details.d.ts.map +0 -1
  410. package/web-components/details/details.js +0 -124
  411. package/web-components/details/details.js.map +0 -1
  412. package/web-components/dialog/dialog.d.ts +0 -31
  413. package/web-components/dialog/dialog.d.ts.map +0 -1
  414. package/web-components/dialog/dialog.js +0 -143
  415. package/web-components/dialog/dialog.js.map +0 -1
  416. package/web-components/divider/divider.d.ts +0 -13
  417. package/web-components/divider/divider.d.ts.map +0 -1
  418. package/web-components/divider/divider.js +0 -95
  419. package/web-components/divider/divider.js.map +0 -1
  420. package/web-components/form/form.d.ts.map +0 -1
  421. package/web-components/form/form.js.map +0 -1
  422. package/web-components/input/input.d.ts +0 -37
  423. package/web-components/input/input.d.ts.map +0 -1
  424. package/web-components/input/input.js +0 -152
  425. package/web-components/input/input.js.map +0 -1
  426. package/web-components/input/label-input.d.ts +0 -15
  427. package/web-components/input/label-input.d.ts.map +0 -1
  428. package/web-components/input/label-input.js +0 -96
  429. package/web-components/input/label-input.js.map +0 -1
  430. package/web-components/input/range-input.d.ts +0 -53
  431. package/web-components/input/range-input.d.ts.map +0 -1
  432. package/web-components/input/range-input.js +0 -316
  433. package/web-components/input/range-input.js.map +0 -1
  434. package/web-components/input/search-input.d.ts +0 -42
  435. package/web-components/input/search-input.d.ts.map +0 -1
  436. package/web-components/input/search-input.js +0 -214
  437. package/web-components/input/search-input.js.map +0 -1
  438. package/web-components/input/select-input.d.ts +0 -36
  439. package/web-components/input/select-input.d.ts.map +0 -1
  440. package/web-components/input/select-input.js +0 -210
  441. package/web-components/input/select-input.js.map +0 -1
  442. package/web-components/input/split-input.d.ts +0 -29
  443. package/web-components/input/split-input.d.ts.map +0 -1
  444. package/web-components/input/split-input.js +0 -184
  445. package/web-components/input/split-input.js.map +0 -1
  446. package/web-components/input/switch-input.d.ts.map +0 -1
  447. package/web-components/input/switch-input.js +0 -189
  448. package/web-components/input/switch-input.js.map +0 -1
  449. package/web-components/layout/flex-flow.d.ts +0 -17
  450. package/web-components/layout/flex-flow.d.ts.map +0 -1
  451. package/web-components/layout/flex-flow.js +0 -73
  452. package/web-components/layout/flex-flow.js.map +0 -1
  453. package/web-components/layout/grid-flow.d.ts +0 -14
  454. package/web-components/layout/grid-flow.d.ts.map +0 -1
  455. package/web-components/layout/grid-flow.js +0 -56
  456. package/web-components/layout/grid-flow.js.map +0 -1
  457. package/web-components/layout/layout.d.ts +0 -18
  458. package/web-components/layout/layout.d.ts.map +0 -1
  459. package/web-components/layout/layout.js +0 -76
  460. package/web-components/layout/layout.js.map +0 -1
  461. package/web-components/link/link.d.ts +0 -10
  462. package/web-components/link/link.d.ts.map +0 -1
  463. package/web-components/link/link.js +0 -17
  464. package/web-components/link/link.js.map +0 -1
  465. package/web-components/link/router-link.d.ts +0 -19
  466. package/web-components/link/router-link.d.ts.map +0 -1
  467. package/web-components/link/router-link.js +0 -60
  468. package/web-components/link/router-link.js.map +0 -1
  469. package/web-components/progress/progress.d.ts.map +0 -1
  470. package/web-components/progress/progress.js +0 -107
  471. package/web-components/progress/progress.js.map +0 -1
  472. package/web-components/router/router.d.ts +0 -86
  473. package/web-components/router/router.d.ts.map +0 -1
  474. package/web-components/router/router.js +0 -246
  475. package/web-components/router/router.js.map +0 -1
  476. package/web-components/skeleton/skeleton.d.ts.map +0 -1
  477. package/web-components/skeleton/skeleton.js +0 -130
  478. package/web-components/skeleton/skeleton.js.map +0 -1
  479. package/web-components/text/overbreath.d.ts +0 -22
  480. package/web-components/text/overbreath.d.ts.map +0 -1
  481. package/web-components/text/overbreath.js +0 -132
  482. package/web-components/text/overbreath.js.map +0 -1
  483. package/web-components/text/text.d.ts.map +0 -1
  484. package/web-components/text/text.js +0 -94
  485. package/web-components/text/text.js.map +0 -1
  486. package/web-components/text/time.d.ts.map +0 -1
  487. package/web-components/text/time.js.map +0 -1
  488. package/web-components/text/typewriter.d.ts.map +0 -1
  489. package/web-components/text/typewriter.js.map +0 -1
  490. package/web-components/tooltip/tooltip.d.ts +0 -30
  491. package/web-components/tooltip/tooltip.d.ts.map +0 -1
  492. package/web-components/tooltip/tooltip.js +0 -123
  493. package/web-components/tooltip/tooltip.js.map +0 -1
  494. package/web-components/wrapper/dragbox.d.ts.map +0 -1
  495. package/web-components/wrapper/dragbox.js.map +0 -1
  496. package/web-components/wrapper/rotate.d.ts.map +0 -1
  497. package/web-components/wrapper/rotate.js +0 -92
  498. package/web-components/wrapper/rotate.js.map +0 -1
@@ -0,0 +1,193 @@
1
+ import { __decorate } from 'tslib';
2
+ import { godown } from '@godown/element/decorators/godown.js';
3
+ import { part } from '@godown/element/decorators/part.js';
4
+ import { styles } from '@godown/element/decorators/styles.js';
5
+ import { classList } from '@godown/element/directives/class-list.js';
6
+ import { conditionIf } from '@godown/element/directives/condition-if.js';
7
+ import { htmlSlot } from '@godown/element/directives/html-slot.js';
8
+ import { joinProperties } from '@godown/element/tools/css.js';
9
+ import { isNil } from '@godown/element/tools/lib.js';
10
+ import { css, html } from 'lit';
11
+ import { property, state } from 'lit/decorators.js';
12
+ import { scopePrefix, cssGlobalVars } from '../core/global-style.js';
13
+ import SuperInput from '../core/super-input.js';
14
+
15
+ const protoName = "range";
16
+ const cssScope = scopePrefix(protoName);
17
+ /**
18
+ * {@linkcode Range} is similar to <input type="range">.
19
+ *
20
+ * Value accepts a number, or an array of two numbers.
21
+ *
22
+ * Number have one handle, array have two.
23
+ *
24
+ * @category input
25
+ */
26
+ let Range = class Range extends SuperInput {
27
+ constructor() {
28
+ super(...arguments);
29
+ /**
30
+ * Minimum value.
31
+ */
32
+ this.min = 0;
33
+ /**
34
+ * Maximum value.
35
+ */
36
+ this.max = 100;
37
+ /**
38
+ * Sliding step length.
39
+ */
40
+ this.step = 1;
41
+ }
42
+ /**
43
+ * Returns true when the second number is greater than the first number
44
+ */
45
+ get reverse() {
46
+ return this.range ? this.value[0] > this.value[1] : false;
47
+ }
48
+ /**
49
+ * Enable range sliding.
50
+ */
51
+ get range() {
52
+ return Array.isArray(this.value);
53
+ }
54
+ get rangeValue() {
55
+ return (this.range ? this.value : [0, this.value]);
56
+ }
57
+ render() {
58
+ const [from, to] = this.rangeValue;
59
+ const gap = this.max - this.min;
60
+ return html `<div part="root" class="${classList({
61
+ vertical: this.vertical,
62
+ range: this.range,
63
+ reverse: this.reverse,
64
+ })}" @mousedown="${this.disabled ? null : this._handleMousedownRoot}" style="${joinProperties({ "--start": `${((from - this.min) / gap) * 100}%`, "--end": `${((to - this.min) / gap) * 100}%` })}"><div part="track"></div>${conditionIf(this.range, html `<i part="handle" class="${classList({ "last-focus": this.lastFocus === 1 }, "start")}" @mousedown="${this.disabled ? null : this._handleMousedownStart}">${htmlSlot("start")}</i>`)} <i part="handle" class="${classList({ "last-focus": this.lastFocus === 2 }, "end")}" @mousedown="${this.disabled ? null : this._handleMousedownEnd}">${htmlSlot("end")}</i></div>`;
65
+ }
66
+ _handleMousedownStart(e) {
67
+ this.lastFocus = 1;
68
+ this.createMousedownListener(this.setStart)(e);
69
+ }
70
+ _handleMousedownEnd(e) {
71
+ this.lastFocus = 2;
72
+ this.createMousedownListener(this.setEnd)(e);
73
+ }
74
+ setStart(value) {
75
+ const i = this.value[1];
76
+ this.value = this.range ? [value, i] : value;
77
+ }
78
+ setEnd(value) {
79
+ const i = this.value[0];
80
+ this.value = this.range ? [i, value] : value;
81
+ }
82
+ _computeValue(e) {
83
+ const rect = this._root.getBoundingClientRect();
84
+ const div = this.vertical ? (e.clientY - rect.top) / rect.height : (e.clientX - rect.left) / rect.width;
85
+ let value = Math.round((div * (this.max - this.min)) / this.step) * this.step;
86
+ if (value > this.max) {
87
+ value -= this.step;
88
+ }
89
+ else if (value < this.min) {
90
+ value += this.step;
91
+ }
92
+ return value;
93
+ }
94
+ _handleMousedownRoot(e) {
95
+ const value = this._computeValue(e);
96
+ if (!this.range || Math.abs(value - this.value[0]) > Math.abs(value - this.value[1])) {
97
+ this.setEnd(value);
98
+ this._handleMousedownEnd(e);
99
+ }
100
+ else {
101
+ this.setStart(value);
102
+ this._handleMousedownStart(e);
103
+ }
104
+ }
105
+ createMousedownListener(mouseMoveCallback) {
106
+ return (e) => {
107
+ e.preventDefault();
108
+ e.stopPropagation();
109
+ const move = this.createMousemoveListener(mouseMoveCallback);
110
+ document.addEventListener("mousemove", move);
111
+ const stop = () => {
112
+ document.removeEventListener("mousemove", move);
113
+ document.removeEventListener("mouseup", stop);
114
+ };
115
+ document.addEventListener("mouseup", stop);
116
+ };
117
+ }
118
+ createMousemoveListener(callback) {
119
+ return (e) => {
120
+ const value = this._computeValue(e);
121
+ if (value > this.max || value < this.min) {
122
+ return;
123
+ }
124
+ callback?.call(this, value);
125
+ };
126
+ }
127
+ _connectedInit() {
128
+ const gap = this.max - this.min;
129
+ this.step ||= gap / 100;
130
+ if (!isNil(this.default) && isNil(this.value)) {
131
+ this.value = this.default;
132
+ }
133
+ else if (isNil(this.default) && !isNil(this.value)) {
134
+ this.default = this.value;
135
+ }
136
+ else {
137
+ const mid = Math.round(gap / 2 / this.step) * this.step;
138
+ this.default = this.range ? [0, mid] : mid;
139
+ this.value = this.default;
140
+ }
141
+ }
142
+ reset() {
143
+ this.value = this.default;
144
+ }
145
+ swap() {
146
+ if (this.range) {
147
+ const [a, b] = this.value;
148
+ this.value = [b, a];
149
+ }
150
+ }
151
+ sort() {
152
+ this.value = this.toSorted();
153
+ }
154
+ toSorted() {
155
+ if (this.range) {
156
+ const [a, b] = this.value;
157
+ return a > b ? [b, a] : [a, b];
158
+ }
159
+ return this.value;
160
+ }
161
+ };
162
+ __decorate([
163
+ property({ type: Number })
164
+ ], Range.prototype, "min", void 0);
165
+ __decorate([
166
+ property({ type: Number })
167
+ ], Range.prototype, "max", void 0);
168
+ __decorate([
169
+ property({ type: Number })
170
+ ], Range.prototype, "step", void 0);
171
+ __decorate([
172
+ property({ type: Boolean, reflect: true })
173
+ ], Range.prototype, "vertical", void 0);
174
+ __decorate([
175
+ property({ type: Array })
176
+ ], Range.prototype, "value", void 0);
177
+ __decorate([
178
+ property({ type: Array })
179
+ ], Range.prototype, "default", void 0);
180
+ __decorate([
181
+ part("root")
182
+ ], Range.prototype, "_root", void 0);
183
+ __decorate([
184
+ state()
185
+ ], Range.prototype, "lastFocus", void 0);
186
+ Range = __decorate([
187
+ godown(protoName),
188
+ styles(css `:host{${cssScope}-handle-active:var(${cssGlobalVars._colors.blue[7]});${cssScope}-track-width:.5em;background:var(${cssGlobalVars.input}-background);width:var(${cssGlobalVars.input}-width);display:inline-block;margin:.25em 0}:host([vertical]){height:var(${cssGlobalVars.input}-width);width:-moz-fit-content;width:fit-content}:host(:not([disabled])) i:active{${cssScope}-handle-scale:1.05;background:var(${cssScope}-handle-active)}.last-focus{z-index:1}[part=root]{min-height:inherit;position:relative;border-radius:inherit;width:100%;--start:0%;--end:50%;height:var(${cssScope}-track-width)}[part=track]{height:100%;min-height:inherit;display:flex;position:absolute;pointer-events:none;border-radius:inherit;justify-content:space-between;left:min(var(--start),var(--end));background:var(${cssGlobalVars.active});width:max(calc(var(--end) - var(--start)),calc(var(--start) - var(--end)))}[part=handle]{width:1em;height:1em;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;position:absolute;border:.1em solid;border-radius:50%;transform-origin:0 25%;transform:scale(var(${cssScope}-handle-scale,1)) translate(-50%,-25%);background:var(${cssGlobalVars.active});border-color:var(${cssGlobalVars.input}-control)}`, css `.vertical{height:100%;width:var(${cssScope}-track-width)}.vertical i{transform:translate(-25%,-50%)}.vertical [part=track]{width:100%;height:max(calc(var(--end) - var(--start)),calc(var(--start) - var(--end)));top:min(var(--start),var(--end));left:0}`, css `.start{left:var(--start);top:0}.end{left:var(--end);top:0}.vertical .start{top:var(--start);left:0}.vertical .end{top:var(--end);left:0}`)
189
+ ], Range);
190
+ var Range$1 = Range;
191
+
192
+ export { Range$1 as default };
193
+ //# sourceMappingURL=range.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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js";
2
2
  /**
3
3
  * {@linkcode Rotate} Make child elements rotate.
4
+ *
5
+ * @category wrapper
4
6
  */
5
- export declare class Rotate extends GodownElement {
7
+ declare class Rotate extends GlobalStyle {
6
8
  _root: HTMLElement;
7
9
  protected render(): import("lit").TemplateResult<1>;
8
- /**
9
- * Cancel the offset.
10
- */
11
10
  reset(): void;
12
- /**
13
- * Apply offset.
14
- */
15
11
  protected _handleRotate(e: MouseEvent): void;
16
12
  /**
17
13
  * Compute offset.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../src/components/rotate.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAKnE;;;;GAIG;AACH,cAIM,MAAO,SAAQ,WAAW;IAE9B,KAAK,EAAE,WAAW,CAAC;IAEnB,SAAS,CAAC,MAAM;IAIhB,KAAK;IAKL,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,UAAU;IAMrC;;;;;;;OAOG;IACH,cAAc,CAAC,CAAC,EAAE,UAAU;;;;CAU7B;AAED,eAAe,MAAM,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { __decorate } from 'tslib';
2
+ import { godown } from '@godown/element/decorators/godown.js';
3
+ import { part } from '@godown/element/decorators/part.js';
4
+ import { styles } from '@godown/element/decorators/styles.js';
5
+ import { htmlSlot } from '@godown/element/directives/html-slot.js';
6
+ import { css, html } from 'lit';
7
+ import { scopePrefix, GlobalStyle } from '../core/global-style.js';
8
+
9
+ const protoName = "rotate";
10
+ const cssScope = scopePrefix(protoName);
11
+ /**
12
+ * {@linkcode Rotate} Make child elements rotate.
13
+ *
14
+ * @category wrapper
15
+ */
16
+ let Rotate = class Rotate extends GlobalStyle {
17
+ render() {
18
+ return html `<div part="root"><div part="slot" @mousemove="${this._handleRotate}">${htmlSlot()}</div><i @mouseleave="${this.reset}"></i></div>`;
19
+ }
20
+ reset() {
21
+ this._root.style.removeProperty("transform");
22
+ this._root.style.removeProperty("transition");
23
+ }
24
+ _handleRotate(e) {
25
+ const { rotateX, rotateY } = this._computeOffset(e);
26
+ this._root.style.setProperty("transform", `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`);
27
+ this._root.style.setProperty("transition", "0s");
28
+ }
29
+ /**
30
+ * Compute offset.
31
+ * ```
32
+ * `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`
33
+ * ```
34
+ * @param e Mouse move event.
35
+ * @returns rotateX, rotateY
36
+ */
37
+ _computeOffset(e) {
38
+ const { left, top, width, height } = this._root.getBoundingClientRect();
39
+ const { clientX, clientY } = e;
40
+ const offsetX = clientX - left;
41
+ const offsetY = clientY - top;
42
+ const rotateX = -(offsetY - height / 2) / height / 2;
43
+ const rotateY = (offsetX - width / 2) / width / 2;
44
+ return { rotateX, rotateY };
45
+ }
46
+ };
47
+ __decorate([
48
+ part("root")
49
+ ], Rotate.prototype, "_root", void 0);
50
+ Rotate = __decorate([
51
+ godown(protoName),
52
+ styles(css `:host{display:block;width:-moz-fit-content;width:fit-content;transition:all .5s ease-in-out;${cssScope}--padding:.75em;${cssScope}--offset:.5em}div{position:relative;transition:inherit;transition-property:transform}i{width:100%;height:100%;position:absolute;top:0;box-sizing:content-box;padding:var(${cssScope}--offset);margin:calc(-1 * var(${cssScope}--offset))}[part=slot]{z-index:2}`)
53
+ ], Rotate);
54
+ var Rotate$1 = Rotate;
55
+
56
+ export { Rotate$1 as default };
57
+ //# sourceMappingURL=rotate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rotate.js","sources":["../src/components/rotate.ts"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;AAQA,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;AAIG;AAKH,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,WAAW,CAAA;IAIpB,MAAM,GAAA;AACd,QAAA,OAAO,IAAI,CAAA,CACsB,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EAAE,OAAO,EAAE,CAAC;KAC7B;CACF,CAAA;AAtCC,UAAA,CAAA;IADC,IAAI,CAAC,MAAM,CAAC;AACM,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAFf,MAAM,GAAA,UAAA,CAAA;IAJX,MAAM,CAAC,SAAS,CAAC;AACjB,IAAA,MAAM,CACL,GAAG,CAAA,CAAA,4FAAA,EAAgG,QAAQ,CAAA,gBAAA,EAAmB,QAAQ,CAAA,yKAAA,EAA4K,QAAQ,CAAA,+BAAA,EAAkC,QAAQ,CAAA,iCAAA,CAAqC,CAC1Y;AACK,CAAA,EAAA,MAAM,CAwCX,CAAA;AAED,eAAe,MAAM;;;;"}
@@ -0,0 +1,121 @@
1
+ import { type PropertyValueMap, type TemplateResult } from "lit";
2
+ import { GlobalStyle } from "../core/global-style.js";
3
+ /**
4
+ * {@linkcode Router} has basic routing control.
5
+ *
6
+ * To switch routes, use `router-link component`.
7
+ *
8
+ * It has two methods to collect routes.
9
+ *
10
+ * 1. From field `routes`, an array, each elements require "path" and "component".
11
+ * 2. From child elements, which have the slot attribute for matching routes.
12
+ *
13
+ * If only the method 1 is used, set `type` to `"field"`.
14
+ *
15
+ * If only the method 2 is used, set `type` to `"slotted"`.
16
+ *
17
+ * `type` defaults to `"united"`, which will try method 1, then method 2.
18
+ *
19
+ * If no routes are matched, the default value (no named slot) will be rendered.
20
+ *
21
+ * @category navigation
22
+ */
23
+ declare class Router<C = unknown> extends GlobalStyle {
24
+ static routerInstances: Set<Router<unknown>>;
25
+ private __fieldRouteTree;
26
+ private __slottedRouteTree;
27
+ private __cacheRecord;
28
+ private __routes;
29
+ /**
30
+ * Render result.
31
+ */
32
+ component: C | TemplateResult;
33
+ /**
34
+ * Dynamic parameters record.
35
+ */
36
+ params: Record<string, string>;
37
+ /**
38
+ * Value of matched path in routes.
39
+ */
40
+ path: string;
41
+ /**
42
+ * Current pathname (equals to location.pathname).
43
+ */
44
+ pathname: string;
45
+ /**
46
+ * Path prefix.
47
+ */
48
+ baseURL: string;
49
+ /**
50
+ * Rendered content when there is no match.
51
+ */
52
+ default: TemplateResult;
53
+ /**
54
+ * The type of routing sources.
55
+ *
56
+ * If field, it won't collect the slot attribute of the child elements.
57
+ *
58
+ * This property should not be changed after the rendering is complete.
59
+ */
60
+ type: "united" | "slotted" | "field";
61
+ /**
62
+ * Cache accessed records.
63
+ *
64
+ * Emptied at each re-collection.
65
+ */
66
+ cache: boolean;
67
+ set routes(value: (Record<string, any> & {
68
+ path: string;
69
+ component?: C;
70
+ })[]);
71
+ get routes(): (Record<string, any> & {
72
+ path: string;
73
+ component?: C;
74
+ })[];
75
+ clear(): void;
76
+ protected render(): C | TemplateResult;
77
+ connectedCallback(): void;
78
+ disconnectedCallback(): void;
79
+ useRouter(): {
80
+ pathname: string;
81
+ params: Record<string, string>;
82
+ path: string;
83
+ component: C | TemplateResult;
84
+ };
85
+ /**
86
+ * @param params value of useRouter()
87
+ * @param first whether this path is loaded for the first time.
88
+ */
89
+ routeChangeCallback: (params: {
90
+ pathname: string;
91
+ params: Record<string, string>;
92
+ path: string;
93
+ component: C | TemplateResult;
94
+ }, first: boolean) => void;
95
+ protected updated(changedProperties: PropertyValueMap<this>): void;
96
+ /**
97
+ * Find components from {@linkcode __fieldRouteTree} matching query.
98
+ * @param query Query string.
99
+ * @returns Components or null.
100
+ */
101
+ fieldComponent(query?: string): C;
102
+ /**
103
+ * Find components from {@linkcode __slottedRouteTree} matching query.
104
+ * @param query Query string.
105
+ * @returns Named slot element template result or null.
106
+ */
107
+ slottedComponent(usedRouteTemplate?: string): TemplateResult<1>;
108
+ /**
109
+ * Reset the route tree, clear cache, collect routes from child elements.
110
+ */
111
+ collectSlottedRoutes(): void;
112
+ /**
113
+ * Reset the route tree, clear cache, collect routes from value.
114
+ */
115
+ collectFieldRoutes(value: typeof this.routes): void;
116
+ useWhich(path: string): string;
117
+ parseParams(routeTemplate: string, path: string): Record<string, string>;
118
+ static updateAll(): void;
119
+ }
120
+ export default Router;
121
+ //# sourceMappingURL=router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/components/router.ts"],"names":[],"mappings":"AAIA,OAAO,EAAO,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,cAEM,MAAM,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,WAAW;IAC3C,MAAM,CAAC,eAAe,uBAAqB;IAE3C,OAAO,CAAC,gBAAgB,CAA8B;IACtD,OAAO,CAAC,kBAAkB,CAA8B;IACxD,OAAO,CAAC,aAAa,CAAwD;IAC7E,OAAO,CAAC,QAAQ,CAMZ;IAEJ;;OAEG;IAEH,SAAS,EAAE,CAAC,GAAG,cAAc,CAAQ;IACrC;;OAEG;IAEH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IACpC;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IAEH,QAAQ,SAAM;IACd;;OAEG;IAEH,OAAO,SAAM;IACb;;OAEG;IAEH,OAAO,EAAE,cAAc,CAAc;IACrC;;;;;;OAMG;IAEH,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAY;IAChD;;;;OAIG;IAEH,KAAK,UAAS;IAEd,IACI,MAAM,CAAC,KAAK;;;QAAA,EAGf;IACD,IAAI,MAAM;;;SAET;IAED,KAAK;IAIL,SAAS,CAAC,MAAM;IAsBhB,iBAAiB;IAgBjB,oBAAoB;IAKpB,SAAS;;;;;;IAST;;;OAGG;IACH,mBAAmB,EAAE,CAAC,MAAM,EAAE;QAC5B,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/B,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,CAAC,GAAG,cAAc,CAAC;KAC/B,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAQ;IAElC,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAa3D;;;;OAIG;IACH,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM;IAgB7B;;;;OAIG;IACH,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,MAAM;IAiB3C;;OAEG;IACH,oBAAoB;IAQpB;;OAEG;IACH,kBAAkB,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC,MAAM;IAQ5C,QAAQ,CAAC,IAAI,EAAE,MAAM;IAIrB,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAI/C,MAAM,CAAC,SAAS;CAKjB;AAED,eAAe,MAAM,CAAC"}
@@ -0,0 +1,251 @@
1
+ import { __decorate } from 'tslib';
2
+ import { godown } from '@godown/element/decorators/godown.js';
3
+ import { styles } from '@godown/element/decorators/styles.js';
4
+ import { htmlSlot } from '@godown/element/directives/html-slot.js';
5
+ import { RouteTree } from '@godown/element/tools/route-tree.js';
6
+ import { css } from 'lit';
7
+ import { state, property } from 'lit/decorators.js';
8
+ import { GlobalStyle } from '../core/global-style.js';
9
+
10
+ var Router_1;
11
+ const protoName = "router";
12
+ /**
13
+ * {@linkcode Router} has basic routing control.
14
+ *
15
+ * To switch routes, use `router-link component`.
16
+ *
17
+ * It has two methods to collect routes.
18
+ *
19
+ * 1. From field `routes`, an array, each elements require "path" and "component".
20
+ * 2. From child elements, which have the slot attribute for matching routes.
21
+ *
22
+ * If only the method 1 is used, set `type` to `"field"`.
23
+ *
24
+ * If only the method 2 is used, set `type` to `"slotted"`.
25
+ *
26
+ * `type` defaults to `"united"`, which will try method 1, then method 2.
27
+ *
28
+ * If no routes are matched, the default value (no named slot) will be rendered.
29
+ *
30
+ * @category navigation
31
+ */
32
+ let Router = Router_1 = class Router extends GlobalStyle {
33
+ constructor() {
34
+ super(...arguments);
35
+ this.__fieldRouteTree = new RouteTree();
36
+ this.__slottedRouteTree = new RouteTree();
37
+ this.__cacheRecord = new Map();
38
+ /**
39
+ * Render result.
40
+ */
41
+ this.component = null;
42
+ /**
43
+ * Dynamic parameters record.
44
+ */
45
+ this.params = {};
46
+ /**
47
+ * Current pathname (equals to location.pathname).
48
+ */
49
+ this.pathname = "";
50
+ /**
51
+ * Path prefix.
52
+ */
53
+ this.baseURL = "";
54
+ /**
55
+ * Rendered content when there is no match.
56
+ */
57
+ this.default = htmlSlot();
58
+ /**
59
+ * The type of routing sources.
60
+ *
61
+ * If field, it won't collect the slot attribute of the child elements.
62
+ *
63
+ * This property should not be changed after the rendering is complete.
64
+ */
65
+ this.type = "united";
66
+ /**
67
+ * Cache accessed records.
68
+ *
69
+ * Emptied at each re-collection.
70
+ */
71
+ this.cache = false;
72
+ /**
73
+ * @param params value of useRouter()
74
+ * @param first whether this path is loaded for the first time.
75
+ */
76
+ this.routeChangeCallback = null;
77
+ }
78
+ set routes(value) {
79
+ this.__routes = value;
80
+ this.collectFieldRoutes(value);
81
+ }
82
+ get routes() {
83
+ return this.__routes;
84
+ }
85
+ clear() {
86
+ this.__cacheRecord.clear();
87
+ }
88
+ render() {
89
+ this.params = {};
90
+ if (this.cache) {
91
+ const cached = this.__cacheRecord.get(this.pathname);
92
+ if (cached) {
93
+ Object.assign(this, cached);
94
+ return this.component;
95
+ }
96
+ }
97
+ switch (this.type) {
98
+ case "field":
99
+ this.component = this.fieldComponent();
100
+ break;
101
+ case "slotted":
102
+ this.component = this.slottedComponent();
103
+ break;
104
+ default:
105
+ this.component = this.fieldComponent() ?? this.slottedComponent();
106
+ }
107
+ return this.component ?? this.default ?? null;
108
+ }
109
+ connectedCallback() {
110
+ super.connectedCallback();
111
+ Router_1.routerInstances.add(this);
112
+ this.pathname = window.location.pathname;
113
+ if (this.type !== "field") {
114
+ const mutationObserver = new MutationObserver(this.collectSlottedRoutes);
115
+ mutationObserver.observe(this, {
116
+ attributeFilter: ["slot"],
117
+ attributes: true,
118
+ subtree: true,
119
+ });
120
+ this.collectSlottedRoutes();
121
+ }
122
+ }
123
+ disconnectedCallback() {
124
+ super.disconnectedCallback();
125
+ Router_1.routerInstances.delete(this);
126
+ }
127
+ useRouter() {
128
+ return {
129
+ pathname: this.pathname,
130
+ params: this.params,
131
+ path: this.path,
132
+ component: this.component,
133
+ };
134
+ }
135
+ updated(changedProperties) {
136
+ const shouldDispatch = changedProperties.has("pathname") || changedProperties.has("path");
137
+ if (shouldDispatch) {
138
+ const ur = this.useRouter();
139
+ const noRecord = !this.__cacheRecord.has(this.pathname);
140
+ if (noRecord) {
141
+ this.__cacheRecord.set(this.pathname, ur);
142
+ }
143
+ this.routeChangeCallback?.(ur, noRecord);
144
+ this.dispatchEvent(new CustomEvent("change", { detail: ur }));
145
+ }
146
+ }
147
+ /**
148
+ * Find components from {@linkcode __fieldRouteTree} matching query.
149
+ * @param query Query string.
150
+ * @returns Components or null.
151
+ */
152
+ fieldComponent(query) {
153
+ query ||= this.useWhich(this.pathname);
154
+ this.path = query;
155
+ if (!query) {
156
+ return null;
157
+ }
158
+ this.params = this.parseParams(this.path, this.pathname);
159
+ const route = this.routes.find((r) => r.path === query);
160
+ if (!route) {
161
+ return null;
162
+ }
163
+ return route.component;
164
+ }
165
+ /**
166
+ * Find components from {@linkcode __slottedRouteTree} matching query.
167
+ * @param query Query string.
168
+ * @returns Named slot element template result or null.
169
+ */
170
+ slottedComponent(usedRouteTemplate) {
171
+ const slottedPaths = this._slottedNames;
172
+ usedRouteTemplate ||= this.__slottedRouteTree.useWhich(this.pathname);
173
+ this.path = usedRouteTemplate;
174
+ if (!usedRouteTemplate) {
175
+ return null;
176
+ }
177
+ this.path = slottedPaths.find((s) => s === usedRouteTemplate);
178
+ if (!this.path) {
179
+ return null;
180
+ }
181
+ this.params = this.parseParams(usedRouteTemplate, this.pathname);
182
+ return htmlSlot(this.path);
183
+ }
184
+ /**
185
+ * Reset the route tree, clear cache, collect routes from child elements.
186
+ */
187
+ collectSlottedRoutes() {
188
+ this.__slottedRouteTree = new RouteTree();
189
+ this.clear();
190
+ this._slottedNames.forEach(slotName => {
191
+ this.__slottedRouteTree.insert(slotName);
192
+ });
193
+ }
194
+ /**
195
+ * Reset the route tree, clear cache, collect routes from value.
196
+ */
197
+ collectFieldRoutes(value) {
198
+ this.__fieldRouteTree = new RouteTree();
199
+ this.clear();
200
+ value.forEach(({ path }) => {
201
+ this.__fieldRouteTree.insert(path);
202
+ });
203
+ }
204
+ useWhich(path) {
205
+ return this.__fieldRouteTree.useWhich(this.baseURL + path);
206
+ }
207
+ parseParams(routeTemplate, path) {
208
+ return this.__fieldRouteTree.parseParams(path, routeTemplate);
209
+ }
210
+ static updateAll() {
211
+ this.routerInstances.forEach((i) => {
212
+ i.pathname = window.location.pathname;
213
+ });
214
+ }
215
+ };
216
+ Router.routerInstances = new Set();
217
+ __decorate([
218
+ state()
219
+ ], Router.prototype, "component", void 0);
220
+ __decorate([
221
+ state()
222
+ ], Router.prototype, "params", void 0);
223
+ __decorate([
224
+ state()
225
+ ], Router.prototype, "path", void 0);
226
+ __decorate([
227
+ property()
228
+ ], Router.prototype, "pathname", void 0);
229
+ __decorate([
230
+ property()
231
+ ], Router.prototype, "baseURL", void 0);
232
+ __decorate([
233
+ state()
234
+ ], Router.prototype, "default", void 0);
235
+ __decorate([
236
+ property()
237
+ ], Router.prototype, "type", void 0);
238
+ __decorate([
239
+ property({ type: Boolean })
240
+ ], Router.prototype, "cache", void 0);
241
+ __decorate([
242
+ state()
243
+ ], Router.prototype, "routes", null);
244
+ Router = Router_1 = __decorate([
245
+ godown(protoName),
246
+ styles(css `:host{display:contents}`)
247
+ ], Router);
248
+ var Router$1 = Router;
249
+
250
+ export { Router$1 as default };
251
+ //# sourceMappingURL=router.js.map