eddev 0.3.35 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/eddev.js +1 -3
- package/css/devtools.css +15 -0
- package/css/editor-styles.css +94 -0
- package/dist/app/entry/Root.d.ts +1 -0
- package/dist/app/entry/Root.js +9 -0
- package/dist/app/entry/main.admin.d.ts +3 -0
- package/dist/app/entry/main.admin.js +10 -0
- package/dist/app/entry/main.frontend.spa.d.ts +3 -0
- package/dist/app/entry/main.frontend.spa.js +13 -0
- package/dist/app/entry/main.frontend.ssr.d.ts +21 -0
- package/dist/app/entry/main.frontend.ssr.js +79 -0
- package/dist/app/entry/main.serverless.dev.d.ts +4 -0
- package/dist/app/entry/main.serverless.dev.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 +79 -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/hooks/usePersistState.js +31 -0
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts +4184 -0
- package/dist/app/lib/devtools/hooks/useTailwind.js +6 -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 +46 -0
- package/dist/app/lib/hooks/queryUtils.js +183 -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 +11 -0
- package/dist/app/lib/internal/internal-store.js +9 -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 +106 -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/create-api-builtin-hono.d.ts +8 -0
- package/dist/app/server/create-api-builtin-hono.js +80 -0
- package/dist/app/server/create-ssr-hono.d.ts +18 -0
- package/dist/app/server/create-ssr-hono.js +104 -0
- package/dist/app/server/utils/headers.d.ts +4 -0
- package/dist/app/server/utils/headers.js +11 -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 +8 -0
- package/dist/app/server/utils/replace-host.js +14 -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 +114 -0
- package/dist/node/cli/cli.js +166 -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/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/index.html.d.ts +2 -0
- package/dist/node/compiler/index.html.js +15 -0
- package/dist/node/compiler/serverless.dev.d.ts +16 -0
- package/dist/node/compiler/serverless.dev.js +215 -0
- package/dist/node/compiler/vite/get-vite-config.d.ts +13 -0
- package/dist/node/compiler/vite/get-vite-config.js +315 -0
- package/dist/node/compiler/vite/plugin-admin.d.ts +4 -0
- package/dist/node/compiler/vite/plugin-admin.js +67 -0
- package/dist/node/compiler/vite/plugin-blocks.d.ts +4 -0
- package/dist/node/compiler/vite/plugin-blocks.js +73 -0
- package/dist/node/compiler/vite/plugin-entry.d.ts +6 -0
- package/dist/node/compiler/vite/plugin-entry.js +16 -0
- package/dist/node/compiler/vite/plugin-resolved-tailwind.d.ts +4 -0
- package/dist/node/compiler/vite/plugin-resolved-tailwind.js +29 -0
- package/dist/node/compiler/vite/plugin-theme.d.ts +4 -0
- package/dist/node/compiler/vite/plugin-theme.js +40 -0
- package/dist/node/compiler/vite/plugin-views.d.ts +4 -0
- package/dist/node/compiler/vite/plugin-views.js +51 -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 +94 -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.d.ts +0 -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 +57 -0
- package/dist/node/project/project.js +115 -0
- package/dist/node/project/wp-info.d.ts +32 -0
- package/dist/node/project/wp-info.js +34 -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 +54 -0
- package/dist/node/utils/console.d.ts +21 -0
- package/dist/node/utils/console.js +28 -0
- package/dist/node/utils/export-extractor.d.ts +9 -0
- package/dist/node/utils/export-extractor.js +71 -0
- package/dist/node/utils/formatZodError.d.ts +3 -0
- package/dist/node/utils/formatZodError.js +33 -0
- package/dist/node/utils/fs.d.ts +106 -0
- package/dist/node/utils/fs.js +56 -0
- package/dist/node/utils/getRepoInfo.d.ts +7 -0
- package/dist/node/utils/getRepoInfo.js +21 -0
- package/dist/node/utils/helpers.d.ts +2 -0
- package/dist/node/utils/helpers.js +14 -0
- package/dist/node/utils/highlightCode.d.ts +10 -0
- package/dist/node/utils/highlightCode.js +30 -0
- package/dist/node/utils/isDeploying.d.ts +4 -0
- package/dist/node/utils/isDeploying.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/selfSignedCert.d.ts +4 -0
- package/dist/node/utils/selfSignedCert.js +35 -0
- package/dist/node/utils/statefulLog.d.ts +65 -0
- package/dist/node/utils/statefulLog.js +223 -0
- package/dist/node/utils/unsafe-fetch.d.ts +2 -0
- package/dist/node/utils/unsafe-fetch.js +19 -0
- package/dist/node/utils/watchFileTree.d.ts +11 -0
- package/dist/node/utils/watchFileTree.js +58 -0
- package/package.json +123 -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/tsup.config.ts +40 -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.manifests.d.ts +22 -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 -54
- 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/{entry/entry.publicPath.d.ts → dist/app/lib/devtools/index.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
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
import { createStitches as createBaseStitches } from "../../../../stitches-archive";
|
|
2
|
+
const typeKeyMap = {
|
|
3
|
+
fontSize: "fontSizes",
|
|
4
|
+
fontFamily: "fonts",
|
|
5
|
+
lineHeight: "lineHeights",
|
|
6
|
+
letterSpacing: "letterSpacings",
|
|
7
|
+
fontWeight: "fontWeights",
|
|
8
|
+
};
|
|
9
|
+
export function parseBreakpoints(names, medias) {
|
|
10
|
+
const breakpoints = [];
|
|
11
|
+
// Add an initial breakpoint
|
|
12
|
+
breakpoints.push({ key: "initial", min: "0px", max: null });
|
|
13
|
+
// Parse each breakpoint
|
|
14
|
+
for (const key in medias) {
|
|
15
|
+
if (!names.includes(key))
|
|
16
|
+
continue;
|
|
17
|
+
const media = medias[key];
|
|
18
|
+
const minMatch = media.match(/min-width: ([0-9]+[a-z]+)/);
|
|
19
|
+
const maxMatch = media.match(/max-width: ([0-9]+[a-z]+)/);
|
|
20
|
+
if (!minMatch && !maxMatch)
|
|
21
|
+
continue;
|
|
22
|
+
breakpoints.push({
|
|
23
|
+
key,
|
|
24
|
+
min: minMatch ? minMatch[1] : null,
|
|
25
|
+
max: maxMatch ? maxMatch[1] : null,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
// Ensure each breakpoint has a min/max value (except for first and last)
|
|
29
|
+
for (let i = 0; i < breakpoints.length; i++) {
|
|
30
|
+
const bp = breakpoints[i];
|
|
31
|
+
const prev = breakpoints[i - 1];
|
|
32
|
+
const next = breakpoints[i + 1];
|
|
33
|
+
if (bp.min === null && prev && prev.max) {
|
|
34
|
+
bp.min = prev.max;
|
|
35
|
+
}
|
|
36
|
+
if (bp.max === null && next && next.min) {
|
|
37
|
+
bp.max = next.min;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return breakpoints;
|
|
41
|
+
}
|
|
42
|
+
const unitless = (value) => parseFloat(value);
|
|
43
|
+
function parseTypography(theme, breakpoints, typography) {
|
|
44
|
+
const globals = {};
|
|
45
|
+
const typeVariants = {};
|
|
46
|
+
breakpoints.forEach((bp) => (globals["@" + bp.key] = {}));
|
|
47
|
+
globals["@editor"] = {};
|
|
48
|
+
const resolveValue = (scale, value) => {
|
|
49
|
+
if (typeof value === "string" && value.match(/^\$[a-z0-9\-\_]+$/)) {
|
|
50
|
+
// Single scale
|
|
51
|
+
return theme[scale][value.replace("$", "")];
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const resolveThemeVar = (scale, value) => {
|
|
58
|
+
if (typeof value === "string" && value.match(/^\$[a-z0-9\-\_]+$/)) {
|
|
59
|
+
// Single scale
|
|
60
|
+
return "$" + scale + value;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
for (const name in typography) {
|
|
67
|
+
const style = typography[name];
|
|
68
|
+
const variant = {};
|
|
69
|
+
typeVariants[name] = variant;
|
|
70
|
+
for (const key in style) {
|
|
71
|
+
const value = style[key];
|
|
72
|
+
const varName = `--type-${name}-${key}`;
|
|
73
|
+
variant[key] = `var(${varName})`;
|
|
74
|
+
const tokenPrefix = typeKeyMap[key];
|
|
75
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
76
|
+
// A simple string or number value is used
|
|
77
|
+
globals["@initial"][varName] = resolveThemeVar(tokenPrefix, value);
|
|
78
|
+
}
|
|
79
|
+
else if (value && typeof value === "object") {
|
|
80
|
+
// A responsive object value
|
|
81
|
+
const unit = key === "lineHeight" ? "%" : "px";
|
|
82
|
+
const [tokenGlobals, initial] = getResponsiveObjectStyles(breakpoints, value, varName, unit);
|
|
83
|
+
for (const key in tokenGlobals) {
|
|
84
|
+
globals[key] = { ...globals[key], ...tokenGlobals[key] };
|
|
85
|
+
}
|
|
86
|
+
// const entries = Object.entries(value)
|
|
87
|
+
// entries.forEach(([bpName, responsiveValue], i) => {
|
|
88
|
+
// if (Array.isArray(responsiveValue)) {
|
|
89
|
+
// responsiveValue = responsiveValue[0]
|
|
90
|
+
// // An array in the format [value] signifies font locking between the current breakpoint and the next defined one
|
|
91
|
+
// const minSize = breakpoints.find((bp) => "@" + bp.key === bpName)?.min
|
|
92
|
+
// const nextBreakpoint = breakpoints.find((bp) => "@" + bp.key === entries[i + 1]?.[0])
|
|
93
|
+
// if (!nextBreakpoint)
|
|
94
|
+
// throw new Error(
|
|
95
|
+
// `Cannot create responsive '${key}' for '${name}' at breakpoint '${bpName}', since it is the last-defined breakpoint. Your last size should be a string/number/token.`
|
|
96
|
+
// )
|
|
97
|
+
// const maxSize = nextBreakpoint.min
|
|
98
|
+
// let responsiveValue2 = (value as any)["@" + nextBreakpoint.key]
|
|
99
|
+
// if (Array.isArray(responsiveValue2)) responsiveValue2 = responsiveValue2[0]
|
|
100
|
+
// let size1 = resolveValue(tokenPrefix, responsiveValue)
|
|
101
|
+
// let size2 = resolveValue(tokenPrefix, responsiveValue2)
|
|
102
|
+
// responsiveValue = `calc(${size1} + (100vw - ${minSize}) / (${unitless(maxSize)} - ${unitless(
|
|
103
|
+
// minSize
|
|
104
|
+
// )}) * (${unitless(size2)} - ${unitless(size1)}))`
|
|
105
|
+
// }
|
|
106
|
+
// globals[bpName][varName] = responsiveValue
|
|
107
|
+
// })
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { globalTypography: globals, typeVariants };
|
|
112
|
+
}
|
|
113
|
+
function parseGrid(theme, media, grid) {
|
|
114
|
+
const globalGrid = {};
|
|
115
|
+
const resolveThemeVar = (scale, value) => {
|
|
116
|
+
if (typeof value === "string" && value.match(/^\$[a-z0-9\-\_]+$/)) {
|
|
117
|
+
// Single scale
|
|
118
|
+
return "$" + scale + value;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
return value;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
for (let [bpName, breakpoint] of Object.entries(grid.breakpoints)) {
|
|
125
|
+
globalGrid[bpName] = {
|
|
126
|
+
"--grid-columns": grid.columns,
|
|
127
|
+
"--grid-outer-width": breakpoint.container,
|
|
128
|
+
"--grid-inner-width": `calc(${breakpoint.container} - ${resolveThemeVar("spaces", breakpoint.margin)} * 2)`,
|
|
129
|
+
"--grid-gutter": breakpoint.gutter,
|
|
130
|
+
"--grid-margin": breakpoint.margin,
|
|
131
|
+
"--grid-col-width": `calc((var(--grid-inner-width) - (${grid.columns - 1} * var(--grid-gutter))) / ${grid.columns})`,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return { gridVariants: {}, globalGrid };
|
|
135
|
+
}
|
|
136
|
+
function parseResponsiveValue(val) {
|
|
137
|
+
if (Array.isArray(val)) {
|
|
138
|
+
return {
|
|
139
|
+
...parseResponsiveValue(val[0]),
|
|
140
|
+
lerpStart: true,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
else if (typeof val === "string") {
|
|
144
|
+
if (val.match(/^x[0-9\.]+$/)) {
|
|
145
|
+
return {
|
|
146
|
+
lerpStart: false,
|
|
147
|
+
type: "multiplier",
|
|
148
|
+
value: parseFloat(val.replace(/^x/, "")),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
else if (val.match(/^[0-9\.]+%$/)) {
|
|
152
|
+
return {
|
|
153
|
+
lerpStart: false,
|
|
154
|
+
type: "percent",
|
|
155
|
+
value: parseFloat(val.replace(/^x/, "")),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
else if (val.match(/^[0-9\.]+px$/)) {
|
|
159
|
+
return {
|
|
160
|
+
lerpStart: false,
|
|
161
|
+
type: "px",
|
|
162
|
+
value: parseFloat(val.replace(/px$/, "")),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else if (typeof val === "number") {
|
|
167
|
+
return {
|
|
168
|
+
lerpStart: false,
|
|
169
|
+
type: "number",
|
|
170
|
+
value: val,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
else if (val === undefined || val === null) {
|
|
174
|
+
return {
|
|
175
|
+
lerpStart: false,
|
|
176
|
+
type: "undefined",
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
lerpStart: false,
|
|
181
|
+
type: "unknown",
|
|
182
|
+
value: val,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export function parseResponsiveObject(breakpoints, object) {
|
|
186
|
+
// Breakpoint hash
|
|
187
|
+
const breakpointHash = {};
|
|
188
|
+
for (let bp of breakpoints) {
|
|
189
|
+
breakpointHash[bp.key] = {
|
|
190
|
+
min: bp.min ? parseFloat(bp.min) : null,
|
|
191
|
+
max: bp.max ? parseFloat(bp.max) : null,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
const result = [];
|
|
195
|
+
let lerpStart = "initial";
|
|
196
|
+
let lastDefined = "initial";
|
|
197
|
+
let concreteValues = {};
|
|
198
|
+
for (let bp of breakpoints) {
|
|
199
|
+
const value = parseResponsiveValue(object["@" + bp.key]);
|
|
200
|
+
const defined = value.type !== "undefined";
|
|
201
|
+
let base = !defined || value.type === "multiplier" ? lastDefined : bp.key;
|
|
202
|
+
lerpStart = value.lerpStart ? bp.key : lerpStart && !defined ? lerpStart : null;
|
|
203
|
+
if (value.type === "px" || value.type === "number") {
|
|
204
|
+
concreteValues[bp.key] = value.value;
|
|
205
|
+
}
|
|
206
|
+
else if (value.type === "multiplier") {
|
|
207
|
+
concreteValues[bp.key] = value.value * concreteValues[base];
|
|
208
|
+
}
|
|
209
|
+
else if (value.type === "percent") {
|
|
210
|
+
concreteValues[bp.key] = value.value;
|
|
211
|
+
}
|
|
212
|
+
result.push({
|
|
213
|
+
...value,
|
|
214
|
+
defined: defined,
|
|
215
|
+
breakpoint: bp.key,
|
|
216
|
+
lastBreakpoint: lastDefined,
|
|
217
|
+
baseBreakpoint: base,
|
|
218
|
+
lerping: lerpStart
|
|
219
|
+
? {
|
|
220
|
+
fromBP: lerpStart,
|
|
221
|
+
toBP: null,
|
|
222
|
+
minMedia: 0,
|
|
223
|
+
maxMedia: 0,
|
|
224
|
+
minValue: 0,
|
|
225
|
+
maxValue: 0,
|
|
226
|
+
}
|
|
227
|
+
: undefined,
|
|
228
|
+
concreteValue: concreteValues[bp.key],
|
|
229
|
+
});
|
|
230
|
+
if (defined) {
|
|
231
|
+
lastDefined = bp.key;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
let nextBreakpoints = [];
|
|
235
|
+
let lastBreakpoint = null;
|
|
236
|
+
for (let i = breakpoints.length - 1; i >= 0; i--) {
|
|
237
|
+
const bp = breakpoints[i];
|
|
238
|
+
nextBreakpoints[i] = lastBreakpoint;
|
|
239
|
+
if (result[i].defined) {
|
|
240
|
+
lastBreakpoint = bp.key;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
result.forEach((item, i) => {
|
|
244
|
+
if (item.lerping) {
|
|
245
|
+
item.lerping.toBP = nextBreakpoints[i];
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
result.forEach((item, i) => {
|
|
249
|
+
const lerp = item.lerping;
|
|
250
|
+
if (lerp) {
|
|
251
|
+
const fromBP = lerp.fromBP ? breakpointHash[lerp.fromBP] : null;
|
|
252
|
+
const toBP = lerp.toBP ? breakpointHash[lerp.toBP] : null;
|
|
253
|
+
if (!fromBP || fromBP.min === null) {
|
|
254
|
+
throw new Error(`Cannot create responsive style for first breakpoint`);
|
|
255
|
+
}
|
|
256
|
+
if (!toBP || toBP.min === null) {
|
|
257
|
+
throw new Error(`Cannot create responsive style for last breakpoint`);
|
|
258
|
+
}
|
|
259
|
+
lerp.minMedia = fromBP.min;
|
|
260
|
+
lerp.maxMedia = toBP.min;
|
|
261
|
+
lerp.minValue = item.concreteValue;
|
|
262
|
+
lerp.maxValue = result.find((o) => o.breakpoint === lerp.toBP).concreteValue;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
return result;
|
|
266
|
+
}
|
|
267
|
+
export function getResponsiveObjectStyles(breakpoints, object, varName, unit = "px") {
|
|
268
|
+
// Prescale object
|
|
269
|
+
object = { ...object };
|
|
270
|
+
const parsed = parseResponsiveObject(breakpoints, object);
|
|
271
|
+
const globals = {};
|
|
272
|
+
for (let atom of parsed) {
|
|
273
|
+
if (atom.lerpStart && atom.lerping) {
|
|
274
|
+
const lerp = atom.lerping;
|
|
275
|
+
globals["@" + atom.breakpoint] = {
|
|
276
|
+
[varName]: `calc(${lerp.minValue}${unit} + (100vw - ${lerp.minMedia}${unit}) / (${lerp.maxMedia} - ${lerp.minMedia}) * (${lerp.maxValue} - ${lerp.minValue}))`,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
else if (atom.concreteValue) {
|
|
280
|
+
globals["@" + atom.breakpoint] = {
|
|
281
|
+
[varName]: atom.concreteValue + unit,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
else if (atom.defined) {
|
|
285
|
+
globals["@" + atom.breakpoint] = {
|
|
286
|
+
[varName]: atom.value,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return [globals, globals["@initial"]?.[varName]];
|
|
291
|
+
}
|
|
292
|
+
// parseResponsiveTokens({'@initial': blah, '@desktop': blah}, breakpoints, )
|
|
293
|
+
export function parseResponsiveTokens(theme, breakpoints) {
|
|
294
|
+
const globalResponsive = {
|
|
295
|
+
"@initial": {},
|
|
296
|
+
};
|
|
297
|
+
const initialResponsive = {};
|
|
298
|
+
for (const scale in theme) {
|
|
299
|
+
const initials = {};
|
|
300
|
+
initialResponsive[scale] = initials;
|
|
301
|
+
for (const key in theme[scale]) {
|
|
302
|
+
const val = theme[scale][key];
|
|
303
|
+
if (val && typeof val === "object") {
|
|
304
|
+
const [tokenGlobals, initial] = getResponsiveObjectStyles(breakpoints, val, "--" + scale + "-" + key);
|
|
305
|
+
for (const bp in tokenGlobals) {
|
|
306
|
+
globalResponsive[bp] = {
|
|
307
|
+
...globalResponsive[bp],
|
|
308
|
+
...tokenGlobals[bp],
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
initials[key] = initial;
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
initials[key] = val;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return { initialResponsive, globalResponsive };
|
|
319
|
+
}
|
|
320
|
+
export function createStitches(config) {
|
|
321
|
+
const breakpoints = parseBreakpoints(config.breakpoints, config.media);
|
|
322
|
+
const { typeVariants, globalTypography } = parseTypography(config.theme, breakpoints, config.typography);
|
|
323
|
+
const { gridVariants, globalGrid } = parseGrid(config.theme, config.media, config.grid);
|
|
324
|
+
const { initialResponsive, globalResponsive } = parseResponsiveTokens(config.responsive, breakpoints);
|
|
325
|
+
const stitches = createBaseStitches({
|
|
326
|
+
// prefix: config.prefix,
|
|
327
|
+
media: {
|
|
328
|
+
initial: "",
|
|
329
|
+
...config.media,
|
|
330
|
+
},
|
|
331
|
+
theme: { ...config.theme, ...initialResponsive },
|
|
332
|
+
themeMap: config.themeMap,
|
|
333
|
+
utils: {
|
|
334
|
+
...(config.utils || {}),
|
|
335
|
+
typography: (key) => typeVariants[key],
|
|
336
|
+
m: (value) => ({
|
|
337
|
+
margin: value,
|
|
338
|
+
}),
|
|
339
|
+
mt: (value) => ({
|
|
340
|
+
marginTop: value,
|
|
341
|
+
}),
|
|
342
|
+
mr: (value) => ({
|
|
343
|
+
marginRight: value,
|
|
344
|
+
}),
|
|
345
|
+
mb: (value) => ({
|
|
346
|
+
marginBottom: value,
|
|
347
|
+
}),
|
|
348
|
+
ml: (value) => ({
|
|
349
|
+
marginLeft: value,
|
|
350
|
+
}),
|
|
351
|
+
mx: (value) => ({
|
|
352
|
+
marginLeft: value,
|
|
353
|
+
marginRight: value,
|
|
354
|
+
}),
|
|
355
|
+
my: (value) => ({
|
|
356
|
+
marginTop: value,
|
|
357
|
+
marginBottom: value,
|
|
358
|
+
}),
|
|
359
|
+
p: (value) => ({
|
|
360
|
+
padding: value,
|
|
361
|
+
}),
|
|
362
|
+
pt: (value) => ({
|
|
363
|
+
paddingTop: value,
|
|
364
|
+
}),
|
|
365
|
+
pr: (value) => ({
|
|
366
|
+
paddingRight: value,
|
|
367
|
+
}),
|
|
368
|
+
pb: (value) => ({
|
|
369
|
+
paddingBottom: value,
|
|
370
|
+
}),
|
|
371
|
+
pl: (value) => ({
|
|
372
|
+
paddingLeft: value,
|
|
373
|
+
}),
|
|
374
|
+
px: (value) => ({
|
|
375
|
+
paddingLeft: value,
|
|
376
|
+
paddingRight: value,
|
|
377
|
+
}),
|
|
378
|
+
py: (value) => ({
|
|
379
|
+
paddingTop: value,
|
|
380
|
+
paddingBottom: value,
|
|
381
|
+
}),
|
|
382
|
+
cols: (value) => ({
|
|
383
|
+
gridColumn: `auto / span ${value}`,
|
|
384
|
+
"--grid-columns": value,
|
|
385
|
+
}),
|
|
386
|
+
},
|
|
387
|
+
});
|
|
388
|
+
// Typography globals
|
|
389
|
+
const typeGlobals = {};
|
|
390
|
+
Object.entries(globalTypography).forEach(([key, styles]) => {
|
|
391
|
+
if (key === "@initial") {
|
|
392
|
+
typeGlobals[":root"] = styles;
|
|
393
|
+
}
|
|
394
|
+
else if (key === "@editor") {
|
|
395
|
+
typeGlobals[":root body.block-editor-page"] = styles;
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
typeGlobals[key] = { ":root": styles };
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
stitches.globalCss(typeGlobals)();
|
|
402
|
+
// Grid globals
|
|
403
|
+
const gridGlobals = {};
|
|
404
|
+
Object.entries(globalGrid).forEach(([key, styles]) => {
|
|
405
|
+
if (key === "@initial") {
|
|
406
|
+
gridGlobals[":root"] = styles;
|
|
407
|
+
}
|
|
408
|
+
else if (key === "@editor") {
|
|
409
|
+
gridGlobals[":root body.block-editor-page"] = styles;
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
gridGlobals[key] = { ":root": styles };
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
stitches.globalCss(gridGlobals)();
|
|
416
|
+
const responsiveGlobals = {};
|
|
417
|
+
Object.entries(globalResponsive).forEach(([key, styles]) => {
|
|
418
|
+
if (key === "@initial") {
|
|
419
|
+
responsiveGlobals[":root"] = styles;
|
|
420
|
+
}
|
|
421
|
+
else if (key === "@editor") {
|
|
422
|
+
responsiveGlobals[":root body.block-editor-page"] = styles;
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
responsiveGlobals[key] = { ":root": styles };
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
stitches.globalCss(responsiveGlobals)();
|
|
429
|
+
const responsiveTokens = {};
|
|
430
|
+
return {
|
|
431
|
+
...stitches,
|
|
432
|
+
originalConfig: config,
|
|
433
|
+
breakpoints,
|
|
434
|
+
typeVariants,
|
|
435
|
+
gridVariants,
|
|
436
|
+
responsiveTokens,
|
|
437
|
+
responsiveGlobals,
|
|
438
|
+
};
|
|
439
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./createStitches";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
};
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
type Props = PropsWithChildren<{}>;
|
|
5
3
|
export declare function BrowserRouter(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
4
|
export {};
|