soinproduction-gutenberg 0.1.16 → 0.3.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -11
- package/adapters/next/runtime.php +2 -2
- package/adapters/wordpress/README.md +1 -1
- package/adapters/wordpress/blueprint.ts +12 -1
- package/adapters/wordpress/renderer.php +27 -8
- package/adapters/wordpress/runtime.tsx +14 -8
- package/admin-ui/controls.js +15 -15
- package/admin-ui/editor.css +21 -4
- package/admin-ui/viewport.tsx +20 -2
- package/components/archive/editor.tsx +279 -0
- package/components/archive/index.tsx +622 -0
- package/components/archive/manifest.json +12 -0
- package/components/archive/model.ts +433 -0
- package/components/archive/styles.css +79 -0
- package/components/button/index.tsx +3 -2
- package/components/buttons/implementation/content.tsx +2 -7
- package/components/buttons/shared/index.tsx +1 -1
- package/components/drag/editor.tsx +51 -41
- package/components/drag/index.tsx +21 -13
- package/components/drag/layout.ts +5 -0
- package/components/drag/sync-model.ts +35 -0
- package/components/drag/sync.tsx +64 -0
- package/components/forms/manifest.json +3 -0
- package/components/forms/styles.css +2 -0
- package/components/heading/editor.tsx +6 -2
- package/components/heading/index.tsx +5 -3
- package/components/heading/manifest.json +5 -0
- package/components/icon/editor.tsx +1 -0
- package/components/icon/index.tsx +8 -10
- package/components/icon/manifest.json +8 -1
- package/components/list/index.tsx +25 -0
- package/components/records/index.tsx +9 -5
- package/components/section/index.tsx +7 -3
- package/components/text/editor.tsx +1 -0
- package/components/text/index.tsx +16 -10
- package/components/text/manifest.json +8 -1
- package/core/README.md +1 -1
- package/core/content/html.tsx +3 -0
- package/core/content/rich-text.tsx +15 -1
- package/core/editor/appearance.tsx +49 -0
- package/core/editor/button-width.tsx +29 -0
- package/core/editor/icons.tsx +3 -3
- package/core/editor/inline-icon.tsx +144 -0
- package/core/editor/inline-link.tsx +1 -1
- package/core/editor/paragraphs.tsx +1 -1
- package/core/editor/reset.tsx +9 -0
- package/core/editor/styles.css +110 -81
- package/core/fields/appearance.ts +29 -0
- package/core/fields/editor.tsx +35 -14
- package/core/fields/render.tsx +16 -14
- package/core/icons/icon.tsx +2 -2
- package/core/icons/inline.tsx +11 -0
- package/core/icons/library.ts +4 -0
- package/core/media/universal/editor-value.ts +84 -0
- package/core/media/universal/editor.css +51 -53
- package/core/media/universal/editor.tsx +197 -117
- package/core/ui/button-appearance.ts +1 -1
- package/core/ui/button-width.ts +16 -0
- package/core/ui/collection-motion.tsx +59 -0
- package/core/ui/section-motion.ts +122 -0
- package/core/ui/sheet.tsx +1 -1
- package/core/ui/slider.tsx +14 -8
- package/dist/adapters/next/runtime.php +2 -2
- package/dist/adapters/wordpress/README.md +1 -1
- package/dist/adapters/wordpress/blueprint.d.ts +18 -4
- package/dist/adapters/wordpress/blueprint.js +18 -4
- package/dist/adapters/wordpress/blueprint.js.map +2 -2
- package/dist/adapters/wordpress/renderer.php +27 -8
- package/dist/adapters/wordpress/runtime.js +15 -7
- package/dist/adapters/wordpress/runtime.js.map +2 -2
- package/dist/admin-ui/controls.js +15 -15
- package/dist/admin-ui/editor.css +21 -4
- package/dist/admin-ui/viewport.d.ts +3 -0
- package/dist/admin-ui/viewport.js +23 -3
- package/dist/admin-ui/viewport.js.map +2 -2
- package/dist/components/archive/editor.d.ts +2 -0
- package/dist/components/archive/editor.js +267 -0
- package/dist/components/archive/editor.js.map +7 -0
- package/dist/components/archive/index.d.ts +110 -0
- package/dist/components/archive/index.js +517 -0
- package/dist/components/archive/index.js.map +7 -0
- package/dist/components/archive/manifest.json +12 -0
- package/dist/components/archive/model.d.ts +102 -0
- package/dist/components/archive/model.js +248 -0
- package/dist/components/archive/model.js.map +7 -0
- package/dist/components/archive/styles.css +79 -0
- package/dist/components/button/index.js +3 -2
- package/dist/components/button/index.js.map +2 -2
- package/dist/components/buttons/implementation/content.js +2 -4
- package/dist/components/buttons/implementation/content.js.map +2 -2
- package/dist/components/buttons/shared/index.js +1 -1
- package/dist/components/buttons/shared/index.js.map +2 -2
- package/dist/components/drag/editor.d.ts +1 -1
- package/dist/components/drag/editor.js +51 -45
- package/dist/components/drag/editor.js.map +2 -2
- package/dist/components/drag/index.d.ts +5 -3
- package/dist/components/drag/index.js +19 -10
- package/dist/components/drag/index.js.map +3 -3
- package/dist/components/drag/layout.d.ts +2 -0
- package/dist/components/drag/layout.js +4 -0
- package/dist/components/drag/layout.js.map +2 -2
- package/dist/components/drag/sync-model.d.ts +7 -0
- package/dist/components/drag/sync-model.js +35 -0
- package/dist/components/drag/sync-model.js.map +7 -0
- package/dist/components/drag/sync.d.ts +32 -0
- package/dist/components/drag/sync.js +106 -0
- package/dist/components/drag/sync.js.map +7 -0
- package/dist/components/forms/manifest.json +3 -0
- package/dist/components/forms/styles.css +2 -0
- package/dist/components/heading/editor.d.ts +1 -0
- package/dist/components/heading/editor.js +33 -35
- package/dist/components/heading/editor.js.map +2 -2
- package/dist/components/heading/index.js +5 -3
- package/dist/components/heading/index.js.map +2 -2
- package/dist/components/heading/manifest.json +5 -0
- package/dist/components/icon/editor.d.ts +1 -0
- package/dist/components/icon/editor.js +5 -0
- package/dist/components/icon/editor.js.map +7 -0
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/icon/index.js +10 -7
- package/dist/components/icon/index.js.map +2 -2
- package/dist/components/icon/manifest.json +8 -1
- package/dist/components/list/index.js +38 -0
- package/dist/components/list/index.js.map +2 -2
- package/dist/components/records/index.d.ts +6 -4
- package/dist/components/records/index.js +6 -2
- package/dist/components/records/index.js.map +2 -2
- package/dist/components/section/index.d.ts +2 -1
- package/dist/components/section/index.js +7 -3
- package/dist/components/section/index.js.map +2 -2
- package/dist/components/text/editor.d.ts +1 -0
- package/dist/components/text/editor.js +5 -0
- package/dist/components/text/editor.js.map +7 -0
- package/dist/components/text/index.d.ts +9 -17
- package/dist/components/text/index.js +17 -7
- package/dist/components/text/index.js.map +2 -2
- package/dist/components/text/manifest.json +8 -1
- package/dist/core/README.md +1 -1
- package/dist/core/content/html.js +4 -0
- package/dist/core/content/html.js.map +2 -2
- package/dist/core/content/rich-text.js +15 -1
- package/dist/core/content/rich-text.js.map +2 -2
- package/dist/core/editor/appearance.d.ts +5 -0
- package/dist/core/editor/appearance.js +67 -0
- package/dist/core/editor/appearance.js.map +7 -0
- package/dist/core/editor/button-width.d.ts +5 -0
- package/dist/core/editor/button-width.js +46 -0
- package/dist/core/editor/button-width.js.map +7 -0
- package/dist/core/editor/icons.js +2 -2
- package/dist/core/editor/icons.js.map +2 -2
- package/dist/core/editor/inline-icon.d.ts +20 -0
- package/dist/core/editor/inline-icon.js +207 -0
- package/dist/core/editor/inline-icon.js.map +7 -0
- package/dist/core/editor/inline-link.js +1 -1
- package/dist/core/editor/inline-link.js.map +2 -2
- package/dist/core/editor/paragraphs.js +1 -1
- package/dist/core/editor/paragraphs.js.map +2 -2
- package/dist/core/editor/reset.d.ts +13 -0
- package/dist/core/editor/reset.js +15 -0
- package/dist/core/editor/reset.js.map +7 -0
- package/dist/core/editor/styles.css +110 -81
- package/dist/core/fields/appearance.d.ts +10 -0
- package/dist/core/fields/appearance.js +40 -0
- package/dist/core/fields/appearance.js.map +7 -0
- package/dist/core/fields/editor.js +71 -31
- package/dist/core/fields/editor.js.map +2 -2
- package/dist/core/fields/render.d.ts +5 -2
- package/dist/core/fields/render.js +12 -13
- package/dist/core/fields/render.js.map +2 -2
- package/dist/core/icons/icon.js +2 -2
- package/dist/core/icons/icon.js.map +2 -2
- package/dist/core/icons/inline.d.ts +5 -0
- package/dist/core/icons/inline.js +23 -0
- package/dist/core/icons/inline.js.map +7 -0
- package/dist/core/icons/library.d.ts +1 -0
- package/dist/core/icons/library.js +4 -0
- package/dist/core/icons/library.js.map +2 -2
- package/dist/core/media/universal/editor-value.d.ts +16 -0
- package/dist/core/media/universal/editor-value.js +49 -0
- package/dist/core/media/universal/editor-value.js.map +7 -0
- package/dist/core/media/universal/editor.css +51 -53
- package/dist/core/media/universal/editor.d.ts +4 -2
- package/dist/core/media/universal/editor.js +132 -70
- package/dist/core/media/universal/editor.js.map +3 -3
- package/dist/core/ui/button-appearance.d.ts +1 -0
- package/dist/core/ui/button-appearance.js.map +1 -1
- package/dist/core/ui/button-width.d.ts +4 -0
- package/dist/core/ui/button-width.js +17 -0
- package/dist/core/ui/button-width.js.map +7 -0
- package/dist/core/ui/collection-motion.d.ts +7 -0
- package/dist/core/ui/collection-motion.js +63 -0
- package/dist/core/ui/collection-motion.js.map +7 -0
- package/dist/core/ui/section-motion.d.ts +6 -0
- package/dist/core/ui/section-motion.js +127 -0
- package/dist/core/ui/section-motion.js.map +7 -0
- package/dist/core/ui/sheet.js +1 -1
- package/dist/core/ui/sheet.js.map +2 -2
- package/dist/core/ui/slider.js +24 -7
- package/dist/core/ui/slider.js.map +2 -2
- package/dist/editor/list-icons.js +3 -12
- package/dist/editor/list-icons.js.map +2 -2
- package/dist/editor/seo.js +7 -3
- package/dist/editor/seo.js.map +2 -2
- package/dist/generated/adapters.d.ts +1 -0
- package/dist/generated/adapters.js +5 -0
- package/dist/generated/adapters.js.map +7 -0
- package/dist/generated/editor-config.json +3 -0
- package/dist/generated/editor-registry.d.ts +6 -0
- package/dist/generated/editor-registry.js +7 -0
- package/dist/generated/editor-registry.js.map +7 -0
- package/dist/generated/editor.d.ts +2 -0
- package/dist/generated/editor.js +5 -0
- package/dist/generated/editor.js.map +7 -0
- package/dist/generated/public-assets.json +3 -0
- package/dist/generated/registry.d.ts +2 -0
- package/dist/generated/registry.js +7 -0
- package/dist/generated/registry.js.map +7 -0
- package/dist/generated/section-styles.json +4 -0
- package/dist/generated/sections.d.ts +1 -0
- package/dist/generated/sections.js +5 -0
- package/dist/generated/sections.js.map +7 -0
- package/dist/generated/theme.json +4 -0
- package/dist/hooks/use-motion.d.ts +5 -2
- package/dist/hooks/use-motion.js +4 -34
- package/dist/hooks/use-motion.js.map +2 -2
- package/dist/host/checks/boilerplate.test.mjs +49 -0
- package/dist/host/checks/breakpoints.test.mjs +51 -0
- package/dist/host/checks/cms-contract.test.mjs +60 -0
- package/dist/host/checks/cms.integration.mjs +19 -0
- package/dist/host/checks/rem-scale.test.mjs +13 -0
- package/dist/host/checks/routes.integration.mjs +239 -0
- package/dist/host/checks/routing.test.mjs +209 -0
- package/dist/host/checks/seo.test.mjs +32 -0
- package/dist/host/checks/shell-loading.test.mjs +66 -0
- package/dist/host/cms/contract.d.ts +75 -0
- package/dist/host/cms/contract.js +114 -0
- package/dist/host/cms/contract.js.map +7 -0
- package/dist/host/cms/policy.d.ts +11 -0
- package/dist/host/cms/policy.js +10 -0
- package/dist/host/cms/policy.js.map +7 -0
- package/dist/host/cms/server.d.ts +13 -0
- package/dist/host/cms/server.js +44 -0
- package/dist/host/cms/server.js.map +7 -0
- package/dist/host/docs/ARCHITECTURE.md +13 -0
- package/dist/host/docs/AUTHORING.md +133 -0
- package/dist/host/docs/BOILERPLATE.md +31 -0
- package/dist/host/docs/HOSTING.md +15 -0
- package/dist/host/editor/element-catalog.d.ts +15 -0
- package/dist/host/editor/element-catalog.js +20 -0
- package/dist/host/editor/element-catalog.js.map +7 -0
- package/dist/host/editor/environment.d.ts +1 -0
- package/dist/host/editor/environment.js +17 -0
- package/dist/host/editor/environment.js.map +7 -0
- package/dist/host/editor/field-controls.d.ts +2 -0
- package/dist/host/editor/field-controls.js +10 -0
- package/dist/host/editor/field-controls.js.map +7 -0
- package/dist/host/editor/index.d.ts +1 -0
- package/dist/host/editor/index.js +240 -0
- package/dist/host/editor/index.js.map +7 -0
- package/dist/host/editor/module-editor.d.ts +3 -0
- package/dist/host/editor/module-editor.js +10 -0
- package/dist/host/editor/module-editor.js.map +7 -0
- package/dist/host/editor/page-canvas.d.ts +2 -0
- package/dist/host/editor/page-canvas.js +93 -0
- package/dist/host/editor/page-canvas.js.map +7 -0
- package/dist/host/editor/record.d.ts +13 -0
- package/dist/host/editor/record.js +21 -0
- package/dist/host/editor/record.js.map +7 -0
- package/dist/host/editor/register.d.ts +1 -0
- package/dist/host/editor/register.js +186 -0
- package/dist/host/editor/register.js.map +7 -0
- package/dist/host/editor/styles.css +3 -0
- package/dist/host/media/resolve.d.ts +1 -0
- package/dist/host/media/resolve.js +5 -0
- package/dist/host/media/resolve.js.map +7 -0
- package/dist/host/modals/content.d.ts +4 -0
- package/dist/host/modals/content.js +51 -0
- package/dist/host/modals/content.js.map +7 -0
- package/dist/host/modals/dialog.d.ts +10 -0
- package/dist/host/modals/dialog.js +16 -0
- package/dist/host/modals/dialog.js.map +7 -0
- package/dist/host/modals/modal-shell.d.ts +7 -0
- package/dist/host/modals/modal-shell.js +119 -0
- package/dist/host/modals/modal-shell.js.map +7 -0
- package/dist/host/modals/shell.d.ts +10 -0
- package/dist/host/modals/shell.js +17 -0
- package/dist/host/modals/shell.js.map +7 -0
- package/dist/host/next/config.d.ts +2 -0
- package/dist/host/next/config.js +34 -0
- package/dist/host/next/config.js.map +7 -0
- package/dist/host/next/error.d.ts +3 -0
- package/dist/host/next/error.js +13 -0
- package/dist/host/next/error.js.map +7 -0
- package/dist/host/next/head.d.ts +1 -0
- package/dist/host/next/head.js +9 -0
- package/dist/host/next/head.js.map +7 -0
- package/dist/host/next/missing.d.ts +1 -0
- package/dist/host/next/missing.js +6 -0
- package/dist/host/next/missing.js.map +7 -0
- package/dist/host/next/not-found.d.ts +8 -0
- package/dist/host/next/not-found.js +11 -0
- package/dist/host/next/not-found.js.map +7 -0
- package/dist/host/next/page.d.ts +10 -0
- package/dist/host/next/page.js +45 -0
- package/dist/host/next/page.js.map +7 -0
- package/dist/host/next/preview.d.ts +12 -0
- package/dist/host/next/preview.js +32 -0
- package/dist/host/next/preview.js.map +7 -0
- package/dist/host/next/proxy.d.ts +1 -0
- package/dist/host/next/proxy.js +7 -0
- package/dist/host/next/proxy.js.map +7 -0
- package/dist/host/next/routes/api/[...path].d.ts +10 -0
- package/dist/host/next/routes/api/[...path].js +25 -0
- package/dist/host/next/routes/api/[...path].js.map +7 -0
- package/dist/host/next/routes/api/forms/[id].d.ts +7 -0
- package/dist/host/next/routes/api/forms/[id].js +17 -0
- package/dist/host/next/routes/api/forms/[id].js.map +7 -0
- package/dist/host/next/routes/api/modals/[id].d.ts +5 -0
- package/dist/host/next/routes/api/modals/[id].js +11 -0
- package/dist/host/next/routes/api/modals/[id].js.map +7 -0
- package/dist/host/next/routes/api/preview.d.ts +2 -0
- package/dist/host/next/routes/api/preview.js +16 -0
- package/dist/host/next/routes/api/preview.js.map +7 -0
- package/dist/host/next/routes/api/seo/sitemap.d.ts +2 -0
- package/dist/host/next/routes/api/seo/sitemap.js +11 -0
- package/dist/host/next/routes/api/seo/sitemap.js.map +7 -0
- package/dist/host/next/routes/robots.txt.d.ts +2 -0
- package/dist/host/next/routes/robots.txt.js +10 -0
- package/dist/host/next/routes/robots.txt.js.map +7 -0
- package/dist/host/next/routes/sitemap.xml.d.ts +2 -0
- package/dist/host/next/routes/sitemap.xml.js +10 -0
- package/dist/host/next/routes/sitemap.xml.js.map +7 -0
- package/dist/host/next/routes/sitemap_index.xml.d.ts +2 -0
- package/dist/host/next/routes/sitemap_index.xml.js +10 -0
- package/dist/host/next/routes/sitemap_index.xml.js.map +7 -0
- package/dist/host/rendering/block-list.d.ts +7 -0
- package/dist/host/rendering/block-list.js +98 -0
- package/dist/host/rendering/block-list.js.map +7 -0
- package/dist/host/rendering/html.d.ts +2 -0
- package/dist/host/rendering/html.js +5 -0
- package/dist/host/rendering/html.js.map +7 -0
- package/dist/host/rendering/native-content.d.ts +9 -0
- package/dist/host/rendering/native-content.js +55 -0
- package/dist/host/rendering/native-content.js.map +7 -0
- package/dist/host/routing/page-proxy.d.ts +9 -0
- package/dist/host/routing/page-proxy.js +70 -0
- package/dist/host/routing/page-proxy.js.map +7 -0
- package/dist/host/seo/parse.d.ts +13 -0
- package/dist/host/seo/parse.js +135 -0
- package/dist/host/seo/parse.js.map +7 -0
- package/dist/host/seo/schema.d.ts +7 -0
- package/dist/host/seo/schema.js +21 -0
- package/dist/host/seo/schema.js.map +7 -0
- package/dist/host/seo/server.d.ts +11 -0
- package/dist/host/seo/server.js +66 -0
- package/dist/host/seo/server.js.map +7 -0
- package/dist/host/styles.css +23 -0
- package/dist/host/system/not-found.d.ts +1 -0
- package/dist/host/system/not-found.js +14 -0
- package/dist/host/system/not-found.js.map +7 -0
- package/dist/host/wordpress.d.ts +1 -0
- package/dist/host/wordpress.js +6 -0
- package/dist/host/wordpress.js.map +7 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -4
- package/dist/index.js.map +2 -2
- package/dist/modules/booking/blocks/form/component.d.ts +1 -1
- package/dist/modules/booking/blocks/form/component.js +12 -3
- package/dist/modules/booking/blocks/form/component.js.map +2 -2
- package/dist/modules/booking/bootstrap.php +6 -0
- package/dist/modules/booking/frontend/widget.js +1 -1
- package/dist/modules/booking/frontend/widget.js.map +2 -2
- package/dist/modules/icons/bootstrap.php +6 -0
- package/dist/modules/icons/inline.php +24 -0
- package/dist/modules/modals/context.d.ts +5 -0
- package/dist/modules/modals/context.js +3 -1
- package/dist/modules/modals/context.js.map +2 -2
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +8 -2
- package/dist/schema/index.js.map +2 -2
- package/dist/schema/theme.json +112 -0
- package/dist/styles/columns.css +14 -0
- package/dist/styles/native-content.css +19 -0
- package/dist/tooling/block-paths.mjs +4 -3
- package/dist/tooling/breakpoints.cjs +8 -7
- package/dist/tooling/build-editor.mjs +8 -6
- package/dist/tooling/build-package.mjs +3 -1
- package/dist/tooling/build-wordpress.mjs +8 -6
- package/dist/tooling/check-project.mjs +14 -0
- package/dist/tooling/clean-project.mjs +16 -0
- package/dist/tooling/cli.mjs +8 -0
- package/dist/tooling/create-module.mjs +2 -2
- package/dist/tooling/create-post-type.mjs +10 -8
- package/dist/tooling/create-section.mjs +2 -2
- package/dist/tooling/dev.mjs +5 -9
- package/dist/tooling/export-starter.mjs +50 -0
- package/dist/tooling/init-theme.mjs +6 -182
- package/dist/tooling/jsx-only.mjs +2 -2
- package/dist/tooling/next-runtime.mjs +2 -2
- package/dist/tooling/postcss-config.mjs +2 -0
- package/dist/tooling/prepare-project.mjs +7 -3
- package/dist/tooling/project-build.mjs +6 -0
- package/dist/tooling/rem-css.cjs +6 -2
- package/dist/tooling/section-styles.mjs +8 -8
- package/dist/tooling/smoke-package.mjs +9 -2
- package/dist/tooling/sync-blocks.mjs +15 -11
- package/dist/tooling/sync-host.mjs +7 -0
- package/dist/tooling/sync-kit.mjs +8 -3
- package/dist/tooling/sync-public-assets.mjs +24 -0
- package/dist/tooling/sync-sections.mjs +5 -4
- package/dist/tooling/sync-theme.mjs +91 -0
- package/dist/tooling/theme-config.cjs +22 -0
- package/dist/tooling/watch-editor.mjs +2 -2
- package/dist/ui/README.md +2 -1
- package/dist/ui/forms-admin.css +4 -0
- package/dist/ui/forms.css +11 -0
- package/dist/ui/multi-select.d.ts +23 -0
- package/dist/ui/multi-select.js +97 -0
- package/dist/ui/multi-select.js.map +7 -0
- package/dist/ui/select.js +2 -2
- package/dist/ui/select.js.map +2 -2
- package/dist/wordpress/admin/locale.php +12 -0
- package/dist/wordpress/api/content.php +22 -20
- package/dist/wordpress/bootstrap.php +2 -0
- package/dist/wordpress/breakpoints.php +3 -2
- package/dist/wordpress/documents.php +6 -11
- package/dist/wordpress/editor.php +11 -8
- package/dist/wordpress/examples/post-type.example.php +11 -11
- package/dist/wordpress/host.php +68 -0
- package/dist/wordpress/integrations.php +10 -8
- package/dist/wordpress/layouts.php +18 -0
- package/dist/wordpress/post-types/collections.php +27 -85
- package/dist/wordpress/post-types/modals.php +6 -7
- package/dist/wordpress/project-autoload.php +16 -0
- package/dist/wordpress/record-context.php +42 -0
- package/dist/wordpress/rendering/bootstrap.php +4 -6
- package/dist/wordpress/rendering/performance.php +1 -12
- package/dist/wordpress/seo.php +2 -3
- package/dist/wordpress/template.php +24 -0
- package/dist/wordpress/theme-config.php +10 -0
- package/dist/wordpress/theme.php +7 -0
- package/editor/list-icons.tsx +3 -5
- package/editor/seo.ts +10 -2
- package/generated/adapters.ts +1 -0
- package/generated/editor-config.json +3 -0
- package/generated/editor-registry.ts +3 -0
- package/generated/editor.ts +2 -0
- package/generated/public-assets.json +3 -0
- package/generated/registry.ts +2 -0
- package/generated/section-styles.json +4 -0
- package/generated/sections.ts +1 -0
- package/generated/theme.json +4 -0
- package/hooks/use-motion.ts +8 -44
- package/host/checks/boilerplate.test.mjs +49 -0
- package/host/checks/breakpoints.test.mjs +51 -0
- package/host/checks/cms-contract.test.mjs +60 -0
- package/host/checks/cms.integration.mjs +19 -0
- package/host/checks/rem-scale.test.mjs +13 -0
- package/host/checks/routes.integration.mjs +239 -0
- package/host/checks/routing.test.mjs +209 -0
- package/host/checks/seo.test.mjs +32 -0
- package/host/checks/shell-loading.test.mjs +66 -0
- package/host/cms/contract.ts +143 -0
- package/host/cms/policy.ts +9 -0
- package/host/cms/server.ts +32 -0
- package/host/docs/ARCHITECTURE.md +13 -0
- package/host/docs/AUTHORING.md +133 -0
- package/host/docs/BOILERPLATE.md +31 -0
- package/host/docs/HOSTING.md +15 -0
- package/host/editor/element-catalog.ts +18 -0
- package/host/editor/environment.tsx +10 -0
- package/host/editor/field-controls.tsx +7 -0
- package/host/editor/globals.d.ts +6 -0
- package/host/editor/index.tsx +262 -0
- package/host/editor/module-editor.tsx +6 -0
- package/host/editor/page-canvas.tsx +96 -0
- package/host/editor/record.ts +27 -0
- package/host/editor/register.tsx +189 -0
- package/host/editor/styles.css +3 -0
- package/host/media/resolve.ts +1 -0
- package/host/modals/content.tsx +53 -0
- package/host/modals/dialog.tsx +24 -0
- package/host/modals/modal-shell.tsx +133 -0
- package/host/modals/shell.tsx +23 -0
- package/host/next/config.ts +31 -0
- package/host/next/error.tsx +2 -0
- package/host/next/head.tsx +2 -0
- package/host/next/missing.tsx +1 -0
- package/host/next/not-found.tsx +5 -0
- package/host/next/page.tsx +55 -0
- package/host/next/preview.tsx +14 -0
- package/host/next/proxy.ts +3 -0
- package/host/next/routes/api/[...path].ts +16 -0
- package/host/next/routes/api/forms/[id].ts +12 -0
- package/host/next/routes/api/modals/[id].ts +2 -0
- package/host/next/routes/api/preview.ts +13 -0
- package/host/next/routes/api/seo/sitemap.ts +7 -0
- package/host/next/routes/robots.txt.ts +5 -0
- package/host/next/routes/sitemap.xml.ts +5 -0
- package/host/next/routes/sitemap_index.xml.ts +5 -0
- package/host/rendering/block-list.tsx +121 -0
- package/host/rendering/html.tsx +2 -0
- package/host/rendering/native-content.tsx +79 -0
- package/host/routing/page-proxy.ts +83 -0
- package/host/seo/parse.ts +154 -0
- package/host/seo/schema.tsx +22 -0
- package/host/seo/server.ts +64 -0
- package/host/styles.css +23 -0
- package/host/system/not-found.tsx +14 -0
- package/host/wordpress.tsx +5 -0
- package/index.tsx +3 -2
- package/modules/booking/blocks/form/component.tsx +10 -3
- package/modules/booking/bootstrap.php +6 -0
- package/modules/booking/frontend/widget.tsx +1 -1
- package/modules/icons/bootstrap.php +6 -0
- package/modules/icons/inline.php +24 -0
- package/modules/modals/context.ts +2 -0
- package/package.json +22 -3
- package/schema/index.tsx +7 -2
- package/schema/theme.json +112 -0
- package/starter/map.json +32 -0
- package/starter/package-lock.template.json +3502 -0
- package/starter/templates/.htaccess +7 -0
- package/starter/templates/.nvmrc +1 -0
- package/starter/templates/AGENTS.md +14 -0
- package/starter/templates/README.md +13 -0
- package/starter/templates/deploy/nginx-private.conf +10 -0
- package/starter/templates/frontend/.env.example +13 -0
- package/starter/templates/frontend/.htaccess +7 -0
- package/starter/templates/frontend/.prettierrc.json +1 -0
- package/starter/templates/frontend/AGENTS.md +9 -0
- package/starter/templates/frontend/app/404/page.tsx +1 -0
- package/starter/templates/frontend/app/[[...path]]/page.tsx +1 -0
- package/starter/templates/frontend/app/api/[...path]/route.ts +1 -0
- package/starter/templates/frontend/app/api/forms/[id]/route.ts +1 -0
- package/starter/templates/frontend/app/api/modals/[id]/route.ts +1 -0
- package/starter/templates/frontend/app/api/preview/route.ts +1 -0
- package/starter/templates/frontend/app/api/seo/sitemap/route.ts +2 -0
- package/starter/templates/frontend/app/error.tsx +2 -0
- package/starter/templates/frontend/app/globals.css +5 -0
- package/starter/templates/frontend/app/layout.tsx +8 -0
- package/starter/templates/frontend/app/not-found.tsx +1 -0
- package/starter/templates/frontend/app/preview/[id]/page.tsx +1 -0
- package/starter/templates/frontend/app/robots.txt/route.ts +2 -0
- package/starter/templates/frontend/app/sitemap.xml/route.ts +2 -0
- package/starter/templates/frontend/app/sitemap_index.xml/route.ts +2 -0
- package/starter/templates/frontend/gitignore.template +8 -0
- package/starter/templates/frontend/next.config.ts +2 -0
- package/starter/templates/frontend/package.json +51 -0
- package/starter/templates/frontend/postcss.config.mjs +1 -0
- package/starter/templates/frontend/proxy.ts +7 -0
- package/starter/templates/frontend/public/assets/fonts/Manrope-Variable.woff2 +0 -0
- package/starter/templates/frontend/public/assets/fonts/OFL-Manrope.txt +93 -0
- package/starter/templates/frontend/public/assets/fonts/OFL-Unbounded.txt +93 -0
- package/starter/templates/frontend/public/assets/fonts/SOURCES.txt +26 -0
- package/starter/templates/frontend/public/assets/fonts/Unbounded-Variable.woff2 +0 -0
- package/starter/templates/frontend/src/README.md +3 -0
- package/starter/templates/frontend/src/sections/README.md +3 -0
- package/starter/templates/frontend/src/styles/base.css +14 -0
- package/starter/templates/frontend/src/styles/buttons.css +200 -0
- package/starter/templates/frontend/src/styles/headings.css +42 -0
- package/starter/templates/frontend/tsconfig.json +61 -0
- package/starter/templates/functions.php +3 -0
- package/starter/templates/gitignore.template +27 -0
- package/starter/templates/inc/README.md +3 -0
- package/starter/templates/index.php +3 -0
- package/starter/templates/style.css +7 -0
- package/starter/templates/templates/index.html +1 -0
- package/starter/templates/theme.json +462 -0
- package/styles/columns.css +14 -0
- package/styles/native-content.css +19 -0
- package/tooling/block-paths.mjs +4 -3
- package/tooling/breakpoints.cjs +8 -7
- package/tooling/build-editor.mjs +8 -6
- package/tooling/build-package.mjs +3 -1
- package/tooling/build-wordpress.mjs +8 -6
- package/tooling/check-project.mjs +14 -0
- package/tooling/clean-project.mjs +16 -0
- package/tooling/cli.mjs +8 -0
- package/tooling/create-module.mjs +2 -2
- package/tooling/create-post-type.mjs +10 -8
- package/tooling/create-section.mjs +2 -2
- package/tooling/dev.mjs +5 -9
- package/tooling/export-starter.mjs +50 -0
- package/tooling/init-theme.mjs +6 -182
- package/tooling/jsx-only.mjs +2 -2
- package/tooling/next-runtime.mjs +2 -2
- package/tooling/postcss-config.mjs +2 -0
- package/tooling/prepare-project.mjs +7 -3
- package/tooling/project-build.mjs +6 -0
- package/tooling/rem-css.cjs +6 -2
- package/tooling/section-styles.mjs +8 -8
- package/tooling/smoke-package.mjs +9 -2
- package/tooling/sync-blocks.mjs +15 -11
- package/tooling/sync-host.mjs +7 -0
- package/tooling/sync-kit.mjs +8 -3
- package/tooling/sync-public-assets.mjs +24 -0
- package/tooling/sync-sections.mjs +5 -4
- package/tooling/sync-theme.mjs +91 -0
- package/tooling/theme-config.cjs +22 -0
- package/tooling/watch-editor.mjs +2 -2
- package/tsconfig.json +4 -1
- package/ui/README.md +2 -1
- package/ui/forms-admin.css +4 -0
- package/ui/forms.css +11 -0
- package/ui/multi-select.tsx +60 -0
- package/ui/select.tsx +2 -2
- package/wordpress/admin/locale.php +12 -0
- package/wordpress/api/content.php +22 -20
- package/wordpress/bootstrap.php +2 -0
- package/wordpress/breakpoints.php +3 -2
- package/wordpress/documents.php +6 -11
- package/wordpress/editor.php +11 -8
- package/wordpress/examples/post-type.example.php +11 -11
- package/wordpress/host.php +68 -0
- package/wordpress/integrations.php +10 -8
- package/wordpress/layouts.php +18 -0
- package/wordpress/post-types/collections.php +27 -85
- package/wordpress/post-types/modals.php +6 -7
- package/wordpress/project-autoload.php +16 -0
- package/wordpress/record-context.php +42 -0
- package/wordpress/rendering/bootstrap.php +4 -6
- package/wordpress/rendering/performance.php +1 -12
- package/wordpress/seo.php +2 -3
- package/wordpress/template.php +24 -0
- package/wordpress/theme-config.php +10 -0
- package/wordpress/theme.php +7 -0
- package/components/pricing-plans/editor.tsx +0 -2
- package/components/pricing-plans/implementation/component.tsx +0 -40
- package/components/pricing-plans/implementation/editor.tsx +0 -17
- package/components/pricing-plans/implementation/selection.ts +0 -10
- package/components/pricing-plans/index.tsx +0 -11
- package/components/pricing-plans/manifest.json +0 -17
- package/components/pricing-plans/server.php +0 -24
- package/components/reviews-carousel/card.tsx +0 -63
- package/components/reviews-carousel/editor.tsx +0 -2
- package/components/reviews-carousel/implementation/component.tsx +0 -80
- package/components/reviews-carousel/implementation/editor.tsx +0 -17
- package/components/reviews-carousel/implementation/selection.ts +0 -10
- package/components/reviews-carousel/index.tsx +0 -12
- package/components/reviews-carousel/manifest.json +0 -14
- package/components/reviews-carousel/server.php +0 -18
- package/dist/components/pricing-plans/editor.d.ts +0 -1
- package/dist/components/pricing-plans/editor.js +0 -9
- package/dist/components/pricing-plans/editor.js.map +0 -7
- package/dist/components/pricing-plans/implementation/component.d.ts +0 -4
- package/dist/components/pricing-plans/implementation/component.js +0 -45
- package/dist/components/pricing-plans/implementation/component.js.map +0 -7
- package/dist/components/pricing-plans/implementation/editor.d.ts +0 -6
- package/dist/components/pricing-plans/implementation/editor.js +0 -21
- package/dist/components/pricing-plans/implementation/editor.js.map +0 -7
- package/dist/components/pricing-plans/implementation/selection.d.ts +0 -3
- package/dist/components/pricing-plans/implementation/selection.js +0 -13
- package/dist/components/pricing-plans/implementation/selection.js.map +0 -7
- package/dist/components/pricing-plans/index.d.ts +0 -46
- package/dist/components/pricing-plans/index.js +0 -13
- package/dist/components/pricing-plans/index.js.map +0 -7
- package/dist/components/pricing-plans/manifest.json +0 -17
- package/dist/components/pricing-plans/server.php +0 -24
- package/dist/components/reviews-carousel/card.d.ts +0 -1
- package/dist/components/reviews-carousel/card.js +0 -55
- package/dist/components/reviews-carousel/card.js.map +0 -7
- package/dist/components/reviews-carousel/editor.d.ts +0 -1
- package/dist/components/reviews-carousel/editor.js +0 -9
- package/dist/components/reviews-carousel/editor.js.map +0 -7
- package/dist/components/reviews-carousel/implementation/component.d.ts +0 -12
- package/dist/components/reviews-carousel/implementation/component.js +0 -63
- package/dist/components/reviews-carousel/implementation/component.js.map +0 -7
- package/dist/components/reviews-carousel/implementation/editor.d.ts +0 -6
- package/dist/components/reviews-carousel/implementation/editor.js +0 -21
- package/dist/components/reviews-carousel/implementation/editor.js.map +0 -7
- package/dist/components/reviews-carousel/implementation/selection.d.ts +0 -3
- package/dist/components/reviews-carousel/implementation/selection.js +0 -13
- package/dist/components/reviews-carousel/implementation/selection.js.map +0 -7
- package/dist/components/reviews-carousel/index.d.ts +0 -60
- package/dist/components/reviews-carousel/index.js +0 -13
- package/dist/components/reviews-carousel/index.js.map +0 -7
- package/dist/components/reviews-carousel/manifest.json +0 -14
- package/dist/components/reviews-carousel/server.php +0 -18
- package/dist/modules/collections/blocks/review/component.d.ts +0 -2
- package/dist/modules/collections/blocks/review/component.js +0 -14
- package/dist/modules/collections/blocks/review/component.js.map +0 -7
- package/dist/modules/collections/blocks/review/editor.d.ts +0 -1
- package/dist/modules/collections/blocks/review/editor.js +0 -11
- package/dist/modules/collections/blocks/review/editor.js.map +0 -7
- package/dist/modules/collections/blocks/review/register.php +0 -2
- package/dist/modules/collections/blocks/review/schema.d.ts +0 -7
- package/dist/modules/collections/blocks/review/schema.js +0 -14
- package/dist/modules/collections/blocks/review/schema.js.map +0 -7
- package/dist/modules/collections/manifest.json +0 -5
- package/dist/styles/rem-scale.css +0 -76
- package/modules/collections/blocks/review/component.tsx +0 -7
- package/modules/collections/blocks/review/editor.tsx +0 -8
- package/modules/collections/blocks/review/register.php +0 -2
- package/modules/collections/blocks/review/schema.ts +0 -20
- package/modules/collections/manifest.json +0 -5
- package/styles/rem-scale.css +0 -76
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ The npm package includes compiled ESM, TypeScript declarations, source templates
|
|
|
17
17
|
|
|
18
18
|
## WordPress project preparation
|
|
19
19
|
|
|
20
|
-
The
|
|
20
|
+
The project owns authored sections/components/styles, theme tokens, language, configuration, content and business PHP. Kit owns CMS/editor/rendering/routing/SEO infrastructure, build tools, generic checks and neutral starter templates.
|
|
21
21
|
|
|
22
22
|
For the existing declarative theme architecture, add this to the frontend's `package.json`:
|
|
23
23
|
|
|
@@ -31,24 +31,23 @@ An existing hand-maintained `kit/` is never overwritten. Move it aside when migr
|
|
|
31
31
|
|
|
32
32
|
The host supplies:
|
|
33
33
|
|
|
34
|
-
- `
|
|
35
|
-
- `
|
|
34
|
+
- `theme.json → kit.responsive`: `breakpoints`, `media.columns` and `layoutIgnore`.
|
|
35
|
+
- `theme.json → kit`: enabled global modules and editor settings.
|
|
36
36
|
- `src/sections/section-*/section.tsx` and `section.json`: authored sections.
|
|
37
37
|
- Existing project content renderer and editor integration points when using legacy blocks.
|
|
38
38
|
|
|
39
|
-
Example `
|
|
39
|
+
Example `theme.json → kit`:
|
|
40
40
|
|
|
41
41
|
```json
|
|
42
42
|
{
|
|
43
43
|
"modules": ["forms", "icons", "video-posters"],
|
|
44
|
-
"editor": {"
|
|
45
|
-
"wordpress": {"entry":"src/wordpress.tsx"}
|
|
44
|
+
"editor": {"stylesheet":"app/globals.css"}
|
|
46
45
|
}
|
|
47
46
|
```
|
|
48
47
|
|
|
49
48
|
Point the host TypeScript aliases `@kit` and `@kit/*` to `kit/index.tsx` and `kit/*`; `@ui/*` to `kit/ui/*`; and `@forms/*` to `kit/modules/forms/frontend/*` where existing host code uses them. The generated source itself uses relative imports. Compile authored portable sections through the root `@kit` import so the WordPress compiler can substitute its markers.
|
|
50
49
|
|
|
51
|
-
Load `kit/
|
|
50
|
+
Load `kit/wordpress/theme.php` once from the WordPress theme and supply module settings through host integration files. Deploy the managed kit's PHP and published assets along with the theme. Node is needed for preparation/building, not PHP request rendering.
|
|
52
51
|
|
|
53
52
|
## Automatic connections
|
|
54
53
|
|
|
@@ -86,7 +85,7 @@ Use the installed `soinproduction-kit` binary in npm scripts:
|
|
|
86
85
|
{"scripts":{"dev":"soinproduction-kit dev","start":"soinproduction-kit start","create:component":"soinproduction-kit create component","create:section":"soinproduction-kit create section","create:layout":"soinproduction-kit create layout","new:section":"soinproduction-kit new section","render:module":"soinproduction-kit render"}}
|
|
87
86
|
```
|
|
88
87
|
|
|
89
|
-
`dev` and `start` select a free port automatically. Explicit `--port`/`-p` or `PORT` take precedence. Development propagates the actual origin to site/forms configuration and writes `build/next-server.json`; the Next PHP adapter loaded by `bootstrap.php` reads it for local frontend URLs. Public deployment URLs stay configured. Override the project-relative runtime path with `runtime.file` in `
|
|
88
|
+
`dev` and `start` select a free port automatically. Explicit `--port`/`-p` or `PORT` take precedence. Development propagates the actual origin to site/forms configuration and writes `build/next-server.json`; the Next PHP adapter loaded by `bootstrap.php` reads it for local frontend URLs. Public deployment URLs stay configured. Override the project-relative runtime path with `runtime.file` in `theme.json → kit`.
|
|
90
89
|
|
|
91
90
|
Generators prepare the installed kit automatically, then create the component schema, renderer, editor, PHP registration, styles and preview in the project. `new section` creates a declarative section. Use `--no-build` to generate without an editor build. `render` regenerates module markup from its schema. All commands accept `--project PATH`. The project owns component/section selection and optional `adapters.contentRenderer` / `adapters.editorAdapter` objects (`from`, `export`); portable defaults are provided. Preparation reuses unchanged package sources and refreshes generated connections without disturbing a running Next watcher.
|
|
92
91
|
|
|
@@ -109,7 +108,7 @@ npx soinproduction-kit create post-type case_study --collection \
|
|
|
109
108
|
```
|
|
110
109
|
|
|
111
110
|
Kit создаёт `inc/post-types/case_study.php`, подключает его в `inc/bootstrap.php`
|
|
112
|
-
и добавляет тип в `
|
|
111
|
+
и добавляет тип в `theme.json → kit`. Для коллекции Kit создаёт блок
|
|
113
112
|
`site/case-study-card` с описанием и изображением и фиксирует его в шаблоне записи.
|
|
114
113
|
`--block site/study-card` задаёт другое имя. Если такой блок уже существует в теме,
|
|
115
114
|
Kit использует его. После генерации пересоберите редактор обычной командой проекта
|
|
@@ -153,7 +152,7 @@ The portable PHP renderer resolves the same tag, class and defaults as React.
|
|
|
153
152
|
|
|
154
153
|
### Isolated section styles
|
|
155
154
|
|
|
156
|
-
Set `"sectionStyles": "isolated"` in `
|
|
155
|
+
Set `"sectionStyles": "isolated"` in `theme.json → kit` to compile each section's `styles.css` into a hashed asset. Preparation emits `src/sections/styles.manifest.generated.json` and `public/kit/sections/`. Keep those public assets available alongside a deployed Next build. The shared stylesheet retains theme declarations; selectors and keyframes load per rendered section. Existing projects retain global imports unless they opt in.
|
|
157
156
|
|
|
158
157
|
The existing `Section` root receives `data-site-section="site/slug"`. Compiled selectors are guarded by that owner without increasing specificity; keyframe names are unique to the section. Document state ancestors such as `html[data-motion]` still work. Keep reset rules, fonts and global custom properties in the shared entry. Use unique names for section `@theme` tokens; global directives such as `@font-face`, `@property`, `@utility` and `@apply` are rejected inside isolated section styles.
|
|
159
158
|
|
|
@@ -161,7 +160,7 @@ In a custom React block renderer, look up the actual block name in the generated
|
|
|
161
160
|
|
|
162
161
|
## View-specific native wrappers
|
|
163
162
|
|
|
164
|
-
Enable `"jsxOnly": true` in `
|
|
163
|
+
Enable `"jsxOnly": true` in `theme.json → kit` and run Kit preparation once. It connects the Kit JSX runtime through the project's `jsxImportSource`. Existing consumers stay on their current runtime unless opted in; an unrelated custom runtime is never replaced automatically.
|
|
165
164
|
|
|
166
165
|
```tsx
|
|
167
166
|
<div only="admin" className="relative">
|
|
@@ -206,3 +205,79 @@ Every public JSX component accepts `order?: number`. Lower values appear first i
|
|
|
206
205
|
```
|
|
207
206
|
|
|
208
207
|
The component reference includes all public JSX props, including inherited props. Its type table is regenerated from TypeScript before each documentation build. Run `node tooling/build-doc-props.mjs --check` to check it without writing files.
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## Explicit project data
|
|
211
|
+
|
|
212
|
+
The site API contains WordPress metadata, shared layout blocks, media references, public page links and archive assignments. It does not create project post types, guess collection block names, read a theme settings function or load project collections. Project PHP registers its own post types and exports data explicitly:
|
|
213
|
+
|
|
214
|
+
```php
|
|
215
|
+
add_filter('site_public_data', function (array $data): array {
|
|
216
|
+
$data['settings'] = (array) get_option('project_settings', []);
|
|
217
|
+
$data['resources'] = collection_records('resource', 'site/resource-card');
|
|
218
|
+
return $data;
|
|
219
|
+
});
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
`collection_records($postType, $blockName)` requires both arguments. It returns the saved block fields plus record identity and extra blocks, without injecting domain-specific fields or labels. The CLI generates this explicit integration in the theme. `postTypes` in `theme.json → kit` selects project types for the Kit editor; omitting project configuration creates no project collections. Optional icons, forms and booking modules contribute their data only when connected. Project-specific internal SEO documents use `site_seo_internal_document`.
|
|
223
|
+
|
|
224
|
+
Compose review carousels and pricing sections in the project using `Records`, `Slider`, `List` and their child primitives. KIT no longer ships the old project-specific review/pricing widgets or their automatic API collections. There are no compatibility aliases for these removed integrations.
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
## Record and editor API contracts
|
|
228
|
+
|
|
229
|
+
Every document's `record` contains `id`, `type`, `slug`, `url`, `title`, `excerpt` and `taxonomies` (a map of taxonomy names to term ID arrays), plus the project's saved `site_record` fields. Core identity always comes from WordPress, not from editable metadata. Linked cards and collection records use the same context. Projects decide which relationship fields to save; KIT does not guess them.
|
|
230
|
+
|
|
231
|
+
`GET /site/v1/site` contains public data only. Editor-only integrations use the `site_editor_data` filter and authenticated `GET /site/v1/editor/site`, which requires `edit_posts` and returns `Cache-Control: private, no-store`. Do not add editor catalogues or private data to `site_public_data`.
|
|
232
|
+
|
|
233
|
+
## Thin starter (0.2)
|
|
234
|
+
|
|
235
|
+
Use `soinproduction-kit export /absolute/new-directory` to create a neutral theme from package-owned templates. The current site's sections, settings and secrets are never copied. The export includes the local pinned npm archive, lock and `kit.lock.json` provenance. `starter/map.json` is the ownership map.
|
|
236
|
+
|
|
237
|
+
No project `src/lib`, `src/site`, registry files or scripts are needed. `prepare` writes all connections under `kit/generated`. `app` route files re-export `@kit/host/next/*`; the root layout, stylesheet and language stay project-owned. PHP entry files load `kit/wordpress/theme.php` and `kit/wordpress/template.php`. Common documentation and checks are shipped in `host/docs` and `host/checks`.
|
|
238
|
+
|
|
239
|
+
Commands: `prepare`, `build`, `build:editor`, `build:wordpress`, `dev`, `start`, `check`, `check:routes`, `check:cms`, `clean`, `export`. Projects may add their own `tests/*.test.mjs`; `check` runs them alongside the package's generic checks.
|
|
240
|
+
|
|
241
|
+
Optional custom integration: `editor.extensions` imports a project editor extension after the default entry; `editor.entry` replaces the entry; `editor.styles` adds editor CSS. `adapters.shell`, `adapters.contentRenderer`, and `adapters.editorAdapter` accept explicit `{from, export}` module references. Configure `editor.buttonStyles` as name/label objects. No project styles are registered implicitly.
|
|
242
|
+
|
|
243
|
+
The neutral starter stores Manrope and Unbounded locally with their licenses. Next loads them through next/font/local; WordPress uses theme.json fontFace and published build/assets/fonts. adminUi.locale optionally configures the admin/login/editor language while leaving the public locale unchanged. Shared custom admin controls have English labels.
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
### Inline record templates
|
|
247
|
+
|
|
248
|
+
`Records` accepts either ordinary JSX children or a render function with the current record. Use the function for record-dependent classes, attributes, numbers and arrays while keeping the complete card markup inside the collection:
|
|
249
|
+
|
|
250
|
+
```tsx
|
|
251
|
+
<Records name="items" type="item">
|
|
252
|
+
{record => <article data-record-id={record.id} className={record.highlighted ? 'bg-muted' : 'bg-background'}>
|
|
253
|
+
<RecordTitle />
|
|
254
|
+
<RecordText field="description" />
|
|
255
|
+
</article>}
|
|
256
|
+
</Records>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Record primitives keep the same current-record context in both forms. Selection stores IDs and preserves their order. A render function supplies presentation only; it does not declare editable section fields. An editor add tile renders with an empty record (`title`, `excerpt`, `index`), so guard optional arrays and nested values. Dynamic templates render in Next SSR and Gutenberg; WordPress mode uses the existing browser island because PHP cannot serialize JavaScript callbacks. Ordinary declarative JSX templates retain their existing PHP blueprint behavior.
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
### Synchronized Drag areas
|
|
263
|
+
|
|
264
|
+
Give multiple Drag areas in one section the same `sync` value (`true` uses the section's shared group). Each area needs its own name and each Cols palette needs a unique name. Synchronized areas use the same grid/mobileGrid/gap/maxCol and share one native Gutenberg block pool; existing first-area block names stay unchanged.
|
|
265
|
+
|
|
266
|
+
```tsx
|
|
267
|
+
<Drag name="heading" sync="layout" grid={18} mobileGrid={1} gap={0}>
|
|
268
|
+
<Cols name="main" span={13}><Heading name="title" /></Cols>
|
|
269
|
+
</Drag>
|
|
270
|
+
<Drag name="footer" sync="layout" grid={18} mobileGrid={1} gap={0}>
|
|
271
|
+
<Cols name="action" span={5}><Buttons name="actions" /></Cols>
|
|
272
|
+
</Drag>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
A column's English aside `Area` control selects its default area or the area for the chosen screen range. Stored `syncArea` and `responsive[breakpoint].syncArea` route the whole column, including its elements. Each range is independent; removing a range's route restores the default. Normal Gutenberg operations still move child elements between columns in the common pool. Synchronization creates no copies of field data. Stable portal hosts move between areas while keeping mounted React state and focus. Guides and resize frames are shared across the areas of that section.
|
|
276
|
+
|
|
277
|
+
Enabling this on existing content requires a backed-up project migration: put the area's fields into its columns, assign stable `syncId` strings to columns, and set their default `syncArea` names. This is an explicit project data migration, never a library request-time rewrite. Sections using a single ordinary Drag keep their existing behavior. Default placement is available in Next SSR, with responsive portal routing enhanced in the browser. WordPress portable mode uses the existing browser island for synchronized areas; PHP does not execute the portal controller.
|
|
278
|
+
|
|
279
|
+
The editor's **Fit window** mode previews and edits the actual canvas breakpoint, including saved column and area overrides. A named device previews that independent screen range. **Default** in the column layout tabs explicitly edits the base layout on a wide canvas; returning to Fit window restores responsive preview. Column alignment and below-breakpoint full-row placement share the same stylesheet on React, PHP and Gutenberg.
|
|
280
|
+
|
|
281
|
+
### Shared section reveal
|
|
282
|
+
|
|
283
|
+
`<Section motion>` enables the Kit reveal (32px rise and fade). Mark independent groups with `data-motion`; without markers the section is one reveal target. The editor, reduced-motion preference, missing browser support and initial viewport keep content visible. Added or replaced targets are observed without replaying revealed nodes, including stable portal moves. `data-motion-delay` or `--site-motion-delay` sets an optional delay in milliseconds. Hero entrances and continuous Marquee motion stay project-owned. New section scaffolds include `motion`; omit it or use `motion={false}` to disable. PHP sections and React use the same controller.
|
|
@@ -8,9 +8,9 @@ function frontend_origin(?string $configured = null, ?string $runtime_file = nul
|
|
|
8
8
|
$local = ['127.0.0.1', 'localhost', '[::1]', '::1'];
|
|
9
9
|
if (!in_array(parse_url($configured, PHP_URL_HOST), $local, true)) return $configured;
|
|
10
10
|
$root = dirname(__DIR__, 3);
|
|
11
|
-
$config_file = $root . '/
|
|
11
|
+
$config_file = dirname($root) . '/theme.json';
|
|
12
12
|
$config = is_readable($config_file) ? json_decode((string)file_get_contents($config_file), true) : [];
|
|
13
|
-
$relative = $config['runtime']['file'] ?? 'build/next-server.json';
|
|
13
|
+
$relative = $config['kit']['runtime']['file'] ?? 'build/next-server.json';
|
|
14
14
|
if ($runtime_file === null && (!is_string($relative) || str_starts_with($relative, '/') || in_array('..', explode('/', str_replace('\\', '/', $relative)), true))) return $configured;
|
|
15
15
|
$file = $runtime_file ?? $root . '/' . $relative;
|
|
16
16
|
$runtime = is_readable($file) ? json_decode((string)file_get_contents($file), true) : null;
|
|
@@ -6,7 +6,7 @@ Node is required locally for building only. Deploy the theme PHP, its existing e
|
|
|
6
6
|
|
|
7
7
|
## Migration
|
|
8
8
|
|
|
9
|
-
Set `mode` to `next` or `wordpress` in the theme-root `
|
|
9
|
+
Set `mode` to `next` or `wordpress` in the theme-root `theme.json → kit.render`. This is the sole renderer setting shared by PHP and the build scripts; there is no admin control or database option. `npm run dev` watches editor sources and starts Next in next mode, or rebuilds browser/PHP assets in wordpress mode. `npm run build` produces the selected target plus the editor. Restart dev after changing mode. In WordPress mode open the WordPress URL, not the Next port.
|
|
10
10
|
|
|
11
11
|
Legacy sections and the project header/footer still need migration: the PHP shell renders saved header/footer data through the legacy layout bridge, while new sections use the generated blueprint. Other legacy sections still require migration.
|
|
12
12
|
|
|
@@ -4,7 +4,7 @@ const marker = (name: string) => Object.assign((_props: any) => null, {kitName:
|
|
|
4
4
|
export const Section = marker('Section'), Text = marker('Text'), Heading = marker('Heading'),
|
|
5
5
|
Paragraphs = marker('Paragraphs'), Image = marker('Image'), Icon = marker('Icon'),
|
|
6
6
|
Background = marker('Background'), Buttons = marker('Buttons'), SocialLinks = marker('SocialLinks'), Button = marker('Button'), Link = marker('Link'), List = marker('List'),
|
|
7
|
-
|
|
7
|
+
Form = marker('Form'), Records = marker('Records'), Categories = marker('Categories'), RecordEdit = marker('RecordEdit'), RecordImage = marker('RecordImage'),
|
|
8
8
|
RecordDate = marker('RecordDate'), RecordTitle = marker('RecordTitle'), RecordExcerpt = marker('RecordExcerpt'), RecordLink = marker('RecordLink'),
|
|
9
9
|
RecordIndex = marker('RecordIndex'), Drag = marker('Drag'), Cols = marker('Cols'), Toggle = marker('Toggle'),
|
|
10
10
|
Choice = marker('Choice'), Show = marker('Show'), Area = marker('Area'), Gallery = marker('Gallery'),
|
|
@@ -23,6 +23,10 @@ function describe(node: ReactNode): any[] {
|
|
|
23
23
|
// Stateful project components mount through the existing browser island.
|
|
24
24
|
// Preserve declarative children as the PHP fallback, without serializing callback props.
|
|
25
25
|
if (!type) return [{type: 'ClientComponent', props: {}, children: describe((child.props as any).children)}];
|
|
26
|
+
// A record render function needs the live collection and runs in the browser island.
|
|
27
|
+
if (type === 'Drag' && props.sync) return [{type:'ClientComponent',props:{},children:[]}];
|
|
28
|
+
if (type === 'Records' && typeof (sourceProps as any).children === 'function')
|
|
29
|
+
return [{type: 'ClientComponent', props: {}, children: []}];
|
|
26
30
|
if (type === 'Categories' && props.tab !== undefined) props.tab = describe(props.tab);
|
|
27
31
|
for (const [key, value] of Object.entries(props)) if (typeof value === 'function') throw new Error(`WordPress compiler: callback ${key} cannot be serialized`);
|
|
28
32
|
return [{type, props, children: describe((sourceProps as any).children)}];
|
|
@@ -36,3 +40,10 @@ export function section(meta: any, View: () => ReactNode) {
|
|
|
36
40
|
const isStatic = (nodes:any[]):boolean => nodes.every(node => (staticTypes.has(node.type) || /^[a-z]/.test(node.type)) && isStatic(node.children ?? []));
|
|
37
41
|
return {name: 'site/' + meta.slug, title: meta.title, template, static: isStatic(template)};
|
|
38
42
|
}
|
|
43
|
+
|
|
44
|
+
// Archive state is evaluated by the existing WordPress browser island, never during extraction.
|
|
45
|
+
export const Archive = marker('ClientComponent'), ArchiveFilters = marker('ClientComponent'),
|
|
46
|
+
ArchiveSortControl = marker('ClientComponent'), ArchiveSearch = marker('ClientComponent'),
|
|
47
|
+
ArchiveStatus = marker('ClientComponent'), ArchiveResults = marker('ClientComponent'),
|
|
48
|
+
ArchiveReset = marker('ClientComponent'), ArchivePagination = marker('ClientComponent');
|
|
49
|
+
export const useArchive = (): any => { throw new Error('Archive state is only available inside its runtime provider.'); };
|
|
@@ -11,6 +11,13 @@ function manifest(): array {
|
|
|
11
11
|
}
|
|
12
12
|
function definition(string $name): ?array {foreach(manifest()['sections'] as $section)if($section['name']===$name)return $section;return null;}
|
|
13
13
|
function classes(array $props): string {return trim(($props['className']??'').' '.($props['frontClassName']??''));}
|
|
14
|
+
function appearance_color($value): ?string {
|
|
15
|
+
if(!is_string($value))return null;
|
|
16
|
+
if(preg_match('/^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/iD',$value))return $value;
|
|
17
|
+
if(preg_match('/^[a-z][a-z0-9-]*$/D',$value))return 'var(--wp--preset--color--'.$value.')';
|
|
18
|
+
if(preg_match('/^var\(--wp--preset--color--[a-z][a-z0-9-]*\)$/D',$value))return $value;
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
14
21
|
function attrs(array $attributes): string {
|
|
15
22
|
$out='';foreach($attributes as $key=>$value){if($value===null||$value===false||str_starts_with($key,'on'))continue;$out.=' '.esc_attr($key).'="'.esc_attr($value===true?'':(string)$value).'"';}return $out;
|
|
16
23
|
}
|
|
@@ -58,11 +65,17 @@ function background_poster(string $url): string {
|
|
|
58
65
|
$id=attachment_url_to_postid($url);
|
|
59
66
|
return $id?(wp_get_attachment_image_url($id,'large')?:$url):$url;
|
|
60
67
|
}
|
|
68
|
+
function button_width_style($value): ?string {
|
|
69
|
+
if((!is_string($value)&&!is_int($value)&&!is_float($value))||!is_numeric($value))return null;
|
|
70
|
+
$width=(float)$value;if(!is_finite($width)||$width<=0||$width>100)return null;
|
|
71
|
+
$size='calc('.$width.'% - (1 - '.($width/100).') * var(--site-button-width-gap, 0px))';
|
|
72
|
+
return 'width:'.$size.';flex-basis:'.$size.';flex-grow:0;flex-shrink:0;max-width:100%';
|
|
73
|
+
}
|
|
61
74
|
function button(array $value,?string $fallback=null,array $site=[],string $extra_class='',bool $unstyled=false): string {
|
|
62
75
|
if(empty($value['text']))return '';
|
|
63
76
|
$url=$value['url']??'#';$id=(int)($value['modalId']??0);
|
|
64
77
|
if($id)foreach($site['modals']??[] as $modal)if($modal['id']===$id)$url='#modal-'.($modal['slug']??$id);
|
|
65
|
-
if(!empty($value['linkId']))$url
|
|
78
|
+
if(!empty($value['linkId'])){$url=\SiteTheme\public_record_url((int)$value['linkId']);if(!$url)return '';}
|
|
66
79
|
$style=$value['style']??$fallback;
|
|
67
80
|
$class=$unstyled?'site-link':match($style){'text'=>'site-text-link eyebrow !text-foreground transition-colors hover:!text-flame','accent'=>'btn-primary !bg-flame !text-flame-foreground hover:!opacity-90','outline'=>'btn-ghost','light-outline'=>'btn-ghost !border-background/40 hover:!bg-background hover:!text-foreground',default=>'btn-primary'};
|
|
68
81
|
$label=wp_kses_post($value['text']);$metadata=$value['metadata']??[];
|
|
@@ -70,7 +83,7 @@ function button(array $value,?string $fallback=null,array $site=[],string $extra
|
|
|
70
83
|
$mask='url("data:image/svg+xml,'.rawurlencode($icon['svg']).'")';
|
|
71
84
|
$label=tag('span',['class'=>'site-button-label site-button-icon-'.(($metadata['siteButtonIconPosition']??'')==='before'?'before':'after'),'style'=>'--site-button-icon:'.$mask],$label);break;
|
|
72
85
|
}
|
|
73
|
-
return tag('a',['href'=>esc_url($url),'class'=>trim($class.' '.$extra_class),'data-modal-plan'=>$value['plan']??null,'target'=>$value['linkTarget']??null,'rel'=>$value['rel']??null],$label);
|
|
86
|
+
return tag('a',['href'=>esc_url($url),'style'=>$unstyled?null:button_width_style($value['width']??null),'class'=>trim($class.' '.$extra_class),'data-modal-plan'=>$value['plan']??null,'target'=>$value['linkTarget']??null,'rel'=>$value['rel']??null],$label);
|
|
74
87
|
}
|
|
75
88
|
function social_links(array $links, string $class = '', string $style = 'text'): string {
|
|
76
89
|
$labels = ['instagram'=>'Instagram', 'facebook'=>'Facebook', 'telegram'=>'Telegram', 'youtube'=>'YouTube', 'tiktok'=>'TikTok', 'linkedin'=>'LinkedIn'];
|
|
@@ -208,19 +221,25 @@ function node(array $node,array $context): string {
|
|
|
208
221
|
if(!array_key_exists('icon',$settings))$icon='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="m6 9 6 6 6-6"></path></svg>';
|
|
209
222
|
elseif($settings['icon'])$icon=node(['type'=>'Icon','props'=>['name'=>'indicator']],array_replace($context,['data'=>['indicator'=>$settings['icon']]]));
|
|
210
223
|
return tag('summary',['class'=>$class],nodes($children,$context).($icon?tag('span',['data-disclosure-icon'=>true],$icon):''));
|
|
211
|
-
case 'Section':if(!empty($p['when'])&&empty($data[$p['when']]))return '';return tag('section',['id'=>$data['sectionId']??null,'class'=>$class,'data-site-section'=>$p['data-site-section']??null],nodes($children,$context));
|
|
212
|
-
case 'Text':
|
|
224
|
+
case 'Section':if(!empty($p['when'])&&empty($data[$p['when']]))return '';return tag('section',['id'=>$data['sectionId']??null,'class'=>$class,'data-site-section'=>$p['data-site-section']??null,'data-section-motion'=>!empty($p['motion'])?'reveal':null],nodes($children,$context));
|
|
225
|
+
case 'Text':
|
|
226
|
+
$settings=$data['__textStyles'][$p['name']??'']??[];$color=appearance_color($settings['color']??null);$style=$color?'color:'.$color:null;
|
|
227
|
+
$decoration=in_array($settings['decoration']??null,['none','line'],true)?$settings['decoration']:($p['decoration']??'none');
|
|
228
|
+
$text=tag('p',['class'=>$decoration==='line'?'min-w-0':$class,'style'=>$style],inline_rich_text((string)($value??''),$site));
|
|
229
|
+
if($decoration!=='line')return $text;
|
|
230
|
+
$line=appearance_color($settings['decorationColor']??null)??appearance_color($p['decorationColor']??null);
|
|
231
|
+
return tag('div',['class'=>trim('site-text-decoration flex items-start gap-4 '.$class),'style'=>$style],tag('span',['aria-hidden'=>'true','class'=>'mt-[.8em] h-px w-12 shrink-0 bg-current','style'=>$line?'background-color:'.$line:null],'').$text);
|
|
213
232
|
case 'Heading':
|
|
214
233
|
$valid_tag=static fn($v)=>is_string($v)&&preg_match('/^(?:h[1-6]|p|span)$/D',$v);$valid_style=static fn($v)=>is_string($v)&&preg_match('/^h[1-6]$/D',$v);$settings=$data['__headings'][$p['name']??'']??[];
|
|
215
234
|
$fallback=$valid_tag($p['tag']??null)?$p['tag']:($valid_style('h'.($p['level']??2))?'h'.($p['level']??2):'h2');
|
|
216
235
|
$heading_tag=$valid_tag($settings['tag']??null)?$settings['tag']:$fallback;
|
|
217
236
|
$heading_style=$valid_style($settings['textStyle']??null)?$settings['textStyle']:($valid_style($p['textStyle']??null)?$p['textStyle']:'');
|
|
218
|
-
return tag($heading_tag,['class'=>trim($heading_style.' '.$class)],
|
|
237
|
+
return tag($heading_tag,['class'=>trim($heading_style.' '.$class),'style'=>($color=appearance_color($data['__textStyles'][$p['name']??'']['color']??null))?'color:'.$color:null],inline_rich_text((string)($value??''),$site));
|
|
219
238
|
case 'Paragraphs':return tag('div',['class'=>'site-paragraph-flow '.$class],implode('',array_map(fn($v,$i)=>tag('div',['class'=>trim('site-description-row '.(is_array($v)&&($v['style']??'')==='accent-line'?'is-style-studio-accent-line ':'').($i?($p['paragraphClassName']??''):''))],tag('p',[],wp_kses_post(is_array($v)?($v['text']??''):$v))),is_array($value)?$value:[],array_keys(is_array($value)?$value:[]))));
|
|
220
239
|
case 'Image':return image($value,$class);
|
|
221
240
|
case 'Icon':
|
|
222
241
|
if(!$value)return '';$name=is_string($value)?$value:($value['type']??'');
|
|
223
|
-
foreach($site['icons']??[] as $icon){if(($icon['value']??'')===$name){$mask='url("data:image/svg+xml,'.rawurlencode($icon['svg']).'")';return tag('span',['class'=>trim('inline-flex shrink-0 leading-none text-flame '.$class),'aria-hidden'=>'true'],tag('span',['style'=>'display:inline-block;width:.9em;height:.9em;background-color:currentColor;mask:'.$mask.' center/contain no-repeat;-webkit-mask:'.$mask.' center/contain no-repeat']));}}return '';
|
|
242
|
+
foreach($site['icons']??[] as $icon){if(($icon['value']??'')===$name){$mask='url("data:image/svg+xml,'.rawurlencode($icon['svg']).'")';return tag('span',['class'=>trim('inline-flex shrink-0 leading-none text-flame '.$class),'aria-hidden'=>'true','style'=>($color=appearance_color($data['__iconColors'][$p['name']??'']??null))?'color:'.$color:null],tag('span',['style'=>'display:inline-block;width:.9em;height:.9em;background-color:currentColor;mask:'.$mask.' center/contain no-repeat;-webkit-mask:'.$mask.' center/contain no-repeat']));}}return '';
|
|
224
243
|
case 'Choice':case 'RecordEdit':return '';
|
|
225
244
|
case 'Toggle':return ($value??($p['default']??false))?classed_content($class,nodes($children,$context)):'';
|
|
226
245
|
case 'Show':
|
|
@@ -252,10 +271,8 @@ function node(array $node,array $context): string {
|
|
|
252
271
|
case 'RecordContent':$blocks=$record[$p['field']??'']??[];return is_array($blocks)&&$blocks?classed_content($class,native_blocks($blocks,$context)):'';
|
|
253
272
|
case 'RecordText':$text=$record[$p['field']??'']??'';return $text?tag(in_array($p['as']??'p',['p','span','div','blockquote'],true)?($p['as']??'p'):'p',['class'=>$class],wp_kses_post((string)$text)):'';
|
|
254
273
|
case 'Gallery':$html='';foreach(is_array($value)?$value:[] as $row)$html.=image($row,'w-full h-full object-cover');return tag('div',['class'=>$class],$html);
|
|
255
|
-
case 'PricingPlans':return pricing_plans(is_array($value)?$value:null,$site,$class);
|
|
256
274
|
// The form is interactive and mounts in the browser.
|
|
257
275
|
case 'Form':return tag('div',['class'=>$class],'');
|
|
258
|
-
case 'ReviewsCarousel':return reviews_carousel(is_array($value)?$value:null,$site,$class);
|
|
259
276
|
case 'Categories':case 'Records':
|
|
260
277
|
$rows=relationship_rows($value,$p,$site,$data,$context['category']??null,$type==='Categories');
|
|
261
278
|
if($type==='Categories'&&($p['mode']??'list')==='tabs'){
|
|
@@ -306,3 +323,5 @@ function node(array $node,array $context): string {
|
|
|
306
323
|
default:throw new \RuntimeException('Unsupported kit node: '.$type);
|
|
307
324
|
}
|
|
308
325
|
}
|
|
326
|
+
|
|
327
|
+
function inline_rich_text(string $html,array $site):string { $html=wp_kses_post($html);return function_exists('SpIcons\\inline_icons')?\SpIcons\inline_icons($html,$site['icons']??null):$html; }
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {mountSectionMotion} from '../../core/ui/section-motion.js';
|
|
1
2
|
import {enhanceStaticMedia} from './static-media.js';
|
|
2
3
|
import {Component, useEffect, useLayoutEffect, useState, type ReactNode} from 'react';
|
|
3
4
|
import {createRoot} from 'react-dom/client';
|
|
@@ -42,7 +43,7 @@ class FallbackBoundary extends Component<{ children: ReactNode }, { failed: bool
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
/** Keep the already functional PHP header until a visitor interacts with navigation. */
|
|
45
|
-
function InteractiveHeader({target,site}:{target:HTMLElement;site:any}) {
|
|
46
|
+
function InteractiveHeader({target,site,record}:{target:HTMLElement;site:any;record:any}) {
|
|
46
47
|
const [active,setActive]=useState(false);
|
|
47
48
|
useEffect(()=>{
|
|
48
49
|
const enable=()=>{
|
|
@@ -58,18 +59,23 @@ function InteractiveHeader({target,site}:{target:HTMLElement;site:any}) {
|
|
|
58
59
|
target.addEventListener('keyup',click,{once:true});
|
|
59
60
|
return ()=>{target.removeEventListener('click',click);target.removeEventListener('pointerover',hover);target.removeEventListener('keyup',click);};
|
|
60
61
|
},[target,site]);
|
|
61
|
-
return active?<Island target={target}><BlockList blocks={site.header} site={site}/></Island>:null;
|
|
62
|
+
return active?<Island target={target}><BlockList blocks={site.header} site={site} record={record}/></Island>:null;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
/** PHP owns crawlable HTML; browser React provides shared interactions. */
|
|
65
66
|
const payload = document.getElementById('site-wordpress-data');
|
|
66
67
|
if (payload) {
|
|
67
|
-
const {site, instances} = JSON.parse(payload.textContent ?? '{}');
|
|
68
|
+
const {site, instances, record} = JSON.parse(payload.textContent ?? '{}');
|
|
68
69
|
site.runtime.retainedHeaderLogo = document.querySelector('#site-header-root header img');
|
|
69
70
|
const root = document.createElement('div');
|
|
70
71
|
root.id = 'site-wordpress-runtime';
|
|
71
72
|
document.body.append(root);
|
|
72
73
|
enhanceStaticMedia();
|
|
74
|
+
// React islands own their Section effects; enhance only HTML retained from PHP.
|
|
75
|
+
for (const instance of instances) {
|
|
76
|
+
if (!instance.static) continue;
|
|
77
|
+
document.getElementById(instance.id)?.querySelectorAll<HTMLElement>('section[data-section-motion="reveal"]').forEach(section => mountSectionMotion(section));
|
|
78
|
+
}
|
|
73
79
|
const islands = instances.flatMap((instance: any) => {
|
|
74
80
|
if (instance.static) return [];
|
|
75
81
|
const target = document.getElementById(instance.id);
|
|
@@ -78,19 +84,19 @@ if (payload) {
|
|
|
78
84
|
const View = definition.View;
|
|
79
85
|
return [<FallbackBoundary key={instance.id}><Island target={target}>
|
|
80
86
|
<ContentProvider data={mediaValues(instance.block.attrs.data ?? {}, site.media)}
|
|
81
|
-
innerBlocks={instance.block.innerBlocks ?? []} site={site}><View
|
|
87
|
+
innerBlocks={instance.block.innerBlocks ?? []} site={site} record={record}><View
|
|
82
88
|
data={mediaValues(instance.block.attrs.data ?? {}, site.media)}
|
|
83
|
-
blocks={instance.block.innerBlocks ?? []} site={site}/></ContentProvider>
|
|
89
|
+
blocks={instance.block.innerBlocks ?? []} site={site} record={record}/></ContentProvider>
|
|
84
90
|
</Island></FallbackBoundary>];
|
|
85
91
|
});
|
|
86
92
|
for (const part of ['header', 'footer'] as const) {
|
|
87
93
|
const target = document.getElementById(`site-${part}-root`);
|
|
88
94
|
if (target && site[part]?.length) islands.push(
|
|
89
|
-
<FallbackBoundary key={part}>{part==='header'?<InteractiveHeader target={target} site={site}/>:<Island target={target}><BlockList blocks={site[part]}
|
|
90
|
-
site={site}/></Island>}</FallbackBoundary>
|
|
95
|
+
<FallbackBoundary key={part}>{part==='header'?<InteractiveHeader target={target} site={site} record={record}/>:<Island target={target}><BlockList blocks={site[part]}
|
|
96
|
+
site={site} record={record}/></Island>}</FallbackBoundary>
|
|
91
97
|
);
|
|
92
98
|
}
|
|
93
|
-
createRoot(root).render(<SiteShell site={site} chrome={false}>{islands}</SiteShell>);
|
|
99
|
+
createRoot(root).render(<SiteShell site={site} record={record} chrome={false}>{islands}</SiteShell>);
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
}
|
package/admin-ui/controls.js
CHANGED
|
@@ -8,7 +8,7 @@ export function enhanceControls(root) {
|
|
|
8
8
|
const withMinutes = isTime && Number(source.step) !== 3600;
|
|
9
9
|
const wrap = document.createElement('div'); wrap.className = 'sp-ui-select';
|
|
10
10
|
const trigger = document.createElement('button'); trigger.type = 'button'; trigger.className = 'sp-ui-select-trigger';
|
|
11
|
-
const label = source.closest('label')?.querySelector('span')?.textContent || source.getAttribute('aria-label') || '
|
|
11
|
+
const label = source.closest('label')?.querySelector('span')?.textContent || source.getAttribute('aria-label') || 'Select a value';
|
|
12
12
|
const list = document.createElement('div'); list.className = 'sp-ui-select-options'; list.setAttribute('popover','auto'); list.setAttribute('role','listbox'); list.setAttribute('aria-label',label);
|
|
13
13
|
list.id = `site-control-${++enhanceControls.counter}`;
|
|
14
14
|
trigger.setAttribute('aria-haspopup','listbox'); trigger.setAttribute('aria-expanded','false'); trigger.setAttribute('aria-controls',list.id);
|
|
@@ -16,10 +16,10 @@ export function enhanceControls(root) {
|
|
|
16
16
|
let editor;
|
|
17
17
|
if (isTime) {
|
|
18
18
|
// Preserve typed HH:MM input; minute-enabled fields also expose separate hour/minute columns.
|
|
19
|
-
source.type = 'text'; source.inputMode = 'numeric'; source.placeholder = '
|
|
19
|
+
source.type = 'text'; source.inputMode = 'numeric'; source.placeholder = 'HH:MM'; source.maxLength = 5;
|
|
20
20
|
source.pattern = Number(source.step) === 3600 ? '(?:[01][0-9]|2[0-3]):00' : '(?:[01][0-9]|2[0-3]):[0-5][0-9]';
|
|
21
21
|
wrap.classList.add('sp-ui-time'); editor = source;
|
|
22
|
-
trigger.setAttribute('aria-label',`${label}:
|
|
22
|
+
trigger.setAttribute('aria-label',`${label}: choose time`);
|
|
23
23
|
} else {
|
|
24
24
|
source.hidden = true;
|
|
25
25
|
// The trigger receives the original label association, while the named select submits data.
|
|
@@ -29,7 +29,7 @@ export function enhanceControls(root) {
|
|
|
29
29
|
const values = () => isTime ? Array.from({length:24},(_,hour)=>({value:`${String(hour).padStart(2,'0')}:00`,label:`${String(hour).padStart(2,'0')}:00`,disabled:false})) : Array.from(source.options,option=>({value:option.value,label:option.text,disabled:option.disabled}));
|
|
30
30
|
const place = trackPopover(list,wrap,withMinutes?280:null,withMinutes?340:(isTime?300:260));
|
|
31
31
|
const sync = () => {
|
|
32
|
-
if (!isTime) trigger.textContent = source.selectedOptions[0]?.text || '
|
|
32
|
+
if (!isTime) trigger.textContent = source.selectedOptions[0]?.text || 'Select';
|
|
33
33
|
else trigger.textContent = '◷';
|
|
34
34
|
trigger.disabled = source.disabled;
|
|
35
35
|
list.querySelectorAll('[role=option]').forEach(option=>{
|
|
@@ -44,7 +44,7 @@ export function enhanceControls(root) {
|
|
|
44
44
|
if (withMinutes) {
|
|
45
45
|
list.classList.add('sp-ui-time-options');list.setAttribute('role','dialog');
|
|
46
46
|
const columns=document.createElement('div');columns.className='sp-ui-time-columns';
|
|
47
|
-
[['hours','
|
|
47
|
+
[['hours','Hours',24],['minutes','Minutes',60]].forEach(([part,title,count])=>{
|
|
48
48
|
const column=document.createElement('div');column.className='sp-ui-time-column';
|
|
49
49
|
const heading=document.createElement('span');heading.textContent=title;column.append(heading);
|
|
50
50
|
const options=document.createElement('div');options.setAttribute('role','listbox');options.setAttribute('aria-label',title);
|
|
@@ -54,7 +54,7 @@ export function enhanceControls(root) {
|
|
|
54
54
|
}
|
|
55
55
|
column.append(options);columns.append(column);
|
|
56
56
|
});
|
|
57
|
-
const done=document.createElement('button');done.type='button';done.className='sp-ui-time-done';done.textContent='
|
|
57
|
+
const done=document.createElement('button');done.type='button';done.className='sp-ui-time-done';done.textContent='Done';done.addEventListener('click',()=>{close();source.focus();});
|
|
58
58
|
list.append(columns,done);sync();
|
|
59
59
|
} else values().forEach(value=>{
|
|
60
60
|
const option=document.createElement('button'); option.type='button'; option.setAttribute('role','option'); option.tabIndex=-1; option.textContent=value.label; option.dataset.value=value.value; option.disabled=value.disabled;
|
|
@@ -65,7 +65,7 @@ export function enhanceControls(root) {
|
|
|
65
65
|
if(isTime && !withMinutes) {
|
|
66
66
|
const options=document.createElement('div');options.className='sp-ui-hour-values';options.setAttribute('role','listbox');options.setAttribute('aria-label',label);
|
|
67
67
|
options.append(...list.childNodes);list.append(options);list.setAttribute('role','dialog');list.classList.add('sp-ui-hour-options');
|
|
68
|
-
const done=document.createElement('button');done.type='button';done.className='sp-ui-time-done';done.textContent='
|
|
68
|
+
const done=document.createElement('button');done.type='button';done.className='sp-ui-time-done';done.textContent='Done';done.addEventListener('click',()=>{close();source.focus();});list.append(done);sync();
|
|
69
69
|
}
|
|
70
70
|
place();
|
|
71
71
|
list.showPopover();
|
|
@@ -99,7 +99,7 @@ enhanceControls.counter = 0;
|
|
|
99
99
|
|
|
100
100
|
function enhanceDate(source) {
|
|
101
101
|
source.dataset.spEnhanced='true';
|
|
102
|
-
const label=source.closest('label')?.querySelector('span')?.textContent || '
|
|
102
|
+
const label=source.closest('label')?.querySelector('span')?.textContent || 'Date';
|
|
103
103
|
const required=source.required;
|
|
104
104
|
const wrap=document.createElement('div');wrap.className='sp-ui-select sp-ui-date';
|
|
105
105
|
const trigger=document.createElement('button');trigger.type='button';trigger.className='sp-ui-select-trigger';trigger.setAttribute('aria-haspopup','dialog');trigger.setAttribute('aria-expanded','false');trigger.setAttribute('aria-label',label);
|
|
@@ -112,7 +112,7 @@ function enhanceDate(source) {
|
|
|
112
112
|
const parse=value=>{const [y,m,d]=value.split('-').map(Number);return new Date(Date.UTC(y,m-1,d));};
|
|
113
113
|
const iso=date=>date.toISOString().slice(0,10);
|
|
114
114
|
let visible=parse(source.value || todayIso);
|
|
115
|
-
const sync=()=>{trigger.textContent=source.value?source.value.split('-').reverse().join('.'):'
|
|
115
|
+
const sync=()=>{trigger.textContent=source.value?source.value.split('-').reverse().join('.'):'Select date';trigger.disabled=source.disabled;};
|
|
116
116
|
const place=trackPopover(popup,wrap,304,380);
|
|
117
117
|
const close=()=>{if(popup.matches(':popover-open'))popup.hidePopover();};
|
|
118
118
|
const choose=value=>{source.value=value;source.dispatchEvent(new Event('input',{bubbles:true}));source.dispatchEvent(new Event('change',{bubbles:true}));close();trigger.focus();};
|
|
@@ -120,15 +120,15 @@ function enhanceDate(source) {
|
|
|
120
120
|
const render=(focusDate=null)=>{
|
|
121
121
|
popup.replaceChildren();
|
|
122
122
|
const header=document.createElement('div');header.className='sp-ui-date-header';
|
|
123
|
-
const title=document.createElement('strong');title.textContent=new Intl.DateTimeFormat('
|
|
123
|
+
const title=document.createElement('strong');title.textContent=new Intl.DateTimeFormat('en-GB',{month:'long',year:'numeric',timeZone:'UTC'}).format(visible);title.setAttribute('aria-live','polite');
|
|
124
124
|
const changeMonth=delta=>{visible=new Date(Date.UTC(visible.getUTCFullYear(),visible.getUTCMonth()+delta,1));render(true);};
|
|
125
|
-
header.append(button('
|
|
126
|
-
const weekdays=document.createElement('div');weekdays.className='sp-ui-date-grid sp-ui-date-weekdays';['
|
|
127
|
-
const grid=document.createElement('div');grid.className='sp-ui-date-grid';grid.setAttribute('role','group');grid.setAttribute('aria-label','
|
|
125
|
+
header.append(button('Previous month','‹',()=>changeMonth(-1)),title,button('Next month','›',()=>changeMonth(1)));popup.append(header);
|
|
126
|
+
const weekdays=document.createElement('div');weekdays.className='sp-ui-date-grid sp-ui-date-weekdays';['Mon','Tue','Wed','Thu','Fri','Sat','Sun'].forEach(day=>{const el=document.createElement('span');el.textContent=day;weekdays.append(el);});popup.append(weekdays);
|
|
127
|
+
const grid=document.createElement('div');grid.className='sp-ui-date-grid';grid.setAttribute('role','group');grid.setAttribute('aria-label','Days of the month');
|
|
128
128
|
const first=new Date(Date.UTC(visible.getUTCFullYear(),visible.getUTCMonth(),1));const offset=(first.getUTCDay()+6)%7;
|
|
129
129
|
for(let i=0;i<42;i++) {
|
|
130
130
|
const date=new Date(first);date.setUTCDate(1-offset+i);const value=iso(date);
|
|
131
|
-
const day=button(new Intl.DateTimeFormat('
|
|
131
|
+
const day=button(new Intl.DateTimeFormat('en-GB',{day:'numeric',month:'long',year:'numeric',timeZone:'UTC'}).format(date),String(date.getUTCDate()),()=>choose(value));day.dataset.date=value;
|
|
132
132
|
if(date.getUTCMonth()!==visible.getUTCMonth())day.classList.add('sp-ui-date-outside');
|
|
133
133
|
if(value===source.value){day.classList.add('is-selected');day.setAttribute('aria-pressed','true');}
|
|
134
134
|
if(value===todayIso)day.setAttribute('aria-current','date');
|
|
@@ -141,7 +141,7 @@ function enhanceDate(source) {
|
|
|
141
141
|
});grid.append(day);
|
|
142
142
|
}
|
|
143
143
|
popup.append(grid);
|
|
144
|
-
const footer=document.createElement('div');footer.className='sp-ui-date-footer';footer.append(button('
|
|
144
|
+
const footer=document.createElement('div');footer.className='sp-ui-date-footer';footer.append(button('Select today','Today',()=>choose(todayIso)));if(!required)footer.append(button('Clear date','Clear',()=>choose('')));popup.append(footer);
|
|
145
145
|
const focused=focusDate===true?iso(first):(focusDate || source.value || todayIso);
|
|
146
146
|
const target=Array.from(grid.querySelectorAll('button')).find(el=>el.dataset.date===focused && !el.disabled) || grid.querySelector('button:not(:disabled)');
|
|
147
147
|
if(target){target.tabIndex=0;if(popup.matches(':popover-open'))target.focus({preventScroll:true});}
|
package/admin-ui/editor.css
CHANGED
|
@@ -297,10 +297,9 @@
|
|
|
297
297
|
/* Small contextual controls keep their own compact scale. */
|
|
298
298
|
.sp-media-control {
|
|
299
299
|
--sp-media-border: var(--sp-ui-border);
|
|
300
|
-
border-radius: var(--sp-ui-radius);
|
|
301
300
|
color: var(--sp-ui-ink);
|
|
302
|
-
background:
|
|
303
|
-
box-shadow:
|
|
301
|
+
background: transparent;
|
|
302
|
+
box-shadow: none;
|
|
304
303
|
}
|
|
305
304
|
.sp-media-control .sp-media-tabs {
|
|
306
305
|
background: #f0f0f0;
|
|
@@ -614,7 +613,8 @@
|
|
|
614
613
|
font: 500 11px/1.4 system-ui, sans-serif;
|
|
615
614
|
color: #1e1e1e;
|
|
616
615
|
}
|
|
617
|
-
.site-field-rich-control > span
|
|
616
|
+
.site-field-rich-control > span,
|
|
617
|
+
.site-field-control-heading > span {
|
|
618
618
|
text-transform: uppercase;
|
|
619
619
|
}
|
|
620
620
|
.site-field-rich-control > .block-editor-rich-text__editable {
|
|
@@ -787,3 +787,20 @@
|
|
|
787
787
|
.site-collection-add:only-child{min-height:max(80px,var(--site-collection-add-height,0px));}
|
|
788
788
|
.site-collection-add>.site-record-add-shape{pointer-events:none;overflow:hidden;}
|
|
789
789
|
.site-collection-add>.site-record-add-shape>*{max-width:100%;}
|
|
790
|
+
|
|
791
|
+
/* Archive inspector lives outside the canvas: keep its spacing in the editor stylesheet. */
|
|
792
|
+
.site-archive-settings .site-collection-display-title{margin-top:0}
|
|
793
|
+
.site-archive-settings .site-list-display-settings{margin-bottom:20px}
|
|
794
|
+
.site-archive-filter-settings{display:grid;gap:20px;margin-bottom:20px}
|
|
795
|
+
.site-archive-filter-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
|
|
796
|
+
.site-archive-filter-heading .components-base-control{margin-bottom:0}
|
|
797
|
+
.site-archive-filter-options{display:grid;gap:16px;padding-top:16px}
|
|
798
|
+
.site-archive-filter-options>.components-base-control{margin:0}
|
|
799
|
+
.site-archive-record-actions{display:flex;flex-shrink:0;align-items:center}
|
|
800
|
+
.site-archive-record-actions .components-button{padding:6px;height:30px;min-width:30px}
|
|
801
|
+
.site-archive-text-settings{display:grid;gap:20px}
|
|
802
|
+
.site-archive-text-settings>.components-base-control{margin:0}
|
|
803
|
+
.site-archive-settings .site-relationship{margin-top:20px}
|
|
804
|
+
|
|
805
|
+
.site-archive-settings .site-select-control { margin-bottom:20px; }
|
|
806
|
+
.site-archive-filter-options > .site-select-control { margin:0; }
|
package/admin-ui/viewport.tsx
CHANGED
|
@@ -16,6 +16,7 @@ const breakpoints = (Object.entries(BREAKPOINTS) as [string, number][]).filter((
|
|
|
16
16
|
export const editorBreakpoints = breakpoints.map(([name]) => name);
|
|
17
17
|
let selected: string | null = null;
|
|
18
18
|
let canvasWidth = 0;
|
|
19
|
+
let defaultLayout = false;
|
|
19
20
|
const listeners = new Set<() => void>();
|
|
20
21
|
const emit = () => listeners.forEach(listener => listener());
|
|
21
22
|
const subscribe = (listener: () => void) => { listeners.add(listener); return () => { listeners.delete(listener); }; };
|
|
@@ -25,6 +26,19 @@ export function useViewport() {
|
|
|
25
26
|
return useSyncExternalStore(subscribe, () => selected, () => null);
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
/** Explicit base-layout editing is separate from the responsive fit-window preview. */
|
|
30
|
+
export function useDefaultLayout() {
|
|
31
|
+
return useSyncExternalStore(subscribe, () => defaultLayout, () => false);
|
|
32
|
+
}
|
|
33
|
+
export function setDefaultLayout() {
|
|
34
|
+
preserveViewportAnchor();
|
|
35
|
+
selected = null;
|
|
36
|
+
defaultLayout = true;
|
|
37
|
+
if (wp.data.select('core/editor').getDeviceType() !== 'Desktop') wp.data.dispatch('core/editor').setDeviceType('Desktop');
|
|
38
|
+
syncCanvas();
|
|
39
|
+
emit();
|
|
40
|
+
}
|
|
41
|
+
|
|
28
42
|
/** Width of the editor canvas document, which is what the site's media queries see. */
|
|
29
43
|
export function useCanvasWidth() {
|
|
30
44
|
return useSyncExternalStore(subscribe, () => canvasWidth, () => 0);
|
|
@@ -70,7 +84,7 @@ function canvasBox() {
|
|
|
70
84
|
}
|
|
71
85
|
function syncCanvas() {
|
|
72
86
|
let style = document.getElementById('site-viewport-zoom');
|
|
73
|
-
const width = selected ? BREAKPOINTS[selected as keyof typeof BREAKPOINTS] : 0;
|
|
87
|
+
const width = defaultLayout ? breakpoints.at(-1)?.[1] ?? 0 : selected ? BREAKPOINTS[selected as keyof typeof BREAKPOINTS] : 0;
|
|
74
88
|
const container = canvasBox()?.parentElement;
|
|
75
89
|
if (!width || !container) return style?.remove();
|
|
76
90
|
const view = getComputedStyle(container);
|
|
@@ -146,6 +160,7 @@ export function setViewport(name: string | null) {
|
|
|
146
160
|
if (name && !(name in BREAKPOINTS)) return;
|
|
147
161
|
preserveViewportAnchor();
|
|
148
162
|
selected = name;
|
|
163
|
+
defaultLayout = false;
|
|
149
164
|
// Gutenberg's own device preview would size the canvas again.
|
|
150
165
|
if (name && wp.data.select('core/editor').getDeviceType() !== 'Desktop') wp.data.dispatch('core/editor').setDeviceType('Desktop');
|
|
151
166
|
syncCanvas();
|
|
@@ -154,6 +169,7 @@ export function setViewport(name: string | null) {
|
|
|
154
169
|
|
|
155
170
|
function ViewportBar() {
|
|
156
171
|
const current = useViewport();
|
|
172
|
+
const baseLayout = useDefaultLayout();
|
|
157
173
|
const [host, setHost] = useState<HTMLElement | null>(null);
|
|
158
174
|
useEffect(() => {
|
|
159
175
|
const attach = () => {
|
|
@@ -194,8 +210,9 @@ function ViewportBar() {
|
|
|
194
210
|
if (container) resize.observe(container);
|
|
195
211
|
// A device picked in Gutenberg's own menu replaces the breakpoint.
|
|
196
212
|
const unsubscribe = wp.data.subscribe(() => {
|
|
197
|
-
if (selected && wp.data.select('core/editor').getDeviceType() !== 'Desktop') {
|
|
213
|
+
if ((selected || defaultLayout) && wp.data.select('core/editor').getDeviceType() !== 'Desktop') {
|
|
198
214
|
selected = null;
|
|
215
|
+
defaultLayout = false;
|
|
199
216
|
syncCanvas();
|
|
200
217
|
emit();
|
|
201
218
|
}
|
|
@@ -206,6 +223,7 @@ function ViewportBar() {
|
|
|
206
223
|
const { Button } = wp.components;
|
|
207
224
|
return createPortal(
|
|
208
225
|
<div className="site-viewport-bar" role="group" aria-label="Site breakpoints">
|
|
226
|
+
<Button size="compact" icon={<BreakpointIcon value={1360} />} label="Fit window" showTooltip isPressed={!current && !baseLayout} onClick={() => setViewport(null)} />
|
|
209
227
|
{breakpoints.map(([name, width]) => (
|
|
210
228
|
<Button key={name} size="compact" icon={<BreakpointIcon value={width} />} label={`${breakpointLabel(name)} · ${breakpointRange(name)}${current === name ? ' · click again to fit the window' : ''}`} showTooltip isPressed={current === name} onClick={() => setViewport(current === name ? null : name)} />
|
|
211
229
|
))}
|