eddev 0.3.38 → 2.0.0-beta.10
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/bin/eddev.js +1 -3
- package/css/devtools.css +15 -0
- package/css/editor-styles.css +94 -0
- package/dist/app/entry/boot-admin.d.ts +1 -0
- package/dist/app/entry/boot-admin.js +8 -0
- package/dist/app/entry/spa-root.d.ts +1 -0
- package/dist/app/entry/spa-root.js +9 -0
- package/dist/app/entry/ssr-root-client.d.ts +4 -0
- package/dist/app/entry/ssr-root-client.js +9 -0
- package/dist/app/entry/ssr-root.d.ts +9 -0
- package/dist/app/entry/ssr-root.js +21 -0
- package/{admin → dist/app/lib/admin}/defineField.d.ts +2 -2
- package/dist/app/lib/admin/defineField.js +3 -0
- package/{admin → dist/app/lib/admin}/defineWidget.d.ts +1 -1
- package/dist/app/lib/admin/defineWidget.js +6 -0
- package/dist/app/lib/admin/index.d.ts +2 -0
- package/dist/app/lib/admin/index.js +2 -0
- package/dist/app/lib/admin/installFieldTypes.js +92 -0
- package/dist/app/lib/admin/runWidgets.js +38 -0
- package/dist/app/lib/blocks/ContentBlocks.d.ts +83 -0
- package/dist/app/lib/blocks/ContentBlocks.js +92 -0
- package/dist/app/lib/blocks/EditableText.d.ts +41 -0
- package/dist/app/lib/blocks/EditableText.js +50 -0
- package/{blocks → dist/app/lib/blocks}/ErrorBoundaryFrontend.d.ts +2 -2
- package/dist/app/lib/blocks/ErrorBoundaryFrontend.js +35 -0
- package/dist/app/lib/blocks/InnerBlocks.d.ts +42 -0
- package/dist/app/lib/blocks/InnerBlocks.js +55 -0
- package/dist/app/lib/blocks/block-utils.d.ts +24 -0
- package/dist/app/lib/blocks/block-utils.js +41 -0
- package/dist/app/lib/blocks/defineBlock.d.ts +2 -0
- package/dist/app/lib/blocks/defineBlock.js +3 -0
- package/dist/app/lib/blocks/editor/EditorSupport.d.ts +5 -0
- package/dist/app/lib/blocks/editor/EditorSupport.js +19 -0
- package/{blocks → dist/app/lib/blocks/editor}/ErrorBoundaryEditor.d.ts +1 -1
- package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.js +28 -0
- package/dist/app/lib/blocks/editor/block-templates.d.ts +3 -0
- package/dist/app/lib/blocks/editor/block-templates.js +9 -0
- package/dist/app/lib/blocks/editor/blocks-by-tag.d.ts +7 -0
- package/dist/app/lib/blocks/editor/blocks-by-tag.js +42 -0
- package/dist/app/lib/blocks/editor/controls.d.ts +10 -0
- package/dist/app/lib/blocks/editor/controls.js +20 -0
- package/dist/app/lib/blocks/editor/editor-config.d.ts +58 -0
- package/dist/app/lib/blocks/editor/editor-config.js +191 -0
- package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts +2 -0
- package/dist/app/lib/blocks/editor/installGutenbergHooks.js +131 -0
- package/dist/app/lib/blocks/editor/usePostEditor.d.ts +27 -0
- package/dist/app/lib/blocks/editor/usePostEditor.js +79 -0
- package/dist/app/lib/blocks/index.d.ts +9 -0
- package/dist/app/lib/blocks/index.js +9 -0
- package/dist/app/lib/blocks/inline-editing.d.ts +54 -0
- package/dist/app/lib/blocks/inline-editing.js +114 -0
- package/dist/app/lib/devtools/components/BreakpointIndicator.js +81 -0
- package/{dev-ui → dist/app/lib/devtools}/components/DevUI.d.ts +1 -0
- package/dist/app/lib/devtools/components/DevUI.js +6 -0
- package/dist/app/lib/devtools/dev-tools-store.d.ts +9 -0
- package/dist/app/lib/devtools/dev-tools-store.js +8 -0
- package/dist/app/lib/devtools/hooks/usePersistState.js +31 -0
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts +4183 -0
- package/dist/app/lib/devtools/hooks/useTailwind.js +9 -0
- package/dist/app/lib/devtools/index.d.ts +1 -0
- package/dist/app/lib/devtools/index.js +1 -0
- package/dist/app/lib/devtools/loader.js +23 -0
- package/dist/app/lib/devtools/tailwind.config.d.ts +23 -0
- package/dist/app/lib/devtools/tailwind.config.js +24 -0
- package/{hooks → dist/app/lib/devtools}/useQueryDebug.d.ts +1 -1
- package/dist/app/lib/devtools/useQueryDebug.js +13 -0
- package/dist/app/lib/dynamic/dynamic.d.ts +8 -0
- package/dist/app/lib/dynamic/dynamic.js +25 -0
- package/dist/app/lib/dynamic/index.d.ts +1 -0
- package/dist/app/lib/dynamic/index.js +1 -0
- package/dist/app/lib/hooks/apiConfig.d.ts +18 -0
- package/dist/app/lib/hooks/apiConfig.js +4 -0
- package/{hooks → dist/app/lib/hooks}/index.d.ts +2 -0
- package/dist/app/lib/hooks/index.js +5 -0
- package/dist/app/lib/hooks/queryUtils.d.ts +49 -0
- package/dist/app/lib/hooks/queryUtils.js +180 -0
- package/dist/app/lib/hooks/useAppData.d.ts +4 -0
- package/dist/app/lib/hooks/useAppData.js +11 -0
- package/{hooks → dist/app/lib/hooks}/usePageLoad.d.ts +1 -1
- package/dist/app/lib/hooks/usePageLoad.js +5 -0
- package/dist/app/lib/hooks/useRPC.d.ts +9 -0
- package/dist/app/lib/hooks/useRPC.js +9 -0
- package/dist/app/lib/internal/index.d.ts +4 -0
- package/dist/app/lib/internal/index.js +4 -0
- package/dist/app/lib/internal/internal-store.d.ts +9 -0
- package/dist/app/lib/internal/internal-store.js +7 -0
- package/dist/app/lib/internal/read-admin-manifest.d.ts +19 -0
- package/dist/app/lib/internal/read-admin-manifest.js +17 -0
- package/dist/app/lib/internal/read-block-manifest.d.ts +15 -0
- package/dist/app/lib/internal/read-block-manifest.js +16 -0
- package/dist/app/lib/internal/read-view-manifest.d.ts +12 -0
- package/dist/app/lib/internal/read-view-manifest.js +3 -0
- package/dist/app/lib/legacy-stitches/createStitches.d.ts +615 -0
- package/dist/app/lib/legacy-stitches/createStitches.js +439 -0
- package/dist/app/lib/legacy-stitches/index.js +1 -0
- package/{components → dist/app/lib/routing/components}/BrowserRouter.d.ts +2 -4
- package/dist/app/lib/routing/components/BrowserRouter.js +351 -0
- package/dist/app/lib/routing/components/ClientOnly.d.ts +12 -0
- package/dist/app/lib/routing/components/ClientOnly.js +14 -0
- package/dist/app/lib/routing/components/Link.d.ts +26 -0
- package/dist/app/lib/routing/components/Link.js +93 -0
- package/dist/app/lib/routing/components/RouteRenderer.d.ts +9 -0
- package/dist/app/lib/routing/components/RouteRenderer.js +28 -0
- package/dist/app/lib/routing/components/SSRRouter.d.ts +9 -0
- package/dist/app/lib/routing/components/SSRRouter.js +14 -0
- package/dist/app/lib/routing/components/ScrollRestoration.d.ts +15 -0
- package/dist/app/lib/routing/components/ScrollRestoration.js +32 -0
- package/dist/app/lib/routing/context.d.ts +5 -0
- package/dist/app/lib/routing/context.js +129 -0
- package/dist/app/lib/routing/hooks/useIsSSR.d.ts +8 -0
- package/dist/app/lib/routing/hooks/useIsSSR.js +22 -0
- package/dist/app/lib/routing/hooks/useRestorableState.d.ts +5 -0
- package/dist/app/lib/routing/hooks/useRestorableState.js +17 -0
- package/dist/app/lib/routing/hooks/useRoute.d.ts +2 -0
- package/dist/app/lib/routing/hooks/useRoute.js +5 -0
- package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +4 -0
- package/dist/app/lib/routing/hooks/useRouteTransition.js +12 -0
- package/dist/app/lib/routing/hooks/useRouter.d.ts +2 -0
- package/dist/app/lib/routing/hooks/useRouter.js +11 -0
- package/dist/app/lib/routing/hooks/useRouterEvents.d.ts +2 -0
- package/dist/app/lib/routing/hooks/useRouterEvents.js +10 -0
- package/dist/app/lib/routing/hooks/useRouterState.d.ts +2 -0
- package/dist/app/lib/routing/hooks/useRouterState.js +8 -0
- package/dist/app/lib/routing/hooks/useSearchParams.d.ts +10 -0
- package/dist/app/lib/routing/hooks/useSearchParams.js +30 -0
- package/dist/app/lib/routing/index.d.ts +13 -0
- package/dist/app/lib/routing/index.js +13 -0
- package/dist/app/lib/routing/loader.d.ts +30 -0
- package/dist/app/lib/routing/loader.js +108 -0
- package/dist/app/lib/routing/types.d.ts +138 -0
- package/dist/app/lib/routing/utils.d.ts +15 -0
- package/dist/app/lib/routing/utils.js +94 -0
- package/dist/app/lib/views/defineView.d.ts +4 -0
- package/dist/app/lib/views/defineView.js +3 -0
- package/dist/app/lib/views/index.js +1 -0
- package/dist/app/server/index.d.ts +3 -0
- package/dist/app/server/index.js +3 -0
- package/dist/app/server/proxy-wp-admin.d.ts +3 -0
- package/dist/app/server/proxy-wp-admin.js +106 -0
- package/dist/app/server/render-ssr-page.d.ts +2 -0
- package/dist/app/server/render-ssr-page.js +22 -0
- package/dist/app/server/server-context.d.ts +34 -0
- package/dist/app/server/server-context.js +116 -0
- package/dist/app/server/utils/headers.d.ts +5 -0
- package/dist/app/server/utils/headers.js +28 -0
- package/dist/app/server/utils/index.html.d.ts +2 -0
- package/dist/app/server/utils/index.html.js +14 -0
- package/dist/app/server/utils/replace-host.d.ts +10 -0
- package/dist/app/server/utils/replace-host.js +61 -0
- package/dist/app/utils/query-client.d.ts +2 -0
- package/dist/app/utils/query-client.js +16 -0
- package/dist/app/utils/wp.d.ts +26 -0
- package/dist/node/cli/cli-mode.d.ts +10 -0
- package/dist/node/cli/cli-mode.js +12 -0
- package/dist/node/cli/cli-worker.d.ts +13 -0
- package/dist/node/cli/cli-worker.js +117 -0
- package/dist/node/cli/cli.js +197 -0
- package/dist/node/cli/display/CLIApp.d.ts +16 -0
- package/dist/node/cli/display/CLIApp.js +117 -0
- package/dist/node/cli/display/boot-cli-app.d.ts +2 -0
- package/dist/node/cli/display/boot-cli-app.js +10 -0
- package/{cli → dist/node/cli}/display/components/Fullscreen.d.ts +1 -1
- package/dist/node/cli/display/components/Fullscreen.js +24 -0
- package/dist/node/cli/display/components/LogEntries.d.ts +13 -0
- package/dist/node/cli/display/components/LogEntries.js +87 -0
- package/dist/node/cli/display/components/MenuItem.d.ts +6 -0
- package/dist/node/cli/display/components/MenuItem.js +11 -0
- package/dist/node/cli/display/components/TextInput.d.ts +44 -0
- package/dist/node/cli/display/components/TextInput.js +105 -0
- package/dist/node/cli/display/hooks/useManifest.d.ts +2 -0
- package/dist/node/cli/display/hooks/useManifest.js +8 -0
- package/dist/node/cli/display/hooks/useStatefulLog.d.ts +11 -0
- package/dist/node/cli/display/hooks/useStatefulLog.js +51 -0
- package/dist/node/cli/display/tools/BlockList.d.ts +2 -0
- package/dist/node/cli/display/tools/BlockList.js +10 -0
- package/dist/node/cli/display/tools/CreateBlock.d.ts +2 -0
- package/dist/node/cli/display/tools/CreateBlock.js +8 -0
- package/dist/node/cli/display/tools/cli-tool-list.d.ts +2 -0
- package/dist/node/cli/display/tools/cli-tool-list.js +23 -0
- package/dist/node/cli/display/tools/cli-tools.d.ts +26 -0
- package/dist/node/cli/display/tools/cli-tools.js +15 -0
- package/dist/node/cli/display/util/colors.d.ts +4 -0
- package/dist/node/cli/display/util/colors.js +63 -0
- package/dist/node/cli/version.d.ts +1 -0
- package/dist/node/cli/version.js +1 -0
- package/dist/node/compiler/build-vinxi.d.ts +8 -0
- package/dist/node/compiler/build-vinxi.js +37 -0
- package/dist/node/compiler/bundler.admin.d.ts +13 -0
- package/dist/node/compiler/bundler.admin.js +37 -0
- package/dist/node/compiler/bundler.frontend.d.ts +13 -0
- package/dist/node/compiler/bundler.frontend.js +37 -0
- package/dist/node/compiler/dev-server.d.ts +18 -0
- package/dist/node/compiler/dev-server.js +97 -0
- package/dist/node/compiler/get-vite-config.d.ts +19 -0
- package/dist/node/compiler/get-vite-config.js +184 -0
- package/dist/node/compiler/vinxi-app.d.ts +10 -0
- package/dist/node/compiler/vinxi-app.js +121 -0
- package/dist/node/compiler/vinxi-codegen.d.ts +12 -0
- package/dist/node/compiler/vinxi-codegen.js +408 -0
- package/dist/node/graphql/graphql-codegen.d.ts +30 -0
- package/dist/node/graphql/graphql-codegen.js +503 -0
- package/dist/node/graphql/graphql-schema-loader.d.ts +17 -0
- package/dist/node/graphql/graphql-schema-loader.js +91 -0
- package/dist/node/graphql/plugins/gql-plugin-files.d.ts +14 -0
- package/dist/node/graphql/plugins/gql-plugin-files.js +66 -0
- package/dist/node/graphql/plugins/gql-plugin-no-duplicates.d.ts +8 -0
- package/dist/node/graphql/plugins/gql-plugin-no-duplicates.js +10 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.d.ts +8 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.js +263 -0
- package/dist/node/graphql/query-files-loader.d.ts +26 -0
- package/dist/node/graphql/query-files-loader.js +54 -0
- package/dist/node/graphql/wp-info-query.d.ts +1 -0
- package/dist/node/graphql/wp-info-query.js +29 -0
- package/{config/config-schema.d.ts → dist/node/project/config.d.ts} +54 -38
- package/dist/node/project/config.js +138 -0
- package/dist/node/project/eddev-build-file.d.ts +10 -0
- package/dist/node/project/eddev-build-file.js +79 -0
- package/dist/node/project/env.d.ts +39 -0
- package/dist/node/project/env.js +77 -0
- package/dist/node/project/favicons.js +1 -0
- package/dist/node/project/manifest/block-manifest.d.ts +19 -0
- package/dist/node/project/manifest/block-manifest.js +206 -0
- package/dist/node/project/manifest/field-manifest.d.ts +17 -0
- package/dist/node/project/manifest/field-manifest.js +42 -0
- package/dist/node/project/manifest/manifest.d.ts +30 -0
- package/dist/node/project/manifest/manifest.js +105 -0
- package/dist/node/project/manifest/view-manifest.d.ts +19 -0
- package/dist/node/project/manifest/view-manifest.js +152 -0
- package/dist/node/project/manifest/widget-manifest.d.ts +17 -0
- package/dist/node/project/manifest/widget-manifest.js +42 -0
- package/dist/node/project/project.d.ts +58 -0
- package/dist/node/project/project.js +113 -0
- package/dist/node/project/wp-info.d.ts +32 -0
- package/dist/node/project/wp-info.js +32 -0
- package/dist/node/types/block-type.d.ts +92 -0
- package/dist/node/types/block-type.js +82 -0
- package/dist/node/types/view-type.d.ts +31 -0
- package/dist/node/types/view-type.js +53 -0
- package/dist/node/utils/format-zod-error.d.ts +3 -0
- package/dist/node/utils/format-zod-error.js +33 -0
- package/dist/node/utils/fs-codegen.d.ts +40 -0
- package/dist/node/utils/fs-codegen.js +97 -0
- package/dist/node/utils/fs.d.ts +106 -0
- package/dist/node/utils/fs.js +58 -0
- package/dist/node/utils/get-repo-info.d.ts +7 -0
- package/dist/node/utils/get-repo-info.js +21 -0
- package/dist/node/utils/helpers.d.ts +2 -0
- package/dist/node/utils/helpers.js +14 -0
- package/dist/node/utils/highlight-code.d.ts +10 -0
- package/dist/node/utils/highlight-code.js +30 -0
- package/dist/node/utils/is-deploying.d.ts +4 -0
- package/dist/node/utils/is-deploying.js +6 -0
- package/dist/node/utils/report-builder.d.ts +9 -0
- package/dist/node/utils/report-builder.js +51 -0
- package/dist/node/utils/self-signed-cert.d.ts +4 -0
- package/dist/node/utils/self-signed-cert.js +35 -0
- package/dist/node/utils/stateful-log.d.ts +65 -0
- package/dist/node/utils/stateful-log.js +223 -0
- package/dist/node/utils/ts-export-extractor.d.ts +9 -0
- package/dist/node/utils/ts-export-extractor.js +71 -0
- package/dist/node/utils/watch-file-tree.d.ts +11 -0
- package/dist/node/utils/watch-file-tree.js +58 -0
- package/package.json +121 -102
- package/stitches-archive/config.d.ts +210 -0
- package/stitches-archive/css-util.d.ts +119 -0
- package/stitches-archive/css.d.ts +9797 -0
- package/stitches-archive/index.d.mts +144 -0
- package/stitches-archive/index.d.ts +82 -0
- package/stitches-archive/index.mjs +2 -0
- package/stitches-archive/stitches.d.ts +288 -0
- package/stitches-archive/styled-component.d.ts +163 -0
- package/stitches-archive/theme.d.ts +43 -0
- package/stitches-archive/util.d.ts +32 -0
- package/tsconfig.app.json +20 -0
- package/tsconfig.json +2 -104
- package/tsconfig.node.json +20 -0
- package/types.app.d.ts +22 -0
- package/types.app.internal.d.ts +13 -0
- package/types.env.d.ts +16 -0
- package/types.meta.d.ts +319 -0
- package/types.node.d.ts +3 -0
- package/admin/components/FileWell.d.ts +0 -8
- package/admin/components/FileWell.js +0 -189
- package/admin/components/ImageWell.d.ts +0 -9
- package/admin/components/ImageWell.js +0 -209
- package/admin/defineField.js +0 -7
- package/admin/defineWidget.js +0 -10
- package/admin/index.d.ts +0 -4
- package/admin/index.js +0 -16
- package/admin/installFieldTypes.js +0 -71
- package/admin/runWidgets.js +0 -55
- package/admin/selectMedia.d.ts +0 -31
- package/admin/selectMedia.js +0 -9
- package/blocks/ContentBlocks.d.ts +0 -40
- package/blocks/ContentBlocks.js +0 -125
- package/blocks/ErrorBoundaryEditor.js +0 -64
- package/blocks/ErrorBoundaryFrontend.js +0 -69
- package/blocks/InspectorControls.d.ts +0 -2
- package/blocks/InspectorControls.js +0 -13
- package/blocks/blockAttributes.d.ts +0 -20
- package/blocks/blockAttributes.js +0 -81
- package/blocks/defineBlock.d.ts +0 -2
- package/blocks/defineBlock.js +0 -7
- package/blocks/index.d.ts +0 -5
- package/blocks/index.js +0 -23
- package/blocks/inlineEditing.d.ts +0 -32
- package/blocks/inlineEditing.js +0 -141
- package/blocks/installGutenbergHooks.d.ts +0 -2
- package/blocks/installGutenbergHooks.js +0 -211
- package/build/babel/plugin-name-defined-components.d.ts +0 -7
- package/build/babel/plugin-name-defined-components.js +0 -47
- package/build/build-favicon.d.ts +0 -1
- package/build/build-favicon.js +0 -71
- package/build/clean.d.ts +0 -1
- package/build/clean.js +0 -60
- package/build/create-codegen-worker.d.ts +0 -3
- package/build/create-codegen-worker.js +0 -71
- package/build/create-serverless-dev-worker.d.ts +0 -3
- package/build/create-serverless-dev-worker.js +0 -99
- package/build/create-webpack-worker.d.ts +0 -3
- package/build/create-webpack-worker.js +0 -64
- package/build/file-tree.d.ts +0 -5
- package/build/file-tree.js +0 -45
- package/build/get-webpack-config.d.ts +0 -3
- package/build/get-webpack-config.js +0 -426
- package/build/graphql-codegen/graphql-codegen-blocks.d.ts +0 -1
- package/build/graphql-codegen/graphql-codegen-blocks.js +0 -7
- package/build/graphql-codegen/graphql-codegen-files.js +0 -64
- package/build/graphql-codegen/graphql-codegen-no-duplicates.js +0 -13
- package/build/graphql-codegen/graphql-codegen-queries.d.ts +0 -1
- package/build/graphql-codegen/graphql-codegen-queries.js +0 -248
- package/build/manifests/manifest-blocks.d.ts +0 -12
- package/build/manifests/manifest-blocks.js +0 -61
- package/build/manifests/manifest-fields.d.ts +0 -12
- package/build/manifests/manifest-fields.js +0 -42
- package/build/manifests/manifest-views.d.ts +0 -12
- package/build/manifests/manifest-views.js +0 -49
- package/build/manifests/manifest-widgets.d.ts +0 -12
- package/build/manifests/manifest-widgets.js +0 -42
- package/build/manifests/manifest.d.ts +0 -11
- package/build/manifests/manifest.js +0 -100
- package/build/reporter.d.ts +0 -12
- package/build/reporter.js +0 -102
- package/build/serverless/create-next-app.d.ts +0 -9
- package/build/serverless/create-next-app.js +0 -536
- package/build/state/codegen-state.d.ts +0 -32
- package/build/state/codegen-state.js +0 -2
- package/build/state/compiler-state.d.ts +0 -49
- package/build/state/compiler-state.js +0 -2
- package/build/state/serverless-state.d.ts +0 -26
- package/build/state/serverless-state.js +0 -2
- package/build/workers/codegen-worker-script.d.ts +0 -2
- package/build/workers/codegen-worker-script.js +0 -624
- package/build/workers/serverless-worker-dev-script.d.ts +0 -1
- package/build/workers/serverless-worker-dev-script.js +0 -21
- package/build/workers/webpack-worker-script.d.ts +0 -2
- package/build/workers/webpack-worker-script.js +0 -171
- package/cli/build.dev.d.ts +0 -7
- package/cli/build.dev.js +0 -136
- package/cli/build.prod.d.ts +0 -5
- package/cli/build.prod.js +0 -107
- package/cli/cli.js +0 -90
- package/cli/display/components/BundleDisplay.d.ts +0 -5
- package/cli/display/components/BundleDisplay.js +0 -56
- package/cli/display/components/CodegenDisplay.d.ts +0 -5
- package/cli/display/components/CodegenDisplay.js +0 -62
- package/cli/display/components/DevCLIDisplay.d.ts +0 -12
- package/cli/display/components/DevCLIDisplay.js +0 -42
- package/cli/display/components/Fullscreen.js +0 -39
- package/cli/display/components/ServerlessDisplay.d.ts +0 -8
- package/cli/display/components/ServerlessDisplay.js +0 -68
- package/cli/display/components/StatusIcon.d.ts +0 -5
- package/cli/display/components/StatusIcon.js +0 -9
- package/cli/preinstall.d.ts +0 -1
- package/cli/preinstall.js +0 -19
- package/cli/setup.d.ts +0 -1
- package/cli/setup.js +0 -90
- package/components/AdminBar.d.ts +0 -1
- package/components/AdminBar.js +0 -9
- package/components/BrowserRouter.js +0 -155
- package/components/InlinePage.d.ts +0 -11
- package/components/InlinePage.js +0 -70
- package/components/NextRouter.d.ts +0 -9
- package/components/NextRouter.js +0 -45
- package/components/index.d.ts +0 -2
- package/components/index.js +0 -14
- package/config/config-schema.js +0 -38
- package/config/create-schema-file.d.ts +0 -1
- package/config/create-schema-file.js +0 -20
- package/config/get-config.d.ts +0 -78
- package/config/get-config.js +0 -32
- package/config/index.d.ts +0 -2
- package/config/index.js +0 -14
- package/config/parse-config.d.ts +0 -51
- package/config/parse-config.js +0 -8
- package/config/print-zod-errors.d.ts +0 -2
- package/config/print-zod-errors.js +0 -14
- package/dev-ui/components/BreakpointColumnHeader.d.ts +0 -10
- package/dev-ui/components/BreakpointColumnHeader.js +0 -47
- package/dev-ui/components/BreakpointIndicator.js +0 -139
- package/dev-ui/components/DevUI.js +0 -28
- package/dev-ui/components/Launcher.d.ts +0 -98
- package/dev-ui/components/Launcher.js +0 -94
- package/dev-ui/components/PanelWrapper.d.ts +0 -8
- package/dev-ui/components/PanelWrapper.js +0 -37
- package/dev-ui/components/ResponsiveLerpControl.d.ts +0 -7
- package/dev-ui/components/ResponsiveLerpControl.js +0 -176
- package/dev-ui/components/ResponsiveScaleEditor.d.ts +0 -25
- package/dev-ui/components/ResponsiveScaleEditor.js +0 -238
- package/dev-ui/components/atoms/Button.d.ts +0 -47
- package/dev-ui/components/atoms/Button.js +0 -67
- package/dev-ui/components/atoms/Dropdown.d.ts +0 -13
- package/dev-ui/components/atoms/Dropdown.js +0 -50
- package/dev-ui/components/atoms/NumberField.d.ts +0 -11
- package/dev-ui/components/atoms/NumberField.js +0 -111
- package/dev-ui/components/atoms/Spacer.d.ts +0 -42
- package/dev-ui/components/atoms/Spacer.js +0 -8
- package/dev-ui/components/atoms/Text.d.ts +0 -45
- package/dev-ui/components/atoms/Text.js +0 -39
- package/dev-ui/components/atoms/ToggleButton.d.ts +0 -8
- package/dev-ui/components/atoms/ToggleButton.js +0 -41
- package/dev-ui/components/atoms/Tooltip.d.ts +0 -9
- package/dev-ui/components/atoms/Tooltip.js +0 -66
- package/dev-ui/components/panels/AppDataDebugger.d.ts +0 -1
- package/dev-ui/components/panels/AppDataDebugger.js +0 -29
- package/dev-ui/components/panels/ColorEditor.d.ts +0 -1
- package/dev-ui/components/panels/ColorEditor.js +0 -128
- package/dev-ui/components/panels/PageDataDebugger.d.ts +0 -1
- package/dev-ui/components/panels/PageDataDebugger.js +0 -30
- package/dev-ui/components/panels/QueryDebugger.d.ts +0 -1
- package/dev-ui/components/panels/QueryDebugger.js +0 -46
- package/dev-ui/components/panels/SpacingEditor.d.ts +0 -1
- package/dev-ui/components/panels/SpacingEditor.js +0 -88
- package/dev-ui/components/panels/TypographyEditor.d.ts +0 -1
- package/dev-ui/components/panels/TypographyEditor.js +0 -97
- package/dev-ui/hooks/useBreakpoint.d.ts +0 -11
- package/dev-ui/hooks/useBreakpoint.js +0 -59
- package/dev-ui/hooks/usePersistState.js +0 -36
- package/dev-ui/hooks/useStylesheet.d.ts +0 -4
- package/dev-ui/hooks/useStylesheet.js +0 -31
- package/dev-ui/icons.d.ts +0 -15
- package/dev-ui/icons.js +0 -30
- package/dev-ui/index.d.ts +0 -1
- package/dev-ui/index.js +0 -13
- package/dev-ui/loader.js +0 -44
- package/dev-ui/panels.d.ts +0 -11
- package/dev-ui/panels.js +0 -47
- package/dev-ui/theme.d.ts +0 -151
- package/dev-ui/theme.js +0 -50
- package/dynamic/dynamic-component.d.ts +0 -10
- package/dynamic/dynamic-component.js +0 -8
- package/dynamic/index.d.ts +0 -1
- package/dynamic/index.js +0 -13
- package/entry/Root.d.ts +0 -3
- package/entry/Root.js +0 -56
- package/entry/entry.admin.dev.d.ts +0 -1
- package/entry/entry.admin.dev.js +0 -26
- package/entry/entry.admin.prod.d.ts +0 -1
- package/entry/entry.admin.prod.js +0 -16
- package/entry/entry.monolith.dev.d.ts +0 -6
- package/entry/entry.monolith.dev.js +0 -19
- package/entry/entry.monolith.prod.d.ts +0 -6
- package/entry/entry.monolith.prod.js +0 -18
- package/entry/entry.publicPath.js +0 -6
- package/gravityforms/index.d.ts +0 -2
- package/gravityforms/index.js +0 -14
- package/gravityforms/types.d.ts +0 -140
- package/gravityforms/types.js +0 -2
- package/gravityforms/useGravityForm.d.ts +0 -30
- package/gravityforms/useGravityForm.js +0 -292
- package/hooks/index.js +0 -15
- package/hooks/queryUtils.d.ts +0 -63
- package/hooks/queryUtils.js +0 -281
- package/hooks/useAppData.d.ts +0 -10
- package/hooks/useAppData.js +0 -37
- package/hooks/usePageLoad.js +0 -11
- package/hooks/useQuery.d.ts +0 -1
- package/hooks/useQuery.js +0 -10
- package/hooks/useQueryDebug.js +0 -21
- package/hooks/useRPC.d.ts +0 -12
- package/hooks/useRPC.js +0 -20
- package/index.d.ts +0 -1
- package/index.js +0 -5
- package/routing/index.d.ts +0 -1
- package/routing/index.js +0 -13
- package/routing/remoteProps.d.ts +0 -22
- package/routing/remoteProps.js +0 -103
- package/routing/routing.d.ts +0 -96
- package/routing/routing.js +0 -442
- package/routing/updateEditLink.d.ts +0 -1
- package/routing/updateEditLink.js +0 -12
- package/routing/updateHeadTags.d.ts +0 -2
- package/routing/updateHeadTags.js +0 -11
- package/serverless/define-api.d.ts +0 -2
- package/serverless/define-api.js +0 -66
- package/serverless/define-rpc-router.d.ts +0 -6
- package/serverless/define-rpc-router.js +0 -35
- package/serverless/error-codes.d.ts +0 -2
- package/serverless/error-codes.js +0 -14
- package/serverless/index.d.ts +0 -5
- package/serverless/index.js +0 -18
- package/serverless/rpc-provider.d.ts +0 -1
- package/serverless/rpc-provider.js +0 -5
- package/serverless-template/README.md +0 -34
- package/serverless-template/_utils/PageMeta.tsx +0 -44
- package/serverless-template/_utils/ed-config.ts +0 -5
- package/serverless-template/_utils/fetch-wordpress-props.ts +0 -62
- package/serverless-template/_utils/fetch-wp.ts +0 -34
- package/serverless-template/_utils/swr.ts +0 -43
- package/serverless-template/global.d.ts +0 -15
- package/serverless-template/next-env.d.ts +0 -3
- package/serverless-template/next.config.js +0 -119
- package/serverless-template/null.ts +0 -1
- package/serverless-template/package.json +0 -21
- package/serverless-template/pages/404.tsx +0 -12
- package/serverless-template/pages/[...slug].tsx +0 -35
- package/serverless-template/pages/_app.tsx +0 -55
- package/serverless-template/pages/_document.tsx +0 -65
- package/serverless-template/pages/api/rest/[...method].ts +0 -59
- package/serverless-template/pages/api/robots.ts +0 -49
- package/serverless-template/pages/api/sitemap/[...sitemap].ts +0 -56
- package/serverless-template/pages/api/trpc/[...trpc].ts +0 -41
- package/serverless-template/pages/index.tsx +0 -15
- package/serverless-template/tsconfig.json +0 -39
- package/style/createStitches.d.ts +0 -1058
- package/style/createStitches.js +0 -443
- package/style/index.js +0 -13
- package/utils/Observable.d.ts +0 -11
- package/utils/Observable.js +0 -34
- package/utils/getRepoName.d.ts +0 -4
- package/utils/getRepoName.js +0 -30
- package/utils/merge-refs.d.ts +0 -2
- package/utils/merge-refs.js +0 -17
- package/utils/promptIfRepoNameIncorrect.d.ts +0 -1
- package/utils/promptIfRepoNameIncorrect.js +0 -72
- package/utils/refreshOverlayInterop.d.ts +0 -4
- package/utils/refreshOverlayInterop.js +0 -12
- package/utils/reportErrorStack.d.ts +0 -7
- package/utils/reportErrorStack.js +0 -13
- package/utils/serverlessAppContext.d.ts +0 -3
- package/utils/serverlessAppContext.js +0 -6
- package/utils/updateEnvFile.d.ts +0 -1
- package/utils/updateEnvFile.js +0 -76
- package/utils/useObservable.d.ts +0 -2
- package/utils/useObservable.js +0 -12
- package/views/defineView.d.ts +0 -2
- package/views/defineView.js +0 -7
- package/views/index.js +0 -13
- /package/{admin → dist/app/lib/admin}/installFieldTypes.d.ts +0 -0
- /package/{admin → dist/app/lib/admin}/runWidgets.d.ts +0 -0
- /package/{dev-ui → dist/app/lib/devtools}/components/BreakpointIndicator.d.ts +0 -0
- /package/{dev-ui → dist/app/lib/devtools}/hooks/usePersistState.d.ts +0 -0
- /package/{dev-ui → dist/app/lib/devtools}/loader.d.ts +0 -0
- /package/{style → dist/app/lib/legacy-stitches}/index.d.ts +0 -0
- /package/{build/graphql-codegen/graphql-codegen-files.d.ts → dist/app/lib/routing/types.js} +0 -0
- /package/{views → dist/app/lib/views}/index.d.ts +0 -0
- /package/{build/graphql-codegen/graphql-codegen-no-duplicates.d.ts → dist/app/utils/wp.js} +0 -0
- /package/{cli → dist/node/cli}/cli.d.ts +0 -0
- /package/{entry/entry.publicPath.d.ts → dist/node/project/favicons.d.ts} +0 -0
package/hooks/queryUtils.js
DELETED
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
50
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
51
|
-
if (ar || !(i in from)) {
|
|
52
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
53
|
-
ar[i] = from[i];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
57
|
-
};
|
|
58
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
59
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
|
-
};
|
|
61
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports.createUseMutation = exports.createUseInfiniteQuery = exports.createUseQuery = void 0;
|
|
63
|
-
var react_1 = require("react");
|
|
64
|
-
var swr_1 = __importDefault(require("swr"));
|
|
65
|
-
function getNonceHeader() {
|
|
66
|
-
var _a;
|
|
67
|
-
// @ts-ignore
|
|
68
|
-
if ((_a = window === null || window === void 0 ? void 0 : window.wpApiSettings) === null || _a === void 0 ? void 0 : _a.nonce) {
|
|
69
|
-
return {
|
|
70
|
-
// @ts-ignore
|
|
71
|
-
"X-WP-Nonce": window.wpApiSettings.nonce,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
return {};
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/** Generic fetcher functions */
|
|
79
|
-
var fetcherGET = function (name, params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
80
|
-
var url, result, payload;
|
|
81
|
-
return __generator(this, function (_a) {
|
|
82
|
-
switch (_a.label) {
|
|
83
|
-
case 0:
|
|
84
|
-
url = process.serverless ? "/api/rest/query/".concat(name) : "/wp-json/ed/v1/query/".concat(name);
|
|
85
|
-
if (params)
|
|
86
|
-
url += "?params=" + encodeURIComponent(params);
|
|
87
|
-
return [4 /*yield*/, fetch(url, {
|
|
88
|
-
headers: getNonceHeader(),
|
|
89
|
-
})];
|
|
90
|
-
case 1:
|
|
91
|
-
result = _a.sent();
|
|
92
|
-
return [4 /*yield*/, result.json()];
|
|
93
|
-
case 2:
|
|
94
|
-
payload = _a.sent();
|
|
95
|
-
return [2 /*return*/, payload];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}); };
|
|
99
|
-
function createUseQuery(init) {
|
|
100
|
-
var hook = function (vars, opts) {
|
|
101
|
-
var _a, _b;
|
|
102
|
-
var _c = (0, swr_1.default)([init.name, JSON.stringify(vars)], fetcherGET, {
|
|
103
|
-
revalidateIfStale: (_a = opts === null || opts === void 0 ? void 0 : opts.revalidateIfStale) !== null && _a !== void 0 ? _a : false,
|
|
104
|
-
revalidateOnFocus: (_b = opts === null || opts === void 0 ? void 0 : opts.revalidateOnFocus) !== null && _b !== void 0 ? _b : false,
|
|
105
|
-
}), payload = _c.data, isValidating = _c.isValidating, error = _c.error, mutate = _c.mutate;
|
|
106
|
-
return {
|
|
107
|
-
loading: isValidating && !payload,
|
|
108
|
-
data: payload === null || payload === void 0 ? void 0 : payload.data,
|
|
109
|
-
errors: error ? [error] : payload === null || payload === void 0 ? void 0 : payload.errors,
|
|
110
|
-
refresh: mutate,
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
hook.fetch = function (vars) {
|
|
114
|
-
return fetcherGET(init.name, JSON.stringify(vars)).then(function (payload) { return payload.data; });
|
|
115
|
-
};
|
|
116
|
-
return hook;
|
|
117
|
-
}
|
|
118
|
-
exports.createUseQuery = createUseQuery;
|
|
119
|
-
function createUseInfiniteQuery(init) {
|
|
120
|
-
var extract = function (path, payload) {
|
|
121
|
-
var value = payload;
|
|
122
|
-
for (var _i = 0, path_1 = path; _i < path_1.length; _i++) {
|
|
123
|
-
var segment = path_1[_i];
|
|
124
|
-
value = value[segment];
|
|
125
|
-
}
|
|
126
|
-
return value;
|
|
127
|
-
};
|
|
128
|
-
var hook = function (vars, opts) {
|
|
129
|
-
var _a = (0, react_1.useState)(), activeCursor = _a[0], setActiveCursor = _a[1];
|
|
130
|
-
var _b = (0, react_1.useState)(), errors = _b[0], setErrors = _b[1];
|
|
131
|
-
var _c = (0, react_1.useState)(undefined), nextCursor = _c[0], setNextCursor = _c[1];
|
|
132
|
-
var _d = (0, react_1.useState)(false), hasMore = _d[0], setHasMore = _d[1];
|
|
133
|
-
var _e = (0, react_1.useState)(true), isLoadingMore = _e[0], setIsLoadingMore = _e[1];
|
|
134
|
-
var _f = (0, react_1.useState)([]), items = _f[0], setItems = _f[1];
|
|
135
|
-
var _g = (0, react_1.useState)(vars), varPayload = _g[0], setVarPayload = _g[1];
|
|
136
|
-
var _h = (0, swr_1.default)([
|
|
137
|
-
init.name,
|
|
138
|
-
JSON.stringify(__assign(__assign({}, (varPayload || {})), { cursor: activeCursor })),
|
|
139
|
-
], fetcherGET, {
|
|
140
|
-
revalidateIfStale: false,
|
|
141
|
-
revalidateOnFocus: false,
|
|
142
|
-
revalidateOnReconnect: false,
|
|
143
|
-
}), payload = _h.data, isValidating = _h.isValidating, error = _h.error, mutate = _h.mutate;
|
|
144
|
-
(0, react_1.useEffect)(function () {
|
|
145
|
-
setItems([]);
|
|
146
|
-
setIsLoadingMore(true);
|
|
147
|
-
setErrors(undefined);
|
|
148
|
-
setHasMore(false);
|
|
149
|
-
setActiveCursor(undefined);
|
|
150
|
-
setVarPayload(vars);
|
|
151
|
-
}, [JSON.stringify(vars)]);
|
|
152
|
-
(0, react_1.useEffect)(function () {
|
|
153
|
-
if (payload) {
|
|
154
|
-
setIsLoadingMore(false);
|
|
155
|
-
if (payload.errors) {
|
|
156
|
-
setErrors(payload.errors);
|
|
157
|
-
}
|
|
158
|
-
else if (payload.data) {
|
|
159
|
-
// Extract data
|
|
160
|
-
var nodes_1 = extract(init.paths.nodesPath, payload.data);
|
|
161
|
-
var nextCursor_1 = extract(init.paths.endCursorPath, payload.data);
|
|
162
|
-
var hasMore_1 = extract(init.paths.hasNextPagePath, payload.data);
|
|
163
|
-
setErrors(undefined);
|
|
164
|
-
setNextCursor(nextCursor_1);
|
|
165
|
-
setHasMore(hasMore_1);
|
|
166
|
-
setIsLoadingMore(false);
|
|
167
|
-
setItems(function () { return __spreadArray(__spreadArray([], items, true), nodes_1, true); });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}, [payload]);
|
|
171
|
-
return {
|
|
172
|
-
loading: isValidating && !items.length,
|
|
173
|
-
loadingMore: isLoadingMore,
|
|
174
|
-
items: items,
|
|
175
|
-
cursor: activeCursor,
|
|
176
|
-
errors: error ? [error] : errors,
|
|
177
|
-
refresh: function () {
|
|
178
|
-
setErrors(undefined);
|
|
179
|
-
setNextCursor(undefined);
|
|
180
|
-
setActiveCursor(undefined);
|
|
181
|
-
setIsLoadingMore(false);
|
|
182
|
-
mutate();
|
|
183
|
-
},
|
|
184
|
-
loadMore: function () {
|
|
185
|
-
if (isLoadingMore || !hasMore)
|
|
186
|
-
return;
|
|
187
|
-
setIsLoadingMore(true);
|
|
188
|
-
setActiveCursor(nextCursor);
|
|
189
|
-
},
|
|
190
|
-
hasMore: hasMore,
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
return hook;
|
|
194
|
-
}
|
|
195
|
-
exports.createUseInfiniteQuery = createUseInfiniteQuery;
|
|
196
|
-
function createUseMutation(init) {
|
|
197
|
-
var _this = this;
|
|
198
|
-
var hook = function (opts) {
|
|
199
|
-
var _a = (0, react_1.useState)(false), submitting = _a[0], setSubmitting = _a[1];
|
|
200
|
-
var _b = (0, react_1.useState)(false), submitted = _b[0], setSubmitted = _b[1];
|
|
201
|
-
var _c = (0, react_1.useState)(undefined), data = _c[0], setData = _c[1];
|
|
202
|
-
var _d = (0, react_1.useState)(), errors = _d[0], setErrors = _d[1];
|
|
203
|
-
var submit = function (params) { return __awaiter(_this, void 0, void 0, function () {
|
|
204
|
-
var url, result, payload, error_1;
|
|
205
|
-
return __generator(this, function (_a) {
|
|
206
|
-
switch (_a.label) {
|
|
207
|
-
case 0:
|
|
208
|
-
setSubmitting(true);
|
|
209
|
-
setSubmitted(false);
|
|
210
|
-
url = process.serverless ? "/api/rest/mutation/".concat(init.name) : "/wp-json/ed/v1/mutation/".concat(init.name);
|
|
211
|
-
_a.label = 1;
|
|
212
|
-
case 1:
|
|
213
|
-
_a.trys.push([1, 4, , 5]);
|
|
214
|
-
return [4 /*yield*/, fetch(url, {
|
|
215
|
-
method: "POST",
|
|
216
|
-
headers: __assign({ "Content-type": "application/json" }, getNonceHeader()),
|
|
217
|
-
credentials: "include",
|
|
218
|
-
body: JSON.stringify(params),
|
|
219
|
-
})];
|
|
220
|
-
case 2:
|
|
221
|
-
result = _a.sent();
|
|
222
|
-
return [4 /*yield*/, result.json()];
|
|
223
|
-
case 3:
|
|
224
|
-
payload = _a.sent();
|
|
225
|
-
if (payload.errors) {
|
|
226
|
-
setErrors(payload.errors);
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
setData(payload.data);
|
|
230
|
-
setSubmitted(true);
|
|
231
|
-
setErrors(undefined);
|
|
232
|
-
}
|
|
233
|
-
return [3 /*break*/, 5];
|
|
234
|
-
case 4:
|
|
235
|
-
error_1 = _a.sent();
|
|
236
|
-
setErrors([error_1]);
|
|
237
|
-
return [2 /*return*/];
|
|
238
|
-
case 5:
|
|
239
|
-
setSubmitting(false);
|
|
240
|
-
return [2 /*return*/];
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
}); };
|
|
244
|
-
return {
|
|
245
|
-
submitting: submitting,
|
|
246
|
-
submitted: submitted,
|
|
247
|
-
data: data,
|
|
248
|
-
errors: errors,
|
|
249
|
-
submit: submit,
|
|
250
|
-
};
|
|
251
|
-
};
|
|
252
|
-
hook.mutate = function (vars) { return __awaiter(_this, void 0, void 0, function () {
|
|
253
|
-
var url, result, payload;
|
|
254
|
-
return __generator(this, function (_a) {
|
|
255
|
-
switch (_a.label) {
|
|
256
|
-
case 0:
|
|
257
|
-
url = process.serverless ? "/api/rest/mutation/".concat(init.name) : "/wp-json/ed/v1/mutation/".concat(init.name);
|
|
258
|
-
return [4 /*yield*/, fetch(url, {
|
|
259
|
-
method: "POST",
|
|
260
|
-
headers: __assign({ "Content-type": "application/json" }, getNonceHeader()),
|
|
261
|
-
credentials: "include",
|
|
262
|
-
body: JSON.stringify(vars),
|
|
263
|
-
})];
|
|
264
|
-
case 1:
|
|
265
|
-
result = _a.sent();
|
|
266
|
-
return [4 /*yield*/, result.json()];
|
|
267
|
-
case 2:
|
|
268
|
-
payload = _a.sent();
|
|
269
|
-
if (payload.errors) {
|
|
270
|
-
throw payload.errors;
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
return [2 /*return*/, payload.data];
|
|
274
|
-
}
|
|
275
|
-
return [2 /*return*/];
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
}); };
|
|
279
|
-
return hook;
|
|
280
|
-
}
|
|
281
|
-
exports.createUseMutation = createUseMutation;
|
package/hooks/useAppData.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare type AppData = ViewProps["_app"];
|
|
2
|
-
interface AppDataStore {
|
|
3
|
-
data: AppData;
|
|
4
|
-
setAppData(data: AppData): void;
|
|
5
|
-
}
|
|
6
|
-
declare const useAppDataStore: import("zustand").UseBoundStore<AppDataStore, import("zustand").StoreApi<AppDataStore>>;
|
|
7
|
-
declare type Selector<T> = (data: AppData) => T;
|
|
8
|
-
declare function useAppData(): AppData;
|
|
9
|
-
declare function useAppData<T>(selector: Selector<T>): T;
|
|
10
|
-
export { useAppData, useAppDataStore };
|
package/hooks/useAppData.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useAppDataStore = exports.useAppData = void 0;
|
|
7
|
-
var react_1 = require("react");
|
|
8
|
-
var zustand_1 = __importDefault(require("zustand"));
|
|
9
|
-
var serverlessAppContext_1 = require("../utils/serverlessAppContext");
|
|
10
|
-
var useAppDataStore = (0, zustand_1.default)(function (set) { return ({
|
|
11
|
-
data: undefined,
|
|
12
|
-
setAppData: function (data) {
|
|
13
|
-
set({ data: data });
|
|
14
|
-
},
|
|
15
|
-
}); });
|
|
16
|
-
exports.useAppDataStore = useAppDataStore;
|
|
17
|
-
function useAppData(selector) {
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
if (process.serverless) {
|
|
20
|
-
var value = (0, react_1.useContext)(serverlessAppContext_1.ServerlessAppDataContext);
|
|
21
|
-
if (selector)
|
|
22
|
-
return selector(value);
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
else if (process.admin) {
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
return selector ? selector(__ED_APP_DATA.data) : __ED_APP_DATA.data;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
return useAppDataStore(function (store) {
|
|
31
|
-
if (selector)
|
|
32
|
-
return selector(store.data);
|
|
33
|
-
return store.data;
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.useAppData = useAppData;
|
package/hooks/usePageLoad.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.usePageLoad = void 0;
|
|
7
|
-
var zustand_1 = __importDefault(require("zustand"));
|
|
8
|
-
exports.usePageLoad = (0, zustand_1.default)(function (set) { return ({
|
|
9
|
-
loading: false,
|
|
10
|
-
setIsLoading: function (loading) { return set({ loading: loading }); },
|
|
11
|
-
}); });
|
package/hooks/useQuery.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/hooks/useQuery.js
DELETED
package/hooks/useQueryDebug.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useQueryDebugData = exports.setQueryDebug = void 0;
|
|
7
|
-
var zustand_1 = __importDefault(require("zustand"));
|
|
8
|
-
var useQueryDebug = (0, zustand_1.default)(function (set) { return ({
|
|
9
|
-
value: undefined,
|
|
10
|
-
set: function (value) {
|
|
11
|
-
set({ value: value });
|
|
12
|
-
},
|
|
13
|
-
}); });
|
|
14
|
-
function setQueryDebug(value) {
|
|
15
|
-
useQueryDebug.setState({ value: value });
|
|
16
|
-
}
|
|
17
|
-
exports.setQueryDebug = setQueryDebug;
|
|
18
|
-
function useQueryDebugData() {
|
|
19
|
-
return useQueryDebug(function (store) { return store.value; });
|
|
20
|
-
}
|
|
21
|
-
exports.useQueryDebugData = useQueryDebugData;
|
package/hooks/useRPC.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TRPCClientError } from "@trpc/client";
|
|
2
|
-
declare const trpc: any;
|
|
3
|
-
export declare const useRPCQuery: RPCUseQuery;
|
|
4
|
-
export declare const useRPCMutation: RPCUseMutation;
|
|
5
|
-
export declare const useRPCInfiniteQuery: RPCUseInfiniteQuery;
|
|
6
|
-
export declare const rpcClient: any;
|
|
7
|
-
export declare type UseRPCMutationResult = ReturnType<typeof trpc.useMutation>;
|
|
8
|
-
export declare type UseRPCQueryResult = ReturnType<typeof trpc.useQuery>;
|
|
9
|
-
export declare type UseRPCInfiniteQueryResult = ReturnType<typeof trpc.useInfiniteQuery>;
|
|
10
|
-
export declare const RPCClientError: typeof TRPCClientError;
|
|
11
|
-
export declare type RPCClientError = InstanceType<typeof TRPCClientError>;
|
|
12
|
-
export {};
|
package/hooks/useRPC.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RPCClientError = exports.rpcClient = exports.useRPCInfiniteQuery = exports.useRPCMutation = exports.useRPCQuery = void 0;
|
|
4
|
-
var react_1 = require("@trpc/react");
|
|
5
|
-
var client_1 = require("@trpc/client");
|
|
6
|
-
var trpc = process.rpcEnabled ? (0, react_1.createReactQueryHooks)() : {};
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
exports.useRPCQuery = trpc.useQuery;
|
|
9
|
-
// @ts-ignore
|
|
10
|
-
exports.useRPCMutation = trpc.useMutation;
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
exports.useRPCInfiniteQuery = trpc.useInfiniteQuery;
|
|
13
|
-
exports.rpcClient = process.rpcEnabled
|
|
14
|
-
? trpc.createClient({
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
url: process.serverlessEndpoint.replace(/\/$/, "") + "/api/trpc",
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
})
|
|
19
|
-
: null;
|
|
20
|
-
exports.RPCClientError = client_1.TRPCClientError;
|
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/index.js
DELETED
package/routing/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./routing";
|
package/routing/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./routing"), exports);
|
package/routing/remoteProps.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import URLParse from "url-parse";
|
|
2
|
-
export declare type ParsedRouteTags = Record<"title" | "meta" | "script" | "style" | "link", {
|
|
3
|
-
[key: string]: string;
|
|
4
|
-
}[]>;
|
|
5
|
-
export interface RouteData {
|
|
6
|
-
view: string;
|
|
7
|
-
editLink?: string;
|
|
8
|
-
viewType: "react" | "html";
|
|
9
|
-
viewData: any;
|
|
10
|
-
appData: any;
|
|
11
|
-
redirect?: string;
|
|
12
|
-
canonical?: string;
|
|
13
|
-
meta?: {
|
|
14
|
-
head: ParsedRouteTags;
|
|
15
|
-
footer: ParsedRouteTags;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export declare function parseURL(url: string): URLParse<string>;
|
|
19
|
-
export declare function setInitialProps(url: string, data: RouteData): void;
|
|
20
|
-
export declare function isSameOrigin(url: string): boolean;
|
|
21
|
-
export declare function fetchProps(url: string): Promise<RouteData>;
|
|
22
|
-
export declare function hasCachedProps(url: string): boolean;
|
package/routing/remoteProps.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.hasCachedProps = exports.fetchProps = exports.isSameOrigin = exports.setInitialProps = exports.parseURL = void 0;
|
|
43
|
-
var url_parse_1 = __importDefault(require("url-parse"));
|
|
44
|
-
var qs_1 = __importDefault(require("qs"));
|
|
45
|
-
var pending = {};
|
|
46
|
-
var cache = {};
|
|
47
|
-
function parseURL(url) {
|
|
48
|
-
return (0, url_parse_1.default)(url, qs_1.default.parse);
|
|
49
|
-
}
|
|
50
|
-
exports.parseURL = parseURL;
|
|
51
|
-
function getRouteCacheKey(url) {
|
|
52
|
-
var parsed = parseURL(url);
|
|
53
|
-
return parsed.pathname.replace(/\/$/, "");
|
|
54
|
-
}
|
|
55
|
-
function setInitialProps(url, data) {
|
|
56
|
-
var cacheKey = getRouteCacheKey(url);
|
|
57
|
-
cache[cacheKey] = data;
|
|
58
|
-
}
|
|
59
|
-
exports.setInitialProps = setInitialProps;
|
|
60
|
-
function isSameOrigin(url) {
|
|
61
|
-
var parsed = parseURL(url);
|
|
62
|
-
return parsed.origin === document.location.origin && !parsed.pathname.match(/\.[a-z0-9]$/i);
|
|
63
|
-
}
|
|
64
|
-
exports.isSameOrigin = isSameOrigin;
|
|
65
|
-
function fetchProps(url) {
|
|
66
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
-
var parsed, cacheKey, requestUrl, promise;
|
|
68
|
-
return __generator(this, function (_a) {
|
|
69
|
-
parsed = parseURL(url);
|
|
70
|
-
cacheKey = getRouteCacheKey(url);
|
|
71
|
-
// Cached value?
|
|
72
|
-
if (cacheKey in cache)
|
|
73
|
-
return [2 /*return*/, Promise.resolve(cache[cacheKey])];
|
|
74
|
-
if (cacheKey in pending)
|
|
75
|
-
return [2 /*return*/, pending[cacheKey]];
|
|
76
|
-
parsed.query["_props"] = "1";
|
|
77
|
-
requestUrl = parsed.toString();
|
|
78
|
-
promise = fetch(requestUrl)
|
|
79
|
-
.then(function (response) { return response.json(); })
|
|
80
|
-
.then(function (data) {
|
|
81
|
-
if (data.redirect) {
|
|
82
|
-
var redirect_1 = data.redirect;
|
|
83
|
-
return fetchProps(redirect_1).then(function (data) {
|
|
84
|
-
data.canonical = redirect_1;
|
|
85
|
-
return data;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
delete pending[cacheKey];
|
|
89
|
-
cache[cacheKey] = data;
|
|
90
|
-
return data;
|
|
91
|
-
});
|
|
92
|
-
pending[cacheKey] = promise;
|
|
93
|
-
return [2 /*return*/, promise];
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
exports.fetchProps = fetchProps;
|
|
98
|
-
function hasCachedProps(url) {
|
|
99
|
-
var cacheKey = getRouteCacheKey(url);
|
|
100
|
-
// Cached value?
|
|
101
|
-
return !!cache[cacheKey];
|
|
102
|
-
}
|
|
103
|
-
exports.hasCachedProps = hasCachedProps;
|
package/routing/routing.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { ReactNode, PropsWithChildren } from "react";
|
|
2
|
-
import { APropsWithoutRef } from "react-html-props";
|
|
3
|
-
import URLParse from "url-parse";
|
|
4
|
-
import { RouteData } from "./remoteProps";
|
|
5
|
-
declare type RouteItem = URLParse<any> & {
|
|
6
|
-
data?: RouteData;
|
|
7
|
-
};
|
|
8
|
-
declare type AnyPromise = Promise<any>;
|
|
9
|
-
declare type MatchResult = boolean | string;
|
|
10
|
-
declare type RouteStatus = "leaving" | "parent-leaving" | "active" | "inactive";
|
|
11
|
-
declare type RouteContextConfig = {
|
|
12
|
-
debugName?: string;
|
|
13
|
-
match?(next: RouteItem): MatchResult;
|
|
14
|
-
beforeLeave?(current: RouteItem, next: RouteItem, parentIsLeaving: boolean): AnyPromise | undefined;
|
|
15
|
-
onChange?(route: RouteItem, status: RouteStatus): void;
|
|
16
|
-
};
|
|
17
|
-
declare type ContextSubscriber = (item: RouteItem, status: RouteStatus) => void;
|
|
18
|
-
declare type ForkOptions = {
|
|
19
|
-
isSwitch?: boolean;
|
|
20
|
-
};
|
|
21
|
-
declare type RouteContextType = {
|
|
22
|
-
parent?: RouteContextType;
|
|
23
|
-
status: RouteStatus;
|
|
24
|
-
loading?: {
|
|
25
|
-
progress: number;
|
|
26
|
-
};
|
|
27
|
-
children: RouteContextType[];
|
|
28
|
-
isSwitch: boolean;
|
|
29
|
-
item: RouteItem;
|
|
30
|
-
config: RouteContextConfig;
|
|
31
|
-
currentMatch: MatchResult;
|
|
32
|
-
propagateChange(current: RouteItem, match: MatchResult): void;
|
|
33
|
-
propagateCandidate(next: RouteItem, prev: RouteItem): AnyPromise;
|
|
34
|
-
propagateLeaving(current: RouteItem, next: RouteItem, parentLeaving: boolean): AnyPromise;
|
|
35
|
-
getFirstMatch: (item: RouteItem) => RouteContextType | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Navigate to a specific page
|
|
38
|
-
* @param path The relative URL to navigate to
|
|
39
|
-
*/
|
|
40
|
-
navigate: (path: string) => void;
|
|
41
|
-
preload: (path: string) => void;
|
|
42
|
-
/** @deprecated Use navigate() instead */
|
|
43
|
-
onNavigate: (path: string) => void;
|
|
44
|
-
/** @deprecated Use preload() instead */
|
|
45
|
-
onPreload: (path: string) => void;
|
|
46
|
-
dispose: () => void;
|
|
47
|
-
update: () => void;
|
|
48
|
-
match: (next: RouteItem) => MatchResult;
|
|
49
|
-
matchSelf: (next: RouteItem) => MatchResult;
|
|
50
|
-
subscribe: (handler: ContextSubscriber) => () => void;
|
|
51
|
-
fork(config: RouteContextConfig, opts?: ForkOptions): RouteContextType;
|
|
52
|
-
};
|
|
53
|
-
export declare function useRoute(): RouteItem;
|
|
54
|
-
export declare function useRouter(): RouteContextType | undefined;
|
|
55
|
-
export declare type RouterScrollHandler = {
|
|
56
|
-
set: (value: number) => void;
|
|
57
|
-
get: () => number;
|
|
58
|
-
};
|
|
59
|
-
export declare const customRouterScrollHandler: {
|
|
60
|
-
handler: RouterScrollHandler | null;
|
|
61
|
-
};
|
|
62
|
-
export declare const customShouldNavigateFunction: {
|
|
63
|
-
handler: ((href: string) => boolean) | null;
|
|
64
|
-
};
|
|
65
|
-
export declare function useCustomRouterScrollHandler(handler: RouterScrollHandler): void;
|
|
66
|
-
export declare function useShouldNavigateFunction(handler: (href: string) => boolean): void;
|
|
67
|
-
export declare type RouteProps = RouteContextConfig & {
|
|
68
|
-
children: ReactNode;
|
|
69
|
-
};
|
|
70
|
-
export declare function Route(props: RouteProps): import("react/jsx-runtime").JSX.Element | null;
|
|
71
|
-
export declare function createRouteItem(url: string, data: RouteData): RouteItem;
|
|
72
|
-
declare type RouterRootProps = {
|
|
73
|
-
url: string;
|
|
74
|
-
data: RouteData;
|
|
75
|
-
children: ReactNode;
|
|
76
|
-
onNavigateRequest?: (url: string) => void;
|
|
77
|
-
onPreload?: (url: string) => void;
|
|
78
|
-
onNavigated?: (item: RouteItem) => void;
|
|
79
|
-
};
|
|
80
|
-
export declare function RouterRoot(props: RouterRootProps): import("react/jsx-runtime").JSX.Element;
|
|
81
|
-
declare type SwitchProps = {
|
|
82
|
-
children: ReactNode | ReactNode[];
|
|
83
|
-
};
|
|
84
|
-
export declare const isInternalPageLink: (href: string) => boolean;
|
|
85
|
-
export declare const urlPathsMatch: (a: string, b: string) => boolean;
|
|
86
|
-
export declare const urlDescendentsMatch: (a: string, b: string) => boolean;
|
|
87
|
-
export declare const Link: import("react").ForwardRefExoticComponent<APropsWithoutRef & {
|
|
88
|
-
preload?: boolean | undefined;
|
|
89
|
-
} & {
|
|
90
|
-
className?: string | undefined;
|
|
91
|
-
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
92
|
-
export declare function Switch({ children }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
93
|
-
export declare function RouteItemContext(props: PropsWithChildren<{
|
|
94
|
-
route: RouteItem;
|
|
95
|
-
}>): import("react/jsx-runtime").JSX.Element;
|
|
96
|
-
export {};
|