@chinggis.systems/collection-ui 1.0.0 → 1.0.2
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 +21 -36
- package/dist/CollectionRenderer.d.ts +2 -2
- package/dist/CollectionRenderer.d.ts.map +1 -1
- package/dist/CollectionRenderer.js +368 -292
- package/dist/CollectionRenderer.js.map +1 -1
- package/dist/CollectionView.d.ts +13 -0
- package/dist/CollectionView.d.ts.map +1 -0
- package/dist/CollectionView.js +42 -0
- package/dist/CollectionView.js.map +1 -0
- package/dist/assets/spine/BurnBlend.png +0 -0
- package/dist/assets/spine/FlatEdges.webp +0 -0
- package/dist/assets/spine/FlatShadow.webp +0 -0
- package/dist/assets/spine/NormalBlend.webp +0 -0
- package/dist/assets/spine/SoftLightBlend.webp +0 -0
- package/dist/collectionV2Model.d.ts +43 -0
- package/dist/collectionV2Model.d.ts.map +1 -0
- package/dist/collectionV2Model.js +4 -0
- package/dist/collectionV2Model.js.map +1 -0
- package/dist/createAdapters.d.ts +66 -74
- package/dist/createAdapters.d.ts.map +1 -1
- package/dist/createAdapters.js +223 -223
- package/dist/createAdapters.js.map +1 -1
- package/dist/defaultAdapters.d.ts +7 -7
- package/dist/defaultAdapters.js +8 -8
- package/dist/index.d.ts +14 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/layoutPresets.d.ts +18 -18
- package/dist/layoutPresets.js +129 -129
- package/dist/primitives/BookSpine.d.ts +11 -11
- package/dist/primitives/BookSpine.js +10 -10
- package/dist/primitives/CollectionCarousel.d.ts +3 -3
- package/dist/primitives/CollectionCarousel.d.ts.map +1 -1
- package/dist/primitives/CollectionCarousel.js +23 -13
- package/dist/primitives/CollectionCarousel.js.map +1 -1
- package/dist/styles.css +333 -52
- package/dist/types.d.ts +147 -141
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/utils.d.ts +8 -8
- package/dist/utils.js +26 -26
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,142 +1,148 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
-
export type CollectionLayoutName = "banner" | "block-grid" | "carousel" | "dynamic" | "featured" | "grid" | "grid-title" | "hero" | "image-grid" | "list" | "relative" | "slide" | "special";
|
|
3
|
-
export type CollectionLayoutDirection = "horizontal" | "vertical";
|
|
4
|
-
export type CollectionLayoutShape = "circle" | "rectangle" | "square";
|
|
5
|
-
export type CollectionItemMediaKind = "audio" | "book" | "ebook" | string;
|
|
6
|
-
export interface CollectionItem {
|
|
7
|
-
id: string;
|
|
8
|
-
title?: string | null;
|
|
9
|
-
author?: string | null;
|
|
10
|
-
description?: string | null;
|
|
11
|
-
imageUrl?: string | null;
|
|
12
|
-
productId?: string | null;
|
|
13
|
-
type?: CollectionItemMediaKind | null;
|
|
14
|
-
price?: number | null;
|
|
15
|
-
discountPrice?: number | null;
|
|
16
|
-
href?: string | null;
|
|
17
|
-
sort?: number | null;
|
|
18
|
-
metadata?: Record<string, unknown>;
|
|
19
|
-
}
|
|
20
|
-
export interface CollectionLayout {
|
|
21
|
-
name: CollectionLayoutName;
|
|
22
|
-
direction?: CollectionLayoutDirection | null;
|
|
23
|
-
isNumbered?: boolean | null;
|
|
24
|
-
columns?: number | null;
|
|
25
|
-
itemLimit?: number | null;
|
|
26
|
-
shape?: CollectionLayoutShape | null;
|
|
27
|
-
}
|
|
28
|
-
export interface Collection {
|
|
29
|
-
id: string;
|
|
30
|
-
name?: string | null;
|
|
31
|
-
description?: string | null;
|
|
32
|
-
imageUrl?: string | null;
|
|
33
|
-
linkName?: string | null;
|
|
34
|
-
href?: string | null;
|
|
35
|
-
type?: string | null;
|
|
36
|
-
sort?: number | null;
|
|
37
|
-
layout?: CollectionLayout | null;
|
|
38
|
-
items?: CollectionItem[] | null;
|
|
39
|
-
collections?: Collection[] | null;
|
|
40
|
-
metadata?: Record<string, unknown>;
|
|
41
|
-
}
|
|
42
|
-
export interface LinkRenderProps {
|
|
43
|
-
href: string;
|
|
44
|
-
children: ReactNode;
|
|
45
|
-
className?: string;
|
|
46
|
-
collection?: Collection;
|
|
47
|
-
item?: CollectionItem;
|
|
48
|
-
onClick?: () => void;
|
|
49
|
-
}
|
|
50
|
-
export interface ImageRenderProps {
|
|
51
|
-
src: string;
|
|
52
|
-
alt: string;
|
|
53
|
-
width: number;
|
|
54
|
-
height: number;
|
|
55
|
-
className?: string;
|
|
56
|
-
priority?: boolean;
|
|
57
|
-
sizes?: string;
|
|
58
|
-
style?: CSSProperties;
|
|
59
|
-
collection?: Collection;
|
|
60
|
-
item?: CollectionItem;
|
|
61
|
-
}
|
|
62
|
-
export interface BookMediaRenderProps {
|
|
63
|
-
item: CollectionItem;
|
|
64
|
-
src?: string | null;
|
|
65
|
-
alt: string;
|
|
66
|
-
width?: number;
|
|
67
|
-
height?: number;
|
|
68
|
-
isAudio?: boolean;
|
|
69
|
-
priority?: boolean;
|
|
70
|
-
className?: string;
|
|
71
|
-
}
|
|
72
|
-
export interface PriceRenderProps {
|
|
73
|
-
value?: number | null;
|
|
74
|
-
compareAtValue?: number | null;
|
|
75
|
-
className?: string;
|
|
76
|
-
compareAtClassName?: string;
|
|
77
|
-
}
|
|
78
|
-
export interface HtmlRenderProps {
|
|
79
|
-
html: string;
|
|
80
|
-
className?: string;
|
|
81
|
-
onReadMore?: () => void;
|
|
82
|
-
maxHeight?: "sm" | "md" | "lg";
|
|
83
|
-
}
|
|
84
|
-
export interface ItemRenderProps {
|
|
85
|
-
item: CollectionItem;
|
|
86
|
-
href?: string | null;
|
|
87
|
-
index: number;
|
|
88
|
-
number?: number;
|
|
89
|
-
variant: "card" | "featured" | "special" | "vertical";
|
|
90
|
-
collection?: Collection;
|
|
91
|
-
renderBookMedia?: (props: BookMediaRenderProps) => ReactNode;
|
|
92
|
-
renderPrice?: (props: PriceRenderProps) => ReactNode;
|
|
93
|
-
renderHtml?: (props: HtmlRenderProps) => ReactNode;
|
|
94
|
-
}
|
|
95
|
-
export interface CarouselRenderProps {
|
|
96
|
-
id: string;
|
|
97
|
-
slides: ReactNode[];
|
|
98
|
-
className?: string;
|
|
99
|
-
slideClassName?: string;
|
|
100
|
-
previousLabel: string;
|
|
101
|
-
nextLabel: string;
|
|
102
|
-
showControls?: boolean;
|
|
103
|
-
effect?: "slide" | "coverflow";
|
|
104
|
-
centeredSlides?: boolean;
|
|
105
|
-
loop?: boolean;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
1
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
+
export type CollectionLayoutName = "banner" | "block-grid" | "carousel" | "dynamic" | "featured" | "grid" | "grid-title" | "hero" | "image-grid" | "list" | "relative" | "slide" | "special";
|
|
3
|
+
export type CollectionLayoutDirection = "horizontal" | "vertical";
|
|
4
|
+
export type CollectionLayoutShape = "circle" | "rectangle" | "square";
|
|
5
|
+
export type CollectionItemMediaKind = "audio" | "book" | "ebook" | string;
|
|
6
|
+
export interface CollectionItem {
|
|
7
|
+
id: string;
|
|
8
|
+
title?: string | null;
|
|
9
|
+
author?: string | null;
|
|
10
|
+
description?: string | null;
|
|
11
|
+
imageUrl?: string | null;
|
|
12
|
+
productId?: string | null;
|
|
13
|
+
type?: CollectionItemMediaKind | null;
|
|
14
|
+
price?: number | null;
|
|
15
|
+
discountPrice?: number | null;
|
|
16
|
+
href?: string | null;
|
|
17
|
+
sort?: number | null;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
export interface CollectionLayout {
|
|
21
|
+
name: CollectionLayoutName;
|
|
22
|
+
direction?: CollectionLayoutDirection | null;
|
|
23
|
+
isNumbered?: boolean | null;
|
|
24
|
+
columns?: number | null;
|
|
25
|
+
itemLimit?: number | null;
|
|
26
|
+
shape?: CollectionLayoutShape | null;
|
|
27
|
+
}
|
|
28
|
+
export interface Collection {
|
|
29
|
+
id: string;
|
|
30
|
+
name?: string | null;
|
|
31
|
+
description?: string | null;
|
|
32
|
+
imageUrl?: string | null;
|
|
33
|
+
linkName?: string | null;
|
|
34
|
+
href?: string | null;
|
|
35
|
+
type?: string | null;
|
|
36
|
+
sort?: number | null;
|
|
37
|
+
layout?: CollectionLayout | null;
|
|
38
|
+
items?: CollectionItem[] | null;
|
|
39
|
+
collections?: Collection[] | null;
|
|
40
|
+
metadata?: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
export interface LinkRenderProps {
|
|
43
|
+
href: string;
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
className?: string;
|
|
46
|
+
collection?: Collection;
|
|
47
|
+
item?: CollectionItem;
|
|
48
|
+
onClick?: () => void;
|
|
49
|
+
}
|
|
50
|
+
export interface ImageRenderProps {
|
|
51
|
+
src: string;
|
|
52
|
+
alt: string;
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
className?: string;
|
|
56
|
+
priority?: boolean;
|
|
57
|
+
sizes?: string;
|
|
58
|
+
style?: CSSProperties;
|
|
59
|
+
collection?: Collection;
|
|
60
|
+
item?: CollectionItem;
|
|
61
|
+
}
|
|
62
|
+
export interface BookMediaRenderProps {
|
|
63
|
+
item: CollectionItem;
|
|
64
|
+
src?: string | null;
|
|
65
|
+
alt: string;
|
|
66
|
+
width?: number;
|
|
67
|
+
height?: number;
|
|
68
|
+
isAudio?: boolean;
|
|
69
|
+
priority?: boolean;
|
|
70
|
+
className?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface PriceRenderProps {
|
|
73
|
+
value?: number | null;
|
|
74
|
+
compareAtValue?: number | null;
|
|
75
|
+
className?: string;
|
|
76
|
+
compareAtClassName?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface HtmlRenderProps {
|
|
79
|
+
html: string;
|
|
80
|
+
className?: string;
|
|
81
|
+
onReadMore?: () => void;
|
|
82
|
+
maxHeight?: "sm" | "md" | "lg";
|
|
83
|
+
}
|
|
84
|
+
export interface ItemRenderProps {
|
|
85
|
+
item: CollectionItem;
|
|
86
|
+
href?: string | null;
|
|
87
|
+
index: number;
|
|
88
|
+
number?: number;
|
|
89
|
+
variant: "card" | "featured" | "special" | "vertical";
|
|
90
|
+
collection?: Collection;
|
|
91
|
+
renderBookMedia?: (props: BookMediaRenderProps) => ReactNode;
|
|
92
|
+
renderPrice?: (props: PriceRenderProps) => ReactNode;
|
|
93
|
+
renderHtml?: (props: HtmlRenderProps) => ReactNode;
|
|
94
|
+
}
|
|
95
|
+
export interface CarouselRenderProps {
|
|
96
|
+
id: string;
|
|
97
|
+
slides: ReactNode[];
|
|
98
|
+
className?: string;
|
|
99
|
+
slideClassName?: string;
|
|
100
|
+
previousLabel: string;
|
|
101
|
+
nextLabel: string;
|
|
102
|
+
showControls?: boolean;
|
|
103
|
+
effect?: "slide" | "coverflow";
|
|
104
|
+
centeredSlides?: boolean;
|
|
105
|
+
loop?: boolean;
|
|
106
|
+
autoplay?: boolean | {
|
|
107
|
+
delay?: number;
|
|
108
|
+
disableOnInteraction?: boolean;
|
|
109
|
+
pauseOnMouseEnter?: boolean;
|
|
110
|
+
};
|
|
111
|
+
speed?: number;
|
|
112
|
+
slidesPerView?: number | "auto";
|
|
113
|
+
slidesPerGroupAuto?: boolean;
|
|
114
|
+
spaceBetween?: number;
|
|
115
|
+
breakpoints?: Record<string | number, unknown>;
|
|
116
|
+
}
|
|
117
|
+
export interface CollectionRendererLabels {
|
|
118
|
+
all?: string;
|
|
119
|
+
viewAll?: string;
|
|
120
|
+
readMore?: string;
|
|
121
|
+
previous?: string;
|
|
122
|
+
next?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface CollectionRendererAdapters {
|
|
125
|
+
renderLink?: (props: LinkRenderProps) => ReactNode;
|
|
126
|
+
renderImage?: (props: ImageRenderProps) => ReactNode;
|
|
127
|
+
renderItem?: (props: ItemRenderProps) => ReactNode;
|
|
128
|
+
renderBookMedia?: (props: BookMediaRenderProps) => ReactNode;
|
|
129
|
+
renderPrice?: (props: PriceRenderProps) => ReactNode;
|
|
130
|
+
renderHtml?: (props: HtmlRenderProps) => ReactNode;
|
|
131
|
+
renderCarousel?: (props: CarouselRenderProps) => ReactNode;
|
|
132
|
+
resolveCollectionHref?: (collection: Collection) => string | null | undefined;
|
|
133
|
+
resolveItemHref?: (item: CollectionItem) => string | null | undefined;
|
|
134
|
+
onCollectionClick?: (collection: Collection, href?: string | null) => void;
|
|
135
|
+
onItemClick?: (item: CollectionItem, href?: string | null) => void;
|
|
136
|
+
renderContainer?: (children: ReactNode, props: {
|
|
137
|
+
className?: string;
|
|
138
|
+
}) => ReactNode;
|
|
139
|
+
formatCollectionType?: (type: string) => ReactNode;
|
|
140
|
+
}
|
|
141
|
+
export interface CollectionRendererProps {
|
|
142
|
+
collection: Collection;
|
|
143
|
+
layout?: CollectionLayout | null;
|
|
144
|
+
adapters?: CollectionRendererAdapters;
|
|
145
|
+
labels?: CollectionRendererLabels;
|
|
146
|
+
className?: string;
|
|
147
|
+
}
|
|
142
148
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MA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C,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,SAAS,CAAC;IACrD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAC;IACnD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,SAAS,CAAC;IAC3D,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9E,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACtE,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,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IACpF,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC;CACpD;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,0BAA0B,CAAC;IACtC,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Collection, CollectionItem } from "./types";
|
|
2
|
-
export declare function cx(...values: Array<string | false | null | undefined>): string;
|
|
3
|
-
export declare function sortCollections(items?: Collection[] | null): Collection[];
|
|
4
|
-
export declare function compact<T>(items?: Array<T | null | undefined> | null): T[];
|
|
5
|
-
export declare function hasItems(collection: Collection): boolean;
|
|
6
|
-
export declare function hasCollections(collection: Collection): boolean;
|
|
7
|
-
export declare function defaultCollectionHref(collection: Collection): string | null;
|
|
8
|
-
export declare function defaultItemHref(item: CollectionItem): string | null;
|
|
1
|
+
import type { Collection, CollectionItem } from "./types";
|
|
2
|
+
export declare function cx(...values: Array<string | false | null | undefined>): string;
|
|
3
|
+
export declare function sortCollections(items?: Collection[] | null): Collection[];
|
|
4
|
+
export declare function compact<T>(items?: Array<T | null | undefined> | null): T[];
|
|
5
|
+
export declare function hasItems(collection: Collection): boolean;
|
|
6
|
+
export declare function hasCollections(collection: Collection): boolean;
|
|
7
|
+
export declare function defaultCollectionHref(collection: Collection): string | null;
|
|
8
|
+
export declare function defaultItemHref(item: CollectionItem): string | null;
|
|
9
9
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
export function cx(...values) {
|
|
2
|
-
return values.filter(Boolean).join(" ");
|
|
3
|
-
}
|
|
4
|
-
export function sortCollections(items) {
|
|
5
|
-
return [...compact(items)].sort((a, b) => {
|
|
6
|
-
if (a.sort != null || b.sort != null) {
|
|
7
|
-
return (b.sort ?? Number.NEGATIVE_INFINITY) - (a.sort ?? Number.NEGATIVE_INFINITY);
|
|
8
|
-
}
|
|
9
|
-
return (a.name ?? "").localeCompare(b.name ?? "");
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
export function compact(items) {
|
|
13
|
-
return (items ?? []).filter((item) => Boolean(item));
|
|
14
|
-
}
|
|
15
|
-
export function hasItems(collection) {
|
|
16
|
-
return compact(collection.items).length > 0;
|
|
17
|
-
}
|
|
18
|
-
export function hasCollections(collection) {
|
|
19
|
-
return compact(collection.collections).length > 0;
|
|
20
|
-
}
|
|
21
|
-
export function defaultCollectionHref(collection) {
|
|
22
|
-
return collection.href ?? collection.linkName ?? null;
|
|
23
|
-
}
|
|
24
|
-
export function defaultItemHref(item) {
|
|
25
|
-
return item.href ?? null;
|
|
26
|
-
}
|
|
1
|
+
export function cx(...values) {
|
|
2
|
+
return values.filter(Boolean).join(" ");
|
|
3
|
+
}
|
|
4
|
+
export function sortCollections(items) {
|
|
5
|
+
return [...compact(items)].sort((a, b) => {
|
|
6
|
+
if (a.sort != null || b.sort != null) {
|
|
7
|
+
return (b.sort ?? Number.NEGATIVE_INFINITY) - (a.sort ?? Number.NEGATIVE_INFINITY);
|
|
8
|
+
}
|
|
9
|
+
return (a.name ?? "").localeCompare(b.name ?? "");
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function compact(items) {
|
|
13
|
+
return (items ?? []).filter((item) => Boolean(item));
|
|
14
|
+
}
|
|
15
|
+
export function hasItems(collection) {
|
|
16
|
+
return compact(collection.items).length > 0;
|
|
17
|
+
}
|
|
18
|
+
export function hasCollections(collection) {
|
|
19
|
+
return compact(collection.collections).length > 0;
|
|
20
|
+
}
|
|
21
|
+
export function defaultCollectionHref(collection) {
|
|
22
|
+
return collection.href ?? collection.linkName ?? null;
|
|
23
|
+
}
|
|
24
|
+
export function defaultItemHref(item) {
|
|
25
|
+
return item.href ?? null;
|
|
26
|
+
}
|
|
27
27
|
//# sourceMappingURL=utils.js.map
|
package/package.json
CHANGED