@ikas/loyalty-widget-renderer 1.0.0-alpha.84 → 1.0.0-alpha.86
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/build/locales.d.ts +5 -0
- package/build/models/index.js +1 -1
- package/build/models/mini-mode/index.d.ts +1 -0
- package/build/models/mini-mode/index.js +1 -1
- package/build/renderer/components/product-filter-card/index.js +1 -1
- package/build/renderer/index.js +1 -1
- package/build/renderer/screens/gift-product-selection-screen/index.js +1 -1
- package/build/renderer/screens/loyalty-level-screen/index.js +1 -1
- package/build/renderer/screens/loyalty-level-screen/style.d.ts +4 -1
- package/build/renderer/screens/loyalty-level-screen/style.js +1 -1
- package/build/renderer/screens/main-screen/earning-methods-section/index.js +1 -1
- package/build/renderer/screens/main-screen/program-info-section/index.js +1 -1
- package/build/renderer/screens/main-screen/spending-methods-section/index.js +1 -1
- package/build/renderer/style.js +1 -1
- package/build/renderer/utils/locales/de.json.js +1 -1
- package/build/renderer/utils/locales/en.json.js +1 -1
- package/build/renderer/utils/locales/fr.json.js +1 -1
- package/build/renderer/utils/locales/nl.json.js +1 -1
- package/build/renderer/utils/locales/tr.json.js +1 -1
- package/build/renderer/utils/loyalty-details.d.ts +7 -0
- package/build/renderer/utils/loyalty-details.js +1 -1
- package/build/storefront-widget-script-injector.iife.js +1 -1
- package/build/storefront-widget-script-injector.iife.js.map +1 -1
- package/build/utils.d.ts +9 -0
- package/build/utils.js +1 -1
- package/package.json +1 -1
package/build/utils.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
|
|
|
6
6
|
import { EarningMethodTypeEnum, LoyaltyProgramMethodSpendingTypeEnum, LoyaltyWidgetScreenTypeEnum } from "models/types";
|
|
7
7
|
interface WidgetStorageData {
|
|
8
8
|
closedDescriptionSessionId?: string;
|
|
9
|
+
isDescriptionPermanentlyClosed?: boolean;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Get ikas_session_id from localStorage
|
|
@@ -27,6 +28,14 @@ export declare const isDescriptionClosedForCurrentSession: () => boolean;
|
|
|
27
28
|
* Mark description as closed for current session
|
|
28
29
|
*/
|
|
29
30
|
export declare const markDescriptionClosedForSession: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Check if description is permanently closed (across sessions)
|
|
33
|
+
*/
|
|
34
|
+
export declare const isDescriptionPermanentlyClosed: () => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Mark description as permanently closed (across sessions)
|
|
37
|
+
*/
|
|
38
|
+
export declare const markDescriptionPermanentlyClosed: () => void;
|
|
30
39
|
export declare const getScreenIcon: (screenType: LoyaltyWidgetScreenTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element | null;
|
|
31
40
|
export declare const getEarningMethodIcon: (earningMethod: EarningMethodTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element | null;
|
|
32
41
|
export declare const getHistoryEarningMethodLabel: (earningMethodType: EarningMethodTypeEnum) => string;
|
package/build/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__makeTemplateObject as e,__assign as t}from'./ext/tslib/tslib.es6.mjs.js';import n from"react";import'./ext/react-i18next/dist/es/context.js';import{useTranslation as r}from'./ext/react-i18next/dist/es/useTranslation.js';import s from'./ext/i18next/dist/esm/i18next.js';import i from"styled-components";import{ArrowRight as l}from"./assets/icons/arrow-right.js";import{BubbleChatDone as o}from"./assets/widget-icons/normal/bubbleChatDone.js";import{CommentAdd01 as a}from"./assets/widget-icons/normal/commentAdd01.js";import{CouponPercent as E}from"./assets/widget-icons/normal/couponPercent.js";import{DiscountTag02 as c}from"./assets/widget-icons/normal/discountTag02.js";import{Gift as m}from"./assets/widget-icons/normal/gift.js";import{MoneyAdd01 as u}from"./assets/widget-icons/normal/moneyAdd01.js";import{PackageDelivered as d}from"./assets/widget-icons/normal/packageDelivered.js";import{SaveMoneyDollar as R}from"./assets/widget-icons/normal/saveMoneyDollar.js";import{ShoppingBasketAdd02 as p}from"./assets/widget-icons/normal/shoppingBasketAdd02.js";import{UserAdd01 as T}from"./assets/widget-icons/normal/userAdd01.js";import{Refund as _}from"./assets/widget-icons/normal/refund.js";import{UsersIllustration as S}from"./assets/widget-icons/illustraions/usersIllustration.js";import{BubbleChatIllustration as I}from"./assets/widget-icons/illustraions/bubbleChatIllustration.js";import{ApprovedChatIllustration as
|
|
1
|
+
import{__makeTemplateObject as e,__assign as t}from'./ext/tslib/tslib.es6.mjs.js';import n from"react";import'./ext/react-i18next/dist/es/context.js';import{useTranslation as r}from'./ext/react-i18next/dist/es/useTranslation.js';import s from'./ext/i18next/dist/esm/i18next.js';import i from"styled-components";import{ArrowRight as l}from"./assets/icons/arrow-right.js";import{BubbleChatDone as o}from"./assets/widget-icons/normal/bubbleChatDone.js";import{CommentAdd01 as a}from"./assets/widget-icons/normal/commentAdd01.js";import{CouponPercent as E}from"./assets/widget-icons/normal/couponPercent.js";import{DiscountTag02 as c}from"./assets/widget-icons/normal/discountTag02.js";import{Gift as m}from"./assets/widget-icons/normal/gift.js";import{MoneyAdd01 as u}from"./assets/widget-icons/normal/moneyAdd01.js";import{PackageDelivered as d}from"./assets/widget-icons/normal/packageDelivered.js";import{SaveMoneyDollar as R}from"./assets/widget-icons/normal/saveMoneyDollar.js";import{ShoppingBasketAdd02 as p}from"./assets/widget-icons/normal/shoppingBasketAdd02.js";import{UserAdd01 as T}from"./assets/widget-icons/normal/userAdd01.js";import{Refund as _}from"./assets/widget-icons/normal/refund.js";import{UsersIllustration as S}from"./assets/widget-icons/illustraions/usersIllustration.js";import{BubbleChatIllustration as I}from"./assets/widget-icons/illustraions/bubbleChatIllustration.js";import{ApprovedChatIllustration as f}from"./assets/widget-icons/illustraions/approvedChatIllustration.js";import{TshirtIllustration as O}from"./assets/widget-icons/illustraions/tshirtIllustration.js";import{Medal as g}from"./assets/widget-icons/illustraions/medal.js";import{GiftIllustration as N}from"./assets/widget-icons/illustraions/giftIllustration.js";import{ShippingBox as C}from"./assets/widget-icons/illustraions/shippingBox.js";import{BigSaleMedal as M}from"./assets/widget-icons/illustraions/bigSaleMedal.js";import{ShoppingCartIllustration as U}from"./assets/widget-icons/illustraions/shoppingCartIllustration.js";import{RefundIllustration as D}from"./assets/widget-icons/illustraions/refundIllustration.js";import{BankCoin as h}from"./assets/widget-icons/illustraions/bankCoin.js";import{WidgetIconTypeEnum as A}from"./models/loyalty-widget/types/index.js";import{EarningMethodTypeEnum as y,LoyaltyWidgetScreenTypeEnum as x,LoyaltyProgramPointEarningTypeEnum as P,LoyaltyProgramMethodSpendingTypeEnum as j}from"./models/types/index.js";import{FlexibleValueContainer as L}from"./renderer/components/flexible-value-container/index.js";import{textSM as w,textXSMedium as v,textXS as b}from"./renderer/components/style/typography.js";var G,B,F,Y,H,V,k,W,X,J="ikas-storefront-widget",q=function(){try{var e=localStorage.getItem("ikas_session_id");return e&&JSON.parse(e).id||null}catch(e){return null}},z=function(){try{var e=localStorage.getItem(J);return e?JSON.parse(e):{}}catch(e){return{}}},K=function(e){try{var n=z(),r=t(t({},n),e);localStorage.setItem(J,JSON.stringify(r))}catch(e){}},Q=function(){var e=q();return!!e&&z().closedDescriptionSessionId===e},Z=function(){var e=q();e&&K({closedDescriptionSessionId:e})},$=function(){return!0===z().isDescriptionPermanentlyClosed},ee=function(){K({isDescriptionPermanentlyClosed:!0})},te=((G={})[A.ILLUSTRATION]=((B={})[y.CUSTOMER_REGISTER]=n.createElement(S,null),B[y.ENABLE_SUBSCRIPTION]=n.createElement(f,null),B[y.BUY_PRODUCT]=n.createElement(O,null),B[y.CUSTOMER_REVIEW]=n.createElement(I,null),B[y.CUSTOMER_SEGMENT]=n.createElement(E,null),B[y.ORDER_CREATE]=n.createElement(U,null),B),G[A.NORMAL]=((F={})[y.CUSTOMER_REGISTER]=n.createElement(T,null),F[y.ENABLE_SUBSCRIPTION]=n.createElement(o,null),F[y.BUY_PRODUCT]=n.createElement(R,null),F[y.CUSTOMER_REVIEW]=n.createElement(a,null),F[y.CUSTOMER_SEGMENT]=n.createElement(E,null),F[y.ORDER_CREATE]=n.createElement(p,null),F),G),ne=((Y={})[A.ILLUSTRATION]=((H={})[x.MAIN_SCREEN]=n.createElement("div",null),H[x.CREDIT_EARNING_METHODS_SCREEN]=n.createElement(g,null),H[x.CREDIT_SPENDING_METHODS_SCREEN]=n.createElement(M,null),H[x.CREDIT_HISTORY_SCREEN]=n.createElement("div",null),H[x.LOYALTY_LEVEL_SCREEN]=n.createElement("div",null),H[x.GIFT_PRODUCT_SELECTION_SCREEN]=n.createElement(N,null),H),Y[A.NORMAL]=((V={})[x.MAIN_SCREEN]=n.createElement("div",null),V[x.CREDIT_EARNING_METHODS_SCREEN]=n.createElement(u,null),V[x.CREDIT_SPENDING_METHODS_SCREEN]=n.createElement(E,null),V[x.CREDIT_HISTORY_SCREEN]=n.createElement("div",null),V[x.LOYALTY_LEVEL_SCREEN]=n.createElement("div",null),V[x.GIFT_PRODUCT_SELECTION_SCREEN]=n.createElement(m,null),V),Y),re=function(e,t){return t&&t!==A.NONE&&ne[t]?ne[t][e]:null},se=function(e,t){return t&&t!==A.NONE&&te[t]?te[t][e]:null},ie=function(e){var t=r().t;switch(e){case y.CUSTOMER_REGISTER:return t("history.earningMethodLabels.CUSTOMER_REGISTER");case y.ENABLE_SUBSCRIPTION:return t("history.earningMethodLabels.ENABLE_SUBSCRIPTION");case y.CUSTOMER_REVIEW:return t("history.earningMethodLabels.CUSTOMER_REVIEW");case y.ORDER_CREATE:return t("history.earningMethodLabels.ORDER_CREATE");case y.BUY_PRODUCT:return t("history.earningMethodLabels.BUY_PRODUCT");case y.CUSTOMER_SEGMENT:return t("history.earningMethodLabels.CUSTOMER_SEGMENT");default:return""}},le=function(e){var t=r().t;switch(e.methodType){case y.CUSTOMER_REGISTER:return t("earningMethods.CUSTOMER_REGISTER.title");case y.ENABLE_SUBSCRIPTION:return t("earningMethods.ENABLE_SUBSCRIPTION.title");case y.CUSTOMER_REVIEW:return t("earningMethods.CUSTOMER_REVIEW.title");case y.ORDER_CREATE:if(e.pointEarningType===P.DYNAMIC_ORDER_AMOUNT)return t("earningMethods.ORDER_CREATE.RECEIVE_POINTS_ON_SPEND.title");if(e.pointEarningType===P.STATIC)return t("earningMethods.ORDER_CREATE.BASE.title");case y.BUY_PRODUCT:return t("earningMethods.BUY_PRODUCT.title");case y.CUSTOMER_SEGMENT:return t("earningMethods.CUSTOMER_SEGMENT.title");default:return""}},oe=function(e,t){var r,s,i;return t===A.NONE?null:((r={})[A.ILLUSTRATION]=((s={})[j.FIXED_AMOUNT]=n.createElement(h,null),s[j.RATIO]=n.createElement(h,null),s[j.FREE_PRODUCT]=n.createElement(N,null),s[j.FREE_SHIPPING]=n.createElement(C,null),s),r[A.NORMAL]=((i={})[j.FIXED_AMOUNT]=n.createElement(c,null),i[j.RATIO]=n.createElement(c,null),i[j.FREE_PRODUCT]=n.createElement(m,null),i[j.FREE_SHIPPING]=n.createElement(d,null),i),r)[t][e]},ae=function(e){var t;return e&&e!==A.NONE?((t={})[A.ILLUSTRATION]=n.createElement(D,null),t[A.NORMAL]=n.createElement(_,null),t)[e]:null},Ee=function(e){var t,n=r().t,i=s.language,l=null===(t=e.translations)||void 0===t?void 0:t.find(function(e){return e.locale===i});if(null==l?void 0:l.description)return l.description;if(e.description)return e.description;switch(e.type){case j.FIXED_AMOUNT:return e.isDynamic?n("spendingMethods.FIXED_AMOUNT.dynamicTitle"):n("spendingMethods.FIXED_AMOUNT.title");case j.RATIO:return n("spendingMethods.RATIO.title");case j.FREE_SHIPPING:return n("spendingMethods.FREE_SHIPPING.title");case j.FREE_PRODUCT:return n("spendingMethods.FREE_PRODUCT.title");default:return""}},ce=i.span(k||(k=e(["\n display: flex;\n padding: 2px 8px;\n justify-content: center;\n align-items: center;\n gap: 6px;\n border-radius: 6px;\n border: 0.6px solid #cdd5df;\n opacity: 0.8;\n background: #f8fafc;\n ","\n color: #121926;\n\n @media (max-width: 600px) {\n ","\n }\n"],["\n display: flex;\n padding: 2px 8px;\n justify-content: center;\n align-items: center;\n gap: 6px;\n border-radius: 6px;\n border: 0.6px solid #cdd5df;\n opacity: 0.8;\n background: #f8fafc;\n ","\n color: #121926;\n\n @media (max-width: 600px) {\n ","\n }\n"])),w,v),me=i.span(W||(W=e(["\n ","\n color: #364152;\n\n @media (max-width: 600px) {\n ","\n }\n"],["\n ","\n color: #364152;\n\n @media (max-width: 600px) {\n ","\n }\n"])),w,b),ue=i.span(X||(X=e(["\n color: #697586;\n display: flex;\n align-items: center;\n"],["\n color: #697586;\n display: flex;\n align-items: center;\n"]))),de=function(e,t){var s,i,o=r().t,a=(null===(s=e.discountSettings)||void 0===s?void 0:s.point)||0,E=null===(i=e.discountSettings)||void 0===i?void 0:i.discountAmount,c=function(e,r){return void 0===r&&(r=!1),n.createElement(L,null,function(s){return s?n.createElement(n.Fragment,null,n.createElement(me,null,o("earningMethods.xPoints",{points:a})),n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},n.createElement(ue,null,n.createElement(l,null)),n.createElement(ce,null,r&&"number"==typeof e?t.formatCurrency(e):e))):n.createElement(n.Fragment,null,n.createElement(me,null,o("earningMethods.xPoints",{points:a})),n.createElement(ue,null,n.createElement(l,null)),n.createElement(ce,null,r&&"number"==typeof e?t.formatCurrency(e):e))})};return e.type===j.FIXED_AMOUNT&&E?c(E,!0):e.type===j.RATIO&&E?c("%".concat(E)):o("earningMethods.xPoints",{points:a})};export{se as getEarningMethodIcon,le as getEarningMethodTitle,ie as getHistoryEarningMethodLabel,q as getIkasSessionId,ae as getRefundIcon,re as getScreenIcon,de as getSpendingMethodDescription,oe as getSpendingMethodIcon,Ee as getSpendingMethodTitle,z as getWidgetStorage,Q as isDescriptionClosedForCurrentSession,$ as isDescriptionPermanentlyClosed,Z as markDescriptionClosedForSession,ee as markDescriptionPermanentlyClosed,K as setWidgetStorage};
|