@mhmo91/schmancy 0.10.29 → 0.10.31

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 (425) hide show
  1. package/dist/{mixins-CxGRIPYQ.cjs → SchmancyElement-D8_z9JrW.cjs} +2 -242
  2. package/dist/SchmancyElement-D8_z9JrW.cjs.map +1 -0
  3. package/dist/{mixins-BfazlmLD.js → SchmancyElement-DuzT2AMa.js} +149 -492
  4. package/dist/SchmancyElement-DuzT2AMa.js.map +1 -0
  5. package/dist/agent/{flow-3RrZM-e7.js.map → flow-CvG1fLW5.js.map} +1 -1
  6. package/dist/agent/schmancy.agent.js +8465 -2980
  7. package/dist/agent/schmancy.agent.js.map +1 -1
  8. package/dist/agent/{vendor-material-color-33Mj762T.js.map → vendor-material-color-DcL7ZPxx.js.map} +1 -1
  9. package/dist/animation-CCOIW4wJ.cjs.map +1 -1
  10. package/dist/animation-DCznELuT.js.map +1 -1
  11. package/dist/{area-D5wIy4Fn.js → area-0l8V7HlF.js} +2 -2
  12. package/dist/{area-D5wIy4Fn.js.map → area-0l8V7HlF.js.map} +1 -1
  13. package/dist/area-WGfTrwcJ.cjs +21 -0
  14. package/dist/{area-HXuLLQnN.cjs.map → area-WGfTrwcJ.cjs.map} +1 -1
  15. package/dist/area.cjs +1 -1
  16. package/dist/area.js +1 -1
  17. package/dist/{audio-Cvmemu84.cjs → audio-9QLk4pU-.cjs} +1 -1
  18. package/dist/{audio-Cvmemu84.cjs.map → audio-9QLk4pU-.cjs.map} +1 -1
  19. package/dist/{audio-CxO5a2HL.js → audio-x9oLVKBH.js} +1 -1
  20. package/dist/{audio-CxO5a2HL.js.map → audio-x9oLVKBH.js.map} +1 -1
  21. package/dist/audio.cjs +1 -1
  22. package/dist/audio.js +2 -2
  23. package/dist/{autocomplete-hj2AQyEF.cjs → autocomplete-CjjfXbJC.cjs} +2 -2
  24. package/dist/{autocomplete-hj2AQyEF.cjs.map → autocomplete-CjjfXbJC.cjs.map} +1 -1
  25. package/dist/{autocomplete-DCkkdDON.js → autocomplete-sjZovPcs.js} +7 -7
  26. package/dist/{autocomplete-DCkkdDON.js.map → autocomplete-sjZovPcs.js.map} +1 -1
  27. package/dist/autocomplete.cjs +1 -1
  28. package/dist/autocomplete.js +1 -1
  29. package/dist/avatar.cjs +3 -3
  30. package/dist/avatar.cjs.map +1 -1
  31. package/dist/avatar.js +3 -3
  32. package/dist/avatar.js.map +1 -1
  33. package/dist/badge.cjs +1 -1
  34. package/dist/badge.js +1 -1
  35. package/dist/{boat-BfgbRnhA.js → boat-CEaQaCmG.js} +3 -3
  36. package/dist/{boat-BfgbRnhA.js.map → boat-CEaQaCmG.js.map} +1 -1
  37. package/dist/{boat-B_5F_rFr.cjs → boat-CI5rcGS5.cjs} +11 -11
  38. package/dist/{boat-B_5F_rFr.cjs.map → boat-CI5rcGS5.cjs.map} +1 -1
  39. package/dist/boat.cjs +1 -1
  40. package/dist/boat.js +1 -1
  41. package/dist/breadcrumb.cjs +4 -4
  42. package/dist/breadcrumb.cjs.map +1 -1
  43. package/dist/breadcrumb.js +2 -2
  44. package/dist/breadcrumb.js.map +1 -1
  45. package/dist/{busy-zIt9bTZn.cjs → busy-DDKXlzDA.cjs} +8 -8
  46. package/dist/{busy-zIt9bTZn.cjs.map → busy-DDKXlzDA.cjs.map} +1 -1
  47. package/dist/{busy-D6tAS-kW.js → busy-DwD-XHqS.js} +2 -2
  48. package/dist/{busy-D6tAS-kW.js.map → busy-DwD-XHqS.js.map} +1 -1
  49. package/dist/busy.cjs +1 -1
  50. package/dist/busy.js +1 -1
  51. package/dist/{button-D7AejvfK.js → button-BnGN6SsV.js} +2 -2
  52. package/dist/{button-D7AejvfK.js.map → button-BnGN6SsV.js.map} +1 -1
  53. package/dist/{button-8oMffyiO.cjs → button-DlqCWuk-.cjs} +15 -15
  54. package/dist/{button-8oMffyiO.cjs.map → button-DlqCWuk-.cjs.map} +1 -1
  55. package/dist/button.cjs +19 -19
  56. package/dist/button.cjs.map +1 -1
  57. package/dist/button.js +3 -3
  58. package/dist/button.js.map +1 -1
  59. package/dist/{card-CUt9fm_4.js → card-D3IxxBBP.js} +2 -2
  60. package/dist/{card-CUt9fm_4.js.map → card-D3IxxBBP.js.map} +1 -1
  61. package/dist/{card-CTucMMgp.cjs → card-DWZhZ5Ds.cjs} +10 -10
  62. package/dist/{card-CTucMMgp.cjs.map → card-DWZhZ5Ds.cjs.map} +1 -1
  63. package/dist/card.cjs +1 -1
  64. package/dist/card.js +1 -1
  65. package/dist/{checkbox-DrKsfzC4.cjs → checkbox-BBttnA_a.cjs} +3 -3
  66. package/dist/{checkbox-DrKsfzC4.cjs.map → checkbox-BBttnA_a.cjs.map} +1 -1
  67. package/dist/{checkbox-DMmqe2OO.js → checkbox-t__wRS-9.js} +5 -5
  68. package/dist/{checkbox-DMmqe2OO.js.map → checkbox-t__wRS-9.js.map} +1 -1
  69. package/dist/checkbox.cjs +1 -1
  70. package/dist/checkbox.js +1 -1
  71. package/dist/{chips-DRGsqDMA.js → chips-B8HM25xv.js} +4 -4
  72. package/dist/{chips-DRGsqDMA.js.map → chips-B8HM25xv.js.map} +1 -1
  73. package/dist/{chips-B1yQgLyW.cjs → chips-lipKBK9P.cjs} +18 -18
  74. package/dist/{chips-B1yQgLyW.cjs.map → chips-lipKBK9P.cjs.map} +1 -1
  75. package/dist/chips.cjs +1 -1
  76. package/dist/chips.js +2 -2
  77. package/dist/connectivity.cjs +7 -7
  78. package/dist/connectivity.cjs.map +1 -1
  79. package/dist/connectivity.js +3 -3
  80. package/dist/connectivity.js.map +1 -1
  81. package/dist/content-drawer.cjs +1 -1
  82. package/dist/content-drawer.js +1 -1
  83. package/dist/cursor-glow-Ah7VXSj7.js.map +1 -1
  84. package/dist/cursor-glow-Bulq-38P.cjs.map +1 -1
  85. package/dist/{date-range-TDF-f0ss.js → date-range-CObvXmZ4.js} +6 -6
  86. package/dist/{date-range-TDF-f0ss.js.map → date-range-CObvXmZ4.js.map} +1 -1
  87. package/dist/{date-range-BeF0dW1W.cjs → date-range-DXct0_Jg.cjs} +3 -3
  88. package/dist/{date-range-BeF0dW1W.cjs.map → date-range-DXct0_Jg.cjs.map} +1 -1
  89. package/dist/{date-range-inline-JLsmcle2.js → date-range-inline-BEP-oWJZ.js} +5 -5
  90. package/dist/{date-range-inline-JLsmcle2.js.map → date-range-inline-BEP-oWJZ.js.map} +1 -1
  91. package/dist/date-range-inline-lhkwHFxY.cjs +43 -0
  92. package/dist/{date-range-inline-BnhQZTK0.cjs.map → date-range-inline-lhkwHFxY.cjs.map} +1 -1
  93. package/dist/date-range-inline.cjs +1 -1
  94. package/dist/date-range-inline.js +1 -1
  95. package/dist/date-range.cjs +1 -1
  96. package/dist/date-range.js +1 -1
  97. package/dist/delay.cjs +4 -4
  98. package/dist/delay.cjs.map +1 -1
  99. package/dist/delay.js +2 -2
  100. package/dist/delay.js.map +1 -1
  101. package/dist/{details-T75tUASO.cjs → details-DSGEewvZ.cjs} +2 -2
  102. package/dist/{details-T75tUASO.cjs.map → details-DSGEewvZ.cjs.map} +1 -1
  103. package/dist/{details-ChMhQpcY.js → details-nRdT8J-W.js} +11 -11
  104. package/dist/{details-ChMhQpcY.js.map → details-nRdT8J-W.js.map} +1 -1
  105. package/dist/details.cjs +1 -1
  106. package/dist/details.js +1 -1
  107. package/dist/{directives-BkSqmLBV.cjs → directives-DJbBHfID.cjs} +1 -1
  108. package/dist/{directives-BkSqmLBV.cjs.map → directives-DJbBHfID.cjs.map} +1 -1
  109. package/dist/{directives-DgPbz0lQ.js → directives-DZzxV3Hh.js} +3 -3
  110. package/dist/{directives-DgPbz0lQ.js.map → directives-DZzxV3Hh.js.map} +1 -1
  111. package/dist/directives.cjs +1 -1
  112. package/dist/directives.js +2 -2
  113. package/dist/discovery.service-CIa3Eeuk.cjs.map +1 -1
  114. package/dist/discovery.service-DZFxtRwW.js.map +1 -1
  115. package/dist/{divider-D69bhEUY.js → divider-BHgrisGQ.js} +2 -2
  116. package/dist/{divider-D69bhEUY.js.map → divider-BHgrisGQ.js.map} +1 -1
  117. package/dist/{divider-DopO0yKi.cjs → divider-D21yKZNJ.cjs} +3 -3
  118. package/dist/{divider-DopO0yKi.cjs.map → divider-D21yKZNJ.cjs.map} +1 -1
  119. package/dist/divider.cjs +1 -1
  120. package/dist/divider.js +1 -1
  121. package/dist/dropdown.cjs +4 -4
  122. package/dist/dropdown.cjs.map +1 -1
  123. package/dist/dropdown.js +2 -2
  124. package/dist/dropdown.js.map +1 -1
  125. package/dist/{expand-KLSx5dea.js → expand-2TTbmm_z.js} +9 -9
  126. package/dist/{expand-KLSx5dea.js.map → expand-2TTbmm_z.js.map} +1 -1
  127. package/dist/{expand-C386rVT8.cjs → expand-wRphbpW6.cjs} +3 -3
  128. package/dist/{expand-C386rVT8.cjs.map → expand-wRphbpW6.cjs.map} +1 -1
  129. package/dist/expand.cjs +1 -1
  130. package/dist/expand.js +1 -1
  131. package/dist/float-B0L_CH4v.cjs +1 -0
  132. package/dist/{float-DyaPI0qO.cjs.map → float-B0L_CH4v.cjs.map} +1 -1
  133. package/dist/{float-BoPLNysg.js → float-dtDqRmcL.js} +2 -2
  134. package/dist/{float-BoPLNysg.js.map → float-dtDqRmcL.js.map} +1 -1
  135. package/dist/float.cjs +1 -1
  136. package/dist/float.js +1 -1
  137. package/dist/{form-CYeMWHmy.js → form-BxY-9F6N.js} +6 -6
  138. package/dist/{form-CYeMWHmy.js.map → form-BxY-9F6N.js.map} +1 -1
  139. package/dist/{form-CGIJlQyP.cjs → form-DvqHReDF.cjs} +3 -3
  140. package/dist/{form-CGIJlQyP.cjs.map → form-DvqHReDF.cjs.map} +1 -1
  141. package/dist/form.cjs +6 -6
  142. package/dist/form.cjs.map +1 -1
  143. package/dist/form.js +10 -10
  144. package/dist/form.js.map +1 -1
  145. package/dist/gravity-6pL6CfIr.cjs.map +1 -1
  146. package/dist/gravity-sVK3zGBF.js.map +1 -1
  147. package/dist/handover/agent-runtime-followups.md +1 -1
  148. package/dist/handover/agent-runtime-v1.md +3 -3
  149. package/dist/hashContent-BqU6v1Xr.js.map +1 -1
  150. package/dist/hashContent-iRZJJWtE.cjs.map +1 -1
  151. package/dist/{icons-CJUA5bfI.cjs → icons-BbC4t44c.cjs} +6 -6
  152. package/dist/{icons-CJUA5bfI.cjs.map → icons-BbC4t44c.cjs.map} +1 -1
  153. package/dist/{icons-BUQNMhjw.js → icons-CO8UrTJQ.js} +2 -2
  154. package/dist/{icons-BUQNMhjw.js.map → icons-CO8UrTJQ.js.map} +1 -1
  155. package/dist/icons.cjs +1 -1
  156. package/dist/icons.js +1 -1
  157. package/dist/{iframe-pn7MIeH8.cjs → iframe-BepoWz9Z.cjs} +5 -5
  158. package/dist/{iframe-pn7MIeH8.cjs.map → iframe-BepoWz9Z.cjs.map} +1 -1
  159. package/dist/{iframe-CbL0jCo1.js → iframe-t5zo89Fs.js} +2 -2
  160. package/dist/{iframe-CbL0jCo1.js.map → iframe-t5zo89Fs.js.map} +1 -1
  161. package/dist/iframe.cjs +1 -1
  162. package/dist/iframe.js +1 -1
  163. package/dist/index.cjs +1 -1
  164. package/dist/index.js +68 -69
  165. package/dist/{input-C1h5lLiJ.js → input-2OR6wjfT.js} +15 -15
  166. package/dist/{input-C1h5lLiJ.js.map → input-2OR6wjfT.js.map} +1 -1
  167. package/dist/{input-Cmc0IoUP.cjs → input-B-wPPC5o.cjs} +2 -2
  168. package/dist/{input-Cmc0IoUP.cjs.map → input-B-wPPC5o.cjs.map} +1 -1
  169. package/dist/{input-chip-DqAR4nPD.js → input-chip-NBsnZkzu.js} +2 -2
  170. package/dist/{input-chip-DqAR4nPD.js.map → input-chip-NBsnZkzu.js.map} +1 -1
  171. package/dist/{input-chip-B0X_CodJ.cjs → input-chip-O5-pgek1.cjs} +9 -9
  172. package/dist/{input-chip-B0X_CodJ.cjs.map → input-chip-O5-pgek1.cjs.map} +1 -1
  173. package/dist/input.cjs +1 -1
  174. package/dist/input.js +1 -1
  175. package/dist/json.cjs +3 -3
  176. package/dist/json.cjs.map +1 -1
  177. package/dist/json.js +3 -3
  178. package/dist/json.js.map +1 -1
  179. package/dist/kbd.cjs +2 -2
  180. package/dist/kbd.cjs.map +1 -1
  181. package/dist/kbd.js +2 -2
  182. package/dist/kbd.js.map +1 -1
  183. package/dist/{layout-DSAjo92m.js → layout-CJ01zE9V.js} +1 -1
  184. package/dist/{layout-DSAjo92m.js.map → layout-CJ01zE9V.js.map} +1 -1
  185. package/dist/{layout-eXb9wjDh.cjs → layout-D7nKwpa5.cjs} +1 -1
  186. package/dist/{layout-eXb9wjDh.cjs.map → layout-D7nKwpa5.cjs.map} +1 -1
  187. package/dist/layout.cjs +2 -2
  188. package/dist/layout.cjs.map +1 -1
  189. package/dist/layout.js +2 -2
  190. package/dist/layout.js.map +1 -1
  191. package/dist/lazy-CayEFyC3.cjs.map +1 -1
  192. package/dist/lazy-D-bO2r4m.js.map +1 -1
  193. package/dist/{lightbox-BiNK_plj.cjs → lightbox-DVpvjsYb.cjs} +21 -21
  194. package/dist/{lightbox-BiNK_plj.cjs.map → lightbox-DVpvjsYb.cjs.map} +1 -1
  195. package/dist/{lightbox-C3zomJ-r.js → lightbox-Droe9dYY.js} +8 -8
  196. package/dist/{lightbox-C3zomJ-r.js.map → lightbox-Droe9dYY.js.map} +1 -1
  197. package/dist/lightbox.cjs +1 -1
  198. package/dist/lightbox.js +1 -1
  199. package/dist/{list-Bbmp1uMa.js → list-DzAWv99q.js} +2 -2
  200. package/dist/{list-Bbmp1uMa.js.map → list-DzAWv99q.js.map} +1 -1
  201. package/dist/{list-CbM9w9OM.cjs → list-JjUsFCP6.cjs} +5 -5
  202. package/dist/{list-CbM9w9OM.cjs.map → list-JjUsFCP6.cjs.map} +1 -1
  203. package/dist/list.cjs +1 -1
  204. package/dist/list.js +1 -1
  205. package/dist/magnetic-B2VKNfDu.js.map +1 -1
  206. package/dist/magnetic-MQ3HMHJi.cjs.map +1 -1
  207. package/dist/menu-BNPbrAmd.cjs +23 -0
  208. package/dist/{menu-Bfay8vF8.cjs.map → menu-BNPbrAmd.cjs.map} +1 -1
  209. package/dist/{menu-Ph2hboJd.js → menu-D2cZSp74.js} +3 -3
  210. package/dist/{menu-Ph2hboJd.js.map → menu-D2cZSp74.js.map} +1 -1
  211. package/dist/menu.cjs +1 -1
  212. package/dist/menu.js +1 -1
  213. package/dist/mixins-Cevarn7V.js +412 -0
  214. package/dist/mixins-Cevarn7V.js.map +1 -0
  215. package/dist/mixins-JyO9GSGy.cjs +245 -0
  216. package/dist/mixins-JyO9GSGy.cjs.map +1 -0
  217. package/dist/mixins.cjs +1 -1
  218. package/dist/mixins.js +3 -2
  219. package/dist/nav-drawer.cjs +1 -1
  220. package/dist/nav-drawer.js +1 -1
  221. package/dist/navigation-bar.cjs +1 -1
  222. package/dist/navigation-bar.js +1 -1
  223. package/dist/navigation-rail.cjs +10 -10
  224. package/dist/navigation-rail.cjs.map +1 -1
  225. package/dist/navigation-rail.js +2 -2
  226. package/dist/navigation-rail.js.map +1 -1
  227. package/dist/notification-CaeRS5US.cjs +24 -0
  228. package/dist/{notification-DT_cAi8U.cjs.map → notification-CaeRS5US.cjs.map} +1 -1
  229. package/dist/{notification-Du5FRbYp.js → notification-Dxwx0Zln.js} +4 -4
  230. package/dist/{notification-Du5FRbYp.js.map → notification-Dxwx0Zln.js.map} +1 -1
  231. package/dist/notification.cjs +1 -1
  232. package/dist/notification.js +1 -1
  233. package/dist/{option-B7y4FhOn.js → option-BCnYutZz.js} +2 -2
  234. package/dist/{option-B7y4FhOn.js.map → option-BCnYutZz.js.map} +1 -1
  235. package/dist/{option-Cl5Q987d.cjs → option-C6wXFQOM.cjs} +5 -5
  236. package/dist/{option-Cl5Q987d.cjs.map → option-C6wXFQOM.cjs.map} +1 -1
  237. package/dist/option.cjs +1 -1
  238. package/dist/option.js +1 -1
  239. package/dist/{overlay-B79m-KXf.js → overlay-BVdgWkIj.js} +5 -5
  240. package/dist/{overlay-B79m-KXf.js.map → overlay-BVdgWkIj.js.map} +1 -1
  241. package/dist/overlay-U5jr3OYG.cjs +43 -0
  242. package/dist/{overlay-CRwfhbyi.cjs.map → overlay-U5jr3OYG.cjs.map} +1 -1
  243. package/dist/overlay-stack-Bdr9lOqi.cjs.map +1 -1
  244. package/dist/overlay-stack-D2rgxQLh.js.map +1 -1
  245. package/dist/overlay.cjs +1 -1
  246. package/dist/overlay.confirm-body-BCWt92R7.cjs +70 -0
  247. package/dist/{overlay.confirm-body-CxOomuN6.cjs.map → overlay.confirm-body-BCWt92R7.cjs.map} +1 -1
  248. package/dist/{overlay.confirm-body-CW_spktW.js → overlay.confirm-body-BYPEKZtR.js} +6 -6
  249. package/dist/{overlay.confirm-body-CW_spktW.js.map → overlay.confirm-body-BYPEKZtR.js.map} +1 -1
  250. package/dist/overlay.js +3 -3
  251. package/dist/{overlay.service-fb3KaMiP.cjs → overlay.service-D4_SgGuT.cjs} +1 -1
  252. package/dist/{overlay.service-fb3KaMiP.cjs.map → overlay.service-D4_SgGuT.cjs.map} +1 -1
  253. package/dist/{overlay.service-DsBb_UwG.js → overlay.service-Dq2X6ibl.js} +2 -2
  254. package/dist/{overlay.service-DsBb_UwG.js.map → overlay.service-Dq2X6ibl.js.map} +1 -1
  255. package/dist/{progress-fnGrmHpm.cjs → progress-Bc_IBaNH.cjs} +7 -7
  256. package/dist/{progress-fnGrmHpm.cjs.map → progress-Bc_IBaNH.cjs.map} +1 -1
  257. package/dist/{progress-CMwUEDB1.js → progress-BoFm3r6h.js} +2 -2
  258. package/dist/{progress-CMwUEDB1.js.map → progress-BoFm3r6h.js.map} +1 -1
  259. package/dist/progress.cjs +1 -1
  260. package/dist/progress.js +1 -1
  261. package/dist/radio-group-C34WDjrN.cjs +19 -0
  262. package/dist/{radio-group-DQRJGMgS.cjs.map → radio-group-C34WDjrN.cjs.map} +1 -1
  263. package/dist/{radio-group-Zb0fies1.js → radio-group-DnHhGrXp.js} +6 -6
  264. package/dist/{radio-group-Zb0fies1.js.map → radio-group-DnHhGrXp.js.map} +1 -1
  265. package/dist/radio-group.cjs +1 -1
  266. package/dist/radio-group.js +1 -1
  267. package/dist/range.cjs +2 -2
  268. package/dist/range.cjs.map +1 -1
  269. package/dist/range.js +5 -5
  270. package/dist/range.js.map +1 -1
  271. package/dist/reduced-motion-D-L12p7G.js.map +1 -1
  272. package/dist/reduced-motion-Ds-HjMzn.cjs.map +1 -1
  273. package/dist/rxjs-utils-Csnks202.cjs.map +1 -1
  274. package/dist/rxjs-utils-d-ivVN84.js.map +1 -1
  275. package/dist/search-DPKoC-dT.cjs.map +1 -1
  276. package/dist/search-MvIBA93K.js.map +1 -1
  277. package/dist/{select-C-acFFtV.cjs → select-Gb9fTA4M.cjs} +2 -2
  278. package/dist/{select-C-acFFtV.cjs.map → select-Gb9fTA4M.cjs.map} +1 -1
  279. package/dist/{select-BJJKYtEi.js → select-gRJb1TEf.js} +6 -6
  280. package/dist/{select-BJJKYtEi.js.map → select-gRJb1TEf.js.map} +1 -1
  281. package/dist/select.cjs +1 -1
  282. package/dist/select.js +1 -1
  283. package/dist/skeleton.cjs +2 -2
  284. package/dist/skeleton.cjs.map +1 -1
  285. package/dist/skeleton.js +2 -2
  286. package/dist/skeleton.js.map +1 -1
  287. package/dist/skills/form.md +34 -0
  288. package/dist/skills/schmancy/form.md +34 -0
  289. package/dist/slider.cjs +7 -7
  290. package/dist/slider.cjs.map +1 -1
  291. package/dist/slider.js +2 -2
  292. package/dist/slider.js.map +1 -1
  293. package/dist/{sound.service-v_jqCkos.js → sound.service-Cuo4-X_-.js} +1 -1
  294. package/dist/{sound.service-v_jqCkos.js.map → sound.service-Cuo4-X_-.js.map} +1 -1
  295. package/dist/{sound.service-DVJZb9ox.cjs → sound.service-Czs3gmRx.cjs} +1 -1
  296. package/dist/{sound.service-DVJZb9ox.cjs.map → sound.service-Czs3gmRx.cjs.map} +1 -1
  297. package/dist/splash-screen-C0oeDPxV.cjs +41 -0
  298. package/dist/{splash-screen-CGnhHDB_.cjs.map → splash-screen-C0oeDPxV.cjs.map} +1 -1
  299. package/dist/{splash-screen-CCDpzGg_.js → splash-screen-CbcYpkIx.js} +2 -2
  300. package/dist/{splash-screen-CCDpzGg_.js.map → splash-screen-CbcYpkIx.js.map} +1 -1
  301. package/dist/splash-screen.cjs +1 -1
  302. package/dist/splash-screen.js +1 -1
  303. package/dist/src-C_7k7YhE.cjs +263 -0
  304. package/dist/{src-C0MzzF_S.cjs.map → src-C_7k7YhE.cjs.map} +1 -1
  305. package/dist/{src-CUcUMK0M.js → src-DavVEUeO.js} +35 -35
  306. package/dist/{src-CUcUMK0M.js.map → src-DavVEUeO.js.map} +1 -1
  307. package/dist/{state-CHbIt2Dw.js → state-B-5H9i10.js} +280 -273
  308. package/dist/state-B-5H9i10.js.map +1 -0
  309. package/dist/state-D85Se4Fx.cjs +1 -0
  310. package/dist/state-D85Se4Fx.cjs.map +1 -0
  311. package/dist/state.cjs +1 -1
  312. package/dist/state.js +3 -3
  313. package/dist/steps.cjs +10 -10
  314. package/dist/steps.cjs.map +1 -1
  315. package/dist/steps.js +2 -2
  316. package/dist/steps.js.map +1 -1
  317. package/dist/surface-DHPaLOTA.cjs +7 -0
  318. package/dist/{surface-DPzlMMYX.cjs.map → surface-DHPaLOTA.cjs.map} +1 -1
  319. package/dist/{surface-CLcc26d2.js → surface-gZpeCF6E.js} +4 -4
  320. package/dist/{surface-CLcc26d2.js.map → surface-gZpeCF6E.js.map} +1 -1
  321. package/dist/surface.cjs +1 -1
  322. package/dist/surface.js +1 -1
  323. package/dist/switch.cjs +2 -2
  324. package/dist/switch.cjs.map +1 -1
  325. package/dist/switch.js +6 -6
  326. package/dist/switch.js.map +1 -1
  327. package/dist/table.cjs +11 -11
  328. package/dist/table.cjs.map +1 -1
  329. package/dist/table.js +2 -2
  330. package/dist/table.js.map +1 -1
  331. package/dist/{tabs-BvEal6oS.js → tabs-DJNdoE-x.js} +2 -2
  332. package/dist/{tabs-BvEal6oS.js.map → tabs-DJNdoE-x.js.map} +1 -1
  333. package/dist/{tabs-DEKOKYrn.cjs → tabs-DgaVwuOo.cjs} +4 -4
  334. package/dist/{tabs-DEKOKYrn.cjs.map → tabs-DgaVwuOo.cjs.map} +1 -1
  335. package/dist/tabs.cjs +1 -1
  336. package/dist/tabs.js +1 -1
  337. package/dist/teleport.cjs +1 -1
  338. package/dist/teleport.js +1 -1
  339. package/dist/textarea-2QE5z6Ny.cjs +43 -0
  340. package/dist/{textarea-Cjlsy3y9.cjs.map → textarea-2QE5z6Ny.cjs.map} +1 -1
  341. package/dist/{textarea-CH62STRD.js → textarea-8x0prbgm.js} +9 -9
  342. package/dist/{textarea-CH62STRD.js.map → textarea-8x0prbgm.js.map} +1 -1
  343. package/dist/textarea.cjs +1 -1
  344. package/dist/textarea.js +1 -1
  345. package/dist/theme-D0yboni1.cjs +181 -0
  346. package/dist/{theme-CG3Gpne7.cjs.map → theme-D0yboni1.cjs.map} +1 -1
  347. package/dist/{theme-z82BIRuw.js → theme-DSD9Bs69.js} +8 -8
  348. package/dist/{theme-z82BIRuw.js.map → theme-DSD9Bs69.js.map} +1 -1
  349. package/dist/theme-button-Dpr6SGzB.cjs +8 -0
  350. package/dist/{theme-button-CEc_Kl54.cjs.map → theme-button-Dpr6SGzB.cjs.map} +1 -1
  351. package/dist/{theme-button-oWeOoeSw.js → theme-button-nd6Z7plT.js} +2 -2
  352. package/dist/{theme-button-oWeOoeSw.js.map → theme-button-nd6Z7plT.js.map} +1 -1
  353. package/dist/theme-button.cjs +1 -1
  354. package/dist/theme-button.js +1 -1
  355. package/dist/theme.cjs +1 -1
  356. package/dist/theme.interface-CSt7JUBD.cjs.map +1 -1
  357. package/dist/theme.interface-odQEpZZH.js.map +1 -1
  358. package/dist/theme.js +3 -3
  359. package/dist/{theme.service-Y-e8b331.cjs → theme.service-LtQw04e6.cjs} +1 -1
  360. package/dist/{theme.service-Y-e8b331.cjs.map → theme.service-LtQw04e6.cjs.map} +1 -1
  361. package/dist/{theme.service-Bh08uOSJ.js → theme.service-mRlvWZVs.js} +1 -1
  362. package/dist/{theme.service-Bh08uOSJ.js.map → theme.service-mRlvWZVs.js.map} +1 -1
  363. package/dist/tooltip.cjs.map +1 -1
  364. package/dist/tooltip.js.map +1 -1
  365. package/dist/tree.cjs +3 -3
  366. package/dist/tree.cjs.map +1 -1
  367. package/dist/tree.js +2 -2
  368. package/dist/tree.js.map +1 -1
  369. package/dist/types.cjs.map +1 -1
  370. package/dist/types.js.map +1 -1
  371. package/dist/typewriter.cjs.map +1 -1
  372. package/dist/typewriter.js.map +1 -1
  373. package/dist/{typography-CjAvaB88.cjs → typography-CiZQpzE4.cjs} +4 -4
  374. package/dist/{typography-CjAvaB88.cjs.map → typography-CiZQpzE4.cjs.map} +1 -1
  375. package/dist/{typography-DP82e3GJ.js → typography-DXyf-KdK.js} +2 -2
  376. package/dist/{typography-DP82e3GJ.js.map → typography-DXyf-KdK.js.map} +1 -1
  377. package/dist/typography.cjs +1 -1
  378. package/dist/typography.js +1 -1
  379. package/dist/utils-DTa3QHxk.cjs.map +1 -1
  380. package/dist/utils-H8wNknWC.js.map +1 -1
  381. package/dist/visually-hidden.cjs +2 -2
  382. package/dist/visually-hidden.cjs.map +1 -1
  383. package/dist/visually-hidden.js +2 -2
  384. package/dist/visually-hidden.js.map +1 -1
  385. package/dist/{window-BkPXY-8m.js → window-C_ATa3qM.js} +3 -3
  386. package/dist/{window-BkPXY-8m.js.map → window-C_ATa3qM.js.map} +1 -1
  387. package/dist/window-qKfP5c6M.cjs +59 -0
  388. package/dist/{window-aVXgfw__.cjs.map → window-qKfP5c6M.cjs.map} +1 -1
  389. package/dist/window.cjs +1 -1
  390. package/dist/window.js +1 -1
  391. package/package.json +1 -1
  392. package/skills/schmancy/form.md +34 -0
  393. package/src/state/index.ts +27 -2
  394. package/src/state/schmancy-context.ts +89 -88
  395. package/src/surface/surface.styles.ts +14 -10
  396. package/types/src/state/index.d.ts +15 -1
  397. package/types/src/state/schmancy-context.d.ts +2 -2
  398. package/dist/active-host-BP0zy_Y9.js +0 -63
  399. package/dist/active-host-BP0zy_Y9.js.map +0 -1
  400. package/dist/active-host-jH3iloCR.cjs +0 -1
  401. package/dist/active-host-jH3iloCR.cjs.map +0 -1
  402. package/dist/agent/overlay.confirm-body-BFYWMa45.js +0 -5518
  403. package/dist/agent/overlay.confirm-body-BFYWMa45.js.map +0 -1
  404. package/dist/area-HXuLLQnN.cjs +0 -21
  405. package/dist/date-range-inline-BnhQZTK0.cjs +0 -43
  406. package/dist/float-DyaPI0qO.cjs +0 -1
  407. package/dist/menu-Bfay8vF8.cjs +0 -23
  408. package/dist/mixins-BfazlmLD.js.map +0 -1
  409. package/dist/mixins-CxGRIPYQ.cjs.map +0 -1
  410. package/dist/notification-DT_cAi8U.cjs +0 -24
  411. package/dist/overlay-CRwfhbyi.cjs +0 -43
  412. package/dist/overlay.confirm-body-CxOomuN6.cjs +0 -70
  413. package/dist/radio-group-DQRJGMgS.cjs +0 -19
  414. package/dist/splash-screen-CGnhHDB_.cjs +0 -41
  415. package/dist/src-C0MzzF_S.cjs +0 -263
  416. package/dist/state-CHbIt2Dw.js.map +0 -1
  417. package/dist/state-DcGj-pJJ.cjs +0 -1
  418. package/dist/state-DcGj-pJJ.cjs.map +0 -1
  419. package/dist/surface-DPzlMMYX.cjs +0 -7
  420. package/dist/textarea-Cjlsy3y9.cjs +0 -43
  421. package/dist/theme-CG3Gpne7.cjs +0 -181
  422. package/dist/theme-button-CEc_Kl54.cjs +0 -8
  423. package/dist/window-aVXgfw__.cjs +0 -59
  424. /package/dist/agent/{flow-3RrZM-e7.js → flow-CvG1fLW5.js} +0 -0
  425. /package/dist/agent/{vendor-material-color-33Mj762T.js → vendor-material-color-DcL7ZPxx.js} +0 -0
@@ -85,6 +85,40 @@ async _onSubmit(e: CustomEvent<SchmancyFormSubmitDetail>) {
85
85
  }
86
86
  ```
87
87
 
88
+ ## Submit-handler discipline
89
+
90
+ A `@submit` handler narrows the draft type, then passes the persist promise to `ev.detail.until(...)` in one expression. The form already enforces field-level `required` and renders a rejected `until` promise inline via `formError` state — anything the handler adds on top is duplication.
91
+
92
+ Anti-patterns:
93
+
94
+ - Wrapping a single `await api(...)` call in an `(async () => { ... })()` IIFE solely to use `await`. `until(api(...))` accepts a promise directly; the IIFE adds nothing.
95
+ - `if (!draft.name.trim()) throw new Error('Fill in the name.')` when the field is `<schmancy-input required>`. Required-field violations never reach the handler — schmancy-form blocks the submit dispatch before they would.
96
+ - `throw new Error(...)` on a kind-narrowing branch (`if (draft?.kind !== 'organization')`). The other branch is impossible by construction (the form's `<schmancy-context>` isolates that kind's draft). Narrowing branches use `return`, not `throw`.
97
+
98
+ The remaining legitimate throws are cross-component invariants the form can't see — e.g., "Pick a legal entity first" when a sibling picker writes to a different state singleton. Express them by passing `Promise.reject(new Error(...))` to `until`, not by re-introducing an IIFE.
99
+
100
+ ```ts
101
+ // ❌ wrong
102
+ ev.detail.until((async () => {
103
+ if (!draft.name.trim()) throw new Error('Fill in the name.');
104
+ if (auth.currentUser === null) throw new Error('Sign in.');
105
+ await updateWorkspace(draft.id, { name: draft.name.trim() });
106
+ })());
107
+
108
+ // ✓ right
109
+ const draft = state.value;
110
+ if (draft?.kind !== 'organization' || !draft.id) return;
111
+ ev.detail.until(updateWorkspace(draft.id, { name: draft.name.trim() }));
112
+
113
+ // ✓ cross-component invariant: reject inline
114
+ const parent = ws.legalEntity.value;
115
+ if (parent?.kind !== 'legalEntity') {
116
+ ev.detail.until(Promise.reject(new Error('Pick a legal entity first.')));
117
+ return;
118
+ }
119
+ ev.detail.until(createWorkspace(/* ...assembled with parent.id... */));
120
+ ```
121
+
88
122
  ## CSS state hooks (free)
89
123
 
90
124
  Every field broadcasts these via `:state(...)`:
@@ -19,11 +19,11 @@ import { Signal } from '@lit-labs/signals'
19
19
  // `@lit/context` re-exports `ContextRequestEvent` as `ContextEvent` from
20
20
  // its public entry. Same class, just a shorter public name.
21
21
  import { ContextEvent as ContextRequestEvent, createContext } from '@lit/context'
22
- import { Observable } from 'rxjs'
22
+ import { Observable, type MonoTypeOperatorFunction } from 'rxjs'
23
23
  import { produce, type Draft } from 'immer'
24
24
 
25
25
  import { createAdapter, type StorageAdapter, type StorageBackend } from './persist'
26
- import { resolveActiveHost, stateContextKey } from './active-host'
26
+ import { _activeHost, resolveActiveHost, stateContextKey } from './active-host'
27
27
  // Side-effect import: registers the `<schmancy-context>` element so users
28
28
  // only need to import from `@mhmo91/schmancy/state` to get both the factory
29
29
  // and the scoping primitive.
@@ -897,3 +897,28 @@ export function observe<T>(source: ObservableState<T>) {
897
897
  })
898
898
  }
899
899
  }
900
+
901
+
902
+ /**
903
+ * RxJS operator that restores `host` as the active schmancy context for every
904
+ * emission. Drop this into any pipeline whose subscriber calls state mutators
905
+ * from an async scheduler that bypasses the Promise.then patch (Firestore
906
+ * onSnapshot, WebSockets, native timers, etc.).
907
+ *
908
+ * ```ts
909
+ * snapshotDoc$(ref).pipe(
910
+ * schmancyContext(this),
911
+ * takeUntil(this.disconnecting),
912
+ * ).subscribe(snap => { ws.legalEntity.set(parse(snap)) })
913
+ * ```
914
+ */
915
+ export function schmancyContext<T>(host: HTMLElement): MonoTypeOperatorFunction<T> {
916
+ return (source) =>
917
+ new Observable<T>((subscriber) =>
918
+ source.subscribe({
919
+ next: (v) => _activeHost.run(host, () => subscriber.next(v)),
920
+ error: (e) => subscriber.error(e),
921
+ complete: () => subscriber.complete(),
922
+ }),
923
+ )
924
+ }
@@ -11,10 +11,11 @@
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 { _publishEventHost, stateContextKey } from './active-host';
18
19
 
19
20
  // Curated set of DOM event types that descendants are likely to bind state-
20
21
  // mutating handlers to. The capture-phase listener publishes `this` as the
@@ -22,109 +23,109 @@ import { _publishEventHost, stateContextKey } from './active-host'
22
23
  // inline handlers (or any code reached during the synchronous chain) call a
23
24
  // state mutator can resolve back to the isolated copy this context provides.
24
25
  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
26
+ 'click',
27
+ 'dblclick',
28
+ 'submit',
29
+ 'change',
30
+ 'input',
31
+ 'keydown',
32
+ 'keyup',
33
+ 'keypress',
34
+ 'pointerdown',
35
+ 'pointerup',
36
+ 'mousedown',
37
+ 'mouseup',
38
+ 'focus',
39
+ 'blur',
40
+ 'paste',
41
+ 'drop',
42
+ ] as const;
42
43
 
43
44
  /** Duck-typed view of what the `state()` factory hands out, restricted to the
44
45
  * bits `<schmancy-context>` needs. Kept internal — consumers see the full
45
46
  * `State<>` type and never refer to this. */
46
47
  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>
48
+ readonly namespace: string;
49
+ readonly value: unknown;
50
+ /** Internal hook the factory adds to every state instance. Builds a fresh
51
+ * per-context copy seeded with the current value, sharing nothing with the
52
+ * global instance. The returned object exposes `destroy()` so the context
53
+ * element can flush + close on disconnect. */
54
+ _isolatedInstance(): { destroy(): void } & Record<string | symbol, unknown>;
54
55
  }
55
56
 
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[] = []
57
+ export class SchmancyContext extends SchmancyElement {
58
+ /** States to isolate under this subtree. Pass the same instances you import
59
+ * at module scope (e.g. `provides={[cart, menu]}`). Outside this element
60
+ * they continue to behave as module-scoped globals; descendants of this
61
+ * element see a per-element isolated copy. */
62
+ @property({ attribute: false }) provides: readonly StateTemplate[] = [];
62
63
 
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
- }> = []
64
+ // Per-mount records. Keep both the provider (so we can release it on
65
+ // disconnect) and the isolated instance (so we can destroy it).
66
+ private _scoped: Array<{
67
+ isolated: { destroy(): void };
68
+ provider: ContextProvider<Context<unknown, unknown>>;
69
+ }> = [];
69
70
 
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
- }
71
+ private _publishEventTargetAsHost = (e: Event): void => {
72
+ // Publish the deepest event target (across shadow boundaries) rather
73
+ // than `this`. The downstream `ContextRequestEvent` will be dispatched
74
+ // from this host and must bubble up through `<schmancy-context>` to
75
+ // reach our `ContextProvider`. `@lit/context` skips self-registration
76
+ // (`consumerHost === this.host` ⇒ no-op), so dispatching from
77
+ // schmancy-context itself would silently fall back to the global.
78
+ const path = e.composedPath();
79
+ for (const node of path) {
80
+ if (node instanceof HTMLElement) {
81
+ _publishEventHost(node);
82
+ return;
83
+ }
84
+ }
85
+ };
85
86
 
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
- }
87
+ override connectedCallback(): void {
88
+ super.connectedCallback();
89
+ for (const tmpl of this.provides) {
90
+ const isolated = tmpl._isolatedInstance();
91
+ const ctx = createContext<unknown>(stateContextKey(tmpl.namespace));
92
+ // ContextProvider auto-wires via the host's ReactiveControllerHost
93
+ // interface (LitElement satisfies it). It listens for
94
+ // `context-request` events and responds with `isolated` for any
95
+ // requester whose `event.context === ctx`.
96
+ const provider = new ContextProvider(this, { context: ctx, initialValue: isolated });
97
+ this._scoped.push({ isolated, provider });
98
+ }
99
+ for (const type of EVENT_TYPES) {
100
+ this.addEventListener(type, this._publishEventTargetAsHost, { capture: true });
101
+ }
102
+ }
102
103
 
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
- }
104
+ override disconnectedCallback(): void {
105
+ for (const type of EVENT_TYPES) {
106
+ this.removeEventListener(type, this._publishEventTargetAsHost, { capture: true });
107
+ }
108
+ for (const entry of this._scoped) {
109
+ entry.isolated.destroy();
110
+ }
111
+ this._scoped = [];
112
+ super.disconnectedCallback();
113
+ }
113
114
 
114
- override render() {
115
- return html`<slot></slot>`
116
- }
115
+ override render() {
116
+ return html`<slot></slot>`;
117
+ }
117
118
  }
118
119
 
119
120
  // Imperative define so a second load (source + dist) is a no-op rather than
120
121
  // a throw — the registry is process-global; whichever class wins serves the
121
122
  // element identity for the page.
122
123
  if (!customElements.get('schmancy-context')) {
123
- customElements.define('schmancy-context', SchmancyContext)
124
+ customElements.define('schmancy-context', SchmancyContext);
124
125
  }
125
126
 
126
127
  declare global {
127
- interface HTMLElementTagNameMap {
128
- 'schmancy-context': SchmancyContext
129
- }
128
+ interface HTMLElementTagNameMap {
129
+ 'schmancy-context': SchmancyContext;
130
+ }
130
131
  }
@@ -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
 
@@ -1,5 +1,5 @@
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';
@@ -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"}