@whop/embedded-components-react-js 0.0.5-beta.5 → 0.0.5-beta.7
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/chunk-NSSMTXJJ.mjs +9 -0
- package/dist/chunk-NSSMTXJJ.mjs.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/use-element-snapshot.d.ts +5 -0
- package/dist/lib/use-element-snapshot.js +64 -0
- package/dist/lib/use-element-snapshot.js.map +1 -0
- package/dist/lib/use-element-snapshot.mjs +41 -0
- package/dist/lib/use-element-snapshot.mjs.map +1 -0
- package/dist/lib/with-fallback.d.ts +55 -0
- package/dist/lib/with-fallback.js +85 -0
- package/dist/lib/with-fallback.js.map +1 -0
- package/dist/lib/with-fallback.mjs +58 -0
- package/dist/lib/with-fallback.mjs.map +1 -0
- package/dist/payouts/elements/balance.d.ts +11 -0
- package/dist/payouts/elements/balance.js +30 -0
- package/dist/payouts/elements/balance.js.map +1 -0
- package/dist/payouts/elements/balance.mjs +8 -0
- package/dist/payouts/elements/balance.mjs.map +1 -0
- package/dist/payouts/elements/bnpl-reserve-balance-breakdown.d.ts +11 -0
- package/dist/payouts/elements/bnpl-reserve-balance-breakdown.js +30 -0
- package/dist/payouts/elements/bnpl-reserve-balance-breakdown.js.map +1 -0
- package/dist/payouts/elements/bnpl-reserve-balance-breakdown.mjs +8 -0
- package/dist/payouts/elements/bnpl-reserve-balance-breakdown.mjs.map +1 -0
- package/dist/payouts/elements/change-account-country.d.ts +11 -0
- package/dist/payouts/elements/change-account-country.js +30 -0
- package/dist/payouts/elements/change-account-country.js.map +1 -0
- package/dist/payouts/elements/change-account-country.mjs +8 -0
- package/dist/payouts/elements/change-account-country.mjs.map +1 -0
- package/dist/payouts/elements/generate-withdrawal-receipt.d.ts +11 -0
- package/dist/payouts/elements/generate-withdrawal-receipt.js +30 -0
- package/dist/payouts/elements/generate-withdrawal-receipt.js.map +1 -0
- package/dist/payouts/elements/generate-withdrawal-receipt.mjs +8 -0
- package/dist/payouts/elements/generate-withdrawal-receipt.mjs.map +1 -0
- package/dist/payouts/elements/index.d.ts +16 -0
- package/dist/payouts/elements/index.js +31 -0
- package/dist/payouts/elements/index.js.map +1 -0
- package/dist/payouts/elements/index.mjs +13 -0
- package/dist/payouts/elements/index.mjs.map +1 -0
- package/dist/payouts/elements/pending-balance-breakdown.d.ts +11 -0
- package/dist/payouts/elements/pending-balance-breakdown.js +30 -0
- package/dist/payouts/elements/pending-balance-breakdown.js.map +1 -0
- package/dist/payouts/elements/pending-balance-breakdown.mjs +8 -0
- package/dist/payouts/elements/pending-balance-breakdown.mjs.map +1 -0
- package/dist/payouts/elements/regular-reserve-balance-breakdown.d.ts +11 -0
- package/dist/payouts/elements/regular-reserve-balance-breakdown.js +30 -0
- package/dist/payouts/elements/regular-reserve-balance-breakdown.js.map +1 -0
- package/dist/payouts/elements/regular-reserve-balance-breakdown.mjs +8 -0
- package/dist/payouts/elements/regular-reserve-balance-breakdown.mjs.map +1 -0
- package/dist/payouts/elements/reset-account.d.ts +11 -0
- package/dist/payouts/elements/reset-account.js +30 -0
- package/dist/payouts/elements/reset-account.js.map +1 -0
- package/dist/payouts/elements/reset-account.mjs +8 -0
- package/dist/payouts/elements/reset-account.mjs.map +1 -0
- package/dist/payouts/elements/status-banner.d.ts +18 -0
- package/dist/payouts/elements/status-banner.js +102 -0
- package/dist/payouts/elements/status-banner.js.map +1 -0
- package/dist/payouts/elements/status-banner.mjs +76 -0
- package/dist/payouts/elements/status-banner.mjs.map +1 -0
- package/dist/payouts/elements/total-balance-breakdown.d.ts +11 -0
- package/dist/payouts/elements/total-balance-breakdown.js +30 -0
- package/dist/payouts/elements/total-balance-breakdown.js.map +1 -0
- package/dist/payouts/elements/total-balance-breakdown.mjs +8 -0
- package/dist/payouts/elements/total-balance-breakdown.mjs.map +1 -0
- package/dist/payouts/elements/verify.d.ts +11 -0
- package/dist/payouts/elements/verify.js +30 -0
- package/dist/payouts/elements/verify.js.map +1 -0
- package/dist/payouts/elements/verify.mjs +8 -0
- package/dist/payouts/elements/verify.mjs.map +1 -0
- package/dist/payouts/elements/withdraw-button.d.ts +11 -0
- package/dist/payouts/elements/withdraw-button.js +30 -0
- package/dist/payouts/elements/withdraw-button.js.map +1 -0
- package/dist/payouts/elements/withdraw-button.mjs +8 -0
- package/dist/payouts/elements/withdraw-button.mjs.map +1 -0
- package/dist/payouts/elements/withdrawal-breakdown.d.ts +11 -0
- package/dist/payouts/elements/withdrawal-breakdown.js +30 -0
- package/dist/payouts/elements/withdrawal-breakdown.js.map +1 -0
- package/dist/payouts/elements/withdrawal-breakdown.mjs +8 -0
- package/dist/payouts/elements/withdrawal-breakdown.mjs.map +1 -0
- package/dist/payouts/elements/withdrawals.d.ts +11 -0
- package/dist/payouts/elements/withdrawals.js +30 -0
- package/dist/payouts/elements/withdrawals.js.map +1 -0
- package/dist/payouts/elements/withdrawals.mjs +8 -0
- package/dist/payouts/elements/withdrawals.mjs.map +1 -0
- package/dist/payouts/index.d.ts +17 -0
- package/dist/payouts/index.js +20 -0
- package/dist/payouts/index.js.map +1 -0
- package/dist/payouts/index.mjs +2 -0
- package/dist/payouts/index.mjs.map +1 -0
- package/dist/payouts/session.d.ts +11 -0
- package/dist/payouts/session.js +84 -0
- package/dist/payouts/session.js.map +1 -0
- package/dist/payouts/session.mjs +55 -0
- package/dist/payouts/session.mjs.map +1 -0
- package/dist/payouts/use-session-ref.d.ts +8 -0
- package/dist/payouts/use-session-ref.js +29 -0
- package/dist/payouts/use-session-ref.js.map +1 -0
- package/dist/payouts/use-session-ref.mjs +7 -0
- package/dist/payouts/use-session-ref.mjs.map +1 -0
- package/dist/provider.d.ts +11 -0
- package/dist/provider.js +116 -0
- package/dist/provider.js.map +1 -0
- package/dist/provider.mjs +87 -0
- package/dist/provider.mjs.map +1 -0
- package/package.json +2 -2
- package/package.json.temp +0 -44
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value)=>key in obj ? __defProp(obj, key, {
|
|
3
|
+
enumerable: true,
|
|
4
|
+
configurable: true,
|
|
5
|
+
writable: true,
|
|
6
|
+
value
|
|
7
|
+
}) : obj[key] = value;
|
|
8
|
+
var __publicField = (obj, key, value)=>__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
9
|
+
export { __publicField };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { PayoutsSession, usePayoutsSession } from './payouts/session.js';
|
|
2
|
+
export { BalanceElement } from './payouts/elements/balance.js';
|
|
3
|
+
export { ChangeAccountCountryElement } from './payouts/elements/change-account-country.js';
|
|
4
|
+
export { ResetAccountElement } from './payouts/elements/reset-account.js';
|
|
5
|
+
export { VerifyElement } from './payouts/elements/verify.js';
|
|
6
|
+
export { WithdrawButtonElement } from './payouts/elements/withdraw-button.js';
|
|
7
|
+
export { WithdrawalBreakdownElement } from './payouts/elements/withdrawal-breakdown.js';
|
|
8
|
+
export { WithdrawalsElement } from './payouts/elements/withdrawals.js';
|
|
9
|
+
export { TotalBalanceBreakdownElement } from './payouts/elements/total-balance-breakdown.js';
|
|
10
|
+
export { PendingBalanceBreakdownElement } from './payouts/elements/pending-balance-breakdown.js';
|
|
11
|
+
export { RegularReserveBalanceBreakdownElement } from './payouts/elements/regular-reserve-balance-breakdown.js';
|
|
12
|
+
export { BnplReserveBalanceBreakdownElement } from './payouts/elements/bnpl-reserve-balance-breakdown.js';
|
|
13
|
+
export { GenerateWithdrawalReceiptElement } from './payouts/elements/generate-withdrawal-receipt.js';
|
|
14
|
+
export { StatusBannerElement } from './payouts/elements/status-banner.js';
|
|
15
|
+
export { usePayoutsSessionRef } from './payouts/use-session-ref.js';
|
|
16
|
+
export { Elements, useElements } from './provider.js';
|
|
17
|
+
import '@whop/embedded-components-vanilla-js/types';
|
|
18
|
+
import 'react';
|
|
19
|
+
import './lib/with-fallback.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var index_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(index_exports);
|
|
18
|
+
__reExport(index_exports, require("./payouts"), module.exports);
|
|
19
|
+
__reExport(index_exports, require("./payouts/use-session-ref"), module.exports);
|
|
20
|
+
__reExport(index_exports, require("./provider"), module.exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./payouts\";\nexport * from \"./payouts/use-session-ref\";\nexport * from \"./provider\";\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,sBAAd;AACA,0BAAc,sCADd;AAEA,0BAAc,uBAFd;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./payouts\";\nexport * from \"./payouts/use-session-ref\";\nexport * from \"./provider\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var use_element_snapshot_exports = {};
|
|
21
|
+
__export(use_element_snapshot_exports, {
|
|
22
|
+
useElementSnapshot: () => useElementSnapshot
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(use_element_snapshot_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
function useElementSnapshot(source) {
|
|
27
|
+
const callbacks = (0, import_react.useMemo)(() => {
|
|
28
|
+
return /* @__PURE__ */ new Set();
|
|
29
|
+
}, []);
|
|
30
|
+
const state = (0, import_react.useSyncExternalStore)(
|
|
31
|
+
(listener) => {
|
|
32
|
+
const onSnapshot = () => {
|
|
33
|
+
listener();
|
|
34
|
+
};
|
|
35
|
+
callbacks.add(onSnapshot);
|
|
36
|
+
return () => {
|
|
37
|
+
callbacks.delete(onSnapshot);
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
() => {
|
|
41
|
+
const snap = source?.getSnapshot();
|
|
42
|
+
return snap;
|
|
43
|
+
},
|
|
44
|
+
() => {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
(0, import_react.useEffect)(() => {
|
|
49
|
+
if (!source) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const onSnapshot = () => {
|
|
53
|
+
for (const callback of callbacks) {
|
|
54
|
+
callback();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
source.on("snapshot", onSnapshot);
|
|
58
|
+
return () => {
|
|
59
|
+
source.off("snapshot", onSnapshot);
|
|
60
|
+
};
|
|
61
|
+
}, [source, callbacks]);
|
|
62
|
+
return state;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=use-element-snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/use-element-snapshot.ts"],"sourcesContent":["\"use client\";\n\nimport type { WhopElement } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport { useEffect, useMemo, useSyncExternalStore } from \"react\";\n\nexport function useElementSnapshot<E extends WhopElement<any, any, any>>(\n\tsource: E | undefined | null,\n): ReturnType<E[\"getSnapshot\"]> | null {\n\tconst callbacks = useMemo(() => {\n\t\treturn new Set<() => void>();\n\t}, []);\n\n\tconst state = useSyncExternalStore(\n\t\t(listener) => {\n\t\t\tconst onSnapshot = () => {\n\t\t\t\tlistener();\n\t\t\t};\n\t\t\tcallbacks.add(onSnapshot);\n\t\t\treturn () => {\n\t\t\t\tcallbacks.delete(onSnapshot);\n\t\t\t};\n\t\t},\n\t\t() => {\n\t\t\tconst snap = source?.getSnapshot();\n\t\t\treturn snap;\n\t\t},\n\t\t() => {\n\t\t\treturn null;\n\t\t},\n\t);\n\n\tuseEffect(() => {\n\t\tif (!source) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst onSnapshot = () => {\n\t\t\tfor (const callback of callbacks) {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t};\n\t\tsource.on(\"snapshot\", onSnapshot);\n\t\treturn () => {\n\t\t\tsource.off(\"snapshot\", onSnapshot);\n\t\t};\n\t}, [source, callbacks]);\n\n\treturn state;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAAyD;AAElD,SAAS,mBACf,QACsC;AACtC,QAAM,gBAAY,sBAAQ,MAAM;AAC/B,WAAO,oBAAI,IAAgB;AAAA,EAC5B,GAAG,CAAC,CAAC;AAEL,QAAM,YAAQ;AAAA,IACb,CAAC,aAAa;AACb,YAAM,aAAa,MAAM;AACxB,iBAAS;AAAA,MACV;AACA,gBAAU,IAAI,UAAU;AACxB,aAAO,MAAM;AACZ,kBAAU,OAAO,UAAU;AAAA,MAC5B;AAAA,IACD;AAAA,IACA,MAAM;AACL,YAAM,OAAO,QAAQ,YAAY;AACjC,aAAO;AAAA,IACR;AAAA,IACA,MAAM;AACL,aAAO;AAAA,IACR;AAAA,EACD;AAEA,8BAAU,MAAM;AACf,QAAI,CAAC,QAAQ;AACZ;AAAA,IACD;AAEA,UAAM,aAAa,MAAM;AACxB,iBAAW,YAAY,WAAW;AACjC,iBAAS;AAAA,MACV;AAAA,IACD;AACA,WAAO,GAAG,YAAY,UAAU;AAChC,WAAO,MAAM;AACZ,aAAO,IAAI,YAAY,UAAU;AAAA,IAClC;AAAA,EACD,GAAG,CAAC,QAAQ,SAAS,CAAC;AAEtB,SAAO;AACR;","names":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-NSSMTXJJ.mjs";
|
|
3
|
+
import { useEffect, useMemo, useSyncExternalStore } from "react";
|
|
4
|
+
function useElementSnapshot(source) {
|
|
5
|
+
const callbacks = useMemo(()=>{
|
|
6
|
+
return new Set();
|
|
7
|
+
}, []);
|
|
8
|
+
const state = useSyncExternalStore((listener)=>{
|
|
9
|
+
const onSnapshot = ()=>{
|
|
10
|
+
listener();
|
|
11
|
+
};
|
|
12
|
+
callbacks.add(onSnapshot);
|
|
13
|
+
return ()=>{
|
|
14
|
+
callbacks.delete(onSnapshot);
|
|
15
|
+
};
|
|
16
|
+
}, ()=>{
|
|
17
|
+
const snap = source?.getSnapshot();
|
|
18
|
+
return snap;
|
|
19
|
+
}, ()=>{
|
|
20
|
+
return null;
|
|
21
|
+
});
|
|
22
|
+
useEffect(()=>{
|
|
23
|
+
if (!source) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const onSnapshot = ()=>{
|
|
27
|
+
for (const callback of callbacks){
|
|
28
|
+
callback();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
source.on("snapshot", onSnapshot);
|
|
32
|
+
return ()=>{
|
|
33
|
+
source.off("snapshot", onSnapshot);
|
|
34
|
+
};
|
|
35
|
+
}, [
|
|
36
|
+
source,
|
|
37
|
+
callbacks
|
|
38
|
+
]);
|
|
39
|
+
return state;
|
|
40
|
+
}
|
|
41
|
+
export { useElementSnapshot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/use-element-snapshot.ts"],"sourcesContent":["\"use client\";\n\nimport type { WhopElement } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport { useEffect, useMemo, useSyncExternalStore } from \"react\";\n\nexport function useElementSnapshot<E extends WhopElement<any, any, any>>(\n\tsource: E | undefined | null,\n): ReturnType<E[\"getSnapshot\"]> | null {\n\tconst callbacks = useMemo(() => {\n\t\treturn new Set<() => void>();\n\t}, []);\n\n\tconst state = useSyncExternalStore(\n\t\t(listener) => {\n\t\t\tconst onSnapshot = () => {\n\t\t\t\tlistener();\n\t\t\t};\n\t\t\tcallbacks.add(onSnapshot);\n\t\t\treturn () => {\n\t\t\t\tcallbacks.delete(onSnapshot);\n\t\t\t};\n\t\t},\n\t\t() => {\n\t\t\tconst snap = source?.getSnapshot();\n\t\t\treturn snap;\n\t\t},\n\t\t() => {\n\t\t\treturn null;\n\t\t},\n\t);\n\n\tuseEffect(() => {\n\t\tif (!source) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst onSnapshot = () => {\n\t\t\tfor (const callback of callbacks) {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t};\n\t\tsource.on(\"snapshot\", onSnapshot);\n\t\treturn () => {\n\t\t\tsource.off(\"snapshot\", onSnapshot);\n\t\t};\n\t}, [source, callbacks]);\n\n\treturn state;\n}\n"],"mappings":";;AAIA,SAAS,WAAW,SAAS,4BAA4B;AAElD,SAAS,mBACf,QACsC;AACtC,QAAM,YAAY,QAAQ,MAAM;AAC/B,WAAO,oBAAI,IAAgB;AAAA,EAC5B,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ;AAAA,IACb,CAAC,aAAa;AACb,YAAM,aAAa,MAAM;AACxB,iBAAS;AAAA,MACV;AACA,gBAAU,IAAI,UAAU;AACxB,aAAO,MAAM;AACZ,kBAAU,OAAO,UAAU;AAAA,MAC5B;AAAA,IACD;AAAA,IACA,MAAM;AACL,YAAM,OAAO,QAAQ,YAAY;AACjC,aAAO;AAAA,IACR;AAAA,IACA,MAAM;AACL,aAAO;AAAA,IACR;AAAA,EACD;AAEA,YAAU,MAAM;AACf,QAAI,CAAC,QAAQ;AACZ;AAAA,IACD;AAEA,UAAM,aAAa,MAAM;AACxB,iBAAW,YAAY,WAAW;AACjC,iBAAS;AAAA,MACV;AAAA,IACD;AACA,WAAO,GAAG,YAAY,UAAU;AAChC,WAAO,MAAM;AACZ,aAAO,IAAI,YAAY,UAAU;AAAA,IAClC;AAAA,EACD,GAAG,CAAC,QAAQ,SAAS,CAAC;AAEtB,SAAO;AACR;","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { PayoutsSessionElements } from '@whop/embedded-components-vanilla-js/types';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Valid element type strings that can be passed to createElement.
|
|
6
|
+
*/
|
|
7
|
+
type ElementType = keyof PayoutsSessionElements;
|
|
8
|
+
/**
|
|
9
|
+
* Extract the options type for a given element type using indexed access.
|
|
10
|
+
* PayoutsSessionElements maps element types to [Options, Element] tuples.
|
|
11
|
+
*/
|
|
12
|
+
type ElementOptionsFor<T extends ElementType> = PayoutsSessionElements[T][0];
|
|
13
|
+
/**
|
|
14
|
+
* Component definition with a constrained element type.
|
|
15
|
+
* The type must be a valid element type from the SDK.
|
|
16
|
+
*/
|
|
17
|
+
interface ElementComponentDefinition<T extends ElementType = ElementType> {
|
|
18
|
+
displayName: string;
|
|
19
|
+
type: T;
|
|
20
|
+
}
|
|
21
|
+
interface WithFallbackPropsBase {
|
|
22
|
+
className?: string;
|
|
23
|
+
style?: React__default.CSSProperties;
|
|
24
|
+
onReady?: () => void;
|
|
25
|
+
fallback?: React__default.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
interface WithFallbackPropsRequired<TOptions> extends WithFallbackPropsBase {
|
|
28
|
+
options: TOptions;
|
|
29
|
+
}
|
|
30
|
+
interface WithFallbackPropsOptional<TOptions> extends WithFallbackPropsBase {
|
|
31
|
+
options?: TOptions;
|
|
32
|
+
}
|
|
33
|
+
type WithFallbackComponent<TOptions, TRequired extends boolean> = {
|
|
34
|
+
(props: TRequired extends true ? WithFallbackPropsRequired<TOptions> : WithFallbackPropsOptional<TOptions>): React__default.ReactNode;
|
|
35
|
+
displayName: string;
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Creates a React component that wraps an embedded element with fallback support.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Type-safe: options type is inferred from the element type
|
|
44
|
+
* export const BalanceElement = withFallback({
|
|
45
|
+
* displayName: "BalanceElement",
|
|
46
|
+
* type: "balance-element",
|
|
47
|
+
* } as const);
|
|
48
|
+
*
|
|
49
|
+
* // Usage - TypeScript knows the correct options type
|
|
50
|
+
* <BalanceElement options={{ hidePendingBalance: true }} />
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare function withFallback<const T extends ElementType, TRequired extends boolean = false>(Component: ElementComponentDefinition<T>): WithFallbackComponent<ElementOptionsFor<T>, TRequired>;
|
|
54
|
+
|
|
55
|
+
export { type WithFallbackPropsOptional, type WithFallbackPropsRequired, withFallback };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var with_fallback_exports = {};
|
|
31
|
+
__export(with_fallback_exports, {
|
|
32
|
+
withFallback: () => withFallback
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(with_fallback_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_session = require("../payouts/session");
|
|
37
|
+
var import_use_element_snapshot = require("./use-element-snapshot");
|
|
38
|
+
function withFallback(Component) {
|
|
39
|
+
function WrappedElement({
|
|
40
|
+
options,
|
|
41
|
+
className,
|
|
42
|
+
style,
|
|
43
|
+
onReady,
|
|
44
|
+
fallback
|
|
45
|
+
}) {
|
|
46
|
+
const payoutsSession = (0, import_session.usePayoutsSession)();
|
|
47
|
+
const ref = (0, import_react.useRef)(null);
|
|
48
|
+
const element = (0, import_react.useMemo)(() => {
|
|
49
|
+
if (!payoutsSession) return null;
|
|
50
|
+
return payoutsSession.createElement(Component, options ?? {});
|
|
51
|
+
}, [payoutsSession]);
|
|
52
|
+
const elementSnapshot = (0, import_use_element_snapshot.useElementSnapshot)(element);
|
|
53
|
+
const isReady = elementSnapshot?.state === "ready";
|
|
54
|
+
(0, import_react.useEffect)(() => {
|
|
55
|
+
if (!element) return;
|
|
56
|
+
element.updateOptions(options ?? {});
|
|
57
|
+
}, [options, element]);
|
|
58
|
+
(0, import_react.useEffect)(() => {
|
|
59
|
+
if (!element || !onReady) return;
|
|
60
|
+
element.on("ready", onReady);
|
|
61
|
+
return () => {
|
|
62
|
+
element.off("ready", onReady);
|
|
63
|
+
};
|
|
64
|
+
}, [element, onReady]);
|
|
65
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
66
|
+
if (!element || !ref.current) return;
|
|
67
|
+
element.mount(ref.current);
|
|
68
|
+
return () => {
|
|
69
|
+
element.unmount();
|
|
70
|
+
};
|
|
71
|
+
}, [element, ref.current]);
|
|
72
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
style: { ...style, visibility: isReady ? void 0 : "hidden" },
|
|
76
|
+
className,
|
|
77
|
+
ref
|
|
78
|
+
}
|
|
79
|
+
), !isReady && (fallback ?? null));
|
|
80
|
+
}
|
|
81
|
+
WrappedElement.displayName = Component.displayName;
|
|
82
|
+
WrappedElement.type = Component.type;
|
|
83
|
+
return WrappedElement;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=with-fallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/with-fallback.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n\tPayoutsSessionElements,\n\tWhopElement,\n} from \"@whop/embedded-components-vanilla-js/types\";\nimport React, { useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { usePayoutsSession } from \"../payouts/session\";\nimport { useElementSnapshot } from \"./use-element-snapshot\";\n\n/**\n * Valid element type strings that can be passed to createElement.\n */\ntype ElementType = keyof PayoutsSessionElements;\n\n/**\n * Extract the options type for a given element type using indexed access.\n * PayoutsSessionElements maps element types to [Options, Element] tuples.\n */\ntype ElementOptionsFor<T extends ElementType> = PayoutsSessionElements[T][0];\n\n/**\n * Base element type that all created elements conform to.\n * Using WhopElement<any, any, any> gives us access to common methods\n * (mount, unmount, on, off, updateOptions) without union type issues.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype BaseElement = WhopElement<any, any, any>;\n\n/**\n * Component definition with a constrained element type.\n * The type must be a valid element type from the SDK.\n */\ninterface ElementComponentDefinition<T extends ElementType = ElementType> {\n\tdisplayName: string;\n\ttype: T;\n}\n\ninterface WithFallbackPropsBase {\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\tonReady?: () => void;\n\tfallback?: React.ReactNode;\n}\n\nexport interface WithFallbackPropsRequired<TOptions>\n\textends WithFallbackPropsBase {\n\toptions: TOptions;\n}\n\nexport interface WithFallbackPropsOptional<TOptions>\n\textends WithFallbackPropsBase {\n\toptions?: TOptions;\n}\n\ntype WithFallbackComponent<TOptions, TRequired extends boolean> = {\n\t(\n\t\tprops: TRequired extends true\n\t\t\t? WithFallbackPropsRequired<TOptions>\n\t\t\t: WithFallbackPropsOptional<TOptions>,\n\t): React.ReactNode;\n\tdisplayName: string;\n\ttype: string;\n};\n\n/**\n * Creates a React component that wraps an embedded element with fallback support.\n *\n * @example\n * ```tsx\n * // Type-safe: options type is inferred from the element type\n * export const BalanceElement = withFallback({\n * displayName: \"BalanceElement\",\n * type: \"balance-element\",\n * } as const);\n *\n * // Usage - TypeScript knows the correct options type\n * <BalanceElement options={{ hidePendingBalance: true }} />\n * ```\n */\nexport function withFallback<\n\tconst T extends ElementType,\n\tTRequired extends boolean = false,\n>(\n\tComponent: ElementComponentDefinition<T>,\n): WithFallbackComponent<ElementOptionsFor<T>, TRequired> {\n\ttype TOptions = ElementOptionsFor<T>;\n\n\tfunction WrappedElement({\n\t\toptions,\n\t\tclassName,\n\t\tstyle,\n\t\tonReady,\n\t\tfallback,\n\t}: WithFallbackPropsOptional<TOptions>) {\n\t\tconst payoutsSession = usePayoutsSession();\n\t\tconst ref = useRef<HTMLDivElement>(null);\n\n\t\tconst element = useMemo((): BaseElement | null => {\n\t\t\tif (!payoutsSession) return null;\n\t\t\t// Safe: T is constrained to valid element types, and options matches T\n\t\t\treturn payoutsSession.createElement(Component, options ?? {});\n\t\t}, [payoutsSession]);\n\n\t\tconst elementSnapshot = useElementSnapshot(element);\n\n\t\tconst isReady = elementSnapshot?.state === \"ready\";\n\n\t\tuseEffect(() => {\n\t\t\tif (!element) return;\n\t\t\telement.updateOptions(options ?? {});\n\t\t}, [options, element]);\n\n\t\tuseEffect(() => {\n\t\t\tif (!element || !onReady) return;\n\t\t\telement.on(\"ready\", onReady);\n\t\t\treturn () => {\n\t\t\t\telement.off(\"ready\", onReady);\n\t\t\t};\n\t\t}, [element, onReady]);\n\n\t\tuseLayoutEffect(() => {\n\t\t\tif (!element || !ref.current) return;\n\t\t\telement.mount(ref.current);\n\t\t\treturn () => {\n\t\t\t\telement.unmount();\n\t\t\t};\n\t\t}, [element, ref.current]);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{ ...style, visibility: isReady ? undefined : \"hidden\" }}\n\t\t\t\t\tclassName={className}\n\t\t\t\t\tref={ref}\n\t\t\t\t/>\n\t\t\t\t{!isReady && (fallback ?? null)}\n\t\t\t</>\n\t\t);\n\t}\n\n\tWrappedElement.displayName = Component.displayName;\n\tWrappedElement.type = Component.type;\n\n\treturn WrappedElement as WithFallbackComponent<TOptions, TRequired>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,mBAAmE;AACnE,qBAAkC;AAClC,kCAAmC;AAwE5B,SAAS,aAIf,WACyD;AAGzD,WAAS,eAAe;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,GAAwC;AACvC,UAAM,qBAAiB,kCAAkB;AACzC,UAAM,UAAM,qBAAuB,IAAI;AAEvC,UAAM,cAAU,sBAAQ,MAA0B;AACjD,UAAI,CAAC,eAAgB,QAAO;AAE5B,aAAO,eAAe,cAAc,WAAW,WAAW,CAAC,CAAC;AAAA,IAC7D,GAAG,CAAC,cAAc,CAAC;AAEnB,UAAM,sBAAkB,gDAAmB,OAAO;AAElD,UAAM,UAAU,iBAAiB,UAAU;AAE3C,gCAAU,MAAM;AACf,UAAI,CAAC,QAAS;AACd,cAAQ,cAAc,WAAW,CAAC,CAAC;AAAA,IACpC,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,gCAAU,MAAM;AACf,UAAI,CAAC,WAAW,CAAC,QAAS;AAC1B,cAAQ,GAAG,SAAS,OAAO;AAC3B,aAAO,MAAM;AACZ,gBAAQ,IAAI,SAAS,OAAO;AAAA,MAC7B;AAAA,IACD,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,sCAAgB,MAAM;AACrB,UAAI,CAAC,WAAW,CAAC,IAAI,QAAS;AAC9B,cAAQ,MAAM,IAAI,OAAO;AACzB,aAAO,MAAM;AACZ,gBAAQ,QAAQ;AAAA,MACjB;AAAA,IACD,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC;AAEzB,WACC,6BAAAA,QAAA,2BAAAA,QAAA,gBACC,6BAAAA,QAAA;AAAA,MAAC;AAAA;AAAA,QACA,OAAO,EAAE,GAAG,OAAO,YAAY,UAAU,SAAY,SAAS;AAAA,QAC9D;AAAA,QACA;AAAA;AAAA,IACD,GACC,CAAC,YAAY,YAAY,KAC3B;AAAA,EAEF;AAEA,iBAAe,cAAc,UAAU;AACvC,iBAAe,OAAO,UAAU;AAEhC,SAAO;AACR;","names":["React"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../chunk-NSSMTXJJ.mjs";
|
|
3
|
+
import React, { useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
4
|
+
import { usePayoutsSession } from "../payouts/session.mjs";
|
|
5
|
+
import { useElementSnapshot } from "./use-element-snapshot.mjs";
|
|
6
|
+
function withFallback(Component) {
|
|
7
|
+
function WrappedElement({ options, className, style, onReady, fallback }) {
|
|
8
|
+
const payoutsSession = usePayoutsSession();
|
|
9
|
+
const ref = useRef(null);
|
|
10
|
+
const element = useMemo(()=>{
|
|
11
|
+
if (!payoutsSession) return null;
|
|
12
|
+
return payoutsSession.createElement(Component, options ?? {});
|
|
13
|
+
}, [
|
|
14
|
+
payoutsSession
|
|
15
|
+
]);
|
|
16
|
+
const elementSnapshot = useElementSnapshot(element);
|
|
17
|
+
const isReady = elementSnapshot?.state === "ready";
|
|
18
|
+
useEffect(()=>{
|
|
19
|
+
if (!element) return;
|
|
20
|
+
element.updateOptions(options ?? {});
|
|
21
|
+
}, [
|
|
22
|
+
options,
|
|
23
|
+
element
|
|
24
|
+
]);
|
|
25
|
+
useEffect(()=>{
|
|
26
|
+
if (!element || !onReady) return;
|
|
27
|
+
element.on("ready", onReady);
|
|
28
|
+
return ()=>{
|
|
29
|
+
element.off("ready", onReady);
|
|
30
|
+
};
|
|
31
|
+
}, [
|
|
32
|
+
element,
|
|
33
|
+
onReady
|
|
34
|
+
]);
|
|
35
|
+
useLayoutEffect(()=>{
|
|
36
|
+
if (!element || !ref.current) return;
|
|
37
|
+
element.mount(ref.current);
|
|
38
|
+
return ()=>{
|
|
39
|
+
element.unmount();
|
|
40
|
+
};
|
|
41
|
+
}, [
|
|
42
|
+
element,
|
|
43
|
+
ref.current
|
|
44
|
+
]);
|
|
45
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
46
|
+
style: {
|
|
47
|
+
...style,
|
|
48
|
+
visibility: isReady ? void 0 : "hidden"
|
|
49
|
+
},
|
|
50
|
+
className,
|
|
51
|
+
ref
|
|
52
|
+
}), !isReady && (fallback ?? null));
|
|
53
|
+
}
|
|
54
|
+
WrappedElement.displayName = Component.displayName;
|
|
55
|
+
WrappedElement.type = Component.type;
|
|
56
|
+
return WrappedElement;
|
|
57
|
+
}
|
|
58
|
+
export { withFallback };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/with-fallback.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n\tPayoutsSessionElements,\n\tWhopElement,\n} from \"@whop/embedded-components-vanilla-js/types\";\nimport React, { useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { usePayoutsSession } from \"../payouts/session\";\nimport { useElementSnapshot } from \"./use-element-snapshot\";\n\n/**\n * Valid element type strings that can be passed to createElement.\n */\ntype ElementType = keyof PayoutsSessionElements;\n\n/**\n * Extract the options type for a given element type using indexed access.\n * PayoutsSessionElements maps element types to [Options, Element] tuples.\n */\ntype ElementOptionsFor<T extends ElementType> = PayoutsSessionElements[T][0];\n\n/**\n * Base element type that all created elements conform to.\n * Using WhopElement<any, any, any> gives us access to common methods\n * (mount, unmount, on, off, updateOptions) without union type issues.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype BaseElement = WhopElement<any, any, any>;\n\n/**\n * Component definition with a constrained element type.\n * The type must be a valid element type from the SDK.\n */\ninterface ElementComponentDefinition<T extends ElementType = ElementType> {\n\tdisplayName: string;\n\ttype: T;\n}\n\ninterface WithFallbackPropsBase {\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\tonReady?: () => void;\n\tfallback?: React.ReactNode;\n}\n\nexport interface WithFallbackPropsRequired<TOptions>\n\textends WithFallbackPropsBase {\n\toptions: TOptions;\n}\n\nexport interface WithFallbackPropsOptional<TOptions>\n\textends WithFallbackPropsBase {\n\toptions?: TOptions;\n}\n\ntype WithFallbackComponent<TOptions, TRequired extends boolean> = {\n\t(\n\t\tprops: TRequired extends true\n\t\t\t? WithFallbackPropsRequired<TOptions>\n\t\t\t: WithFallbackPropsOptional<TOptions>,\n\t): React.ReactNode;\n\tdisplayName: string;\n\ttype: string;\n};\n\n/**\n * Creates a React component that wraps an embedded element with fallback support.\n *\n * @example\n * ```tsx\n * // Type-safe: options type is inferred from the element type\n * export const BalanceElement = withFallback({\n * displayName: \"BalanceElement\",\n * type: \"balance-element\",\n * } as const);\n *\n * // Usage - TypeScript knows the correct options type\n * <BalanceElement options={{ hidePendingBalance: true }} />\n * ```\n */\nexport function withFallback<\n\tconst T extends ElementType,\n\tTRequired extends boolean = false,\n>(\n\tComponent: ElementComponentDefinition<T>,\n): WithFallbackComponent<ElementOptionsFor<T>, TRequired> {\n\ttype TOptions = ElementOptionsFor<T>;\n\n\tfunction WrappedElement({\n\t\toptions,\n\t\tclassName,\n\t\tstyle,\n\t\tonReady,\n\t\tfallback,\n\t}: WithFallbackPropsOptional<TOptions>) {\n\t\tconst payoutsSession = usePayoutsSession();\n\t\tconst ref = useRef<HTMLDivElement>(null);\n\n\t\tconst element = useMemo((): BaseElement | null => {\n\t\t\tif (!payoutsSession) return null;\n\t\t\t// Safe: T is constrained to valid element types, and options matches T\n\t\t\treturn payoutsSession.createElement(Component, options ?? {});\n\t\t}, [payoutsSession]);\n\n\t\tconst elementSnapshot = useElementSnapshot(element);\n\n\t\tconst isReady = elementSnapshot?.state === \"ready\";\n\n\t\tuseEffect(() => {\n\t\t\tif (!element) return;\n\t\t\telement.updateOptions(options ?? {});\n\t\t}, [options, element]);\n\n\t\tuseEffect(() => {\n\t\t\tif (!element || !onReady) return;\n\t\t\telement.on(\"ready\", onReady);\n\t\t\treturn () => {\n\t\t\t\telement.off(\"ready\", onReady);\n\t\t\t};\n\t\t}, [element, onReady]);\n\n\t\tuseLayoutEffect(() => {\n\t\t\tif (!element || !ref.current) return;\n\t\t\telement.mount(ref.current);\n\t\t\treturn () => {\n\t\t\t\telement.unmount();\n\t\t\t};\n\t\t}, [element, ref.current]);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{ ...style, visibility: isReady ? undefined : \"hidden\" }}\n\t\t\t\t\tclassName={className}\n\t\t\t\t\tref={ref}\n\t\t\t\t/>\n\t\t\t\t{!isReady && (fallback ?? null)}\n\t\t\t</>\n\t\t);\n\t}\n\n\tWrappedElement.displayName = Component.displayName;\n\tWrappedElement.type = Component.type;\n\n\treturn WrappedElement as WithFallbackComponent<TOptions, TRequired>;\n}\n"],"mappings":";;AAMA,OAAO,SAAS,WAAW,iBAAiB,SAAS,cAAc;AACnE,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AAwE5B,SAAS,aAIf,WACyD;AAGzD,WAAS,eAAe;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,GAAwC;AACvC,UAAM,iBAAiB,kBAAkB;AACzC,UAAM,MAAM,OAAuB,IAAI;AAEvC,UAAM,UAAU,QAAQ,MAA0B;AACjD,UAAI,CAAC,eAAgB,QAAO;AAE5B,aAAO,eAAe,cAAc,WAAW,WAAW,CAAC,CAAC;AAAA,IAC7D,GAAG,CAAC,cAAc,CAAC;AAEnB,UAAM,kBAAkB,mBAAmB,OAAO;AAElD,UAAM,UAAU,iBAAiB,UAAU;AAE3C,cAAU,MAAM;AACf,UAAI,CAAC,QAAS;AACd,cAAQ,cAAc,WAAW,CAAC,CAAC;AAAA,IACpC,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,cAAU,MAAM;AACf,UAAI,CAAC,WAAW,CAAC,QAAS;AAC1B,cAAQ,GAAG,SAAS,OAAO;AAC3B,aAAO,MAAM;AACZ,gBAAQ,IAAI,SAAS,OAAO;AAAA,MAC7B;AAAA,IACD,GAAG,CAAC,SAAS,OAAO,CAAC;AAErB,oBAAgB,MAAM;AACrB,UAAI,CAAC,WAAW,CAAC,IAAI,QAAS;AAC9B,cAAQ,MAAM,IAAI,OAAO;AACzB,aAAO,MAAM;AACZ,gBAAQ,QAAQ;AAAA,MACjB;AAAA,IACD,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC;AAEzB,WACC,0DACC;AAAA,MAAC;AAAA;AAAA,QACA,OAAO,EAAE,GAAG,OAAO,YAAY,UAAU,SAAY,SAAS;AAAA,QAC9D;AAAA,QACA;AAAA;AAAA,IACD,GACC,CAAC,YAAY,YAAY,KAC3B;AAAA,EAEF;AAEA,iBAAe,cAAc,UAAU;AACvC,iBAAe,OAAO,UAAU;AAEhC,SAAO;AACR;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WithFallbackPropsOptional } from '../../lib/with-fallback.js';
|
|
2
|
+
import * as _whop_embedded_components_vanilla_js_types from '@whop/embedded-components-vanilla-js/types';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
declare const BalanceElement: {
|
|
6
|
+
(props: WithFallbackPropsOptional<_whop_embedded_components_vanilla_js_types.BalanceElementOptions>): React.ReactNode;
|
|
7
|
+
displayName: string;
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { BalanceElement };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var balance_exports = {};
|
|
21
|
+
__export(balance_exports, {
|
|
22
|
+
BalanceElement: () => BalanceElement
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(balance_exports);
|
|
25
|
+
var import_with_fallback = require("../../lib/with-fallback");
|
|
26
|
+
const BalanceElement = (0, import_with_fallback.withFallback)({
|
|
27
|
+
displayName: "BalanceElement",
|
|
28
|
+
type: "balance-element"
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=balance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/payouts/elements/balance.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\n// Options type is automatically inferred from \"balance-element\"\nexport const BalanceElement = withFallback({\n\tdisplayName: \"BalanceElement\",\n\ttype: \"balance-element\",\n} as const);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAA6B;AAGtB,MAAM,qBAAiB,mCAAa;AAAA,EAC1C,aAAa;AAAA,EACb,MAAM;AACP,CAAU;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/payouts/elements/balance.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\n// Options type is automatically inferred from \"balance-element\"\nexport const BalanceElement = withFallback({\n\tdisplayName: \"BalanceElement\",\n\ttype: \"balance-element\",\n} as const);\n"],"mappings":";;AAEA,SAAS,oBAAoB;AAGtB,MAAM,iBAAiB,aAAa;AAAA,EAC1C,aAAa;AAAA,EACb,MAAM;AACP,CAAU;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WithFallbackPropsOptional } from '../../lib/with-fallback.js';
|
|
2
|
+
import * as _whop_embedded_components_vanilla_js_types from '@whop/embedded-components-vanilla-js/types';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
declare const BnplReserveBalanceBreakdownElement: {
|
|
6
|
+
(props: WithFallbackPropsOptional<_whop_embedded_components_vanilla_js_types.BnplReserveBalanceBreakdownElementOptions>): React.ReactNode;
|
|
7
|
+
displayName: string;
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { BnplReserveBalanceBreakdownElement };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var bnpl_reserve_balance_breakdown_exports = {};
|
|
21
|
+
__export(bnpl_reserve_balance_breakdown_exports, {
|
|
22
|
+
BnplReserveBalanceBreakdownElement: () => BnplReserveBalanceBreakdownElement
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(bnpl_reserve_balance_breakdown_exports);
|
|
25
|
+
var import_with_fallback = require("../../lib/with-fallback");
|
|
26
|
+
const BnplReserveBalanceBreakdownElement = (0, import_with_fallback.withFallback)({
|
|
27
|
+
displayName: "BnplReserveBalanceBreakdownElement",
|
|
28
|
+
type: "bnpl-reserve-balance-breakdown-element"
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=bnpl-reserve-balance-breakdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/payouts/elements/bnpl-reserve-balance-breakdown.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\nexport const BnplReserveBalanceBreakdownElement = withFallback({\n\tdisplayName: \"BnplReserveBalanceBreakdownElement\",\n\ttype: \"bnpl-reserve-balance-breakdown-element\",\n} as const);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAA6B;AAEtB,MAAM,yCAAqC,mCAAa;AAAA,EAC9D,aAAa;AAAA,EACb,MAAM;AACP,CAAU;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../chunk-NSSMTXJJ.mjs";
|
|
3
|
+
import { withFallback } from "../../lib/with-fallback.mjs";
|
|
4
|
+
const BnplReserveBalanceBreakdownElement = withFallback({
|
|
5
|
+
displayName: "BnplReserveBalanceBreakdownElement",
|
|
6
|
+
type: "bnpl-reserve-balance-breakdown-element"
|
|
7
|
+
});
|
|
8
|
+
export { BnplReserveBalanceBreakdownElement };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/payouts/elements/bnpl-reserve-balance-breakdown.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\nexport const BnplReserveBalanceBreakdownElement = withFallback({\n\tdisplayName: \"BnplReserveBalanceBreakdownElement\",\n\ttype: \"bnpl-reserve-balance-breakdown-element\",\n} as const);\n"],"mappings":";;AAEA,SAAS,oBAAoB;AAEtB,MAAM,qCAAqC,aAAa;AAAA,EAC9D,aAAa;AAAA,EACb,MAAM;AACP,CAAU;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WithFallbackPropsOptional } from '../../lib/with-fallback.js';
|
|
2
|
+
import * as _whop_embedded_components_vanilla_js_types from '@whop/embedded-components-vanilla-js/types';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
declare const ChangeAccountCountryElement: {
|
|
6
|
+
(props: WithFallbackPropsOptional<_whop_embedded_components_vanilla_js_types.ChangeAccountCountryElementOptions>): React.ReactNode;
|
|
7
|
+
displayName: string;
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { ChangeAccountCountryElement };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var change_account_country_exports = {};
|
|
21
|
+
__export(change_account_country_exports, {
|
|
22
|
+
ChangeAccountCountryElement: () => ChangeAccountCountryElement
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(change_account_country_exports);
|
|
25
|
+
var import_with_fallback = require("../../lib/with-fallback");
|
|
26
|
+
const ChangeAccountCountryElement = (0, import_with_fallback.withFallback)({
|
|
27
|
+
displayName: "ChangeAccountCountryElement",
|
|
28
|
+
type: "change-account-country-element"
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=change-account-country.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/payouts/elements/change-account-country.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\nexport const ChangeAccountCountryElement = withFallback({\n\tdisplayName: \"ChangeAccountCountryElement\",\n\ttype: \"change-account-country-element\",\n} as const);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,2BAA6B;AAEtB,MAAM,kCAA8B,mCAAa;AAAA,EACvD,aAAa;AAAA,EACb,MAAM;AACP,CAAU;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../chunk-NSSMTXJJ.mjs";
|
|
3
|
+
import { withFallback } from "../../lib/with-fallback.mjs";
|
|
4
|
+
const ChangeAccountCountryElement = withFallback({
|
|
5
|
+
displayName: "ChangeAccountCountryElement",
|
|
6
|
+
type: "change-account-country-element"
|
|
7
|
+
});
|
|
8
|
+
export { ChangeAccountCountryElement };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/payouts/elements/change-account-country.tsx"],"sourcesContent":["\"use client\";\n\nimport { withFallback } from \"../../lib/with-fallback\";\n\nexport const ChangeAccountCountryElement = withFallback({\n\tdisplayName: \"ChangeAccountCountryElement\",\n\ttype: \"change-account-country-element\",\n} as const);\n"],"mappings":";;AAEA,SAAS,oBAAoB;AAEtB,MAAM,8BAA8B,aAAa;AAAA,EACvD,aAAa;AAAA,EACb,MAAM;AACP,CAAU;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WithFallbackPropsRequired } from '../../lib/with-fallback.js';
|
|
2
|
+
import * as _whop_embedded_components_vanilla_js_types from '@whop/embedded-components-vanilla-js/types';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
declare const GenerateWithdrawalReceiptElement: {
|
|
6
|
+
(props: WithFallbackPropsRequired<_whop_embedded_components_vanilla_js_types.GenerateWithdrawalReceiptElementOptions>): React.ReactNode;
|
|
7
|
+
displayName: string;
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { GenerateWithdrawalReceiptElement };
|