@whop/embedded-components-react-js 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/chat/elements/chat.d.ts +1 -1
- package/dist/chat/elements/dms-list.d.ts +1 -1
- package/dist/chat/elements/index.d.ts +2 -2
- package/dist/chat/elements/search-element.d.ts +1 -1
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/with-fallback.d.ts +6 -47
- package/dist/chat/with-fallback.js +2 -59
- package/dist/chat/with-fallback.js.map +1 -1
- package/dist/chat/with-fallback.mjs +2 -54
- package/dist/chat/with-fallback.mjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/lib/create-with-fallback.d.ts +51 -0
- package/dist/lib/create-with-fallback.js +89 -0
- package/dist/lib/create-with-fallback.js.map +1 -0
- package/dist/lib/create-with-fallback.mjs +59 -0
- package/dist/lib/create-with-fallback.mjs.map +1 -0
- package/dist/payouts/elements/add-payout-method.d.ts +1 -1
- package/dist/payouts/elements/automatic-withdraw.d.ts +1 -1
- package/dist/payouts/elements/available-cash-breakdown.d.ts +1 -1
- package/dist/payouts/elements/balance.d.ts +1 -1
- package/dist/payouts/elements/balances.d.ts +1 -1
- package/dist/payouts/elements/change-account-country.d.ts +1 -1
- package/dist/payouts/elements/generate-withdrawal-receipt.d.ts +1 -1
- package/dist/payouts/elements/index.d.ts +2 -2
- package/dist/payouts/elements/pending-breakdown.d.ts +1 -1
- package/dist/payouts/elements/reserve-breakdown.d.ts +1 -1
- package/dist/payouts/elements/reset-account.d.ts +1 -1
- package/dist/payouts/elements/treasury-breakdown.d.ts +1 -1
- package/dist/payouts/elements/verify.d.ts +1 -1
- package/dist/payouts/elements/withdraw-button.d.ts +1 -1
- package/dist/payouts/elements/withdraw.d.ts +1 -1
- package/dist/payouts/elements/withdrawal-breakdown.d.ts +1 -1
- package/dist/payouts/elements/withdrawals.d.ts +1 -1
- package/dist/payouts/index.d.ts +1 -1
- package/dist/payouts/with-fallback.d.ts +6 -47
- package/dist/payouts/with-fallback.js +2 -59
- package/dist/payouts/with-fallback.js.map +1 -1
- package/dist/payouts/with-fallback.mjs +2 -54
- package/dist/payouts/with-fallback.mjs.map +1 -1
- package/dist/wallet/elements/deposit.d.ts +11 -0
- package/dist/wallet/elements/deposit.js +30 -0
- package/dist/wallet/elements/deposit.js.map +1 -0
- package/dist/wallet/elements/deposit.mjs +8 -0
- package/dist/wallet/elements/deposit.mjs.map +1 -0
- package/dist/wallet/elements/index.d.ts +4 -0
- package/dist/wallet/elements/index.js +25 -0
- package/dist/wallet/elements/index.js.map +1 -0
- package/dist/wallet/elements/index.mjs +3 -0
- package/dist/wallet/elements/index.mjs.map +1 -0
- package/dist/wallet/index.d.ts +5 -0
- package/dist/wallet/index.js +20 -0
- package/dist/wallet/index.js.map +1 -0
- package/dist/wallet/index.mjs +2 -0
- package/dist/wallet/index.mjs.map +1 -0
- package/dist/wallet/session.d.ts +11 -0
- package/dist/wallet/session.js +73 -0
- package/dist/wallet/session.js.map +1 -0
- package/dist/wallet/session.mjs +52 -0
- package/dist/wallet/session.mjs.map +1 -0
- package/dist/wallet/use-session-ref.d.ts +8 -0
- package/dist/wallet/use-session-ref.js +29 -0
- package/dist/wallet/use-session-ref.js.map +1 -0
- package/dist/wallet/use-session-ref.mjs +7 -0
- package/dist/wallet/use-session-ref.mjs.map +1 -0
- package/dist/wallet/with-fallback.d.ts +14 -0
- package/dist/wallet/with-fallback.js +28 -0
- package/dist/wallet/with-fallback.js.map +1 -0
- package/dist/wallet/with-fallback.mjs +6 -0
- package/dist/wallet/with-fallback.mjs.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,29 @@
|
|
|
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 __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var use_session_ref_exports = {};
|
|
20
|
+
__export(use_session_ref_exports, {
|
|
21
|
+
useWalletSessionRef: () => useWalletSessionRef
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(use_session_ref_exports);
|
|
24
|
+
var import_react = require("react");
|
|
25
|
+
function useWalletSessionRef() {
|
|
26
|
+
const ref = (0, import_react.useRef)(null);
|
|
27
|
+
return ref;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=use-session-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/wallet/use-session-ref.ts"],"sourcesContent":["import type { WalletSession as WalletSessionType } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport { useRef } from \"react\";\n\nexport function useWalletSessionRef() {\n\tconst ref = useRef<{\n\t\twalletSession: WalletSessionType | null;\n\t}>(null);\n\treturn ref;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAuB;AAEhB,SAAS,sBAAsB;AACrC,QAAM,UAAM,qBAET,IAAI;AACP,SAAO;AACR;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/wallet/use-session-ref.ts"],"sourcesContent":["import type { WalletSession as WalletSessionType } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport { useRef } from \"react\";\n\nexport function useWalletSessionRef() {\n\tconst ref = useRef<{\n\t\twalletSession: WalletSessionType | null;\n\t}>(null);\n\treturn ref;\n}\n"],"mappings":";AAEA,SAAS,cAAc;AAEhB,SAAS,sBAAsB;AACrC,QAAM,MAAM,OAET,IAAI;AACP,SAAO;AACR;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WithFallbackPropsRequired, WithFallbackPropsOptional } from '../lib/create-with-fallback.js';
|
|
2
|
+
import { WalletSessionElements } from '@whop/embedded-components-vanilla-js/types';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
declare const withFallback: <const T extends "deposit-element", TRequired extends boolean = false>(Component: {
|
|
6
|
+
displayName: string;
|
|
7
|
+
type: T;
|
|
8
|
+
}) => {
|
|
9
|
+
(props: TRequired extends true ? WithFallbackPropsRequired<WalletSessionElements[T][0]> : WithFallbackPropsOptional<WalletSessionElements[T][0]>): React.ReactNode;
|
|
10
|
+
displayName: string;
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { WithFallbackPropsOptional, WithFallbackPropsRequired, withFallback };
|
|
@@ -0,0 +1,28 @@
|
|
|
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 with_fallback_exports = {};
|
|
21
|
+
__export(with_fallback_exports, {
|
|
22
|
+
withFallback: () => withFallback
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(with_fallback_exports);
|
|
25
|
+
var import_create_with_fallback = require("../lib/create-with-fallback");
|
|
26
|
+
var import_session = require("./session");
|
|
27
|
+
const withFallback = (0, import_create_with_fallback.createWithFallback)(import_session.useWalletSession);
|
|
28
|
+
//# sourceMappingURL=with-fallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/wallet/with-fallback.tsx"],"sourcesContent":["\"use client\";\n\nimport type { WalletSessionElements } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport { createWithFallback } from \"../lib/create-with-fallback\";\nimport { useWalletSession } from \"./session\";\n\nexport type {\n\tWithFallbackPropsOptional,\n\tWithFallbackPropsRequired,\n} from \"../lib/create-with-fallback\";\n\nexport const withFallback =\n\tcreateWithFallback<WalletSessionElements>(useWalletSession);\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kCAAmC;AACnC,qBAAiC;AAO1B,MAAM,mBACZ,gDAA0C,+BAAgB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/wallet/with-fallback.tsx"],"sourcesContent":["\"use client\";\n\nimport type { WalletSessionElements } from \"@whop/embedded-components-vanilla-js/types\";\n\nimport { createWithFallback } from \"../lib/create-with-fallback\";\nimport { useWalletSession } from \"./session\";\n\nexport type {\n\tWithFallbackPropsOptional,\n\tWithFallbackPropsRequired,\n} from \"../lib/create-with-fallback\";\n\nexport const withFallback =\n\tcreateWithFallback<WalletSessionElements>(useWalletSession);\n"],"mappings":";;AAIA,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AAO1B,MAAM,eACZ,mBAA0C,gBAAgB;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whop/embedded-components-react-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "React components for Whop.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"React",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=16.8.0 <20.0.0",
|
|
24
24
|
"react-dom": ">=16.8.0 <20.0.0",
|
|
25
|
-
"@whop/embedded-components-vanilla-js": "^1.
|
|
25
|
+
"@whop/embedded-components-vanilla-js": "^1.2.0"
|
|
26
26
|
},
|
|
27
27
|
"typing": "dist/index.d.ts"
|
|
28
28
|
}
|