@swisspost/design-system-components 10.4.0 → 10.6.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.
- package/README.md +2 -2
- package/dist/cjs/breakpoints-Kruvy8Dm.js +47 -0
- package/dist/cjs/{create-validator-decorator-BtgLWaMJ.js → create-validator-decorator-Cy5yN6u9.js} +1 -1
- package/dist/cjs/{event-from-CwMw19f8.js → event-from-CTcQxB9-.js} +19 -13
- package/dist/cjs/{index-CW10QvjR.js → index-B3PXzvDk.js} +1 -1
- package/dist/cjs/{breakpoints-B0Olgvgc.js → index-CggFmZ8n.js} +0 -42
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{one-of-vJeW7S4_.js → one-of-CRFrfihj.js} +1 -1
- package/dist/cjs/{package-CL8OSAS4.js → package-pKyFPwiA.js} +1 -1
- package/dist/cjs/{pattern-Zmn3wpyp.js → pattern-D329DFcf.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +7 -7
- package/dist/cjs/post-autocomplete.cjs.entry.js +70 -55
- package/dist/cjs/post-avatar.cjs.entry.js +7 -7
- package/dist/cjs/post-back-to-top.cjs.entry.js +25 -13
- package/dist/cjs/post-banner.cjs.entry.js +6 -13
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +42 -12
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +222 -71
- package/dist/cjs/post-closebutton_14.cjs.entry.js +431 -233
- package/dist/cjs/post-collapsible_2.cjs.entry.js +9 -9
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +18 -16
- package/dist/cjs/post-footer.cjs.entry.js +8 -8
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/post-listbox-option.cjs.entry.js +4 -4
- package/dist/cjs/post-listbox.cjs.entry.js +6 -6
- package/dist/cjs/post-number-input.cjs.entry.js +7 -6
- package/dist/cjs/post-pagination.cjs.entry.js +6 -6
- package/dist/cjs/post-popover-trigger.cjs.entry.js +8 -8
- package/dist/cjs/post-popover.cjs.entry.js +11 -11
- package/dist/cjs/post-progressbar.cjs.entry.js +5 -5
- package/dist/cjs/post-rating.cjs.entry.js +7 -7
- package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +8 -8
- package/dist/cjs/post-side-navigation.cjs.entry.js +9 -9
- package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/post-stepper.cjs.entry.js +8 -8
- package/dist/cjs/post-tab-item.cjs.entry.js +7 -7
- package/dist/cjs/post-tab-panel.cjs.entry.js +7 -7
- package/dist/cjs/post-tabs.cjs.entry.js +9 -9
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +8 -8
- package/dist/cjs/post-tooltip.cjs.entry.js +6 -6
- package/dist/cjs/{required-DRnPokVn.js → required-DhAEd0c7.js} +1 -1
- package/dist/cjs/{type-CNcU_-B2.js → type-2Ma9dvHs.js} +1 -1
- package/dist/cjs/{url-DgJ3lXQz.js → url-DePscsTj.js} +1 -1
- package/dist/collection/components/post-autocomplete/post-autocomplete.js +65 -50
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +19 -7
- package/dist/collection/components/post-banner/post-banner.js +2 -17
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +59 -4
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +249 -71
- package/dist/collection/components/post-closebutton/post-closebutton.js +7 -8
- package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +2 -2
- package/dist/collection/components/post-date-picker/native-mask-element.js +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.js +11 -9
- package/dist/collection/components/post-footer/post-footer.js +2 -2
- package/dist/collection/components/post-header/post-header.js +2 -2
- package/dist/collection/components/post-icon/post-icon.js +1 -1
- package/dist/collection/components/post-language-menu/post-language-menu.js +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-listbox/post-listbox.js +2 -2
- package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
- package/dist/collection/components/post-logo/post-logo.js +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +3 -3
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.js +23 -8
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- package/dist/collection/components/post-number-input/post-number-input.js +2 -2
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +4 -4
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +3 -3
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +71 -43
- package/dist/collection/components/post-progressbar/post-progressbar.js +1 -1
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-side-navigation/post-side-navigation.css +1 -1
- package/dist/collection/components/post-side-navigation/post-side-navigation.js +1 -1
- package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.js +1 -1
- package/dist/collection/components/post-stepper/post-stepper.js +1 -1
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.js +2 -2
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +2 -2
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +2 -2
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +2 -2
- package/dist/collection/utils/breakpoints.js +11 -9
- package/dist/collection/utils/closable-target.js +38 -0
- package/dist/collection/utils/event-from.js +18 -13
- package/dist/collection/utils/floating-ui.js +72 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/components/breakpoints.js +1 -1
- package/dist/components/event-from.js +1 -1
- package/dist/components/index2.js +1 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-autocomplete.js +1 -1
- package/dist/components/post-back-to-top.js +1 -1
- package/dist/components/post-banner.js +1 -1
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumbs.js +1 -1
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +1 -1
- package/dist/components/post-collapsible2.js +1 -1
- package/dist/components/post-date-picker.js +1 -1
- package/dist/components/post-footer.js +1 -1
- package/dist/components/post-header.js +1 -1
- package/dist/components/post-icon2.js +1 -1
- package/dist/components/post-linkarea.js +1 -1
- package/dist/components/post-listbox-option.js +1 -1
- package/dist/components/post-listbox.js +1 -1
- package/dist/components/post-logo.js +1 -1
- package/dist/components/post-mainnavigation.js +1 -1
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +1 -1
- package/dist/components/post-menu-item2.js +1 -1
- package/dist/components/post-menu-trigger2.js +1 -1
- package/dist/components/post-menu2.js +1 -1
- package/dist/components/post-number-input.js +1 -1
- package/dist/components/post-popover-trigger.js +1 -1
- package/dist/components/post-popover.js +1 -1
- package/dist/components/post-popovercontainer2.js +1 -1
- package/dist/components/post-progressbar.js +1 -1
- package/dist/components/post-rating.js +1 -1
- package/dist/components/post-side-navigation-trigger.js +1 -1
- package/dist/components/post-side-navigation.js +1 -1
- package/dist/components/post-stepper-item.js +1 -1
- package/dist/components/post-stepper.js +1 -1
- package/dist/components/post-tab-item.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-togglebutton2.js +1 -1
- package/dist/components/post-tooltip-trigger.js +1 -1
- package/dist/components/post-tooltip.js +1 -1
- package/dist/components/react/index.js +1 -1
- package/dist/components/react/{p-Bwko4UKh.js → p-3RU9XwVO.js} +1 -1
- package/dist/components/react/p-5LuCes5o.js +1 -0
- package/dist/components/react/p-B1TcktiB.js +1 -0
- package/dist/components/react/{p-4wtxqxXu.js → p-B2jsM_Ov.js} +1 -1
- package/dist/components/react/p-BEcxHjuM.js +1 -0
- package/dist/components/react/p-BN2dfUQ0.js +1 -0
- package/dist/components/react/p-BPUhha1U.js +1 -0
- package/dist/{post-components/p-C-lLRsYC.js → components/react/p-BdLRXQqY.js} +1 -1
- package/dist/components/react/{p-BSb74xQy.js → p-Bnb_TyDh.js} +1 -1
- package/dist/components/react/p-CVVXnYLU.js +1 -0
- package/dist/components/react/{p-9RCG8BWM.js → p-CcDLIogT.js} +1 -1
- package/dist/components/react/{p-CSmrQ__L.js → p-CdggfEzz.js} +1 -1
- package/dist/components/react/p-CnN4Jdtv.js +1 -0
- package/dist/components/react/{p-D-imniYA.js → p-CzsG0uCA.js} +1 -1
- package/dist/components/react/p-DeO0rZ1T.js +1 -0
- package/dist/components/react/p-DffT6evQ.js +1 -0
- package/dist/components/react/p-T8T3po4z.js +1 -0
- package/dist/components/react/p-WXzzOdnl.js +1 -0
- package/dist/components/react/p-bR8vy6-s.js +1 -0
- package/dist/components/react/{p-B1kYo1K9.js → p-m1-sOx5T.js} +1 -1
- package/dist/components/react/post-accordion-item.js +1 -1
- package/dist/components/react/post-accordion.js +1 -1
- package/dist/components/react/post-autocomplete.js +1 -1
- package/dist/components/react/post-avatar.js +1 -1
- package/dist/components/react/post-back-to-top.js +1 -1
- package/dist/components/react/post-banner.js +1 -1
- package/dist/components/react/post-breadcrumb-item.js +1 -1
- package/dist/components/react/post-breadcrumbs.js +1 -1
- package/dist/components/react/post-closebutton.js +1 -1
- package/dist/components/react/post-collapsible-trigger.js +1 -1
- package/dist/components/react/post-collapsible.js +1 -1
- package/dist/components/react/post-date-picker.js +1 -1
- package/dist/components/react/post-footer.js +1 -1
- package/dist/components/react/post-header.js +1 -1
- package/dist/components/react/post-icon.js +1 -1
- package/dist/components/react/post-language-menu-item.js +1 -1
- package/dist/components/react/post-language-menu.js +1 -1
- package/dist/components/react/post-linkarea.js +1 -1
- package/dist/components/react/post-listbox-option.js +1 -1
- package/dist/components/react/post-listbox.js +1 -1
- package/dist/components/react/post-logo.js +1 -1
- package/dist/components/react/post-mainnavigation.js +1 -1
- package/dist/components/react/post-megadropdown-trigger.js +1 -1
- package/dist/components/react/post-megadropdown.js +1 -1
- package/dist/components/react/post-menu-item.js +1 -1
- package/dist/components/react/post-menu-trigger.js +1 -1
- package/dist/components/react/post-menu.js +1 -1
- package/dist/components/react/post-number-input.js +1 -1
- package/dist/components/react/post-pagination.js +1 -1
- package/dist/components/react/post-popover-trigger.js +1 -1
- package/dist/components/react/post-popover.js +1 -1
- package/dist/components/react/post-popovercontainer.js +1 -1
- package/dist/components/react/post-progressbar.js +1 -1
- package/dist/components/react/post-rating.js +1 -1
- package/dist/components/react/post-side-navigation-trigger.js +1 -1
- package/dist/components/react/post-side-navigation.js +1 -1
- package/dist/components/react/post-stepper-item.js +1 -1
- package/dist/components/react/post-stepper.js +1 -1
- package/dist/components/react/post-tab-item.js +1 -1
- package/dist/components/react/post-tab-panel.js +1 -1
- package/dist/components/react/post-tabs.js +1 -1
- package/dist/components/react/post-togglebutton.js +1 -1
- package/dist/components/react/post-tooltip-trigger.js +1 -1
- package/dist/components/react/post-tooltip.js +1 -1
- package/dist/docs.json +118 -27
- package/dist/esm/breakpoints-I1j7a0bW.js +45 -0
- package/dist/esm/{create-validator-decorator-CNUaQboh.js → create-validator-decorator-C2XlYkNB.js} +1 -1
- package/dist/esm/{event-from-rEfV4v4a.js → event-from-BEcxHjuM.js} +19 -14
- package/dist/esm/{index-sn7oKSwC.js → index-BjziJWh2.js} +1 -1
- package/dist/esm/{breakpoints-BQ3HlJPr.js → index-bR8vy6-s.js} +1 -42
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{one-of-C6Ironyj.js → one-of-Do1iao-k.js} +1 -1
- package/dist/esm/{package-tTf1w3A9.js → package-T8T3po4z.js} +1 -1
- package/dist/esm/{pattern-57oD--q3.js → pattern-BZDucOTq.js} +1 -1
- package/dist/esm/post-accordion_2.entry.js +7 -7
- package/dist/esm/post-autocomplete.entry.js +70 -55
- package/dist/esm/post-avatar.entry.js +7 -7
- package/dist/esm/post-back-to-top.entry.js +25 -13
- package/dist/esm/post-banner.entry.js +6 -13
- package/dist/esm/post-breadcrumb-item.entry.js +42 -12
- package/dist/esm/post-breadcrumbs.entry.js +222 -71
- package/dist/esm/post-closebutton_14.entry.js +430 -232
- package/dist/esm/post-collapsible_2.entry.js +9 -9
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +18 -16
- package/dist/esm/post-footer.entry.js +8 -8
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/post-listbox-option.entry.js +4 -4
- package/dist/esm/post-listbox.entry.js +6 -6
- package/dist/esm/post-number-input.entry.js +6 -5
- package/dist/esm/post-pagination.entry.js +6 -6
- package/dist/esm/post-popover-trigger.entry.js +8 -8
- package/dist/esm/post-popover.entry.js +11 -11
- package/dist/esm/post-progressbar.entry.js +5 -5
- package/dist/esm/post-rating.entry.js +7 -7
- package/dist/esm/post-side-navigation-trigger.entry.js +8 -8
- package/dist/esm/post-side-navigation.entry.js +9 -9
- package/dist/esm/post-stepper-item.entry.js +3 -3
- package/dist/esm/post-stepper.entry.js +8 -8
- package/dist/esm/post-tab-item.entry.js +7 -7
- package/dist/esm/post-tab-panel.entry.js +7 -7
- package/dist/esm/post-tabs.entry.js +9 -9
- package/dist/esm/post-tooltip-trigger.entry.js +8 -8
- package/dist/esm/post-tooltip.entry.js +6 -6
- package/dist/esm/{required-D2rl2XZJ.js → required-B0X7uy13.js} +1 -1
- package/dist/esm/{type-CGynDrfh.js → type-CF1dOg6D.js} +1 -1
- package/dist/esm/{url-1wyUfUv-.js → url-BL7d6iWZ.js} +1 -1
- package/dist/post-components/{p-167191e5.entry.js → p-0e922531.entry.js} +1 -1
- package/dist/post-components/{p-cf6eacab.entry.js → p-1ec27142.entry.js} +1 -1
- package/dist/post-components/{p-da217dbc.entry.js → p-2005eb98.entry.js} +1 -1
- package/dist/post-components/p-2cff5b3a.entry.js +1 -0
- package/dist/post-components/p-53bd2128.entry.js +1 -0
- package/dist/post-components/{p-212c71e4.entry.js → p-59b30e90.entry.js} +1 -1
- package/dist/post-components/{p-beed9922.entry.js → p-60550edb.entry.js} +1 -1
- package/dist/post-components/p-655ded00.entry.js +1 -0
- package/dist/post-components/p-76cc3c9a.entry.js +1 -0
- package/dist/post-components/{p-3149d866.entry.js → p-8012cc3b.entry.js} +1 -1
- package/dist/post-components/p-819c93de.entry.js +1 -0
- package/dist/post-components/p-840acd3c.entry.js +1 -0
- package/dist/post-components/p-87b1034f.entry.js +1 -0
- package/dist/post-components/p-88f754e9.entry.js +1 -0
- package/dist/post-components/p-9S_5_Zh8.js +1 -0
- package/dist/post-components/p-BEcxHjuM.js +1 -0
- package/dist/post-components/p-BYfu3J2D.js +1 -0
- package/dist/post-components/p-BjziJWh2.js +2 -0
- package/dist/post-components/p-BoYe-VVx.js +1 -0
- package/dist/post-components/p-CbbADNiv.js +1 -0
- package/dist/post-components/p-DgnQe03V.js +1 -0
- package/dist/post-components/p-DlKbBdcP.js +1 -0
- package/dist/post-components/p-I1j7a0bW.js +1 -0
- package/dist/post-components/p-T8T3po4z.js +1 -0
- package/dist/post-components/{p-a01ea634.entry.js → p-a32d3050.entry.js} +1 -1
- package/dist/post-components/p-b4229624.entry.js +1 -0
- package/dist/post-components/{p-96bf6b01.entry.js → p-b9faa76b.entry.js} +1 -1
- package/dist/post-components/p-bR8vy6-s.js +1 -0
- package/dist/post-components/{p-70fbe469.entry.js → p-ba1b4ba0.entry.js} +1 -1
- package/dist/post-components/p-c0ae13b7.entry.js +1 -0
- package/dist/post-components/p-c9dcdebb.entry.js +1 -0
- package/dist/post-components/p-ccf8020b.entry.js +1 -0
- package/dist/post-components/p-cd68d3a2.entry.js +1 -0
- package/dist/post-components/p-cdc7b8d3.entry.js +1 -0
- package/dist/post-components/{p-1cf5bc67.entry.js → p-d7c9a969.entry.js} +1 -1
- package/dist/post-components/p-db11f781.entry.js +1 -0
- package/dist/post-components/{p-0323b0f3.entry.js → p-dc285087.entry.js} +1 -1
- package/dist/post-components/{p-e8d9723e.entry.js → p-de6f1816.entry.js} +1 -1
- package/dist/post-components/p-dec8bd99.entry.js +1 -0
- package/dist/post-components/p-f9a8ee94.entry.js +1 -0
- package/dist/post-components/post-components.css +2 -2
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-autocomplete/post-autocomplete.d.ts +18 -6
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +2 -1
- package/dist/types/components/post-banner/post-banner.d.ts +0 -1
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +12 -1
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +54 -14
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +1 -1
- package/dist/types/components/post-menu/post-menu.d.ts +1 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +8 -5
- package/dist/types/components.d.ts +38 -7
- package/dist/types/utils/breakpoints.d.ts +1 -0
- package/dist/types/utils/closable-target.d.ts +5 -0
- package/dist/types/utils/event-from.d.ts +8 -0
- package/dist/types/utils/floating-ui.d.ts +12 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/hydrate/index.js +1085 -665
- package/hydrate/index.mjs +1085 -665
- package/package.json +31 -22
- package/dist/components/react/p-BXqGI600.js +0 -1
- package/dist/components/react/p-B_WnO-QF.js +0 -1
- package/dist/components/react/p-BaB8wJvk.js +0 -1
- package/dist/components/react/p-Bji_4dfL.js +0 -1
- package/dist/components/react/p-CX2E_IXB.js +0 -1
- package/dist/components/react/p-CwmQwirr.js +0 -1
- package/dist/components/react/p-D17tCsFk.js +0 -1
- package/dist/components/react/p-DD1c_IgL.js +0 -1
- package/dist/components/react/p-Df31eVdi.js +0 -1
- package/dist/components/react/p-I0dqoE80.js +0 -1
- package/dist/components/react/p-rEfV4v4a.js +0 -1
- package/dist/components/react/p-tTf1w3A9.js +0 -1
- package/dist/post-components/p-06ddd73b.entry.js +0 -1
- package/dist/post-components/p-090e52db.entry.js +0 -1
- package/dist/post-components/p-292a9784.entry.js +0 -1
- package/dist/post-components/p-2de6fe62.entry.js +0 -1
- package/dist/post-components/p-39ff8127.entry.js +0 -1
- package/dist/post-components/p-3a968b19.entry.js +0 -1
- package/dist/post-components/p-472_tiaS.js +0 -1
- package/dist/post-components/p-58422de1.entry.js +0 -1
- package/dist/post-components/p-5873a90c.entry.js +0 -1
- package/dist/post-components/p-986fa1c1.entry.js +0 -1
- package/dist/post-components/p-BQ3HlJPr.js +0 -1
- package/dist/post-components/p-B_FOhVrp.js +0 -1
- package/dist/post-components/p-CeNqFJV7.js +0 -1
- package/dist/post-components/p-DYDdaLz-.js +0 -1
- package/dist/post-components/p-DoNhJ2D7.js +0 -1
- package/dist/post-components/p-b1d2384a.entry.js +0 -1
- package/dist/post-components/p-b535fc10.entry.js +0 -1
- package/dist/post-components/p-b99e6621.entry.js +0 -1
- package/dist/post-components/p-bf83a3fb.entry.js +0 -1
- package/dist/post-components/p-c46bc56f.entry.js +0 -1
- package/dist/post-components/p-ce8132a9.entry.js +0 -1
- package/dist/post-components/p-d72e830b.entry.js +0 -1
- package/dist/post-components/p-e08d26f4.entry.js +0 -1
- package/dist/post-components/p-rEfV4v4a.js +0 -1
- package/dist/post-components/p-sn7oKSwC.js +0 -2
- package/dist/post-components/p-tTf1w3A9.js +0 -1
|
@@ -1,22 +1,61 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var breakpoints = require('./breakpoints-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var index = require('./index-B3PXzvDk.js');
|
|
4
|
+
var breakpoints = require('./breakpoints-Kruvy8Dm.js');
|
|
5
|
+
var eventFrom = require('./event-from-CTcQxB9-.js');
|
|
6
|
+
var _package = require('./package-pKyFPwiA.js');
|
|
7
|
+
var oneOf = require('./one-of-CRFrfihj.js');
|
|
8
|
+
var required = require('./required-DhAEd0c7.js');
|
|
8
9
|
var fade = require('./fade-CPQhl1fP.js');
|
|
9
|
-
var eventFrom = require('./event-from-CwMw19f8.js');
|
|
10
10
|
var getFocusableChildren = require('./get-focusable-children-BGVgg7Te.js');
|
|
11
|
-
var
|
|
11
|
+
var index$1 = require('./index-CggFmZ8n.js');
|
|
12
|
+
var type = require('./type-2Ma9dvHs.js');
|
|
12
13
|
var nanoid = require('./nanoid-CmjyF1Cm.js');
|
|
13
|
-
var pattern = require('./pattern-
|
|
14
|
-
var url = require('./url-
|
|
14
|
+
var pattern = require('./pattern-D329DFcf.js');
|
|
15
|
+
var url = require('./url-DePscsTj.js');
|
|
15
16
|
var utils = require('./utils-s05L2ulk.js');
|
|
16
17
|
var fadeSlide = require('./fade-slide-dPhQa-I1.js');
|
|
17
18
|
var placement = require('./placement-qEFR9hmI.js');
|
|
18
19
|
var getRoot = require('./get-root-B1FnQ50K.js');
|
|
19
|
-
require('./create-validator-decorator-
|
|
20
|
+
require('./create-validator-decorator-Cy5yN6u9.js');
|
|
21
|
+
|
|
22
|
+
const CLOSABLE_TARGETS = [
|
|
23
|
+
{
|
|
24
|
+
predicate: el => el.localName === 'post-banner',
|
|
25
|
+
close: el => void el.dismiss(),
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
predicate: el => el.localName === 'post-popover',
|
|
29
|
+
close: el => void el.hide(),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
predicate: el => el.localName === 'post-popovercontainer',
|
|
33
|
+
close: el => void el.hide(),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
predicate: el => el.localName === 'post-collapsible',
|
|
37
|
+
close: el => void el.toggle(false),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
predicate: el => el.localName === 'post-accordion-item',
|
|
41
|
+
close: el => void el.toggle(false),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
predicate: el => el.localName === 'dialog',
|
|
45
|
+
close: el => el.close(),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
predicate: el => el.hasAttribute('popover'),
|
|
49
|
+
close: el => el.togglePopover(false),
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
function findClosableTarget(start) {
|
|
53
|
+
const el = eventFrom.findClosestAcrossShadow(start, (el) => CLOSABLE_TARGETS.some(t => t.predicate(el)));
|
|
54
|
+
if (!el)
|
|
55
|
+
return null;
|
|
56
|
+
const match = CLOSABLE_TARGETS.find(t => t.predicate(el));
|
|
57
|
+
return { element: el, close: () => match.close(el) };
|
|
58
|
+
}
|
|
20
59
|
|
|
21
60
|
const BUTTON_TYPES = ['button', 'reset'];
|
|
22
61
|
const PLACEMENT = ['manual', 'auto'];
|
|
@@ -46,7 +85,7 @@ const PostClosebutton = class {
|
|
|
46
85
|
}
|
|
47
86
|
/**
|
|
48
87
|
* The "type" attribute used for the close button
|
|
49
|
-
|
|
88
|
+
|
|
50
89
|
*/
|
|
51
90
|
this.buttonType = 'button';
|
|
52
91
|
/**
|
|
@@ -57,6 +96,10 @@ const PostClosebutton = class {
|
|
|
57
96
|
* The size of the close button.
|
|
58
97
|
*/
|
|
59
98
|
this.size = 'default';
|
|
99
|
+
this.handleClick = () => {
|
|
100
|
+
const target = findClosableTarget(this.host);
|
|
101
|
+
target?.close();
|
|
102
|
+
};
|
|
60
103
|
}
|
|
61
104
|
componentDidLoad() {
|
|
62
105
|
if (globalThis.MutationObserver) {
|
|
@@ -81,13 +124,8 @@ const PostClosebutton = class {
|
|
|
81
124
|
console.error(`The \`${this.host.localName}\` component requires content for accessibility.`);
|
|
82
125
|
}
|
|
83
126
|
}
|
|
84
|
-
handleClick() {
|
|
85
|
-
if (this.buttonType === 'reset')
|
|
86
|
-
this.internals.form?.reset();
|
|
87
|
-
this.host.closest('dialog')?.close();
|
|
88
|
-
}
|
|
89
127
|
render() {
|
|
90
|
-
return (index.h(index.Host, { key: '
|
|
128
|
+
return (index.h(index.Host, { key: 'b8e2214b904f5167fa3753aab947418891236fcf', "data-version": _package.version }, index.h("button", { key: '224ca42d3be187062ba9717e4a534ff34eeafaf7', type: this.buttonType, class: "btn btn-icon btn-secondary btn-sm", onClick: this.handleClick }, index.h("post-icon", { key: '5b289691599d6f9a3bb0fa7a28c71eecd1f5aee7', "aria-hidden": "true", name: "closex" }), index.h("span", { key: 'e22045f15b3dc8b8b228eb4282114e10db68b186', ref: el => (this.visuallyHidden = el), class: "visually-hidden" }, index.h("slot", { key: 'e492390c995a993ffc8988a1c90a41e59fbe39f5' })))));
|
|
91
129
|
}
|
|
92
130
|
static get formAssociated() { return true; }
|
|
93
131
|
get host() { return index.getElement(this); }
|
|
@@ -176,7 +214,7 @@ const PostHeader = class {
|
|
|
176
214
|
}
|
|
177
215
|
constructor(hostRef) {
|
|
178
216
|
index.registerInstance(this, hostRef);
|
|
179
|
-
this.throttledResize =
|
|
217
|
+
this.throttledResize = index$1.throttle(50, () => this.updateLocalHeaderHeight());
|
|
180
218
|
this.animationOptions = {
|
|
181
219
|
duration: 350,
|
|
182
220
|
easing: 'headerEase',
|
|
@@ -434,10 +472,10 @@ const PostHeader = class {
|
|
|
434
472
|
render() {
|
|
435
473
|
const onDesktop = this.device === 'desktop';
|
|
436
474
|
const onTabletAndMobile = this.device !== 'desktop';
|
|
437
|
-
return (index.h(index.Host, { key: '
|
|
475
|
+
return (index.h(index.Host, { key: 'd288ef2e58942c2cbc5da673076548c97eef04ed', "data-version": _package.version, "data-color-scheme": "light", "data-burger-menu": this.hasBurgerMenu, "data-menu-extended": this.burgerMenuExtended }, index.h("header", { key: '5357f3edf382dec9b552fdfe9fb51d0878de697c' }, index.h("div", { key: 'bafa11390b33056e5a3d1a8a2922fd3a43a25020', class: "global-header" }, index.h("div", { key: '2d54e8d2931864880ff7a28aea64625e775ce327', class: "section" }, index.h("div", { key: 'b3a87bbf3b87213e22043d58a7298d0cff530cdf', class: "logo" }, index.h("slot", { key: '9d559b9231dc23841e277d3f4633cdeba2da12b2', name: "post-logo" })), index.h("div", { key: '64ebd463868ce8b417023651e745e33331feb908', class: "sliding-controls" }, onDesktop && (index.h("div", { key: 'b4e7d7231a0d8bebe620d41cb655c3686449b19f', class: "audience" }, index.h("slot", { key: '0781a76b1853a842dc74ec2a2a649f7de487e148', name: "audience" }))), index.h("slot", { key: '25f1d5b34a5aa950014214f810f3acca95dbbe80', name: "global-nav-primary" }), (onDesktop || !this.hasMainNav) && [
|
|
438
476
|
index.h("slot", { key: "global-nav-secondary", name: "global-nav-secondary" }),
|
|
439
477
|
index.h("slot", { key: "language-menu", name: "language-menu" }),
|
|
440
|
-
], index.h("slot", { key: '
|
|
478
|
+
], index.h("slot", { key: 'd7121e5e9ddf825f96a3a82e65ff135c61891adb', name: "post-login" }), onTabletAndMobile && this.hasMainNav && (index.h("post-togglebutton", { key: 'dd0bcf9cfd96d4ffa44fc549d518d7b39d287156', class: "burger-button", ref: el => (this.burgerMenuButton = el), onClick: () => this.toggleBurgerMenu() }, index.h("span", { key: '23004cb12733a7081f828d33327cc26adafe3888' }, this.textMenu), index.h("post-icon", { key: '7fb36892eadfcce0a85d964c411aeafc3fbbde1b', "aria-hidden": "true", name: "burger", "data-showwhen": "untoggled" }), index.h("post-icon", { key: 'a41292205573c03f25d225d4f4296f75ffe6c7ce', "aria-hidden": "true", name: "closex", "data-showwhen": "toggled" })))))), index.h("div", { key: '7d6d1424881bb5277210c86b194dfb9e5dcb7c59', ref: el => (this.localHeader = el), class: { 'local-header': true, 'megadropdown-open': this.megadropdownOpen } }, index.h("div", { key: '724a8d3f79112875ba343470f9d0b753ce5d4861', class: "section" }, index.h("slot", { key: '688aafdec4e4d5565f3d0a9d9bd9bb7bc78152be', name: "side-nav" }), index.h("slot", { key: '12590bfb4bfcc8c565f008a8e3d75b5951eb73bc', name: "title" }), this.hasTitle && index.h("slot", { key: 'd862de0f3aaba5ea22a26c387ea7e93dc0c5e79c', name: "local-nav" }), onDesktop && index.h("slot", { key: '1a25ec6694bc8b2c06e21449dc566f36595afbb5', name: "main-nav" }), onDesktop && !this.hasTitle && index.h("slot", { key: '987c26ee73fb19049fdd19de79b537b71e2771de', name: "local-nav" }))), this.hasBurgerMenu && this.renderBurgerMenu())));
|
|
441
479
|
}
|
|
442
480
|
get host() { return index.getElement(this); }
|
|
443
481
|
static get watchers() { return {
|
|
@@ -567,7 +605,7 @@ const PostIcon = class {
|
|
|
567
605
|
}).filter(([_key, value]) => value !== null));
|
|
568
606
|
}
|
|
569
607
|
render() {
|
|
570
|
-
return (index.h(index.Host, { key: '
|
|
608
|
+
return (index.h(index.Host, { key: '405ccfde4206c14f044575d0b23998d93a03ffb6', "data-version": _package.version }, index.h("span", { key: 'ad70ccf63add4b881ef6096ae460e13fba09f508', style: this.getStyles() })));
|
|
571
609
|
}
|
|
572
610
|
get host() { return index.getElement(this); }
|
|
573
611
|
};
|
|
@@ -632,7 +670,7 @@ const PostLanguageMenu = class {
|
|
|
632
670
|
}
|
|
633
671
|
componentDidLoad() {
|
|
634
672
|
// Initially set variants and active language
|
|
635
|
-
// Handles cases where the language-menu is rendered after the language-
|
|
673
|
+
// Handles cases where the language-menu is rendered after the language-menu-items have been rendered
|
|
636
674
|
this.updateChildrenVariant();
|
|
637
675
|
}
|
|
638
676
|
/**
|
|
@@ -800,7 +838,7 @@ const PostLogo = class {
|
|
|
800
838
|
render() {
|
|
801
839
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
802
840
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
803
|
-
return (index.h(index.Host, { key: '
|
|
841
|
+
return (index.h(index.Host, { key: '1f69b0ddc0ecf2fde47423cd7824fcbe76e4a529', "data-version": _package.version }, index.h(LogoTag, { key: '096736bd50a6dd43e02a104e7e81897cb286db60', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, index.h("span", { key: 'bc49b9591424f02744f771eb1079911f02ceca33', class: "description" }, index.h("slot", { key: 'ea905eac805e2a9940bfe50aa222bef738d15d27', onSlotchange: () => this.checkDescription() })), index.h("svg", { key: '482d94c38347017269dabd0ab3d15f4ede14f187', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, index.h("g", { key: 'fcd3dc56e8a0e448abe65b557639a8bea8ca580f', id: "Logo" }, index.h("rect", { key: '11ed7bad596ee07301f1c1101ddded089ef2bf99', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), index.h("polygon", { key: '6ab9d28c8492c746a2620cff62dbd92a59a00aff', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), index.h("path", { key: '8b96cee7ee8ad1ec3c22aaf7928f7a711c05c828', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
|
|
804
842
|
}
|
|
805
843
|
get host() { return index.getElement(this); }
|
|
806
844
|
};
|
|
@@ -940,7 +978,7 @@ const PostMainnavigation = class {
|
|
|
940
978
|
}, NAVBAR_DISABLE_DURATION);
|
|
941
979
|
}
|
|
942
980
|
render() {
|
|
943
|
-
return (index.h(index.Host, { key: '
|
|
981
|
+
return (index.h(index.Host, { key: 'cf7b2328a41b41ca28956120b8042590655e7bb2', version: _package.version, class: this.canScroll ? 'scrollable' : '' }, index.h("div", { key: 'a25c55cf7b11a11ce86fb134dd57dbdad3d30301', "aria-hidden": "true", class: { 'scroll-control scroll-left': true, 'd-none': !this.canScrollLeft }, onMouseDown: e => this.handleScrollButtonClick(e, 'left') }, index.h("post-icon", { key: '013778591637d5ee0ac2cd2bf3f23c677ba2a13f', "aria-hidden": "true", name: "chevronleft" })), index.h("nav", { key: 'a007b7be57429580de35865e5eff0c54378d0a8e', ref: el => (this.navbar = el), "aria-label": this.textMain }, index.h("slot", { key: 'bc8e1db18430ee43b5963539fbaa65e1fb1b0c55' })), index.h("div", { key: 'cdb413fedc9a90c712db0fe5d6ab760a426ff632', "aria-hidden": "true", class: { 'scroll-control scroll-right': true, 'd-none': !this.canScrollRight }, onMouseDown: e => this.handleScrollButtonClick(e, 'right') }, index.h("post-icon", { key: 'b2df569a79881b3a044556ba9c0f2e2b0646e78b', "aria-hidden": "true", name: "chevronright" }))));
|
|
944
982
|
}
|
|
945
983
|
get host() { return index.getElement(this); }
|
|
946
984
|
};
|
|
@@ -963,6 +1001,8 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
963
1001
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
964
1002
|
};
|
|
965
1003
|
const PostMegadropdown = class {
|
|
1004
|
+
/** Tracks the currently active dropdown instance. */
|
|
1005
|
+
static { this.activeDropdown = null; }
|
|
966
1006
|
get megadropdownTrigger() {
|
|
967
1007
|
const hostId = this.host.getAttribute('id');
|
|
968
1008
|
return hostId ? document.querySelector(`post-megadropdown-trigger[for="${hostId}"]`) : null;
|
|
@@ -1244,12 +1284,10 @@ const PostMegadropdown = class {
|
|
|
1244
1284
|
}
|
|
1245
1285
|
render() {
|
|
1246
1286
|
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
1247
|
-
return (index.h(index.Host, { key: '
|
|
1287
|
+
return (index.h(index.Host, { key: 'c0854fff62bf5e8de1597e46051aea5f300ee686', version: _package.version }, index.h("div", { key: '1f4f66b74d7129481d76f1eec15a924b2c37718c', ref: el => (this.animatedContainer = el), class: "megadropdown", style: containerStyle }, index.h("div", { key: 'af743442fe3ad6211cddccddf5d0803de9f501b5', class: "section" }, this.device !== 'desktop' && this.megadropdownTitle && (index.h("p", { key: '35a03b2ee32498aa157140d4e6916cbf66655e5c', class: "megadropdown-title" }, this.megadropdownTitle)), index.h("div", { key: '6c4efb52e7bb04c4f40d5b3f739ca69771c48602', class: "megadropdown-content" }, index.h("slot", { key: '2b3200495cf23fe049734de9de9a5a1f4c9b09f3' })), this.device === 'desktop' ? (index.h("post-closebutton", { onClick: () => this.hide(true), class: "close-button", size: "small", placement: "manual" }, this.textClose)) : (index.h("button", { onClick: () => this.hide(true), class: "back-button" }, index.h("post-icon", { name: "arrowleft" }), this.textBack))))));
|
|
1248
1288
|
}
|
|
1249
1289
|
get host() { return index.getElement(this); }
|
|
1250
1290
|
};
|
|
1251
|
-
/** Tracks the currently active dropdown instance. */
|
|
1252
|
-
PostMegadropdown.activeDropdown = null;
|
|
1253
1291
|
__decorate$4([
|
|
1254
1292
|
required.Required(),
|
|
1255
1293
|
type.Type('string')
|
|
@@ -1331,7 +1369,7 @@ const PostMegadropdownTrigger = class {
|
|
|
1331
1369
|
this.megadropdown.toggle();
|
|
1332
1370
|
}
|
|
1333
1371
|
render() {
|
|
1334
|
-
return (index.h(index.Host, { key: '
|
|
1372
|
+
return (index.h(index.Host, { key: '7e6201e3cdea96113bbebdeeb805acff557c8bbb', "data-version": _package.version }, index.h("button", { key: '1863f48dbd6e98b7a2b226b7c3b25b16a38c644b', ref: el => (this.interactiveButton = el), type: "button", "aria-haspopup": "menu", "aria-expanded": this.isMegadropdownExpanded.toString(), onClick: this.onClick.bind(this), onKeyDown: this.onKeyDown.bind(this), class: { active: this.active } }, index.h("span", { key: 'dee7e77e45914a3e40a9f5027570bef0035dfdf2' }, index.h("span", { key: '362865f7946f14f45ecdb240e81f09370e3f6d10', innerHTML: this.slottedContent }), index.h("span", { key: 'd61eb63433aa65631f787646df2c6705c3d6e7a1', "aria-hidden": "true" }, index.h("slot", { key: 'c831f7299fe3c80b8229c861e01e09a2ee481bc8' }))), index.h("post-icon", { key: 'bcc8ed53293e16d4571e989a491760f98425b298', name: "chevrondown" }))));
|
|
1335
1373
|
}
|
|
1336
1374
|
get host() { return index.getElement(this); }
|
|
1337
1375
|
};
|
|
@@ -1462,17 +1500,32 @@ const PostMenu = class {
|
|
|
1462
1500
|
this.toggleMenu.emit(this.isVisible);
|
|
1463
1501
|
if (this.isVisible) {
|
|
1464
1502
|
this.lastFocusedElement = this.root?.activeElement;
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1503
|
+
// Only focus the first item if the trigger was keyboard-focus-visible
|
|
1504
|
+
// that's the browser's own signal for a keyboard-driven interaction.
|
|
1505
|
+
if (this.wasFocusVisible(this.lastFocusedElement)) {
|
|
1506
|
+
requestAnimationFrame(() => {
|
|
1507
|
+
const menuItems = this.getSlottedItems();
|
|
1508
|
+
if (menuItems.length > 0) {
|
|
1509
|
+
menuItems[0].focus();
|
|
1510
|
+
}
|
|
1511
|
+
});
|
|
1512
|
+
}
|
|
1471
1513
|
}
|
|
1472
1514
|
else if (this.lastFocusedElement) {
|
|
1473
1515
|
this.lastFocusedElement.focus();
|
|
1474
1516
|
}
|
|
1475
1517
|
}
|
|
1518
|
+
wasFocusVisible(element) {
|
|
1519
|
+
if (!element)
|
|
1520
|
+
return false;
|
|
1521
|
+
try {
|
|
1522
|
+
return element.matches(':focus-visible');
|
|
1523
|
+
}
|
|
1524
|
+
catch {
|
|
1525
|
+
// Not supported, fall back to always focusing
|
|
1526
|
+
return true;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1476
1529
|
controlKeyDownHandler(e) {
|
|
1477
1530
|
const menuItems = this.getSlottedItems();
|
|
1478
1531
|
if (menuItems.length === 0) {
|
|
@@ -1524,7 +1577,7 @@ const PostMenu = class {
|
|
|
1524
1577
|
]));
|
|
1525
1578
|
}
|
|
1526
1579
|
render() {
|
|
1527
|
-
return (index.h(index.Host, { key: '
|
|
1580
|
+
return (index.h(index.Host, { key: '22441c2bef0402f10e77b96b8a5d48a0648615f7', "data-version": _package.version }, index.h("post-popovercontainer", { key: '8b37fe55d58a3a486e947266348b55408999a8bb', onPostShow: this.handlePostShown.bind(this), onPostBeforeToggle: this.handlePostBeforeToggle.bind(this), placement: this.placement, ref: e => (this.popoverRef = e) }, index.h("div", { key: '2679eb9c4a95585b8aaf74e29f026c84b10aa6f3', part: "post-menu" }, index.h("slot", { key: '0da58a1bde1bdb4c1f8b7b19ca8cbde14d7946fc', name: "header" }), index.h("slot", { key: '801f7bc59d4d3267728b9adf0750dbea76a7652c' })))));
|
|
1528
1581
|
}
|
|
1529
1582
|
get host() { return index.getElement(this); }
|
|
1530
1583
|
};
|
|
@@ -1543,7 +1596,7 @@ __decorate$2([
|
|
|
1543
1596
|
], PostMenu.prototype, "handlePostBeforeToggle", null);
|
|
1544
1597
|
PostMenu.style = postMenuCss();
|
|
1545
1598
|
|
|
1546
|
-
const postMenuItemCss = () => `post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;width:100%}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item
|
|
1599
|
+
const postMenuItemCss = () => `post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;width:100%}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item button,post-menu-item a{position:relative;display:flex;align-items:center;padding:8px 12px 8px 16px;gap:12px;font-size:.875rem;color:#050400;border-radius:0;text-decoration:none}@media screen and (min-width: 780px){post-menu-item button,post-menu-item a{font-size:1rem;padding-block:12px;gap:16px}}@media screen and (min-width: 1024px){post-menu-item button,post-menu-item a{font-size:1.25rem;padding-block:13px}}post-menu-item button:focus-visible,post-menu-item a:focus-visible{outline-offset:2px !important;border-radius:4px}post-menu-item button:hover,post-menu-item a:hover{background-color:#504f4b;color:#fff}post-menu-item button post-icon,post-menu-item a post-icon{width:16px;height:16px;margin-block:4px}@media screen and (min-width: 780px){post-menu-item button post-icon,post-menu-item a post-icon{width:24px;height:24px;margin:0}}`;
|
|
1547
1600
|
|
|
1548
1601
|
const PostMenuItem = class {
|
|
1549
1602
|
constructor(hostRef) {
|
|
@@ -1623,7 +1676,7 @@ const PostMenuTrigger = class {
|
|
|
1623
1676
|
return null;
|
|
1624
1677
|
}
|
|
1625
1678
|
render() {
|
|
1626
|
-
return (index.h(index.Host, { key: '
|
|
1679
|
+
return (index.h(index.Host, { key: 'f75522d28e9a45c80846a191cff3ea2eb51b5bde', "data-version": _package.version }, index.h("slot", { key: 'bc70e3ddc8dc372611c00a4cda52cd35ede02a3f' })));
|
|
1627
1680
|
}
|
|
1628
1681
|
get host() { return index.getElement(this); }
|
|
1629
1682
|
};
|
|
@@ -1638,6 +1691,7 @@ PostMenuTrigger.style = postMenuTriggerCss();
|
|
|
1638
1691
|
* @see https://floating-ui.com/docs/virtual-elements
|
|
1639
1692
|
*/
|
|
1640
1693
|
|
|
1694
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
1641
1695
|
const min = Math.min;
|
|
1642
1696
|
const max = Math.max;
|
|
1643
1697
|
const round = Math.round;
|
|
@@ -1730,12 +1784,12 @@ function getOppositePlacement(placement) {
|
|
|
1730
1784
|
return oppositeSideMap[side] + placement.slice(side.length);
|
|
1731
1785
|
}
|
|
1732
1786
|
function expandPaddingObject(padding) {
|
|
1787
|
+
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
|
1733
1788
|
return {
|
|
1734
|
-
top: 0,
|
|
1735
|
-
right: 0,
|
|
1736
|
-
bottom: 0,
|
|
1737
|
-
left: 0
|
|
1738
|
-
...padding
|
|
1789
|
+
top: (_padding$top = padding.top) != null ? _padding$top : 0,
|
|
1790
|
+
right: (_padding$right = padding.right) != null ? _padding$right : 0,
|
|
1791
|
+
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
|
|
1792
|
+
left: (_padding$left = padding.left) != null ? _padding$left : 0
|
|
1739
1793
|
};
|
|
1740
1794
|
}
|
|
1741
1795
|
function getPaddingObject(padding) {
|
|
@@ -1810,13 +1864,9 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
1810
1864
|
y: reference.y
|
|
1811
1865
|
};
|
|
1812
1866
|
}
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
break;
|
|
1817
|
-
case 'end':
|
|
1818
|
-
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
1819
|
-
break;
|
|
1867
|
+
const alignment = getAlignment(placement);
|
|
1868
|
+
if (alignment) {
|
|
1869
|
+
coords[alignmentAxis] += commonAlign * (alignment === 'end' ? 1 : -1) * (rtl && isVertical ? -1 : 1);
|
|
1820
1870
|
}
|
|
1821
1871
|
return coords;
|
|
1822
1872
|
}
|
|
@@ -1865,10 +1915,7 @@ async function detectOverflow(state, options) {
|
|
|
1865
1915
|
height: rects.floating.height
|
|
1866
1916
|
} : rects.reference;
|
|
1867
1917
|
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
1868
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)))
|
|
1869
|
-
x: 1,
|
|
1870
|
-
y: 1
|
|
1871
|
-
} : {
|
|
1918
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) && (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
1872
1919
|
x: 1,
|
|
1873
1920
|
y: 1
|
|
1874
1921
|
};
|
|
@@ -2041,17 +2088,16 @@ const arrow$1 = options => ({
|
|
|
2041
2088
|
|
|
2042
2089
|
// Make sure the arrow doesn't overflow the floating element if the center
|
|
2043
2090
|
// point is outside the floating element's bounds.
|
|
2044
|
-
const min$1 = minPadding;
|
|
2045
2091
|
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
2046
2092
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
2047
|
-
const offset = clamp(
|
|
2093
|
+
const offset = clamp(minPadding, center, max);
|
|
2048
2094
|
|
|
2049
2095
|
// If the reference is small enough that the arrow's padding causes it to
|
|
2050
2096
|
// to point to nothing for an aligned placement, adjust the offset of the
|
|
2051
2097
|
// floating element itself. To ensure `shift()` continues to take action,
|
|
2052
2098
|
// a single reset is performed when this is true.
|
|
2053
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center <
|
|
2054
|
-
const alignmentOffset = shouldAddOffset ? center <
|
|
2099
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
2100
|
+
const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;
|
|
2055
2101
|
return {
|
|
2056
2102
|
[axis]: coords[axis] + alignmentOffset,
|
|
2057
2103
|
data: {
|
|
@@ -2198,6 +2244,76 @@ const flip$1 = function (options) {
|
|
|
2198
2244
|
};
|
|
2199
2245
|
};
|
|
2200
2246
|
|
|
2247
|
+
function getSideOffsets(overflow, rect) {
|
|
2248
|
+
return {
|
|
2249
|
+
top: overflow.top - rect.height,
|
|
2250
|
+
right: overflow.right - rect.width,
|
|
2251
|
+
bottom: overflow.bottom - rect.height,
|
|
2252
|
+
left: overflow.left - rect.width
|
|
2253
|
+
};
|
|
2254
|
+
}
|
|
2255
|
+
function isAnySideFullyClipped(overflow) {
|
|
2256
|
+
return sides.some(side => overflow[side] >= 0);
|
|
2257
|
+
}
|
|
2258
|
+
/**
|
|
2259
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
2260
|
+
* when it is not in the same clipping context as the reference element.
|
|
2261
|
+
* @see https://floating-ui.com/docs/hide
|
|
2262
|
+
*/
|
|
2263
|
+
const hide$1 = function (options) {
|
|
2264
|
+
if (options === void 0) {
|
|
2265
|
+
options = {};
|
|
2266
|
+
}
|
|
2267
|
+
return {
|
|
2268
|
+
name: 'hide',
|
|
2269
|
+
options,
|
|
2270
|
+
async fn(state) {
|
|
2271
|
+
const {
|
|
2272
|
+
rects,
|
|
2273
|
+
platform
|
|
2274
|
+
} = state;
|
|
2275
|
+
const {
|
|
2276
|
+
strategy = 'referenceHidden',
|
|
2277
|
+
...detectOverflowOptions
|
|
2278
|
+
} = evaluate(options, state);
|
|
2279
|
+
switch (strategy) {
|
|
2280
|
+
case 'referenceHidden':
|
|
2281
|
+
{
|
|
2282
|
+
const overflow = await platform.detectOverflow(state, {
|
|
2283
|
+
...detectOverflowOptions,
|
|
2284
|
+
elementContext: 'reference'
|
|
2285
|
+
});
|
|
2286
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
2287
|
+
return {
|
|
2288
|
+
data: {
|
|
2289
|
+
referenceHiddenOffsets: offsets,
|
|
2290
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
2291
|
+
}
|
|
2292
|
+
};
|
|
2293
|
+
}
|
|
2294
|
+
case 'escaped':
|
|
2295
|
+
{
|
|
2296
|
+
const overflow = await platform.detectOverflow(state, {
|
|
2297
|
+
...detectOverflowOptions,
|
|
2298
|
+
altBoundary: true
|
|
2299
|
+
});
|
|
2300
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
2301
|
+
return {
|
|
2302
|
+
data: {
|
|
2303
|
+
escapedOffsets: offsets,
|
|
2304
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
2305
|
+
}
|
|
2306
|
+
};
|
|
2307
|
+
}
|
|
2308
|
+
default:
|
|
2309
|
+
{
|
|
2310
|
+
return {};
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
};
|
|
2315
|
+
};
|
|
2316
|
+
|
|
2201
2317
|
function getBoundingRect(rects) {
|
|
2202
2318
|
const minX = min(...rects.map(rect => rect.left));
|
|
2203
2319
|
const minY = min(...rects.map(rect => rect.top));
|
|
@@ -2254,12 +2370,19 @@ const inline$1 = function (options) {
|
|
|
2254
2370
|
y
|
|
2255
2371
|
} = evaluate(options, state);
|
|
2256
2372
|
const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
|
|
2373
|
+
|
|
2374
|
+
// No rects (e.g. a hidden or detached reference, or a collapsed range) —
|
|
2375
|
+
// keep the existing reference rect rather than resetting to an invalid
|
|
2376
|
+
// one with non-finite values.
|
|
2377
|
+
if (!nativeClientRects.length) {
|
|
2378
|
+
return {};
|
|
2379
|
+
}
|
|
2257
2380
|
const clientRects = getRectsByLine(nativeClientRects);
|
|
2258
2381
|
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
|
|
2259
2382
|
const paddingObject = getPaddingObject(padding);
|
|
2260
2383
|
function getBoundingClientRect() {
|
|
2261
2384
|
// There are two rects and they are disjoined.
|
|
2262
|
-
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
2385
|
+
if (clientRects.length === 2 && (clientRects[0].left > clientRects[1].right || clientRects[1].left > clientRects[0].right) && x != null && y != null) {
|
|
2263
2386
|
// Find the first rect in which the point is fully inside.
|
|
2264
2387
|
return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
|
2265
2388
|
}
|
|
@@ -2274,18 +2397,12 @@ const inline$1 = function (options) {
|
|
|
2274
2397
|
const bottom = lastRect.bottom;
|
|
2275
2398
|
const left = isTop ? firstRect.left : lastRect.left;
|
|
2276
2399
|
const right = isTop ? firstRect.right : lastRect.right;
|
|
2277
|
-
|
|
2278
|
-
const height = bottom - top;
|
|
2279
|
-
return {
|
|
2280
|
-
top,
|
|
2281
|
-
bottom,
|
|
2282
|
-
left,
|
|
2283
|
-
right,
|
|
2284
|
-
width,
|
|
2285
|
-
height,
|
|
2400
|
+
return rectToClientRect({
|
|
2286
2401
|
x: left,
|
|
2287
|
-
y: top
|
|
2288
|
-
|
|
2402
|
+
y: top,
|
|
2403
|
+
width: right - left,
|
|
2404
|
+
height: bottom - top
|
|
2405
|
+
});
|
|
2289
2406
|
}
|
|
2290
2407
|
const isLeftSide = getSide(placement) === 'left';
|
|
2291
2408
|
const maxRight = max(...clientRects.map(rect => rect.right));
|
|
@@ -2293,20 +2410,12 @@ const inline$1 = function (options) {
|
|
|
2293
2410
|
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
2294
2411
|
const top = measureRects[0].top;
|
|
2295
2412
|
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
bottom,
|
|
2303
|
-
left,
|
|
2304
|
-
right,
|
|
2305
|
-
width,
|
|
2306
|
-
height,
|
|
2307
|
-
x: left,
|
|
2308
|
-
y: top
|
|
2309
|
-
};
|
|
2413
|
+
return rectToClientRect({
|
|
2414
|
+
x: minLeft,
|
|
2415
|
+
y: top,
|
|
2416
|
+
width: maxRight - minLeft,
|
|
2417
|
+
height: bottom - top
|
|
2418
|
+
});
|
|
2310
2419
|
}
|
|
2311
2420
|
return fallback;
|
|
2312
2421
|
}
|
|
@@ -2456,23 +2565,16 @@ const shift$1 = function (options) {
|
|
|
2456
2565
|
y
|
|
2457
2566
|
};
|
|
2458
2567
|
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
2459
|
-
const crossAxis = getSideAxis(
|
|
2568
|
+
const crossAxis = getSideAxis(placement);
|
|
2460
2569
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
2461
2570
|
let mainAxisCoord = coords[mainAxis];
|
|
2462
2571
|
let crossAxisCoord = coords[crossAxis];
|
|
2572
|
+
const clampCoord = (axis, coord) => clamp(coord + overflow[axis === 'y' ? 'top' : 'left'], coord, coord - overflow[axis === 'y' ? 'bottom' : 'right']);
|
|
2463
2573
|
if (checkMainAxis) {
|
|
2464
|
-
|
|
2465
|
-
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
2466
|
-
const min = mainAxisCoord + overflow[minSide];
|
|
2467
|
-
const max = mainAxisCoord - overflow[maxSide];
|
|
2468
|
-
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
2574
|
+
mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
|
|
2469
2575
|
}
|
|
2470
2576
|
if (checkCrossAxis) {
|
|
2471
|
-
|
|
2472
|
-
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
2473
|
-
const min = crossAxisCoord + overflow[minSide];
|
|
2474
|
-
const max = crossAxisCoord - overflow[maxSide];
|
|
2475
|
-
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
2577
|
+
crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
|
|
2476
2578
|
}
|
|
2477
2579
|
const limitedCoords = limiter.fn({
|
|
2478
2580
|
...state,
|
|
@@ -2503,6 +2605,7 @@ const limitShift$1 = function (options) {
|
|
|
2503
2605
|
return {
|
|
2504
2606
|
options,
|
|
2505
2607
|
fn(state) {
|
|
2608
|
+
var _rawOffset$mainAxis, _rawOffset$crossAxis;
|
|
2506
2609
|
const {
|
|
2507
2610
|
x,
|
|
2508
2611
|
y,
|
|
@@ -2528,9 +2631,8 @@ const limitShift$1 = function (options) {
|
|
|
2528
2631
|
mainAxis: rawOffset,
|
|
2529
2632
|
crossAxis: 0
|
|
2530
2633
|
} : {
|
|
2531
|
-
mainAxis: 0,
|
|
2532
|
-
crossAxis: 0
|
|
2533
|
-
...rawOffset
|
|
2634
|
+
mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
|
|
2635
|
+
crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
|
|
2534
2636
|
};
|
|
2535
2637
|
if (checkMainAxis) {
|
|
2536
2638
|
const len = mainAxis === 'y' ? 'height' : 'width';
|
|
@@ -2562,6 +2664,12 @@ const limitShift$1 = function (options) {
|
|
|
2562
2664
|
};
|
|
2563
2665
|
};
|
|
2564
2666
|
|
|
2667
|
+
// Method syntax keeps callback parameters bivariant, but expressing the
|
|
2668
|
+
// explicit `| undefined` required by `exactOptionalPropertyTypes` needs
|
|
2669
|
+
// property syntax, which is contravariant under `strictFunctionTypes`.
|
|
2670
|
+
// Extracting the function from a method position restores that bivariance so
|
|
2671
|
+
// consumers can still assign callbacks with narrower parameter types.
|
|
2672
|
+
|
|
2565
2673
|
/**
|
|
2566
2674
|
* Provides data that allows you to change the size of the floating element —
|
|
2567
2675
|
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
@@ -2576,7 +2684,6 @@ const size$1 = function (options) {
|
|
|
2576
2684
|
name: 'size',
|
|
2577
2685
|
options,
|
|
2578
2686
|
async fn(state) {
|
|
2579
|
-
var _state$middlewareData, _state$middlewareData2;
|
|
2580
2687
|
const {
|
|
2581
2688
|
placement,
|
|
2582
2689
|
rects,
|
|
@@ -2608,24 +2715,21 @@ const size$1 = function (options) {
|
|
|
2608
2715
|
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
2609
2716
|
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
2610
2717
|
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
2611
|
-
const
|
|
2718
|
+
const shiftData = state.middlewareData.shift;
|
|
2719
|
+
const noShift = !shiftData;
|
|
2612
2720
|
let availableHeight = overflowAvailableHeight;
|
|
2613
2721
|
let availableWidth = overflowAvailableWidth;
|
|
2614
|
-
if (
|
|
2722
|
+
if (shiftData != null && shiftData.enabled.x) {
|
|
2615
2723
|
availableWidth = maximumClippingWidth;
|
|
2616
2724
|
}
|
|
2617
|
-
if (
|
|
2725
|
+
if (shiftData != null && shiftData.enabled.y) {
|
|
2618
2726
|
availableHeight = maximumClippingHeight;
|
|
2619
2727
|
}
|
|
2620
2728
|
if (noShift && !alignment) {
|
|
2621
|
-
const xMin = max(overflow.left, 0);
|
|
2622
|
-
const xMax = max(overflow.right, 0);
|
|
2623
|
-
const yMin = max(overflow.top, 0);
|
|
2624
|
-
const yMax = max(overflow.bottom, 0);
|
|
2625
2729
|
if (isYAxis) {
|
|
2626
|
-
availableWidth = width - 2 *
|
|
2730
|
+
availableWidth = width - 2 * max(overflow.left, overflow.right);
|
|
2627
2731
|
} else {
|
|
2628
|
-
availableHeight = height - 2 *
|
|
2732
|
+
availableHeight = height - 2 * max(overflow.top, overflow.bottom);
|
|
2629
2733
|
}
|
|
2630
2734
|
}
|
|
2631
2735
|
await apply({
|
|
@@ -2781,7 +2885,7 @@ function getParentNode(node) {
|
|
|
2781
2885
|
function getNearestOverflowAncestor(node) {
|
|
2782
2886
|
const parentNode = getParentNode(node);
|
|
2783
2887
|
if (isLastTraversableNode(parentNode)) {
|
|
2784
|
-
return node.ownerDocument
|
|
2888
|
+
return (node.ownerDocument || node).body;
|
|
2785
2889
|
}
|
|
2786
2890
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
2787
2891
|
return parentNode;
|
|
@@ -2878,10 +2982,7 @@ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
|
2878
2982
|
if (isFixed === void 0) {
|
|
2879
2983
|
isFixed = false;
|
|
2880
2984
|
}
|
|
2881
|
-
|
|
2882
|
-
return false;
|
|
2883
|
-
}
|
|
2884
|
-
return isFixed;
|
|
2985
|
+
return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
|
|
2885
2986
|
}
|
|
2886
2987
|
|
|
2887
2988
|
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
@@ -2908,12 +3009,12 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
2908
3009
|
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
2909
3010
|
let width = clientRect.width / scale.x;
|
|
2910
3011
|
let height = clientRect.height / scale.y;
|
|
2911
|
-
if (domElement) {
|
|
3012
|
+
if (domElement && offsetParent) {
|
|
2912
3013
|
const win = getWindow(domElement);
|
|
2913
|
-
const offsetWin =
|
|
3014
|
+
const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
2914
3015
|
let currentWin = win;
|
|
2915
3016
|
let currentIFrame = getFrameElement(currentWin);
|
|
2916
|
-
while (currentIFrame &&
|
|
3017
|
+
while (currentIFrame && offsetWin !== currentWin) {
|
|
2917
3018
|
const iframeScale = getScale(currentIFrame);
|
|
2918
3019
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
2919
3020
|
const css = getComputedStyle$1(currentIFrame);
|
|
@@ -2977,7 +3078,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
2977
3078
|
let scale = createCoords(1);
|
|
2978
3079
|
const offsets = createCoords(0);
|
|
2979
3080
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
2980
|
-
if (isOffsetParentAnElement || !
|
|
3081
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
2981
3082
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
2982
3083
|
scroll = getNodeScroll(offsetParent);
|
|
2983
3084
|
}
|
|
@@ -2998,18 +3099,17 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
2998
3099
|
}
|
|
2999
3100
|
|
|
3000
3101
|
function getClientRects(element) {
|
|
3001
|
-
return Array.from(element.getClientRects());
|
|
3102
|
+
return element.getClientRects ? Array.from(element.getClientRects()) : [];
|
|
3002
3103
|
}
|
|
3003
3104
|
|
|
3004
3105
|
// Gets the entire size of the scrollable document area, even extending outside
|
|
3005
3106
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
3006
|
-
function getDocumentRect(
|
|
3007
|
-
const
|
|
3008
|
-
const
|
|
3009
|
-
const body = element.ownerDocument.body;
|
|
3107
|
+
function getDocumentRect(html) {
|
|
3108
|
+
const scroll = getNodeScroll(html);
|
|
3109
|
+
const body = html.ownerDocument.body;
|
|
3010
3110
|
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
3011
3111
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
3012
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(
|
|
3112
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(html);
|
|
3013
3113
|
const y = -scroll.scrollTop;
|
|
3014
3114
|
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
3015
3115
|
x += max(html.clientWidth, body.clientWidth) - width;
|
|
@@ -3026,7 +3126,11 @@ function getDocumentRect(element) {
|
|
|
3026
3126
|
// calculation is affected by unusual styles.
|
|
3027
3127
|
// Most scrollbars leave 15-18px of space.
|
|
3028
3128
|
const SCROLLBAR_MAX = 25;
|
|
3029
|
-
function getViewportRect(element, strategy) {
|
|
3129
|
+
function getViewportRect(element, strategy, rootBoundary) {
|
|
3130
|
+
if (rootBoundary === void 0) {
|
|
3131
|
+
rootBoundary = 'viewport';
|
|
3132
|
+
}
|
|
3133
|
+
const isLayoutViewport = rootBoundary === 'layoutViewport';
|
|
3030
3134
|
const win = getWindow(element);
|
|
3031
3135
|
const html = getDocumentElement(element);
|
|
3032
3136
|
const visualViewport = win.visualViewport;
|
|
@@ -3035,31 +3139,42 @@ function getViewportRect(element, strategy) {
|
|
|
3035
3139
|
let x = 0;
|
|
3036
3140
|
let y = 0;
|
|
3037
3141
|
if (visualViewport) {
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3142
|
+
// Client coordinates are relative to the layout viewport, except in
|
|
3143
|
+
// WebKit with an `absolute` strategy, where they are relative to the
|
|
3144
|
+
// visual viewport.
|
|
3145
|
+
const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed';
|
|
3146
|
+
if (isLayoutViewport) {
|
|
3147
|
+
if (!layoutRelativeClientCoords) {
|
|
3148
|
+
x = -visualViewport.offsetLeft;
|
|
3149
|
+
y = -visualViewport.offsetTop;
|
|
3150
|
+
}
|
|
3151
|
+
} else {
|
|
3152
|
+
width = visualViewport.width;
|
|
3153
|
+
height = visualViewport.height;
|
|
3154
|
+
if (layoutRelativeClientCoords) {
|
|
3155
|
+
x = visualViewport.offsetLeft;
|
|
3156
|
+
y = visualViewport.offsetTop;
|
|
3157
|
+
}
|
|
3044
3158
|
}
|
|
3045
3159
|
}
|
|
3046
3160
|
const windowScrollbarX = getWindowScrollBarX(html);
|
|
3047
|
-
//
|
|
3048
|
-
// visual width
|
|
3049
|
-
//
|
|
3161
|
+
// `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks
|
|
3162
|
+
// the visual width but isn't reflected in `html.clientWidth`, so subtract it.
|
|
3163
|
+
// Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also
|
|
3164
|
+
// reserves an empty inline-start gutter that clips nothing, so exclude just
|
|
3165
|
+
// the one scrollbar-side gutter — halve the measured (two-gutter) total. A
|
|
3166
|
+
// left-side scrollbar (`windowScrollbarX > 0`) is already handled by
|
|
3167
|
+
// `getHTMLOffset`/`visualViewport.width`; skip it here.
|
|
3050
3168
|
if (windowScrollbarX <= 0) {
|
|
3051
3169
|
const doc = html.ownerDocument;
|
|
3052
3170
|
const body = doc.body;
|
|
3053
3171
|
const bodyStyles = getComputedStyle(body);
|
|
3054
3172
|
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
3055
|
-
const
|
|
3056
|
-
|
|
3057
|
-
|
|
3173
|
+
const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
3174
|
+
const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth;
|
|
3175
|
+
if (gutter <= SCROLLBAR_MAX) {
|
|
3176
|
+
width -= gutter;
|
|
3058
3177
|
}
|
|
3059
|
-
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
3060
|
-
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
3061
|
-
// by the scrollbar amount so there isn't extra space on the right.
|
|
3062
|
-
width += windowScrollbarX;
|
|
3063
3178
|
}
|
|
3064
3179
|
return {
|
|
3065
3180
|
width,
|
|
@@ -3074,7 +3189,7 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
3074
3189
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
3075
3190
|
const top = clientRect.top + element.clientTop;
|
|
3076
3191
|
const left = clientRect.left + element.clientLeft;
|
|
3077
|
-
const scale =
|
|
3192
|
+
const scale = getScale(element);
|
|
3078
3193
|
const width = element.clientWidth * scale.x;
|
|
3079
3194
|
const height = element.clientHeight * scale.y;
|
|
3080
3195
|
const x = left * scale.x;
|
|
@@ -3088,8 +3203,8 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
3088
3203
|
}
|
|
3089
3204
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
3090
3205
|
let rect;
|
|
3091
|
-
if (clippingAncestor === 'viewport') {
|
|
3092
|
-
rect = getViewportRect(element, strategy);
|
|
3206
|
+
if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {
|
|
3207
|
+
rect = getViewportRect(element, strategy, clippingAncestor);
|
|
3093
3208
|
} else if (clippingAncestor === 'document') {
|
|
3094
3209
|
rect = getDocumentRect(getDocumentElement(element));
|
|
3095
3210
|
} else if (isElement(clippingAncestor)) {
|
|
@@ -3105,13 +3220,6 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
3105
3220
|
}
|
|
3106
3221
|
return rectToClientRect(rect);
|
|
3107
3222
|
}
|
|
3108
|
-
function hasFixedPositionAncestor(element, stopNode) {
|
|
3109
|
-
const parentNode = getParentNode(element);
|
|
3110
|
-
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
3111
|
-
return false;
|
|
3112
|
-
}
|
|
3113
|
-
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
3114
|
-
}
|
|
3115
3223
|
|
|
3116
3224
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
3117
3225
|
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
@@ -3122,7 +3230,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
3122
3230
|
return cachedResult;
|
|
3123
3231
|
}
|
|
3124
3232
|
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
3125
|
-
let
|
|
3233
|
+
let lastKeptComputedStyle = null;
|
|
3126
3234
|
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
3127
3235
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
3128
3236
|
|
|
@@ -3130,16 +3238,20 @@ function getClippingElementAncestors(element, cache) {
|
|
|
3130
3238
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
3131
3239
|
const computedStyle = getComputedStyle$1(currentNode);
|
|
3132
3240
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3241
|
+
// Position of the containing block chain below the current node. A fixed
|
|
3242
|
+
// element whose containing block hasn't been found yet is a fixed chain.
|
|
3243
|
+
const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : '';
|
|
3244
|
+
|
|
3245
|
+
// A non-containing ancestor does not clip the element when the chain
|
|
3246
|
+
// below it escapes it: a fixed chain escapes all ancestors up to the
|
|
3247
|
+
// next containing block, an absolute chain escapes static ancestors.
|
|
3248
|
+
const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static');
|
|
3137
3249
|
if (shouldDropCurrentNode) {
|
|
3138
3250
|
// Drop non-containing blocks.
|
|
3139
3251
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
3140
3252
|
} else {
|
|
3141
|
-
//
|
|
3142
|
-
|
|
3253
|
+
// The kept node carries the chain position for the next iteration.
|
|
3254
|
+
lastKeptComputedStyle = computedStyle;
|
|
3143
3255
|
}
|
|
3144
3256
|
currentNode = getParentNode(currentNode);
|
|
3145
3257
|
}
|
|
@@ -3149,7 +3261,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
3149
3261
|
|
|
3150
3262
|
// Gets the maximum area that the element is visible in due to any number of
|
|
3151
3263
|
// clipping ancestors.
|
|
3152
|
-
function getClippingRect(_ref) {
|
|
3264
|
+
function getClippingRect$1(_ref) {
|
|
3153
3265
|
let {
|
|
3154
3266
|
element,
|
|
3155
3267
|
boundary,
|
|
@@ -3199,13 +3311,7 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
3199
3311
|
scrollTop: 0
|
|
3200
3312
|
};
|
|
3201
3313
|
const offsets = createCoords(0);
|
|
3202
|
-
|
|
3203
|
-
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
3204
|
-
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
3205
|
-
function setLeftRTLScrollbarOffset() {
|
|
3206
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
3207
|
-
}
|
|
3208
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
3314
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
3209
3315
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
3210
3316
|
scroll = getNodeScroll(offsetParent);
|
|
3211
3317
|
}
|
|
@@ -3213,12 +3319,13 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
3213
3319
|
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
3214
3320
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
3215
3321
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
3216
|
-
} else if (documentElement) {
|
|
3217
|
-
setLeftRTLScrollbarOffset();
|
|
3218
3322
|
}
|
|
3219
3323
|
}
|
|
3220
|
-
|
|
3221
|
-
|
|
3324
|
+
|
|
3325
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
3326
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
3327
|
+
if (!isOffsetParentAnElement && documentElement) {
|
|
3328
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
3222
3329
|
}
|
|
3223
3330
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
3224
3331
|
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
@@ -3303,7 +3410,7 @@ function isRTL(element) {
|
|
|
3303
3410
|
const platform = {
|
|
3304
3411
|
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
3305
3412
|
getDocumentElement,
|
|
3306
|
-
getClippingRect,
|
|
3413
|
+
getClippingRect: getClippingRect$1,
|
|
3307
3414
|
getOffsetParent,
|
|
3308
3415
|
getElementRects,
|
|
3309
3416
|
getClientRects,
|
|
@@ -3318,7 +3425,7 @@ function rectsAreEqual(a, b) {
|
|
|
3318
3425
|
}
|
|
3319
3426
|
|
|
3320
3427
|
// https://samthor.au/2021/observing-dom/
|
|
3321
|
-
function observeMove(element, onMove) {
|
|
3428
|
+
function observeMove(element, onMove, ancestorResize) {
|
|
3322
3429
|
let io = null;
|
|
3323
3430
|
let timeoutId;
|
|
3324
3431
|
const root = getDocumentElement(element);
|
|
@@ -3361,13 +3468,22 @@ function observeMove(element, onMove) {
|
|
|
3361
3468
|
let isFirstUpdate = true;
|
|
3362
3469
|
function handleObserve(entries) {
|
|
3363
3470
|
const ratio = entries[0].intersectionRatio;
|
|
3471
|
+
|
|
3472
|
+
// The entry is a snapshot, so the reference may have moved since the
|
|
3473
|
+
// intersection was computed (under performance constraints, or between
|
|
3474
|
+
// consecutive frames of a multi-frame layout shift). The reported ratio
|
|
3475
|
+
// and the observed area are stale in that case and cannot be trusted to
|
|
3476
|
+
// detect subsequent movement, so refresh regardless of the ratio.
|
|
3477
|
+
if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
3478
|
+
return refresh();
|
|
3479
|
+
}
|
|
3364
3480
|
if (ratio !== threshold) {
|
|
3365
3481
|
if (!isFirstUpdate) {
|
|
3366
3482
|
return refresh();
|
|
3367
3483
|
}
|
|
3368
3484
|
if (!ratio) {
|
|
3369
|
-
// If the reference is clipped, the ratio is 0. Throttle
|
|
3370
|
-
// to prevent an infinite loop of updates.
|
|
3485
|
+
// If the reference is clipped in place, the ratio is 0. Throttle
|
|
3486
|
+
// the refresh to prevent an infinite loop of updates.
|
|
3371
3487
|
timeoutId = setTimeout(() => {
|
|
3372
3488
|
refresh(false, 1e-7);
|
|
3373
3489
|
}, 1000);
|
|
@@ -3375,16 +3491,6 @@ function observeMove(element, onMove) {
|
|
|
3375
3491
|
refresh(false, ratio);
|
|
3376
3492
|
}
|
|
3377
3493
|
}
|
|
3378
|
-
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
3379
|
-
// It's possible that even though the ratio is reported as 1, the
|
|
3380
|
-
// element is not actually fully within the IntersectionObserver's root
|
|
3381
|
-
// area anymore. This can happen under performance constraints. This may
|
|
3382
|
-
// be a bug in the browser's IntersectionObserver implementation. To
|
|
3383
|
-
// work around this, we compare the element's bounding rect now with
|
|
3384
|
-
// what it was at the time we created the IntersectionObserver. If they
|
|
3385
|
-
// are not equal then the element moved, so we refresh.
|
|
3386
|
-
refresh();
|
|
3387
|
-
}
|
|
3388
3494
|
isFirstUpdate = false;
|
|
3389
3495
|
}
|
|
3390
3496
|
|
|
@@ -3401,8 +3507,18 @@ function observeMove(element, onMove) {
|
|
|
3401
3507
|
}
|
|
3402
3508
|
io.observe(element);
|
|
3403
3509
|
}
|
|
3510
|
+
const win = getWindow(element);
|
|
3511
|
+
// The window is a resize ancestor, so when `ancestorResize` is enabled its
|
|
3512
|
+
// listener already runs the update on resize. Here we only need to rebuild
|
|
3513
|
+
// the `IntersectionObserver` for the new root size, skipping a redundant
|
|
3514
|
+
// update. When `ancestorResize` is disabled, this becomes the sole update.
|
|
3515
|
+
const handleResize = () => refresh(ancestorResize);
|
|
3516
|
+
win.addEventListener('resize', handleResize);
|
|
3404
3517
|
refresh(true);
|
|
3405
|
-
return
|
|
3518
|
+
return () => {
|
|
3519
|
+
win.removeEventListener('resize', handleResize);
|
|
3520
|
+
cleanup();
|
|
3521
|
+
};
|
|
3406
3522
|
}
|
|
3407
3523
|
|
|
3408
3524
|
/**
|
|
@@ -3427,12 +3543,10 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
3427
3543
|
const referenceEl = unwrapElement(reference);
|
|
3428
3544
|
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];
|
|
3429
3545
|
ancestors.forEach(ancestor => {
|
|
3430
|
-
ancestorScroll && ancestor.addEventListener('scroll', update
|
|
3431
|
-
passive: true
|
|
3432
|
-
});
|
|
3546
|
+
ancestorScroll && ancestor.addEventListener('scroll', update);
|
|
3433
3547
|
ancestorResize && ancestor.addEventListener('resize', update);
|
|
3434
3548
|
});
|
|
3435
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
3549
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;
|
|
3436
3550
|
let reobserveFrame = -1;
|
|
3437
3551
|
let resizeObserver = null;
|
|
3438
3552
|
if (elementResize) {
|
|
@@ -3518,6 +3632,13 @@ const flip = flip$1;
|
|
|
3518
3632
|
*/
|
|
3519
3633
|
const size = size$1;
|
|
3520
3634
|
|
|
3635
|
+
/**
|
|
3636
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
3637
|
+
* when it is not in the same clipping context as the reference element.
|
|
3638
|
+
* @see https://floating-ui.com/docs/hide
|
|
3639
|
+
*/
|
|
3640
|
+
const hide = hide$1;
|
|
3641
|
+
|
|
3521
3642
|
/**
|
|
3522
3643
|
* Provides data to position an inner element of the floating element so that it
|
|
3523
3644
|
* appears centered to the reference element.
|
|
@@ -3546,11 +3667,9 @@ const computePosition = (reference, floating, options) => {
|
|
|
3546
3667
|
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
3547
3668
|
// single call. If other functions become expensive, we can add them as well.
|
|
3548
3669
|
const cache = new Map();
|
|
3549
|
-
const mergedOptions = {
|
|
3550
|
-
platform,
|
|
3551
|
-
...options
|
|
3552
|
-
};
|
|
3670
|
+
const mergedOptions = options != null ? options : {};
|
|
3553
3671
|
const platformWithCache = {
|
|
3672
|
+
...platform,
|
|
3554
3673
|
...mergedOptions.platform,
|
|
3555
3674
|
_c: cache
|
|
3556
3675
|
};
|
|
@@ -4367,6 +4486,77 @@ function apply() {
|
|
|
4367
4486
|
injectStyles(document);
|
|
4368
4487
|
}
|
|
4369
4488
|
|
|
4489
|
+
/**
|
|
4490
|
+
* This utility is covered by the end-to-end tests under 'clipping' in `popovercontainer.cy.ts`.
|
|
4491
|
+
*/
|
|
4492
|
+
const CLIPPING_RECT_CACHE = Symbol('Clipping Rect Cache');
|
|
4493
|
+
/**
|
|
4494
|
+
* A custom floating UI platform that restricts clipping rectangles to the safe area.
|
|
4495
|
+
*/
|
|
4496
|
+
const safeAreaPlatform = { ...platform, getClippingRect };
|
|
4497
|
+
/**
|
|
4498
|
+
* Computes the clipping rectangle of an element while accounting for the safe area.
|
|
4499
|
+
*/
|
|
4500
|
+
async function getClippingRect(...args) {
|
|
4501
|
+
const element = args[0].element;
|
|
4502
|
+
// Check whether the clipping rectangle of the given element has already been computed during
|
|
4503
|
+
// this pass.
|
|
4504
|
+
const hit = this[CLIPPING_RECT_CACHE].get(element);
|
|
4505
|
+
if (hit)
|
|
4506
|
+
return hit;
|
|
4507
|
+
// Compute the clipping rectangle with the Floating UI DOM platform, then restrict it to the safe
|
|
4508
|
+
// area.
|
|
4509
|
+
const clippingRect = await platform.getClippingRect.apply(this, args);
|
|
4510
|
+
applySafeArea(clippingRect, element);
|
|
4511
|
+
this[CLIPPING_RECT_CACHE].set(element, clippingRect);
|
|
4512
|
+
return clippingRect;
|
|
4513
|
+
}
|
|
4514
|
+
/**
|
|
4515
|
+
* Restricts the `clippingRect` computed for `element` to the safe area, modifying it in place.
|
|
4516
|
+
*
|
|
4517
|
+
* The safe area only applies to elements that the header can actually cover, which excludes
|
|
4518
|
+
* elements without a header on their page, elements on a top layer and elements within the header.
|
|
4519
|
+
*/
|
|
4520
|
+
function applySafeArea(clippingRect, element) {
|
|
4521
|
+
const headerElement = element.ownerDocument.querySelector('post-header');
|
|
4522
|
+
if (headerElement === null)
|
|
4523
|
+
return;
|
|
4524
|
+
let parent = element;
|
|
4525
|
+
while (!isLastTraversableNode(parent)) {
|
|
4526
|
+
parent = getParentNode(parent);
|
|
4527
|
+
if (!isHTMLElement(parent))
|
|
4528
|
+
continue;
|
|
4529
|
+
// Do not apply the safe area of the header to
|
|
4530
|
+
// - elements that are on a top layer, such as a dialog.
|
|
4531
|
+
// - elements that are located within the header itself.
|
|
4532
|
+
if (isTopLayer(parent) || parent === headerElement)
|
|
4533
|
+
return;
|
|
4534
|
+
}
|
|
4535
|
+
const headerRect = headerElement.getBoundingClientRect();
|
|
4536
|
+
const top = Math.max(clippingRect.y, headerRect.bottom);
|
|
4537
|
+
clippingRect.height -= top - clippingRect.y;
|
|
4538
|
+
clippingRect.y = top;
|
|
4539
|
+
}
|
|
4540
|
+
/**
|
|
4541
|
+
* Computes the coordinates that will position the `floating` element next to a given `reference`
|
|
4542
|
+
* element while accounting for the safe area.
|
|
4543
|
+
*
|
|
4544
|
+
* The safe area is the part of the viewport that the header does not cover. Restricting the
|
|
4545
|
+
* clipping rectangles to it makes floating elements behave as if they were clipped by the header.
|
|
4546
|
+
*/
|
|
4547
|
+
const computePositionWithSafeArea = (reference, floating, options) => {
|
|
4548
|
+
// Adapted from https://github.com/floating-ui/floating-ui/blob/27629b74ba36ab8ceb2a968051927b9b69511a3b/packages/dom/src/index.ts#L15
|
|
4549
|
+
options ??= {};
|
|
4550
|
+
return computePosition(reference, floating, {
|
|
4551
|
+
...options,
|
|
4552
|
+
platform: {
|
|
4553
|
+
...safeAreaPlatform,
|
|
4554
|
+
...options.platform,
|
|
4555
|
+
[CLIPPING_RECT_CACHE]: new Map(),
|
|
4556
|
+
},
|
|
4557
|
+
});
|
|
4558
|
+
};
|
|
4559
|
+
|
|
4370
4560
|
const postPopovercontainerCss = () => `@layer polyfill{@supports not selector(:popover-open){:host([popover]:not(.\\:popover-open)){display:none}}}:host{background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:host>div{box-shadow:var(--post-device-elevation-300);width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px;position:relative}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host>div{border:2px solid rgba(0,0,0,0)}}:host [part=post-popovercontainer-border-mask]{display:none;position:absolute;inset:0;border-radius:4px;pointer-events:none}:host .arrow{--post-popovercontainer-arrow-border: var(--post-popovercontainer-arrow-border-width, 0px) solid var(--post-popovercontainer-arrow-border-color, transparent);position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:host .arrow[dynamic-placement=top]{border-bottom-right-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=right]{border-bottom-left-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=bottom]{border-top-left-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=left]{border-top-right-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .arrow[dynamic-placement=top]{border-block-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);bottom:-0.3796735336rem !important}:host .arrow[dynamic-placement=left]{border-block-start:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);right:-0.3796735336rem !important}:host .arrow[dynamic-placement=right]{border-block-end:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);left:-0.3796735336rem !important}:host .arrow[dynamic-placement=bottom]{border-block-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);top:-0.3796735336rem !important}}:host([tooltip]){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:host([safe-space])::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto}:host([safe-space=triangle])::after{clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:host([safe-space=trapezoid])::after{clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:host(:not(:has(.arrow)))>div{box-shadow:var(--post-device-elevation-300)}:host(:has(.arrow))>div{filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=top]))>div{filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=left]))>div{filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=right]))>div{filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}`;
|
|
4371
4561
|
|
|
4372
4562
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -4383,6 +4573,30 @@ const ANIMATIONS = {
|
|
|
4383
4573
|
'pop-in': popIn,
|
|
4384
4574
|
};
|
|
4385
4575
|
const PostPopovercontainer = class {
|
|
4576
|
+
static {
|
|
4577
|
+
this.STATIC_SIDES = {
|
|
4578
|
+
top: 'bottom',
|
|
4579
|
+
right: 'left',
|
|
4580
|
+
bottom: 'top',
|
|
4581
|
+
left: 'right',
|
|
4582
|
+
};
|
|
4583
|
+
}
|
|
4584
|
+
static {
|
|
4585
|
+
this.PROPERTIES_TO_CLEAR = [
|
|
4586
|
+
'--post-safe-space-popover-x',
|
|
4587
|
+
'--post-safe-space-popover-y',
|
|
4588
|
+
'--post-safe-space-popover-x-start',
|
|
4589
|
+
'--post-safe-space-popover-x-end',
|
|
4590
|
+
'--post-safe-space-popover-y-start',
|
|
4591
|
+
'--post-safe-space-popover-y-end',
|
|
4592
|
+
'--post-safe-space-trigger-x',
|
|
4593
|
+
'--post-safe-space-trigger-y',
|
|
4594
|
+
'--post-safe-space-trigger-x-start',
|
|
4595
|
+
'--post-safe-space-trigger-x-end',
|
|
4596
|
+
'--post-safe-space-trigger-y-start',
|
|
4597
|
+
'--post-safe-space-trigger-y-end',
|
|
4598
|
+
];
|
|
4599
|
+
}
|
|
4386
4600
|
constructor(hostRef) {
|
|
4387
4601
|
index.registerInstance(this, hostRef);
|
|
4388
4602
|
this.postBeforeShow = index.createEvent(this, "postBeforeShow");
|
|
@@ -4444,7 +4658,7 @@ const PostPopovercontainer = class {
|
|
|
4444
4658
|
if (this.toggleTimeoutId || !target)
|
|
4445
4659
|
return;
|
|
4446
4660
|
this.eventTarget = target;
|
|
4447
|
-
this.
|
|
4661
|
+
this.updatePosition();
|
|
4448
4662
|
this.host.showPopover();
|
|
4449
4663
|
}
|
|
4450
4664
|
/**
|
|
@@ -4470,7 +4684,7 @@ const PostPopovercontainer = class {
|
|
|
4470
4684
|
this.eventTarget = target;
|
|
4471
4685
|
// Prevent instant double toggle
|
|
4472
4686
|
if (!this.toggleTimeoutId) {
|
|
4473
|
-
this.
|
|
4687
|
+
this.updatePosition();
|
|
4474
4688
|
this.host.togglePopover(force);
|
|
4475
4689
|
this.toggleTimeoutId = null;
|
|
4476
4690
|
}
|
|
@@ -4582,17 +4796,14 @@ const PostPopovercontainer = class {
|
|
|
4582
4796
|
startAutoupdates() {
|
|
4583
4797
|
if (!this.eventTarget || !this.host)
|
|
4584
4798
|
return;
|
|
4585
|
-
this.clearAutoUpdate = autoUpdate(this.eventTarget, this.host, this.
|
|
4586
|
-
}
|
|
4587
|
-
/**
|
|
4588
|
-
* Retrieves the dynamic height of the header
|
|
4589
|
-
*/
|
|
4590
|
-
getHeaderHeight() {
|
|
4591
|
-
const header = document.querySelector('post-header');
|
|
4592
|
-
return header ? Number.parseFloat(getComputedStyle(header).height) : 0;
|
|
4799
|
+
this.clearAutoUpdate = autoUpdate(this.eventTarget, this.host, this.updatePosition.bind(this));
|
|
4593
4800
|
}
|
|
4594
|
-
async
|
|
4595
|
-
const { x, y, middlewareData, placement } = await this.
|
|
4801
|
+
async updatePosition() {
|
|
4802
|
+
const { x, y, middlewareData, placement } = await this.calculatePosition();
|
|
4803
|
+
// Hide the popover if the target is outside the viewport
|
|
4804
|
+
if (middlewareData.hide?.referenceHidden) {
|
|
4805
|
+
this.host.hidePopover();
|
|
4806
|
+
}
|
|
4596
4807
|
const currentPlacement = placement.split('-')[0];
|
|
4597
4808
|
this.dynamicPlacement = currentPlacement;
|
|
4598
4809
|
// Position popover
|
|
@@ -4617,13 +4828,15 @@ const PostPopovercontainer = class {
|
|
|
4617
4828
|
await this.updateSafeSpaceBoundaries(currentPlacement);
|
|
4618
4829
|
}
|
|
4619
4830
|
}
|
|
4620
|
-
async
|
|
4831
|
+
async calculatePosition() {
|
|
4621
4832
|
const gap = this.edgeGap;
|
|
4622
4833
|
const isAligned = (this.placement || 'top').includes('-');
|
|
4623
|
-
const flipMiddleware =
|
|
4624
|
-
|
|
4625
|
-
crossAxis: false,
|
|
4626
|
-
|
|
4834
|
+
const flipMiddleware = [
|
|
4835
|
+
// Flip the popover if the target moves outside the viewport
|
|
4836
|
+
flip({ elementContext: 'reference', crossAxis: false }),
|
|
4837
|
+
// Flip the popover if the popover itself moves outside the viewport
|
|
4838
|
+
flip({ elementContext: 'floating', crossAxis: false }),
|
|
4839
|
+
];
|
|
4627
4840
|
const shiftMiddleware = shift({
|
|
4628
4841
|
padding: gap,
|
|
4629
4842
|
limiter: limitShift({
|
|
@@ -4635,7 +4848,7 @@ const PostPopovercontainer = class {
|
|
|
4635
4848
|
inline(),
|
|
4636
4849
|
// Per floating-ui docs: for aligned placements (e.g. bottom-end),
|
|
4637
4850
|
// flip should come before shift. For non-aligned, shift before flip.
|
|
4638
|
-
...(isAligned ? [flipMiddleware, shiftMiddleware] : [shiftMiddleware, flipMiddleware]),
|
|
4851
|
+
...(isAligned ? [...flipMiddleware, shiftMiddleware] : [shiftMiddleware, ...flipMiddleware]),
|
|
4639
4852
|
size({
|
|
4640
4853
|
apply({ availableWidth, elements }) {
|
|
4641
4854
|
Object.assign(elements.floating.style, {
|
|
@@ -4647,7 +4860,12 @@ const PostPopovercontainer = class {
|
|
|
4647
4860
|
if (this.arrow) {
|
|
4648
4861
|
middleware.push(arrow({ element: this.arrowRef, padding: gap }));
|
|
4649
4862
|
}
|
|
4650
|
-
|
|
4863
|
+
// Automatically hide the popover if the target moves outside the scrollport.
|
|
4864
|
+
if (this.autoHide) {
|
|
4865
|
+
// Per floating-ui docs: hide should generally be placed at the end.
|
|
4866
|
+
middleware.push(hide({ strategy: 'referenceHidden' }));
|
|
4867
|
+
}
|
|
4868
|
+
return computePositionWithSafeArea(this.eventTarget, this.host, {
|
|
4651
4869
|
placement: this.placement || 'top',
|
|
4652
4870
|
strategy: 'fixed',
|
|
4653
4871
|
middleware,
|
|
@@ -4714,32 +4932,12 @@ const PostPopovercontainer = class {
|
|
|
4714
4932
|
}
|
|
4715
4933
|
}
|
|
4716
4934
|
render() {
|
|
4717
|
-
return (index.h(index.Host, { key: '
|
|
4935
|
+
return (index.h(index.Host, { key: 'f3ea4bfc9a59faa2fbf1e413a1ec648f598a6779', "data-version": _package.version, popover: "auto" }, index.h("div", { key: 'a328c73c7e08eca1e423fcbe736798188cca2a87', part: "post-popovercontainer-content", class: "popover-content" }, this.arrow && (index.h("span", { key: '8fad0095fb8d8c903ba84a639b4efc3e321c6aef', "dynamic-placement": this.dynamicPlacement, class: "arrow", ref: el => {
|
|
4718
4936
|
this.arrowRef = el;
|
|
4719
|
-
} })), index.h("span", { key: '
|
|
4937
|
+
} })), index.h("span", { key: 'deadbcc5892ed545a64b4a0e5e0936e0dd1feb70', part: "post-popovercontainer-border-mask" }), index.h("slot", { key: '48c4db7ab222f3ef18157ce19d8ba15d75441f98' }))));
|
|
4720
4938
|
}
|
|
4721
4939
|
get host() { return index.getElement(this); }
|
|
4722
4940
|
};
|
|
4723
|
-
PostPopovercontainer.STATIC_SIDES = {
|
|
4724
|
-
top: 'bottom',
|
|
4725
|
-
right: 'left',
|
|
4726
|
-
bottom: 'top',
|
|
4727
|
-
left: 'right',
|
|
4728
|
-
};
|
|
4729
|
-
PostPopovercontainer.PROPERTIES_TO_CLEAR = [
|
|
4730
|
-
'--post-safe-space-popover-x',
|
|
4731
|
-
'--post-safe-space-popover-y',
|
|
4732
|
-
'--post-safe-space-popover-x-start',
|
|
4733
|
-
'--post-safe-space-popover-x-end',
|
|
4734
|
-
'--post-safe-space-popover-y-start',
|
|
4735
|
-
'--post-safe-space-popover-y-end',
|
|
4736
|
-
'--post-safe-space-trigger-x',
|
|
4737
|
-
'--post-safe-space-trigger-y',
|
|
4738
|
-
'--post-safe-space-trigger-x-start',
|
|
4739
|
-
'--post-safe-space-trigger-x-end',
|
|
4740
|
-
'--post-safe-space-trigger-y-start',
|
|
4741
|
-
'--post-safe-space-trigger-y-end',
|
|
4742
|
-
];
|
|
4743
4941
|
__decorate([
|
|
4744
4942
|
oneOf.OneOf(placement.PLACEMENT_TYPES)
|
|
4745
4943
|
], PostPopovercontainer.prototype, "placement", void 0);
|
|
@@ -4780,7 +4978,7 @@ const PostTogglebutton = class {
|
|
|
4780
4978
|
});
|
|
4781
4979
|
}
|
|
4782
4980
|
render() {
|
|
4783
|
-
return (index.h(index.Host, { key: '
|
|
4981
|
+
return (index.h(index.Host, { key: '81fa9d922480059096e4146c10cf2ef72357b482', "data-version": _package.version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, index.h("slot", { key: '4e8d793e3867ba4c9c8e17d509652309a79f032a' })));
|
|
4784
4982
|
}
|
|
4785
4983
|
get host() { return index.getElement(this); }
|
|
4786
4984
|
};
|