@ikas/loyalty-widget-renderer 1.0.0-alpha.6 → 1.0.0-alpha.60

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.
Files changed (125) hide show
  1. package/build/assets/icons/arrow-right.d.ts +2 -0
  2. package/build/assets/icons/arrow-right.js +1 -0
  3. package/build/assets/index.d.ts +1 -0
  4. package/build/assets/widget-icons/illustraions/medal.js +1 -1
  5. package/build/ext/@babel/runtime/helpers/esm/arrayLikeToArray.js +1 -0
  6. package/build/ext/@babel/runtime/helpers/esm/arrayWithHoles.js +1 -0
  7. package/build/ext/@babel/runtime/helpers/esm/assertThisInitialized.js +1 -0
  8. package/build/ext/@babel/runtime/helpers/esm/classCallCheck.js +1 -0
  9. package/build/ext/@babel/runtime/helpers/esm/createClass.js +1 -0
  10. package/build/ext/@babel/runtime/helpers/esm/defineProperty.js +1 -0
  11. package/build/ext/@babel/runtime/helpers/esm/getPrototypeOf.js +1 -0
  12. package/build/ext/@babel/runtime/helpers/esm/inherits.js +1 -0
  13. package/build/ext/@babel/runtime/helpers/esm/iterableToArray.js +1 -0
  14. package/build/ext/@babel/runtime/helpers/esm/iterableToArrayLimit.js +1 -0
  15. package/build/ext/@babel/runtime/helpers/esm/nonIterableRest.js +1 -0
  16. package/build/ext/@babel/runtime/helpers/esm/possibleConstructorReturn.js +1 -0
  17. package/build/ext/@babel/runtime/helpers/esm/setPrototypeOf.js +1 -0
  18. package/build/ext/@babel/runtime/helpers/esm/slicedToArray.js +1 -0
  19. package/build/ext/@babel/runtime/helpers/esm/toArray.js +1 -0
  20. package/build/ext/@babel/runtime/helpers/esm/toPrimitive.js +1 -0
  21. package/build/ext/@babel/runtime/helpers/esm/toPropertyKey.js +1 -0
  22. package/build/ext/@babel/runtime/helpers/esm/typeof.js +1 -0
  23. package/build/ext/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +1 -0
  24. package/build/ext/i18next/dist/esm/i18next.js +1 -0
  25. package/build/ext/react-i18next/dist/es/I18nextProvider.js +1 -0
  26. package/build/ext/react-i18next/dist/es/context.js +1 -0
  27. package/build/ext/react-i18next/dist/es/unescape.js +1 -0
  28. package/build/ext/react-i18next/dist/es/useTranslation.js +1 -0
  29. package/build/ext/react-i18next/dist/es/utils.js +1 -0
  30. package/build/ext/tslib/tslib.es6.mjs.js +1 -1
  31. package/build/index.d.ts +5 -1
  32. package/build/index.js +1 -1
  33. package/build/injector.d.ts +5 -0
  34. package/build/models/common/index.d.ts +21 -0
  35. package/build/models/common/index.js +1 -0
  36. package/build/models/image/index.d.ts +2 -2
  37. package/build/models/image/index.js +1 -1
  38. package/build/models/index.d.ts +16 -5
  39. package/build/models/index.js +1 -1
  40. package/build/models/loyalty-customer-info/index.d.ts +7 -7
  41. package/build/models/loyalty-customer-info/index.js +1 -1
  42. package/build/models/loyalty-program-earning-method/index.d.ts +16 -30
  43. package/build/models/loyalty-program-earning-method/index.js +1 -1
  44. package/build/models/loyalty-program-point-history/index.d.ts +3 -3
  45. package/build/models/loyalty-program-point-history/index.js +1 -1
  46. package/build/models/loyalty-program-spending-method/index.d.ts +7 -20
  47. package/build/models/loyalty-program-spending-method/index.js +1 -1
  48. package/build/models/loyalty-widget/header/header-background/index.d.ts +1 -2
  49. package/build/models/loyalty-widget/header/header-background/index.js +1 -1
  50. package/build/models/loyalty-widget/header/index.d.ts +1 -1
  51. package/build/models/loyalty-widget/index.d.ts +2 -2
  52. package/build/models/loyalty-widget/index.js +1 -1
  53. package/build/models/loyalty-widget/settings/index.js +1 -1
  54. package/build/models/mini-mode/index.d.ts +7 -0
  55. package/build/models/mini-mode/index.js +1 -0
  56. package/build/models/types/index.d.ts +13 -36
  57. package/build/models/types/index.js +1 -1
  58. package/build/renderer/components/button/index.js +1 -1
  59. package/build/renderer/components/button/style.d.ts +1 -0
  60. package/build/renderer/components/button/style.js +1 -1
  61. package/build/renderer/components/count-up/index.d.ts +7 -0
  62. package/build/renderer/components/count-up/index.js +1 -0
  63. package/build/renderer/components/flexible-value-container/index.d.ts +16 -0
  64. package/build/renderer/components/flexible-value-container/index.js +1 -0
  65. package/build/renderer/components/loyalty-method-card/index.d.ts +2 -1
  66. package/build/renderer/components/loyalty-method-card/index.js +1 -1
  67. package/build/renderer/components/loyalty-method-card/style.js +1 -1
  68. package/build/renderer/components/mini-mode-button/index.d.ts +7 -0
  69. package/build/renderer/components/mini-mode-button/index.js +1 -0
  70. package/build/renderer/components/mini-mode-button/style.d.ts +6 -0
  71. package/build/renderer/components/mini-mode-button/style.js +1 -0
  72. package/build/renderer/components/mini-mode-description/index.d.ts +7 -0
  73. package/build/renderer/components/mini-mode-description/index.js +1 -0
  74. package/build/renderer/components/mini-mode-description/style.d.ts +3 -0
  75. package/build/renderer/components/mini-mode-description/style.js +1 -0
  76. package/build/renderer/components/style/icon-wrapper.d.ts +4 -0
  77. package/build/renderer/components/style/icon-wrapper.js +1 -0
  78. package/build/renderer/components/style/typography.d.ts +3 -1
  79. package/build/renderer/components/style/typography.js +1 -1
  80. package/build/renderer/index.js +1 -1
  81. package/build/renderer/screens/credit-earning-methods-screen/index.js +1 -1
  82. package/build/renderer/screens/credit-history-screen/index.js +1 -1
  83. package/build/renderer/screens/credit-history-screen/style.d.ts +3 -1
  84. package/build/renderer/screens/credit-history-screen/style.js +1 -1
  85. package/build/renderer/screens/credit-spending-methods-screen/index.js +1 -1
  86. package/build/renderer/screens/credit-spending-methods-screen/style.d.ts +3 -1
  87. package/build/renderer/screens/credit-spending-methods-screen/style.js +1 -1
  88. package/build/renderer/screens/loyalty-level-screen/index.js +1 -1
  89. package/build/renderer/screens/loyalty-level-screen/style.d.ts +6 -2
  90. package/build/renderer/screens/loyalty-level-screen/style.js +1 -1
  91. package/build/renderer/screens/main-screen/earning-methods-section/index.d.ts +1 -0
  92. package/build/renderer/screens/main-screen/earning-methods-section/index.js +1 -1
  93. package/build/renderer/screens/main-screen/header/auth-user-section/index.js +1 -1
  94. package/build/renderer/screens/main-screen/header/index.js +1 -1
  95. package/build/renderer/screens/main-screen/header/logo-section/index.js +1 -1
  96. package/build/renderer/screens/main-screen/header/logo-section/style.d.ts +3 -1
  97. package/build/renderer/screens/main-screen/header/logo-section/style.js +1 -1
  98. package/build/renderer/screens/main-screen/header/style.d.ts +11 -5
  99. package/build/renderer/screens/main-screen/header/style.js +1 -1
  100. package/build/renderer/screens/main-screen/header/title-section/index.js +1 -1
  101. package/build/renderer/screens/main-screen/header/title-section/style.js +1 -1
  102. package/build/renderer/screens/main-screen/header/user-logged-section/index.js +1 -1
  103. package/build/renderer/screens/main-screen/index.js +1 -1
  104. package/build/renderer/screens/main-screen/program-info-section/index.js +1 -1
  105. package/build/renderer/screens/main-screen/program-info-section/style.d.ts +11 -3
  106. package/build/renderer/screens/main-screen/program-info-section/style.js +1 -1
  107. package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.js +1 -1
  108. package/build/renderer/screens/main-screen/spending-methods-section/index.d.ts +1 -0
  109. package/build/renderer/screens/main-screen/spending-methods-section/index.js +1 -1
  110. package/build/renderer/screens/main-screen/style.js +1 -1
  111. package/build/renderer/style.d.ts +17 -2
  112. package/build/renderer/style.js +1 -1
  113. package/build/renderer/utils/i18n.js +1 -1
  114. package/build/renderer/utils/locales/en.json.js +1 -1
  115. package/build/renderer/utils/locales/tr.json.js +1 -1
  116. package/build/renderer/utils/loyalty-details.js +1 -1
  117. package/build/storefront-widget-script-injector.iife.js +68 -0
  118. package/build/storefront-widget-script-injector.iife.js.map +1 -0
  119. package/build/utils.d.ts +6 -4
  120. package/build/utils.js +1 -1
  121. package/package.json +19 -10
  122. package/build/models/base.d.ts +0 -4
  123. package/build/models/base.js +0 -1
  124. package/build/models/category/index.d.ts +0 -5
  125. package/build/models/loyalty-widget/header-background/index.d.ts +0 -9
package/build/utils.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  import React from "react";
2
- import { EarningMethodTypeEnum, LoyaltyProgramMethodSpendingTypeEnum } from "models/types";
3
- import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
2
+ import { LoyaltyWidgetViewModel } from "models";
4
3
  import { LoyaltyProgramEarningMethod } from "models/loyalty-program-earning-method";
5
4
  import { LoyaltyProgramSpendingMethod } from "models/loyalty-program-spending-method";
6
- export declare const getEarningMethodIcon: (earningMethod: EarningMethodTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element;
5
+ import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
6
+ import { EarningMethodTypeEnum, LoyaltyProgramMethodSpendingTypeEnum, LoyaltyWidgetScreenTypeEnum } from "models/types";
7
+ export declare const getScreenIcon: (screenType: LoyaltyWidgetScreenTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element | null;
8
+ export declare const getEarningMethodIcon: (earningMethod: EarningMethodTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element | null;
7
9
  export declare const getEarningMethodTitle: (earningMethod: LoyaltyProgramEarningMethod) => string;
8
10
  export declare const getSpendingMethodIcon: (spendingMethod: LoyaltyProgramMethodSpendingTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element | null;
9
11
  export declare const getSpendingMethodTitle: (method: LoyaltyProgramSpendingMethod) => string;
10
- export declare const getSpendingMethodDescription: (method: LoyaltyProgramSpendingMethod, currency: string) => string | React.JSX.Element;
12
+ export declare const getSpendingMethodDescription: (method: LoyaltyProgramSpendingMethod, viewModel: LoyaltyWidgetViewModel) => string | React.JSX.Element;
package/build/utils.js CHANGED
@@ -1 +1 @@
1
- import{__makeTemplateObject as e}from'./ext/tslib/tslib.es6.mjs.js';import t from"react";import{EarningMethodTypeEnum as n,LoyaltyProgramPointEarningTypeEnum as r,LoyaltyProgramMethodSpendingTypeEnum as s}from"./models/types/index.js";import{BubbleChatDone as i}from"./assets/widget-icons/normal/bubbleChatDone.js";import{CommentAdd01 as o}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 c}from"./assets/widget-icons/normal/packageDelivered.js";import{SaveMoneyDollar as m}from"./assets/widget-icons/normal/saveMoneyDollar.js";import{ShoppingBasketAdd02 as d}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 O}from"./assets/widget-icons/illustraions/shoppingCartIllustration.js";import{WidgetIconTypeEnum as _}from"./models/loyalty-widget/types/index.js";import S from"i18next";import{BankCoin as M}from"./assets/widget-icons/illustraions/bankCoin.js";import{useTranslation as C}from"react-i18next";import{textSM as U}from"./renderer/components/style/typography.js";import N from"styled-components";var A,P,h,j,D,y,x=((A={})[_.ILLUSTRATION]=((P={})[n.CUSTOMER_REGISTER]=t.createElement(p,null),P[n.ENABLE_SUBSCRIPTION]=t.createElement(T,null),P[n.BUY_PRODUCT]=t.createElement(g,null),P[n.CUSTOMER_REVIEW]=t.createElement(R,null),P[n.CUSTOMER_SEGMENT]=t.createElement(l,null),P[n.ORDER_CREATE]=t.createElement(O,null),P),A[_.NORMAL]=((h={})[n.CUSTOMER_REGISTER]=t.createElement(u,null),h[n.ENABLE_SUBSCRIPTION]=t.createElement(i,null),h[n.BUY_PRODUCT]=t.createElement(m,null),h[n.CUSTOMER_REVIEW]=t.createElement(o,null),h[n.CUSTOMER_SEGMENT]=t.createElement(l,null),h[n.ORDER_CREATE]=t.createElement(d,null),h),A),w=function(e,t){return x[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===r.DYNAMIC_ORDER_AMOUNT)return t("earningMethods.ORDER_CREATE.RECEIVE_POINTS_ON_SPEND.title");if(e.pointEarningType===r.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 r,i,o;return n===_.NONE?null:((r={})[_.ILLUSTRATION]=((i={})[s.FIXED_AMOUNT]=t.createElement(M,null),i[s.RATIO]=t.createElement(M,null),i[s.FREE_PRODUCT]=t.createElement(f,null),i[s.FREE_SHIPPING]=t.createElement(I,null),i),r[_.NORMAL]=((o={})[s.FIXED_AMOUNT]=t.createElement(a,null),o[s.RATIO]=t.createElement(a,null),o[s.FREE_PRODUCT]=t.createElement(E,null),o[s.FREE_SHIPPING]=t.createElement(c,null),o),r)[n][e]},B=function(e){var t=C().t,n=S.language,r=e.translations.find(function(e){return e.locale===n});if(null==r?void 0:r.description)return r.description;if(e.description)return e.description;switch(e.type){case s.FIXED_AMOUNT:return t("spendingMethods.FIXED_AMOUNT.title");case s.RATIO:return t("spendingMethods.RATIO.title");case s.FREE_SHIPPING:return t("spendingMethods.FREE_SHIPPING.title");case s.FREE_PRODUCT:return t("spendingMethods.FREE_PRODUCT.title");default:return""}},F=N.span(j||(j=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(D||(D=e(["\n ","\n color: #364152;\n"],["\n ","\n color: #364152;\n"])),U),L=N.span(y||(y=e(["\n color: #697586;\n"],["\n color: #697586;\n"]))),k=function(e,n){var r,i,o=C().t,l=(null===(r=e.discountSettings)||void 0===r?void 0:r.point)||0,a=null===(i=e.discountSettings)||void 0===i?void 0:i.discountAmount,E=function(e,r){return void 0===r&&(r=!1),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},t.createElement(G,null,o("earningMethods.xPoints",{points:l})),t.createElement(L,null,"→"),t.createElement(F,null,e," ",r&&n))};return e.type===s.FIXED_AMOUNT&&a?E(a,!0):e.type===s.RATIO&&a?E("%".concat(a)):o("earningMethods.xPoints",{points:l})};export{w as getEarningMethodIcon,b as getEarningMethodTitle,k as getSpendingMethodDescription,v as getSpendingMethodIcon,B as getSpendingMethodTitle};
1
+ import{__makeTemplateObject as e}from'./ext/tslib/tslib.es6.mjs.js';import n from"react";import'./ext/react-i18next/dist/es/context.js';import{useTranslation as t}from'./ext/react-i18next/dist/es/useTranslation.js';import r from'./ext/i18next/dist/esm/i18next.js';import l from"styled-components";import{ArrowRight as i}from"./assets/icons/arrow-right.js";import{BubbleChatDone as s}from"./assets/widget-icons/normal/bubbleChatDone.js";import{CommentAdd01 as o}from"./assets/widget-icons/normal/commentAdd01.js";import{CouponPercent as a}from"./assets/widget-icons/normal/couponPercent.js";import{DiscountTag02 as E}from"./assets/widget-icons/normal/discountTag02.js";import{Gift as m}from"./assets/widget-icons/normal/gift.js";import{MoneyAdd01 as c}from"./assets/widget-icons/normal/moneyAdd01.js";import{PackageDelivered as d}from"./assets/widget-icons/normal/packageDelivered.js";import{SaveMoneyDollar as u}from"./assets/widget-icons/normal/saveMoneyDollar.js";import{ShoppingBasketAdd02 as p}from"./assets/widget-icons/normal/shoppingBasketAdd02.js";import{UserAdd01 as R}from"./assets/widget-icons/normal/userAdd01.js";import{UsersIllustration as T}from"./assets/widget-icons/illustraions/usersIllustration.js";import{BubbleChatIllustration as _}from"./assets/widget-icons/illustraions/bubbleChatIllustration.js";import{ApprovedChatIllustration as f}from"./assets/widget-icons/illustraions/approvedChatIllustration.js";import{TshirtIllustration as g}from"./assets/widget-icons/illustraions/tshirtIllustration.js";import{Medal as I}from"./assets/widget-icons/illustraions/medal.js";import{GiftIllustration as O}from"./assets/widget-icons/illustraions/giftIllustration.js";import{ShippingBox as S}from"./assets/widget-icons/illustraions/shippingBox.js";import{BigSaleMedal as N}from"./assets/widget-icons/illustraions/bigSaleMedal.js";import{ShoppingCartIllustration as C}from"./assets/widget-icons/illustraions/shoppingCartIllustration.js";import{BankCoin as M}from"./assets/widget-icons/illustraions/bankCoin.js";import{WidgetIconTypeEnum as A}from"./models/loyalty-widget/types/index.js";import{EarningMethodTypeEnum as x,LoyaltyWidgetScreenTypeEnum as D,LoyaltyProgramPointEarningTypeEnum as U,LoyaltyProgramMethodSpendingTypeEnum as j}from"./models/types/index.js";import{FlexibleValueContainer as y}from"./renderer/components/flexible-value-container/index.js";import{textSM as h,textXSMedium as w,textXS as P}from"./renderer/components/style/typography.js";var v,L,b,F,G,B,Y,H,V,X=((v={})[A.ILLUSTRATION]=((L={})[x.CUSTOMER_REGISTER]=n.createElement(T,null),L[x.ENABLE_SUBSCRIPTION]=n.createElement(f,null),L[x.BUY_PRODUCT]=n.createElement(g,null),L[x.CUSTOMER_REVIEW]=n.createElement(_,null),L[x.CUSTOMER_SEGMENT]=n.createElement(a,null),L[x.ORDER_CREATE]=n.createElement(C,null),L),v[A.NORMAL]=((b={})[x.CUSTOMER_REGISTER]=n.createElement(R,null),b[x.ENABLE_SUBSCRIPTION]=n.createElement(s,null),b[x.BUY_PRODUCT]=n.createElement(u,null),b[x.CUSTOMER_REVIEW]=n.createElement(o,null),b[x.CUSTOMER_SEGMENT]=n.createElement(a,null),b[x.ORDER_CREATE]=n.createElement(p,null),b),v),k=((F={})[A.ILLUSTRATION]=((G={})[D.MAIN_SCREEN]=n.createElement("div",null),G[D.CREDIT_EARNING_METHODS_SCREEN]=n.createElement(I,null),G[D.CREDIT_SPENDING_METHODS_SCREEN]=n.createElement(N,null),G[D.CREDIT_HISTORY_SCREEN]=n.createElement("div",null),G[D.LOYALTY_LEVEL_SCREEN]=n.createElement("div",null),G),F[A.NORMAL]=((B={})[D.MAIN_SCREEN]=n.createElement("div",null),B[D.CREDIT_EARNING_METHODS_SCREEN]=n.createElement(c,null),B[D.CREDIT_SPENDING_METHODS_SCREEN]=n.createElement(a,null),B[D.CREDIT_HISTORY_SCREEN]=n.createElement("div",null),B[D.LOYALTY_LEVEL_SCREEN]=n.createElement("div",null),B),F),W=function(e,n){return n&&n!==A.NONE&&k[n]?k[n][e]:null},q=function(e,n){return n&&n!==A.NONE&&X[n]?X[n][e]:null},z=function(e){var n=t().t;switch(e.methodType){case x.CUSTOMER_REGISTER:return n("earningMethods.CUSTOMER_REGISTER.title");case x.ENABLE_SUBSCRIPTION:return n("earningMethods.ENABLE_SUBSCRIPTION.title");case x.CUSTOMER_REVIEW:return n("earningMethods.CUSTOMER_REVIEW.title");case x.ORDER_CREATE:if(e.pointEarningType===U.DYNAMIC_ORDER_AMOUNT)return n("earningMethods.ORDER_CREATE.RECEIVE_POINTS_ON_SPEND.title");if(e.pointEarningType===U.STATIC)return n("earningMethods.ORDER_CREATE.BASE.title");case x.BUY_PRODUCT:return n("earningMethods.BUY_PRODUCT.title");case x.CUSTOMER_SEGMENT:return n("earningMethods.CUSTOMER_SEGMENT.title");default:return""}},J=function(e,t){var r,l,i;return t===A.NONE?null:((r={})[A.ILLUSTRATION]=((l={})[j.FIXED_AMOUNT]=n.createElement(M,null),l[j.RATIO]=n.createElement(M,null),l[j.FREE_PRODUCT]=n.createElement(O,null),l[j.FREE_SHIPPING]=n.createElement(S,null),l),r[A.NORMAL]=((i={})[j.FIXED_AMOUNT]=n.createElement(E,null),i[j.RATIO]=n.createElement(E,null),i[j.FREE_PRODUCT]=n.createElement(m,null),i[j.FREE_SHIPPING]=n.createElement(d,null),i),r)[t][e]},K=function(e){var n,l=t().t,i=r.language,s=null===(n=e.translations)||void 0===n?void 0:n.find(function(e){return e.locale===i});if(null==s?void 0:s.description)return s.description;if(e.description)return e.description;switch(e.type){case j.FIXED_AMOUNT:return e.isDynamic?l("spendingMethods.FIXED_AMOUNT.dynamicTitle"):l("spendingMethods.FIXED_AMOUNT.title");case j.RATIO:return l("spendingMethods.RATIO.title");case j.FREE_SHIPPING:return l("spendingMethods.FREE_SHIPPING.title");case j.FREE_PRODUCT:return l("spendingMethods.FREE_PRODUCT.title");default:return""}},Q=l.span(Y||(Y=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"])),h,w),Z=l.span(H||(H=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"])),h,P),$=l.span(V||(V=e(["\n color: #697586;\n display: flex;\n align-items: center;\n"],["\n color: #697586;\n display: flex;\n align-items: center;\n"]))),ee=function(e,r){var l,s,o=t().t,a=(null===(l=e.discountSettings)||void 0===l?void 0:l.point)||0,E=null===(s=e.discountSettings)||void 0===s?void 0:s.discountAmount,m=function(e,t){return void 0===t&&(t=!1),n.createElement(y,null,function(l){return l?n.createElement(n.Fragment,null,n.createElement(Z,null,o("earningMethods.xPoints",{points:a})),n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},n.createElement($,null,n.createElement(i,null)),n.createElement(Q,null,t&&"number"==typeof e?r.formatCurrency(e):e))):n.createElement(n.Fragment,null,n.createElement(Z,null,o("earningMethods.xPoints",{points:a})),n.createElement($,null,n.createElement(i,null)),n.createElement(Q,null,t&&"number"==typeof e?r.formatCurrency(e):e))})};return e.type===j.FIXED_AMOUNT&&E?m(E,!0):e.type===j.RATIO&&E?m("%".concat(E)):o("earningMethods.xPoints",{points:a})};export{q as getEarningMethodIcon,z as getEarningMethodTitle,W as getScreenIcon,ee as getSpendingMethodDescription,J as getSpendingMethodIcon,K as getSpendingMethodTitle};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/loyalty-widget-renderer",
3
- "version": "1.0.0-alpha.6",
3
+ "version": "1.0.0-alpha.60",
4
4
  "description": "",
5
5
  "author": "ucy",
6
6
  "license": "ISC",
@@ -24,24 +24,33 @@
24
24
  "release": "npm publish",
25
25
  "build": "rm -rf build && rollup -c",
26
26
  "watch": "rollup -c -w",
27
- "dev": "parcel app/index.html --port 3000"
27
+ "dev": "parcel app/index.html --port 3000",
28
+ "serve": "npm run build && npx serve build -p 3000 --cors",
29
+ "lint:fix": "eslint './src/**/*.{ts,tsx}' --fix"
28
30
  },
29
31
  "devDependencies": {
32
+ "@eslint/eslintrc": "^3.3.3",
33
+ "@eslint/js": "^9.39.1",
30
34
  "@rollup/plugin-commonjs": "^22.0.0",
31
35
  "@rollup/plugin-json": "^4.1.0",
32
36
  "@rollup/plugin-node-resolve": "^13.3.0",
37
+ "@trivago/prettier-plugin-sort-imports": "^6.0.0",
33
38
  "@types/lodash": "^4.14.191",
34
39
  "@types/node": "^12.0.0",
35
40
  "@types/react": "^17 || ^18",
36
41
  "@types/react-dom": "^17 || ^18",
37
- "i18next": "^25.6.3",
38
- "react-i18next": "^16.3.5",
39
- "styled-components": "^5.3.3",
40
42
  "@types/styled-components": "5.1.26",
41
43
  "@types/uuid": "^9.0.0",
42
- "mobx": "^6.1.3",
44
+ "@typescript-eslint/eslint-plugin": "^8.48.1",
45
+ "@typescript-eslint/parser": "^8.48.1",
46
+ "cloudflare": "^5.2.0",
47
+ "eslint": "^9.39.1",
48
+ "eslint-plugin-react": "^7.37.5",
49
+ "eslint-plugin-unused-imports": "^4.3.0",
50
+ "mobx": "^6.7.0",
43
51
  "mobx-react": "^7.6.0",
44
52
  "parcel": "^2.12.0",
53
+ "prettier": "^3.7.4",
45
54
  "react": "^17 || ^18",
46
55
  "react-dom": "^17 || ^18",
47
56
  "rollup": "^2.75.6",
@@ -51,21 +60,21 @@
51
60
  "rollup-plugin-rename-node-modules": "^1.2.0",
52
61
  "rollup-plugin-terser": "^7.0.2",
53
62
  "rollup-plugin-typescript2": "^0.36.0",
63
+ "styled-components": "^5.3.3",
54
64
  "ts-patch": "^3.3.0",
55
-
56
65
  "typescript": "^5.9.3",
57
66
  "typescript-transform-paths": "^3.5.5"
58
67
  },
59
68
  "peerDependencies": {
60
- "mobx": "^6.1.3",
69
+ "mobx": "^6.7.0",
61
70
  "mobx-react": "^7.6.0",
62
71
  "react": "^17 || ^18",
63
72
  "react-dom": "^17 || ^18",
64
- "i18next": "^25.6.3",
65
- "react-i18next": "^16.3.5",
66
73
  "styled-components": "^5.3.3"
67
74
  },
68
75
  "dependencies": {
76
+ "i18next": "^21.6.12",
77
+ "react-i18next": "^11.15.5",
69
78
  "uuidv4": "^6.2.13"
70
79
  }
71
80
  }
@@ -1,4 +0,0 @@
1
- export declare class BaseModel {
2
- id: string;
3
- constructor(data?: Partial<BaseModel>);
4
- }
@@ -1 +0,0 @@
1
- import{makeObservable as o,observable as s}from"mobx";import'./../ext/uuid/dist/esm-browser/stringify.js';import'./../ext/uuid/dist/esm-browser/v3.js';import i from'./../ext/uuid/dist/esm-browser/v4.js';import'./../ext/uuid/dist/esm-browser/v5.js';var d=function(d){void 0===d&&(d={}),this.id=d.id||i(),o(this,{id:s})};export{d as BaseModel};
@@ -1,5 +0,0 @@
1
- export declare class Category {
2
- id: string;
3
- name: string;
4
- constructor(data?: Partial<Category>);
5
- }
@@ -1,9 +0,0 @@
1
- import { BaseModel } from "models/base";
2
- import { LoyaltyWidgetImage } from "models/image";
3
- import { HeaderBackgroundTypeEnum } from "../types";
4
- export declare class LoyaltyWidgetHeaderBackground extends BaseModel {
5
- bgColor: string | null;
6
- image: LoyaltyWidgetImage | null;
7
- type: HeaderBackgroundTypeEnum;
8
- constructor(data: Partial<LoyaltyWidgetHeaderBackground>);
9
- }