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
@@ -0,0 +1,243 @@
1
+ /*
2
+ * Editor layout: the separators between the sidebars and the canvas, the left sidebar's tabs,
3
+ * the canvas frame's resize handles and the scrollbar space of the panels.
4
+ * Payload CSS variables only, no Tailwind.
5
+ */
6
+ @layer payload-default {
7
+ /*
8
+ * A separator takes no space. Its hit area (::before) reaches 4 px into both neighbours.
9
+ * An <hr>: no border, margin or clipping of its own.
10
+ */
11
+ .builder-split {
12
+ position: relative;
13
+ z-index: 6;
14
+ flex: none;
15
+ width: 0;
16
+ margin: 0;
17
+ padding: 0;
18
+ border: 0;
19
+ overflow: visible;
20
+ background: none;
21
+ cursor: col-resize;
22
+ touch-action: none;
23
+ outline: none;
24
+ }
25
+
26
+ .builder-split::before {
27
+ content: "";
28
+ position: absolute;
29
+ inset: 0 -4px;
30
+ }
31
+
32
+ /* The line shows on hover, on keyboard focus and while dragging. */
33
+ .builder-split::after {
34
+ content: "";
35
+ position: absolute;
36
+ inset: 0 -1px;
37
+ background: var(--be-accent);
38
+ opacity: 0;
39
+ transition: opacity 120ms ease;
40
+ pointer-events: none;
41
+ }
42
+
43
+ .builder-split:hover::after, .builder-split:focus-visible::after {
44
+ opacity: 1;
45
+ transition-delay: 150ms;
46
+ }
47
+
48
+ .builder-split:focus-visible::after {
49
+ transition-delay: 0ms;
50
+ }
51
+
52
+ /*
53
+ * While a separator or a frame handle is dragged: the resize cursor everywhere, no text
54
+ * selection, no eased frame zoom (the frame must follow the pointer), and the line stays visible.
55
+ */
56
+ .builder-editor[data-resizing] {
57
+ cursor: col-resize;
58
+ user-select: none;
59
+ }
60
+
61
+ .builder-editor[data-resizing] .builder-split::after {
62
+ transition: none;
63
+ }
64
+
65
+ .builder-editor[data-resizing] .builder-split:active::after {
66
+ opacity: 1;
67
+ }
68
+
69
+ .builder-editor[data-resizing] .builder-editor__frame {
70
+ transition: none;
71
+ }
72
+
73
+ /*
74
+ * ---------------------------------------------------------------------------
75
+ * Left sidebar: Layers, Blocks and Sections tabs (LeftPanel.tsx)
76
+ * ---------------------------------------------------------------------------
77
+ */
78
+ .builder-left__head {
79
+ flex: none;
80
+ padding: 8px 12px;
81
+ border-bottom: 1px solid var(--be-border);
82
+ /* A narrow sidebar drops the tab icons first. */
83
+ container-type: inline-size;
84
+ /* Widths follow the labels, so "Sections 18" gets the room it needs. */
85
+ }
86
+
87
+ .builder-left__head .builder-editor__segment {
88
+ flex: 1 1 auto;
89
+ gap: 5px;
90
+ min-width: 0;
91
+ padding: 0 6px;
92
+ white-space: nowrap;
93
+ }
94
+
95
+ .builder-left__head .builder-editor__segment svg {
96
+ flex: none;
97
+ }
98
+
99
+ /* A drag rests on the tab: it opens in a moment. */
100
+ .builder-left__head .builder-editor__segment[data-drag-over] {
101
+ background: var(--be-accent-soft);
102
+ color: var(--color-text);
103
+ box-shadow: inset 0 0 0 1px var(--be-accent);
104
+ }
105
+
106
+ /* After the rules above, so it wins over them. */
107
+ @container (max-width: 250px) {
108
+ .builder-left__head .builder-editor__segment {
109
+ padding: 0 4px;
110
+ }
111
+
112
+ .builder-left__head .builder-editor__segment svg {
113
+ display: none;
114
+ }
115
+ }
116
+
117
+ .builder-left__panel {
118
+ display: flex;
119
+ flex: 1;
120
+ flex-direction: column;
121
+ min-height: 0;
122
+ }
123
+
124
+ .builder-left__panel[hidden] {
125
+ display: none;
126
+ }
127
+
128
+ /* Blocks and Sections: the search field under the tabs. */
129
+ .builder-left__panel .builder-editor__insert > .builder-editor__search {
130
+ margin-top: 10px;
131
+ }
132
+
133
+ /* Layers: the block count and the tree tools, in a slim row. */
134
+ .builder-editor__panel-head.builder-left__tools {
135
+ height: 34px;
136
+ padding: 0 8px 0 12px;
137
+ }
138
+
139
+ .builder-left__note {
140
+ color: var(--be-muted);
141
+ font-size: var(--be-text-s);
142
+ font-variant-numeric: tabular-nums;
143
+ }
144
+
145
+ /*
146
+ * ---------------------------------------------------------------------------
147
+ * Canvas frame resize handles (FrameResize.tsx). In the frame wrapper, which has the frame's
148
+ * size on screen: the handles sit in the stage padding, centered on each edge.
149
+ * ---------------------------------------------------------------------------
150
+ */
151
+ /* `[data-tooltip]` and the wrapper: wins over `.builder-editor [data-tooltip] { position: relative }`. */
152
+ .builder-editor__frame-wrap .builder-frame-handle[data-tooltip] {
153
+ position: absolute;
154
+ z-index: 4;
155
+ top: 50%;
156
+ width: 6px;
157
+ height: 44px;
158
+ margin: 0;
159
+ padding: 0;
160
+ border: 0;
161
+ border-radius: 3px;
162
+ background: var(--color-bg-disabled);
163
+ cursor: ew-resize;
164
+ touch-action: none;
165
+ transform: translateY(-50%);
166
+ transition: background-color 120ms ease, height 120ms var(--be-ease);
167
+ /* A larger hit area than the bar. */
168
+ }
169
+
170
+ .builder-editor__frame-wrap .builder-frame-handle[data-tooltip]::before {
171
+ content: "";
172
+ position: absolute;
173
+ inset: -10px -5px;
174
+ }
175
+
176
+ .builder-editor__frame-wrap .builder-frame-handle[data-tooltip]:hover, .builder-editor__frame-wrap .builder-frame-handle[data-tooltip]:focus-visible, .builder-editor__frame-wrap .builder-frame-handle[data-tooltip]:active {
177
+ height: 64px;
178
+ background: var(--be-accent);
179
+ }
180
+
181
+ .builder-editor__frame-wrap .builder-frame-handle[data-tooltip]:focus-visible {
182
+ outline: 2px solid var(--be-accent);
183
+ outline-offset: 2px;
184
+ }
185
+
186
+ .builder-frame-handle--left {
187
+ left: -15px;
188
+ }
189
+
190
+ .builder-frame-handle--right {
191
+ right: -15px;
192
+ }
193
+
194
+ .builder-editor[data-resizing] .builder-frame-handle {
195
+ transition: none;
196
+ }
197
+
198
+ /* The live width and breakpoint while a handle is dragged. */
199
+ .builder-frame-handle__label {
200
+ position: absolute;
201
+ z-index: 5;
202
+ top: 12px;
203
+ left: 50%;
204
+ padding: 4px 10px;
205
+ border-radius: 12px;
206
+ background: var(--color-bg-inverse);
207
+ color: var(--color-text-oninverse);
208
+ font-size: var(--be-text-s);
209
+ font-weight: var(--be-weight-medium);
210
+ font-variant-numeric: tabular-nums;
211
+ white-space: nowrap;
212
+ pointer-events: none;
213
+ transform: translateX(-50%);
214
+ box-shadow: var(--be-shadow);
215
+ }
216
+
217
+ .builder-frame-handle__label[hidden] {
218
+ display: none;
219
+ }
220
+
221
+ /*
222
+ * ---------------------------------------------------------------------------
223
+ * Scrollbar space. The scrolling panels keep room for the scrollbar, so content does not shift
224
+ * when a collapse removes the scrollbar. The right padding gives up the scrollbar's width.
225
+ * ---------------------------------------------------------------------------
226
+ */
227
+ .builder-editor__outline,
228
+ .builder-editor__insert-body,
229
+ .builder-editor__inspector-body,
230
+ .builder-assistant__scroll {
231
+ scrollbar-gutter: stable;
232
+ }
233
+
234
+ /* Two classes: wins over the padding in editor.scss, whichever stylesheet loads first. */
235
+ .builder-editor__left .builder-editor__insert-body,
236
+ .builder-editor__right .builder-editor__inspector-body {
237
+ padding-right: 4px;
238
+ }
239
+
240
+ .builder-editor__left .builder-editor__outline {
241
+ padding-right: 0;
242
+ }
243
+ }
@@ -7,12 +7,27 @@ export declare const LEFT_TABS: readonly {
7
7
  icon: IconName;
8
8
  digit: string;
9
9
  }[];
10
+ /**
11
+ * The tabs this editor offers: Sections only when there are sections to insert or a place to save
12
+ * them (the form builder has neither: `sections: false`).
13
+ */
14
+ export declare function offeredLeftTabs<T extends {
15
+ id: LeftTab;
16
+ }>(config: Pick<Runtime['config'], 'sections' | 'savedSections'>, tabs: readonly T[]): readonly T[];
10
17
  /** The stored tab. Null when the user never picked one (or storage is blocked). */
11
18
  export declare function readLeftTab(): LeftTab | null;
12
19
  /** The tab for the digit of its shortcut ("1" is Layers). */
13
20
  export declare function leftTabForDigit(digit: string): LeftTab | null;
14
21
  /** The DOM id of a tab's panel. */
15
22
  export declare const leftPanelId: (tab: LeftTab) => string;
23
+ /**
24
+ * After a click added blocks from the library: Layers opens with the new block selected and in view
25
+ * (as in Webflow). `focus` moves the focus to its row (the clicked item hides with its panel).
26
+ * Returns `added`.
27
+ */
28
+ export declare function showAddedInLayers(runtime: Runtime, added: boolean, { focus }?: {
29
+ focus?: boolean;
30
+ }): boolean;
16
31
  /**
17
32
  * Opens a tab and keeps the choice. `focus` moves the focus into the panel: the search field of
18
33
  * Blocks and Sections, the focusable row of Layers.
@@ -5,6 +5,14 @@ export const LEFT_TABS = [
5
5
  { id: 'blocks', label: 'Blocks', icon: 'grid', digit: '2' },
6
6
  { id: 'sections', label: 'Sections', icon: 'section', digit: '3' },
7
7
  ];
8
+ /**
9
+ * The tabs this editor offers: Sections only when there are sections to insert or a place to save
10
+ * them (the form builder has neither: `sections: false`).
11
+ */
12
+ export function offeredLeftTabs(config, tabs) {
13
+ const sections = (config.sections?.length ?? 0) > 0 || Boolean(config.savedSections);
14
+ return sections ? tabs : tabs.filter((tab) => tab.id !== 'sections');
15
+ }
8
16
  const STORAGE_KEY = 'payload-builder:left-tab';
9
17
  const isLeftTab = (value) => LEFT_TABS.some((tab) => tab.id === value);
10
18
  /** The stored tab. Null when the user never picked one (or storage is blocked). */
@@ -23,6 +31,16 @@ export function leftTabForDigit(digit) {
23
31
  }
24
32
  /** The DOM id of a tab's panel. */
25
33
  export const leftPanelId = (tab) => `builder-left-${tab}`;
34
+ /**
35
+ * After a click added blocks from the library: Layers opens with the new block selected and in view
36
+ * (as in Webflow). `focus` moves the focus to its row (the clicked item hides with its panel).
37
+ * Returns `added`.
38
+ */
39
+ export function showAddedInLayers(runtime, added, { focus = false } = {}) {
40
+ if (added)
41
+ selectLeftTab(runtime, 'layers', { focus });
42
+ return added;
43
+ }
26
44
  /**
27
45
  * Opens a tab and keeps the choice. `focus` moves the focus into the panel: the search field of
28
46
  * Blocks and Sections, the focusable row of Layers.
@@ -1,6 +1,6 @@
1
1
  // Sizes of the editor's resizable panels: the left sidebar and the right sidebar. A size lives in a CSS variable on the editor root, so a
2
2
  // drag changes one style property and React does not render. Sizes are kept in local storage.
3
- // Without a stored size, the default comes from the stylesheet (layout.scss).
3
+ // Without a stored size, the default comes from the stylesheet (layout.css).
4
4
  export const PANELS = {
5
5
  left: { variable: '--be-left-width', min: 200, max: 480, label: 'Resize the left sidebar' },
6
6
  right: { variable: '--be-right-width', min: 280, max: 600, label: 'Resize the right sidebar' },
@@ -1,5 +1,5 @@
1
1
  import { breakpointAt } from '../styles/tokens.js';
2
- import './presence.scss';
2
+ import './presence.css';
3
3
  /** Who else is here (click to follow) and the last remote change. The save state shows the connection. */
4
4
  export declare function Presence({ widths }: {
5
5
  widths: Parameters<typeof breakpointAt>[0];
@@ -2,7 +2,7 @@
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  // Presence UI: avatars in the toolbar, other editors' cursors and selections on the canvas,
4
4
  // colored dots in the outline, the "is editing this block" banner and the follow frame.
5
- // Admin code: Payload CSS variables and SCSS only (editor.scss, "Multiplayer" section).
5
+ // Admin code: Payload CSS variables and plain CSS only (editor.css, "Multiplayer" section).
6
6
  import { useEffect, useMemo, useState } from 'react';
7
7
  import { localeLabel } from '../../../core/index.js';
8
8
  import { Icon } from '../icons.js';
@@ -12,7 +12,7 @@ import { useEditor } from '../store.js';
12
12
  import { sameItems, useValue, useValueSelector } from '../valueStore.js';
13
13
  import { propPathOf } from './field.js';
14
14
  import { cursorPoint, distinctInitials, shortName } from './presence.js';
15
- import './presence.scss';
15
+ import './presence.css';
16
16
  /** Cursors that have not moved for this long fade out. */
17
17
  const CURSOR_IDLE_MS = 10_000;
18
18
  const MAX_AVATARS = 5;
@@ -1,13 +1,14 @@
1
- // "Anna is editing this field" under an inspector field. Payload CSS variables only, inside
2
- // Payload's own layer. The rest of the presence styles are in editor.scss ("Multiplayer").
3
-
1
+ /*
2
+ * "Anna is editing this field" under an inspector field. Payload CSS variables only, inside
3
+ * Payload's own layer. The rest of the presence styles are in editor.scss ("Multiplayer").
4
+ */
4
5
  @layer payload-default {
5
6
  .builder-peer-field {
6
7
  display: flex;
7
8
  align-items: center;
8
9
  gap: 6px;
9
10
  margin: 4px 0 0;
10
- color: var(--theme-elevation-800);
11
+ color: var(--color-text);
11
12
  font-size: var(--be-text-s, 11px);
12
13
  line-height: 1.35;
13
14
  animation: builder-fade-in 160ms var(--be-ease, ease-out);
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { Block } from '../../../core/types.js';
3
- import './locale.scss';
3
+ import './locale.css';
4
4
  /**
5
5
  * The props the inspector shows for a block in the editor's locale: untranslated text props are
6
6
  * left out (their fallback shows as the placeholder). Same object without localization.
@@ -15,7 +15,7 @@ import { Icon } from '../icons.js';
15
15
  import { useRuntime } from '../runtime.js';
16
16
  import { useEditor } from '../store.js';
17
17
  import { clearTranslation, copyFromDefault, copyIntoDefault, defaultLocaleName, localeName } from './locale.js';
18
- import './locale.scss';
18
+ import './locale.css';
19
19
  const FieldsLocaleContext = createContext(null);
20
20
  const NO_PROPS = {};
21
21
  const NO_KEYS = new Set();
@@ -1,2 +1,2 @@
1
- import './locale.scss';
1
+ import './locale.css';
2
2
  export declare function LocaleSwitcher(): import("react").JSX.Element | null;
@@ -8,7 +8,7 @@ import { MenuButton } from '../menu/Menu.js';
8
8
  import { useRuntime } from '../runtime.js';
9
9
  import { useEditor } from '../store.js';
10
10
  import { localeName, missingWords, switchLocale, untranslatedMap } from './locale.js';
11
- import './locale.scss';
11
+ import './locale.css';
12
12
  export function LocaleSwitcher() {
13
13
  const runtime = useRuntime();
14
14
  const settings = runtime.store.localization;
@@ -0,0 +1,153 @@
1
+ /*
2
+ * Localization in the editor: the top bar's switcher, the inspector note and field marks, and
3
+ * the outline dot. Payload CSS variables only.
4
+ */
5
+ @layer payload-default {
6
+ .builder-locale-switch {
7
+ display: inline-flex;
8
+ flex: none;
9
+ align-items: center;
10
+ gap: 4px;
11
+ height: 28px;
12
+ padding: 0 6px 0 8px;
13
+ border: 1px solid var(--be-border);
14
+ border-radius: var(--be-radius);
15
+ background: transparent;
16
+ color: var(--color-text);
17
+ font: inherit;
18
+ font-size: var(--be-text-m);
19
+ font-weight: var(--be-weight-strong);
20
+ cursor: pointer;
21
+ }
22
+
23
+ .builder-locale-switch:hover {
24
+ background: var(--be-hover);
25
+ }
26
+
27
+ .builder-locale-switch:focus-visible {
28
+ outline: 2px solid var(--be-accent);
29
+ outline-offset: 1px;
30
+ }
31
+
32
+ .builder-locale-switch svg {
33
+ color: var(--be-muted);
34
+ }
35
+
36
+ /* Editing another language than the default: the switcher stands out a little. */
37
+ .builder-locale-switch--other {
38
+ border-color: color-mix(in srgb, var(--color-border-warning-strong, #f59e0b) 55%, transparent);
39
+ background: color-mix(in srgb, var(--color-bg-warning, #f59e0b) 10%, transparent);
40
+ }
41
+
42
+ .builder-locale-switch__code {
43
+ letter-spacing: 0.02em;
44
+ }
45
+
46
+ .builder-locale-note {
47
+ display: flex;
48
+ gap: 8px;
49
+ margin: 0 0 12px;
50
+ padding: 8px 10px;
51
+ border: 1px solid color-mix(in srgb, var(--color-border-warning-strong, #f59e0b) 40%, transparent);
52
+ border-radius: var(--be-radius-m);
53
+ background: color-mix(in srgb, var(--color-bg-warning, #f59e0b) 8%, transparent);
54
+ color: var(--color-text);
55
+ font-size: var(--be-text-m);
56
+ line-height: 1.4;
57
+ }
58
+
59
+ .builder-locale-note > svg {
60
+ flex: none;
61
+ margin-top: 2px;
62
+ color: var(--color-text-warning, #f59e0b);
63
+ }
64
+
65
+ .builder-locale-note p {
66
+ margin: 0;
67
+ }
68
+
69
+ .builder-locale-note .builder-locale-field__action {
70
+ margin-top: 6px;
71
+ }
72
+
73
+ .builder-locale-field {
74
+ display: flex;
75
+ flex-direction: column;
76
+ gap: 4px;
77
+ }
78
+
79
+ /* The input shows the fallback language's value: greyed. */
80
+ .builder-locale-field[data-locale-status=untranslated] input,
81
+ .builder-locale-field[data-locale-status=untranslated] textarea,
82
+ .builder-locale-field[data-locale-status=untranslated] .rich-text-lexical,
83
+ .builder-locale-field[data-locale-status=untranslated] .react-select,
84
+ .builder-locale-field[data-locale-status=untranslated] .upload,
85
+ .builder-locale-field[data-locale-status=untranslated] .relationship {
86
+ opacity: 0.6;
87
+ }
88
+
89
+ .builder-locale-field__mark {
90
+ display: flex;
91
+ flex-wrap: wrap;
92
+ align-items: center;
93
+ gap: 4px 8px;
94
+ margin-top: -6px;
95
+ color: var(--be-muted);
96
+ font-size: var(--be-text-s);
97
+ }
98
+
99
+ .builder-locale-field[data-locale-status=untranslated] .builder-locale-field__state,
100
+ .builder-locale-field[data-locale-status=missing] .builder-locale-field__state {
101
+ color: var(--color-text-warning, #f59e0b);
102
+ }
103
+
104
+ .builder-locale-field__action {
105
+ padding: 0;
106
+ border: 0;
107
+ background: none;
108
+ color: var(--color-text);
109
+ font: inherit;
110
+ font-size: var(--be-text-s);
111
+ text-decoration: underline;
112
+ text-underline-offset: 2px;
113
+ cursor: pointer;
114
+ }
115
+
116
+ .builder-locale-field__action:hover {
117
+ color: var(--be-accent-strong);
118
+ }
119
+
120
+ .builder-locale-field__action:focus-visible {
121
+ outline: 2px solid var(--be-accent);
122
+ outline-offset: 1px;
123
+ }
124
+
125
+ /* Outline: a block with props that show the fallback language. */
126
+ .builder-editor__row-untranslated {
127
+ flex: none;
128
+ width: 6px;
129
+ height: 6px;
130
+ margin-left: auto;
131
+ border-radius: 50%;
132
+ background: var(--color-bg-warning, #f59e0b);
133
+ }
134
+
135
+ .builder-editor__row-untranslated + .builder-editor__row-problem {
136
+ margin-left: 4px;
137
+ }
138
+
139
+ /* Presence: a collaborator's language under their initials. */
140
+ .builder-presence__locale {
141
+ position: absolute;
142
+ right: -6px;
143
+ bottom: -5px;
144
+ padding: 0 3px;
145
+ border-radius: 3px;
146
+ background: var(--color-bg-inverse);
147
+ color: var(--color-text-oninverse);
148
+ font-size: 8px;
149
+ font-weight: 700;
150
+ line-height: 11px;
151
+ letter-spacing: 0.02em;
152
+ }
153
+ }
@@ -1,3 +1,9 @@
1
- import './media.scss';
2
- /** The chip, the image box and the media popover. Mounted once, in the overlay. */
3
- export declare const ImageEditor: import("react").MemoExoticComponent<() => import("react").JSX.Element | null>;
1
+ import './media.css';
2
+ /**
3
+ * The chip, the image box and the media popover. Mounted once, in the overlay. `barRight` and
4
+ * `barTop`: the selected block's top right corner while its action bar sits inside it, else null.
5
+ */
6
+ export declare const ImageEditor: import("react").MemoExoticComponent<({ barRight, barTop }: {
7
+ barRight: number | null;
8
+ barTop: number | null;
9
+ }) => import("react").JSX.Element | null>;
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- // Images on the canvas, admin side: a "Replace" chip on the image under the pointer, and a media
4
- // popover (double-click or a click on the chip) with Choose from library, Upload, Generate, Remove
5
- // and the alt text. The chip and the image box live in the overlay (iframe coordinates); the
6
- // popover renders into the editor root, like the insert picker, because the overlay takes no
7
- // pointer events.
3
+ // Images on the canvas, admin side: a "Replace" chip in the top right corner of the image under
4
+ // the pointer, and a media popover (double-click or a click on the chip) with Choose from
5
+ // library, Upload, Generate, Remove and the alt text. The chip and the image box live in the
6
+ // overlay (iframe coordinates); the popover renders into the editor root, like the insert picker,
7
+ // because the overlay takes no pointer events.
8
8
  import { useListDrawer } from '@payloadcms/ui';
9
9
  import { memo, useEffect, useId, useRef, useState, useSyncExternalStore } from 'react';
10
10
  import { createPortal } from 'react-dom';
@@ -19,8 +19,8 @@ import { Popover, usePopover } from '../styles/popover.js';
19
19
  import { Select } from '../ui/Select.js';
20
20
  import { useOptionalValue, useValue, useValueSelector } from '../valueStore.js';
21
21
  import { imageEditor, imageSpotContext, loadMedia, removeImage, saveMediaAlt, setAltProp, setImage, setImageValue, updateImageEditor, uploadImage, } from './actions.js';
22
- import { altPropPath, mediaRef, propAt } from './model.js';
23
- import './media.scss';
22
+ import { altPropPath, chipPlace, mediaRef, propAt } from './model.js';
23
+ import './media.css';
24
24
  const noSubscription = () => () => { };
25
25
  const editorRoot = () => document.querySelector('.builder-editor');
26
26
  const noRoot = () => null;
@@ -36,8 +36,11 @@ function visiblePart(rect, viewport) {
36
36
  const bottom = Math.min(rect.y + rect.height, viewport.height);
37
37
  return { x, y, width: Math.max(0, right - x), height: Math.max(0, bottom - y) };
38
38
  }
39
- /** The chip, the image box and the media popover. Mounted once, in the overlay. */
40
- export const ImageEditor = memo(function ImageEditor() {
39
+ /**
40
+ * The chip, the image box and the media popover. Mounted once, in the overlay. `barRight` and
41
+ * `barTop`: the selected block's top right corner while its action bar sits inside it, else null.
42
+ */
43
+ export const ImageEditor = memo(function ImageEditor({ barRight, barTop }) {
41
44
  const runtime = useRuntime();
42
45
  const store = imageEditor(runtime);
43
46
  const state = useValue(store);
@@ -52,6 +55,7 @@ export const ImageEditor = memo(function ImageEditor() {
52
55
  const [library, setLibrary] = useState(null);
53
56
  const host = useSyncExternalStore(noSubscription, editorRoot, noRoot);
54
57
  const viewport = useValueSelector(runtime.measurement, (m) => m?.viewport ?? null, sameSize);
58
+ const { zoom } = useValue(runtime.frame);
55
59
  const open = state.open;
56
60
  const target = open?.target ?? held ?? state.hover;
57
61
  const spotIndex = open && target === open.target ? Math.min(open.spot, target.spots.length - 1) : 0;
@@ -86,9 +90,11 @@ export const ImageEditor = memo(function ImageEditor() {
86
90
  // The part of the image inside the canvas view: a cover image is often larger than its section.
87
91
  const rect = spot ? visiblePart(spot.rect, viewport) : null;
88
92
  const box = rect ? { left: rect.x, top: rect.y, width: rect.width, height: rect.height } : undefined;
89
- const chip = rect ? { left: rect.x, top: rect.y } : undefined;
93
+ // The chip's anchor is the image's top right corner; CSS moves it inside, under the bar or above.
94
+ const chip = rect ? { left: rect.x + rect.width, top: rect.y } : undefined;
95
+ const place = rect ? chipPlace(rect, zoom, barRight !== null && barTop !== null ? { right: barRight, top: barTop } : null) : 'inside';
90
96
  const chipLabel = busy ? 'Uploading…' : state.dropping ? 'Drop to replace' : 'Replace';
91
- return (_jsxs(_Fragment, { children: [visible && target && spot && (_jsxs(_Fragment, { children: [_jsx("div", { className: "builder-media__box", "data-dropping": state.dropping || undefined, "data-busy": busy || undefined, style: box }), _jsxs("button", { ref: chipRef, type: "button", className: "builder-media__chip", style: chip, "aria-haspopup": "dialog", "aria-expanded": popover.open, "data-tooltip": popover.open || state.dropping ? undefined : 'Replace the image (or double-click it, or drop a file on it)', onPointerEnter: () => setHeld(state.hover ?? held), onPointerLeave: () => setHeld(null), onClick: () => {
97
+ return (_jsxs(_Fragment, { children: [visible && target && spot && (_jsxs(_Fragment, { children: [_jsx("div", { className: "builder-media__box", "data-dropping": state.dropping || undefined, "data-busy": busy || undefined, style: box }), _jsxs("button", { ref: chipRef, type: "button", className: "builder-media__chip", "data-place": place, style: chip, "aria-haspopup": "dialog", "aria-expanded": popover.open, "data-tooltip": popover.open || state.dropping ? undefined : 'Replace the image (or double-click it, or drop a file on it)', onPointerEnter: () => setHeld(state.hover ?? held), onPointerLeave: () => setHeld(null), onClick: () => {
92
98
  if (popover.isOpen()) {
93
99
  popover.hide();
94
100
  return;