@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,422 @@
|
|
|
1
|
+
# Richtext
|
|
2
|
+
|
|
3
|
+
Render a Rich Text editor field. Extends [Base](/docs/api-reference/fields/base).
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
const config = {
|
|
7
|
+
components: {
|
|
8
|
+
Example: {
|
|
9
|
+
fields: {
|
|
10
|
+
body: {
|
|
11
|
+
type: "richtext",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
render: ({ body }) => body,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Params
|
|
21
|
+
|
|
22
|
+
| Param | Example | Type | Status |
|
|
23
|
+
| ---------------------------------------------- | ------------------------------------------ | ---------------- | -------- |
|
|
24
|
+
| [`type`](#type) | `type: "richtext"` | "richtext" | Required |
|
|
25
|
+
| [`contentEditable`](#contentEditable) | `contentEditable: false` | Boolean | - |
|
|
26
|
+
| [`initialHeight`](#initialheight) | `initialHeight: 312` | Number \| String | - |
|
|
27
|
+
| [`options`](#options) | `options: { bold: false }` | Object | - |
|
|
28
|
+
| [`renderMenu()`](#rendermenuprops) | `renderMenu: () => <RichTextMenu />` | Function | - |
|
|
29
|
+
| [`renderInlineMenu()`](#renderinlinemenuprops) | `renderInlineMenu: () => <RichTextMenu />` | Function | - |
|
|
30
|
+
| [`tiptap.extensions`](#tiptapextensions) | `extensions: []` | Array | - |
|
|
31
|
+
| [`tiptap.selector`](#tiptapselector) | `selector: (ctx) => ({ ... })` | Function | - |
|
|
32
|
+
|
|
33
|
+
## Required params
|
|
34
|
+
|
|
35
|
+
### `type`
|
|
36
|
+
|
|
37
|
+
The type of the field. Must be `"richtext"` for RichText fields.
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
const config = {
|
|
41
|
+
components: {
|
|
42
|
+
Example: {
|
|
43
|
+
fields: {
|
|
44
|
+
description: {
|
|
45
|
+
type: "richtext",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
// ...
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Optional params
|
|
55
|
+
|
|
56
|
+
### `contentEditable`
|
|
57
|
+
|
|
58
|
+
Enable inline text editing for this field. Defaults to `false`.
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
const config = {
|
|
62
|
+
components: {
|
|
63
|
+
Example: {
|
|
64
|
+
fields: {
|
|
65
|
+
description: {
|
|
66
|
+
type: "richtext",
|
|
67
|
+
contentEditable: true,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
// ...
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `initialHeight`
|
|
77
|
+
|
|
78
|
+
Set the initial height for the field input. Defaults to `192`.
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
const config = {
|
|
82
|
+
components: {
|
|
83
|
+
Example: {
|
|
84
|
+
fields: {
|
|
85
|
+
description: {
|
|
86
|
+
type: "richtext",
|
|
87
|
+
initialHeight: 312,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
// ...
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
> **Note:** Does not apply to inline fields when using
|
|
97
|
+
> [`contentEditable`](#contenteditable).
|
|
98
|
+
|
|
99
|
+
### `options`
|
|
100
|
+
|
|
101
|
+
The Rich Text field is built with [Tiptap](https://tiptap.dev). Configure Puck's [included Tiptap extensions](#included-extensions) to modify editing behaviour.
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
const config = {
|
|
105
|
+
components: {
|
|
106
|
+
Example: {
|
|
107
|
+
fields: {
|
|
108
|
+
description: {
|
|
109
|
+
type: "richtext",
|
|
110
|
+
options: {
|
|
111
|
+
// Disable an included extension
|
|
112
|
+
bold: false,
|
|
113
|
+
|
|
114
|
+
// Configure an included extension
|
|
115
|
+
heading: { levels: [1, 2] },
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
// ...
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### Included extensions
|
|
126
|
+
|
|
127
|
+
- [`Blockquote`](https://tiptap.dev/docs/editor/extensions/nodes/blockquote)
|
|
128
|
+
- [`Bold`](https://tiptap.dev/docs/editor/extensions/marks/bold)
|
|
129
|
+
- [`BulletList`](https://tiptap.dev/docs/editor/extensions/nodes/bullet-list)
|
|
130
|
+
- [`Code`](https://tiptap.dev/docs/editor/extensions/marks/code)
|
|
131
|
+
- [`CodeBlock`](https://tiptap.dev/docs/editor/extensions/nodes/code-block)
|
|
132
|
+
- [`Document`](https://tiptap.dev/docs/editor/extensions/nodes/document)
|
|
133
|
+
- [`HardBreak`](https://tiptap.dev/docs/editor/extensions/nodes/hard-break)
|
|
134
|
+
- [`Heading`](https://tiptap.dev/docs/editor/extensions/nodes/heading)
|
|
135
|
+
- [`HorizontalRule`](https://tiptap.dev/docs/editor/extensions/nodes/horizontal-rule)
|
|
136
|
+
- [`Italic`](https://tiptap.dev/docs/editor/extensions/marks/italic)
|
|
137
|
+
- [`ListItem`](https://tiptap.dev/docs/editor/extensions/nodes/list-item)
|
|
138
|
+
- [`ListKeymap`](https://tiptap.dev/docs/editor/extensions/functionality/listkeymap)
|
|
139
|
+
- [`Link`](https://tiptap.dev/docs/editor/extensions/marks/link)
|
|
140
|
+
- [`OrderedList`](https://tiptap.dev/docs/editor/extensions/nodes/ordered-list)
|
|
141
|
+
- [`Paragraph`](https://tiptap.dev/docs/editor/extensions/nodes/paragraph)
|
|
142
|
+
- [`Strike`](https://tiptap.dev/docs/editor/extensions/marks/strike)
|
|
143
|
+
- [`Text`](https://tiptap.dev/docs/editor/extensions/nodes/text)
|
|
144
|
+
- [`TextAlign`](https://tiptap.dev/docs/editor/extensions/functionality/textalign)
|
|
145
|
+
- [`Underline`](https://tiptap.dev/docs/editor/extensions/marks/underline)
|
|
146
|
+
|
|
147
|
+
### `renderMenu(props)`
|
|
148
|
+
|
|
149
|
+
Render a custom menu for the field. Use with the [`<RichTextMenu>`](/docs/api-reference/components-rich-text-menu) component to arrange existing controls, or introduce new ones.
|
|
150
|
+
|
|
151
|
+
Receives [Menu Render Props](#menu-render-props).
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import { RichTextMenu } from "@puckeditor/core";
|
|
155
|
+
|
|
156
|
+
const config = {
|
|
157
|
+
components: {
|
|
158
|
+
Example: {
|
|
159
|
+
fields: {
|
|
160
|
+
description: {
|
|
161
|
+
type: "richtext",
|
|
162
|
+
renderMenu: ({ children }) => (
|
|
163
|
+
<RichTextMenu>
|
|
164
|
+
{/* Render default menu */}
|
|
165
|
+
{children}
|
|
166
|
+
|
|
167
|
+
<RichTextMenu.Group>
|
|
168
|
+
{/* Render a Blockquote control */}
|
|
169
|
+
<RichTextMenu.Blockquote />
|
|
170
|
+
|
|
171
|
+
{/* Render a custom control */}
|
|
172
|
+
<RichTextMenu.Control {/* ... */} />
|
|
173
|
+
|
|
174
|
+
</RichTextMenu.Group>
|
|
175
|
+
</RichTextMenu>
|
|
176
|
+
),
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
// ...
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### `renderInlineMenu(props)`
|
|
186
|
+
|
|
187
|
+
Render a custom inline menu when using [`contentEditable`](#contenteditable). Use with the [`<RichTextMenu>`](/docs/api-reference/components-rich-text-menu) component to arrange existing controls, or introduce new ones.
|
|
188
|
+
|
|
189
|
+
Receives [Menu Render Props](#menu-render-props).
|
|
190
|
+
|
|
191
|
+
```tsx
|
|
192
|
+
import { RichTextMenu } from "@puckeditor/core";
|
|
193
|
+
|
|
194
|
+
const config = {
|
|
195
|
+
components: {
|
|
196
|
+
Example: {
|
|
197
|
+
fields: {
|
|
198
|
+
description: {
|
|
199
|
+
type: "richtext",
|
|
200
|
+
contentEditable: true,
|
|
201
|
+
renderInlineMenu: ({ children }) => (
|
|
202
|
+
<RichTextMenu>
|
|
203
|
+
{/* Render default menu */}
|
|
204
|
+
{children}
|
|
205
|
+
|
|
206
|
+
<RichTextMenu.Group>
|
|
207
|
+
{/* Render a Blockquote control */}
|
|
208
|
+
<RichTextMenu.Blockquote />
|
|
209
|
+
|
|
210
|
+
{/* Render a custom control */}
|
|
211
|
+
<RichTextMenu.Control {/* ... */} />
|
|
212
|
+
|
|
213
|
+
</RichTextMenu.Group>
|
|
214
|
+
</RichTextMenu>
|
|
215
|
+
),
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
// ...
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### `tiptap.extensions`
|
|
225
|
+
|
|
226
|
+
Provide custom [Tiptap extensions](https://tiptap.dev/docs/editor/extensions/overview) to the editor to deeply customize behavior. See [included extensions](#included-extensions).
|
|
227
|
+
|
|
228
|
+
```tsx
|
|
229
|
+
import Emoji from "@tiptap/extension-emoji";
|
|
230
|
+
|
|
231
|
+
const config = {
|
|
232
|
+
components: {
|
|
233
|
+
Example: {
|
|
234
|
+
fields: {
|
|
235
|
+
description: {
|
|
236
|
+
type: "richtext",
|
|
237
|
+
tiptap: {
|
|
238
|
+
extensions: [Emoji],
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
> **Note:** TipTap maintains an extensive [library of
|
|
248
|
+
> extensions](https://tiptap.dev/docs/editor/extensions/overview) and
|
|
249
|
+
> documentation for [developing your
|
|
250
|
+
> own](https://tiptap.dev/docs/editor/extensions/custom-extensions).
|
|
251
|
+
|
|
252
|
+
### `tiptap.selector`
|
|
253
|
+
|
|
254
|
+
Extend the [default editor state](#included-state) to access additional editor information in the menu. See [Tiptap docs](https://tiptap.dev/docs/editor/getting-started/install/react#reacting-to-editor-state-changes).
|
|
255
|
+
|
|
256
|
+
```tsx
|
|
257
|
+
import { RichTextMenu } from "@puckeditor/core";
|
|
258
|
+
|
|
259
|
+
const config = {
|
|
260
|
+
components: {
|
|
261
|
+
Example: {
|
|
262
|
+
fields: {
|
|
263
|
+
description: {
|
|
264
|
+
type: "richtext",
|
|
265
|
+
tiptap: {
|
|
266
|
+
selector: ({ editor, readOnly }) => ({
|
|
267
|
+
isHighlight: editor?.isActive("highlight"),
|
|
268
|
+
canHighlight:
|
|
269
|
+
!readOnly && editor?.can().chain().toggleHighlight().run(),
|
|
270
|
+
}),
|
|
271
|
+
},
|
|
272
|
+
renderMenu: ({ editorState }) => (
|
|
273
|
+
<RichTextMenu>
|
|
274
|
+
<RichTextMenu.Group>
|
|
275
|
+
<button disabled={editorState?.canHighlight}>
|
|
276
|
+
{editorState?.isHighlight ? "Unhighlight" : "Highlight"}
|
|
277
|
+
</button>
|
|
278
|
+
</RichTextMenu.Group>
|
|
279
|
+
</RichTextMenu>
|
|
280
|
+
),
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Menu Render Props
|
|
289
|
+
|
|
290
|
+
Render props for [`renderMenu()`](/docs/api-reference/fields/rendermenuprops) and [`renderInlineMenu()`](#renderinlinemenuprops) APIs.
|
|
291
|
+
|
|
292
|
+
| Param | Example | Type |
|
|
293
|
+
| ----------------------------- | ---------------- | ------------------- |
|
|
294
|
+
| [`children`](#children) | `<div />` | ReactNode |
|
|
295
|
+
| [`editor`](#editor) | `{}` | Editor \| null |
|
|
296
|
+
| [`editorState`](#editorstate) | `{isBold: true}` | EditorState \| null |
|
|
297
|
+
|
|
298
|
+
### `children`
|
|
299
|
+
|
|
300
|
+
The default menu items. Include this to extend the existing menu.
|
|
301
|
+
|
|
302
|
+
```tsx
|
|
303
|
+
import { RichTextMenu } from "@puckeditor/core";
|
|
304
|
+
|
|
305
|
+
const config = {
|
|
306
|
+
components: {
|
|
307
|
+
Example: {
|
|
308
|
+
fields: {
|
|
309
|
+
description: {
|
|
310
|
+
type: "richtext",
|
|
311
|
+
renderMenu: ({ children }) => (
|
|
312
|
+
<RichTextMenu>
|
|
313
|
+
{/* Render default menu */}
|
|
314
|
+
{children}
|
|
315
|
+
|
|
316
|
+
<RichTextMenu.Group>
|
|
317
|
+
{/* Render a Blockquote control */}
|
|
318
|
+
<RichTextMenu.Blockquote />
|
|
319
|
+
</RichTextMenu.Group>
|
|
320
|
+
</RichTextMenu>
|
|
321
|
+
),
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
// ...
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### `editor`
|
|
331
|
+
|
|
332
|
+
The Tiptap [Editor Instance](https://tiptap.dev/docs/editor/api/editor). Use this to implement custom controls based on Puck's [included extensions](#included-extensions), and additional extensions provided by [`tiptap.extensions`](#tiptapextensions).
|
|
333
|
+
|
|
334
|
+
```tsx
|
|
335
|
+
import { RichTextMenu } from "@puckeditor/core";
|
|
336
|
+
|
|
337
|
+
const config = {
|
|
338
|
+
components: {
|
|
339
|
+
Example: {
|
|
340
|
+
fields: {
|
|
341
|
+
description: {
|
|
342
|
+
type: "richtext",
|
|
343
|
+
renderMenu: ({ editor }) => (
|
|
344
|
+
<RichTextMenu>
|
|
345
|
+
<RichTextMenu.Group>
|
|
346
|
+
<button
|
|
347
|
+
onClick={() =>
|
|
348
|
+
editor?.chain().focus().toggleBlockquote().run()
|
|
349
|
+
}
|
|
350
|
+
>
|
|
351
|
+
Quote
|
|
352
|
+
</button>
|
|
353
|
+
</RichTextMenu.Group>
|
|
354
|
+
</RichTextMenu>
|
|
355
|
+
),
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
// ...
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
};
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### `editorState`
|
|
365
|
+
|
|
366
|
+
Access editor state information without causing re-renders. Provides the [included state](#included-state), and additional state provided by [`tiptap.selector`](#tiptapselector).
|
|
367
|
+
|
|
368
|
+
```tsx
|
|
369
|
+
import { RichTextMenu } from "@puckeditor/core";
|
|
370
|
+
|
|
371
|
+
const config = {
|
|
372
|
+
components: {
|
|
373
|
+
Example: {
|
|
374
|
+
fields: {
|
|
375
|
+
description: {
|
|
376
|
+
type: "richtext",
|
|
377
|
+
renderMenu: ({ editorState }) => (
|
|
378
|
+
<RichTextMenu>
|
|
379
|
+
{editorState?.isBold ? "Bold" : "Not bold"}
|
|
380
|
+
</RichTextMenu>
|
|
381
|
+
),
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
// ...
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
};
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
#### Included state
|
|
391
|
+
|
|
392
|
+
- `isAlignLeft`
|
|
393
|
+
- `canAlignLeft`
|
|
394
|
+
- `isAlignCenter`
|
|
395
|
+
- `canAlignCenter`
|
|
396
|
+
- `isAlignRight`
|
|
397
|
+
- `canAlignRight`
|
|
398
|
+
- `isAlignJustify`
|
|
399
|
+
- `canAlignJustify`
|
|
400
|
+
- `isBold`
|
|
401
|
+
- `canBold`
|
|
402
|
+
- `isItalic`
|
|
403
|
+
- `canItalic`
|
|
404
|
+
- `isUnderline`
|
|
405
|
+
- `canUnderline`
|
|
406
|
+
- `isStrike`
|
|
407
|
+
- `canStrike`
|
|
408
|
+
- `isInlineCode`
|
|
409
|
+
- `canInlineCode`
|
|
410
|
+
- `isBulletList`
|
|
411
|
+
- `canBulletList`
|
|
412
|
+
- `isOrderedList`
|
|
413
|
+
- `canOrderedList`
|
|
414
|
+
- `isCodeBlock`
|
|
415
|
+
- `canCodeBlock`
|
|
416
|
+
- `isBlockquote`
|
|
417
|
+
- `canBlockquote`
|
|
418
|
+
- `canHorizontalRule`
|
|
419
|
+
|
|
420
|
+
### `readOnly`
|
|
421
|
+
|
|
422
|
+
Whether or not the field is currently read-only.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
Render a `select` input with a list of options. Extends [Base](/docs/api-reference/fields/base).
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
const config = {
|
|
7
|
+
components: {
|
|
8
|
+
Example: {
|
|
9
|
+
fields: {
|
|
10
|
+
textAlign: {
|
|
11
|
+
type: "select",
|
|
12
|
+
options: [
|
|
13
|
+
{ label: "Left", value: "left" },
|
|
14
|
+
{ label: "Right", value: "right" },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
render: ({ textAlign }) => {
|
|
19
|
+
return <p style={{ textAlign }}>Hello, world</p>;
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Params
|
|
27
|
+
|
|
28
|
+
| Param | Example | Type | Status |
|
|
29
|
+
| --------------------- | ----------------------------------------------------- | -------- | -------- |
|
|
30
|
+
| [`type`](#type) | `type: "select"` | "select" | Required |
|
|
31
|
+
| [`options`](#options) | `options: [{ label: "Option 1", value: "option-1" }]` | Object[] | Required |
|
|
32
|
+
|
|
33
|
+
## Required params
|
|
34
|
+
|
|
35
|
+
### `type`
|
|
36
|
+
|
|
37
|
+
The type of the field. Must be `"select"` for Array fields.
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
const config = {
|
|
41
|
+
components: {
|
|
42
|
+
Example: {
|
|
43
|
+
fields: {
|
|
44
|
+
textAlign: {
|
|
45
|
+
type: "select",
|
|
46
|
+
options: [
|
|
47
|
+
{ label: "Left", value: "left" },
|
|
48
|
+
{ label: "Right", value: "right" },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
// ...
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `options`
|
|
59
|
+
|
|
60
|
+
The options for the select field. The `value` can be a String, Number or Boolean.
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
const config = {
|
|
64
|
+
components: {
|
|
65
|
+
Example: {
|
|
66
|
+
fields: {
|
|
67
|
+
textAlign: {
|
|
68
|
+
type: "select",
|
|
69
|
+
options: [
|
|
70
|
+
{ label: "Left", value: "left" },
|
|
71
|
+
{ label: "Right", value: "right" },
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
// ...
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
```
|