payload-canvas 0.6.0 → 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 (164) hide show
  1. package/README.md +17 -17
  2. package/dist/admin/AiKeyField.d.ts +4 -3
  3. package/dist/admin/AiKeyField.js +3 -3
  4. package/dist/admin/BuilderTab.js +1 -1
  5. package/dist/admin/DocumentEditView.d.ts +1 -1
  6. package/dist/admin/DocumentEditView.js +2 -3
  7. package/dist/admin/LayoutField.d.ts +1 -1
  8. package/dist/admin/LayoutField.js +2 -2
  9. package/dist/admin/TemplateConditionsField.d.ts +2 -2
  10. package/dist/admin/TemplateConditionsField.js +2 -2
  11. package/dist/admin/aiKeyField.css +58 -0
  12. package/dist/admin/diff/LayoutDiff.js +3 -3
  13. package/dist/admin/diff/LayoutJsonDiff.d.ts +1 -1
  14. package/dist/admin/diff/LayoutJsonDiff.js +1 -1
  15. package/dist/admin/diff/layoutDiff.css +180 -0
  16. package/dist/admin/editor/Editor.d.ts +2 -2
  17. package/dist/admin/editor/Editor.js +2 -2
  18. package/dist/admin/editor/Library.js +1 -2
  19. package/dist/admin/editor/assistant/AssistantPanel.d.ts +1 -1
  20. package/dist/admin/editor/assistant/AssistantPanel.js +1 -1
  21. package/dist/admin/editor/assistant/{assistant.scss → assistant.css} +322 -315
  22. package/dist/admin/editor/classes/ClassManager.d.ts +1 -1
  23. package/dist/admin/editor/classes/ClassManager.js +1 -1
  24. package/dist/admin/editor/classes/manager.css +258 -0
  25. package/dist/admin/editor/comments/CommentLayer.d.ts +1 -1
  26. package/dist/admin/editor/comments/CommentLayer.js +1 -1
  27. package/dist/admin/editor/comments/CommentsPanel.d.ts +1 -1
  28. package/dist/admin/editor/comments/CommentsPanel.js +1 -1
  29. package/dist/admin/editor/comments/{comments.scss → comments.css} +121 -140
  30. package/dist/admin/editor/comments/useCommentFromURL.js +1 -1
  31. package/dist/admin/editor/dnd/{dnd.scss → dnd.css} +78 -80
  32. package/dist/admin/editor/{editor.scss → editor.css} +782 -763
  33. package/dist/admin/editor/empty/EmptyStart.d.ts +1 -1
  34. package/dist/admin/editor/empty/EmptyStart.js +3 -3
  35. package/dist/admin/editor/empty/{empty.scss → empty.css} +12 -13
  36. package/dist/admin/editor/fields/FormBlock.js +3 -3
  37. package/dist/admin/editor/fields/fields.css +786 -0
  38. package/dist/admin/editor/generate/GenerateImage.d.ts +1 -1
  39. package/dist/admin/editor/generate/GenerateImage.js +1 -1
  40. package/dist/admin/editor/generate/{generate.scss → generate.css} +83 -82
  41. package/dist/admin/editor/layout/layout.css +243 -0
  42. package/dist/admin/editor/layout/panels.js +1 -1
  43. package/dist/admin/editor/live/PresenceUI.d.ts +1 -1
  44. package/dist/admin/editor/live/PresenceUI.js +2 -2
  45. package/dist/admin/editor/live/{presence.scss → presence.css} +5 -4
  46. package/dist/admin/editor/locale/LocaleField.d.ts +1 -1
  47. package/dist/admin/editor/locale/LocaleField.js +1 -1
  48. package/dist/admin/editor/locale/LocaleSwitcher.d.ts +1 -1
  49. package/dist/admin/editor/locale/LocaleSwitcher.js +1 -1
  50. package/dist/admin/editor/locale/locale.css +153 -0
  51. package/dist/admin/editor/media/ImageEditor.d.ts +1 -1
  52. package/dist/admin/editor/media/ImageEditor.js +1 -1
  53. package/dist/admin/editor/media/{media.scss → media.css} +67 -67
  54. package/dist/admin/editor/menu/Menu.d.ts +1 -1
  55. package/dist/admin/editor/menu/Menu.js +1 -1
  56. package/dist/admin/editor/menu/menu.css +132 -0
  57. package/dist/admin/editor/motion/MotionPanel.d.ts +2 -2
  58. package/dist/admin/editor/motion/MotionPanel.js +2 -2
  59. package/dist/admin/editor/motion/{motion.scss → motion.css} +24 -21
  60. package/dist/admin/editor/regions/RegionPane.js +1 -1
  61. package/dist/admin/editor/renderField.d.ts +1 -1
  62. package/dist/admin/editor/renderField.js +1 -1
  63. package/dist/admin/editor/sections/ComponentFields.d.ts +1 -1
  64. package/dist/admin/editor/sections/ComponentFields.js +2 -3
  65. package/dist/admin/editor/sections/PropertyControls.d.ts +1 -1
  66. package/dist/admin/editor/sections/PropertyControls.js +1 -1
  67. package/dist/admin/editor/sections/components.css +244 -0
  68. package/dist/admin/editor/sections/variants.css +93 -0
  69. package/dist/admin/editor/sections/variants.d.ts +1 -1
  70. package/dist/admin/editor/sections/variants.js +1 -1
  71. package/dist/admin/editor/styles/ClassBar.d.ts +1 -1
  72. package/dist/admin/editor/styles/ClassBar.js +1 -1
  73. package/dist/admin/editor/styles/StylesPanel.d.ts +1 -1
  74. package/dist/admin/editor/styles/StylesPanel.js +1 -1
  75. package/dist/admin/editor/styles/{classes.scss → classes.css} +128 -125
  76. package/dist/admin/editor/styles/{styles.scss → styles.css} +368 -370
  77. package/dist/admin/editor/templates/Bindable.d.ts +1 -1
  78. package/dist/admin/editor/templates/Bindable.js +1 -1
  79. package/dist/admin/editor/templates/binding.js +4 -1
  80. package/dist/admin/editor/templates/{templates.scss → templates.css} +207 -206
  81. package/dist/admin/editor/tooltip/Tooltips.d.ts +1 -1
  82. package/dist/admin/editor/tooltip/Tooltips.js +1 -1
  83. package/dist/admin/editor/tooltip/{tooltip.scss → tooltip.css} +11 -10
  84. package/dist/admin/editor/topbar/ContentModeToggle.d.ts +1 -1
  85. package/dist/admin/editor/topbar/ContentModeToggle.js +1 -1
  86. package/dist/admin/editor/topbar/DocumentActions.js +1 -2
  87. package/dist/admin/editor/topbar/TopBar.d.ts +1 -1
  88. package/dist/admin/editor/topbar/TopBar.js +2 -3
  89. package/dist/admin/editor/topbar/{contentMode.scss → contentMode.css} +7 -8
  90. package/dist/admin/editor/topbar/screens/DrawerRouter.d.ts +1 -1
  91. package/dist/admin/editor/topbar/screens/DrawerRouter.js +52 -40
  92. package/dist/admin/editor/topbar/screens/ScreenDrawer.d.ts +1 -1
  93. package/dist/admin/editor/topbar/screens/ScreenDrawer.js +4 -5
  94. package/dist/admin/editor/topbar/screens/drawerRouterSupport.d.ts +5 -5
  95. package/dist/admin/editor/topbar/screens/drawerRouterSupport.js +7 -7
  96. package/dist/admin/editor/topbar/screens/screens.css +139 -0
  97. package/dist/admin/editor/topbar/settingsDrawer.css +33 -0
  98. package/dist/admin/editor/topbar/settingsDrawer.d.ts +1 -1
  99. package/dist/admin/editor/topbar/settingsDrawer.js +3 -3
  100. package/dist/admin/editor/topbar/{topbar.scss → topbar.css} +189 -191
  101. package/dist/admin/editor/ui/Select.d.ts +1 -1
  102. package/dist/admin/editor/ui/Select.js +1 -1
  103. package/dist/admin/editor/ui/Slider.d.ts +1 -1
  104. package/dist/admin/editor/ui/Slider.js +1 -1
  105. package/dist/admin/editor/ui/controls.css +301 -0
  106. package/dist/admin/forms/SubmissionCells.d.ts +1 -1
  107. package/dist/admin/forms/SubmissionCells.js +1 -1
  108. package/dist/admin/forms/SubmissionView.d.ts +1 -1
  109. package/dist/admin/forms/SubmissionView.js +1 -1
  110. package/dist/admin/forms/submissionData.d.ts +1 -1
  111. package/dist/admin/forms/submissionData.js +1 -1
  112. package/dist/admin/forms/submissions.css +200 -0
  113. package/dist/admin/layoutField.css +70 -0
  114. package/dist/admin/screen/BuilderScreen.d.ts +1 -1
  115. package/dist/admin/screen/BuilderScreen.js +1 -1
  116. package/dist/admin/templateConditions.css +25 -0
  117. package/dist/ai/images/service.js +2 -2
  118. package/dist/ai/settings/index.js +3 -0
  119. package/dist/classes/collection.js +1 -0
  120. package/dist/classes/sheet.js +2 -0
  121. package/dist/comments/collection.js +3 -0
  122. package/dist/core/fieldHooks.d.ts +1 -1
  123. package/dist/forms/submissionsAdmin.js +1 -1
  124. package/dist/forms/uploads.js +2 -2
  125. package/dist/live/draftAccess.js +1 -1
  126. package/dist/plugin/index.js +2 -2
  127. package/dist/plugin/sections.js +3 -0
  128. package/dist/plugin/templates.js +5 -1
  129. package/dist/react/canvas/inline/candidates.js +2 -2
  130. package/dist/react/canvas/inline/rich/editor.js +9 -1
  131. package/dist/react/components/Image.d.ts +1 -1
  132. package/dist/react/components/Image.js +2 -2
  133. package/dist/react/render/resolve.js +2 -0
  134. package/dist/react/render/templates.js +3 -1
  135. package/dist/react/server.js +1 -1
  136. package/dist/react/theme/ThemeStyle.js +1 -1
  137. package/dist/theme/admin/ColorField.d.ts +4 -3
  138. package/dist/theme/admin/ColorField.js +1 -1
  139. package/dist/theme/admin/FontField.d.ts +4 -3
  140. package/dist/theme/admin/FontField.js +1 -1
  141. package/dist/theme/admin/SaveSignal.js +1 -1
  142. package/dist/theme/admin/SliderField.d.ts +1 -1
  143. package/dist/theme/admin/SliderField.js +1 -1
  144. package/dist/theme/admin/Variables.d.ts +4 -3
  145. package/dist/theme/admin/Variables.js +2 -2
  146. package/dist/theme/admin/fields.css +327 -0
  147. package/dist/theme/global.js +2 -0
  148. package/package.json +25 -24
  149. package/dist/admin/aiKeyField.scss +0 -58
  150. package/dist/admin/diff/layoutDiff.scss +0 -181
  151. package/dist/admin/editor/classes/manager.scss +0 -262
  152. package/dist/admin/editor/fields/fields.scss +0 -778
  153. package/dist/admin/editor/layout/layout.scss +0 -240
  154. package/dist/admin/editor/locale/locale.scss +0 -154
  155. package/dist/admin/editor/menu/menu.scss +0 -132
  156. package/dist/admin/editor/sections/components.scss +0 -238
  157. package/dist/admin/editor/sections/variants.scss +0 -90
  158. package/dist/admin/editor/topbar/screens/screens.scss +0 -134
  159. package/dist/admin/editor/topbar/settingsDrawer.scss +0 -32
  160. package/dist/admin/editor/ui/controls.scss +0 -320
  161. package/dist/admin/forms/submissions.scss +0 -197
  162. package/dist/admin/layoutField.scss +0 -69
  163. package/dist/admin/templateConditions.scss +0 -24
  164. package/dist/theme/admin/fields.scss +0 -363
@@ -1,2 +1,2 @@
1
- import './empty.scss';
1
+ import './empty.css';
2
2
  export declare function EmptyStart(): import("react").JSX.Element | null;
@@ -21,7 +21,7 @@ import { useRuntime } from '../runtime.js';
21
21
  import { useEditor } from '../store.js';
22
22
  import { isTemplateDoc } from '../templates/state.js';
23
23
  import { useValueSelector } from '../valueStore.js';
24
- import './empty.scss';
24
+ import './empty.css';
25
25
  /** Categories of the suggested sections, in order: a page usually starts with these. */
26
26
  const SUGGESTED = ['Heroes', 'Features', 'Calls to action'];
27
27
  const SUGGESTION_COUNT = 3;
@@ -92,7 +92,7 @@ function TemplateNotice({ template, titleId, onIgnore }) {
92
92
  const singular = collections.find((c) => c.slug === runtime.config.collection)?.labels?.singular;
93
93
  const noun = typeof singular === 'string' ? singular.toLowerCase() : 'document';
94
94
  const templates = runtime.config.templates;
95
- return (_jsxs(_Fragment, { children: [_jsx("span", { className: "builder-empty-start__icon", children: _jsx(Icon, { name: "template", size: 20 }) }), _jsxs("h2", { id: titleId, className: "builder-empty-start__title", children: ["This ", noun, " uses the template \u201C", template.name, "\u201D"] }), _jsxs("p", { className: "builder-empty-start__text", children: ["The site shows this ", noun, " through the template. Blocks you add here do not show while a template applies."] }), _jsxs("div", { className: "builder-empty-start__actions", children: [templates && (_jsx(Button, { el: "link", url: builderViewPath(routes.admin, templates.collection, template.id), buttonStyle: "primary", size: "small", margin: false, children: "Open the template" })), onIgnore && (_jsx(Button, { buttonStyle: "secondary", size: "small", margin: false, onClick: onIgnore, children: "Add blocks here anyway" }))] })] }));
95
+ return (_jsxs(_Fragment, { children: [_jsx("span", { className: "builder-empty-start__icon", children: _jsx(Icon, { name: "template", size: 20 }) }), _jsxs("h2", { id: titleId, className: "builder-empty-start__title", children: ["This ", noun, " uses the template \u201C", template.name, "\u201D"] }), _jsxs("p", { className: "builder-empty-start__text", children: ["The site shows this ", noun, " through the template. Blocks you add here do not show while a template applies."] }), _jsxs("div", { className: "builder-empty-start__actions", children: [templates && (_jsx(Button, { el: "link", url: builderViewPath(routes.admin, templates.collection, template.id), buttonStyle: "primary", size: "medium", margin: false, children: "Open the template" })), onIgnore && (_jsx(Button, { buttonStyle: "secondary", size: "medium", margin: false, onClick: onIgnore, children: "Add blocks here anyway" }))] })] }));
96
96
  }
97
97
  function StartOptions({ titleId }) {
98
98
  const runtime = useRuntime();
@@ -101,5 +101,5 @@ function StartOptions({ titleId }) {
101
101
  if (insertBlocks(runtime, section.blocks, sectionPosition(runtime)))
102
102
  runtime.notify(`Added ${section.label}`);
103
103
  };
104
- return (_jsxs(_Fragment, { children: [_jsx("h2", { id: titleId, className: "builder-empty-start__title", children: "Start this page" }), _jsx("p", { className: "builder-empty-start__text", children: picks.length > 0 ? 'Add a section to begin, or build the page block by block.' : 'Add blocks from the Blocks tab, or drag them onto the canvas.' }), picks.length > 0 && (_jsx("ul", { className: "builder-empty-start__sections", "aria-label": "Suggested sections", children: picks.map((section) => (_jsx("li", { children: _jsxs("button", { type: "button", className: "builder-editor__card builder-empty-start__section", onClick: () => insert(section), children: [_jsx(SectionThumb, { section: section }), _jsxs("span", { className: "builder-editor__card-text", children: [_jsx("span", { className: "builder-editor__card-label", children: section.label }), section.category && _jsx("span", { className: "builder-editor__card-desc", children: section.category })] })] }) }, section.id))) })), _jsxs("div", { className: "builder-empty-start__actions", children: [picks.length > 0 && (_jsx(Button, { buttonStyle: "secondary", size: "small", margin: false, onClick: () => selectLeftTab(runtime, 'sections', { focus: true }), children: "Browse sections" })), _jsx(Button, { buttonStyle: "secondary", size: "small", margin: false, onClick: () => selectLeftTab(runtime, 'blocks', { focus: true }), children: "Add a block" }), runtime.assistant && (_jsx(Button, { buttonStyle: "secondary", size: "small", margin: false, icon: _jsx(Icon, { name: "sparkle", size: 14 }), iconPosition: "left", onClick: () => runtime.toggleAssistant(true), children: "Ask the assistant" }))] })] }));
104
+ return (_jsxs(_Fragment, { children: [_jsx("h2", { id: titleId, className: "builder-empty-start__title", children: "Start this page" }), _jsx("p", { className: "builder-empty-start__text", children: picks.length > 0 ? 'Add a section to begin, or build the page block by block.' : 'Add blocks from the Blocks tab, or drag them onto the canvas.' }), picks.length > 0 && (_jsx("ul", { className: "builder-empty-start__sections", "aria-label": "Suggested sections", children: picks.map((section) => (_jsx("li", { children: _jsxs("button", { type: "button", className: "builder-editor__card builder-empty-start__section", onClick: () => insert(section), children: [_jsx(SectionThumb, { section: section }), _jsxs("span", { className: "builder-editor__card-text", children: [_jsx("span", { className: "builder-editor__card-label", children: section.label }), section.category && _jsx("span", { className: "builder-editor__card-desc", children: section.category })] })] }) }, section.id))) })), _jsxs("div", { className: "builder-empty-start__actions", children: [picks.length > 0 && (_jsx(Button, { buttonStyle: "secondary", size: "medium", margin: false, onClick: () => selectLeftTab(runtime, 'sections', { focus: true }), children: "Browse sections" })), _jsx(Button, { buttonStyle: "secondary", size: "medium", margin: false, onClick: () => selectLeftTab(runtime, 'blocks', { focus: true }), children: "Add a block" }), runtime.assistant && (_jsx(Button, { buttonStyle: "secondary", size: "medium", margin: false, icon: _jsx(Icon, { name: "sparkle", size: 14 }), iconPosition: "left", onClick: () => runtime.toggleAssistant(true), children: "Ask the assistant" }))] })] }));
105
105
  }
@@ -1,5 +1,4 @@
1
- // The empty page's start card, over the canvas. Payload CSS variables only.
2
-
1
+ /* The empty page's start card, over the canvas. Payload CSS variables only. */
3
2
  @layer payload-default {
4
3
  .builder-empty-start {
5
4
  position: absolute;
@@ -10,7 +9,7 @@
10
9
  align-items: flex-start;
11
10
  padding: 72px 16px 16px;
12
11
  overflow: auto;
13
- // Drops from the library pass through to the canvas around the card.
12
+ /* Drops from the library pass through to the canvas around the card. */
14
13
  pointer-events: none;
15
14
  }
16
15
 
@@ -24,7 +23,7 @@
24
23
  border: 1px solid var(--be-border);
25
24
  border-radius: var(--be-radius-m);
26
25
  background: var(--be-panel);
27
- color: var(--theme-text);
26
+ color: var(--color-text);
28
27
  box-shadow: var(--be-shadow);
29
28
  text-align: center;
30
29
  pointer-events: auto;
@@ -43,8 +42,8 @@
43
42
 
44
43
  .builder-empty-start__title {
45
44
  margin: 0;
46
- // Payload's h4 size (16px): the start card's title is a page-level heading, not panel text.
47
- font-size: calc(var(--base) * 0.8);
45
+ /* Payload's h4 size (16px): the start card's title is a page-level heading, not panel text. */
46
+ font-size: calc(1.0156rem * 0.8);
48
47
  font-weight: var(--be-weight-strong);
49
48
  line-height: 1.35;
50
49
  text-wrap: balance;
@@ -53,7 +52,7 @@
53
52
  .builder-empty-start__text {
54
53
  max-width: 48ch;
55
54
  margin: 0;
56
- color: var(--theme-elevation-650);
55
+ color: var(--color-text-secondary);
57
56
  font-size: var(--be-text-m);
58
57
  line-height: 1.5;
59
58
  text-wrap: balance;
@@ -72,14 +71,14 @@
72
71
  .builder-empty-start__section {
73
72
  height: 100%;
74
73
  cursor: pointer;
74
+ }
75
75
 
76
- .builder-editor__thumb {
77
- height: 84px;
78
- }
76
+ .builder-empty-start__section .builder-editor__thumb {
77
+ height: 84px;
78
+ }
79
79
 
80
- .builder-editor__thumb--picture {
81
- max-height: 84px;
82
- }
80
+ .builder-empty-start__section .builder-editor__thumb--picture {
81
+ max-height: 84px;
83
82
  }
84
83
 
85
84
  .builder-empty-start__actions {
@@ -105,11 +105,11 @@ export function FormBlockActions({ path }) {
105
105
  if (mode === 'build') {
106
106
  return (_jsxs("div", { className: "builder-form-actions", children: [_jsx(Note, { children: formId === null
107
107
  ? 'Visitors can send this form once the page is published. Publishing saves it to Forms.'
108
- : `Publishing the page saves changes to this form (Forms #${String(formId)}). ${answers ?? ''}` }), submissionsLink && count ? (_jsx(Button, { el: "link", url: submissionsLink, newTab: true, buttonStyle: "secondary", size: "small", margin: false, children: "View submissions" })) : null] }));
108
+ : `Publishing the page saves changes to this form (Forms #${String(formId)}). ${answers ?? ''}` }), submissionsLink && count ? (_jsx(Button, { el: "link", url: submissionsLink, newTab: true, buttonStyle: "secondary", size: "medium", margin: false, children: "View submissions" })) : null] }));
109
109
  }
110
110
  if (formId === null)
111
111
  return null;
112
- return (_jsxs("div", { className: "builder-form-actions", children: [answers ? _jsx(Note, { children: answers }) : null, _jsxs("div", { className: "builder-form-actions__row", children: [_jsx(Button, { el: "link", url: builderViewPath(config.routes.admin, forms.collection, formId), newTab: true, buttonStyle: "secondary", size: "small", margin: false, children: "Edit form" }), _jsx(Button, { buttonStyle: "secondary", size: "small", margin: false, disabled: busy, tooltip: "Its fields become blocks in this form, so you edit them here", onClick: () => {
112
+ return (_jsxs("div", { className: "builder-form-actions", children: [answers ? _jsx(Note, { children: answers }) : null, _jsxs("div", { className: "builder-form-actions__row", children: [_jsx(Button, { el: "link", url: builderViewPath(config.routes.admin, forms.collection, formId), newTab: true, buttonStyle: "secondary", size: "medium", margin: false, children: "Edit form" }), _jsx(Button, { buttonStyle: "secondary", size: "medium", margin: false, disabled: busy, tooltip: "Its fields become blocks in this form, so you edit them here", onClick: () => {
113
113
  setBusy(true);
114
114
  void moveIntoPage(runtime, blockId, formId).finally(() => setBusy(false));
115
115
  }, children: "Move into this page" })] })] }));
@@ -163,5 +163,5 @@ export function FormSourceNote() {
163
163
  }, [isForm, forms, meta.id, runtime.api]);
164
164
  if (!source)
165
165
  return null;
166
- return (_jsxs("div", { className: "builder-form-actions builder-form-actions--source", children: [_jsxs("p", { className: "builder-field-note builder-field-note--warning", children: ["This form is built on the page ", source.title ? `“${source.title}”` : `#${source.document}`, ". Edit it there: when that page publishes a change to this form, it replaces changes made here."] }), _jsx(Button, { el: "link", url: builderViewPath(config.routes.admin, source.collection, source.document), buttonStyle: "secondary", size: "small", margin: false, children: "Open the page" })] }));
166
+ return (_jsxs("div", { className: "builder-form-actions builder-form-actions--source", children: [_jsxs("p", { className: "builder-field-note builder-field-note--warning", children: ["This form is built on the page ", source.title ? `“${source.title}”` : `#${source.document}`, ". Edit it there: when that page publishes a change to this form, it replaces changes made here."] }), _jsx(Button, { el: "link", url: builderViewPath(config.routes.admin, source.collection, source.document), buttonStyle: "secondary", size: "medium", margin: false, children: "Open the page" })] }));
167
167
  }