gatsby-matrix-theme 53.11.0 → 53.11.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/CHANGELOG.md +27 -0
- package/package.json +2 -2
- package/src/components/atoms/coupon/coupon.module.scss +3 -0
- package/src/components/atoms/coupon/index.js +5 -2
- package/src/components/organisms/cards/template-one/index.js +10 -10
- package/src/gatsby-core-theme/components/organisms/toplist/list/index.js +18 -22
- package/storybook/public/{384.88e62bf5.iframe.bundle.js → 384.a2cfcbfd.iframe.bundle.js} +3 -3
- package/storybook/public/{384.88e62bf5.iframe.bundle.js.map → 384.a2cfcbfd.iframe.bundle.js.map} +1 -1
- package/storybook/public/591.77af51ef.iframe.bundle.js +1 -0
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.d7a32f6f.iframe.bundle.js +1 -0
- package/storybook/public/project.json +1 -1
- package/storybook/public/{runtime~main.6de64b68.iframe.bundle.js → runtime~main.81ab47de.iframe.bundle.js} +1 -1
- package/storybook/public/591.b6c3f243.iframe.bundle.js +0 -1
- package/storybook/public/main.beddb092.iframe.bundle.js +0 -1
- /package/storybook/public/{384.88e62bf5.iframe.bundle.js.LICENSE.txt → 384.a2cfcbfd.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
## [53.11.2](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.11.1...v53.11.2) (2026-02-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* enable load more ([6a0f7ba](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/6a0f7ba0b1d92f6a685726f0c8ada4d6960bb939))
|
|
7
|
+
* remove enalbeLoadMore ([df78a91](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/df78a91926861c490ff07d3ca490f12c6594ee8d))
|
|
8
|
+
* update cards template one with usememo ([41ccc88](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/41ccc8872a23f9d913f398e45fc8836ca06b04f5))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Config
|
|
12
|
+
|
|
13
|
+
* update core theme ([cea05f7](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/cea05f7b22101a0a9571555ceba9af01bcac53de))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
* Merge branch 'en-54-add-load-more-button-to-cards' into 'master' ([913bcb1](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/913bcb14317e810647f1bfda9d888e4c13b37bb1))
|
|
17
|
+
|
|
18
|
+
## [53.11.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.11.0...v53.11.1) (2026-02-13)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* fix inp for load more button and coupon copy code ([130fb65](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/130fb659c17b9c7486a4dfedfdbd9eef5aad31fa))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
* Merge branch 'EN-383' into 'master' ([853a764](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/853a764834dedef904e977c9eda38b00adae73c9))
|
|
27
|
+
|
|
1
28
|
# [53.11.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.10.0...v53.11.0) (2026-02-11)
|
|
2
29
|
|
|
3
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-matrix-theme",
|
|
3
|
-
"version": "53.11.
|
|
3
|
+
"version": "53.11.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Matrix Theme NPM Package",
|
|
6
6
|
"author": "",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@react-icons/all-files": "^4.1.0",
|
|
27
27
|
"gatsby": "^5.11.0",
|
|
28
|
-
"gatsby-core-theme": "44.15.
|
|
28
|
+
"gatsby-core-theme": "44.15.1",
|
|
29
29
|
"gatsby-plugin-sharp": "^5.11.0",
|
|
30
30
|
"gatsby-plugin-sitemap": "^6.13.1",
|
|
31
31
|
"gatsby-transformer-sharp": "^5.11.0",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.couponContainer {
|
|
2
2
|
@include flex-align(center, center);
|
|
3
|
+
|
|
3
4
|
width: fit-content;
|
|
4
5
|
}
|
|
5
6
|
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
|
|
15
16
|
.coupon {
|
|
16
17
|
@include flex-align(center, center);
|
|
18
|
+
|
|
17
19
|
border: 1px dashed #20cd77;
|
|
18
20
|
background-color: #e9faf1;
|
|
19
21
|
color: #262629;
|
|
@@ -26,6 +28,7 @@
|
|
|
26
28
|
line-height: 1.7rem;
|
|
27
29
|
letter-spacing: 0.44px;
|
|
28
30
|
text-transform: uppercase;
|
|
31
|
+
z-index: 9;
|
|
29
32
|
|
|
30
33
|
svg {
|
|
31
34
|
width: 2.2rem;
|
|
@@ -20,7 +20,10 @@ const Coupon = ({
|
|
|
20
20
|
|
|
21
21
|
const [copySuccess, setCopySuccess] = useState('');
|
|
22
22
|
|
|
23
|
-
const copyToClipBoard = async (copyMe) => {
|
|
23
|
+
const copyToClipBoard = async (e, copyMe) => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
|
|
24
27
|
try {
|
|
25
28
|
await navigator.clipboard.writeText(copyMe);
|
|
26
29
|
setCopySuccess(true);
|
|
@@ -41,7 +44,7 @@ const Coupon = ({
|
|
|
41
44
|
<span className={styles.prefix}>{useTranslate(translationKey, defaultTranslation)}</span>
|
|
42
45
|
)}
|
|
43
46
|
<button
|
|
44
|
-
onClick={() => (code !== null && !inactive ? copyToClipBoard(code) : '')}
|
|
47
|
+
onClick={(e) => (code !== null && !inactive ? copyToClipBoard(e, code) : '')}
|
|
45
48
|
type="button"
|
|
46
49
|
className={`${styles.coupon} ${copySuccess ? styles.copied : ''}
|
|
47
50
|
${code === null ? styles.noCode : ''}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable camelcase */
|
|
2
|
-
import React, { Suspense, useContext } from 'react';
|
|
2
|
+
import React, { Suspense, useContext, useMemo } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import useLoadMore from 'gatsby-core-theme/src/hooks/useLoadMore';
|
|
5
5
|
import { Context } from '~context/MainProvider.js';
|
|
@@ -9,7 +9,6 @@ import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
|
9
9
|
import styles from './cards.module.scss';
|
|
10
10
|
import Card from '~atoms/cards/default-card';
|
|
11
11
|
import Button from '~atoms/button/button';
|
|
12
|
-
import keygen from '~helpers/keygen';
|
|
13
12
|
|
|
14
13
|
const Cards = ({
|
|
15
14
|
module,
|
|
@@ -22,10 +21,8 @@ const Cards = ({
|
|
|
22
21
|
isArchiveModule = false,
|
|
23
22
|
increment = limit,
|
|
24
23
|
}) => {
|
|
25
|
-
const CustomCardComponent = getCard(
|
|
26
|
-
|
|
27
|
-
page?.template
|
|
28
|
-
);
|
|
24
|
+
const CustomCardComponent = useMemo(() => getCard(module?.model_type || module?.cards_page_type, page?.template), [module?.model_type, module?.cards_page_type, page?.template]);
|
|
25
|
+
|
|
29
26
|
const { admin } = useContext(Context) || {};
|
|
30
27
|
const loadMoreData = useLoadMore({
|
|
31
28
|
items: module.items,
|
|
@@ -47,12 +44,15 @@ const Cards = ({
|
|
|
47
44
|
{moduleItems &&
|
|
48
45
|
moduleItems.map((item, index) =>
|
|
49
46
|
CustomCardComponent ? (
|
|
50
|
-
<Suspense
|
|
47
|
+
<Suspense
|
|
48
|
+
key={item.id}
|
|
49
|
+
fallback={<></>}
|
|
50
|
+
>
|
|
51
51
|
{admin ? (
|
|
52
52
|
<div className={styles.container}>
|
|
53
53
|
<AdminButton item={item} />
|
|
54
54
|
<CustomCardComponent
|
|
55
|
-
key={
|
|
55
|
+
key={item.id}
|
|
56
56
|
featured={module.style === 'featured'}
|
|
57
57
|
item={item}
|
|
58
58
|
type={item.type}
|
|
@@ -65,7 +65,7 @@ const Cards = ({
|
|
|
65
65
|
</div>
|
|
66
66
|
) : (
|
|
67
67
|
<CustomCardComponent
|
|
68
|
-
key={
|
|
68
|
+
key={item.id}
|
|
69
69
|
featured={module.style === 'featured'}
|
|
70
70
|
item={item}
|
|
71
71
|
type={item.type}
|
|
@@ -79,7 +79,7 @@ const Cards = ({
|
|
|
79
79
|
</Suspense>
|
|
80
80
|
) : (
|
|
81
81
|
<Card
|
|
82
|
-
key={
|
|
82
|
+
key={item.id}
|
|
83
83
|
item={item}
|
|
84
84
|
modulePosition={modulePosition}
|
|
85
85
|
itemPosition={index + 1}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-no-bind */
|
|
2
2
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
3
3
|
/* eslint-disable react/prop-types */
|
|
4
|
-
import React, { useRef } from 'react';
|
|
4
|
+
import React, { useRef, useState, useCallback, startTransition } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
|
|
7
7
|
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
8
|
-
import keygen from '~helpers/keygen';
|
|
9
8
|
import Button from '~atoms/button/button';
|
|
10
9
|
import Row from '../../../../../components/molecules/toplist/row/variant-one';
|
|
11
10
|
import VerifiedAuthor from '../../../../../images/icons/verified-author';
|
|
@@ -44,25 +43,22 @@ export default function List({
|
|
|
44
43
|
if ((!hasLoadMoreButton || parseInt(hasLoadMoreButton) === 0) && parseInt(initItemsCount) > 0) {
|
|
45
44
|
items = items && items.splice(0, initItemsCount);
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
const
|
|
46
|
+
|
|
47
|
+
const [visibleCount, setVisibleCount] = useState(initLoadItems);
|
|
49
48
|
|
|
50
49
|
const showLoadMoreButton =
|
|
51
50
|
hasLoadMoreButton === '1' && Number(initItemsCount) < toplist.items?.length;
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
const displayed = elRefs.current.filter((item) => item.classList.contains(styles.show)).length;
|
|
55
|
-
|
|
56
|
-
const nextItem = loadingItems + displayed;
|
|
57
|
-
const lastItem =
|
|
58
|
-
nextItem > elRefs.current.length ? elRefs.current.length + 1 : displayed + loadingItems;
|
|
52
|
+
const allItemsVisible = items && visibleCount >= items.length;
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
const handleClick = useCallback(() => {
|
|
55
|
+
startTransition(() => {
|
|
56
|
+
setVisibleCount((prev) => {
|
|
57
|
+
const next = prev + loadingItems;
|
|
58
|
+
return items && next >= items.length ? items.length : next;
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}, [loadingItems, items]);
|
|
66
62
|
|
|
67
63
|
const templateStyle = () => {
|
|
68
64
|
switch (modulestyle) {
|
|
@@ -79,7 +75,7 @@ export default function List({
|
|
|
79
75
|
|
|
80
76
|
return (
|
|
81
77
|
<>
|
|
82
|
-
<ol className={`${styles.list || ''} ${templateStyle()} `}
|
|
78
|
+
<ol className={`${styles.list || ''} ${templateStyle()} `}>
|
|
83
79
|
{items && items.map((item, index) => (
|
|
84
80
|
<Row
|
|
85
81
|
pagePath={pagePath}
|
|
@@ -89,8 +85,8 @@ export default function List({
|
|
|
89
85
|
oneliner={toplist.one_liner}
|
|
90
86
|
isPPC={isPPCPage}
|
|
91
87
|
index={index}
|
|
92
|
-
className={index
|
|
93
|
-
key={
|
|
88
|
+
className={index < visibleCount ? styles.show : null}
|
|
89
|
+
key={item.id || item.name || index}
|
|
94
90
|
itemRefs={elRefs}
|
|
95
91
|
template={template}
|
|
96
92
|
layout={isGrid ? 'grid' : 'list'}
|
|
@@ -101,12 +97,12 @@ export default function List({
|
|
|
101
97
|
/>
|
|
102
98
|
))}
|
|
103
99
|
</ol>
|
|
104
|
-
{showLoadMoreButton && (
|
|
105
|
-
<div
|
|
100
|
+
{showLoadMoreButton && !allItemsVisible && (
|
|
101
|
+
<div className={styles.loadMore}>
|
|
106
102
|
<Button
|
|
107
103
|
isInternalLink={false}
|
|
108
104
|
btnText={useTranslate('load_more', 'Load More')}
|
|
109
|
-
onClick={
|
|
105
|
+
onClick={handleClick}
|
|
110
106
|
buttonType="tertiary"
|
|
111
107
|
icon={loadMoreIcon}
|
|
112
108
|
tag="button"
|