eddev 2.0.0-beta.21 → 2.0.0-beta.211
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/css/editor-styles.css +4 -0
- package/dist/app/entry/HydrationOverlay.d.ts +2 -0
- package/dist/app/entry/HydrationOverlay.d.ts.map +1 -0
- package/dist/app/entry/HydrationOverlay.js +2 -0
- package/dist/app/entry/MetaTags.d.ts +8 -0
- package/dist/app/entry/MetaTags.d.ts.map +1 -0
- package/dist/app/entry/MetaTags.js +30 -0
- package/dist/app/entry/boot-admin.d.ts +1 -0
- package/dist/app/entry/boot-admin.d.ts.map +1 -0
- package/dist/app/entry/boot-admin.js +7 -3
- package/dist/app/entry/hydration-script.d.ts +2 -0
- package/dist/app/entry/hydration-script.d.ts.map +1 -0
- package/dist/app/entry/hydration-script.js +18 -0
- package/dist/app/entry/spa-root.d.ts +1 -0
- package/dist/app/entry/spa-root.d.ts.map +1 -0
- package/dist/app/entry/spa-root.js +3 -5
- package/dist/app/entry/ssr-root-client.d.ts +4 -1
- package/dist/app/entry/ssr-root-client.d.ts.map +1 -0
- package/dist/app/entry/ssr-root-client.js +18 -6
- package/dist/app/entry/ssr-root.d.ts +6 -4
- package/dist/app/entry/ssr-root.d.ts.map +1 -0
- package/dist/app/entry/ssr-root.js +20 -19
- package/dist/app/lib/admin/defineField.d.ts +1 -0
- package/dist/app/lib/admin/defineField.d.ts.map +1 -0
- package/dist/app/lib/admin/defineWidget.d.ts +1 -0
- package/dist/app/lib/admin/defineWidget.d.ts.map +1 -0
- package/dist/app/lib/admin/index.d.ts +1 -0
- package/dist/app/lib/admin/index.d.ts.map +1 -0
- package/dist/app/lib/admin/installFieldTypes.d.ts +1 -0
- package/dist/app/lib/admin/installFieldTypes.d.ts.map +1 -0
- package/dist/app/lib/admin/installFieldTypes.js +2 -0
- package/dist/app/lib/admin/runWidgets.d.ts +1 -0
- package/dist/app/lib/admin/runWidgets.d.ts.map +1 -0
- package/dist/app/lib/admin/runWidgets.js +7 -2
- package/dist/app/lib/blocks/ContentBlocks.d.ts +7 -4
- package/dist/app/lib/blocks/ContentBlocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/ContentBlocks.js +16 -3
- package/dist/app/lib/blocks/EditableText.d.ts +30 -5
- package/dist/app/lib/blocks/EditableText.d.ts.map +1 -0
- package/dist/app/lib/blocks/EditableText.js +34 -5
- package/dist/app/lib/blocks/InnerBlocks.d.ts +21 -6
- package/dist/app/lib/blocks/InnerBlocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/InnerBlocks.js +73 -25
- package/dist/app/lib/blocks/SlotBlocks.d.ts +8 -0
- package/dist/app/lib/blocks/SlotBlocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/SlotBlocks.js +46 -0
- package/dist/app/lib/blocks/block-utils.d.ts +2 -1
- package/dist/app/lib/blocks/block-utils.d.ts.map +1 -0
- package/dist/app/lib/blocks/block-utils.js +3 -1
- package/dist/app/lib/blocks/builtin-blocks.d.ts +2 -0
- package/dist/app/lib/blocks/builtin-blocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/builtin-blocks.js +55 -0
- package/dist/app/lib/blocks/defineBlock.d.ts +4 -0
- package/dist/app/lib/blocks/defineBlock.d.ts.map +1 -0
- package/dist/app/lib/blocks/defineBlock.js +9 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.d.ts +8 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.js +164 -0
- package/dist/app/lib/blocks/editor/EditorSupport.d.ts +1 -0
- package/dist/app/lib/blocks/editor/EditorSupport.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/EditorSupport.js +17 -10
- package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts +2 -1
- package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/block-templates.d.ts +8 -1
- package/dist/app/lib/blocks/editor/block-templates.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/block-templates.js +71 -2
- package/dist/app/lib/blocks/editor/blocks-by-tag.d.ts +1 -0
- package/dist/app/lib/blocks/editor/blocks-by-tag.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/controls.d.ts +1 -0
- package/dist/app/lib/blocks/editor/controls.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/create-block.d.ts +10 -0
- package/dist/app/lib/blocks/editor/create-block.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/create-block.js +13 -0
- package/dist/app/lib/blocks/editor/editor-config.d.ts +77 -8
- package/dist/app/lib/blocks/editor/editor-config.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/editor-config.js +29 -62
- package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts +4 -0
- package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/installGutenbergHooks.js +126 -21
- package/dist/app/lib/blocks/editor/root-blocks.d.ts +7 -0
- package/dist/app/lib/blocks/editor/root-blocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/root-blocks.js +30 -0
- package/dist/app/lib/blocks/editor/usePostEditor.d.ts +12 -1
- package/dist/app/lib/blocks/editor/usePostEditor.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/usePostEditor.js +28 -13
- package/dist/app/lib/blocks/index.d.ts +8 -5
- package/dist/app/lib/blocks/index.d.ts.map +1 -0
- package/dist/app/lib/blocks/index.js +7 -5
- package/dist/app/lib/blocks/inline-editing.d.ts +10 -0
- package/dist/app/lib/blocks/inline-editing.d.ts.map +1 -0
- package/dist/app/lib/blocks/inline-editing.js +12 -2
- package/dist/app/lib/devtools/components/BreakpointIndicator.d.ts +1 -0
- package/dist/app/lib/devtools/components/BreakpointIndicator.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/BreakpointIndicator.js +2 -2
- package/dist/app/lib/devtools/components/DevUI.d.ts +1 -0
- package/dist/app/lib/devtools/components/DevUI.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/DevUI.js +3 -2
- package/dist/app/lib/devtools/components/GridIndicator.d.ts +2 -0
- package/dist/app/lib/devtools/components/GridIndicator.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/GridIndicator.js +29 -0
- package/dist/app/lib/devtools/dev-tools-store.d.ts +1 -0
- package/dist/app/lib/devtools/dev-tools-store.d.ts.map +1 -0
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts +2 -1
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts.map +1 -0
- package/dist/app/lib/devtools/hooks/usePersistState.js +11 -2
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts +77 -76
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts.map +1 -0
- package/dist/app/lib/devtools/index.d.ts +1 -0
- package/dist/app/lib/devtools/index.d.ts.map +1 -0
- package/dist/app/lib/devtools/loader.d.ts +1 -0
- package/dist/app/lib/devtools/loader.d.ts.map +1 -0
- package/dist/app/lib/devtools/loader.js +6 -5
- package/dist/app/lib/devtools/tailwind.config.d.ts +1 -0
- package/dist/app/lib/devtools/tailwind.config.d.ts.map +1 -0
- package/dist/app/lib/devtools/useQueryDebug.d.ts +8 -1
- package/dist/app/lib/devtools/useQueryDebug.d.ts.map +1 -0
- package/dist/app/lib/devtools/useQueryDebug.js +5 -8
- package/dist/app/lib/dynamic/dynamic.d.ts +2 -1
- package/dist/app/lib/dynamic/dynamic.d.ts.map +1 -0
- package/dist/app/lib/dynamic/dynamic.js +5 -1
- package/dist/app/lib/dynamic/index.d.ts +1 -0
- package/dist/app/lib/dynamic/index.d.ts.map +1 -0
- package/dist/app/lib/hooks/index.d.ts +3 -3
- package/dist/app/lib/hooks/index.d.ts.map +1 -0
- package/dist/app/lib/hooks/index.js +2 -3
- package/dist/app/lib/hooks/{queryUtils.d.ts → query-hooks.d.ts} +42 -3
- package/dist/app/lib/hooks/query-hooks.d.ts.map +1 -0
- package/dist/app/lib/hooks/{queryUtils.js → query-hooks.js} +90 -28
- package/dist/app/lib/hooks/useAppData.d.ts +1 -0
- package/dist/app/lib/hooks/useAppData.d.ts.map +1 -0
- package/dist/app/lib/hooks/useAppData.js +11 -0
- package/dist/app/lib/hooks/useRPC.d.ts +1 -4
- package/dist/app/lib/hooks/useRPC.d.ts.map +1 -0
- package/dist/app/lib/hooks/useRPC.js +0 -8
- package/dist/app/lib/integrations/gravityforms/index.d.ts +3 -0
- package/dist/app/lib/integrations/gravityforms/index.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/index.js +2 -0
- package/dist/app/lib/integrations/gravityforms/types.d.ts +145 -0
- package/dist/app/lib/integrations/gravityforms/types.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/types.js +1 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts +31 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.js +295 -0
- package/dist/app/lib/internal/finalize-rpc.d.ts +18 -0
- package/dist/app/lib/internal/finalize-rpc.d.ts.map +1 -0
- package/dist/app/lib/internal/finalize-rpc.js +3 -0
- package/dist/app/lib/internal/index.d.ts +2 -0
- package/dist/app/lib/internal/index.d.ts.map +1 -0
- package/dist/app/lib/internal/index.js +1 -0
- package/dist/app/lib/internal/internal-store.d.ts +1 -0
- package/dist/app/lib/internal/internal-store.d.ts.map +1 -0
- package/dist/app/lib/internal/read-admin-manifest.d.ts +1 -0
- package/dist/app/lib/internal/read-admin-manifest.d.ts.map +1 -0
- package/dist/app/lib/internal/read-block-manifest.d.ts +2 -0
- package/dist/app/lib/internal/read-block-manifest.d.ts.map +1 -0
- package/dist/app/lib/internal/read-block-manifest.js +7 -0
- package/dist/app/lib/internal/read-view-manifest.d.ts +7 -4
- package/dist/app/lib/internal/read-view-manifest.d.ts.map +1 -0
- package/dist/app/lib/internal/read-view-manifest.js +18 -0
- package/dist/app/lib/legacy-stitches/createStitches.d.ts +510 -1
- package/dist/app/lib/legacy-stitches/createStitches.d.ts.map +1 -0
- package/dist/app/lib/legacy-stitches/index.d.ts +1 -0
- package/dist/app/lib/legacy-stitches/index.d.ts.map +1 -0
- package/dist/app/lib/routing/components/BackButton.d.ts +50 -0
- package/dist/app/lib/routing/components/BackButton.d.ts.map +1 -0
- package/dist/app/lib/routing/components/BackButton.js +47 -0
- package/dist/app/lib/routing/components/BrowserRouter.d.ts +10 -1
- package/dist/app/lib/routing/components/BrowserRouter.d.ts.map +1 -0
- package/dist/app/lib/routing/components/BrowserRouter.js +136 -21
- package/dist/app/lib/routing/components/ClientOnly.d.ts +2 -1
- package/dist/app/lib/routing/components/ClientOnly.d.ts.map +1 -0
- package/dist/app/lib/routing/components/ClientOnly.js +1 -1
- package/dist/app/lib/routing/components/Link.d.ts +19 -2
- package/dist/app/lib/routing/components/Link.d.ts.map +1 -0
- package/dist/app/lib/routing/components/Link.js +43 -23
- package/dist/app/lib/routing/components/NativeLinkHandler.d.ts +10 -0
- package/dist/app/lib/routing/components/NativeLinkHandler.d.ts.map +1 -0
- package/dist/app/lib/routing/components/NativeLinkHandler.js +23 -0
- package/dist/app/lib/routing/components/RouteRenderer.d.ts +1 -0
- package/dist/app/lib/routing/components/RouteRenderer.d.ts.map +1 -0
- package/dist/app/lib/routing/components/RouteRenderer.js +17 -3
- package/dist/app/lib/routing/components/SSRRouter.d.ts +3 -0
- package/dist/app/lib/routing/components/SSRRouter.d.ts.map +1 -0
- package/dist/app/lib/routing/components/SSRRouter.js +3 -2
- package/dist/app/lib/routing/components/ScrollRestoration.d.ts +1 -0
- package/dist/app/lib/routing/components/ScrollRestoration.d.ts.map +1 -0
- package/dist/app/lib/routing/components/ScrollRestoration.js +4 -1
- package/dist/app/lib/routing/context.d.ts +9 -5
- package/dist/app/lib/routing/context.d.ts.map +1 -0
- package/dist/app/lib/routing/context.js +12 -95
- package/dist/app/lib/routing/hooks/useIsSSR.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useIsSSR.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRestorableState.d.ts +3 -1
- package/dist/app/lib/routing/hooks/useRestorableState.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRoute.d.ts +16 -0
- package/dist/app/lib/routing/hooks/useRoute.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRoute.js +21 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.d.ts +6 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.js +9 -0
- package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRouteTransition.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouter.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRouter.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouterEvents.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRouterEvents.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouterState.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRouterState.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useSearchParams.d.ts +78 -6
- package/dist/app/lib/routing/hooks/useSearchParams.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useSearchParams.js +75 -15
- package/dist/app/lib/routing/index.d.ts +3 -0
- package/dist/app/lib/routing/index.d.ts.map +1 -0
- package/dist/app/lib/routing/index.js +2 -0
- package/dist/app/lib/routing/loader.d.ts +1 -0
- package/dist/app/lib/routing/loader.d.ts.map +1 -0
- package/dist/app/lib/routing/loader.js +19 -10
- package/dist/app/lib/routing/types.d.ts +60 -12
- package/dist/app/lib/routing/types.d.ts.map +1 -0
- package/dist/app/lib/routing/utils.d.ts +7 -2
- package/dist/app/lib/routing/utils.d.ts.map +1 -0
- package/dist/app/lib/routing/utils.js +41 -4
- package/dist/app/lib/{hooks → runtime}/apiConfig.d.ts +11 -2
- package/dist/app/lib/runtime/apiConfig.d.ts.map +1 -0
- package/dist/app/lib/runtime/apiConfig.js +6 -0
- package/dist/app/lib/runtime/errorHandling.d.ts +40 -0
- package/dist/app/lib/runtime/errorHandling.d.ts.map +1 -0
- package/dist/app/lib/runtime/errorHandling.js +6 -0
- package/dist/app/lib/runtime/index.d.ts +3 -0
- package/dist/app/lib/runtime/index.d.ts.map +1 -0
- package/dist/app/lib/runtime/index.js +2 -0
- package/dist/app/lib/views/defineView.d.ts +2 -1
- package/dist/app/lib/views/defineView.d.ts.map +1 -0
- package/dist/app/lib/views/index.d.ts +1 -0
- package/dist/app/lib/views/index.d.ts.map +1 -0
- package/dist/app/server/index.d.ts +4 -1
- package/dist/app/server/index.d.ts.map +1 -0
- package/dist/app/server/index.js +3 -1
- package/dist/app/server/proxy-wp-admin.d.ts +2 -2
- package/dist/app/server/proxy-wp-admin.d.ts.map +1 -0
- package/dist/app/server/proxy-wp-admin.js +46 -13
- package/dist/app/server/render-ai-page.d.ts +13 -0
- package/dist/app/server/render-ai-page.d.ts.map +1 -0
- package/dist/app/server/render-ai-page.js +100 -0
- package/dist/app/server/render-ssr-page.d.ts +31 -3
- package/dist/app/server/render-ssr-page.d.ts.map +1 -0
- package/dist/app/server/render-ssr-page.js +226 -10
- package/dist/app/server/rpc.d.ts +60 -0
- package/dist/app/server/rpc.d.ts.map +1 -0
- package/dist/app/server/rpc.js +18 -0
- package/dist/app/server/server-context.d.ts +44 -6
- package/dist/app/server/server-context.d.ts.map +1 -0
- package/dist/app/server/server-context.js +334 -37
- package/dist/app/server/server-custom-config.d.ts +3 -0
- package/dist/app/server/server-custom-config.d.ts.map +1 -0
- package/dist/app/server/server-custom-config.js +1 -0
- package/dist/app/server/utils/content-security.d.ts +26 -0
- package/dist/app/server/utils/content-security.d.ts.map +1 -0
- package/dist/app/server/utils/content-security.js +124 -0
- package/dist/app/server/utils/headers.d.ts +1 -0
- package/dist/app/server/utils/headers.d.ts.map +1 -0
- package/dist/app/server/utils/replace-host.d.ts +2 -1
- package/dist/app/server/utils/replace-host.d.ts.map +1 -0
- package/dist/app/server/utils/replace-host.js +10 -2
- package/dist/app/server/utils/swr-cache.d.ts +5 -0
- package/dist/app/server/utils/swr-cache.d.ts.map +1 -0
- package/dist/app/server/utils/swr-cache.js +31 -0
- package/dist/app/utils/APIProvider.d.ts +3 -0
- package/dist/app/utils/APIProvider.d.ts.map +1 -0
- package/dist/app/utils/APIProvider.js +5 -0
- package/dist/app/utils/BlockErrorBoundary.d.ts +20 -0
- package/dist/app/utils/BlockErrorBoundary.d.ts.map +1 -0
- package/dist/app/utils/BlockErrorBoundary.js +38 -0
- package/dist/app/utils/ErrorMessage.d.ts +6 -0
- package/dist/app/utils/ErrorMessage.d.ts.map +1 -0
- package/dist/app/utils/ErrorMessage.js +14 -0
- package/dist/app/utils/RouteErrorBoundary.d.ts +20 -0
- package/dist/app/utils/RouteErrorBoundary.d.ts.map +1 -0
- package/dist/app/utils/RouteErrorBoundary.js +41 -0
- package/dist/app/utils/asset-capture.d.ts +3 -0
- package/dist/app/utils/asset-capture.d.ts.map +1 -0
- package/dist/app/utils/asset-capture.js +5 -0
- package/dist/app/utils/hydration-debugger.d.ts +14 -0
- package/dist/app/utils/hydration-debugger.d.ts.map +1 -0
- package/dist/app/utils/hydration-debugger.js +11 -0
- package/dist/app/utils/query-client.d.ts +3 -0
- package/dist/app/utils/query-client.d.ts.map +1 -0
- package/dist/app/utils/query-client.js +5 -1
- package/dist/app/utils/query-monitor.d.ts +27 -0
- package/dist/app/utils/query-monitor.d.ts.map +1 -0
- package/dist/app/utils/query-monitor.js +7 -0
- package/dist/app/utils/trpc-client.d.ts +3 -0
- package/dist/app/utils/trpc-client.d.ts.map +1 -0
- package/dist/app/utils/trpc-client.js +39 -0
- package/dist/app/utils/wp.d.ts +11 -10
- package/dist/app/utils/wp.d.ts.map +1 -0
- package/dist/node/cli/cli-mode.d.ts +1 -0
- package/dist/node/cli/cli-mode.d.ts.map +1 -0
- package/dist/node/cli/cli-worker.d.ts +1 -0
- package/dist/node/cli/cli-worker.d.ts.map +1 -0
- package/dist/node/cli/cli-worker.js +7 -3
- package/dist/node/cli/cli.d.ts +1 -0
- package/dist/node/cli/cli.d.ts.map +1 -0
- package/dist/node/cli/cli.js +120 -7
- package/dist/node/cli/display/CLIApp.d.ts +1 -0
- package/dist/node/cli/display/CLIApp.d.ts.map +1 -0
- package/dist/node/cli/display/CLIApp.js +1 -1
- package/dist/node/cli/display/boot-cli-app.d.ts +1 -0
- package/dist/node/cli/display/boot-cli-app.d.ts.map +1 -0
- package/dist/node/cli/display/boot-cli-app.js +1 -1
- package/dist/node/cli/display/components/Fullscreen.d.ts +1 -0
- package/dist/node/cli/display/components/Fullscreen.d.ts.map +1 -0
- package/dist/node/cli/display/components/LogEntries.d.ts +1 -0
- package/dist/node/cli/display/components/LogEntries.d.ts.map +1 -0
- package/dist/node/cli/display/components/MenuItem.d.ts +1 -0
- package/dist/node/cli/display/components/MenuItem.d.ts.map +1 -0
- package/dist/node/cli/display/components/TextInput.d.ts +1 -0
- package/dist/node/cli/display/components/TextInput.d.ts.map +1 -0
- package/dist/node/cli/display/hooks/useManifest.d.ts +1 -0
- package/dist/node/cli/display/hooks/useManifest.d.ts.map +1 -0
- package/dist/node/cli/display/hooks/useStatefulLog.d.ts +1 -0
- package/dist/node/cli/display/hooks/useStatefulLog.d.ts.map +1 -0
- package/dist/node/cli/display/tools/BlockList.d.ts +1 -0
- package/dist/node/cli/display/tools/BlockList.d.ts.map +1 -0
- package/dist/node/cli/display/tools/CreateBlock.d.ts +1 -0
- package/dist/node/cli/display/tools/CreateBlock.d.ts.map +1 -0
- package/dist/node/cli/display/tools/cli-tool-list.d.ts +1 -0
- package/dist/node/cli/display/tools/cli-tool-list.d.ts.map +1 -0
- package/dist/node/cli/display/tools/cli-tools.d.ts +1 -0
- package/dist/node/cli/display/tools/cli-tools.d.ts.map +1 -0
- package/dist/node/cli/display/util/colors.d.ts +1 -0
- package/dist/node/cli/display/util/colors.d.ts.map +1 -0
- package/dist/node/cli/version.d.ts +2 -1
- package/dist/node/cli/version.d.ts.map +1 -0
- package/dist/node/cli/version.js +1 -1
- package/dist/node/compiler/build-vinxi.d.ts +1 -0
- package/dist/node/compiler/build-vinxi.d.ts.map +1 -0
- package/dist/node/compiler/build-vinxi.js +2 -1
- package/dist/node/compiler/bundler.admin.d.ts +1 -0
- package/dist/node/compiler/bundler.admin.d.ts.map +1 -0
- package/dist/node/compiler/bundler.admin.js +1 -0
- package/dist/node/compiler/bundler.frontend.d.ts +2 -0
- package/dist/node/compiler/bundler.frontend.d.ts.map +1 -0
- package/dist/node/compiler/bundler.frontend.js +26 -11
- package/dist/node/compiler/dev-server.d.ts +1 -0
- package/dist/node/compiler/dev-server.d.ts.map +1 -0
- package/dist/node/compiler/dev-server.js +17 -1
- package/dist/node/compiler/get-vite-config.d.ts +12 -1
- package/dist/node/compiler/get-vite-config.d.ts.map +1 -0
- package/dist/node/compiler/get-vite-config.js +173 -42
- package/dist/node/compiler/vinxi-app.d.ts +13 -0
- package/dist/node/compiler/vinxi-app.d.ts.map +1 -0
- package/dist/node/compiler/vinxi-app.js +142 -32
- package/dist/node/compiler/vinxi-codegen.d.ts +1 -0
- package/dist/node/compiler/vinxi-codegen.d.ts.map +1 -0
- package/dist/node/compiler/vinxi-codegen.js +371 -108
- package/dist/node/graphql/graphql-codegen.d.ts +12 -1
- package/dist/node/graphql/graphql-codegen.d.ts.map +1 -0
- package/dist/node/graphql/graphql-codegen.js +239 -37
- package/dist/node/graphql/graphql-schema-loader.d.ts +3 -1
- package/dist/node/graphql/graphql-schema-loader.d.ts.map +1 -0
- package/dist/node/graphql/graphql-schema-loader.js +5 -16
- package/dist/node/graphql/plugins/gql-plugin-files.d.ts +3 -1
- package/dist/node/graphql/plugins/gql-plugin-files.d.ts.map +1 -0
- package/dist/node/graphql/plugins/gql-plugin-files.js +3 -2
- package/dist/node/graphql/plugins/gql-plugin-no-duplicates.d.ts +1 -0
- package/dist/node/graphql/plugins/gql-plugin-no-duplicates.d.ts.map +1 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.d.ts +1 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.d.ts.map +1 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.js +2 -2
- package/dist/node/graphql/query-files-loader.d.ts +4 -0
- package/dist/node/graphql/query-files-loader.d.ts.map +1 -0
- package/dist/node/graphql/query-files-loader.js +5 -0
- package/dist/node/graphql/wp-info-query.d.ts +1 -0
- package/dist/node/graphql/wp-info-query.d.ts.map +1 -0
- package/dist/node/project/config.d.ts +207 -73
- package/dist/node/project/config.d.ts.map +1 -0
- package/dist/node/project/config.js +94 -20
- package/dist/node/project/eddev-build-file.d.ts +1 -0
- package/dist/node/project/eddev-build-file.d.ts.map +1 -0
- package/dist/node/project/eddev-build-file.js +4 -2
- package/dist/node/project/env.d.ts +5 -0
- package/dist/node/project/env.d.ts.map +1 -0
- package/dist/node/project/env.js +1 -0
- package/dist/node/project/favicons.d.ts +1 -1
- package/dist/node/project/favicons.d.ts.map +1 -0
- package/dist/node/project/favicons.js +1 -1
- package/dist/node/project/manifest/block-manifest.d.ts +1 -0
- package/dist/node/project/manifest/block-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/block-manifest.js +6 -2
- package/dist/node/project/manifest/field-manifest.d.ts +1 -0
- package/dist/node/project/manifest/field-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/manifest.d.ts +2 -0
- package/dist/node/project/manifest/manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/manifest.js +14 -10
- package/dist/node/project/manifest/routes-manifest.d.ts +21 -0
- package/dist/node/project/manifest/routes-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/routes-manifest.js +74 -0
- package/dist/node/project/manifest/view-manifest.d.ts +1 -0
- package/dist/node/project/manifest/view-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/widget-manifest.d.ts +1 -0
- package/dist/node/project/manifest/widget-manifest.d.ts.map +1 -0
- package/dist/node/project/project.d.ts +12 -0
- package/dist/node/project/project.d.ts.map +1 -0
- package/dist/node/project/project.js +57 -3
- package/dist/node/project/wp-info.d.ts +3 -0
- package/dist/node/project/wp-info.d.ts.map +1 -0
- package/dist/node/project/wp-info.js +13 -1
- package/dist/node/storybook/index.d.ts +3 -0
- package/dist/node/storybook/index.d.ts.map +1 -0
- package/dist/node/storybook/index.js +13 -0
- package/dist/node/types/block-type.d.ts +57 -25
- package/dist/node/types/block-type.d.ts.map +1 -0
- package/dist/node/types/block-type.js +4 -1
- package/dist/node/types/view-type.d.ts +8 -7
- package/dist/node/types/view-type.d.ts.map +1 -0
- package/dist/node/utils/fetch-wp.d.ts +2 -0
- package/dist/node/utils/fetch-wp.d.ts.map +1 -0
- package/dist/node/utils/fetch-wp.js +28 -0
- package/dist/node/utils/format-zod-error.d.ts +1 -0
- package/dist/node/utils/format-zod-error.d.ts.map +1 -0
- package/dist/node/utils/fs-codegen.d.ts +4 -0
- package/dist/node/utils/fs-codegen.d.ts.map +1 -0
- package/dist/node/utils/fs-codegen.js +10 -2
- package/dist/node/utils/fs.d.ts +5 -0
- package/dist/node/utils/fs.d.ts.map +1 -0
- package/dist/node/utils/get-repo-info.d.ts +1 -0
- package/dist/node/utils/get-repo-info.d.ts.map +1 -0
- package/dist/node/utils/helpers.d.ts +1 -0
- package/dist/node/utils/helpers.d.ts.map +1 -0
- package/dist/node/utils/highlight-code.d.ts +1 -0
- package/dist/node/utils/highlight-code.d.ts.map +1 -0
- package/dist/node/utils/is-deploying.d.ts +1 -0
- package/dist/node/utils/is-deploying.d.ts.map +1 -0
- package/dist/node/utils/is-deploying.js +1 -1
- package/dist/node/utils/report-builder.d.ts +1 -0
- package/dist/node/utils/report-builder.d.ts.map +1 -0
- package/dist/node/utils/self-signed-cert.d.ts +5 -0
- package/dist/node/utils/self-signed-cert.d.ts.map +1 -0
- package/dist/node/utils/self-signed-cert.js +28 -4
- package/dist/node/utils/stateful-log.d.ts +1 -0
- package/dist/node/utils/stateful-log.d.ts.map +1 -0
- package/dist/node/utils/stateful-log.js +2 -0
- package/dist/node/utils/ts-export-extractor.d.ts +1 -0
- package/dist/node/utils/ts-export-extractor.d.ts.map +1 -0
- package/dist/node/utils/watch-file-tree.d.ts +18 -3
- package/dist/node/utils/watch-file-tree.d.ts.map +1 -0
- package/dist/node/utils/watch-file-tree.js +12 -5
- package/package.json +42 -25
- package/tsconfig.app.json +10 -5
- package/tsconfig.node.json +3 -2
- package/types.app.d.ts +2 -0
- package/types.meta.d.ts +449 -136
- package/dist/app/lib/blocks/ErrorBoundaryFrontend.d.ts +0 -15
- package/dist/app/lib/blocks/ErrorBoundaryFrontend.js +0 -35
- package/dist/app/lib/hooks/apiConfig.js +0 -4
- package/dist/app/lib/hooks/usePageLoad.d.ts +0 -6
- package/dist/app/lib/hooks/usePageLoad.js +0 -5
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
1
|
+
import { RouteMetaTag, RouterAPI, RouterAPIState } from "./types.js";
|
|
2
|
+
export declare const RouterContext: import("react").Context<RouterAPI>;
|
|
3
|
+
export declare const RouterStateContext: import("react").Context<RouterAPIState>;
|
|
4
|
+
export declare const RouteItemContext: import("react").Context<import("./types.js").TypedRouteState<"_unknown", {}>>;
|
|
5
|
+
export declare const clientMetaTags: {
|
|
6
|
+
tags: null | RouteMetaTag[];
|
|
7
|
+
setMetaTags(tags: RouteMetaTag[]): void;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/routing/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAc,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAkBhF,eAAO,MAAM,aAAa,oCAgBxB,CAAA;AAEF,eAAO,MAAM,kBAAkB,yCAI7B,CAAA;AAEF,eAAO,MAAM,gBAAgB,+EAAwC,CAAA;AAErE,eAAO,MAAM,cAAc;UACX,IAAI,GAAG,YAAY,EAAE;sBACjB,YAAY,EAAE;CAGhC,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
import { RouteLoader } from "./loader.js";
|
|
3
|
+
import { proxy } from "valtio";
|
|
3
4
|
const NOOP_ROUTE = {
|
|
4
5
|
component: () => null,
|
|
5
6
|
id: "initial",
|
|
@@ -12,6 +13,7 @@ const NOOP_ROUTE = {
|
|
|
12
13
|
search: "",
|
|
13
14
|
query: {},
|
|
14
15
|
returnState: undefined,
|
|
16
|
+
meta: {},
|
|
15
17
|
};
|
|
16
18
|
export const RouterContext = createContext({
|
|
17
19
|
loader: new RouteLoader(),
|
|
@@ -25,6 +27,10 @@ export const RouterContext = createContext({
|
|
|
25
27
|
replaceQuery(query) { },
|
|
26
28
|
handleClickEvent(e, originalHref) { },
|
|
27
29
|
emitEvent(event) { },
|
|
30
|
+
getState() {
|
|
31
|
+
return null;
|
|
32
|
+
},
|
|
33
|
+
restoreRoute(route) { },
|
|
28
34
|
});
|
|
29
35
|
export const RouterStateContext = createContext({
|
|
30
36
|
history: [NOOP_ROUTE],
|
|
@@ -32,98 +38,9 @@ export const RouterStateContext = createContext({
|
|
|
32
38
|
blockers: [],
|
|
33
39
|
});
|
|
34
40
|
export const RouteItemContext = createContext(NOOP_ROUTE);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// value: T
|
|
42
|
-
// update(next: T): void
|
|
43
|
-
// }
|
|
44
|
-
// function createStore<T>(initial: T): Store<T> {
|
|
45
|
-
// let value = initial
|
|
46
|
-
// const subscribers = new Set<(value: T) => void>()
|
|
47
|
-
// return {
|
|
48
|
-
// subscribe(sub: (value: T) => void) {
|
|
49
|
-
// subscribers.add(sub)
|
|
50
|
-
// return () => {
|
|
51
|
-
// subscribers.delete(sub)
|
|
52
|
-
// }
|
|
53
|
-
// },
|
|
54
|
-
// get value() {
|
|
55
|
-
// return value
|
|
56
|
-
// },
|
|
57
|
-
// update(nextValue: T) {
|
|
58
|
-
// value = nextValue
|
|
59
|
-
// if (subscribers.size) {
|
|
60
|
-
// console.log("UPDATE", value)
|
|
61
|
-
// startTransition(() => {
|
|
62
|
-
// for (let sub of subscribers) {
|
|
63
|
-
// sub(value)
|
|
64
|
-
// }
|
|
65
|
-
// })
|
|
66
|
-
// }
|
|
67
|
-
// },
|
|
68
|
-
// }
|
|
69
|
-
// }
|
|
70
|
-
// export function createStoreHook<T>(store: Store<T>): StoreHook<T> {
|
|
71
|
-
// const hook = (selector: any) => {
|
|
72
|
-
// const get = () => (selector ? selector(store.value) : store.value)
|
|
73
|
-
// return useSyncExternalStore(store.subscribe, get, get)
|
|
74
|
-
// }
|
|
75
|
-
// return hook as StoreHook<T>
|
|
76
|
-
// }
|
|
77
|
-
// export function createStoreContextHook<T>(ctx: Context<Store<T>>): StoreHook<T> {
|
|
78
|
-
// const hook = (selector: any) => {
|
|
79
|
-
// const store = useContext(ctx)
|
|
80
|
-
// const get = () => (selector ? selector(store.value) : store.value)
|
|
81
|
-
// return useSyncExternalStore(store.subscribe, get, get)
|
|
82
|
-
// }
|
|
83
|
-
// return hook as StoreHook<T>
|
|
84
|
-
// }
|
|
85
|
-
// export const RouterContext = createContext<Store<RouterAPI>>(null!)
|
|
86
|
-
// export const RouterStateContext = createContext<Store<RouterAPIState>>(null!)
|
|
87
|
-
// export const RouteContext = createContext<Store<RouteState>>(null!)
|
|
88
|
-
// const NOOP_ROUTE: RouteState = {
|
|
89
|
-
// component: () => null,
|
|
90
|
-
// id: "initial",
|
|
91
|
-
// hash: "",
|
|
92
|
-
// key: "initial",
|
|
93
|
-
// pathname: "",
|
|
94
|
-
// props: {},
|
|
95
|
-
// uri: "",
|
|
96
|
-
// view: "_unknown",
|
|
97
|
-
// search: "",
|
|
98
|
-
// query: {},
|
|
99
|
-
// returnState: undefined,
|
|
100
|
-
// }
|
|
101
|
-
// export const createRouteItemStore = (initial?: RouteState) => {
|
|
102
|
-
// return createStore<RouteState>(initial ?? NOOP_ROUTE)
|
|
103
|
-
// }
|
|
104
|
-
// export function createRouterAPIStore(initial?: RouterAPI) {
|
|
105
|
-
// return createStore<RouterAPI>(
|
|
106
|
-
// initial ?? {
|
|
107
|
-
// loader: new RouteLoader(),
|
|
108
|
-
// async navigate(url) {},
|
|
109
|
-
// async prefetch(url) {},
|
|
110
|
-
// async preload(url) {},
|
|
111
|
-
// subscribe(fn) {
|
|
112
|
-
// return () => {}
|
|
113
|
-
// },
|
|
114
|
-
// replaceHash(hash) {},
|
|
115
|
-
// replaceQuery(query) {},
|
|
116
|
-
// handleClickEvent(e, originalHref) {},
|
|
117
|
-
// emitEvent(event) {},
|
|
118
|
-
// },
|
|
119
|
-
// )
|
|
120
|
-
// }
|
|
121
|
-
// export function createRouterStateStore(initial?: RouterAPIState) {
|
|
122
|
-
// return createStore<RouterAPIState>(
|
|
123
|
-
// initial ?? {
|
|
124
|
-
// history: [],
|
|
125
|
-
// activeRoute: NOOP_ROUTE,
|
|
126
|
-
// blockers: [],
|
|
127
|
-
// },
|
|
128
|
-
// )
|
|
129
|
-
// }
|
|
41
|
+
export const clientMetaTags = proxy({
|
|
42
|
+
tags: null,
|
|
43
|
+
setMetaTags(tags) {
|
|
44
|
+
clientMetaTags.tags = tags;
|
|
45
|
+
},
|
|
46
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsSSR.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/hooks/useIsSSR.tsx"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,QAAQ,YAavB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { Dispatch } from "react";
|
|
1
2
|
/**
|
|
2
3
|
* Works exactly like useState, but allows back and forward navigation to restore the previous state.
|
|
3
4
|
* You must pass a unique ID as an additional first parameter to ensure the state is restored correctly.
|
|
4
5
|
*/
|
|
5
|
-
export declare function useRestorableState<T>(key: string, fallback
|
|
6
|
+
export declare function useRestorableState<T>(key: string, fallback: T): [T, Dispatch<T>];
|
|
7
|
+
//# sourceMappingURL=useRestorableState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRestorableState.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/hooks/useRestorableState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAY,MAAM,OAAO,CAAA;AAI1C;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAYhF"}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
1
|
import type { RouteState } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the current route object.
|
|
4
|
+
*
|
|
5
|
+
* In most circumstances, this will be the active top-level route.
|
|
6
|
+
*
|
|
7
|
+
* In cases where manual rendering of routes is taking place, such as during page transitions or in some modal cases.
|
|
8
|
+
*
|
|
9
|
+
* @returns The current route
|
|
10
|
+
*/
|
|
2
11
|
export declare function useRoute(): RouteState;
|
|
12
|
+
/**
|
|
13
|
+
* Returns the current route, if it matches the specified view, otherwise null.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useViewRoute<V extends keyof ViewProps>(view: V): Extract<RouteState, {
|
|
16
|
+
view: V;
|
|
17
|
+
}> | null;
|
|
18
|
+
//# sourceMappingURL=useRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRoute.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/hooks/useRoute.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,IAAI,UAAU,CAErC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,SAAS,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,IAAI,CAOxG"}
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
import { RouteItemContext } from "../context.js";
|
|
3
|
+
/**
|
|
4
|
+
* Returns the current route object.
|
|
5
|
+
*
|
|
6
|
+
* In most circumstances, this will be the active top-level route.
|
|
7
|
+
*
|
|
8
|
+
* In cases where manual rendering of routes is taking place, such as during page transitions or in some modal cases.
|
|
9
|
+
*
|
|
10
|
+
* @returns The current route
|
|
11
|
+
*/
|
|
3
12
|
export function useRoute() {
|
|
4
13
|
return useContext(RouteItemContext);
|
|
5
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns the current route, if it matches the specified view, otherwise null.
|
|
17
|
+
*/
|
|
18
|
+
export function useViewRoute(view) {
|
|
19
|
+
const route = useContext(RouteItemContext);
|
|
20
|
+
if (route.view === view) {
|
|
21
|
+
return route;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouteMeta.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/hooks/useRouteMeta.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,eAAO,MAAM,eAAe;UACd,SAAS;CACrB,CAAA;AAEF,wBAAgB,YAAY,IAGf,SAAS,CACrB"}
|
|
@@ -2,3 +2,4 @@ import type { RouteState } from "../types.js";
|
|
|
2
2
|
type TransitionFunction = (currentRoute: RouteState, nextRoute: RouteState) => void | Promise<any | void>;
|
|
3
3
|
export declare function useRouteTransition(func: TransitionFunction): void;
|
|
4
4
|
export {};
|
|
5
|
+
//# sourceMappingURL=useRouteTransition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouteTransition.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/hooks/useRouteTransition.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,KAAK,kBAAkB,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAA;AAEzG,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,QAe1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouter.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/hooks/useRouter.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,wBAAgB,SAAS,CAAC,CAAC,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,KAAK,CAAC,GAAG,CAAC,CAO1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouterEvents.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/hooks/useRouterEvents.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,wBAAgB,eAAe,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,QAWpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRouterState.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/hooks/useRouterState.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,wBAAgB,cAAc,CAAC,CAAC,GAAG,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,CAAC,GAAG,CAAC,CAI7F"}
|
|
@@ -1,10 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search param API object.
|
|
3
|
+
*/
|
|
1
4
|
export type SearchParamAPI<T> = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Set an individual parameter value by key.
|
|
7
|
+
*
|
|
8
|
+
* If the value is an array, then one or more `key[]` parameters will be set. Otherwise, a single `key` parameter will be set.
|
|
9
|
+
*
|
|
10
|
+
* If the value is `null` or `undefined`, the parameter will be removed from the query string.
|
|
11
|
+
*
|
|
12
|
+
* @param key The search parameter name
|
|
13
|
+
* @param value The value to set
|
|
14
|
+
*/
|
|
15
|
+
set<K extends keyof T>(key: K, value: T[K] | null | undefined): void;
|
|
16
|
+
/**
|
|
17
|
+
* Set all parameters at once, replacing the entire query string. Any parameters not present will be replaced with their default value. Passing an empty object is equivalent to calling `reset()`.
|
|
18
|
+
*
|
|
19
|
+
* @param value
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
setAll: (value: Partial<T>) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Returns a memoized setter function for a specific key.
|
|
25
|
+
*
|
|
26
|
+
* This is useful when you want to pass a setter function to a child component, without needing to pass the entire API object.
|
|
27
|
+
*
|
|
28
|
+
* For example:
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <SearchInput value={params.q} onSearch={api.setter("q")} />
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @param key The search parameter name
|
|
34
|
+
* @returns (value: T) => void
|
|
35
|
+
*/
|
|
36
|
+
setter<K extends keyof T>(key: K): (value: T[K] | null | undefined) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Reset all parameters to their default values.
|
|
39
|
+
*/
|
|
5
40
|
reset(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Gets the current value of a parameter. In most cases, you should use the `params` object returned from `useSearchParams` instead of this method.
|
|
43
|
+
*/
|
|
6
44
|
get<K extends keyof T>(key: K): T[K];
|
|
7
45
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Provides type-safe read/write access to query string parameters, integrating with the routing system.
|
|
48
|
+
*
|
|
49
|
+
* - Call `useSearchParams` with a default value object, which defines the expected shape of the query string parameters.
|
|
50
|
+
* - Only keys that are present in the default value object will be handled, and all others will be ignored.
|
|
51
|
+
* - Arrays of values are supported, and you should use a default value of `[]` for that key. You may want to cast the default parameter as an array of the expected type (eg. `myValue: [] as string[]`) to ensure that the parameter type is correct.
|
|
52
|
+
* - This hook returns a tuple with the current query string parameters object, and an API object with methods to interact with the query string. See {@link SearchParamAPI} for more details.
|
|
53
|
+
*
|
|
54
|
+
* For example:
|
|
55
|
+
* ```tsx
|
|
56
|
+
* const [params, api] = useSearchParams({
|
|
57
|
+
* mode: "list" as "list" | "grid",
|
|
58
|
+
* page: 1,
|
|
59
|
+
* tags: [] as string[],
|
|
60
|
+
* })
|
|
61
|
+
*
|
|
62
|
+
* api.set("mode", "grid")
|
|
63
|
+
* api.set("tags", ["tag1", "tag2"])
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* Note that if a parameter is set back to it's default value, it'll actually be _removed_ from the updated query string, keeping the URL clean when only the default values are set.
|
|
67
|
+
*
|
|
68
|
+
* ```tsx
|
|
69
|
+
* api.set("mode", "grid")
|
|
70
|
+
* // url becomes: "/?mode=grid"
|
|
71
|
+
* // params.mode === 'grid'
|
|
72
|
+
*
|
|
73
|
+
* api.set("mode", "list")
|
|
74
|
+
* // url becomes: "/"
|
|
75
|
+
* // params.mode === 'list'
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @param defaultValue - The default value object, defining the expected shape of the query string parameters.
|
|
79
|
+
* @returns A tuple of the resolve parameter object, and a {@link SearchParamAPI} object with methods to interact with the query string.
|
|
80
|
+
*/
|
|
81
|
+
export declare function useSearchParams<T extends object>(defaultValue: T): [T, SearchParamAPI<T>];
|
|
82
|
+
//# sourceMappingURL=useSearchParams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSearchParams.d.ts","sourceRoot":"","sources":["../../../../../src/app/lib/routing/hooks/useSearchParams.tsx"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;IAC9B;;;;;;;;;OASG;IACH,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAA;IACpE;;;;;OAKG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;IACnC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAC3E;;OAEG;IACH,KAAK,IAAI,IAAI,CAAA;IACb;;OAEG;IACH,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;CACrC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CA2DzF"}
|
|
@@ -1,30 +1,90 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
1
|
+
import { useMemo, useRef, useState } from "react";
|
|
2
2
|
import { useRoute } from "./useRoute.js";
|
|
3
3
|
import { useRouter } from "./useRouter.js";
|
|
4
|
+
import { parseQuery } from "../utils.js";
|
|
5
|
+
import { hash } from "object-code";
|
|
6
|
+
/**
|
|
7
|
+
* Provides type-safe read/write access to query string parameters, integrating with the routing system.
|
|
8
|
+
*
|
|
9
|
+
* - Call `useSearchParams` with a default value object, which defines the expected shape of the query string parameters.
|
|
10
|
+
* - Only keys that are present in the default value object will be handled, and all others will be ignored.
|
|
11
|
+
* - Arrays of values are supported, and you should use a default value of `[]` for that key. You may want to cast the default parameter as an array of the expected type (eg. `myValue: [] as string[]`) to ensure that the parameter type is correct.
|
|
12
|
+
* - This hook returns a tuple with the current query string parameters object, and an API object with methods to interact with the query string. See {@link SearchParamAPI} for more details.
|
|
13
|
+
*
|
|
14
|
+
* For example:
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const [params, api] = useSearchParams({
|
|
17
|
+
* mode: "list" as "list" | "grid",
|
|
18
|
+
* page: 1,
|
|
19
|
+
* tags: [] as string[],
|
|
20
|
+
* })
|
|
21
|
+
*
|
|
22
|
+
* api.set("mode", "grid")
|
|
23
|
+
* api.set("tags", ["tag1", "tag2"])
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Note that if a parameter is set back to it's default value, it'll actually be _removed_ from the updated query string, keeping the URL clean when only the default values are set.
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* api.set("mode", "grid")
|
|
30
|
+
* // url becomes: "/?mode=grid"
|
|
31
|
+
* // params.mode === 'grid'
|
|
32
|
+
*
|
|
33
|
+
* api.set("mode", "list")
|
|
34
|
+
* // url becomes: "/"
|
|
35
|
+
* // params.mode === 'list'
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param defaultValue - The default value object, defining the expected shape of the query string parameters.
|
|
39
|
+
* @returns A tuple of the resolve parameter object, and a {@link SearchParamAPI} object with methods to interact with the query string.
|
|
40
|
+
*/
|
|
4
41
|
export function useSearchParams(defaultValue) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
42
|
+
const [currentQuery, replaceQuery] = env.admin
|
|
43
|
+
? useState({})
|
|
44
|
+
: [useRoute().query, useRouter((r) => r.replaceQuery)];
|
|
45
|
+
const merged = useMemo(() => ({
|
|
8
46
|
...defaultValue,
|
|
9
|
-
...
|
|
10
|
-
}), [
|
|
47
|
+
...currentQuery,
|
|
48
|
+
}), [currentQuery]);
|
|
49
|
+
const values = useRef(merged);
|
|
50
|
+
values.current = merged;
|
|
51
|
+
// Memoized setters
|
|
52
|
+
const setters = useMemo(() => ({}), []);
|
|
53
|
+
// Gets the current value, directly from the source.
|
|
54
|
+
function get() {
|
|
55
|
+
if (env.client) {
|
|
56
|
+
return { ...defaultValue, ...parseQuery(document.location.search) };
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return merged;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Main update function
|
|
11
63
|
const update = (patch) => {
|
|
12
|
-
const value = { ...
|
|
64
|
+
const value = { ...get(), ...patch };
|
|
13
65
|
for (let key in defaultValue) {
|
|
14
|
-
if (defaultValue[key] === value[key] || [null, undefined].includes(value[key])) {
|
|
66
|
+
if (hash(defaultValue[key]) === hash(value[key]) || [null, undefined].includes(value[key])) {
|
|
15
67
|
delete value[key];
|
|
16
68
|
}
|
|
17
69
|
}
|
|
70
|
+
values.current = value;
|
|
18
71
|
replaceQuery(value);
|
|
19
72
|
};
|
|
20
73
|
return [
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
set: (key, value) => update({
|
|
24
|
-
setAll: (value) => update(
|
|
25
|
-
|
|
74
|
+
values.current,
|
|
75
|
+
useMemo(() => ({
|
|
76
|
+
set: (key, value) => update({ [key]: value }),
|
|
77
|
+
setAll: (value) => update({
|
|
78
|
+
...defaultValue,
|
|
79
|
+
...value,
|
|
80
|
+
}),
|
|
81
|
+
setter: (key) => {
|
|
82
|
+
if (!setters[key])
|
|
83
|
+
setters[key] = (value) => update({ [key]: value });
|
|
84
|
+
return setters[key];
|
|
85
|
+
},
|
|
26
86
|
reset: () => update({}),
|
|
27
|
-
get: (key) =>
|
|
28
|
-
},
|
|
87
|
+
get: (key) => values.current[key],
|
|
88
|
+
}), []),
|
|
29
89
|
];
|
|
30
90
|
}
|
|
@@ -3,6 +3,8 @@ export * from "./components/Link.js";
|
|
|
3
3
|
export * from "./components/ScrollRestoration.js";
|
|
4
4
|
export * from "./components/RouteRenderer.js";
|
|
5
5
|
export * from "./components/ClientOnly.js";
|
|
6
|
+
export * from "./components/BackButton.js";
|
|
7
|
+
export * from "./components/NativeLinkHandler.js";
|
|
6
8
|
export * from "./hooks/useRoute.js";
|
|
7
9
|
export * from "./hooks/useRouteTransition.js";
|
|
8
10
|
export * from "./hooks/useRouter.js";
|
|
@@ -11,3 +13,4 @@ export * from "./hooks/useRouterState.js";
|
|
|
11
13
|
export * from "./hooks/useRestorableState.js";
|
|
12
14
|
export * from "./hooks/useIsSSR.js";
|
|
13
15
|
export * from "./hooks/useSearchParams.js";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/routing/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAE1B,cAAc,sBAAsB,CAAA;AACpC,cAAc,mCAAmC,CAAA;AACjD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mCAAmC,CAAA;AAEjD,cAAc,qBAAqB,CAAA;AACnC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA"}
|
|
@@ -3,6 +3,8 @@ export * from "./components/Link.js";
|
|
|
3
3
|
export * from "./components/ScrollRestoration.js";
|
|
4
4
|
export * from "./components/RouteRenderer.js";
|
|
5
5
|
export * from "./components/ClientOnly.js";
|
|
6
|
+
export * from "./components/BackButton.js";
|
|
7
|
+
export * from "./components/NativeLinkHandler.js";
|
|
6
8
|
export * from "./hooks/useRoute.js";
|
|
7
9
|
export * from "./hooks/useRouteTransition.js";
|
|
8
10
|
export * from "./hooks/useRouter.js";
|
|
@@ -28,3 +28,4 @@ export declare class RouteLoader {
|
|
|
28
28
|
getRouteComponent<K extends keyof ViewProps>(view: K): DynamicComponent<FunctionComponent<ViewProps[K]>>;
|
|
29
29
|
get appComponent(): DynamicComponent<FunctionComponent<PropsWithChildren<AppData>>>;
|
|
30
30
|
}
|
|
31
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/routing/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,SAAS,CAAA;IACf,SAAS,EAAE,iBAAiB,CAAA;CAC7B,CAAA;AAED,qBAAa,UAAW,SAAQ,KAAK;IAE1B,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,MAAM;gBADlB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM;CAI5B;AAED,qBAAa,WAAW;IACtB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAY;IACpD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAY;IAC1D,OAAO,EAAE,OAAO,CAAQ;IACxB,OAAO,CAAC,SAAS,CAAgD;IACjE,OAAO,CAAC,YAAY,CAA2C;IAE/D,EAAE,SAAgB;IAElB,YAAY,CAAC,IAAI,EAAE,OAAO,KAAK;IAI/B,oBAAoB,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM;IAI5D,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,WAAW;IAyBnB,YAAY,CAAC,QAAQ,EAAE,MAAM;IAKvB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,UAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAiD9E,UAAU,CAAC,OAAO,EAAE,OAAO;IAI3B,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS;IAKnD,iBAAiB,CAAC,CAAC,SAAS,MAAM,SAAS,EAAE,IAAI,EAAE,CAAC,GACT,gBAAgB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAG5F,IAAI,YAAY,IAC6B,gBAAgB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAC3G;CACF"}
|
|
@@ -56,6 +56,7 @@ export class RouteLoader {
|
|
|
56
56
|
return this.entries.has(cacheKey);
|
|
57
57
|
}
|
|
58
58
|
async loadRouteData(pathname, withAppData = false) {
|
|
59
|
+
pathname = withTrailingSlash(pathname);
|
|
59
60
|
const cacheKey = this.getKey(pathname);
|
|
60
61
|
// Cached value?
|
|
61
62
|
if (this.entries.has(cacheKey))
|
|
@@ -65,27 +66,35 @@ export class RouteLoader {
|
|
|
65
66
|
serverless: env.serverless,
|
|
66
67
|
debug: env.dev,
|
|
67
68
|
});
|
|
68
|
-
const promise = this.fetchImpl(requestUrl
|
|
69
|
-
.then((response) =>
|
|
70
|
-
.
|
|
69
|
+
const promise = this.fetchImpl(requestUrl)
|
|
70
|
+
.then(async (response) => {
|
|
71
|
+
if (response.redirected) {
|
|
72
|
+
return { redirect: response.url };
|
|
73
|
+
}
|
|
74
|
+
let text = await response.text();
|
|
71
75
|
if (this.processProps) {
|
|
72
76
|
text = this.processProps(text);
|
|
73
77
|
}
|
|
74
78
|
try {
|
|
75
|
-
|
|
79
|
+
const payload = JSON.parse(text);
|
|
80
|
+
if (!payload.view && !payload.redirect) {
|
|
81
|
+
throw new RouteError(`Invalid route data for '${pathname}'`, 500);
|
|
82
|
+
}
|
|
83
|
+
return payload;
|
|
76
84
|
}
|
|
77
85
|
catch (err) {
|
|
78
86
|
throw new RouteError(`JSON parse error for route '${pathname}':\n${err?.message}`, 500);
|
|
79
87
|
}
|
|
80
88
|
})
|
|
81
|
-
.then((data) => {
|
|
89
|
+
.then(async (data) => {
|
|
82
90
|
if (data.redirect) {
|
|
83
|
-
const redirect = data.redirect;
|
|
84
|
-
data = this.loadRouteData(redirect)
|
|
85
|
-
|
|
86
|
-
return data;
|
|
87
|
-
});
|
|
91
|
+
const redirect = parseURL(data.redirect).pathname;
|
|
92
|
+
data = await this.loadRouteData(redirect);
|
|
93
|
+
data.canonical = redirect;
|
|
88
94
|
}
|
|
95
|
+
return data;
|
|
96
|
+
})
|
|
97
|
+
.then((data) => {
|
|
89
98
|
this.entries.set(cacheKey, new Promise((resolve) => resolve(data)));
|
|
90
99
|
return data;
|
|
91
100
|
});
|