@ikas/loyalty-widget-renderer 1.0.0-alpha.8 → 1.0.0

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 (145) hide show
  1. package/build/_virtual/index.js +1 -1
  2. package/build/_virtual/index2.js +1 -0
  3. package/build/_virtual/react-is.production.js +1 -0
  4. package/build/_virtual/react-is.production.min.js +1 -0
  5. package/build/assets/badgeLevel1.d.ts +2 -2
  6. package/build/assets/badgeLevel2.d.ts +2 -2
  7. package/build/assets/badgeLevel3.d.ts +2 -2
  8. package/build/assets/badgeLevel4.d.ts +2 -2
  9. package/build/assets/icons/check-circle-fill.d.ts +2 -2
  10. package/build/assets/icons/check.d.ts +2 -2
  11. package/build/assets/icons/chevron-left.d.ts +2 -2
  12. package/build/assets/icons/x-close.d.ts +2 -2
  13. package/build/assets/index.d.ts +27 -27
  14. package/build/assets/widget-icons/illustraions/approvedChatIllustration.d.ts +2 -2
  15. package/build/assets/widget-icons/illustraions/bankCoin.d.ts +2 -2
  16. package/build/assets/widget-icons/illustraions/bigSaleMedal.d.ts +2 -2
  17. package/build/assets/widget-icons/illustraions/bubbleChatIllustration.d.ts +2 -2
  18. package/build/assets/widget-icons/illustraions/giftIllustration.d.ts +2 -2
  19. package/build/assets/widget-icons/illustraions/medal.d.ts +2 -2
  20. package/build/assets/widget-icons/illustraions/shippingBox.d.ts +2 -2
  21. package/build/assets/widget-icons/illustraions/shoppingCartIllustration.d.ts +2 -2
  22. package/build/assets/widget-icons/illustraions/tshirtIllustration.d.ts +2 -2
  23. package/build/assets/widget-icons/illustraions/usersIllustration.d.ts +2 -2
  24. package/build/assets/widget-icons/normal/bubbleChatDone.d.ts +2 -2
  25. package/build/assets/widget-icons/normal/commentAdd01.d.ts +2 -2
  26. package/build/assets/widget-icons/normal/couponPercent.d.ts +2 -2
  27. package/build/assets/widget-icons/normal/discountTag02.d.ts +2 -2
  28. package/build/assets/widget-icons/normal/gift.d.ts +2 -2
  29. package/build/assets/widget-icons/normal/moneyAdd01.d.ts +2 -2
  30. package/build/assets/widget-icons/normal/packageDelivered.d.ts +2 -2
  31. package/build/assets/widget-icons/normal/saveMoneyDollar.d.ts +2 -2
  32. package/build/assets/widget-icons/normal/shoppingBasketAdd02.d.ts +2 -2
  33. package/build/assets/widget-icons/normal/userAdd01.d.ts +2 -2
  34. package/build/ext/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js +1 -0
  35. package/build/ext/@emotion/memoize/dist/memoize.browser.esm.js +1 -0
  36. package/build/ext/@emotion/stylis/dist/stylis.browser.esm.js +1 -0
  37. package/build/ext/@emotion/unitless/dist/unitless.browser.esm.js +1 -0
  38. package/build/ext/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -0
  39. package/build/ext/hoist-non-react-statics/ext/react-is/cjs/react-is.development.js +9 -0
  40. package/build/ext/hoist-non-react-statics/ext/react-is/cjs/react-is.production.min.js +9 -0
  41. package/build/ext/hoist-non-react-statics/ext/react-is/index.js +1 -0
  42. package/build/ext/i18next/dist/esm/i18next.js +1 -1
  43. package/build/ext/react-i18next/dist/es/defaults.js +1 -1
  44. package/build/ext/react-i18next/dist/es/i18nInstance.js +1 -1
  45. package/build/ext/react-i18next/dist/es/useTranslation.js +1 -1
  46. package/build/ext/react-i18next/dist/es/utils.js +1 -1
  47. package/build/ext/react-is/cjs/react-is.development.js +10 -0
  48. package/build/ext/react-is/cjs/react-is.production.js +10 -0
  49. package/build/ext/react-is/index.js +1 -0
  50. package/build/ext/styled-components/dist/styled-components.browser.esm.js +1 -0
  51. package/build/index.d.ts +12 -11
  52. package/build/models/base.d.ts +4 -4
  53. package/build/models/button/index.d.ts +7 -7
  54. package/build/models/category/index.d.ts +5 -5
  55. package/build/models/image/index.d.ts +12 -12
  56. package/build/models/index.d.ts +28 -28
  57. package/build/models/loyalty-customer-info/index.d.ts +28 -28
  58. package/build/models/loyalty-program-earning-method/index.d.ts +51 -51
  59. package/build/models/loyalty-program-point-history/index.d.ts +17 -17
  60. package/build/models/loyalty-program-spending-method/index.d.ts +38 -38
  61. package/build/models/loyalty-widget/header/header-background/index.d.ts +9 -9
  62. package/build/models/loyalty-widget/header/index.d.ts +8 -8
  63. package/build/models/loyalty-widget/header-background/index.d.ts +9 -9
  64. package/build/models/loyalty-widget/index.d.ts +12 -12
  65. package/build/models/loyalty-widget/settings/index.d.ts +10 -10
  66. package/build/models/loyalty-widget/types/index.d.ts +29 -29
  67. package/build/models/types/index.d.ts +145 -145
  68. package/build/renderer/components/button/index.d.ts +15 -15
  69. package/build/renderer/components/button/style.d.ts +15 -15
  70. package/build/renderer/components/button/style.js +1 -1
  71. package/build/renderer/components/index.d.ts +5 -3
  72. package/build/renderer/components/loyalty-method-card/index.d.ts +23 -23
  73. package/build/renderer/components/loyalty-method-card/style.d.ts +22 -22
  74. package/build/renderer/components/loyalty-method-card/style.js +1 -1
  75. package/build/renderer/components/section-title/index.d.ts +8 -8
  76. package/build/renderer/components/section-title/style.d.ts +1 -1
  77. package/build/renderer/components/section-title/style.js +1 -1
  78. package/build/renderer/components/style/typography.d.ts +11 -11
  79. package/build/renderer/components/style/typography.js +1 -1
  80. package/build/renderer/index.d.ts +5 -7
  81. package/build/renderer/index.js +1 -1
  82. package/build/renderer/screens/credit-earning-methods-screen/index.d.ts +9 -9
  83. package/build/renderer/screens/credit-earning-methods-screen/index.js +1 -1
  84. package/build/renderer/screens/credit-earning-methods-screen/style.d.ts +5 -5
  85. package/build/renderer/screens/credit-earning-methods-screen/style.js +1 -1
  86. package/build/renderer/screens/credit-history-screen/index.d.ts +9 -9
  87. package/build/renderer/screens/credit-history-screen/index.js +1 -1
  88. package/build/renderer/screens/credit-history-screen/style.d.ts +17 -17
  89. package/build/renderer/screens/credit-history-screen/style.js +1 -1
  90. package/build/renderer/screens/credit-spending-methods-screen/index.d.ts +9 -9
  91. package/build/renderer/screens/credit-spending-methods-screen/index.js +1 -1
  92. package/build/renderer/screens/credit-spending-methods-screen/style.d.ts +8 -8
  93. package/build/renderer/screens/credit-spending-methods-screen/style.js +1 -1
  94. package/build/renderer/screens/loyalty-level-screen/index.d.ts +9 -9
  95. package/build/renderer/screens/loyalty-level-screen/index.js +1 -1
  96. package/build/renderer/screens/loyalty-level-screen/style.d.ts +32 -32
  97. package/build/renderer/screens/loyalty-level-screen/style.js +1 -1
  98. package/build/renderer/screens/main-screen/earning-methods-section/index.d.ts +14 -14
  99. package/build/renderer/screens/main-screen/earning-methods-section/index.js +1 -1
  100. package/build/renderer/screens/main-screen/header/auth-user-section/index.d.ts +7 -7
  101. package/build/renderer/screens/main-screen/header/auth-user-section/index.js +1 -1
  102. package/build/renderer/screens/main-screen/header/auth-user-section/style.d.ts +7 -7
  103. package/build/renderer/screens/main-screen/header/auth-user-section/style.js +1 -1
  104. package/build/renderer/screens/main-screen/header/index.d.ts +10 -10
  105. package/build/renderer/screens/main-screen/header/logo-section/index.d.ts +7 -7
  106. package/build/renderer/screens/main-screen/header/logo-section/style.d.ts +2 -2
  107. package/build/renderer/screens/main-screen/header/logo-section/style.js +1 -1
  108. package/build/renderer/screens/main-screen/header/style.d.ts +12 -12
  109. package/build/renderer/screens/main-screen/header/style.js +1 -1
  110. package/build/renderer/screens/main-screen/header/title-section/index.d.ts +7 -7
  111. package/build/renderer/screens/main-screen/header/title-section/index.js +1 -1
  112. package/build/renderer/screens/main-screen/header/title-section/style.d.ts +7 -7
  113. package/build/renderer/screens/main-screen/header/title-section/style.js +1 -1
  114. package/build/renderer/screens/main-screen/header/user-logged-section/index.d.ts +7 -7
  115. package/build/renderer/screens/main-screen/header/user-logged-section/index.js +1 -1
  116. package/build/renderer/screens/main-screen/header/user-logged-section/style.d.ts +18 -18
  117. package/build/renderer/screens/main-screen/header/user-logged-section/style.js +1 -1
  118. package/build/renderer/screens/main-screen/index.d.ts +9 -9
  119. package/build/renderer/screens/main-screen/index.js +1 -1
  120. package/build/renderer/screens/main-screen/program-info-section/index.d.ts +8 -8
  121. package/build/renderer/screens/main-screen/program-info-section/index.js +1 -1
  122. package/build/renderer/screens/main-screen/program-info-section/style.d.ts +8 -8
  123. package/build/renderer/screens/main-screen/program-info-section/style.js +1 -1
  124. package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.d.ts +9 -9
  125. package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.js +1 -1
  126. package/build/renderer/screens/main-screen/spending-methods-section/index.d.ts +13 -13
  127. package/build/renderer/screens/main-screen/spending-methods-section/index.js +1 -1
  128. package/build/renderer/screens/main-screen/style.d.ts +5 -5
  129. package/build/renderer/screens/main-screen/style.js +1 -1
  130. package/build/renderer/style.d.ts +6 -6
  131. package/build/renderer/style.js +1 -1
  132. package/build/renderer/utils/i18n.d.ts +2 -2
  133. package/build/renderer/utils/i18n.js +1 -1
  134. package/build/renderer/utils/loyalty-details.d.ts +12 -12
  135. package/build/renderer/utils/translations.d.ts +5 -5
  136. package/build/utils.d.ts +10 -10
  137. package/build/utils.js +1 -1
  138. package/package.json +13 -15
  139. package/build/ext/react-i18next/dist/es/I18nextProvider.js +0 -1
  140. package/build/ext/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js +0 -1
  141. package/build/ext/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -10
  142. package/build/ext/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -10
  143. package/build/ext/use-sync-external-store/shim/index.js +0 -1
  144. /package/build/_virtual/{use-sync-external-store-shim.development.js → react-is.development.js} +0 -0
  145. /package/build/_virtual/{use-sync-external-store-shim.production.js → react-is.development2.js} +0 -0
package/build/utils.d.ts CHANGED
@@ -1,10 +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;
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 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 s,LoyaltyProgramMethodSpendingTypeEnum as r}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 d}from"./assets/widget-icons/normal/packageDelivered.js";import{SaveMoneyDollar as c}from"./assets/widget-icons/normal/saveMoneyDollar.js";import{ShoppingBasketAdd02 as m}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'./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"styled-components";var A,j,x,h,D,P,y=((A={})[_.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(O,null),j),A[_.NORMAL]=((x={})[n.CUSTOMER_REGISTER]=t.createElement(u,null),x[n.ENABLE_SUBSCRIPTION]=t.createElement(i,null),x[n.BUY_PRODUCT]=t.createElement(c,null),x[n.CUSTOMER_REVIEW]=t.createElement(o,null),x[n.CUSTOMER_SEGMENT]=t.createElement(l,null),x[n.ORDER_CREATE]=t.createElement(m,null),x),A),w=function(e,t){return y[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,i,o;return n===_.NONE?null:((s={})[_.ILLUSTRATION]=((i={})[r.FIXED_AMOUNT]=t.createElement(M,null),i[r.RATIO]=t.createElement(M,null),i[r.FREE_PRODUCT]=t.createElement(f,null),i[r.FREE_SHIPPING]=t.createElement(I,null),i),s[_.NORMAL]=((o={})[r.FIXED_AMOUNT]=t.createElement(a,null),o[r.RATIO]=t.createElement(a,null),o[r.FREE_PRODUCT]=t.createElement(E,null),o[r.FREE_SHIPPING]=t.createElement(d,null),o),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(D||(D=e(["\n ","\n color: #364152;\n"],["\n ","\n color: #364152;\n"])),U),L=N.span(P||(P=e(["\n color: #697586;\n"],["\n color: #697586;\n"]))),k=function(e,n){var s,i,o=C().t,l=(null===(s=e.discountSettings)||void 0===s?void 0:s.point)||0,a=null===(i=e.discountSettings)||void 0===i?void 0:i.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,o("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)):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 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 O}from"./assets/widget-icons/illustraions/shoppingCartIllustration.js";import{WidgetIconTypeEnum as _}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{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,P,h,y,D=((A={})[_.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(O,null),j),A[_.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 D[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===_.NONE?null:((s={})[_.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[_.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(P||(P=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(h||(h=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 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/loyalty-widget-renderer",
3
- "version": "1.0.0-alpha.8",
3
+ "version": "1.0.0",
4
4
  "description": "",
5
5
  "author": "ucy",
6
6
  "license": "ISC",
@@ -18,7 +18,6 @@
18
18
  "assets": "./src/assets"
19
19
  },
20
20
  "scripts": {
21
- "prepare": "ts-patch install -s",
22
21
  "prepack": "npm run build",
23
22
  "pack": "npm pack",
24
23
  "release": "npm publish",
@@ -34,7 +33,6 @@
34
33
  "@types/node": "^12.0.0",
35
34
  "@types/react": "^17 || ^18",
36
35
  "@types/react-dom": "^17 || ^18",
37
- "styled-components": "^5.3.3",
38
36
  "@types/styled-components": "5.1.26",
39
37
  "@types/uuid": "^9.0.0",
40
38
  "mobx": "^6.1.3",
@@ -48,21 +46,21 @@
48
46
  "rollup-plugin-postcss": "^4.0.2",
49
47
  "rollup-plugin-rename-node-modules": "^1.2.0",
50
48
  "rollup-plugin-terser": "^7.0.2",
51
- "rollup-plugin-typescript2": "^0.36.0",
52
- "ts-patch": "^3.3.0",
53
- "typescript": "^5.9.3",
54
- "typescript-transform-paths": "^3.5.5"
49
+ "rollup-plugin-typescript2": "^0.32.1",
50
+ "styled-components": "5.3.3",
51
+ "ttypescript": "^1.5.15",
52
+ "typescript": "~4.9.5",
53
+ "typescript-transform-paths": "^2.2.2"
55
54
  },
56
55
  "peerDependencies": {
57
- "react": "^17 || ^18",
58
- "react-dom": "^17 || ^18",
59
- "styled-components": "^5.3.3",
60
56
  "mobx": "^6.1.3",
61
- "mobx-react": "^7.6.0"
57
+ "mobx-react": "^7.6.0",
58
+ "react": "^17 || ^18",
59
+ "react-dom": "^17 || ^18"
62
60
  },
63
61
  "dependencies": {
64
- "uuidv4": "^6.2.13",
65
- "i18next": "^25.6.3",
66
- "react-i18next": "^16.3.5"
62
+ "i18next": "^23.12.2",
63
+ "react-i18next": "^13.0.0",
64
+ "uuidv4": "^6.2.13"
67
65
  }
68
- }
66
+ }
@@ -1 +0,0 @@
1
- import{useMemo as r,createElement as t}from"react";import{I18nContext as e}from"./context.js";function o({i18n:o,defaultNS:n,children:i}){const c=r(()=>({i18n:o,defaultNS:n}),[o,n]);return t(e.Provider,{value:c},i)}export{o as I18nextProvider};
@@ -1 +0,0 @@
1
- new RegExp(Object.keys({"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&copy;":"©","&reg;":"®","&trade;":"™","&hellip;":"…","&ndash;":"–","&mdash;":"—","&lsquo;":"‘","&rsquo;":"’","&sbquo;":"‚","&ldquo;":"“","&rdquo;":"”","&bdquo;":"„","&dagger;":"†","&Dagger;":"‡","&bull;":"•","&prime;":"′","&Prime;":"″","&lsaquo;":"‹","&rsaquo;":"›","&sect;":"§","&para;":"¶","&middot;":"·","&ensp;":" ","&emsp;":" ","&thinsp;":" ","&euro;":"€","&pound;":"£","&yen;":"¥","&cent;":"¢","&curren;":"¤","&times;":"×","&divide;":"÷","&minus;":"−","&plusmn;":"±","&ne;":"≠","&le;":"≤","&ge;":"≥","&asymp;":"≈","&equiv;":"≡","&infin;":"∞","&int;":"∫","&sum;":"∑","&prod;":"∏","&radic;":"√","&part;":"∂","&permil;":"‰","&deg;":"°","&micro;":"µ","&larr;":"←","&uarr;":"↑","&rarr;":"→","&darr;":"↓","&harr;":"↔","&crarr;":"↵","&lArr;":"⇐","&uArr;":"⇑","&rArr;":"⇒","&dArr;":"⇓","&hArr;":"⇔","&alpha;":"α","&beta;":"β","&gamma;":"γ","&delta;":"δ","&epsilon;":"ε","&zeta;":"ζ","&eta;":"η","&theta;":"θ","&iota;":"ι","&kappa;":"κ","&lambda;":"λ","&mu;":"μ","&nu;":"ν","&xi;":"ξ","&omicron;":"ο","&pi;":"π","&rho;":"ρ","&sigma;":"σ","&tau;":"τ","&upsilon;":"υ","&phi;":"φ","&chi;":"χ","&psi;":"ψ","&omega;":"ω","&Alpha;":"Α","&Beta;":"Β","&Gamma;":"Γ","&Delta;":"Δ","&Epsilon;":"Ε","&Zeta;":"Ζ","&Eta;":"Η","&Theta;":"Θ","&Iota;":"Ι","&Kappa;":"Κ","&Lambda;":"Λ","&Mu;":"Μ","&Nu;":"Ν","&Xi;":"Ξ","&Omicron;":"Ο","&Pi;":"Π","&Rho;":"Ρ","&Sigma;":"Σ","&Tau;":"Τ","&Upsilon;":"Υ","&Phi;":"Φ","&Chi;":"Χ","&Psi;":"Ψ","&Omega;":"Ω","&Agrave;":"À","&Aacute;":"Á","&Acirc;":"Â","&Atilde;":"Ã","&Auml;":"Ä","&Aring;":"Å","&AElig;":"Æ","&Ccedil;":"Ç","&Egrave;":"È","&Eacute;":"É","&Ecirc;":"Ê","&Euml;":"Ë","&Igrave;":"Ì","&Iacute;":"Í","&Icirc;":"Î","&Iuml;":"Ï","&ETH;":"Ð","&Ntilde;":"Ñ","&Ograve;":"Ò","&Oacute;":"Ó","&Ocirc;":"Ô","&Otilde;":"Õ","&Ouml;":"Ö","&Oslash;":"Ø","&Ugrave;":"Ù","&Uacute;":"Ú","&Ucirc;":"Û","&Uuml;":"Ü","&Yacute;":"Ý","&THORN;":"Þ","&szlig;":"ß","&agrave;":"à","&aacute;":"á","&acirc;":"â","&atilde;":"ã","&auml;":"ä","&aring;":"å","&aelig;":"æ","&ccedil;":"ç","&egrave;":"è","&eacute;":"é","&ecirc;":"ê","&euml;":"ë","&igrave;":"ì","&iacute;":"í","&icirc;":"î","&iuml;":"ï","&eth;":"ð","&ntilde;":"ñ","&ograve;":"ò","&oacute;":"ó","&ocirc;":"ô","&otilde;":"õ","&ouml;":"ö","&oslash;":"ø","&ugrave;":"ù","&uacute;":"ú","&ucirc;":"û","&uuml;":"ü","&yacute;":"ý","&thorn;":"þ","&yuml;":"ÿ","&iexcl;":"¡","&iquest;":"¿","&fnof;":"ƒ","&circ;":"ˆ","&tilde;":"˜","&OElig;":"Œ","&oelig;":"œ","&Scaron;":"Š","&scaron;":"š","&Yuml;":"Ÿ","&ordf;":"ª","&ordm;":"º","&macr;":"¯","&acute;":"´","&cedil;":"¸","&sup1;":"¹","&sup2;":"²","&sup3;":"³","&frac14;":"¼","&frac12;":"½","&frac34;":"¾","&spades;":"♠","&clubs;":"♣","&hearts;":"♥","&diams;":"♦","&loz;":"◊","&oline;":"‾","&frasl;":"⁄","&weierp;":"℘","&image;":"ℑ","&real;":"ℜ","&alefsym;":"ℵ"}).map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),"g");
@@ -1,10 +0,0 @@
1
- import{__exports as e}from"../../../_virtual/use-sync-external-store-shim.development.js";import t from"react";
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.development.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var n;function r(){return n||(n=1,"production"!==process.env.NODE_ENV&&function(){function n(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=t,o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},u=r.useState,a=r.useEffect,i=r.useLayoutEffect,s=r.useDebugValue,_=!1,c=!1,O="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){_||void 0===r.startTransition||(_=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var O=t();if(!c){var l=t();o(O,l)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var f=(l=u({inst:{value:O,getSnapshot:t}}))[0].inst,d=l[1];return i(function(){f.value=O,f.getSnapshot=t,n(f)&&d({inst:f})},[e,O,t]),a(function(){return n(f)&&d({inst:f}),e(function(){n(f)&&d({inst:f})})},[e]),s(O),O};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:O,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),e}export{r as __require};
@@ -1,10 +0,0 @@
1
- import{__exports as t}from"../../../_virtual/use-sync-external-store-shim.production.js";import e from"react";
2
- /**
3
- * @license React
4
- * use-sync-external-store-shim.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var n;function r(){if(n)return t;n=1;var r=e;var u="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=r.useState,i=r.useEffect,a=r.useLayoutEffect,s=r.useDebugValue;function c(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!u(t,n)}catch(t){return!0}}var f="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=o({inst:{value:n,getSnapshot:e}}),u=r[0].inst,f=r[1];return a(function(){u.value=n,u.getSnapshot=e,c(u)&&f({inst:u})},[t,n,e]),i(function(){return c(u)&&f({inst:u}),t(function(){c(u)&&f({inst:u})})},[t]),s(n),n};return t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:f,t}export{r as __require};
@@ -1 +0,0 @@
1
- import{s as r}from"../../../_virtual/index.js";import{__require as s}from"../cjs/use-sync-external-store-shim.production.js";import{__require as e}from"../cjs/use-sync-external-store-shim.development.js";var o;o=r,"production"===process.env.NODE_ENV?o.exports=s():o.exports=e();