@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.
Files changed (372) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -0
  3. package/dist/bin.mjs +7304 -0
  4. package/dist/docs/api-reference/actions.md +63 -0
  5. package/dist/docs/api-reference/components/action-bar-action.md +35 -0
  6. package/dist/docs/api-reference/components/action-bar-group.md +24 -0
  7. package/dist/docs/api-reference/components/action-bar-label.md +25 -0
  8. package/dist/docs/api-reference/components/action-bar-separator.md +16 -0
  9. package/dist/docs/api-reference/components/action-bar.md +32 -0
  10. package/dist/docs/api-reference/components/auto-field.md +63 -0
  11. package/dist/docs/api-reference/components/drawer-item.md +75 -0
  12. package/dist/docs/api-reference/components/drawer.md +29 -0
  13. package/dist/docs/api-reference/components/drop-zone.md +232 -0
  14. package/dist/docs/api-reference/components/field-label.md +138 -0
  15. package/dist/docs/api-reference/components/inline-text-field.md +77 -0
  16. package/dist/docs/api-reference/components/puck-components.md +19 -0
  17. package/dist/docs/api-reference/components/puck-fields.md +39 -0
  18. package/dist/docs/api-reference/components/puck-layout.md +27 -0
  19. package/dist/docs/api-reference/components/puck-outline.md +19 -0
  20. package/dist/docs/api-reference/components/puck-preview.md +39 -0
  21. package/dist/docs/api-reference/components/puck.md +561 -0
  22. package/dist/docs/api-reference/components/render.md +94 -0
  23. package/dist/docs/api-reference/components/rich-text-menu-control.md +87 -0
  24. package/dist/docs/api-reference/components/rich-text-menu-group.md +27 -0
  25. package/dist/docs/api-reference/components/rich-text-menu.md +99 -0
  26. package/dist/docs/api-reference/components.md +32 -0
  27. package/dist/docs/api-reference/configuration/component-config.md +569 -0
  28. package/dist/docs/api-reference/configuration/config.md +108 -0
  29. package/dist/docs/api-reference/configuration.md +4 -0
  30. package/dist/docs/api-reference/data-model/app-state.md +168 -0
  31. package/dist/docs/api-reference/data-model/component-data.md +62 -0
  32. package/dist/docs/api-reference/data-model/data.md +95 -0
  33. package/dist/docs/api-reference/data-model/item-selector.md +34 -0
  34. package/dist/docs/api-reference/data-model/root-data.md +59 -0
  35. package/dist/docs/api-reference/data-model.md +8 -0
  36. package/dist/docs/api-reference/dictionary.md +172 -0
  37. package/dist/docs/api-reference/field-transforms.md +51 -0
  38. package/dist/docs/api-reference/fields/array.md +211 -0
  39. package/dist/docs/api-reference/fields/base.md +96 -0
  40. package/dist/docs/api-reference/fields/custom.md +193 -0
  41. package/dist/docs/api-reference/fields/external.md +413 -0
  42. package/dist/docs/api-reference/fields/number.md +132 -0
  43. package/dist/docs/api-reference/fields/object.md +78 -0
  44. package/dist/docs/api-reference/fields/radio.md +82 -0
  45. package/dist/docs/api-reference/fields/richtext.md +422 -0
  46. package/dist/docs/api-reference/fields/select.md +79 -0
  47. package/dist/docs/api-reference/fields/slot.md +302 -0
  48. package/dist/docs/api-reference/fields/text.md +93 -0
  49. package/dist/docs/api-reference/fields/textarea.md +93 -0
  50. package/dist/docs/api-reference/fields.md +16 -0
  51. package/dist/docs/api-reference/functions/migrate.md +204 -0
  52. package/dist/docs/api-reference/functions/register-overlay-portal.md +45 -0
  53. package/dist/docs/api-reference/functions/resolve-all-data.md +27 -0
  54. package/dist/docs/api-reference/functions/set-deep.md +55 -0
  55. package/dist/docs/api-reference/functions/transform-props.md +51 -0
  56. package/dist/docs/api-reference/functions/use-get-puck.md +24 -0
  57. package/dist/docs/api-reference/functions/use-puck.md +43 -0
  58. package/dist/docs/api-reference/functions/walk-tree.md +88 -0
  59. package/dist/docs/api-reference/functions.md +8 -0
  60. package/dist/docs/api-reference/overrides/action-bar.md +35 -0
  61. package/dist/docs/api-reference/overrides/component-overlay.md +41 -0
  62. package/dist/docs/api-reference/overrides/drawer-item.md +24 -0
  63. package/dist/docs/api-reference/overrides/drawer.md +19 -0
  64. package/dist/docs/api-reference/overrides/field-label.md +18 -0
  65. package/dist/docs/api-reference/overrides/field-types.md +51 -0
  66. package/dist/docs/api-reference/overrides/fields.md +19 -0
  67. package/dist/docs/api-reference/overrides/header-actions.md +24 -0
  68. package/dist/docs/api-reference/overrides/header.md +29 -0
  69. package/dist/docs/api-reference/overrides/iframe.md +32 -0
  70. package/dist/docs/api-reference/overrides/outline.md +19 -0
  71. package/dist/docs/api-reference/overrides/preview.md +19 -0
  72. package/dist/docs/api-reference/overrides/puck.md +19 -0
  73. package/dist/docs/api-reference/overrides.md +28 -0
  74. package/dist/docs/api-reference/permissions.md +55 -0
  75. package/dist/docs/api-reference/plugin.md +112 -0
  76. package/dist/docs/api-reference/plugins/blocks-plugin.md +57 -0
  77. package/dist/docs/api-reference/plugins/fields-plugin.md +68 -0
  78. package/dist/docs/api-reference/plugins/legacy-side-bar-plugin.md +54 -0
  79. package/dist/docs/api-reference/plugins/outline-plugin.md +57 -0
  80. package/dist/docs/api-reference/puck-api.md +278 -0
  81. package/dist/docs/api-reference/theming/action-bar.md +32 -0
  82. package/dist/docs/api-reference/theming/button.md +65 -0
  83. package/dist/docs/api-reference/theming/canvas.md +20 -0
  84. package/dist/docs/api-reference/theming/computed-values.md +194 -0
  85. package/dist/docs/api-reference/theming/drawer.md +34 -0
  86. package/dist/docs/api-reference/theming/fields.md +70 -0
  87. package/dist/docs/api-reference/theming/global.md +127 -0
  88. package/dist/docs/api-reference/theming/header.md +19 -0
  89. package/dist/docs/api-reference/theming/icon-button.md +28 -0
  90. package/dist/docs/api-reference/theming/outline.md +35 -0
  91. package/dist/docs/api-reference/theming/plugin-bar.md +24 -0
  92. package/dist/docs/api-reference/theming/sidebar.md +19 -0
  93. package/dist/docs/api-reference/theming/slot.md +27 -0
  94. package/dist/docs/cli.md +201 -0
  95. package/dist/docs/extending-puck/composition.md +54 -0
  96. package/dist/docs/extending-puck/custom-fields.md +133 -0
  97. package/dist/docs/extending-puck/field-transforms.md +89 -0
  98. package/dist/docs/extending-puck/internal-puck-api.md +96 -0
  99. package/dist/docs/extending-puck/plugins.md +159 -0
  100. package/dist/docs/extending-puck/theming.md +88 -0
  101. package/dist/docs/extending-puck/ui-overrides.md +134 -0
  102. package/dist/docs/getting-started.md +68 -0
  103. package/dist/docs/guides/migrations/dropzones-to-slots.md +138 -0
  104. package/dist/docs/index.json +466 -0
  105. package/dist/docs/index.md +37 -0
  106. package/dist/docs/integrating-puck/categories.md +92 -0
  107. package/dist/docs/integrating-puck/component-configuration.md +159 -0
  108. package/dist/docs/integrating-puck/data-migration.md +86 -0
  109. package/dist/docs/integrating-puck/dynamic-fields.md +86 -0
  110. package/dist/docs/integrating-puck/dynamic-props.md +137 -0
  111. package/dist/docs/integrating-puck/external-data-sources.md +149 -0
  112. package/dist/docs/integrating-puck/feature-toggling.md +121 -0
  113. package/dist/docs/integrating-puck/localization.md +228 -0
  114. package/dist/docs/integrating-puck/multi-column-layouts.md +226 -0
  115. package/dist/docs/integrating-puck/overlay-portals.md +25 -0
  116. package/dist/docs/integrating-puck/rich-text-editing.md +230 -0
  117. package/dist/docs/integrating-puck/root-configuration.md +171 -0
  118. package/dist/docs/integrating-puck/server-components.md +199 -0
  119. package/dist/docs/integrating-puck/styling.md +117 -0
  120. package/dist/docs/integrating-puck/viewports.md +75 -0
  121. package/dist/templates/astro/README.md +52 -0
  122. package/dist/templates/astro/_gitignore +24 -0
  123. package/dist/templates/astro/astro.config.mjs +14 -0
  124. package/dist/templates/astro/database.json +1 -0
  125. package/dist/templates/astro/package.json +25 -0
  126. package/dist/templates/astro/public/favicon.svg +9 -0
  127. package/dist/templates/astro/src/lib/pages.ts +21 -0
  128. package/dist/templates/astro/src/lib/resolve-puck-path.ts +19 -0
  129. package/dist/templates/astro/src/pages/[...puckPath].astro +25 -0
  130. package/dist/templates/astro/src/pages/api/pages.ts +18 -0
  131. package/dist/templates/astro/src/puck/editor.tsx +32 -0
  132. package/dist/templates/astro/src/puck/pages.ts +15 -0
  133. package/dist/templates/astro/src/puck/render.tsx +9 -0
  134. package/dist/templates/astro/src/puck.config.tsx +23 -0
  135. package/dist/templates/astro/tsconfig.json +14 -0
  136. package/dist/templates/astro-ai/README.md +64 -0
  137. package/dist/templates/astro-ai/_gitignore +24 -0
  138. package/dist/templates/astro-ai/astro.config.mjs +21 -0
  139. package/dist/templates/astro-ai/database.json +1 -0
  140. package/dist/templates/astro-ai/package.json +27 -0
  141. package/dist/templates/astro-ai/public/favicon.svg +9 -0
  142. package/dist/templates/astro-ai/src/lib/pages.ts +21 -0
  143. package/dist/templates/astro-ai/src/lib/resolve-puck-path.ts +19 -0
  144. package/dist/templates/astro-ai/src/pages/[...puckPath].astro +25 -0
  145. package/dist/templates/astro-ai/src/pages/api/pages.ts +18 -0
  146. package/dist/templates/astro-ai/src/pages/api/puck/[...all].ts +36 -0
  147. package/dist/templates/astro-ai/src/puck/editor.tsx +53 -0
  148. package/dist/templates/astro-ai/src/puck/pages.ts +15 -0
  149. package/dist/templates/astro-ai/src/puck/render.tsx +10 -0
  150. package/dist/templates/astro-ai/src/puck.config.tsx +23 -0
  151. package/dist/templates/astro-ai/tsconfig.json +14 -0
  152. package/dist/templates/express/README.md +66 -0
  153. package/dist/templates/express/_gitignore +16 -0
  154. package/dist/templates/express/database.json +1 -0
  155. package/dist/templates/express/package.json +20 -0
  156. package/dist/templates/express/src/index.ts +15 -0
  157. package/dist/templates/express/src/puck/pages.ts +39 -0
  158. package/dist/templates/express/tsconfig.json +12 -0
  159. package/dist/templates/express-ai/README.md +81 -0
  160. package/dist/templates/express-ai/_gitignore +16 -0
  161. package/dist/templates/express-ai/database.json +1 -0
  162. package/dist/templates/express-ai/package.json +22 -0
  163. package/dist/templates/express-ai/src/index.ts +17 -0
  164. package/dist/templates/express-ai/src/puck/cloud.ts +71 -0
  165. package/dist/templates/express-ai/src/puck/pages.ts +39 -0
  166. package/dist/templates/express-ai/tsconfig.json +12 -0
  167. package/dist/templates/hono/README.md +66 -0
  168. package/dist/templates/hono/_gitignore +32 -0
  169. package/dist/templates/hono/database.json +1 -0
  170. package/dist/templates/hono/package.json +20 -0
  171. package/dist/templates/hono/src/index.ts +21 -0
  172. package/dist/templates/hono/src/puck/pages.ts +32 -0
  173. package/dist/templates/hono/tsconfig.json +13 -0
  174. package/dist/templates/hono-ai/README.md +81 -0
  175. package/dist/templates/hono-ai/_gitignore +32 -0
  176. package/dist/templates/hono-ai/database.json +1 -0
  177. package/dist/templates/hono-ai/package.json +22 -0
  178. package/dist/templates/hono-ai/src/index.ts +23 -0
  179. package/dist/templates/hono-ai/src/puck/cloud.ts +30 -0
  180. package/dist/templates/hono-ai/src/puck/pages.ts +32 -0
  181. package/dist/templates/hono-ai/tsconfig.json +13 -0
  182. package/dist/templates/manifest.json +4 -0
  183. package/dist/templates/next/README.md +112 -0
  184. package/dist/templates/next/_gitignore +35 -0
  185. package/dist/templates/next/app/[...puckPath]/client.tsx +9 -0
  186. package/dist/templates/next/app/[...puckPath]/page.tsx +49 -0
  187. package/dist/templates/next/app/favicon.ico +0 -0
  188. package/dist/templates/next/app/layout.tsx +13 -0
  189. package/dist/templates/next/app/page.tsx +1 -0
  190. package/dist/templates/next/app/puck/[...puckPath]/client.tsx +20 -0
  191. package/dist/templates/next/app/puck/[...puckPath]/page.tsx +55 -0
  192. package/dist/templates/next/app/puck/api/route.ts +25 -0
  193. package/dist/templates/next/app/puck/page.tsx +3 -0
  194. package/dist/templates/next/app/styles.css +3 -0
  195. package/dist/templates/next/database.json +1 -0
  196. package/dist/templates/next/lib/get-page.ts +11 -0
  197. package/dist/templates/next/next.config.js +3 -0
  198. package/dist/templates/next/package.json +25 -0
  199. package/dist/templates/next/proxy.ts +27 -0
  200. package/dist/templates/next/puck.config.tsx +25 -0
  201. package/dist/templates/next/tsconfig/base.json +20 -0
  202. package/dist/templates/next/tsconfig/nextjs.json +21 -0
  203. package/dist/templates/next/tsconfig.json +8 -0
  204. package/dist/templates/next-ai/README.md +169 -0
  205. package/dist/templates/next-ai/_gitignore +35 -0
  206. package/dist/templates/next-ai/app/[...puckPath]/client.tsx +12 -0
  207. package/dist/templates/next-ai/app/[...puckPath]/page.tsx +49 -0
  208. package/dist/templates/next-ai/app/api/pages/route.ts +26 -0
  209. package/dist/templates/next-ai/app/api/puck/[...all]/route.ts +31 -0
  210. package/dist/templates/next-ai/app/layout.tsx +13 -0
  211. package/dist/templates/next-ai/app/page.tsx +1 -0
  212. package/dist/templates/next-ai/app/puck/[...puckPath]/client.tsx +38 -0
  213. package/dist/templates/next-ai/app/puck/[...puckPath]/page.tsx +57 -0
  214. package/dist/templates/next-ai/app/puck/page.tsx +3 -0
  215. package/dist/templates/next-ai/app/styles.css +3 -0
  216. package/dist/templates/next-ai/database.json +1 -0
  217. package/dist/templates/next-ai/lib/get-page.ts +11 -0
  218. package/dist/templates/next-ai/next.config.js +3 -0
  219. package/dist/templates/next-ai/package.json +27 -0
  220. package/dist/templates/next-ai/proxy.ts +27 -0
  221. package/dist/templates/next-ai/public/favicon.ico +0 -0
  222. package/dist/templates/next-ai/puck.config.tsx +25 -0
  223. package/dist/templates/next-ai/tsconfig/base.json +20 -0
  224. package/dist/templates/next-ai/tsconfig/nextjs.json +21 -0
  225. package/dist/templates/next-ai/tsconfig.json +8 -0
  226. package/dist/templates/react-router/README.md +113 -0
  227. package/dist/templates/react-router/_gitignore +6 -0
  228. package/dist/templates/react-router/app/components/puck-render.tsx +8 -0
  229. package/dist/templates/react-router/app/lib/pages.server.ts +29 -0
  230. package/dist/templates/react-router/app/lib/resolve-puck-path.server.ts +19 -0
  231. package/dist/templates/react-router/app/root.tsx +65 -0
  232. package/dist/templates/react-router/app/routes/_index.tsx +31 -0
  233. package/dist/templates/react-router/app/routes/puck-splat.tsx +95 -0
  234. package/dist/templates/react-router/app/routes.ts +7 -0
  235. package/dist/templates/react-router/database.json +1 -0
  236. package/dist/templates/react-router/package.json +33 -0
  237. package/dist/templates/react-router/public/favicon.ico +0 -0
  238. package/dist/templates/react-router/puck.config.tsx +23 -0
  239. package/dist/templates/react-router/react-router.config.ts +7 -0
  240. package/dist/templates/react-router/tsconfig.json +29 -0
  241. package/dist/templates/react-router/vite.config.ts +10 -0
  242. package/dist/templates/react-router-ai/README.md +172 -0
  243. package/dist/templates/react-router-ai/_gitignore +6 -0
  244. package/dist/templates/react-router-ai/app/components/puck-render.tsx +11 -0
  245. package/dist/templates/react-router-ai/app/lib/pages.server.ts +29 -0
  246. package/dist/templates/react-router-ai/app/lib/resolve-puck-path.server.ts +19 -0
  247. package/dist/templates/react-router-ai/app/root.tsx +65 -0
  248. package/dist/templates/react-router-ai/app/routes/_index.tsx +31 -0
  249. package/dist/templates/react-router-ai/app/routes/api.puck.ts +34 -0
  250. package/dist/templates/react-router-ai/app/routes/puck-splat.tsx +119 -0
  251. package/dist/templates/react-router-ai/app/routes.ts +8 -0
  252. package/dist/templates/react-router-ai/database.json +1 -0
  253. package/dist/templates/react-router-ai/package.json +35 -0
  254. package/dist/templates/react-router-ai/public/favicon.ico +0 -0
  255. package/dist/templates/react-router-ai/puck.config.tsx +25 -0
  256. package/dist/templates/react-router-ai/react-router.config.ts +7 -0
  257. package/dist/templates/react-router-ai/tsconfig.json +29 -0
  258. package/dist/templates/react-router-ai/vite.config.ts +10 -0
  259. package/dist/templates/tanstack-start/README.md +113 -0
  260. package/dist/templates/tanstack-start/_gitignore +12 -0
  261. package/dist/templates/tanstack-start/database.json +1 -0
  262. package/dist/templates/tanstack-start/package.json +26 -0
  263. package/dist/templates/tanstack-start/puck.config.tsx +23 -0
  264. package/dist/templates/tanstack-start/src/components/puck-render.tsx +8 -0
  265. package/dist/templates/tanstack-start/src/lib/pages.server.ts +26 -0
  266. package/dist/templates/tanstack-start/src/lib/pages.ts +39 -0
  267. package/dist/templates/tanstack-start/src/lib/resolve-puck-path.ts +19 -0
  268. package/dist/templates/tanstack-start/src/routeTree.gen.ts +86 -0
  269. package/dist/templates/tanstack-start/src/router.tsx +19 -0
  270. package/dist/templates/tanstack-start/src/routes/$.tsx +41 -0
  271. package/dist/templates/tanstack-start/src/routes/__root.tsx +42 -0
  272. package/dist/templates/tanstack-start/src/routes/index.tsx +18 -0
  273. package/dist/templates/tanstack-start/src/styles.css +13 -0
  274. package/dist/templates/tanstack-start/tsconfig.json +24 -0
  275. package/dist/templates/tanstack-start/vite.config.ts +15 -0
  276. package/dist/templates/tanstack-start-ai/README.md +171 -0
  277. package/dist/templates/tanstack-start-ai/_gitignore +12 -0
  278. package/dist/templates/tanstack-start-ai/database.json +1 -0
  279. package/dist/templates/tanstack-start-ai/package.json +28 -0
  280. package/dist/templates/tanstack-start-ai/puck.config.tsx +23 -0
  281. package/dist/templates/tanstack-start-ai/src/components/puck-render.tsx +11 -0
  282. package/dist/templates/tanstack-start-ai/src/lib/pages.server.ts +26 -0
  283. package/dist/templates/tanstack-start-ai/src/lib/pages.ts +39 -0
  284. package/dist/templates/tanstack-start-ai/src/lib/resolve-puck-path.ts +19 -0
  285. package/dist/templates/tanstack-start-ai/src/routeTree.gen.ts +104 -0
  286. package/dist/templates/tanstack-start-ai/src/router.tsx +19 -0
  287. package/dist/templates/tanstack-start-ai/src/routes/$.tsx +73 -0
  288. package/dist/templates/tanstack-start-ai/src/routes/__root.tsx +42 -0
  289. package/dist/templates/tanstack-start-ai/src/routes/api/puck/$.ts +39 -0
  290. package/dist/templates/tanstack-start-ai/src/routes/index.tsx +18 -0
  291. package/dist/templates/tanstack-start-ai/src/styles.css +13 -0
  292. package/dist/templates/tanstack-start-ai/tsconfig.json +24 -0
  293. package/dist/templates/tanstack-start-ai/vite.config.ts +15 -0
  294. package/dist/templates/vinext/README.md +112 -0
  295. package/dist/templates/vinext/_gitignore +33 -0
  296. package/dist/templates/vinext/app/[...puckPath]/client.tsx +9 -0
  297. package/dist/templates/vinext/app/[...puckPath]/page.tsx +49 -0
  298. package/dist/templates/vinext/app/favicon.ico +0 -0
  299. package/dist/templates/vinext/app/layout.tsx +13 -0
  300. package/dist/templates/vinext/app/page.tsx +1 -0
  301. package/dist/templates/vinext/app/puck/[...puckPath]/client.tsx +20 -0
  302. package/dist/templates/vinext/app/puck/[...puckPath]/page.tsx +55 -0
  303. package/dist/templates/vinext/app/puck/api/route.ts +25 -0
  304. package/dist/templates/vinext/app/puck/page.tsx +3 -0
  305. package/dist/templates/vinext/app/styles.css +3 -0
  306. package/dist/templates/vinext/database.json +1 -0
  307. package/dist/templates/vinext/lib/get-page.ts +11 -0
  308. package/dist/templates/vinext/package.json +30 -0
  309. package/dist/templates/vinext/proxy.ts +27 -0
  310. package/dist/templates/vinext/puck.config.tsx +25 -0
  311. package/dist/templates/vinext/tsconfig.json +30 -0
  312. package/dist/templates/vinext/vite.config.ts +6 -0
  313. package/dist/templates/vinext-ai/README.md +169 -0
  314. package/dist/templates/vinext-ai/_gitignore +33 -0
  315. package/dist/templates/vinext-ai/app/[...puckPath]/client.tsx +12 -0
  316. package/dist/templates/vinext-ai/app/[...puckPath]/page.tsx +49 -0
  317. package/dist/templates/vinext-ai/app/api/pages/route.ts +26 -0
  318. package/dist/templates/vinext-ai/app/api/puck/[...all]/route.ts +31 -0
  319. package/dist/templates/vinext-ai/app/layout.tsx +13 -0
  320. package/dist/templates/vinext-ai/app/page.tsx +1 -0
  321. package/dist/templates/vinext-ai/app/puck/[...puckPath]/client.tsx +38 -0
  322. package/dist/templates/vinext-ai/app/puck/[...puckPath]/page.tsx +57 -0
  323. package/dist/templates/vinext-ai/app/puck/page.tsx +3 -0
  324. package/dist/templates/vinext-ai/app/styles.css +3 -0
  325. package/dist/templates/vinext-ai/database.json +1 -0
  326. package/dist/templates/vinext-ai/lib/get-page.ts +11 -0
  327. package/dist/templates/vinext-ai/package.json +32 -0
  328. package/dist/templates/vinext-ai/proxy.ts +27 -0
  329. package/dist/templates/vinext-ai/public/favicon.ico +0 -0
  330. package/dist/templates/vinext-ai/puck.config.tsx +25 -0
  331. package/dist/templates/vinext-ai/tsconfig.json +30 -0
  332. package/dist/templates/vinext-ai/vite.config.ts +9 -0
  333. package/dist/templates/vite/README.md +56 -0
  334. package/dist/templates/vite/_gitignore +24 -0
  335. package/dist/templates/vite/database.json +1 -0
  336. package/dist/templates/vite/index.html +12 -0
  337. package/dist/templates/vite/package.json +29 -0
  338. package/dist/templates/vite/server/index.ts +13 -0
  339. package/dist/templates/vite/server/prod.ts +18 -0
  340. package/dist/templates/vite/server/puck/pages.ts +32 -0
  341. package/dist/templates/vite/src/App.tsx +11 -0
  342. package/dist/templates/vite/src/main.tsx +12 -0
  343. package/dist/templates/vite/src/puck/editor.tsx +28 -0
  344. package/dist/templates/vite/src/puck/page.tsx +27 -0
  345. package/dist/templates/vite/src/puck/pages.ts +15 -0
  346. package/dist/templates/vite/src/puck/root.tsx +27 -0
  347. package/dist/templates/vite/src/puck.config.tsx +23 -0
  348. package/dist/templates/vite/tsconfig.app.json +26 -0
  349. package/dist/templates/vite/tsconfig.json +7 -0
  350. package/dist/templates/vite/tsconfig.node.json +23 -0
  351. package/dist/templates/vite/vite.config.ts +14 -0
  352. package/dist/templates/vite-ai/README.md +67 -0
  353. package/dist/templates/vite-ai/_gitignore +24 -0
  354. package/dist/templates/vite-ai/database.json +1 -0
  355. package/dist/templates/vite-ai/index.html +12 -0
  356. package/dist/templates/vite-ai/package.json +31 -0
  357. package/dist/templates/vite-ai/server/index.ts +15 -0
  358. package/dist/templates/vite-ai/server/prod.ts +18 -0
  359. package/dist/templates/vite-ai/server/puck/cloud.ts +30 -0
  360. package/dist/templates/vite-ai/server/puck/pages.ts +32 -0
  361. package/dist/templates/vite-ai/src/App.tsx +11 -0
  362. package/dist/templates/vite-ai/src/main.tsx +12 -0
  363. package/dist/templates/vite-ai/src/puck/editor.tsx +49 -0
  364. package/dist/templates/vite-ai/src/puck/page.tsx +28 -0
  365. package/dist/templates/vite-ai/src/puck/pages.ts +15 -0
  366. package/dist/templates/vite-ai/src/puck/root.tsx +27 -0
  367. package/dist/templates/vite-ai/src/puck.config.tsx +23 -0
  368. package/dist/templates/vite-ai/tsconfig.app.json +26 -0
  369. package/dist/templates/vite-ai/tsconfig.json +7 -0
  370. package/dist/templates/vite-ai/tsconfig.node.json +23 -0
  371. package/dist/templates/vite-ai/vite.config.ts +14 -0
  372. package/package.json +51 -0
@@ -0,0 +1,278 @@
1
+ # PuckApi
2
+
3
+ `PuckApi` exposes Puck's internals to enable extension and modification to Puck's core behavior. It can be accessed by the [`usePuck`](/docs/api-reference/functions/use-puck) and [`useGetPuck`](/docs/api-reference/functions/use-get-puck) hooks.
4
+
5
+ > **Note:** `PuckApi` can currently only be accessed through
6
+ > [composition](/docs/extending-puck/composition), [UI
7
+ > overrides](/docs/extending-puck/ui-overrides) or [custom
8
+ > fields](/docs/extending-puck/custom-fields).
9
+
10
+ ## Params
11
+
12
+ | Param | Example | Type |
13
+ | ----------------------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------------------- |
14
+ | [`appState`](#appstate) | `{ data: {}, ui: {} }` | [AppState](/docs/api-reference/data-model/app-state) |
15
+ | [`dictionary`](#dictionary) | `{ "header-publish": "Publish" }` | [Dictionary](/docs/api-reference/dictionary) |
16
+ | [`dispatch`](#dispatchaction) | `(action: PuckAction) => void` | Function |
17
+ | [`getItemBySelector`](#getitembyselectorselector) | `() => ({ type: "Heading", props: {} })` | Function |
18
+ | [`getItemById`](#getitembyidid) | `() => ({ type: "Heading", props: {} })` | Function |
19
+ | [`getSelectorForId`](#getselectorforidid) | `() => ({ index: 0, zone: 'Flex-123:children' })` | Function |
20
+ | [`getPermissions`](#getpermissionsparams) | `() => ({ delete: true })` | Function |
21
+ | [`history`](#history) | `{}` | Object |
22
+ | [`refreshPermissions`](#refreshpermissionsparams) | `() => void` | Function |
23
+ | [`resolveDataById`](#resolvedatabyidid-trigger) | `() => void` | Function |
24
+ | [`resolveDataBySelector`](#resolvedatabyselectorselector-trigger) | `() => void` | Function |
25
+ | [`selectedItem`](#selecteditem) | `{ type: "Heading", props: {id: "my-heading"} }` | [ComponentData](/docs/api-reference/data-model/data#content-1) |
26
+
27
+ ### `appState`
28
+
29
+ The current [application state](/docs/api-reference/data-model/app-state) for this Puck instance.
30
+
31
+ ```tsx
32
+ console.log(appState.data);
33
+ // { content: [], root: {}, zones: {} }
34
+ ```
35
+
36
+ ### `dictionary`
37
+
38
+ The [`dictionary`](/docs/api-reference/dictionary) object passed to [`<Puck>`](/docs/api-reference/components/puck#dictionary).
39
+
40
+ ### `dispatch(action)`
41
+
42
+ Execute an [action](/docs/api-reference/actions) to mutate the Puck [application state](/docs/api-reference/data-model/app-state).
43
+
44
+ ```tsx
45
+ dispatch({
46
+ type: "setUi",
47
+ ui: {
48
+ leftSideBarVisible: false,
49
+ },
50
+ });
51
+ ```
52
+
53
+ ### `getItemBySelector(selector)`
54
+
55
+ Get an item's [`ComponentData`](/docs/api-reference/data-model/component-data) by its [selector](/docs/api-reference/data-model/item-selector).
56
+
57
+ ```tsx
58
+ getItemBySelector({
59
+ index: 0,
60
+ zone: "Flex-123:children", // The "children" slot field in the component with id "Flex-123"
61
+ });
62
+ // { type: "HeadingBlock", props: {} }
63
+ ```
64
+
65
+ ### `getItemById(id)`
66
+
67
+ Get an item's [`ComponentData`](/docs/api-reference/data-model/component-data) by its component id.
68
+
69
+ ```tsx
70
+ getItemById("HeadingBlock-123");
71
+ // { type: "HeadingBlock", props: {} }
72
+ ```
73
+
74
+ ### `getParentById(id)`
75
+
76
+ Get an item's parent [`ComponentData`](/docs/api-reference/data-model/component-data) using the child component's ID.
77
+
78
+ ### `getSelectorForId(id)`
79
+
80
+ Get an item's [selector](/docs/api-reference/data-model/app-state#uiitemselector) by its component id.
81
+
82
+ ```tsx
83
+ getSelectorForId("HeadingBlock-123");
84
+ // { index: 0, zone: "Flex-123:children" }
85
+ ```
86
+
87
+ ### `getPermissions(params)`
88
+
89
+ Get global, component or resolved dynamic [permissions](/docs/api-reference/permissions).
90
+
91
+ ```tsx
92
+ getPermissions();
93
+ // { delete: true, edit: true }
94
+ ```
95
+
96
+ #### Params
97
+
98
+ | Param | Example | Type |
99
+ | ------ | ------------------------------------------------- | ------- |
100
+ | `item` | `{ type: "HeadingBlock", props: { id: "1234" } }` | Object |
101
+ | `root` | `false` | Boolean |
102
+ | `type` | `"HeadingBlock"` | String |
103
+
104
+ ##### `item`
105
+
106
+ Specify `item` to retrieve the permissions for a given component instance, resolving any dynamic permissions for that component, as set by the [`resolvePermissions` parameter](/docs/api-reference/configuration/component-config#resolvepermissionsdata-params).
107
+
108
+ ```tsx
109
+ getPermissions({
110
+ item: { type: "HeadingBlock", props: { id: "Heading-1234" } }, // Get resolved permissions for Heading-1234
111
+ });
112
+ // { delete: false }
113
+ ```
114
+
115
+ The `getPermissions` function will be redefined when after resolving dynamic permissions, so it's generally required to wrap it in a `useEffect` hook:
116
+
117
+ ```tsx
118
+ const [myPermissions, setMyPermissions] = useState(getPermissions());
119
+
120
+ useEffect(() => {
121
+ setMyPermissions(getPermissions());
122
+ }, [getPermissions]);
123
+ ```
124
+
125
+ ##### `root`
126
+
127
+ Specify `root` to retrieve the permissions for the `root`, as set by the [`permissions` parameter](/docs/api-reference/configuration/component-config#permissions).
128
+
129
+ ```tsx
130
+ getPermissions({ root: true });
131
+ // { delete: false }
132
+ ```
133
+
134
+ ##### `type`
135
+
136
+ Specify `type` to retrieve the permissions for a given component type, as set by the [`permissions` parameter](/docs/api-reference/configuration/component-config#permissions).
137
+
138
+ ```tsx
139
+ getPermissions({ type: "HeadingBlock" });
140
+ // { delete: false }
141
+ ```
142
+
143
+ ### `history`
144
+
145
+ The `history` API provides programmatic access to the undo/redo [AppState](/docs/api-reference/data-model/app-state) history.
146
+
147
+ | Param | Example | Type |
148
+ | ------------------------------------- | ----------------------------------- | ------------------------------ |
149
+ | [`back`](#historyback) | `() => void` | Function |
150
+ | [`forward`](#historyforward) | `() => void` | Function |
151
+ | [`hasPast`](#historyhaspast) | `true` | Boolean |
152
+ | [`hasFuture`](#historyhasfuture) | `false` | Boolean |
153
+ | [`histories`](#historyhistories) | `[{ id: 'abc123', data: {} }]` | [History](#history-params)\[\] |
154
+ | [`index`](#historyindex) | `5` | Number |
155
+ | [`setHistories`](#sethistories) | `setHistories: (histories) => void` | Function |
156
+ | [`setHistoryIndex`](#sethistoryindex) | `setHistoryIndex: (index) => void` | Function |
157
+
158
+ #### `history.back()`
159
+
160
+ A function to move the app state back through the [histories](#historyhistories).
161
+
162
+ #### `history.forward()`
163
+
164
+ A function to move the app state forward through the [histories](#historyhistories).
165
+
166
+ #### `history.hasPast`
167
+
168
+ A boolean describing whether or not the present app state has past history items.
169
+
170
+ #### `history.hasFuture`
171
+
172
+ A boolean describing whether or not the present app state has future history items.
173
+
174
+ #### `history.histories`
175
+
176
+ An array describing the recorded history as `History` objects.
177
+
178
+ ##### `History` params
179
+
180
+ | Param | Example | Type |
181
+ | ------- | -------- | ---------------------------------------------------- |
182
+ | `state` | `{}` | [AppState](/docs/api-reference/data-model/app-state) |
183
+ | `id` | `abc123` | String |
184
+
185
+ ###### `state`
186
+
187
+ The [app state](/docs/api-reference/data-model/app-state) payload for this history entry.
188
+
189
+ ###### `id`
190
+
191
+ An optional ID for this history entry.
192
+
193
+ #### `history.index`
194
+
195
+ The index of the currently selected history in [`history.histories`](#historyhistories)
196
+
197
+ #### `setHistories`
198
+
199
+ A function to set the history state.
200
+
201
+ ```tsx
202
+ setHistories([]); // clears all history
203
+ ```
204
+
205
+ #### `setHistoryIndex`
206
+
207
+ A function to set current history index.
208
+
209
+ ```tsx
210
+ setHistoryIndex(2);
211
+ ```
212
+
213
+ ### `refreshPermissions(params)`
214
+
215
+ Force the permissions to refresh, running all [`resolvePermissions` functions](/docs/api-reference/configuration/component-config#resolvepermissionsdata-params) and skipping the cache.
216
+
217
+ ```tsx
218
+ resolvePermissions(); // Refresh all permissions
219
+ ```
220
+
221
+ #### Params
222
+
223
+ | Param | Example | Type |
224
+ | ------ | ------------------------------------------------- | ------- |
225
+ | `item` | `{ type: "HeadingBlock", props: { id: "1234" } }` | Object |
226
+ | `root` | `false` | Boolean |
227
+ | `type` | `"HeadingBlock"` | String |
228
+
229
+ ##### `item`
230
+
231
+ Specify `item` to refresh the permissions for a given component instance only.
232
+
233
+ ```tsx
234
+ refreshPermissions({
235
+ item: { type: "HeadingBlock", props: { id: "Heading-1234" } }, // Force refresh the resolved permissions for Heading-1234
236
+ });
237
+ ```
238
+
239
+ ##### `root`
240
+
241
+ Specify `root` to refresh the permissions for the `root` only.
242
+
243
+ ```tsx
244
+ refreshPermissions({ root: true });
245
+ ```
246
+
247
+ ##### `type`
248
+
249
+ Specify `type` to refresh the permissions for all components of a given component type.
250
+
251
+ ```tsx
252
+ refreshPermissions({ type: "HeadingBlock" });
253
+ ```
254
+
255
+ ### `resolveDataById(id, trigger)`
256
+
257
+ Runs a component's [`resolveData`](/docs/api-reference/configuration/component-config#resolvedatadata-params) by id for a given [trigger](/docs/api-reference/configuration/component-config#paramstrigger).
258
+
259
+ ```tsx
260
+ resolveDataById("Heading-1234", "replace");
261
+ ```
262
+
263
+ ### `resolveDataBySelector(selector, trigger)`
264
+
265
+ Runs a component's [`resolveData`](/docs/api-reference/configuration/component-config#resolvedatadata-params) by selector for a given [trigger](/docs/api-reference/configuration/component-config#paramstrigger).
266
+
267
+ ```tsx
268
+ resolveDataBySelector({ zone: "Flex-1234:items", index: 0 }, "insert");
269
+ ```
270
+
271
+ ### `selectedItem`
272
+
273
+ The currently selected item, as defined by `appState.ui.itemSelector`.
274
+
275
+ ```tsx
276
+ console.log(selectedItem);
277
+ // { type: "Heading", props: {id: "my-heading"} }
278
+ ```
@@ -0,0 +1,32 @@
1
+ # Action bar
2
+
3
+ Use the following CSS properties for theming the action bar shown when selecting a component.
4
+
5
+ ```css
6
+ .Container {
7
+ --puck-actionbar-color-bg: darkgreen;
8
+ --puck-actionbar-color-action-hover: white;
9
+ --puck-actionbar-radius: 999px;
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#action-bar) for the values they resolve to.
16
+
17
+ | Token | Default | Description |
18
+ | ------------------------------------------ | ---------------------------------------------- | ----------------------------- |
19
+ | `--puck-actionbar-color-bg` | `var(--puck-color-surface-inverse)` | Background color |
20
+ | `--puck-actionbar-color-text` | `var(--puck-color-text-inverse)` | Label and action text color |
21
+ | `--puck-actionbar-opacity-text` | `var(--puck-opacity-text-inverse)` | Label and action text opacity |
22
+ | `--puck-actionbar-color-separator` | `var(--puck-color-border-inverse)` | Group separator color |
23
+ | `--puck-actionbar-color-action-hover` | `var(--puck-color-interactive-inverse-hover)` | Action color on hover |
24
+ | `--puck-actionbar-color-action-active` | `var(--puck-color-interactive-inverse-active)` | Action color when active |
25
+ | `--puck-actionbar-color-action-disabled` | `var(--puck-color-text-inverse)` | Disabled action color |
26
+ | `--puck-actionbar-opacity-action-disabled` | `0.54` | Disabled action opacity |
27
+ | `--puck-actionbar-space-y` | `var(--puck-space-1)` | Vertical padding |
28
+ | `--puck-actionbar-space-x` | `0` | Horizontal padding |
29
+ | `--puck-actionbar-radius` | `var(--puck-radius-l)` | Border radius |
30
+ | `--puck-actionbar-font-size` | `var(--puck-font-size-xxxs)` | Label font size |
31
+ | `--puck-actionbar-action-space` | `6px` | Action button padding |
32
+ | `--puck-actionbar-action-size` | `var(--puck-icon-size-s)` | Action icon size |
@@ -0,0 +1,65 @@
1
+ # Button
2
+
3
+ Use the following CSS properties for theming Puck's buttons, such as the Publish button.
4
+
5
+ ```css
6
+ .Container {
7
+ --puck-button-radius: 9999px;
8
+ --puck-button-primary-color-bg: #6d28d9;
9
+ --puck-button-primary-color-bg-hover: #5b21b6;
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#button) for the values they resolve to.
16
+
17
+ | Token | Default | Description |
18
+ | ---------------------- | ---------------------- | ------------- |
19
+ | `--puck-button-radius` | `var(--puck-radius-m)` | Border radius |
20
+
21
+ ### Sizes
22
+
23
+ **Medium size (`--puck-button-medium-*`)**
24
+
25
+ | Token | Default | Description |
26
+ | ---------------------------------- | -------------------------------------------------------------- | ------------------ |
27
+ | `--puck-button-medium-space-y` | `calc(var(--puck-space-2) - var(--puck-border-width-regular))` | Vertical padding |
28
+ | `--puck-button-medium-space-x` | `calc(20px - var(--puck-border-width-regular))` | Horizontal padding |
29
+ | `--puck-button-medium-font-weight` | `var(--puck-font-weight-regular)` | Label font weight |
30
+ | `--puck-button-medium-font-size` | `var(--puck-font-size-xxs)` | Label font size |
31
+
32
+ **Large size (`--puck-button-large-*`)**
33
+
34
+ | Token | Default | Description |
35
+ | --------------------------------- | -------------------------------------------------------------- | ------------------ |
36
+ | `--puck-button-large-space-y` | `calc(var(--puck-space-3) - var(--puck-border-width-regular))` | Vertical padding |
37
+ | `--puck-button-large-space-x` | `calc(20px - var(--puck-border-width-regular))` | Horizontal padding |
38
+ | `--puck-button-large-font-weight` | `var(--puck-font-weight-regular)` | Label font weight |
39
+ | `--puck-button-large-font-size` | `var(--puck-font-size-xxs)` | Label font size |
40
+
41
+ ### Variants
42
+
43
+ **Primary variant (`--puck-button-primary-*`)**
44
+
45
+ | Token | Default | Description |
46
+ | ------------------------------------------- | -------------------------------------- | ---------------------- |
47
+ | `--puck-button-primary-color-bg` | `var(--puck-color-interactive)` | Background |
48
+ | `--puck-button-primary-color-bg-hover` | `var(--puck-color-interactive-hover)` | Background on hover |
49
+ | `--puck-button-primary-color-bg-active` | `var(--puck-color-interactive-active)` | Background when active |
50
+ | `--puck-button-primary-color-text` | `var(--puck-color-text-inverse)` | Text color |
51
+ | `--puck-button-primary-color-border` | `transparent` | Border color |
52
+ | `--puck-button-primary-color-bg-disabled` | `var(--puck-color-bg-disabled)` | Disabled background |
53
+ | `--puck-button-primary-color-text-disabled` | `var(--puck-color-text-disabled)` | Disabled text color |
54
+
55
+ **Secondary variant (`--puck-button-secondary-*`)**
56
+
57
+ | Token | Default | Description |
58
+ | --------------------------------------------- | ------------------------------------ | ---------------------- |
59
+ | `--puck-button-secondary-color-bg` | `transparent` | Background |
60
+ | `--puck-button-secondary-color-bg-hover` | `var(--puck-color-interactive-soft)` | Background on hover |
61
+ | `--puck-button-secondary-color-bg-active` | `var(--puck-color-interactive-soft)` | Background when active |
62
+ | `--puck-button-secondary-color-text` | `currentColor` | Text color |
63
+ | `--puck-button-secondary-color-border` | `currentColor` | Border color |
64
+ | `--puck-button-secondary-color-bg-disabled` | `var(--puck-color-bg-disabled)` | Disabled background |
65
+ | `--puck-button-secondary-color-text-disabled` | `var(--puck-color-text-disabled)` | Disabled text color |
@@ -0,0 +1,20 @@
1
+ # Canvas
2
+
3
+ Use the following CSS properties for theming the canvas.
4
+
5
+ ```css
6
+ .Container {
7
+ --puck-canvas-color-bg: #f4f4f8;
8
+ --puck-canvas-preview-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#canvas) for the values they resolve to.
15
+
16
+ | Token | Default | Description |
17
+ | -------------------------------- | --------------------------------- | ---------------------------------- |
18
+ | `--puck-canvas-color-text` | `var(--puck-color-text)` | Canvas text color |
19
+ | `--puck-canvas-color-bg` | `var(--puck-color-surface-muted)` | Canvas frame (gutter) background |
20
+ | `--puck-canvas-preview-color-bg` | `var(--puck-color-surface)` | Background behind the page preview |
@@ -0,0 +1,194 @@
1
+ # Component computed values
2
+
3
+ These tables document the default computed value each component token resolves to with the default global theme tokens.
4
+
5
+ ## Action bar
6
+
7
+ | Token | Computed default value |
8
+ | ------------------------------------------ | ---------------------- |
9
+ | `--puck-actionbar-color-bg` | #181818 |
10
+ | `--puck-actionbar-color-text` | #ffffff |
11
+ | `--puck-actionbar-opacity-text` | `0.75` |
12
+ | `--puck-actionbar-color-separator` | #767676 |
13
+ | `--puck-actionbar-color-action-hover` | #6499cf |
14
+ | `--puck-actionbar-color-action-active` | #88b0da |
15
+ | `--puck-actionbar-color-action-disabled` | #ffffff |
16
+ | `--puck-actionbar-opacity-action-disabled` | `0.54` |
17
+ | `--puck-actionbar-space-y` | `4px` |
18
+ | `--puck-actionbar-space-x` | `0` |
19
+ | `--puck-actionbar-radius` | `8px` |
20
+ | `--puck-actionbar-font-size` | `0.75rem` (`12px`) |
21
+ | `--puck-actionbar-action-space` | `6px` |
22
+ | `--puck-actionbar-action-size` | `16px` |
23
+
24
+ ## Button
25
+
26
+ | Token | Computed default value |
27
+ | --------------------------------------------- | --------------------------- |
28
+ | `--puck-button-radius` | `4px` |
29
+ | `--puck-button-medium-space-y` | `calc(8px - 1px)` (`7px`) |
30
+ | `--puck-button-medium-space-x` | `calc(20px - 1px)` (`19px`) |
31
+ | `--puck-button-medium-font-weight` | `400` |
32
+ | `--puck-button-medium-font-size` | `0.875rem` (`14px`) |
33
+ | `--puck-button-large-space-y` | `calc(12px - 1px)` (`11px`) |
34
+ | `--puck-button-large-space-x` | `calc(20px - 1px)` (`19px`) |
35
+ | `--puck-button-large-font-weight` | `400` |
36
+ | `--puck-button-large-font-size` | `0.875rem` (`14px`) |
37
+ | `--puck-button-primary-color-bg` | #0158ad |
38
+ | `--puck-button-primary-color-bg-hover` | #014292 |
39
+ | `--puck-button-primary-color-bg-active` | #002c77 |
40
+ | `--puck-button-primary-color-text` | #ffffff |
41
+ | `--puck-button-primary-color-border` | `transparent` |
42
+ | `--puck-button-primary-color-bg-disabled` | #ababab |
43
+ | `--puck-button-primary-color-text-disabled` | #404040 |
44
+ | `--puck-button-secondary-color-bg` | `transparent` |
45
+ | `--puck-button-secondary-color-bg-hover` | #f3f6fb |
46
+ | `--puck-button-secondary-color-bg-active` | #f3f6fb |
47
+ | `--puck-button-secondary-color-text` | `currentColor` |
48
+ | `--puck-button-secondary-color-border` | `currentColor` |
49
+ | `--puck-button-secondary-color-bg-disabled` | #ababab |
50
+ | `--puck-button-secondary-color-text-disabled` | #404040 |
51
+
52
+ ## Canvas
53
+
54
+ | Token | Computed default value |
55
+ | -------------------------------- | ---------------------- |
56
+ | `--puck-canvas-color-text` | #000000 |
57
+ | `--puck-canvas-color-bg` | #f5f5f5 |
58
+ | `--puck-canvas-preview-color-bg` | #ffffff |
59
+
60
+ ## Drawer
61
+
62
+ | Token | Computed default value |
63
+ | ----------------------------------------- | ---------------------- |
64
+ | `--puck-drawer-space` | `16px` |
65
+ | `--puck-drawer-category-color-text` | #767676 |
66
+ | `--puck-drawer-category-color-bg-hover` | #f3f6fb |
67
+ | `--puck-drawer-category-color-text-hover` | #0158ad |
68
+ | `--puck-drawer-category-color-bg-active` | #e7eef7 |
69
+ | `--puck-drawer-category-font-size` | `0.75rem` (`12px`) |
70
+ | `--puck-drawer-category-space` | `8px` |
71
+ | `--puck-drawer-item-color-bg` | #ffffff |
72
+ | `--puck-drawer-item-color-text` | #000000 |
73
+ | `--puck-drawer-item-color-border` | #dcdcdc |
74
+ | `--puck-drawer-item-border-width` | `1px` |
75
+ | `--puck-drawer-item-color-bg-hover` | #f7faff |
76
+ | `--puck-drawer-item-color-text-hover` | #0158ad |
77
+ | `--puck-drawer-item-radius` | `4px` |
78
+ | `--puck-drawer-item-font-size` | `0.875rem` (`14px`) |
79
+ | `--puck-drawer-item-space` | `12px` |
80
+
81
+ ## Fields
82
+
83
+ | Token | Computed default value |
84
+ | -------------------------------------------- | --------------------------- |
85
+ | `--puck-field-color-surface` | #ffffff |
86
+ | `--puck-field-color-bg` | #ffffff |
87
+ | `--puck-field-color-bg-hover` | #f7faff |
88
+ | `--puck-field-color-bg-active` | #f3f6fb |
89
+ | `--puck-field-color-text` | #000000 |
90
+ | `--puck-field-color-text-hover` | #000000 |
91
+ | `--puck-field-color-text-active` | #0158ad |
92
+ | `--puck-field-color-border` | #dcdcdc |
93
+ | `--puck-field-color-border-hover` | #767676 |
94
+ | `--puck-field-color-border-focus` | #3479be |
95
+ | `--puck-field-color-border-dragging` | #abc7e5 |
96
+ | `--puck-field-color-bg-disabled` | #f5f5f5 |
97
+ | `--puck-field-color-border-disabled` | #dcdcdc |
98
+ | `--puck-field-color-text-disabled` | #5a5a5a |
99
+ | `--puck-field-border-width` | `1px` |
100
+ | `--puck-field-radius` | `4px` |
101
+ | `--puck-field-font-size` | `0.875rem` (`14px`) |
102
+ | `--puck-field-space-x` | `calc(16px - 1px)` (`15px`) |
103
+ | `--puck-field-space-y` | `12px` |
104
+ | `--puck-field-space-surface-x` | `calc(16px - 1px)` (`15px`) |
105
+ | `--puck-field-space-surface-y` | `16px` |
106
+ | `--puck-field-label-color-text` | #5a5a5a |
107
+ | `--puck-field-label-space-y` | `12px` |
108
+ | `--puck-field-label-font-size` | `0.875rem` (`14px`) |
109
+ | `--puck-field-label-font-weight` | `600` |
110
+ | `--puck-field-label-color-icon` | #ababab |
111
+ | `--puck-field-array-add-color-icon` | #0158ad |
112
+ | `--puck-field-richtext-menu-color-bg` | #fafafa |
113
+ | `--puck-field-richtext-menu-color-separator` | #efefef |
114
+ | `--puck-field-richtext-menu-space-x` | `6px` |
115
+ | `--puck-field-richtext-menu-space-y` | `6px` |
116
+ | `--puck-field-external-detach-color-bg` | #fafafa |
117
+ | `--puck-field-external-detach-color-text` | #767676 |
118
+
119
+ ## Header
120
+
121
+ | Token | Computed default value |
122
+ | -------------------------- | ---------------------- |
123
+ | `--puck-header-color-bg` | #ffffff |
124
+ | `--puck-header-color-text` | #000000 |
125
+
126
+ ## Icon button
127
+
128
+ | Token | Computed default value |
129
+ | --------------------------------------- | ---------------------- |
130
+ | `--puck-iconbutton-radius` | `4px` |
131
+ | `--puck-iconbutton-space` | `4px` |
132
+ | `--puck-iconbutton-color-bg` | `transparent` |
133
+ | `--puck-iconbutton-color-bg-hover` | #efefef |
134
+ | `--puck-iconbutton-color-bg-active` | #f3f6fb |
135
+ | `--puck-iconbutton-color-icon` | `currentColor` |
136
+ | `--puck-iconbutton-color-icon-hover` | #0158ad |
137
+ | `--puck-iconbutton-color-icon-active` | #0158ad |
138
+ | `--puck-iconbutton-color-icon-disabled` | #ababab |
139
+
140
+ ## Outline
141
+
142
+ | Token | Computed default value |
143
+ | -------------------------------------- | -------------------------------------------------------------------------------------------------- |
144
+ | `--puck-outline-color-bg-hover` | #f3f6fb |
145
+ | `--puck-outline-color-bg-selected` | #e7eef7 |
146
+ | `--puck-outline-color-text` | #5a5a5a |
147
+ | `--puck-outline-color-text-hover` | #0158ad |
148
+ | `--puck-outline-color-text-helper` | #ababab |
149
+ | `--puck-outline-color-icon` | #ababab |
150
+ | `--puck-outline-color-border-hover` | #e7eef7 |
151
+ | `--puck-outline-color-border-selected` | #abc7e5 |
152
+ | `--puck-outline-color-drop-indicator` | #6499cf |
153
+ | `--puck-outline-space-indent` | `12px` |
154
+ | `--puck-outline-border-width` | `1px` |
155
+ | `--puck-outline-radius` | `4px` |
156
+ | `--puck-outline-font-size` | `0.75rem` (`12px`) |
157
+ | `--puck-outline-font-family` | `ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace` |
158
+ | `--puck-outline-icon-size` | `14px` |
159
+ | `--puck-outline-action-size` | `16px` |
160
+ | `--puck-outline-zone-color-text` | #767676 |
161
+ | `--puck-outline-zone-font-size` | `calc(0.75rem * 0.9)` (`10.8px`) |
162
+
163
+ ## Plugin bar
164
+
165
+ | Token | Computed default value |
166
+ | -------------------------------------- | ---------------------- |
167
+ | `--puck-pluginbar-color-bg` | #fafafa |
168
+ | `--puck-pluginbar-color-bg-hover` | #f3f6fb |
169
+ | `--puck-pluginbar-color-text` | #5a5a5a |
170
+ | `--puck-pluginbar-color-text-hover` | #0158ad |
171
+ | `--puck-pluginbar-color-text-selected` | #0158ad |
172
+ | `--puck-pluginbar-font-size` | `0.75rem` (`12px`) |
173
+
174
+ ## Sidebar
175
+
176
+ | Token | Computed default value |
177
+ | ------------------------------- | ---------------------- |
178
+ | `--puck-sidebar-left-color-bg` | #fafafa |
179
+ | `--puck-sidebar-right-color-bg` | #ffffff |
180
+
181
+ ## Slot
182
+
183
+ | Token | Computed default value |
184
+ | --------------------------------------------- | ----------------------------------------------------------- |
185
+ | `--puck-slot-color-bg` | color-mix(in srgb, #cfdff0 30%, transparent) |
186
+ | `--puck-slot-color-border` | #abc7e5 |
187
+ | `--puck-slot-border-width` | `2px` |
188
+ | `--puck-slot-border-style` | `dashed` |
189
+ | `--puck-slot-component-color-overlay` | color-mix(in srgb, #cfdff0 30%, transparent) |
190
+ | `--puck-slot-component-color-overlay-border` | #abc7e5 |
191
+ | `--puck-slot-component-border-width` | `2px` |
192
+ | `--puck-slot-component-color-border-selected` | #abc7e5 |
193
+ | `--puck-slot-component-color-placeholder` | #6499cf |
194
+ | `--puck-slot-component-color-border-dragging` | #cfdff0 |
@@ -0,0 +1,34 @@
1
+ # Drawer
2
+
3
+ Use the following CSS properties for theming the component drawer, including its category headers and draggable items.
4
+
5
+ ```css
6
+ .Container {
7
+ --puck-drawer-item-color-bg: #1e1e2e;
8
+ --puck-drawer-item-color-text: #cdd6f4;
9
+ --puck-drawer-item-radius: 12px;
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#drawer) for the values they resolve to.
16
+
17
+ | Token | Default | Description |
18
+ | ----------------------------------------- | ------------------------------------------ | ------------------------------------ |
19
+ | `--puck-drawer-space` | `var(--puck-space-4)` | Drawer padding |
20
+ | `--puck-drawer-category-color-text` | `var(--puck-color-text-muted)` | Category header text color |
21
+ | `--puck-drawer-category-color-bg-hover` | `var(--puck-color-interactive-soft)` | Category header background on hover |
22
+ | `--puck-drawer-category-color-text-hover` | `var(--puck-color-interactive)` | Category header text color on hover |
23
+ | `--puck-drawer-category-color-bg-active` | `var(--puck-color-interactive-subtle)` | Category header background on active |
24
+ | `--puck-drawer-category-font-size` | `var(--puck-font-size-xxxs)` | Category header font size |
25
+ | `--puck-drawer-category-space` | `var(--puck-space-2)` | Category header padding |
26
+ | `--puck-drawer-item-color-bg` | `var(--puck-color-surface)` | Item background color |
27
+ | `--puck-drawer-item-color-text` | `var(--puck-color-text)` | Item text color |
28
+ | `--puck-drawer-item-color-border` | `var(--puck-color-border)` | Item border color |
29
+ | `--puck-drawer-item-border-width` | `var(--puck-border-width-regular)` | Item border width |
30
+ | `--puck-drawer-item-color-bg-hover` | `var(--puck-color-interactive-soft-hover)` | Item background on hover |
31
+ | `--puck-drawer-item-color-text-hover` | `var(--puck-color-interactive)` | Item text color on hover |
32
+ | `--puck-drawer-item-radius` | `var(--puck-radius-m)` | Item border radius |
33
+ | `--puck-drawer-item-font-size` | `var(--puck-font-size-xxs)` | Item font size |
34
+ | `--puck-drawer-item-space` | `var(--puck-space-3)` | Item padding |