payload-canvas 0.3.0-next.1 → 0.4.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 +522 -39
- package/dist/admin/BuilderTab.js +1 -1
- package/dist/admin/diff/LayoutDiff.js +3 -3
- package/dist/admin/diff/changes.js +8 -0
- package/dist/admin/diff/layoutDiff.scss +48 -48
- package/dist/admin/editor/DragLayer.js +1 -1
- package/dist/admin/editor/InlineToolbar.js +1 -1
- package/dist/admin/editor/Inspector.js +50 -5
- package/dist/admin/editor/Outline.js +13 -11
- package/dist/admin/editor/Overlay.js +1 -1
- package/dist/admin/editor/actions.d.ts +9 -1
- package/dist/admin/editor/actions.js +38 -3
- package/dist/admin/editor/assistant/AssistantPanel.js +1 -1
- package/dist/admin/editor/assistant/ConnectAgents.js +1 -1
- package/dist/admin/editor/assistant/assistant.scss +65 -65
- package/dist/admin/editor/dnd/dnd.scss +2 -2
- package/dist/admin/editor/editor.scss +134 -134
- package/dist/admin/editor/empty/EmptyStart.js +32 -6
- package/dist/admin/editor/empty/empty.scss +3 -3
- package/dist/admin/editor/fields/ArrayField.js +2 -2
- package/dist/admin/editor/fields/GroupField.d.ts +5 -2
- package/dist/admin/editor/fields/GroupField.js +6 -2
- package/dist/admin/editor/fields/WhereField.d.ts +17 -0
- package/dist/admin/editor/fields/WhereField.js +67 -0
- package/dist/admin/editor/fields/access.d.ts +1 -1
- package/dist/admin/editor/fields/fields.scss +122 -33
- package/dist/admin/editor/fields/whereRows.d.ts +28 -0
- package/dist/admin/editor/fields/whereRows.js +118 -0
- package/dist/admin/editor/generate/GenerateImage.js +1 -1
- package/dist/admin/editor/generate/generate.scss +48 -48
- package/dist/admin/editor/icons.d.ts +1 -0
- package/dist/admin/editor/icons.js +3 -1
- package/dist/admin/editor/insert/InsertHandle.js +1 -1
- package/dist/admin/editor/layout/FrameResize.js +1 -1
- package/dist/admin/editor/layout/LeftPanel.js +1 -1
- package/dist/admin/editor/layout/layout.scss +4 -4
- package/dist/admin/editor/live/PresenceUI.js +1 -1
- package/dist/admin/editor/live/presence.scss +1 -1
- package/dist/admin/editor/locale/LocaleField.d.ts +2 -2
- package/dist/admin/editor/locale/LocaleField.js +4 -2
- package/dist/admin/editor/locale/locale.scss +12 -12
- package/dist/admin/editor/media/ImageEditor.js +1 -1
- package/dist/admin/editor/media/media.scss +23 -23
- package/dist/admin/editor/menu/Menu.js +1 -1
- package/dist/admin/editor/menu/blockMenu.js +5 -1
- package/dist/admin/editor/menu/menu.scss +16 -16
- package/dist/admin/editor/motion/MotionPanel.js +2 -2
- package/dist/admin/editor/motion/model.d.ts +2 -2
- package/dist/admin/editor/motion/model.js +2 -2
- package/dist/admin/editor/motion/motion.scss +2 -2
- package/dist/admin/editor/regions/RegionOverlay.js +1 -1
- package/dist/admin/editor/regions/RegionPane.js +1 -1
- package/dist/admin/editor/renderField.d.ts +3 -1
- package/dist/admin/editor/renderField.js +14 -5
- package/dist/admin/editor/runtime.js +1 -0
- package/dist/admin/editor/styles/ColorPicker.js +1 -1
- package/dist/admin/editor/styles/SiteClasses.d.ts +9 -0
- package/dist/admin/editor/styles/SiteClasses.js +31 -0
- package/dist/admin/editor/styles/StylesPanel.d.ts +3 -1
- package/dist/admin/editor/styles/StylesPanel.js +9 -6
- package/dist/admin/editor/styles/VariantBar.js +1 -1
- package/dist/admin/editor/styles/context.d.ts +9 -2
- package/dist/admin/editor/styles/context.js +14 -9
- package/dist/admin/editor/styles/controls.js +3 -3
- package/dist/admin/editor/styles/sections.js +2 -2
- package/dist/admin/editor/styles/styles.scss +147 -93
- package/dist/admin/editor/templates/Bindable.d.ts +14 -6
- package/dist/admin/editor/templates/Bindable.js +74 -18
- package/dist/admin/editor/templates/SamplePicker.js +1 -1
- package/dist/admin/editor/templates/binding.d.ts +11 -4
- package/dist/admin/editor/templates/binding.js +23 -3
- package/dist/admin/editor/templates/templates.scss +90 -90
- package/dist/admin/editor/tooltip/tooltip.scss +4 -4
- package/dist/admin/editor/topbar/DocumentActions.js +1 -1
- package/dist/admin/editor/topbar/DocumentTitle.js +1 -1
- package/dist/admin/editor/topbar/screens/DrawerRouter.d.ts +1 -1
- package/dist/admin/editor/topbar/screens/ScreenDrawer.js +1 -1
- package/dist/admin/editor/topbar/screens/drawerRouterSupport.d.ts +1 -1
- package/dist/admin/editor/topbar/screens/screens.scss +20 -20
- package/dist/admin/editor/topbar/settingsDrawer.js +3 -3
- package/dist/admin/editor/topbar/settingsDrawer.scss +7 -7
- package/dist/admin/editor/topbar/topbar.scss +47 -47
- package/dist/admin/editor/ui/Select.js +1 -1
- package/dist/admin/editor/ui/controls.scss +26 -26
- package/dist/admin/screen/BuilderScreen.js +1 -1
- package/dist/ai/adapters/anthropic.d.ts +2 -2
- package/dist/ai/images/service.js +1 -1
- package/dist/ai/loop.d.ts +5 -5
- package/dist/ai/prompt.js +8 -2
- package/dist/ai/tools.js +11 -2
- package/dist/blocks/builtins/carousel.d.ts +32 -0
- package/dist/blocks/builtins/carousel.js +122 -0
- package/dist/blocks/builtins/disclosure.d.ts +13 -0
- package/dist/blocks/builtins/disclosure.js +107 -0
- package/dist/blocks/builtins/faq.d.ts +17 -0
- package/dist/blocks/builtins/faq.js +88 -0
- package/dist/blocks/builtins/filterLink.d.ts +22 -0
- package/dist/blocks/builtins/filterLink.js +76 -0
- package/dist/blocks/builtins/headingId.d.ts +15 -0
- package/dist/blocks/builtins/headingId.js +36 -0
- package/dist/blocks/builtins/icon.d.ts +8 -0
- package/dist/blocks/builtins/icon.js +45 -0
- package/dist/blocks/builtins/index.d.ts +35 -0
- package/dist/blocks/builtins/index.js +50 -0
- package/dist/blocks/builtins/lightbox.d.ts +43 -0
- package/dist/blocks/builtins/lightbox.js +93 -0
- package/dist/blocks/builtins/mediaBackdrop.d.ts +11 -0
- package/dist/blocks/builtins/mediaBackdrop.js +79 -0
- package/dist/blocks/builtins/sectionRef.d.ts +26 -0
- package/dist/blocks/builtins/sectionRef.js +78 -0
- package/dist/blocks/builtins/shared.d.ts +33 -0
- package/dist/blocks/builtins/shared.js +70 -0
- package/dist/blocks/builtins/tableOfContents.d.ts +3 -0
- package/dist/blocks/builtins/tableOfContents.js +44 -0
- package/dist/blocks/defaults.d.ts +28 -10
- package/dist/blocks/defaults.js +413 -20
- package/dist/blocks/index.d.ts +4 -2
- package/dist/blocks/index.js +3 -1
- package/dist/core/attrs.d.ts +27 -0
- package/dist/core/attrs.js +132 -0
- package/dist/core/bindings.d.ts +123 -12
- package/dist/core/bindings.js +504 -19
- package/dist/core/blocks.d.ts +46 -1
- package/dist/core/blocks.js +136 -0
- package/dist/core/classes.d.ts +10 -2
- package/dist/core/classes.js +34 -5
- package/dist/core/fieldAccess.js +1 -1
- package/dist/core/fieldHooks.d.ts +1 -1
- package/dist/core/headings.d.ts +21 -0
- package/dist/core/headings.js +47 -0
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +4 -2
- package/dist/core/motion.d.ts +24 -15
- package/dist/core/motion.js +20 -12
- package/dist/core/operations.js +59 -2
- package/dist/core/payloadBlocks.js +3 -1
- package/dist/core/schema.js +20 -0
- package/dist/core/tree.js +24 -1
- package/dist/core/types.d.ts +87 -0
- package/dist/core/validate.js +29 -4
- package/dist/css/tokens.d.ts +6 -3
- package/dist/css/tokens.js +48 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/live/draftAccess.js +1 -1
- package/dist/live/session.d.ts +1 -1
- package/dist/live/storage.js +4 -2
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +50 -13
- package/dist/mcp/shared.d.ts +34 -31
- package/dist/mcp/shared.js +23 -8
- package/dist/plugin/index.d.ts +8 -0
- package/dist/plugin/index.js +30 -12
- package/dist/plugin/listCollections.d.ts +17 -2
- package/dist/plugin/listCollections.js +44 -7
- package/dist/plugin/references.d.ts +5 -0
- package/dist/plugin/references.js +1 -1
- package/dist/plugin/templates.d.ts +4 -0
- package/dist/plugin/templates.js +24 -9
- package/dist/protocol/index.d.ts +3 -1
- package/dist/react/canvas/BuilderCanvas.js +6 -4
- package/dist/react/canvas/fetchDocs.d.ts +16 -2
- package/dist/react/canvas/fetchDocs.js +42 -9
- package/dist/react/canvas/inline/rich/editor.js +1 -6
- package/dist/react/canvas/measure.d.ts +3 -1
- package/dist/react/canvas/measure.js +26 -2
- package/dist/react/canvas/resolveLayout.d.ts +1 -1
- package/dist/react/canvas/resolveLayout.js +17 -6
- package/dist/react/canvas/serverBlocks.d.ts +11 -0
- package/dist/react/canvas/serverBlocks.js +28 -1
- package/dist/react/canvas/thumbnail/ThumbnailCanvas.js +1 -1
- package/dist/react/components/Button.d.ts +11 -2
- package/dist/react/components/Button.js +43 -6
- package/dist/react/components/CollectionList.d.ts +6 -3
- package/dist/react/components/CollectionList.js +21 -7
- package/dist/react/components/Container.js +4 -1
- package/dist/react/components/Field.js +13 -2
- package/dist/react/components/Heading.js +9 -2
- package/dist/react/components/Image.d.ts +9 -0
- package/dist/react/components/Image.js +16 -1
- package/dist/react/components/List.d.ts +1 -0
- package/dist/react/components/List.js +6 -0
- package/dist/react/components/Menu.d.ts +16 -0
- package/dist/react/components/Menu.js +83 -19
- package/dist/react/components/RichText.d.ts +8 -3
- package/dist/react/components/RichText.js +25 -4
- package/dist/react/components/builtins/Accordion.d.ts +9 -0
- package/dist/react/components/builtins/Accordion.js +37 -0
- package/dist/react/components/builtins/BackdropVideo.d.ts +13 -0
- package/dist/react/components/builtins/BackdropVideo.js +16 -0
- package/dist/react/components/builtins/Carousel.d.ts +13 -0
- package/dist/react/components/builtins/Carousel.js +134 -0
- package/dist/react/components/builtins/Disclosure.d.ts +7 -0
- package/dist/react/components/builtins/Disclosure.js +13 -0
- package/dist/react/components/builtins/FilterLink.d.ts +8 -0
- package/dist/react/components/builtins/FilterLink.js +30 -0
- package/dist/react/components/builtins/Icon.d.ts +14 -0
- package/dist/react/components/builtins/Icon.js +28 -0
- package/dist/react/components/builtins/Lightbox.d.ts +45 -0
- package/dist/react/components/builtins/Lightbox.js +252 -0
- package/dist/react/components/builtins/MediaBackdrop.d.ts +14 -0
- package/dist/react/components/builtins/MediaBackdrop.js +61 -0
- package/dist/react/components/builtins/SectionRef.d.ts +7 -0
- package/dist/react/components/builtins/SectionRef.js +17 -0
- package/dist/react/components/builtins/TableOfContents.d.ts +7 -0
- package/dist/react/components/builtins/TableOfContents.js +21 -0
- package/dist/react/components/builtins/glyphs.d.ts +8 -0
- package/dist/react/components/builtins/glyphs.js +7 -0
- package/dist/react/components/builtins/index.d.ts +32 -0
- package/dist/react/components/builtins/index.js +36 -0
- package/dist/react/components/index.js +2 -0
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.js +3 -1
- package/dist/react/motion/runtime.js +10 -6
- package/dist/react/motion/style.js +1 -1
- package/dist/react/render/PayloadRoot.js +1 -1
- package/dist/react/render/RenderLayout.d.ts +1 -1
- package/dist/react/render/RenderLayout.js +77 -24
- package/dist/react/render/lists.d.ts +107 -5
- package/dist/react/render/lists.js +284 -9
- package/dist/react/render/resolve.d.ts +22 -2
- package/dist/react/render/resolve.js +45 -24
- package/dist/react/render/sections.d.ts +9 -0
- package/dist/react/render/sections.js +51 -0
- package/dist/react/render/types.d.ts +6 -1
- package/dist/react/server.d.ts +4 -4
- package/dist/react/server.js +55 -7
- package/dist/react/theme/ThemeStyle.d.ts +13 -2
- package/dist/react/theme/ThemeStyle.js +13 -3
- package/dist/theme/admin/ColorField.d.ts +2 -2
- package/dist/theme/admin/ColorField.js +2 -2
- package/dist/theme/admin/FontField.d.ts +2 -2
- package/dist/theme/admin/FontField.js +2 -2
- package/dist/theme/admin/SaveSignal.js +2 -2
- package/dist/theme/admin/fields.scss +48 -48
- package/package.json +23 -28
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// The where builder's rows (field, operator, value) <-> a Payload `where` object. Pure, so it is
|
|
2
|
+
// tested without React. Rows are AND-ed. A where the rows cannot show (`or`, nested groups,
|
|
3
|
+
// object values, unknown operators) returns null from `whereRows`, and the field shows raw JSON.
|
|
4
|
+
export const WHERE_OPERATORS = [
|
|
5
|
+
'equals',
|
|
6
|
+
'not_equals',
|
|
7
|
+
'in',
|
|
8
|
+
'not_in',
|
|
9
|
+
'greater_than',
|
|
10
|
+
'greater_than_equal',
|
|
11
|
+
'less_than',
|
|
12
|
+
'less_than_equal',
|
|
13
|
+
'like',
|
|
14
|
+
'contains',
|
|
15
|
+
'exists',
|
|
16
|
+
];
|
|
17
|
+
const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
18
|
+
const isScalar = (value) => typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
|
|
19
|
+
const isOperator = (value) => WHERE_OPERATORS.includes(value);
|
|
20
|
+
function fitsOperator(operator, value) {
|
|
21
|
+
if (operator === 'exists')
|
|
22
|
+
return typeof value === 'boolean';
|
|
23
|
+
if (operator === 'in' || operator === 'not_in')
|
|
24
|
+
return Array.isArray(value) && value.every(isScalar);
|
|
25
|
+
return isScalar(value);
|
|
26
|
+
}
|
|
27
|
+
/** The rows of `{ field: { op: value } }` (several fields and operators allowed). Null when it does not fit. */
|
|
28
|
+
function rowsOf(where) {
|
|
29
|
+
const rows = [];
|
|
30
|
+
for (const [field, condition] of Object.entries(where)) {
|
|
31
|
+
if (field === 'and' || field === 'or' || !isRecord(condition))
|
|
32
|
+
return null;
|
|
33
|
+
const entries = Object.entries(condition);
|
|
34
|
+
if (entries.length === 0)
|
|
35
|
+
return null;
|
|
36
|
+
for (const [operator, value] of entries) {
|
|
37
|
+
if (!isOperator(operator) || !fitsOperator(operator, value))
|
|
38
|
+
return null;
|
|
39
|
+
rows.push({ field, operator, value });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return rows;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The rows of a stored where: empty for no where, null when the builder cannot show it. Takes
|
|
46
|
+
* `{ a: { equals: 1 }, b: { … } }` and `{ and: [ { a: { equals: 1 } }, … ] }`.
|
|
47
|
+
*/
|
|
48
|
+
export function whereRows(where) {
|
|
49
|
+
if (where === undefined || where === null)
|
|
50
|
+
return [];
|
|
51
|
+
if (!isRecord(where))
|
|
52
|
+
return null;
|
|
53
|
+
const keys = Object.keys(where);
|
|
54
|
+
if (keys.length === 1 && keys[0] === 'and') {
|
|
55
|
+
if (!Array.isArray(where.and))
|
|
56
|
+
return null;
|
|
57
|
+
const rows = [];
|
|
58
|
+
for (const part of where.and) {
|
|
59
|
+
if (!isRecord(part))
|
|
60
|
+
return null;
|
|
61
|
+
const partRows = rowsOf(part);
|
|
62
|
+
if (!partRows)
|
|
63
|
+
return null;
|
|
64
|
+
rows.push(...partRows);
|
|
65
|
+
}
|
|
66
|
+
return rows;
|
|
67
|
+
}
|
|
68
|
+
return rowsOf(where);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The where of the rows: one object `{ field: { op: value } }`, or `{ and: [...] }` when a field
|
|
72
|
+
* has the same operator twice. Rows without a field are left out. `undefined` for no rows.
|
|
73
|
+
*/
|
|
74
|
+
export function rowsWhere(rows) {
|
|
75
|
+
const complete = rows.filter((row) => row.field.trim());
|
|
76
|
+
if (complete.length === 0)
|
|
77
|
+
return undefined;
|
|
78
|
+
const flat = {};
|
|
79
|
+
for (const row of complete) {
|
|
80
|
+
const field = row.field.trim();
|
|
81
|
+
const condition = (flat[field] ??= {});
|
|
82
|
+
if (row.operator in condition) {
|
|
83
|
+
return { and: complete.map((r) => ({ [r.field.trim()]: { [r.operator]: r.value } })) };
|
|
84
|
+
}
|
|
85
|
+
condition[row.operator] = row.value;
|
|
86
|
+
}
|
|
87
|
+
return flat;
|
|
88
|
+
}
|
|
89
|
+
/** The text a value shows in the value input: lists as "a, b". */
|
|
90
|
+
export const whereValueText = (value) => Array.isArray(value) ? value.map(String).join(', ') : value === undefined || value === null ? '' : String(value);
|
|
91
|
+
/**
|
|
92
|
+
* The value to store for typed text. `fieldType` is the Payload field type when known: numbers
|
|
93
|
+
* become numbers and checkboxes booleans; any other text stays text (so "0412" stays a string).
|
|
94
|
+
* `in` and `not_in` split on commas. `exists` takes "true" or "false".
|
|
95
|
+
*/
|
|
96
|
+
export function parseWhereValue(text, operator, fieldType) {
|
|
97
|
+
if (operator === 'exists')
|
|
98
|
+
return text.trim() !== 'false';
|
|
99
|
+
const one = (part) => {
|
|
100
|
+
if (fieldType === 'number') {
|
|
101
|
+
const number = Number(part);
|
|
102
|
+
return part.trim() !== '' && Number.isFinite(number) ? number : part;
|
|
103
|
+
}
|
|
104
|
+
if (fieldType === 'checkbox')
|
|
105
|
+
return part.trim() === 'true';
|
|
106
|
+
return part;
|
|
107
|
+
};
|
|
108
|
+
if (operator === 'in' || operator === 'not_in') {
|
|
109
|
+
return text
|
|
110
|
+
.split(',')
|
|
111
|
+
.map((part) => part.trim())
|
|
112
|
+
.filter(Boolean)
|
|
113
|
+
.map(one);
|
|
114
|
+
}
|
|
115
|
+
return one(text);
|
|
116
|
+
}
|
|
117
|
+
/** The value a row keeps when its operator changes: re-read from its text for the new operator. */
|
|
118
|
+
export const convertWhereValue = (row, operator, fieldType) => parseWhereValue(operator === 'exists' ? 'true' : whereValueText(row.value), operator, fieldType);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
// "Generate image" under an upload field of the inspector: a prompt, an aspect ratio and alt text.
|
|
4
4
|
// The server generates the image with the site's image adapter, saves it in the media collection
|
|
5
5
|
// as the signed-in user, and the field gets the new media id. Hidden when no image adapter is ready.
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
gap: 6px;
|
|
10
10
|
margin-top: 6px;
|
|
11
11
|
padding: 4px 8px;
|
|
12
|
-
border: 1px dashed var(--
|
|
13
|
-
border-radius: var(--radius-
|
|
12
|
+
border: 1px dashed var(--theme-elevation-250);
|
|
13
|
+
border-radius: var(--style-radius-s, 4px);
|
|
14
14
|
background: none;
|
|
15
|
-
color: var(--
|
|
15
|
+
color: var(--theme-elevation-700);
|
|
16
16
|
font: inherit;
|
|
17
17
|
font-size: var(--be-text-m);
|
|
18
18
|
cursor: pointer;
|
|
19
19
|
|
|
20
20
|
&:hover {
|
|
21
|
-
border-color: var(--
|
|
22
|
-
color: var(--
|
|
21
|
+
border-color: var(--theme-elevation-400);
|
|
22
|
+
color: var(--theme-text);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
&:focus-visible {
|
|
26
|
-
outline: 2px solid var(--
|
|
26
|
+
outline: 2px solid var(--theme-success-500);
|
|
27
27
|
outline-offset: 1px;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
gap: 6px;
|
|
35
35
|
margin-top: 8px;
|
|
36
36
|
padding: 10px;
|
|
37
|
-
border: 1px solid var(--
|
|
38
|
-
border-radius: var(--radius-
|
|
39
|
-
background: var(--
|
|
37
|
+
border: 1px solid var(--theme-elevation-150);
|
|
38
|
+
border-radius: var(--style-radius-m, 6px);
|
|
39
|
+
background: var(--theme-elevation-50);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.builder-generate__head {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
display: inline-flex;
|
|
50
50
|
align-items: center;
|
|
51
51
|
gap: 6px;
|
|
52
|
-
color: var(--
|
|
52
|
+
color: var(--theme-text);
|
|
53
53
|
font-size: var(--be-text-m);
|
|
54
54
|
font-weight: var(--be-weight-strong);
|
|
55
55
|
}
|
|
@@ -61,27 +61,27 @@
|
|
|
61
61
|
height: 22px;
|
|
62
62
|
padding: 0;
|
|
63
63
|
border: 0;
|
|
64
|
-
border-radius: var(--radius-
|
|
64
|
+
border-radius: var(--style-radius-s, 4px);
|
|
65
65
|
background: none;
|
|
66
|
-
color: var(--
|
|
66
|
+
color: var(--theme-elevation-600);
|
|
67
67
|
cursor: pointer;
|
|
68
68
|
|
|
69
69
|
&:hover:not(:disabled) {
|
|
70
|
-
background: var(--
|
|
71
|
-
color: var(--
|
|
70
|
+
background: var(--theme-elevation-100);
|
|
71
|
+
color: var(--theme-text);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.builder-generate__label {
|
|
76
76
|
margin: 4px 0 0;
|
|
77
77
|
padding: 0;
|
|
78
|
-
color: var(--
|
|
78
|
+
color: var(--theme-elevation-600);
|
|
79
79
|
font-size: var(--be-text-s);
|
|
80
80
|
font-weight: var(--be-weight-medium);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.builder-generate__optional {
|
|
84
|
-
color: var(--
|
|
84
|
+
color: var(--theme-elevation-600);
|
|
85
85
|
font-weight: var(--be-weight-regular);
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -89,15 +89,15 @@
|
|
|
89
89
|
box-sizing: border-box;
|
|
90
90
|
width: 100%;
|
|
91
91
|
padding: 6px 8px;
|
|
92
|
-
border: 1px solid var(--
|
|
93
|
-
border-radius: var(--radius-
|
|
94
|
-
background: var(--
|
|
95
|
-
color: var(--
|
|
92
|
+
border: 1px solid var(--theme-elevation-150);
|
|
93
|
+
border-radius: var(--style-radius-s, 4px);
|
|
94
|
+
background: var(--theme-input-bg, var(--theme-bg));
|
|
95
|
+
color: var(--theme-text);
|
|
96
96
|
font: inherit;
|
|
97
97
|
font-size: var(--be-text-m);
|
|
98
98
|
|
|
99
99
|
&:focus {
|
|
100
|
-
border-color: var(--
|
|
100
|
+
border-color: var(--theme-elevation-400);
|
|
101
101
|
outline: none;
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -131,27 +131,27 @@
|
|
|
131
131
|
align-items: center;
|
|
132
132
|
gap: 5px;
|
|
133
133
|
padding: 3px 6px;
|
|
134
|
-
border: 1px solid var(--
|
|
135
|
-
border-radius: var(--radius-
|
|
136
|
-
background: var(--
|
|
137
|
-
color: var(--
|
|
134
|
+
border: 1px solid var(--theme-elevation-150);
|
|
135
|
+
border-radius: var(--style-radius-s, 4px);
|
|
136
|
+
background: var(--theme-bg);
|
|
137
|
+
color: var(--theme-elevation-700);
|
|
138
138
|
font: inherit;
|
|
139
139
|
font-size: var(--be-text-s);
|
|
140
140
|
font-variant-numeric: tabular-nums;
|
|
141
141
|
cursor: pointer;
|
|
142
142
|
|
|
143
143
|
&:hover:not(:disabled) {
|
|
144
|
-
border-color: var(--
|
|
144
|
+
border-color: var(--theme-elevation-300);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
&[aria-pressed='true'] {
|
|
148
|
-
border-color: var(--
|
|
149
|
-
background: color-mix(in srgb, var(--
|
|
150
|
-
color: var(--
|
|
148
|
+
border-color: var(--theme-success-500);
|
|
149
|
+
background: color-mix(in srgb, var(--theme-success-500) 12%, transparent);
|
|
150
|
+
color: var(--theme-text);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
&:focus-visible {
|
|
154
|
-
outline: 2px solid var(--
|
|
154
|
+
outline: 2px solid var(--theme-success-500);
|
|
155
155
|
outline-offset: 1px;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
.builder-generate__model {
|
|
178
178
|
overflow: hidden;
|
|
179
179
|
min-width: 0;
|
|
180
|
-
color: var(--
|
|
180
|
+
color: var(--theme-elevation-600);
|
|
181
181
|
font-size: var(--be-text-s);
|
|
182
182
|
text-overflow: ellipsis;
|
|
183
183
|
white-space: nowrap;
|
|
@@ -186,16 +186,16 @@
|
|
|
186
186
|
.builder-generate__button {
|
|
187
187
|
flex: none;
|
|
188
188
|
padding: 5px 12px;
|
|
189
|
-
border: 1px solid var(--
|
|
190
|
-
border-radius: var(--radius-
|
|
191
|
-
background: var(--
|
|
192
|
-
color: var(--
|
|
189
|
+
border: 1px solid var(--theme-elevation-200);
|
|
190
|
+
border-radius: var(--style-radius-s, 4px);
|
|
191
|
+
background: var(--theme-bg);
|
|
192
|
+
color: var(--theme-text);
|
|
193
193
|
font: inherit;
|
|
194
194
|
font-size: var(--be-text-m);
|
|
195
195
|
cursor: pointer;
|
|
196
196
|
|
|
197
197
|
&:hover:not(:disabled) {
|
|
198
|
-
border-color: var(--
|
|
198
|
+
border-color: var(--theme-elevation-400);
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
&:disabled {
|
|
@@ -205,13 +205,13 @@
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
.builder-generate__button--primary {
|
|
208
|
-
border-color: var(--
|
|
209
|
-
background: var(--
|
|
210
|
-
color: var(--
|
|
208
|
+
border-color: var(--theme-elevation-800);
|
|
209
|
+
background: var(--theme-elevation-800);
|
|
210
|
+
color: var(--theme-bg);
|
|
211
211
|
|
|
212
212
|
&:hover:not(:disabled) {
|
|
213
|
-
border-color: var(--
|
|
214
|
-
background: var(--
|
|
213
|
+
border-color: var(--theme-elevation-1000);
|
|
214
|
+
background: var(--theme-elevation-1000);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
display: inline-flex;
|
|
220
220
|
align-items: center;
|
|
221
221
|
gap: 8px;
|
|
222
|
-
color: var(--
|
|
222
|
+
color: var(--theme-elevation-700);
|
|
223
223
|
font-size: var(--be-text-m);
|
|
224
224
|
font-variant-numeric: tabular-nums;
|
|
225
225
|
}
|
|
@@ -227,15 +227,15 @@
|
|
|
227
227
|
.builder-generate__spinner {
|
|
228
228
|
width: 12px;
|
|
229
229
|
height: 12px;
|
|
230
|
-
border: 2px solid var(--
|
|
231
|
-
border-top-color: var(--
|
|
230
|
+
border: 2px solid var(--theme-elevation-200);
|
|
231
|
+
border-top-color: var(--theme-success-500);
|
|
232
232
|
border-radius: 50%;
|
|
233
233
|
animation: builder-generate-spin 0.8s linear infinite;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
.builder-generate__error {
|
|
237
237
|
margin: 0;
|
|
238
|
-
color: var(--
|
|
238
|
+
color: var(--theme-error-500);
|
|
239
239
|
font-size: var(--be-text-m);
|
|
240
240
|
line-height: 1.4;
|
|
241
241
|
}
|
|
@@ -250,14 +250,14 @@
|
|
|
250
250
|
flex: none;
|
|
251
251
|
width: 56px;
|
|
252
252
|
height: 56px;
|
|
253
|
-
border-radius: var(--radius-
|
|
253
|
+
border-radius: var(--style-radius-s, 4px);
|
|
254
254
|
object-fit: cover;
|
|
255
|
-
background: var(--
|
|
255
|
+
background: var(--theme-elevation-100);
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
.builder-generate__note {
|
|
259
259
|
margin: 0;
|
|
260
|
-
color: var(--
|
|
260
|
+
color: var(--theme-elevation-600);
|
|
261
261
|
font-size: var(--be-text-s);
|
|
262
262
|
line-height: 1.4;
|
|
263
263
|
}
|
|
@@ -18,6 +18,7 @@ declare const PATHS: {
|
|
|
18
18
|
layers: import("react").JSX.Element;
|
|
19
19
|
field: import("react").JSX.Element;
|
|
20
20
|
collectionList: import("react").JSX.Element;
|
|
21
|
+
repeat: import("react").JSX.Element;
|
|
21
22
|
bind: import("react").JSX.Element;
|
|
22
23
|
template: import("react").JSX.Element;
|
|
23
24
|
calendar: import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
const dot = (cx, cy, r = 0.9) => _jsx("circle", { cx: cx, cy: cy, r: r, fill: "currentColor", stroke: "none" });
|
|
4
4
|
const PATHS = {
|
|
5
5
|
// Blocks
|
|
@@ -23,6 +23,8 @@ const PATHS = {
|
|
|
23
23
|
// Dynamic blocks (templates and binding)
|
|
24
24
|
field: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M5.5 2.5H5A1.5 1.5 0 0 0 3.5 4v2.25L2.25 8 3.5 9.75V12A1.5 1.5 0 0 0 5 13.5h.5" }), _jsx("path", { d: "M10.5 2.5h.5A1.5 1.5 0 0 1 12.5 4v2.25L13.75 8 12.5 9.75V12a1.5 1.5 0 0 1-1.5 1.5h-.5" }), _jsx("path", { d: "M6.5 8h3" })] })),
|
|
25
25
|
collectionList: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "2", y: "2", width: "12", height: "5", rx: "1" }), _jsx("rect", { x: "2", y: "9", width: "12", height: "5", rx: "1", opacity: 0.45 }), _jsx("path", { d: "M4.5 4.5h4" }), _jsx("path", { d: "M4.5 11.5h4", opacity: 0.45 })] })),
|
|
26
|
+
// Rows of one field: braces (a field) around repeated lines.
|
|
27
|
+
repeat: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M5 2.5h-.5A1.5 1.5 0 0 0 3 4v8a1.5 1.5 0 0 0 1.5 1.5H5" }), _jsx("path", { d: "M11 2.5h.5A1.5 1.5 0 0 1 13 4v8a1.5 1.5 0 0 1-1.5 1.5H11" }), _jsx("path", { d: "M6 5.5h4" }), _jsx("path", { d: "M6 8h4", opacity: 0.6 }), _jsx("path", { d: "M6 10.5h4", opacity: 0.35 })] })),
|
|
26
28
|
bind: (_jsxs(_Fragment, { children: [_jsx("ellipse", { cx: "8", cy: "3.75", rx: "5", ry: "1.75" }), _jsx("path", { d: "M3 3.75v8.5c0 .97 2.24 1.75 5 1.75s5-.78 5-1.75v-8.5M3 8c0 .97 2.24 1.75 5 1.75S13 8.97 13 8" })] })),
|
|
27
29
|
template: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "2", y: "2", width: "12", height: "12", rx: "1.5", strokeDasharray: "2 1.6" }), _jsx("path", { d: "M5 5.5h6M5 8h3.5" })] })),
|
|
28
30
|
calendar: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "2", y: "3", width: "12", height: "11", rx: "1.5" }), _jsx("path", { d: "M2 6.5h12M5.25 1.75v2.5M10.75 1.75v2.5" })] })),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
/* oxlint-disable jsx-a11y/prefer-tag-over-role, jsx-a11y/click-events-have-key-events -- a combobox: the search input keeps the focus and handles the keys (arrows, Enter, Escape) for the listbox, which a native select cannot do */
|
|
4
4
|
// The canvas "+" button: on the edge between blocks next to the pointer, or inside an empty slot.
|
|
5
5
|
// A click opens a small picker (blocks and sections that fit there, searchable, keyboard
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
// Handles on the left and right edge of the canvas frame (Webflow-style). Drag one to resize the
|
|
4
4
|
// frame: it stays centered, so both edges move. Shift snaps to breakpoint and device widths. A
|
|
5
5
|
// double-click (or Enter) goes back to the device the drag started from, else to fluid.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
// The left sidebar: three tabs at the top (Layers, Blocks, Sections), each panel full height.
|
|
4
4
|
// Panels stay mounted once opened and hide with the `hidden` attribute: a library item that is
|
|
5
5
|
// being dragged must stay mounted (dnd-kit tracks its node) when the tab changes mid-drag.
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
// A drag rests on the tab: it opens in a moment.
|
|
94
94
|
.builder-editor__segment[data-drag-over] {
|
|
95
95
|
background: var(--be-accent-soft);
|
|
96
|
-
color: var(--
|
|
96
|
+
color: var(--theme-text);
|
|
97
97
|
box-shadow: inset 0 0 0 1px var(--be-accent);
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
padding: 0;
|
|
154
154
|
border: 0;
|
|
155
155
|
border-radius: 3px;
|
|
156
|
-
background: var(--
|
|
156
|
+
background: var(--theme-elevation-300);
|
|
157
157
|
cursor: ew-resize;
|
|
158
158
|
touch-action: none;
|
|
159
159
|
transform: translateY(-50%);
|
|
@@ -201,8 +201,8 @@
|
|
|
201
201
|
left: 50%;
|
|
202
202
|
padding: 4px 10px;
|
|
203
203
|
border-radius: 12px;
|
|
204
|
-
background: var(--
|
|
205
|
-
color: var(--
|
|
204
|
+
background: var(--theme-elevation-900);
|
|
205
|
+
color: var(--theme-elevation-0);
|
|
206
206
|
font-size: var(--be-text-s);
|
|
207
207
|
font-weight: var(--be-weight-medium);
|
|
208
208
|
font-variant-numeric: tabular-nums;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
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
5
|
// Admin code: Payload CSS variables and SCSS only (editor.scss, "Multiplayer" section).
|
|
@@ -17,7 +17,7 @@ export declare function LocaleFieldFrame({ path, name, children }: {
|
|
|
17
17
|
path: string;
|
|
18
18
|
name: string;
|
|
19
19
|
children: ReactNode;
|
|
20
|
-
}): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean |
|
|
20
|
+
}): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* Above the inspector tabs. In a locale other than the default: which language you edit and what
|
|
23
23
|
* changes every language; on the Content tab, "Copy N fields from English" fills every
|
|
@@ -26,5 +26,5 @@ export declare function LocaleFieldFrame({ path, name, children }: {
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function LocaleNote({ blockId, tab }: {
|
|
28
28
|
blockId: string;
|
|
29
|
-
tab: 'content' | 'styles' | 'motion';
|
|
29
|
+
tab: 'content' | 'styles' | 'motion' | 'advanced';
|
|
30
30
|
}): import("react").JSX.Element | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
// The inspector's language marks:
|
|
4
4
|
// - `LocaleNote` above the tabs: which language you edit, what changes every language, and
|
|
5
5
|
// "Copy N fields from English" for the selected block. In the default language it shows only
|
|
@@ -163,5 +163,7 @@ export function LocaleNote({ blockId, tab }) {
|
|
|
163
163
|
? `Styles change every language, not only ${language}.`
|
|
164
164
|
: tab === 'motion'
|
|
165
165
|
? `Animations change every language, not only ${language}.`
|
|
166
|
-
:
|
|
166
|
+
: tab === 'advanced'
|
|
167
|
+
? `HTML attributes change every language, not only ${language}.`
|
|
168
|
+
: `Editing ${language}. Translated fields change ${language} only; other fields, blocks and styles change every language.` }), tab === 'content' && missing > 0 && (_jsxs("button", { type: "button", className: "builder-locale-field__action", onClick: () => copyFromDefault(runtime, blockId), children: ["Copy ", missing, " ", missing === 1 ? 'field' : 'fields', " from ", fallback] }))] })] }));
|
|
167
169
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
border: 1px solid var(--be-border);
|
|
13
13
|
border-radius: var(--be-radius);
|
|
14
14
|
background: transparent;
|
|
15
|
-
color: var(--
|
|
15
|
+
color: var(--theme-text);
|
|
16
16
|
font: inherit;
|
|
17
17
|
font-size: var(--be-text-m);
|
|
18
18
|
font-weight: var(--be-weight-strong);
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
|
|
35
35
|
// Editing another language than the default: the switcher stands out a little.
|
|
36
36
|
.builder-locale-switch--other {
|
|
37
|
-
border-color: color-mix(in srgb, var(--
|
|
38
|
-
background: color-mix(in srgb, var(--
|
|
37
|
+
border-color: color-mix(in srgb, var(--theme-warning-500, #f59e0b) 55%, transparent);
|
|
38
|
+
background: color-mix(in srgb, var(--theme-warning-500, #f59e0b) 10%, transparent);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.builder-locale-switch__code {
|
|
@@ -47,17 +47,17 @@
|
|
|
47
47
|
gap: 8px;
|
|
48
48
|
margin: 0 0 12px;
|
|
49
49
|
padding: 8px 10px;
|
|
50
|
-
border: 1px solid color-mix(in srgb, var(--
|
|
50
|
+
border: 1px solid color-mix(in srgb, var(--theme-warning-500, #f59e0b) 40%, transparent);
|
|
51
51
|
border-radius: var(--be-radius-m);
|
|
52
|
-
background: color-mix(in srgb, var(--
|
|
53
|
-
color: var(--
|
|
52
|
+
background: color-mix(in srgb, var(--theme-warning-500, #f59e0b) 8%, transparent);
|
|
53
|
+
color: var(--theme-text);
|
|
54
54
|
font-size: var(--be-text-m);
|
|
55
55
|
line-height: 1.4;
|
|
56
56
|
|
|
57
57
|
> svg {
|
|
58
58
|
flex: none;
|
|
59
59
|
margin-top: 2px;
|
|
60
|
-
color: var(--
|
|
60
|
+
color: var(--theme-warning-500, #f59e0b);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
p {
|
|
@@ -99,14 +99,14 @@
|
|
|
99
99
|
|
|
100
100
|
.builder-locale-field[data-locale-status='untranslated'] .builder-locale-field__state,
|
|
101
101
|
.builder-locale-field[data-locale-status='missing'] .builder-locale-field__state {
|
|
102
|
-
color: var(--
|
|
102
|
+
color: var(--theme-warning-500, #f59e0b);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
.builder-locale-field__action {
|
|
106
106
|
padding: 0;
|
|
107
107
|
border: 0;
|
|
108
108
|
background: none;
|
|
109
|
-
color: var(--
|
|
109
|
+
color: var(--theme-text);
|
|
110
110
|
font: inherit;
|
|
111
111
|
font-size: var(--be-text-s);
|
|
112
112
|
text-decoration: underline;
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
height: 6px;
|
|
131
131
|
margin-left: auto;
|
|
132
132
|
border-radius: 50%;
|
|
133
|
-
background: var(--
|
|
133
|
+
background: var(--theme-warning-500, #f59e0b);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
.builder-editor__row-untranslated + .builder-editor__row-problem {
|
|
@@ -144,8 +144,8 @@
|
|
|
144
144
|
bottom: -5px;
|
|
145
145
|
padding: 0 3px;
|
|
146
146
|
border-radius: 3px;
|
|
147
|
-
background: var(--
|
|
148
|
-
color: var(--
|
|
147
|
+
background: var(--theme-elevation-800);
|
|
148
|
+
color: var(--theme-elevation-0);
|
|
149
149
|
font-size: 8px;
|
|
150
150
|
font-weight: 700;
|
|
151
151
|
line-height: 11px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
// Images on the canvas, admin side: a "Replace" chip on the image under the pointer, and a media
|
|
4
4
|
// popover (double-click or a click on the chip) with Choose from library, Upload, Generate, Remove
|
|
5
5
|
// and the alt text. The chip and the image box live in the overlay (iframe coordinates); the
|