@puckeditor/cli 0.24.0-canary.301a0304
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/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/bin.mjs +7304 -0
- package/dist/docs/api-reference/actions.md +63 -0
- package/dist/docs/api-reference/components/action-bar-action.md +35 -0
- package/dist/docs/api-reference/components/action-bar-group.md +24 -0
- package/dist/docs/api-reference/components/action-bar-label.md +25 -0
- package/dist/docs/api-reference/components/action-bar-separator.md +16 -0
- package/dist/docs/api-reference/components/action-bar.md +32 -0
- package/dist/docs/api-reference/components/auto-field.md +63 -0
- package/dist/docs/api-reference/components/drawer-item.md +75 -0
- package/dist/docs/api-reference/components/drawer.md +29 -0
- package/dist/docs/api-reference/components/drop-zone.md +232 -0
- package/dist/docs/api-reference/components/field-label.md +138 -0
- package/dist/docs/api-reference/components/inline-text-field.md +77 -0
- package/dist/docs/api-reference/components/puck-components.md +19 -0
- package/dist/docs/api-reference/components/puck-fields.md +39 -0
- package/dist/docs/api-reference/components/puck-layout.md +27 -0
- package/dist/docs/api-reference/components/puck-outline.md +19 -0
- package/dist/docs/api-reference/components/puck-preview.md +39 -0
- package/dist/docs/api-reference/components/puck.md +561 -0
- package/dist/docs/api-reference/components/render.md +94 -0
- package/dist/docs/api-reference/components/rich-text-menu-control.md +87 -0
- package/dist/docs/api-reference/components/rich-text-menu-group.md +27 -0
- package/dist/docs/api-reference/components/rich-text-menu.md +99 -0
- package/dist/docs/api-reference/components.md +32 -0
- package/dist/docs/api-reference/configuration/component-config.md +569 -0
- package/dist/docs/api-reference/configuration/config.md +108 -0
- package/dist/docs/api-reference/configuration.md +4 -0
- package/dist/docs/api-reference/data-model/app-state.md +168 -0
- package/dist/docs/api-reference/data-model/component-data.md +62 -0
- package/dist/docs/api-reference/data-model/data.md +95 -0
- package/dist/docs/api-reference/data-model/item-selector.md +34 -0
- package/dist/docs/api-reference/data-model/root-data.md +59 -0
- package/dist/docs/api-reference/data-model.md +8 -0
- package/dist/docs/api-reference/dictionary.md +172 -0
- package/dist/docs/api-reference/field-transforms.md +51 -0
- package/dist/docs/api-reference/fields/array.md +211 -0
- package/dist/docs/api-reference/fields/base.md +96 -0
- package/dist/docs/api-reference/fields/custom.md +193 -0
- package/dist/docs/api-reference/fields/external.md +413 -0
- package/dist/docs/api-reference/fields/number.md +132 -0
- package/dist/docs/api-reference/fields/object.md +78 -0
- package/dist/docs/api-reference/fields/radio.md +82 -0
- package/dist/docs/api-reference/fields/richtext.md +422 -0
- package/dist/docs/api-reference/fields/select.md +79 -0
- package/dist/docs/api-reference/fields/slot.md +302 -0
- package/dist/docs/api-reference/fields/text.md +93 -0
- package/dist/docs/api-reference/fields/textarea.md +93 -0
- package/dist/docs/api-reference/fields.md +16 -0
- package/dist/docs/api-reference/functions/migrate.md +204 -0
- package/dist/docs/api-reference/functions/register-overlay-portal.md +45 -0
- package/dist/docs/api-reference/functions/resolve-all-data.md +27 -0
- package/dist/docs/api-reference/functions/set-deep.md +55 -0
- package/dist/docs/api-reference/functions/transform-props.md +51 -0
- package/dist/docs/api-reference/functions/use-get-puck.md +24 -0
- package/dist/docs/api-reference/functions/use-puck.md +43 -0
- package/dist/docs/api-reference/functions/walk-tree.md +88 -0
- package/dist/docs/api-reference/functions.md +8 -0
- package/dist/docs/api-reference/overrides/action-bar.md +35 -0
- package/dist/docs/api-reference/overrides/component-overlay.md +41 -0
- package/dist/docs/api-reference/overrides/drawer-item.md +24 -0
- package/dist/docs/api-reference/overrides/drawer.md +19 -0
- package/dist/docs/api-reference/overrides/field-label.md +18 -0
- package/dist/docs/api-reference/overrides/field-types.md +51 -0
- package/dist/docs/api-reference/overrides/fields.md +19 -0
- package/dist/docs/api-reference/overrides/header-actions.md +24 -0
- package/dist/docs/api-reference/overrides/header.md +29 -0
- package/dist/docs/api-reference/overrides/iframe.md +32 -0
- package/dist/docs/api-reference/overrides/outline.md +19 -0
- package/dist/docs/api-reference/overrides/preview.md +19 -0
- package/dist/docs/api-reference/overrides/puck.md +19 -0
- package/dist/docs/api-reference/overrides.md +28 -0
- package/dist/docs/api-reference/permissions.md +55 -0
- package/dist/docs/api-reference/plugin.md +112 -0
- package/dist/docs/api-reference/plugins/blocks-plugin.md +57 -0
- package/dist/docs/api-reference/plugins/fields-plugin.md +68 -0
- package/dist/docs/api-reference/plugins/legacy-side-bar-plugin.md +54 -0
- package/dist/docs/api-reference/plugins/outline-plugin.md +57 -0
- package/dist/docs/api-reference/puck-api.md +278 -0
- package/dist/docs/api-reference/theming/action-bar.md +32 -0
- package/dist/docs/api-reference/theming/button.md +65 -0
- package/dist/docs/api-reference/theming/canvas.md +20 -0
- package/dist/docs/api-reference/theming/computed-values.md +194 -0
- package/dist/docs/api-reference/theming/drawer.md +34 -0
- package/dist/docs/api-reference/theming/fields.md +70 -0
- package/dist/docs/api-reference/theming/global.md +127 -0
- package/dist/docs/api-reference/theming/header.md +19 -0
- package/dist/docs/api-reference/theming/icon-button.md +28 -0
- package/dist/docs/api-reference/theming/outline.md +35 -0
- package/dist/docs/api-reference/theming/plugin-bar.md +24 -0
- package/dist/docs/api-reference/theming/sidebar.md +19 -0
- package/dist/docs/api-reference/theming/slot.md +27 -0
- package/dist/docs/cli.md +201 -0
- package/dist/docs/extending-puck/composition.md +54 -0
- package/dist/docs/extending-puck/custom-fields.md +133 -0
- package/dist/docs/extending-puck/field-transforms.md +89 -0
- package/dist/docs/extending-puck/internal-puck-api.md +96 -0
- package/dist/docs/extending-puck/plugins.md +159 -0
- package/dist/docs/extending-puck/theming.md +88 -0
- package/dist/docs/extending-puck/ui-overrides.md +134 -0
- package/dist/docs/getting-started.md +68 -0
- package/dist/docs/guides/migrations/dropzones-to-slots.md +138 -0
- package/dist/docs/index.json +466 -0
- package/dist/docs/index.md +37 -0
- package/dist/docs/integrating-puck/categories.md +92 -0
- package/dist/docs/integrating-puck/component-configuration.md +159 -0
- package/dist/docs/integrating-puck/data-migration.md +86 -0
- package/dist/docs/integrating-puck/dynamic-fields.md +86 -0
- package/dist/docs/integrating-puck/dynamic-props.md +137 -0
- package/dist/docs/integrating-puck/external-data-sources.md +149 -0
- package/dist/docs/integrating-puck/feature-toggling.md +121 -0
- package/dist/docs/integrating-puck/localization.md +228 -0
- package/dist/docs/integrating-puck/multi-column-layouts.md +226 -0
- package/dist/docs/integrating-puck/overlay-portals.md +25 -0
- package/dist/docs/integrating-puck/rich-text-editing.md +230 -0
- package/dist/docs/integrating-puck/root-configuration.md +171 -0
- package/dist/docs/integrating-puck/server-components.md +199 -0
- package/dist/docs/integrating-puck/styling.md +117 -0
- package/dist/docs/integrating-puck/viewports.md +75 -0
- package/dist/templates/astro/README.md +52 -0
- package/dist/templates/astro/_gitignore +24 -0
- package/dist/templates/astro/astro.config.mjs +14 -0
- package/dist/templates/astro/database.json +1 -0
- package/dist/templates/astro/package.json +25 -0
- package/dist/templates/astro/public/favicon.svg +9 -0
- package/dist/templates/astro/src/lib/pages.ts +21 -0
- package/dist/templates/astro/src/lib/resolve-puck-path.ts +19 -0
- package/dist/templates/astro/src/pages/[...puckPath].astro +25 -0
- package/dist/templates/astro/src/pages/api/pages.ts +18 -0
- package/dist/templates/astro/src/puck/editor.tsx +32 -0
- package/dist/templates/astro/src/puck/pages.ts +15 -0
- package/dist/templates/astro/src/puck/render.tsx +9 -0
- package/dist/templates/astro/src/puck.config.tsx +23 -0
- package/dist/templates/astro/tsconfig.json +14 -0
- package/dist/templates/astro-ai/README.md +64 -0
- package/dist/templates/astro-ai/_gitignore +24 -0
- package/dist/templates/astro-ai/astro.config.mjs +21 -0
- package/dist/templates/astro-ai/database.json +1 -0
- package/dist/templates/astro-ai/package.json +27 -0
- package/dist/templates/astro-ai/public/favicon.svg +9 -0
- package/dist/templates/astro-ai/src/lib/pages.ts +21 -0
- package/dist/templates/astro-ai/src/lib/resolve-puck-path.ts +19 -0
- package/dist/templates/astro-ai/src/pages/[...puckPath].astro +25 -0
- package/dist/templates/astro-ai/src/pages/api/pages.ts +18 -0
- package/dist/templates/astro-ai/src/pages/api/puck/[...all].ts +36 -0
- package/dist/templates/astro-ai/src/puck/editor.tsx +53 -0
- package/dist/templates/astro-ai/src/puck/pages.ts +15 -0
- package/dist/templates/astro-ai/src/puck/render.tsx +10 -0
- package/dist/templates/astro-ai/src/puck.config.tsx +23 -0
- package/dist/templates/astro-ai/tsconfig.json +14 -0
- package/dist/templates/express/README.md +66 -0
- package/dist/templates/express/_gitignore +16 -0
- package/dist/templates/express/database.json +1 -0
- package/dist/templates/express/package.json +20 -0
- package/dist/templates/express/src/index.ts +15 -0
- package/dist/templates/express/src/puck/pages.ts +39 -0
- package/dist/templates/express/tsconfig.json +12 -0
- package/dist/templates/express-ai/README.md +81 -0
- package/dist/templates/express-ai/_gitignore +16 -0
- package/dist/templates/express-ai/database.json +1 -0
- package/dist/templates/express-ai/package.json +22 -0
- package/dist/templates/express-ai/src/index.ts +17 -0
- package/dist/templates/express-ai/src/puck/cloud.ts +71 -0
- package/dist/templates/express-ai/src/puck/pages.ts +39 -0
- package/dist/templates/express-ai/tsconfig.json +12 -0
- package/dist/templates/hono/README.md +66 -0
- package/dist/templates/hono/_gitignore +32 -0
- package/dist/templates/hono/database.json +1 -0
- package/dist/templates/hono/package.json +20 -0
- package/dist/templates/hono/src/index.ts +21 -0
- package/dist/templates/hono/src/puck/pages.ts +32 -0
- package/dist/templates/hono/tsconfig.json +13 -0
- package/dist/templates/hono-ai/README.md +81 -0
- package/dist/templates/hono-ai/_gitignore +32 -0
- package/dist/templates/hono-ai/database.json +1 -0
- package/dist/templates/hono-ai/package.json +22 -0
- package/dist/templates/hono-ai/src/index.ts +23 -0
- package/dist/templates/hono-ai/src/puck/cloud.ts +30 -0
- package/dist/templates/hono-ai/src/puck/pages.ts +32 -0
- package/dist/templates/hono-ai/tsconfig.json +13 -0
- package/dist/templates/manifest.json +4 -0
- package/dist/templates/next/README.md +112 -0
- package/dist/templates/next/_gitignore +35 -0
- package/dist/templates/next/app/[...puckPath]/client.tsx +9 -0
- package/dist/templates/next/app/[...puckPath]/page.tsx +49 -0
- package/dist/templates/next/app/favicon.ico +0 -0
- package/dist/templates/next/app/layout.tsx +13 -0
- package/dist/templates/next/app/page.tsx +1 -0
- package/dist/templates/next/app/puck/[...puckPath]/client.tsx +20 -0
- package/dist/templates/next/app/puck/[...puckPath]/page.tsx +55 -0
- package/dist/templates/next/app/puck/api/route.ts +25 -0
- package/dist/templates/next/app/puck/page.tsx +3 -0
- package/dist/templates/next/app/styles.css +3 -0
- package/dist/templates/next/database.json +1 -0
- package/dist/templates/next/lib/get-page.ts +11 -0
- package/dist/templates/next/next.config.js +3 -0
- package/dist/templates/next/package.json +25 -0
- package/dist/templates/next/proxy.ts +27 -0
- package/dist/templates/next/puck.config.tsx +25 -0
- package/dist/templates/next/tsconfig/base.json +20 -0
- package/dist/templates/next/tsconfig/nextjs.json +21 -0
- package/dist/templates/next/tsconfig.json +8 -0
- package/dist/templates/next-ai/README.md +169 -0
- package/dist/templates/next-ai/_gitignore +35 -0
- package/dist/templates/next-ai/app/[...puckPath]/client.tsx +12 -0
- package/dist/templates/next-ai/app/[...puckPath]/page.tsx +49 -0
- package/dist/templates/next-ai/app/api/pages/route.ts +26 -0
- package/dist/templates/next-ai/app/api/puck/[...all]/route.ts +31 -0
- package/dist/templates/next-ai/app/layout.tsx +13 -0
- package/dist/templates/next-ai/app/page.tsx +1 -0
- package/dist/templates/next-ai/app/puck/[...puckPath]/client.tsx +38 -0
- package/dist/templates/next-ai/app/puck/[...puckPath]/page.tsx +57 -0
- package/dist/templates/next-ai/app/puck/page.tsx +3 -0
- package/dist/templates/next-ai/app/styles.css +3 -0
- package/dist/templates/next-ai/database.json +1 -0
- package/dist/templates/next-ai/lib/get-page.ts +11 -0
- package/dist/templates/next-ai/next.config.js +3 -0
- package/dist/templates/next-ai/package.json +27 -0
- package/dist/templates/next-ai/proxy.ts +27 -0
- package/dist/templates/next-ai/public/favicon.ico +0 -0
- package/dist/templates/next-ai/puck.config.tsx +25 -0
- package/dist/templates/next-ai/tsconfig/base.json +20 -0
- package/dist/templates/next-ai/tsconfig/nextjs.json +21 -0
- package/dist/templates/next-ai/tsconfig.json +8 -0
- package/dist/templates/react-router/README.md +113 -0
- package/dist/templates/react-router/_gitignore +6 -0
- package/dist/templates/react-router/app/components/puck-render.tsx +8 -0
- package/dist/templates/react-router/app/lib/pages.server.ts +29 -0
- package/dist/templates/react-router/app/lib/resolve-puck-path.server.ts +19 -0
- package/dist/templates/react-router/app/root.tsx +65 -0
- package/dist/templates/react-router/app/routes/_index.tsx +31 -0
- package/dist/templates/react-router/app/routes/puck-splat.tsx +95 -0
- package/dist/templates/react-router/app/routes.ts +7 -0
- package/dist/templates/react-router/database.json +1 -0
- package/dist/templates/react-router/package.json +33 -0
- package/dist/templates/react-router/public/favicon.ico +0 -0
- package/dist/templates/react-router/puck.config.tsx +23 -0
- package/dist/templates/react-router/react-router.config.ts +7 -0
- package/dist/templates/react-router/tsconfig.json +29 -0
- package/dist/templates/react-router/vite.config.ts +10 -0
- package/dist/templates/react-router-ai/README.md +172 -0
- package/dist/templates/react-router-ai/_gitignore +6 -0
- package/dist/templates/react-router-ai/app/components/puck-render.tsx +11 -0
- package/dist/templates/react-router-ai/app/lib/pages.server.ts +29 -0
- package/dist/templates/react-router-ai/app/lib/resolve-puck-path.server.ts +19 -0
- package/dist/templates/react-router-ai/app/root.tsx +65 -0
- package/dist/templates/react-router-ai/app/routes/_index.tsx +31 -0
- package/dist/templates/react-router-ai/app/routes/api.puck.ts +34 -0
- package/dist/templates/react-router-ai/app/routes/puck-splat.tsx +119 -0
- package/dist/templates/react-router-ai/app/routes.ts +8 -0
- package/dist/templates/react-router-ai/database.json +1 -0
- package/dist/templates/react-router-ai/package.json +35 -0
- package/dist/templates/react-router-ai/public/favicon.ico +0 -0
- package/dist/templates/react-router-ai/puck.config.tsx +25 -0
- package/dist/templates/react-router-ai/react-router.config.ts +7 -0
- package/dist/templates/react-router-ai/tsconfig.json +29 -0
- package/dist/templates/react-router-ai/vite.config.ts +10 -0
- package/dist/templates/tanstack-start/README.md +113 -0
- package/dist/templates/tanstack-start/_gitignore +12 -0
- package/dist/templates/tanstack-start/database.json +1 -0
- package/dist/templates/tanstack-start/package.json +26 -0
- package/dist/templates/tanstack-start/puck.config.tsx +23 -0
- package/dist/templates/tanstack-start/src/components/puck-render.tsx +8 -0
- package/dist/templates/tanstack-start/src/lib/pages.server.ts +26 -0
- package/dist/templates/tanstack-start/src/lib/pages.ts +39 -0
- package/dist/templates/tanstack-start/src/lib/resolve-puck-path.ts +19 -0
- package/dist/templates/tanstack-start/src/routeTree.gen.ts +86 -0
- package/dist/templates/tanstack-start/src/router.tsx +19 -0
- package/dist/templates/tanstack-start/src/routes/$.tsx +41 -0
- package/dist/templates/tanstack-start/src/routes/__root.tsx +42 -0
- package/dist/templates/tanstack-start/src/routes/index.tsx +18 -0
- package/dist/templates/tanstack-start/src/styles.css +13 -0
- package/dist/templates/tanstack-start/tsconfig.json +24 -0
- package/dist/templates/tanstack-start/vite.config.ts +15 -0
- package/dist/templates/tanstack-start-ai/README.md +171 -0
- package/dist/templates/tanstack-start-ai/_gitignore +12 -0
- package/dist/templates/tanstack-start-ai/database.json +1 -0
- package/dist/templates/tanstack-start-ai/package.json +28 -0
- package/dist/templates/tanstack-start-ai/puck.config.tsx +23 -0
- package/dist/templates/tanstack-start-ai/src/components/puck-render.tsx +11 -0
- package/dist/templates/tanstack-start-ai/src/lib/pages.server.ts +26 -0
- package/dist/templates/tanstack-start-ai/src/lib/pages.ts +39 -0
- package/dist/templates/tanstack-start-ai/src/lib/resolve-puck-path.ts +19 -0
- package/dist/templates/tanstack-start-ai/src/routeTree.gen.ts +104 -0
- package/dist/templates/tanstack-start-ai/src/router.tsx +19 -0
- package/dist/templates/tanstack-start-ai/src/routes/$.tsx +73 -0
- package/dist/templates/tanstack-start-ai/src/routes/__root.tsx +42 -0
- package/dist/templates/tanstack-start-ai/src/routes/api/puck/$.ts +39 -0
- package/dist/templates/tanstack-start-ai/src/routes/index.tsx +18 -0
- package/dist/templates/tanstack-start-ai/src/styles.css +13 -0
- package/dist/templates/tanstack-start-ai/tsconfig.json +24 -0
- package/dist/templates/tanstack-start-ai/vite.config.ts +15 -0
- package/dist/templates/vinext/README.md +112 -0
- package/dist/templates/vinext/_gitignore +33 -0
- package/dist/templates/vinext/app/[...puckPath]/client.tsx +9 -0
- package/dist/templates/vinext/app/[...puckPath]/page.tsx +49 -0
- package/dist/templates/vinext/app/favicon.ico +0 -0
- package/dist/templates/vinext/app/layout.tsx +13 -0
- package/dist/templates/vinext/app/page.tsx +1 -0
- package/dist/templates/vinext/app/puck/[...puckPath]/client.tsx +20 -0
- package/dist/templates/vinext/app/puck/[...puckPath]/page.tsx +55 -0
- package/dist/templates/vinext/app/puck/api/route.ts +25 -0
- package/dist/templates/vinext/app/puck/page.tsx +3 -0
- package/dist/templates/vinext/app/styles.css +3 -0
- package/dist/templates/vinext/database.json +1 -0
- package/dist/templates/vinext/lib/get-page.ts +11 -0
- package/dist/templates/vinext/package.json +30 -0
- package/dist/templates/vinext/proxy.ts +27 -0
- package/dist/templates/vinext/puck.config.tsx +25 -0
- package/dist/templates/vinext/tsconfig.json +30 -0
- package/dist/templates/vinext/vite.config.ts +6 -0
- package/dist/templates/vinext-ai/README.md +169 -0
- package/dist/templates/vinext-ai/_gitignore +33 -0
- package/dist/templates/vinext-ai/app/[...puckPath]/client.tsx +12 -0
- package/dist/templates/vinext-ai/app/[...puckPath]/page.tsx +49 -0
- package/dist/templates/vinext-ai/app/api/pages/route.ts +26 -0
- package/dist/templates/vinext-ai/app/api/puck/[...all]/route.ts +31 -0
- package/dist/templates/vinext-ai/app/layout.tsx +13 -0
- package/dist/templates/vinext-ai/app/page.tsx +1 -0
- package/dist/templates/vinext-ai/app/puck/[...puckPath]/client.tsx +38 -0
- package/dist/templates/vinext-ai/app/puck/[...puckPath]/page.tsx +57 -0
- package/dist/templates/vinext-ai/app/puck/page.tsx +3 -0
- package/dist/templates/vinext-ai/app/styles.css +3 -0
- package/dist/templates/vinext-ai/database.json +1 -0
- package/dist/templates/vinext-ai/lib/get-page.ts +11 -0
- package/dist/templates/vinext-ai/package.json +32 -0
- package/dist/templates/vinext-ai/proxy.ts +27 -0
- package/dist/templates/vinext-ai/public/favicon.ico +0 -0
- package/dist/templates/vinext-ai/puck.config.tsx +25 -0
- package/dist/templates/vinext-ai/tsconfig.json +30 -0
- package/dist/templates/vinext-ai/vite.config.ts +9 -0
- package/dist/templates/vite/README.md +56 -0
- package/dist/templates/vite/_gitignore +24 -0
- package/dist/templates/vite/database.json +1 -0
- package/dist/templates/vite/index.html +12 -0
- package/dist/templates/vite/package.json +29 -0
- package/dist/templates/vite/server/index.ts +13 -0
- package/dist/templates/vite/server/prod.ts +18 -0
- package/dist/templates/vite/server/puck/pages.ts +32 -0
- package/dist/templates/vite/src/App.tsx +11 -0
- package/dist/templates/vite/src/main.tsx +12 -0
- package/dist/templates/vite/src/puck/editor.tsx +28 -0
- package/dist/templates/vite/src/puck/page.tsx +27 -0
- package/dist/templates/vite/src/puck/pages.ts +15 -0
- package/dist/templates/vite/src/puck/root.tsx +27 -0
- package/dist/templates/vite/src/puck.config.tsx +23 -0
- package/dist/templates/vite/tsconfig.app.json +26 -0
- package/dist/templates/vite/tsconfig.json +7 -0
- package/dist/templates/vite/tsconfig.node.json +23 -0
- package/dist/templates/vite/vite.config.ts +14 -0
- package/dist/templates/vite-ai/README.md +67 -0
- package/dist/templates/vite-ai/_gitignore +24 -0
- package/dist/templates/vite-ai/database.json +1 -0
- package/dist/templates/vite-ai/index.html +12 -0
- package/dist/templates/vite-ai/package.json +31 -0
- package/dist/templates/vite-ai/server/index.ts +15 -0
- package/dist/templates/vite-ai/server/prod.ts +18 -0
- package/dist/templates/vite-ai/server/puck/cloud.ts +30 -0
- package/dist/templates/vite-ai/server/puck/pages.ts +32 -0
- package/dist/templates/vite-ai/src/App.tsx +11 -0
- package/dist/templates/vite-ai/src/main.tsx +12 -0
- package/dist/templates/vite-ai/src/puck/editor.tsx +49 -0
- package/dist/templates/vite-ai/src/puck/page.tsx +28 -0
- package/dist/templates/vite-ai/src/puck/pages.ts +15 -0
- package/dist/templates/vite-ai/src/puck/root.tsx +27 -0
- package/dist/templates/vite-ai/src/puck.config.tsx +23 -0
- package/dist/templates/vite-ai/tsconfig.app.json +26 -0
- package/dist/templates/vite-ai/tsconfig.json +7 -0
- package/dist/templates/vite-ai/tsconfig.node.json +23 -0
- package/dist/templates/vite-ai/vite.config.ts +14 -0
- package/package.json +51 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Fields
|
|
2
|
+
|
|
3
|
+
Use the following CSS properties for theming Puck's fields.
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
.Container {
|
|
7
|
+
--puck-field-radius: 32px;
|
|
8
|
+
--puck-field-color-border: transparent;
|
|
9
|
+
--puck-field-color-bg: #f0f0f0;
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## CSS properties
|
|
14
|
+
|
|
15
|
+
Defaults shown as `var(--puck-...)` reference [global tokens](/docs/api-reference/theming/global). See [computed values](/docs/api-reference/theming/computed-values#fields) for the values they resolve to.
|
|
16
|
+
|
|
17
|
+
These apply to every field type; the sections below cover tokens specific to individual fields.
|
|
18
|
+
|
|
19
|
+
The `-hover` and `-active` variants only affect controls that respond to interaction, like selects, radio options, and array buttons. Plain text inputs change their border on hover, not their background.
|
|
20
|
+
|
|
21
|
+
| Token | Default | Description |
|
|
22
|
+
| ------------------------------------ | -------------------------------------------------------------- | --------------------------------- |
|
|
23
|
+
| `--puck-field-color-surface` | `var(--puck-color-surface)` | Object / array body background |
|
|
24
|
+
| `--puck-field-color-bg` | `var(--puck-color-surface)` | Field control background |
|
|
25
|
+
| `--puck-field-color-bg-hover` | `var(--puck-color-interactive-soft-hover)` | Control background on hover |
|
|
26
|
+
| `--puck-field-color-bg-active` | `var(--puck-color-interactive-soft)` | Active or selected background |
|
|
27
|
+
| `--puck-field-color-text` | `var(--puck-color-text)` | Text color |
|
|
28
|
+
| `--puck-field-color-text-hover` | `var(--puck-field-color-text)` | Text color on hover |
|
|
29
|
+
| `--puck-field-color-text-active` | `var(--puck-color-interactive)` | Selected state text color |
|
|
30
|
+
| `--puck-field-color-border` | `var(--puck-color-border)` | Border color |
|
|
31
|
+
| `--puck-field-color-border-hover` | `var(--puck-color-border-hover)` | Border color on hover / focus |
|
|
32
|
+
| `--puck-field-color-border-focus` | `var(--puck-color-focus-ring)` | Focus ring color |
|
|
33
|
+
| `--puck-field-color-border-dragging` | `var(--puck-color-selection-border)` | Border color while dragging |
|
|
34
|
+
| `--puck-field-color-bg-disabled` | `var(--puck-color-surface-muted)` | Disabled control background |
|
|
35
|
+
| `--puck-field-color-border-disabled` | `var(--puck-color-border)` | Disabled border color |
|
|
36
|
+
| `--puck-field-color-text-disabled` | `var(--puck-color-text-secondary)` | Disabled text color |
|
|
37
|
+
| `--puck-field-border-width` | `var(--puck-border-width-regular)` | Border width |
|
|
38
|
+
| `--puck-field-radius` | `var(--puck-radius-m)` | Border radius |
|
|
39
|
+
| `--puck-field-font-size` | `var(--puck-font-size-xxs)` | Font size |
|
|
40
|
+
| `--puck-field-space-x` | `calc(var(--puck-space-4) - var(--puck-border-width-regular))` | Horizontal padding |
|
|
41
|
+
| `--puck-field-space-y` | `var(--puck-space-3)` | Vertical padding |
|
|
42
|
+
| `--puck-field-space-surface-x` | `calc(var(--puck-space-4) - var(--puck-border-width-regular))` | Object / array horizontal padding |
|
|
43
|
+
| `--puck-field-space-surface-y` | `var(--puck-space-4)` | Object / array vertical padding |
|
|
44
|
+
| `--puck-field-label-color-text` | `var(--puck-color-text-secondary)` | Label text color |
|
|
45
|
+
| `--puck-field-label-space-y` | `var(--puck-space-3)` | Label bottom spacing |
|
|
46
|
+
| `--puck-field-label-font-size` | `var(--puck-font-size-xxs)` | Label font size |
|
|
47
|
+
| `--puck-field-label-font-weight` | `var(--puck-font-weight-semibold)` | Label font weight |
|
|
48
|
+
| `--puck-field-label-color-icon` | `var(--puck-color-text-subtle)` | Label icon color |
|
|
49
|
+
|
|
50
|
+
### Array
|
|
51
|
+
|
|
52
|
+
| Token | Default | Description |
|
|
53
|
+
| ----------------------------------- | ------------------------------- | --------------------- |
|
|
54
|
+
| `--puck-field-array-add-color-icon` | `var(--puck-color-interactive)` | Add button icon color |
|
|
55
|
+
|
|
56
|
+
### Rich Text
|
|
57
|
+
|
|
58
|
+
| Token | Default | Description |
|
|
59
|
+
| -------------------------------------------- | ---------------------------------- | -------------------------- |
|
|
60
|
+
| `--puck-field-richtext-menu-color-bg` | `var(--puck-color-surface-subtle)` | Toolbar background |
|
|
61
|
+
| `--puck-field-richtext-menu-color-separator` | `var(--puck-color-border-muted)` | Toolbar group separator |
|
|
62
|
+
| `--puck-field-richtext-menu-space-x` | `6px` | Toolbar horizontal padding |
|
|
63
|
+
| `--puck-field-richtext-menu-space-y` | `6px` | Toolbar vertical padding |
|
|
64
|
+
|
|
65
|
+
### External
|
|
66
|
+
|
|
67
|
+
| Token | Default | Description |
|
|
68
|
+
| ----------------------------------------- | ---------------------------------- | ------------------------ |
|
|
69
|
+
| `--puck-field-external-detach-color-bg` | `var(--puck-color-surface-subtle)` | Detach button background |
|
|
70
|
+
| `--puck-field-external-detach-color-text` | `var(--puck-color-text-muted)` | Detach button text color |
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Global theming
|
|
2
|
+
|
|
3
|
+
CSS properties for theming the entire Puck user interface.
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
.Container {
|
|
7
|
+
--puck-color-interactive: #0f5fff;
|
|
8
|
+
--puck-color-focus-ring: #3b82f6;
|
|
9
|
+
}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Colors
|
|
13
|
+
|
|
14
|
+
| Token | Default | Used for |
|
|
15
|
+
| ----------------------------------------- | ----------------------------------------------------------- | --------------------------------------------------- |
|
|
16
|
+
| `--puck-color-surface` | #ffffff | Panel, field and menu backgrounds |
|
|
17
|
+
| `--puck-color-surface-muted` | #f5f5f5 | Canvas and disabled field backgrounds |
|
|
18
|
+
| `--puck-color-surface-subtle` | #fafafa | App layout, sidebar and toolbar backgrounds |
|
|
19
|
+
| `--puck-color-surface-inverse` | #181818 | Action bar background |
|
|
20
|
+
| `--puck-color-border` | #dcdcdc | Default borders and dividers |
|
|
21
|
+
| `--puck-color-border-hover` | #767676 | Input border on hover and focus |
|
|
22
|
+
| `--puck-color-border-muted` | #efefef | Subtle dividers and separators |
|
|
23
|
+
| `--puck-color-border-inverse` | #767676 | Separators on inverse surfaces |
|
|
24
|
+
| `--puck-color-text` | #000000 | Default body and field text |
|
|
25
|
+
| `--puck-color-text-secondary` | #5a5a5a | Field labels and disabled field text |
|
|
26
|
+
| `--puck-color-text-muted` | #767676 | Drawer categories, drag handles and zone labels |
|
|
27
|
+
| `--puck-color-text-subtle` | #ababab | Disabled icons, loaders and helper text |
|
|
28
|
+
| `--puck-color-text-inverse` | #ffffff | Text on inverse and primary surfaces |
|
|
29
|
+
| `--puck-color-interactive` | #0158ad | Primary actions, links and active states |
|
|
30
|
+
| `--puck-color-interactive-hover` | #014292 | Links and primary button hover |
|
|
31
|
+
| `--puck-color-interactive-active` | #002c77 | Links and primary button active |
|
|
32
|
+
| `--puck-color-interactive-subtle` | #e7eef7 | Active plugin bar, category and outline backgrounds |
|
|
33
|
+
| `--puck-color-interactive-soft` | #f3f6fb | Secondary button and selected item backgrounds |
|
|
34
|
+
| `--puck-color-interactive-soft-hover` | #f7faff | Row and item hover backgrounds |
|
|
35
|
+
| `--puck-color-interactive-neutral-hover` | #efefef | Icon button hover background |
|
|
36
|
+
| `--puck-color-interactive-inverse-hover` | #6499cf | Interactive hover color on inverse surfaces |
|
|
37
|
+
| `--puck-color-interactive-inverse-active` | #88b0da | Interactive active color on inverse surfaces |
|
|
38
|
+
| `--puck-color-focus-ring` | #3479be | Keyboard focus outlines |
|
|
39
|
+
| `--puck-color-selection-bg` | color-mix(in srgb, #cfdff0 30%, transparent) | Slot, drop zone and selected overlay background |
|
|
40
|
+
| `--puck-color-selection-border` | #abc7e5 | Selected and drop zone outline borders |
|
|
41
|
+
| `--puck-color-line-placeholder` | #6499cf | Drag-and-drop insertion line |
|
|
42
|
+
| `--puck-color-highlight` | #d89aba | Accent color scale step, not currently consumed |
|
|
43
|
+
| `--puck-color-bg-disabled` | #ababab | Disabled button background |
|
|
44
|
+
| `--puck-color-text-disabled` | #404040 | Disabled button text |
|
|
45
|
+
| `--puck-color-overlay-backdrop` | color-mix(in srgb, #000000 75%, transparent) | Modal backdrop |
|
|
46
|
+
|
|
47
|
+
## Opacity
|
|
48
|
+
|
|
49
|
+
| Token | Default | Used for |
|
|
50
|
+
| ----------------------------- | ------- | ------------------------ |
|
|
51
|
+
| `--puck-opacity-text-inverse` | `0.75` | Action bar label opacity |
|
|
52
|
+
|
|
53
|
+
## Spacing
|
|
54
|
+
|
|
55
|
+
| Token | Default | Used for |
|
|
56
|
+
| ---------------------------- | --------------------- | ----------------------------------------------- |
|
|
57
|
+
| `--puck-space-1` | `4px` | Small gaps, padding and margins throughout |
|
|
58
|
+
| `--puck-space-2` | `8px` | Medium spacing in buttons, plugin bar and menus |
|
|
59
|
+
| `--puck-space-3` | `12px` | Default field padding and drawer items |
|
|
60
|
+
| `--puck-space-4` | `16px` | Large panel, section and field padding |
|
|
61
|
+
| `--puck-space-5` | `24px` | External input panels and slot indicator height |
|
|
62
|
+
| `--puck-space-chrome-gutter` | `var(--puck-space-4)` | Header and canvas gutter padding |
|
|
63
|
+
|
|
64
|
+
## Radius
|
|
65
|
+
|
|
66
|
+
| Token | Default | Used for |
|
|
67
|
+
| --------------------- | ------- | --------------------------------------------------- |
|
|
68
|
+
| `--puck-radius-none` | `0` | Square-cornered plugin bar tabs and button variants |
|
|
69
|
+
| `--puck-radius-xs` | `2px` | Breadcrumb and sidebar section hover chips |
|
|
70
|
+
| `--puck-radius-s` | `3px` | Radius scale step, not currently consumed |
|
|
71
|
+
| `--puck-radius-m` | `4px` | Default radius for buttons, fields and controls |
|
|
72
|
+
| `--puck-radius-l` | `8px` | Action bar, modal and select dropdown |
|
|
73
|
+
| `--puck-radius-pill` | `30px` | Viewport size control buttons |
|
|
74
|
+
| `--puck-radius-round` | `100%` | Loader spinner ring |
|
|
75
|
+
|
|
76
|
+
## Border Width
|
|
77
|
+
|
|
78
|
+
| Token | Default | Used for |
|
|
79
|
+
| ------------------------------ | ------- | ------------------------------------------ |
|
|
80
|
+
| `--puck-border-width-hairline` | `0.5px` | Action bar and rich text menu dividers |
|
|
81
|
+
| `--puck-border-width-regular` | `1px` | Default borders and outlines across UI |
|
|
82
|
+
| `--puck-border-width-focus` | `2px` | Focus ring outlines and drop zone outlines |
|
|
83
|
+
| `--puck-border-width-strong` | `4px` | Plugin bar active tab and accent borders |
|
|
84
|
+
|
|
85
|
+
## Motion
|
|
86
|
+
|
|
87
|
+
| Token | Default | Used for |
|
|
88
|
+
| ------------------------ | ------------- | ---------------------------------------------- |
|
|
89
|
+
| `--puck-duration-fast` | `50ms` | Hover and focus transitions across UI controls |
|
|
90
|
+
| `--puck-duration-medium` | `150ms` | Layout, sidebar and slot resize transitions |
|
|
91
|
+
| `--puck-duration-slow` | `250ms` | Canvas fade-in transition |
|
|
92
|
+
| `--puck-ease-exit` | `ease-in` | Easing for most hover and collapse transitions |
|
|
93
|
+
| `--puck-ease-emphasized` | `ease-in-out` | Easing for viewport controls slide |
|
|
94
|
+
| `--puck-ease-entrance` | `ease-out` | Easing for canvas and sidebar entrance |
|
|
95
|
+
|
|
96
|
+
## Typography
|
|
97
|
+
|
|
98
|
+
| Token | Default | Used for |
|
|
99
|
+
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- |
|
|
100
|
+
| `--puck-font-family` | `Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica Neue, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol` | Default editor UI font family |
|
|
101
|
+
| `--puck-font-family-monospaced` | `ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace` | Header path display and outline font |
|
|
102
|
+
| `--puck-font-weight-regular` | `400` | Default button font weight |
|
|
103
|
+
| `--puck-font-weight-medium` | `500` | Active fields, labels and action bar |
|
|
104
|
+
| `--puck-font-weight-semibold` | `600` | Field labels, plugin bar items and headers |
|
|
105
|
+
| `--puck-font-weight-bold` | `700` | Heading component text |
|
|
106
|
+
| `--puck-font-weight-heavy` | `800` | Largest heading variant |
|
|
107
|
+
| `--puck-letter-spacing-ui` | `0.05ch` | Button label letter spacing |
|
|
108
|
+
| `--puck-letter-spacing-heading` | `0.08ch` | Largest heading letter spacing |
|
|
109
|
+
| `--puck-space-m-unitless` | `24` | Referenced by line-height calculations only |
|
|
110
|
+
|
|
111
|
+
## Icon Size
|
|
112
|
+
|
|
113
|
+
| Token | Default | Used for |
|
|
114
|
+
| --------------------- | ------- | --------------------------------------------------------- |
|
|
115
|
+
| `--puck-icon-size-xs` | `14px` | Outline layer and zone icons |
|
|
116
|
+
| `--puck-icon-size-s` | `16px` | Action bar, inline control and outline caret/action icons |
|
|
117
|
+
| `--puck-icon-size-m` | `18px` | Select, rich text menu and collapse-all icons |
|
|
118
|
+
| `--puck-icon-size-l` | `24px` | Icon size scale step, not currently consumed |
|
|
119
|
+
|
|
120
|
+
## Functional
|
|
121
|
+
|
|
122
|
+
| Token | Default | Used for |
|
|
123
|
+
| --------------------------------- | -------------------------- | ----------------------------------------------------------- |
|
|
124
|
+
| `--puck-slot-min-empty-height` | `128px` | Minimum height of empty slots |
|
|
125
|
+
| `--puck-line-placeholder-width` | `2px` | Drag-and-drop insertion line thickness (canvas and outline) |
|
|
126
|
+
| `--puck-user-sidebar-left-width` | `186px–320px (responsive)` | User override for left sidebar width |
|
|
127
|
+
| `--puck-user-sidebar-right-width` | `186px–320px (responsive)` | User override for right sidebar width |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Header
|
|
2
|
+
|
|
3
|
+
Use the following CSS properties for theming the editor header.
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
.Container {
|
|
7
|
+
--puck-header-color-bg: #1e293b;
|
|
8
|
+
--puck-header-color-text: #f8fafc;
|
|
9
|
+
}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## CSS properties
|
|
13
|
+
|
|
14
|
+
Defaults shown as `var(--puck-...)` reference [global tokens](/docs/api-reference/theming/global). See [computed values](/docs/api-reference/theming/computed-values#header) for the values they resolve to.
|
|
15
|
+
|
|
16
|
+
| Token | Default | Description |
|
|
17
|
+
| -------------------------- | --------------------------- | ---------------- |
|
|
18
|
+
| `--puck-header-color-bg` | `var(--puck-color-surface)` | Background color |
|
|
19
|
+
| `--puck-header-color-text` | `var(--puck-color-text)` | Text color |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Icon button
|
|
2
|
+
|
|
3
|
+
Use the following CSS properties for theming Puck's icon buttons.
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
.Container {
|
|
7
|
+
--puck-iconbutton-radius: 9999px;
|
|
8
|
+
--puck-iconbutton-color-icon: #1f2937;
|
|
9
|
+
--puck-iconbutton-color-bg-hover: #eef2ff;
|
|
10
|
+
--puck-iconbutton-space: 16px;
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## CSS properties
|
|
15
|
+
|
|
16
|
+
Defaults shown as `var(--puck-...)` reference [global tokens](/docs/api-reference/theming/global). See [computed values](/docs/api-reference/theming/computed-values#icon-button) for the values they resolve to.
|
|
17
|
+
|
|
18
|
+
| Token | Default | Description |
|
|
19
|
+
| --------------------------------------- | --------------------------------------------- | ----------------------- |
|
|
20
|
+
| `--puck-iconbutton-radius` | `var(--puck-radius-m)` | Border radius |
|
|
21
|
+
| `--puck-iconbutton-space` | `var(--puck-space-1)` | Padding |
|
|
22
|
+
| `--puck-iconbutton-color-bg` | `transparent` | Background color |
|
|
23
|
+
| `--puck-iconbutton-color-bg-hover` | `var(--puck-color-interactive-neutral-hover)` | Background on hover |
|
|
24
|
+
| `--puck-iconbutton-color-bg-active` | `var(--puck-color-interactive-soft)` | Background when pressed |
|
|
25
|
+
| `--puck-iconbutton-color-icon` | `currentColor` | Icon color |
|
|
26
|
+
| `--puck-iconbutton-color-icon-hover` | `var(--puck-color-interactive)` | Icon color on hover |
|
|
27
|
+
| `--puck-iconbutton-color-icon-active` | `var(--puck-color-interactive)` | Icon color when active |
|
|
28
|
+
| `--puck-iconbutton-color-icon-disabled` | `var(--puck-color-text-subtle)` | Disabled icon color |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Outline
|
|
2
|
+
|
|
3
|
+
Use the following CSS properties for theming the outline (layers) panel.
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
.Container {
|
|
7
|
+
--puck-outline-color-bg-selected: #f0f0f0;
|
|
8
|
+
--puck-outline-color-border-selected: #b947ff;
|
|
9
|
+
}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## CSS properties
|
|
13
|
+
|
|
14
|
+
Defaults shown as `var(--puck-...)` reference [global tokens](/docs/api-reference/theming/global). See [computed values](/docs/api-reference/theming/computed-values#outline) for the values they resolve to.
|
|
15
|
+
|
|
16
|
+
| Token | Default | Description |
|
|
17
|
+
| -------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
|
18
|
+
| `--puck-outline-color-text` | `var(--puck-color-text-secondary)` | Layer label text color |
|
|
19
|
+
| `--puck-outline-color-text-hover` | `var(--puck-color-interactive)` | Zone label color when targeted by a drag |
|
|
20
|
+
| `--puck-outline-color-text-helper` | `var(--puck-color-text-subtle)` | Empty-zone helper text color |
|
|
21
|
+
| `--puck-outline-color-icon` | `var(--puck-color-text-subtle)` | Layer icon color |
|
|
22
|
+
| `--puck-outline-color-bg-hover` | `var(--puck-color-interactive-soft)` | Layer background on hover |
|
|
23
|
+
| `--puck-outline-color-border-hover` | `var(--puck-color-interactive-subtle)` | Layer border color on hover |
|
|
24
|
+
| `--puck-outline-color-bg-selected` | `var(--puck-color-interactive-subtle)` | Selected layer background |
|
|
25
|
+
| `--puck-outline-color-border-selected` | `var(--puck-color-selection-border)` | Selected layer border color |
|
|
26
|
+
| `--puck-outline-color-drop-indicator` | `var(--puck-color-line-placeholder)` | Drag-and-drop line indicator color |
|
|
27
|
+
| `--puck-outline-border-width` | `var(--puck-border-width-regular)` | Layer border width |
|
|
28
|
+
| `--puck-outline-radius` | `var(--puck-radius-m)` | Layer border radius |
|
|
29
|
+
| `--puck-outline-font-size` | `var(--puck-font-size-xxxs)` | Layer label font size |
|
|
30
|
+
| `--puck-outline-font-family` | `var(--puck-font-family-monospaced)` | Layer tree font family |
|
|
31
|
+
| `--puck-outline-icon-size` | `var(--puck-icon-size-xs)` | Layer and zone icon size |
|
|
32
|
+
| `--puck-outline-action-size` | `var(--puck-icon-size-s)` | Expand caret and row action icon size |
|
|
33
|
+
| `--puck-outline-space-indent` | `var(--puck-space-3)` | Indentation per nesting level |
|
|
34
|
+
| `--puck-outline-zone-color-text` | `var(--puck-color-text-muted)` | Nested-zone label and icon color |
|
|
35
|
+
| `--puck-outline-zone-font-size` | `calc(var(--puck-font-size-xxxs) * 0.9)` | Nested-zone label font size |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Plugin bar
|
|
2
|
+
|
|
3
|
+
Use the following CSS properties for theming the plugin bar.
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
.Container {
|
|
7
|
+
--puck-pluginbar-color-bg: #1e293b;
|
|
8
|
+
--puck-pluginbar-color-text: #94a3b8;
|
|
9
|
+
--puck-pluginbar-color-text-selected: #f8fafc;
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## CSS properties
|
|
14
|
+
|
|
15
|
+
Defaults shown as `var(--puck-...)` reference [global tokens](/docs/api-reference/theming/global). See [computed values](/docs/api-reference/theming/computed-values#plugin-bar) for the values they resolve to.
|
|
16
|
+
|
|
17
|
+
| Token | Default | Description |
|
|
18
|
+
| -------------------------------------- | ------------------------------------ | ------------------------ |
|
|
19
|
+
| `--puck-pluginbar-color-bg` | `var(--puck-color-surface-subtle)` | Background color |
|
|
20
|
+
| `--puck-pluginbar-color-bg-hover` | `var(--puck-color-interactive-soft)` | Tab background on hover |
|
|
21
|
+
| `--puck-pluginbar-color-text` | `var(--puck-color-text-secondary)` | Item text color |
|
|
22
|
+
| `--puck-pluginbar-color-text-hover` | `var(--puck-color-interactive)` | Item text color on hover |
|
|
23
|
+
| `--puck-pluginbar-color-text-selected` | `var(--puck-color-interactive)` | Selected item text color |
|
|
24
|
+
| `--puck-pluginbar-font-size` | `var(--puck-font-size-xxxs)` | Item font size |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Sidebar
|
|
2
|
+
|
|
3
|
+
Use the following CSS properties for theming the left and right sidebar panels.
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
.Container {
|
|
7
|
+
--puck-sidebar-left-color-bg: #f5f5f7;
|
|
8
|
+
--puck-sidebar-right-color-bg: #ffffff;
|
|
9
|
+
}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## CSS properties
|
|
13
|
+
|
|
14
|
+
Defaults shown as `var(--puck-...)` reference [global tokens](/docs/api-reference/theming/global). See [computed values](/docs/api-reference/theming/computed-values#sidebar) for the values they resolve to.
|
|
15
|
+
|
|
16
|
+
| Token | Default | Description |
|
|
17
|
+
| ------------------------------- | ---------------------------------- | ---------------------- |
|
|
18
|
+
| `--puck-sidebar-left-color-bg` | `var(--puck-color-surface-subtle)` | Left panel background |
|
|
19
|
+
| `--puck-sidebar-right-color-bg` | `var(--puck-color-surface)` | Right panel background |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Slot
|
|
2
|
+
|
|
3
|
+
Use the following CSS properties for theming slots (drop zones) and the components dragged within them.
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
.Container {
|
|
7
|
+
--puck-slot-color-bg: #fff2ee;
|
|
8
|
+
--puck-slot-color-border: #f6ab3b;
|
|
9
|
+
}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## CSS properties
|
|
13
|
+
|
|
14
|
+
Defaults shown as `var(--puck-...)` reference [global tokens](/docs/api-reference/theming/global). See [computed values](/docs/api-reference/theming/computed-values#slot) for the values they resolve to.
|
|
15
|
+
|
|
16
|
+
| Token | Default | Description |
|
|
17
|
+
| --------------------------------------------- | ------------------------------------ | ------------------------------------- |
|
|
18
|
+
| `--puck-slot-color-bg` | `var(--puck-color-selection-bg)` | Drop zone background when active |
|
|
19
|
+
| `--puck-slot-color-border` | `var(--puck-color-selection-border)` | Drop zone outline color |
|
|
20
|
+
| `--puck-slot-border-width` | `var(--puck-border-width-focus)` | Drop zone outline width |
|
|
21
|
+
| `--puck-slot-border-style` | `dashed` | Drop zone outline style |
|
|
22
|
+
| `--puck-slot-component-color-overlay` | `var(--puck-color-selection-bg)` | Component overlay background on hover |
|
|
23
|
+
| `--puck-slot-component-color-overlay-border` | `var(--puck-color-selection-border)` | Component overlay outline |
|
|
24
|
+
| `--puck-slot-component-border-width` | `var(--puck-border-width-focus)` | Component overlay outline width |
|
|
25
|
+
| `--puck-slot-component-color-border-selected` | `var(--puck-color-selection-border)` | Selected component overlay outline |
|
|
26
|
+
| `--puck-slot-component-color-placeholder` | #6499cf | Drag placeholder background |
|
|
27
|
+
| `--puck-slot-component-color-border-dragging` | #cfdff0 | Outline while dragging component |
|
package/dist/docs/cli.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# CLI
|
|
2
|
+
|
|
3
|
+
The Puck CLI sets up Puck and [Puck Cloud](https://cloud.puckeditor.com) in a new or existing app. It's built for coding agents, and works interactively for humans.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npx @puckeditor/cli init
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
`init` inspects your project and makes the smallest set of changes needed to reach a working Puck app, with Puck AI if you choose it:
|
|
10
|
+
|
|
11
|
+
- **No app yet**: creates a Next.js, React Router, TanStack Start, vinext, Vite or Astro app, or a Hono or Express server, from the Puck [recipes](https://github.com/puckeditor/puck#recipes)
|
|
12
|
+
- **App without Puck**: installs `@puckeditor/core` and adds an editor at `/edit`
|
|
13
|
+
- **Puck without Puck AI** (when you choose it): installs `@puckeditor/cloud-client` and `@puckeditor/plugin-ai`, adds the `/api/puck` route and the Puck AI plugin, and connects your Puck Cloud account
|
|
14
|
+
- **Already set up**: verifies the setup and changes nothing
|
|
15
|
+
|
|
16
|
+
With Puck AI, the only manual step is logging in to Puck Cloud and approving the connection in your browser. When it's done, the CLI starts your dev server and opens the editor.
|
|
17
|
+
|
|
18
|
+
Puck AI is optional. It's the editor plugin that uses Puck Cloud as its backend, so choosing it sets up Puck Cloud too. `init` asks whether to add it; pass `--ai` or `--no-ai` to choose up front.
|
|
19
|
+
|
|
20
|
+
## Supported projects
|
|
21
|
+
|
|
22
|
+
- Next.js 15+ using the App Router (`app/` or `src/app/`)
|
|
23
|
+
- React Router 7+ in framework mode
|
|
24
|
+
- [TanStack Start](https://tanstack.com/start) 1.x
|
|
25
|
+
- [vinext](https://github.com/cloudflare/vinext) using the App Router
|
|
26
|
+
- [Vite](https://vite.dev) React apps (see [Vite and Astro](#vite-and-astro))
|
|
27
|
+
- [Astro](https://astro.build) 7+ (see [Vite and Astro](#vite-and-astro))
|
|
28
|
+
- [Hono](https://hono.dev) and [Express](https://expressjs.com) servers (see [Servers](#servers))
|
|
29
|
+
- npm, pnpm, Yarn and Bun, including workspaces
|
|
30
|
+
- TypeScript projects
|
|
31
|
+
|
|
32
|
+
When the CLI can't safely change something, like an existing `middleware.ts`, it leaves the file alone and tells you exactly what to add.
|
|
33
|
+
|
|
34
|
+
## Vite and Astro
|
|
35
|
+
|
|
36
|
+
A Vite app, or an Astro site without a server adapter, has nowhere to save pages or run Puck Cloud. The CLI asks where that server comes from. Agents get a `choose_backend` action; pass `--backend` to choose up front:
|
|
37
|
+
|
|
38
|
+
- `--backend add`: in Vite, adds a Hono server in `server/`, run by Vite in development with `@hono/vite-dev-server` and by `npm start` in production. In Astro, runs `astro add node` so pages and API routes are served on demand
|
|
39
|
+
- `--backend external --backend-url <url>`: proxies `/api` to a server that runs elsewhere, e.g. a [Hono or Express server](#servers) set up by the CLI. Puck Cloud and `PUCK_API_KEY` live on that server
|
|
40
|
+
- `--backend none`: saves pages in the browser's `localStorage`. Puck AI isn't available without a server
|
|
41
|
+
|
|
42
|
+
In Vite, the editor opens at any URL ending in `/edit`: `<PuckRoot>` wraps your app in `src/main.tsx` and renders the editor instead. Render published pages with `<PuckPage path={...} />` wherever your app renders pages.
|
|
43
|
+
|
|
44
|
+
In Astro with an adapter, `src/pages/[...puckPath].astro` renders the editor at `/edit` URLs and published pages everywhere else, on the server. Without one, the editor is a static page at `/edit?path=/your/page`. The CLI runs `astro add react` when React isn't set up yet.
|
|
45
|
+
|
|
46
|
+
## Servers
|
|
47
|
+
|
|
48
|
+
In a Hono or Express project, the CLI sets up the APIs a Puck editor in another app talks to:
|
|
49
|
+
|
|
50
|
+
- `/api/pages`: loads (`GET ?path=/about`) and saves (`POST { path, data }`) pages, in `src/puck/pages.ts`
|
|
51
|
+
- `/api/puck/*`: the Puck Cloud route for Puck AI, in `src/puck/cloud.ts`, when you choose Puck AI
|
|
52
|
+
|
|
53
|
+
It mounts both on your app before it starts serving, so your own middleware runs first. Node doesn't load `.env` files, so the CLI adds `--env-file-if-exists=.env.local` to a `tsx` or `node` dev script. Bun loads `.env.local` itself. On Cloudflare Workers, put `PUCK_API_KEY` in `.dev.vars` instead.
|
|
54
|
+
|
|
55
|
+
Add the Puck AI plugin in the app with the editor. If that app runs on another origin, proxy `/api` to the server in development, or pass `host` to `createAiPlugin`.
|
|
56
|
+
|
|
57
|
+
## For coding agents
|
|
58
|
+
|
|
59
|
+
Run with `--yes --json`. The CLI never prompts, and prints exactly one JSON document to stdout.
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
npx @puckeditor/cli init --yes --json
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
When `status` is `action_required`, nothing has been changed yet. Show each entry in `actions` to the developer, then run its `rerun` command. Without `--ai` or `--no-ai`, the first run returns a `choose_ai` action, so the developer can decide whether to add Puck AI. With `--ai`, the first run asks the developer to log in:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"status": "action_required",
|
|
70
|
+
"message": "Puck Cloud login required. No changes have been made yet.",
|
|
71
|
+
"actions": [
|
|
72
|
+
{
|
|
73
|
+
"type": "browser_login",
|
|
74
|
+
"url": "https://cloud.puckeditor.com/cli/connect#code=BCDF-GHJK",
|
|
75
|
+
"userCode": "BCDF-GHJK",
|
|
76
|
+
"rerun": "npx @puckeditor/cli init --yes --json --ai"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
After the developer approves, the same command completes the setup:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"status": "success",
|
|
87
|
+
"project": { "framework": "next", "packageManager": "pnpm" },
|
|
88
|
+
"puck": { "installed": true, "configured": true },
|
|
89
|
+
"cloud": { "configured": true, "verified": "remote" },
|
|
90
|
+
"ai": { "installed": true, "configured": true },
|
|
91
|
+
"filesModified": [".env.local", "app/api/puck/[...all]/route.ts"]
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Start with `npx @puckeditor/cli status --json` to see what's already set up and which command to run next.
|
|
96
|
+
|
|
97
|
+
### Statuses
|
|
98
|
+
|
|
99
|
+
| Status | Meaning |
|
|
100
|
+
| ----------------- | --------------------------------------------------------------------------------------- |
|
|
101
|
+
| `success` | The project is set up. `changed` is `false` if there was nothing to do. |
|
|
102
|
+
| `action_required` | Input or approval is needed. Nothing was changed. Complete `actions`, then run `rerun`. |
|
|
103
|
+
| `partial` | Changes were applied, but some `actions` must be completed by hand. |
|
|
104
|
+
| `error` | Something went wrong. See `error.code` and `error.message`. |
|
|
105
|
+
|
|
106
|
+
### Actions
|
|
107
|
+
|
|
108
|
+
| Type | What to do |
|
|
109
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
110
|
+
| `browser_login` | Ask the developer to open `url`, confirm `userCode` and approve |
|
|
111
|
+
| `provide_api_key` | Ask for a Puck API key, then re-run with `PUCK_API_KEY` set |
|
|
112
|
+
| `confirm_plan` | Review `plan.steps`, then re-run with `--yes` |
|
|
113
|
+
| `choose_ai` | Ask the developer, then re-run `init` with `--ai` or `--no-ai` |
|
|
114
|
+
| `choose_backend` | Ask the developer, then re-run with `--backend add`, `--backend external --backend-url <url>` or `--backend none` |
|
|
115
|
+
| `choose_framework` | Re-run `init` with `--framework` and one of `next`, `react-router`, `tanstack-start`, `vinext`, `vite`, `astro`, `hono` or `express` |
|
|
116
|
+
| `provide_app_name` | Re-run `init` with `--name <name>` |
|
|
117
|
+
| `choose_workspace_package` | Re-run with `--workspace <dir>` for one of `choices` |
|
|
118
|
+
| `manual_edit` | Apply `snippet` to `file` as described in `instructions` |
|
|
119
|
+
| `set_environment_variable` | Set `PUCK_API_KEY` wherever the app runs |
|
|
120
|
+
|
|
121
|
+
### Exit codes
|
|
122
|
+
|
|
123
|
+
| Code | Meaning |
|
|
124
|
+
| ---- | ------------------------------------ |
|
|
125
|
+
| 0 | Success |
|
|
126
|
+
| 2 | Invalid arguments or API key |
|
|
127
|
+
| 3 | Unsupported or ambiguous project |
|
|
128
|
+
| 4 | File conflict |
|
|
129
|
+
| 5 | Package manager failure |
|
|
130
|
+
| 6 | `doctor` found problems |
|
|
131
|
+
| 7 | Puck Cloud couldn't complete a login |
|
|
132
|
+
| 10 | Action required |
|
|
133
|
+
| 11 | Partially set up |
|
|
134
|
+
|
|
135
|
+
### Reading the docs
|
|
136
|
+
|
|
137
|
+
The CLI includes these docs as markdown, matching its release. Use the version of the CLI that matches the project's `@puckeditor/core`:
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
npx @puckeditor/cli docs ls # every page
|
|
141
|
+
npx @puckeditor/cli docs find "dynamic fields" # find pages by title or heading
|
|
142
|
+
npx @puckeditor/cli docs grep resolveData # search page content
|
|
143
|
+
npx @puckeditor/cli docs cat api-reference/fields/text
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The latest docs are indexed at [llms.txt](https://puckeditor.com/llms.txt), and any page is available as markdown by adding `.md` to its URL. Agents with skill support can also install the [Puck skill](https://github.com/puckeditor/skills):
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
npx skills add puckeditor/skills --skill puck
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Commands
|
|
153
|
+
|
|
154
|
+
| Command | Description |
|
|
155
|
+
| ------------ | ------------------------------------------------------------------ |
|
|
156
|
+
| `init` | Set up Puck, optionally with Puck AI, creating an app if needed |
|
|
157
|
+
| `add editor` | Add the Puck editor |
|
|
158
|
+
| `add cloud` | Connect Puck Cloud (adds the editor first if needed) |
|
|
159
|
+
| `add ai` | Add the Puck AI plugin (adds Puck Cloud first if needed) |
|
|
160
|
+
| `status` | Show what's installed and configured |
|
|
161
|
+
| `doctor` | Diagnose problems and suggest fixes. Never makes changes |
|
|
162
|
+
| `docs` | Read these docs: `ls`, `cat <page>`, `find <query>`, `grep <text>` |
|
|
163
|
+
|
|
164
|
+
## Flags
|
|
165
|
+
|
|
166
|
+
| Flag | Description |
|
|
167
|
+
| -------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
168
|
+
| `--json` | Machine-readable output |
|
|
169
|
+
| `--yes`, `-y` | Apply the plan without prompting |
|
|
170
|
+
| `--dry-run` | Show the plan without changing anything or logging in |
|
|
171
|
+
| `--cwd <path>` | Run against another directory |
|
|
172
|
+
| `--workspace <name\|dir>` | Choose an app when running from a monorepo root |
|
|
173
|
+
| `--api-key <key>` | Use an existing API key instead of logging in |
|
|
174
|
+
| `--no-env-write` | Don't write `PUCK_API_KEY` to a file |
|
|
175
|
+
| `--ai` | Also set up Puck AI and Puck Cloud (`init`) |
|
|
176
|
+
| `--no-ai` | Set up the editor only, without asking about Puck AI (`init`) |
|
|
177
|
+
| `--backend <choice>` | Where a Vite app's server comes from: `add`, `external` or `none` |
|
|
178
|
+
| `--backend-url <url>` | The server for `--backend external` |
|
|
179
|
+
| `--wait` | Wait for login approval instead of returning `action_required` |
|
|
180
|
+
| `--framework <name>` | Framework for a new app: `next`, `react-router`, `tanstack-start`, `vinext`, `vite`, `astro`, `hono` or `express` |
|
|
181
|
+
| `--name <name>` | Directory for a new app |
|
|
182
|
+
| `--package-manager <name>` | Override the detected package manager |
|
|
183
|
+
| `--offline` | Skip the Puck Cloud connection check (`doctor`) |
|
|
184
|
+
|
|
185
|
+
## API keys
|
|
186
|
+
|
|
187
|
+
The CLI writes `PUCK_API_KEY` to `.env.local`, and makes sure it's ignored by git. If a key already exists in `.env.development.local`, it's updated there instead. Keys are never written to `.env`, and never printed.
|
|
188
|
+
|
|
189
|
+
To use an existing key, prefer the environment over `--api-key`, which is visible in your shell history:
|
|
190
|
+
|
|
191
|
+
```sh
|
|
192
|
+
PUCK_API_KEY=your-key npx @puckeditor/cli add cloud --yes
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Remember to set `PUCK_API_KEY` in your production environment too. `react-router-serve` and Cloudflare Workers don't load `.env` files; on Workers, use `wrangler secret put PUCK_API_KEY`.
|
|
196
|
+
|
|
197
|
+
The `/api/puck` route and the editor are public by default. Add authentication before deploying.
|
|
198
|
+
|
|
199
|
+
## Puck AI
|
|
200
|
+
|
|
201
|
+
`init` and `add ai` add the Puck AI plugin to the editor, allow design mode in the `/api/puck` route, and wrap your config with `withDynamicConfig` so components designed by Puck AI render on your pages. If your editor has been customised, the CLI leaves it alone and prints the code to add.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Composition
|
|
2
|
+
|
|
3
|
+
Puck uses compositional patterns enable completely custom editor interfaces. [See an example](https://demo.puckeditor.com/custom-ui/edit/).
|
|
4
|
+
|
|
5
|
+
## Using composition
|
|
6
|
+
|
|
7
|
+
Composition can be achieved by providing [`children`](/docs/api-reference/components/puck#children) to the [`<Puck>` component](/docs/api-reference/components/puck):
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Puck } from "@puckeditor/core";
|
|
11
|
+
|
|
12
|
+
export function Editor() {
|
|
13
|
+
return (
|
|
14
|
+
<Puck>
|
|
15
|
+
<div
|
|
16
|
+
style={{ display: "grid", gridTemplateColumns: "1fr 2fr", gridGap: 16 }}
|
|
17
|
+
>
|
|
18
|
+
<div>
|
|
19
|
+
{/* Render the drag-and-drop preview */}
|
|
20
|
+
<Puck.Preview />
|
|
21
|
+
</div>
|
|
22
|
+
<div>
|
|
23
|
+
{/* Render the component list */}
|
|
24
|
+
<Puck.Components />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</Puck>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Compositional components
|
|
33
|
+
|
|
34
|
+
Puck exposes its core components, allowing you to compose them together to create new layouts:
|
|
35
|
+
|
|
36
|
+
- [`<Puck.Components>`](/docs/api-reference/components/puck-components) - A draggable list of components.
|
|
37
|
+
- [`<Puck.Fields>`](/docs/api-reference/components/puck-fields) - The fields for the currently selected item.
|
|
38
|
+
- [`<Puck.Outline>`](/docs/api-reference/components/puck-outline) - An interactive outline.
|
|
39
|
+
- [`<Puck.Preview>`](/docs/api-reference/components/puck-preview) - A drag-and-drop preview.
|
|
40
|
+
|
|
41
|
+
The internal UI for these components can also be changed by implementing [UI overrides](/docs/extending-puck/ui-overrides) or [theming](/docs/extending-puck/theming).
|
|
42
|
+
|
|
43
|
+
### Helper components
|
|
44
|
+
|
|
45
|
+
Puck also exposes helper components for even deeper customization:
|
|
46
|
+
|
|
47
|
+
- [`<Drawer>`](/docs/api-reference/components/drawer) - A reference list of items that can be dragged into a droppable area, normally `<Puck.Preview>`.
|
|
48
|
+
- [`<Drawer.Item>`](/docs/api-reference/components/drawer-item) - An item that can be dragged from a `<Drawer>`.
|
|
49
|
+
- [`<FieldLabel>`](/docs/api-reference/components/field-label) - A styled label for creating inputs.
|
|
50
|
+
|
|
51
|
+
## Further reading
|
|
52
|
+
|
|
53
|
+
- [Internal Puck API](/docs/extending-puck/internal-puck-api)
|
|
54
|
+
- [UI overrides](/docs/extending-puck/ui-overrides)
|