@mhmo91/schmancy 0.10.28 → 0.10.30

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 (451) hide show
  1. package/custom-elements.json +7 -2
  2. package/dist/SchmancyElement-BQ4DFufc.js +300 -0
  3. package/dist/SchmancyElement-BQ4DFufc.js.map +1 -0
  4. package/dist/SchmancyElement-DhSiMp6Y.cjs +2 -0
  5. package/dist/SchmancyElement-DhSiMp6Y.cjs.map +1 -0
  6. package/dist/agent/{flow-3RrZM-e7.js.map → flow-CvG1fLW5.js.map} +1 -1
  7. package/dist/agent/schmancy.agent.js +7843 -3334
  8. package/dist/agent/schmancy.agent.js.map +1 -1
  9. package/dist/agent/schmancy.manifest.json +1 -2
  10. package/dist/agent/{vendor-material-color-33Mj762T.js.map → vendor-material-color-DcL7ZPxx.js.map} +1 -1
  11. package/dist/animation-CCOIW4wJ.cjs.map +1 -1
  12. package/dist/animation-DCznELuT.js.map +1 -1
  13. package/dist/{area-C_Yvjmad.js → area-BjpUWvzE.js} +7 -7
  14. package/dist/{area-C_Yvjmad.js.map → area-BjpUWvzE.js.map} +1 -1
  15. package/dist/area-CgTzkxah.cjs +21 -0
  16. package/dist/{area-BSVOYQDA.cjs.map → area-CgTzkxah.cjs.map} +1 -1
  17. package/dist/area.cjs +1 -1
  18. package/dist/area.js +1 -1
  19. package/dist/{audio-CxO5a2HL.js → audio-CwBJntnB.js} +1 -1
  20. package/dist/{audio-CxO5a2HL.js.map → audio-CwBJntnB.js.map} +1 -1
  21. package/dist/{audio-Cvmemu84.cjs → audio-DISBFOaR.cjs} +1 -1
  22. package/dist/{audio-Cvmemu84.cjs.map → audio-DISBFOaR.cjs.map} +1 -1
  23. package/dist/audio.cjs +1 -1
  24. package/dist/audio.js +2 -2
  25. package/dist/{autocomplete-B50VXUzw.cjs → autocomplete-DbCUOgWU.cjs} +2 -2
  26. package/dist/{autocomplete-B50VXUzw.cjs.map → autocomplete-DbCUOgWU.cjs.map} +1 -1
  27. package/dist/{autocomplete-C6I1mfOT.js → autocomplete-Dy708jem.js} +7 -7
  28. package/dist/{autocomplete-C6I1mfOT.js.map → autocomplete-Dy708jem.js.map} +1 -1
  29. package/dist/autocomplete.cjs +1 -1
  30. package/dist/autocomplete.js +1 -1
  31. package/dist/avatar.cjs +3 -3
  32. package/dist/avatar.cjs.map +1 -1
  33. package/dist/avatar.js +5 -5
  34. package/dist/avatar.js.map +1 -1
  35. package/dist/badge.cjs +1 -1
  36. package/dist/badge.js +1 -1
  37. package/dist/{boat-DVQBNkk5.cjs → boat-BzZN_iwp.cjs} +11 -11
  38. package/dist/{boat-DVQBNkk5.cjs.map → boat-BzZN_iwp.cjs.map} +1 -1
  39. package/dist/{boat-C94QZ4Zt.js → boat-Z4Lzl3ai.js} +8 -8
  40. package/dist/{boat-C94QZ4Zt.js.map → boat-Z4Lzl3ai.js.map} +1 -1
  41. package/dist/boat.cjs +1 -1
  42. package/dist/boat.js +1 -1
  43. package/dist/breadcrumb.cjs +4 -4
  44. package/dist/breadcrumb.cjs.map +1 -1
  45. package/dist/breadcrumb.js +7 -7
  46. package/dist/breadcrumb.js.map +1 -1
  47. package/dist/{busy--bNb42rM.js → busy-CRFGPkcP.js} +7 -7
  48. package/dist/{busy--bNb42rM.js.map → busy-CRFGPkcP.js.map} +1 -1
  49. package/dist/{busy-DuxFvEkY.cjs → busy-Cu-47DfN.cjs} +8 -8
  50. package/dist/{busy-DuxFvEkY.cjs.map → busy-Cu-47DfN.cjs.map} +1 -1
  51. package/dist/busy.cjs +1 -1
  52. package/dist/busy.js +1 -1
  53. package/dist/{button-DAFZ5A4O.cjs → button-CN_JTjRd.cjs} +15 -15
  54. package/dist/{button-DAFZ5A4O.cjs.map → button-CN_JTjRd.cjs.map} +1 -1
  55. package/dist/{button-B7b9L_h5.js → button-D_USF3tt.js} +10 -10
  56. package/dist/{button-B7b9L_h5.js.map → button-D_USF3tt.js.map} +1 -1
  57. package/dist/button.cjs +19 -19
  58. package/dist/button.cjs.map +1 -1
  59. package/dist/button.js +9 -9
  60. package/dist/button.js.map +1 -1
  61. package/dist/{card-DZPd24Sn.cjs → card-D4P5_gg9.cjs} +10 -10
  62. package/dist/{card-DZPd24Sn.cjs.map → card-D4P5_gg9.cjs.map} +1 -1
  63. package/dist/{card-ixzxOW-Q.js → card-DpN5KIYc.js} +15 -15
  64. package/dist/{card-ixzxOW-Q.js.map → card-DpN5KIYc.js.map} +1 -1
  65. package/dist/card.cjs +1 -1
  66. package/dist/card.js +1 -1
  67. package/dist/{checkbox-DdGpepTh.js → checkbox-C8ChypKf.js} +5 -5
  68. package/dist/{checkbox-DdGpepTh.js.map → checkbox-C8ChypKf.js.map} +1 -1
  69. package/dist/{checkbox-Bi_Fm2mf.cjs → checkbox-hhXVXDV1.cjs} +3 -3
  70. package/dist/{checkbox-Bi_Fm2mf.cjs.map → checkbox-hhXVXDV1.cjs.map} +1 -1
  71. package/dist/checkbox.cjs +1 -1
  72. package/dist/checkbox.js +1 -1
  73. package/dist/{chips-DLTynyVB.js → chips-B8R9q4yl.js} +27 -27
  74. package/dist/{chips-DLTynyVB.js.map → chips-B8R9q4yl.js.map} +1 -1
  75. package/dist/{chips-DWQMZErr.cjs → chips-BTLlO_Ow.cjs} +18 -18
  76. package/dist/{chips-DWQMZErr.cjs.map → chips-BTLlO_Ow.cjs.map} +1 -1
  77. package/dist/chips.cjs +1 -1
  78. package/dist/chips.js +2 -2
  79. package/dist/connectivity.cjs +7 -7
  80. package/dist/connectivity.cjs.map +1 -1
  81. package/dist/connectivity.js +5 -5
  82. package/dist/connectivity.js.map +1 -1
  83. package/dist/content-drawer.cjs +1 -1
  84. package/dist/content-drawer.js +1 -1
  85. package/dist/cursor-glow-Ah7VXSj7.js.map +1 -1
  86. package/dist/cursor-glow-Bulq-38P.cjs.map +1 -1
  87. package/dist/{date-range-DQpmMJH-.cjs → date-range-9h6ZSkZb.cjs} +3 -3
  88. package/dist/{date-range-DQpmMJH-.cjs.map → date-range-9h6ZSkZb.cjs.map} +1 -1
  89. package/dist/{date-range-CJ6MiTpF.js → date-range-CS96dWMh.js} +7 -7
  90. package/dist/{date-range-CJ6MiTpF.js.map → date-range-CS96dWMh.js.map} +1 -1
  91. package/dist/date-range-inline-CAxnHA-l.cjs +43 -0
  92. package/dist/{date-range-inline-nPWIs-3C.cjs.map → date-range-inline-CAxnHA-l.cjs.map} +1 -1
  93. package/dist/{date-range-inline-Ho3CENTh.js → date-range-inline-DCXdGeRv.js} +5 -5
  94. package/dist/{date-range-inline-Ho3CENTh.js.map → date-range-inline-DCXdGeRv.js.map} +1 -1
  95. package/dist/date-range-inline.cjs +1 -1
  96. package/dist/date-range-inline.js +1 -1
  97. package/dist/date-range.cjs +1 -1
  98. package/dist/date-range.js +1 -1
  99. package/dist/delay.cjs +4 -4
  100. package/dist/delay.cjs.map +1 -1
  101. package/dist/delay.js +6 -6
  102. package/dist/delay.js.map +1 -1
  103. package/dist/{details-BnRWMZdt.cjs → details-BC0IObBd.cjs} +2 -2
  104. package/dist/{details-BnRWMZdt.cjs.map → details-BC0IObBd.cjs.map} +1 -1
  105. package/dist/{details-CcMTvYo7.js → details-Pgd0slKn.js} +11 -11
  106. package/dist/{details-CcMTvYo7.js.map → details-Pgd0slKn.js.map} +1 -1
  107. package/dist/details.cjs +1 -1
  108. package/dist/details.js +1 -1
  109. package/dist/{directives-DgPbz0lQ.js → directives-B-RT9R2u.js} +3 -3
  110. package/dist/{directives-DgPbz0lQ.js.map → directives-B-RT9R2u.js.map} +1 -1
  111. package/dist/{directives-BkSqmLBV.cjs → directives-CFWacnWU.cjs} +1 -1
  112. package/dist/{directives-BkSqmLBV.cjs.map → directives-CFWacnWU.cjs.map} +1 -1
  113. package/dist/directives.cjs +1 -1
  114. package/dist/directives.js +2 -2
  115. package/dist/discovery.service-CIa3Eeuk.cjs.map +1 -1
  116. package/dist/discovery.service-DZFxtRwW.js.map +1 -1
  117. package/dist/{divider-CZCj0ioH.js → divider-BMzm0lOz.js} +5 -5
  118. package/dist/{divider-CZCj0ioH.js.map → divider-BMzm0lOz.js.map} +1 -1
  119. package/dist/{divider-C6yJSL1c.cjs → divider-D1OzaRAQ.cjs} +3 -3
  120. package/dist/{divider-C6yJSL1c.cjs.map → divider-D1OzaRAQ.cjs.map} +1 -1
  121. package/dist/divider.cjs +1 -1
  122. package/dist/divider.js +1 -1
  123. package/dist/dropdown.cjs +4 -4
  124. package/dist/dropdown.cjs.map +1 -1
  125. package/dist/dropdown.js +8 -8
  126. package/dist/dropdown.js.map +1 -1
  127. package/dist/{expand-Cc6ogXsR.js → expand-C0Uqxfv0.js} +10 -10
  128. package/dist/{expand-Cc6ogXsR.js.map → expand-C0Uqxfv0.js.map} +1 -1
  129. package/dist/{expand-D4EhwOYh.cjs → expand-CiQkzth9.cjs} +3 -3
  130. package/dist/{expand-D4EhwOYh.cjs.map → expand-CiQkzth9.cjs.map} +1 -1
  131. package/dist/expand.cjs +1 -1
  132. package/dist/expand.js +1 -1
  133. package/dist/float-Bu_IfKRd.cjs +1 -0
  134. package/dist/{float-B8EPc_OG.cjs.map → float-Bu_IfKRd.cjs.map} +1 -1
  135. package/dist/{float-BvI3HTtB.js → float-DwBMXhek.js} +2 -2
  136. package/dist/{float-BvI3HTtB.js.map → float-DwBMXhek.js.map} +1 -1
  137. package/dist/float.cjs +1 -1
  138. package/dist/float.js +1 -1
  139. package/dist/{form-FtYtZScl.js → form-B9Je2W_m.js} +15 -95
  140. package/dist/form-B9Je2W_m.js.map +1 -0
  141. package/dist/{form-SHg5FLsd.cjs → form-BnbAVZyf.cjs} +4 -19
  142. package/dist/form-BnbAVZyf.cjs.map +1 -0
  143. package/dist/form.cjs +18 -1
  144. package/dist/form.cjs.map +1 -0
  145. package/dist/form.js +93 -9
  146. package/dist/form.js.map +1 -0
  147. package/dist/gravity-6pL6CfIr.cjs.map +1 -1
  148. package/dist/gravity-sVK3zGBF.js.map +1 -1
  149. package/dist/handover/agent-runtime-followups.md +1 -1
  150. package/dist/handover/agent-runtime-v1.md +3 -3
  151. package/dist/hashContent-BqU6v1Xr.js.map +1 -1
  152. package/dist/hashContent-iRZJJWtE.cjs.map +1 -1
  153. package/dist/{icon-CgIXAvKI.cjs → icons-BfWQl5k5.cjs} +6 -6
  154. package/dist/icons-BfWQl5k5.cjs.map +1 -0
  155. package/dist/{icon-B1eZr2ZL.js → icons-DJHPXKgR.js} +4 -4
  156. package/dist/{icon-CgIXAvKI.cjs.map → icons-DJHPXKgR.js.map} +1 -1
  157. package/dist/icons.cjs +1 -1
  158. package/dist/icons.js +1 -1
  159. package/dist/{iframe-CmpAZc61.js → iframe-DLz8ll0s.js} +5 -5
  160. package/dist/{iframe-CmpAZc61.js.map → iframe-DLz8ll0s.js.map} +1 -1
  161. package/dist/{iframe-BO3BpRLH.cjs → iframe-UtczJypj.cjs} +5 -5
  162. package/dist/{iframe-BO3BpRLH.cjs.map → iframe-UtczJypj.cjs.map} +1 -1
  163. package/dist/iframe.cjs +1 -1
  164. package/dist/iframe.js +1 -1
  165. package/dist/index.cjs +1 -1
  166. package/dist/index.js +69 -69
  167. package/dist/{input-_Hft9vov.js → input-AQbBEj2f.js} +15 -15
  168. package/dist/{input-_Hft9vov.js.map → input-AQbBEj2f.js.map} +1 -1
  169. package/dist/{input-5YL2oUBr.cjs → input-Pp6A1m3s.cjs} +2 -2
  170. package/dist/{input-5YL2oUBr.cjs.map → input-Pp6A1m3s.cjs.map} +1 -1
  171. package/dist/{input-chip-DKMNpcED.cjs → input-chip-B5vYNuEm.cjs} +9 -9
  172. package/dist/{input-chip-DKMNpcED.cjs.map → input-chip-B5vYNuEm.cjs.map} +1 -1
  173. package/dist/{input-chip-BNTojQT6.js → input-chip-Bbs_gXOB.js} +10 -10
  174. package/dist/{input-chip-BNTojQT6.js.map → input-chip-Bbs_gXOB.js.map} +1 -1
  175. package/dist/input.cjs +1 -1
  176. package/dist/input.js +1 -1
  177. package/dist/json.cjs +3 -3
  178. package/dist/json.cjs.map +1 -1
  179. package/dist/json.js +5 -5
  180. package/dist/json.js.map +1 -1
  181. package/dist/kbd.cjs +2 -2
  182. package/dist/kbd.cjs.map +1 -1
  183. package/dist/kbd.js +5 -5
  184. package/dist/kbd.js.map +1 -1
  185. package/dist/{layout-DSAjo92m.js → layout-9K1zxhZn.js} +1 -1
  186. package/dist/{layout-DSAjo92m.js.map → layout-9K1zxhZn.js.map} +1 -1
  187. package/dist/{layout-eXb9wjDh.cjs → layout-B0dct--7.cjs} +1 -1
  188. package/dist/{layout-eXb9wjDh.cjs.map → layout-B0dct--7.cjs.map} +1 -1
  189. package/dist/layout.cjs +2 -2
  190. package/dist/layout.cjs.map +1 -1
  191. package/dist/layout.js +7 -7
  192. package/dist/layout.js.map +1 -1
  193. package/dist/lazy-CayEFyC3.cjs.map +1 -1
  194. package/dist/lazy-D-bO2r4m.js.map +1 -1
  195. package/dist/{lightbox-t4dvb8_A.cjs → lightbox-D_EizrG3.cjs} +21 -21
  196. package/dist/{lightbox-t4dvb8_A.cjs.map → lightbox-D_EizrG3.cjs.map} +1 -1
  197. package/dist/{lightbox-CKlYcnHV.js → lightbox-DmJTs2My.js} +9 -9
  198. package/dist/{lightbox-CKlYcnHV.js.map → lightbox-DmJTs2My.js.map} +1 -1
  199. package/dist/lightbox.cjs +1 -1
  200. package/dist/lightbox.js +1 -1
  201. package/dist/{list-21mWtDKg.cjs → list-BSn8czyO.cjs} +5 -5
  202. package/dist/{list-21mWtDKg.cjs.map → list-BSn8czyO.cjs.map} +1 -1
  203. package/dist/{list-B6QhxgRJ.js → list-DjSSRZxF.js} +12 -12
  204. package/dist/{list-B6QhxgRJ.js.map → list-DjSSRZxF.js.map} +1 -1
  205. package/dist/list.cjs +1 -1
  206. package/dist/list.js +1 -1
  207. package/dist/magnetic-B2VKNfDu.js.map +1 -1
  208. package/dist/magnetic-MQ3HMHJi.cjs.map +1 -1
  209. package/dist/{menu-C5qcgMnw.js → menu-CCVEde6u.js} +7 -7
  210. package/dist/{menu-C5qcgMnw.js.map → menu-CCVEde6u.js.map} +1 -1
  211. package/dist/menu-DTNnq7j_.cjs +23 -0
  212. package/dist/{menu-Cuxt5K4Y.cjs.map → menu-DTNnq7j_.cjs.map} +1 -1
  213. package/dist/menu.cjs +1 -1
  214. package/dist/menu.js +1 -1
  215. package/dist/mixins-BYfSDvbP.js +412 -0
  216. package/dist/mixins-BYfSDvbP.js.map +1 -0
  217. package/dist/mixins-YQI9JogS.cjs +245 -0
  218. package/dist/mixins-YQI9JogS.cjs.map +1 -0
  219. package/dist/mixins.cjs +1 -1
  220. package/dist/mixins.js +3 -2
  221. package/dist/nav-drawer.cjs +1 -1
  222. package/dist/nav-drawer.js +1 -1
  223. package/dist/navigation-bar.cjs +1 -1
  224. package/dist/navigation-bar.js +1 -1
  225. package/dist/navigation-rail.cjs +10 -10
  226. package/dist/navigation-rail.cjs.map +1 -1
  227. package/dist/navigation-rail.js +15 -15
  228. package/dist/navigation-rail.js.map +1 -1
  229. package/dist/{notification-CDKBKh63.js → notification-BNEuu3Q2.js} +7 -7
  230. package/dist/{notification-CDKBKh63.js.map → notification-BNEuu3Q2.js.map} +1 -1
  231. package/dist/notification-RhaYvA1I.cjs +24 -0
  232. package/dist/{notification-CcNoBFEJ.cjs.map → notification-RhaYvA1I.cjs.map} +1 -1
  233. package/dist/notification.cjs +1 -1
  234. package/dist/notification.js +1 -1
  235. package/dist/{option-BWfmDJvm.js → option-BLMYRy5C.js} +6 -6
  236. package/dist/{option-BWfmDJvm.js.map → option-BLMYRy5C.js.map} +1 -1
  237. package/dist/{option-DejeqOad.cjs → option-Dk7UFFlr.cjs} +5 -5
  238. package/dist/{option-DejeqOad.cjs.map → option-Dk7UFFlr.cjs.map} +1 -1
  239. package/dist/option.cjs +1 -1
  240. package/dist/option.js +1 -1
  241. package/dist/overlay-BbntqsVm.cjs +43 -0
  242. package/dist/overlay-BbntqsVm.cjs.map +1 -0
  243. package/dist/{overlay-D3c_NY18.js → overlay-CujzmLxg.js} +93 -144
  244. package/dist/overlay-CujzmLxg.js.map +1 -0
  245. package/dist/overlay-stack-Bdr9lOqi.cjs.map +1 -1
  246. package/dist/overlay-stack-D2rgxQLh.js.map +1 -1
  247. package/dist/overlay.cjs +1 -1
  248. package/dist/overlay.confirm-body-CMge0LP5.cjs +70 -0
  249. package/dist/overlay.confirm-body-CMge0LP5.cjs.map +1 -0
  250. package/dist/{overlay.confirm-body-B_v0ivkn.js → overlay.confirm-body-CRk4MvKh.js} +15 -27
  251. package/dist/overlay.confirm-body-CRk4MvKh.js.map +1 -0
  252. package/dist/overlay.js +3 -3
  253. package/dist/{overlay.service-B3FjXCqc.js → overlay.service-DnT4SBlJ.js} +31 -27
  254. package/dist/{overlay.service-B3FjXCqc.js.map → overlay.service-DnT4SBlJ.js.map} +1 -1
  255. package/dist/overlay.service-Dq5XtSEL.cjs +1 -0
  256. package/dist/{overlay.service-BkSeqXIv.cjs.map → overlay.service-Dq5XtSEL.cjs.map} +1 -1
  257. package/dist/{progress-6_rb3Ah9.cjs → progress-Bqd4DdOQ.cjs} +7 -7
  258. package/dist/{progress-6_rb3Ah9.cjs.map → progress-Bqd4DdOQ.cjs.map} +1 -1
  259. package/dist/{progress-CFcmO0wv.js → progress-Cu_wh6Sl.js} +10 -10
  260. package/dist/{progress-CFcmO0wv.js.map → progress-Cu_wh6Sl.js.map} +1 -1
  261. package/dist/progress.cjs +1 -1
  262. package/dist/progress.js +1 -1
  263. package/dist/radio-group-C8rUbYL6.cjs +19 -0
  264. package/dist/{radio-group-_WZg8EKM.cjs.map → radio-group-C8rUbYL6.cjs.map} +1 -1
  265. package/dist/{radio-group-Bd8y9QpX.js → radio-group-Duzgx17I.js} +7 -7
  266. package/dist/{radio-group-Bd8y9QpX.js.map → radio-group-Duzgx17I.js.map} +1 -1
  267. package/dist/radio-group.cjs +1 -1
  268. package/dist/radio-group.js +1 -1
  269. package/dist/range.cjs +2 -2
  270. package/dist/range.cjs.map +1 -1
  271. package/dist/range.js +5 -5
  272. package/dist/range.js.map +1 -1
  273. package/dist/reduced-motion-D-L12p7G.js.map +1 -1
  274. package/dist/reduced-motion-Ds-HjMzn.cjs.map +1 -1
  275. package/dist/rxjs-utils-Csnks202.cjs.map +1 -1
  276. package/dist/rxjs-utils-d-ivVN84.js.map +1 -1
  277. package/dist/search-DPKoC-dT.cjs.map +1 -1
  278. package/dist/search-MvIBA93K.js.map +1 -1
  279. package/dist/{select-Czpl1ztD.js → select-CzCv1f1c.js} +6 -6
  280. package/dist/{select-Czpl1ztD.js.map → select-CzCv1f1c.js.map} +1 -1
  281. package/dist/{select-BaioT3yY.cjs → select-DdqEsfnG.cjs} +2 -2
  282. package/dist/{select-BaioT3yY.cjs.map → select-DdqEsfnG.cjs.map} +1 -1
  283. package/dist/select.cjs +1 -1
  284. package/dist/select.js +1 -1
  285. package/dist/skeleton.cjs +2 -2
  286. package/dist/skeleton.cjs.map +1 -1
  287. package/dist/skeleton.js +5 -5
  288. package/dist/skeleton.js.map +1 -1
  289. package/dist/skills/form.md +34 -0
  290. package/dist/skills/schmancy/form.md +34 -0
  291. package/dist/slider.cjs +7 -7
  292. package/dist/slider.cjs.map +1 -1
  293. package/dist/slider.js +6 -6
  294. package/dist/slider.js.map +1 -1
  295. package/dist/{sound.service-v_jqCkos.js → sound.service-BOWTBG16.js} +1 -1
  296. package/dist/{sound.service-v_jqCkos.js.map → sound.service-BOWTBG16.js.map} +1 -1
  297. package/dist/{sound.service-DVJZb9ox.cjs → sound.service-BwIzAFQx.cjs} +1 -1
  298. package/dist/{sound.service-DVJZb9ox.cjs.map → sound.service-BwIzAFQx.cjs.map} +1 -1
  299. package/dist/{splash-screen-YtTVkJg8.js → splash-screen-Dj-zuGuB.js} +6 -6
  300. package/dist/{splash-screen-YtTVkJg8.js.map → splash-screen-Dj-zuGuB.js.map} +1 -1
  301. package/dist/splash-screen-_KhxgneW.cjs +41 -0
  302. package/dist/{splash-screen-3FtgdVy3.cjs.map → splash-screen-_KhxgneW.cjs.map} +1 -1
  303. package/dist/splash-screen.cjs +1 -1
  304. package/dist/splash-screen.js +1 -1
  305. package/dist/src-BSjgxN07.cjs +263 -0
  306. package/dist/{src-AYRNg63f.cjs.map → src-BSjgxN07.cjs.map} +1 -1
  307. package/dist/{src-DKMEgT2z.js → src-Curgs4Yp.js} +83 -83
  308. package/dist/{src-DKMEgT2z.js.map → src-Curgs4Yp.js.map} +1 -1
  309. package/dist/state-BthYuA3T.cjs +1 -0
  310. package/dist/state-BthYuA3T.cjs.map +1 -0
  311. package/dist/{state-CHbIt2Dw.js → state-E0bVrZ7q.js} +293 -279
  312. package/dist/state-E0bVrZ7q.js.map +1 -0
  313. package/dist/state.cjs +1 -1
  314. package/dist/state.js +3 -3
  315. package/dist/steps.cjs +10 -10
  316. package/dist/steps.cjs.map +1 -1
  317. package/dist/steps.js +9 -9
  318. package/dist/steps.js.map +1 -1
  319. package/dist/{surface-CVxyQPln.js → surface-C2TIedTq.js} +4 -4
  320. package/dist/{surface-CVxyQPln.js.map → surface-C2TIedTq.js.map} +1 -1
  321. package/dist/surface-D-GqzyLn.cjs +7 -0
  322. package/dist/{surface-BNvxLEDN.cjs.map → surface-D-GqzyLn.cjs.map} +1 -1
  323. package/dist/surface.cjs +1 -1
  324. package/dist/surface.js +1 -1
  325. package/dist/switch.cjs +2 -2
  326. package/dist/switch.cjs.map +1 -1
  327. package/dist/switch.js +6 -6
  328. package/dist/switch.js.map +1 -1
  329. package/dist/table.cjs +11 -11
  330. package/dist/table.cjs.map +1 -1
  331. package/dist/table.js +10 -10
  332. package/dist/table.js.map +1 -1
  333. package/dist/{tabs-CnPXvZuZ.js → tabs-CLRVe23a.js} +11 -11
  334. package/dist/{tabs-CnPXvZuZ.js.map → tabs-CLRVe23a.js.map} +1 -1
  335. package/dist/{tabs-DTU7748z.cjs → tabs-C_493iod.cjs} +4 -4
  336. package/dist/{tabs-DTU7748z.cjs.map → tabs-C_493iod.cjs.map} +1 -1
  337. package/dist/tabs.cjs +1 -1
  338. package/dist/tabs.js +1 -1
  339. package/dist/teleport.cjs +1 -1
  340. package/dist/teleport.js +1 -1
  341. package/dist/{textarea-mQPsppmd.js → textarea-BWEyOtPy.js} +9 -9
  342. package/dist/{textarea-mQPsppmd.js.map → textarea-BWEyOtPy.js.map} +1 -1
  343. package/dist/textarea-CICgd2oP.cjs +43 -0
  344. package/dist/{textarea-Bqth6Q8P.cjs.map → textarea-CICgd2oP.cjs.map} +1 -1
  345. package/dist/textarea.cjs +1 -1
  346. package/dist/textarea.js +1 -1
  347. package/dist/{theme-BJqpv4cG.js → theme-Bfg_H2AF.js} +12 -12
  348. package/dist/{theme-BJqpv4cG.js.map → theme-Bfg_H2AF.js.map} +1 -1
  349. package/dist/theme-D7zOJiyg.cjs +181 -0
  350. package/dist/{theme-D4HGKt7N.cjs.map → theme-D7zOJiyg.cjs.map} +1 -1
  351. package/dist/{theme-button-Jap7G_IH.js → theme-button-C53GdQER.js} +4 -4
  352. package/dist/{theme-button-Jap7G_IH.js.map → theme-button-C53GdQER.js.map} +1 -1
  353. package/dist/theme-button-DgeBcqFm.cjs +8 -0
  354. package/dist/{theme-button-LP-Dgr17.cjs.map → theme-button-DgeBcqFm.cjs.map} +1 -1
  355. package/dist/theme-button.cjs +1 -1
  356. package/dist/theme-button.js +1 -1
  357. package/dist/theme.cjs +1 -1
  358. package/dist/theme.interface-CSt7JUBD.cjs.map +1 -1
  359. package/dist/theme.interface-odQEpZZH.js.map +1 -1
  360. package/dist/theme.js +3 -3
  361. package/dist/{theme.service-Bh08uOSJ.js → theme.service-BqDuioYc.js} +1 -1
  362. package/dist/{theme.service-Bh08uOSJ.js.map → theme.service-BqDuioYc.js.map} +1 -1
  363. package/dist/{theme.service-Y-e8b331.cjs → theme.service-C3PoISGd.cjs} +1 -1
  364. package/dist/{theme.service-Y-e8b331.cjs.map → theme.service-C3PoISGd.cjs.map} +1 -1
  365. package/dist/tooltip.cjs.map +1 -1
  366. package/dist/tooltip.js.map +1 -1
  367. package/dist/tree.cjs +3 -3
  368. package/dist/tree.cjs.map +1 -1
  369. package/dist/tree.js +4 -4
  370. package/dist/tree.js.map +1 -1
  371. package/dist/types.cjs.map +1 -1
  372. package/dist/types.js.map +1 -1
  373. package/dist/typewriter.cjs.map +1 -1
  374. package/dist/typewriter.js.map +1 -1
  375. package/dist/{typography-Bc4MmSal.cjs → typography-B19fJ5YT.cjs} +4 -4
  376. package/dist/{typography-Bc4MmSal.cjs.map → typography-B19fJ5YT.cjs.map} +1 -1
  377. package/dist/{typography-BJMm6b0b.js → typography-CzbQv-X0.js} +10 -10
  378. package/dist/{typography-BJMm6b0b.js.map → typography-CzbQv-X0.js.map} +1 -1
  379. package/dist/typography.cjs +1 -1
  380. package/dist/typography.js +1 -1
  381. package/dist/utils-DTa3QHxk.cjs.map +1 -1
  382. package/dist/utils-H8wNknWC.js.map +1 -1
  383. package/dist/visually-hidden.cjs +2 -2
  384. package/dist/visually-hidden.cjs.map +1 -1
  385. package/dist/visually-hidden.js +4 -4
  386. package/dist/visually-hidden.js.map +1 -1
  387. package/dist/window-DXB53PuA.cjs +59 -0
  388. package/dist/{window-CNu_WnsY.cjs.map → window-DXB53PuA.cjs.map} +1 -1
  389. package/dist/{window-DZTjkE24.js → window-DpctMXiy.js} +9 -9
  390. package/dist/{window-DZTjkE24.js.map → window-DpctMXiy.js.map} +1 -1
  391. package/dist/window.cjs +1 -1
  392. package/dist/window.js +1 -1
  393. package/package.json +1 -1
  394. package/skills/schmancy/form.md +34 -0
  395. package/src/form/form.ts +5 -1
  396. package/src/overlay/overlay.animations.ts +0 -29
  397. package/src/overlay/overlay.component.ts +30 -38
  398. package/src/overlay/overlay.confirm-body.ts +3 -15
  399. package/src/overlay/overlay.layout.ts +11 -53
  400. package/src/overlay/overlay.stack.test.ts +113 -0
  401. package/src/overlay/overlay.types.ts +17 -11
  402. package/src/state/active-host.ts +50 -1
  403. package/src/state/index.ts +50 -11
  404. package/src/state/schmancy-context.ts +97 -88
  405. package/src/surface/surface.styles.ts +14 -10
  406. package/types/src/form/form.d.ts +1 -0
  407. package/types/src/overlay/overlay.confirm-body.d.ts +1 -1
  408. package/types/src/overlay/overlay.layout.d.ts +10 -30
  409. package/types/src/overlay/overlay.stack.test.d.ts +1 -0
  410. package/types/src/overlay/overlay.types.d.ts +17 -11
  411. package/types/src/state/active-host.d.ts +3 -0
  412. package/types/src/state/index.d.ts +16 -2
  413. package/types/src/state/schmancy-context.d.ts +2 -2
  414. package/dist/active-host-BP0zy_Y9.js +0 -63
  415. package/dist/active-host-BP0zy_Y9.js.map +0 -1
  416. package/dist/active-host-jH3iloCR.cjs +0 -1
  417. package/dist/active-host-jH3iloCR.cjs.map +0 -1
  418. package/dist/agent/overlay.confirm-body-BZoUgkdK.js +0 -4574
  419. package/dist/agent/overlay.confirm-body-BZoUgkdK.js.map +0 -1
  420. package/dist/area-BSVOYQDA.cjs +0 -21
  421. package/dist/date-range-inline-nPWIs-3C.cjs +0 -43
  422. package/dist/float-B8EPc_OG.cjs +0 -1
  423. package/dist/form-FtYtZScl.js.map +0 -1
  424. package/dist/form-SHg5FLsd.cjs.map +0 -1
  425. package/dist/icon-B1eZr2ZL.js.map +0 -1
  426. package/dist/menu-Cuxt5K4Y.cjs +0 -23
  427. package/dist/mixins-8dT5j6CS.js +0 -627
  428. package/dist/mixins-8dT5j6CS.js.map +0 -1
  429. package/dist/mixins-BF3Vj8_c.cjs +0 -242
  430. package/dist/mixins-BF3Vj8_c.cjs.map +0 -1
  431. package/dist/notification-CcNoBFEJ.cjs +0 -24
  432. package/dist/overlay-D3c_NY18.js.map +0 -1
  433. package/dist/overlay-Dv2utO4C.cjs +0 -43
  434. package/dist/overlay-Dv2utO4C.cjs.map +0 -1
  435. package/dist/overlay.confirm-body-B2ntyquG.cjs +0 -79
  436. package/dist/overlay.confirm-body-B2ntyquG.cjs.map +0 -1
  437. package/dist/overlay.confirm-body-B_v0ivkn.js.map +0 -1
  438. package/dist/overlay.service-BkSeqXIv.cjs +0 -1
  439. package/dist/radio-group-_WZg8EKM.cjs +0 -19
  440. package/dist/splash-screen-3FtgdVy3.cjs +0 -41
  441. package/dist/src-AYRNg63f.cjs +0 -263
  442. package/dist/state-CHbIt2Dw.js.map +0 -1
  443. package/dist/state-DcGj-pJJ.cjs +0 -1
  444. package/dist/state-DcGj-pJJ.cjs.map +0 -1
  445. package/dist/surface-BNvxLEDN.cjs +0 -7
  446. package/dist/textarea-Bqth6Q8P.cjs +0 -43
  447. package/dist/theme-D4HGKt7N.cjs +0 -181
  448. package/dist/theme-button-LP-Dgr17.cjs +0 -8
  449. package/dist/window-CNu_WnsY.cjs +0 -59
  450. /package/dist/agent/{flow-3RrZM-e7.js → flow-CvG1fLW5.js} +0 -0
  451. /package/dist/agent/{vendor-material-color-33Mj762T.js → vendor-material-color-DcL7ZPxx.js} +0 -0
@@ -11,10 +11,16 @@
11
11
  // connected. `disconnectedCallback` destroys all isolated copies; their
12
12
  // pending writes flush, their adapters close.
13
13
 
14
- import { LitElement, html } from 'lit'
15
- import { property } from 'lit/decorators.js'
16
- import { ContextProvider, createContext, type Context } from '@lit/context'
17
- import { _publishEventHost, stateContextKey } from './active-host'
14
+ import { type Context, ContextProvider, createContext } from '@lit/context';
15
+ import { SchmancyElement } from '@mixins/SchmancyElement';
16
+ import { html } from 'lit';
17
+ import { property } from 'lit/decorators.js';
18
+ import {
19
+ _publishEventHost,
20
+ deregisterAmbientProvider,
21
+ registerAmbientProvider,
22
+ stateContextKey,
23
+ } from './active-host';
18
24
 
19
25
  // Curated set of DOM event types that descendants are likely to bind state-
20
26
  // mutating handlers to. The capture-phase listener publishes `this` as the
@@ -22,109 +28,112 @@ import { _publishEventHost, stateContextKey } from './active-host'
22
28
  // inline handlers (or any code reached during the synchronous chain) call a
23
29
  // state mutator can resolve back to the isolated copy this context provides.
24
30
  const EVENT_TYPES = [
25
- 'click',
26
- 'dblclick',
27
- 'submit',
28
- 'change',
29
- 'input',
30
- 'keydown',
31
- 'keyup',
32
- 'keypress',
33
- 'pointerdown',
34
- 'pointerup',
35
- 'mousedown',
36
- 'mouseup',
37
- 'focus',
38
- 'blur',
39
- 'paste',
40
- 'drop',
41
- ] as const
31
+ 'click',
32
+ 'dblclick',
33
+ 'submit',
34
+ 'change',
35
+ 'input',
36
+ 'keydown',
37
+ 'keyup',
38
+ 'keypress',
39
+ 'pointerdown',
40
+ 'pointerup',
41
+ 'mousedown',
42
+ 'mouseup',
43
+ 'focus',
44
+ 'blur',
45
+ 'paste',
46
+ 'drop',
47
+ ] as const;
42
48
 
43
49
  /** Duck-typed view of what the `state()` factory hands out, restricted to the
44
50
  * bits `<schmancy-context>` needs. Kept internal — consumers see the full
45
51
  * `State<>` type and never refer to this. */
46
52
  export interface StateTemplate {
47
- readonly namespace: string
48
- readonly value: unknown
49
- /** Internal hook the factory adds to every state instance. Builds a fresh
50
- * per-context copy seeded with the current value, sharing nothing with the
51
- * global instance. The returned object exposes `destroy()` so the context
52
- * element can flush + close on disconnect. */
53
- _isolatedInstance(): { destroy(): void } & Record<string | symbol, unknown>
53
+ readonly namespace: string;
54
+ readonly value: unknown;
55
+ /** Internal hook the factory adds to every state instance. Builds a fresh
56
+ * per-context copy seeded with the current value, sharing nothing with the
57
+ * global instance. The returned object exposes `destroy()` so the context
58
+ * element can flush + close on disconnect. */
59
+ _isolatedInstance(): { destroy(): void } & Record<string | symbol, unknown>;
54
60
  }
55
61
 
56
- export class SchmancyContext extends LitElement {
57
- /** States to isolate under this subtree. Pass the same instances you import
58
- * at module scope (e.g. `provides={[cart, menu]}`). Outside this element
59
- * they continue to behave as module-scoped globals; descendants of this
60
- * element see a per-element isolated copy. */
61
- @property({ attribute: false }) provides: readonly StateTemplate[] = []
62
+ export class SchmancyContext extends SchmancyElement {
63
+ /** States to isolate under this subtree. Pass the same instances you import
64
+ * at module scope (e.g. `provides={[cart, menu]}`). Outside this element
65
+ * they continue to behave as module-scoped globals; descendants of this
66
+ * element see a per-element isolated copy. */
67
+ @property({ attribute: false }) provides: readonly StateTemplate[] = [];
62
68
 
63
- // Per-mount records. Keep both the provider (so we can release it on
64
- // disconnect) and the isolated instance (so we can destroy it).
65
- private _scoped: Array<{
66
- isolated: { destroy(): void }
67
- provider: ContextProvider<Context<unknown, unknown>>
68
- }> = []
69
+ // Per-mount records. Keep both the provider (so we can release it on
70
+ // disconnect) and the isolated instance (so we can destroy it).
71
+ private _scoped: Array<{
72
+ namespace: string;
73
+ isolated: { destroy(): void };
74
+ provider: ContextProvider<Context<unknown, unknown>>;
75
+ }> = [];
69
76
 
70
- private _publishEventTargetAsHost = (e: Event): void => {
71
- // Publish the deepest event target (across shadow boundaries) rather
72
- // than `this`. The downstream `ContextRequestEvent` will be dispatched
73
- // from this host and must bubble up through `<schmancy-context>` to
74
- // reach our `ContextProvider`. `@lit/context` skips self-registration
75
- // (`consumerHost === this.host` ⇒ no-op), so dispatching from
76
- // schmancy-context itself would silently fall back to the global.
77
- const path = e.composedPath()
78
- for (const node of path) {
79
- if (node instanceof HTMLElement) {
80
- _publishEventHost(node)
81
- return
82
- }
83
- }
84
- }
77
+ private _publishEventTargetAsHost = (e: Event): void => {
78
+ // Publish the deepest event target (across shadow boundaries) rather
79
+ // than `this`. The downstream `ContextRequestEvent` will be dispatched
80
+ // from this host and must bubble up through `<schmancy-context>` to
81
+ // reach our `ContextProvider`. `@lit/context` skips self-registration
82
+ // (`consumerHost === this.host` ⇒ no-op), so dispatching from
83
+ // schmancy-context itself would silently fall back to the global.
84
+ const path = e.composedPath();
85
+ for (const node of path) {
86
+ if (node instanceof HTMLElement) {
87
+ _publishEventHost(node);
88
+ return;
89
+ }
90
+ }
91
+ };
85
92
 
86
- override connectedCallback(): void {
87
- super.connectedCallback()
88
- for (const tmpl of this.provides) {
89
- const isolated = tmpl._isolatedInstance()
90
- const ctx = createContext<unknown>(stateContextKey(tmpl.namespace))
91
- // ContextProvider auto-wires via the host's ReactiveControllerHost
92
- // interface (LitElement satisfies it). It listens for
93
- // `context-request` events and responds with `isolated` for any
94
- // requester whose `event.context === ctx`.
95
- const provider = new ContextProvider(this, { context: ctx, initialValue: isolated })
96
- this._scoped.push({ isolated, provider })
97
- }
98
- for (const type of EVENT_TYPES) {
99
- this.addEventListener(type, this._publishEventTargetAsHost, { capture: true })
100
- }
101
- }
93
+ override connectedCallback(): void {
94
+ super.connectedCallback();
95
+ for (const tmpl of this.provides) {
96
+ const isolated = tmpl._isolatedInstance();
97
+ const ctx = createContext<unknown>(stateContextKey(tmpl.namespace));
98
+ // ContextProvider auto-wires via the host's ReactiveControllerHost
99
+ // interface (LitElement satisfies it). It listens for
100
+ // `context-request` events and responds with `isolated` for any
101
+ // requester whose `event.context === ctx`.
102
+ const provider = new ContextProvider(this, { context: ctx, initialValue: isolated });
103
+ registerAmbientProvider(tmpl.namespace, isolated);
104
+ this._scoped.push({ namespace: tmpl.namespace, isolated, provider });
105
+ }
106
+ for (const type of EVENT_TYPES) {
107
+ this.addEventListener(type, this._publishEventTargetAsHost, { capture: true });
108
+ }
109
+ }
102
110
 
103
- override disconnectedCallback(): void {
104
- for (const type of EVENT_TYPES) {
105
- this.removeEventListener(type, this._publishEventTargetAsHost, { capture: true })
106
- }
107
- for (const entry of this._scoped) {
108
- entry.isolated.destroy()
109
- }
110
- this._scoped = []
111
- super.disconnectedCallback()
112
- }
111
+ override disconnectedCallback(): void {
112
+ for (const type of EVENT_TYPES) {
113
+ this.removeEventListener(type, this._publishEventTargetAsHost, { capture: true });
114
+ }
115
+ for (const entry of this._scoped) {
116
+ deregisterAmbientProvider(entry.namespace);
117
+ entry.isolated.destroy();
118
+ }
119
+ this._scoped = [];
120
+ super.disconnectedCallback();
121
+ }
113
122
 
114
- override render() {
115
- return html`<slot></slot>`
116
- }
123
+ override render() {
124
+ return html`<slot></slot>`;
125
+ }
117
126
  }
118
127
 
119
128
  // Imperative define so a second load (source + dist) is a no-op rather than
120
129
  // a throw — the registry is process-global; whichever class wins serves the
121
130
  // element identity for the page.
122
131
  if (!customElements.get('schmancy-context')) {
123
- customElements.define('schmancy-context', SchmancyContext)
132
+ customElements.define('schmancy-context', SchmancyContext);
124
133
  }
125
134
 
126
135
  declare global {
127
- interface HTMLElementTagNameMap {
128
- 'schmancy-context': SchmancyContext
129
- }
136
+ interface HTMLElementTagNameMap {
137
+ 'schmancy-context': SchmancyContext;
138
+ }
130
139
  }
@@ -25,13 +25,15 @@ export const surfaceTypeStyles = css`
25
25
  color: var(--schmancy-sys-color-surface-on);
26
26
  }
27
27
 
28
- /* Subtle — frosted glass, clearly readable */
28
+ /* Subtle — bright vibrant glass: near-white tint, saturated blur, top-edge highlight */
29
29
  :host([type='subtle']) {
30
- --glass-base: var(--schmancy-sys-color-surface-container);
30
+ --glass-base: var(--schmancy-sys-color-surface-lowest);
31
31
  --glass-tint: var(--schmancy-sys-color-surface-on);
32
- background: color-mix(in srgb, var(--glass-base) 78%, transparent);
33
- backdrop-filter: blur(8px) saturate(130%);
34
- -webkit-backdrop-filter: blur(8px) saturate(130%);
32
+ background: color-mix(in srgb, var(--glass-base) 30%, transparent);
33
+ backdrop-filter: blur(12px) saturate(160%);
34
+ -webkit-backdrop-filter: blur(12px) saturate(160%);
35
+ border: 1px solid color-mix(in srgb, var(--schmancy-sys-color-outlineVariant) 60%, transparent);
36
+ box-shadow: inset 0 1px 0 color-mix(in srgb, var(--schmancy-sys-color-surface-on) 8%, transparent);
35
37
  color: var(--schmancy-sys-color-surface-on);
36
38
  }
37
39
 
@@ -147,14 +149,16 @@ export const surfaceTypeStyles = css`
147
149
  color: var(--schmancy-sys-color-surface-on);
148
150
  }
149
151
 
150
- /* subtle aliases — frosted glass */
152
+ /* subtle aliases — bright vibrant glass */
151
153
  :host([type='containerLow']),
152
154
  :host([type='container']) {
153
- --glass-base: var(--schmancy-sys-color-surface-container);
155
+ --glass-base: var(--schmancy-sys-color-surface-lowest);
154
156
  --glass-tint: var(--schmancy-sys-color-surface-on);
155
- background: color-mix(in srgb, var(--glass-base) 78%, transparent);
156
- backdrop-filter: blur(8px) saturate(130%);
157
- -webkit-backdrop-filter: blur(8px) saturate(130%);
157
+ background: color-mix(in srgb, var(--glass-base) 30%, transparent);
158
+ backdrop-filter: blur(12px) saturate(160%);
159
+ -webkit-backdrop-filter: blur(12px) saturate(160%);
160
+ border: 1px solid color-mix(in srgb, var(--schmancy-sys-color-outlineVariant) 60%, transparent);
161
+ box-shadow: inset 0 1px 0 color-mix(in srgb, var(--schmancy-sys-color-surface-on) 8%, transparent);
158
162
  color: var(--schmancy-sys-color-surface-on);
159
163
  }
160
164
 
@@ -33,6 +33,7 @@ export type SchmancyFormSubmitDetail<T = Record<string, FormDataEntryValue>> = {
33
33
  until(p: Promise<unknown>): void;
34
34
  };
35
35
  export default class SchmancyForm<TSchema extends ParseSchema | undefined = undefined> extends SchmancyElement {
36
+ static styles: import("lit").CSSResult;
36
37
  static readonly tagName: string;
37
38
  /**
38
39
  * Optional schema for parsing FormData on submit. Anything with a
@@ -1,6 +1,6 @@
1
1
  import { SchmancyElement } from '@mixins/index';
2
2
  import { type TemplateResult } from 'lit';
3
- import '../icons/icon';
3
+ import '../form/form';
4
4
  import '../form/fields/input/input';
5
5
  import '../typography/typography';
6
6
  import '../button/button';
@@ -7,45 +7,25 @@ import type { Anchor, OverlayLayout, VirtualAnchor } from './overlay.types';
7
7
  * as named-constant diffs, not hidden in inline literals (state skill:
8
8
  * "thresholds ARE the policy").
9
9
  */
10
- /** Below this viewport width, every overlay becomes a bottom sheet. */
11
- export declare const NARROW_VIEWPORT_PX = 640;
12
- /** Content taller than this fraction of viewport height → sheet. */
13
- export declare const TALL_CONTENT_FRACTION = 0.8;
14
- /** Content wider than this fraction of viewport width → sheet. */
15
- export declare const WIDE_CONTENT_FRACTION = 0.9;
16
10
  /** Floating UI / CSS anchor-positioning safety padding. */
17
11
  export declare const ANCHOR_FIT_PADDING_PX = 16;
18
12
  export interface LayoutInputs {
19
13
  anchor?: Anchor;
20
- content: {
21
- width: number;
22
- height: number;
23
- };
24
- viewport: {
25
- width: number;
26
- height: number;
27
- /** `matchMedia('(pointer: coarse)').matches` at call time. */
28
- isCoarsePointer: boolean;
29
- };
30
14
  }
31
15
  /**
32
- * Priority order:
33
- * 1. viewport / content forces sheet
34
- * 2. anchor provided → anchored (the novel default)
35
- * 3. fallback → centered
16
+ * Two outcomes, one signal: anchor presence.
36
17
  *
37
- * Floating UI's `flip` + `shift` + `size` middleware handles "anchor
38
- * doesn't fit initially" it returns a fitting position rather than
39
- * rejecting. So step 2 does NOT branch on "does the anchor fit?";
40
- * Floating UI's output IS the answer. If content is genuinely too
41
- * large for any anchored position, step 1 already routed to sheet.
18
+ * - anchor provided anchored (popover/menu/dropdown next to a trigger)
19
+ * - no anchor → sheet (everything else: dialogs, takeovers, content panels)
20
+ *
21
+ * Callers who want to force a specific layout regardless of anchor pass
22
+ * `ShowOptions.as` the resolver is bypassed entirely in that case.
23
+ *
24
+ * Floating UI's `flip` + `shift` + `size` middleware handles "anchor doesn't
25
+ * fit initially" — it returns a fitting position rather than rejecting. So
26
+ * anchored layouts don't need a fallback; Floating UI's output IS the answer.
42
27
  */
43
28
  export declare function resolveLayout(inputs: LayoutInputs): OverlayLayout;
44
- /**
45
- * Read the current viewport + pointer inputs. Separated so tests can
46
- * substitute synthetic inputs and the `resolveLayout` fn stays pure.
47
- */
48
- export declare function readViewport(): LayoutInputs['viewport'];
49
29
  /**
50
30
  * Resolved reference the positioning strategies consume.
51
31
  *
@@ -0,0 +1 @@
1
+ import './overlay.component';
@@ -71,11 +71,11 @@ export interface ShowOptions {
71
71
  * addEventListener, getUserMedia, etc. When signal aborts, overlay
72
72
  * dismisses (same as unsubscribe). */
73
73
  signal?: AbortSignal;
74
- /** Rare escape hatch. Defaults: `false` for anchored, `true` for
75
- * centered/sheet. Setting `modal: true` on an anchored overlay forces
76
- * <dialog>.showModal() semantics (focus trap + background inert)
77
- * use for destructive-confirm menus. */
78
- modal?: boolean;
74
+ /** Override the resolved layout. When set, short-circuits the resolver
75
+ * and forces this layout. Use when the caller knows the content's nature
76
+ * better than the resolver can e.g. `as: 'sheet'` for an immersive
77
+ * takeover view that doesn't have an anchor. */
78
+ as?: OverlayLayout;
79
79
  /** Default `'push'`. Same vocabulary as `area.push()`.
80
80
  * - `'push'` — new history entry; back dismisses, forward re-opens.
81
81
  * - `'replace'` — replace current entry; back skips the overlay.
@@ -98,14 +98,20 @@ export interface ShowOptions {
98
98
  track?: boolean;
99
99
  }
100
100
  /**
101
- * Resolved layout. Pure output of the dispatch engine; callers never pick.
102
- * - `'centered'` — native <dialog>.showModal(), focus-trapped.
101
+ * Resolved layout. Two values:
103
102
  * - `'anchored'` — popover="auto" + CSS Anchor Positioning / Floating UI,
104
- * non-modal, background stays interactive.
105
- * - `'sheet'` — native <dialog>.showModal() as a bottom sheet,
106
- * swipe-to-dismiss, safe-area aware.
103
+ * non-modal, background stays interactive. Used when the
104
+ * caller passes an anchor (the novel default for menus,
105
+ * popovers, dropdowns).
106
+ * - `'sheet'` — bottom sheet (mobile) or modal panel (desktop) with
107
+ * swipe-to-dismiss, safe-area aware. The default for every
108
+ * non-anchored overlay — confirm/prompt, immersive content
109
+ * views, legal pages, takeovers.
110
+ *
111
+ * Callers can force a layout with `ShowOptions.as` — useful for an anchored
112
+ * trigger whose content should still render as a sheet, or vice versa.
107
113
  */
108
- export type OverlayLayout = 'centered' | 'anchored' | 'sheet';
114
+ export type OverlayLayout = 'anchored' | 'sheet';
109
115
  /**
110
116
  * Positioning tier an anchored overlay is using.
111
117
  * - `'css-anchor'` — Tier 1: Popover API + CSS Anchor Positioning (Chromium).
@@ -16,6 +16,9 @@ export declare const _activeHost: {
16
16
  * later, unrelated microtask sees a stale value. */
17
17
  export declare function _publishEventHost(host: HTMLElement): void;
18
18
  export declare function resolveActiveHost(): HTMLElement | undefined;
19
+ export declare function registerAmbientProvider(namespace: string, instance: unknown): void;
20
+ export declare function deregisterAmbientProvider(namespace: string): void;
21
+ export declare function getAmbientProvider(namespace: string): unknown | undefined;
19
22
  /** Stable context key for a state namespace. `Symbol.for(...)` so the same
20
23
  * namespace string yields the same symbol across module boundaries — the
21
24
  * ContextProvider on `<schmancy-context>` and the ContextRequestEvent
@@ -1,11 +1,11 @@
1
1
  import { Signal } from '@lit-labs/signals';
2
- import { Observable } from 'rxjs';
2
+ import { Observable, type MonoTypeOperatorFunction } from 'rxjs';
3
3
  import { type Draft } from 'immer';
4
4
  import { type StorageBackend } from './persist';
5
5
  import './schmancy-context';
6
6
  export type { StorageBackend } from './persist';
7
7
  export { Signal } from '@lit-labs/signals';
8
- export { _activeHost } from './active-host';
8
+ export { _activeHost, registerAmbientProvider, deregisterAmbientProvider, getAmbientProvider } from './active-host';
9
9
  export { SchmancyContext } from './schmancy-context';
10
10
  declare const stateBrand: unique symbol;
11
11
  declare const namespaceBrand: unique symbol;
@@ -143,3 +143,17 @@ export interface BoundState<T> {
143
143
  }
144
144
  export declare function bindState<T>(host: ReactiveControllerHost, source: ObservableState<T>): BoundState<T>;
145
145
  export declare function observe<T>(source: ObservableState<T>): (proto: object, propertyKey: string | symbol) => void;
146
+ /**
147
+ * RxJS operator that restores `host` as the active schmancy context for every
148
+ * emission. Drop this into any pipeline whose subscriber calls state mutators
149
+ * from an async scheduler that bypasses the Promise.then patch (Firestore
150
+ * onSnapshot, WebSockets, native timers, etc.).
151
+ *
152
+ * ```ts
153
+ * snapshotDoc$(ref).pipe(
154
+ * schmancyContext(this),
155
+ * takeUntil(this.disconnecting),
156
+ * ).subscribe(snap => { ws.legalEntity.set(parse(snap)) })
157
+ * ```
158
+ */
159
+ export declare function schmancyContext<T>(host: HTMLElement): MonoTypeOperatorFunction<T>;
@@ -1,4 +1,4 @@
1
- import { LitElement } from 'lit';
1
+ import { SchmancyElement } from '@mixins/SchmancyElement';
2
2
  /** Duck-typed view of what the `state()` factory hands out, restricted to the
3
3
  * bits `<schmancy-context>` needs. Kept internal — consumers see the full
4
4
  * `State<>` type and never refer to this. */
@@ -13,7 +13,7 @@ export interface StateTemplate {
13
13
  destroy(): void;
14
14
  } & Record<string | symbol, unknown>;
15
15
  }
16
- export declare class SchmancyContext extends LitElement {
16
+ export declare class SchmancyContext extends SchmancyElement {
17
17
  /** States to isolate under this subtree. Pass the same instances you import
18
18
  * at module scope (e.g. `provides={[cart, menu]}`). Outside this element
19
19
  * they continue to behave as module-scoped globals; descendants of this
@@ -1,63 +0,0 @@
1
- function e(e, t, n, r) {
2
- var i, a = arguments.length, o = a < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r;
3
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o = Reflect.decorate(e, t, n, r);
4
- else for (var s = e.length - 1; s >= 0; s--) (i = e[s]) && (o = (a < 3 ? i(o) : a > 3 ? i(t, n, o) : i(t, n)) || o);
5
- return a > 3 && o && Object.defineProperty(t, n, o), o;
6
- }
7
- var t = Symbol.for("schmancy.state.activeHost.stack"), n = globalThis;
8
- n[t] ??= { stack: [void 0] };
9
- var r = n[t].stack;
10
- if (typeof Promise < "u" && !("t" in Promise.prototype)) {
11
- Object.defineProperty(Promise.prototype, "t", {
12
- value: !0,
13
- configurable: !1,
14
- enumerable: !1,
15
- writable: !1
16
- });
17
- let e = Promise.prototype.then;
18
- Promise.prototype.then = function(t, n) {
19
- let i = r[r.length - 1], a = t && ((e) => {
20
- r.push(i);
21
- try {
22
- return t(e);
23
- } finally {
24
- r.pop();
25
- }
26
- }), o = n && ((e) => {
27
- r.push(i);
28
- try {
29
- return n(e);
30
- } finally {
31
- r.pop();
32
- }
33
- });
34
- return e.call(this, a, o);
35
- };
36
- }
37
- var i = {
38
- run(e, t) {
39
- r.push(e);
40
- try {
41
- return t();
42
- } finally {
43
- r.pop();
44
- }
45
- },
46
- get: () => r[r.length - 1]
47
- }, a = Symbol.for("schmancy.state.activeHost.eventHost"), o = globalThis[a] ??= {
48
- host: void 0,
49
- scheduled: !1
50
- };
51
- function s(e) {
52
- o.host = e, o.scheduled || (o.scheduled = !0, queueMicrotask(() => {
53
- o.scheduled = !1, o.host = void 0;
54
- }));
55
- }
56
- function c() {
57
- let e = i.get();
58
- return e === void 0 ? o.host === void 0 ? typeof document < "u" && document.activeElement instanceof HTMLElement ? document.activeElement : void 0 : o.host : e;
59
- }
60
- function l(e) {
61
- return Symbol.for(`schmancy.state:${e}`);
62
- }
63
- export { e as a, l as i, s as n, c as r, i as t };
@@ -1 +0,0 @@
1
- {"version":3,"file":"active-host-BP0zy_Y9.js","names":[],"sources":["../src/state/active-host.ts"],"sourcesContent":["// `_`-prefixed identifiers below are an intentional naming convention for\n// module-private infrastructure. `_activeHost` is exported only so the\n// $LitElement mixin can wrap render/lifecycle in `_activeHost.run`; the\n// underscore signals \"not part of the public state API.\"\n/* oxlint-disable no-underscore-dangle */\n\n// Active-host tracker for context-aware state resolution.\n//\n// Polyfills the TC39 `AsyncContext.Variable` propagation primitive using a\n// stack + a one-time `Promise.prototype.then` patch. The stack value carries\n// across `await`, `queueMicrotask`, RxJS subscription callbacks, and any\n// other code path that ultimately routes through `Promise.then`. This is the\n// same capture-and-restore technique zone.js, async-hooks, and the various\n// AsyncContext userland polyfills use.\n//\n// Why we own this:\n// - The TC39 proposal is at stage 2; no official polyfill ships from TC39.\n// - The `async-context@1.0.0` package on npm is unrelated (a 2014 Node\n// callback helper), and the available userland polyfills either depend\n// on zone.js (~50 KB) or are Node-only / hobby quality.\n// - The patch surface is ~30 lines, idempotent, preserves Promise\n// semantics (delegates to the original `then`, so `Symbol.species` and\n// subclassing work unchanged), and decommissions cleanly the day a real\n// polyfill or native AsyncContext lands (drop the file, swap the\n// `_activeHost` export for the standard primitive).\n//\n// Known limitation — native await on a native Promise: V8's await\n// optimization (since 7.x) skips the spec-prescribed\n// `Promise.resolve(x).then(continuation)` step, so userland `then`\n// patches don't intercept the resumption. Class methods that mutate\n// state across an `await` boundary will fall back to the\n// module-scoped global, not the active-host's isolated copy. To\n// preserve the host across awaits, either keep the mutation in the\n// synchronous prelude before the first `await`, or explicitly chain\n// with `.then()` (which still routes through the patched method).\n// A real fix requires either a build-time async-function transform\n// or native AsyncContext.Variable in the runtime.\n//\n// resolveActiveHost() fallback chain:\n// 1. Stack value set by `_activeHost.run(host, fn)` — covers render(),\n// Lit lifecycle methods, and class-method handlers (all wrapped by\n// SchmancyElement's prototype-chain wrap).\n// 2. The closest `<schmancy-context>` whose subtree currently has an\n// in-flight DOM event. The element installs capture-phase listeners\n// that publish itself as the event-host while the synchronous\n// handler chain runs; the slot clears via microtask. Covers\n// template-bound inline arrow handlers attached to descendants.\n// 3. document.activeElement — keyboard handlers in focus.\n// 4. undefined → caller falls back to the module-scoped global instance.\n\n// Singleton across any number of schmancy module copies (source + dist, ESM\n// + CJS, hoisted vs. nested node_modules) via the runtime-global symbol\n// registry. The first copy to load creates the slot; later copies reuse it.\n// Without this, two stacks → mixins push to one, state reads from the other,\n// and active-host context is lost across the boundary.\nconst STACK_KEY = Symbol.for('schmancy.state.activeHost.stack')\ntype StackSlot = { stack: Array<HTMLElement | undefined> }\nconst _g = globalThis as { [STACK_KEY]?: StackSlot }\n_g[STACK_KEY] ??= { stack: [undefined] }\nconst _stack = _g[STACK_KEY].stack\n\n// One-time Promise.prototype.then patch at module init. Each .then() call\n// captures the stack head at chain time; firing the callback restores that\n// captured value for the duration of the callback. The guard property\n// prevents double-patching across HMR / duplicate module loads.\ndeclare global {\n\tinterface Promise<T> {\n\t\t// Marker symbol so we can detect (and skip) re-patching.\n\t\treadonly __schmancyActiveHostPatched?: true\n\t}\n}\n\n// Patching Promise.prototype is the entire mechanism this module exists to\n// provide — the lint rules below intentionally do not apply.\n/* oxlint-disable no-extend-native, unicorn/no-thenable */\nif (typeof Promise !== 'undefined' && !('__schmancyActiveHostPatched' in Promise.prototype)) {\n\tObject.defineProperty(Promise.prototype, '__schmancyActiveHostPatched', {\n\t\tvalue: true,\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\twritable: false,\n\t})\n\tconst _origThen = Promise.prototype.then\n\t// Replace with our wrapper. We delegate to the original `then` via\n\t// `_origThen.call(this, …)` so Promise subclassing / Symbol.species behave\n\t// exactly as before — the only added work is the stack push/pop around\n\t// each user callback.\n\tPromise.prototype.then = function schmancyThen<T, R1, R2>(\n\t\tthis: Promise<T>,\n\t\tonfulfilled?: ((value: T) => R1 | PromiseLike<R1>) | null,\n\t\tonrejected?: ((reason: unknown) => R2 | PromiseLike<R2>) | null,\n\t): Promise<R1 | R2> {\n\t\tconst captured = _stack[_stack.length - 1]\n\t\tconst wrapFulfilled = onfulfilled\n\t\t\t? (v: T): R1 | PromiseLike<R1> => {\n\t\t\t\t\t_stack.push(captured)\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn onfulfilled(v)\n\t\t\t\t\t} finally {\n\t\t\t\t\t\t_stack.pop()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t: onfulfilled\n\t\tconst wrapRejected = onrejected\n\t\t\t? (r: unknown): R2 | PromiseLike<R2> => {\n\t\t\t\t\t_stack.push(captured)\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn onrejected(r)\n\t\t\t\t\t} finally {\n\t\t\t\t\t\t_stack.pop()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t: onrejected\n\t\treturn _origThen.call(this, wrapFulfilled, wrapRejected) as Promise<R1 | R2>\n\t}\n}\n/* oxlint-enable no-extend-native, unicorn/no-thenable */\n\nexport const _activeHost = {\n\t/** Run `fn` with `host` as the active host for the duration of `fn` and\n\t * any awaits / microtasks / Promise chains that descend from it. */\n\trun<R>(host: HTMLElement | undefined, fn: () => R): R {\n\t\t_stack.push(host)\n\t\ttry {\n\t\t\treturn fn()\n\t\t} finally {\n\t\t\t_stack.pop()\n\t\t}\n\t},\n\t/** The current active host, or undefined if no `run()` is on the stack. */\n\tget(): HTMLElement | undefined {\n\t\treturn _stack[_stack.length - 1]\n\t},\n}\n\n// Tier 2 of the resolveActiveHost() fallback chain. A `<schmancy-context>`\n// publishes itself here from a capture-phase event listener attached to\n// itself; the slot clears in the next microtask, after the synchronous\n// event-handler chain has run. `window.event` is unreliable across both\n// engines and time (it can outlive its event — a stale `message` event\n// from postMessage can leak BODY for arbitrary later resolution calls), so\n// we own this slot rather than read the legacy global.\n//\n// Singleton across module copies for the same reason as `_stack` above.\nconst EVENT_HOST_KEY = Symbol.for('schmancy.state.activeHost.eventHost')\ntype EventHostSlot = { host: HTMLElement | undefined; scheduled: boolean }\nconst _eventHostSlot: EventHostSlot =\n\t((globalThis as { [EVENT_HOST_KEY]?: EventHostSlot })[EVENT_HOST_KEY] ??= {\n\t\thost: undefined,\n\t\tscheduled: false,\n\t})\n\n/** Publish `host` as the active event-host. The slot self-clears at the\n * end of the current microtask checkpoint — long enough for the entire\n * synchronous event-handler chain to read it, short enough that no\n * later, unrelated microtask sees a stale value. */\nexport function _publishEventHost(host: HTMLElement): void {\n\t_eventHostSlot.host = host\n\tif (_eventHostSlot.scheduled) return\n\t_eventHostSlot.scheduled = true\n\tqueueMicrotask(() => {\n\t\t_eventHostSlot.scheduled = false\n\t\t_eventHostSlot.host = undefined\n\t})\n}\n\nexport function resolveActiveHost(): HTMLElement | undefined {\n\t// 1. Stack (set by _activeHost.run).\n\tconst fromStack = _activeHost.get()\n\tif (fromStack !== undefined) return fromStack\n\n\t// 2. Closest <schmancy-context> with an in-flight event in its subtree.\n\tif (_eventHostSlot.host !== undefined) return _eventHostSlot.host\n\n\t// 3. document.activeElement — keyboard / focus handlers.\n\tif (typeof document !== 'undefined' && document.activeElement instanceof HTMLElement) {\n\t\treturn document.activeElement\n\t}\n\n\t// 4. undefined — caller falls back to module-scoped.\n\treturn undefined\n}\n\n/** Stable context key for a state namespace. `Symbol.for(...)` so the same\n * namespace string yields the same symbol across module boundaries — the\n * ContextProvider on `<schmancy-context>` and the ContextRequestEvent\n * dispatched by a state read must agree on identity. */\nexport function stateContextKey(namespace: string): symbol {\n\treturn Symbol.for(`schmancy.state:${namespace}`)\n}\n"],"mappings":";;;;;;AAuDA,IAAM,IAAY,OAAO,IAAI,kCAAA,EAEvB,IAAK;AACX,EAAG,OAAe,EAAE,OAAO,CAAA,KAAC,EAAA,EAAA;AAC5B,IAAM,IAAS,EAAG,GAAW;AAgB7B,IAAuB,OAAZ,UAAY,OAAZ,EAA6B,OAAiC,QAAQ,YAAY;CAC5F,OAAO,eAAe,QAAQ,WAAW,KAA+B;EACvE,OAAA,CAAO;EACP,cAAA,CAAc;EACd,YAAA,CAAY;EACZ,UAAA,CAAU;EAAA,CAAA;CAEX,IAAM,IAAY,QAAQ,UAAU;CAKpC,QAAQ,UAAU,OAAO,SAExB,GACA,GAAA;EAEA,IAAM,IAAW,EAAO,EAAO,SAAS,IAClC,IAAgB,OAClB,MAAA;GACD,EAAO,KAAK,EAAA;GACZ,IAAA;IACC,OAAO,EAAY,EAAA;aAAA;IAEnB,EAAO,KAAA;;MAIL,IAAe,OACjB,MAAA;GACD,EAAO,KAAK,EAAA;GACZ,IAAA;IACC,OAAO,EAAW,EAAA;aAAA;IAElB,EAAO,KAAA;;;EAIX,OAAO,EAAU,KAAK,MAAM,GAAe,EAAA;;;AAK7C,IAAa,IAAc;CAG1B,IAAO,GAA+B,GAAA;EACrC,EAAO,KAAK,EAAA;EACZ,IAAA;GACC,OAAO,GAAA;YAAA;GAEP,EAAO,KAAA;;;CAIT,WACQ,EAAO,EAAO,SAAS;CAAA,EAa1B,IAAiB,OAAO,IAAI,sCAAA,EAE5B,IACJ,WAAqD,OAAoB;CACzE,MAAA,KAAM;CACN,WAAA,CAAW;CAAA;AAOb,SAAgB,EAAkB,GAAA;CACjC,EAAe,OAAO,GAClB,EAAe,cACnB,EAAe,YAAA,CAAY,GAC3B,qBAAA;EACC,EAAe,YAAA,CAAY,GAC3B,EAAe,OAAA,KAAO;GAAA;;AAIxB,SAAgB,IAAA;CAEf,IAAM,IAAY,EAAY,KAAA;CAC9B,OAAI,MAAJ,KAAkB,IAGd,EAAe,SAHiB,KAGR,IAGJ,OAAb,WAAa,OAAe,SAAS,yBAAyB,cACjE,SAAS,gBAAA,KADjB,IAH8C,EAAe,OAHzB;;AAkBrC,SAAgB,EAAgB,GAAA;CAC/B,OAAO,OAAO,IAAI,kBAAkB,IAAA;;AAAA,SAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,QAAA,KAAA"}
@@ -1 +0,0 @@
1
- function e(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o}var t=Symbol.for(`schmancy.state.activeHost.stack`),n=globalThis;n[t]??={stack:[void 0]};var r=n[t].stack;if(typeof Promise<`u`&&!(`o`in Promise.prototype)){Object.defineProperty(Promise.prototype,`o`,{value:!0,configurable:!1,enumerable:!1,writable:!1});let e=Promise.prototype.then;Promise.prototype.then=function(t,n){let i=r[r.length-1],a=t&&(e=>{r.push(i);try{return t(e)}finally{r.pop()}}),o=n&&(e=>{r.push(i);try{return n(e)}finally{r.pop()}});return e.call(this,a,o)}}var i={run(e,t){r.push(e);try{return t()}finally{r.pop()}},get:()=>r[r.length-1]},a=Symbol.for(`schmancy.state.activeHost.eventHost`),o=globalThis[a]??={host:void 0,scheduled:!1};function s(e){o.host=e,o.scheduled||(o.scheduled=!0,queueMicrotask(()=>{o.scheduled=!1,o.host=void 0}))}function c(){let e=i.get();return e===void 0?o.host===void 0?typeof document<`u`&&document.activeElement instanceof HTMLElement?document.activeElement:void 0:o.host:e}function l(e){return Symbol.for(`schmancy.state:${e}`)}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
@@ -1 +0,0 @@
1
- {"version":3,"file":"active-host-jH3iloCR.cjs","names":[],"sources":["../src/state/active-host.ts"],"sourcesContent":["// `_`-prefixed identifiers below are an intentional naming convention for\n// module-private infrastructure. `_activeHost` is exported only so the\n// $LitElement mixin can wrap render/lifecycle in `_activeHost.run`; the\n// underscore signals \"not part of the public state API.\"\n/* oxlint-disable no-underscore-dangle */\n\n// Active-host tracker for context-aware state resolution.\n//\n// Polyfills the TC39 `AsyncContext.Variable` propagation primitive using a\n// stack + a one-time `Promise.prototype.then` patch. The stack value carries\n// across `await`, `queueMicrotask`, RxJS subscription callbacks, and any\n// other code path that ultimately routes through `Promise.then`. This is the\n// same capture-and-restore technique zone.js, async-hooks, and the various\n// AsyncContext userland polyfills use.\n//\n// Why we own this:\n// - The TC39 proposal is at stage 2; no official polyfill ships from TC39.\n// - The `async-context@1.0.0` package on npm is unrelated (a 2014 Node\n// callback helper), and the available userland polyfills either depend\n// on zone.js (~50 KB) or are Node-only / hobby quality.\n// - The patch surface is ~30 lines, idempotent, preserves Promise\n// semantics (delegates to the original `then`, so `Symbol.species` and\n// subclassing work unchanged), and decommissions cleanly the day a real\n// polyfill or native AsyncContext lands (drop the file, swap the\n// `_activeHost` export for the standard primitive).\n//\n// Known limitation — native await on a native Promise: V8's await\n// optimization (since 7.x) skips the spec-prescribed\n// `Promise.resolve(x).then(continuation)` step, so userland `then`\n// patches don't intercept the resumption. Class methods that mutate\n// state across an `await` boundary will fall back to the\n// module-scoped global, not the active-host's isolated copy. To\n// preserve the host across awaits, either keep the mutation in the\n// synchronous prelude before the first `await`, or explicitly chain\n// with `.then()` (which still routes through the patched method).\n// A real fix requires either a build-time async-function transform\n// or native AsyncContext.Variable in the runtime.\n//\n// resolveActiveHost() fallback chain:\n// 1. Stack value set by `_activeHost.run(host, fn)` — covers render(),\n// Lit lifecycle methods, and class-method handlers (all wrapped by\n// SchmancyElement's prototype-chain wrap).\n// 2. The closest `<schmancy-context>` whose subtree currently has an\n// in-flight DOM event. The element installs capture-phase listeners\n// that publish itself as the event-host while the synchronous\n// handler chain runs; the slot clears via microtask. Covers\n// template-bound inline arrow handlers attached to descendants.\n// 3. document.activeElement — keyboard handlers in focus.\n// 4. undefined → caller falls back to the module-scoped global instance.\n\n// Singleton across any number of schmancy module copies (source + dist, ESM\n// + CJS, hoisted vs. nested node_modules) via the runtime-global symbol\n// registry. The first copy to load creates the slot; later copies reuse it.\n// Without this, two stacks → mixins push to one, state reads from the other,\n// and active-host context is lost across the boundary.\nconst STACK_KEY = Symbol.for('schmancy.state.activeHost.stack')\ntype StackSlot = { stack: Array<HTMLElement | undefined> }\nconst _g = globalThis as { [STACK_KEY]?: StackSlot }\n_g[STACK_KEY] ??= { stack: [undefined] }\nconst _stack = _g[STACK_KEY].stack\n\n// One-time Promise.prototype.then patch at module init. Each .then() call\n// captures the stack head at chain time; firing the callback restores that\n// captured value for the duration of the callback. The guard property\n// prevents double-patching across HMR / duplicate module loads.\ndeclare global {\n\tinterface Promise<T> {\n\t\t// Marker symbol so we can detect (and skip) re-patching.\n\t\treadonly __schmancyActiveHostPatched?: true\n\t}\n}\n\n// Patching Promise.prototype is the entire mechanism this module exists to\n// provide — the lint rules below intentionally do not apply.\n/* oxlint-disable no-extend-native, unicorn/no-thenable */\nif (typeof Promise !== 'undefined' && !('__schmancyActiveHostPatched' in Promise.prototype)) {\n\tObject.defineProperty(Promise.prototype, '__schmancyActiveHostPatched', {\n\t\tvalue: true,\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\twritable: false,\n\t})\n\tconst _origThen = Promise.prototype.then\n\t// Replace with our wrapper. We delegate to the original `then` via\n\t// `_origThen.call(this, …)` so Promise subclassing / Symbol.species behave\n\t// exactly as before — the only added work is the stack push/pop around\n\t// each user callback.\n\tPromise.prototype.then = function schmancyThen<T, R1, R2>(\n\t\tthis: Promise<T>,\n\t\tonfulfilled?: ((value: T) => R1 | PromiseLike<R1>) | null,\n\t\tonrejected?: ((reason: unknown) => R2 | PromiseLike<R2>) | null,\n\t): Promise<R1 | R2> {\n\t\tconst captured = _stack[_stack.length - 1]\n\t\tconst wrapFulfilled = onfulfilled\n\t\t\t? (v: T): R1 | PromiseLike<R1> => {\n\t\t\t\t\t_stack.push(captured)\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn onfulfilled(v)\n\t\t\t\t\t} finally {\n\t\t\t\t\t\t_stack.pop()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t: onfulfilled\n\t\tconst wrapRejected = onrejected\n\t\t\t? (r: unknown): R2 | PromiseLike<R2> => {\n\t\t\t\t\t_stack.push(captured)\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn onrejected(r)\n\t\t\t\t\t} finally {\n\t\t\t\t\t\t_stack.pop()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t: onrejected\n\t\treturn _origThen.call(this, wrapFulfilled, wrapRejected) as Promise<R1 | R2>\n\t}\n}\n/* oxlint-enable no-extend-native, unicorn/no-thenable */\n\nexport const _activeHost = {\n\t/** Run `fn` with `host` as the active host for the duration of `fn` and\n\t * any awaits / microtasks / Promise chains that descend from it. */\n\trun<R>(host: HTMLElement | undefined, fn: () => R): R {\n\t\t_stack.push(host)\n\t\ttry {\n\t\t\treturn fn()\n\t\t} finally {\n\t\t\t_stack.pop()\n\t\t}\n\t},\n\t/** The current active host, or undefined if no `run()` is on the stack. */\n\tget(): HTMLElement | undefined {\n\t\treturn _stack[_stack.length - 1]\n\t},\n}\n\n// Tier 2 of the resolveActiveHost() fallback chain. A `<schmancy-context>`\n// publishes itself here from a capture-phase event listener attached to\n// itself; the slot clears in the next microtask, after the synchronous\n// event-handler chain has run. `window.event` is unreliable across both\n// engines and time (it can outlive its event — a stale `message` event\n// from postMessage can leak BODY for arbitrary later resolution calls), so\n// we own this slot rather than read the legacy global.\n//\n// Singleton across module copies for the same reason as `_stack` above.\nconst EVENT_HOST_KEY = Symbol.for('schmancy.state.activeHost.eventHost')\ntype EventHostSlot = { host: HTMLElement | undefined; scheduled: boolean }\nconst _eventHostSlot: EventHostSlot =\n\t((globalThis as { [EVENT_HOST_KEY]?: EventHostSlot })[EVENT_HOST_KEY] ??= {\n\t\thost: undefined,\n\t\tscheduled: false,\n\t})\n\n/** Publish `host` as the active event-host. The slot self-clears at the\n * end of the current microtask checkpoint — long enough for the entire\n * synchronous event-handler chain to read it, short enough that no\n * later, unrelated microtask sees a stale value. */\nexport function _publishEventHost(host: HTMLElement): void {\n\t_eventHostSlot.host = host\n\tif (_eventHostSlot.scheduled) return\n\t_eventHostSlot.scheduled = true\n\tqueueMicrotask(() => {\n\t\t_eventHostSlot.scheduled = false\n\t\t_eventHostSlot.host = undefined\n\t})\n}\n\nexport function resolveActiveHost(): HTMLElement | undefined {\n\t// 1. Stack (set by _activeHost.run).\n\tconst fromStack = _activeHost.get()\n\tif (fromStack !== undefined) return fromStack\n\n\t// 2. Closest <schmancy-context> with an in-flight event in its subtree.\n\tif (_eventHostSlot.host !== undefined) return _eventHostSlot.host\n\n\t// 3. document.activeElement — keyboard / focus handlers.\n\tif (typeof document !== 'undefined' && document.activeElement instanceof HTMLElement) {\n\t\treturn document.activeElement\n\t}\n\n\t// 4. undefined — caller falls back to module-scoped.\n\treturn undefined\n}\n\n/** Stable context key for a state namespace. `Symbol.for(...)` so the same\n * namespace string yields the same symbol across module boundaries — the\n * ContextProvider on `<schmancy-context>` and the ContextRequestEvent\n * dispatched by a state read must agree on identity. */\nexport function stateContextKey(namespace: string): symbol {\n\treturn Symbol.for(`schmancy.state:${namespace}`)\n}\n"],"mappings":"qUAuDA,IAAM,EAAY,OAAO,IAAI,kCAAA,CAEvB,EAAK,WACX,EAAG,KAAe,CAAE,MAAO,CAAA,IAAC,GAAA,CAAA,CAC5B,IAAM,EAAS,EAAG,GAAW,MAgB7B,GAAuB,OAAZ,QAAY,KAAZ,EAA6B,MAAiC,QAAQ,WAAY,CAC5F,OAAO,eAAe,QAAQ,UAAW,IAA+B,CACvE,MAAA,CAAO,EACP,aAAA,CAAc,EACd,WAAA,CAAY,EACZ,SAAA,CAAU,EAAA,CAAA,CAEX,IAAM,EAAY,QAAQ,UAAU,KAKpC,QAAQ,UAAU,KAAO,SAExB,EACA,EAAA,CAEA,IAAM,EAAW,EAAO,EAAO,OAAS,GAClC,EAAgB,IAClB,GAAA,CACD,EAAO,KAAK,EAAA,CACZ,GAAA,CACC,OAAO,EAAY,EAAA,QAAA,CAEnB,EAAO,KAAA,IAIL,EAAe,IACjB,GAAA,CACD,EAAO,KAAK,EAAA,CACZ,GAAA,CACC,OAAO,EAAW,EAAA,QAAA,CAElB,EAAO,KAAA,IAIX,OAAO,EAAU,KAAK,KAAM,EAAe,EAAA,EAK7C,IAAa,EAAc,CAG1B,IAAO,EAA+B,EAAA,CACrC,EAAO,KAAK,EAAA,CACZ,GAAA,CACC,OAAO,GAAA,QAAA,CAEP,EAAO,KAAA,GAIT,QACQ,EAAO,EAAO,OAAS,GAAA,CAa1B,EAAiB,OAAO,IAAI,sCAAA,CAE5B,EACJ,WAAqD,KAAoB,CACzE,KAAA,IAAM,GACN,UAAA,CAAW,EAAA,CAOb,SAAgB,EAAkB,EAAA,CACjC,EAAe,KAAO,EAClB,EAAe,YACnB,EAAe,UAAA,CAAY,EAC3B,mBAAA,CACC,EAAe,UAAA,CAAY,EAC3B,EAAe,KAAA,IAAO,IAAA,EAIxB,SAAgB,GAAA,CAEf,IAAM,EAAY,EAAY,KAAA,CAC9B,OAAI,IAAJ,IAAkB,GAGd,EAAe,OAHiB,IAGR,GAGJ,OAAb,SAAa,KAAe,SAAS,yBAAyB,YACjE,SAAS,cAAA,IADjB,GAH8C,EAAe,KAHzB,EAkBrC,SAAgB,EAAgB,EAAA,CAC/B,OAAO,OAAO,IAAI,kBAAkB,IAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}