@eventcatalog/core 0.2.2 → 0.2.5
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +125 -125
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1bay4w0 +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/images-manifest.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/267.js +41 -36
- package/.next/server/chunks/29.js +16 -15
- package/.next/server/chunks/331.js +945 -0
- package/.next/server/chunks/47.js +10 -1
- package/.next/server/chunks/484.js +2 -4
- package/.next/server/chunks/50.js +4 -3
- package/.next/server/chunks/526.js +6 -4
- package/.next/server/chunks/565.js +5 -5
- package/.next/server/chunks/797.js +5 -4
- package/.next/server/chunks/938.js +4 -3
- package/.next/server/chunks/944.js +21 -16
- package/.next/server/chunks/97.js +257 -195
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_app.js +12 -24
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js +55 -932
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/domains/Shopping/events/AddedItemToCart/logs.html +1 -1
- package/.next/server/pages/domains/Shopping/events/AddedItemToCart/logs.json +1 -1
- package/.next/server/pages/domains/Shopping/events/AddedItemToCart/v/0.0.1.html +2 -2
- package/.next/server/pages/domains/Shopping/events/AddedItemToCart/v/0.0.2.html +2 -2
- package/.next/server/pages/domains/Shopping/events/AddedItemToCart.html +2 -2
- package/.next/server/pages/domains/Shopping/events/RemovedItemFromCart/logs.html +1 -1
- package/.next/server/pages/domains/Shopping/events/RemovedItemFromCart/logs.json +1 -1
- package/.next/server/pages/domains/Shopping/events/RemovedItemFromCart.html +2 -2
- package/.next/server/pages/domains/Shopping.html +2 -2
- package/.next/server/pages/domains/[domain]/events/[name]/logs.js +41 -8
- package/.next/server/pages/domains/[domain]/events/[name]/logs.js.nft.json +1 -1
- package/.next/server/pages/domains/[domain]/events/[name]/v/[version].js +11 -3
- package/.next/server/pages/domains/[domain]/events/[name]/v/[version].js.nft.json +1 -1
- package/.next/server/pages/domains/[domain]/events/[name].js +7 -0
- package/.next/server/pages/domains/[domain]/events/[name].js.nft.json +1 -1
- package/.next/server/pages/domains/[domain]/services/[name].js +12 -4
- package/.next/server/pages/domains/[domain]/services/[name].js.nft.json +1 -1
- package/.next/server/pages/domains/[domain].js +14 -13
- package/.next/server/pages/domains/[domain].js.nft.json +1 -1
- package/.next/server/pages/domains.html +2 -2
- package/.next/server/pages/domains.js +12 -4
- package/.next/server/pages/domains.js.nft.json +1 -1
- package/.next/server/pages/events/OrderComplete/logs.html +1 -1
- package/.next/server/pages/events/OrderComplete/logs.json +1 -1
- package/.next/server/pages/events/OrderComplete.html +2 -2
- package/.next/server/pages/events/OrderConfirmed/logs.html +1 -1
- package/.next/server/pages/events/OrderConfirmed/logs.json +1 -1
- package/.next/server/pages/events/OrderConfirmed.html +2 -2
- package/.next/server/pages/events/OrderRequested/logs.html +1 -1
- package/.next/server/pages/events/OrderRequested/logs.json +1 -1
- package/.next/server/pages/events/OrderRequested.html +2 -2
- package/.next/server/pages/events/PaymentProcessed/logs.html +1 -1
- package/.next/server/pages/events/PaymentProcessed/logs.json +1 -1
- package/.next/server/pages/events/PaymentProcessed.html +2 -2
- package/.next/server/pages/events/RemovedItemFromCart/logs.html +1 -1
- package/.next/server/pages/events/RemovedItemFromCart/logs.json +1 -1
- package/.next/server/pages/events/RemovedItemFromCart.html +2 -2
- package/.next/server/pages/events/ShipmentDelivered/logs.html +1 -1
- package/.next/server/pages/events/ShipmentDelivered/logs.json +1 -1
- package/.next/server/pages/events/ShipmentDelivered.html +2 -2
- package/.next/server/pages/events/ShipmentDispatched/logs.html +1 -1
- package/.next/server/pages/events/ShipmentDispatched/logs.json +1 -1
- package/.next/server/pages/events/ShipmentDispatched.html +2 -2
- package/.next/server/pages/events/ShipmentPrepared/logs.html +1 -1
- package/.next/server/pages/events/ShipmentPrepared/logs.json +1 -1
- package/.next/server/pages/events/ShipmentPrepared.html +2 -2
- package/.next/server/pages/events/[name]/logs.js +7 -0
- package/.next/server/pages/events/[name]/logs.js.nft.json +1 -1
- package/.next/server/pages/events/[name]/v/[version].js +30 -4
- package/.next/server/pages/events/[name]/v/[version].js.nft.json +1 -1
- package/.next/server/pages/events/[name].js +7 -0
- package/.next/server/pages/events/[name].js.nft.json +1 -1
- package/.next/server/pages/events.html +2 -2
- package/.next/server/pages/events.js +12 -4
- package/.next/server/pages/events.js.nft.json +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/overview.js +5 -17
- package/.next/server/pages/overview.js.nft.json +1 -1
- package/.next/server/pages/services/Payment Service.html +2 -2
- package/.next/server/pages/services/Shipping Service.html +2 -2
- package/.next/server/pages/services/[name].js +7 -0
- package/.next/server/pages/services/[name].js.nft.json +1 -1
- package/.next/server/pages/services.html +2 -2
- package/.next/server/pages/services.js +12 -4
- package/.next/server/pages/services.js.nft.json +1 -1
- package/.next/server/pages/users/[id].js +12 -4
- package/.next/server/pages/users/[id].js.nft.json +1 -1
- package/.next/server/pages/users/dboyne.html +2 -2
- package/.next/server/pages/users/mSmith.html +2 -2
- package/.next/server/pages/visualiser.html +2 -2
- package/.next/server/pages/visualiser.js +12 -4
- package/.next/server/pages/visualiser.js.nft.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/server/webpack-runtime.js +17 -39
- package/{out/_next/static/chunks/020d8314.aea2d24215754e7b.js → .next/static/chunks/020d8314.14edf32f1a7a45dc.js} +1 -1
- package/.next/static/chunks/109-c7517eb568876b36.js +1 -0
- package/.next/static/chunks/176cb4e4-59b1695530801e16.js +1 -0
- package/.next/static/chunks/178-c0d21132335f7d58.js +1 -0
- package/.next/static/chunks/274-8d503842229d0944.js +1 -0
- package/.next/static/chunks/2edb282b-b8f4863366339abc.js +1 -0
- package/.next/static/chunks/364-0efd016d31d19995.js +1 -0
- package/.next/static/chunks/5-6380a6f543e8372a.js +1 -0
- package/.next/static/chunks/506-68ae644af2659950.js +1 -0
- package/.next/static/chunks/585-8ff3ec10b43fcb10.js +1 -0
- package/.next/static/chunks/650-7b49ecd97114e917.js +1 -0
- package/.next/static/chunks/7f5d3f51-83121b73403fb948.js +1 -0
- package/.next/static/chunks/802.7a3e85882c0aeb52.js +1 -0
- package/.next/static/chunks/b744740b-32af777c67e2c3ff.js +1 -0
- package/.next/static/chunks/framework-d23f68ad701fe0b2.js +1 -0
- package/.next/static/chunks/main-b9941e28536fdc23.js +1 -0
- package/.next/static/chunks/pages/_app-2e37f6bdeff8f48f.js +1 -0
- package/.next/static/chunks/pages/domains/[domain]/events/[name]/logs-9678f8d15063d3b5.js +1 -0
- package/.next/static/chunks/pages/domains/[domain]-2b08aa35416b7fe6.js +1 -0
- package/.next/static/chunks/pages/events/[name]/logs-279caf3ba628e52c.js +1 -0
- package/.next/static/chunks/pages/events-691363297e733e50.js +1 -0
- package/.next/static/chunks/pages/overview-7ada2cb9fcb9a9ea.js +1 -0
- package/.next/static/chunks/pages/services-0a099323cc1d9712.js +1 -0
- package/.next/static/chunks/pages/users/[id]-d1f16749cca85865.js +1 -0
- package/.next/static/chunks/pages/visualiser-6e608dcc36f31bdb.js +1 -0
- package/.next/static/chunks/{webpack-b17b8ef11b94ba66.js → webpack-7adfcbd8c9cf8b5d.js} +1 -1
- package/.next/static/sg3nuxBE93h0VJ0CXy-Od/_buildManifest.js +1 -0
- package/.next/static/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/_middlewareManifest.js +0 -0
- package/.next/static/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/_ssgManifest.js +0 -0
- package/.next/trace +57 -57
- package/CHANGELOG.md +18 -0
- package/components/Grids/EventGrid.tsx +2 -1
- package/components/Sidebars/EventSidebar.tsx +4 -1
- package/out/404/index.html +1 -1
- package/out/_next/data/sg3nuxBE93h0VJ0CXy-Od/domains/Shopping/events/AddedItemToCart/logs.json +1 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/domains/Shopping/events/AddedItemToCart/v/0.0.1.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/domains/Shopping/events/AddedItemToCart/v/0.0.2.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/domains/Shopping/events/AddedItemToCart.json +0 -0
- package/out/_next/data/sg3nuxBE93h0VJ0CXy-Od/domains/Shopping/events/RemovedItemFromCart/logs.json +1 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/domains/Shopping/events/RemovedItemFromCart.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/domains/Shopping.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/domains.json +0 -0
- package/out/_next/data/sg3nuxBE93h0VJ0CXy-Od/events/OrderComplete/logs.json +1 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/events/OrderComplete.json +0 -0
- package/out/_next/data/sg3nuxBE93h0VJ0CXy-Od/events/OrderConfirmed/logs.json +1 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/events/OrderConfirmed.json +0 -0
- package/out/_next/data/sg3nuxBE93h0VJ0CXy-Od/events/OrderRequested/logs.json +1 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/events/OrderRequested.json +0 -0
- package/out/_next/data/sg3nuxBE93h0VJ0CXy-Od/events/PaymentProcessed/logs.json +1 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/events/PaymentProcessed.json +0 -0
- package/out/_next/data/sg3nuxBE93h0VJ0CXy-Od/events/RemovedItemFromCart/logs.json +1 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/events/RemovedItemFromCart.json +0 -0
- package/out/_next/data/sg3nuxBE93h0VJ0CXy-Od/events/ShipmentDelivered/logs.json +1 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/events/ShipmentDelivered.json +0 -0
- package/out/_next/data/sg3nuxBE93h0VJ0CXy-Od/events/ShipmentDispatched/logs.json +1 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/events/ShipmentDispatched.json +0 -0
- package/out/_next/data/sg3nuxBE93h0VJ0CXy-Od/events/ShipmentPrepared/logs.json +1 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/events/ShipmentPrepared.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/events.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/overview.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/services/Payment Service.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/services/Shipping Service.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/services.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/users/dboyne.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/users/mSmith.json +0 -0
- package/out/_next/data/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/visualiser.json +0 -0
- package/{.next/static/chunks/020d8314.aea2d24215754e7b.js → out/_next/static/chunks/020d8314.14edf32f1a7a45dc.js} +1 -1
- package/out/_next/static/chunks/109-c7517eb568876b36.js +1 -0
- package/out/_next/static/chunks/176cb4e4-59b1695530801e16.js +1 -0
- package/out/_next/static/chunks/178-c0d21132335f7d58.js +1 -0
- package/out/_next/static/chunks/274-8d503842229d0944.js +1 -0
- package/out/_next/static/chunks/2edb282b-b8f4863366339abc.js +1 -0
- package/out/_next/static/chunks/364-0efd016d31d19995.js +1 -0
- package/out/_next/static/chunks/5-6380a6f543e8372a.js +1 -0
- package/out/_next/static/chunks/506-68ae644af2659950.js +1 -0
- package/out/_next/static/chunks/585-8ff3ec10b43fcb10.js +1 -0
- package/out/_next/static/chunks/650-7b49ecd97114e917.js +1 -0
- package/out/_next/static/chunks/7f5d3f51-83121b73403fb948.js +1 -0
- package/out/_next/static/chunks/802.7a3e85882c0aeb52.js +1 -0
- package/out/_next/static/chunks/b744740b-32af777c67e2c3ff.js +1 -0
- package/out/_next/static/chunks/framework-d23f68ad701fe0b2.js +1 -0
- package/out/_next/static/chunks/main-b9941e28536fdc23.js +1 -0
- package/out/_next/static/chunks/pages/_app-2e37f6bdeff8f48f.js +1 -0
- package/out/_next/static/chunks/pages/domains/[domain]/events/[name]/logs-9678f8d15063d3b5.js +1 -0
- package/out/_next/static/chunks/pages/domains/[domain]-2b08aa35416b7fe6.js +1 -0
- package/out/_next/static/chunks/pages/events/[name]/logs-279caf3ba628e52c.js +1 -0
- package/out/_next/static/chunks/pages/events-691363297e733e50.js +1 -0
- package/out/_next/static/chunks/pages/overview-7ada2cb9fcb9a9ea.js +1 -0
- package/out/_next/static/chunks/pages/services-0a099323cc1d9712.js +1 -0
- package/out/_next/static/chunks/pages/users/[id]-d1f16749cca85865.js +1 -0
- package/out/_next/static/chunks/pages/visualiser-6e608dcc36f31bdb.js +1 -0
- package/out/_next/static/chunks/{webpack-b17b8ef11b94ba66.js → webpack-7adfcbd8c9cf8b5d.js} +1 -1
- package/out/_next/static/sg3nuxBE93h0VJ0CXy-Od/_buildManifest.js +1 -0
- package/out/_next/static/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/_middlewareManifest.js +0 -0
- package/out/_next/static/{LtNt1L84oXPKXzIoa0aVR → sg3nuxBE93h0VJ0CXy-Od}/_ssgManifest.js +0 -0
- package/out/domains/Shopping/events/AddedItemToCart/index.html +2 -2
- package/out/domains/Shopping/events/AddedItemToCart/logs/index.html +1 -1
- package/out/domains/Shopping/events/AddedItemToCart/v/0.0.1/index.html +2 -2
- package/out/domains/Shopping/events/AddedItemToCart/v/0.0.2/index.html +2 -2
- package/out/domains/Shopping/events/RemovedItemFromCart/index.html +2 -2
- package/out/domains/Shopping/events/RemovedItemFromCart/logs/index.html +1 -1
- package/out/domains/Shopping/index.html +2 -2
- package/out/domains/index.html +2 -2
- package/out/events/OrderComplete/index.html +2 -2
- package/out/events/OrderComplete/logs/index.html +1 -1
- package/out/events/OrderConfirmed/index.html +2 -2
- package/out/events/OrderConfirmed/logs/index.html +1 -1
- package/out/events/OrderRequested/index.html +2 -2
- package/out/events/OrderRequested/logs/index.html +1 -1
- package/out/events/PaymentProcessed/index.html +2 -2
- package/out/events/PaymentProcessed/logs/index.html +1 -1
- package/out/events/RemovedItemFromCart/index.html +2 -2
- package/out/events/RemovedItemFromCart/logs/index.html +1 -1
- package/out/events/ShipmentDelivered/index.html +2 -2
- package/out/events/ShipmentDelivered/logs/index.html +1 -1
- package/out/events/ShipmentDispatched/index.html +2 -2
- package/out/events/ShipmentDispatched/logs/index.html +1 -1
- package/out/events/ShipmentPrepared/index.html +2 -2
- package/out/events/ShipmentPrepared/logs/index.html +1 -1
- package/out/events/index.html +2 -2
- package/out/index.html +1 -1
- package/out/overview/index.html +1 -1
- package/out/services/Payment Service/index.html +2 -2
- package/out/services/Shipping Service/index.html +2 -2
- package/out/services/index.html +2 -2
- package/out/users/dboyne/index.html +2 -2
- package/out/users/mSmith/index.html +2 -2
- package/out/visualiser/index.html +2 -2
- package/package.json +2 -2
- package/pages/_app.tsx +0 -7
- package/pages/_document.tsx +18 -0
- package/pages/domains/[domain]/events/[name]/logs.tsx +9 -3
- package/pages/domains/[domain]/index.tsx +3 -5
- package/pages/events/[name]/logs.tsx +39 -32
- package/pages/events/[name]/v/[version].tsx +6 -0
- package/.next/static/LtNt1L84oXPKXzIoa0aVR/_buildManifest.js +0 -1
- package/.next/static/chunks/109-716dea1303010b4f.js +0 -1
- package/.next/static/chunks/176cb4e4-8a0f6f010ef8accb.js +0 -1
- package/.next/static/chunks/178-e9a666e11fb7c88d.js +0 -1
- package/.next/static/chunks/274-11c4d093341d7201.js +0 -1
- package/.next/static/chunks/2edb282b-9e1cce5842787609.js +0 -1
- package/.next/static/chunks/364-9c039ca46569869e.js +0 -1
- package/.next/static/chunks/5-f60eecf67567a225.js +0 -1
- package/.next/static/chunks/506-12764fcf4b5d93b0.js +0 -1
- package/.next/static/chunks/585-aa9262ea1bcf9d5b.js +0 -1
- package/.next/static/chunks/650-555944cc1eb7714e.js +0 -1
- package/.next/static/chunks/7f5d3f51-7158fdd5a44cedd5.js +0 -1
- package/.next/static/chunks/802.a40c121588cf5040.js +0 -1
- package/.next/static/chunks/b744740b-229c238b25b9eeac.js +0 -1
- package/.next/static/chunks/framework-576ec6a1c1386453.js +0 -1
- package/.next/static/chunks/main-0015f560a7edeb35.js +0 -1
- package/.next/static/chunks/pages/_app-d88c877888678e85.js +0 -1
- package/.next/static/chunks/pages/domains/[domain]/events/[name]/logs-7317f2121b8f0d8c.js +0 -1
- package/.next/static/chunks/pages/domains/[domain]-e39d527b56fd45c8.js +0 -1
- package/.next/static/chunks/pages/events/[name]/logs-707da36de8222a98.js +0 -1
- package/.next/static/chunks/pages/events-5a41c37b360b2fce.js +0 -1
- package/.next/static/chunks/pages/overview-dc5e91549c7e3d52.js +0 -1
- package/.next/static/chunks/pages/services-7fe5a823f1b25f18.js +0 -1
- package/.next/static/chunks/pages/users/[id]-b255611073ef76e0.js +0 -1
- package/.next/static/chunks/pages/visualiser-2fc8224670ac5dff.js +0 -1
- package/out/_next/data/LtNt1L84oXPKXzIoa0aVR/domains/Shopping/events/AddedItemToCart/logs.json +0 -1
- package/out/_next/data/LtNt1L84oXPKXzIoa0aVR/domains/Shopping/events/RemovedItemFromCart/logs.json +0 -1
- package/out/_next/data/LtNt1L84oXPKXzIoa0aVR/events/OrderComplete/logs.json +0 -1
- package/out/_next/data/LtNt1L84oXPKXzIoa0aVR/events/OrderConfirmed/logs.json +0 -1
- package/out/_next/data/LtNt1L84oXPKXzIoa0aVR/events/OrderRequested/logs.json +0 -1
- package/out/_next/data/LtNt1L84oXPKXzIoa0aVR/events/PaymentProcessed/logs.json +0 -1
- package/out/_next/data/LtNt1L84oXPKXzIoa0aVR/events/RemovedItemFromCart/logs.json +0 -1
- package/out/_next/data/LtNt1L84oXPKXzIoa0aVR/events/ShipmentDelivered/logs.json +0 -1
- package/out/_next/data/LtNt1L84oXPKXzIoa0aVR/events/ShipmentDispatched/logs.json +0 -1
- package/out/_next/data/LtNt1L84oXPKXzIoa0aVR/events/ShipmentPrepared/logs.json +0 -1
- package/out/_next/static/LtNt1L84oXPKXzIoa0aVR/_buildManifest.js +0 -1
- package/out/_next/static/chunks/109-716dea1303010b4f.js +0 -1
- package/out/_next/static/chunks/176cb4e4-8a0f6f010ef8accb.js +0 -1
- package/out/_next/static/chunks/178-e9a666e11fb7c88d.js +0 -1
- package/out/_next/static/chunks/274-11c4d093341d7201.js +0 -1
- package/out/_next/static/chunks/2edb282b-9e1cce5842787609.js +0 -1
- package/out/_next/static/chunks/364-9c039ca46569869e.js +0 -1
- package/out/_next/static/chunks/5-f60eecf67567a225.js +0 -1
- package/out/_next/static/chunks/506-12764fcf4b5d93b0.js +0 -1
- package/out/_next/static/chunks/585-aa9262ea1bcf9d5b.js +0 -1
- package/out/_next/static/chunks/650-555944cc1eb7714e.js +0 -1
- package/out/_next/static/chunks/7f5d3f51-7158fdd5a44cedd5.js +0 -1
- package/out/_next/static/chunks/802.a40c121588cf5040.js +0 -1
- package/out/_next/static/chunks/b744740b-229c238b25b9eeac.js +0 -1
- package/out/_next/static/chunks/framework-576ec6a1c1386453.js +0 -1
- package/out/_next/static/chunks/main-0015f560a7edeb35.js +0 -1
- package/out/_next/static/chunks/pages/_app-d88c877888678e85.js +0 -1
- package/out/_next/static/chunks/pages/domains/[domain]/events/[name]/logs-7317f2121b8f0d8c.js +0 -1
- package/out/_next/static/chunks/pages/domains/[domain]-e39d527b56fd45c8.js +0 -1
- package/out/_next/static/chunks/pages/events/[name]/logs-707da36de8222a98.js +0 -1
- package/out/_next/static/chunks/pages/events-5a41c37b360b2fce.js +0 -1
- package/out/_next/static/chunks/pages/overview-dc5e91549c7e3d52.js +0 -1
- package/out/_next/static/chunks/pages/services-7fe5a823f1b25f18.js +0 -1
- package/out/_next/static/chunks/pages/users/[id]-b255611073ef76e0.js +0 -1
- package/out/_next/static/chunks/pages/visualiser-2fc8224670ac5dff.js +0 -1
|
@@ -21,8 +21,7 @@ function _interopRequireDefault(obj) {
|
|
|
21
21
|
default: obj
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
const prefetched = {
|
|
25
|
-
};
|
|
24
|
+
const prefetched = {};
|
|
26
25
|
function prefetch(router, href, as, options) {
|
|
27
26
|
if (true) return;
|
|
28
27
|
if (!(0, _router).isLocalURL(href)) return;
|
|
@@ -43,15 +42,13 @@ function isModifiedEvent(event) {
|
|
|
43
42
|
}
|
|
44
43
|
function linkClicked(e, router, href, as, replace, shallow, scroll, locale) {
|
|
45
44
|
const { nodeName } = e.currentTarget;
|
|
46
|
-
|
|
45
|
+
// anchors inside an svg have a lowercase nodeName
|
|
46
|
+
const isAnchorNodeName = nodeName.toUpperCase() === 'A';
|
|
47
|
+
if (isAnchorNodeName && (isModifiedEvent(e) || !(0, _router).isLocalURL(href))) {
|
|
47
48
|
// ignore click for browser’s default behavior
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
e.preventDefault();
|
|
51
|
-
// avoid scroll for urls with anchor refs
|
|
52
|
-
if (scroll == null && as.indexOf('#') >= 0) {
|
|
53
|
-
scroll = false;
|
|
54
|
-
}
|
|
55
52
|
// replace state instead of push if prop is present
|
|
56
53
|
router[replace ? 'replace' : 'push'](href, as, {
|
|
57
54
|
shallow,
|
|
@@ -119,6 +116,7 @@ function Link(props) {
|
|
|
119
116
|
const childProps = {
|
|
120
117
|
ref: setRef,
|
|
121
118
|
onClick: (e)=>{
|
|
119
|
+
if (false) {}
|
|
122
120
|
if (child.props && typeof child.props.onClick === 'function') {
|
|
123
121
|
child.props.onClick(e);
|
|
124
122
|
}
|
|
@@ -262,8 +260,7 @@ function prefetchViaDom(href, as, link) {
|
|
|
262
260
|
}
|
|
263
261
|
const ASSET_LOAD_ERROR = Symbol('ASSET_LOAD_ERROR');
|
|
264
262
|
function markAssetError(err) {
|
|
265
|
-
return Object.defineProperty(err, ASSET_LOAD_ERROR, {
|
|
266
|
-
});
|
|
263
|
+
return Object.defineProperty(err, ASSET_LOAD_ERROR, {});
|
|
267
264
|
}
|
|
268
265
|
function isAssetError(err) {
|
|
269
266
|
return err && ASSET_LOAD_ERROR in err;
|
|
@@ -472,11 +469,9 @@ function createRouteLoader(assetPrefix) {
|
|
|
472
469
|
return getFilesForRoute(assetPrefix, route).then((output)=>Promise.all(canPrefetch ? output.scripts.map((script)=>prefetchViaDom(script, 'script')
|
|
473
470
|
) : [])
|
|
474
471
|
).then(()=>{
|
|
475
|
-
(0, _requestIdleCallback).requestIdleCallback(()=>this.loadRoute(route, true).catch(()=>{
|
|
476
|
-
})
|
|
472
|
+
(0, _requestIdleCallback).requestIdleCallback(()=>this.loadRoute(route, true).catch(()=>{})
|
|
477
473
|
);
|
|
478
|
-
}).catch(()=>{
|
|
479
|
-
});
|
|
474
|
+
}).catch(()=>{});
|
|
480
475
|
}
|
|
481
476
|
};
|
|
482
477
|
} //# sourceMappingURL=route-loader.js.map
|
|
@@ -620,12 +615,10 @@ function createRouter(...args) {
|
|
|
620
615
|
}
|
|
621
616
|
function makePublicRouterInstance(router) {
|
|
622
617
|
const scopedRouter = router;
|
|
623
|
-
const instance = {
|
|
624
|
-
};
|
|
618
|
+
const instance = {};
|
|
625
619
|
for (const property of urlPropertyFields){
|
|
626
620
|
if (typeof scopedRouter[property] === 'object') {
|
|
627
|
-
instance[property] = Object.assign(Array.isArray(scopedRouter[property]) ? [] : {
|
|
628
|
-
}, scopedRouter[property]) // makes sure query is not stateful
|
|
621
|
+
instance[property] = Object.assign(Array.isArray(scopedRouter[property]) ? [] : {}, scopedRouter[property]) // makes sure query is not stateful
|
|
629
622
|
;
|
|
630
623
|
continue;
|
|
631
624
|
}
|
|
@@ -656,10 +649,11 @@ exports.useIntersection = useIntersection;
|
|
|
656
649
|
var _react = __webpack_require__(6689);
|
|
657
650
|
var _requestIdleCallback = __webpack_require__(9071);
|
|
658
651
|
const hasIntersectionObserver = typeof IntersectionObserver !== 'undefined';
|
|
659
|
-
function useIntersection({ rootMargin , disabled }) {
|
|
652
|
+
function useIntersection({ rootRef , rootMargin , disabled }) {
|
|
660
653
|
const isDisabled = disabled || !hasIntersectionObserver;
|
|
661
654
|
const unobserve = (0, _react).useRef();
|
|
662
655
|
const [visible, setVisible] = (0, _react).useState(false);
|
|
656
|
+
const [root, setRoot] = (0, _react).useState(rootRef ? rootRef.current : null);
|
|
663
657
|
const setRef = (0, _react).useCallback((el)=>{
|
|
664
658
|
if (unobserve.current) {
|
|
665
659
|
unobserve.current();
|
|
@@ -669,11 +663,13 @@ function useIntersection({ rootMargin , disabled }) {
|
|
|
669
663
|
if (el && el.tagName) {
|
|
670
664
|
unobserve.current = observe(el, (isVisible)=>isVisible && setVisible(isVisible)
|
|
671
665
|
, {
|
|
666
|
+
root,
|
|
672
667
|
rootMargin
|
|
673
668
|
});
|
|
674
669
|
}
|
|
675
670
|
}, [
|
|
676
671
|
isDisabled,
|
|
672
|
+
root,
|
|
677
673
|
rootMargin,
|
|
678
674
|
visible
|
|
679
675
|
]);
|
|
@@ -689,6 +685,11 @@ function useIntersection({ rootMargin , disabled }) {
|
|
|
689
685
|
}, [
|
|
690
686
|
visible
|
|
691
687
|
]);
|
|
688
|
+
(0, _react).useEffect(()=>{
|
|
689
|
+
if (rootRef) setRoot(rootRef.current);
|
|
690
|
+
}, [
|
|
691
|
+
rootRef
|
|
692
|
+
]);
|
|
692
693
|
return [
|
|
693
694
|
setRef,
|
|
694
695
|
visible
|
|
@@ -705,13 +706,30 @@ function observe(element, callback, options) {
|
|
|
705
706
|
if (elements.size === 0) {
|
|
706
707
|
observer.disconnect();
|
|
707
708
|
observers.delete(id);
|
|
709
|
+
let index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin
|
|
710
|
+
);
|
|
711
|
+
if (index > -1) {
|
|
712
|
+
idList.splice(index, 1);
|
|
713
|
+
}
|
|
708
714
|
}
|
|
709
715
|
};
|
|
710
716
|
}
|
|
711
717
|
const observers = new Map();
|
|
718
|
+
const idList = [];
|
|
712
719
|
function createObserver(options) {
|
|
713
|
-
const id =
|
|
714
|
-
|
|
720
|
+
const id = {
|
|
721
|
+
root: options.root || null,
|
|
722
|
+
margin: options.rootMargin || ''
|
|
723
|
+
};
|
|
724
|
+
let existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin
|
|
725
|
+
);
|
|
726
|
+
let instance;
|
|
727
|
+
if (existing) {
|
|
728
|
+
instance = observers.get(existing);
|
|
729
|
+
} else {
|
|
730
|
+
instance = observers.get(id);
|
|
731
|
+
idList.push(id);
|
|
732
|
+
}
|
|
715
733
|
if (instance) {
|
|
716
734
|
return instance;
|
|
717
735
|
}
|
|
@@ -787,7 +805,7 @@ exports.resolveHref = resolveHref;
|
|
|
787
805
|
exports["default"] = void 0;
|
|
788
806
|
var _normalizeTrailingSlash = __webpack_require__(583);
|
|
789
807
|
var _routeLoader = __webpack_require__(1437);
|
|
790
|
-
var _isError =
|
|
808
|
+
var _isError = _interopRequireWildcard(__webpack_require__(274));
|
|
791
809
|
var _denormalizePagePath = __webpack_require__(562);
|
|
792
810
|
var _normalizeLocalePath = __webpack_require__(4014);
|
|
793
811
|
var _mitt = _interopRequireDefault(__webpack_require__(8020));
|
|
@@ -804,6 +822,27 @@ function _interopRequireDefault(obj) {
|
|
|
804
822
|
default: obj
|
|
805
823
|
};
|
|
806
824
|
}
|
|
825
|
+
function _interopRequireWildcard(obj) {
|
|
826
|
+
if (obj && obj.__esModule) {
|
|
827
|
+
return obj;
|
|
828
|
+
} else {
|
|
829
|
+
var newObj = {};
|
|
830
|
+
if (obj != null) {
|
|
831
|
+
for(var key in obj){
|
|
832
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
833
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
834
|
+
if (desc.get || desc.set) {
|
|
835
|
+
Object.defineProperty(newObj, key, desc);
|
|
836
|
+
} else {
|
|
837
|
+
newObj[key] = obj[key];
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
newObj.default = obj;
|
|
843
|
+
return newObj;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
807
846
|
let detectDomainLocale;
|
|
808
847
|
if (false) {}
|
|
809
848
|
const basePath = false || '';
|
|
@@ -902,8 +941,7 @@ function interpolateAs(route, asPathname, query) {
|
|
|
902
941
|
};
|
|
903
942
|
}
|
|
904
943
|
function omitParmsFromQuery(query, params) {
|
|
905
|
-
const filteredQuery = {
|
|
906
|
-
};
|
|
944
|
+
const filteredQuery = {};
|
|
907
945
|
Object.keys(query).forEach((key)=>{
|
|
908
946
|
if (!params.includes(key)) {
|
|
909
947
|
filteredQuery[key] = query[key];
|
|
@@ -1063,16 +1101,13 @@ function fetchNextData(dataHref, isServerRender, text, inflightCache, persistCac
|
|
|
1063
1101
|
});
|
|
1064
1102
|
}
|
|
1065
1103
|
class Router {
|
|
1066
|
-
constructor(pathname1, query1, as1, { initialProps , pageLoader , App , wrapApp , Component , err
|
|
1104
|
+
constructor(pathname1, query1, as1, { initialProps , pageLoader , App , wrapApp , Component , err , subscription , isFallback , locale , locales , defaultLocale , domainLocales , isPreview }){
|
|
1067
1105
|
// Static Data Cache
|
|
1068
|
-
this.sdc = {
|
|
1069
|
-
};
|
|
1106
|
+
this.sdc = {};
|
|
1070
1107
|
// In-flight Server Data Requests, for deduping
|
|
1071
|
-
this.sdr = {
|
|
1072
|
-
};
|
|
1108
|
+
this.sdr = {};
|
|
1073
1109
|
// In-flight middleware preflight requests
|
|
1074
|
-
this.sde = {
|
|
1075
|
-
};
|
|
1110
|
+
this.sde = {};
|
|
1076
1111
|
this._idx = 0;
|
|
1077
1112
|
this.onPopState = (e)=>{
|
|
1078
1113
|
const state = e.state;
|
|
@@ -1103,7 +1138,7 @@ class Router {
|
|
|
1103
1138
|
const { pathname } = (0, _parseRelativeUrl).parseRelativeUrl(url);
|
|
1104
1139
|
// Make sure we don't re-render on initial load,
|
|
1105
1140
|
// can be caused by navigating back from an external site
|
|
1106
|
-
if (this.isSsr && as === this.asPath && pathname === this.pathname) {
|
|
1141
|
+
if (this.isSsr && as === addBasePath(this.asPath) && pathname === addBasePath(this.pathname)) {
|
|
1107
1142
|
return;
|
|
1108
1143
|
}
|
|
1109
1144
|
// If the downstream application returns falsy, return.
|
|
@@ -1111,27 +1146,25 @@ class Router {
|
|
|
1111
1146
|
if (this._bps && !this._bps(state)) {
|
|
1112
1147
|
return;
|
|
1113
1148
|
}
|
|
1114
|
-
this.change('replaceState', url, as, Object.assign({
|
|
1115
|
-
}, options, {
|
|
1149
|
+
this.change('replaceState', url, as, Object.assign({}, options, {
|
|
1116
1150
|
shallow: options.shallow && this._shallow,
|
|
1117
1151
|
locale: options.locale || this.defaultLocale
|
|
1118
1152
|
}), forcedScroll);
|
|
1119
1153
|
};
|
|
1120
1154
|
// represents the current component key
|
|
1121
|
-
|
|
1155
|
+
const route = (0, _normalizeTrailingSlash).removePathTrailingSlash(pathname1);
|
|
1122
1156
|
// set up the component cache (by route keys)
|
|
1123
|
-
this.components = {
|
|
1124
|
-
};
|
|
1157
|
+
this.components = {};
|
|
1125
1158
|
// We should not keep the cache, if there's an error
|
|
1126
1159
|
// Otherwise, this cause issues when when going back and
|
|
1127
1160
|
// come again to the errored page.
|
|
1128
1161
|
if (pathname1 !== '/_error') {
|
|
1129
1162
|
var ref;
|
|
1130
|
-
this.components[
|
|
1163
|
+
this.components[route] = {
|
|
1131
1164
|
Component,
|
|
1132
1165
|
initial: true,
|
|
1133
1166
|
props: initialProps,
|
|
1134
|
-
err
|
|
1167
|
+
err,
|
|
1135
1168
|
__N_SSG: initialProps && initialProps.__N_SSG,
|
|
1136
1169
|
__N_SSP: initialProps && initialProps.__N_SSP,
|
|
1137
1170
|
__N_RSC: !!((ref = Component) === null || ref === void 0 ? void 0 : ref.__next_rsc__)
|
|
@@ -1145,12 +1178,9 @@ class Router {
|
|
|
1145
1178
|
// TODO: Should be remove the following major version as it was never documented
|
|
1146
1179
|
this.events = Router.events;
|
|
1147
1180
|
this.pageLoader = pageLoader;
|
|
1148
|
-
this.pathname = pathname1;
|
|
1149
|
-
this.query = query1;
|
|
1150
1181
|
// if auto prerendered and dynamic route wait to update asPath
|
|
1151
1182
|
// until after mount to prevent hydration mismatch
|
|
1152
1183
|
const autoExportDynamic = (0, _isDynamic).isDynamicRoute(pathname1) && self.__NEXT_DATA__.autoExport;
|
|
1153
|
-
this.asPath = autoExportDynamic ? pathname1 : as1;
|
|
1154
1184
|
this.basePath = basePath;
|
|
1155
1185
|
this.sub = subscription;
|
|
1156
1186
|
this.clc = null;
|
|
@@ -1158,11 +1188,18 @@ class Router {
|
|
|
1158
1188
|
// make sure to ignore extra popState in safari on navigating
|
|
1159
1189
|
// back from external site
|
|
1160
1190
|
this.isSsr = true;
|
|
1161
|
-
this.isFallback = isFallback;
|
|
1162
|
-
this.isReady = !!(self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || self.__NEXT_DATA__.appGip && !self.__NEXT_DATA__.gsp || !autoExportDynamic && !self.location.search && !false);
|
|
1163
|
-
this.isPreview = !!isPreview;
|
|
1164
1191
|
this.isLocaleDomain = false;
|
|
1192
|
+
this.isReady = !!(self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || self.__NEXT_DATA__.appGip && !self.__NEXT_DATA__.gsp || !autoExportDynamic && !self.location.search && !false);
|
|
1165
1193
|
if (false) {}
|
|
1194
|
+
this.state = {
|
|
1195
|
+
route,
|
|
1196
|
+
pathname: pathname1,
|
|
1197
|
+
query: query1,
|
|
1198
|
+
asPath: autoExportDynamic ? pathname1 : as1,
|
|
1199
|
+
isPreview: !!isPreview,
|
|
1200
|
+
locale: false ? 0 : undefined,
|
|
1201
|
+
isFallback
|
|
1202
|
+
};
|
|
1166
1203
|
if (false) {}
|
|
1167
1204
|
}
|
|
1168
1205
|
reload() {
|
|
@@ -1178,8 +1215,7 @@ class Router {
|
|
|
1178
1215
|
* @param url of the route
|
|
1179
1216
|
* @param as masks `url` for the browser
|
|
1180
1217
|
* @param options object you can define `shallow` and other options
|
|
1181
|
-
*/ push(url, as, options = {
|
|
1182
|
-
}) {
|
|
1218
|
+
*/ push(url, as, options = {}) {
|
|
1183
1219
|
if (false) {}
|
|
1184
1220
|
({ url , as } = prepareUrlAs(this, url, as));
|
|
1185
1221
|
return this.change('pushState', url, as, options);
|
|
@@ -1189,58 +1225,65 @@ class Router {
|
|
|
1189
1225
|
* @param url of the route
|
|
1190
1226
|
* @param as masks `url` for the browser
|
|
1191
1227
|
* @param options object you can define `shallow` and other options
|
|
1192
|
-
*/ replace(
|
|
1193
|
-
|
|
1194
|
-
(
|
|
1195
|
-
return this.change('replaceState', url1, as2, options1);
|
|
1228
|
+
*/ replace(url, as, options = {}) {
|
|
1229
|
+
({ url , as } = prepareUrlAs(this, url, as));
|
|
1230
|
+
return this.change('replaceState', url, as, options);
|
|
1196
1231
|
}
|
|
1197
|
-
async change(method,
|
|
1198
|
-
if (!isLocalURL(
|
|
1199
|
-
window.location.href =
|
|
1232
|
+
async change(method, url, as, options, forcedScroll) {
|
|
1233
|
+
if (!isLocalURL(url)) {
|
|
1234
|
+
window.location.href = url;
|
|
1200
1235
|
return false;
|
|
1201
1236
|
}
|
|
1202
|
-
const shouldResolveHref =
|
|
1237
|
+
const shouldResolveHref = options._h || options._shouldResolveHref || pathNoQueryHash(url) === pathNoQueryHash(as);
|
|
1238
|
+
const nextState = {
|
|
1239
|
+
...this.state
|
|
1240
|
+
};
|
|
1203
1241
|
// for static pages with query params in the URL we delay
|
|
1204
1242
|
// marking the router ready until after the query is updated
|
|
1205
|
-
if (
|
|
1243
|
+
if (options._h) {
|
|
1206
1244
|
this.isReady = true;
|
|
1207
1245
|
}
|
|
1208
|
-
const prevLocale =
|
|
1246
|
+
const prevLocale = nextState.locale;
|
|
1209
1247
|
if (false) { var ref; }
|
|
1210
|
-
if (!
|
|
1248
|
+
if (!options._h) {
|
|
1211
1249
|
this.isSsr = false;
|
|
1212
1250
|
}
|
|
1213
1251
|
// marking route changes as a navigation start entry
|
|
1214
1252
|
if (_utils.ST) {
|
|
1215
1253
|
performance.mark('routeChange');
|
|
1216
1254
|
}
|
|
1217
|
-
const { shallow =false } =
|
|
1255
|
+
const { shallow =false , scroll =true } = options;
|
|
1218
1256
|
const routeProps = {
|
|
1219
1257
|
shallow
|
|
1220
1258
|
};
|
|
1221
1259
|
if (this._inFlightRoute) {
|
|
1222
1260
|
this.abortComponentLoad(this._inFlightRoute, routeProps);
|
|
1223
1261
|
}
|
|
1224
|
-
|
|
1225
|
-
const cleanedAs = delLocale(hasBasePath(
|
|
1226
|
-
this._inFlightRoute =
|
|
1227
|
-
let localeChange = prevLocale !==
|
|
1262
|
+
as = addBasePath(addLocale(hasBasePath(as) ? delBasePath(as) : as, options.locale, this.defaultLocale));
|
|
1263
|
+
const cleanedAs = delLocale(hasBasePath(as) ? delBasePath(as) : as, nextState.locale);
|
|
1264
|
+
this._inFlightRoute = as;
|
|
1265
|
+
let localeChange = prevLocale !== nextState.locale;
|
|
1228
1266
|
// If the url change is only related to a hash change
|
|
1229
1267
|
// We should not proceed. We should only change the state.
|
|
1230
1268
|
// WARNING: `_h` is an internal option for handing Next.js client-side
|
|
1231
1269
|
// hydration. Your app should _never_ use this property. It may change at
|
|
1232
1270
|
// any time without notice.
|
|
1233
|
-
if (!
|
|
1234
|
-
|
|
1235
|
-
Router.events.emit('hashChangeStart',
|
|
1271
|
+
if (!options._h && this.onlyAHashChange(cleanedAs) && !localeChange) {
|
|
1272
|
+
nextState.asPath = cleanedAs;
|
|
1273
|
+
Router.events.emit('hashChangeStart', as, routeProps);
|
|
1236
1274
|
// TODO: do we need the resolved href when only a hash change?
|
|
1237
|
-
this.changeState(method,
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1275
|
+
this.changeState(method, url, as, {
|
|
1276
|
+
...options,
|
|
1277
|
+
scroll: false
|
|
1278
|
+
});
|
|
1279
|
+
if (scroll) {
|
|
1280
|
+
this.scrollToHash(cleanedAs);
|
|
1281
|
+
}
|
|
1282
|
+
this.set(nextState, this.components[nextState.route], null);
|
|
1283
|
+
Router.events.emit('hashChangeComplete', as, routeProps);
|
|
1241
1284
|
return true;
|
|
1242
1285
|
}
|
|
1243
|
-
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(
|
|
1286
|
+
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
|
|
1244
1287
|
let { pathname , query } = parsed;
|
|
1245
1288
|
// The build manifest needs to be loaded before auto-static dynamic pages
|
|
1246
1289
|
// get their query parameters to allow ensuring they can be parsed properly
|
|
@@ -1255,7 +1298,7 @@ class Router {
|
|
|
1255
1298
|
} catch (err) {
|
|
1256
1299
|
// If we fail to resolve the page list or client-build manifest, we must
|
|
1257
1300
|
// do a server-side transition:
|
|
1258
|
-
window.location.href =
|
|
1301
|
+
window.location.href = as;
|
|
1259
1302
|
return false;
|
|
1260
1303
|
}
|
|
1261
1304
|
// If asked to change the current URL we should reload the current page
|
|
@@ -1268,39 +1311,41 @@ class Router {
|
|
|
1268
1311
|
}
|
|
1269
1312
|
// we need to resolve the as value using rewrites for dynamic SSG
|
|
1270
1313
|
// pages to allow building the data URL correctly
|
|
1271
|
-
let resolvedAs =
|
|
1314
|
+
let resolvedAs = as;
|
|
1272
1315
|
// url and as should always be prefixed with basePath by this
|
|
1273
1316
|
// point by either next/link or router.push/replace so strip the
|
|
1274
1317
|
// basePath from the pathname to match the pages dir 1-to-1
|
|
1275
1318
|
pathname = pathname ? (0, _normalizeTrailingSlash).removePathTrailingSlash(delBasePath(pathname)) : pathname;
|
|
1276
1319
|
if (shouldResolveHref && pathname !== '/_error') {
|
|
1277
|
-
|
|
1320
|
+
options._shouldResolveHref = true;
|
|
1278
1321
|
if (false) {} else {
|
|
1279
1322
|
parsed.pathname = resolveDynamicRoute(pathname, pages);
|
|
1280
1323
|
if (parsed.pathname !== pathname) {
|
|
1281
1324
|
pathname = parsed.pathname;
|
|
1282
1325
|
parsed.pathname = addBasePath(pathname);
|
|
1283
|
-
|
|
1326
|
+
url = (0, _utils).formatWithValidation(parsed);
|
|
1284
1327
|
}
|
|
1285
1328
|
}
|
|
1286
1329
|
}
|
|
1287
|
-
if (!isLocalURL(
|
|
1330
|
+
if (!isLocalURL(as)) {
|
|
1288
1331
|
if (false) {}
|
|
1289
|
-
window.location.href =
|
|
1332
|
+
window.location.href = as;
|
|
1290
1333
|
return false;
|
|
1291
1334
|
}
|
|
1292
|
-
resolvedAs = delLocale(delBasePath(resolvedAs),
|
|
1335
|
+
resolvedAs = delLocale(delBasePath(resolvedAs), nextState.locale);
|
|
1293
1336
|
/**
|
|
1294
|
-
* If the route update was triggered for client-side hydration
|
|
1295
|
-
* do not check the preflight
|
|
1296
|
-
*
|
|
1297
|
-
*/ if (
|
|
1337
|
+
* If the route update was triggered for client-side hydration and
|
|
1338
|
+
* the rendered route is not dynamic do not check the preflight
|
|
1339
|
+
* request as it is not necessary.
|
|
1340
|
+
*/ if (options._h !== 1 || (0, _isDynamic).isDynamicRoute((0, _normalizeTrailingSlash).removePathTrailingSlash(pathname))) {
|
|
1298
1341
|
const effect = await this._preflightRequest({
|
|
1299
|
-
as
|
|
1342
|
+
as,
|
|
1300
1343
|
cache: "production" === 'production',
|
|
1301
1344
|
pages,
|
|
1302
1345
|
pathname,
|
|
1303
|
-
query
|
|
1346
|
+
query,
|
|
1347
|
+
locale: nextState.locale,
|
|
1348
|
+
isPreview: nextState.isPreview
|
|
1304
1349
|
});
|
|
1305
1350
|
if (effect.type === 'rewrite') {
|
|
1306
1351
|
query = {
|
|
@@ -1310,17 +1355,15 @@ class Router {
|
|
|
1310
1355
|
resolvedAs = effect.asPath;
|
|
1311
1356
|
pathname = effect.resolvedHref;
|
|
1312
1357
|
parsed.pathname = effect.resolvedHref;
|
|
1313
|
-
|
|
1358
|
+
url = (0, _utils).formatWithValidation(parsed);
|
|
1314
1359
|
} else if (effect.type === 'redirect' && effect.newAs) {
|
|
1315
|
-
return this.change(method, effect.newUrl, effect.newAs,
|
|
1360
|
+
return this.change(method, effect.newUrl, effect.newAs, options);
|
|
1316
1361
|
} else if (effect.type === 'redirect' && effect.destination) {
|
|
1317
1362
|
window.location.href = effect.destination;
|
|
1318
|
-
return new Promise(()=>{
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
return new Promise(()=>{
|
|
1323
|
-
});
|
|
1363
|
+
return new Promise(()=>{});
|
|
1364
|
+
} else if (effect.type === 'refresh' && as !== window.location.pathname) {
|
|
1365
|
+
window.location.href = as;
|
|
1366
|
+
return new Promise(()=>{});
|
|
1324
1367
|
}
|
|
1325
1368
|
}
|
|
1326
1369
|
const route = (0, _normalizeTrailingSlash).removePathTrailingSlash(pathname);
|
|
@@ -1330,18 +1373,16 @@ class Router {
|
|
|
1330
1373
|
const routeRegex = (0, _routeRegex).getRouteRegex(route);
|
|
1331
1374
|
const routeMatch = (0, _routeMatcher).getRouteMatcher(routeRegex)(asPathname);
|
|
1332
1375
|
const shouldInterpolate = route === asPathname;
|
|
1333
|
-
const interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {
|
|
1334
|
-
};
|
|
1376
|
+
const interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {};
|
|
1335
1377
|
if (!routeMatch || shouldInterpolate && !interpolatedAs.result) {
|
|
1336
1378
|
const missingParams = Object.keys(routeRegex.groups).filter((param)=>!query[param]
|
|
1337
1379
|
);
|
|
1338
1380
|
if (missingParams.length > 0) {
|
|
1339
1381
|
if (false) {}
|
|
1340
|
-
throw new Error((shouldInterpolate ? `The provided \`href\` (${
|
|
1382
|
+
throw new Error((shouldInterpolate ? `The provided \`href\` (${url}) value is missing query values (${missingParams.join(', ')}) to be interpolated properly. ` : `The provided \`as\` value (${asPathname}) is incompatible with the \`href\` value (${route}). `) + `Read more: https://nextjs.org/docs/messages/${shouldInterpolate ? 'href-interpolation-failed' : 'incompatible-href-as'}`);
|
|
1341
1383
|
}
|
|
1342
1384
|
} else if (shouldInterpolate) {
|
|
1343
|
-
|
|
1344
|
-
}, parsedAs, {
|
|
1385
|
+
as = (0, _utils).formatWithValidation(Object.assign({}, parsedAs, {
|
|
1345
1386
|
pathname: interpolatedAs.result,
|
|
1346
1387
|
query: omitParmsFromQuery(query, interpolatedAs.params)
|
|
1347
1388
|
}));
|
|
@@ -1350,10 +1391,10 @@ class Router {
|
|
|
1350
1391
|
Object.assign(query, routeMatch);
|
|
1351
1392
|
}
|
|
1352
1393
|
}
|
|
1353
|
-
Router.events.emit('routeChangeStart',
|
|
1394
|
+
Router.events.emit('routeChangeStart', as, routeProps);
|
|
1354
1395
|
try {
|
|
1355
1396
|
var ref, ref1;
|
|
1356
|
-
let routeInfo = await this.getRouteInfo(route, pathname, query,
|
|
1397
|
+
let routeInfo = await this.getRouteInfo(route, pathname, query, as, resolvedAs, routeProps, nextState.locale, nextState.isPreview);
|
|
1357
1398
|
let { error , props , __N_SSG , __N_SSP } = routeInfo;
|
|
1358
1399
|
// handle redirect on client-transition
|
|
1359
1400
|
if ((__N_SSG || __N_SSP) && props) {
|
|
@@ -1366,13 +1407,12 @@ class Router {
|
|
|
1366
1407
|
const parsedHref = (0, _parseRelativeUrl).parseRelativeUrl(destination);
|
|
1367
1408
|
parsedHref.pathname = resolveDynamicRoute(parsedHref.pathname, pages);
|
|
1368
1409
|
const { url: newUrl , as: newAs } = prepareUrlAs(this, destination, destination);
|
|
1369
|
-
return this.change(method, newUrl, newAs,
|
|
1410
|
+
return this.change(method, newUrl, newAs, options);
|
|
1370
1411
|
}
|
|
1371
1412
|
window.location.href = destination;
|
|
1372
|
-
return new Promise(()=>{
|
|
1373
|
-
});
|
|
1413
|
+
return new Promise(()=>{});
|
|
1374
1414
|
}
|
|
1375
|
-
|
|
1415
|
+
nextState.isPreview = !!props.__N_PREVIEW;
|
|
1376
1416
|
// handle SSG data 404
|
|
1377
1417
|
if (props.notFound === SSG_DATA_NOT_FOUND) {
|
|
1378
1418
|
let notFoundRoute;
|
|
@@ -1382,27 +1422,34 @@ class Router {
|
|
|
1382
1422
|
} catch (_) {
|
|
1383
1423
|
notFoundRoute = '/_error';
|
|
1384
1424
|
}
|
|
1385
|
-
routeInfo = await this.getRouteInfo(notFoundRoute, notFoundRoute, query,
|
|
1425
|
+
routeInfo = await this.getRouteInfo(notFoundRoute, notFoundRoute, query, as, resolvedAs, {
|
|
1386
1426
|
shallow: false
|
|
1387
|
-
});
|
|
1427
|
+
}, nextState.locale, nextState.isPreview);
|
|
1388
1428
|
}
|
|
1389
1429
|
}
|
|
1390
|
-
Router.events.emit('beforeHistoryChange',
|
|
1391
|
-
this.changeState(method,
|
|
1392
|
-
if (
|
|
1430
|
+
Router.events.emit('beforeHistoryChange', as, routeProps);
|
|
1431
|
+
this.changeState(method, url, as, options);
|
|
1432
|
+
if (options._h && pathname === '/_error' && ((ref = self.__NEXT_DATA__.props) === null || ref === void 0 ? void 0 : (ref1 = ref.pageProps) === null || ref1 === void 0 ? void 0 : ref1.statusCode) === 500 && (props === null || props === void 0 ? void 0 : props.pageProps)) {
|
|
1393
1433
|
// ensure statusCode is still correct for static 500 page
|
|
1394
1434
|
// when updating query information
|
|
1395
1435
|
props.pageProps.statusCode = 500;
|
|
1396
1436
|
}
|
|
1397
1437
|
// shallow routing is only allowed for same page URL changes.
|
|
1398
|
-
const isValidShallowRoute =
|
|
1438
|
+
const isValidShallowRoute = options.shallow && nextState.route === route;
|
|
1399
1439
|
var _scroll;
|
|
1400
|
-
const shouldScroll = (_scroll =
|
|
1440
|
+
const shouldScroll = (_scroll = options.scroll) !== null && _scroll !== void 0 ? _scroll : !isValidShallowRoute;
|
|
1401
1441
|
const resetScroll = shouldScroll ? {
|
|
1402
1442
|
x: 0,
|
|
1403
1443
|
y: 0
|
|
1404
1444
|
} : null;
|
|
1405
|
-
await this.set(
|
|
1445
|
+
await this.set({
|
|
1446
|
+
...nextState,
|
|
1447
|
+
route,
|
|
1448
|
+
pathname,
|
|
1449
|
+
query,
|
|
1450
|
+
asPath: cleanedAs,
|
|
1451
|
+
isFallback: false
|
|
1452
|
+
}, routeInfo, forcedScroll !== null && forcedScroll !== void 0 ? forcedScroll : resetScroll).catch((e)=>{
|
|
1406
1453
|
if (e.cancelled) error = error || e;
|
|
1407
1454
|
else throw e;
|
|
1408
1455
|
});
|
|
@@ -1411,7 +1458,7 @@ class Router {
|
|
|
1411
1458
|
throw error;
|
|
1412
1459
|
}
|
|
1413
1460
|
if (false) {}
|
|
1414
|
-
Router.events.emit('routeChangeComplete',
|
|
1461
|
+
Router.events.emit('routeChangeComplete', as, routeProps);
|
|
1415
1462
|
return true;
|
|
1416
1463
|
} catch (err1) {
|
|
1417
1464
|
if ((0, _isError).default(err1) && err1.cancelled) {
|
|
@@ -1420,35 +1467,34 @@ class Router {
|
|
|
1420
1467
|
throw err1;
|
|
1421
1468
|
}
|
|
1422
1469
|
}
|
|
1423
|
-
changeState(
|
|
1424
|
-
}) {
|
|
1470
|
+
changeState(method, url, as, options = {}) {
|
|
1425
1471
|
if (false) {}
|
|
1426
|
-
if (
|
|
1427
|
-
this._shallow =
|
|
1428
|
-
window.history[
|
|
1429
|
-
url
|
|
1430
|
-
as
|
|
1431
|
-
options
|
|
1472
|
+
if (method !== 'pushState' || (0, _utils).getURL() !== as) {
|
|
1473
|
+
this._shallow = options.shallow;
|
|
1474
|
+
window.history[method]({
|
|
1475
|
+
url,
|
|
1476
|
+
as,
|
|
1477
|
+
options,
|
|
1432
1478
|
__N: true,
|
|
1433
|
-
idx: this._idx =
|
|
1479
|
+
idx: this._idx = method !== 'pushState' ? this._idx : this._idx + 1
|
|
1434
1480
|
}, // Passing the empty string here should be safe against future changes to the method.
|
|
1435
1481
|
// https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
|
|
1436
|
-
'',
|
|
1482
|
+
'', as);
|
|
1437
1483
|
}
|
|
1438
1484
|
}
|
|
1439
|
-
async handleRouteInfoError(
|
|
1440
|
-
if (
|
|
1485
|
+
async handleRouteInfoError(err, pathname, query, as, routeProps, loadErrorFail) {
|
|
1486
|
+
if (err.cancelled) {
|
|
1441
1487
|
// bubble up cancellation errors
|
|
1442
|
-
throw
|
|
1488
|
+
throw err;
|
|
1443
1489
|
}
|
|
1444
|
-
if ((0, _routeLoader).isAssetError(
|
|
1445
|
-
Router.events.emit('routeChangeError',
|
|
1490
|
+
if ((0, _routeLoader).isAssetError(err) || loadErrorFail) {
|
|
1491
|
+
Router.events.emit('routeChangeError', err, as, routeProps);
|
|
1446
1492
|
// If we can't load the page it could be one of following reasons
|
|
1447
1493
|
// 1. Page doesn't exists
|
|
1448
1494
|
// 2. Page does exist in a different zone
|
|
1449
1495
|
// 3. Internal error while loading the page
|
|
1450
1496
|
// So, doing a hard reload is the proper way to deal with this.
|
|
1451
|
-
window.location.href =
|
|
1497
|
+
window.location.href = as;
|
|
1452
1498
|
// Changing the URL doesn't block executing the current code path.
|
|
1453
1499
|
// So let's throw a cancellation error stop the routing logic.
|
|
1454
1500
|
throw buildCancellationError();
|
|
@@ -1464,31 +1510,30 @@ class Router {
|
|
|
1464
1510
|
props,
|
|
1465
1511
|
Component,
|
|
1466
1512
|
styleSheets,
|
|
1467
|
-
err
|
|
1468
|
-
error:
|
|
1513
|
+
err,
|
|
1514
|
+
error: err
|
|
1469
1515
|
};
|
|
1470
1516
|
if (!routeInfo.props) {
|
|
1471
1517
|
try {
|
|
1472
1518
|
routeInfo.props = await this.getInitialProps(Component, {
|
|
1473
|
-
err
|
|
1519
|
+
err,
|
|
1474
1520
|
pathname,
|
|
1475
1521
|
query
|
|
1476
1522
|
});
|
|
1477
1523
|
} catch (gipErr) {
|
|
1478
1524
|
console.error('Error in error page `getInitialProps`: ', gipErr);
|
|
1479
|
-
routeInfo.props = {
|
|
1480
|
-
};
|
|
1525
|
+
routeInfo.props = {};
|
|
1481
1526
|
}
|
|
1482
1527
|
}
|
|
1483
1528
|
return routeInfo;
|
|
1484
1529
|
} catch (routeInfoErr) {
|
|
1485
|
-
return this.handleRouteInfoError((0, _isError).default(routeInfoErr) ? routeInfoErr : new Error(routeInfoErr + ''), pathname, query,
|
|
1530
|
+
return this.handleRouteInfoError((0, _isError).default(routeInfoErr) ? routeInfoErr : new Error(routeInfoErr + ''), pathname, query, as, routeProps, true);
|
|
1486
1531
|
}
|
|
1487
1532
|
}
|
|
1488
|
-
async getRouteInfo(route,
|
|
1533
|
+
async getRouteInfo(route, pathname, query, as, resolvedAs, routeProps, locale, isPreview) {
|
|
1489
1534
|
try {
|
|
1490
1535
|
const existingRouteInfo = this.components[route];
|
|
1491
|
-
if (
|
|
1536
|
+
if (routeProps.shallow && existingRouteInfo && this.route === route) {
|
|
1492
1537
|
return existingRouteInfo;
|
|
1493
1538
|
}
|
|
1494
1539
|
let cachedRouteInfo = undefined;
|
|
@@ -1511,20 +1556,20 @@ class Router {
|
|
|
1511
1556
|
if (__N_SSG || __N_SSP || __N_RSC) {
|
|
1512
1557
|
dataHref = this.pageLoader.getDataHref({
|
|
1513
1558
|
href: (0, _utils).formatWithValidation({
|
|
1514
|
-
pathname
|
|
1515
|
-
query
|
|
1559
|
+
pathname,
|
|
1560
|
+
query
|
|
1516
1561
|
}),
|
|
1517
1562
|
asPath: resolvedAs,
|
|
1518
1563
|
ssg: __N_SSG,
|
|
1519
1564
|
rsc: __N_RSC,
|
|
1520
|
-
locale
|
|
1565
|
+
locale
|
|
1521
1566
|
});
|
|
1522
1567
|
}
|
|
1523
|
-
const props = await this._getData(()=>__N_SSG || __N_SSP ? fetchNextData(dataHref, this.isSsr, false, __N_SSG ? this.sdc : this.sdr, !!__N_SSG && !
|
|
1524
|
-
pathname
|
|
1525
|
-
query
|
|
1526
|
-
asPath:
|
|
1527
|
-
locale
|
|
1568
|
+
const props = await this._getData(()=>__N_SSG || __N_SSP ? fetchNextData(dataHref, this.isSsr, false, __N_SSG ? this.sdc : this.sdr, !!__N_SSG && !isPreview) : this.getInitialProps(Component, {
|
|
1569
|
+
pathname,
|
|
1570
|
+
query,
|
|
1571
|
+
asPath: as,
|
|
1572
|
+
locale,
|
|
1528
1573
|
locales: this.locales,
|
|
1529
1574
|
defaultLocale: this.defaultLocale
|
|
1530
1575
|
})
|
|
@@ -1541,16 +1586,12 @@ class Router {
|
|
|
1541
1586
|
this.components[route] = routeInfo;
|
|
1542
1587
|
return routeInfo;
|
|
1543
1588
|
} catch (err) {
|
|
1544
|
-
return this.handleRouteInfoError((0, _isError).
|
|
1589
|
+
return this.handleRouteInfoError((0, _isError).getProperError(err), pathname, query, as, routeProps);
|
|
1545
1590
|
}
|
|
1546
1591
|
}
|
|
1547
|
-
set(
|
|
1548
|
-
this.
|
|
1549
|
-
this.
|
|
1550
|
-
this.pathname = pathname3;
|
|
1551
|
-
this.query = query3;
|
|
1552
|
-
this.asPath = as7;
|
|
1553
|
-
return this.notify(data1, resetScroll);
|
|
1592
|
+
set(state, data, resetScroll) {
|
|
1593
|
+
this.state = state;
|
|
1594
|
+
return this.sub(data, this.components['/_app'].Component, resetScroll);
|
|
1554
1595
|
}
|
|
1555
1596
|
/**
|
|
1556
1597
|
* Callback to execute before replacing router state
|
|
@@ -1558,10 +1599,10 @@ class Router {
|
|
|
1558
1599
|
*/ beforePopState(cb) {
|
|
1559
1600
|
this._bps = cb;
|
|
1560
1601
|
}
|
|
1561
|
-
onlyAHashChange(
|
|
1602
|
+
onlyAHashChange(as) {
|
|
1562
1603
|
if (!this.asPath) return false;
|
|
1563
1604
|
const [oldUrlNoHash, oldHash] = this.asPath.split('#');
|
|
1564
|
-
const [newUrlNoHash, newHash] =
|
|
1605
|
+
const [newUrlNoHash, newHash] = as.split('#');
|
|
1565
1606
|
// Makes sure we scroll to the provided hash if the url/hash are the same
|
|
1566
1607
|
if (newHash && oldUrlNoHash === newUrlNoHash && oldHash === newHash) {
|
|
1567
1608
|
return true;
|
|
@@ -1576,8 +1617,8 @@ class Router {
|
|
|
1576
1617
|
// and is treated as a next reload.
|
|
1577
1618
|
return oldHash !== newHash;
|
|
1578
1619
|
}
|
|
1579
|
-
scrollToHash(
|
|
1580
|
-
const [, hash] =
|
|
1620
|
+
scrollToHash(as) {
|
|
1621
|
+
const [, hash = ''] = as.split('#');
|
|
1581
1622
|
// Scroll to top if the hash is just `#` with no value or `#top`
|
|
1582
1623
|
// To mirror browsers
|
|
1583
1624
|
if (hash === '' || hash === 'top') {
|
|
@@ -1605,29 +1646,30 @@ class Router {
|
|
|
1605
1646
|
* This feature only works in production!
|
|
1606
1647
|
* @param url the href of prefetched page
|
|
1607
1648
|
* @param asPath the as path of the prefetched page
|
|
1608
|
-
*/ async prefetch(
|
|
1609
|
-
|
|
1610
|
-
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url4);
|
|
1649
|
+
*/ async prefetch(url, asPath = url, options = {}) {
|
|
1650
|
+
let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
|
|
1611
1651
|
let { pathname , query } = parsed;
|
|
1612
1652
|
if (false) {}
|
|
1613
1653
|
const pages = await this.pageLoader.getPageList();
|
|
1614
|
-
let resolvedAs =
|
|
1654
|
+
let resolvedAs = asPath;
|
|
1615
1655
|
if (false) {} else {
|
|
1616
1656
|
parsed.pathname = resolveDynamicRoute(parsed.pathname, pages);
|
|
1617
1657
|
if (parsed.pathname !== pathname) {
|
|
1618
1658
|
pathname = parsed.pathname;
|
|
1619
1659
|
parsed.pathname = pathname;
|
|
1620
|
-
|
|
1660
|
+
url = (0, _utils).formatWithValidation(parsed);
|
|
1621
1661
|
}
|
|
1622
1662
|
}
|
|
1623
1663
|
// Prefetch is not supported in development mode because it would trigger on-demand-entries
|
|
1624
1664
|
if (false) {}
|
|
1625
1665
|
const effects = await this._preflightRequest({
|
|
1626
|
-
as: addBasePath(
|
|
1666
|
+
as: addBasePath(asPath),
|
|
1627
1667
|
cache: true,
|
|
1628
1668
|
pages,
|
|
1629
1669
|
pathname,
|
|
1630
|
-
query
|
|
1670
|
+
query,
|
|
1671
|
+
locale: this.locale,
|
|
1672
|
+
isPreview: this.isPreview
|
|
1631
1673
|
});
|
|
1632
1674
|
if (effects.type === 'rewrite') {
|
|
1633
1675
|
parsed.pathname = effects.resolvedHref;
|
|
@@ -1637,29 +1679,29 @@ class Router {
|
|
|
1637
1679
|
...effects.parsedAs.query
|
|
1638
1680
|
};
|
|
1639
1681
|
resolvedAs = effects.asPath;
|
|
1640
|
-
|
|
1682
|
+
url = (0, _utils).formatWithValidation(parsed);
|
|
1641
1683
|
}
|
|
1642
1684
|
const route = (0, _normalizeTrailingSlash).removePathTrailingSlash(pathname);
|
|
1643
1685
|
await Promise.all([
|
|
1644
1686
|
this.pageLoader._isSsg(route).then((isSsg)=>{
|
|
1645
1687
|
return isSsg ? fetchNextData(this.pageLoader.getDataHref({
|
|
1646
|
-
href:
|
|
1688
|
+
href: url,
|
|
1647
1689
|
asPath: resolvedAs,
|
|
1648
1690
|
ssg: true,
|
|
1649
|
-
locale: typeof
|
|
1691
|
+
locale: typeof options.locale !== 'undefined' ? options.locale : this.locale
|
|
1650
1692
|
}), false, false, this.sdc, true) : false;
|
|
1651
1693
|
}),
|
|
1652
|
-
this.pageLoader[
|
|
1694
|
+
this.pageLoader[options.priority ? 'loadPage' : 'prefetch'](route),
|
|
1653
1695
|
]);
|
|
1654
1696
|
}
|
|
1655
|
-
async fetchComponent(
|
|
1697
|
+
async fetchComponent(route) {
|
|
1656
1698
|
let cancelled = false;
|
|
1657
1699
|
const cancel = this.clc = ()=>{
|
|
1658
1700
|
cancelled = true;
|
|
1659
1701
|
};
|
|
1660
1702
|
const handleCancelled = ()=>{
|
|
1661
1703
|
if (cancelled) {
|
|
1662
|
-
const error = new Error(`Abort fetching component for route: "${
|
|
1704
|
+
const error = new Error(`Abort fetching component for route: "${route}"`);
|
|
1663
1705
|
error.cancelled = true;
|
|
1664
1706
|
throw error;
|
|
1665
1707
|
}
|
|
@@ -1668,7 +1710,7 @@ class Router {
|
|
|
1668
1710
|
}
|
|
1669
1711
|
};
|
|
1670
1712
|
try {
|
|
1671
|
-
const componentResult = await this.pageLoader.loadPage(
|
|
1713
|
+
const componentResult = await this.pageLoader.loadPage(route);
|
|
1672
1714
|
handleCancelled();
|
|
1673
1715
|
return componentResult;
|
|
1674
1716
|
} catch (err) {
|
|
@@ -1695,24 +1737,16 @@ class Router {
|
|
|
1695
1737
|
});
|
|
1696
1738
|
}
|
|
1697
1739
|
_getFlightData(dataHref) {
|
|
1698
|
-
|
|
1699
|
-
if (!this.isPreview && this.sdc[cacheKey]) {
|
|
1700
|
-
return Promise.resolve({
|
|
1701
|
-
fresh: false,
|
|
1702
|
-
data: this.sdc[cacheKey]
|
|
1703
|
-
});
|
|
1704
|
-
}
|
|
1740
|
+
// Do not cache RSC flight response since it's not a static resource
|
|
1705
1741
|
return fetchNextData(dataHref, true, true, this.sdc, false).then((serialized)=>{
|
|
1706
|
-
this.sdc[cacheKey] = serialized;
|
|
1707
1742
|
return {
|
|
1708
1743
|
fresh: true,
|
|
1709
1744
|
data: serialized
|
|
1710
1745
|
};
|
|
1711
1746
|
});
|
|
1712
1747
|
}
|
|
1713
|
-
async _preflightRequest(
|
|
1714
|
-
|
|
1715
|
-
const cleanedAs = delLocale(hasBasePath(options5.as) ? delBasePath(options5.as) : options5.as, this.locale);
|
|
1748
|
+
async _preflightRequest(options) {
|
|
1749
|
+
const cleanedAs = delLocale(hasBasePath(options.as) ? delBasePath(options.as) : options.as, options.locale);
|
|
1716
1750
|
const fns = await this.pageLoader.getMiddlewareList();
|
|
1717
1751
|
const requiresPreflight = fns.some(([middleware, isSSR])=>{
|
|
1718
1752
|
return (0, _routeMatcher).getRouteMatcher((0, _getMiddlewareRegex).getMiddlewareRegex(middleware, !isSSR))(cleanedAs);
|
|
@@ -1723,20 +1757,29 @@ class Router {
|
|
|
1723
1757
|
};
|
|
1724
1758
|
}
|
|
1725
1759
|
const preflight = await this._getPreflightData({
|
|
1726
|
-
preflightHref:
|
|
1727
|
-
shouldCache:
|
|
1760
|
+
preflightHref: options.as,
|
|
1761
|
+
shouldCache: options.cache,
|
|
1762
|
+
isPreview: options.isPreview
|
|
1728
1763
|
});
|
|
1729
|
-
if (
|
|
1764
|
+
if (preflight.rewrite) {
|
|
1765
|
+
// for external rewrites we need to do a hard navigation
|
|
1766
|
+
// to the resource
|
|
1767
|
+
if (!preflight.rewrite.startsWith('/')) {
|
|
1768
|
+
return {
|
|
1769
|
+
type: 'redirect',
|
|
1770
|
+
destination: options.as
|
|
1771
|
+
};
|
|
1772
|
+
}
|
|
1730
1773
|
const parsed = (0, _parseRelativeUrl).parseRelativeUrl((0, _normalizeLocalePath).normalizeLocalePath(hasBasePath(preflight.rewrite) ? delBasePath(preflight.rewrite) : preflight.rewrite, this.locales).pathname);
|
|
1731
1774
|
const fsPathname = (0, _normalizeTrailingSlash).removePathTrailingSlash(parsed.pathname);
|
|
1732
1775
|
let matchedPage;
|
|
1733
1776
|
let resolvedHref;
|
|
1734
|
-
if (
|
|
1777
|
+
if (options.pages.includes(fsPathname)) {
|
|
1735
1778
|
matchedPage = true;
|
|
1736
1779
|
resolvedHref = fsPathname;
|
|
1737
1780
|
} else {
|
|
1738
|
-
resolvedHref = resolveDynamicRoute(fsPathname,
|
|
1739
|
-
if (resolvedHref !== parsed.pathname &&
|
|
1781
|
+
resolvedHref = resolveDynamicRoute(fsPathname, options.pages);
|
|
1782
|
+
if (resolvedHref !== parsed.pathname && options.pages.includes(resolvedHref)) {
|
|
1740
1783
|
matchedPage = true;
|
|
1741
1784
|
}
|
|
1742
1785
|
}
|
|
@@ -1774,9 +1817,9 @@ class Router {
|
|
|
1774
1817
|
};
|
|
1775
1818
|
}
|
|
1776
1819
|
_getPreflightData(params) {
|
|
1777
|
-
const { preflightHref , shouldCache =false } = params;
|
|
1820
|
+
const { preflightHref , shouldCache =false , isPreview } = params;
|
|
1778
1821
|
const { href: cacheKey } = new URL(preflightHref, window.location.href);
|
|
1779
|
-
if ( true && !
|
|
1822
|
+
if ( true && !isPreview && shouldCache && this.sde[cacheKey]) {
|
|
1780
1823
|
return Promise.resolve(this.sde[cacheKey]);
|
|
1781
1824
|
}
|
|
1782
1825
|
return fetch(preflightHref, {
|
|
@@ -1790,13 +1833,14 @@ class Router {
|
|
|
1790
1833
|
throw new Error(`Failed to preflight request`);
|
|
1791
1834
|
}
|
|
1792
1835
|
return {
|
|
1836
|
+
cache: res.headers.get('x-middleware-cache'),
|
|
1793
1837
|
redirect: res.headers.get('Location'),
|
|
1794
1838
|
refresh: res.headers.has('x-middleware-refresh'),
|
|
1795
1839
|
rewrite: res.headers.get('x-middleware-rewrite'),
|
|
1796
1840
|
ssr: !!res.headers.get('x-middleware-ssr')
|
|
1797
1841
|
};
|
|
1798
1842
|
}).then((data)=>{
|
|
1799
|
-
if (shouldCache) {
|
|
1843
|
+
if (shouldCache && data.cache !== 'no-cache') {
|
|
1800
1844
|
this.sde[cacheKey] = data;
|
|
1801
1845
|
}
|
|
1802
1846
|
return data;
|
|
@@ -1805,26 +1849,44 @@ class Router {
|
|
|
1805
1849
|
throw err;
|
|
1806
1850
|
});
|
|
1807
1851
|
}
|
|
1808
|
-
getInitialProps(
|
|
1852
|
+
getInitialProps(Component, ctx) {
|
|
1809
1853
|
const { Component: App } = this.components['/_app'];
|
|
1810
1854
|
const AppTree = this._wrapApp(App);
|
|
1811
1855
|
ctx.AppTree = AppTree;
|
|
1812
1856
|
return (0, _utils).loadGetInitialProps(App, {
|
|
1813
1857
|
AppTree,
|
|
1814
|
-
Component
|
|
1858
|
+
Component,
|
|
1815
1859
|
router: this,
|
|
1816
1860
|
ctx
|
|
1817
1861
|
});
|
|
1818
1862
|
}
|
|
1819
|
-
abortComponentLoad(
|
|
1863
|
+
abortComponentLoad(as, routeProps) {
|
|
1820
1864
|
if (this.clc) {
|
|
1821
|
-
Router.events.emit('routeChangeError', buildCancellationError(),
|
|
1865
|
+
Router.events.emit('routeChangeError', buildCancellationError(), as, routeProps);
|
|
1822
1866
|
this.clc();
|
|
1823
1867
|
this.clc = null;
|
|
1824
1868
|
}
|
|
1825
1869
|
}
|
|
1826
|
-
|
|
1827
|
-
return this.
|
|
1870
|
+
get route() {
|
|
1871
|
+
return this.state.route;
|
|
1872
|
+
}
|
|
1873
|
+
get pathname() {
|
|
1874
|
+
return this.state.pathname;
|
|
1875
|
+
}
|
|
1876
|
+
get query() {
|
|
1877
|
+
return this.state.query;
|
|
1878
|
+
}
|
|
1879
|
+
get asPath() {
|
|
1880
|
+
return this.state.asPath;
|
|
1881
|
+
}
|
|
1882
|
+
get locale() {
|
|
1883
|
+
return this.state.locale;
|
|
1884
|
+
}
|
|
1885
|
+
get isFallback() {
|
|
1886
|
+
return this.state.isFallback;
|
|
1887
|
+
}
|
|
1888
|
+
get isPreview() {
|
|
1889
|
+
return this.state.isPreview;
|
|
1828
1890
|
}
|
|
1829
1891
|
}
|
|
1830
1892
|
Router.events = (0, _mitt).default();
|