@spillway-cms/blocks 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/dist/ask.d.ts +39 -0
- package/dist/ask.js +96 -0
- package/dist/ask.js.map +1 -0
- package/dist/calendar.d.ts +42 -0
- package/dist/calendar.js +96 -0
- package/dist/calendar.js.map +1 -0
- package/dist/collection.d.ts +89 -0
- package/dist/collection.js +304 -0
- package/dist/collection.js.map +1 -0
- package/dist/config.d.ts +208 -0
- package/dist/config.js +563 -0
- package/dist/config.js.map +1 -0
- package/dist/css.d.ts +1 -0
- package/dist/css.js +600 -0
- package/dist/css.js.map +1 -0
- package/dist/docs-feedback.d.ts +34 -0
- package/dist/docs-feedback.js +57 -0
- package/dist/docs-feedback.js.map +1 -0
- package/dist/examples.d.ts +12 -0
- package/dist/examples.js +80 -0
- package/dist/examples.js.map +1 -0
- package/dist/experiment.d.ts +18 -0
- package/dist/experiment.js +20 -0
- package/dist/experiment.js.map +1 -0
- package/dist/form.d.ts +40 -0
- package/dist/form.js +252 -0
- package/dist/form.js.map +1 -0
- package/dist/gallery.d.ts +36 -0
- package/dist/gallery.js +114 -0
- package/dist/gallery.js.map +1 -0
- package/dist/image.d.ts +41 -0
- package/dist/image.js +39 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/layouts.d.ts +8 -0
- package/dist/layouts.js +81 -0
- package/dist/layouts.js.map +1 -0
- package/dist/markdown.d.ts +32 -0
- package/dist/markdown.js +283 -0
- package/dist/markdown.js.map +1 -0
- package/dist/marketing.d.ts +53 -0
- package/dist/marketing.js +184 -0
- package/dist/marketing.js.map +1 -0
- package/dist/menu.d.ts +43 -0
- package/dist/menu.js +75 -0
- package/dist/menu.js.map +1 -0
- package/dist/meta.d.ts +14 -0
- package/dist/meta.js +183 -0
- package/dist/meta.js.map +1 -0
- package/dist/module-block.d.ts +29 -0
- package/dist/module-block.js +53 -0
- package/dist/module-block.js.map +1 -0
- package/dist/personalize.d.ts +18 -0
- package/dist/personalize.js +32 -0
- package/dist/personalize.js.map +1 -0
- package/dist/registry-browse.d.ts +31 -0
- package/dist/registry-browse.js +97 -0
- package/dist/registry-browse.js.map +1 -0
- package/dist/registry-gallery.d.ts +22 -0
- package/dist/registry-gallery.js +73 -0
- package/dist/registry-gallery.js.map +1 -0
- package/dist/registry-org.d.ts +22 -0
- package/dist/registry-org.js +44 -0
- package/dist/registry-org.js.map +1 -0
- package/dist/registry-package.d.ts +27 -0
- package/dist/registry-package.js +145 -0
- package/dist/registry-package.js.map +1 -0
- package/dist/registry-publisher.d.ts +20 -0
- package/dist/registry-publisher.js +46 -0
- package/dist/registry-publisher.js.map +1 -0
- package/dist/registry-shared.d.ts +29 -0
- package/dist/registry-shared.js +122 -0
- package/dist/registry-shared.js.map +1 -0
- package/dist/registry-stats.d.ts +15 -0
- package/dist/registry-stats.js +42 -0
- package/dist/registry-stats.js.map +1 -0
- package/dist/registry-types.d.ts +218 -0
- package/dist/registry-types.js +29 -0
- package/dist/registry-types.js.map +1 -0
- package/dist/sanitize.d.ts +37 -0
- package/dist/sanitize.js +293 -0
- package/dist/sanitize.js.map +1 -0
- package/dist/search.d.ts +25 -0
- package/dist/search.js +77 -0
- package/dist/search.js.map +1 -0
- package/dist/shared.d.ts +27 -0
- package/dist/shared.js +59 -0
- package/dist/shared.js.map +1 -0
- package/dist/status-board.d.ts +49 -0
- package/dist/status-board.js +81 -0
- package/dist/status-board.js.map +1 -0
- package/dist/styles.css +1245 -0
- package/dist/styles.d.ts +37 -0
- package/dist/styles.js +242 -0
- package/dist/styles.js.map +1 -0
- package/package.json +47 -3
- package/README.md +0 -3
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
function FilterForm({ id, filters, listing, sortControl }) {
|
|
3
|
+
const sortOptions = sortControl ? (listing.sortOptions ?? []) : [];
|
|
4
|
+
const currentSort = sortOptions.find((o) => o.active);
|
|
5
|
+
return (_jsxs("form", { className: "sw-listing__form", method: "get", action: listing.action, role: "search", "aria-label": "Filter results", children: [listing.hidden.map((h) => (_jsx("input", { type: "hidden", name: h.name, value: h.value }, h.name))), _jsxs("div", { className: "sw-listing__fields", children: [filters.map((f) => {
|
|
6
|
+
const fid = `${id}-${f.field}`;
|
|
7
|
+
switch (f.kind) {
|
|
8
|
+
case 'search':
|
|
9
|
+
return (_jsxs("div", { className: "sw-listing__field sw-listing__field--search", children: [_jsx("label", { className: "sw-listing__label", htmlFor: fid, children: f.label }), _jsx("input", { id: fid, className: "sw-listing__input", type: "search", name: "q", defaultValue: listing.state.q })] }, f.field));
|
|
10
|
+
case 'select':
|
|
11
|
+
case 'taxonomy':
|
|
12
|
+
return (_jsxs("div", { className: "sw-listing__field", children: [_jsx("label", { className: "sw-listing__label", htmlFor: fid, children: f.label }), _jsxs("select", { id: fid, className: "sw-listing__input", name: f.field, defaultValue: listing.state.values[f.field] ?? '', children: [_jsx("option", { value: "", children: "All" }), (listing.options[f.field] ?? []).map((o) => (_jsx("option", { value: o.value, children: o.label }, o.value)))] })] }, f.field));
|
|
13
|
+
case 'daterange':
|
|
14
|
+
return (_jsxs("fieldset", { className: "sw-listing__field sw-listing__field--dates", children: [_jsx("legend", { className: "sw-listing__label", children: f.label }), _jsxs("div", { className: "sw-listing__dates", children: [_jsx("label", { className: "sw-listing__sublabel", htmlFor: `${fid}-from`, children: "From" }), _jsx("input", { id: `${fid}-from`, className: "sw-listing__input", type: "date", name: "from", defaultValue: listing.state.from }), _jsx("label", { className: "sw-listing__sublabel", htmlFor: `${fid}-to`, children: "To" }), _jsx("input", { id: `${fid}-to`, className: "sw-listing__input", type: "date", name: "to", defaultValue: listing.state.to })] })] }, f.field));
|
|
15
|
+
default:
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}), sortOptions.length ? (_jsxs("div", { className: "sw-listing__field", children: [_jsx("label", { className: "sw-listing__label", htmlFor: `${id}-sort`, children: "Sort by" }), _jsxs("div", { className: "sw-listing__dates", children: [_jsxs("select", { id: `${id}-sort`, className: "sw-listing__input", name: "sort", defaultValue: currentSort?.field ?? '', children: [currentSort ? null : _jsx("option", { value: "", children: "Default" }), sortOptions.map((o) => (_jsx("option", { value: o.field, children: o.label }, o.field)))] }), _jsx("label", { className: "sw-visually-hidden", htmlFor: `${id}-dir`, children: "Order" }), _jsxs("select", { id: `${id}-dir`, className: "sw-listing__input", name: "dir", defaultValue: currentSort?.dir ?? 'asc', children: [_jsx("option", { value: "asc", children: "Ascending" }), _jsx("option", { value: "desc", children: "Descending" })] })] })] })) : null, _jsxs("div", { className: "sw-listing__actions", children: [_jsx("button", { className: "sw-button sw-button--primary", type: "submit", children: "Apply" }), _jsx("a", { className: "sw-listing__reset", href: listing.action, children: "Reset" })] })] })] }));
|
|
19
|
+
}
|
|
20
|
+
function Pager({ listing }) {
|
|
21
|
+
if (listing.pages <= 1)
|
|
22
|
+
return null;
|
|
23
|
+
return (_jsxs("nav", { className: "sw-listing__pager", "aria-label": "Pagination", children: [listing.prevHref ? (_jsx("a", { href: listing.prevHref, rel: "prev", children: "\u2190 Previous" })) : (_jsx("span", { className: "sw-listing__pager-disabled", children: "\u2190 Previous" })), _jsx("ol", { className: "sw-listing__pages", children: listing.pageHrefs.map((p) => p.page === listing.page ? (_jsx("li", { children: _jsx("span", { "aria-current": "page", children: p.page }) }, p.page)) : (_jsx("li", { children: _jsx("a", { href: p.href, children: p.page }) }, p.page))) }), listing.nextHref ? (_jsx("a", { href: listing.nextHref, rel: "next", children: "Next \u2192" })) : (_jsx("span", { className: "sw-listing__pager-disabled", children: "Next \u2192" }))] }));
|
|
24
|
+
}
|
|
25
|
+
const yesNo = [
|
|
26
|
+
{ label: 'Yes', value: true },
|
|
27
|
+
{ label: 'No', value: false },
|
|
28
|
+
];
|
|
29
|
+
function cx(...parts) {
|
|
30
|
+
return parts.filter(Boolean).join(' ');
|
|
31
|
+
}
|
|
32
|
+
function formatDate(iso) {
|
|
33
|
+
const d = new Date(iso);
|
|
34
|
+
return Number.isNaN(d.getTime()) ? iso : d.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric', timeZone: 'UTC' });
|
|
35
|
+
}
|
|
36
|
+
function Item({ item, display, showDate, showSummary, titleLevel, columns }) {
|
|
37
|
+
const Title = titleLevel;
|
|
38
|
+
const lines = columns.filter((c) => c.field !== 'title' && item.cells?.[c.field]);
|
|
39
|
+
const linked = Boolean(item.path);
|
|
40
|
+
const title = linked ? _jsx("a", { href: item.path ?? '#', children: item.title }) : item.title;
|
|
41
|
+
return (_jsxs("li", { className: cx('sw-collection__item', linked && 'sw-collection__item--link'), children: [display === 'cards' && item.imageUrl ? _jsx("img", { className: "sw-collection__image", src: item.imageUrl, alt: "", loading: "lazy" }) : null, _jsxs("div", { className: "sw-collection__body", children: [_jsx(Title, { className: "sw-collection__title", children: title }), showDate && item.date ? (_jsx("time", { className: "sw-collection__date", dateTime: item.date, children: formatDate(item.date) })) : null, showSummary && item.summary && display !== 'grid' ? _jsx("p", { className: "sw-collection__summary", children: item.summary }) : null, lines.length ? (_jsx("dl", { className: "sw-collection__fields", children: lines.map((c) => (_jsxs("div", { className: "sw-collection__field", children: [_jsx("dt", { children: c.label }), _jsx("dd", { children: item.cells[c.field] })] }, c.field))) })) : null] })] }));
|
|
42
|
+
}
|
|
43
|
+
const lower = (h) => (h === 'h2' ? 'h3' : 'h4');
|
|
44
|
+
/** Consecutive items under the same group heading (one group, unnamed, when the block does not group). */
|
|
45
|
+
function groupsOf(items) {
|
|
46
|
+
const out = [];
|
|
47
|
+
for (const item of items) {
|
|
48
|
+
const label = item.group ?? null;
|
|
49
|
+
const last = out[out.length - 1];
|
|
50
|
+
if (last && last.label === label)
|
|
51
|
+
last.items.push(item);
|
|
52
|
+
else
|
|
53
|
+
out.push({ label, items: [item] });
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
function SortHeader({ column, option }) {
|
|
58
|
+
if (!option)
|
|
59
|
+
return _jsx(_Fragment, { children: column.label });
|
|
60
|
+
const next = option.active ? (option.dir === 'asc' ? 'descending' : 'ascending') : 'ascending';
|
|
61
|
+
return (_jsxs("a", { className: cx('sw-collection__sort', option.active && `sw-collection__sort--${option.dir}`), href: option.href, children: [column.label, _jsxs("span", { className: "sw-visually-hidden", children: [", sort ", next] })] }));
|
|
62
|
+
}
|
|
63
|
+
function Table({ items, columns, sortOptions, caption }) {
|
|
64
|
+
const linkField = columns.some((c) => c.field === 'title') ? 'title' : columns[0]?.field;
|
|
65
|
+
return (_jsx("div", { className: "sw-collection__table-wrap", children: _jsxs("table", { className: "sw-collection__table", children: [_jsx("caption", { className: "sw-visually-hidden", children: caption }), _jsx("thead", { children: _jsx("tr", { children: columns.map((c) => {
|
|
66
|
+
const option = sortOptions.find((o) => o.field === c.field);
|
|
67
|
+
return (_jsx("th", { scope: "col", "aria-sort": option?.active ? (option.dir === 'asc' ? 'ascending' : 'descending') : undefined, children: _jsx(SortHeader, { column: c, option: option }) }, c.field));
|
|
68
|
+
}) }) }), _jsx("tbody", { children: items.map((item) => (_jsx("tr", { children: columns.map((c) => {
|
|
69
|
+
const text = item.cells?.[c.field] ?? (c.field === 'title' ? item.title : '');
|
|
70
|
+
return _jsx("td", { children: c.field === linkField && item.path ? _jsx("a", { href: item.path, children: text || item.title }) : text }, c.field);
|
|
71
|
+
}) }, item.id + (item.occurrence?.start ?? '')))) })] }) }));
|
|
72
|
+
}
|
|
73
|
+
export const collectionComponent = {
|
|
74
|
+
label: 'Collection',
|
|
75
|
+
fields: {
|
|
76
|
+
collectionId: { type: 'text', label: 'Collection id or key', placeholder: 'latest_posts' },
|
|
77
|
+
display: {
|
|
78
|
+
type: 'select',
|
|
79
|
+
label: 'Display',
|
|
80
|
+
options: [
|
|
81
|
+
{ label: 'Cards', value: 'cards' },
|
|
82
|
+
{ label: 'List', value: 'list' },
|
|
83
|
+
{ label: 'Grid', value: 'grid' },
|
|
84
|
+
{ label: 'Table', value: 'table' },
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
columns: {
|
|
88
|
+
type: 'select',
|
|
89
|
+
label: 'Columns (cards and grid)',
|
|
90
|
+
options: [
|
|
91
|
+
{ label: '2', value: 2 },
|
|
92
|
+
{ label: '3', value: 3 },
|
|
93
|
+
{ label: '4', value: 4 },
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
showDate: { type: 'radio', label: 'Show date', options: yesNo },
|
|
97
|
+
showSummary: { type: 'radio', label: 'Show summary', options: yesNo },
|
|
98
|
+
titleLevel: {
|
|
99
|
+
type: 'radio',
|
|
100
|
+
label: 'Title level',
|
|
101
|
+
options: [
|
|
102
|
+
{ label: 'H2', value: 'h2' },
|
|
103
|
+
{ label: 'H3', value: 'h3' },
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
emptyText: { type: 'text', label: 'Text when empty' },
|
|
107
|
+
fields: {
|
|
108
|
+
type: 'array',
|
|
109
|
+
label: 'Fields to show',
|
|
110
|
+
getItemSummary: (item) => item.label || item.field || 'Field',
|
|
111
|
+
arrayFields: {
|
|
112
|
+
field: { type: 'text', label: 'Field key', placeholder: 'department, publishedAt, author' },
|
|
113
|
+
label: { type: 'text', label: 'Heading (optional)' },
|
|
114
|
+
},
|
|
115
|
+
defaultItemProps: { field: '', label: '' },
|
|
116
|
+
},
|
|
117
|
+
sortable: {
|
|
118
|
+
type: 'array',
|
|
119
|
+
label: 'Visitors can sort by',
|
|
120
|
+
getItemSummary: (item) => item.field || 'Field',
|
|
121
|
+
arrayFields: { field: { type: 'text', label: 'Field key', placeholder: 'title' } },
|
|
122
|
+
defaultItemProps: { field: '' },
|
|
123
|
+
},
|
|
124
|
+
groupBy: { type: 'text', label: 'Group by field (optional)', placeholder: 'department' },
|
|
125
|
+
exports: {
|
|
126
|
+
type: 'select',
|
|
127
|
+
label: 'Downloads',
|
|
128
|
+
options: [
|
|
129
|
+
{ label: 'None', value: 'none' },
|
|
130
|
+
{ label: 'CSV', value: 'csv' },
|
|
131
|
+
{ label: 'Excel (.xlsx)', value: 'xlsx' },
|
|
132
|
+
{ label: 'CSV and Excel', value: 'both' },
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
filters: {
|
|
136
|
+
type: 'array',
|
|
137
|
+
label: 'Visitor filters',
|
|
138
|
+
getItemSummary: (item) => item.label || item.field || 'Filter',
|
|
139
|
+
arrayFields: {
|
|
140
|
+
field: { type: 'text', label: 'Field key', placeholder: 'department' },
|
|
141
|
+
label: { type: 'text', label: 'Label' },
|
|
142
|
+
kind: {
|
|
143
|
+
type: 'select',
|
|
144
|
+
label: 'Kind',
|
|
145
|
+
options: [
|
|
146
|
+
{ label: 'Keyword search', value: 'search' },
|
|
147
|
+
{ label: 'Taxonomy term', value: 'taxonomy' },
|
|
148
|
+
{ label: 'Select (one value)', value: 'select' },
|
|
149
|
+
{ label: 'Date range', value: 'daterange' },
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
defaultItemProps: { field: '', label: '', kind: 'search' },
|
|
154
|
+
},
|
|
155
|
+
pageSize: { type: 'number', label: 'Items per page', min: 1, max: 100 },
|
|
156
|
+
showPager: { type: 'radio', label: 'Show pager', options: yesNo },
|
|
157
|
+
showResultCount: { type: 'radio', label: 'Show result count', options: yesNo },
|
|
158
|
+
},
|
|
159
|
+
defaultProps: {
|
|
160
|
+
collectionId: '',
|
|
161
|
+
display: 'cards',
|
|
162
|
+
columns: 3,
|
|
163
|
+
showDate: true,
|
|
164
|
+
showSummary: true,
|
|
165
|
+
titleLevel: 'h3',
|
|
166
|
+
emptyText: 'Nothing here yet.',
|
|
167
|
+
fields: [],
|
|
168
|
+
sortable: [],
|
|
169
|
+
groupBy: '',
|
|
170
|
+
exports: 'none',
|
|
171
|
+
filters: [],
|
|
172
|
+
pageSize: 12,
|
|
173
|
+
showPager: false,
|
|
174
|
+
showResultCount: false,
|
|
175
|
+
},
|
|
176
|
+
render: (props) => renderCollection(props),
|
|
177
|
+
};
|
|
178
|
+
function renderCollection({ id, collectionId, display, columns, showDate, showSummary, titleLevel, emptyText, filters, showPager, showResultCount, items, listing, fieldColumns, exportHrefs }) {
|
|
179
|
+
const mode = display ?? 'cards';
|
|
180
|
+
const cols = mode === 'list' || mode === 'table' ? 1 : (columns ?? 3);
|
|
181
|
+
const exposed = Array.isArray(filters) ? filters : [];
|
|
182
|
+
const shown = Array.isArray(fieldColumns) ? fieldColumns : [];
|
|
183
|
+
const sortOptions = listing?.sortOptions ?? [];
|
|
184
|
+
// A table sorts from its headers; the other displays get a Sort by control in the form.
|
|
185
|
+
const sortControl = mode !== 'table' && sortOptions.length > 0;
|
|
186
|
+
const formId = `sw-listing-${String(id ?? collectionId ?? 'x').replace(/[^a-zA-Z0-9_-]/g, '')}`;
|
|
187
|
+
const top = titleLevel === 'h2' ? 'h2' : 'h3';
|
|
188
|
+
const groups = Array.isArray(items) ? groupsOf(items) : [];
|
|
189
|
+
const grouped = groups.some((g) => g.label !== null);
|
|
190
|
+
const itemLevel = grouped ? lower(top) : top;
|
|
191
|
+
const GroupHeading = top;
|
|
192
|
+
const body = (list) => mode === 'table' ? (_jsx(Table, { items: list, columns: shown.length ? shown : [{ field: 'title', label: 'Title' }], sortOptions: sortOptions, caption: `${collectionId} items` })) : (_jsx("ul", { className: "sw-collection__list", children: list.map((item) => (_jsx(Item, { item: item, display: mode, showDate: showDate !== false, showSummary: showSummary !== false, titleLevel: itemLevel, columns: shown }, item.id + (item.occurrence?.start ?? '')))) }));
|
|
193
|
+
return (_jsx("section", { className: cx('sw-block', 'sw-collection', `sw-collection--${mode}`, `sw-collection--cols-${cols}`, exposed.length > 0 && 'sw-collection--filtered'), "data-collection": collectionId || undefined, children: _jsxs("div", { className: "sw-container", children: [listing && (exposed.length > 0 || sortControl) ? _jsx(FilterForm, { id: formId, filters: exposed, listing: listing, sortControl: sortControl }) : null, listing && showResultCount !== false && Array.isArray(items) ? (_jsx("p", { className: "sw-listing__count", role: "status", children: (listing.total === 0 ? 'No results' : `${listing.total} result${listing.total === 1 ? '' : 's'}`) + (listing.pages > 1 ? ` · page ${listing.page} of ${listing.pages}` : '') })) : null, !Array.isArray(items) ? (_jsxs("div", { className: "sw-collection__placeholder", role: "note", children: ["Collection: ", collectionId || '(none selected)', " (resolved when published)"] })) : items.length === 0 ? (_jsx("p", { className: "sw-collection__empty", children: emptyText })) : grouped ? (groups.map((g, i) => (_jsxs("div", { className: "sw-collection__group", children: [_jsx(GroupHeading, { className: "sw-collection__group-title", children: g.label }), body(g.items)] }, `${g.label}-${i}`)))) : (body(items)), listing && showPager !== false ? _jsx(Pager, { listing: listing }) : null, exportHrefs && (exportHrefs.csv || exportHrefs.xlsx) && Array.isArray(items) && items.length > 0 ? (_jsxs("p", { className: "sw-collection__exports", children: ["Download:", ' ', exportHrefs.csv ? (_jsx("a", { href: exportHrefs.csv, download: true, children: "CSV" })) : null, exportHrefs.csv && exportHrefs.xlsx ? ' ' : null, exportHrefs.xlsx ? (_jsx("a", { href: exportHrefs.xlsx, download: true, children: "Excel (.xlsx)" })) : null] })) : null] }) }));
|
|
194
|
+
}
|
|
195
|
+
export const collectionCss = `/* ---------- Collection ---------- */
|
|
196
|
+
|
|
197
|
+
.sw-collection__list {
|
|
198
|
+
display: grid;
|
|
199
|
+
gap: var(--sw-space-3);
|
|
200
|
+
grid-template-columns: 1fr;
|
|
201
|
+
list-style: none;
|
|
202
|
+
margin: 0;
|
|
203
|
+
padding: 0;
|
|
204
|
+
}
|
|
205
|
+
@media (min-width: 640px) {
|
|
206
|
+
.sw-collection--cards .sw-collection__list,
|
|
207
|
+
.sw-collection--grid .sw-collection__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
208
|
+
}
|
|
209
|
+
@media (min-width: 900px) {
|
|
210
|
+
.sw-collection--cols-3 .sw-collection__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
211
|
+
.sw-collection--cols-4 .sw-collection__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
212
|
+
}
|
|
213
|
+
.sw-collection--list .sw-collection__list { gap: 0; }
|
|
214
|
+
.sw-collection__item {
|
|
215
|
+
display: flex;
|
|
216
|
+
flex-direction: column;
|
|
217
|
+
overflow: hidden;
|
|
218
|
+
}
|
|
219
|
+
.sw-collection--cards .sw-collection__item,
|
|
220
|
+
.sw-collection--grid .sw-collection__item {
|
|
221
|
+
border: 1px solid var(--sw-color-border);
|
|
222
|
+
border-radius: var(--sw-radius, 8px);
|
|
223
|
+
background: var(--sw-color-bg, #ffffff);
|
|
224
|
+
}
|
|
225
|
+
.sw-collection--list .sw-collection__item {
|
|
226
|
+
padding: var(--sw-space-2) 0;
|
|
227
|
+
border-top: 1px solid var(--sw-color-border);
|
|
228
|
+
}
|
|
229
|
+
.sw-collection--list .sw-collection__item:last-child { border-bottom: 1px solid var(--sw-color-border); }
|
|
230
|
+
.sw-collection__image {
|
|
231
|
+
display: block;
|
|
232
|
+
width: 100%;
|
|
233
|
+
aspect-ratio: 16 / 9;
|
|
234
|
+
object-fit: cover;
|
|
235
|
+
}
|
|
236
|
+
.sw-collection__body {
|
|
237
|
+
display: flex;
|
|
238
|
+
flex-direction: column;
|
|
239
|
+
gap: var(--sw-space-1);
|
|
240
|
+
}
|
|
241
|
+
.sw-collection--cards .sw-collection__body,
|
|
242
|
+
.sw-collection--grid .sw-collection__body { padding: var(--sw-space-3); }
|
|
243
|
+
.sw-collection--grid .sw-collection__body { padding: var(--sw-space-2); }
|
|
244
|
+
.sw-collection__title { margin: 0; font-size: 1.2rem; }
|
|
245
|
+
.sw-collection--grid .sw-collection__title { font-size: 1rem; }
|
|
246
|
+
.sw-collection__title a { color: inherit; text-decoration: none; }
|
|
247
|
+
.sw-collection__item--link { position: relative; transition: border-color 120ms ease; }
|
|
248
|
+
.sw-collection__item--link .sw-collection__title a::after { content: ""; position: absolute; inset: 0; }
|
|
249
|
+
.sw-collection--cards .sw-collection__item--link:hover,
|
|
250
|
+
.sw-collection--grid .sw-collection__item--link:hover { border-color: var(--sw-color-primary, #1d4ed8); }
|
|
251
|
+
.sw-collection__item--link:focus-within { box-shadow: var(--sw-focus-ring); }
|
|
252
|
+
.sw-collection__date { font-size: 0.875rem; color: var(--sw-color-muted); }
|
|
253
|
+
.sw-collection__summary { margin: 0; max-width: 36em; color: var(--sw-color-muted); }
|
|
254
|
+
.sw-collection__empty { color: var(--sw-color-muted); }
|
|
255
|
+
.sw-collection__placeholder {
|
|
256
|
+
padding: var(--sw-space-3);
|
|
257
|
+
border: 1px dashed var(--sw-color-border);
|
|
258
|
+
border-radius: var(--sw-radius, 8px);
|
|
259
|
+
background: var(--sw-color-surface);
|
|
260
|
+
color: var(--sw-color-muted);
|
|
261
|
+
font-size: 0.9rem;
|
|
262
|
+
text-align: center;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* Exposed filters and pager */
|
|
266
|
+
.sw-listing__form { margin-bottom: var(--sw-space-3); }
|
|
267
|
+
.sw-listing__fields { display: flex; flex-wrap: wrap; gap: var(--sw-space-2); align-items: flex-end; }
|
|
268
|
+
.sw-listing__field { display: flex; flex-direction: column; gap: 4px; min-width: 10rem; border: 0; margin: 0; padding: 0; }
|
|
269
|
+
.sw-listing__field--search { flex: 1 1 14rem; }
|
|
270
|
+
.sw-listing__label { font-size: 0.85rem; font-weight: 600; }
|
|
271
|
+
.sw-listing__sublabel { font-size: 0.8rem; color: var(--sw-color-muted); }
|
|
272
|
+
.sw-listing__dates { display: flex; flex-wrap: wrap; gap: var(--sw-space-1); align-items: center; }
|
|
273
|
+
.sw-listing__input { font: inherit; padding: 0.5rem 0.65rem; border: 1px solid var(--sw-color-border); border-radius: var(--sw-radius, 8px); background: var(--sw-color-bg, #fff); color: inherit; min-width: 0; }
|
|
274
|
+
.sw-listing__input:focus { outline: none; box-shadow: var(--sw-focus-ring); }
|
|
275
|
+
.sw-listing__actions { display: flex; gap: var(--sw-space-2); align-items: center; }
|
|
276
|
+
.sw-listing__reset { font-size: 0.9rem; }
|
|
277
|
+
.sw-listing__count { margin: 0 0 var(--sw-space-2); color: var(--sw-color-muted); font-size: 0.9rem; }
|
|
278
|
+
.sw-listing__pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sw-space-2); margin-top: var(--sw-space-3); flex-wrap: wrap; }
|
|
279
|
+
.sw-listing__pages { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
|
|
280
|
+
.sw-listing__pages a, .sw-listing__pages span { display: inline-block; min-width: 2rem; padding: 0.25rem 0.5rem; text-align: center; border-radius: var(--sw-radius, 8px); text-decoration: none; }
|
|
281
|
+
.sw-listing__pages span[aria-current] { background: var(--sw-color-primary, #1d4ed8); color: var(--sw-color-primary-contrast, #fff); }
|
|
282
|
+
.sw-listing__pager-disabled { color: var(--sw-color-muted); }
|
|
283
|
+
|
|
284
|
+
/* Fields, table, groups and downloads (Collections level 2) */
|
|
285
|
+
.sw-collection__fields { display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--sw-space-2); margin: var(--sw-space-1) 0 0; font-size: 0.9rem; }
|
|
286
|
+
.sw-collection__field { display: contents; }
|
|
287
|
+
.sw-collection__fields dt { color: var(--sw-color-muted); }
|
|
288
|
+
.sw-collection__fields dd { margin: 0; }
|
|
289
|
+
.sw-collection__table-wrap { overflow-x: auto; }
|
|
290
|
+
.sw-collection__table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
|
|
291
|
+
.sw-collection__table th, .sw-collection__table td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--sw-color-border); }
|
|
292
|
+
.sw-collection__table th { font-weight: 600; white-space: nowrap; }
|
|
293
|
+
.sw-collection__sort { color: inherit; text-decoration: none; }
|
|
294
|
+
.sw-collection__sort:hover, .sw-collection__sort:focus-visible { text-decoration: underline; }
|
|
295
|
+
.sw-collection__sort::after { content: "\\2195"; margin-left: 0.35em; color: var(--sw-color-muted); font-size: 0.85em; }
|
|
296
|
+
.sw-collection__sort--asc::after { content: "\\2191"; color: inherit; }
|
|
297
|
+
.sw-collection__sort--desc::after { content: "\\2193"; color: inherit; }
|
|
298
|
+
.sw-collection__group + .sw-collection__group { margin-top: var(--sw-space-4); }
|
|
299
|
+
.sw-collection__group-title { margin: 0 0 var(--sw-space-2); font-size: 1.25rem; }
|
|
300
|
+
.sw-collection__exports { margin: var(--sw-space-3) 0 0; font-size: 0.9rem; color: var(--sw-color-muted); }
|
|
301
|
+
.sw-collection__exports a { margin-right: var(--sw-space-2); }
|
|
302
|
+
.sw-collection .sw-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
|
|
303
|
+
`;
|
|
304
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../src/collection.tsx"],"names":[],"mappings":";AA6DA,SAAS,UAAU,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAwF;IAC7I,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACtD,OAAO,CACL,gBAAM,SAAS,EAAC,kBAAkB,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAC,QAAQ,gBAAY,gBAAgB,aAC9G,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACzB,gBAAoB,IAAI,EAAC,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 -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The core block library as a Puck `Config`.
|
|
3
|
+
*
|
|
4
|
+
* Every `render` function here is server-safe: no hooks, no `window` or
|
|
5
|
+
* `document`, no client-only imports. The server renders pages with
|
|
6
|
+
* `Render` from `@puckeditor/core/rsc`; the admin uses the same config inside
|
|
7
|
+
* the Puck editor.
|
|
8
|
+
*
|
|
9
|
+
* Slots (Puck 0.24): slot content is stored inside the parent's props and
|
|
10
|
+
* arrives in `render` as a component, e.g. `column.content` in Columns.
|
|
11
|
+
*/
|
|
12
|
+
import type { Config, Slot } from '@puckeditor/core';
|
|
13
|
+
import { type CalendarProps } from './calendar.js';
|
|
14
|
+
import { type CollectionProps } from './collection.js';
|
|
15
|
+
import { type FormProps } from './form.js';
|
|
16
|
+
import { type ResolvedMedia } from './image.js';
|
|
17
|
+
import { type SharedProps } from './shared.js';
|
|
18
|
+
import { type PersonalizeProps } from './personalize.js';
|
|
19
|
+
import { type ExperimentProps } from './experiment.js';
|
|
20
|
+
import { type RegistryBrowseProps } from './registry-browse.js';
|
|
21
|
+
import { type RegistryPackageProps } from './registry-package.js';
|
|
22
|
+
import { type GalleryProps } from './gallery.js';
|
|
23
|
+
import { type FaqProps, type LogoStripProps, type StatsProps, type TestimonialsProps } from './marketing.js';
|
|
24
|
+
import { type SearchProps } from './search.js';
|
|
25
|
+
import { type AskProps } from './ask.js';
|
|
26
|
+
import { type MenuBlockProps } from './menu.js';
|
|
27
|
+
import { type RegistryStatsProps } from './registry-stats.js';
|
|
28
|
+
import { type StatusBoardProps } from './status-board.js';
|
|
29
|
+
import { type ThemeGalleryProps } from './registry-gallery.js';
|
|
30
|
+
import { type PublisherProfileProps } from './registry-publisher.js';
|
|
31
|
+
import { type OrgProfileProps } from './registry-org.js';
|
|
32
|
+
import { type DocsFeedbackProps } from './docs-feedback.js';
|
|
33
|
+
import { type ModuleBlockProps } from './module-block.js';
|
|
34
|
+
export type Align = 'left' | 'center';
|
|
35
|
+
export type TextAlign = 'left' | 'center' | 'right';
|
|
36
|
+
export interface HeroProps {
|
|
37
|
+
eyebrow: string;
|
|
38
|
+
title: string;
|
|
39
|
+
subtitle: string;
|
|
40
|
+
primaryLabel: string;
|
|
41
|
+
primaryHref: string;
|
|
42
|
+
secondaryLabel: string;
|
|
43
|
+
secondaryHref: string;
|
|
44
|
+
backgroundImage: string;
|
|
45
|
+
align: Align;
|
|
46
|
+
size: 'default' | 'large';
|
|
47
|
+
/** The block style's key (Brand → Styles), e.g. "dark-band"; empty means the site's default Hero style. */
|
|
48
|
+
style?: string;
|
|
49
|
+
/** Resolved by the server from `backgroundImage` when it is a library image; never stored. */
|
|
50
|
+
backgroundMedia?: ResolvedMedia | null;
|
|
51
|
+
}
|
|
52
|
+
export interface HeadingProps {
|
|
53
|
+
text: string;
|
|
54
|
+
level: 'h1' | 'h2' | 'h3' | 'h4';
|
|
55
|
+
align: TextAlign;
|
|
56
|
+
/** The block style's key; empty means the site's default Heading style. */
|
|
57
|
+
style?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface TextProps {
|
|
60
|
+
/** HTML (or plain paragraphs). On the page builder canvas only, the rich text editor Puck renders in place. */
|
|
61
|
+
content: string;
|
|
62
|
+
format: 'paragraphs' | 'html';
|
|
63
|
+
/** How the page builder edits the HTML: the visual editor or the markup. Builder state only; rendering ignores it. */
|
|
64
|
+
editor?: 'visual' | 'html';
|
|
65
|
+
size: 'normal' | 'lead';
|
|
66
|
+
align: TextAlign;
|
|
67
|
+
/** The block style's key; empty means the site's default Text style. */
|
|
68
|
+
style?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface ImageProps {
|
|
71
|
+
src: string;
|
|
72
|
+
alt: string;
|
|
73
|
+
caption: string;
|
|
74
|
+
width: 'full' | 'wide' | 'normal';
|
|
75
|
+
rounded: boolean;
|
|
76
|
+
/** Resolved by the server from `src` when it is a library image; never stored. */
|
|
77
|
+
media?: ResolvedMedia | null;
|
|
78
|
+
}
|
|
79
|
+
export interface ColumnsProps {
|
|
80
|
+
columns: {
|
|
81
|
+
content: Slot;
|
|
82
|
+
}[];
|
|
83
|
+
gap: 's' | 'normal' | 'l';
|
|
84
|
+
/** With two columns: equal widths, the first twice as wide (wide-left, 2:1) or the second (wide-right, 1:2). Three and four columns are always equal. */
|
|
85
|
+
ratio?: 'equal' | 'wide-left' | 'wide-right';
|
|
86
|
+
/** How columns of different heights line up. */
|
|
87
|
+
valign?: 'top' | 'center' | 'bottom';
|
|
88
|
+
}
|
|
89
|
+
/** A band that holds other blocks: a background and a width for everything inside it. Each block keeps its own alignment. */
|
|
90
|
+
export interface SectionProps {
|
|
91
|
+
content: Slot;
|
|
92
|
+
background: 'none' | 'surface' | 'primary' | 'secondary' | 'dark';
|
|
93
|
+
width: 'narrow' | 'normal' | 'wide';
|
|
94
|
+
}
|
|
95
|
+
export interface ButtonsItem {
|
|
96
|
+
label: string;
|
|
97
|
+
href: string;
|
|
98
|
+
emphasis: 'primary' | 'secondary' | 'link';
|
|
99
|
+
newTab?: boolean;
|
|
100
|
+
}
|
|
101
|
+
/** One to four buttons in a row that wraps on small screens. */
|
|
102
|
+
export interface ButtonsProps {
|
|
103
|
+
buttons: ButtonsItem[];
|
|
104
|
+
align: TextAlign;
|
|
105
|
+
}
|
|
106
|
+
/** Space above and below a block, in steps of the theme's spacing scale; "auto" keeps the page's own rhythm. */
|
|
107
|
+
export type SpaceStep = 'auto' | 'none' | 's' | 'm' | 'l' | 'xl';
|
|
108
|
+
export interface BlockSpacing {
|
|
109
|
+
spaceAbove?: SpaceStep;
|
|
110
|
+
spaceBelow?: SpaceStep;
|
|
111
|
+
}
|
|
112
|
+
export interface CallToActionProps {
|
|
113
|
+
title: string;
|
|
114
|
+
text: string;
|
|
115
|
+
buttonLabel: string;
|
|
116
|
+
buttonHref: string;
|
|
117
|
+
/** The block style's key: the built-in "band" and "card" (the two looks this prop held before styles), "dark-band" or one the site added. */
|
|
118
|
+
style?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface CardItem {
|
|
121
|
+
title: string;
|
|
122
|
+
text: string;
|
|
123
|
+
href: string;
|
|
124
|
+
imageUrl: string;
|
|
125
|
+
}
|
|
126
|
+
export interface CardsProps {
|
|
127
|
+
cards: CardItem[];
|
|
128
|
+
columns: 2 | 3 | 4;
|
|
129
|
+
/** The heading level of each card's title: h2 when no heading sits above the cards (straight under the page's h1), so the outline does not skip a level. */
|
|
130
|
+
titleLevel?: 'h2' | 'h3';
|
|
131
|
+
/** The block style's key; empty means the site's default Cards style. */
|
|
132
|
+
style?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface SpacerProps {
|
|
135
|
+
size: 's' | 'm' | 'l' | 'xl';
|
|
136
|
+
}
|
|
137
|
+
export interface DividerProps {
|
|
138
|
+
width: 'normal' | 'narrow';
|
|
139
|
+
}
|
|
140
|
+
export interface EmbedProps {
|
|
141
|
+
html: string;
|
|
142
|
+
caption: string;
|
|
143
|
+
/** Hosts the iframe may point at; the server resolves it from SiteSettings.embedAllowedHosts, the editor preview uses the default list. Never stored. */
|
|
144
|
+
allowedHosts?: readonly string[];
|
|
145
|
+
/** The site asks for consent (privacy.consentMode 'banner'): the iframe waits for it. Set by the server; never stored. */
|
|
146
|
+
consent?: boolean;
|
|
147
|
+
}
|
|
148
|
+
export interface ButtonProps {
|
|
149
|
+
label: string;
|
|
150
|
+
href: string;
|
|
151
|
+
/** Kept for pages saved before styles: a Button with no style and variant "secondary" renders with the "secondary" style. */
|
|
152
|
+
variant?: 'primary' | 'secondary';
|
|
153
|
+
align: TextAlign;
|
|
154
|
+
/** The block style's key; empty means the site's default Button style. */
|
|
155
|
+
style?: string;
|
|
156
|
+
}
|
|
157
|
+
export interface RootProps {
|
|
158
|
+
title: string;
|
|
159
|
+
}
|
|
160
|
+
export type BlockProps = {
|
|
161
|
+
Hero: HeroProps;
|
|
162
|
+
Heading: HeadingProps;
|
|
163
|
+
Text: TextProps;
|
|
164
|
+
Image: ImageProps;
|
|
165
|
+
Gallery: GalleryProps;
|
|
166
|
+
Search: SearchProps;
|
|
167
|
+
Ask: AskProps;
|
|
168
|
+
Menu: MenuBlockProps;
|
|
169
|
+
Columns: ColumnsProps;
|
|
170
|
+
Section: SectionProps;
|
|
171
|
+
Buttons: ButtonsProps;
|
|
172
|
+
CallToAction: CallToActionProps;
|
|
173
|
+
Cards: CardsProps;
|
|
174
|
+
Faq: FaqProps;
|
|
175
|
+
Testimonials: TestimonialsProps;
|
|
176
|
+
Stats: StatsProps;
|
|
177
|
+
LogoStrip: LogoStripProps;
|
|
178
|
+
Spacer: SpacerProps;
|
|
179
|
+
Divider: DividerProps;
|
|
180
|
+
Embed: EmbedProps;
|
|
181
|
+
Button: ButtonProps;
|
|
182
|
+
Collection: CollectionProps;
|
|
183
|
+
Calendar: CalendarProps;
|
|
184
|
+
Form: FormProps;
|
|
185
|
+
Shared: SharedProps;
|
|
186
|
+
Personalize: PersonalizeProps;
|
|
187
|
+
Experiment: ExperimentProps;
|
|
188
|
+
RegistryBrowse: RegistryBrowseProps;
|
|
189
|
+
RegistryPackage: RegistryPackageProps;
|
|
190
|
+
RegistryStats: RegistryStatsProps;
|
|
191
|
+
ThemeGallery: ThemeGalleryProps;
|
|
192
|
+
PublisherProfile: PublisherProfileProps;
|
|
193
|
+
OrgProfile: OrgProfileProps;
|
|
194
|
+
DocsFeedback: DocsFeedbackProps;
|
|
195
|
+
StatusBoard: StatusBoardProps;
|
|
196
|
+
ModuleBlock: ModuleBlockProps;
|
|
197
|
+
};
|
|
198
|
+
export type BlockName = keyof BlockProps;
|
|
199
|
+
export type BlockCategory = 'layout' | 'content' | 'marketing' | 'docs' | 'registry' | 'advanced' | 'modules';
|
|
200
|
+
export type BlocksConfig = Config<{
|
|
201
|
+
components: BlockProps;
|
|
202
|
+
root: RootProps;
|
|
203
|
+
categories: ['layout', 'content', 'marketing', 'docs', 'registry', 'advanced', 'modules'];
|
|
204
|
+
}>;
|
|
205
|
+
export declare const config: BlocksConfig;
|
|
206
|
+
export declare const SPACED_BLOCKS: readonly ["Section", "Columns", "Divider", "Heading", "Text", "Image", "Gallery", "Search", "Ask", "Embed", "Button", "Buttons", "Hero", "CallToAction", "Cards", "Faq", "Testimonials", "Stats", "LogoStrip", "Collection", "Calendar", "Form"];
|
|
207
|
+
/** The classes for a block's Space above and Space below; unknown values are ignored. */
|
|
208
|
+
export declare function spacingClasses(props: BlockSpacing | undefined): string;
|