@ikas/loyalty-widget-renderer 1.0.0-alpha.1
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/_virtual/index.js +1 -0
- package/build/_virtual/index2.js +1 -0
- package/build/_virtual/index3.js +1 -0
- package/build/_virtual/react-is.development.js +1 -0
- package/build/_virtual/react-is.development2.js +1 -0
- package/build/_virtual/react-is.production.js +1 -0
- package/build/_virtual/react-is.production.min.js +1 -0
- package/build/_virtual/use-sync-external-store-shim.development.js +1 -0
- package/build/_virtual/use-sync-external-store-shim.production.js +1 -0
- package/build/assets/badgeLevel1.d.ts +2 -0
- package/build/assets/badgeLevel1.js +1 -0
- package/build/assets/badgeLevel2.d.ts +2 -0
- package/build/assets/badgeLevel2.js +1 -0
- package/build/assets/badgeLevel3.d.ts +2 -0
- package/build/assets/badgeLevel3.js +1 -0
- package/build/assets/badgeLevel4.d.ts +2 -0
- package/build/assets/badgeLevel4.js +1 -0
- package/build/assets/icons/check-circle-fill.d.ts +2 -0
- package/build/assets/icons/check-circle-fill.js +1 -0
- package/build/assets/icons/check.d.ts +2 -0
- package/build/assets/icons/check.js +1 -0
- package/build/assets/icons/chevron-left.d.ts +2 -0
- package/build/assets/icons/chevron-left.js +1 -0
- package/build/assets/icons/x-close.d.ts +2 -0
- package/build/assets/icons/x-close.js +1 -0
- package/build/assets/index.d.ts +27 -0
- package/build/assets/widget-icons/illustraions/approvedChatIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/approvedChatIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/bankCoin.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/bankCoin.js +1 -0
- package/build/assets/widget-icons/illustraions/bigSaleMedal.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/bigSaleMedal.js +1 -0
- package/build/assets/widget-icons/illustraions/bubbleChatIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/bubbleChatIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/giftIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/giftIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/medal.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/medal.js +1 -0
- package/build/assets/widget-icons/illustraions/shippingBox.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/shippingBox.js +1 -0
- package/build/assets/widget-icons/illustraions/shoppingCartIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/shoppingCartIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/tshirtIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/tshirtIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/usersIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/usersIllustration.js +1 -0
- package/build/assets/widget-icons/normal/bubbleChatDone.d.ts +2 -0
- package/build/assets/widget-icons/normal/bubbleChatDone.js +1 -0
- package/build/assets/widget-icons/normal/commentAdd01.d.ts +2 -0
- package/build/assets/widget-icons/normal/commentAdd01.js +1 -0
- package/build/assets/widget-icons/normal/couponPercent.d.ts +2 -0
- package/build/assets/widget-icons/normal/couponPercent.js +1 -0
- package/build/assets/widget-icons/normal/discountTag02.d.ts +2 -0
- package/build/assets/widget-icons/normal/discountTag02.js +1 -0
- package/build/assets/widget-icons/normal/gift.d.ts +2 -0
- package/build/assets/widget-icons/normal/gift.js +1 -0
- package/build/assets/widget-icons/normal/moneyAdd01.d.ts +2 -0
- package/build/assets/widget-icons/normal/moneyAdd01.js +1 -0
- package/build/assets/widget-icons/normal/packageDelivered.d.ts +2 -0
- package/build/assets/widget-icons/normal/packageDelivered.js +1 -0
- package/build/assets/widget-icons/normal/saveMoneyDollar.d.ts +2 -0
- package/build/assets/widget-icons/normal/saveMoneyDollar.js +1 -0
- package/build/assets/widget-icons/normal/shoppingBasketAdd02.d.ts +2 -0
- package/build/assets/widget-icons/normal/shoppingBasketAdd02.js +1 -0
- package/build/assets/widget-icons/normal/userAdd01.d.ts +2 -0
- package/build/assets/widget-icons/normal/userAdd01.js +1 -0
- package/build/ext/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js +1 -0
- package/build/ext/@emotion/memoize/dist/memoize.browser.esm.js +1 -0
- package/build/ext/@emotion/stylis/dist/stylis.browser.esm.js +1 -0
- package/build/ext/@emotion/unitless/dist/unitless.browser.esm.js +1 -0
- package/build/ext/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -0
- package/build/ext/hoist-non-react-statics/ext/react-is/cjs/react-is.development.js +9 -0
- package/build/ext/hoist-non-react-statics/ext/react-is/cjs/react-is.production.min.js +9 -0
- package/build/ext/hoist-non-react-statics/ext/react-is/index.js +1 -0
- package/build/ext/i18next/dist/esm/i18next.js +1 -0
- package/build/ext/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js +1 -0
- package/build/ext/react-i18next/dist/es/context.js +1 -0
- package/build/ext/react-i18next/dist/es/defaults.js +1 -0
- package/build/ext/react-i18next/dist/es/i18nInstance.js +1 -0
- package/build/ext/react-i18next/dist/es/initReactI18next.js +1 -0
- package/build/ext/react-i18next/dist/es/unescape.js +1 -0
- package/build/ext/react-i18next/dist/es/useTranslation.js +1 -0
- package/build/ext/react-i18next/dist/es/utils.js +1 -0
- package/build/ext/react-is/cjs/react-is.development.js +10 -0
- package/build/ext/react-is/cjs/react-is.production.js +10 -0
- package/build/ext/react-is/index.js +1 -0
- package/build/ext/styled-components/dist/styled-components.browser.esm.js +1 -0
- package/build/ext/tslib/tslib.es6.mjs.js +1 -0
- package/build/ext/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +10 -0
- package/build/ext/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +10 -0
- package/build/ext/use-sync-external-store/shim/index.js +1 -0
- package/build/ext/uuid/dist/esm-browser/md5.js +1 -0
- package/build/ext/uuid/dist/esm-browser/parse.js +1 -0
- package/build/ext/uuid/dist/esm-browser/regex.js +1 -0
- package/build/ext/uuid/dist/esm-browser/rng.js +1 -0
- package/build/ext/uuid/dist/esm-browser/sha1.js +1 -0
- package/build/ext/uuid/dist/esm-browser/stringify.js +1 -0
- package/build/ext/uuid/dist/esm-browser/v3.js +1 -0
- package/build/ext/uuid/dist/esm-browser/v35.js +1 -0
- package/build/ext/uuid/dist/esm-browser/v4.js +1 -0
- package/build/ext/uuid/dist/esm-browser/v5.js +1 -0
- package/build/ext/uuid/dist/esm-browser/validate.js +1 -0
- package/build/index.d.ts +12 -0
- package/build/index.js +1 -0
- package/build/models/base.d.ts +4 -0
- package/build/models/base.js +1 -0
- package/build/models/button/index.d.ts +7 -0
- package/build/models/button/index.js +1 -0
- package/build/models/category/index.d.ts +5 -0
- package/build/models/image/index.d.ts +12 -0
- package/build/models/image/index.js +1 -0
- package/build/models/index.d.ts +28 -0
- package/build/models/index.js +1 -0
- package/build/models/loyalty-customer-info/index.d.ts +28 -0
- package/build/models/loyalty-customer-info/index.js +1 -0
- package/build/models/loyalty-program-earning-method/index.d.ts +51 -0
- package/build/models/loyalty-program-earning-method/index.js +1 -0
- package/build/models/loyalty-program-point-history/index.d.ts +17 -0
- package/build/models/loyalty-program-point-history/index.js +1 -0
- package/build/models/loyalty-program-spending-method/index.d.ts +38 -0
- package/build/models/loyalty-program-spending-method/index.js +1 -0
- package/build/models/loyalty-widget/header/header-background/index.d.ts +9 -0
- package/build/models/loyalty-widget/header/header-background/index.js +1 -0
- package/build/models/loyalty-widget/header/index.d.ts +8 -0
- package/build/models/loyalty-widget/header/index.js +1 -0
- package/build/models/loyalty-widget/header-background/index.d.ts +9 -0
- package/build/models/loyalty-widget/index.d.ts +12 -0
- package/build/models/loyalty-widget/index.js +1 -0
- package/build/models/loyalty-widget/settings/index.d.ts +10 -0
- package/build/models/loyalty-widget/settings/index.js +1 -0
- package/build/models/loyalty-widget/types/index.d.ts +29 -0
- package/build/models/loyalty-widget/types/index.js +1 -0
- package/build/models/types/index.d.ts +145 -0
- package/build/models/types/index.js +1 -0
- package/build/renderer/components/button/index.d.ts +15 -0
- package/build/renderer/components/button/index.js +1 -0
- package/build/renderer/components/button/style.d.ts +15 -0
- package/build/renderer/components/button/style.js +1 -0
- package/build/renderer/components/index.d.ts +3 -0
- package/build/renderer/components/loyalty-method-card/index.d.ts +23 -0
- package/build/renderer/components/loyalty-method-card/index.js +1 -0
- package/build/renderer/components/loyalty-method-card/style.d.ts +22 -0
- package/build/renderer/components/loyalty-method-card/style.js +1 -0
- package/build/renderer/components/section-title/index.d.ts +8 -0
- package/build/renderer/components/section-title/index.js +1 -0
- package/build/renderer/components/section-title/style.d.ts +1 -0
- package/build/renderer/components/section-title/style.js +1 -0
- package/build/renderer/components/style/typography.d.ts +11 -0
- package/build/renderer/components/style/typography.js +1 -0
- package/build/renderer/index.d.ts +5 -0
- package/build/renderer/index.js +1 -0
- package/build/renderer/screens/credit-earning-methods-screen/index.d.ts +9 -0
- package/build/renderer/screens/credit-earning-methods-screen/index.js +1 -0
- package/build/renderer/screens/credit-earning-methods-screen/style.d.ts +5 -0
- package/build/renderer/screens/credit-earning-methods-screen/style.js +1 -0
- package/build/renderer/screens/credit-history-screen/index.d.ts +9 -0
- package/build/renderer/screens/credit-history-screen/index.js +1 -0
- package/build/renderer/screens/credit-history-screen/style.d.ts +17 -0
- package/build/renderer/screens/credit-history-screen/style.js +1 -0
- package/build/renderer/screens/credit-spending-methods-screen/index.d.ts +9 -0
- package/build/renderer/screens/credit-spending-methods-screen/index.js +1 -0
- package/build/renderer/screens/credit-spending-methods-screen/style.d.ts +8 -0
- package/build/renderer/screens/credit-spending-methods-screen/style.js +1 -0
- package/build/renderer/screens/loyalty-level-screen/index.d.ts +9 -0
- package/build/renderer/screens/loyalty-level-screen/index.js +1 -0
- package/build/renderer/screens/loyalty-level-screen/style.d.ts +32 -0
- package/build/renderer/screens/loyalty-level-screen/style.js +1 -0
- package/build/renderer/screens/main-screen/earning-methods-section/index.d.ts +14 -0
- package/build/renderer/screens/main-screen/earning-methods-section/index.js +1 -0
- package/build/renderer/screens/main-screen/header/auth-user-section/index.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/auth-user-section/index.js +1 -0
- package/build/renderer/screens/main-screen/header/auth-user-section/style.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/auth-user-section/style.js +1 -0
- package/build/renderer/screens/main-screen/header/index.d.ts +10 -0
- package/build/renderer/screens/main-screen/header/index.js +1 -0
- package/build/renderer/screens/main-screen/header/logo-section/index.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/logo-section/index.js +1 -0
- package/build/renderer/screens/main-screen/header/logo-section/style.d.ts +2 -0
- package/build/renderer/screens/main-screen/header/logo-section/style.js +1 -0
- package/build/renderer/screens/main-screen/header/style.d.ts +12 -0
- package/build/renderer/screens/main-screen/header/style.js +1 -0
- package/build/renderer/screens/main-screen/header/title-section/index.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/title-section/index.js +1 -0
- package/build/renderer/screens/main-screen/header/title-section/style.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/title-section/style.js +1 -0
- package/build/renderer/screens/main-screen/header/user-logged-section/index.d.ts +7 -0
- package/build/renderer/screens/main-screen/header/user-logged-section/index.js +1 -0
- package/build/renderer/screens/main-screen/header/user-logged-section/style.d.ts +18 -0
- package/build/renderer/screens/main-screen/header/user-logged-section/style.js +1 -0
- package/build/renderer/screens/main-screen/index.d.ts +9 -0
- package/build/renderer/screens/main-screen/index.js +1 -0
- package/build/renderer/screens/main-screen/program-info-section/index.d.ts +8 -0
- package/build/renderer/screens/main-screen/program-info-section/index.js +1 -0
- package/build/renderer/screens/main-screen/program-info-section/style.d.ts +8 -0
- package/build/renderer/screens/main-screen/program-info-section/style.js +1 -0
- package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.d.ts +9 -0
- package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.js +1 -0
- package/build/renderer/screens/main-screen/spending-methods-section/index.d.ts +13 -0
- package/build/renderer/screens/main-screen/spending-methods-section/index.js +1 -0
- package/build/renderer/screens/main-screen/style.d.ts +5 -0
- package/build/renderer/screens/main-screen/style.js +1 -0
- package/build/renderer/style.d.ts +6 -0
- package/build/renderer/style.js +1 -0
- package/build/renderer/utils/i18n.d.ts +2 -0
- package/build/renderer/utils/i18n.js +1 -0
- package/build/renderer/utils/locales/en.json.js +1 -0
- package/build/renderer/utils/locales/tr.json.js +1 -0
- package/build/renderer/utils/loyalty-details.d.ts +12 -0
- package/build/renderer/utils/loyalty-details.js +1 -0
- package/build/renderer/utils/translations.d.ts +5 -0
- package/build/utils.d.ts +10 -0
- package/build/utils.js +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__spreadArray as e}from'./../../ext/tslib/tslib.es6.mjs.js';import{EarningMethodTypeEnum as n,LoyaltyProgramPointEarningTypeEnum as r,LoyaltyProgramFilterTypeEnum as t}from"../../models/types/index.js";var i=function(e,n,r){if(!r||0===r.length)return[];var i=[];return r.forEach(function(r){var a="";switch(n){case t.CATEGORY:case t.DYNAMIC_CATEGORY:if(e.categories){var o=e.categories.find(function(e){return e.id===r});o&&(a=o.name)}break;case t.PRODUCT_AND_VARIANT:if(e.products){var s=e.products.find(function(e){return e.id===r});s&&(a=s.name)}break;case t.PRODUCT_BRAND:if(e.brands){var c=e.brands.find(function(e){return e.id===r});c&&(a=c.name)}break;case t.PRODUCT_TAG:if(e.tags){var u=e.tags.find(function(e){return e.id===r});u&&(a=u.name)}}a?i.push({type:n,name:a,id:r}):i.push({type:n,name:r,id:r})}),i},a=function(e,n){if(e.products){var r=e.products.find(function(e){return e.id===n});return r?r.name:void 0}},o=function(a,o,s){var c,u,d=s.currency;switch(o.methodType){case n.CUSTOMER_REGISTER:case n.CUSTOMER_REVIEW:case n.ENABLE_SUBSCRIPTION:return a("earningMethods.xPoints",{points:o.pointsEarned});case n.ORDER_CREATE:var E=e(e([],(null===(c=o.productSettings)||void 0===c?void 0:c.productFilters)||[],!0),(null===(u=o.orderSettings)||void 0===u?void 0:u.productFilters)||[],!0),R=E.reduce(function(e,n){return e.concat(i(s,n.type,n.idList))},[]),A=R.map(function(e){switch(e.type){case t.CATEGORY:case t.DYNAMIC_CATEGORY:return a("earningMethods.ORDER_CREATE.BASE.genericCategory",{category:e.name});case t.PRODUCT_AND_VARIANT:return a("earningMethods.ORDER_CREATE.BASE.genericProduct",{product:e.name});case t.PRODUCT_BRAND:return a("earningMethods.ORDER_CREATE.BASE.genericBrand",{brand:e.name});case t.PRODUCT_TAG:return a("earningMethods.ORDER_CREATE.BASE.genericTag",{tag:e.name});default:return e.name}}).filter(Boolean).join(", "),m=o.orderSettings||{},f=m.minOrderAmount,T=m.maxOrderAmount,p="number"==typeof T&&T>0,g="";switch("number"==typeof f&&f>0?g=a("earningMethods.ORDER_CREATE.BASE.descriptionStaticMinimum",{amount:f,currency:d}):p&&(g=a("earningMethods.ORDER_CREATE.BASE.descriptionStaticMaximum",{amount:T,currency:d})),o.pointEarningType){case r.DYNAMIC_ORDER_AMOUNT:return(C=[A,g,a("earningMethods.ORDER_CREATE.RECEIVE_POINTS_ON_SPEND.description",{amount:o.amountPerPointsEarned,currency:d,points:o.pointsEarned})].filter(Boolean)).join(" ");case r.STATIC:var C;return 0===(C=[A,g].filter(Boolean)).length?void E.length:!g&&A?A+" "+a("earningMethods.ORDER_CREATE.BASE.descriptionSuffix"):C.join(", ")}break;default:return""}};export{o as getEarningMethodDescriptionV2,i as getFilterDetails,a as getFreeProductName};
|
package/build/utils.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EarningMethodTypeEnum, LoyaltyProgramMethodSpendingTypeEnum } from "models/types";
|
|
3
|
+
import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
|
|
4
|
+
import { LoyaltyProgramEarningMethod } from "models/loyalty-program-earning-method";
|
|
5
|
+
import { LoyaltyProgramSpendingMethod } from "models/loyalty-program-spending-method";
|
|
6
|
+
export declare const getEarningMethodIcon: (earningMethod: EarningMethodTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element;
|
|
7
|
+
export declare const getEarningMethodTitle: (earningMethod: LoyaltyProgramEarningMethod) => string;
|
|
8
|
+
export declare const getSpendingMethodIcon: (spendingMethod: LoyaltyProgramMethodSpendingTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element | null;
|
|
9
|
+
export declare const getSpendingMethodTitle: (method: LoyaltyProgramSpendingMethod) => string;
|
|
10
|
+
export declare const getSpendingMethodDescription: (method: LoyaltyProgramSpendingMethod, currency: string) => string | React.JSX.Element;
|
package/build/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__makeTemplateObject as e}from'./ext/tslib/tslib.es6.mjs.js';import t from"react";import{EarningMethodTypeEnum as n,LoyaltyProgramPointEarningTypeEnum as s,LoyaltyProgramMethodSpendingTypeEnum as r}from"./models/types/index.js";import{BubbleChatDone as o}from"./assets/widget-icons/normal/bubbleChatDone.js";import{CommentAdd01 as i}from"./assets/widget-icons/normal/commentAdd01.js";import{CouponPercent as l}from"./assets/widget-icons/normal/couponPercent.js";import{DiscountTag02 as a}from"./assets/widget-icons/normal/discountTag02.js";import{Gift as E}from"./assets/widget-icons/normal/gift.js";import{PackageDelivered as d}from"./assets/widget-icons/normal/packageDelivered.js";import{SaveMoneyDollar as m}from"./assets/widget-icons/normal/saveMoneyDollar.js";import{ShoppingBasketAdd02 as c}from"./assets/widget-icons/normal/shoppingBasketAdd02.js";import{UserAdd01 as u}from"./assets/widget-icons/normal/userAdd01.js";import{UsersIllustration as p}from"./assets/widget-icons/illustraions/usersIllustration.js";import{BubbleChatIllustration as R}from"./assets/widget-icons/illustraions/bubbleChatIllustration.js";import{ApprovedChatIllustration as T}from"./assets/widget-icons/illustraions/approvedChatIllustration.js";import{TshirtIllustration as g}from"./assets/widget-icons/illustraions/tshirtIllustration.js";import{GiftIllustration as f}from"./assets/widget-icons/illustraions/giftIllustration.js";import{ShippingBox as I}from"./assets/widget-icons/illustraions/shippingBox.js";import{ShoppingCartIllustration as _}from"./assets/widget-icons/illustraions/shoppingCartIllustration.js";import{WidgetIconTypeEnum as O}from"./models/loyalty-widget/types/index.js";import S from'./ext/i18next/dist/esm/i18next.js';import{BankCoin as M}from"./assets/widget-icons/illustraions/bankCoin.js";import'./ext/react-i18next/dist/es/context.js';import'./ext/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js';import{useTranslation as C}from'./ext/react-i18next/dist/es/useTranslation.js';import{textSM as U}from"./renderer/components/style/typography.js";import N from'./ext/styled-components/dist/styled-components.browser.esm.js';var A,j,x,h,y,D,P=((A={})[O.ILLUSTRATION]=((j={})[n.CUSTOMER_REGISTER]=t.createElement(p,null),j[n.ENABLE_SUBSCRIPTION]=t.createElement(T,null),j[n.BUY_PRODUCT]=t.createElement(g,null),j[n.CUSTOMER_REVIEW]=t.createElement(R,null),j[n.CUSTOMER_SEGMENT]=t.createElement(l,null),j[n.ORDER_CREATE]=t.createElement(_,null),j),A[O.NORMAL]=((x={})[n.CUSTOMER_REGISTER]=t.createElement(u,null),x[n.ENABLE_SUBSCRIPTION]=t.createElement(o,null),x[n.BUY_PRODUCT]=t.createElement(m,null),x[n.CUSTOMER_REVIEW]=t.createElement(i,null),x[n.CUSTOMER_SEGMENT]=t.createElement(l,null),x[n.ORDER_CREATE]=t.createElement(c,null),x),A),w=function(e,t){return P[t][e]},b=function(e){var t=C().t;switch(e.methodType){case n.CUSTOMER_REGISTER:return t("earningMethods.CUSTOMER_REGISTER.title");case n.ENABLE_SUBSCRIPTION:return t("earningMethods.ENABLE_SUBSCRIPTION.title");case n.CUSTOMER_REVIEW:return t("earningMethods.CUSTOMER_REVIEW.title");case n.ORDER_CREATE:if(e.pointEarningType===s.DYNAMIC_ORDER_AMOUNT)return t("earningMethods.ORDER_CREATE.RECEIVE_POINTS_ON_SPEND.title");if(e.pointEarningType===s.STATIC)return t("earningMethods.ORDER_CREATE.BASE.title");case n.BUY_PRODUCT:return t("earningMethods.BUY_PRODUCT.title");case n.CUSTOMER_SEGMENT:return t("earningMethods.CUSTOMER_SEGMENT.title");default:return""}},v=function(e,n){var s,o,i;return n===O.NONE?null:((s={})[O.ILLUSTRATION]=((o={})[r.FIXED_AMOUNT]=t.createElement(M,null),o[r.RATIO]=t.createElement(M,null),o[r.FREE_PRODUCT]=t.createElement(f,null),o[r.FREE_SHIPPING]=t.createElement(I,null),o),s[O.NORMAL]=((i={})[r.FIXED_AMOUNT]=t.createElement(a,null),i[r.RATIO]=t.createElement(a,null),i[r.FREE_PRODUCT]=t.createElement(E,null),i[r.FREE_SHIPPING]=t.createElement(d,null),i),s)[n][e]},B=function(e){var t=C().t,n=S.language,s=e.translations.find(function(e){return e.locale===n});if(null==s?void 0:s.description)return s.description;if(e.description)return e.description;switch(e.type){case r.FIXED_AMOUNT:return t("spendingMethods.FIXED_AMOUNT.title");case r.RATIO:return t("spendingMethods.RATIO.title");case r.FREE_SHIPPING:return t("spendingMethods.FREE_SHIPPING.title");case r.FREE_PRODUCT:return t("spendingMethods.FREE_PRODUCT.title");default:return""}},F=N.span(h||(h=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 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"])),U),G=N.span(y||(y=e(["\n ","\n color: #364152;\n"],["\n ","\n color: #364152;\n"])),U),L=N.span(D||(D=e(["\n color: #697586;\n"],["\n color: #697586;\n"]))),k=function(e,n){var s,o,i=C().t,l=(null===(s=e.discountSettings)||void 0===s?void 0:s.point)||0,a=null===(o=e.discountSettings)||void 0===o?void 0:o.discountAmount,E=function(e,s){return void 0===s&&(s=!1),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},t.createElement(G,null,i("earningMethods.xPoints",{points:l})),t.createElement(L,null,"→"),t.createElement(F,null,e," ",s&&n))};return e.type===r.FIXED_AMOUNT&&a?E(a,!0):e.type===r.RATIO&&a?E("%".concat(a)):i("earningMethods.xPoints",{points:l})};export{w as getEarningMethodIcon,b as getEarningMethodTitle,k as getSpendingMethodDescription,v as getSpendingMethodIcon,B as getSpendingMethodTitle};
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ikas/loyalty-widget-renderer",
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "ucy",
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"module": "./build/index.js",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"files": [
|
|
10
|
+
"build",
|
|
11
|
+
"build-cjs"
|
|
12
|
+
],
|
|
13
|
+
"types": "./build/index.d.ts",
|
|
14
|
+
"alias": {
|
|
15
|
+
"utils": "./src/utils.tsx",
|
|
16
|
+
"models": "./src/models",
|
|
17
|
+
"renderer": "./src/renderer",
|
|
18
|
+
"assets": "./src/assets"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"postinstall": "ts-patch install -s",
|
|
22
|
+
"prepack": "npm run build",
|
|
23
|
+
"pack": "npm pack",
|
|
24
|
+
"release": "npm publish",
|
|
25
|
+
"build": "rm -rf build && rollup -c",
|
|
26
|
+
"watch": "rollup -c -w",
|
|
27
|
+
"dev": "parcel app/index.html --port 3000"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@rollup/plugin-commonjs": "^22.0.0",
|
|
31
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
32
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
33
|
+
"@types/lodash": "^4.14.191",
|
|
34
|
+
"@types/node": "^12.0.0",
|
|
35
|
+
"@types/react": "^17 || ^18",
|
|
36
|
+
"@types/react-dom": "^17 || ^18",
|
|
37
|
+
"@types/styled-components": "5.1.26",
|
|
38
|
+
"@types/uuid": "^9.0.0",
|
|
39
|
+
"mobx": "^6.1.3",
|
|
40
|
+
"mobx-react": "^7.6.0",
|
|
41
|
+
"parcel": "^2.12.0",
|
|
42
|
+
"react": "^17 || ^18",
|
|
43
|
+
"react-dom": "^17 || ^18",
|
|
44
|
+
"rollup": "^2.75.6",
|
|
45
|
+
"rollup-plugin-import-css": "^3.5.0",
|
|
46
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
47
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
48
|
+
"rollup-plugin-rename-node-modules": "^1.2.0",
|
|
49
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
50
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
51
|
+
"styled-components": "5.3.3",
|
|
52
|
+
"ts-patch": "^3.3.0",
|
|
53
|
+
|
|
54
|
+
"typescript": "^5.9.3",
|
|
55
|
+
"typescript-transform-paths": "^3.5.5"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"mobx": "^6.1.3",
|
|
59
|
+
"mobx-react": "^7.6.0",
|
|
60
|
+
"react": "^17 || ^18",
|
|
61
|
+
"react-dom": "^17 || ^18"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"i18next": "^25.6.3",
|
|
65
|
+
"react-i18next": "^16.3.5",
|
|
66
|
+
"uuidv4": "^6.2.13"
|
|
67
|
+
}
|
|
68
|
+
}
|