@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,168 @@
|
|
|
1
|
+
# `AppState`
|
|
2
|
+
|
|
3
|
+
> **Note:** The application state is unstable and is likely to experience breaking
|
|
4
|
+
> changes.
|
|
5
|
+
|
|
6
|
+
The internal state of the [`<Puck>`](/docs/api-reference/components/puck) component.
|
|
7
|
+
|
|
8
|
+
## `data`
|
|
9
|
+
|
|
10
|
+
The current [`Data`](/docs/api-reference/data-model/data) payload being managed by Puck.
|
|
11
|
+
|
|
12
|
+
## `ui`
|
|
13
|
+
|
|
14
|
+
The current state of the Puck editor interface.
|
|
15
|
+
|
|
16
|
+
| Param | Example | Type |
|
|
17
|
+
| ----------------------------------------------- | ----------------------------------------------------- | ----------------------------- |
|
|
18
|
+
| [`arrayState`](#uiarraystate) | `{}` | Object |
|
|
19
|
+
| [`componentList`](#uicomponentlist) | `{ typography: { components: [ "HeadingBlock" ] } }` | Object |
|
|
20
|
+
| [`field.focus`](#fieldfocus) | `"title"` | String |
|
|
21
|
+
| [`isDragging`](#isdragging) | `false` | Boolean |
|
|
22
|
+
| [`itemSelector`](#uiitemselector) | `{ index: 0, zone: "my-content" }` | [ItemSelector](/docs/api-reference/data-model/item-selector) |
|
|
23
|
+
| [`leftSideBarVisible`](#uileftsidebarvisible) | `false` | Boolean |
|
|
24
|
+
| [`leftSideBarWidth`](#uileftsidebarwidth) | `200` | Number |
|
|
25
|
+
| [`mobilePanelExpanded`](#uimobilepanelexpanded) | `true` | Boolean |
|
|
26
|
+
| [`plugin`](#uiplugin) | `{ current: "blocks" }` | Object |
|
|
27
|
+
| [`previewMode`](#uipreviewmode) | `"edit"` | String |
|
|
28
|
+
| [`rightSideBarVisible`](#uirightsidebarvisible) | `false` | Boolean |
|
|
29
|
+
| [`rightSideBarWidth`](#uirightsidebarwidth) | `200` | Number |
|
|
30
|
+
| [`viewports`](#uiviewports) | `{ controlsVisible: true, current: {}, options: [] }` | Object |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
### `ui.arrayState`
|
|
35
|
+
|
|
36
|
+
An object describing the internal state of array items
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
### `ui.componentList`
|
|
41
|
+
|
|
42
|
+
An object describing the component drawer. Similar shape to the [categories API](/docs/api-reference/configuration/config#categories)
|
|
43
|
+
|
|
44
|
+
#### `ui.componentList[key].components`
|
|
45
|
+
|
|
46
|
+
Array containing the names of components in this category.
|
|
47
|
+
|
|
48
|
+
#### `ui.componentList[key].title`
|
|
49
|
+
|
|
50
|
+
Title of the category.
|
|
51
|
+
|
|
52
|
+
#### `ui.componentList[key].visible`
|
|
53
|
+
|
|
54
|
+
Whether or not the category is visible in the side bar.
|
|
55
|
+
|
|
56
|
+
#### `ui.componentList[key].expanded`
|
|
57
|
+
|
|
58
|
+
Whether or not the category is expanded in the side bar.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### `ui.field.focus`
|
|
63
|
+
|
|
64
|
+
The name of the currently focused field.
|
|
65
|
+
|
|
66
|
+
### `ui.field.metadata`
|
|
67
|
+
|
|
68
|
+
Metadata for the the currently focused field.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### `ui.isDragging`
|
|
73
|
+
|
|
74
|
+
A boolean stating whether or not the user is currently dragging a component.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### `ui.itemSelector`
|
|
79
|
+
|
|
80
|
+
An [`ItemSelector`](/docs/api-reference/data-model/item-selector) for the currently selected item.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### `ui.leftSideBarVisible`
|
|
85
|
+
|
|
86
|
+
Whether or not the left side bar is visible.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### `ui.leftSideBarWidth`
|
|
91
|
+
|
|
92
|
+
Current width of the left side bar in pixels.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### `ui.mobilePanelExpanded`
|
|
97
|
+
|
|
98
|
+
Indicates whether the mobile plugin panel is expanded when the [`mobilePanelHeight` parameter](/docs/api-reference/plugin#mobilepanelheight) is set to `"toggle"`. Users toggle this value via the maximize/minimize button that appears on smaller viewports.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### `ui.plugin`
|
|
103
|
+
|
|
104
|
+
| Param | Example | Type |
|
|
105
|
+
| ----------------------------- | ---------- | ------ |
|
|
106
|
+
| [`current`](#uiplugincurrent) | `"blocks"` | String |
|
|
107
|
+
|
|
108
|
+
#### `ui.plugin.current`
|
|
109
|
+
|
|
110
|
+
The currently selected plugin in the plugin rail. Matches the plugin [`name` parameter](/docs/api-reference/plugin#name).
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### `ui.previewMode`
|
|
115
|
+
|
|
116
|
+
The mode for the preview area, controlling whether or not the user can interact with the underlying component. Accepts the following values:
|
|
117
|
+
|
|
118
|
+
- **`"edit"` (default)**: Components can be dragged and modified. An overlay prevents interaction with the underlying component.
|
|
119
|
+
- **`"interactive"`**: Editing functionality is disabled. The user can interact with the underlying component.
|
|
120
|
+
|
|
121
|
+
Puck does not currently provide the UI to control this value, but it can be toggled via the `cmd+i` or `ctrl+i` hotkeys.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### `ui.rightSideBarVisible`
|
|
126
|
+
|
|
127
|
+
Whether or not the right side bar is visible.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### `ui.rightSideBarWidth`
|
|
132
|
+
|
|
133
|
+
Current width of the right side bar in pixels.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### `ui.viewports`
|
|
138
|
+
|
|
139
|
+
| Param | Example | Type |
|
|
140
|
+
| ------------------------------------------------ | --------------------------------- | -------------------------------------------------------------------- |
|
|
141
|
+
| [`controlsVisible`](#uiviewportscontrolsvisible) | `false` | Boolean |
|
|
142
|
+
| [`current`](#uiviewportscurrent) | `{ width: 1440, height: "auto" }` | Object |
|
|
143
|
+
| [`options`](#uiviewportsoptions) | `[]` | [Viewports\[\]](/docs/api-reference/components/puck#viewport-params) |
|
|
144
|
+
|
|
145
|
+
#### `ui.viewports.controlsVisible`
|
|
146
|
+
|
|
147
|
+
Whether or not the viewport controls are visible.
|
|
148
|
+
|
|
149
|
+
#### `ui.viewports.current`
|
|
150
|
+
|
|
151
|
+
The currently selected viewport.
|
|
152
|
+
|
|
153
|
+
| Param | Example | Type |
|
|
154
|
+
| ------------------------------------- | -------- | ------------------ |
|
|
155
|
+
| [`width`](#uiviewportscurrentwidth) | `1440` | Number |
|
|
156
|
+
| [`height`](#uiviewportscurrentheight) | `"auto"` | Number \| `"auto"` |
|
|
157
|
+
|
|
158
|
+
##### `ui.viewports.current.width`
|
|
159
|
+
|
|
160
|
+
The width of the current viewport.
|
|
161
|
+
|
|
162
|
+
##### `ui.viewports.current.height`
|
|
163
|
+
|
|
164
|
+
The height of the current viewport.
|
|
165
|
+
|
|
166
|
+
#### `ui.viewports.options`
|
|
167
|
+
|
|
168
|
+
The available viewport options, as provided via the [`viewports` API](/docs/api-reference/components/puck#viewports).
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# `ComponentData`
|
|
2
|
+
|
|
3
|
+
An object representing an instance of a component.
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"type": "HeadingBlock",
|
|
8
|
+
"props": {
|
|
9
|
+
"id": "HeadingBlock-1234",
|
|
10
|
+
"title": "Hello, world"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Params
|
|
16
|
+
|
|
17
|
+
| Param | Example | Type | Status |
|
|
18
|
+
| ----------------------- | ----------------------------------------------- | ------ | -------- |
|
|
19
|
+
| [`type`](#type) | `type: "HeadingBlock"` | String | Required |
|
|
20
|
+
| [`props`](#props) | `props: { id: "12345", title: "Hello, world" }` | Object | Required |
|
|
21
|
+
| [`readOnly`](#readonly) | `readOnly: { title: true }` | Object | - |
|
|
22
|
+
|
|
23
|
+
### Required params
|
|
24
|
+
|
|
25
|
+
#### `type`
|
|
26
|
+
|
|
27
|
+
The type of the component, which tells Puck to run the [`render()`](/docs/api-reference/configuration/component-config#renderprops) method for the component of the [same key](/docs/api-reference/configuration/config#components).
|
|
28
|
+
|
|
29
|
+
#### `props`
|
|
30
|
+
|
|
31
|
+
The props stored based on the [`component config`](/docs/api-reference/configuration/component-config) that Puck will pass to the [`render()`](/docs/api-reference/configuration/component-config#renderprops) method for the component.
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"type": "HeadingBlock",
|
|
36
|
+
"props": {
|
|
37
|
+
"id": "HeadingBlock-1234", // Auto-generated
|
|
38
|
+
"title": "Hello, world"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Requires a unique `id` prop to be defined.
|
|
44
|
+
|
|
45
|
+
### Optional params
|
|
46
|
+
|
|
47
|
+
#### `readOnly`
|
|
48
|
+
|
|
49
|
+
An object describing which fields are set to [read-only](/docs/api-reference/configuration/component-config#datareadonly-1).
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"type": "HeadingBlock",
|
|
54
|
+
"props": {
|
|
55
|
+
"id": "HeadingBlock-1234",
|
|
56
|
+
"title": "Hello, world"
|
|
57
|
+
},
|
|
58
|
+
"readOnly": {
|
|
59
|
+
"title": true
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# `Data`
|
|
2
|
+
|
|
3
|
+
An object produced by Puck describing the shape of content.
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"content": [
|
|
8
|
+
{
|
|
9
|
+
"type": "HeadingBlock",
|
|
10
|
+
"props": {
|
|
11
|
+
"id": "HeadingBlock-1234",
|
|
12
|
+
"title": "Hello, world"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"root": { "props": { "title": "Puck Example" } },
|
|
17
|
+
"zones": {}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Params
|
|
22
|
+
|
|
23
|
+
| Param | Example | Type | Status |
|
|
24
|
+
| --------------------- | ---------------------------------------- | ---------------------------------------------------------------- | -------- |
|
|
25
|
+
| [`content`](#content) | `content: []` | [ComponentData](/docs/api-reference/data-model/component-data)[] | Required |
|
|
26
|
+
| [`root`](#root) | `root: { props: { title: "My page" } }` | [RootData](/docs/api-reference/root-data) | Required |
|
|
27
|
+
| [`zones`](#zones) | `zones: { "HeadingBlock-123:zone": [] }` | Object | - |
|
|
28
|
+
|
|
29
|
+
### `content`
|
|
30
|
+
|
|
31
|
+
An array of [ComponentData](/docs/api-reference/data-model/component-data) objects representing the component instances in the default content region.
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"content": [
|
|
36
|
+
{
|
|
37
|
+
"type": "HeadingBlock",
|
|
38
|
+
"props": {
|
|
39
|
+
"id": "HeadingBlock-1234",
|
|
40
|
+
"title": "Hello, world"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"root": {},
|
|
45
|
+
"zones": {}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### `root`
|
|
50
|
+
|
|
51
|
+
An object describing data for the [`root` config](/docs/api-reference/configuration/config#root). An instance of [`RootData`](/docs/api-reference/root-data).
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"content": [],
|
|
56
|
+
"root": {
|
|
57
|
+
"props": {
|
|
58
|
+
"title": "My page"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"zones": {}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### `zones`
|
|
66
|
+
|
|
67
|
+
> **Note:** This parameter will soon be deprecated, as DropZones have been replaced by
|
|
68
|
+
> [`slot` fields](/docs/api-reference/fields/slot). For migration notes, see
|
|
69
|
+
> [these docs](/docs/guides/migrations/dropzones-to-slots).
|
|
70
|
+
|
|
71
|
+
An object describing nested content regions for each [DropZone](/docs/api-reference/components/drop-zone).
|
|
72
|
+
|
|
73
|
+
#### `zones[zoneKey]`
|
|
74
|
+
|
|
75
|
+
An array of [ComponentData](/docs/api-reference/data-model/component-data) objects representing the components instances in a particular DropZone.
|
|
76
|
+
|
|
77
|
+
`zoneKey` is a compound of the component `id` and [DropZone `zone`](/docs/api-reference/components/drop-zone#zone).
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"content": [],
|
|
82
|
+
"root": {},
|
|
83
|
+
"zones": {
|
|
84
|
+
"HeadingBlock-1234:my-content": [
|
|
85
|
+
{
|
|
86
|
+
"type": "HeadingBlock",
|
|
87
|
+
"props": {
|
|
88
|
+
"id": "HeadingBlock-1234",
|
|
89
|
+
"title": "Hello, world"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# `ItemSelector`
|
|
2
|
+
|
|
3
|
+
An object describing the location of an item in the Puck [data](/docs/api-reference/data-model/data).
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"index": 0,
|
|
8
|
+
"zone": "Flex-123:children" // The "children" slot field in the component with id "Flex-123"
|
|
9
|
+
}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Params
|
|
13
|
+
|
|
14
|
+
| Param | Example | Type | Status |
|
|
15
|
+
| ----------------- | ----------------------------- | ------ | -------- |
|
|
16
|
+
| [`index`](#index) | `index: 0` | Number | Required |
|
|
17
|
+
| [`zone`](#zone) | `zone: "Flex-123:children" }` | String | - |
|
|
18
|
+
|
|
19
|
+
### `index`
|
|
20
|
+
|
|
21
|
+
The index of the item.
|
|
22
|
+
|
|
23
|
+
### `zone`
|
|
24
|
+
|
|
25
|
+
An optional string representing the location of the item. It is a concatenation of two values, joined with a colon (`:`):
|
|
26
|
+
|
|
27
|
+
1. The id of the parent component
|
|
28
|
+
2. The name of the [slot field](/docs/api-reference/fields/slot) or [DropZone `zone`](/docs/api-reference/components/drop-zone#zone) value
|
|
29
|
+
|
|
30
|
+
The root of the payload is represented by the `root` id. The default content is represented by `default-zone`. When not provided, `zone` will contain the value `root:default-zone`, injecting data into [`content`](/docs/api-reference/data-model/data#content)
|
|
31
|
+
|
|
32
|
+
> **Note:** DropZones have been replaced by [`slot`
|
|
33
|
+
> fields](/docs/api-reference/fields/slot). For migration notes, see [these
|
|
34
|
+
> docs](/docs/guides/migrations/dropzones-to-slots).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# `RootData`
|
|
2
|
+
|
|
3
|
+
An object representing the root data. Similar to [`ComponentData`](/docs/api-reference/data-model/component-data).
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"props": {
|
|
8
|
+
"title": "Hello, world"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Params
|
|
14
|
+
|
|
15
|
+
| Param | Example | Type | Status |
|
|
16
|
+
| ------------------------------ | ---------------------------------- | ------ | -------- |
|
|
17
|
+
| [`props`](#contentprops) | `props: { title: "Hello, world" }` | Object | Required |
|
|
18
|
+
| [`readOnly`](#contentreadonly) | `readOnly: { title: true }` | Object | - |
|
|
19
|
+
|
|
20
|
+
### Required params
|
|
21
|
+
|
|
22
|
+
#### `type`
|
|
23
|
+
|
|
24
|
+
The type of the component, which tells Puck to run the [`render()`](/docs/api-reference/configuration/component-config#renderprops) method for the component of the [same key](/docs/api-reference/config#components).
|
|
25
|
+
|
|
26
|
+
#### `props`
|
|
27
|
+
|
|
28
|
+
The props stored based on the [`component config`](/docs/api-reference/configuration/component-config) that Puck will pass to the [`render()`](/docs/api-reference/configuration/component-config#renderprops) method for the component of the [same key](/docs/api-reference/config#components).
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"type": "HeadingBlock",
|
|
33
|
+
"props": {
|
|
34
|
+
"id": "HeadingBlock-1234",
|
|
35
|
+
"title": "Hello, world"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Requires `id` unless used for [`root`](/docs/api-reference/data-model/data#root).
|
|
41
|
+
|
|
42
|
+
### Optional params
|
|
43
|
+
|
|
44
|
+
#### `readOnly`
|
|
45
|
+
|
|
46
|
+
An object describing which fields are set to [read-only](/docs/api-reference/configuration/component-config#datareadonly-1).
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"type": "HeadingBlock",
|
|
51
|
+
"props": {
|
|
52
|
+
"id": "HeadingBlock-1234",
|
|
53
|
+
"title": "Hello, world"
|
|
54
|
+
},
|
|
55
|
+
"readOnly": {
|
|
56
|
+
"title": true
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Data Model
|
|
2
|
+
|
|
3
|
+
The Puck data model
|
|
4
|
+
|
|
5
|
+
- [AppState](/docs/api-reference/data-model/app-state) - Puck's internal state.
|
|
6
|
+
- [ComponentData](/docs/api-reference/data-model/component-data) - The data model for each component instance.
|
|
7
|
+
- [Data](/docs/api-reference/data-model/data) - The data model produced by Puck for a page.
|
|
8
|
+
- [RootData](/docs/api-reference/data-model/root-data) - The data model for the root data.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Dictionary
|
|
2
|
+
|
|
3
|
+
The dictionary defines the text strings used throughout Puck's UI.
|
|
4
|
+
|
|
5
|
+
Use this to implement [localization](/docs/integrating-puck/localization) or to override default messages:
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
const dictionary = {
|
|
9
|
+
"header-publish": "Save",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
<Puck dictionary={dictionary} />;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
When a default string contains a template variable (e.g. `{count}`), you can use that to position the variable in your string:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
const dictionary = {
|
|
19
|
+
"field-external-result-singular": "Total: {count}",
|
|
20
|
+
"field-external-result-plural": "Total: {count}",
|
|
21
|
+
};
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The dictionary also accepts your own keys, which you can read from the [internal Puck API](/docs/api-reference/puck-api#dictionary). See [Custom strings](/docs/integrating-puck/localization#custom-strings).
|
|
25
|
+
|
|
26
|
+
## Tokens
|
|
27
|
+
|
|
28
|
+
Tokens follow a `{area}-{name}-{variant}` format.
|
|
29
|
+
|
|
30
|
+
Many tokens set an element's HTML `title` attribute, a tooltip that only appears on hover, rather than always-visible text. These are marked _(tooltip)_ below.
|
|
31
|
+
|
|
32
|
+
### Header
|
|
33
|
+
|
|
34
|
+
| Token | Default | Used for |
|
|
35
|
+
| ---------------------------- | ------------------------ | -------------------------------- |
|
|
36
|
+
| `header-publish` | `"Publish"` | Publish button |
|
|
37
|
+
| `header-undo` | `"undo"` | Undo button (tooltip) |
|
|
38
|
+
| `header-redo` | `"redo"` | Redo button (tooltip) |
|
|
39
|
+
| `header-toggle-leftsidebar` | `"Toggle left sidebar"` | Sidebar toggle (tooltip) |
|
|
40
|
+
| `header-toggle-rightsidebar` | `"Toggle right sidebar"` | Sidebar toggle (tooltip) |
|
|
41
|
+
| `header-toggle-menubar` | `"Toggle menu bar"` | Mobile menu bar toggle (tooltip) |
|
|
42
|
+
|
|
43
|
+
### Actions
|
|
44
|
+
|
|
45
|
+
| Token | Default | Used for |
|
|
46
|
+
| --------------------- | ----------------- | ------------------------------ |
|
|
47
|
+
| `action-selectparent` | `"Select parent"` | Component action bar (tooltip) |
|
|
48
|
+
| `action-duplicate` | `"Duplicate"` | Component action bar (tooltip) |
|
|
49
|
+
| `action-delete` | `"Delete"` | Component action bar (tooltip) |
|
|
50
|
+
|
|
51
|
+
### Labels
|
|
52
|
+
|
|
53
|
+
| Token | Default | Used for |
|
|
54
|
+
| ----------------- | ------------- | ------------------------------------------------------- |
|
|
55
|
+
| `label-page` | `"Page"` | Breadcrumbs, fields panel title, header title fallback |
|
|
56
|
+
| `label-component` | `"Component"` | Outline and breadcrumbs, for unresolved component types |
|
|
57
|
+
|
|
58
|
+
### Outline
|
|
59
|
+
|
|
60
|
+
| Token | Default | Used for |
|
|
61
|
+
| ---------------------------- | ---------------- | -------------------------------------- |
|
|
62
|
+
| `outline-empty` | `"No items"` | Empty zone |
|
|
63
|
+
| `outline-header-title` | `"Outline"` | Outline header title |
|
|
64
|
+
| `outline-header-collapseall` | `"Collapse all"` | Outline header collapse all (tooltip) |
|
|
65
|
+
| `outline-item-collapse` | `"Collapse"` | Outline row toggle (tooltip) |
|
|
66
|
+
| `outline-item-expand` | `"Expand"` | Outline row toggle (tooltip) |
|
|
67
|
+
| `outline-item-duplicate` | `"Duplicate"` | Outline row duplicate action (tooltip) |
|
|
68
|
+
| `outline-item-delete` | `"Delete"` | Outline row delete action (tooltip) |
|
|
69
|
+
|
|
70
|
+
### Drawer
|
|
71
|
+
|
|
72
|
+
| Token | Default | Used for |
|
|
73
|
+
| -------------------------- | -------------------- | --------------------------------------------- |
|
|
74
|
+
| `drawer-category-collapse` | `"Collapse {title}"` | Category toggle (tooltip) |
|
|
75
|
+
| `drawer-category-expand` | `"Expand {title}"` | Category toggle (tooltip) |
|
|
76
|
+
| `drawer-category-other` | `"Other"` | Default category for uncategorized components |
|
|
77
|
+
|
|
78
|
+
### Canvas
|
|
79
|
+
|
|
80
|
+
| Token | Default | Used for |
|
|
81
|
+
| ----------------- | ------------------------------- | -------------------------------------------------- |
|
|
82
|
+
| `canvas-noconfig` | `"No configuration for {type}"` | Placeholder for components missing from the config |
|
|
83
|
+
|
|
84
|
+
### Fields
|
|
85
|
+
|
|
86
|
+
| Token | Default | Used for |
|
|
87
|
+
| ---------------- | ------------- | ----------------------------------- |
|
|
88
|
+
| `field-readonly` | `"Read-only"` | Read-only field lock icon (tooltip) |
|
|
89
|
+
|
|
90
|
+
#### Array field
|
|
91
|
+
|
|
92
|
+
| Token | Default | Used for |
|
|
93
|
+
| --------------------------- | ----------------- | --------------------- |
|
|
94
|
+
| `field-arrayitem-summary` | `"Item #{index}"` | Item default label |
|
|
95
|
+
| `field-arrayitem-duplicate` | `"Duplicate"` | Item action (tooltip) |
|
|
96
|
+
| `field-arrayitem-delete` | `"Delete"` | Item action (tooltip) |
|
|
97
|
+
|
|
98
|
+
#### External field
|
|
99
|
+
|
|
100
|
+
| Token | Default | Used for |
|
|
101
|
+
| -------------------------------- | ------------------- | -------------------------------- |
|
|
102
|
+
| `field-external-selectdata` | `"Select data"` | Trigger button and modal heading |
|
|
103
|
+
| `field-external-search` | `"Search"` | Modal search |
|
|
104
|
+
| `field-external-togglefilters` | `"Toggle filters"` | Modal filter toggle (tooltip) |
|
|
105
|
+
| `field-external-item` | `"External item"` | Selected item default label |
|
|
106
|
+
| `field-external-result-singular` | `"{count} result"` | Modal footer |
|
|
107
|
+
| `field-external-result-plural` | `"{count} results"` | Modal footer |
|
|
108
|
+
|
|
109
|
+
#### Rich text field
|
|
110
|
+
|
|
111
|
+
| Token | Default | Used for |
|
|
112
|
+
| ------------------------------------ | ------------------- | --------------------------- |
|
|
113
|
+
| `field-richtext-bold` | `"Bold"` | Formatting button (tooltip) |
|
|
114
|
+
| `field-richtext-italic` | `"Italic"` | Formatting button (tooltip) |
|
|
115
|
+
| `field-richtext-underline` | `"Underline"` | Formatting button (tooltip) |
|
|
116
|
+
| `field-richtext-strikethrough` | `"Strikethrough"` | Formatting button (tooltip) |
|
|
117
|
+
| `field-richtext-blockquote` | `"Blockquote"` | Formatting button (tooltip) |
|
|
118
|
+
| `field-richtext-code-inline` | `"Inline code"` | Formatting button (tooltip) |
|
|
119
|
+
| `field-richtext-code-block` | `"Code block"` | Formatting button (tooltip) |
|
|
120
|
+
| `field-richtext-list-bullet` | `"Bullet list"` | Formatting button (tooltip) |
|
|
121
|
+
| `field-richtext-list-ordered` | `"Ordered list"` | Formatting button (tooltip) |
|
|
122
|
+
| `field-richtext-horizontalrule` | `"Horizontal rule"` | Formatting button (tooltip) |
|
|
123
|
+
| `field-richtext-align-left` | `"Align left"` | Alignment button (tooltip) |
|
|
124
|
+
| `field-richtext-align-center` | `"Align center"` | Alignment button (tooltip) |
|
|
125
|
+
| `field-richtext-align-right` | `"Align right"` | Alignment button (tooltip) |
|
|
126
|
+
| `field-richtext-align-justify` | `"Justify"` | Alignment button (tooltip) |
|
|
127
|
+
| `field-richtext-select` | `"Select"` | Select control (tooltip) |
|
|
128
|
+
| `field-richtext-headingselect-1` | `"Heading 1"` | Heading select option |
|
|
129
|
+
| `field-richtext-headingselect-2` | `"Heading 2"` | Heading select option |
|
|
130
|
+
| `field-richtext-headingselect-3` | `"Heading 3"` | Heading select option |
|
|
131
|
+
| `field-richtext-headingselect-4` | `"Heading 4"` | Heading select option |
|
|
132
|
+
| `field-richtext-headingselect-5` | `"Heading 5"` | Heading select option |
|
|
133
|
+
| `field-richtext-headingselect-6` | `"Heading 6"` | Heading select option |
|
|
134
|
+
| `field-richtext-alignselect-left` | `"Left"` | Alignment select option |
|
|
135
|
+
| `field-richtext-alignselect-center` | `"Center"` | Alignment select option |
|
|
136
|
+
| `field-richtext-alignselect-right` | `"Right"` | Alignment select option |
|
|
137
|
+
| `field-richtext-alignselect-justify` | `"Justify"` | Alignment select option |
|
|
138
|
+
| `field-richtext-listselect-bullet` | `"Bullet list"` | List select option |
|
|
139
|
+
| `field-richtext-listselect-ordered` | `"Ordered list"` | List select option |
|
|
140
|
+
|
|
141
|
+
### Viewport controls
|
|
142
|
+
|
|
143
|
+
| Token | Default | Used for |
|
|
144
|
+
| ------------------------- | ------------------------------ | --------------------------------------- |
|
|
145
|
+
| `viewport-zoom-in` | `"Zoom viewport in"` | Zoom button (tooltip) |
|
|
146
|
+
| `viewport-zoom-out` | `"Zoom viewport out"` | Zoom button (tooltip) |
|
|
147
|
+
| `viewport-zoom-auto` | `"{zoom}% (Auto)"` | Auto zoom select option |
|
|
148
|
+
| `viewport-toggle-menu` | `"Toggle viewport menu"` | Menu toggle (tooltip) |
|
|
149
|
+
| `viewport-switch` | `"Switch to {label} viewport"` | Viewport button (tooltip) |
|
|
150
|
+
| `viewport-switch-default` | `"Switch viewport"` | Viewport button, if unlabeled (tooltip) |
|
|
151
|
+
|
|
152
|
+
### Plugin bar
|
|
153
|
+
|
|
154
|
+
| Token | Default | Used for |
|
|
155
|
+
| ------------------- | -------------- | ------------------------------------ |
|
|
156
|
+
| `plugin-blocks` | `"Blocks"` | Sidebar tab and legacy section title |
|
|
157
|
+
| `plugin-outline` | `"Outline"` | Sidebar tab |
|
|
158
|
+
| `plugin-fields` | `"Fields"` | Sidebar tab |
|
|
159
|
+
| `plugin-components` | `"Components"` | Legacy sidebar section title |
|
|
160
|
+
|
|
161
|
+
### Layout
|
|
162
|
+
|
|
163
|
+
| Token | Default | Used for |
|
|
164
|
+
| ----------------- | ------------ | ----------------------------- |
|
|
165
|
+
| `layout-maximize` | `"maximize"` | Mobile panel toggle (tooltip) |
|
|
166
|
+
| `layout-minimize` | `"minimize"` | Mobile panel toggle (tooltip) |
|
|
167
|
+
|
|
168
|
+
### Loader
|
|
169
|
+
|
|
170
|
+
| Token | Default | Used for |
|
|
171
|
+
| ---------------- | ----------- | ---------------------------- |
|
|
172
|
+
| `loader-loading` | `"loading"` | Loading spinner (aria-label) |
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# FieldTransforms
|
|
2
|
+
|
|
3
|
+
Transform the data for each [field type](/docs/api-reference/fields) before rendering in the editor.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
const UppercaseText = ({ value }) => <p>{value.toUpperCase()}</p>;
|
|
7
|
+
|
|
8
|
+
const fieldTransforms = {
|
|
9
|
+
text: (props) => <UppercaseText {...props} />,
|
|
10
|
+
// ...
|
|
11
|
+
};
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
You can specify a custom render method for each known [field type](/docs/api-reference/fields), or introduce completely new ones.
|
|
15
|
+
|
|
16
|
+
## Render Props
|
|
17
|
+
|
|
18
|
+
| Prop | Example | Type |
|
|
19
|
+
| ----------------------------- | -------------------- | ----------------------------------- |
|
|
20
|
+
| [`componentId`](#componentid) | `"Heading-12345"` | string |
|
|
21
|
+
| [`field`](#field) | `{ type: "text" }` | [Field](/docs/api-reference/fields) |
|
|
22
|
+
| [`isReadOnly`](#isreadonly) | `false` | boolean |
|
|
23
|
+
| [`propName`](#propname) | `"title"` | string |
|
|
24
|
+
| [`propPath`](#proppath) | `"obj.arr[2].title"` | string |
|
|
25
|
+
| [`value`](#value) | `"Value"` | any |
|
|
26
|
+
|
|
27
|
+
### `componentId`
|
|
28
|
+
|
|
29
|
+
The id of the component containing this prop
|
|
30
|
+
|
|
31
|
+
### `field`
|
|
32
|
+
|
|
33
|
+
The component's field definition for this prop.
|
|
34
|
+
|
|
35
|
+
### `isReadOnly`
|
|
36
|
+
|
|
37
|
+
Whether or not this field is currently set to read-only.
|
|
38
|
+
|
|
39
|
+
### `propName`
|
|
40
|
+
|
|
41
|
+
The name of this prop provided to the [component field](/docs/api-reference/configuration/component-config#fields) config.
|
|
42
|
+
|
|
43
|
+
### `propPath`
|
|
44
|
+
|
|
45
|
+
The path of this prop within the props object.
|
|
46
|
+
|
|
47
|
+
Use in conjunction with the [`setDeep`](/docs/api-reference/functions/set-deep) utility to set data for a key deep within an object or array, normally [ComponentData](/docs/api-reference/data-model/component-data).
|
|
48
|
+
|
|
49
|
+
### `value`
|
|
50
|
+
|
|
51
|
+
The value of the prop.
|