@chinggis.systems/collection-ui 1.0.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 +159 -0
- package/dist/CollectionRenderer.d.ts +3 -0
- package/dist/CollectionRenderer.d.ts.map +1 -0
- package/dist/CollectionRenderer.js +293 -0
- package/dist/CollectionRenderer.js.map +1 -0
- package/dist/createAdapters.d.ts +75 -0
- package/dist/createAdapters.d.ts.map +1 -0
- package/dist/createAdapters.js +224 -0
- package/dist/createAdapters.js.map +1 -0
- package/dist/defaultAdapters.d.ts +8 -0
- package/dist/defaultAdapters.d.ts.map +1 -0
- package/dist/defaultAdapters.js +9 -0
- package/dist/defaultAdapters.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/layoutPresets.d.ts +19 -0
- package/dist/layoutPresets.d.ts.map +1 -0
- package/dist/layoutPresets.js +130 -0
- package/dist/layoutPresets.js.map +1 -0
- package/dist/primitives/BookSpine.d.ts +12 -0
- package/dist/primitives/BookSpine.d.ts.map +1 -0
- package/dist/primitives/BookSpine.js +11 -0
- package/dist/primitives/BookSpine.js.map +1 -0
- package/dist/primitives/CollectionCarousel.d.ts +4 -0
- package/dist/primitives/CollectionCarousel.d.ts.map +1 -0
- package/dist/primitives/CollectionCarousel.js +14 -0
- package/dist/primitives/CollectionCarousel.js.map +1 -0
- package/dist/styles.css +773 -0
- package/dist/types.d.ts +142 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +27 -0
- package/dist/utils.js.map +1 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# @internom/collection-ui
|
|
2
|
+
|
|
3
|
+
Reusable React renderer for Internom collection layouts.
|
|
4
|
+
|
|
5
|
+
The package owns normalized collection rendering, commerce-oriented item cards, book-spine media, price/rich-text fallbacks, Swiper carousel rendering, and Collection V2 normalization. Apps still configure route prefixes, image base URLs, item type checks, tracking, and framework-specific adapters when needed.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
yarn add @internom/collection-ui swiper
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Import the package stylesheet once. It includes the Swiper base/navigation CSS used by `CollectionCarousel`.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import "@internom/collection-ui/styles.css";
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Collection V2 Usage
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import {
|
|
23
|
+
CollectionRenderer,
|
|
24
|
+
createCollectionRendererAdapters,
|
|
25
|
+
normalizeCollection,
|
|
26
|
+
} from "@internom/collection-ui";
|
|
27
|
+
import "@internom/collection-ui/styles.css";
|
|
28
|
+
|
|
29
|
+
const adapters = createCollectionRendererAdapters({
|
|
30
|
+
collectionBasePath: "/collection",
|
|
31
|
+
itemBasePath: "/entity/id",
|
|
32
|
+
thumbBaseUrl: "https://image.internom.mn/public/product-thumb/",
|
|
33
|
+
isAudioType: (type) => type === "AUDIO" || type === "audio",
|
|
34
|
+
isProductType: (type) => ["TOY", "GIFT", "STATIONARY"].includes(String(type)),
|
|
35
|
+
readMoreLabel: "Дэлгэрэнгүй үзэх",
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function CollectionPreview({ collection }: { collection: unknown }) {
|
|
39
|
+
return (
|
|
40
|
+
<CollectionRenderer
|
|
41
|
+
collection={normalizeCollection(collection as any)}
|
|
42
|
+
adapters={adapters}
|
|
43
|
+
className="collection-ui--dark collection-ui--preview"
|
|
44
|
+
labels={{
|
|
45
|
+
all: "Бүгд",
|
|
46
|
+
viewAll: "Бүгдийг үзэх",
|
|
47
|
+
readMore: "Дэлгэрэнгүй үзэх",
|
|
48
|
+
previous: "Өмнөх",
|
|
49
|
+
next: "Дараах",
|
|
50
|
+
}}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Use `collection-ui--preview` inside admin panes. It keeps media/images smaller and caps the preview height so the form controls stay usable. Drop that class for storefront/full-page rendering.
|
|
57
|
+
|
|
58
|
+
`normalizeCollection` accepts Collection V2-style REST fields:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
normalizeCollection({
|
|
62
|
+
id: "collection-id",
|
|
63
|
+
title: "Онцгой бүтээгдэхүүн",
|
|
64
|
+
image: "https://example.com/banner.jpg",
|
|
65
|
+
link: "/collection/special",
|
|
66
|
+
layout: {
|
|
67
|
+
variant: "SPECIAL",
|
|
68
|
+
direction: "HORIZONTAL",
|
|
69
|
+
columns: 6,
|
|
70
|
+
},
|
|
71
|
+
items: [
|
|
72
|
+
{
|
|
73
|
+
id: "item-id",
|
|
74
|
+
productId: "product-id",
|
|
75
|
+
title: "A Little Life",
|
|
76
|
+
author: "Hanya Yanagihara",
|
|
77
|
+
imageUrl: "a-little-life.jpg",
|
|
78
|
+
price: 36900,
|
|
79
|
+
discountPrice: 42900,
|
|
80
|
+
type: "BOOK",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Exports
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import {
|
|
90
|
+
BookSpine,
|
|
91
|
+
CollectionCarousel,
|
|
92
|
+
CollectionRenderer,
|
|
93
|
+
getCollectionLayoutControls,
|
|
94
|
+
getCollectionLayoutDefinition,
|
|
95
|
+
createCollectionRendererAdapters,
|
|
96
|
+
isCollectionLayoutControlVisible,
|
|
97
|
+
normalizeCollection,
|
|
98
|
+
normalizeCollectionLayout,
|
|
99
|
+
} from "@internom/collection-ui";
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Admin Layout Controls
|
|
103
|
+
|
|
104
|
+
Admin forms should not show every control for every template. Ask the package which controls are valid:
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
import {
|
|
108
|
+
getCollectionLayoutDefinition,
|
|
109
|
+
isCollectionLayoutControlVisible,
|
|
110
|
+
} from "@internom/collection-ui";
|
|
111
|
+
|
|
112
|
+
const definition = getCollectionLayoutDefinition(layout.name);
|
|
113
|
+
|
|
114
|
+
const showDirection = isCollectionLayoutControlVisible(layout.name, "direction");
|
|
115
|
+
const showShape = isCollectionLayoutControlVisible(layout.name, "shape");
|
|
116
|
+
const showColumns = isCollectionLayoutControlVisible(layout.name, "columns");
|
|
117
|
+
|
|
118
|
+
// Render controls from definition.directionOptions / shapeOptions / columnOptions.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Examples:
|
|
122
|
+
|
|
123
|
+
- `special`, `banner`, `hero`: hide direction, shape, and columns.
|
|
124
|
+
- `carousel`, `grid`, `featured`, `image-grid`: show columns.
|
|
125
|
+
- `image-grid`: show shape.
|
|
126
|
+
- `list`, `dynamic`: show direction and numbered toggle.
|
|
127
|
+
|
|
128
|
+
## Exact App Integration
|
|
129
|
+
|
|
130
|
+
The built-in package skin is framework-free and production-oriented. If an app needs exact internom.mn parity with app-specific components, provide adapters:
|
|
131
|
+
|
|
132
|
+
- `renderLink` for router links.
|
|
133
|
+
- `renderImage` for optimized images.
|
|
134
|
+
- `renderCarousel` for custom Swiper controls.
|
|
135
|
+
- `renderBookMedia` for custom spine/media.
|
|
136
|
+
- `renderPrice` for app price formatting.
|
|
137
|
+
- `renderHtml` for app rich-text clamping.
|
|
138
|
+
- `renderItem` for app product cards.
|
|
139
|
+
|
|
140
|
+
This repository includes an example at `src/ui/collection/ecommerceCollectionRendererAdapters.tsx`.
|
|
141
|
+
|
|
142
|
+
## Admin Checklist
|
|
143
|
+
|
|
144
|
+
If admin preview still looks different from internom.mn:
|
|
145
|
+
|
|
146
|
+
- Use real REST item data, not placeholder cards.
|
|
147
|
+
- Use `normalizeCollection` on the Collection V2 REST payload.
|
|
148
|
+
- Import `@internom/collection-ui/styles.css`.
|
|
149
|
+
- Use `className="collection-ui--dark collection-ui--preview"` in admin panes.
|
|
150
|
+
- Configure `thumbBaseUrl`, `collectionBasePath`, `itemBasePath`, `isAudioType`, and `isProductType`.
|
|
151
|
+
- Ensure the admin preview shell is not adding a conflicting fixed card/background around the collection if you expect full-width storefront parity.
|
|
152
|
+
|
|
153
|
+
## Build
|
|
154
|
+
|
|
155
|
+
```sh
|
|
156
|
+
yarn build
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
The build emits ESM JavaScript, source maps, CSS, and TypeScript declarations into `dist`.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CollectionRendererProps } from "./types";
|
|
2
|
+
export declare function CollectionRenderer({ collection, layout, adapters, labels, className, }: CollectionRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
//# sourceMappingURL=CollectionRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionRenderer.d.ts","sourceRoot":"","sources":["../src/CollectionRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAMV,uBAAuB,EAGxB,MAAM,SAAS,CAAC;AAiBjB,wBAAgB,kBAAkB,CAAC,EACjC,UAAU,EACV,MAAM,EACN,QAAQ,EACR,MAAM,EACN,SAAS,GACV,EAAE,uBAAuB,kDA0BzB"}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { defaultAdapters } from "./defaultAdapters";
|
|
4
|
+
import { compact, cx, hasCollections, hasItems, sortCollections, } from "./utils";
|
|
5
|
+
const defaultLabels = {
|
|
6
|
+
all: "All",
|
|
7
|
+
viewAll: "View all",
|
|
8
|
+
readMore: "Read more",
|
|
9
|
+
previous: "Previous",
|
|
10
|
+
next: "Next",
|
|
11
|
+
};
|
|
12
|
+
export function CollectionRenderer({ collection, layout, adapters, labels, className, }) {
|
|
13
|
+
const resolvedLayout = layout ?? collection.layout;
|
|
14
|
+
if (!resolvedLayout) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return (_jsx("div", { className: cx("collection-ui", className), "data-layout": resolvedLayout.name, "data-direction": resolvedLayout.direction ?? undefined, style: {
|
|
18
|
+
"--collection-ui-columns": resolvedLayout.columns ?? undefined,
|
|
19
|
+
}, children: _jsx(CollectionBody, { collection: collection, layout: resolvedLayout, adapters: adapters, labels: { ...defaultLabels, ...labels } }) }));
|
|
20
|
+
}
|
|
21
|
+
function CollectionBody({ collection, layout, adapters, labels, }) {
|
|
22
|
+
switch (layout.name) {
|
|
23
|
+
case "dynamic":
|
|
24
|
+
case "list": {
|
|
25
|
+
if (!hasItems(collection)) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
if (layout.direction === "vertical") {
|
|
29
|
+
return (_jsx(VerticalList, { collection: collection, items: compact(collection.items), adapters: adapters, labels: labels, numbered: layout.isNumbered }));
|
|
30
|
+
}
|
|
31
|
+
return (_jsx(HorizontalList, { collection: collection, items: compact(collection.items), adapters: adapters, labels: labels }));
|
|
32
|
+
}
|
|
33
|
+
case "grid":
|
|
34
|
+
case "relative": {
|
|
35
|
+
if (!hasItems(collection)) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return (_jsx(GridList, { collection: collection, items: compact(collection.items), adapters: adapters, labels: labels }));
|
|
39
|
+
}
|
|
40
|
+
case "carousel": {
|
|
41
|
+
if (!hasItems(collection)) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return (_jsx(HorizontalList, { collection: collection, items: compact(collection.items), adapters: adapters, labels: labels }));
|
|
45
|
+
}
|
|
46
|
+
case "grid-title": {
|
|
47
|
+
if (!hasCollections(collection)) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return (_jsx(GridTitle, { collection: collection, adapters: adapters, labels: labels, itemLimit: layout.itemLimit ?? 3 }));
|
|
51
|
+
}
|
|
52
|
+
case "hero":
|
|
53
|
+
case "banner": {
|
|
54
|
+
if (!collection.imageUrl) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return (_jsx(LargeBanner, { collection: collection, adapters: adapters, labels: labels }));
|
|
58
|
+
}
|
|
59
|
+
case "special": {
|
|
60
|
+
if (!hasItems(collection)) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return (_jsx(SpecialItem, { collection: collection, adapters: adapters, labels: labels }));
|
|
64
|
+
}
|
|
65
|
+
case "slide":
|
|
66
|
+
if (!hasCollections(collection)) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return (_jsx(SlideShow, { collections: compact(collection.collections), adapters: adapters, labels: labels }));
|
|
70
|
+
case "featured": {
|
|
71
|
+
if (!hasCollections(collection)) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return (_jsx(FeaturedBanners, { collections: compact(collection.collections), adapters: adapters, labels: labels }));
|
|
75
|
+
}
|
|
76
|
+
case "image-grid": {
|
|
77
|
+
if (!hasCollections(collection)) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return (_jsx(ImageGrid, { collection: collection, adapters: adapters, labels: labels, variant: layout.shape === "square" ? "square" : "circle" }));
|
|
81
|
+
}
|
|
82
|
+
case "block-grid": {
|
|
83
|
+
if (!hasCollections(collection)) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
return (_jsx(ImageGrid, { collection: collection, adapters: adapters, labels: labels, variant: "block" }));
|
|
87
|
+
}
|
|
88
|
+
default:
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function getAdapters(adapters) {
|
|
93
|
+
return { ...defaultAdapters, ...adapters };
|
|
94
|
+
}
|
|
95
|
+
function renderItem(adapters, props) {
|
|
96
|
+
return adapters.renderItem({
|
|
97
|
+
...props,
|
|
98
|
+
renderBookMedia: adapters.renderBookMedia,
|
|
99
|
+
renderPrice: adapters.renderPrice,
|
|
100
|
+
renderHtml: adapters.renderHtml,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function Container({ adapters, children, className, }) {
|
|
104
|
+
const resolved = getAdapters(adapters);
|
|
105
|
+
return resolved.renderContainer(children, {
|
|
106
|
+
className: cx("collection-ui-container", className),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function LinkAdapter({ adapters, href, children, className, collection, item, onClick, }) {
|
|
110
|
+
const resolved = getAdapters(adapters);
|
|
111
|
+
if (!href) {
|
|
112
|
+
return _jsx(_Fragment, { children: children });
|
|
113
|
+
}
|
|
114
|
+
return (_jsx(_Fragment, { children: resolved.renderLink({
|
|
115
|
+
href,
|
|
116
|
+
children,
|
|
117
|
+
className,
|
|
118
|
+
collection,
|
|
119
|
+
item,
|
|
120
|
+
onClick,
|
|
121
|
+
}) }));
|
|
122
|
+
}
|
|
123
|
+
function ImageAdapter(props) {
|
|
124
|
+
const resolved = getAdapters(props.adapters);
|
|
125
|
+
if (!props.src) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
return _jsx(_Fragment, { children: resolved.renderImage(props) });
|
|
129
|
+
}
|
|
130
|
+
function SectionTitle({ collection, adapters, labels, small, }) {
|
|
131
|
+
const resolved = getAdapters(adapters);
|
|
132
|
+
const href = resolved.resolveCollectionHref(collection);
|
|
133
|
+
return (_jsxs("div", { className: "collection-ui-title", children: [_jsxs("div", { className: "collection-ui-title__row", children: [_jsx("h2", { className: cx("collection-ui-title__heading", small && "collection-ui-title__heading--small"), children: href ? (_jsx(LinkAdapter, { adapters: adapters, href: href, collection: collection, children: collection.name })) : (collection.name) }), href ? (_jsx(LinkAdapter, { adapters: adapters, href: href, collection: collection, className: "collection-ui-title__link", children: small ? labels.all : labels.viewAll })) : null] }), collection.description ? (_jsx("p", { className: "collection-ui-title__description", children: collection.description })) : null] }));
|
|
134
|
+
}
|
|
135
|
+
function HorizontalList({ collection, items, adapters, labels, }) {
|
|
136
|
+
const id = useId().replaceAll(":", "");
|
|
137
|
+
const resolved = getAdapters(adapters);
|
|
138
|
+
const collectionHref = resolved.resolveCollectionHref(collection);
|
|
139
|
+
const slides = items.map((item, index) => {
|
|
140
|
+
const href = resolved.resolveItemHref(item);
|
|
141
|
+
return renderItem(resolved, {
|
|
142
|
+
item,
|
|
143
|
+
href,
|
|
144
|
+
index,
|
|
145
|
+
variant: "card",
|
|
146
|
+
collection,
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
if (collectionHref) {
|
|
150
|
+
slides.push(_jsxs(LinkAdapter, { adapters: adapters, href: collectionHref, collection: collection, className: "collection-ui-view-all", children: [_jsx("span", { className: "collection-ui-view-all__icon", "aria-hidden": "true", children: ">" }), _jsx("span", { children: labels.viewAll })] }));
|
|
151
|
+
}
|
|
152
|
+
return (_jsx(Container, { adapters: adapters, children: _jsxs("section", { className: "collection-ui-horizontal", "aria-labelledby": `collection-title-${id}`, children: [_jsx("div", { id: `collection-title-${id}`, children: _jsx(SectionTitle, { collection: collection, adapters: adapters, labels: labels }) }), resolved.renderCarousel({
|
|
153
|
+
id: `collection-carousel-${id}`,
|
|
154
|
+
slides,
|
|
155
|
+
className: "collection-ui-carousel__track",
|
|
156
|
+
slideClassName: "collection-ui-carousel__slide",
|
|
157
|
+
previousLabel: labels.previous,
|
|
158
|
+
nextLabel: labels.next,
|
|
159
|
+
showControls: true,
|
|
160
|
+
slidesPerView: "auto",
|
|
161
|
+
slidesPerGroupAuto: true,
|
|
162
|
+
spaceBetween: 20,
|
|
163
|
+
})] }) }));
|
|
164
|
+
}
|
|
165
|
+
function GridList({ collection, items, adapters, labels, }) {
|
|
166
|
+
const resolved = getAdapters(adapters);
|
|
167
|
+
const collectionHref = resolved.resolveCollectionHref(collection);
|
|
168
|
+
const cards = items.map((item, index) => {
|
|
169
|
+
const href = resolved.resolveItemHref(item);
|
|
170
|
+
return (_jsx("div", { className: "collection-ui-grid__item", children: renderItem(resolved, {
|
|
171
|
+
item,
|
|
172
|
+
href,
|
|
173
|
+
index,
|
|
174
|
+
variant: "card",
|
|
175
|
+
collection,
|
|
176
|
+
}) }, item.id));
|
|
177
|
+
});
|
|
178
|
+
return (_jsx(Container, { adapters: adapters, children: _jsxs("section", { className: "collection-ui-grid", "aria-label": collection.name ?? undefined, children: [_jsx(SectionTitle, { collection: collection, adapters: adapters, labels: labels }), _jsxs("div", { className: "collection-ui-grid__items", children: [cards, collectionHref ? (_jsxs(LinkAdapter, { adapters: adapters, href: collectionHref, collection: collection, className: "collection-ui-view-all collection-ui-grid__view-all", children: [_jsx("span", { className: "collection-ui-view-all__icon", "aria-hidden": "true", children: ">" }), _jsx("span", { children: labels.viewAll })] })) : null] })] }) }));
|
|
179
|
+
}
|
|
180
|
+
function VerticalList({ collection, items, adapters, labels, numbered, limit, hideTitle, }) {
|
|
181
|
+
const resolved = getAdapters(adapters);
|
|
182
|
+
const visibleItems = limit ? items.slice(0, limit) : items;
|
|
183
|
+
return (_jsx(Container, { adapters: adapters, children: _jsxs("section", { className: "collection-ui-vertical", children: [hideTitle ? null : (_jsx(SectionTitle, { collection: collection, adapters: adapters, labels: labels })), _jsx("div", { className: "collection-ui-vertical__grid", role: "list", children: visibleItems.map((item, index) => {
|
|
184
|
+
const href = resolved.resolveItemHref(item);
|
|
185
|
+
return (_jsx("div", { className: "collection-ui-vertical__item", role: "listitem", children: renderItem(resolved, {
|
|
186
|
+
item,
|
|
187
|
+
href,
|
|
188
|
+
index,
|
|
189
|
+
number: numbered ? index + 1 : undefined,
|
|
190
|
+
variant: "vertical",
|
|
191
|
+
collection,
|
|
192
|
+
}) }, item.id));
|
|
193
|
+
}) })] }) }));
|
|
194
|
+
}
|
|
195
|
+
function GridTitle({ collection, adapters, labels, itemLimit, }) {
|
|
196
|
+
const id = useId().replaceAll(":", "");
|
|
197
|
+
const resolved = getAdapters(adapters);
|
|
198
|
+
const slides = compact(collection.collections).map((child) => (_jsxs("div", { className: "collection-ui-grid-title__panel", children: [_jsx(SectionTitle, { collection: child, adapters: adapters, labels: labels, small: true }), _jsx(VerticalList, { collection: child, items: compact(child.items), adapters: adapters, labels: labels, numbered: true, limit: itemLimit, hideTitle: true })] }, child.id)));
|
|
199
|
+
return (_jsx("section", { className: "collection-ui-band", children: _jsxs(Container, { adapters: adapters, children: [_jsx(SectionTitle, { collection: collection, adapters: adapters, labels: labels }), resolved.renderCarousel({
|
|
200
|
+
id: `collection-grid-title-${id}`,
|
|
201
|
+
slides,
|
|
202
|
+
className: "collection-ui-grid-title",
|
|
203
|
+
slideClassName: "collection-ui-grid-title__slide",
|
|
204
|
+
previousLabel: labels.previous,
|
|
205
|
+
nextLabel: labels.next,
|
|
206
|
+
showControls: true,
|
|
207
|
+
slidesPerView: 1,
|
|
208
|
+
slidesPerGroupAuto: false,
|
|
209
|
+
spaceBetween: 24,
|
|
210
|
+
breakpoints: {
|
|
211
|
+
1280: {
|
|
212
|
+
slidesPerView: 2,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
})] }) }));
|
|
216
|
+
}
|
|
217
|
+
function LargeBanner({ collection, adapters, labels, }) {
|
|
218
|
+
const resolved = getAdapters(adapters);
|
|
219
|
+
const href = resolved.resolveCollectionHref(collection);
|
|
220
|
+
const handleClick = () => resolved.onCollectionClick?.(collection, href);
|
|
221
|
+
return (_jsx(Container, { adapters: adapters, className: "collection-ui-container--wide", children: _jsxs("section", { className: "collection-ui-banner", children: [_jsxs("div", { className: "collection-ui-banner__copy", children: [collection.type ? (_jsx("div", { className: "collection-ui-banner__eyebrow", children: resolved.formatCollectionType(collection.type) })) : null, _jsx("h2", { className: "collection-ui-banner__title", children: collection.name }), collection.description ? (_jsx("p", { className: "collection-ui-banner__description", children: collection.description })) : null, href ? (_jsx(LinkAdapter, { adapters: adapters, href: href, collection: collection, onClick: handleClick, className: "collection-ui-button", children: labels.readMore })) : null] }), collection.imageUrl ? (_jsx(LinkAdapter, { adapters: adapters, href: href ?? "", collection: collection, onClick: handleClick, children: _jsx(ImageAdapter, { adapters: adapters, src: collection.imageUrl, alt: collection.name ?? "Collection banner", width: 1003, height: 564, priority: true, sizes: "(max-width: 768px) 100vw, 1003px", className: "collection-ui-banner__image", collection: collection, style: { height: "auto" } }) })) : null] }) }));
|
|
222
|
+
}
|
|
223
|
+
function SpecialItem({ collection, adapters, labels, }) {
|
|
224
|
+
const item = compact(collection.items)[0];
|
|
225
|
+
const resolved = getAdapters(adapters);
|
|
226
|
+
if (!item) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
const href = resolved.resolveItemHref(item);
|
|
230
|
+
return (_jsx("section", { className: "collection-ui-band", children: _jsx(Container, { adapters: adapters, children: _jsxs("div", { className: "collection-ui-special", children: [renderItem(resolved, {
|
|
231
|
+
item,
|
|
232
|
+
href,
|
|
233
|
+
index: 0,
|
|
234
|
+
variant: "special",
|
|
235
|
+
collection,
|
|
236
|
+
}), href ? (_jsx(LinkAdapter, { adapters: adapters, href: href, item: item, collection: collection, onClick: () => resolved.onItemClick?.(item, href), className: "collection-ui-button collection-ui-special__button", children: labels.readMore })) : null] }) }) }));
|
|
237
|
+
}
|
|
238
|
+
function FeaturedBanners({ collections, adapters, labels, }) {
|
|
239
|
+
return (_jsx(Container, { adapters: adapters, className: "collection-ui-container--wide", children: _jsx("div", { className: cx("collection-ui-featured", collections.length >= 3 && "collection-ui-featured--three"), children: sortCollections(collections).map((collection) => (_jsx(FeaturedBanner, { collection: collection, adapters: adapters, labels: labels }, collection.id))) }) }));
|
|
240
|
+
}
|
|
241
|
+
function SlideShow({ collections, adapters, labels, }) {
|
|
242
|
+
const id = useId().replaceAll(":", "");
|
|
243
|
+
const resolved = getAdapters(adapters);
|
|
244
|
+
const slides = sortCollections(collections).map((collection) => (_jsx("div", { className: "collection-ui-slide__item", children: _jsx(FeaturedBanner, { collection: collection, adapters: adapters, labels: labels }) }, collection.id)));
|
|
245
|
+
return (_jsx(Container, { adapters: adapters, className: "collection-ui-container--wide", children: _jsx("section", { className: "collection-ui-slide", children: resolved.renderCarousel({
|
|
246
|
+
id: `collection-slide-${id}`,
|
|
247
|
+
slides,
|
|
248
|
+
className: "collection-ui-slide__track",
|
|
249
|
+
slideClassName: "collection-ui-slide__slide",
|
|
250
|
+
previousLabel: labels.previous,
|
|
251
|
+
nextLabel: labels.next,
|
|
252
|
+
showControls: true,
|
|
253
|
+
effect: "coverflow",
|
|
254
|
+
centeredSlides: true,
|
|
255
|
+
loop: slides.length > 1,
|
|
256
|
+
slidesPerView: 1.1,
|
|
257
|
+
slidesPerGroupAuto: false,
|
|
258
|
+
spaceBetween: 20,
|
|
259
|
+
breakpoints: {
|
|
260
|
+
768: {
|
|
261
|
+
slidesPerView: 1.35,
|
|
262
|
+
spaceBetween: 24,
|
|
263
|
+
},
|
|
264
|
+
1200: {
|
|
265
|
+
slidesPerView: 1.6,
|
|
266
|
+
spaceBetween: 28,
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
}) }) }));
|
|
270
|
+
}
|
|
271
|
+
function FeaturedBanner({ collection, adapters, labels, }) {
|
|
272
|
+
const resolved = getAdapters(adapters);
|
|
273
|
+
const href = resolved.resolveCollectionHref(collection);
|
|
274
|
+
const handleClick = () => resolved.onCollectionClick?.(collection, href);
|
|
275
|
+
if (!collection.imageUrl) {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
return (_jsxs("article", { className: "collection-ui-featured-card", children: [_jsx(LinkAdapter, { adapters: adapters, href: href ?? "", collection: collection, onClick: handleClick, children: _jsx(ImageAdapter, { adapters: adapters, src: collection.imageUrl, alt: collection.name ?? "", width: 740, height: 417, priority: true, className: "collection-ui-featured-card__image", collection: collection, style: { height: "auto" } }) }), _jsxs("div", { className: "collection-ui-featured-card__body", children: [_jsx("h2", { className: "collection-ui-featured-card__title", children: _jsx(LinkAdapter, { adapters: adapters, href: href ?? "", collection: collection, onClick: handleClick, children: collection.name }) }), collection.description ? (_jsx("p", { className: "collection-ui-featured-card__description", children: collection.description })) : null, href ? (_jsx(LinkAdapter, { adapters: adapters, href: href, collection: collection, onClick: handleClick, className: "collection-ui-featured-card__link", children: labels.readMore })) : null] })] }));
|
|
279
|
+
}
|
|
280
|
+
function ImageGrid({ collection, adapters, labels, variant, }) {
|
|
281
|
+
const resolved = getAdapters(adapters);
|
|
282
|
+
const imageCollections = sortCollections(collection.collections).filter((item) => item.imageUrl);
|
|
283
|
+
return (_jsx(Container, { adapters: adapters, children: _jsxs("section", { className: cx("collection-ui-image-grid", `collection-ui-image-grid--${variant}`), children: [_jsx(SectionTitle, { collection: collection, adapters: adapters, labels: labels }), _jsx("div", { className: "collection-ui-image-grid__items", children: imageCollections.map((child, index) => {
|
|
284
|
+
const href = resolved.resolveCollectionHref(child);
|
|
285
|
+
const handleClick = () => resolved.onCollectionClick?.(child, href);
|
|
286
|
+
return (_jsx("div", { className: cx("collection-ui-image-grid__item", variant === "block" &&
|
|
287
|
+
index % 2 === 0 &&
|
|
288
|
+
"collection-ui-image-grid__item--end"), children: _jsx(LinkAdapter, { adapters: adapters, href: href ?? "", collection: child, onClick: handleClick, children: _jsx(ImageAdapter, { adapters: adapters, src: child.imageUrl ?? "", alt: child.name ?? "", width: variant === "circle" ? 200 : 176, height: variant === "circle" ? 200 : 64, className: cx("collection-ui-image-grid__image", variant === "circle" &&
|
|
289
|
+
"collection-ui-image-grid__image--circle", variant === "square" &&
|
|
290
|
+
"collection-ui-image-grid__image--square"), collection: child }) }) }, child.id));
|
|
291
|
+
}) })] }) }));
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=CollectionRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionRenderer.js","sourceRoot":"","sources":["../src/CollectionRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAsB,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I,IAAI,EAAE,EAChB,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,WAAW,YAEpB,KAAC,YAAY,IACX,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE,EACzB,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EACrB,KAAK,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EACvC,MAAM,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EACvC,SAAS,EAAE,EAAE,CACX,iCAAiC,EACjC,OAAO,KAAK,QAAQ;wCAClB,yCAAyC,EAC3C,OAAO,KAAK,QAAQ;wCAClB,yCAAyC,CAC5C,EACD,UAAU,EAAE,KAAK,GACjB,GACU,IAvBT,KAAK,CAAC,EAAE,CAwBT,CACP,CAAC;oBACJ,CAAC,CAAC,GACE,IACE,GACA,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Collection, CollectionItem, CollectionItemMediaKind, CollectionLayout, CollectionRendererAdapters } from "./types";
|
|
3
|
+
export interface CreateCollectionAdaptersOptions {
|
|
4
|
+
collectionBasePath?: string;
|
|
5
|
+
itemBasePath?: string;
|
|
6
|
+
thumbBaseUrl?: string;
|
|
7
|
+
isAudioType?: (type?: CollectionItemMediaKind | null) => boolean;
|
|
8
|
+
isProductType?: (type?: CollectionItemMediaKind | null) => boolean;
|
|
9
|
+
formatCollectionType?: (type: string) => ReactNode;
|
|
10
|
+
onCollectionClick?: (collection: Collection, href?: string | null) => void;
|
|
11
|
+
onItemClick?: (item: CollectionItem, href?: string | null) => void;
|
|
12
|
+
readMoreLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CollectionInput {
|
|
15
|
+
id: string;
|
|
16
|
+
name?: string | null;
|
|
17
|
+
title?: string | null;
|
|
18
|
+
slug?: string | null;
|
|
19
|
+
description?: string | null;
|
|
20
|
+
imageUrl?: string | null;
|
|
21
|
+
image?: string | null;
|
|
22
|
+
images?: Array<CollectionImageInput | null> | null;
|
|
23
|
+
linkName?: string | null;
|
|
24
|
+
link?: string | null;
|
|
25
|
+
appLink?: string | null;
|
|
26
|
+
href?: string | null;
|
|
27
|
+
type?: string | null;
|
|
28
|
+
source?: string | null;
|
|
29
|
+
sort?: number | null;
|
|
30
|
+
layout?: CollectionStyleInput | CollectionLayout | null;
|
|
31
|
+
childItems?: {
|
|
32
|
+
items?: Array<CollectionItemInput | null> | null;
|
|
33
|
+
} | null;
|
|
34
|
+
childCollections?: {
|
|
35
|
+
items?: Array<CollectionInput | null> | null;
|
|
36
|
+
} | null;
|
|
37
|
+
items?: Array<CollectionItemInput | null> | null;
|
|
38
|
+
collections?: Array<CollectionInput | null> | null;
|
|
39
|
+
metadata?: Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
export interface CollectionImageInput {
|
|
42
|
+
url: string;
|
|
43
|
+
title?: string | null;
|
|
44
|
+
query?: string | null;
|
|
45
|
+
itemId?: string | null;
|
|
46
|
+
link?: string | null;
|
|
47
|
+
appLink?: string | null;
|
|
48
|
+
}
|
|
49
|
+
export interface CollectionItemInput {
|
|
50
|
+
id: string;
|
|
51
|
+
title?: string | null;
|
|
52
|
+
author?: string | null;
|
|
53
|
+
description?: string | null;
|
|
54
|
+
imageUrl?: string | null;
|
|
55
|
+
productId?: string | null;
|
|
56
|
+
href?: string | null;
|
|
57
|
+
type?: CollectionItemMediaKind | null;
|
|
58
|
+
price?: number | null;
|
|
59
|
+
discountPrice?: number | null;
|
|
60
|
+
sort?: number | null;
|
|
61
|
+
metadata?: Record<string, unknown>;
|
|
62
|
+
}
|
|
63
|
+
export interface CollectionStyleInput {
|
|
64
|
+
name?: string | null;
|
|
65
|
+
variant?: string | null;
|
|
66
|
+
direction?: string | null;
|
|
67
|
+
isNumbered?: boolean | null;
|
|
68
|
+
columns?: number | null;
|
|
69
|
+
itemLimit?: number | null;
|
|
70
|
+
shape?: string | null;
|
|
71
|
+
}
|
|
72
|
+
export declare function normalizeCollection(input: CollectionInput, renderStyle?: CollectionStyleInput | CollectionLayout | null): Collection;
|
|
73
|
+
export declare function normalizeCollectionLayout(style?: CollectionStyleInput | CollectionLayout | null): CollectionLayout | null;
|
|
74
|
+
export declare function createCollectionRendererAdapters(options?: CreateCollectionAdaptersOptions): CollectionRendererAdapters;
|
|
75
|
+
//# sourceMappingURL=createAdapters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAdapters.d.ts","sourceRoot":"","sources":["../src/createAdapters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAGV,UAAU,EACV,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,0BAA0B,EAM3B,MAAM,SAAS,CAAC;AAKjB,MAAM,WAAW,+BAA+B;IAC9C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,uBAAuB,GAAG,IAAI,KAAK,OAAO,CAAC;IACjE,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,uBAAuB,GAAG,IAAI,KAAK,OAAO,CAAC;IACnE,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC;IACnD,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3E,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACnE,a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