@superlogic/spree-pay 0.4.1 → 0.4.6
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/{CryptoComTab-PW3NRWJL.js → CryptoComTab-5662XFNI.js} +2 -2
- package/build/{CryptoTab-ZABUPHVT.js → CryptoTab-7EG23TQW.js} +4 -4
- package/build/{chunk-IDYBXJWP.js → chunk-7I6EBCSI.js} +1 -1
- package/build/{chunk-5GHGAP6Z.js → chunk-AGTOSFMT.js} +15 -3
- package/build/{chunk-W43ZCY4N.js → chunk-FKAVWVFL.js} +51 -2
- package/build/index.cjs +243 -127
- package/build/index.css +9 -21
- package/build/index.d.cts +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +128 -76
- package/package.json +13 -11
- package/src/styles/bridge.css +53 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Iframe3ds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7I6EBCSI.js";
|
|
4
4
|
import {
|
|
5
5
|
InfoBanner,
|
|
6
6
|
Legal,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
useSpreePayRegister,
|
|
13
13
|
useSpreePaymentMethod,
|
|
14
14
|
useStaticConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AGTOSFMT.js";
|
|
16
16
|
|
|
17
17
|
// src/components/CryptoComTab/CryptoComTab.tsx
|
|
18
18
|
import { useCallback, useEffect } from "react";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CheckoutButton,
|
|
3
3
|
PointsSwitch,
|
|
4
4
|
cn as cn2
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FKAVWVFL.js";
|
|
6
6
|
import {
|
|
7
7
|
Dialog,
|
|
8
8
|
DialogContent,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
useSpreePayConfig,
|
|
17
17
|
useSpreePayRegister,
|
|
18
18
|
useSpreePaymentMethod
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-AGTOSFMT.js";
|
|
20
20
|
|
|
21
21
|
// src/components/CryptoTab/Crypto/CryptoWrapper.tsx
|
|
22
22
|
import { useMemo as useMemo2 } from "react";
|
|
@@ -409,7 +409,7 @@ function Input({ className, type, ...props }) {
|
|
|
409
409
|
type,
|
|
410
410
|
"data-slot": "input",
|
|
411
411
|
className: cn2(
|
|
412
|
-
"file:text-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0
|
|
412
|
+
"file:text-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input px-universal-2xs py-universal-6xs rounded-radius-universal-xs text-body-m file:text-label-s file:font-label-primary flex h-9 w-full min-w-0 border bg-transparent text-(--color-text-icons-primary-default) shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent placeholder:text-(--color-text-icons-tertiary-default) disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
413
413
|
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
414
414
|
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
415
415
|
className
|
|
@@ -501,7 +501,7 @@ function Separator2({
|
|
|
501
501
|
decorative,
|
|
502
502
|
orientation,
|
|
503
503
|
className: cn2(
|
|
504
|
-
"shrink-0 bg-(--
|
|
504
|
+
"shrink-0 bg-(--color-border-default) data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
505
505
|
className
|
|
506
506
|
),
|
|
507
507
|
...props
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/types/payments.ts
|
|
2
|
+
var isNewCard = (card) => !("cardId" in card);
|
|
2
3
|
var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
|
|
3
4
|
PaymentType2["CREDIT_CARD"] = "CREDIT_CARD";
|
|
4
5
|
PaymentType2["CRYPTO"] = "CRYPTO";
|
|
@@ -9,7 +10,7 @@ var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
|
|
|
9
10
|
})(PaymentType || {});
|
|
10
11
|
|
|
11
12
|
// package.json
|
|
12
|
-
var version = "0.4.
|
|
13
|
+
var version = "0.4.6";
|
|
13
14
|
|
|
14
15
|
// src/utils/logger.ts
|
|
15
16
|
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
@@ -595,10 +596,20 @@ var SlapiPaymentService = {
|
|
|
595
596
|
throw error;
|
|
596
597
|
}
|
|
597
598
|
},
|
|
598
|
-
|
|
599
|
+
removeCard: async ({ cardId }) => {
|
|
600
|
+
slapiLogger.debug("Removing card", { cardId });
|
|
601
|
+
try {
|
|
602
|
+
await slapiApi.delete(`/v1/payments/cards/${cardId}`);
|
|
603
|
+
slapiLogger.info("Card removed successfully", { cardId });
|
|
604
|
+
} catch (error) {
|
|
605
|
+
slapiLogger.error("Failed to remove card", error, { cardId });
|
|
606
|
+
throw error;
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
addCard: async ({ source, hash, saveCard }) => {
|
|
599
610
|
slapiLogger.debug("Adding card", { hash, sourcePrefix: source.substring(0, 10) });
|
|
600
611
|
try {
|
|
601
|
-
const data = await slapiApi.post("/v1/payments/cards", { hash, source });
|
|
612
|
+
const data = await slapiApi.post("/v1/payments/cards", { hash, source, saveCard });
|
|
602
613
|
slapiLogger.info("Card added successfully", { cardId: data.id, hash });
|
|
603
614
|
return { data };
|
|
604
615
|
} catch (error) {
|
|
@@ -765,6 +776,7 @@ function DialogDescription({ className, ...props }) {
|
|
|
765
776
|
|
|
766
777
|
export {
|
|
767
778
|
PaymentError,
|
|
779
|
+
isNewCard,
|
|
768
780
|
PaymentType,
|
|
769
781
|
LogLevel,
|
|
770
782
|
logger,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useSpreePayEnv,
|
|
7
7
|
useSpreePaymentMethod,
|
|
8
8
|
useStaticConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AGTOSFMT.js";
|
|
10
10
|
|
|
11
11
|
// src/components/common/PointsSwitch.tsx
|
|
12
12
|
import { useId } from "react";
|
|
@@ -283,7 +283,56 @@ var CheckoutButton = ({ isLoggedIn }) => {
|
|
|
283
283
|
|
|
284
284
|
// ../ui/src/lib/utils.ts
|
|
285
285
|
import { clsx } from "clsx";
|
|
286
|
-
import {
|
|
286
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
287
|
+
var isUniversalSpacing = (value) => value.startsWith("universal-");
|
|
288
|
+
var isLayoutToken = (value) => value.startsWith("universal-") || value.startsWith("layout-");
|
|
289
|
+
var isUniversalRadius = (value) => value.startsWith("radius-universal-");
|
|
290
|
+
var isTypography = (value) => value.startsWith("heading-") || value.startsWith("body-") || value.startsWith("label-") || value.startsWith("menu-");
|
|
291
|
+
var twMerge = extendTailwindMerge({
|
|
292
|
+
extend: {
|
|
293
|
+
classGroups: {
|
|
294
|
+
"font-size": [{ text: [isTypography] }],
|
|
295
|
+
leading: [{ leading: [isTypography] }],
|
|
296
|
+
"font-weight": [{ font: [isTypography] }],
|
|
297
|
+
p: [{ p: [isUniversalSpacing] }],
|
|
298
|
+
px: [{ px: [isUniversalSpacing] }],
|
|
299
|
+
py: [{ py: [isUniversalSpacing] }],
|
|
300
|
+
pt: [{ pt: [isUniversalSpacing] }],
|
|
301
|
+
pb: [{ pb: [isUniversalSpacing] }],
|
|
302
|
+
pl: [{ pl: [isUniversalSpacing] }],
|
|
303
|
+
pr: [{ pr: [isUniversalSpacing] }],
|
|
304
|
+
m: [{ m: [isUniversalSpacing] }],
|
|
305
|
+
mx: [{ mx: [isUniversalSpacing] }],
|
|
306
|
+
my: [{ my: [isUniversalSpacing] }],
|
|
307
|
+
mt: [{ mt: [isUniversalSpacing] }],
|
|
308
|
+
mb: [{ mb: [isUniversalSpacing] }],
|
|
309
|
+
ml: [{ ml: [isUniversalSpacing] }],
|
|
310
|
+
mr: [{ mr: [isUniversalSpacing] }],
|
|
311
|
+
gap: [{ gap: [isUniversalSpacing] }],
|
|
312
|
+
"gap-x": [{ "gap-x": [isUniversalSpacing] }],
|
|
313
|
+
"gap-y": [{ "gap-y": [isUniversalSpacing] }],
|
|
314
|
+
"space-x": [{ "space-x": [isUniversalSpacing] }],
|
|
315
|
+
"space-y": [{ "space-y": [isUniversalSpacing] }],
|
|
316
|
+
w: [{ w: [isLayoutToken] }],
|
|
317
|
+
"min-w": [{ "min-w": [isLayoutToken] }],
|
|
318
|
+
"max-w": [{ "max-w": [isLayoutToken] }],
|
|
319
|
+
h: [{ h: [isLayoutToken] }],
|
|
320
|
+
"min-h": [{ "min-h": [isLayoutToken] }],
|
|
321
|
+
"max-h": [{ "max-h": [isLayoutToken] }],
|
|
322
|
+
rounded: [{ rounded: [isUniversalRadius] }],
|
|
323
|
+
"rounded-s": [{ "rounded-s": [isUniversalRadius] }],
|
|
324
|
+
"rounded-e": [{ "rounded-e": [isUniversalRadius] }],
|
|
325
|
+
"rounded-t": [{ "rounded-t": [isUniversalRadius] }],
|
|
326
|
+
"rounded-r": [{ "rounded-r": [isUniversalRadius] }],
|
|
327
|
+
"rounded-b": [{ "rounded-b": [isUniversalRadius] }],
|
|
328
|
+
"rounded-l": [{ "rounded-l": [isUniversalRadius] }],
|
|
329
|
+
"rounded-tl": [{ "rounded-tl": [isUniversalRadius] }],
|
|
330
|
+
"rounded-tr": [{ "rounded-tr": [isUniversalRadius] }],
|
|
331
|
+
"rounded-br": [{ "rounded-br": [isUniversalRadius] }],
|
|
332
|
+
"rounded-bl": [{ "rounded-bl": [isUniversalRadius] }]
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
});
|
|
287
336
|
function cn2(...inputs) {
|
|
288
337
|
return twMerge(clsx(inputs));
|
|
289
338
|
}
|