@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.
Files changed (100) hide show
  1. package/LICENSE +21 -0
  2. package/dist/ask.d.ts +39 -0
  3. package/dist/ask.js +96 -0
  4. package/dist/ask.js.map +1 -0
  5. package/dist/calendar.d.ts +42 -0
  6. package/dist/calendar.js +96 -0
  7. package/dist/calendar.js.map +1 -0
  8. package/dist/collection.d.ts +89 -0
  9. package/dist/collection.js +304 -0
  10. package/dist/collection.js.map +1 -0
  11. package/dist/config.d.ts +208 -0
  12. package/dist/config.js +563 -0
  13. package/dist/config.js.map +1 -0
  14. package/dist/css.d.ts +1 -0
  15. package/dist/css.js +600 -0
  16. package/dist/css.js.map +1 -0
  17. package/dist/docs-feedback.d.ts +34 -0
  18. package/dist/docs-feedback.js +57 -0
  19. package/dist/docs-feedback.js.map +1 -0
  20. package/dist/examples.d.ts +12 -0
  21. package/dist/examples.js +80 -0
  22. package/dist/examples.js.map +1 -0
  23. package/dist/experiment.d.ts +18 -0
  24. package/dist/experiment.js +20 -0
  25. package/dist/experiment.js.map +1 -0
  26. package/dist/form.d.ts +40 -0
  27. package/dist/form.js +252 -0
  28. package/dist/form.js.map +1 -0
  29. package/dist/gallery.d.ts +36 -0
  30. package/dist/gallery.js +114 -0
  31. package/dist/gallery.js.map +1 -0
  32. package/dist/image.d.ts +41 -0
  33. package/dist/image.js +39 -0
  34. package/dist/image.js.map +1 -0
  35. package/dist/index.d.ts +49 -0
  36. package/dist/index.js +28 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/layouts.d.ts +8 -0
  39. package/dist/layouts.js +81 -0
  40. package/dist/layouts.js.map +1 -0
  41. package/dist/markdown.d.ts +32 -0
  42. package/dist/markdown.js +283 -0
  43. package/dist/markdown.js.map +1 -0
  44. package/dist/marketing.d.ts +53 -0
  45. package/dist/marketing.js +184 -0
  46. package/dist/marketing.js.map +1 -0
  47. package/dist/menu.d.ts +43 -0
  48. package/dist/menu.js +75 -0
  49. package/dist/menu.js.map +1 -0
  50. package/dist/meta.d.ts +14 -0
  51. package/dist/meta.js +183 -0
  52. package/dist/meta.js.map +1 -0
  53. package/dist/module-block.d.ts +29 -0
  54. package/dist/module-block.js +53 -0
  55. package/dist/module-block.js.map +1 -0
  56. package/dist/personalize.d.ts +18 -0
  57. package/dist/personalize.js +32 -0
  58. package/dist/personalize.js.map +1 -0
  59. package/dist/registry-browse.d.ts +31 -0
  60. package/dist/registry-browse.js +97 -0
  61. package/dist/registry-browse.js.map +1 -0
  62. package/dist/registry-gallery.d.ts +22 -0
  63. package/dist/registry-gallery.js +73 -0
  64. package/dist/registry-gallery.js.map +1 -0
  65. package/dist/registry-org.d.ts +22 -0
  66. package/dist/registry-org.js +44 -0
  67. package/dist/registry-org.js.map +1 -0
  68. package/dist/registry-package.d.ts +27 -0
  69. package/dist/registry-package.js +145 -0
  70. package/dist/registry-package.js.map +1 -0
  71. package/dist/registry-publisher.d.ts +20 -0
  72. package/dist/registry-publisher.js +46 -0
  73. package/dist/registry-publisher.js.map +1 -0
  74. package/dist/registry-shared.d.ts +29 -0
  75. package/dist/registry-shared.js +122 -0
  76. package/dist/registry-shared.js.map +1 -0
  77. package/dist/registry-stats.d.ts +15 -0
  78. package/dist/registry-stats.js +42 -0
  79. package/dist/registry-stats.js.map +1 -0
  80. package/dist/registry-types.d.ts +218 -0
  81. package/dist/registry-types.js +29 -0
  82. package/dist/registry-types.js.map +1 -0
  83. package/dist/sanitize.d.ts +37 -0
  84. package/dist/sanitize.js +293 -0
  85. package/dist/sanitize.js.map +1 -0
  86. package/dist/search.d.ts +25 -0
  87. package/dist/search.js +77 -0
  88. package/dist/search.js.map +1 -0
  89. package/dist/shared.d.ts +27 -0
  90. package/dist/shared.js +59 -0
  91. package/dist/shared.js.map +1 -0
  92. package/dist/status-board.d.ts +49 -0
  93. package/dist/status-board.js +81 -0
  94. package/dist/status-board.js.map +1 -0
  95. package/dist/styles.css +1245 -0
  96. package/dist/styles.d.ts +37 -0
  97. package/dist/styles.js +242 -0
  98. package/dist/styles.js.map +1 -0
  99. package/package.json +47 -3
  100. package/README.md +0 -3
package/dist/menu.js ADDED
@@ -0,0 +1,75 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ const cx = (...c) => c.filter(Boolean).join(' ');
3
+ function List({ items, depth, level }) {
4
+ return (_jsx("ul", { className: level === 0 ? 'sw-menu-block__list' : 'sw-menu-block__sublist', children: items.map((item, i) => (_jsxs("li", { className: cx('sw-menu-block__item', item.current && 'is-current', item.trail && !item.current && 'is-trail'), children: [_jsx("a", { href: item.href, "aria-current": item.current ? 'page' : undefined, target: item.newTab ? '_blank' : undefined, rel: item.newTab ? 'noopener' : undefined, children: item.label }), item.children?.length && level + 1 < depth ? _jsx(List, { items: item.children, depth: depth, level: level + 1 }) : null] }, `${item.href}-${i}`))) }));
5
+ }
6
+ export const menuBlockComponent = {
7
+ label: 'Menu',
8
+ fields: {
9
+ source: {
10
+ type: 'radio',
11
+ label: 'Menu',
12
+ options: [
13
+ { label: 'A menu I choose', value: 'menu' },
14
+ { label: "The page's section menu", value: 'section' },
15
+ ],
16
+ },
17
+ // The admin replaces this with a picker over the site's menus.
18
+ menuKey: { type: 'text', label: 'Menu key' },
19
+ show: {
20
+ type: 'radio',
21
+ label: 'Show',
22
+ options: [
23
+ { label: 'The whole menu', value: 'all' },
24
+ { label: 'The branch that holds this page', value: 'branch' },
25
+ ],
26
+ },
27
+ depth: {
28
+ type: 'radio',
29
+ label: 'Levels',
30
+ options: [
31
+ { label: 'One', value: 1 },
32
+ { label: 'Two', value: 2 },
33
+ ],
34
+ },
35
+ heading: { type: 'text', label: 'Heading' },
36
+ layout: {
37
+ type: 'radio',
38
+ label: 'Layout',
39
+ options: [
40
+ { label: 'Stacked (a sidebar)', value: 'vertical' },
41
+ { label: 'In a row', value: 'horizontal' },
42
+ ],
43
+ },
44
+ },
45
+ defaultProps: { source: 'menu', menuKey: 'main', show: 'all', depth: 2, heading: '', layout: 'vertical' },
46
+ render: ({ source, menuKey, show, depth, heading, layout, items, menuLabel, branch, puck }) => {
47
+ const list = Array.isArray(items) ? items : [];
48
+ if (!list.length) {
49
+ if (!puck?.isEditing)
50
+ return _jsx(_Fragment, {});
51
+ const what = source === 'section' ? "the page's section menu" : `the menu "${menuKey || 'none chosen'}"`;
52
+ return (_jsx("section", { className: "sw-block sw-menu-block sw-menu-block--placeholder", children: _jsx("div", { className: "sw-container", children: _jsxs("div", { className: "sw-menu-block__placeholder", role: "note", children: ["Menu: ", show === 'branch' ? `the branch of ${what} that holds the page. It shows on pages that are in it.` : `${what} has no links to show here.`] }) }) }));
53
+ }
54
+ const title = heading?.trim() || (show === 'branch' ? branch?.label : '');
55
+ const titleHref = !heading?.trim() && show === 'branch' ? branch?.href : undefined;
56
+ const levels = Number(depth) === 1 ? 1 : 2;
57
+ return (_jsx("nav", { className: cx('sw-block', 'sw-menu-block', layout === 'horizontal' && 'sw-menu-block--horizontal'), "aria-label": title || menuLabel || 'Menu', children: _jsxs("div", { className: "sw-container", children: [title ? (_jsx("h2", { className: "sw-menu-block__heading", children: titleHref ? (_jsx("a", { href: titleHref, "aria-current": branch?.current ? 'page' : undefined, children: title })) : (title) })) : null, _jsx(List, { items: list, depth: levels, level: 0 })] }) }));
58
+ },
59
+ };
60
+ export const menuBlockCss = `/* ---------- Menu ---------- */
61
+ .sw-menu-block__heading { font-size: 1.05rem; margin: 0 0 0.75rem; }
62
+ .sw-menu-block__heading a { color: inherit; text-decoration: none; }
63
+ .sw-menu-block__heading a:hover { text-decoration: underline; }
64
+ .sw-menu-block__list, .sw-menu-block__sublist { list-style: none; margin: 0; padding: 0; }
65
+ .sw-menu-block__sublist { margin: 0.25rem 0 0.25rem 0.85rem; padding-left: 0.75rem; border-left: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
66
+ .sw-menu-block__item > a { display: block; padding: 0.4rem 0.6rem; border-radius: var(--sw-radius, 8px); color: inherit; text-decoration: none; line-height: 1.35; }
67
+ .sw-menu-block__item > a:hover { background: color-mix(in srgb, currentColor 7%, transparent); text-decoration: underline; }
68
+ .sw-menu-block__item > a:focus-visible { outline: 2px solid var(--sw-color-primary, #1d4ed8); outline-offset: 1px; }
69
+ .sw-menu-block__item.is-trail > a { font-weight: 600; }
70
+ .sw-menu-block__item.is-current > a { font-weight: 600; color: var(--sw-color-primary, #1d4ed8); background: color-mix(in srgb, var(--sw-color-primary, #1d4ed8) 9%, transparent); }
71
+ .sw-menu-block--horizontal .sw-menu-block__list { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
72
+ .sw-menu-block--horizontal .sw-menu-block__sublist { display: none; }
73
+ .sw-menu-block__placeholder { padding: 1rem; border: 1px dashed color-mix(in srgb, currentColor 35%, transparent); border-radius: var(--sw-radius, 8px); font-size: 0.9rem; opacity: 0.8; }
74
+ `;
75
+ //# sourceMappingURL=menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.js","sourceRoot":"","sources":["../src/menu.tsx"],"names":[],"mappings":";AAwCA,MAAM,EAAE,GAAG,CAAC,GAAG,CAAwC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAExF,SAAS,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAA4D;IAC7F,OAAO,CACL,aAAI,SAAS,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,wBAAwB,YAC1E,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,cAA8B,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,IAAI,CAAC,OAAO,IAAI,YAAY,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,UAAU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,IAC1C,GACF,CACP,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;CAc3B,CAAC"}
package/dist/meta.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * One line per block for the admin, the docs and the AI layer. `summary` is the
3
+ * short line under the block's name in the page builder's blocks panel;
4
+ * `description` is the full one for the docs; `aiHint` tells a model when to use
5
+ * the block and what to put in it. The style slots of the styled blocks (Hero,
6
+ * Cards, Button, CallToAction, Heading, Text) and their built-in styles sit next
7
+ * door, in styles.ts (`blockStyleSlots`).
8
+ */
9
+ export interface BlockMeta {
10
+ summary: string;
11
+ description: string;
12
+ aiHint: string;
13
+ }
14
+ export declare const blockMeta: Record<string, BlockMeta>;
package/dist/meta.js ADDED
@@ -0,0 +1,183 @@
1
+ export const blockMeta = {
2
+ Hero: {
3
+ summary: 'Opening section with buttons.',
4
+ description: 'Large opening section with an eyebrow, title, subtitle, up to two buttons and an optional background image.',
5
+ aiHint: 'Use once, at the top of a landing page. Title under 10 words, subtitle one or two sentences. Primary button is the main action; secondary is optional. Leave backgroundImage empty unless a real image URL is known.',
6
+ },
7
+ Heading: {
8
+ summary: 'A section heading.',
9
+ description: 'A standalone heading (h1 to h4) with alignment.',
10
+ aiHint: 'Use to start a section. Prefer h2 for sections and h3 for sub-sections; the Hero already provides the h1. Keep headings short and specific.',
11
+ },
12
+ Text: {
13
+ summary: 'Paragraphs of body copy.',
14
+ description: 'Body copy as HTML, edited visually in the page builder. Plain text is split into paragraphs on blank lines.',
15
+ aiHint: 'Use for prose. Prefer format "paragraphs" and separate paragraphs with a blank line. Use "lead" size for a single intro paragraph. Only use "html" when markup such as lists or links is required.',
16
+ },
17
+ Image: {
18
+ summary: 'One image with alt text.',
19
+ description: 'A single image with required alt text, optional caption and width (normal, wide, full).',
20
+ aiHint: 'Use only with a real image URL from the media library (/media/...). Always write descriptive alt text; use an empty alt only for purely decorative images.',
21
+ },
22
+ Gallery: {
23
+ summary: 'Image grid with a lightbox.',
24
+ description: 'A grid of images (2, 3 or 4 columns; square, 4:3 or as uploaded) with alt text and optional captions. Each opens full size in a lightbox with Previous and Next, which works without JavaScript.',
25
+ aiHint: 'Use for three or more related photos, such as an event, a place or a product. Only real image URLs from the media library (/media/...), each with descriptive alt text; captions are optional. For one image use Image instead.',
26
+ },
27
+ Columns: {
28
+ summary: 'Side-by-side columns of blocks.',
29
+ description: 'Two to four side-by-side columns, each a slot that holds other blocks. Two columns can be equal or 2:1 either way; the gap (S, M, L) and the vertical alignment are set on the block. Stacks on small screens.',
30
+ aiHint: 'Use to place blocks side by side, for example an Image next to a Text. Each entry in "columns" has a "content" array of child blocks. Keep to 2 or 3 columns for readability; use ratio "wide-left" or "wide-right" to give text more room than an image.',
31
+ },
32
+ Section: {
33
+ summary: 'A band that holds other blocks.',
34
+ description: 'A full-width band with a background (page, surface, primary, secondary or dark) and a width (narrow, normal, wide), holding any blocks in its content slot; each block inside keeps its own alignment. Text and buttons turn light on the colored and dark backgrounds.',
35
+ aiHint: 'Use to group a heading, text, buttons or cards on one background, for example a dark band with a Heading, a Text and a Buttons block. Put the child blocks in "content". Prefer it to Spacer for separating sections.',
36
+ },
37
+ CallToAction: {
38
+ summary: 'A short pitch with one button.',
39
+ description: 'A title, short text and one button; its style (a colored band, a bordered card or one the site defines) comes from Brand → Styles.',
40
+ aiHint: 'Use near the end of a page to ask for one action. Title under 8 words, text one sentence, a specific button label such as "Book a demo" rather than "Submit".',
41
+ },
42
+ Cards: {
43
+ summary: 'A grid of cards with links.',
44
+ description: 'A grid of cards with title, text, optional link and image, in 2 to 4 columns.',
45
+ aiHint: 'Use for features, benefits, services or a list of related pages. Three cards with parallel phrasing read best. Leave href empty when there is no target page.',
46
+ },
47
+ Faq: {
48
+ summary: 'Questions that open to answers.',
49
+ description: 'A list of questions; each opens in place to show its answer. Search engines can show the answers (FAQPage structured data), which you can turn off.',
50
+ aiHint: 'Use for real questions visitors ask, phrased as they would ask them. Answers short and direct, one or two sentences, plain text (a blank line starts a new paragraph). Four to eight questions.',
51
+ },
52
+ Testimonials: {
53
+ summary: 'Quotes from people, with names.',
54
+ description: 'Quotes with the name, role and an optional photo of who said them, in 1 to 3 columns.',
55
+ aiHint: 'Only use real quotes the site has; never invent testimonials. Keep each quote to one or two sentences. Leave imageUrl empty unless a real photo URL is known.',
56
+ },
57
+ Stats: {
58
+ summary: 'Big numbers with labels.',
59
+ description: 'Up to six large figures (98%, 40, 14:1), each with what it counts.',
60
+ aiHint: 'Use for three or four true, specific figures the site states elsewhere. The label says what is counted, in a few words. Do not invent numbers.',
61
+ },
62
+ LogoStrip: {
63
+ summary: 'A row of partner logos.',
64
+ description: 'A row of logos, optionally linked and shown in gray until hovered.',
65
+ aiHint: 'Use for partners, clients, accreditations or press. Each logo needs the organization name as its alt text. Leave out when no real logo URLs are known.',
66
+ },
67
+ Spacer: {
68
+ summary: 'Space between sections.',
69
+ description: 'Vertical space (s, m, l, xl).',
70
+ aiHint: 'Use sparingly. Blocks already have padding, and every block has spaceAbove and spaceBelow (auto, none, s, m, l, xl) to adjust it.',
71
+ },
72
+ Search: {
73
+ summary: 'A search box for this site.',
74
+ description: 'A search field with a button that opens the site search results for what the visitor typed. A plain form that works without JavaScript; the label stays available to screen readers when it is hidden.',
75
+ aiHint: 'Use on help, resource or directory pages, or near the top of a landing page with a lot of content. One per page is enough; the site header may already have a search field.',
76
+ },
77
+ Ask: {
78
+ summary: 'Answers questions from the site',
79
+ description: "A field for a question and up to six suggested questions. With search answers on (Site settings → Search → Answers), the answer appears below it, written only from the site's published pages with a link to each source; otherwise, and without JavaScript, it opens the search results. A plain form that works everywhere.",
80
+ aiHint: "Use on help centers, admissions, FAQ-style or contact pages where visitors arrive with questions. Suggested questions should be ones the site's pages answer. One per page.",
81
+ },
82
+ Menu: {
83
+ summary: 'Links from a menu.',
84
+ description: "One of the site's menus as a list of links: the whole menu, or only the branch that holds the page being viewed (its sub-items, like a department's navigation), one or two levels deep, stacked for a sidebar or in a row. It can follow the menu of the department section the page is in instead of naming one. The current page is marked; nothing shows when there are no links for the page.",
85
+ aiHint: 'Use for in-page or sidebar navigation of a section of the site. Set menuKey to an existing menu key (main is the header menu); use show "branch" to list the pages around the current one. Do not repeat the header navigation on a page.',
86
+ },
87
+ Divider: {
88
+ summary: 'A line between sections.',
89
+ description: 'A horizontal rule.',
90
+ aiHint: 'Use to separate unrelated sections. Do not place directly after a Spacer.',
91
+ },
92
+ Embed: {
93
+ summary: 'A video or other embed code.',
94
+ description: 'Raw embed HTML (for example a YouTube iframe) in a responsive 16:9 frame.',
95
+ aiHint: 'Use only when the user provides embed code or a known embeddable URL. Put the full iframe markup in "html". Never invent video IDs.',
96
+ },
97
+ Buttons: {
98
+ summary: 'A row of one to four buttons.',
99
+ description: 'One to four buttons in a row that wraps on small screens, each with its own label, link, emphasis (primary, secondary or text link) and an option to open in a new tab; aligned left, center or right.',
100
+ aiHint: 'Use when a section needs more than one action, for example "Book a demo" (primary) and "Read the docs" (secondary). One primary button per row; the rest secondary or text links.',
101
+ },
102
+ Button: {
103
+ summary: 'A single button or text link.',
104
+ description: 'A single button with alignment; its emphasis (primary, secondary or a text link) comes from its style.',
105
+ aiHint: 'Use for a standalone link styled as a button. Label is a verb phrase; href is a site path or full URL.',
106
+ },
107
+ Form: {
108
+ summary: 'A contact or signup form.',
109
+ description: 'A lead-capture form defined under Forms in the admin, referenced by key. Fields, labels and the success message come from the definition.',
110
+ aiHint: 'Use for contact, demo or newsletter forms. Set formKey to the key of an existing form (leave it empty if none is known); never invent fields here. Add a short title and a one-sentence intro.',
111
+ },
112
+ Calendar: {
113
+ summary: 'Events as a month or a list.',
114
+ description: 'A month grid or date list of the event occurrences in a collection, with a link to its iCal feed; filled in by the server at render time.',
115
+ aiHint: 'Use on an events page. Set collectionId to the key of an existing collection of a type with a daterange field (ask or leave empty if unknown); view "month" for a grid, "list" for upcoming dates.',
116
+ },
117
+ Shared: {
118
+ summary: 'A reusable shared block.',
119
+ description: 'A block saved in the component library (Shared blocks in the admin), referenced by key and rendered by the server; edit it once, update everywhere.',
120
+ aiHint: 'Use only when the user names an existing shared block key (a promo, a contact card). Never invent keys; leave sharedKey empty if none is known.',
121
+ },
122
+ Personalize: {
123
+ summary: 'A variant for an audience.',
124
+ description: 'Two slots, Default and Variant; visitors who match an audience (Audiences in the admin) see the variant. The server decides per visitor after the page loads, so pages stay cached.',
125
+ aiHint: 'Use only when the user names an existing audience key. Put the content for everyone in "default" and the audience version in "variant"; keep both the same shape (a Hero in each, for example). Never invent audience keys.',
126
+ },
127
+ Experiment: {
128
+ summary: 'An A/B test of versions.',
129
+ description: 'An A/B test: slots a (control), b and optional c; visitors of a running experiment (Experiments in the admin) are assigned a variant by weight and the results screen reports conversions per variant.',
130
+ aiHint: 'Use only when the user names an existing experiment key. Put the current content in "a" and the challenger in "b"; leave "c" empty unless asked. Never invent experiment keys.',
131
+ },
132
+ Collection: {
133
+ summary: 'A list that updates itself.',
134
+ description: 'A saved query (collection) of entities rendered as cards, a list or a grid, optionally with visitor filters (keyword, taxonomy, select, date range) and a pager; items are filled in by the server at render time.',
135
+ aiHint: 'Use for "latest posts", "case studies" or any list that should update itself. Set collectionId to the key of an existing collection (ask or leave empty if unknown); never invent items, the server supplies them.',
136
+ },
137
+ RegistryBrowse: {
138
+ summary: 'Search the package registry.',
139
+ description: 'Search and browse the package registry (modules, themes, kits): a GET search form, kind tabs, a sort, result cards with badges and a pager; filled in by the registry service from the page URL. Placeholder on instances that do not host the registry.',
140
+ aiHint: 'Use once on the /registry page of the project site. Keep the defaults; set kind to "theme" or "kit" only for a page dedicated to that kind. Needs no other props; the server supplies the results.',
141
+ },
142
+ RegistryPackage: {
143
+ summary: 'One registry package page.',
144
+ description: 'The detail page of one registry package, resolved from the last segment of the page path (/registry/<name>): header with badges, install command with a copy button, publisher and links, capability sheet, compatibility, versions, advisories, deprecation notice, README, changelog and a "For agents" section linking manifest.json.',
145
+ aiHint: 'Use once on the /registry/<name> catch-all page of the project site. The package comes from the URL; there is nothing to fill in besides the section toggles.',
146
+ },
147
+ RegistryStats: {
148
+ summary: 'Registry totals and downloads.',
149
+ description: 'The registry totals: packages by kind, publishers and downloads, as a row of figures.',
150
+ aiHint: 'Use on the registry landing or home page of the project site to show how much is published. Leave the title empty when a Heading precedes it.',
151
+ },
152
+ ThemeGallery: {
153
+ summary: 'The registry themes as cards.',
154
+ description: 'The theme directory: registry kits of kind "theme" as cards with a screenshot, description, publisher and Preview and Details links.',
155
+ aiHint: 'Use on a /themes page of the project site. Set limit to the number of cards wanted; the server supplies the themes.',
156
+ },
157
+ PublisherProfile: {
158
+ summary: 'A publisher and their packages.',
159
+ description: 'A publisher’s public profile (handle, name, verified badge, bio, website, maintainers) and their packages; the handle comes from the page path (/registry/publishers/<handle>) or the handle prop.',
160
+ aiHint: 'Use once on the /registry/publishers/<handle> catch-all page of the project site, with handle left empty. Set handle only for a page about one known publisher.',
161
+ },
162
+ OrgProfile: {
163
+ summary: 'Organization and its packages.',
164
+ description: 'An organization’s public profile (handle, name, verified badge, website, members with their roles, the namespaces it owns) and the packages published under those namespaces; the handle comes from the page path (/registry/orgs/<handle>) or the handle prop.',
165
+ aiHint: 'Use once on the /registry/orgs/<handle> catch-all page of the project site, with handle left empty. Set handle only for a page about one known organization.',
166
+ },
167
+ DocsFeedback: {
168
+ summary: '"Was this page helpful?"',
169
+ description: '"Was this page helpful?" with Yes and No buttons and an optional comment, posted to a form (docs_feedback by default) with the page path and the documented version as hidden fields; works without JavaScript and asks for no personal data.',
170
+ aiHint: 'Put it last on a documentation page. Keep formKey at docs_feedback unless the site defines another feedback form; the docs kit creates that form and places this block on every doc page.',
171
+ },
172
+ StatusBoard: {
173
+ summary: 'Uptime of a list of instances.',
174
+ description: 'A list of Spillway instances with their state (up, degraded or down), version, when each was last checked and a 90-day uptime bar; the server fetches every instance’s /status.json (3 s timeout, cached for a minute) and reads the history the probe step records every five minutes.',
175
+ aiHint: 'Use on a /status page of the project site. Fill instances with a name and the instance’s public URL (https://...); never invent URLs. Keep showUptime on unless asked.',
176
+ },
177
+ ModuleBlock: {
178
+ summary: 'A block from a module.',
179
+ description: 'A block an installed module provides (module name, block key and the block’s own props); rendered by the module on the server, with a placeholder when the module is disabled or missing.',
180
+ aiHint: 'Only use with a module and block key that GET /api/builder/config lists; never invent one. Fill props from that block’s field definitions.',
181
+ },
182
+ };
183
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,SAAS,GAA8B;IAClD,IAAI,EAAE;QACJ,OAAO,EAAE,+BAA+B;QACxC,WAAW,EAAE,6GAA6G;QAC1H,MAAM,EACJ,sNAAsN;KACzN;IACD,OAAO,EAAE;QACP,OAAO,EAAE,oBAAoB;QAC7B,WAAW,EAAE,iDAAiD;QAC9D,MAAM,EACJ,6IAA6I;KAChJ;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,0BAA0B;QACnC,WAAW,EAAE,6GAA6G;QAC1H,MAAM,EACJ,oMAAoM;KACvM;IACD,KAAK,EAAE;QACL,OAAO,EAAE,0BAA0B;QACnC,WAAW,EAAE,yFAAyF;QACtG,MAAM,EACJ,4JAA4J;KAC/J;IACD,OAAO,EAAE;QACP,OAAO,EAAE,6BAA6B;QACtC,WAAW,EAAE,kMAAkM;QAC/M,MAAM,EACJ,iOAAiO;KACpO;IACD,OAAO,EAAE;QACP,OAAO,EAAE,iCAAiC;QAC1C,WAAW,EAAE,gNAAgN;QAC7N,MAAM,EACJ,2PAA2P;KAC9P;IACD,OAAO,EAAE;QACP,OAAO,EAAE,iCAAiC;QAC1C,WAAW,EAAE,yQAAyQ;QACtR,MAAM,EACJ,uNAAuN;KAC1N;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,gCAAgC;QACzC,WAAW,EAAE,oIAAoI;QACjJ,MAAM,EACJ,+JAA+J;KAClK;IACD,KAAK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AU,EAAE;QACV,OAAO,EAAE,gCAAgC;QACzC,WAAW,EAAE,iQAAiQ;QAC9Q,MAAM,EAAE,8JAA8J;KACvK;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,0BAA0B;QACnC,WAAW,EAAE,+OAA+O;QAC5P,MAAM,EAAE,2LAA2L;KACpM;IACD,WAAW,EAAE;QACX,OAAO,EAAE,gCAAgC;QACzC,WAAW,EAAE,yRAAyR;QACtS,MAAM,EAAE,wKAAwK;KACjL;IACD,WAAW,EAAE;QACX,OAAO,EAAE,wBAAwB;QACjC,WAAW,EAAE,2LAA2L;QACxM,MAAM,EAAE,4IAA4I;KACrJ;CACF,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * ModuleBlock: a block a module provides (docs/modules.md, "Blocks in the page builder"). The page stores
3
+ * `{ module, key, props }`; the server's resolver asks the module system for the HTML (sanitised for sandboxed
4
+ * modules, the module's own markup for trusted ones) and puts it in `html`. When the module is disabled,
5
+ * uninstalled, in safe mode or fails to render, `placeholder` is set and the block shows its label instead of
6
+ * breaking the page. Server-safe: no hooks, no browser APIs; the admin swaps in its own fields and a live preview.
7
+ */
8
+ import type { ComponentConfig } from '@puckeditor/core';
9
+ export interface ModuleBlockProps {
10
+ /** The module's name as installed (manifest `name`). */
11
+ module: string;
12
+ /** The block key the module's manifest declares (`blockKey`, because React reserves `key`). */
13
+ blockKey: string;
14
+ /** The block's own props, shaped by the manifest's field definitions. */
15
+ props: Record<string, unknown>;
16
+ /** The block style's key, for a block whose manifest declares `styles` or `styleSlots` (stored next to `props`). */
17
+ style?: string;
18
+ /** Resolved by the server before render; never stored in the layout. `styleSet` is the style set the key belongs to. */
19
+ styleSet?: string | null;
20
+ html?: string | null;
21
+ placeholder?: boolean | null;
22
+ label?: string | null;
23
+ reason?: string | null;
24
+ }
25
+ export declare function moduleBlockClass(module: string, key: string): string;
26
+ export declare const moduleBlockComponent: ComponentConfig<{
27
+ props: ModuleBlockProps;
28
+ }>;
29
+ export declare const moduleBlockCss = "/* ---------- Module block ---------- */\n\n/* The module's HTML sits in the page container; a trusted module that brings its own container gets no second gutter. */\n.sw-module-block__body > * + * { margin-top: 1em; }\n.sw-module-block__body .sw-container { max-width: none; padding-inline: 0; }\n.sw-module-block__body figure { margin: 0; }\n.sw-module-block__body img { display: block; max-width: 100%; height: auto; border-radius: var(--sw-radius, 8px); }\n.sw-module-block__body ul { padding-left: 1.4em; }\n.sw-module-block__body table { margin: 0; }\n.sw-module-block__body caption { padding-bottom: var(--sw-space-1); text-align: left; font-weight: 600; }\n.sw-module-block__body thead th { border-bottom: 2px solid var(--sw-color-border); }\n\n.sw-module-block--placeholder { padding-block: var(--sw-space-2); }\n.sw-module-block__placeholder {\n padding: var(--sw-space-3);\n border: 1px dashed var(--sw-color-border);\n border-radius: var(--sw-radius, 8px);\n background: var(--sw-color-surface);\n color: var(--sw-color-muted);\n font-size: 0.9rem;\n text-align: center;\n}\n";
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { BLOCK_STYLE_KEY_RE, blockStyleClass } from '@spillway-cms/shared';
3
+ export function moduleBlockClass(module, key) {
4
+ const slug = (s) => s.replace(/^@/, '').replace(/[^a-z0-9]+/gi, '-').replace(/^-+|-+$/g, '').toLowerCase();
5
+ return `sw-module-block--${slug(module)}-${slug(key)}`;
6
+ }
7
+ export const moduleBlockComponent = {
8
+ label: 'Module block',
9
+ fields: {
10
+ module: { type: 'text', label: 'Module' },
11
+ blockKey: { type: 'text', label: 'Block key' },
12
+ props: { type: 'object', label: 'Props', objectFields: {} },
13
+ },
14
+ defaultProps: { module: '', blockKey: '', props: {} },
15
+ render: ({ module, blockKey: rawKey, html, placeholder, label, reason, style, styleSet }) => {
16
+ const name = String(module ?? '');
17
+ const blockKey = String(rawKey ?? '');
18
+ // A styled module block's wrapper carries its style's class (sw-style-cards-filled for a block that uses the Cards styles).
19
+ const styled = typeof styleSet === 'string' && styleSet && typeof style === 'string' && BLOCK_STYLE_KEY_RE.test(style) ? ` ${blockStyleClass(styleSet, style)}` : '';
20
+ if (typeof html === 'string' && html && !placeholder) {
21
+ // Like a core block: a section in the page's rhythm, the content in the container with prose styles (a sandboxed
22
+ // module's HTML is prose: paragraphs, lists, tables, images).
23
+ return (_jsx("section", { className: `sw-block sw-module-block ${moduleBlockClass(name, blockKey)}${styled}`, "data-module": name, "data-block": blockKey, "data-style": styled ? style : undefined, children: _jsx("div", { className: "sw-container sw-prose sw-module-block__body", dangerouslySetInnerHTML: { __html: html } }) }));
24
+ }
25
+ const title = label || (name && blockKey ? `${name}/${blockKey}` : '');
26
+ const text = !name || !blockKey ? 'Module block: none selected' : placeholder ? `Module block: ${title}${reason ? ` (${reason})` : ''}` : `Module block: ${title}`;
27
+ return (_jsx("section", { className: `sw-block sw-module-block sw-module-block--placeholder ${name && blockKey ? moduleBlockClass(name, blockKey) : ''}`.trim(), "data-module": name || undefined, "data-block": blockKey || undefined, children: _jsx("div", { className: "sw-container", children: _jsx("div", { className: "sw-module-block__placeholder", role: "note", children: text }) }) }));
28
+ },
29
+ };
30
+ export const moduleBlockCss = `/* ---------- Module block ---------- */
31
+
32
+ /* The module's HTML sits in the page container; a trusted module that brings its own container gets no second gutter. */
33
+ .sw-module-block__body > * + * { margin-top: 1em; }
34
+ .sw-module-block__body .sw-container { max-width: none; padding-inline: 0; }
35
+ .sw-module-block__body figure { margin: 0; }
36
+ .sw-module-block__body img { display: block; max-width: 100%; height: auto; border-radius: var(--sw-radius, 8px); }
37
+ .sw-module-block__body ul { padding-left: 1.4em; }
38
+ .sw-module-block__body table { margin: 0; }
39
+ .sw-module-block__body caption { padding-bottom: var(--sw-space-1); text-align: left; font-weight: 600; }
40
+ .sw-module-block__body thead th { border-bottom: 2px solid var(--sw-color-border); }
41
+
42
+ .sw-module-block--placeholder { padding-block: var(--sw-space-2); }
43
+ .sw-module-block__placeholder {
44
+ padding: var(--sw-space-3);
45
+ border: 1px dashed var(--sw-color-border);
46
+ border-radius: var(--sw-radius, 8px);
47
+ background: var(--sw-color-surface);
48
+ color: var(--sw-color-muted);
49
+ font-size: 0.9rem;
50
+ text-align: center;
51
+ }
52
+ `;
53
+ //# sourceMappingURL=module-block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-block.js","sourceRoot":"","sources":["../src/module-block.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAmB3E,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,GAAW;IAC1D,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACnH,OAAO,oBAAoB,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AACzD,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAiD;IAChF,KAAK,EAAE,cAAc;IACrB,MAAM,EAAE;QACN,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;QACzC,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE;QAC9C,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;KAC5D;IACD,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IACrD,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1F,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AAS,EAAE,yDAAyD,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,iBAAe,IAAI,IAAI,SAAS,gBAAc,QAAQ,IAAI,SAAS,YAC/M,cAAK,SAAS,EAAC,cAAc,YAC3B,cAAK,SAAS,EAAC,8BAA8B,EAAC,IAAI,EAAC,MAAM,YACtD,IAAI,GACD,GACF,GACE,CACX,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsB7B,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Personalize block: two slots, `default` and `variant`; visitors who match the audience get the
3
+ * variant. On a cached page the server renders the default inside `<div data-sw-island="…">` and the
4
+ * island script swaps in the visitor's version; the island endpoint renders the block with `show`
5
+ * set. In the editor both slots are shown stacked with labels. Server-safe.
6
+ */
7
+ import type { ComponentConfig, Slot } from '@puckeditor/core';
8
+ export interface PersonalizeProps {
9
+ audienceKey: string;
10
+ default: Slot;
11
+ variant: Slot;
12
+ /** Set by the server on cached pages: `<entityId>/<blockId>`; null renders the content inline. Never stored. */
13
+ island?: string | null;
14
+ /** Set by the island endpoint: which slot this visitor sees. Never stored. */
15
+ show?: string;
16
+ }
17
+ export declare const personalizeComponent: ComponentConfig<PersonalizeProps>;
18
+ export declare const islandCss = "/* ---------- Personalize and Experiment islands ---------- */\n\n.sw-island--editing { padding: var(--sw-space-2); border: 1px dashed var(--sw-color-border); border-radius: var(--sw-radius, 8px); }\n.sw-island__label {\n margin: var(--sw-space-1) 0;\n font-size: 0.8rem;\n font-weight: 600;\n letter-spacing: 0.02em;\n text-transform: uppercase;\n color: var(--sw-color-muted);\n}\n.sw-island__slot { min-height: 0; }\n.sw-island--editing .sw-island__slot { min-height: 2.5rem; }\n";
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const personalizeComponent = {
3
+ label: 'Personalize',
4
+ fields: {
5
+ audienceKey: { type: 'text', label: 'Audience key', placeholder: 'from Audiences in the admin' },
6
+ default: { type: 'slot', label: 'Default content' },
7
+ variant: { type: 'slot', label: 'Content for the audience' },
8
+ },
9
+ defaultProps: { audienceKey: '', default: [], variant: [] },
10
+ render: ({ audienceKey, default: Default, variant: Variant, island, show, puck }) => {
11
+ if (puck?.isEditing) {
12
+ return (_jsxs("div", { className: "sw-island sw-island--editing", "data-sw-audience": audienceKey || undefined, children: [_jsx("div", { className: "sw-island__label", children: "Default (everyone else)" }), _jsx(Default, { className: "sw-island__slot" }), _jsxs("div", { className: "sw-island__label", children: ["Audience: ", audienceKey || 'none selected'] }), _jsx(Variant, { className: "sw-island__slot" })] }));
13
+ }
14
+ const Content = show === 'variant' ? Variant : Default;
15
+ return (_jsx("div", { className: "sw-island sw-personalize", "data-sw-island": island || undefined, "data-sw-audience": audienceKey || undefined, "data-sw-variant": show === 'variant' ? 'variant' : undefined, children: _jsx(Content, { className: "sw-island__slot" }) }));
16
+ },
17
+ };
18
+ export const islandCss = `/* ---------- Personalize and Experiment islands ---------- */
19
+
20
+ .sw-island--editing { padding: var(--sw-space-2); border: 1px dashed var(--sw-color-border); border-radius: var(--sw-radius, 8px); }
21
+ .sw-island__label {
22
+ margin: var(--sw-space-1) 0;
23
+ font-size: 0.8rem;
24
+ font-weight: 600;
25
+ letter-spacing: 0.02em;
26
+ text-transform: uppercase;
27
+ color: var(--sw-color-muted);
28
+ }
29
+ .sw-island__slot { min-height: 0; }
30
+ .sw-island--editing .sw-island__slot { min-height: 2.5rem; }
31
+ `;
32
+ //# sourceMappingURL=personalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personalize.js","sourceRoot":"","sources":["../src/personalize.tsx"],"names":[],"mappings":";AAkBA,MAAM,CAAC,MAAM,oBAAoB,GAAsC;IACrE,KAAK,EAAE,aAAa;IACpB,M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,GAAG;;;;;;;;;;;;;CAaxB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * RegistryBrowse: search and browse the package registry. The stored props hold the defaults
3
+ * (kind, page size, whether to show the search box); the server fills `data` from the registry
4
+ * service and the page URL (?q=&kind=&sort=&page=), so the form is a plain GET form and the
5
+ * page works without JavaScript. Server-safe.
6
+ */
7
+ import type { ComponentConfig } from '@puckeditor/core';
8
+ import type { RegistryBrowseData, RegistryKindFilter, RegistrySort } from './registry-types.js';
9
+ export interface RegistryBrowseProps {
10
+ /** The kind the page opens on when the URL names none. */
11
+ kind: RegistryKindFilter;
12
+ pageSize: number;
13
+ showSearch: boolean;
14
+ showKinds: boolean;
15
+ showSort: boolean;
16
+ layout: 'list' | 'grid';
17
+ emptyText: string;
18
+ /** The package names' heading level. H2 (the default) suits a list right under the page title; H3 one under its own H2 heading. */
19
+ titleLevel?: 'h2' | 'h3';
20
+ /** Resolved by the server; never stored. */
21
+ data?: RegistryBrowseData;
22
+ }
23
+ export declare const BROWSE_SORTS: {
24
+ key: RegistrySort;
25
+ label: string;
26
+ }[];
27
+ export declare function RegistryPager({ data }: {
28
+ data: Pick<RegistryBrowseData, 'page' | 'pages' | 'prevHref' | 'nextHref' | 'pageHrefs'>;
29
+ }): import("react").JSX.Element | null;
30
+ export declare const registryBrowseComponent: ComponentConfig<RegistryBrowseProps>;
31
+ export declare const registryBrowseCss = "/* ---------- Registry: browse ---------- */\n\n.sw-reg-search { display: flex; flex-wrap: wrap; gap: var(--sw-space-2); align-items: flex-end; margin-bottom: var(--sw-space-2); }\n.sw-reg-search__field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 16rem; min-width: 0; }\n.sw-reg-search__field--sort { flex: 0 1 14rem; }\n.sw-reg-search__label { font-size: 0.85rem; font-weight: 600; }\n.sw-reg-search__input { font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--sw-color-border); border-radius: var(--sw-radius, 8px); background: var(--sw-color-bg, #fff); color: inherit; min-width: 0; }\n.sw-reg-search__input:focus { outline: none; box-shadow: var(--sw-focus-ring); }\n.sw-reg-search__actions { display: flex; gap: var(--sw-space-2); align-items: center; }\n.sw-reg-search__reset { font-size: 0.9rem; }\n.sw-reg-tabs { margin-bottom: var(--sw-space-2); border-bottom: 1px solid var(--sw-color-border); overflow-x: auto; }\n.sw-reg-tabs__list { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }\n.sw-reg-tab { display: inline-flex; align-items: center; gap: 6px; padding: 0.55rem 0.9rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--sw-color-muted); text-decoration: none; font-weight: 600; white-space: nowrap; }\n.sw-reg-tab:hover { color: var(--sw-color-text); text-decoration: none; }\n.sw-reg-tab--current { color: var(--sw-color-primary, #1d4ed8); border-bottom-color: var(--sw-color-primary, #1d4ed8); }\n.sw-reg-tab__count { font-size: 0.75rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--sw-color-surface); color: var(--sw-color-muted); }\n";
@@ -0,0 +1,97 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { PackageCard, Placeholder, cx } from './registry-shared.js';
3
+ const yesNo = [
4
+ { label: 'Yes', value: true },
5
+ { label: 'No', value: false },
6
+ ];
7
+ export const BROWSE_SORTS = [
8
+ { key: 'relevance', label: 'Relevance' },
9
+ { key: 'downloads', label: 'Most downloaded' },
10
+ { key: 'updated', label: 'Recently updated' },
11
+ { key: 'name', label: 'Name' },
12
+ ];
13
+ function SearchForm({ id, data, showSearch, showSort }) {
14
+ if (!showSearch && !showSort)
15
+ return null;
16
+ return (_jsxs("form", { className: "sw-reg-search", method: "get", action: data.action, role: "search", "aria-label": "Search the registry", children: [data.state.kind !== 'all' ? _jsx("input", { type: "hidden", name: "kind", value: data.state.kind }) : null, showSearch ? (_jsxs("div", { className: "sw-reg-search__field", children: [_jsx("label", { className: "sw-reg-search__label", htmlFor: `${id}-q`, children: "Search packages" }), _jsx("input", { id: `${id}-q`, className: "sw-reg-search__input", type: "search", name: "q", defaultValue: data.state.q, placeholder: "Name, description or keyword" })] })) : null, showSort ? (_jsxs("div", { className: "sw-reg-search__field sw-reg-search__field--sort", children: [_jsx("label", { className: "sw-reg-search__label", htmlFor: `${id}-sort`, children: "Sort by" }), _jsx("select", { id: `${id}-sort`, className: "sw-reg-search__input", name: "sort", defaultValue: data.state.sort, children: data.sorts.map((s) => (_jsx("option", { value: s.key, children: s.label }, s.key))) })] })) : null, _jsxs("div", { className: "sw-reg-search__actions", children: [_jsx("button", { className: "sw-button sw-button--primary", type: "submit", children: "Search" }), data.state.q ? (_jsx("a", { className: "sw-reg-search__reset", href: data.action, children: "Clear" })) : null] })] }));
17
+ }
18
+ function KindTabs({ data }) {
19
+ return (_jsx("nav", { className: "sw-reg-tabs", "aria-label": "Package kind", children: _jsx("ul", { className: "sw-reg-tabs__list", children: data.kinds.map((k) => {
20
+ const current = k.key === data.state.kind;
21
+ return (_jsx("li", { children: _jsxs("a", { className: cx('sw-reg-tab', current && 'sw-reg-tab--current'), href: k.href, "aria-current": current ? 'page' : undefined, children: [k.label, typeof k.count === 'number' ? _jsx("span", { className: "sw-reg-tab__count", children: k.count }) : null] }) }, k.key));
22
+ }) }) }));
23
+ }
24
+ export function RegistryPager({ data }) {
25
+ if (data.pages <= 1)
26
+ return null;
27
+ return (_jsxs("nav", { className: "sw-listing__pager", "aria-label": "Pagination", children: [data.prevHref ? (_jsx("a", { href: data.prevHref, rel: "prev", children: "\u2190 Previous" })) : (_jsx("span", { className: "sw-listing__pager-disabled", children: "\u2190 Previous" })), _jsx("ol", { className: "sw-listing__pages", children: data.pageHrefs.map((p) => p.page === data.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))) }), data.nextHref ? (_jsx("a", { href: data.nextHref, rel: "next", children: "Next \u2192" })) : (_jsx("span", { className: "sw-listing__pager-disabled", children: "Next \u2192" }))] }));
28
+ }
29
+ export const registryBrowseComponent = {
30
+ label: 'Registry browse',
31
+ fields: {
32
+ kind: {
33
+ type: 'select',
34
+ label: 'Default kind',
35
+ options: [
36
+ { label: 'All', value: 'all' },
37
+ { label: 'Modules', value: 'module' },
38
+ { label: 'Themes', value: 'theme' },
39
+ { label: 'Kits', value: 'kit' },
40
+ { label: 'Brands', value: 'brand' },
41
+ ],
42
+ },
43
+ pageSize: { type: 'number', label: 'Results per page', min: 1, max: 100 },
44
+ showSearch: { type: 'radio', label: 'Show search box', options: yesNo },
45
+ showKinds: { type: 'radio', label: 'Show kind tabs', options: yesNo },
46
+ showSort: { type: 'radio', label: 'Show sort', options: yesNo },
47
+ layout: {
48
+ type: 'radio',
49
+ label: 'Layout',
50
+ options: [
51
+ { label: 'List', value: 'list' },
52
+ { label: 'Grid', value: 'grid' },
53
+ ],
54
+ },
55
+ emptyText: { type: 'text', label: 'Text when nothing matches' },
56
+ titleLevel: {
57
+ type: 'radio',
58
+ label: 'Title level',
59
+ options: [
60
+ { label: 'H2', value: 'h2' },
61
+ { label: 'H3', value: 'h3' },
62
+ ],
63
+ },
64
+ },
65
+ defaultProps: {
66
+ titleLevel: 'h2',
67
+ kind: 'all',
68
+ pageSize: 20,
69
+ showSearch: true,
70
+ showKinds: true,
71
+ showSort: true,
72
+ layout: 'list',
73
+ emptyText: 'No packages match. Try another word or a different kind.',
74
+ },
75
+ render: ({ id, kind, showSearch, showKinds, showSort, layout, emptyText, titleLevel, data }) => {
76
+ const formId = `sw-reg-${String(id ?? 'browse').replace(/[^a-zA-Z0-9_-]/g, '')}`;
77
+ return (_jsx("section", { className: "sw-block sw-reg-browse", "data-kind": kind || 'all', children: _jsx("div", { className: "sw-container", children: !data ? (_jsx(Placeholder, { label: `Registry: ${kind === 'all' || !kind ? 'all packages' : `${kind}s`}` })) : (_jsxs(_Fragment, { children: [_jsx(SearchForm, { id: formId, data: data, showSearch: showSearch !== false, showSort: showSort !== false }), showKinds !== false ? _jsx(KindTabs, { data: data }) : null, _jsxs("p", { className: "sw-listing__count", role: "status", children: [data.total === 0 ? 'No results' : `${data.total} package${data.total === 1 ? '' : 's'}`, data.state.q ? ` for “${data.state.q}”` : '', data.pages > 1 ? ` · page ${data.page} of ${data.pages}` : ''] }), data.items.length === 0 ? (_jsx("p", { className: "sw-reg-empty", children: emptyText })) : (_jsx("ul", { className: cx('sw-reg-list', layout === 'grid' && 'sw-reg-list--grid'), children: data.items.map((item) => (_jsx(PackageCard, { item: item, titleLevel: titleLevel === 'h3' ? 'h3' : 'h2' }, `${item.kind}:${item.name}`))) })), _jsx(RegistryPager, { data: data })] })) }) }));
78
+ },
79
+ };
80
+ export const registryBrowseCss = `/* ---------- Registry: browse ---------- */
81
+
82
+ .sw-reg-search { display: flex; flex-wrap: wrap; gap: var(--sw-space-2); align-items: flex-end; margin-bottom: var(--sw-space-2); }
83
+ .sw-reg-search__field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 16rem; min-width: 0; }
84
+ .sw-reg-search__field--sort { flex: 0 1 14rem; }
85
+ .sw-reg-search__label { font-size: 0.85rem; font-weight: 600; }
86
+ .sw-reg-search__input { font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--sw-color-border); border-radius: var(--sw-radius, 8px); background: var(--sw-color-bg, #fff); color: inherit; min-width: 0; }
87
+ .sw-reg-search__input:focus { outline: none; box-shadow: var(--sw-focus-ring); }
88
+ .sw-reg-search__actions { display: flex; gap: var(--sw-space-2); align-items: center; }
89
+ .sw-reg-search__reset { font-size: 0.9rem; }
90
+ .sw-reg-tabs { margin-bottom: var(--sw-space-2); border-bottom: 1px solid var(--sw-color-border); overflow-x: auto; }
91
+ .sw-reg-tabs__list { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
92
+ .sw-reg-tab { display: inline-flex; align-items: center; gap: 6px; padding: 0.55rem 0.9rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--sw-color-muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
93
+ .sw-reg-tab:hover { color: var(--sw-color-text); text-decoration: none; }
94
+ .sw-reg-tab--current { color: var(--sw-color-primary, #1d4ed8); border-bottom-color: var(--sw-color-primary, #1d4ed8); }
95
+ .sw-reg-tab__count { font-size: 0.75rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--sw-color-surface); color: var(--sw-color-muted); }
96
+ `;
97
+ //# sourceMappingURL=registry-browse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-browse.js","sourceRoot":"","sources":["../src/registry-browse.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAiBpE,MAAM,KAAK,GAAG;IACZ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;IAC7B,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;CACrB,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAA2C;IAClE,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACxC,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,iBAAiB,EAAE;IAC9C,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE;IAC7C,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;CAC/B,CAAC;AAEF,SAAS,UAAU,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAoF;IACtI,IAAI,CAAC,UAAU,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,CACL,gBAAM,SAAS,EAAC,eAAe,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAC,QAAQ,gBAAY,qBAAqB,aAC7G,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK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