TEBEX-1314 Payment portal support#31
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds payment portal support to Tebex.js, introducing a new portal API alongside the existing checkout functionality. The implementation shares common code between checkout and portal, including theme definitions, color configurations, and lightbox components.
Changes:
- Introduced
Tebex.portalAPI with initialization, launch, render, and close methods - Refactored shared types and components (theme, colors, lightbox) into common modules
- Added comprehensive test coverage for portal functionality
Reviewed changes
Copilot reviewed 26 out of 47 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/portal.ts | New portal implementation with initialization, rendering, and event handling |
| src/common.ts | Extracted shared theme and color types used by both checkout and portal |
| src/components/lightbox.tsx | Refactored lightbox component with enhanced options support and name-based identification |
| src/components/spinner.tsx | Updated import paths to reflect new components directory structure |
| src/checkout.ts | Updated to use shared types and refactored lightbox integration |
| src/index.ts | Exported new portal API and shared types |
| src/legacy/checkoutTypes.ts | Added deprecated type aliases for backward compatibility |
| src/webComponents/TebexPortal.ts | Created stub web component (not yet fully implemented) |
| src/utils/dom.ts | Enhanced setAttribute to support array values |
| tests/portal.test.ts | Comprehensive test suite for portal functionality |
| tests/checkout.test.ts | Updated tests to support object-based color configuration |
| example/index.html | Added portal demo section to example page |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/common.ts
Outdated
| }; | ||
|
|
||
| /** | ||
| * |
There was a problem hiding this comment.
Empty JSDoc comment block for TebexColorConfig type. Should include a description explaining that this type accepts either an array of color definitions or an object mapping color names to color values.
| * | |
| * Configuration for theming colors in the embedded Tebex UI. | |
| * | |
| * Accepts either: | |
| * - an array of {@link TebexColorDefinition} objects, or | |
| * - an object mapping {@link TebexColorName} keys to string color values. |
|
@tebexjaames looks like some tests are failing? |
Yeah; they're expecting portal.tebex.io to exist at the moment. ":) |
No description provided.