@monei-js/components 2.0.0 → 2.1.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/README.md +41 -13
- package/dist/index.cjs +21 -1
- package/dist/index.d.cts +45 -27
- package/dist/index.d.ts +45 -27
- package/dist/index.js +21 -1
- package/dist/monei.umd.production.min.js +2 -2
- package/dist/monei.umd.production.min.js.map +1 -1
- package/package.json +4 -3
- package/src/bridge/types.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monei-js/components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"author": "MONEI <support@monei.com> (https://monei.com)",
|
|
5
5
|
"description": "MONEI UI Components enable you to collect sensitive payment information using customizable UI components.",
|
|
6
6
|
"homepage": "https://monei.com",
|
|
@@ -51,12 +51,13 @@
|
|
|
51
51
|
"registry": "https://registry.npmjs.org/"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
|
-
"start": "
|
|
54
|
+
"start": "pnpm --workspace-root run sandbox:components",
|
|
55
|
+
"start:ui": "portless components vp dev",
|
|
55
56
|
"dev": "vp pack --watch",
|
|
56
57
|
"dev:prod": "STAGE=prod vp pack --watch",
|
|
57
58
|
"build": "vp pack",
|
|
58
59
|
"build:prod": "STAGE=prod vp pack",
|
|
59
|
-
"prepack": "vp pack",
|
|
60
|
+
"prepack": "STAGE=prod vp pack",
|
|
60
61
|
"test": "vp test --passWithNoTests",
|
|
61
62
|
"release": "release-it"
|
|
62
63
|
},
|
package/src/bridge/types.ts
CHANGED
|
@@ -79,6 +79,9 @@ export type BridgeComponentOptions<P> = {
|
|
|
79
79
|
|
|
80
80
|
/** Alternative input names for props (e.g., merchants can pass innerStyle or style) */
|
|
81
81
|
aliases?: Record<string, string>;
|
|
82
|
+
|
|
83
|
+
/** Optional submit factory — wires instance.submit() on the component (e.g., CardInput) */
|
|
84
|
+
submit?: (instance: BridgeComponent<P>) => (options?: any) => Promise<any>;
|
|
82
85
|
};
|
|
83
86
|
|
|
84
87
|
// ---- Component instance (replaces MoneiComponent) ----
|
|
@@ -88,6 +91,7 @@ export interface BridgeComponent<P> {
|
|
|
88
91
|
updateProps: (props: Partial<P>) => Promise<void>;
|
|
89
92
|
close: () => Promise<void>;
|
|
90
93
|
destroy: () => Promise<void>;
|
|
94
|
+
submit?: (options?: any) => Promise<any>;
|
|
91
95
|
state: Record<string, any>;
|
|
92
96
|
event: EventEmitterType;
|
|
93
97
|
props: P;
|