@licklist/design 0.44.486 → 0.44.487
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/dist/events/event-venue-map/components/MapPoint/MapPoint.js +1 -1
- package/dist/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.d.ts +2 -1
- package/dist/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.d.ts.map +1 -1
- package/dist/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.js +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
- package/package.json +1 -1
- package/src/events/event-venue-map/components/MapPoint/MapPoint.tsx +2 -2
- package/src/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.tsx +8 -0
- package/src/iframe/ryft/RyftPaymentForm.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,o=require("tslib"),n=require("react"),t=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,i=require("@licklist/plugins/dist/context/event/EventVenueMapContext"),r=require("react-konva"),u=require("../../utils/index.js"),c=require("./components/PointIcon/PointIcon.js"),d=require("./components/ProductIcon/ProductIcon.js");exports.MapPoint=function(e){var s=e.xCoordinate,l=e.yCoordinate,a=e.id,f=e.imageOffsetX,p=e.imageOffsetY,v=e.imageScale,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,o=require("tslib"),n=require("react"),t=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,i=require("@licklist/plugins/dist/context/event/EventVenueMapContext"),r=require("react-konva"),u=require("../../utils/index.js"),c=require("./components/PointIcon/PointIcon.js"),d=require("./components/ProductIcon/ProductIcon.js");exports.MapPoint=function(e){var s=e.xCoordinate,l=e.yCoordinate,a=e.id,f=e.imageOffsetX,p=e.imageOffsetY,v=e.imageScale,m=e.localId,P=e.pointNumber,I=e.changeCursorType,x=e.usedInIframe,C=e.choosedProductUuids,M=void 0===C?[]:C,O=e.errorOnChoosedProductUuids,g=void 0===O?[]:O,E=e.isSoldOut,y=n.useContext(i.EventVenueMapContext),b=y.setActiveElementKey,h=y.activeElementKey,q=y.setMapPoints,U=y.editMode,j=y.mapPointProducts,S=o.__read(u.calculatePointsCoordinates(s,l,{imageScale:v,imageOffsetX:f,imageOffsetY:p}),2),B=S[0],_=S[1],k=String(a||m),A=k===h,K=j.find((function(e){return a&&e.pointId&&e.pointId===a})),N=Boolean(j.find((function(e){return M.includes(null==e?void 0:e.productUuid)&&M.includes(null==K?void 0:K.productUuid)}))),T=Boolean(j.find((function(e){return g.includes(null==e?void 0:e.productUuid)&&g.includes(null==K?void 0:K.productUuid)}))),V=function(e){e.cancelBubble=!0,A||E||(b(k),q((function(e){var o=e.slice(),n=o.find((function(e){return e.id===a||(null==e?void 0:e.localId)===m})),t=o.indexOf(n);return o.splice(t,1),o.push(n),o})))};return t.createElement(r.Group,{onClick:V,onTap:V,onMouseEnter:function(){I("pointer")},onMouseLeave:function(){I()}},x?t.createElement(d.ProductIcon,{x:B,y:_,isSoldOut:E,isActive:A,isProductChoosed:N,isErrorOnChoosedProduct:T}):t.createElement(c.PointIcon,{x:B,y:_,isActive:A,hasProduct:!E&&Boolean(K),pointNumber:P,onDelete:function(){b(),I(),q((function(e){return u.removeMapPointFromPoints(e,a,m)}))},editMode:U}))};
|
package/dist/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.d.ts
CHANGED
|
@@ -5,8 +5,9 @@ export declare type ProductIconProps = KonvaNodeEvents & Konva.ShapeConfig & {
|
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
7
7
|
isActive?: boolean;
|
|
8
|
+
isSoldOut?: boolean;
|
|
8
9
|
isErrorOnChoosedProduct: boolean;
|
|
9
10
|
isProductChoosed: boolean;
|
|
10
11
|
};
|
|
11
|
-
export declare const ProductIcon: ({ x, y, isActive, isErrorOnChoosedProduct, isProductChoosed, }: ProductIconProps) => JSX.Element;
|
|
12
|
+
export declare const ProductIcon: ({ x, y, isActive, isSoldOut, isErrorOnChoosedProduct, isProductChoosed, }: ProductIconProps) => JSX.Element;
|
|
12
13
|
//# sourceMappingURL=ProductIcon.d.ts.map
|
package/dist/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductIcon.d.ts","sourceRoot":"","sources":["../../../../../../src/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAQ,eAAe,EAAiB,MAAM,aAAa,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductIcon.d.ts","sourceRoot":"","sources":["../../../../../../src/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAQ,eAAe,EAAiB,MAAM,aAAa,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B,oBAAY,gBAAgB,GAAG,eAAe,GAC5C,KAAK,CAAC,WAAW,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uBAAuB,EAAE,OAAO,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAkBJ,eAAO,MAAM,WAAW,8EAOrB,gBAAgB,gBA8FlB,CAAC"}
|
package/dist/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o,t=require("tslib"),e=require("react"),r=(o=e)&&"object"==typeof o&&"default"in o?o.default:o,n=require("react-konva"),i="#FFFFFF",a="#FFFFFF80",c="#0E8CE2",l=function(o,t){void 0===t&&(t=!1);var e=document.getElementById("snippet-template-context");if(e){var r=getComputedStyle(e).getPropertyValue(o);return!r||r&&!t?r:"".concat(r,"80")}};exports.ProductIcon=function(o){var p,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o,t=require("tslib"),e=require("react"),r=(o=e)&&"object"==typeof o&&"default"in o?o.default:o,n=require("react-konva"),i="#FFFFFF",a="#FFFFFF80",c="#0E8CE2",l="#878787",d=function(o,t){void 0===t&&(t=!1);var e=document.getElementById("snippet-template-context");if(e){var r=getComputedStyle(e).getPropertyValue(o);return!r||r&&!t?r:"".concat(r,"80")}};exports.ProductIcon=function(o){var p,s,u=o.x,v=o.y,C=o.isActive,F=o.isSoldOut,f=o.isErrorOnChoosedProduct,k=o.isProductChoosed,P=e.useMemo((function(){return{pointBackgroundColor:d("--snippet-canvas-point-background-color")||i,pointBorderColor:d("--snippet-canvas-point-border-color",!0)||a,pointFontColor:d("--snippet-canvas-point-font-color")||c,activePointBackgroundColor:d("--snippet-canvas-active-point-background-color")||c,activePointBorderColor:d("--snippet-canvas-active-point-border-color",!0)||a,activePointFontColor:d("--snippet-canvas-active-point-font-color")||i}}),[C,f,k]);return r.createElement(n.Group,{x:u,y:v},r.createElement(n.Circle,t.__assign({radius:14,strokeWidth:2,x:0,y:-21},(p=P.pointBackgroundColor,s=P.pointBorderColor,C&&(s=P.activePointBorderColor),k&&(p=P.activePointBackgroundColor),f&&(s="#ff000080"),F&&(s=l,p=l),{fill:p,stroke:s}))),k?r.createElement(n.Path,{x:-7,y:-28,data:"M1.5 6L5.5 10L13.5 2",width:28,height:28,fill:P.activePointBackgroundColor,stroke:P.activePointFontColor,strokeWidth:3}):r.createElement(n.Path,{x:-7,y:-28,data:"M14 0C9.3569 0.6633 4.6431 0.6633 0 0L6 7V13H3V14H11V13H8V7L14 0Z",width:28,height:28,strokeWidth:1,fill:P.pointFontColor,stroke:P.pointFontColor}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),a=e(r),n=require("react-router-dom"),i=require("../../static/loader/BlockLoader.js"),o=require("react-i18next"),u=e(require("react-bootstrap/Button")),s=require("react-hook-form"),c=e(require("react-bootstrap/Form")),l=require("../../static/loader/ButtonLoader.js"),d=e(require("react-bootstrap/Alert"));require("../../static/index.js");var f=require("@licklist/plugins/dist/hooks/Ryft/useRyftPayment"),m={insufficient_funds:"insufficientFunds",declined_do_not_honour:"declinedDoNotHonour",invalid_card_number:"invalidCardNumber",restricted_card:"restrictedCard",security_violation:"securityViolation",expired_card:"expiredCard",gateway_reject:"gatewayReject",bad_track_data:"badTrackData","3ds_authentication_failure":"3dsAuthenticationFailure",unknown_error:"unknownError"};exports.RyftPaymentForm=function(e){var y=e.accountId,_=e.isCreateLoading,E=e.initRyft,v=e.resetReferrer,p=e.onSubmit,b=o.useTranslation(["Design","Validation","Ryft"]).t,g=n.useHistory(),R=t.__read(r.useState(!1),2),h=R[0],q=R[1],k=t.__read(r.useState(!1),2),w=k[0],S=k[1],T=t.__read(r.useState(!1),2),F=T[0],N=T[1],A=t.__read(r.useState(void 0),2),
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),a=e(r),n=require("react-router-dom"),i=require("../../static/loader/BlockLoader.js"),o=require("react-i18next"),u=e(require("react-bootstrap/Button")),s=require("react-hook-form"),c=e(require("react-bootstrap/Form")),l=require("../../static/loader/ButtonLoader.js"),d=e(require("react-bootstrap/Alert"));require("../../static/index.js");var f=require("@licklist/plugins/dist/hooks/Ryft/useRyftPayment"),m={insufficient_funds:"insufficientFunds",declined_do_not_honour:"declinedDoNotHonour",invalid_card_number:"invalidCardNumber",restricted_card:"restrictedCard",security_violation:"securityViolation",expired_card:"expiredCard",gateway_reject:"gatewayReject",bad_track_data:"badTrackData","3ds_authentication_failure":"3dsAuthenticationFailure",unknown_error:"unknownError"};exports.RyftPaymentForm=function(e){var y=e.accountId,_=e.isCreateLoading,E=e.initRyft,v=e.resetReferrer,p=e.onSubmit,b=o.useTranslation(["Design","Validation","Ryft"]).t,g=n.useHistory(),R=t.__read(r.useState(!1),2),h=R[0],q=R[1],k=t.__read(r.useState(!1),2),w=k[0],S=k[1],T=t.__read(r.useState(!1),2),F=T[0],N=T[1],A=t.__read(r.useState(void 0),2),P=A[0],x=A[1],D=f.useRyftPayment().addEventHandler,C=s.useForm(),j=function(){v&&v()},L=function(e){(null==e?void 0:e.id)&&(null==e?void 0:e.returnUrl)&&(window.location.href="".concat(e.returnUrl,"&ps=").concat(e.id),j())};return r.useEffect((function(){y.data&&!y.isError&&E((function(){D("cardValidationChanged",(function(e){q(e.isValid)})),N(!1)}),(function(){return N(!0)}))}),[y.data]),y.isLoading||y.isFetching||_?a.createElement("div",{className:"mt-5 pt-5"},a.createElement(i.BlockLoader,null)):y.isError?a.createElement("div",{className:"mt-5 ryft-init-failure"},a.createElement(d,{key:"danger",variant:"danger"},a.createElement("h5",null,b("Ryft:errorMessage")),b("Ryft:noPaymentProviderFound"))):F?a.createElement("div",{className:"mt-5 ryft-init-failure"},a.createElement(d,{key:"danger",variant:"danger"},a.createElement("h5",null,b("Ryft:errorMessage")),b("Ryft:initFailureMessage"),a.createElement("div",{className:"flex flex-column align-items-center mt-4"},a.createElement(u,{variant:"primary",onClick:function(){g.go(0)}},b("Ryft:refresh"))))):a.createElement(a.Fragment,null,a.createElement(c.Label,null,b("Design:paymentDetails")),a.createElement("form",{id:"ryft-pay-form",noValidate:!0,onSubmit:C.handleSubmit((function(){return t.__awaiter(void 0,void 0,void 0,(function(){var e,r,a;return t.__generator(this,(function(t){switch(t.label){case 0:S(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,p()];case 2:if((e=t.sent())||x("unknown_error"),"requiredAction"in e){if(e.status!==f.RYFT_STATUS_PENDING_ACTION||!(null===(a=e.requiredAction)||void 0===a?void 0:a.url))return L(e),[2];window.location.href=e.requiredAction.url,j()}return e.status===f.RYFT_STATUS_APPROVED||e.status===f.RYFT_STATUS_CAPTURED?(L(e),[2]):(e.lastError&&(x(e.lastError),j()),[3,5]);case 3:return r=t.sent(),x(r),[3,5];case 4:return S(!1),[7];case 5:return[2]}}))}))})),className:"ryft-payment-form"},a.createElement("div",{className:"submit-button-wrapper mt-3 p-1"},a.createElement(u,{type:"submit",disabled:w||!h},w&&a.createElement(l.ButtonLoader,null),b("Design:buyNow"))),P&&a.createElement("div",{id:"ryft-payment-error"},b("".concat(m[P])))))},exports.ryftErrorMap=m;
|
package/package.json
CHANGED
|
@@ -132,7 +132,7 @@ export const MapPoint = ({
|
|
|
132
132
|
<ProductIcon
|
|
133
133
|
x={pointX}
|
|
134
134
|
y={pointY}
|
|
135
|
-
|
|
135
|
+
isSoldOut={isSoldOut}
|
|
136
136
|
isActive={isActive}
|
|
137
137
|
isProductChoosed={isProductChoosed}
|
|
138
138
|
isErrorOnChoosedProduct={isErrorOnChoosedProduct}
|
|
@@ -142,7 +142,7 @@ export const MapPoint = ({
|
|
|
142
142
|
x={pointX}
|
|
143
143
|
y={pointY}
|
|
144
144
|
isActive={isActive}
|
|
145
|
-
hasProduct={Boolean(pointProduct)}
|
|
145
|
+
hasProduct={!isSoldOut && Boolean(pointProduct)}
|
|
146
146
|
pointNumber={pointNumber}
|
|
147
147
|
onDelete={onDelete}
|
|
148
148
|
editMode={editMode}
|
package/src/events/event-venue-map/components/MapPoint/components/ProductIcon/ProductIcon.tsx
CHANGED
|
@@ -22,6 +22,7 @@ const BACKGROUND_COLOR = "#FFFFFF";
|
|
|
22
22
|
const BACKGROUND_COLOR_TRANSPARENT = "#FFFFFF80";
|
|
23
23
|
const FILL_COLOR = "#0E8CE2";
|
|
24
24
|
const ERROR_COLOR_TRANSPARENT = "#ff000080";
|
|
25
|
+
const NO_PRODUCT_ON_POINT = "#878787";
|
|
25
26
|
const SNIPPET_TEMPLATE_ID = "snippet-template-context";
|
|
26
27
|
|
|
27
28
|
export type ProductIconProps = KonvaNodeEvents &
|
|
@@ -29,6 +30,7 @@ export type ProductIconProps = KonvaNodeEvents &
|
|
|
29
30
|
x: number;
|
|
30
31
|
y: number;
|
|
31
32
|
isActive?: boolean;
|
|
33
|
+
isSoldOut?: boolean;
|
|
32
34
|
isErrorOnChoosedProduct: boolean;
|
|
33
35
|
isProductChoosed: boolean;
|
|
34
36
|
};
|
|
@@ -53,6 +55,7 @@ export const ProductIcon = ({
|
|
|
53
55
|
x,
|
|
54
56
|
y,
|
|
55
57
|
isActive,
|
|
58
|
+
isSoldOut,
|
|
56
59
|
isErrorOnChoosedProduct,
|
|
57
60
|
isProductChoosed,
|
|
58
61
|
}: ProductIconProps) => {
|
|
@@ -107,6 +110,11 @@ export const ProductIcon = ({
|
|
|
107
110
|
stroke = ERROR_COLOR_TRANSPARENT;
|
|
108
111
|
}
|
|
109
112
|
|
|
113
|
+
if (isSoldOut) {
|
|
114
|
+
stroke = NO_PRODUCT_ON_POINT;
|
|
115
|
+
fill = NO_PRODUCT_ON_POINT;
|
|
116
|
+
}
|
|
117
|
+
|
|
110
118
|
return { fill, stroke };
|
|
111
119
|
};
|
|
112
120
|
|
|
@@ -183,7 +183,7 @@ export const RyftPaymentForm = ({
|
|
|
183
183
|
onSubmit={methods.handleSubmit(handleSubmit)}
|
|
184
184
|
className="ryft-payment-form"
|
|
185
185
|
>
|
|
186
|
-
<div className="submit-button-wrapper mt-3
|
|
186
|
+
<div className="submit-button-wrapper mt-3 p-1">
|
|
187
187
|
<Button type="submit" disabled={isBtnDisabled || !isValid}>
|
|
188
188
|
{isBtnDisabled && <ButtonLoader />}
|
|
189
189
|
{t("Design:buyNow")}
|