convex-cms 0.0.6 → 0.0.7-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -97
- package/admin/src/components/ContentEntryEditor.tsx +2 -2
- package/admin/src/components/ContentTypeFormModal.tsx +121 -81
- package/admin/src/components/fields/ReferenceField.tsx +9 -9
- package/admin/src/pages/ContentPage.tsx +11 -19
- package/admin/src/pages/ContentTypesPage.tsx +62 -16
- package/admin/src/routes/entries/$entryId.tsx +1 -1
- package/admin/src/routes/entries/type/$contentTypeId.tsx +1 -1
- package/admin-dist/nitro.json +1 -1
- package/admin-dist/public/assets/CmsEmptyState-CXVkI3FZ.js +1 -0
- package/admin-dist/public/assets/CmsPageHeader-DU9fD34s.js +1 -0
- package/admin-dist/public/assets/{CmsStatusBadge-Dd9uToHE.js → CmsStatusBadge-nZ9TeLBL.js} +1 -1
- package/admin-dist/public/assets/{CmsSurface-DBy5Lumx.js → CmsSurface-DF7OcKg_.js} +1 -1
- package/admin-dist/public/assets/CmsToolbar-5S8FQrSx.js +1 -0
- package/admin-dist/public/assets/ContentEntryEditor-BDb44eTo.js +4 -0
- package/admin-dist/public/assets/TaxonomyFilter-DEN2Q9Lo.js +1 -0
- package/admin-dist/public/assets/_contentTypeId-Ba5iowxH.js +1 -0
- package/admin-dist/public/assets/_entryId-OY3sLz6O.js +1 -0
- package/admin-dist/public/assets/alert-BbW1Q9CR.js +1 -0
- package/admin-dist/public/assets/badge-DdM8Eua8.js +1 -0
- package/admin-dist/public/assets/{circle-check-big-CpLxAvEj.js → circle-check-big-B7eCOM8r.js} +1 -1
- package/admin-dist/public/assets/command-BIjzeKOv.js +1 -0
- package/admin-dist/public/assets/content-BV3YeSSW.js +1 -0
- package/admin-dist/public/assets/content-types-Bm4b2tf8.js +1 -0
- package/admin-dist/public/assets/globals-D41WzvyZ.css +1 -0
- package/admin-dist/public/assets/index-DnJ5Twlv.js +1 -0
- package/admin-dist/public/assets/main-BZB1uYTH.js +102 -0
- package/admin-dist/public/assets/media-BIMN5jXt.js +1 -0
- package/admin-dist/public/assets/new._contentTypeId-DTWb8ZDl.js +1 -0
- package/admin-dist/public/assets/pencil-BDQ1ZWRw.js +1 -0
- package/admin-dist/public/assets/{rotate-ccw-BZpZtw0N.js → rotate-ccw-BWblSIsl.js} +1 -1
- package/admin-dist/public/assets/scroll-area-BoaB6x8v.js +1 -0
- package/admin-dist/public/assets/{search-BvgYr-c9.js → search-CYMIpd39.js} +1 -1
- package/admin-dist/public/assets/settings-DaNDUtr5.js +1 -0
- package/admin-dist/public/assets/switch-DN7TOCa5.js +1 -0
- package/admin-dist/public/assets/tabs-RN__emeJ.js +1 -0
- package/admin-dist/public/assets/tanstack-adapter-DQcKErwf.js +1 -0
- package/admin-dist/public/assets/taxonomies-DylY9HE1.js +1 -0
- package/admin-dist/public/assets/trash-Dp_a2mpb.js +1 -0
- package/admin-dist/public/assets/{useBreadcrumbLabel-D00rvqjw.js → useBreadcrumbLabel-BQ9dJI6T.js} +1 -1
- package/admin-dist/public/assets/usePermissions-WUBNg_Id.js +1 -0
- package/admin-dist/server/_chunks/_libs/@date-fns/tz.mjs +2 -2
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-avatar.mjs +1 -1
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-collection.mjs +1 -1
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-context.mjs +2 -2
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-dialog.mjs +2 -2
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-label.mjs +1 -1
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-menu.mjs +1 -1
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-popover.mjs +1 -1
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-primitive.mjs +6 -72
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-select.mjs +1 -1
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-separator.mjs +1 -1
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-slot.mjs +20 -435
- package/admin-dist/server/_chunks/_libs/@radix-ui/react-visually-hidden.mjs +30 -3
- package/admin-dist/server/_chunks/_libs/@tanstack/history.mjs +0 -376
- package/admin-dist/server/_chunks/_libs/@tanstack/react-router.mjs +168 -383
- package/admin-dist/server/_chunks/_libs/@tanstack/router-core.mjs +451 -1195
- package/admin-dist/server/_chunks/_libs/react-dom.mjs +5 -5
- package/admin-dist/server/_chunks/_libs/react.mjs +2 -2
- package/admin-dist/server/_libs/cmdk.mjs +1 -1
- package/admin-dist/server/_libs/convex.mjs +3 -3
- package/admin-dist/server/_libs/cookie-es.mjs +1 -58
- package/admin-dist/server/_libs/date-fns.mjs +1 -1
- package/admin-dist/server/_libs/lucide-react.mjs +110 -103
- package/admin-dist/server/_libs/seroval-plugins.mjs +1 -58
- package/admin-dist/server/_libs/seroval.mjs +1 -1765
- package/admin-dist/server/_libs/zod.mjs +1 -1
- package/admin-dist/server/_ssr/CmsEmptyState-DYh_PPQE.mjs +38 -0
- package/admin-dist/server/_ssr/{CmsPageHeader-ClNPU7Up.mjs → CmsPageHeader-BcniLh49.mjs} +1 -1
- package/admin-dist/server/_ssr/{CmsStatusBadge-CojMbrY7.mjs → CmsStatusBadge-BShWDxwE.mjs} +2 -2
- package/admin-dist/server/_ssr/{CmsSurface-Dcv440rp.mjs → CmsSurface-CHEv-Kba.mjs} +1 -1
- package/admin-dist/server/_ssr/{CmsToolbar-BKv1nL6u.mjs → CmsToolbar-Dqqb216_.mjs} +2 -3
- package/admin-dist/server/_ssr/{ContentEntryEditor-weiXSBdZ.mjs → ContentEntryEditor-DOIAyWME.mjs} +18 -21
- package/admin-dist/server/_ssr/{TaxonomyFilter-BPQ57Mwk.mjs → TaxonomyFilter-BfsPAZ-Y.mjs} +4 -5
- package/admin-dist/server/_ssr/{_contentTypeId-DyyauLOs.mjs → _contentTypeId-CPjmri90.mjs} +34 -43
- package/admin-dist/server/_ssr/{_entryId-9Cafwxmw.mjs → _entryId-D0yu8HuP.mjs} +35 -47
- package/admin-dist/server/_ssr/_tanstack-start-manifest_v-DgCpSt_y.mjs +4 -0
- package/admin-dist/server/_ssr/badge-Cp61aQNc.mjs +39 -0
- package/admin-dist/server/_ssr/{command-CEf8YBxY.mjs → command-BfjE1WJf.mjs} +2 -2
- package/admin-dist/server/_ssr/{config.server-D7JHDcDv.mjs → config.server-BOr7Jxr4.mjs} +5 -14
- package/admin-dist/server/_ssr/{content-ZFWVzO25.mjs → content-DrODe6sA.mjs} +40 -49
- package/admin-dist/server/_ssr/content-types-BPgMwxiT.mjs +459 -0
- package/admin-dist/server/_ssr/{index-BlSIlH4Z.mjs → index-BTHmIC9W.mjs} +26 -28
- package/admin-dist/server/_ssr/index.mjs +3459 -62
- package/admin-dist/server/_ssr/{media-CD2_NUMw.mjs → media-DkvBfmD9.mjs} +31 -43
- package/admin-dist/server/_ssr/{new._contentTypeId-dmZy6PBX.mjs → new._contentTypeId-Co_73sDJ.mjs} +33 -45
- package/admin-dist/server/_ssr/router-CaDgRHfQ.mjs +3031 -0
- package/admin-dist/server/_ssr/{scroll-area-BH_1K-WT.mjs → scroll-area-D3v-O_jk.mjs} +1 -1
- package/admin-dist/server/_ssr/{settings-DVdsoWoh.mjs → settings-MaEXh2Hz.mjs} +30 -39
- package/admin-dist/server/_ssr/{switch-DX_X8vZl.mjs → switch-DmbR03dm.mjs} +1 -1
- package/admin-dist/server/_ssr/{tabs-4FWM0sn8.mjs → tabs-5oFlAGLz.mjs} +2 -3
- package/admin-dist/server/_ssr/{tanstack-adapter-D3ZcKtbY.mjs → tanstack-adapter-DNaUioIZ.mjs} +1 -1
- package/admin-dist/server/_ssr/{taxonomies-BHFfO9Yr.mjs → taxonomies-D3xMK23a.mjs} +30 -39
- package/admin-dist/server/_ssr/{trash-9tUB2KwI.mjs → trash-CNw1mtF1.mjs} +30 -39
- package/admin-dist/server/_ssr/{useBreadcrumbLabel-DVme3DSb.mjs → useBreadcrumbLabel-BQGjOTcy.mjs} +1 -1
- package/admin-dist/server/_ssr/{usePermissions-zAQj-ruE.mjs → usePermissions-D0qtvmNi.mjs} +1 -1
- package/admin-dist/server/index.mjs +162 -204
- package/dist/cli/templates/cmsClient.d.ts +1 -1
- package/dist/cli/templates/cmsClient.d.ts.map +1 -1
- package/dist/cli/templates/cmsClient.js +30 -11
- package/dist/cli/templates/cmsClient.js.map +1 -1
- package/dist/cli/templates/cmsConfig.d.ts +1 -1
- package/dist/cli/templates/cmsConfig.d.ts.map +1 -1
- package/dist/cli/templates/cmsConfig.js +3 -3
- package/dist/client/admin/contentLock.d.ts +4 -4
- package/dist/client/admin/contentLock.d.ts.map +1 -1
- package/dist/client/admin/contentLock.js +1 -1
- package/dist/client/admin/contentLock.js.map +1 -1
- package/dist/client/admin/contentTypes.d.ts +303 -290
- package/dist/client/admin/contentTypes.d.ts.map +1 -1
- package/dist/client/admin/contentTypes.js +101 -9
- package/dist/client/admin/contentTypes.js.map +1 -1
- package/dist/client/admin/entries.d.ts +18 -19
- package/dist/client/admin/entries.d.ts.map +1 -1
- package/dist/client/admin/entries.js +6 -8
- package/dist/client/admin/entries.js.map +1 -1
- package/dist/client/admin/index.d.ts +690 -642
- package/dist/client/admin/index.d.ts.map +1 -1
- package/dist/client/admin/index.js +29 -5
- package/dist/client/admin/index.js.map +1 -1
- package/dist/client/admin/media.d.ts.map +1 -1
- package/dist/client/admin/taxonomies.d.ts.map +1 -1
- package/dist/client/admin/trash.d.ts +3 -4
- package/dist/client/admin/trash.d.ts.map +1 -1
- package/dist/client/admin/types.d.ts +181 -4
- package/dist/client/admin/types.d.ts.map +1 -1
- package/dist/client/admin/validators.d.ts +2009 -25
- package/dist/client/admin/validators.d.ts.map +1 -1
- package/dist/client/admin/validators.js +15 -4
- package/dist/client/admin/validators.js.map +1 -1
- package/dist/client/admin/versions.d.ts +1 -1
- package/dist/client/admin/versions.d.ts.map +1 -1
- package/dist/client/agentTools.d.ts +1 -4
- package/dist/client/agentTools.d.ts.map +1 -1
- package/dist/client/agentTools.js +9 -21
- package/dist/client/agentTools.js.map +1 -1
- package/dist/client/config.d.ts +10 -0
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/config.js +1 -0
- package/dist/client/config.js.map +1 -1
- package/dist/client/defineContent.d.ts +338 -0
- package/dist/client/defineContent.d.ts.map +1 -0
- package/dist/client/defineContent.js +368 -0
- package/dist/client/defineContent.js.map +1 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/queryBuilder.d.ts +0 -15
- package/dist/client/queryBuilder.d.ts.map +1 -1
- package/dist/client/queryBuilder.js +0 -23
- package/dist/client/queryBuilder.js.map +1 -1
- package/dist/client/registry.d.ts +77 -0
- package/dist/client/registry.d.ts.map +1 -0
- package/dist/client/registry.js +95 -0
- package/dist/client/registry.js.map +1 -0
- package/dist/client/schema/defineContentType.d.ts +36 -24
- package/dist/client/schema/defineContentType.d.ts.map +1 -1
- package/dist/client/schema/defineContentType.js +77 -48
- package/dist/client/schema/defineContentType.js.map +1 -1
- package/dist/client/schema/typedClient.d.ts.map +1 -1
- package/dist/client/schema/typedClient.js +2 -10
- package/dist/client/schema/typedClient.js.map +1 -1
- package/dist/client/schema/types.d.ts +16 -9
- package/dist/client/schema/types.d.ts.map +1 -1
- package/dist/client/schema/types.js.map +1 -1
- package/dist/client/utils/toSlug.d.ts +60 -0
- package/dist/client/utils/toSlug.d.ts.map +1 -0
- package/dist/client/utils/toSlug.js +31 -0
- package/dist/client/utils/toSlug.js.map +1 -0
- package/dist/client/wrapper.d.ts +2 -2
- package/dist/client/wrapper.d.ts.map +1 -1
- package/dist/client/wrapper.js +22 -30
- package/dist/client/wrapper.js.map +1 -1
- package/dist/component/_generated/component.d.ts +24 -28
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/authorizationHooks.d.ts +1 -1
- package/dist/component/authorizationHooks.d.ts.map +1 -1
- package/dist/component/authorizationHooks.js +2 -2
- package/dist/component/authorizationHooks.js.map +1 -1
- package/dist/component/bulkOperations.d.ts.map +1 -1
- package/dist/component/bulkOperations.js +7 -4
- package/dist/component/bulkOperations.js.map +1 -1
- package/dist/component/contentEntries.d.ts +18 -56
- package/dist/component/contentEntries.d.ts.map +1 -1
- package/dist/component/contentEntries.js +45 -137
- package/dist/component/contentEntries.js.map +1 -1
- package/dist/component/contentEntryMutations.d.ts +14 -14
- package/dist/component/contentEntryMutations.d.ts.map +1 -1
- package/dist/component/contentEntryMutations.js +40 -43
- package/dist/component/contentEntryMutations.js.map +1 -1
- package/dist/component/contentEntryValidation.d.ts +3 -3
- package/dist/component/contentEntryValidation.js +6 -9
- package/dist/component/contentEntryValidation.js.map +1 -1
- package/dist/component/contentLock.d.ts +7 -7
- package/dist/component/contentLock.js +3 -3
- package/dist/component/contentLock.js.map +1 -1
- package/dist/component/contentTypeMigration.d.ts +1 -1
- package/dist/component/contentTypeMigration.js +2 -2
- package/dist/component/contentTypeMigration.js.map +1 -1
- package/dist/component/contentTypeMutations.js +2 -2
- package/dist/component/contentTypeMutations.js.map +1 -1
- package/dist/component/convex.config.d.ts.map +1 -1
- package/dist/component/convex.config.js +1 -1
- package/dist/component/convex.config.js.map +1 -1
- package/dist/component/eventEmitter.d.ts +0 -1
- package/dist/component/eventEmitter.d.ts.map +1 -1
- package/dist/component/eventEmitter.js.map +1 -1
- package/dist/component/exportImport.d.ts +37 -37
- package/dist/component/exportImport.d.ts.map +1 -1
- package/dist/component/exportImport.js +34 -34
- package/dist/component/exportImport.js.map +1 -1
- package/dist/component/lib/deepReferenceResolver.d.ts +2 -2
- package/dist/component/lib/deepReferenceResolver.d.ts.map +1 -1
- package/dist/component/lib/deepReferenceResolver.js +13 -8
- package/dist/component/lib/deepReferenceResolver.js.map +1 -1
- package/dist/component/lib/ragContentChunker.d.ts +3 -3
- package/dist/component/lib/ragContentChunker.d.ts.map +1 -1
- package/dist/component/lib/ragContentChunker.js +4 -4
- package/dist/component/lib/ragContentChunker.js.map +1 -1
- package/dist/component/lib/referenceResolver.d.ts.map +1 -1
- package/dist/component/lib/referenceResolver.js +10 -17
- package/dist/component/lib/referenceResolver.js.map +1 -1
- package/dist/component/mediaAssetMutations.js +4 -4
- package/dist/component/mediaAssetMutations.js.map +1 -1
- package/dist/component/ragContentIndexer.d.ts +2 -2
- package/dist/component/ragContentIndexer.d.ts.map +1 -1
- package/dist/component/ragContentIndexer.js +44 -48
- package/dist/component/ragContentIndexer.js.map +1 -1
- package/dist/component/roles.d.ts +3 -3
- package/dist/component/scheduledPublish.d.ts +4 -4
- package/dist/component/scheduledPublish.js +3 -3
- package/dist/component/scheduledPublish.js.map +1 -1
- package/dist/component/schema.d.ts +18 -18
- package/dist/component/schema.js +5 -5
- package/dist/component/schema.js.map +1 -1
- package/dist/component/trash.d.ts +6 -9
- package/dist/component/trash.d.ts.map +1 -1
- package/dist/component/trash.js +12 -36
- package/dist/component/trash.js.map +1 -1
- package/dist/component/userContext.d.ts +1 -2
- package/dist/component/userContext.d.ts.map +1 -1
- package/dist/component/userContext.js +1 -2
- package/dist/component/userContext.js.map +1 -1
- package/dist/component/validators.d.ts +27 -33
- package/dist/component/validators.d.ts.map +1 -1
- package/dist/component/validators.js +3 -5
- package/dist/component/validators.js.map +1 -1
- package/dist/component/versionMutations.d.ts +1 -1
- package/dist/component/webhookTrigger.d.ts +14 -14
- package/dist/test.d.ts +30 -30
- package/dist/test.d.ts.map +1 -1
- package/dist/test.js +24 -24
- package/dist/test.js.map +1 -1
- package/package.json +1 -1
- package/admin-dist/public/assets/CmsEmptyState-Do_erIgn.js +0 -5
- package/admin-dist/public/assets/CmsPageHeader-qDwPGi48.js +0 -1
- package/admin-dist/public/assets/CmsToolbar-D1-Y-7SK.js +0 -1
- package/admin-dist/public/assets/ContentEntryEditor-CWBiIx52.js +0 -4
- package/admin-dist/public/assets/TaxonomyFilter-CdYQawxb.js +0 -1
- package/admin-dist/public/assets/_contentTypeId-D9VMP6Gs.js +0 -1
- package/admin-dist/public/assets/_entryId-2FlCfqE7.js +0 -1
- package/admin-dist/public/assets/alert-GxZx0y5c.js +0 -1
- package/admin-dist/public/assets/badge-BAlGIjop.js +0 -1
- package/admin-dist/public/assets/command-di7XCqcv.js +0 -1
- package/admin-dist/public/assets/content-D8zELsDG.js +0 -1
- package/admin-dist/public/assets/content-types-BmzD0krT.js +0 -2
- package/admin-dist/public/assets/globals-BvFfH-v9.css +0 -1
- package/admin-dist/public/assets/index-zqfj4T_v.js +0 -1
- package/admin-dist/public/assets/label-B6PPtKR5.js +0 -1
- package/admin-dist/public/assets/link-2-W2fVnVOf.js +0 -1
- package/admin-dist/public/assets/list-F8O0lZXC.js +0 -1
- package/admin-dist/public/assets/main-dZT72bAG.js +0 -97
- package/admin-dist/public/assets/media-CETueFbV.js +0 -1
- package/admin-dist/public/assets/new._contentTypeId-BV2-TyyR.js +0 -1
- package/admin-dist/public/assets/plus-AABQIF0N.js +0 -1
- package/admin-dist/public/assets/scroll-area-CDfk-zrz.js +0 -1
- package/admin-dist/public/assets/select-BuiHcMzS.js +0 -1
- package/admin-dist/public/assets/settings-DBxbYDvn.js +0 -1
- package/admin-dist/public/assets/switch-DiJvolcs.js +0 -1
- package/admin-dist/public/assets/tabs-Cgz6G_Xy.js +0 -1
- package/admin-dist/public/assets/tanstack-adapter-BknsSgra.js +0 -1
- package/admin-dist/public/assets/taxonomies-DOErsLl5.js +0 -1
- package/admin-dist/public/assets/textarea-CgggMxUX.js +0 -1
- package/admin-dist/public/assets/trash-BU4ANuaW.js +0 -1
- package/admin-dist/public/assets/triangle-alert-lvCbwp0s.js +0 -1
- package/admin-dist/public/assets/usePermissions-D7tQowaF.js +0 -1
- package/admin-dist/server/_libs/h3-v2.mjs +0 -277
- package/admin-dist/server/_ssr/CmsButton-DbzfJru_.mjs +0 -125
- package/admin-dist/server/_ssr/CmsEmptyState-CuvcXr3Z.mjs +0 -290
- package/admin-dist/server/_ssr/_tanstack-start-manifest_v-Dk-FIYPN.mjs +0 -4
- package/admin-dist/server/_ssr/content-types-D25lUE-j.mjs +0 -1312
- package/admin-dist/server/_ssr/label-PblVvdRv.mjs +0 -22
- package/admin-dist/server/_ssr/router-x6Ab8T4s.mjs +0 -1622
- package/admin-dist/server/_ssr/select-CrfEkFJw.mjs +0 -142
- package/admin-dist/server/_ssr/textarea-CZVaroMc.mjs +0 -18
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports, r as reactExports, R as React, a as React$1 } from "../react.mjs";
|
|
2
2
|
import { w as warning } from "../../../_libs/tiny-warning.mjs";
|
|
3
|
-
import { r as replaceEqualDeep,
|
|
3
|
+
import { r as replaceEqualDeep, i as isNotFound, d as defaultGetScrollRestorationKey, a as restoreScroll, e as escapeHtml, s as storageKey, b as rootRouteId, c as isRedirect, g as getLocationChangeInfo, t as transformReadableStreamWithRouter, f as transformPipeableStreamWithRouter, h as isDangerousProtocol, j as exactPathTest, k as removeTrailingSlash, l as deepEqual, m as functionalUpdate, B as BaseRootRoute, n as BaseRoute, o as isModuleNotFoundError, R as RouterCore } from "./router-core.mjs";
|
|
4
4
|
import { i as invariant } from "../../../_libs/tiny-invariant.mjs";
|
|
5
5
|
import { PassThrough } from "node:stream";
|
|
6
|
-
import { R as ReactDOMServer
|
|
6
|
+
import { R as ReactDOMServer } from "../react-dom.mjs";
|
|
7
7
|
import { i as isbot } from "../../../_libs/isbot.mjs";
|
|
8
8
|
import { u as useStore } from "./react-store.mjs";
|
|
9
9
|
function CatchBoundary(props) {
|
|
@@ -137,140 +137,11 @@ function useRouterState(opts) {
|
|
|
137
137
|
}
|
|
138
138
|
const REACT_USE = "use";
|
|
139
139
|
const reactUse = React[REACT_USE];
|
|
140
|
-
const useLayoutEffect = typeof window !== "undefined" ? reactExports.useLayoutEffect : reactExports.useEffect;
|
|
141
|
-
function usePrevious(value) {
|
|
142
|
-
const ref = reactExports.useRef({
|
|
143
|
-
value,
|
|
144
|
-
prev: null
|
|
145
|
-
});
|
|
146
|
-
const current = ref.current.value;
|
|
147
|
-
if (value !== current) {
|
|
148
|
-
ref.current = {
|
|
149
|
-
value,
|
|
150
|
-
prev: current
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return ref.current.prev;
|
|
154
|
-
}
|
|
155
|
-
function useIntersectionObserver(ref, callback, intersectionObserverOptions2 = {}, options = {}) {
|
|
156
|
-
reactExports.useEffect(() => {
|
|
157
|
-
if (!ref.current || options.disabled || typeof IntersectionObserver !== "function") {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
161
|
-
callback(entry);
|
|
162
|
-
}, intersectionObserverOptions2);
|
|
163
|
-
observer.observe(ref.current);
|
|
164
|
-
return () => {
|
|
165
|
-
observer.disconnect();
|
|
166
|
-
};
|
|
167
|
-
}, [callback, intersectionObserverOptions2, options.disabled, ref]);
|
|
168
|
-
}
|
|
169
140
|
function useForwardedRef(ref) {
|
|
170
141
|
const innerRef = reactExports.useRef(null);
|
|
171
142
|
reactExports.useImperativeHandle(ref, () => innerRef.current, []);
|
|
172
143
|
return innerRef;
|
|
173
144
|
}
|
|
174
|
-
function Transitioner() {
|
|
175
|
-
const router = useRouter();
|
|
176
|
-
const mountLoadForRouter = reactExports.useRef({ router, mounted: false });
|
|
177
|
-
const [isTransitioning, setIsTransitioning] = reactExports.useState(false);
|
|
178
|
-
const { hasPendingMatches, isLoading } = useRouterState({
|
|
179
|
-
select: (s) => ({
|
|
180
|
-
isLoading: s.isLoading,
|
|
181
|
-
hasPendingMatches: s.matches.some((d) => d.status === "pending")
|
|
182
|
-
}),
|
|
183
|
-
structuralSharing: true
|
|
184
|
-
});
|
|
185
|
-
const previousIsLoading = usePrevious(isLoading);
|
|
186
|
-
const isAnyPending = isLoading || isTransitioning || hasPendingMatches;
|
|
187
|
-
const previousIsAnyPending = usePrevious(isAnyPending);
|
|
188
|
-
const isPagePending = isLoading || hasPendingMatches;
|
|
189
|
-
const previousIsPagePending = usePrevious(isPagePending);
|
|
190
|
-
router.startTransition = (fn) => {
|
|
191
|
-
setIsTransitioning(true);
|
|
192
|
-
reactExports.startTransition(() => {
|
|
193
|
-
fn();
|
|
194
|
-
setIsTransitioning(false);
|
|
195
|
-
});
|
|
196
|
-
};
|
|
197
|
-
reactExports.useEffect(() => {
|
|
198
|
-
const unsub = router.history.subscribe(
|
|
199
|
-
({ navigateOpts }) => {
|
|
200
|
-
if (navigateOpts?.skipTransitionerLoad) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
router.load();
|
|
204
|
-
}
|
|
205
|
-
);
|
|
206
|
-
const nextLocation = router.buildLocation({
|
|
207
|
-
to: router.latestLocation.pathname,
|
|
208
|
-
search: true,
|
|
209
|
-
params: true,
|
|
210
|
-
hash: true,
|
|
211
|
-
state: true,
|
|
212
|
-
_includeValidateSearch: true
|
|
213
|
-
});
|
|
214
|
-
if (trimPathRight(router.latestLocation.publicHref) !== trimPathRight(nextLocation.publicHref)) {
|
|
215
|
-
router.commitLocation({ ...nextLocation, replace: true });
|
|
216
|
-
}
|
|
217
|
-
return () => {
|
|
218
|
-
unsub();
|
|
219
|
-
};
|
|
220
|
-
}, [router, router.history]);
|
|
221
|
-
useLayoutEffect(() => {
|
|
222
|
-
if (
|
|
223
|
-
// if we are hydrating from SSR, loading is triggered in ssr-client
|
|
224
|
-
typeof window !== "undefined" && router.ssr || mountLoadForRouter.current.router === router && mountLoadForRouter.current.mounted
|
|
225
|
-
) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
mountLoadForRouter.current = { router, mounted: true };
|
|
229
|
-
const tryLoad = async () => {
|
|
230
|
-
try {
|
|
231
|
-
await router.load();
|
|
232
|
-
} catch (err) {
|
|
233
|
-
console.error(err);
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
tryLoad();
|
|
237
|
-
}, [router]);
|
|
238
|
-
useLayoutEffect(() => {
|
|
239
|
-
if (previousIsLoading && !isLoading) {
|
|
240
|
-
router.emit({
|
|
241
|
-
type: "onLoad",
|
|
242
|
-
// When the new URL has committed, when the new matches have been loaded into state.matches
|
|
243
|
-
...getLocationChangeInfo(router.state)
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
}, [previousIsLoading, router, isLoading]);
|
|
247
|
-
useLayoutEffect(() => {
|
|
248
|
-
if (previousIsPagePending && !isPagePending) {
|
|
249
|
-
router.emit({
|
|
250
|
-
type: "onBeforeRouteMount",
|
|
251
|
-
...getLocationChangeInfo(router.state)
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}, [isPagePending, previousIsPagePending, router]);
|
|
255
|
-
useLayoutEffect(() => {
|
|
256
|
-
if (previousIsAnyPending && !isAnyPending) {
|
|
257
|
-
const changeInfo = getLocationChangeInfo(router.state);
|
|
258
|
-
router.emit({
|
|
259
|
-
type: "onResolved",
|
|
260
|
-
...changeInfo
|
|
261
|
-
});
|
|
262
|
-
router.__store.setState((s) => ({
|
|
263
|
-
...s,
|
|
264
|
-
status: "idle",
|
|
265
|
-
resolvedLocation: s.location
|
|
266
|
-
}));
|
|
267
|
-
if (changeInfo.hrefChanged) {
|
|
268
|
-
handleHashScroll(router);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}, [isAnyPending, previousIsAnyPending, router]);
|
|
272
|
-
return null;
|
|
273
|
-
}
|
|
274
145
|
const matchContext = reactExports.createContext(void 0);
|
|
275
146
|
const dummyMatchContext = reactExports.createContext(
|
|
276
147
|
void 0
|
|
@@ -318,9 +189,6 @@ function renderRouteNotFound(router, route, data) {
|
|
|
318
189
|
}
|
|
319
190
|
function ScriptOnce({ children }) {
|
|
320
191
|
const router = useRouter();
|
|
321
|
-
if (!router.isServer) {
|
|
322
|
-
return null;
|
|
323
|
-
}
|
|
324
192
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
325
193
|
"script",
|
|
326
194
|
{
|
|
@@ -333,7 +201,7 @@ function ScriptOnce({ children }) {
|
|
|
333
201
|
}
|
|
334
202
|
function ScrollRestoration() {
|
|
335
203
|
const router = useRouter();
|
|
336
|
-
if (!router.isScrollRestoring ||
|
|
204
|
+
if (!router.isScrollRestoring || false) {
|
|
337
205
|
return null;
|
|
338
206
|
}
|
|
339
207
|
if (typeof router.options.scrollRestoration === "function") {
|
|
@@ -519,16 +387,7 @@ const MatchInner = reactExports.memo(function MatchInnerImpl({
|
|
|
519
387
|
const pendingMinMs = route.options.pendingMinMs ?? router.options.defaultPendingMinMs;
|
|
520
388
|
if (pendingMinMs) {
|
|
521
389
|
const routerMatch = router.getMatch(match.id);
|
|
522
|
-
if (routerMatch && !routerMatch._nonReactive.minPendingPromise)
|
|
523
|
-
if (!router.isServer) {
|
|
524
|
-
const minPendingPromise = createControlledPromise();
|
|
525
|
-
routerMatch._nonReactive.minPendingPromise = minPendingPromise;
|
|
526
|
-
setTimeout(() => {
|
|
527
|
-
minPendingPromise.resolve();
|
|
528
|
-
routerMatch._nonReactive.minPendingPromise = void 0;
|
|
529
|
-
}, pendingMinMs);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
390
|
+
if (routerMatch && !routerMatch._nonReactive.minPendingPromise) ;
|
|
532
391
|
}
|
|
533
392
|
throw router.getMatch(match.id)?._nonReactive.loadPromise;
|
|
534
393
|
}
|
|
@@ -541,7 +400,7 @@ const MatchInner = reactExports.memo(function MatchInnerImpl({
|
|
|
541
400
|
throw router.getMatch(match.id)?._nonReactive.loadPromise;
|
|
542
401
|
}
|
|
543
402
|
if (match.status === "error") {
|
|
544
|
-
|
|
403
|
+
{
|
|
545
404
|
const RouteErrorComponent = (route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent;
|
|
546
405
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
547
406
|
RouteErrorComponent,
|
|
@@ -554,7 +413,6 @@ const MatchInner = reactExports.memo(function MatchInnerImpl({
|
|
|
554
413
|
}
|
|
555
414
|
);
|
|
556
415
|
}
|
|
557
|
-
throw match.error;
|
|
558
416
|
}
|
|
559
417
|
return out;
|
|
560
418
|
});
|
|
@@ -600,9 +458,9 @@ function Matches() {
|
|
|
600
458
|
const rootRoute = router.routesById[rootRouteId];
|
|
601
459
|
const PendingComponent = rootRoute.options.pendingComponent ?? router.options.defaultPendingComponent;
|
|
602
460
|
const pendingElement = PendingComponent ? /* @__PURE__ */ jsxRuntimeExports.jsx(PendingComponent, {}) : null;
|
|
603
|
-
const ResolvedSuspense =
|
|
461
|
+
const ResolvedSuspense = SafeFragment;
|
|
604
462
|
const inner = /* @__PURE__ */ jsxRuntimeExports.jsxs(ResolvedSuspense, { fallback: pendingElement, children: [
|
|
605
|
-
|
|
463
|
+
false,
|
|
606
464
|
/* @__PURE__ */ jsxRuntimeExports.jsx(MatchesInner, {})
|
|
607
465
|
] });
|
|
608
466
|
return router.options.InnerWrap ? /* @__PURE__ */ jsxRuntimeExports.jsx(router.options.InnerWrap, { children: inner }) : inner;
|
|
@@ -798,10 +656,7 @@ function useNavigate(_defaultOpts) {
|
|
|
798
656
|
}
|
|
799
657
|
function useLinkProps(options, forwardedRef) {
|
|
800
658
|
const router = useRouter();
|
|
801
|
-
const [isTransitioning, setIsTransitioning] = reactExports.useState(false);
|
|
802
|
-
const hasRenderFetched = reactExports.useRef(false);
|
|
803
659
|
const innerRef = useForwardedRef(forwardedRef);
|
|
804
|
-
const isHydrated = useHydrated();
|
|
805
660
|
const {
|
|
806
661
|
// custom props
|
|
807
662
|
activeProps,
|
|
@@ -839,79 +694,76 @@ function useLinkProps(options, forwardedRef) {
|
|
|
839
694
|
_fromLocation,
|
|
840
695
|
...propsSafeToSpread
|
|
841
696
|
} = options;
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
return void 0;
|
|
873
|
-
}
|
|
874
|
-
let href = next.maskedLocation ? next.maskedLocation.url.href : next.url.href;
|
|
875
|
-
let external = false;
|
|
876
|
-
if (router.origin) {
|
|
877
|
-
if (href.startsWith(router.origin)) {
|
|
878
|
-
href = router.history.createHref(href.replace(router.origin, "")) || "/";
|
|
879
|
-
} else {
|
|
880
|
-
external = true;
|
|
697
|
+
{
|
|
698
|
+
const safeInternal = isSafeInternal(to);
|
|
699
|
+
if (typeof to === "string" && !safeInternal && // Quick checks to avoid `new URL` in common internal-like cases
|
|
700
|
+
to.indexOf(":") > -1) {
|
|
701
|
+
try {
|
|
702
|
+
new URL(to);
|
|
703
|
+
if (isDangerousProtocol(to)) {
|
|
704
|
+
if (false) ;
|
|
705
|
+
return {
|
|
706
|
+
...propsSafeToSpread,
|
|
707
|
+
ref: innerRef,
|
|
708
|
+
href: void 0,
|
|
709
|
+
...children && { children },
|
|
710
|
+
...target && { target },
|
|
711
|
+
...disabled && { disabled },
|
|
712
|
+
...style && { style },
|
|
713
|
+
...className && { className }
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
return {
|
|
717
|
+
...propsSafeToSpread,
|
|
718
|
+
ref: innerRef,
|
|
719
|
+
href: to,
|
|
720
|
+
...children && { children },
|
|
721
|
+
...target && { target },
|
|
722
|
+
...disabled && { disabled },
|
|
723
|
+
...style && { style },
|
|
724
|
+
...className && { className }
|
|
725
|
+
};
|
|
726
|
+
} catch {
|
|
881
727
|
}
|
|
882
728
|
}
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
729
|
+
const next2 = router.buildLocation({ ...options, from: options.from });
|
|
730
|
+
const hrefOptionPublicHref2 = next2.maskedLocation ? next2.maskedLocation.publicHref : next2.publicHref;
|
|
731
|
+
const hrefOptionExternal2 = next2.maskedLocation ? next2.maskedLocation.external : next2.external;
|
|
732
|
+
const hrefOption2 = getHrefOption(
|
|
733
|
+
hrefOptionPublicHref2,
|
|
734
|
+
hrefOptionExternal2,
|
|
735
|
+
router.history,
|
|
736
|
+
disabled
|
|
737
|
+
);
|
|
738
|
+
const externalLink2 = (() => {
|
|
739
|
+
if (hrefOption2?.external) {
|
|
740
|
+
if (isDangerousProtocol(hrefOption2.href)) {
|
|
741
|
+
return void 0;
|
|
742
|
+
}
|
|
743
|
+
return hrefOption2.href;
|
|
889
744
|
}
|
|
890
|
-
return
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
745
|
+
if (safeInternal) return void 0;
|
|
746
|
+
if (typeof to === "string" && to.indexOf(":") > -1) {
|
|
747
|
+
try {
|
|
748
|
+
new URL(to);
|
|
749
|
+
if (isDangerousProtocol(to)) {
|
|
750
|
+
if (false) ;
|
|
751
|
+
return void 0;
|
|
752
|
+
}
|
|
753
|
+
return to;
|
|
754
|
+
} catch {
|
|
755
|
+
}
|
|
900
756
|
}
|
|
901
|
-
return
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
const isActive = useRouterState({
|
|
909
|
-
select: (s) => {
|
|
910
|
-
if (externalLink) return false;
|
|
911
|
-
if (activeOptions?.exact) {
|
|
757
|
+
return void 0;
|
|
758
|
+
})();
|
|
759
|
+
const isActive2 = (() => {
|
|
760
|
+
if (externalLink2) return false;
|
|
761
|
+
const currentLocation = router.state.location;
|
|
762
|
+
const exact = activeOptions?.exact ?? false;
|
|
763
|
+
if (exact) {
|
|
912
764
|
const testExact = exactPathTest(
|
|
913
|
-
|
|
914
|
-
|
|
765
|
+
currentLocation.pathname,
|
|
766
|
+
next2.pathname,
|
|
915
767
|
router.basepath
|
|
916
768
|
);
|
|
917
769
|
if (!testExact) {
|
|
@@ -919,11 +771,11 @@ function useLinkProps(options, forwardedRef) {
|
|
|
919
771
|
}
|
|
920
772
|
} else {
|
|
921
773
|
const currentPathSplit = removeTrailingSlash(
|
|
922
|
-
|
|
774
|
+
currentLocation.pathname,
|
|
923
775
|
router.basepath
|
|
924
776
|
);
|
|
925
777
|
const nextPathSplit = removeTrailingSlash(
|
|
926
|
-
|
|
778
|
+
next2.pathname,
|
|
927
779
|
router.basepath
|
|
928
780
|
);
|
|
929
781
|
const pathIsFuzzyEqual = currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === "/");
|
|
@@ -931,170 +783,117 @@ function useLinkProps(options, forwardedRef) {
|
|
|
931
783
|
return false;
|
|
932
784
|
}
|
|
933
785
|
}
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
786
|
+
const includeSearch = activeOptions?.includeSearch ?? true;
|
|
787
|
+
if (includeSearch) {
|
|
788
|
+
if (currentLocation.search !== next2.search) {
|
|
789
|
+
const currentSearchEmpty = !currentLocation.search || typeof currentLocation.search === "object" && Object.keys(currentLocation.search).length === 0;
|
|
790
|
+
const nextSearchEmpty = !next2.search || typeof next2.search === "object" && Object.keys(next2.search).length === 0;
|
|
791
|
+
if (!(currentSearchEmpty && nextSearchEmpty)) {
|
|
792
|
+
const searchTest = deepEqual(currentLocation.search, next2.search, {
|
|
793
|
+
partial: !exact,
|
|
794
|
+
ignoreUndefined: !activeOptions?.explicitUndefined
|
|
795
|
+
});
|
|
796
|
+
if (!searchTest) {
|
|
797
|
+
return false;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
941
800
|
}
|
|
942
801
|
}
|
|
943
802
|
if (activeOptions?.includeHash) {
|
|
944
|
-
return
|
|
803
|
+
return false;
|
|
945
804
|
}
|
|
946
805
|
return true;
|
|
806
|
+
})();
|
|
807
|
+
if (externalLink2) {
|
|
808
|
+
return {
|
|
809
|
+
...propsSafeToSpread,
|
|
810
|
+
ref: innerRef,
|
|
811
|
+
href: externalLink2,
|
|
812
|
+
...children && { children },
|
|
813
|
+
...target && { target },
|
|
814
|
+
...disabled && { disabled },
|
|
815
|
+
...style && { style },
|
|
816
|
+
...className && { className }
|
|
817
|
+
};
|
|
947
818
|
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
(entry) => {
|
|
957
|
-
if (entry?.isIntersecting) {
|
|
958
|
-
doPreload();
|
|
819
|
+
const resolvedActiveProps2 = isActive2 ? functionalUpdate(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT;
|
|
820
|
+
const resolvedInactiveProps2 = isActive2 ? STATIC_EMPTY_OBJECT : functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT;
|
|
821
|
+
const resolvedStyle2 = (() => {
|
|
822
|
+
const baseStyle = style;
|
|
823
|
+
const activeStyle = resolvedActiveProps2.style;
|
|
824
|
+
const inactiveStyle = resolvedInactiveProps2.style;
|
|
825
|
+
if (!baseStyle && !activeStyle && !inactiveStyle) {
|
|
826
|
+
return void 0;
|
|
959
827
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
hashScrollIntoView,
|
|
995
|
-
startTransition,
|
|
996
|
-
viewTransition,
|
|
997
|
-
ignoreBlocker
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
};
|
|
1001
|
-
if (externalLink) {
|
|
828
|
+
if (baseStyle && !activeStyle && !inactiveStyle) {
|
|
829
|
+
return baseStyle;
|
|
830
|
+
}
|
|
831
|
+
if (!baseStyle && activeStyle && !inactiveStyle) {
|
|
832
|
+
return activeStyle;
|
|
833
|
+
}
|
|
834
|
+
if (!baseStyle && !activeStyle && inactiveStyle) {
|
|
835
|
+
return inactiveStyle;
|
|
836
|
+
}
|
|
837
|
+
return {
|
|
838
|
+
...baseStyle,
|
|
839
|
+
...activeStyle,
|
|
840
|
+
...inactiveStyle
|
|
841
|
+
};
|
|
842
|
+
})();
|
|
843
|
+
const resolvedClassName2 = (() => {
|
|
844
|
+
const baseClassName = className;
|
|
845
|
+
const activeClassName = resolvedActiveProps2.className;
|
|
846
|
+
const inactiveClassName = resolvedInactiveProps2.className;
|
|
847
|
+
if (!baseClassName && !activeClassName && !inactiveClassName) {
|
|
848
|
+
return "";
|
|
849
|
+
}
|
|
850
|
+
let out = "";
|
|
851
|
+
if (baseClassName) {
|
|
852
|
+
out = baseClassName;
|
|
853
|
+
}
|
|
854
|
+
if (activeClassName) {
|
|
855
|
+
out = out ? `${out} ${activeClassName}` : activeClassName;
|
|
856
|
+
}
|
|
857
|
+
if (inactiveClassName) {
|
|
858
|
+
out = out ? `${out} ${inactiveClassName}` : inactiveClassName;
|
|
859
|
+
}
|
|
860
|
+
return out;
|
|
861
|
+
})();
|
|
1002
862
|
return {
|
|
1003
863
|
...propsSafeToSpread,
|
|
864
|
+
...resolvedActiveProps2,
|
|
865
|
+
...resolvedInactiveProps2,
|
|
866
|
+
href: hrefOption2?.href,
|
|
1004
867
|
ref: innerRef,
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
...
|
|
1008
|
-
...
|
|
1009
|
-
...
|
|
1010
|
-
...
|
|
1011
|
-
...onClick && { onClick },
|
|
1012
|
-
...onFocus && { onFocus },
|
|
1013
|
-
...onMouseEnter && { onMouseEnter },
|
|
1014
|
-
...onMouseLeave && { onMouseLeave },
|
|
1015
|
-
...onTouchStart && { onTouchStart }
|
|
868
|
+
disabled: !!disabled,
|
|
869
|
+
target,
|
|
870
|
+
...resolvedStyle2 && { style: resolvedStyle2 },
|
|
871
|
+
...resolvedClassName2 && { className: resolvedClassName2 },
|
|
872
|
+
...disabled && STATIC_DISABLED_PROPS,
|
|
873
|
+
...isActive2 && STATIC_ACTIVE_PROPS
|
|
1016
874
|
};
|
|
1017
875
|
}
|
|
1018
|
-
const handleFocus = (_) => {
|
|
1019
|
-
if (disabled) return;
|
|
1020
|
-
if (preload) {
|
|
1021
|
-
doPreload();
|
|
1022
|
-
}
|
|
1023
|
-
};
|
|
1024
|
-
const handleTouchStart = handleFocus;
|
|
1025
|
-
const handleEnter = (e) => {
|
|
1026
|
-
if (disabled || !preload) return;
|
|
1027
|
-
if (!preloadDelay) {
|
|
1028
|
-
doPreload();
|
|
1029
|
-
} else {
|
|
1030
|
-
const eventTarget = e.target;
|
|
1031
|
-
if (timeoutMap.has(eventTarget)) {
|
|
1032
|
-
return;
|
|
1033
|
-
}
|
|
1034
|
-
const id = setTimeout(() => {
|
|
1035
|
-
timeoutMap.delete(eventTarget);
|
|
1036
|
-
doPreload();
|
|
1037
|
-
}, preloadDelay);
|
|
1038
|
-
timeoutMap.set(eventTarget, id);
|
|
1039
|
-
}
|
|
1040
|
-
};
|
|
1041
|
-
const handleLeave = (e) => {
|
|
1042
|
-
if (disabled || !preload || !preloadDelay) return;
|
|
1043
|
-
const eventTarget = e.target;
|
|
1044
|
-
const id = timeoutMap.get(eventTarget);
|
|
1045
|
-
if (id) {
|
|
1046
|
-
clearTimeout(id);
|
|
1047
|
-
timeoutMap.delete(eventTarget);
|
|
1048
|
-
}
|
|
1049
|
-
};
|
|
1050
|
-
const resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT;
|
|
1051
|
-
const resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT;
|
|
1052
|
-
const resolvedClassName = [
|
|
1053
|
-
className,
|
|
1054
|
-
resolvedActiveProps.className,
|
|
1055
|
-
resolvedInactiveProps.className
|
|
1056
|
-
].filter(Boolean).join(" ");
|
|
1057
|
-
const resolvedStyle = (style || resolvedActiveProps.style || resolvedInactiveProps.style) && {
|
|
1058
|
-
...style,
|
|
1059
|
-
...resolvedActiveProps.style,
|
|
1060
|
-
...resolvedInactiveProps.style
|
|
1061
|
-
};
|
|
1062
|
-
return {
|
|
1063
|
-
...propsSafeToSpread,
|
|
1064
|
-
...resolvedActiveProps,
|
|
1065
|
-
...resolvedInactiveProps,
|
|
1066
|
-
href: hrefOption?.href,
|
|
1067
|
-
ref: innerRef,
|
|
1068
|
-
onClick: composeHandlers([onClick, handleClick]),
|
|
1069
|
-
onFocus: composeHandlers([onFocus, handleFocus]),
|
|
1070
|
-
onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),
|
|
1071
|
-
onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),
|
|
1072
|
-
onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),
|
|
1073
|
-
disabled: !!disabled,
|
|
1074
|
-
target,
|
|
1075
|
-
...resolvedStyle && { style: resolvedStyle },
|
|
1076
|
-
...resolvedClassName && { className: resolvedClassName },
|
|
1077
|
-
...disabled && STATIC_DISABLED_PROPS,
|
|
1078
|
-
...isActive && STATIC_ACTIVE_PROPS,
|
|
1079
|
-
...isTransitioning && STATIC_TRANSITIONING_PROPS
|
|
1080
|
-
};
|
|
1081
876
|
}
|
|
1082
877
|
const STATIC_EMPTY_OBJECT = {};
|
|
1083
878
|
const STATIC_ACTIVE_OBJECT = { className: "active" };
|
|
1084
879
|
const STATIC_DISABLED_PROPS = { role: "link", "aria-disabled": true };
|
|
1085
880
|
const STATIC_ACTIVE_PROPS = { "data-status": "active", "aria-current": "page" };
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
};
|
|
1091
|
-
const composeHandlers = (handlers) => (e) => {
|
|
1092
|
-
for (const handler of handlers) {
|
|
1093
|
-
if (!handler) continue;
|
|
1094
|
-
if (e.defaultPrevented) return;
|
|
1095
|
-
handler(e);
|
|
881
|
+
function getHrefOption(publicHref, external, history, disabled) {
|
|
882
|
+
if (disabled) return void 0;
|
|
883
|
+
if (external) {
|
|
884
|
+
return { href: publicHref, external: true };
|
|
1096
885
|
}
|
|
1097
|
-
|
|
886
|
+
return {
|
|
887
|
+
href: history.createHref(publicHref) || "/",
|
|
888
|
+
external: false
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
function isSafeInternal(to) {
|
|
892
|
+
if (typeof to !== "string") return false;
|
|
893
|
+
const zero = to.charCodeAt(0);
|
|
894
|
+
if (zero === 47) return to.charCodeAt(1) !== 47;
|
|
895
|
+
return zero === 46;
|
|
896
|
+
}
|
|
1098
897
|
const Link = reactExports.forwardRef(
|
|
1099
898
|
(props, ref) => {
|
|
1100
899
|
const { _asChild, ...rest } = props;
|
|
@@ -1109,9 +908,6 @@ const Link = reactExports.forwardRef(
|
|
|
1109
908
|
return reactExports.createElement(_asChild, linkProps, children);
|
|
1110
909
|
}
|
|
1111
910
|
);
|
|
1112
|
-
function isCtrlEvent(e) {
|
|
1113
|
-
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
1114
|
-
}
|
|
1115
911
|
class Route extends BaseRoute {
|
|
1116
912
|
/**
|
|
1117
913
|
* @deprecated Use the `createRoute` function instead.
|
|
@@ -1394,7 +1190,7 @@ function Script({
|
|
|
1394
1190
|
attrs,
|
|
1395
1191
|
children
|
|
1396
1192
|
}) {
|
|
1397
|
-
|
|
1193
|
+
useRouter();
|
|
1398
1194
|
reactExports.useEffect(() => {
|
|
1399
1195
|
if (attrs?.src) {
|
|
1400
1196
|
const normSrc = (() => {
|
|
@@ -1462,17 +1258,6 @@ function Script({
|
|
|
1462
1258
|
}
|
|
1463
1259
|
return void 0;
|
|
1464
1260
|
}, [attrs, children]);
|
|
1465
|
-
if (!router.isServer) {
|
|
1466
|
-
const { src, ...rest } = attrs || {};
|
|
1467
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1468
|
-
"script",
|
|
1469
|
-
{
|
|
1470
|
-
suppressHydrationWarning: true,
|
|
1471
|
-
dangerouslySetInnerHTML: { __html: "" },
|
|
1472
|
-
...rest
|
|
1473
|
-
}
|
|
1474
|
-
);
|
|
1475
|
-
}
|
|
1476
1261
|
if (attrs?.src && typeof attrs.src === "string") {
|
|
1477
1262
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("script", { ...attrs, suppressHydrationWarning: true });
|
|
1478
1263
|
}
|