@ikas/loyalty-widget-renderer 1.0.0-alpha.8 → 1.0.0-alpha.81
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/assets/icons/arrow-right.d.ts +2 -0
- package/build/assets/icons/arrow-right.js +1 -0
- package/build/assets/icons/check-circle.d.ts +2 -0
- package/build/assets/icons/check-circle.js +1 -0
- package/build/assets/index.d.ts +7 -0
- package/build/assets/widget-icons/illustraions/check-fill.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/check-fill.js +1 -0
- package/build/assets/widget-icons/illustraions/informationCircleIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/informationCircleIllustration.js +1 -0
- package/build/assets/widget-icons/illustraions/medal.js +1 -1
- package/build/assets/widget-icons/illustraions/refundIllustration.d.ts +2 -0
- package/build/assets/widget-icons/illustraions/refundIllustration.js +1 -0
- package/build/assets/widget-icons/normal/informationCircle.d.ts +2 -0
- package/build/assets/widget-icons/normal/informationCircle.js +1 -0
- package/build/assets/widget-icons/normal/refund.d.ts +2 -0
- package/build/assets/widget-icons/normal/refund.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/arrayLikeToArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/arrayWithHoles.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/assertThisInitialized.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/classCallCheck.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/createClass.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/defineProperty.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/getPrototypeOf.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/inherits.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/iterableToArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/iterableToArrayLimit.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/nonIterableRest.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/objectWithoutProperties.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/possibleConstructorReturn.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/setPrototypeOf.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/slicedToArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/toArray.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/toPrimitive.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/toPropertyKey.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/typeof.js +1 -0
- package/build/ext/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +1 -0
- package/build/ext/html-parse-stringify/dist/html-parse-stringify.module.js +1 -0
- package/build/ext/i18next/dist/esm/i18next.js +1 -1
- package/build/ext/react-i18next/dist/es/I18nextProvider.js +1 -1
- package/build/ext/react-i18next/dist/es/Trans.js +1 -0
- package/build/ext/react-i18next/dist/es/context.js +1 -1
- package/build/ext/react-i18next/dist/es/unescape.js +1 -1
- package/build/ext/react-i18next/dist/es/useTranslation.js +1 -1
- package/build/ext/react-i18next/dist/es/utils.js +1 -1
- package/build/ext/tslib/tslib.es6.mjs.js +1 -1
- package/build/ext/void-elements/index.js +1 -0
- package/build/index.d.ts +9 -0
- package/build/index.js +1 -1
- package/build/injector.d.ts +5 -0
- package/build/locales.d.ts +638 -0
- package/build/locales.js +1 -0
- package/build/models/common/index.d.ts +21 -0
- package/build/models/common/index.js +1 -0
- package/build/models/image/index.d.ts +2 -2
- package/build/models/image/index.js +1 -1
- package/build/models/index.d.ts +16 -6
- package/build/models/index.js +1 -1
- package/build/models/loyalty-customer-info/index.d.ts +29 -8
- package/build/models/loyalty-customer-info/index.js +1 -1
- package/build/models/loyalty-program-earning-method/index.d.ts +16 -30
- package/build/models/loyalty-program-earning-method/index.js +1 -1
- package/build/models/loyalty-program-point-history/index.d.ts +3 -3
- package/build/models/loyalty-program-point-history/index.js +1 -1
- package/build/models/loyalty-program-spending-method/index.d.ts +7 -20
- package/build/models/loyalty-program-spending-method/index.js +1 -1
- package/build/models/loyalty-widget/header/header-background/index.d.ts +2 -2
- package/build/models/loyalty-widget/header/header-background/index.js +1 -1
- package/build/models/loyalty-widget/header/index.d.ts +1 -1
- package/build/models/loyalty-widget/index.d.ts +4 -2
- package/build/models/loyalty-widget/index.js +1 -1
- package/build/models/loyalty-widget/settings/index.js +1 -1
- package/build/models/loyalty-widget/translations.d.ts +5 -0
- package/build/models/loyalty-widget/translations.js +1 -0
- package/build/models/mini-mode/index.d.ts +7 -0
- package/build/models/mini-mode/index.js +1 -0
- package/build/models/types/index.d.ts +25 -41
- package/build/models/types/index.js +1 -1
- package/build/renderer/components/animate-height/index.d.ts +9 -0
- package/build/renderer/components/animate-height/index.js +1 -0
- package/build/renderer/components/button/index.js +1 -1
- package/build/renderer/components/button/style.d.ts +1 -0
- package/build/renderer/components/button/style.js +1 -1
- package/build/renderer/components/count-up/index.d.ts +7 -0
- package/build/renderer/components/count-up/index.js +1 -0
- package/build/renderer/components/flexible-value-container/index.d.ts +16 -0
- package/build/renderer/components/flexible-value-container/index.js +1 -0
- package/build/renderer/components/loyalty-method-card/index.d.ts +2 -1
- package/build/renderer/components/loyalty-method-card/index.js +1 -1
- package/build/renderer/components/loyalty-method-card/style.d.ts +3 -3
- package/build/renderer/components/loyalty-method-card/style.js +1 -1
- package/build/renderer/components/mini-mode-button/index.d.ts +7 -0
- package/build/renderer/components/mini-mode-button/index.js +1 -0
- package/build/renderer/components/mini-mode-button/style.d.ts +6 -0
- package/build/renderer/components/mini-mode-button/style.js +1 -0
- package/build/renderer/components/mini-mode-description/index.d.ts +8 -0
- package/build/renderer/components/mini-mode-description/index.js +1 -0
- package/build/renderer/components/mini-mode-description/style.d.ts +3 -0
- package/build/renderer/components/mini-mode-description/style.js +1 -0
- package/build/renderer/components/style/icon-wrapper.d.ts +4 -0
- package/build/renderer/components/style/icon-wrapper.js +1 -0
- package/build/renderer/components/style/typography.d.ts +3 -1
- package/build/renderer/components/style/typography.js +1 -1
- package/build/renderer/components/tooltip/index.d.ts +7 -0
- package/build/renderer/components/tooltip/index.js +1 -0
- package/build/renderer/components/tooltip/style.d.ts +4 -0
- package/build/renderer/components/tooltip/style.js +1 -0
- package/build/renderer/components/translation-settings/style.d.ts +9 -0
- package/build/renderer/index.js +1 -1
- package/build/renderer/screens/credit-earning-methods-screen/index.js +1 -1
- package/build/renderer/screens/credit-earning-methods-screen/style.js +1 -1
- package/build/renderer/screens/credit-history-screen/index.js +1 -1
- package/build/renderer/screens/credit-history-screen/style.d.ts +5 -1
- package/build/renderer/screens/credit-history-screen/style.js +1 -1
- package/build/renderer/screens/credit-spending-methods-screen/index.js +1 -1
- package/build/renderer/screens/credit-spending-methods-screen/style.d.ts +3 -1
- package/build/renderer/screens/credit-spending-methods-screen/style.js +1 -1
- package/build/renderer/screens/loyalty-level-screen/index.js +1 -1
- package/build/renderer/screens/loyalty-level-screen/style.d.ts +13 -3
- package/build/renderer/screens/loyalty-level-screen/style.js +1 -1
- package/build/renderer/screens/main-screen/applied-discount/index.d.ts +9 -0
- package/build/renderer/screens/main-screen/applied-discount/index.js +1 -0
- package/build/renderer/screens/main-screen/applied-discount/style.d.ts +14 -0
- package/build/renderer/screens/main-screen/applied-discount/style.js +1 -0
- package/build/renderer/screens/main-screen/cart-warning/index.d.ts +7 -0
- package/build/renderer/screens/main-screen/cart-warning/index.js +1 -0
- package/build/renderer/screens/main-screen/cart-warning/style.d.ts +5 -0
- package/build/renderer/screens/main-screen/cart-warning/style.js +1 -0
- package/build/renderer/screens/main-screen/earning-methods-section/index.d.ts +1 -0
- package/build/renderer/screens/main-screen/earning-methods-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/auth-user-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/index.js +1 -1
- package/build/renderer/screens/main-screen/header/logo-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/logo-section/style.d.ts +3 -1
- package/build/renderer/screens/main-screen/header/logo-section/style.js +1 -1
- package/build/renderer/screens/main-screen/header/style.d.ts +11 -5
- package/build/renderer/screens/main-screen/header/style.js +1 -1
- package/build/renderer/screens/main-screen/header/title-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/title-section/style.js +1 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/index.js +1 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/style.d.ts +4 -1
- package/build/renderer/screens/main-screen/header/user-logged-section/style.js +1 -1
- package/build/renderer/screens/main-screen/index.js +1 -1
- package/build/renderer/screens/main-screen/program-info-section/index.js +1 -1
- package/build/renderer/screens/main-screen/program-info-section/style.d.ts +12 -4
- package/build/renderer/screens/main-screen/program-info-section/style.js +1 -1
- package/build/renderer/screens/main-screen/spending-methods-section/dynamic-slider.js +1 -1
- package/build/renderer/screens/main-screen/spending-methods-section/index.d.ts +1 -0
- package/build/renderer/screens/main-screen/spending-methods-section/index.js +1 -1
- package/build/renderer/screens/main-screen/style.js +1 -1
- package/build/renderer/style.d.ts +18 -2
- package/build/renderer/style.js +1 -1
- package/build/renderer/utils/i18n.d.ts +17 -0
- package/build/renderer/utils/i18n.js +1 -1
- package/build/renderer/utils/locales/de.json.js +1 -0
- package/build/renderer/utils/locales/en.json.js +1 -1
- package/build/renderer/utils/locales/fr.json.js +1 -0
- package/build/renderer/utils/locales/nl.json.js +1 -0
- package/build/renderer/utils/locales/tr.json.js +1 -1
- package/build/renderer/utils/loyalty-details.js +1 -1
- package/build/renderer/utils/object-utils.d.ts +2 -0
- package/build/renderer/utils/object-utils.js +1 -0
- package/build/storefront-widget-script-injector.iife.js +68 -0
- package/build/storefront-widget-script-injector.iife.js.map +1 -0
- package/build/utils.d.ts +32 -4
- package/build/utils.js +1 -1
- package/package.json +23 -11
- package/build/_virtual/index.js +0 -1
- package/build/_virtual/use-sync-external-store-shim.development.js +0 -1
- package/build/_virtual/use-sync-external-store-shim.production.js +0 -1
- package/build/ext/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js +0 -1
- package/build/ext/react-i18next/dist/es/defaults.js +0 -1
- package/build/ext/react-i18next/dist/es/i18nInstance.js +0 -1
- package/build/ext/react-i18next/dist/es/initReactI18next.js +0 -1
- package/build/ext/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -10
- package/build/ext/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -10
- package/build/ext/use-sync-external-store/shim/index.js +0 -1
- package/build/models/base.d.ts +0 -4
- package/build/models/base.js +0 -1
- package/build/models/category/index.d.ts +0 -5
- package/build/models/loyalty-widget/header-background/index.d.ts +0 -9
package/build/utils.d.ts
CHANGED
|
@@ -1,10 +1,38 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
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
|
-
|
|
5
|
+
import { WidgetIconTypeEnum } from "models/loyalty-widget/types";
|
|
6
|
+
import { EarningMethodTypeEnum, LoyaltyProgramMethodSpendingTypeEnum, LoyaltyWidgetScreenTypeEnum } from "models/types";
|
|
7
|
+
interface WidgetStorageData {
|
|
8
|
+
closedDescriptionSessionId?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get ikas_session_id from localStorage
|
|
12
|
+
*/
|
|
13
|
+
export declare const getIkasSessionId: () => string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Get widget storage data from localStorage
|
|
16
|
+
*/
|
|
17
|
+
export declare const getWidgetStorage: () => WidgetStorageData;
|
|
18
|
+
/**
|
|
19
|
+
* Set widget storage data to localStorage
|
|
20
|
+
*/
|
|
21
|
+
export declare const setWidgetStorage: (data: WidgetStorageData) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Check if description is closed for current session
|
|
24
|
+
*/
|
|
25
|
+
export declare const isDescriptionClosedForCurrentSession: () => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Mark description as closed for current session
|
|
28
|
+
*/
|
|
29
|
+
export declare const markDescriptionClosedForSession: () => void;
|
|
30
|
+
export declare const getScreenIcon: (screenType: LoyaltyWidgetScreenTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element | null;
|
|
31
|
+
export declare const getEarningMethodIcon: (earningMethod: EarningMethodTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element | null;
|
|
32
|
+
export declare const getHistoryEarningMethodLabel: (earningMethodType: EarningMethodTypeEnum) => string;
|
|
7
33
|
export declare const getEarningMethodTitle: (earningMethod: LoyaltyProgramEarningMethod) => string;
|
|
8
34
|
export declare const getSpendingMethodIcon: (spendingMethod: LoyaltyProgramMethodSpendingTypeEnum, widgetIconType: WidgetIconTypeEnum) => React.JSX.Element | null;
|
|
35
|
+
export declare const getRefundIcon: (widgetIconType: WidgetIconTypeEnum) => React.JSX.Element | null;
|
|
9
36
|
export declare const getSpendingMethodTitle: (method: LoyaltyProgramSpendingMethod) => string;
|
|
10
|
-
export declare const getSpendingMethodDescription: (method: LoyaltyProgramSpendingMethod,
|
|
37
|
+
export declare const getSpendingMethodDescription: (method: LoyaltyProgramSpendingMethod, viewModel: LoyaltyWidgetViewModel) => string | React.JSX.Element;
|
|
38
|
+
export {};
|
package/build/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__makeTemplateObject as e}from'./ext/tslib/tslib.es6.mjs.js';import
|
|
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 f}from"./assets/widget-icons/illustraions/bubbleChatIllustration.js";import{ApprovedChatIllustration as I}from"./assets/widget-icons/illustraions/approvedChatIllustration.js";import{TshirtIllustration as g}from"./assets/widget-icons/illustraions/tshirtIllustration.js";import{Medal as O}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 h}from"./assets/widget-icons/illustraions/refundIllustration.js";import{BankCoin as A}from"./assets/widget-icons/illustraions/bankCoin.js";import{WidgetIconTypeEnum as D}from"./models/loyalty-widget/types/index.js";import{EarningMethodTypeEnum as y,LoyaltyWidgetScreenTypeEnum as x,LoyaltyProgramPointEarningTypeEnum as j,LoyaltyProgramMethodSpendingTypeEnum as w}from"./models/types/index.js";import{FlexibleValueContainer as L}from"./renderer/components/flexible-value-container/index.js";import{textSM as P,textXSMedium as v,textXS as b}from"./renderer/components/style/typography.js";var B,G,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})},$=((B={})[D.ILLUSTRATION]=((G={})[y.CUSTOMER_REGISTER]=n.createElement(S,null),G[y.ENABLE_SUBSCRIPTION]=n.createElement(I,null),G[y.BUY_PRODUCT]=n.createElement(g,null),G[y.CUSTOMER_REVIEW]=n.createElement(f,null),G[y.CUSTOMER_SEGMENT]=n.createElement(E,null),G[y.ORDER_CREATE]=n.createElement(U,null),G),B[D.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),B),ee=((Y={})[D.ILLUSTRATION]=((H={})[x.MAIN_SCREEN]=n.createElement("div",null),H[x.CREDIT_EARNING_METHODS_SCREEN]=n.createElement(O,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),Y[D.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),Y),te=function(e,t){return t&&t!==D.NONE&&ee[t]?ee[t][e]:null},ne=function(e,t){return t&&t!==D.NONE&&$[t]?$[t][e]:null},re=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""}},se=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===j.DYNAMIC_ORDER_AMOUNT)return t("earningMethods.ORDER_CREATE.RECEIVE_POINTS_ON_SPEND.title");if(e.pointEarningType===j.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""}},ie=function(e,t){var r,s,i;return t===D.NONE?null:((r={})[D.ILLUSTRATION]=((s={})[w.FIXED_AMOUNT]=n.createElement(A,null),s[w.RATIO]=n.createElement(A,null),s[w.FREE_PRODUCT]=n.createElement(N,null),s[w.FREE_SHIPPING]=n.createElement(C,null),s),r[D.NORMAL]=((i={})[w.FIXED_AMOUNT]=n.createElement(c,null),i[w.RATIO]=n.createElement(c,null),i[w.FREE_PRODUCT]=n.createElement(m,null),i[w.FREE_SHIPPING]=n.createElement(d,null),i),r)[t][e]},le=function(e){var t;return e&&e!==D.NONE?((t={})[D.ILLUSTRATION]=n.createElement(h,null),t[D.NORMAL]=n.createElement(_,null),t)[e]:null},oe=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 w.FIXED_AMOUNT:return e.isDynamic?n("spendingMethods.FIXED_AMOUNT.dynamicTitle"):n("spendingMethods.FIXED_AMOUNT.title");case w.RATIO:return n("spendingMethods.RATIO.title");case w.FREE_SHIPPING:return n("spendingMethods.FREE_SHIPPING.title");case w.FREE_PRODUCT:return n("spendingMethods.FREE_PRODUCT.title");default:return""}},ae=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"])),P,v),Ee=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"])),P,b),ce=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"]))),me=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(Ee,null,o("earningMethods.xPoints",{points:a})),n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},n.createElement(ce,null,n.createElement(l,null)),n.createElement(ae,null,r&&"number"==typeof e?t.formatCurrency(e):e))):n.createElement(n.Fragment,null,n.createElement(Ee,null,o("earningMethods.xPoints",{points:a})),n.createElement(ce,null,n.createElement(l,null)),n.createElement(ae,null,r&&"number"==typeof e?t.formatCurrency(e):e))})};return e.type===w.FIXED_AMOUNT&&E?c(E,!0):e.type===w.RATIO&&E?c("%".concat(E)):o("earningMethods.xPoints",{points:a})};export{ne as getEarningMethodIcon,se as getEarningMethodTitle,re as getHistoryEarningMethodLabel,q as getIkasSessionId,le as getRefundIcon,te as getScreenIcon,me as getSpendingMethodDescription,ie as getSpendingMethodIcon,oe as getSpendingMethodTitle,z as getWidgetStorage,Q as isDescriptionClosedForCurrentSession,Z as markDescriptionClosedForSession,K as setWidgetStorage};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/loyalty-widget-renderer",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.81",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "ucy",
|
|
6
6
|
"license": "ISC",
|
|
@@ -24,22 +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
|
-
"styled-components": "^5.3.3",
|
|
38
42
|
"@types/styled-components": "5.1.26",
|
|
39
43
|
"@types/uuid": "^9.0.0",
|
|
40
|
-
"
|
|
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",
|
|
41
51
|
"mobx-react": "^7.6.0",
|
|
42
52
|
"parcel": "^2.12.0",
|
|
53
|
+
"prettier": "^3.7.4",
|
|
43
54
|
"react": "^17 || ^18",
|
|
44
55
|
"react-dom": "^17 || ^18",
|
|
45
56
|
"rollup": "^2.75.6",
|
|
@@ -49,20 +60,21 @@
|
|
|
49
60
|
"rollup-plugin-rename-node-modules": "^1.2.0",
|
|
50
61
|
"rollup-plugin-terser": "^7.0.2",
|
|
51
62
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
63
|
+
"styled-components": "^5.3.3",
|
|
52
64
|
"ts-patch": "^3.3.0",
|
|
53
65
|
"typescript": "^5.9.3",
|
|
54
66
|
"typescript-transform-paths": "^3.5.5"
|
|
55
67
|
},
|
|
56
68
|
"peerDependencies": {
|
|
69
|
+
"mobx": "^6.7.0",
|
|
70
|
+
"mobx-react": "^7.6.0",
|
|
57
71
|
"react": "^17 || ^18",
|
|
58
72
|
"react-dom": "^17 || ^18",
|
|
59
|
-
"styled-components": "^5.3.3"
|
|
60
|
-
"mobx": "^6.1.3",
|
|
61
|
-
"mobx-react": "^7.6.0"
|
|
73
|
+
"styled-components": "^5.3.3"
|
|
62
74
|
},
|
|
63
75
|
"dependencies": {
|
|
64
|
-
"
|
|
65
|
-
"i18next": "^
|
|
66
|
-
"
|
|
76
|
+
"i18next": "^21.6.12",
|
|
77
|
+
"react-i18next": "^11.15.5",
|
|
78
|
+
"uuidv4": "^6.2.13"
|
|
67
79
|
}
|
|
68
|
-
}
|
|
80
|
+
}
|
package/build/_virtual/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r={exports:{}};export{r as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r={};export{r as __exports};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r={};export{r as __exports};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
new RegExp(Object.keys({" ":" ","&":"&","<":"<",">":">",""":'"',"'":"'","©":"©","®":"®","™":"™","…":"…","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","′":"′","″":"″","‹":"‹","›":"›","§":"§","¶":"¶","·":"·"," ":" "," ":" "," ":" ","€":"€","£":"£","¥":"¥","¢":"¢","¤":"¤","×":"×","÷":"÷","−":"−","±":"±","≠":"≠","≤":"≤","≥":"≥","≈":"≈","≡":"≡","∞":"∞","∫":"∫","∑":"∑","∏":"∏","√":"√","∂":"∂","‰":"‰","°":"°","µ":"µ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ","¡":"¡","¿":"¿","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ª":"ª","º":"º","¯":"¯","´":"´","¸":"¸","¹":"¹","²":"²","³":"³","¼":"¼","½":"½","¾":"¾","♠":"♠","♣":"♣","♥":"♥","♦":"♦","◊":"◊","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","ℵ":"ℵ"}).map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),"g");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{unescape as e}from"./unescape.js";let s={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e};const n=(e={})=>{s={...s,...e}},t=()=>s;export{t as getDefaults,n as setDefaults};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let t;const e=e=>{t=e},o=()=>t;export{o as getI18n,e as setI18n};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{setDefaults as t}from"./defaults.js";import{setI18n as o}from"./i18nInstance.js";const r={type:"3rdParty",init(r){t(r.options.react),o(r)}};export{r as initReactI18next};
|
|
@@ -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();
|
package/build/models/base.d.ts
DELETED
package/build/models/base.js
DELETED
|
@@ -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,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
|
-
}
|