@epic-web/workshop-app 4.6.6 → 4.7.1
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/build/client/assets/{_-COWH0sBh.js → _-Bd2gNcck.js} +2 -2
- package/build/client/assets/{_-COWH0sBh.js.map → _-Bd2gNcck.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber-wyz3vbhs.js → _exerciseNumber-CFOo2dQj.js} +2 -2
- package/build/client/assets/{_exerciseNumber-wyz3vbhs.js.map → _exerciseNumber-CFOo2dQj.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber_._stepNumber-C37pli7_.js → _exerciseNumber_._stepNumber-DCbWNWpZ.js} +2 -2
- package/build/client/assets/{_exerciseNumber_._stepNumber-C37pli7_.js.map → _exerciseNumber_._stepNumber-DCbWNWpZ.js.map} +1 -1
- package/build/client/assets/_exerciseNumber_.finished-P7xMAtl1.js +2 -0
- package/build/client/assets/_exerciseNumber_.finished-P7xMAtl1.js.map +1 -0
- package/build/client/assets/_layout-Bdd3mpVx.js +2 -0
- package/build/client/assets/_layout-Bdd3mpVx.js.map +1 -0
- package/build/client/assets/_layout-DHBLG7Ti.js +6 -0
- package/build/client/assets/_layout-DHBLG7Ti.js.map +1 -0
- package/build/client/assets/_layout-DaZNLfOL.js +2 -0
- package/build/client/assets/{_layout-BR-Qyofe.js.map → _layout-DaZNLfOL.js.map} +1 -1
- package/build/client/assets/{_layout-D0zbQZjf.js → _layout-rEQoj43V.js} +2 -2
- package/build/client/assets/{_layout-D0zbQZjf.js.map → _layout-rEQoj43V.js.map} +1 -1
- package/build/client/assets/{account-DesvwOeg.js → account-CnLkZd_O.js} +2 -2
- package/build/client/assets/{account-DesvwOeg.js.map → account-CnLkZd_O.js.map} +1 -1
- package/build/client/assets/{button-BfWwrI9B.js → button-CyZl24U2.js} +2 -2
- package/build/client/assets/{button-BfWwrI9B.js.map → button-CyZl24U2.js.map} +1 -1
- package/build/client/assets/{client-hints-BKxdo5Js.js → client-hints-BE5mB4r0.js} +2 -2
- package/build/client/assets/{client-hints-BKxdo5Js.js.map → client-hints-BE5mB4r0.js.map} +1 -1
- package/build/client/assets/components-BMzmvxYw.js +166 -0
- package/build/client/assets/components-BMzmvxYw.js.map +1 -0
- package/build/client/assets/diff-P5f7-8E4.js +2 -0
- package/build/client/assets/diff-P5f7-8E4.js.map +1 -0
- package/build/client/assets/diff-PfwTHr6-.js +2 -0
- package/build/client/assets/{diff-KDzcgGYL.js.map → diff-PfwTHr6-.js.map} +1 -1
- package/build/client/assets/{discord-0kv66Q6F.js → discord-COPE8EOZ.js} +2 -2
- package/build/client/assets/{discord-0kv66Q6F.js.map → discord-COPE8EOZ.js.map} +1 -1
- package/build/client/assets/discord-DIog7bBO.js +2 -0
- package/build/client/assets/discord-DIog7bBO.js.map +1 -0
- package/build/client/assets/entry.client-B0vV2fsa.js +43 -0
- package/build/client/assets/entry.client-B0vV2fsa.js.map +1 -0
- package/build/client/assets/{epic-video-BwtXsHGU.js → epic-video-CYnG2ziQ.js} +128 -128
- package/build/client/assets/epic-video-CYnG2ziQ.js.map +1 -0
- package/build/client/assets/{error-boundary-Bcric_4t.js → error-boundary-DxfVshQ5.js} +2 -2
- package/build/client/assets/{error-boundary-Bcric_4t.js.map → error-boundary-DxfVshQ5.js.map} +1 -1
- package/build/client/assets/finished-DP5ynR5u.js +2 -0
- package/build/client/assets/finished-DP5ynR5u.js.map +1 -0
- package/build/client/assets/index-4E9_Sx3m.js +42 -0
- package/build/client/assets/index-4E9_Sx3m.js.map +1 -0
- package/build/client/assets/{index-Bg9MMnnf.js → index-90bzTYUX.js} +2 -2
- package/build/client/assets/index-90bzTYUX.js.map +1 -0
- package/build/client/assets/{index-BQRtqn3g.js → index-BXefr1BB.js} +2 -2
- package/build/client/assets/{index-BQRtqn3g.js.map → index-BXefr1BB.js.map} +1 -1
- package/build/client/assets/index-Czg1ruVn.js +37 -0
- package/build/client/assets/index-Czg1ruVn.js.map +1 -0
- package/build/client/assets/{index-9nNr0Zqr.js → index-D6ukHE4T.js} +2 -2
- package/build/client/assets/{index-9nNr0Zqr.js.map → index-D6ukHE4T.js.map} +1 -1
- package/build/client/assets/index-Doi37489.js +3 -0
- package/build/client/assets/index-Doi37489.js.map +1 -0
- package/build/client/assets/{loading-C9f_vBoM.js → loading-CNWJVymJ.js} +2 -2
- package/build/client/assets/{loading-C9f_vBoM.js.map → loading-CNWJVymJ.js.map} +1 -1
- package/build/client/assets/{login-D8zyjBAb.js → login-DxG854vQ.js} +2 -2
- package/build/client/assets/{login-D8zyjBAb.js.map → login-DxG854vQ.js.map} +1 -1
- package/build/client/assets/manifest-805aa13a.js +1 -0
- package/build/client/assets/mdx-CR7Me1v_.js +2 -0
- package/build/client/assets/{mdx-BYvGbvEr.js.map → mdx-CR7Me1v_.js.map} +1 -1
- package/build/client/assets/misc-CypjEQkt.js +2 -0
- package/build/client/assets/misc-CypjEQkt.js.map +1 -0
- package/build/client/assets/{nav-chevrons-DOYtx9XE.js → nav-chevrons-BYKwyIgG.js} +2 -2
- package/build/client/assets/{nav-chevrons-DOYtx9XE.js.map → nav-chevrons-BYKwyIgG.js.map} +1 -1
- package/build/client/assets/{onboarding-euWyXpCL.js → onboarding-b9lcdh4n.js} +2 -2
- package/build/client/assets/{onboarding-euWyXpCL.js.map → onboarding-b9lcdh4n.js.map} +1 -1
- package/build/client/assets/{presence-BJPzwbUy.js → presence-DXXVJbaH.js} +2 -2
- package/build/client/assets/{presence-BJPzwbUy.js.map → presence-DXXVJbaH.js.map} +1 -1
- package/build/client/assets/progress-B_mReZVE.js +2 -0
- package/build/client/assets/progress-B_mReZVE.js.map +1 -0
- package/build/client/assets/{progress-bar-7LK87ZMh.js → progress-bar-DCrt7X4t.js} +2 -2
- package/build/client/assets/{progress-bar-7LK87ZMh.js.map → progress-bar-DCrt7X4t.js.map} +1 -1
- package/build/client/assets/{request-info-Dyls4H67.js → request-info-CUT0ULYN.js} +2 -2
- package/build/client/assets/{request-info-Dyls4H67.js.map → request-info-CUT0ULYN.js.map} +1 -1
- package/build/client/assets/{root-BQ7V6fP4.js → root-bgHbi7rA.js} +4 -4
- package/build/client/assets/root-bgHbi7rA.js.map +1 -0
- package/build/client/assets/{support-DUAHYT3r.js → support-DrY-qRGh.js} +2 -2
- package/build/client/assets/{support-DUAHYT3r.js.map → support-DrY-qRGh.js.map} +1 -1
- package/build/client/assets/tailwind-D2vjZZFL.css +1 -0
- package/build/client/assets/tooltip-CfmIzAYi.js +2 -0
- package/build/client/assets/tooltip-CfmIzAYi.js.map +1 -0
- package/build/client/assets/{use-event-source-aW6X9lN1.js → use-event-source-ySol3hbz.js} +2 -2
- package/build/client/assets/{use-event-source-aW6X9lN1.js.map → use-event-source-ySol3hbz.js.map} +1 -1
- package/build/client/assets/{user-73ocDYRe.js → user-C4QTtQw5.js} +2 -2
- package/build/client/assets/{user-73ocDYRe.js.map → user-C4QTtQw5.js.map} +1 -1
- package/build/server/index.js +840 -607
- package/build/server/index.js.map +1 -1
- package/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js +65 -3
- package/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js +65 -3
- package/node_modules/@babel/runtime/package.json +1 -28
- package/node_modules/@conform-to/dom/dom.d.ts +17 -5
- package/node_modules/@conform-to/dom/form.d.ts +221 -122
- package/node_modules/@conform-to/dom/index.d.ts +24 -2
- package/node_modules/@conform-to/dom/intent.d.ts +92 -60
- package/node_modules/@conform-to/dom/package.json +1 -1
- package/node_modules/@conform-to/dom/parse.d.ts +47 -27
- package/node_modules/@conform-to/dom/types.d.ts +17 -14
- package/node_modules/@conform-to/dom/util.d.ts +4 -1
- package/node_modules/@conform-to/react/context.d.ts +187 -59
- package/node_modules/@conform-to/react/context.js +3 -5
- package/node_modules/@conform-to/react/context.mjs +4 -6
- package/node_modules/@conform-to/react/experimental.d.ts +0 -0
- package/node_modules/@conform-to/react/hooks.d.ts +53 -24
- package/node_modules/@conform-to/react/index.d.ts +28 -4
- package/node_modules/@conform-to/react/integrations.js +14 -1
- package/node_modules/@conform-to/react/integrations.mjs +14 -1
- package/node_modules/@conform-to/react/package.json +2 -2
- package/node_modules/@conform-to/zod/coercion.d.ts +14 -4
- package/node_modules/@conform-to/zod/constraint.d.ts +3 -1
- package/node_modules/@conform-to/zod/package.json +2 -2
- package/node_modules/@conform-to/zod/parse.d.ts +43 -25
- package/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs +1 -1
- package/node_modules/@floating-ui/core/dist/floating-ui.core.browser.mjs +14 -3
- package/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts +51 -51
- package/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +51 -51
- package/node_modules/@floating-ui/core/dist/floating-ui.core.esm.js +14 -3
- package/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +14 -3
- package/node_modules/@floating-ui/core/dist/floating-ui.core.umd.js +14 -3
- package/node_modules/@floating-ui/core/dist/floating-ui.core.umd.min.js +1 -1
- package/node_modules/@floating-ui/core/package.json +2 -2
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs +1 -1
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.mjs +12 -11
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts +11 -8
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts +11 -8
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js +1 -12
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +1 -12
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.js +12 -11
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.min.js +1 -1
- package/node_modules/@floating-ui/dom/package.json +2 -2
- package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.d.mts +12 -4
- package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.d.ts +12 -4
- package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js +1 -0
- package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs +1 -0
- package/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.umd.js +1 -0
- package/node_modules/@floating-ui/react-dom/package.json +1 -1
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.mts +11 -6
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +11 -6
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.mts +2 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.ts +2 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.esm.js +13 -1
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +13 -1
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.umd.js +13 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.umd.min.js +1 -1
- package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.d.ts +2 -0
- package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.esm.js +13 -1
- package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.umd.js +13 -0
- package/node_modules/@floating-ui/utils/package.json +1 -1
- package/node_modules/@radix-ui/number/dist/index.d.mts +2 -2
- package/node_modules/@radix-ui/number/dist/index.d.ts +2 -2
- package/node_modules/@radix-ui/number/dist/index.js +28 -10
- package/node_modules/@radix-ui/number/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/number/dist/index.mjs +6 -7
- package/node_modules/@radix-ui/number/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/number/package.json +1 -4
- package/node_modules/@radix-ui/primitive/dist/index.d.mts +2 -2
- package/node_modules/@radix-ui/primitive/dist/index.d.ts +2 -2
- package/node_modules/@radix-ui/primitive/dist/index.js +33 -13
- package/node_modules/@radix-ui/primitive/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/primitive/dist/index.mjs +11 -10
- package/node_modules/@radix-ui/primitive/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/primitive/package.json +1 -4
- package/node_modules/@radix-ui/react-accordion/dist/index.d.mts +40 -28
- package/node_modules/@radix-ui/react-accordion/dist/index.d.ts +40 -28
- package/node_modules/@radix-ui/react-accordion/dist/index.js +324 -316
- package/node_modules/@radix-ui/react-accordion/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-accordion/dist/index.mjs +293 -300
- package/node_modules/@radix-ui/react-accordion/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-accordion/package.json +12 -13
- package/node_modules/@radix-ui/react-arrow/dist/index.d.mts +8 -8
- package/node_modules/@radix-ui/react-arrow/dist/index.d.ts +8 -8
- package/node_modules/@radix-ui/react-arrow/dist/index.js +57 -37
- package/node_modules/@radix-ui/react-arrow/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-arrow/dist/index.mjs +25 -30
- package/node_modules/@radix-ui/react-arrow/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-arrow/package.json +4 -5
- package/node_modules/@radix-ui/react-collapsible/dist/index.d.mts +27 -16
- package/node_modules/@radix-ui/react-collapsible/dist/index.d.ts +27 -16
- package/node_modules/@radix-ui/react-collapsible/dist/index.js +176 -167
- package/node_modules/@radix-ui/react-collapsible/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-collapsible/dist/index.mjs +143 -153
- package/node_modules/@radix-ui/react-collapsible/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-collapsible/package.json +11 -12
- package/node_modules/@radix-ui/react-collection/dist/index.d.mts +27 -15
- package/node_modules/@radix-ui/react-collection/dist/index.d.ts +27 -15
- package/node_modules/@radix-ui/react-collection/dist/index.js +99 -112
- package/node_modules/@radix-ui/react-collection/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-collection/dist/index.mjs +68 -106
- package/node_modules/@radix-ui/react-collection/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-collection/package.json +7 -8
- package/node_modules/@radix-ui/react-compose-refs/dist/index.d.mts +5 -4
- package/node_modules/@radix-ui/react-compose-refs/dist/index.d.ts +5 -4
- package/node_modules/@radix-ui/react-compose-refs/dist/index.js +47 -30
- package/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +16 -27
- package/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-compose-refs/package.json +2 -5
- package/node_modules/@radix-ui/react-context/dist/index.d.mts +10 -8
- package/node_modules/@radix-ui/react-context/dist/index.d.ts +10 -8
- package/node_modules/@radix-ui/react-context/dist/index.js +104 -123
- package/node_modules/@radix-ui/react-context/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-context/dist/index.mjs +73 -120
- package/node_modules/@radix-ui/react-context/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-context/package.json +2 -5
- package/node_modules/@radix-ui/react-direction/dist/index.d.mts +6 -5
- package/node_modules/@radix-ui/react-direction/dist/index.d.ts +6 -5
- package/node_modules/@radix-ui/react-direction/dist/index.js +47 -24
- package/node_modules/@radix-ui/react-direction/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-direction/dist/index.mjs +16 -20
- package/node_modules/@radix-ui/react-direction/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-direction/package.json +2 -5
- package/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.mts +10 -10
- package/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts +10 -10
- package/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +230 -270
- package/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +199 -261
- package/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-dismissable-layer/package.json +9 -10
- package/node_modules/@radix-ui/react-focus-guards/dist/index.d.mts +4 -4
- package/node_modules/@radix-ui/react-focus-guards/dist/index.d.ts +4 -4
- package/node_modules/@radix-ui/react-focus-guards/dist/index.js +63 -39
- package/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +32 -34
- package/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-focus-guards/package.json +2 -5
- package/node_modules/@radix-ui/react-focus-scope/dist/index.d.mts +8 -8
- package/node_modules/@radix-ui/react-focus-scope/dist/index.d.ts +8 -8
- package/node_modules/@radix-ui/react-focus-scope/dist/index.js +228 -282
- package/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +197 -275
- package/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-focus-scope/package.json +6 -7
- package/node_modules/@radix-ui/react-id/dist/index.d.mts +2 -2
- package/node_modules/@radix-ui/react-id/dist/index.d.ts +2 -2
- package/node_modules/@radix-ui/react-id/dist/index.js +47 -26
- package/node_modules/@radix-ui/react-id/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-id/dist/index.mjs +14 -22
- package/node_modules/@radix-ui/react-id/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-id/package.json +3 -4
- package/node_modules/@radix-ui/react-popover/dist/index.d.mts +48 -37
- package/node_modules/@radix-ui/react-popover/dist/index.d.ts +48 -37
- package/node_modules/@radix-ui/react-popover/dist/index.js +319 -311
- package/node_modules/@radix-ui/react-popover/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-popover/dist/index.mjs +288 -291
- package/node_modules/@radix-ui/react-popover/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-popover/package.json +17 -18
- package/node_modules/@radix-ui/react-popper/dist/index.d.mts +36 -25
- package/node_modules/@radix-ui/react-popper/dist/index.d.ts +36 -25
- package/node_modules/@radix-ui/react-popper/dist/index.js +305 -321
- package/node_modules/@radix-ui/react-popper/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-popper/dist/index.mjs +284 -305
- package/node_modules/@radix-ui/react-popper/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-popper/package.json +12 -13
- package/node_modules/@radix-ui/react-portal/dist/index.d.mts +9 -9
- package/node_modules/@radix-ui/react-portal/dist/index.d.ts +9 -9
- package/node_modules/@radix-ui/react-portal/dist/index.js +52 -34
- package/node_modules/@radix-ui/react-portal/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-portal/dist/index.mjs +21 -27
- package/node_modules/@radix-ui/react-portal/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-portal/package.json +5 -5
- package/node_modules/@radix-ui/react-presence/dist/index.d.mts +5 -4
- package/node_modules/@radix-ui/react-presence/dist/index.d.ts +5 -4
- package/node_modules/@radix-ui/react-presence/dist/index.js +147 -132
- package/node_modules/@radix-ui/react-presence/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-presence/dist/index.mjs +116 -129
- package/node_modules/@radix-ui/react-presence/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-presence/package.json +5 -6
- package/node_modules/@radix-ui/react-primitive/dist/index.d.mts +8 -9
- package/node_modules/@radix-ui/react-primitive/dist/index.d.ts +8 -9
- package/node_modules/@radix-ui/react-primitive/dist/index.js +73 -100
- package/node_modules/@radix-ui/react-primitive/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-primitive/dist/index.mjs +42 -93
- package/node_modules/@radix-ui/react-primitive/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-primitive/package.json +4 -5
- package/node_modules/@radix-ui/react-roving-focus/dist/index.d.mts +25 -13
- package/node_modules/@radix-ui/react-roving-focus/dist/index.d.ts +25 -13
- package/node_modules/@radix-ui/react-roving-focus/dist/index.js +239 -247
- package/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-roving-focus/dist/index.mjs +209 -238
- package/node_modules/@radix-ui/react-roving-focus/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-roving-focus/package.json +12 -13
- package/node_modules/@radix-ui/react-select/dist/index.d.mts +77 -65
- package/node_modules/@radix-ui/react-select/dist/index.d.ts +77 -65
- package/node_modules/@radix-ui/react-select/dist/index.js +1107 -1235
- package/node_modules/@radix-ui/react-select/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-select/dist/index.mjs +1076 -1197
- package/node_modules/@radix-ui/react-select/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-select/package.json +23 -24
- package/node_modules/@radix-ui/react-slot/dist/index.d.mts +9 -7
- package/node_modules/@radix-ui/react-slot/dist/index.d.ts +9 -7
- package/node_modules/@radix-ui/react-slot/dist/index.js +107 -87
- package/node_modules/@radix-ui/react-slot/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-slot/dist/index.mjs +76 -80
- package/node_modules/@radix-ui/react-slot/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-slot/package.json +3 -4
- package/node_modules/@radix-ui/react-tabs/dist/index.d.mts +32 -21
- package/node_modules/@radix-ui/react-tabs/dist/index.d.ts +32 -21
- package/node_modules/@radix-ui/react-tabs/dist/index.js +217 -184
- package/node_modules/@radix-ui/react-tabs/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-tabs/dist/index.mjs +185 -169
- package/node_modules/@radix-ui/react-tabs/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-tabs/package.json +11 -12
- package/node_modules/@radix-ui/react-toast/dist/index.d.mts +43 -32
- package/node_modules/@radix-ui/react-toast/dist/index.d.ts +43 -32
- package/node_modules/@radix-ui/react-toast/dist/index.js +645 -715
- package/node_modules/@radix-ui/react-toast/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-toast/dist/index.mjs +614 -695
- package/node_modules/@radix-ui/react-toast/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-toast/package.json +15 -16
- package/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.mts +2 -2
- package/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.ts +2 -2
- package/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +42 -23
- package/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs +11 -21
- package/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-use-callback-ref/package.json +2 -5
- package/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.mts +4 -3
- package/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.ts +4 -3
- package/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +75 -52
- package/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs +44 -50
- package/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-use-controllable-state/package.json +3 -4
- package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.mts +2 -2
- package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.ts +2 -2
- package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +50 -29
- package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs +17 -25
- package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-use-escape-keydown/package.json +3 -4
- package/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.mts +4 -3
- package/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.ts +4 -3
- package/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +38 -17
- package/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs +7 -15
- package/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-use-layout-effect/package.json +2 -5
- package/node_modules/@radix-ui/react-use-previous/dist/index.d.mts +2 -2
- package/node_modules/@radix-ui/react-use-previous/dist/index.d.ts +2 -2
- package/node_modules/@radix-ui/react-use-previous/dist/index.js +45 -26
- package/node_modules/@radix-ui/react-use-previous/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-use-previous/dist/index.mjs +14 -24
- package/node_modules/@radix-ui/react-use-previous/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-use-previous/package.json +2 -5
- package/node_modules/@radix-ui/react-use-rect/dist/index.d.mts +4 -3
- package/node_modules/@radix-ui/react-use-rect/dist/index.d.ts +4 -3
- package/node_modules/@radix-ui/react-use-rect/dist/index.js +52 -32
- package/node_modules/@radix-ui/react-use-rect/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-use-rect/dist/index.mjs +19 -28
- package/node_modules/@radix-ui/react-use-rect/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-use-rect/package.json +3 -4
- package/node_modules/@radix-ui/react-use-size/dist/index.d.mts +2 -2
- package/node_modules/@radix-ui/react-use-size/dist/index.d.ts +2 -2
- package/node_modules/@radix-ui/react-use-size/dist/index.js +70 -57
- package/node_modules/@radix-ui/react-use-size/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-use-size/dist/index.mjs +39 -55
- package/node_modules/@radix-ui/react-use-size/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-use-size/package.json +3 -4
- package/node_modules/@radix-ui/react-visually-hidden/dist/index.d.mts +8 -8
- package/node_modules/@radix-ui/react-visually-hidden/dist/index.d.ts +8 -8
- package/node_modules/@radix-ui/react-visually-hidden/dist/index.js +64 -41
- package/node_modules/@radix-ui/react-visually-hidden/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs +33 -35
- package/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/react-visually-hidden/package.json +4 -5
- package/node_modules/@radix-ui/rect/dist/index.d.mts +3 -3
- package/node_modules/@radix-ui/rect/dist/index.d.ts +3 -3
- package/node_modules/@radix-ui/rect/dist/index.js +69 -66
- package/node_modules/@radix-ui/rect/dist/index.js.map +7 -1
- package/node_modules/@radix-ui/rect/dist/index.mjs +47 -63
- package/node_modules/@radix-ui/rect/dist/index.mjs.map +7 -1
- package/node_modules/@radix-ui/rect/package.json +1 -4
- package/node_modules/@remix-run/react/CHANGELOG.md +18 -0
- package/node_modules/@remix-run/react/dist/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/node_modules/@remix-run/react/dist/browser.js +14 -3
- package/node_modules/@remix-run/react/dist/components.d.ts +9 -0
- package/node_modules/@remix-run/react/dist/components.js +23 -19
- package/node_modules/@remix-run/react/dist/data.js +1 -1
- package/node_modules/@remix-run/react/dist/entry.d.ts +1 -0
- package/node_modules/@remix-run/react/dist/errorBoundaries.d.ts +5 -2
- package/node_modules/@remix-run/react/dist/errorBoundaries.js +26 -5
- package/node_modules/@remix-run/react/dist/errors.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/browser.js +14 -3
- package/node_modules/@remix-run/react/dist/esm/components.js +24 -20
- package/node_modules/@remix-run/react/dist/esm/data.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/errorBoundaries.js +26 -5
- package/node_modules/@remix-run/react/dist/esm/errors.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/fallback.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/fog-of-war.js +226 -0
- package/node_modules/@remix-run/react/dist/esm/index.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/invariant.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/links.js +2 -2
- package/node_modules/@remix-run/react/dist/esm/markup.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/routeModules.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/routes.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/scroll-restoration.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/server.js +1 -1
- package/node_modules/@remix-run/react/dist/esm/single-fetch.js +1 -1
- package/node_modules/@remix-run/react/dist/fallback.js +1 -1
- package/node_modules/@remix-run/react/dist/fog-of-war.d.ts +37 -0
- package/node_modules/@remix-run/react/dist/fog-of-war.js +254 -0
- package/node_modules/@remix-run/react/dist/index.js +1 -1
- package/node_modules/@remix-run/react/dist/invariant.js +1 -1
- package/node_modules/@remix-run/react/dist/links.js +2 -2
- package/node_modules/@remix-run/react/dist/markup.js +1 -1
- package/node_modules/@remix-run/react/dist/routeModules.js +1 -1
- package/node_modules/@remix-run/react/dist/routes.d.ts +1 -1
- package/node_modules/@remix-run/react/dist/routes.js +1 -1
- package/node_modules/@remix-run/react/dist/scroll-restoration.js +1 -1
- package/node_modules/@remix-run/react/dist/server.js +1 -1
- package/node_modules/@remix-run/react/dist/single-fetch.js +1 -1
- package/node_modules/@remix-run/react/package.json +8 -8
- package/node_modules/@remix-run/router/CHANGELOG.md +9 -0
- package/node_modules/@remix-run/router/dist/index.d.ts +1 -1
- package/node_modules/@remix-run/router/dist/router.cjs.js +467 -80
- package/node_modules/@remix-run/router/dist/router.cjs.js.map +1 -1
- package/node_modules/@remix-run/router/dist/router.d.ts +11 -1
- package/node_modules/@remix-run/router/dist/router.js +457 -76
- package/node_modules/@remix-run/router/dist/router.js.map +1 -1
- package/node_modules/@remix-run/router/dist/router.umd.js +467 -80
- package/node_modules/@remix-run/router/dist/router.umd.js.map +1 -1
- package/node_modules/@remix-run/router/dist/router.umd.min.js +2 -2
- package/node_modules/@remix-run/router/dist/router.umd.min.js.map +1 -1
- package/node_modules/@remix-run/router/dist/utils.d.ts +9 -1
- package/node_modules/@remix-run/router/index.ts +1 -0
- package/node_modules/@remix-run/router/package.json +1 -1
- package/node_modules/@remix-run/router/router.ts +586 -73
- package/node_modules/@remix-run/router/utils.ts +51 -8
- package/node_modules/@remix-run/server-runtime/CHANGELOG.md +17 -0
- package/node_modules/@remix-run/server-runtime/dist/cookies.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/data.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/deprecations.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/dev.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/entry.d.ts +1 -0
- package/node_modules/@remix-run/server-runtime/dist/entry.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/errors.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/cookies.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/data.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/deprecations.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/dev.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/entry.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/errors.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/formData.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/headers.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/index.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/invariant.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/markup.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/mode.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/responses.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/routeMatching.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/routes.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/server.js +76 -11
- package/node_modules/@remix-run/server-runtime/dist/esm/serverHandoff.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/sessions/cookieStorage.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/sessions/memoryStorage.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/sessions.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/single-fetch.js +17 -8
- package/node_modules/@remix-run/server-runtime/dist/esm/upload/errors.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/upload/memoryUploadHandler.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/esm/warnings.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/formData.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/headers.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/index.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/invariant.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/markup.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/mode.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/responses.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/routeMatching.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/routes.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/server.js +70 -5
- package/node_modules/@remix-run/server-runtime/dist/serverHandoff.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/sessions/cookieStorage.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/sessions/memoryStorage.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/sessions.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/single-fetch.d.ts +3 -0
- package/node_modules/@remix-run/server-runtime/dist/single-fetch.js +18 -7
- package/node_modules/@remix-run/server-runtime/dist/upload/errors.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/upload/memoryUploadHandler.js +1 -1
- package/node_modules/@remix-run/server-runtime/dist/warnings.js +1 -1
- package/node_modules/@remix-run/server-runtime/package.json +3 -3
- package/node_modules/deep-eql/index.js +10 -5
- package/node_modules/deep-eql/package.json +1 -1
- package/node_modules/framer-motion/dist/cjs/{dom-entry-DSxBucW4.js → dom-entry-GDJJhIpT.js} +59 -106
- package/node_modules/framer-motion/dist/cjs/dom-entry.js +1 -1
- package/node_modules/framer-motion/dist/cjs/index.js +123 -36
- package/node_modules/framer-motion/dist/dom.js +1 -1
- package/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs +3 -3
- package/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs +6 -3
- package/node_modules/framer-motion/dist/es/motion/index.mjs +33 -13
- package/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs +6 -3
- package/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs +54 -3
- package/node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs +5 -2
- package/node_modules/framer-motion/dist/es/projection-entry.mjs +11 -0
- package/node_modules/framer-motion/dist/es/render/VisualElement.mjs +30 -78
- package/node_modules/framer-motion/dist/es/render/utils/animation-state.mjs +5 -1
- package/node_modules/framer-motion/dist/es/render/utils/motion-values.mjs +1 -1
- package/node_modules/framer-motion/dist/es/utils/mix/color.mjs +8 -2
- package/node_modules/framer-motion/dist/es/utils/mix/complex.mjs +1 -3
- package/node_modules/framer-motion/dist/es/utils/mix/immediate.mjs +5 -0
- package/node_modules/framer-motion/dist/es/value/index.mjs +1 -1
- package/node_modules/framer-motion/dist/es/value/types/color/rgba.mjs +1 -1
- package/node_modules/framer-motion/dist/framer-motion.dev.js +175 -134
- package/node_modules/framer-motion/dist/framer-motion.js +1 -1
- package/node_modules/framer-motion/dist/index.d.ts +78 -78
- package/node_modules/framer-motion/dist/three-entry.d.ts +59 -72
- package/node_modules/framer-motion/package.json +14 -28
- package/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +15 -4
- package/node_modules/react-remove-scroll/dist/es2015/UI.js +2 -2
- package/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +12 -4
- package/node_modules/react-remove-scroll/dist/es2015/types.d.ts +10 -2
- package/node_modules/react-remove-scroll/dist/es2019/SideEffect.js +15 -4
- package/node_modules/react-remove-scroll/dist/es2019/UI.js +2 -2
- package/node_modules/react-remove-scroll/dist/es2019/handleScroll.js +12 -4
- package/node_modules/react-remove-scroll/dist/es2019/types.d.ts +10 -2
- package/node_modules/react-remove-scroll/dist/es5/SideEffect.js +15 -4
- package/node_modules/react-remove-scroll/dist/es5/UI.js +2 -2
- package/node_modules/react-remove-scroll/dist/es5/handleScroll.js +12 -4
- package/node_modules/react-remove-scroll/dist/es5/types.d.ts +10 -2
- package/node_modules/react-remove-scroll/dist/index.js +93 -0
- package/node_modules/react-remove-scroll/package.json +4 -3
- package/node_modules/react-router/CHANGELOG.md +14 -0
- package/node_modules/react-router/dist/index.d.ts +4 -1
- package/node_modules/react-router/dist/index.js +3 -2
- package/node_modules/react-router/dist/index.js.map +1 -1
- package/node_modules/react-router/dist/main.js +1 -1
- package/node_modules/react-router/dist/react-router.development.js +3 -2
- package/node_modules/react-router/dist/react-router.development.js.map +1 -1
- package/node_modules/react-router/dist/react-router.production.min.js +2 -2
- package/node_modules/react-router/dist/react-router.production.min.js.map +1 -1
- package/node_modules/react-router/dist/umd/react-router.development.js +3 -2
- package/node_modules/react-router/dist/umd/react-router.development.js.map +1 -1
- package/node_modules/react-router/dist/umd/react-router.production.min.js +2 -2
- package/node_modules/react-router/dist/umd/react-router.production.min.js.map +1 -1
- package/node_modules/react-router/package.json +3 -3
- package/node_modules/react-router-dom/CHANGELOG.md +17 -0
- package/node_modules/react-router-dom/dist/dom.d.ts +29 -16
- package/node_modules/react-router-dom/dist/index.d.ts +18 -6
- package/node_modules/react-router-dom/dist/index.js +3 -1
- package/node_modules/react-router-dom/dist/index.js.map +1 -1
- package/node_modules/react-router-dom/dist/main.js +1 -1
- package/node_modules/react-router-dom/dist/react-router-dom.development.js +29 -1
- package/node_modules/react-router-dom/dist/react-router-dom.development.js.map +1 -1
- package/node_modules/react-router-dom/dist/react-router-dom.production.min.js +2 -2
- package/node_modules/react-router-dom/dist/react-router-dom.production.min.js.map +1 -1
- package/node_modules/react-router-dom/dist/server.js +4 -1
- package/node_modules/react-router-dom/dist/server.mjs +4 -1
- package/node_modules/react-router-dom/dist/umd/react-router-dom.development.js +29 -1
- package/node_modules/react-router-dom/dist/umd/react-router-dom.development.js.map +1 -1
- package/node_modules/react-router-dom/dist/umd/react-router-dom.production.min.js +2 -2
- package/node_modules/react-router-dom/dist/umd/react-router-dom.production.min.js.map +1 -1
- package/node_modules/react-router-dom/package.json +3 -3
- package/node_modules/react-router-dom/server.js +4 -1
- package/node_modules/react-router-dom/server.mjs +4 -1
- package/node_modules/{@remix-run/server-runtime/node_modules/source-map → source-map}/README.md +32 -112
- package/node_modules/source-map/dist/source-map.debug.js +3234 -0
- package/node_modules/source-map/dist/source-map.js +3233 -0
- package/node_modules/source-map/dist/source-map.min.js +2 -0
- package/node_modules/source-map/dist/source-map.min.js.map +1 -0
- package/node_modules/source-map/lib/array-set.js +121 -0
- package/node_modules/{@remix-run/server-runtime/node_modules/source-map → source-map}/lib/base64-vlq.js +40 -11
- package/node_modules/source-map/lib/base64.js +67 -0
- package/node_modules/{@remix-run/server-runtime/node_modules/source-map → source-map}/lib/binary-search.js +19 -15
- package/node_modules/source-map/lib/mapping-list.js +79 -0
- package/node_modules/source-map/lib/quick-sort.js +114 -0
- package/node_modules/source-map/lib/source-map-consumer.js +1145 -0
- package/node_modules/{@remix-run/server-runtime/node_modules/source-map → source-map}/lib/source-map-generator.js +169 -157
- package/node_modules/source-map/lib/source-node.js +413 -0
- package/node_modules/{@remix-run/server-runtime/node_modules/source-map → source-map}/lib/util.js +51 -109
- package/node_modules/{@remix-run/server-runtime/node_modules/source-map → source-map}/package.json +9 -27
- package/node_modules/source-map/source-map.d.ts +98 -0
- package/node_modules/source-map/source-map.js +8 -0
- package/node_modules/turbo-stream/dist/flatten.d.ts +1 -1
- package/node_modules/turbo-stream/dist/flatten.js +44 -9
- package/node_modules/turbo-stream/dist/turbo-stream.js +11 -2
- package/node_modules/turbo-stream/dist/turbo-stream.mjs +58 -7
- package/node_modules/turbo-stream/dist/unflatten.js +2 -0
- package/node_modules/turbo-stream/dist/utils.d.ts +1 -0
- package/node_modules/turbo-stream/dist/utils.js +2 -1
- package/node_modules/turbo-stream/package.json +1 -1
- package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/index.d.ts +1 -0
- package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/package.json +2 -1
- package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/readme.md +1 -0
- package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/is-literal.d.ts +6 -4
- package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/merge-deep.d.ts +8 -9
- package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/omit-deep.d.ts +3 -3
- package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/paths.d.ts +14 -8
- package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/schema.d.ts +12 -12
- package/node_modules/type-fest/source/simplify-deep.d.ts +115 -0
- package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/simplify.d.ts +1 -1
- package/package.json +4 -4
- package/build/client/assets/_exerciseNumber_.finished-DNtyBHjg.js +0 -2
- package/build/client/assets/_exerciseNumber_.finished-DNtyBHjg.js.map +0 -1
- package/build/client/assets/_layout-BR-Qyofe.js +0 -2
- package/build/client/assets/_layout-CNgYirUN.js +0 -2
- package/build/client/assets/_layout-CNgYirUN.js.map +0 -1
- package/build/client/assets/_layout-xu6a9He_.js +0 -2
- package/build/client/assets/_layout-xu6a9He_.js.map +0 -1
- package/build/client/assets/components-C5xBZAiL.js +0 -119
- package/build/client/assets/components-C5xBZAiL.js.map +0 -1
- package/build/client/assets/diff-BKsbFB6w.js +0 -42
- package/build/client/assets/diff-BKsbFB6w.js.map +0 -1
- package/build/client/assets/diff-KDzcgGYL.js +0 -2
- package/build/client/assets/discord-Xp0X4-Fl.js +0 -2
- package/build/client/assets/discord-Xp0X4-Fl.js.map +0 -1
- package/build/client/assets/entry.client-0j1eoieD.js +0 -80
- package/build/client/assets/entry.client-0j1eoieD.js.map +0 -1
- package/build/client/assets/epic-video-BwtXsHGU.js.map +0 -1
- package/build/client/assets/finished-Cu9PZd5Q.js +0 -2
- package/build/client/assets/finished-Cu9PZd5Q.js.map +0 -1
- package/build/client/assets/index-Bg9MMnnf.js.map +0 -1
- package/build/client/assets/index-D6ygCrVn.js +0 -37
- package/build/client/assets/index-D6ygCrVn.js.map +0 -1
- package/build/client/assets/index-r90CY6Wk.js +0 -8
- package/build/client/assets/index-r90CY6Wk.js.map +0 -1
- package/build/client/assets/manifest-b31ba37c.js +0 -1
- package/build/client/assets/mdx-BYvGbvEr.js +0 -2
- package/build/client/assets/misc-DNgC2Frq.js +0 -2
- package/build/client/assets/misc-DNgC2Frq.js.map +0 -1
- package/build/client/assets/progress-CF9Xwfxf.js +0 -2
- package/build/client/assets/progress-CF9Xwfxf.js.map +0 -1
- package/build/client/assets/root-BQ7V6fP4.js.map +0 -1
- package/build/client/assets/tailwind-Ck4g-nq0.css +0 -1
- package/build/client/assets/tooltip-Kw0lYWBI.js +0 -2
- package/build/client/assets/tooltip-Kw0lYWBI.js.map +0 -1
- package/node_modules/@babel/runtime/helpers/AsyncGenerator.js +0 -64
- package/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js +0 -64
- package/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +0 -10
- package/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js +0 -8
- package/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +0 -10
- package/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js +0 -8
- package/node_modules/@conform-to/dom/rollup.config.js +0 -100
- package/node_modules/@conform-to/react/rollup.config.js +0 -102
- package/node_modules/@conform-to/zod/rollup.config.js +0 -100
- package/node_modules/@radix-ui/number/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/primitive/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-accordion/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-arrow/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-collapsible/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-collection/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-compose-refs/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-context/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-direction/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-dismissable-layer/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-focus-guards/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-focus-scope/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-id/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-popover/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-popper/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-portal/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-presence/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-primitive/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-roving-focus/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-select/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-slot/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-tabs/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-toast/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-use-previous/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-use-rect/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-use-size/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/react-visually-hidden/dist/index.d.ts.map +0 -1
- package/node_modules/@radix-ui/rect/dist/index.d.ts.map +0 -1
- package/node_modules/@remix-run/server-runtime/node_modules/source-map/dist/source-map.js +0 -1
- package/node_modules/@remix-run/server-runtime/node_modules/source-map/lib/array-set.js +0 -100
- package/node_modules/@remix-run/server-runtime/node_modules/source-map/lib/base64.js +0 -18
- package/node_modules/@remix-run/server-runtime/node_modules/source-map/lib/mapping-list.js +0 -80
- package/node_modules/@remix-run/server-runtime/node_modules/source-map/lib/source-map-consumer.js +0 -1237
- package/node_modules/@remix-run/server-runtime/node_modules/source-map/lib/source-node.js +0 -404
- package/node_modules/@remix-run/server-runtime/node_modules/source-map/source-map.d.ts +0 -369
- package/node_modules/@remix-run/server-runtime/node_modules/source-map/source-map.js +0 -8
- package/node_modules/framer-motion/dist/projection.dev.js +0 -6659
- /package/node_modules/{@remix-run/server-runtime/node_modules/source-map → source-map}/LICENSE +0 -0
- /package/node_modules/{@remix-run/server-runtime/node_modules/source-map → source-map}/lib/mappings.wasm +0 -0
- /package/node_modules/{@remix-run/server-runtime/node_modules/source-map → source-map}/lib/read-wasm.js +0 -0
- /package/node_modules/{@remix-run/server-runtime/node_modules/source-map → source-map}/lib/wasm.js +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/and.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/array-indices.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/array-slice.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/array-splice.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/array-values.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/async-return-type.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/asyncify.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/basic.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/camel-case.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/camel-cased-properties-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/camel-cased-properties.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/conditional-except.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/conditional-keys.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/conditional-pick-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/conditional-pick.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/conditional-simplify.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/delimiter-case.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/delimiter-cased-properties-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/delimiter-cased-properties.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/distributed-omit.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/distributed-pick.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/empty-object.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/enforce-optional.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/entries.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/entry.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/exact.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/except.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/fixed-length-array.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/get.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/global-this.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/greater-than-or-equal.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/greater-than.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/has-optional-keys.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/has-readonly-keys.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/has-required-keys.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/has-writable-keys.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/if-any.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/if-empty-object.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/if-never.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/if-null.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/if-unknown.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/includes.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/int-range.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/internal.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/invariant-of.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/is-any.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/is-equal.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/is-float.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/is-integer.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/is-never.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/is-null.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/is-unknown.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/iterable-element.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/join.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/jsonifiable.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/jsonify.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/kebab-case.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/kebab-cased-properties-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/kebab-cased-properties.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/keys-of-union.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/last-array-element.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/less-than-or-equal.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/less-than.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/literal-to-primitive-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/literal-to-primitive.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/literal-union.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/merge-exclusive.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/merge.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/multidimensional-array.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/multidimensional-readonly-array.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/non-empty-object.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/numeric.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/observable-like.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/omit-index-signature.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/opaque.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/optional-keys-of.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/or.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/override-properties.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/package-json.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/partial-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/partial-on-undefined-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/pascal-case.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/pascal-cased-properties-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/pascal-cased-properties.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/pick-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/pick-index-signature.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/primitive.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/promisable.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/readonly-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/readonly-keys-of.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/readonly-tuple.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/replace.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/require-all-or-none.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/require-at-least-one.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/require-exactly-one.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/require-one-or-none.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/required-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/required-keys-of.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/screaming-snake-case.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/set-field-type.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/set-non-nullable.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/set-optional.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/set-parameter-type.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/set-readonly.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/set-required.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/set-return-type.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/shared-union-fields-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/single-key-object.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/snake-case.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/snake-cased-properties-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/snake-cased-properties.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/split-words.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/split.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/spread.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/string-key-of.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/string-slice.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/stringified.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/subtract.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/sum.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/tagged-union.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/trim.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/tsconfig-json.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/tuple-to-union.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/typed-array.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/undefined-on-partial-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/union-to-intersection.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/unknown-array.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/unknown-record.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/value-of.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-fest}/source/writable-deep.d.ts +0 -0
- /package/node_modules/{remix-utils/node_modules/type-fest → type-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IAAAA,gBAAgB,KAAA,KAAA,CAAhB,IAAAA,gBAAgB,CAAE5F,KAAlB,EAAA4F,CAAAA;YAJ2B,CAM7B,qFADC;YAEDD,KAAK,GAAGE,iCAAW,CAACF,KAAD,EAAQ7F,UAAR,CAAnB,CAAA6F;YACAA,KAAK,CAACG,OAAN,CAAchG,UAAd,CAAA6F,CAAAA;SATG;QAYLjD,MAAM,EAAC5C,UAAD,EAA4B;YAAA,IAAA,OAAA,AAAA;YAChC6F,KAAK,GAAGE,iCAAW,CAACF,KAAD,EAAQ7F,UAAR,CAAnB,CAAA6F;YACA,CAAA,OAAA,GAAAA,KAAK,CAAC,CAAD,CAAL,CAAA,KAAA,IAAA,IAAA,OAAA,KAAA,KAAA,CAAA,IAAA,OAAA,CAAU1F,MAAV,EAAA,CAAA;SACD;KAfH,CAAO;CAiBR;AAED,SAAS4F,iCAAT,CAAwBE,KAAxB,EAAoCC,IAApC,EAA6C;IAC3C,MAAMC,YAAY,GAAG;WAAIF,KAAJ;KAArB,AAAA;IACA,MAAMG,KAAK,GAAGD,YAAY,CAACE,OAAb,CAAqBH,IAArB,CAAd,AAAA;IACA,IAAIE,KAAK,KAAK,EAAd,EACED,YAAY,CAACG,MAAb,CAAoBF,KAApB,EAA2B,CAA3B,CAAAD,CAAAA;IAEF,OAAOA,YAAP,CAAA;CACD;AAED,SAAS3D,iCAAT,CAAqB+D,KAArB,EAA2C;IACzC,OAAOA,KAAK,CAACC,MAAN,CAAcN,CAAAA,IAAD,GAAUA,IAAI,CAAC5B,OAAL,KAAiB,GAAxC;IAAA,CAAP,CAAA;CACD;AAED,MAAMlG,yCAAI,GAAGD,yCAAb,AAAA;;AD1VA","sources":["packages/react/focus-scope/src/index.ts","packages/react/focus-scope/src/FocusScope.tsx"],"sourcesContent":["export {\n FocusScope,\n //\n Root,\n} from './FocusScope';\nexport type { FocusScopeProps } from './FocusScope';\n","import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\nimport type * as Radix from '@radix-ui/react-primitive';\n\nconst AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';\nconst AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\ntype FocusableTarget = HTMLElement | { focus(): void };\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope\n * -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_SCOPE_NAME = 'FocusScope';\n\ntype FocusScopeElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface FocusScopeProps extends PrimitiveDivProps {\n /**\n * When `true`, tabbing from last item will focus first tabbable\n * and shift+tab from first item will focus last tababble.\n * @defaultValue false\n */\n loop?: boolean;\n\n /**\n * When `true`, focus cannot escape the focus scope via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapped?: boolean;\n\n /**\n * Event handler called when auto-focusing on mount.\n * Can be prevented.\n */\n onMountAutoFocus?: (event: Event) => void;\n\n /**\n * Event handler called when auto-focusing on unmount.\n * Can be prevented.\n */\n onUnmountAutoFocus?: (event: Event) => void;\n}\n\nconst FocusScope = React.forwardRef<FocusScopeElement, FocusScopeProps>((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState<HTMLElement | null>(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef<HTMLElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n },\n }).current;\n\n // Takes care of trapping focus if focus is moved outside programmatically for example\n React.useEffect(() => {\n if (trapped) {\n function handleFocusIn(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const target = event.target as HTMLElement | null;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n function handleFocusOut(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget as HTMLElement | null;\n\n // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:\n //\n // 1. When the user switches app/tabs/windows/the browser itself loses focus.\n // 2. In Google Chrome, when the focused element is removed from the DOM.\n //\n // We let the browser do its thing here because:\n //\n // 1. The browser already keeps a memory of what's focused for when the page gets refocused.\n // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it\n // throws the CPU to 100%, so we avoid doing anything for this reason here too.\n if (relatedTarget === null) return;\n\n // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)\n // that is outside the container, we move focus to the last valid focused element inside.\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n // When the focused element gets removed from the DOM, browsers move focus\n // back to the document.body. In this case, we move focus to the container\n // to keep focus trapped correctly.\n function handleMutations(mutations: MutationRecord[]) {\n const focusedElement = document.activeElement as HTMLElement | null;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n }\n\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n const mutationObserver = new MutationObserver(handleMutations);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n\n return () => {\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n\n // We hit a react bug (fixed in v17) with focusing in unmount.\n // We need to delay the focus a little to get around it for now.\n // See: https://github.com/facebook/react/issues/17894\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n // we need to remove the listener after we `dispatchEvent`\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n\n // Takes care of looping focus (when tabbing whilst at the edges)\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n\n return (\n <Primitive.div tabIndex={-1} {...scopeProps} ref={composedRefs} onKeyDown={handleKeyDown} />\n );\n});\n\nFocusScope.displayName = FOCUS_SCOPE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Attempts focusing the first element in a list of candidates.\n * Stops when focus has actually moved.\n */\nfunction focusFirst(candidates: HTMLElement[], { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\n\n/**\n * Returns the first and last tabbable elements inside a container.\n */\nfunction getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last] as const;\n}\n\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nfunction getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n\n/**\n * Returns the first visible element in a list.\n * NOTE: Only checks visibility up to the `container`.\n */\nfunction findVisible(elements: HTMLElement[], container: HTMLElement) {\n for (const element of elements) {\n // we stop checking if it's hidden at the `container` level (excluding)\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\n\nfunction isHidden(node: HTMLElement, { upTo }: { upTo?: HTMLElement }) {\n if (getComputedStyle(node).visibility === 'hidden') return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (upTo !== undefined && node === upTo) return false;\n if (getComputedStyle(node).display === 'none') return true;\n node = node.parentElement as HTMLElement;\n }\n return false;\n}\n\nfunction isSelectableInput(element: any): element is FocusableTarget & { select: () => void } {\n return element instanceof HTMLInputElement && 'select' in element;\n}\n\nfunction focus(element?: FocusableTarget | null, { select = false } = {}) {\n // only focus if that element is focusable\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users\n element.focus({ preventScroll: true });\n // only select if its not the same element, it supports selection and we need to select\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope stack\n * -----------------------------------------------------------------------------------------------*/\n\ntype FocusScopeAPI = { paused: boolean; pause(): void; resume(): void };\nconst focusScopesStack = createFocusScopesStack();\n\nfunction createFocusScopesStack() {\n /** A stack of focus scopes, with the active one at the top */\n let stack: FocusScopeAPI[] = [];\n\n return {\n add(focusScope: FocusScopeAPI) {\n // pause the currently active focus scope (at the top of the stack)\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n // remove in case it already exists (because we'll re-add it at the top of the stack)\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n\n remove(focusScope: FocusScopeAPI) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n },\n };\n}\n\nfunction arrayRemove<T>(array: T[], item: T) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\n\nfunction removeLinks(items: HTMLElement[]) {\n return items.filter((item) => item.tagName !== 'A');\n}\n\nconst Root = FocusScope;\n\nexport {\n FocusScope,\n //\n Root,\n};\nexport type { FocusScopeProps };\n"],"names":["FocusScope","Root","React","useComposedRefs","Primitive","useCallbackRef","AUTOFOCUS_ON_MOUNT","AUTOFOCUS_ON_UNMOUNT","EVENT_OPTIONS","bubbles","cancelable","FOCUS_SCOPE_NAME","forwardRef","props","forwardedRef","loop","trapped","onMountAutoFocus","onMountAutoFocusProp","onUnmountAutoFocus","onUnmountAutoFocusProp","scopeProps","container","setContainer","useState","lastFocusedElementRef","useRef","composedRefs","node","focusScope","paused","pause","resume","current","useEffect","handleFocusIn","event","target","contains","focus","select","handleFocusOut","relatedTarget","handleMutations","mutations","focusedElement","document","activeElement","body","mutation","removedNodes","length","addEventListener","mutationObserver","MutationObserver","observe","childList","subtree","removeEventListener","disconnect","focusScopesStack","add","previouslyFocusedElement","hasFocusedCandidate","mountEvent","CustomEvent","dispatchEvent","defaultPrevented","focusFirst","removeLinks","getTabbableCandidates","setTimeout","unmountEvent","remove","handleKeyDown","useCallback","isTabKey","key","altKey","ctrlKey","metaKey","currentTarget","first","last","getTabbableEdges","hasTabbableElementsInside","preventDefault","shiftKey","candidates","candidate","findVisible","reverse","nodes","walker","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","isHiddenInput","tagName","type","disabled","hidden","FILTER_SKIP","tabIndex","FILTER_ACCEPT","nextNode","push","currentNode","elements","element","isHidden","upTo","getComputedStyle","visibility","undefined","display","parentElement","isSelectableInput","HTMLInputElement","preventScroll","createFocusScopesStack","stack","activeFocusScope","arrayRemove","unshift","array","item","updatedArray","index","indexOf","splice","items","filter"],"version":3,"file":"index.js.map"}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts", "../src/FocusScope.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\nexport {\n FocusScope,\n //\n Root,\n} from './FocusScope';\nexport type { FocusScopeProps } from './FocusScope';\n", "import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\nconst AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';\nconst AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\ntype FocusableTarget = HTMLElement | { focus(): void };\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope\n * -----------------------------------------------------------------------------------------------*/\n\nconst FOCUS_SCOPE_NAME = 'FocusScope';\n\ntype FocusScopeElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface FocusScopeProps extends PrimitiveDivProps {\n /**\n * When `true`, tabbing from last item will focus first tabbable\n * and shift+tab from first item will focus last tababble.\n * @defaultValue false\n */\n loop?: boolean;\n\n /**\n * When `true`, focus cannot escape the focus scope via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapped?: boolean;\n\n /**\n * Event handler called when auto-focusing on mount.\n * Can be prevented.\n */\n onMountAutoFocus?: (event: Event) => void;\n\n /**\n * Event handler called when auto-focusing on unmount.\n * Can be prevented.\n */\n onUnmountAutoFocus?: (event: Event) => void;\n}\n\nconst FocusScope = React.forwardRef<FocusScopeElement, FocusScopeProps>((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState<HTMLElement | null>(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef<HTMLElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n },\n }).current;\n\n // Takes care of trapping focus if focus is moved outside programmatically for example\n React.useEffect(() => {\n if (trapped) {\n function handleFocusIn(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const target = event.target as HTMLElement | null;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n function handleFocusOut(event: FocusEvent) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget as HTMLElement | null;\n\n // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:\n //\n // 1. When the user switches app/tabs/windows/the browser itself loses focus.\n // 2. In Google Chrome, when the focused element is removed from the DOM.\n //\n // We let the browser do its thing here because:\n //\n // 1. The browser already keeps a memory of what's focused for when the page gets refocused.\n // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it\n // throws the CPU to 100%, so we avoid doing anything for this reason here too.\n if (relatedTarget === null) return;\n\n // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)\n // that is outside the container, we move focus to the last valid focused element inside.\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }\n\n // When the focused element gets removed from the DOM, browsers move focus\n // back to the document.body. In this case, we move focus to the container\n // to keep focus trapped correctly.\n function handleMutations(mutations: MutationRecord[]) {\n const focusedElement = document.activeElement as HTMLElement | null;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n }\n\n document.addEventListener('focusin', handleFocusIn);\n document.addEventListener('focusout', handleFocusOut);\n const mutationObserver = new MutationObserver(handleMutations);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n\n return () => {\n document.removeEventListener('focusin', handleFocusIn);\n document.removeEventListener('focusout', handleFocusOut);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement as HTMLElement | null;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n\n // We hit a react bug (fixed in v17) with focusing in unmount.\n // We need to delay the focus a little to get around it for now.\n // See: https://github.com/facebook/react/issues/17894\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n // we need to remove the listener after we `dispatchEvent`\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n\n // Takes care of looping focus (when tabbing whilst at the edges)\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n\n const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement as HTMLElement | null;\n\n if (isTabKey && focusedElement) {\n const container = event.currentTarget as HTMLElement;\n const [first, last] = getTabbableEdges(container);\n const hasTabbableElementsInside = first && last;\n\n // we can only wrap focus if we have tabbable edges\n if (!hasTabbableElementsInside) {\n if (focusedElement === container) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n\n return (\n <Primitive.div tabIndex={-1} {...scopeProps} ref={composedRefs} onKeyDown={handleKeyDown} />\n );\n});\n\nFocusScope.displayName = FOCUS_SCOPE_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Attempts focusing the first element in a list of candidates.\n * Stops when focus has actually moved.\n */\nfunction focusFirst(candidates: HTMLElement[], { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\n\n/**\n * Returns the first and last tabbable elements inside a container.\n */\nfunction getTabbableEdges(container: HTMLElement) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last] as const;\n}\n\n/**\n * Returns a list of potential tabbable candidates.\n *\n * NOTE: This is only a close approximation. For example it doesn't take into account cases like when\n * elements are not visible. This cannot be worked out easily by just reading a property, but rather\n * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1\n */\nfunction getTabbableCandidates(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n // we do not take into account the order of nodes with positive `tabIndex` as it\n // hinders accessibility to have tab order different from visual order.\n return nodes;\n}\n\n/**\n * Returns the first visible element in a list.\n * NOTE: Only checks visibility up to the `container`.\n */\nfunction findVisible(elements: HTMLElement[], container: HTMLElement) {\n for (const element of elements) {\n // we stop checking if it's hidden at the `container` level (excluding)\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\n\nfunction isHidden(node: HTMLElement, { upTo }: { upTo?: HTMLElement }) {\n if (getComputedStyle(node).visibility === 'hidden') return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (upTo !== undefined && node === upTo) return false;\n if (getComputedStyle(node).display === 'none') return true;\n node = node.parentElement as HTMLElement;\n }\n return false;\n}\n\nfunction isSelectableInput(element: any): element is FocusableTarget & { select: () => void } {\n return element instanceof HTMLInputElement && 'select' in element;\n}\n\nfunction focus(element?: FocusableTarget | null, { select = false } = {}) {\n // only focus if that element is focusable\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users\n element.focus({ preventScroll: true });\n // only select if its not the same element, it supports selection and we need to select\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * FocusScope stack\n * -----------------------------------------------------------------------------------------------*/\n\ntype FocusScopeAPI = { paused: boolean; pause(): void; resume(): void };\nconst focusScopesStack = createFocusScopesStack();\n\nfunction createFocusScopesStack() {\n /** A stack of focus scopes, with the active one at the top */\n let stack: FocusScopeAPI[] = [];\n\n return {\n add(focusScope: FocusScopeAPI) {\n // pause the currently active focus scope (at the top of the stack)\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n // remove in case it already exists (because we'll re-add it at the top of the stack)\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n\n remove(focusScope: FocusScopeAPI) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n },\n };\n}\n\nfunction arrayRemove<T>(array: T[], item: T) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\n\nfunction removeLinks(items: HTMLElement[]) {\n return items.filter((item) => item.tagName !== 'A');\n}\n\nconst Root = FocusScope;\n\nexport {\n FocusScope,\n //\n Root,\n};\nexport type { FocusScopeProps };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,gCAAgC;AAChC,6BAA0B;AAC1B,oCAA+B;AAwM3B;AAtMJ,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;AAC7B,IAAM,gBAAgB,EAAE,SAAS,OAAO,YAAY,KAAK;AAQzD,IAAM,mBAAmB;AAgCzB,IAAM,aAAmB,iBAA+C,CAAC,OAAO,iBAAiB;AAC/F,QAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,CAAC,WAAW,YAAY,IAAU,eAA6B,IAAI;AACzE,QAAM,uBAAmB,8CAAe,oBAAoB;AAC5D,QAAM,yBAAqB,8CAAe,sBAAsB;AAChE,QAAM,wBAA8B,aAA2B,IAAI;AACnE,QAAM,mBAAe,2CAAgB,cAAc,CAAC,SAAS,aAAa,IAAI,CAAC;AAE/E,QAAM,aAAmB,aAAO;AAAA,IAC9B,QAAQ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AA,IACnB;AAAA,EACF;AACF;AAEA,SAAS,YAAe,OAAY,MAAS;AAC3C,QAAM,eAAe,CAAC,GAAG,KAAK;AAC9B,QAAM,QAAQ,aAAa,QAAQ,IAAI;AACvC,MAAI,UAAU,IAAI;AAChB,iBAAa,OAAO,OAAO,CAAC;AAAA,EAC9B;AACA,SAAO;AACT;AAEA,SAAS,YAAY,OAAsB;AACzC,SAAO,MAAM,OAAO,CAAC,SAAS,KAAK,YAAY,GAAG;AACpD;AAEA,IAAM,OAAO;",
|
|
6
|
+
"names": ["handleFocusIn", "handleFocusOut", "handleMutations", "container"]
|
|
7
|
+
}
|
|
@@ -1,292 +1,214 @@
|
|
|
1
|
-
|
|
2
|
-
import {forwardRef as $45QHv$forwardRef, useState as $45QHv$useState, useRef as $45QHv$useRef, useEffect as $45QHv$useEffect, useCallback as $45QHv$useCallback, createElement as $45QHv$createElement} from "react";
|
|
3
|
-
import {useComposedRefs as $45QHv$useComposedRefs} from "@radix-ui/react-compose-refs";
|
|
4
|
-
import {Primitive as $45QHv$Primitive} from "@radix-ui/react-primitive";
|
|
5
|
-
import {useCallbackRef as $45QHv$useCallbackRef} from "@radix-ui/react-use-callback-ref";
|
|
1
|
+
"use client";
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
function handleFocusOut(event) {
|
|
49
|
-
if (focusScope.paused || !container1) return;
|
|
50
|
-
const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:
|
|
51
|
-
//
|
|
52
|
-
// 1. When the user switches app/tabs/windows/the browser itself loses focus.
|
|
53
|
-
// 2. In Google Chrome, when the focused element is removed from the DOM.
|
|
54
|
-
//
|
|
55
|
-
// We let the browser do its thing here because:
|
|
56
|
-
//
|
|
57
|
-
// 1. The browser already keeps a memory of what's focused for when the page gets refocused.
|
|
58
|
-
// 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it
|
|
59
|
-
// throws the CPU to 100%, so we avoid doing anything for this reason here too.
|
|
60
|
-
if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
|
|
61
|
-
// that is outside the container, we move focus to the last valid focused element inside.
|
|
62
|
-
if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
63
|
-
select: true
|
|
64
|
-
});
|
|
65
|
-
} // When the focused element gets removed from the DOM, browsers move focus
|
|
66
|
-
// back to the document.body. In this case, we move focus to the container
|
|
67
|
-
// to keep focus trapped correctly.
|
|
68
|
-
function handleMutations(mutations) {
|
|
69
|
-
const focusedElement = document.activeElement;
|
|
70
|
-
if (focusedElement !== document.body) return;
|
|
71
|
-
for (const mutation of mutations)if (mutation.removedNodes.length > 0) $d3863c46a17e8a28$var$focus(container1);
|
|
72
|
-
}
|
|
73
|
-
document.addEventListener('focusin', handleFocusIn);
|
|
74
|
-
document.addEventListener('focusout', handleFocusOut);
|
|
75
|
-
const mutationObserver = new MutationObserver(handleMutations);
|
|
76
|
-
if (container1) mutationObserver.observe(container1, {
|
|
77
|
-
childList: true,
|
|
78
|
-
subtree: true
|
|
79
|
-
});
|
|
80
|
-
return ()=>{
|
|
81
|
-
document.removeEventListener('focusin', handleFocusIn);
|
|
82
|
-
document.removeEventListener('focusout', handleFocusOut);
|
|
83
|
-
mutationObserver.disconnect();
|
|
84
|
-
};
|
|
3
|
+
// packages/react/focus-scope/src/FocusScope.tsx
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
6
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
7
|
+
import { useCallbackRef } from "@radix-ui/react-use-callback-ref";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
10
|
+
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
11
|
+
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
12
|
+
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
13
|
+
var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
14
|
+
const {
|
|
15
|
+
loop = false,
|
|
16
|
+
trapped = false,
|
|
17
|
+
onMountAutoFocus: onMountAutoFocusProp,
|
|
18
|
+
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
19
|
+
...scopeProps
|
|
20
|
+
} = props;
|
|
21
|
+
const [container, setContainer] = React.useState(null);
|
|
22
|
+
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
23
|
+
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
24
|
+
const lastFocusedElementRef = React.useRef(null);
|
|
25
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
26
|
+
const focusScope = React.useRef({
|
|
27
|
+
paused: false,
|
|
28
|
+
pause() {
|
|
29
|
+
this.paused = true;
|
|
30
|
+
},
|
|
31
|
+
resume() {
|
|
32
|
+
this.paused = false;
|
|
33
|
+
}
|
|
34
|
+
}).current;
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
if (trapped) {
|
|
37
|
+
let handleFocusIn2 = function(event) {
|
|
38
|
+
if (focusScope.paused || !container) return;
|
|
39
|
+
const target = event.target;
|
|
40
|
+
if (container.contains(target)) {
|
|
41
|
+
lastFocusedElementRef.current = target;
|
|
42
|
+
} else {
|
|
43
|
+
focus(lastFocusedElementRef.current, { select: true });
|
|
85
44
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (container1) {
|
|
93
|
-
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
94
|
-
const previouslyFocusedElement = document.activeElement;
|
|
95
|
-
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
|
|
96
|
-
if (!hasFocusedCandidate) {
|
|
97
|
-
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
98
|
-
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
99
|
-
container1.dispatchEvent(mountEvent);
|
|
100
|
-
if (!mountEvent.defaultPrevented) {
|
|
101
|
-
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
|
|
102
|
-
select: true
|
|
103
|
-
});
|
|
104
|
-
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return ()=>{
|
|
108
|
-
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
|
|
109
|
-
// We need to delay the focus a little to get around it for now.
|
|
110
|
-
// See: https://github.com/facebook/react/issues/17894
|
|
111
|
-
setTimeout(()=>{
|
|
112
|
-
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
113
|
-
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
114
|
-
container1.dispatchEvent(unmountEvent);
|
|
115
|
-
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
|
|
116
|
-
select: true
|
|
117
|
-
});
|
|
118
|
-
// we need to remove the listener after we `dispatchEvent`
|
|
119
|
-
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
120
|
-
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
|
|
121
|
-
}, 0);
|
|
122
|
-
};
|
|
45
|
+
}, handleFocusOut2 = function(event) {
|
|
46
|
+
if (focusScope.paused || !container) return;
|
|
47
|
+
const relatedTarget = event.relatedTarget;
|
|
48
|
+
if (relatedTarget === null) return;
|
|
49
|
+
if (!container.contains(relatedTarget)) {
|
|
50
|
+
focus(lastFocusedElementRef.current, { select: true });
|
|
123
51
|
}
|
|
124
|
-
|
|
125
|
-
container1,
|
|
126
|
-
onMountAutoFocus,
|
|
127
|
-
onUnmountAutoFocus,
|
|
128
|
-
focusScope
|
|
129
|
-
]); // Takes care of looping focus (when tabbing whilst at the edges)
|
|
130
|
-
const handleKeyDown = $45QHv$useCallback((event)=>{
|
|
131
|
-
if (!loop && !trapped) return;
|
|
132
|
-
if (focusScope.paused) return;
|
|
133
|
-
const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
52
|
+
}, handleMutations2 = function(mutations) {
|
|
134
53
|
const focusedElement = document.activeElement;
|
|
135
|
-
if (
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
|
|
139
|
-
if (!hasTabbableElementsInside) {
|
|
140
|
-
if (focusedElement === container) event.preventDefault();
|
|
141
|
-
} else {
|
|
142
|
-
if (!event.shiftKey && focusedElement === last) {
|
|
143
|
-
event.preventDefault();
|
|
144
|
-
if (loop) $d3863c46a17e8a28$var$focus(first, {
|
|
145
|
-
select: true
|
|
146
|
-
});
|
|
147
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
148
|
-
event.preventDefault();
|
|
149
|
-
if (loop) $d3863c46a17e8a28$var$focus(last, {
|
|
150
|
-
select: true
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
54
|
+
if (focusedElement !== document.body) return;
|
|
55
|
+
for (const mutation of mutations) {
|
|
56
|
+
if (mutation.removedNodes.length > 0) focus(container);
|
|
154
57
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
});
|
|
167
|
-
/*#__PURE__*/ Object.assign($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
168
|
-
displayName: $d3863c46a17e8a28$var$FOCUS_SCOPE_NAME
|
|
169
|
-
});
|
|
170
|
-
/* -------------------------------------------------------------------------------------------------
|
|
171
|
-
* Utils
|
|
172
|
-
* -----------------------------------------------------------------------------------------------*/ /**
|
|
173
|
-
* Attempts focusing the first element in a list of candidates.
|
|
174
|
-
* Stops when focus has actually moved.
|
|
175
|
-
*/ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
|
|
176
|
-
const previouslyFocusedElement = document.activeElement;
|
|
177
|
-
for (const candidate of candidates){
|
|
178
|
-
$d3863c46a17e8a28$var$focus(candidate, {
|
|
179
|
-
select: select
|
|
180
|
-
});
|
|
181
|
-
if (document.activeElement !== previouslyFocusedElement) return;
|
|
58
|
+
};
|
|
59
|
+
var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
|
|
60
|
+
document.addEventListener("focusin", handleFocusIn2);
|
|
61
|
+
document.addEventListener("focusout", handleFocusOut2);
|
|
62
|
+
const mutationObserver = new MutationObserver(handleMutations2);
|
|
63
|
+
if (container) mutationObserver.observe(container, { childList: true, subtree: true });
|
|
64
|
+
return () => {
|
|
65
|
+
document.removeEventListener("focusin", handleFocusIn2);
|
|
66
|
+
document.removeEventListener("focusout", handleFocusOut2);
|
|
67
|
+
mutationObserver.disconnect();
|
|
68
|
+
};
|
|
182
69
|
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
* NOTE: This is only a close approximation. For example it doesn't take into account cases like when
|
|
199
|
-
* elements are not visible. This cannot be worked out easily by just reading a property, but rather
|
|
200
|
-
* necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
|
|
201
|
-
*
|
|
202
|
-
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
203
|
-
* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
|
|
204
|
-
*/ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
|
|
205
|
-
const nodes = [];
|
|
206
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
207
|
-
acceptNode: (node)=>{
|
|
208
|
-
const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
|
|
209
|
-
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
210
|
-
// runtime's understanding of tabbability, so this automatically accounts
|
|
211
|
-
// for any kind of element that could be tabbed to.
|
|
212
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
70
|
+
}, [trapped, container, focusScope.paused]);
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
if (container) {
|
|
73
|
+
focusScopesStack.add(focusScope);
|
|
74
|
+
const previouslyFocusedElement = document.activeElement;
|
|
75
|
+
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
76
|
+
if (!hasFocusedCandidate) {
|
|
77
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
78
|
+
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
79
|
+
container.dispatchEvent(mountEvent);
|
|
80
|
+
if (!mountEvent.defaultPrevented) {
|
|
81
|
+
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
82
|
+
if (document.activeElement === previouslyFocusedElement) {
|
|
83
|
+
focus(container);
|
|
84
|
+
}
|
|
213
85
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
86
|
+
}
|
|
87
|
+
return () => {
|
|
88
|
+
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
89
|
+
setTimeout(() => {
|
|
90
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
91
|
+
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
92
|
+
container.dispatchEvent(unmountEvent);
|
|
93
|
+
if (!unmountEvent.defaultPrevented) {
|
|
94
|
+
focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
95
|
+
}
|
|
96
|
+
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
97
|
+
focusScopesStack.remove(focusScope);
|
|
98
|
+
}, 0);
|
|
99
|
+
};
|
|
228
100
|
}
|
|
101
|
+
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
102
|
+
const handleKeyDown = React.useCallback(
|
|
103
|
+
(event) => {
|
|
104
|
+
if (!loop && !trapped) return;
|
|
105
|
+
if (focusScope.paused) return;
|
|
106
|
+
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
107
|
+
const focusedElement = document.activeElement;
|
|
108
|
+
if (isTabKey && focusedElement) {
|
|
109
|
+
const container2 = event.currentTarget;
|
|
110
|
+
const [first, last] = getTabbableEdges(container2);
|
|
111
|
+
const hasTabbableElementsInside = first && last;
|
|
112
|
+
if (!hasTabbableElementsInside) {
|
|
113
|
+
if (focusedElement === container2) event.preventDefault();
|
|
114
|
+
} else {
|
|
115
|
+
if (!event.shiftKey && focusedElement === last) {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
if (loop) focus(first, { select: true });
|
|
118
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
if (loop) focus(last, { select: true });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
[loop, trapped, focusScope.paused]
|
|
126
|
+
);
|
|
127
|
+
return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
128
|
+
});
|
|
129
|
+
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
130
|
+
function focusFirst(candidates, { select = false } = {}) {
|
|
131
|
+
const previouslyFocusedElement = document.activeElement;
|
|
132
|
+
for (const candidate of candidates) {
|
|
133
|
+
focus(candidate, { select });
|
|
134
|
+
if (document.activeElement !== previouslyFocusedElement) return;
|
|
135
|
+
}
|
|
229
136
|
}
|
|
230
|
-
function
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
137
|
+
function getTabbableEdges(container) {
|
|
138
|
+
const candidates = getTabbableCandidates(container);
|
|
139
|
+
const first = findVisible(candidates, container);
|
|
140
|
+
const last = findVisible(candidates.reverse(), container);
|
|
141
|
+
return [first, last];
|
|
142
|
+
}
|
|
143
|
+
function getTabbableCandidates(container) {
|
|
144
|
+
const nodes = [];
|
|
145
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
146
|
+
acceptNode: (node) => {
|
|
147
|
+
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
148
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
149
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
237
150
|
}
|
|
238
|
-
|
|
151
|
+
});
|
|
152
|
+
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
153
|
+
return nodes;
|
|
239
154
|
}
|
|
240
|
-
function
|
|
241
|
-
|
|
155
|
+
function findVisible(elements, container) {
|
|
156
|
+
for (const element of elements) {
|
|
157
|
+
if (!isHidden(element, { upTo: container })) return element;
|
|
158
|
+
}
|
|
242
159
|
}
|
|
243
|
-
function
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
160
|
+
function isHidden(node, { upTo }) {
|
|
161
|
+
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
162
|
+
while (node) {
|
|
163
|
+
if (upTo !== void 0 && node === upTo) return false;
|
|
164
|
+
if (getComputedStyle(node).display === "none") return true;
|
|
165
|
+
node = node.parentElement;
|
|
166
|
+
}
|
|
167
|
+
return false;
|
|
252
168
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
function
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
// remove in case it already exists (because we'll re-add it at the top of the stack)
|
|
264
|
-
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
265
|
-
stack.unshift(focusScope);
|
|
266
|
-
},
|
|
267
|
-
remove (focusScope) {
|
|
268
|
-
var _stack$;
|
|
269
|
-
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
270
|
-
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
|
|
271
|
-
}
|
|
272
|
-
};
|
|
169
|
+
function isSelectableInput(element) {
|
|
170
|
+
return element instanceof HTMLInputElement && "select" in element;
|
|
171
|
+
}
|
|
172
|
+
function focus(element, { select = false } = {}) {
|
|
173
|
+
if (element && element.focus) {
|
|
174
|
+
const previouslyFocusedElement = document.activeElement;
|
|
175
|
+
element.focus({ preventScroll: true });
|
|
176
|
+
if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
|
|
177
|
+
element.select();
|
|
178
|
+
}
|
|
273
179
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
180
|
+
var focusScopesStack = createFocusScopesStack();
|
|
181
|
+
function createFocusScopesStack() {
|
|
182
|
+
let stack = [];
|
|
183
|
+
return {
|
|
184
|
+
add(focusScope) {
|
|
185
|
+
const activeFocusScope = stack[0];
|
|
186
|
+
if (focusScope !== activeFocusScope) {
|
|
187
|
+
activeFocusScope?.pause();
|
|
188
|
+
}
|
|
189
|
+
stack = arrayRemove(stack, focusScope);
|
|
190
|
+
stack.unshift(focusScope);
|
|
191
|
+
},
|
|
192
|
+
remove(focusScope) {
|
|
193
|
+
stack = arrayRemove(stack, focusScope);
|
|
194
|
+
stack[0]?.resume();
|
|
195
|
+
}
|
|
196
|
+
};
|
|
281
197
|
}
|
|
282
|
-
function
|
|
283
|
-
|
|
284
|
-
|
|
198
|
+
function arrayRemove(array, item) {
|
|
199
|
+
const updatedArray = [...array];
|
|
200
|
+
const index = updatedArray.indexOf(item);
|
|
201
|
+
if (index !== -1) {
|
|
202
|
+
updatedArray.splice(index, 1);
|
|
203
|
+
}
|
|
204
|
+
return updatedArray;
|
|
285
205
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
206
|
+
function removeLinks(items) {
|
|
207
|
+
return items.filter((item) => item.tagName !== "A");
|
|
208
|
+
}
|
|
209
|
+
var Root = FocusScope;
|
|
210
|
+
export {
|
|
211
|
+
FocusScope,
|
|
212
|
+
Root
|
|
213
|
+
};
|
|
292
214
|
//# sourceMappingURL=index.mjs.map
|