@datlv-trustshop/shopify-inapp-components 0.1.29 → 0.1.31

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.
@@ -120,7 +120,7 @@ export const ArticleList = ({ limit, className = "", onArticleClick, layout = "s
120
120
  lineHeight: "1.4",
121
121
  }, children: article.title }), renderButton ? (renderButton(article, {
122
122
  onClick: () => handleArticleClick(article),
123
- })) : (_jsx(Box, { children: _jsx(Button, { icon: ExternalIcon, onClick: () => handleArticleClick(article), variant: "plain", children: article.link ? "Read article" : "Learn more" }) }))] })] }) }, article.id))) }), showNavigation && displayArticles.length > 1 && (_jsxs(_Fragment, { children: [_jsx("button", { onClick: handlePrevious, "aria-label": "Previous slide", style: {
123
+ })) : (_jsx(Box, { children: _jsx(Button, { icon: ExternalIcon, onClick: () => handleArticleClick(article), variant: "plain", children: article.buttonText || (article.link ? "Read article" : "Learn more") }) }))] })] }) }, article.id))) }), showNavigation && displayArticles.length > 1 && (_jsxs(_Fragment, { children: [_jsx("button", { onClick: handlePrevious, "aria-label": "Previous slide", style: {
124
124
  position: "absolute",
125
125
  top: "50%",
126
126
  transform: "translateY(-50%)",
@@ -99,7 +99,7 @@ export const ArticleSlide = ({ limit, className = "", onArticleClick, autoPlay =
99
99
  display: "inline-flex",
100
100
  alignItems: "center",
101
101
  gap: "4px",
102
- }, children: [article.link ? "Read article" : "Learn more", _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [_jsx("path", { d: "M17 2a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V4.414l-7.293 7.293a1 1 0 0 1-1.414-1.414L14.586 3H12a1 1 0 1 1 0-2h5Z" }), _jsx("path", { d: "M3 6a1 1 0 0 1 1-1h5a1 1 0 1 1 0 2H5v10h10v-4a1 1 0 1 1 2 0v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6Z" })] })] }))] })] }) }, article.id))) }), showNavigation && displayArticles.length > 1 && (_jsxs(_Fragment, { children: [_jsx("button", { onClick: handlePrevious, "aria-label": "Previous slide", style: {
102
+ }, children: [article.buttonText || (article.link ? "Read article" : "Learn more"), _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [_jsx("path", { d: "M17 2a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V4.414l-7.293 7.293a1 1 0 0 1-1.414-1.414L14.586 3H12a1 1 0 1 1 0-2h5Z" }), _jsx("path", { d: "M3 6a1 1 0 0 1 1-1h5a1 1 0 1 1 0 2H5v10h10v-4a1 1 0 1 1 2 0v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6Z" })] })] }))] })] }) }, article.id))) }), showNavigation && displayArticles.length > 1 && (_jsxs(_Fragment, { children: [_jsx("button", { onClick: handlePrevious, "aria-label": "Previous slide", style: {
103
103
  position: "absolute",
104
104
  top: "50%",
105
105
  transform: "translateY(-50%)",
@@ -141,7 +141,7 @@ export const FloatingCard = ({ data, shopId: propsShopId, onDismiss, onPrimaryAc
141
141
  return (_jsx("div", { ref: tracking?.elementRef, style: floatingCardStyles, children: _jsxs(Card, { padding: "0", roundedAbove: "sm", children: [(showCloseButton && data.dismissible !== false) && (_jsx("button", { style: closeButtonStyles, onClick: handleDismiss, "aria-label": "Close", children: _jsx("div", { style: {
142
142
  width: "20px",
143
143
  height: "20ox"
144
- }, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", children: _jsx("path", { d: "M6.71967 7.78033C7.01256 8.07322 7.48744 8.07322 7.78033 7.78033C8.07322 7.48744 8.07322 7.01256 7.78033 6.71967L5.06066 4L7.78033 1.28033C8.07322 0.987437 8.07322 0.512563 7.78033 0.21967C7.48744 -0.073223 7.01256 -0.073223 6.71967 0.21967L4 2.93934L1.28033 0.21967C0.987437 -0.0732233 0.512564 -0.0732233 0.21967 0.21967C-0.0732225 0.512563 -0.0732226 0.987437 0.21967 1.28033L2.93934 4L0.21967 6.71967C-0.0732233 7.01256 -0.0732233 7.48744 0.21967 7.78033C0.512563 8.07322 0.987437 8.07322 1.28033 7.78033L4 5.06066L6.71967 7.78033Z", fill: "white", "fill-opacity": "0.6" }) }) }) })), _jsxs(BlockStack, { gap: "0", children: [data.img_url && (_jsx("div", { style: imageContainerStyles, children: _jsx("img", { src: data.img_url, alt: data.image_alt || data.title, style: {
144
+ }, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", children: _jsx("path", { d: "M6.71967 7.78033C7.01256 8.07322 7.48744 8.07322 7.78033 7.78033C8.07322 7.48744 8.07322 7.01256 7.78033 6.71967L5.06066 4L7.78033 1.28033C8.07322 0.987437 8.07322 0.512563 7.78033 0.21967C7.48744 -0.073223 7.01256 -0.073223 6.71967 0.21967L4 2.93934L1.28033 0.21967C0.987437 -0.0732233 0.512564 -0.0732233 0.21967 0.21967C-0.0732225 0.512563 -0.0732226 0.987437 0.21967 1.28033L2.93934 4L0.21967 6.71967C-0.0732233 7.01256 -0.0732233 7.48744 0.21967 7.78033C0.512563 8.07322 0.987437 8.07322 1.28033 7.78033L4 5.06066L6.71967 7.78033Z", fill: "white", fillOpacity: "0.6" }) }) }) })), _jsxs(BlockStack, { gap: "0", children: [data.img_url && (_jsx("div", { style: imageContainerStyles, children: _jsx("img", { src: data.img_url, alt: data.image_alt || data.title, style: {
145
145
  width: "100%",
146
146
  height: "100%",
147
147
  objectFit: "cover",
@@ -193,6 +193,7 @@ export function adaptArticle(apiData) {
193
193
  category: apiData.category || apiData.section || apiData.label,
194
194
  readTime: apiData.read_time || apiData.readTime || apiData.reading_time,
195
195
  tags: apiData.tags || apiData.keywords || [],
196
+ buttonText: apiData.button_text || apiData.buttonText,
196
197
  };
197
198
  }
198
199
  function adaptProductUpdates(updates) {
@@ -11,4 +11,5 @@ export interface ArticleItem {
11
11
  category?: string;
12
12
  readTime?: number;
13
13
  tags?: string[];
14
+ buttonText?: string;
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datlv-trustshop/shopify-inapp-components",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "private": false,
5
5
  "description": "React TypeScript components for Shopify in-app dashboard content",
6
6
  "main": "dist/index.js",