payload-canvas 0.5.2 → 0.7.0-next.0

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 (325) hide show
  1. package/README.md +350 -45
  2. package/dist/admin/AiKeyField.d.ts +4 -3
  3. package/dist/admin/AiKeyField.js +3 -3
  4. package/dist/admin/ArrayRowLabel.d.ts +12 -0
  5. package/dist/admin/ArrayRowLabel.js +21 -0
  6. package/dist/admin/BuilderTab.js +1 -1
  7. package/dist/admin/DocumentEditView.d.ts +1 -1
  8. package/dist/admin/DocumentEditView.js +2 -3
  9. package/dist/admin/LayoutField.d.ts +1 -1
  10. package/dist/admin/LayoutField.js +2 -2
  11. package/dist/admin/TemplateConditionsField.d.ts +2 -2
  12. package/dist/admin/TemplateConditionsField.js +2 -2
  13. package/dist/admin/aiKeyField.css +58 -0
  14. package/dist/admin/client.d.ts +1 -0
  15. package/dist/admin/client.js +2 -0
  16. package/dist/admin/diff/LayoutDiff.js +3 -3
  17. package/dist/admin/diff/LayoutJsonDiff.d.ts +1 -1
  18. package/dist/admin/diff/LayoutJsonDiff.js +1 -1
  19. package/dist/admin/diff/layoutDiff.css +180 -0
  20. package/dist/admin/editor/Editor.d.ts +2 -2
  21. package/dist/admin/editor/Editor.js +10 -3
  22. package/dist/admin/editor/Inspector.js +23 -17
  23. package/dist/admin/editor/Library.d.ts +2 -2
  24. package/dist/admin/editor/Library.js +8 -7
  25. package/dist/admin/editor/Outline.js +20 -12
  26. package/dist/admin/editor/Overlay.js +6 -4
  27. package/dist/admin/editor/actions.d.ts +7 -2
  28. package/dist/admin/editor/actions.js +44 -12
  29. package/dist/admin/editor/assistant/AssistantPanel.d.ts +1 -1
  30. package/dist/admin/editor/assistant/AssistantPanel.js +33 -21
  31. package/dist/admin/editor/assistant/{assistant.scss → assistant.css} +322 -315
  32. package/dist/admin/editor/classes/ClassManager.d.ts +1 -1
  33. package/dist/admin/editor/classes/ClassManager.js +1 -1
  34. package/dist/admin/editor/classes/manager.css +258 -0
  35. package/dist/admin/editor/comments/CommentLayer.d.ts +1 -1
  36. package/dist/admin/editor/comments/CommentLayer.js +1 -1
  37. package/dist/admin/editor/comments/CommentsPanel.d.ts +1 -1
  38. package/dist/admin/editor/comments/CommentsPanel.js +1 -1
  39. package/dist/admin/editor/comments/{comments.scss → comments.css} +121 -140
  40. package/dist/admin/editor/comments/controller.d.ts +7 -0
  41. package/dist/admin/editor/comments/controller.js +12 -0
  42. package/dist/admin/editor/comments/useCommentFromURL.d.ts +2 -0
  43. package/dist/admin/editor/comments/useCommentFromURL.js +36 -0
  44. package/dist/admin/editor/dnd/{dnd.scss → dnd.css} +78 -80
  45. package/dist/admin/editor/dnd/smooth.js +1 -1
  46. package/dist/admin/editor/{editor.scss → editor.css} +798 -751
  47. package/dist/admin/editor/empty/EmptyStart.d.ts +1 -1
  48. package/dist/admin/editor/empty/EmptyStart.js +3 -3
  49. package/dist/admin/editor/empty/{empty.scss → empty.css} +12 -13
  50. package/dist/admin/editor/fields/ArrayField.js +3 -3
  51. package/dist/admin/editor/fields/FormBlock.d.ts +20 -0
  52. package/dist/admin/editor/fields/FormBlock.js +167 -0
  53. package/dist/admin/editor/fields/FormFieldName.d.ts +25 -0
  54. package/dist/admin/editor/fields/FormFieldName.js +58 -0
  55. package/dist/admin/editor/fields/GroupField.d.ts +22 -2
  56. package/dist/admin/editor/fields/GroupField.js +30 -1
  57. package/dist/admin/editor/fields/MergeTags.d.ts +8 -0
  58. package/dist/admin/editor/fields/MergeTags.js +62 -0
  59. package/dist/admin/editor/fields/arrayRows.d.ts +0 -2
  60. package/dist/admin/editor/fields/arrayRows.js +0 -4
  61. package/dist/admin/editor/fields/fields.css +786 -0
  62. package/dist/admin/editor/fields/values.d.ts +0 -2
  63. package/dist/admin/editor/fields/values.js +0 -14
  64. package/dist/admin/editor/generate/GenerateImage.d.ts +1 -1
  65. package/dist/admin/editor/generate/GenerateImage.js +1 -1
  66. package/dist/admin/editor/generate/{generate.scss → generate.css} +83 -82
  67. package/dist/admin/editor/icons.d.ts +3 -0
  68. package/dist/admin/editor/icons.js +3 -0
  69. package/dist/admin/editor/insert/InsertHandle.js +1 -1
  70. package/dist/admin/editor/insert/picker.d.ts +3 -2
  71. package/dist/admin/editor/insert/picker.js +9 -3
  72. package/dist/admin/editor/layout/LeftPanel.js +5 -3
  73. package/dist/admin/editor/layout/layout.css +243 -0
  74. package/dist/admin/editor/layout/leftTabs.d.ts +15 -0
  75. package/dist/admin/editor/layout/leftTabs.js +18 -0
  76. package/dist/admin/editor/layout/panels.js +1 -1
  77. package/dist/admin/editor/live/PresenceUI.d.ts +1 -1
  78. package/dist/admin/editor/live/PresenceUI.js +2 -2
  79. package/dist/admin/editor/live/{presence.scss → presence.css} +5 -4
  80. package/dist/admin/editor/locale/LocaleField.d.ts +1 -1
  81. package/dist/admin/editor/locale/LocaleField.js +1 -1
  82. package/dist/admin/editor/locale/LocaleSwitcher.d.ts +1 -1
  83. package/dist/admin/editor/locale/LocaleSwitcher.js +1 -1
  84. package/dist/admin/editor/locale/locale.css +153 -0
  85. package/dist/admin/editor/media/ImageEditor.d.ts +9 -3
  86. package/dist/admin/editor/media/ImageEditor.js +17 -11
  87. package/dist/admin/editor/media/{media.scss → media.css} +70 -60
  88. package/dist/admin/editor/media/model.d.ts +10 -1
  89. package/dist/admin/editor/media/model.js +19 -0
  90. package/dist/admin/editor/menu/Menu.d.ts +1 -1
  91. package/dist/admin/editor/menu/Menu.js +1 -1
  92. package/dist/admin/editor/menu/blockMenu.js +3 -3
  93. package/dist/admin/editor/menu/menu.css +132 -0
  94. package/dist/admin/editor/motion/MotionPanel.d.ts +2 -2
  95. package/dist/admin/editor/motion/MotionPanel.js +2 -2
  96. package/dist/admin/editor/motion/{motion.scss → motion.css} +24 -21
  97. package/dist/admin/editor/names.d.ts +9 -0
  98. package/dist/admin/editor/names.js +18 -0
  99. package/dist/admin/editor/regions/RegionFields.d.ts +6 -0
  100. package/dist/admin/editor/regions/RegionFields.js +122 -0
  101. package/dist/admin/editor/regions/RegionPane.js +5 -3
  102. package/dist/admin/editor/regions/RegionRows.js +2 -2
  103. package/dist/admin/editor/regions/required.d.ts +16 -0
  104. package/dist/admin/editor/regions/required.js +43 -0
  105. package/dist/admin/editor/renderField.d.ts +10 -3
  106. package/dist/admin/editor/renderField.js +87 -33
  107. package/dist/admin/editor/runtime.d.ts +3 -2
  108. package/dist/admin/editor/runtime.js +12 -18
  109. package/dist/admin/editor/sections/ComponentFields.d.ts +1 -1
  110. package/dist/admin/editor/sections/ComponentFields.js +2 -3
  111. package/dist/admin/editor/sections/PropertyControls.d.ts +1 -1
  112. package/dist/admin/editor/sections/PropertyControls.js +1 -1
  113. package/dist/admin/editor/sections/components.css +244 -0
  114. package/dist/admin/editor/sections/variants.css +93 -0
  115. package/dist/admin/editor/sections/variants.d.ts +1 -1
  116. package/dist/admin/editor/sections/variants.js +1 -1
  117. package/dist/admin/editor/styles/ClassBar.d.ts +1 -1
  118. package/dist/admin/editor/styles/ClassBar.js +1 -1
  119. package/dist/admin/editor/styles/StylesPanel.d.ts +1 -1
  120. package/dist/admin/editor/styles/StylesPanel.js +5 -3
  121. package/dist/admin/editor/styles/{classes.scss → classes.css} +128 -125
  122. package/dist/admin/editor/styles/context.js +9 -4
  123. package/dist/admin/editor/styles/{styles.scss → styles.css} +368 -370
  124. package/dist/admin/editor/templates/Bindable.d.ts +1 -1
  125. package/dist/admin/editor/templates/Bindable.js +1 -1
  126. package/dist/admin/editor/templates/binding.js +4 -1
  127. package/dist/admin/editor/templates/{templates.scss → templates.css} +207 -206
  128. package/dist/admin/editor/tooltip/Tooltips.d.ts +1 -1
  129. package/dist/admin/editor/tooltip/Tooltips.js +1 -1
  130. package/dist/admin/editor/tooltip/{tooltip.scss → tooltip.css} +11 -10
  131. package/dist/admin/editor/topbar/ContentModeToggle.d.ts +1 -1
  132. package/dist/admin/editor/topbar/ContentModeToggle.js +2 -2
  133. package/dist/admin/editor/topbar/DocumentActions.js +5 -5
  134. package/dist/admin/editor/topbar/TopBar.d.ts +1 -1
  135. package/dist/admin/editor/topbar/TopBar.js +2 -3
  136. package/dist/admin/editor/topbar/contentMode.css +25 -0
  137. package/dist/admin/editor/topbar/screens/DrawerRouter.d.ts +1 -1
  138. package/dist/admin/editor/topbar/screens/DrawerRouter.js +52 -40
  139. package/dist/admin/editor/topbar/screens/ScreenDrawer.d.ts +1 -1
  140. package/dist/admin/editor/topbar/screens/ScreenDrawer.js +4 -5
  141. package/dist/admin/editor/topbar/screens/drawerRouterSupport.d.ts +5 -5
  142. package/dist/admin/editor/topbar/screens/drawerRouterSupport.js +7 -7
  143. package/dist/admin/editor/topbar/screens/screens.css +139 -0
  144. package/dist/admin/editor/topbar/settingsDrawer.css +33 -0
  145. package/dist/admin/editor/topbar/settingsDrawer.d.ts +1 -1
  146. package/dist/admin/editor/topbar/settingsDrawer.js +3 -3
  147. package/dist/admin/editor/topbar/{topbar.scss → topbar.css} +189 -231
  148. package/dist/admin/editor/ui/Select.d.ts +1 -1
  149. package/dist/admin/editor/ui/Select.js +1 -1
  150. package/dist/admin/editor/ui/Slider.d.ts +1 -1
  151. package/dist/admin/editor/ui/Slider.js +1 -1
  152. package/dist/admin/editor/ui/Tabs.d.ts +17 -0
  153. package/dist/admin/editor/ui/Tabs.js +17 -0
  154. package/dist/admin/editor/ui/controls.css +301 -0
  155. package/dist/admin/forms/SubmissionCells.d.ts +6 -0
  156. package/dist/admin/forms/SubmissionCells.js +31 -0
  157. package/dist/admin/forms/SubmissionView.d.ts +5 -0
  158. package/dist/admin/forms/SubmissionView.js +106 -0
  159. package/dist/admin/forms/submissionData.d.ts +32 -0
  160. package/dist/admin/forms/submissionData.js +63 -0
  161. package/dist/admin/forms/submissions.css +200 -0
  162. package/dist/admin/layoutField.css +70 -0
  163. package/dist/admin/rsc.d.ts +2 -0
  164. package/dist/admin/rsc.js +5 -0
  165. package/dist/admin/screen/BuilderScreen.d.ts +1 -1
  166. package/dist/admin/screen/BuilderScreen.js +1 -1
  167. package/dist/admin/templateConditions.css +25 -0
  168. package/dist/ai/endpoint.d.ts +5 -0
  169. package/dist/ai/endpoint.js +18 -8
  170. package/dist/ai/images/service.js +2 -2
  171. package/dist/ai/prompt.d.ts +8 -0
  172. package/dist/ai/prompt.js +30 -0
  173. package/dist/ai/settings/index.js +3 -0
  174. package/dist/ai/tools.d.ts +6 -1
  175. package/dist/ai/tools.js +90 -6
  176. package/dist/blocks/builtins/carousel.js +10 -1
  177. package/dist/blocks/index.d.ts +1 -1
  178. package/dist/blocks/index.js +1 -1
  179. package/dist/blocks/payload.d.ts +7 -0
  180. package/dist/blocks/payload.js +16 -2
  181. package/dist/classes/collection.js +1 -0
  182. package/dist/classes/sheet.js +2 -0
  183. package/dist/comments/collection.js +3 -0
  184. package/dist/comments/shared.d.ts +5 -0
  185. package/dist/comments/shared.js +5 -0
  186. package/dist/core/blocks.d.ts +17 -3
  187. package/dist/core/blocks.js +92 -10
  188. package/dist/core/classes.d.ts +5 -0
  189. package/dist/core/classes.js +26 -1
  190. package/dist/core/conditions.d.ts +7 -0
  191. package/dist/core/conditions.js +22 -0
  192. package/dist/core/dropTarget.d.ts +3 -2
  193. package/dist/core/dropTarget.js +7 -1
  194. package/dist/core/fieldHooks.d.ts +1 -1
  195. package/dist/core/index.d.ts +6 -3
  196. package/dist/core/index.js +6 -3
  197. package/dist/core/payloadBlocks.js +25 -3
  198. package/dist/core/references.d.ts +7 -0
  199. package/dist/core/references.js +29 -11
  200. package/dist/core/regions.d.ts +14 -0
  201. package/dist/core/regions.js +17 -1
  202. package/dist/core/rowLabel.d.ts +8 -0
  203. package/dist/core/rowLabel.js +98 -0
  204. package/dist/core/starter.d.ts +10 -0
  205. package/dist/core/starter.js +40 -0
  206. package/dist/core/tree.js +4 -0
  207. package/dist/core/types.d.ts +96 -0
  208. package/dist/core/uniqueProps.d.ts +40 -0
  209. package/dist/core/uniqueProps.js +156 -0
  210. package/dist/core/validate.js +43 -3
  211. package/dist/forms/answers.d.ts +21 -0
  212. package/dist/forms/answers.js +82 -0
  213. package/dist/forms/blocks.d.ts +33 -0
  214. package/dist/forms/blocks.js +178 -0
  215. package/dist/forms/conditions.d.ts +78 -0
  216. package/dist/forms/conditions.js +184 -0
  217. package/dist/forms/emails.d.ts +23 -0
  218. package/dist/forms/emails.js +64 -0
  219. package/dist/forms/fieldConfigs.d.ts +35 -0
  220. package/dist/forms/fieldConfigs.js +167 -0
  221. package/dist/forms/fieldOps.d.ts +78 -0
  222. package/dist/forms/fieldOps.js +378 -0
  223. package/dist/forms/fieldSettings.d.ts +81 -0
  224. package/dist/forms/fieldSettings.js +239 -0
  225. package/dist/forms/files.d.ts +54 -0
  226. package/dist/forms/files.js +128 -0
  227. package/dist/forms/index.d.ts +16 -0
  228. package/dist/forms/index.js +18 -0
  229. package/dist/forms/mergeTags.d.ts +103 -0
  230. package/dist/forms/mergeTags.js +150 -0
  231. package/dist/forms/noScript.d.ts +60 -0
  232. package/dist/forms/noScript.js +109 -0
  233. package/dist/forms/pageForms.d.ts +99 -0
  234. package/dist/forms/pageForms.js +294 -0
  235. package/dist/forms/pageSync.d.ts +91 -0
  236. package/dist/forms/pageSync.js +325 -0
  237. package/dist/forms/rateLimit.d.ts +21 -0
  238. package/dist/forms/rateLimit.js +50 -0
  239. package/dist/forms/settings.d.ts +13 -0
  240. package/dist/forms/settings.js +92 -0
  241. package/dist/forms/spam.d.ts +100 -0
  242. package/dist/forms/spam.js +218 -0
  243. package/dist/forms/spamSettings.d.ts +43 -0
  244. package/dist/forms/spamSettings.js +25 -0
  245. package/dist/forms/submission.d.ts +34 -0
  246. package/dist/forms/submission.js +89 -0
  247. package/dist/forms/submissionsAdmin.d.ts +26 -0
  248. package/dist/forms/submissionsAdmin.js +108 -0
  249. package/dist/forms/summary.d.ts +60 -0
  250. package/dist/forms/summary.js +113 -0
  251. package/dist/forms/uploads.d.ts +41 -0
  252. package/dist/forms/uploads.js +132 -0
  253. package/dist/index.d.ts +8 -2
  254. package/dist/index.js +8 -2
  255. package/dist/live/document.d.ts +12 -0
  256. package/dist/live/document.js +8 -1
  257. package/dist/live/draftAccess.js +1 -1
  258. package/dist/live/endpoints.d.ts +1 -0
  259. package/dist/live/session.js +3 -1
  260. package/dist/live/storage.d.ts +13 -2
  261. package/dist/live/storage.js +18 -7
  262. package/dist/mcp/forms.d.ts +26 -0
  263. package/dist/mcp/forms.js +280 -0
  264. package/dist/mcp/index.d.ts +7 -0
  265. package/dist/mcp/index.js +29 -10
  266. package/dist/mcp/shared.d.ts +1 -0
  267. package/dist/mcp/shared.js +1 -0
  268. package/dist/plugin/forms.d.ts +30 -0
  269. package/dist/plugin/forms.js +63 -0
  270. package/dist/plugin/formsSync.d.ts +138 -0
  271. package/dist/plugin/formsSync.js +345 -0
  272. package/dist/plugin/hook.d.ts +22 -0
  273. package/dist/plugin/hook.js +19 -7
  274. package/dist/plugin/index.d.ts +14 -0
  275. package/dist/plugin/index.js +101 -30
  276. package/dist/plugin/links.d.ts +7 -2
  277. package/dist/plugin/links.js +9 -3
  278. package/dist/plugin/references.d.ts +6 -0
  279. package/dist/plugin/references.js +12 -0
  280. package/dist/plugin/sections.js +3 -0
  281. package/dist/plugin/templates.js +5 -1
  282. package/dist/react/canvas/BuilderCanvas.d.ts +2 -0
  283. package/dist/react/canvas/BuilderCanvas.js +29 -6
  284. package/dist/react/canvas/inline/candidates.js +2 -2
  285. package/dist/react/canvas/inline/mapper.d.ts +6 -1
  286. package/dist/react/canvas/inline/mapper.js +35 -4
  287. package/dist/react/canvas/inline/rich/editor.js +9 -1
  288. package/dist/react/components/Image.d.ts +1 -1
  289. package/dist/react/components/Image.js +2 -2
  290. package/dist/react/render/LayoutOutlet.d.ts +7 -3
  291. package/dist/react/render/LayoutOutlet.js +9 -4
  292. package/dist/react/render/RenderLayout.js +13 -7
  293. package/dist/react/render/resolve.d.ts +1 -0
  294. package/dist/react/render/resolve.js +7 -1
  295. package/dist/react/render/templates.js +3 -1
  296. package/dist/react/server.js +19 -0
  297. package/dist/react/theme/ThemeStyle.js +1 -1
  298. package/dist/theme/admin/ColorField.d.ts +4 -3
  299. package/dist/theme/admin/ColorField.js +1 -1
  300. package/dist/theme/admin/FontField.d.ts +4 -3
  301. package/dist/theme/admin/FontField.js +1 -1
  302. package/dist/theme/admin/SaveSignal.js +1 -1
  303. package/dist/theme/admin/SliderField.d.ts +1 -1
  304. package/dist/theme/admin/SliderField.js +1 -1
  305. package/dist/theme/admin/Variables.d.ts +4 -3
  306. package/dist/theme/admin/Variables.js +2 -2
  307. package/dist/theme/admin/fields.css +327 -0
  308. package/dist/theme/global.js +2 -0
  309. package/package.json +29 -24
  310. package/dist/admin/aiKeyField.scss +0 -58
  311. package/dist/admin/diff/layoutDiff.scss +0 -181
  312. package/dist/admin/editor/classes/manager.scss +0 -262
  313. package/dist/admin/editor/fields/fields.scss +0 -628
  314. package/dist/admin/editor/layout/layout.scss +0 -240
  315. package/dist/admin/editor/locale/locale.scss +0 -154
  316. package/dist/admin/editor/menu/menu.scss +0 -132
  317. package/dist/admin/editor/sections/components.scss +0 -238
  318. package/dist/admin/editor/sections/variants.scss +0 -90
  319. package/dist/admin/editor/topbar/contentMode.scss +0 -35
  320. package/dist/admin/editor/topbar/screens/screens.scss +0 -134
  321. package/dist/admin/editor/topbar/settingsDrawer.scss +0 -32
  322. package/dist/admin/editor/ui/controls.scss +0 -320
  323. package/dist/admin/layoutField.scss +0 -69
  324. package/dist/admin/templateConditions.scss +0 -24
  325. package/dist/theme/admin/fields.scss +0 -363
@@ -20,14 +20,14 @@ export function focalStyle(doc) {
20
20
  return { objectPosition: `${x}% ${y}%` };
21
21
  }
22
22
  /**
23
- * `srcset` from Payload's image sizes (`doc.sizes`) plus the original. Only sizes with the
23
+ * `srcset` from Payload's image variants (`doc.variants`) plus the original. Only sizes with the
24
24
  * original's aspect ratio count (a square crop would distort the image). Undefined when there
25
25
  * is nothing to choose from.
26
26
  */
27
27
  export function srcSetOf(doc) {
28
28
  const width = asNumber(doc.width);
29
29
  const height = asNumber(doc.height);
30
- const sizes = doc.sizes;
30
+ const sizes = doc.variants;
31
31
  if (!width || !height || typeof sizes !== 'object' || sizes === null)
32
32
  return undefined;
33
33
  const ratio = width / height;
@@ -1,11 +1,15 @@
1
1
  import { type ReactNode } from 'react';
2
- /** Canvas only. The live layout the canvas renders. `BuilderCanvas` provides it around the page frame. */
2
+ /** Canvas only. The live layout's blocks the canvas renders. `BuilderCanvas` provides them around the page frame. */
3
3
  export declare const LayoutOutletContext: import("react").Context<ReactNode>;
4
4
  /** Mount notifications include outlets that appear later through Suspense. */
5
5
  export declare const LayoutOutletPresence: import("react").Context<(() => () => void) | null>;
6
6
  /**
7
7
  * Stands in for the layout in the page frame the canvas server action renders. The canvas fills
8
8
  * it with the layout it renders itself, so every block stays live: selectable, draggable and
9
- * edited in place, with no request to the server.
9
+ * edited in place, with no request to the server. The blocks sit in one `div` (the layout's box);
10
+ * `className` styles it, for example `flex flex-wrap gap-4` when the page puts the blocks in a
11
+ * flex row. Without it the box is a plain block.
10
12
  */
11
- export declare function LayoutOutlet(): ReactNode;
13
+ export declare function LayoutOutlet({ className }?: {
14
+ className?: string;
15
+ }): ReactNode;
@@ -1,16 +1,21 @@
1
1
  'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { createContext, useContext, useLayoutEffect } from 'react';
3
- /** Canvas only. The live layout the canvas renders. `BuilderCanvas` provides it around the page frame. */
4
+ import { LAYOUT_ROOT_ATTRIBUTE } from './regions.js';
5
+ /** Canvas only. The live layout's blocks the canvas renders. `BuilderCanvas` provides them around the page frame. */
4
6
  export const LayoutOutletContext = createContext(null);
5
7
  /** Mount notifications include outlets that appear later through Suspense. */
6
8
  export const LayoutOutletPresence = createContext(null);
7
9
  /**
8
10
  * Stands in for the layout in the page frame the canvas server action renders. The canvas fills
9
11
  * it with the layout it renders itself, so every block stays live: selectable, draggable and
10
- * edited in place, with no request to the server.
12
+ * edited in place, with no request to the server. The blocks sit in one `div` (the layout's box);
13
+ * `className` styles it, for example `flex flex-wrap gap-4` when the page puts the blocks in a
14
+ * flex row. Without it the box is a plain block.
11
15
  */
12
- export function LayoutOutlet() {
16
+ export function LayoutOutlet({ className } = {}) {
13
17
  const register = useContext(LayoutOutletPresence);
14
18
  useLayoutEffect(() => register?.(), [register]);
15
- return useContext(LayoutOutletContext);
19
+ const content = useContext(LayoutOutletContext);
20
+ return (_jsx("div", { [LAYOUT_ROOT_ATTRIBUTE]: '', className: className || undefined, children: content }));
16
21
  }
@@ -54,7 +54,9 @@ function renderSlot(block, slot, ctx) {
54
54
  return renderBlocks(children, ctx, staggersChildren(block.motion));
55
55
  if (!isEditor(ctx))
56
56
  return null;
57
- return (_jsx("div", { "data-slot-empty": "", "data-slot-owner": block.id, "data-slot": slot, style: PLACEHOLDER_STYLE }));
57
+ // The slot's description ("Each block here is one slide") shows inside the empty slot.
58
+ const hint = ctx.definitions.get(block.type)?.slots?.[slot]?.description;
59
+ return (_jsx("div", { "data-slot-empty": "", "data-slot-owner": block.id, "data-slot": slot, "data-slot-hint": hint, style: PLACEHOLDER_STYLE }));
58
60
  }
59
61
  /** The contexts a list block's `item` slot renders with: one per listed document or repeat row. */
60
62
  function repeatContexts(block, around) {
@@ -142,7 +144,7 @@ function renderBlock(stored, ctx, preview = false, item = false) {
142
144
  : editor
143
145
  ? { 'data-block-id': block.id, 'data-block-type': block.type }
144
146
  : canvas
145
- ? { 'data-builder-repeat': '' }
147
+ ? { 'data-builder-repeat': '', ...(ctx.component ? { 'data-builder-component': '' } : {}) }
146
148
  : {};
147
149
  if (editor && !preview && block.hidden)
148
150
  attributes['data-builder-hidden'] = 'true';
@@ -175,7 +177,7 @@ function renderBlock(stored, ctx, preview = false, item = false) {
175
177
  if (slot === SECTION_REF_SLOT) {
176
178
  // A live saved section: its blocks render as repeats on the canvas (the ref is what the
177
179
  // editor selects), and its runtime slot is never a drop target.
178
- slots[slot] = renderBlocks(block.slots?.[slot] ?? [], { ...ctx, repeat: ctx.repeat || canvas });
180
+ slots[slot] = renderBlocks(block.slots?.[slot] ?? [], { ...ctx, repeat: ctx.repeat || canvas, component: canvas });
179
181
  partAttributes[slot] = {};
180
182
  continue;
181
183
  }
@@ -193,10 +195,13 @@ function renderBlock(stored, ctx, preview = false, item = false) {
193
195
  slots[LIST_ITEM_SLOT] = renderListItems(block, ctx);
194
196
  partAttributes[LIST_ITEM_SLOT] = {};
195
197
  }
196
- // Parts (styled slots and `parts`) carry their own classes, with the marker class.
197
- for (const part of blockParts(definition)) {
198
- const own = (partAttributes[part.name] ??= {});
199
- const partClass = withBuilderCssClass(stored.partClassName?.[part.name]);
198
+ // Parts (styled slots and `parts`) carry their own classes, with the marker class. A block whose
199
+ // definition this list lacks (form fields the plugin adds from the forms collection) keeps the
200
+ // parts it stores.
201
+ const partNames = definition ? blockParts(definition).map((part) => part.name) : Object.keys(stored.partClassName ?? {});
202
+ for (const name of partNames) {
203
+ const own = (partAttributes[name] ??= {});
204
+ const partClass = withBuilderCssClass(stored.partClassName?.[name]);
200
205
  if (partClass)
201
206
  own.className = partClass;
202
207
  }
@@ -233,6 +238,7 @@ function createContext(mode, components, blocks, resolveLink, context, pageData,
233
238
  binding: { url: urlResolver(resolveLink), ...(relations ? { relations } : {}) },
234
239
  context,
235
240
  repeat: false,
241
+ component: false,
236
242
  copy: false,
237
243
  pageData,
238
244
  // The editor keeps plain links: a client-side router link would navigate the canvas.
@@ -54,5 +54,6 @@ export type LoadLayoutOptions = RenderLocale & {
54
54
  * 2. Loads every collection list's documents (`depth: 1` or the list's `depth`; published only unless `draft`), with the
55
55
  * access of `options.user` (anonymous without it).
56
56
  * 3. Replaces upload/relationship IDs in block props with documents (one batched `find` per collection).
57
+ * 4. Gives each Form block that shows a saved form that form's fields as its children (`withSavedFormFields`).
57
58
  */
58
59
  export declare function loadLayoutData(layout: Layout, blocks: BlockDefinition[], payload: Payload, options?: LoadLayoutOptions): Promise<Layout>;
@@ -1,4 +1,5 @@
1
1
  // Replaces upload/relationship IDs in block props with documents.
2
+ import { withSavedFormFields } from '../../forms/pageSync.js';
2
3
  import { resolveBindings } from '../../core/index.js';
3
4
  import { isRecord, mapFieldValues } from './fields.js';
4
5
  import { arrangeListDocs, attachListItems, listQueries, listRequest, pageLinks, withPageParams } from './lists.js';
@@ -123,6 +124,7 @@ export function urlResolver(resolveLink) {
123
124
  * 2. Loads every collection list's documents (`depth: 1` or the list's `depth`; published only unless `draft`), with the
124
125
  * access of `options.user` (anonymous without it).
125
126
  * 3. Replaces upload/relationship IDs in block props with documents (one batched `find` per collection).
127
+ * 4. Gives each Form block that shows a saved form that form's fields as its children (`withSavedFormFields`).
126
128
  */
127
129
  export async function loadLayoutData(layout, blocks, payload, options) {
128
130
  const draft = options?.draft ?? false;
@@ -140,6 +142,8 @@ export async function loadLayoutData(layout, blocks, payload, options) {
140
142
  pagination: false,
141
143
  // Join fields (for example media's "Used in") are not needed to render; skip their subqueries.
142
144
  joins: false,
145
+ // A trusted server read, as in Payload 3: an editor picked these documents.
146
+ overrideAccess: true,
143
147
  ...locale,
144
148
  });
145
149
  return new Map(result.docs.map((doc) => [doc.id, doc]));
@@ -167,7 +171,9 @@ export async function loadLayoutData(layout, blocks, payload, options) {
167
171
  }));
168
172
  const withItems = withPageParams(attachListItems(bound, items, pages), queries);
169
173
  // List items and repeat rows resolve their bindings in `RenderLayout`: they take the relations along.
170
- return resolveLayoutData(withRelations(withItems, relations), blocks, fetchDocs);
174
+ const loaded = await resolveLayoutData(withRelations(withItems, relations), blocks, fetchDocs);
175
+ // A Form block that shows a saved form renders that form's fields as its own blocks.
176
+ return withSavedFormFields(loaded);
171
177
  }
172
178
  /**
173
179
  * One collection list's documents. An unknown collection, a filter that matches nothing (`none`) or
@@ -41,6 +41,7 @@ async function matchesConditions(payload, collection, id, where, draft, locale)
41
41
  limit: 1,
42
42
  pagination: false,
43
43
  select: { id: true },
44
+ overrideAccess: true,
44
45
  ...locale,
45
46
  });
46
47
  return found.docs.length > 0;
@@ -67,7 +68,7 @@ export async function findTemplate(payload, args) {
67
68
  if (typeof id !== 'string' && typeof id !== 'number')
68
69
  return null;
69
70
  try {
70
- return usable((await payload.findByID({ collection: slug, id, depth: 0, draft, ...locale })), collection, draft);
71
+ return usable((await payload.findByID({ collection: slug, id, depth: 0, draft, overrideAccess: true, ...locale })), collection, draft);
71
72
  }
72
73
  catch {
73
74
  // A deleted template falls back to the next one.
@@ -94,6 +95,7 @@ export async function findTemplate(payload, args) {
94
95
  createdAt: true,
95
96
  updatedAt: true,
96
97
  },
98
+ overrideAccess: true,
97
99
  ...locale,
98
100
  })).docs;
99
101
  // 2. Templates with conditions: the match queries run at the same time; the order picks the winner.
@@ -5,6 +5,8 @@ import { collectClasses } from '../core/index.js';
5
5
  import { compileClasses } from '../css/index.js';
6
6
  import { withThemeVariables } from '../theme/server.js';
7
7
  import { loadClassesSheet } from './classes/ClassesStyle.js';
8
+ import { builderConfigOf } from '../live/document.js';
9
+ import { savedFormIds, savedFormsClasses } from '../forms/pageSync.js';
8
10
  export { loadLayoutData } from './render/resolve.js';
9
11
  export { loadTemplate } from './render/templates.js';
10
12
  export { loadedLists } from './render/lists.js';
@@ -35,6 +37,9 @@ export async function compilePageCss(payload, parts) {
35
37
  for (const part of present)
36
38
  for (const name of collectClasses(part.layout, config.blocks))
37
39
  classes.add(name);
40
+ // A Form block that shows a saved form renders that form's fields: their classes count too.
41
+ for (const name of await savedFormClasses(payload, present.map((part) => part.layout)))
42
+ classes.add(name);
38
43
  if (classes.size === 0)
39
44
  return null;
40
45
  try {
@@ -47,3 +52,17 @@ export async function compilePageCss(payload, parts) {
47
52
  return stored();
48
53
  }
49
54
  }
55
+ /** The classes of the fields of the saved forms the layouts show ("Use a saved form"). One query. */
56
+ async function savedFormClasses(payload, layouts) {
57
+ const forms = builderConfigOf(payload)?.pageForms?.collection;
58
+ const ids = savedFormIds(layouts);
59
+ if (!forms || ids.length === 0)
60
+ return [];
61
+ try {
62
+ const { docs } = await payload.find({ collection: forms, where: { id: { in: ids } }, depth: 0, limit: ids.length, pagination: false, select: { fields: true }, overrideAccess: true });
63
+ return savedFormsClasses(docs);
64
+ }
65
+ catch {
66
+ return [];
67
+ }
68
+ }
@@ -14,7 +14,7 @@ export const loadTheme = cache(async (payload) => {
14
14
  const config = themeConfigOf(payload);
15
15
  if (!config)
16
16
  return null;
17
- const data = (await payload.findGlobal({ slug: config.slug, depth: 0 }));
17
+ const data = (await payload.findGlobal({ slug: config.slug, depth: 0, overrideAccess: true }));
18
18
  return { data, ...themeOutput(data) };
19
19
  });
20
20
  /**
@@ -1,4 +1,5 @@
1
- import type { TextFieldClientComponent } from 'payload';
2
- import './fields.scss';
1
+ import type { TextFieldClientProps } from 'payload';
2
+ import { type FC } from 'react';
3
+ import './fields.css';
3
4
  /** A hex color: a swatch that opens a picker with presets, and a hex input. Empty means "not set". */
4
- export declare const ThemeColorField: TextFieldClientComponent;
5
+ export declare const ThemeColorField: FC<TextFieldClientProps>;
@@ -5,7 +5,7 @@ import { useField } from '@payloadcms/ui';
5
5
  import { useState } from 'react';
6
6
  import { HexColorPicker } from 'react-colorful';
7
7
  import { FieldShell, labelText } from './FieldShell.js';
8
- import './fields.scss';
8
+ import './fields.css';
9
9
  const PRESETS = [
10
10
  '#000000', '#374151', '#6b7280', '#9ca3af', '#d1d5db', '#ffffff',
11
11
  '#ef4444', '#f97316', '#eab308', '#22c55e', '#3b82f6', '#8b5cf6',
@@ -1,4 +1,5 @@
1
- import type { TextFieldClientComponent } from 'payload';
2
- import './fields.scss';
1
+ import type { TextFieldClientProps } from 'payload';
2
+ import { type FC } from 'react';
3
+ import './fields.css';
3
4
  /** A Google Font family: a searchable list that previews each font in its own typeface. */
4
- export declare const ThemeFontField: TextFieldClientComponent;
5
+ export declare const ThemeFontField: FC<TextFieldClientProps>;
@@ -6,7 +6,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
6
6
  import { googleFontsHref } from '../css.js';
7
7
  import { FieldShell, labelText } from './FieldShell.js';
8
8
  import { GOOGLE_FONTS } from './googleFonts.js';
9
- import './fields.scss';
9
+ import './fields.css';
10
10
  const MAX_VISIBLE = 50;
11
11
  /** Fonts already added to the admin page for previews. Shared by every font field. */
12
12
  const loaded = new Set();
@@ -7,7 +7,7 @@ import { THEME_CHANNEL } from '../config.js';
7
7
  * so every open builder canvas (any tab of this site) reloads the theme at once.
8
8
  */
9
9
  export function ThemeSaveSignal() {
10
- const { savedDocumentData } = useDocumentInfo();
10
+ const { data: savedDocumentData } = useDocumentInfo();
11
11
  const updatedAt = typeof savedDocumentData?.updatedAt === 'string' ? savedDocumentData.updatedAt : null;
12
12
  const first = useRef(updatedAt);
13
13
  useEffect(() => {
@@ -1,5 +1,5 @@
1
1
  import type { StaticLabel } from 'payload';
2
- import './fields.scss';
2
+ import './fields.css';
3
3
  /** The props Payload passes to a `text` or `number` field component (the parts used here). */
4
4
  type SliderFieldProps = {
5
5
  path: string;
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useField } from '@payloadcms/ui';
4
4
  import { Slider } from '../../admin/editor/ui/Slider.js';
5
5
  import { FieldShell, labelText } from './FieldShell.js';
6
- import './fields.scss';
6
+ import './fields.css';
7
7
  /**
8
8
  * A slider with a number input, for a `number` or `text` field. `admin.custom` sets `min`, `max`,
9
9
  * `step`, `unit` and `fallback` (the position shown while the field is empty).
@@ -1,7 +1,8 @@
1
- import type { TextFieldClientComponent } from 'payload';
2
- import './fields.scss';
1
+ import type { TextFieldClientProps } from 'payload';
2
+ import { type FC } from 'react';
3
+ import './fields.css';
3
4
  /** A variable's value (or dark value): a color picker, a size input or a Google Font, from the row's type. */
4
- export declare const ThemeVariableValueField: TextFieldClientComponent;
5
+ export declare const ThemeVariableValueField: FC<TextFieldClientProps>;
5
6
  /** The row label: preview, name, type and value. */
6
7
  export declare function ThemeVariableRowLabel(): import("react").JSX.Element;
7
8
  /**
@@ -10,7 +10,7 @@ import { VARIABLE_TYPES } from '../variables.js';
10
10
  import { ThemeColorField } from './ColorField.js';
11
11
  import { FieldShell } from './FieldShell.js';
12
12
  import { ThemeFontField } from './FontField.js';
13
- import './fields.scss';
13
+ import './fields.css';
14
14
  /** `variables.2.value` → `variables.2`. */
15
15
  const rowPath = (path) => path.slice(0, path.lastIndexOf('.'));
16
16
  const asType = (value) => (value === 'size' || value === 'font' ? value : 'color');
@@ -65,7 +65,7 @@ const rowsOf = (list) => Array.isArray(list)
65
65
  */
66
66
  export function ThemeVariablesWarning() {
67
67
  const { config: { routes: { admin, api }, }, } = useConfig();
68
- const { savedDocumentData } = useDocumentInfo();
68
+ const { data: savedDocumentData } = useDocumentInfo();
69
69
  const saved = useMemo(() => rowsOf(savedDocumentData?.variables), [savedDocumentData]);
70
70
  // The current rows as text, so the form's other edits do not render this again.
71
71
  const currentKey = useFormFields(([fields]) => {
@@ -0,0 +1,327 @@
1
+ /* Theme fields in Payload's admin. Payload CSS variables only, no Tailwind. */
2
+ @layer payload-default {
3
+ .theme-field {
4
+ margin-bottom: var(--spacing-field, calc(1.0156rem * 1.5));
5
+ }
6
+
7
+ /* Shared look of the text inputs, close to Payload's own inputs. */
8
+ .theme-slider__number, .theme-font__input, .theme-color__hex {
9
+ height: calc(1.0156rem * 2);
10
+ padding: 0 calc(1.0156rem * 0.5);
11
+ border: 1px solid var(--color-border);
12
+ border-radius: var(--radius-medium, var(--radius-medium));
13
+ background: var(--field-color-bg);
14
+ color: var(--color-text);
15
+ font: inherit;
16
+ font-size: var(--text-body-medium-font-size, 13px);
17
+ box-sizing: border-box;
18
+ outline: none;
19
+ }
20
+
21
+ .theme-slider__number:hover, .theme-font__input:hover, .theme-color__hex:hover {
22
+ border-color: var(--color-border-control-strong);
23
+ }
24
+
25
+ .theme-slider__number:focus, .theme-font__input:focus, .theme-color__hex:focus {
26
+ border-color: var(--color-border-control-strong);
27
+ }
28
+
29
+ .theme-slider__number:disabled, .theme-font__input:disabled, .theme-color__hex:disabled {
30
+ background: var(--color-bg-secondary);
31
+ color: var(--color-text-tertiary);
32
+ }
33
+
34
+ .theme-slider__reset, .theme-font__clear, .theme-color__clear {
35
+ flex-shrink: 0;
36
+ padding: calc(1.0156rem * 0.25) calc(1.0156rem * 0.5);
37
+ border: none;
38
+ border-radius: var(--radius-medium, var(--radius-medium));
39
+ background: none;
40
+ color: var(--color-text-secondary);
41
+ font: inherit;
42
+ font-size: var(--text-body-small-font-size, 12px);
43
+ cursor: pointer;
44
+ }
45
+
46
+ .theme-slider__reset:hover, .theme-font__clear:hover, .theme-color__clear:hover {
47
+ background: var(--color-bg-hover);
48
+ color: var(--color-text);
49
+ }
50
+
51
+ /* Popups render in a portal at the end of <body>: above Payload's drawers and modals. */
52
+ .theme-popover {
53
+ z-index: 10000;
54
+ }
55
+
56
+ .theme-font__popup, .theme-color__popup {
57
+ border: 1px solid var(--color-border);
58
+ border-radius: var(--radius-medium, var(--radius-medium));
59
+ background: var(--color-bg);
60
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
61
+ }
62
+
63
+ /* Color --------------------------------------------------------------------------------------- */
64
+ .theme-color__controls {
65
+ display: flex;
66
+ align-items: center;
67
+ gap: calc(1.0156rem * 0.5);
68
+ }
69
+
70
+ .theme-color__swatch {
71
+ flex-shrink: 0;
72
+ width: calc(1.0156rem * 2);
73
+ height: calc(1.0156rem * 2);
74
+ padding: 0;
75
+ border: 1px solid var(--color-border-control-strong);
76
+ border-radius: var(--radius-medium, var(--radius-medium));
77
+ cursor: pointer;
78
+ }
79
+
80
+ .theme-color__swatch:hover {
81
+ box-shadow: 0 0 0 2px var(--color-border);
82
+ }
83
+
84
+ .theme-color__swatch:focus-visible {
85
+ outline: 2px solid var(--color-border-strong);
86
+ outline-offset: 2px;
87
+ }
88
+
89
+ /* "Not set": a diagonal line over the input background. */
90
+ .theme-color__swatch--empty {
91
+ background: linear-gradient(to top right, transparent calc(50% - 1px), var(--color-bg-danger) calc(50% - 1px), var(--color-bg-danger) calc(50% + 1px), transparent calc(50% + 1px)), var(--field-color-bg);
92
+ }
93
+
94
+ .theme-color__hex {
95
+ width: calc(1.0156rem * 6);
96
+ font-family: var(--font-mono, monospace);
97
+ }
98
+
99
+ .theme-color__popup {
100
+ width: 224px;
101
+ padding: calc(1.0156rem * 0.5);
102
+ }
103
+
104
+ .theme-color__popup .react-colorful {
105
+ width: 100%;
106
+ height: 150px;
107
+ }
108
+
109
+ .theme-color__popup .react-colorful__saturation {
110
+ border-radius: 4px 4px 0 0;
111
+ }
112
+
113
+ .theme-color__popup .react-colorful__hue {
114
+ height: 12px;
115
+ border-radius: 0 0 4px 4px;
116
+ }
117
+
118
+ .theme-color__popup .react-colorful__pointer {
119
+ width: 16px;
120
+ height: 16px;
121
+ }
122
+
123
+ .theme-color__presets {
124
+ display: grid;
125
+ grid-template-columns: repeat(6, 1fr);
126
+ gap: 4px;
127
+ margin: calc(1.0156rem * 0.5) 0;
128
+ }
129
+
130
+ .theme-color__preset {
131
+ width: 100%;
132
+ aspect-ratio: 1;
133
+ padding: 0;
134
+ border: 1px solid var(--color-border);
135
+ border-radius: 4px;
136
+ cursor: pointer;
137
+ }
138
+
139
+ .theme-color__preset:hover, .theme-color__preset:focus-visible {
140
+ border-color: var(--color-border-strong);
141
+ outline: none;
142
+ }
143
+
144
+ .theme-color__clear {
145
+ width: 100%;
146
+ }
147
+
148
+ /* Font ---------------------------------------------------------------------------------------- */
149
+ .theme-font__row {
150
+ display: flex;
151
+ align-items: center;
152
+ gap: calc(1.0156rem * 0.5);
153
+ }
154
+
155
+ .theme-font__input {
156
+ flex: 1;
157
+ min-width: 0;
158
+ }
159
+
160
+ .theme-font__popup {
161
+ width: var(--anchor-width);
162
+ min-width: 220px;
163
+ overflow: hidden;
164
+ }
165
+
166
+ .theme-font__list {
167
+ max-height: 280px;
168
+ overflow-y: auto;
169
+ padding: 4px 0;
170
+ }
171
+
172
+ .theme-font__option {
173
+ display: block;
174
+ padding: 6px 10px;
175
+ color: var(--color-text);
176
+ font-size: 15px;
177
+ cursor: pointer;
178
+ }
179
+
180
+ .theme-font__option[data-highlighted] {
181
+ background: var(--color-bg-hover);
182
+ }
183
+
184
+ .theme-font__option[data-selected] {
185
+ font-weight: 600;
186
+ }
187
+
188
+ .theme-font__empty:not(:empty) {
189
+ padding: 8px 10px;
190
+ color: var(--color-text-tertiary);
191
+ font-size: var(--text-body-small-font-size, 12px);
192
+ }
193
+
194
+ .theme-font__preview {
195
+ margin-top: calc(1.0156rem * 0.5);
196
+ color: var(--color-text);
197
+ font-size: 16px;
198
+ }
199
+
200
+ /* Slider -------------------------------------------------------------------------------------- */
201
+ .theme-slider__controls {
202
+ display: flex;
203
+ align-items: center;
204
+ gap: calc(1.0156rem * 0.5);
205
+ max-width: 480px;
206
+ }
207
+
208
+ /* The slider itself is the shared one (`admin/editor/ui/Slider.tsx`). */
209
+ .theme-slider__number {
210
+ width: calc(1.0156rem * 3.5);
211
+ text-align: right;
212
+ }
213
+
214
+ .theme-slider__unit {
215
+ color: var(--color-text-tertiary);
216
+ font-size: var(--text-body-small-font-size, 12px);
217
+ }
218
+
219
+ /* Variables ------------------------------------------------------------------------------------ */
220
+ .theme-variable-size__bar {
221
+ display: block;
222
+ max-width: 100%;
223
+ height: 4px;
224
+ margin-top: calc(1.0156rem * 0.375);
225
+ border-radius: 2px;
226
+ background: var(--color-bg-disabled);
227
+ }
228
+
229
+ .theme-variable-label {
230
+ display: inline-flex;
231
+ align-items: center;
232
+ gap: calc(1.0156rem * 0.5);
233
+ min-width: 0;
234
+ }
235
+
236
+ .theme-variable-label__preview {
237
+ display: inline-grid;
238
+ flex-shrink: 0;
239
+ place-items: center;
240
+ width: 18px;
241
+ height: 18px;
242
+ overflow: hidden;
243
+ border: 1px solid var(--color-border-control-strong);
244
+ border-radius: 4px;
245
+ background: var(--color-bg-secondary);
246
+ }
247
+
248
+ .theme-variable-label__preview[data-empty] {
249
+ background: repeating-conic-gradient(var(--color-bg-hover) 0 25%, var(--color-bg) 0 50%) 0 0/8px 8px;
250
+ }
251
+
252
+ .theme-variable-label__preview--font {
253
+ color: var(--color-text);
254
+ font-size: 11px;
255
+ line-height: 1;
256
+ }
257
+
258
+ .theme-variable-label__preview--size {
259
+ justify-items: start;
260
+ padding: 0 2px;
261
+ }
262
+
263
+ .theme-variable-label__preview--size > span {
264
+ display: block;
265
+ max-width: 100%;
266
+ height: 4px;
267
+ border-radius: 2px;
268
+ background: var(--color-bg-disabled);
269
+ }
270
+
271
+ .theme-variable-label__name {
272
+ color: var(--color-text);
273
+ font-family: var(--font-mono, monospace);
274
+ font-weight: 500;
275
+ }
276
+
277
+ .theme-variable-label__meta {
278
+ overflow: hidden;
279
+ color: var(--color-text-tertiary);
280
+ text-overflow: ellipsis;
281
+ white-space: nowrap;
282
+ }
283
+
284
+ .theme-variables-warning {
285
+ margin: calc(1.0156rem * -0.5) 0 var(--spacing-field, calc(1.0156rem * 1.5));
286
+ padding: calc(1.0156rem * 0.75) 1.0156rem;
287
+ border: 1px solid var(--color-border-warning);
288
+ border-radius: var(--radius-medium, var(--radius-medium));
289
+ background: var(--color-bg-warning-tertiary);
290
+ color: var(--color-text-warning);
291
+ font-size: var(--text-body-medium-font-size, 13px);
292
+ }
293
+
294
+ .theme-variables-warning p {
295
+ margin: 0;
296
+ }
297
+
298
+ .theme-variables-warning code {
299
+ padding: 0 3px;
300
+ border-radius: 3px;
301
+ background: var(--color-bg-warning-tertiary);
302
+ font-size: 0.95em;
303
+ }
304
+
305
+ .theme-variables-warning a {
306
+ color: inherit;
307
+ text-decoration: underline;
308
+ text-underline-offset: 2px;
309
+ }
310
+
311
+ .theme-variables-warning__title {
312
+ font-weight: 600;
313
+ }
314
+
315
+ .theme-variables-warning__list {
316
+ display: flex;
317
+ flex-direction: column;
318
+ gap: calc(1.0156rem * 0.5);
319
+ margin: calc(1.0156rem * 0.5) 0;
320
+ padding: 0;
321
+ list-style: none;
322
+ }
323
+
324
+ .theme-variables-warning__where, .theme-variables-warning__hint {
325
+ color: var(--color-text-warning);
326
+ }
327
+ }
@@ -191,6 +191,8 @@ export function themeGlobal(options) {
191
191
  return {
192
192
  slug,
193
193
  label: options.label ?? 'Theme',
194
+ versions: false,
195
+ authorship: false,
194
196
  access: {
195
197
  read: () => true,
196
198
  update: ({ req }) => Boolean(req.user),