@nldd/design-system 0.26.5 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (441) hide show
  1. package/custom-elements.json +428 -37
  2. package/dist/cdn/autoloader.js +141 -141
  3. package/dist/cdn/chunks/{accordion-qXirmNBj.js → accordion-DBM4AcGb.js} +4 -4
  4. package/dist/cdn/chunks/{accordion-item-BXEHwzcv.js → accordion-item-D90CmJyl.js} +4 -4
  5. package/dist/cdn/chunks/{activity-indicator-DP61AhsJ.js → activity-indicator-B6m9h0oa.js} +5 -5
  6. package/dist/cdn/chunks/{admonition-RnRSNAri.js → admonition-B-YTkCjn.js} +4 -4
  7. package/dist/cdn/chunks/after-parse-BSKUm67Q.js +9 -0
  8. package/dist/cdn/chunks/{avatar-DsexiOhH.js → avatar-CfBP9UZZ.js} +75 -41
  9. package/dist/cdn/chunks/{avatar-group-BrfrpXvd.js → avatar-group-DW_xMwb_.js} +71 -49
  10. package/dist/cdn/chunks/{badge-BiQFOq2l.js → badge-DnAuIhp1.js} +5 -5
  11. package/dist/cdn/chunks/{banner-42zIYAEN.js → banner-CRk2ARtC.js} +7 -7
  12. package/dist/cdn/chunks/{bar-split-view-CjYEp276.js → bar-split-view-DDgOYs7Z.js} +28 -21
  13. package/dist/cdn/chunks/{blockquote-qf4hJYvm.js → blockquote-DlfhBScg.js} +3 -3
  14. package/dist/cdn/chunks/{box-CWyg7sbR.js → box-DdU13yI4.js} +3 -3
  15. package/dist/cdn/chunks/{breadcrumbs-BaHjYdz8.js → breadcrumbs-CqkR_6XN.js} +5 -5
  16. package/dist/cdn/chunks/{button-bar-DeJ81759.js → button-bar-BKkap9nk.js} +3 -3
  17. package/dist/cdn/chunks/{button-group-CuRkiHR5.js → button-group-D-YTmErV.js} +2 -2
  18. package/dist/cdn/chunks/{button-CKV-jwGY.js → button-muXGJHlo.js} +8 -8
  19. package/dist/cdn/chunks/{card-DxeUNE3V.js → card-Dvqz83fC.js} +4 -4
  20. package/dist/cdn/chunks/{cell-QaG8b-Qk.js → cell-C0O8tZbX.js} +6 -6
  21. package/dist/cdn/chunks/{checkbox-V0YerUKf.js → checkbox-CNWROiHV.js} +5 -5
  22. package/dist/cdn/chunks/{checkbox-field-DeySECgv.js → checkbox-field-DCYpRJfz.js} +7 -7
  23. package/dist/cdn/chunks/{checkbox-group-DFNy1y-A.js → checkbox-group-DxWAYp_b.js} +3 -3
  24. package/dist/cdn/chunks/{class-map-CmgI2Tu-.js → class-map-D720ceWJ.js} +1 -1
  25. package/dist/cdn/chunks/{code-editor-BBMbUJ4d.js → code-editor-DlnTXkHx.js} +5 -5
  26. package/dist/cdn/chunks/{code-viewer-B8jse0-5.js → code-viewer-DyJzo36-.js} +94 -87
  27. package/dist/cdn/chunks/{codemirror-input-BEotDTtZ.js → codemirror-input-DPSOMYZ4.js} +5 -5
  28. package/dist/cdn/chunks/{collection-DRoS7Ona.js → collection-i7H8zkQ8.js} +61 -42
  29. package/dist/cdn/chunks/{combo-box-DA1ZQJJS.js → combo-box-CpNl_us0.js} +20 -14
  30. package/dist/cdn/chunks/{container-F1i2pmko.js → container-YWW7mHNa.js} +14 -10
  31. package/dist/cdn/chunks/{custom-element-DD4ffKRs.js → custom-element-D8yf5dqU.js} +1 -1
  32. package/dist/cdn/chunks/{date-field-DVgisQnm.js → date-field-DzhUp4Rk.js} +12 -12
  33. package/dist/cdn/chunks/{date-picker-BaDTota3.js → date-picker-CGvsvK3g.js} +21 -15
  34. package/dist/cdn/chunks/{decorate-CeGXihRM.js → decorate-1aEyfetK.js} +1 -1
  35. package/dist/cdn/chunks/{described-by-mixin-qFatR9dF.js → described-by-mixin-DffYoaxu.js} +2 -2
  36. package/dist/cdn/chunks/{description-cell-D45N4P1X.js → description-cell-DEw6xc2o.js} +6 -6
  37. package/dist/cdn/chunks/{dev-checks-CkCD0tPh.js → dev-checks-CTopJcdE.js} +12 -0
  38. package/dist/cdn/chunks/{directive-helpers-B9pcQxsE.js → directive-helpers-BQml5ahH.js} +1 -1
  39. package/dist/cdn/chunks/{dist-BS_pQgb6.js → dist-B5t9fS8q.js} +2 -2
  40. package/dist/cdn/chunks/{dist-DjlGttcc.js → dist-B87Ag4L-.js} +1 -1
  41. package/dist/cdn/chunks/{dist-v62GtoI6.js → dist-BKnqQxdv.js} +1 -1
  42. package/dist/cdn/chunks/{dist-Dsyc1RGG.js → dist-BYbLHkMP.js} +1 -1
  43. package/dist/cdn/chunks/{dist-Cl-rXzh7.js → dist-C8ZY_QIK.js} +1 -1
  44. package/dist/cdn/chunks/{dist-v7yvd26H.js → dist-CIX4JLW1.js} +3 -3
  45. package/dist/cdn/chunks/{dist-DJQUgOKW.js → dist-Cr8NctvS.js} +3 -3
  46. package/dist/cdn/chunks/{dist-mxb0NzAU.js → dist-D59Ae7dj.js} +1 -1
  47. package/dist/cdn/chunks/{dist-n8aCu6Kg.js → dist-DAf6EMuK.js} +2 -2
  48. package/dist/cdn/chunks/{dist-rjQNj-KZ.js → dist-DevfJ4Mu.js} +2 -2
  49. package/dist/cdn/chunks/{dist-jTL_Kil1.js → dist-qHSPGfTO.js} +1 -1
  50. package/dist/cdn/chunks/{divider-CtMx3Byp.js → divider-44rkHLYj.js} +2 -2
  51. package/dist/cdn/chunks/{document-tab-bar-SKSf69FX.js → document-tab-bar-CcSKzhEy.js} +95 -56
  52. package/dist/cdn/chunks/{dropdown-se1zjYlw.js → dropdown-CJPjI-p1.js} +5 -5
  53. package/dist/cdn/chunks/{file-field-DW_Xt5O3.js → file-field-B4HQKpkI.js} +14 -14
  54. package/dist/cdn/chunks/{form-actions-Cy5tH1nk.js → form-actions-HaBfh6vm.js} +2 -2
  55. package/dist/cdn/chunks/{form-associated-mixin-CA0F9CPx.js → form-associated-mixin-BByNH679.js} +2 -2
  56. package/dist/cdn/chunks/{form-field-BMWm8VGS.js → form-field-CwYXsuvv.js} +6 -6
  57. package/dist/cdn/chunks/{form-C9-eW3zc.js → form-obggZEpt.js} +1 -1
  58. package/dist/cdn/chunks/{form-section-DrrXc4wZ.js → form-section-B2UZx_-z.js} +1 -1
  59. package/dist/cdn/chunks/frame-pass-C0RUoFMc.js +17 -0
  60. package/dist/cdn/chunks/{full-bleed-section-6QL0av4x.js → full-bleed-section-BSnWghWY.js} +9 -10
  61. package/dist/cdn/chunks/{hero-BThWV3MR.js → hero-CzbuEAUM.js} +73 -68
  62. package/dist/cdn/chunks/{icon-CVM6X_F1.js → icon-CkCT7sPE.js} +2 -2
  63. package/dist/cdn/chunks/{icon-button-h_sEz0Ia.js → icon-button-BBGwCfYp.js} +9 -9
  64. package/dist/cdn/chunks/{icon-cell-C3Ygercd.js → icon-cell-DcHnXV-8.js} +5 -5
  65. package/dist/cdn/chunks/{identity-BR0KxjM5.js → identity-C0fujsxK.js} +6 -6
  66. package/dist/cdn/chunks/{if-defined-CvQli6P0.js → if-defined-CL4nn-Q-.js} +1 -1
  67. package/dist/cdn/chunks/{image-D8H73DIj.js → image-BgtqLXfM.js} +8 -8
  68. package/dist/cdn/chunks/{inline-dialog-Dlu3bneh.js → inline-dialog-BYRIWhkm.js} +6 -6
  69. package/dist/cdn/chunks/{just-in-time-education-DG0teV5g.js → just-in-time-education-DwH3ubhZ.js} +5 -5
  70. package/dist/cdn/chunks/{kanban-MNLyqki_.js → kanban-BIZUoBj-.js} +35 -30
  71. package/dist/cdn/chunks/{kanban-column-CGF_4Q0N.js → kanban-column-CtjCIgaR.js} +37 -25
  72. package/dist/cdn/chunks/{keyboard-shortcut-DZDtndhS.js → keyboard-shortcut-BHylGMNu.js} +3 -3
  73. package/dist/cdn/chunks/{languages-BCn4J5Ck.js → languages-DghCYmiz.js} +12 -12
  74. package/dist/cdn/chunks/layout-pass-Cq85kSHX.js +45 -0
  75. package/dist/cdn/chunks/{link-CTj3dTmJ.js → link-S53veJpD.js} +6 -6
  76. package/dist/cdn/chunks/{link-group--C486tYV.js → link-group-B2_vdANe.js} +2 -2
  77. package/dist/cdn/chunks/{list-DApLHKj-.js → list-C8hY4uGW.js} +48 -34
  78. package/dist/cdn/chunks/{list-item-BN9uuvXr.js → list-item-CK1Rli4F.js} +5 -6
  79. package/dist/cdn/chunks/{list-item-segment-CvdZT9Ni.js → list-item-segment-KyrcOFDA.js} +3 -3
  80. package/dist/cdn/chunks/{menu-bar-g-O3_TNl.js → menu-bar-BRoqy5zp.js} +62 -46
  81. package/dist/cdn/chunks/{menu-bar-item-tOFEx-lS.js → menu-bar-item-DKW198ZW.js} +6 -6
  82. package/dist/cdn/chunks/{menu-divider-Dmv0lMHV.js → menu-divider-DDPBPK-o.js} +3 -3
  83. package/dist/cdn/chunks/{menu-group-Ci9QUUwZ.js → menu-group-uZXsE-uu.js} +4 -4
  84. package/dist/cdn/chunks/{menu-item-BnIbV4yo.js → menu-item-BOvb4QLd.js} +16 -12
  85. package/dist/cdn/chunks/{menu-2-9LtMLY.js → menu-m67vk1Z4.js} +20 -19
  86. package/dist/cdn/chunks/{menu.template-sPjaMfc8.js → menu.template-v6VnRUNJ.js} +105 -76
  87. package/dist/cdn/chunks/{modal-dialog-D-jAbabe.js → modal-dialog-BNq0r-1L.js} +4 -4
  88. package/dist/cdn/chunks/{multi-line-text-field-uBZqAdr6.js → multi-line-text-field-Bfq47I3P.js} +6 -6
  89. package/dist/cdn/chunks/{navigation-split-view-DARbBPq-.js → navigation-split-view-BiPoxCLL.js} +59 -47
  90. package/dist/cdn/chunks/{notification-CntIGoYh.js → notification-DjZXBv4J.js} +6 -6
  91. package/dist/cdn/chunks/{number-field-C0MTabLP.js → number-field-tqoQLrgZ.js} +8 -8
  92. package/dist/cdn/chunks/{one-half-one-half-section-DYzf6LtU.js → one-half-one-half-section-CyIm21PD.js} +15 -16
  93. package/dist/cdn/chunks/{one-third-two-thirds-section-AAiaxCHH.js → one-third-two-thirds-section-CpnK0vzB.js} +15 -16
  94. package/dist/cdn/chunks/{one-time-code-field-CCILuCy1.js → one-time-code-field-6sMEfzoY.js} +103 -64
  95. package/dist/cdn/chunks/{overflow-menu-DFoh3xL_.js → overflow-menu-IfYEX8tm.js} +1 -1
  96. package/dist/cdn/chunks/{page-footer-BsVMZCXs.js → page-footer-ET6j1N2Z.js} +4 -4
  97. package/dist/cdn/chunks/{page-section-mixin-L0bl3wCm.js → page-section-mixin-D9JL2q9A.js} +3 -3
  98. package/dist/cdn/chunks/{page-BDXLREou.js → page-w4XAfBWD.js} +76 -54
  99. package/dist/cdn/chunks/{pagination-DLwbSZdO.js → pagination-D7QFUu8x.js} +6 -6
  100. package/dist/cdn/chunks/{password-field-DKTJgEyb.js → password-field-Ck5wx6pg.js} +8 -8
  101. package/dist/cdn/chunks/{popover-RB7uLASo.js → popover-DOmi5m85.js} +5 -5
  102. package/dist/cdn/chunks/{progress-bar-DnXWbmiw.js → progress-bar-BDNcB06i.js} +10 -7
  103. package/dist/cdn/chunks/{progress-circle-S89MUtU8.js → progress-circle-BAMztpb3.js} +10 -7
  104. package/dist/cdn/chunks/{radio-button-B31lAjlk.js → radio-button-DAps6n0Q.js} +92 -51
  105. package/dist/cdn/chunks/{radio-button-field-BF4MHiOQ.js → radio-button-field-BbPk0nM_.js} +8 -7
  106. package/dist/cdn/chunks/{radio-button-group-BQUqV8wJ.js → radio-button-group-lxzwku00.js} +3 -3
  107. package/dist/cdn/chunks/{render-marked-ChJNzktf.js → render-marked-ClMFyNu0.js} +1 -1
  108. package/dist/cdn/chunks/{reorder-handle-cell-SEERkeh7.js → reorder-handle-cell-Cap2u2zx.js} +4 -4
  109. package/dist/cdn/chunks/{reorder-handle-mixin-tWe9XTjZ.js → reorder-handle-mixin-CnRKPVqU.js} +2 -2
  110. package/dist/cdn/chunks/{repeat-CdCK17GF.js → repeat-CIyCvHHQ.js} +2 -2
  111. package/dist/cdn/chunks/{rich-text-vVWOndD2.js → rich-text-CblFmHY-.js} +3 -3
  112. package/dist/cdn/chunks/{row-header-mixin-6MoJ5Mjq.js → row-header-mixin-C8z9StDU.js} +2 -2
  113. package/dist/cdn/chunks/{scroll-fade-Cr7_IXpU.js → scroll-fade-C_L9CJrR.js} +2 -2
  114. package/dist/cdn/chunks/scroll-mode-controller-Dl5hddJo.js +52 -0
  115. package/dist/cdn/chunks/{search-field-C9urWH_J.js → search-field-JeUPcBjZ.js} +10 -10
  116. package/dist/cdn/chunks/{segmented-control-DkILAMOJ.js → segmented-control-DtycvVyp.js} +7 -7
  117. package/dist/cdn/chunks/{shadow-resets-9v6K-Fie.js → shadow-resets-DgR56wQK.js} +2 -2
  118. package/dist/cdn/chunks/{sheet-D89xI-KY.js → sheet-XtRs26hN.js} +3 -3
  119. package/dist/cdn/chunks/{shell-CFmfUD0_.js → shell-CCaEEGna.js} +4 -4
  120. package/dist/cdn/chunks/{side-by-side-split-view-ir9c0mwZ.js → side-by-side-split-view-mhXD4Lde.js} +38 -29
  121. package/dist/cdn/chunks/{sidebar-section-BhJXels3.js → sidebar-section-Cwd4LSE6.js} +70 -48
  122. package/dist/cdn/chunks/{simple-section-CMoYuLYV.js → simple-section-BuiaCGks.js} +9 -10
  123. package/dist/cdn/chunks/{skip-link-rUQq0D-l.js → skip-link-nTlmioFt.js} +4 -4
  124. package/dist/cdn/chunks/{slider-CIQqjKUo.js → slider-C0rNQEIY.js} +9 -9
  125. package/dist/cdn/chunks/{spacer-CD85egxE.js → spacer-CeSO9CP1.js} +2 -2
  126. package/dist/cdn/chunks/{spacer-cell-B33mGdru.js → spacer-cell-NhlxEdhA.js} +4 -4
  127. package/dist/cdn/chunks/{split-button-COL7r-wa.js → split-button-BR-ccA6_.js} +7 -7
  128. package/dist/cdn/chunks/{split-view-divider-DVBuBzeO.js → split-view-divider-HcIV0yli.js} +2 -2
  129. package/dist/cdn/chunks/{split-view-pane-CSvIzeBg.js → split-view-pane-BgFUL3BV.js} +4 -4
  130. package/dist/cdn/chunks/{stacked-split-view-onSk2QEi.js → stacked-split-view-j77p3uE2.js} +29 -25
  131. package/dist/cdn/chunks/{static-html-Cyhp44gp.js → static-html-CGoLwgpW.js} +1 -1
  132. package/dist/cdn/chunks/{status-bar-CjYXOQAX.js → status-bar-ByJ21hV2.js} +29 -17
  133. package/dist/cdn/chunks/{step-bar-D-To0TEw.js → step-bar-CRxF0S42.js} +5 -5
  134. package/dist/cdn/chunks/{step-cell-B7sVGixc.js → step-cell-C-gOxNA6.js} +5 -5
  135. package/dist/cdn/chunks/{stepper-h6boMOhz.js → stepper-Dmljb7Qc.js} +7 -7
  136. package/dist/cdn/chunks/{style-map-BrdTV34-.js → style-map-CK811FGv.js} +1 -1
  137. package/dist/cdn/chunks/{swatch-picker-gQ3m3y9U.js → swatch-picker-DtAgTXLo.js} +6 -6
  138. package/dist/cdn/chunks/{switch-DC-BTi9E.js → switch-Bqion92b.js} +5 -5
  139. package/dist/cdn/chunks/{switch-field-D82mLobj.js → switch-field-CWobTcEn.js} +6 -6
  140. package/dist/cdn/chunks/{tab-bar-sKiFzvfj.js → tab-bar-DPtRjP8Z.js} +85 -49
  141. package/dist/cdn/chunks/{table-CuxZfCZD.js → table-C4CFiDgr.js} +111 -54
  142. package/dist/cdn/chunks/{tag-DP_ome5l.js → tag-Bo23A60g.js} +4 -4
  143. package/dist/cdn/chunks/{term-BdiTV-Jk.js → term-DPMEWR-t.js} +12 -12
  144. package/dist/cdn/chunks/{text-C-b1ygHI.js → text-CuiMvMZQ.js} +3 -3
  145. package/dist/cdn/chunks/{text-cell-DfRh7JqZ.js → text-cell-E3yc99xw.js} +8 -8
  146. package/dist/cdn/chunks/{text-editor-DuT9Rrpv.js → text-editor-BVmHiq_b.js} +191 -191
  147. package/dist/cdn/chunks/{text-field-kAbXzkUj.js → text-field-DOv1aI_F.js} +6 -6
  148. package/dist/cdn/chunks/{time-field-DUz9ifmn.js → time-field-BhlLk6tt.js} +14 -14
  149. package/dist/cdn/chunks/{time-picker-DGOKwC9T.js → time-picker-A4-HeVas.js} +170 -99
  150. package/dist/cdn/chunks/{title-BA-SUyAq.js → title-EMt-SYKV.js} +4 -4
  151. package/dist/cdn/chunks/{title-cell-Cu5NFNUu.js → title-cell--EE-L_8a.js} +8 -8
  152. package/dist/cdn/chunks/{toggle-button-J6UapeqB.js → toggle-button-BLwpxmQs.js} +8 -8
  153. package/dist/cdn/chunks/{toggle-button-group-wrps-tL9.js → toggle-button-group-scdxolJt.js} +2 -2
  154. package/dist/cdn/chunks/{token-DJkyJz-k.js → token-DVgXuCRO.js} +5 -5
  155. package/dist/cdn/chunks/{token-field-SiBFPD8-.js → token-field-CICQXLlO.js} +12 -12
  156. package/dist/cdn/chunks/toolbar-Des2gaH2.js +441 -0
  157. package/dist/cdn/chunks/{toolbar-item-DPizdgYi.js → toolbar-item-CkwQ2UyY.js} +3 -3
  158. package/dist/cdn/chunks/{toolbar-title-CB4IJFGv.js → toolbar-title-PoOf794l.js} +4 -4
  159. package/dist/cdn/chunks/{toolbar.styles-vmMPyzS_.js → toolbar.styles-DzreUGTp.js} +3 -3
  160. package/dist/cdn/chunks/{tooltip-Bg2ovCCg.js → tooltip-CMCT2iiD.js} +4 -4
  161. package/dist/cdn/chunks/{top-navigation-bar-vA8wpJXS.js → top-navigation-bar-BfMGgTIy.js} +121 -104
  162. package/dist/cdn/chunks/{top-title-bar-BAJGmgnj.js → top-title-bar-CvvldlNt.js} +43 -30
  163. package/dist/cdn/chunks/{translations-Cjd13Xb6.js → translations-C5JpcNNC.js} +1 -1
  164. package/dist/cdn/chunks/{two-thirds-one-third-section-D1FvorKO.js → two-thirds-one-third-section-BTkeIiHm.js} +15 -16
  165. package/dist/cdn/chunks/{validation-list-D3rKnfTu.js → validation-list-BasB3ZaT.js} +3 -3
  166. package/dist/cdn/chunks/{visibility-mixin-BRMACV1l.js → visibility-mixin-BxhcJG-x.js} +2 -2
  167. package/dist/cdn/chunks/{visually-hidden-BukWRiJA.js → visually-hidden-ByHY8pKl.js} +2 -2
  168. package/dist/cdn/chunks/{window-C9njVzzK.js → window-B5blEfMR.js} +4 -4
  169. package/dist/cdn/chunks/{with-translations-BLzHPSUF.js → with-translations-QDhHJYMT.js} +3 -3
  170. package/dist/components/actions/menu/menu-item.d.ts +11 -0
  171. package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
  172. package/dist/components/actions/menu/menu-item.js +28 -13
  173. package/dist/components/actions/menu/menu-item.js.map +1 -1
  174. package/dist/components/actions/menu/menu.d.ts +6 -0
  175. package/dist/components/actions/menu/menu.d.ts.map +1 -1
  176. package/dist/components/actions/menu/menu.js +14 -4
  177. package/dist/components/actions/menu/menu.js.map +1 -1
  178. package/dist/components/actions/menu/menu.styles.d.ts.map +1 -1
  179. package/dist/components/actions/menu/menu.styles.js +63 -3
  180. package/dist/components/actions/menu/menu.styles.js.map +1 -1
  181. package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
  182. package/dist/components/actions/menu/menu.template.js +18 -47
  183. package/dist/components/actions/menu/menu.template.js.map +1 -1
  184. package/dist/components/actions/toolbar/toolbar.d.ts +56 -16
  185. package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
  186. package/dist/components/actions/toolbar/toolbar.js +263 -95
  187. package/dist/components/actions/toolbar/toolbar.js.map +1 -1
  188. package/dist/components/actions/toolbar/toolbar.steps.d.ts +16 -0
  189. package/dist/components/actions/toolbar/toolbar.steps.d.ts.map +1 -0
  190. package/dist/components/actions/toolbar/toolbar.steps.js +33 -0
  191. package/dist/components/actions/toolbar/toolbar.steps.js.map +1 -0
  192. package/dist/components/content/avatar/avatar.d.ts +22 -10
  193. package/dist/components/content/avatar/avatar.d.ts.map +1 -1
  194. package/dist/components/content/avatar/avatar.js +122 -29
  195. package/dist/components/content/avatar/avatar.js.map +1 -1
  196. package/dist/components/content/avatar-group/avatar-group.d.ts +25 -10
  197. package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -1
  198. package/dist/components/content/avatar-group/avatar-group.js +97 -26
  199. package/dist/components/content/avatar-group/avatar-group.js.map +1 -1
  200. package/dist/components/content/avatar-group/avatar-group.template.d.ts.map +1 -1
  201. package/dist/components/content/avatar-group/avatar-group.template.js +5 -4
  202. package/dist/components/content/avatar-group/avatar-group.template.js.map +1 -1
  203. package/dist/components/content/code-viewer/code-viewer.d.ts +4 -2
  204. package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
  205. package/dist/components/content/code-viewer/code-viewer.js +35 -32
  206. package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
  207. package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
  208. package/dist/components/forms/form-field/form-field.js +4 -0
  209. package/dist/components/forms/form-field/form-field.js.map +1 -1
  210. package/dist/components/inputs/combo-box/combo-box.d.ts +8 -0
  211. package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
  212. package/dist/components/inputs/combo-box/combo-box.js +28 -9
  213. package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
  214. package/dist/components/inputs/date-picker/date-picker.d.ts +11 -0
  215. package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
  216. package/dist/components/inputs/date-picker/date-picker.js +23 -0
  217. package/dist/components/inputs/date-picker/date-picker.js.map +1 -1
  218. package/dist/components/inputs/date-picker/date-picker.template.d.ts.map +1 -1
  219. package/dist/components/inputs/date-picker/date-picker.template.js +4 -2
  220. package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -1
  221. package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
  222. package/dist/components/inputs/file-field/file-field.js +6 -1
  223. package/dist/components/inputs/file-field/file-field.js.map +1 -1
  224. package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts +27 -5
  225. package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts.map +1 -1
  226. package/dist/components/inputs/one-time-code-field/one-time-code-field.js +128 -30
  227. package/dist/components/inputs/one-time-code-field/one-time-code-field.js.map +1 -1
  228. package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
  229. package/dist/components/inputs/radio-button/radio-button.js +5 -2
  230. package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
  231. package/dist/components/inputs/radio-button-field/radio-button-field.d.ts.map +1 -1
  232. package/dist/components/inputs/radio-button-field/radio-button-field.js +5 -2
  233. package/dist/components/inputs/radio-button-field/radio-button-field.js.map +1 -1
  234. package/dist/components/inputs/text-editor/text-editor.annotations.js +1 -1
  235. package/dist/components/inputs/text-editor/text-editor.annotations.js.map +1 -1
  236. package/dist/components/inputs/text-editor/text-editor.js +2 -2
  237. package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
  238. package/dist/components/inputs/text-editor/text-editor.selection.js +1 -1
  239. package/dist/components/inputs/text-editor/text-editor.selection.js.map +1 -1
  240. package/dist/components/inputs/text-editor/text-editor.toolbar.d.ts.map +1 -1
  241. package/dist/components/inputs/text-editor/text-editor.toolbar.js +18 -12
  242. package/dist/components/inputs/text-editor/text-editor.toolbar.js.map +1 -1
  243. package/dist/components/inputs/time-picker/time-picker.d.ts +23 -0
  244. package/dist/components/inputs/time-picker/time-picker.d.ts.map +1 -1
  245. package/dist/components/inputs/time-picker/time-picker.js +132 -12
  246. package/dist/components/inputs/time-picker/time-picker.js.map +1 -1
  247. package/dist/components/inputs/time-picker/time-picker.styles.d.ts.map +1 -1
  248. package/dist/components/inputs/time-picker/time-picker.styles.js +27 -6
  249. package/dist/components/inputs/time-picker/time-picker.styles.js.map +1 -1
  250. package/dist/components/inputs/time-picker/time-picker.template.d.ts.map +1 -1
  251. package/dist/components/inputs/time-picker/time-picker.template.js +1 -0
  252. package/dist/components/inputs/time-picker/time-picker.template.js.map +1 -1
  253. package/dist/components/inputs/token-field/token-field.d.ts.map +1 -1
  254. package/dist/components/inputs/token-field/token-field.js +3 -0
  255. package/dist/components/inputs/token-field/token-field.js.map +1 -1
  256. package/dist/components/layout/collection/collection.d.ts +9 -1
  257. package/dist/components/layout/collection/collection.d.ts.map +1 -1
  258. package/dist/components/layout/collection/collection.js +96 -38
  259. package/dist/components/layout/collection/collection.js.map +1 -1
  260. package/dist/components/layout/container/container.d.ts +1 -0
  261. package/dist/components/layout/container/container.d.ts.map +1 -1
  262. package/dist/components/layout/container/container.js +22 -16
  263. package/dist/components/layout/container/container.js.map +1 -1
  264. package/dist/components/layout/kanban/kanban-column.d.ts +7 -2
  265. package/dist/components/layout/kanban/kanban-column.d.ts.map +1 -1
  266. package/dist/components/layout/kanban/kanban-column.js +49 -17
  267. package/dist/components/layout/kanban/kanban-column.js.map +1 -1
  268. package/dist/components/layout/kanban/kanban.d.ts +4 -1
  269. package/dist/components/layout/kanban/kanban.d.ts.map +1 -1
  270. package/dist/components/layout/kanban/kanban.js +25 -7
  271. package/dist/components/layout/kanban/kanban.js.map +1 -1
  272. package/dist/components/layout/kanban/kanban.template.js +1 -1
  273. package/dist/components/layout/kanban/kanban.template.js.map +1 -1
  274. package/dist/components/layout/page/page.d.ts +39 -12
  275. package/dist/components/layout/page/page.d.ts.map +1 -1
  276. package/dist/components/layout/page/page.js +112 -66
  277. package/dist/components/layout/page/page.js.map +1 -1
  278. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +3 -1
  279. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts.map +1 -1
  280. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js +3 -1
  281. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
  282. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.d.ts.map +1 -1
  283. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js +6 -7
  284. package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js.map +1 -1
  285. package/dist/components/layout/page-sections/hero/hero-corner.d.ts.map +1 -1
  286. package/dist/components/layout/page-sections/hero/hero-corner.js +24 -1
  287. package/dist/components/layout/page-sections/hero/hero-corner.js.map +1 -1
  288. package/dist/components/layout/page-sections/hero/hero-corner.styles.js +22 -22
  289. package/dist/components/layout/page-sections/hero/hero-corner.styles.js.map +1 -1
  290. package/dist/components/layout/page-sections/hero/hero.d.ts +2 -0
  291. package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
  292. package/dist/components/layout/page-sections/hero/hero.js +2 -0
  293. package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
  294. package/dist/components/layout/page-sections/hero/hero.styles.d.ts.map +1 -1
  295. package/dist/components/layout/page-sections/hero/hero.styles.js +8 -11
  296. package/dist/components/layout/page-sections/hero/hero.styles.js.map +1 -1
  297. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts +4 -2
  298. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts.map +1 -1
  299. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js +4 -2
  300. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js.map +1 -1
  301. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.d.ts.map +1 -1
  302. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js +12 -13
  303. package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js.map +1 -1
  304. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +4 -2
  305. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts.map +1 -1
  306. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js +4 -2
  307. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js.map +1 -1
  308. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.d.ts.map +1 -1
  309. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js +12 -13
  310. package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js.map +1 -1
  311. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +12 -9
  312. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
  313. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +66 -21
  314. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
  315. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts.map +1 -1
  316. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js +23 -17
  317. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js.map +1 -1
  318. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.d.ts.map +1 -1
  319. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js +5 -0
  320. package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js.map +1 -1
  321. package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +4 -3
  322. package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
  323. package/dist/components/layout/page-sections/simple-section/simple-section.js +4 -3
  324. package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
  325. package/dist/components/layout/page-sections/simple-section/simple-section.styles.d.ts.map +1 -1
  326. package/dist/components/layout/page-sections/simple-section/simple-section.styles.js +6 -7
  327. package/dist/components/layout/page-sections/simple-section/simple-section.styles.js.map +1 -1
  328. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +4 -2
  329. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts.map +1 -1
  330. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js +4 -2
  331. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
  332. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.d.ts.map +1 -1
  333. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js +12 -13
  334. package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js.map +1 -1
  335. package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +2 -1
  336. package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts.map +1 -1
  337. package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +30 -17
  338. package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
  339. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +8 -3
  340. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts.map +1 -1
  341. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +35 -20
  342. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js.map +1 -1
  343. package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js +1 -1
  344. package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts +6 -2
  345. package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts.map +1 -1
  346. package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js +30 -15
  347. package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js.map +1 -1
  348. package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.js +1 -1
  349. package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts +6 -3
  350. package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts.map +1 -1
  351. package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js +28 -16
  352. package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js.map +1 -1
  353. package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.js +1 -1
  354. package/dist/components/lists-and-tables/list/list.d.ts +19 -0
  355. package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
  356. package/dist/components/lists-and-tables/list/list.js +47 -15
  357. package/dist/components/lists-and-tables/list/list.js.map +1 -1
  358. package/dist/components/lists-and-tables/list/list.roving.d.ts +2 -1
  359. package/dist/components/lists-and-tables/list/list.roving.d.ts.map +1 -1
  360. package/dist/components/lists-and-tables/list/list.roving.js +7 -3
  361. package/dist/components/lists-and-tables/list/list.roving.js.map +1 -1
  362. package/dist/components/lists-and-tables/list-item/list-item.styles.d.ts.map +1 -1
  363. package/dist/components/lists-and-tables/list-item/list-item.styles.js +0 -1
  364. package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
  365. package/dist/components/lists-and-tables/table/table.d.ts +34 -6
  366. package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
  367. package/dist/components/lists-and-tables/table/table.js +143 -40
  368. package/dist/components/lists-and-tables/table/table.js.map +1 -1
  369. package/dist/components/lists-and-tables/table/table.styles.d.ts.map +1 -1
  370. package/dist/components/lists-and-tables/table/table.styles.js +13 -0
  371. package/dist/components/lists-and-tables/table/table.styles.js.map +1 -1
  372. package/dist/components/lists-and-tables/table/table.template.d.ts.map +1 -1
  373. package/dist/components/lists-and-tables/table/table.template.js +6 -0
  374. package/dist/components/lists-and-tables/table/table.template.js.map +1 -1
  375. package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +33 -2
  376. package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
  377. package/dist/components/navigation/document-tab-bar/document-tab-bar.js +136 -38
  378. package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
  379. package/dist/components/navigation/menu-bar/menu-bar.d.ts +21 -3
  380. package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
  381. package/dist/components/navigation/menu-bar/menu-bar.js +61 -29
  382. package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
  383. package/dist/components/navigation/tab-bar/tab-bar.d.ts +26 -4
  384. package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
  385. package/dist/components/navigation/tab-bar/tab-bar.js +99 -24
  386. package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
  387. package/dist/components/navigation/tab-bar/tab-bar.template.d.ts.map +1 -1
  388. package/dist/components/navigation/tab-bar/tab-bar.template.js +1 -0
  389. package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
  390. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +23 -14
  391. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
  392. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +126 -83
  393. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
  394. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +28 -28
  395. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
  396. package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +5 -1
  397. package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
  398. package/dist/components/navigation/top-title-bar/top-title-bar.js +36 -13
  399. package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
  400. package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts +1 -0
  401. package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts.map +1 -1
  402. package/dist/components/status-and-feedback/progress-bar/progress-bar.js +6 -0
  403. package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
  404. package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts +1 -0
  405. package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts.map +1 -1
  406. package/dist/components/status-and-feedback/progress-circle/progress-circle.js +6 -0
  407. package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
  408. package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +0 -1
  409. package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
  410. package/dist/components/status-and-feedback/status-bar/status-bar.js +26 -6
  411. package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
  412. package/dist/nldd.min.js +880 -814
  413. package/dist/types/react.d.ts +8 -8
  414. package/dist/types/vue.d.ts +8 -8
  415. package/dist/utilities/after-parse.d.ts +30 -0
  416. package/dist/utilities/after-parse.d.ts.map +1 -0
  417. package/dist/utilities/after-parse.js +44 -0
  418. package/dist/utilities/after-parse.js.map +1 -0
  419. package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
  420. package/dist/utilities/dev-rules.generated.js +12 -0
  421. package/dist/utilities/dev-rules.generated.js.map +1 -1
  422. package/dist/utilities/frame-pass.d.ts +28 -0
  423. package/dist/utilities/frame-pass.d.ts.map +1 -0
  424. package/dist/utilities/frame-pass.js +41 -0
  425. package/dist/utilities/frame-pass.js.map +1 -0
  426. package/dist/utilities/layout-pass.d.ts +49 -0
  427. package/dist/utilities/layout-pass.d.ts.map +1 -0
  428. package/dist/utilities/layout-pass.js +103 -0
  429. package/dist/utilities/layout-pass.js.map +1 -0
  430. package/dist/utilities/radio-grouping.d.ts +30 -4
  431. package/dist/utilities/radio-grouping.d.ts.map +1 -1
  432. package/dist/utilities/radio-grouping.js +98 -17
  433. package/dist/utilities/radio-grouping.js.map +1 -1
  434. package/dist/utilities/scroll-mode-controller.d.ts +13 -6
  435. package/dist/utilities/scroll-mode-controller.d.ts.map +1 -1
  436. package/dist/utilities/scroll-mode-controller.js +47 -21
  437. package/dist/utilities/scroll-mode-controller.js.map +1 -1
  438. package/lint/data.generated.json +1 -1
  439. package/package.json +1 -1
  440. package/dist/cdn/chunks/scroll-mode-controller-COUD1-3P.js +0 -42
  441. package/dist/cdn/chunks/toolbar-be8hoSAz.js +0 -364
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Work for many hosts at the next animation frame, in one callback.
3
+ *
4
+ * A host that asks for its own frame gets its own callback, and the browser
5
+ * runs the microtasks between two callbacks: a Lit render of the host before
6
+ * lands between them, so each host reads a layout that the one before it has
7
+ * just changed. One frame for all of them lets `run` read for every host
8
+ * first and write after, so the page lays out once.
9
+ *
10
+ * Like LayoutPass (layout-pass.ts), but at the frame the hosts asked for,
11
+ * for work that waited a frame before it was shared. A hidden tab runs no
12
+ * frames, so the pass waits until the tab shows again.
13
+ */
14
+ export class FramePass {
15
+ /** @param run gets every host that asked, in the order they asked. It must
16
+ * not throw: the pass has already let go of its hosts, so one that throws
17
+ * drops the rest of that pass. */
18
+ constructor(_run) {
19
+ this._run = _run;
20
+ this._pending = new Set();
21
+ this._frame = null;
22
+ this._flush = () => {
23
+ this._frame = null;
24
+ if (!this._pending.size)
25
+ return;
26
+ const hosts = [...this._pending];
27
+ this._pending.clear();
28
+ this._run(hosts);
29
+ };
30
+ }
31
+ /** Adds a host to the next frame. */
32
+ schedule(host) {
33
+ this._pending.add(host);
34
+ this._frame ?? (this._frame = requestAnimationFrame(this._flush));
35
+ }
36
+ /** Takes a host out of the next frame, when it left the page. */
37
+ cancel(host) {
38
+ this._pending.delete(host);
39
+ }
40
+ }
41
+ //# sourceMappingURL=frame-pass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frame-pass.js","sourceRoot":"","sources":["../../src/utilities/frame-pass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,SAAS;IAIrB;;uCAEmC;IACnC,YAAoB,IAA0B;QAA1B,SAAI,GAAJ,IAAI,CAAsB;QANtC,aAAQ,GAAG,IAAI,GAAG,EAAK,CAAC;QACxB,WAAM,GAAkB,IAAI,CAAC;QAkB7B,WAAM,GAAG,GAAS,EAAE;YAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;gBAAE,OAAO;YAChC,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;YACjC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC;IAnB+C,CAAC;IAElD,qCAAqC;IACrC,QAAQ,CAAC,IAAO;QACf,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,KAAX,IAAI,CAAC,MAAM,GAAK,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAC;IACpD,CAAC;IAED,iEAAiE;IACjE,MAAM,CAAC,IAAO;QACb,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;CASD"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Layout reads for many hosts, in one pass.
3
+ *
4
+ * A host that measures itself when it renders (an offsetHeight, a
5
+ * getComputedStyle) forces the browser to lay out the page as it is at that
6
+ * moment. A page with many of them, each reading after the previous one wrote,
7
+ * lays out once per host, and each of those layouts is of a page that has
8
+ * grown: quadratic. Reading for all of them first and writing after is one
9
+ * layout.
10
+ *
11
+ * `LayoutPass` collects the hosts that ask in the same tick, and runs them
12
+ * together: at the next microtask, or after the parse while the page is still
13
+ * loading (see afterParse). `sharedResizeObserver` does the same for resize
14
+ * notifications: one observer for every host of a component, so its callback
15
+ * gets them all at once, where an observer per host calls back once per host.
16
+ */
17
+ export declare class LayoutPass<T> {
18
+ private _run;
19
+ private _pending;
20
+ /** @param run gets every host that asked, in the order they asked. It must
21
+ * not throw: the pass has already let go of its hosts, so one that throws
22
+ * drops the rest of that pass. */
23
+ constructor(_run: (hosts: T[]) => void);
24
+ /** Adds a host to the next pass. `doc` only counts for the first host of a
25
+ * pass: a host from another document, such as an iframe, runs when the
26
+ * pass does. */
27
+ schedule(host: T, doc?: Document): void;
28
+ /** Takes a host out of the next pass, when it left the page. */
29
+ cancel(host: T): void;
30
+ /** Runs the pass now, for a caller that cannot wait for it. The run that
31
+ * was scheduled still comes, and finds nothing, or what asked since. */
32
+ flush: () => void;
33
+ private _flush;
34
+ }
35
+ /** One ResizeObserver for every host of a component. */
36
+ export interface SharedResizeObserver<T extends object> {
37
+ observe(target: Element, host: T): void;
38
+ /** Stops watching every target of this host. */
39
+ unobserveAll(host: T): void;
40
+ }
41
+ /**
42
+ * @param onResize gets the hosts with a target that changed size, each once,
43
+ * and only those still in the page.
44
+ * Like any ResizeObserver, a target is reported once when it is observed,
45
+ * also for a host that joins a target another host already observes: the
46
+ * hosts that were there get that report too.
47
+ */
48
+ export declare function sharedResizeObserver<T extends object>(onResize: (hosts: T[]) => void): SharedResizeObserver<T>;
49
+ //# sourceMappingURL=layout-pass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-pass.d.ts","sourceRoot":"","sources":["../../src/utilities/layout-pass.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,UAAU,CAAC,CAAC;IAMZ,OAAO,CAAC,IAAI;IALxB,OAAO,CAAC,QAAQ,CAAgB;IAEhC;;uCAEmC;gBACf,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI;IAE9C;;qBAEiB;IACjB,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,GAAE,QAAmB,GAAG,IAAI;IAOjD,gEAAgE;IAChE,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAIrB;6EACyE;IACzE,KAAK,QAAO,IAAI,CAAkB;IAElC,OAAO,CAAC,MAAM,CAKZ;CACF;AAED,wDAAwD;AACxD,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM;IACrD,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACxC,gDAAgD;IAChD,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAuC9G"}
@@ -0,0 +1,103 @@
1
+ import { afterParse } from './after-parse.js';
2
+ /**
3
+ * Layout reads for many hosts, in one pass.
4
+ *
5
+ * A host that measures itself when it renders (an offsetHeight, a
6
+ * getComputedStyle) forces the browser to lay out the page as it is at that
7
+ * moment. A page with many of them, each reading after the previous one wrote,
8
+ * lays out once per host, and each of those layouts is of a page that has
9
+ * grown: quadratic. Reading for all of them first and writing after is one
10
+ * layout.
11
+ *
12
+ * `LayoutPass` collects the hosts that ask in the same tick, and runs them
13
+ * together: at the next microtask, or after the parse while the page is still
14
+ * loading (see afterParse). `sharedResizeObserver` does the same for resize
15
+ * notifications: one observer for every host of a component, so its callback
16
+ * gets them all at once, where an observer per host calls back once per host.
17
+ */
18
+ export class LayoutPass {
19
+ /** @param run gets every host that asked, in the order they asked. It must
20
+ * not throw: the pass has already let go of its hosts, so one that throws
21
+ * drops the rest of that pass. */
22
+ constructor(_run) {
23
+ this._run = _run;
24
+ this._pending = new Set();
25
+ /** Runs the pass now, for a caller that cannot wait for it. The run that
26
+ * was scheduled still comes, and finds nothing, or what asked since. */
27
+ this.flush = () => this._flush();
28
+ this._flush = () => {
29
+ if (!this._pending.size)
30
+ return;
31
+ const hosts = [...this._pending];
32
+ this._pending.clear();
33
+ this._run(hosts);
34
+ };
35
+ }
36
+ /** Adds a host to the next pass. `doc` only counts for the first host of a
37
+ * pass: a host from another document, such as an iframe, runs when the
38
+ * pass does. */
39
+ schedule(host, doc = document) {
40
+ const scheduled = this._pending.size > 0;
41
+ this._pending.add(host);
42
+ if (scheduled)
43
+ return;
44
+ if (!afterParse(this._flush, doc))
45
+ queueMicrotask(this._flush);
46
+ }
47
+ /** Takes a host out of the next pass, when it left the page. */
48
+ cancel(host) {
49
+ this._pending.delete(host);
50
+ }
51
+ }
52
+ /**
53
+ * @param onResize gets the hosts with a target that changed size, each once,
54
+ * and only those still in the page.
55
+ * Like any ResizeObserver, a target is reported once when it is observed,
56
+ * also for a host that joins a target another host already observes: the
57
+ * hosts that were there get that report too.
58
+ */
59
+ export function sharedResizeObserver(onResize) {
60
+ // A target can belong to more hosts, such as one anchor for two bars.
61
+ const hostsOf = new WeakMap();
62
+ // Weak, so this map keeps no host alive. hostsOf does, for as long as one
63
+ // of its targets lives: call unobserveAll when a host leaves.
64
+ const targetsOf = new WeakMap();
65
+ let observer = null;
66
+ return {
67
+ observe(target, host) {
68
+ observer ?? (observer = new ResizeObserver((entries) => {
69
+ const hosts = new Set();
70
+ for (const entry of entries)
71
+ hostsOf.get(entry.target)?.forEach((of) => hosts.add(of));
72
+ // A host that left the page in the same tick is not reported.
73
+ const live = [...hosts].filter((of) => !(of instanceof Node) || of.isConnected);
74
+ if (live.length)
75
+ onResize(live);
76
+ }));
77
+ const hosts = hostsOf.get(target) ?? new Set();
78
+ hostsOf.set(target, hosts);
79
+ const joins = hosts.size > 0 && !hosts.has(host);
80
+ hosts.add(host);
81
+ const targets = targetsOf.get(host) ?? new Set();
82
+ targetsOf.set(host, targets);
83
+ targets.add(target);
84
+ // Observing a target again reports nothing, so a host that joins one
85
+ // would wait for the next resize.
86
+ if (joins)
87
+ observer.unobserve(target);
88
+ observer.observe(target);
89
+ },
90
+ unobserveAll(host) {
91
+ for (const target of targetsOf.get(host) ?? []) {
92
+ const hosts = hostsOf.get(target);
93
+ hosts?.delete(host);
94
+ if (hosts?.size)
95
+ continue;
96
+ observer?.unobserve(target);
97
+ hostsOf.delete(target);
98
+ }
99
+ targetsOf.delete(host);
100
+ },
101
+ };
102
+ }
103
+ //# sourceMappingURL=layout-pass.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-pass.js","sourceRoot":"","sources":["../../src/utilities/layout-pass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,UAAU;IAGtB;;uCAEmC;IACnC,YAAoB,IAA0B;QAA1B,SAAI,GAAJ,IAAI,CAAsB;QALtC,aAAQ,GAAG,IAAI,GAAG,EAAK,CAAC;QAsBhC;iFACyE;QACzE,UAAK,GAAG,GAAS,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAE1B,WAAM,GAAG,GAAS,EAAE;YAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;gBAAE,OAAO;YAChC,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;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,CAAC,CAAC;gBAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC;YACD,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -39,12 +39,25 @@ export declare class RadioGrouping implements ReactiveController {
39
39
  constructor(host: RadioHost);
40
40
  hostConnected(): void;
41
41
  hostDisconnected(): void;
42
- /** Reads which group this radio is in now, and recounts the one it left. */
43
- regroup(): void;
42
+ /**
43
+ * Reads which group this radio is in now, and recounts the one it left.
44
+ *
45
+ * @param batched recount once for every radio that asks in the same tick,
46
+ * or after the parse while the page is still loading. A recount reads the
47
+ * whole tree, so a page of radios that each recount on connect is
48
+ * quadratic.
49
+ */
50
+ regroup(batched?: boolean): void;
44
51
  /** Counts the group again, after this radio was checked or disabled. */
45
52
  refresh(): void;
46
- /** Unchecks the others, as checking a native radio does. */
47
- uncheckOthers(): void;
53
+ /**
54
+ * Unchecks the others, as checking a native radio does.
55
+ *
56
+ * @param batched at the next recount, with the other radios that render for
57
+ * the first time: of the radios that come checked in the markup, the last
58
+ * one wins. Each of them walking its group on its own is quadratic.
59
+ */
60
+ uncheckOthers(batched?: boolean): void;
48
61
  /**
49
62
  * Moves to the next radio of the group and checks it, as the arrow keys do
50
63
  * for native radios. Disabled options are stepped over, and the ends wrap.
@@ -59,8 +72,21 @@ export declare class RadioGrouping implements ReactiveController {
59
72
  * finished. */
60
73
  private _apply;
61
74
  private static _radiosIn;
75
+ /** Every grouped radio in a tree, by name and form, in document order. */
76
+ private static _groupsIn;
77
+ /** The groups to recount at the next flush: per tree, the names and forms. */
78
+ private static _pending;
79
+ private static _schedule;
80
+ /** Checked radios that render for the first time, in the order they did. */
81
+ private static _claims;
82
+ /** Recounts every pending group, reading each tree once. */
83
+ private static _flush;
84
+ /** The last radio that came checked keeps it; the others in its group do not. */
85
+ private static _settleClaims;
62
86
  /** A radio on its own keeps the place the browser gives it: none. */
63
87
  private static _recount;
88
+ /** Hands every radio of one group its place, and whether the group is answered. */
89
+ private static _place;
64
90
  }
65
91
  export {};
66
92
  //# sourceMappingURL=radio-grouping.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-grouping.d.ts","sourceRoot":"","sources":["../../src/utilities/radio-grouping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AACtE,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzE;;;;;;;;;;;;GAYG;AAEH,2EAA2E;AAC3E,MAAM,WAAW,YAAa,SAAQ,WAAW;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,eAAe,IAAI,IAAI,CAAC;IACxB,+CAA+C;IAC/C,MAAM,IAAI,IAAI,CAAC;CACf;AAED,KAAK,SAAS,GAAG,YAAY,GAAG,sBAAsB,CAAC;AA0BvD,qBAAa,aAAc,YAAW,kBAAkB;IAe3C,OAAO,CAAC,IAAI;IAbxB,gFAAgF;IAChF,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAQ;IAEtC;;;;OAIG;IACH,QAAQ,UAAS;IAEjB,4EAA4E;IAC5E,OAAO,CAAC,UAAU,CAA8B;gBAE5B,IAAI,EAAE,SAAS;IAKnC,aAAa,IAAI,IAAI;IAKrB,gBAAgB,IAAI,IAAI;IAIxB,4EAA4E;IAC5E,OAAO,IAAI,IAAI;IAUf,wEAAwE;IACxE,OAAO,IAAI,IAAI;IAKf,4DAA4D;IAC5D,aAAa,IAAI,IAAI;IAYrB;;;;;OAKG;IACH,aAAa,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO;IAcxC,OAAO,CAAC,IAAI;IAKZ;;;oBAGgB;IAChB,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,MA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C,MAAM,CAAC,SAAS;IAIxB,0EAA0E;IAC1E,OAAO,CAAC,MAAM,CAAC,SAAS;IAcxB,8EAA8E;IAC9E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA6D;IAEpF,OAAO,CAAC,MAAM,CAAC,SAAS,CAWtB;IAEF,4EAA4E;IAC5E,OAAO,CAAC,MAAM,CAAC,OAAO,CAA2B;IAEjD,4DAA4D;IAC5D,OAAO,CAAC,MAAM,CAAC,MAAM,CAenB;IAEF,iFAAiF;IACjF,OAAO,CAAC,MAAM,CAAC,aAAa;IAW5B,qEAAqE;IACrE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAErB;IAEF,mFAAmF;IACnF,OAAO,CAAC,MAAM,CAAC,MAAM;CASrB"}
@@ -1,3 +1,4 @@
1
+ import { afterParse } from './after-parse.js';
1
2
  import { radioPositions } from './radio-position.js';
2
3
  /**
3
4
  * Both tags in one list, because the platform groups on the name and not on the
@@ -30,21 +31,29 @@ export class RadioGrouping {
30
31
  }
31
32
  hostConnected() {
32
33
  // A tick later, once the radios parsed after this one are there too.
33
- queueMicrotask(() => this.regroup());
34
+ queueMicrotask(() => this.regroup(true));
34
35
  }
35
36
  hostDisconnected() {
36
- this.regroup();
37
+ this.regroup(true);
37
38
  }
38
- /** Reads which group this radio is in now, and recounts the one it left. */
39
- regroup() {
39
+ /**
40
+ * Reads which group this radio is in now, and recounts the one it left.
41
+ *
42
+ * @param batched recount once for every radio that asks in the same tick,
43
+ * or after the parse while the page is still loading. A recount reads the
44
+ * whole tree, so a page of radios that each recount on connect is
45
+ * quadratic.
46
+ */
47
+ regroup(batched = false) {
40
48
  const was = this._groupedIn;
41
49
  const now = this._key();
42
50
  this._groupedIn = now;
43
51
  const moved = !now || !was || was.root !== now.root || was.name !== now.name || was.form !== now.form;
52
+ const recount = batched ? RadioGrouping._schedule : RadioGrouping._recount;
44
53
  if (was && moved)
45
- RadioGrouping._recount(was);
54
+ recount(was);
46
55
  if (now)
47
- RadioGrouping._recount(now);
56
+ recount(now);
48
57
  else
49
58
  this._apply(null, this.host.checked);
50
59
  }
@@ -55,11 +64,22 @@ export class RadioGrouping {
55
64
  else
56
65
  this._apply(null, this.host.checked);
57
66
  }
58
- /** Unchecks the others, as checking a native radio does. */
59
- uncheckOthers() {
67
+ /**
68
+ * Unchecks the others, as checking a native radio does.
69
+ *
70
+ * @param batched at the next recount, with the other radios that render for
71
+ * the first time: of the radios that come checked in the markup, the last
72
+ * one wins. Each of them walking its group on its own is quadratic.
73
+ */
74
+ uncheckOthers(batched = false) {
60
75
  const key = this._key();
61
76
  if (!key)
62
77
  return;
78
+ if (batched) {
79
+ RadioGrouping._claims.add(this.host);
80
+ RadioGrouping._schedule(key);
81
+ return;
82
+ }
63
83
  for (const radio of RadioGrouping._radiosIn(key)) {
64
84
  if (radio === this.host || !radio.checked)
65
85
  continue;
@@ -111,16 +131,38 @@ export class RadioGrouping {
111
131
  this.host.requestUpdate();
112
132
  }
113
133
  static _radiosIn({ root, name, form }) {
114
- const radios = root.querySelectorAll?.(RADIO_TAGS) ?? [];
115
- return Array.from(radios).filter((radio) => groupings.has(radio)
116
- && radio.isConnected
117
- && radio.name === name
118
- && isMember(radio)
119
- && radio.internals.form === form);
134
+ return RadioGrouping._groupsIn(root).get(name)?.get(form) ?? [];
120
135
  }
121
- /** A radio on its own keeps the place the browser gives it: none. */
122
- static _recount(key) {
123
- const radios = RadioGrouping._radiosIn(key);
136
+ /** Every grouped radio in a tree, by name and form, in document order. */
137
+ static _groupsIn(root) {
138
+ const groups = new Map();
139
+ for (const radio of root.querySelectorAll?.(RADIO_TAGS) ?? []) {
140
+ if (!groupings.has(radio) || !radio.isConnected || !isMember(radio))
141
+ continue;
142
+ const { name, internals } = radio;
143
+ const byForm = groups.get(name) ?? new Map();
144
+ groups.set(name, byForm);
145
+ const radios = byForm.get(internals.form) ?? [];
146
+ byForm.set(internals.form, radios);
147
+ radios.push(radio);
148
+ }
149
+ return groups;
150
+ }
151
+ /** The last radio that came checked keeps it; the others in its group do not. */
152
+ static _settleClaims(radios, claims) {
153
+ const members = new Set(radios);
154
+ const winner = claims.find((radio) => members.has(radio) && radio.checked);
155
+ if (!winner)
156
+ return;
157
+ for (const radio of radios) {
158
+ if (radio === winner || !radio.checked)
159
+ continue;
160
+ radio.checked = false;
161
+ radio.commitFormValue();
162
+ }
163
+ }
164
+ /** Hands every radio of one group its place, and whether the group is answered. */
165
+ static _place(radios) {
124
166
  const positions = radios.length > 1
125
167
  ? radioPositions(radios, (radio) => radio.checked, (radio) => radio.disabled)
126
168
  : [];
@@ -130,4 +172,43 @@ export class RadioGrouping {
130
172
  });
131
173
  }
132
174
  }
175
+ /** The groups to recount at the next flush: per tree, the names and forms. */
176
+ RadioGrouping._pending = new Map();
177
+ RadioGrouping._schedule = (key) => {
178
+ const pending = RadioGrouping._pending;
179
+ const scheduled = pending.size > 0;
180
+ const names = pending.get(key.root) ?? new Map();
181
+ pending.set(key.root, names);
182
+ const forms = names.get(key.name) ?? new Set();
183
+ names.set(key.name, forms);
184
+ forms.add(key.form);
185
+ if (scheduled)
186
+ return;
187
+ const doc = key.root.ownerDocument ?? key.root;
188
+ if (!afterParse(RadioGrouping._flush, doc))
189
+ queueMicrotask(RadioGrouping._flush);
190
+ };
191
+ /** Checked radios that render for the first time, in the order they did. */
192
+ RadioGrouping._claims = new Set();
193
+ /** Recounts every pending group, reading each tree once. */
194
+ RadioGrouping._flush = () => {
195
+ const pending = [...RadioGrouping._pending];
196
+ const claims = [...RadioGrouping._claims].reverse();
197
+ RadioGrouping._pending.clear();
198
+ RadioGrouping._claims.clear();
199
+ for (const [root, names] of pending) {
200
+ const groups = RadioGrouping._groupsIn(root);
201
+ for (const [name, forms] of names) {
202
+ for (const form of forms) {
203
+ const radios = groups.get(name)?.get(form) ?? [];
204
+ RadioGrouping._settleClaims(radios, claims);
205
+ RadioGrouping._place(radios);
206
+ }
207
+ }
208
+ }
209
+ };
210
+ /** A radio on its own keeps the place the browser gives it: none. */
211
+ RadioGrouping._recount = (key) => {
212
+ RadioGrouping._place(RadioGrouping._radiosIn(key));
213
+ };
133
214
  //# sourceMappingURL=radio-grouping.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-grouping.js","sourceRoot":"","sources":["../../src/utilities/radio-grouping.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAsB,MAAM,qBAAqB,CAAC;AAoCzE;;;;GAIG;AACH,MAAM,UAAU,GAAG,4CAA4C,CAAC;AAEhE,MAAM,WAAW,GAA2B,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;AAExG,yEAAyE;AACzE,MAAM,SAAS,GAAG,IAAI,OAAO,EAA0B,CAAC;AAExD,gFAAgF;AAChF,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,CAAE,KAA4C,CAAC,UAAU,CAAC;AAClE,CAAC;AAED,MAAM,OAAO,aAAa;IAezB,YAAoB,IAAe;QAAf,SAAI,GAAJ,IAAI,CAAW;QAbnC,gFAAgF;QAChF,aAAQ,GAAyB,IAAI,CAAC;QAEtC;;;;WAIG;QACH,aAAQ,GAAG,KAAK,CAAC;QAEjB,4EAA4E;QACpE,eAAU,GAAyB,IAAI,CAAC;QAG/C,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,aAAa;QACZ,qEAAqE;QACrE,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,gBAAgB;QACf,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IAED,4EAA4E;IAC5E,OAAO;QACN,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,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CAAC,AAfoB,CAenB;AAcF,qEAAqE;AACtD,sBAAQ,GAAG,CAAC,GAAkB,EAAQ,EAAE;IACtD,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,CAAC,AAFsB,CAErB"}
@@ -21,6 +21,17 @@ export interface ScrollModeProvider {
21
21
  registerScrollConsumer(consumer: ScrollModeConsumer): void;
22
22
  unregisterScrollConsumer(consumer: ScrollModeConsumer): void;
23
23
  }
24
+ /** A layer without a provider: it reads the mode it inherits from the CSS. */
25
+ export interface StandaloneScrollLayer extends ScrollModeConsumer {
26
+ /** The inherited `--context-scroll-mode`; a style read, no writes. */
27
+ inheritedScrollMode(): ScrollMode;
28
+ }
29
+ /**
30
+ * A layer without a provider reads its mode once it has connected, with the
31
+ * other layers that connect in the same tick, and again after a resize.
32
+ */
33
+ export declare function addStandaloneScrollLayer(layer: StandaloneScrollLayer, doc: Document): void;
34
+ export declare function removeStandaloneScrollLayer(layer: StandaloneScrollLayer): void;
24
35
  /** Nearest ancestor shell (light-DOM `closest`; slotted layers stay in the
25
36
  * consumer's light tree so this reaches across the slot boundaries), or null
26
37
  * when a layer is used stand-alone (e.g. a bare page in the docs).
@@ -64,11 +75,10 @@ export declare function whenScrollModeProviderDefined(host: Element, adopt: (pro
64
75
  * so a manual/media-query override still works. `nldd-page` keeps its own inline
65
76
  * logic because it also has to re-wire scroll listeners.
66
77
  */
67
- export declare class ScrollModeController implements ReactiveController, ScrollModeConsumer {
78
+ export declare class ScrollModeController implements ReactiveController, StandaloneScrollLayer {
68
79
  mode: ScrollMode;
69
80
  private _host;
70
81
  private _onChange?;
71
- private _raf;
72
82
  private _provider;
73
83
  constructor(host: ReactiveControllerHost & HTMLElement, onChange?: (mode: ScrollMode) => void);
74
84
  hostConnected(): void;
@@ -85,9 +95,6 @@ export declare class ScrollModeController implements ReactiveController, ScrollM
85
95
  * var is re-read instead.
86
96
  */
87
97
  readScrollMode(mode?: ScrollMode): void;
88
- private _readVar;
89
- private _onResize;
90
- /** Re-read the inherited `--context-scroll-mode` (used on connect + resize). */
91
- read(): void;
98
+ inheritedScrollMode(): ScrollMode;
92
99
  }
93
100
  //# sourceMappingURL=scroll-mode-controller.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-mode-controller.d.ts","sourceRoot":"","sources":["../../src/utilities/scroll-mode-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AAEtE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3C;;iDAEiD;AACjD,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AAEtE,MAAM,WAAW,wBAAwB;IACxC,YAAY,EAAE,OAAO,CAAC;CACtB;AAED,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IAClC;;;;OAIG;IACH,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CACxC;AAED,kFAAkF;AAClF,MAAM,WAAW,kBAAkB;IAClC,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC3D,wBAAwB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC7D;AAID;;;;;;;;;;wBAUwB;AACxB,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAG/E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,GAAG,IAAI,CAQhH;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,oBAAqB,YAAW,kBAAkB,EAAE,kBAAkB;IAClF,IAAI,EAAE,UAAU,CAAY;IAE5B,OAAO,CAAC,KAAK,CAAuC;IACpD,OAAO,CAAC,SAAS,CAAC,CAA6B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EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAI1F;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAM9E;AAED;;;;;;;;;;wBAUwB;AACxB,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAG/E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,GAAG,IAAI,CAQhH;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,oBAAqB,YAAW,kBAAkB,EAAE,qBAAqB;IACrF,IAAI,EAAE,UAAU,CAAY;IAE5B,OAAO,CAAC,KAAK,CAAuC;IACpD,OAAO,CAAC,SAAS,CAAC,CAA6B;IAC/C,OAAO,CAAC,SAAS,CAAmC;gBAExC,IAAI,EAAE,sBAAsB,GAAG,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI;IAM7F,aAAa,IAAI,IAAI;IAkBrB;iCAC6B;IAC7B,OAAO,CAAC,MAAM,CAKZ;IAEF,gBAAgB,IAAI,IAAI;IASxB;;;;;;;OAOG;IACH,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAQvC,mBAAmB,IAAI,UAAU;CAIjC"}
@@ -1,8 +1,50 @@
1
+ import { LayoutPass } from './layout-pass.js';
1
2
  /** Bubbling + composed event a horizontal split view fires when it collapses to
2
3
  * (or expands out of) a single visible column. nldd-shell listens for it to
3
4
  * derive the document-vs-nested scroll mode. */
4
5
  export const SINGLE_COLUMN_CHANGE_EVENT = 'nldd-single-column-change';
5
6
  const PROVIDER_SELECTOR = 'nldd-shell, nldd-sheet, nldd-modal-dialog';
7
+ /**
8
+ * Every stand-alone layer reads, then every one of them applies. A layer that
9
+ * reads after another one wrote its `data-scroll` recalculates the style of the
10
+ * page, once per layer.
11
+ */
12
+ function readAll(layers) {
13
+ const modes = layers.map((layer) => layer.inheritedScrollMode());
14
+ layers.forEach((layer, i) => layer.readScrollMode(modes[i]));
15
+ }
16
+ const firstReads = new LayoutPass(readAll);
17
+ const standalone = new Set();
18
+ let resizeFrame = 0;
19
+ /** One listener for all of them, read in one frame: the mode can flip at a
20
+ * media-query breakpoint. The frame reads every layer connected by then,
21
+ * also one that came after the resize. */
22
+ function onResize() {
23
+ if (resizeFrame)
24
+ return;
25
+ resizeFrame = requestAnimationFrame(() => {
26
+ resizeFrame = 0;
27
+ readAll([...standalone]);
28
+ });
29
+ }
30
+ /**
31
+ * A layer without a provider reads its mode once it has connected, with the
32
+ * other layers that connect in the same tick, and again after a resize.
33
+ */
34
+ export function addStandaloneScrollLayer(layer, doc) {
35
+ if (!standalone.size)
36
+ window.addEventListener('resize', onResize, { passive: true });
37
+ standalone.add(layer);
38
+ firstReads.schedule(layer, doc);
39
+ }
40
+ export function removeStandaloneScrollLayer(layer) {
41
+ firstReads.cancel(layer);
42
+ if (!standalone.delete(layer) || standalone.size)
43
+ return;
44
+ window.removeEventListener('resize', onResize);
45
+ cancelAnimationFrame(resizeFrame);
46
+ resizeFrame = 0;
47
+ }
6
48
  /** Nearest ancestor shell (light-DOM `closest`; slotted layers stay in the
7
49
  * consumer's light tree so this reaches across the slot boundaries), or null
8
50
  * when a layer is used stand-alone (e.g. a bare page in the docs).
@@ -63,25 +105,16 @@ export function whenScrollModeProviderDefined(host, adopt) {
63
105
  export class ScrollModeController {
64
106
  constructor(host, onChange) {
65
107
  this.mode = 'nested';
66
- this._raf = 0;
67
108
  this._provider = null;
68
109
  /** Switches from stand-alone to push once a provider that was not yet
69
110
  * defined at connect is. */
70
111
  this._adopt = (provider) => {
71
112
  if (this._provider)
72
113
  return;
73
- window.removeEventListener('resize', this._onResize);
114
+ removeStandaloneScrollLayer(this);
74
115
  this._provider = provider;
75
116
  provider.registerScrollConsumer(this);
76
117
  };
77
- this._onResize = () => {
78
- if (this._raf)
79
- return;
80
- this._raf = requestAnimationFrame(() => {
81
- this._raf = 0;
82
- this.read();
83
- });
84
- };
85
118
  this._host = host;
86
119
  this._onChange = onChange;
87
120
  host.addController(this);
@@ -100,8 +133,7 @@ export class ScrollModeController {
100
133
  // Stand-alone (no shell, e.g. docs): the mode comes from the
101
134
  // inherited var; re-read on resize since it can flip at a media-query
102
135
  // breakpoint.
103
- window.addEventListener('resize', this._onResize, { passive: true });
104
- this.read();
136
+ addStandaloneScrollLayer(this, this._host.ownerDocument);
105
137
  whenScrollModeProviderDefined(this._host, this._adopt);
106
138
  }
107
139
  }
@@ -111,10 +143,8 @@ export class ScrollModeController {
111
143
  this._provider = null;
112
144
  }
113
145
  else {
114
- window.removeEventListener('resize', this._onResize);
146
+ removeStandaloneScrollLayer(this);
115
147
  }
116
- if (this._raf)
117
- cancelAnimationFrame(this._raf);
118
148
  }
119
149
  /**
120
150
  * ScrollModeConsumer — nldd-shell pushes the mode it derived. When a mode is
@@ -125,20 +155,16 @@ export class ScrollModeController {
125
155
  * var is re-read instead.
126
156
  */
127
157
  readScrollMode(mode) {
128
- const next = mode ?? this._readVar();
158
+ const next = mode ?? this.inheritedScrollMode();
129
159
  if (next === this.mode)
130
160
  return;
131
161
  this.mode = next;
132
162
  this._host.dataset.scroll = next;
133
163
  this._onChange?.(next);
134
164
  }
135
- _readVar() {
165
+ inheritedScrollMode() {
136
166
  const raw = getComputedStyle(this._host).getPropertyValue('--context-scroll-mode').trim();
137
167
  return raw === 'root' ? 'root' : 'nested';
138
168
  }
139
- /** Re-read the inherited `--context-scroll-mode` (used on connect + resize). */
140
- read() {
141
- this.readScrollMode();
142
- }
143
169
  }
144
170
  //# sourceMappingURL=scroll-mode-controller.js.map