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.
- package/README.md +17 -17
- package/dist/admin/AiKeyField.d.ts +4 -3
- package/dist/admin/AiKeyField.js +3 -3
- package/dist/admin/BuilderTab.js +1 -1
- package/dist/admin/DocumentEditView.d.ts +1 -1
- package/dist/admin/DocumentEditView.js +2 -3
- package/dist/admin/LayoutField.d.ts +1 -1
- package/dist/admin/LayoutField.js +2 -2
- package/dist/admin/TemplateConditionsField.d.ts +2 -2
- package/dist/admin/TemplateConditionsField.js +2 -2
- package/dist/admin/aiKeyField.css +58 -0
- package/dist/admin/diff/LayoutDiff.js +3 -3
- package/dist/admin/diff/LayoutJsonDiff.d.ts +1 -1
- package/dist/admin/diff/LayoutJsonDiff.js +1 -1
- package/dist/admin/diff/layoutDiff.css +180 -0
- package/dist/admin/editor/Editor.d.ts +2 -2
- package/dist/admin/editor/Editor.js +2 -2
- package/dist/admin/editor/Library.js +1 -2
- package/dist/admin/editor/assistant/AssistantPanel.d.ts +1 -1
- package/dist/admin/editor/assistant/AssistantPanel.js +1 -1
- package/dist/admin/editor/assistant/{assistant.scss → assistant.css} +322 -315
- package/dist/admin/editor/classes/ClassManager.d.ts +1 -1
- package/dist/admin/editor/classes/ClassManager.js +1 -1
- package/dist/admin/editor/classes/manager.css +258 -0
- package/dist/admin/editor/comments/CommentLayer.d.ts +1 -1
- package/dist/admin/editor/comments/CommentLayer.js +1 -1
- package/dist/admin/editor/comments/CommentsPanel.d.ts +1 -1
- package/dist/admin/editor/comments/CommentsPanel.js +1 -1
- package/dist/admin/editor/comments/{comments.scss → comments.css} +121 -140
- package/dist/admin/editor/comments/useCommentFromURL.js +1 -1
- package/dist/admin/editor/dnd/{dnd.scss → dnd.css} +78 -80
- package/dist/admin/editor/{editor.scss → editor.css} +782 -763
- package/dist/admin/editor/empty/EmptyStart.d.ts +1 -1
- package/dist/admin/editor/empty/EmptyStart.js +3 -3
- package/dist/admin/editor/empty/{empty.scss → empty.css} +12 -13
- package/dist/admin/editor/fields/FormBlock.js +3 -3
- package/dist/admin/editor/fields/fields.css +786 -0
- package/dist/admin/editor/generate/GenerateImage.d.ts +1 -1
- package/dist/admin/editor/generate/GenerateImage.js +1 -1
- package/dist/admin/editor/generate/{generate.scss → generate.css} +83 -82
- package/dist/admin/editor/layout/layout.css +243 -0
- package/dist/admin/editor/layout/panels.js +1 -1
- package/dist/admin/editor/live/PresenceUI.d.ts +1 -1
- package/dist/admin/editor/live/PresenceUI.js +2 -2
- package/dist/admin/editor/live/{presence.scss → presence.css} +5 -4
- package/dist/admin/editor/locale/LocaleField.d.ts +1 -1
- package/dist/admin/editor/locale/LocaleField.js +1 -1
- package/dist/admin/editor/locale/LocaleSwitcher.d.ts +1 -1
- package/dist/admin/editor/locale/LocaleSwitcher.js +1 -1
- package/dist/admin/editor/locale/locale.css +153 -0
- package/dist/admin/editor/media/ImageEditor.d.ts +1 -1
- package/dist/admin/editor/media/ImageEditor.js +1 -1
- package/dist/admin/editor/media/{media.scss → media.css} +67 -67
- package/dist/admin/editor/menu/Menu.d.ts +1 -1
- package/dist/admin/editor/menu/Menu.js +1 -1
- package/dist/admin/editor/menu/menu.css +132 -0
- package/dist/admin/editor/motion/MotionPanel.d.ts +2 -2
- package/dist/admin/editor/motion/MotionPanel.js +2 -2
- package/dist/admin/editor/motion/{motion.scss → motion.css} +24 -21
- package/dist/admin/editor/regions/RegionPane.js +1 -1
- package/dist/admin/editor/renderField.d.ts +1 -1
- package/dist/admin/editor/renderField.js +1 -1
- package/dist/admin/editor/sections/ComponentFields.d.ts +1 -1
- package/dist/admin/editor/sections/ComponentFields.js +2 -3
- package/dist/admin/editor/sections/PropertyControls.d.ts +1 -1
- package/dist/admin/editor/sections/PropertyControls.js +1 -1
- package/dist/admin/editor/sections/components.css +244 -0
- package/dist/admin/editor/sections/variants.css +93 -0
- package/dist/admin/editor/sections/variants.d.ts +1 -1
- package/dist/admin/editor/sections/variants.js +1 -1
- package/dist/admin/editor/styles/ClassBar.d.ts +1 -1
- package/dist/admin/editor/styles/ClassBar.js +1 -1
- package/dist/admin/editor/styles/StylesPanel.d.ts +1 -1
- package/dist/admin/editor/styles/StylesPanel.js +1 -1
- package/dist/admin/editor/styles/{classes.scss → classes.css} +128 -125
- package/dist/admin/editor/styles/{styles.scss → styles.css} +368 -370
- package/dist/admin/editor/templates/Bindable.d.ts +1 -1
- package/dist/admin/editor/templates/Bindable.js +1 -1
- package/dist/admin/editor/templates/binding.js +4 -1
- package/dist/admin/editor/templates/{templates.scss → templates.css} +207 -206
- package/dist/admin/editor/tooltip/Tooltips.d.ts +1 -1
- package/dist/admin/editor/tooltip/Tooltips.js +1 -1
- package/dist/admin/editor/tooltip/{tooltip.scss → tooltip.css} +11 -10
- package/dist/admin/editor/topbar/ContentModeToggle.d.ts +1 -1
- package/dist/admin/editor/topbar/ContentModeToggle.js +1 -1
- package/dist/admin/editor/topbar/DocumentActions.js +1 -2
- package/dist/admin/editor/topbar/TopBar.d.ts +1 -1
- package/dist/admin/editor/topbar/TopBar.js +2 -3
- package/dist/admin/editor/topbar/{contentMode.scss → contentMode.css} +7 -8
- package/dist/admin/editor/topbar/screens/DrawerRouter.d.ts +1 -1
- package/dist/admin/editor/topbar/screens/DrawerRouter.js +52 -40
- package/dist/admin/editor/topbar/screens/ScreenDrawer.d.ts +1 -1
- package/dist/admin/editor/topbar/screens/ScreenDrawer.js +4 -5
- package/dist/admin/editor/topbar/screens/drawerRouterSupport.d.ts +5 -5
- package/dist/admin/editor/topbar/screens/drawerRouterSupport.js +7 -7
- package/dist/admin/editor/topbar/screens/screens.css +139 -0
- package/dist/admin/editor/topbar/settingsDrawer.css +33 -0
- package/dist/admin/editor/topbar/settingsDrawer.d.ts +1 -1
- package/dist/admin/editor/topbar/settingsDrawer.js +3 -3
- package/dist/admin/editor/topbar/{topbar.scss → topbar.css} +189 -191
- package/dist/admin/editor/ui/Select.d.ts +1 -1
- package/dist/admin/editor/ui/Select.js +1 -1
- package/dist/admin/editor/ui/Slider.d.ts +1 -1
- package/dist/admin/editor/ui/Slider.js +1 -1
- package/dist/admin/editor/ui/controls.css +301 -0
- package/dist/admin/forms/SubmissionCells.d.ts +1 -1
- package/dist/admin/forms/SubmissionCells.js +1 -1
- package/dist/admin/forms/SubmissionView.d.ts +1 -1
- package/dist/admin/forms/SubmissionView.js +1 -1
- package/dist/admin/forms/submissionData.d.ts +1 -1
- package/dist/admin/forms/submissionData.js +1 -1
- package/dist/admin/forms/submissions.css +200 -0
- package/dist/admin/layoutField.css +70 -0
- package/dist/admin/screen/BuilderScreen.d.ts +1 -1
- package/dist/admin/screen/BuilderScreen.js +1 -1
- package/dist/admin/templateConditions.css +25 -0
- package/dist/ai/images/service.js +2 -2
- package/dist/ai/settings/index.js +3 -0
- package/dist/classes/collection.js +1 -0
- package/dist/classes/sheet.js +2 -0
- package/dist/comments/collection.js +3 -0
- package/dist/core/fieldHooks.d.ts +1 -1
- package/dist/forms/submissionsAdmin.js +1 -1
- package/dist/forms/uploads.js +2 -2
- package/dist/live/draftAccess.js +1 -1
- package/dist/plugin/index.js +2 -2
- package/dist/plugin/sections.js +3 -0
- package/dist/plugin/templates.js +5 -1
- package/dist/react/canvas/inline/candidates.js +2 -2
- package/dist/react/canvas/inline/rich/editor.js +9 -1
- package/dist/react/components/Image.d.ts +1 -1
- package/dist/react/components/Image.js +2 -2
- package/dist/react/render/resolve.js +2 -0
- package/dist/react/render/templates.js +3 -1
- package/dist/react/server.js +1 -1
- package/dist/react/theme/ThemeStyle.js +1 -1
- package/dist/theme/admin/ColorField.d.ts +4 -3
- package/dist/theme/admin/ColorField.js +1 -1
- package/dist/theme/admin/FontField.d.ts +4 -3
- package/dist/theme/admin/FontField.js +1 -1
- package/dist/theme/admin/SaveSignal.js +1 -1
- package/dist/theme/admin/SliderField.d.ts +1 -1
- package/dist/theme/admin/SliderField.js +1 -1
- package/dist/theme/admin/Variables.d.ts +4 -3
- package/dist/theme/admin/Variables.js +2 -2
- package/dist/theme/admin/fields.css +327 -0
- package/dist/theme/global.js +2 -0
- package/package.json +25 -24
- package/dist/admin/aiKeyField.scss +0 -58
- package/dist/admin/diff/layoutDiff.scss +0 -181
- package/dist/admin/editor/classes/manager.scss +0 -262
- package/dist/admin/editor/fields/fields.scss +0 -778
- package/dist/admin/editor/layout/layout.scss +0 -240
- package/dist/admin/editor/locale/locale.scss +0 -154
- package/dist/admin/editor/menu/menu.scss +0 -132
- package/dist/admin/editor/sections/components.scss +0 -238
- package/dist/admin/editor/sections/variants.scss +0 -90
- package/dist/admin/editor/topbar/screens/screens.scss +0 -134
- package/dist/admin/editor/topbar/settingsDrawer.scss +0 -32
- package/dist/admin/editor/ui/controls.scss +0 -320
- package/dist/admin/forms/submissions.scss +0 -197
- package/dist/admin/layoutField.scss +0 -69
- package/dist/admin/templateConditions.scss +0 -24
- package/dist/theme/admin/fields.scss +0 -363
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './empty.
|
|
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.
|
|
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: "
|
|
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: "
|
|
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
|
-
|
|
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
|
-
|
|
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(--
|
|
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
|
-
|
|
47
|
-
font-size: calc(
|
|
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(--
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
.builder-empty-start__section .builder-editor__thumb {
|
|
77
|
+
height: 84px;
|
|
78
|
+
}
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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
|
}
|