Skip to content

Commit

Permalink
Merge branch 'dev' into illiar/feat/cf-ui-enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterkmr committed Dec 2, 2024
2 parents 34249d3 + 85eea80 commit db0e3f5
Show file tree
Hide file tree
Showing 66 changed files with 918 additions and 690 deletions.
27 changes: 27 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# @ballerine/backoffice-v2

## 0.7.77

### Patch Changes

- bump
- Updated dependencies
- @ballerine/blocks@0.2.28
- @ballerine/common@0.9.55
- @ballerine/react-pdf-toolkit@1.2.48
- @ballerine/ui@0.5.48
- @ballerine/workflow-browser-sdk@0.6.73
- @ballerine/workflow-node-sdk@0.6.73

## 0.7.76

### Patch Changes

- Updated dependencies
- @ballerine/workflow-browser-sdk@0.6.72
- @ballerine/workflow-node-sdk@0.6.72

## 0.7.75

### Patch Changes
Expand Down Expand Up @@ -107,6 +128,12 @@

- bump
- Updated dependencies
- @ballerine/react-pdf-toolkit@1.2.40
- @ballerine/workflow-browser-sdk@0.6.56
- @ballerine/workflow-node-sdk@0.6.56
- @ballerine/common@0.9.44
- @ballerine/ui@0.5.40
- @ballerine/blocks@0.2.24
- @ballerine/ui@0.5.43
- @ballerine/react-pdf-toolkit@1.2.43

Expand Down
18 changes: 9 additions & 9 deletions apps/backoffice-v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ballerine/backoffice-v2",
"version": "0.7.75",
"version": "0.7.77",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"type": "module",
Expand Down Expand Up @@ -51,12 +51,12 @@
"preview": "vite preview"
},
"dependencies": {
"@ballerine/blocks": "0.2.27",
"@ballerine/common": "0.9.54",
"@ballerine/react-pdf-toolkit": "^1.2.47",
"@ballerine/ui": "^0.5.47",
"@ballerine/workflow-browser-sdk": "0.6.71",
"@ballerine/workflow-node-sdk": "0.6.71",
"@ballerine/blocks": "0.2.28",
"@ballerine/common": "0.9.55",
"@ballerine/react-pdf-toolkit": "^1.2.48",
"@ballerine/ui": "^0.5.48",
"@ballerine/workflow-browser-sdk": "0.6.73",
"@ballerine/workflow-node-sdk": "0.6.73",
"@botpress/webchat": "^2.1.10",
"@botpress/webchat-generator": "^0.2.9",
"@fontsource/inter": "^4.5.15",
Expand Down Expand Up @@ -147,8 +147,8 @@
"zod": "^3.22.3"
},
"devDependencies": {
"@ballerine/config": "^1.1.25",
"@ballerine/eslint-config-react": "^2.0.25",
"@ballerine/config": "^1.1.26",
"@ballerine/eslint-config-react": "^2.0.26",
"@cspell/cspell-types": "^6.31.1",
"@faker-js/faker": "^7.6.0",
"@playwright/test": "^1.32.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export const MerchantMonitoringCreateCheckPage: FunctionComponent = () => {
</Link>
</div>
<h1 className="pb-5 text-2xl font-bold">Create Merchant Check</h1>
<h3 className="pb-5 text-sm">Registered Company Name</h3>
<Card>
<CardContent className={`px-10 pt-8`}>
<Form {...form}>
Expand Down
28 changes: 28 additions & 0 deletions apps/kyb-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# kyb-app

## 0.3.89

### Patch Changes

- Updated dependencies
- @ballerine/ui@0.5.49

## 0.3.88

### Patch Changes

- bump
- Updated dependencies
- @ballerine/blocks@0.2.28
- @ballerine/common@0.9.55
- @ballerine/ui@0.5.48
- @ballerine/workflow-browser-sdk@0.6.73

## 0.3.87

### Patch Changes

- Updated dependencies
- @ballerine/workflow-browser-sdk@0.6.72

## 0.3.86

## 0.3.84
Expand Down Expand Up @@ -93,7 +118,10 @@

- bump
- Updated dependencies
- @ballerine/blocks@0.2.24
- @ballerine/common@0.9.44
- @ballerine/ui@0.5.43
- @ballerine/workflow-browser-sdk@0.6.56

## 0.3.75

Expand Down
14 changes: 7 additions & 7 deletions apps/kyb-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/kyb-app",
"private": true,
"version": "0.3.86",
"version": "0.3.89",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -15,10 +15,10 @@
"test:dev": "vitest"
},
"dependencies": {
"@ballerine/blocks": "0.2.27",
"@ballerine/common": "^0.9.54",
"@ballerine/ui": "0.5.47",
"@ballerine/workflow-browser-sdk": "0.6.71",
"@ballerine/blocks": "0.2.28",
"@ballerine/common": "^0.9.55",
"@ballerine/ui": "0.5.49",
"@ballerine/workflow-browser-sdk": "0.6.73",
"@lukemorales/query-key-factory": "^1.0.3",
"@radix-ui/react-icons": "^1.3.0",
"@rjsf/core": "^5.9.0",
Expand Down Expand Up @@ -64,8 +64,8 @@
"zod": "^3.23.4"
},
"devDependencies": {
"@ballerine/config": "^1.1.25",
"@ballerine/eslint-config-react": "^2.0.25",
"@ballerine/config": "^1.1.26",
"@ballerine/eslint-config-react": "^2.0.26",
"@jest/globals": "^29.7.0",
"@sentry/vite-plugin": "^2.9.0",
"@testing-library/jest-dom": "^6.1.4",
Expand Down
23 changes: 23 additions & 0 deletions apps/kyb-app/src/common/utils/is-iframe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Determines if the current window is running within an iframe.
* Handles both same-origin and cross-origin iframe scenarios.
*
* @returns {boolean} True if running in an iframe (including cross-origin), false otherwise
*/
export const isIframe = (): boolean => {
try {
// Check if window.self and window.top are the same reference
const isFramed = window.self !== window.top;

// Additional security check - try to access parent
// This will throw an error if cross-origin
if (isFramed) {
window.parent.location.origin;
}

return isFramed;
} catch (e: unknown) {
// If we get a security error, we're definitely in a cross-origin iframe
return true;
}
};
21 changes: 20 additions & 1 deletion apps/kyb-app/src/components/layouts/AppShell/FormContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
import { usePageResolverContext } from '@/components/organisms/DynamicUI/PageResolver/hooks/usePageResolverContext';
import { AnyChildren, ScrollArea } from '@ballerine/ui';
import { useEffect, useRef } from 'react';

interface Props {
children: AnyChildren;
header?: AnyChildren;
}

export const FormContainer = ({ children, header }: Props) => {
const scrollAreaRef = useRef<HTMLDivElement>(null);

const { currentPage } = usePageResolverContext();

// Scrolls to top of the page when page changes
useEffect(() => {
if (scrollAreaRef.current) {
setTimeout(() => {
scrollAreaRef.current!.scrollTo({
top: 0,
behavior: 'smooth',
});
}, 100);
}
}, [currentPage]);

return (
<ScrollArea orientation="both" className="h-full">
//@ts-ignore
<ScrollArea orientation="both" className="h-full" ref={scrollAreaRef}>
<div className="text-secondary-foreground box-content flex flex-col gap-5 pl-40 pt-20">
{header ? <div>{header}</div> : null}
<div className="flex-flex-col w-full max-w-[385px]">{children}</div>
Expand Down
9 changes: 5 additions & 4 deletions apps/kyb-app/src/hooks/useAppExit/useAppExit.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isIframe } from '@/common/utils/is-iframe';
import { useCustomerQuery } from '@/hooks/useCustomerQuery';
import { useFlowTracking } from '@/hooks/useFlowTracking';
import { useLanguage } from '@/hooks/useLanguage';
Expand All @@ -11,10 +12,10 @@ export const useAppExit = () => {
const { customer } = useCustomerQuery();
const { trackEvent } = useFlowTracking();

const kybOnExitAction = uiSchema?.config?.kybOnExitAction || 'send-event';
const kybOnExitAction = uiSchema?.config?.kybOnExitAction;

const exit = useCallback(() => {
if (kybOnExitAction === 'send-event') {
if (kybOnExitAction === 'send-event' || isIframe()) {
trackEvent(CollectionFlowEvents.USER_EXITED);

return;
Expand All @@ -25,10 +26,10 @@ export const useAppExit = () => {
location.href = customer?.websiteUrl;
}
}
}, [trackEvent, customer]);
}, [trackEvent, customer, kybOnExitAction]);

return {
exit,
isExitAvailable: kybOnExitAction === 'send-event' ? true : !!customer?.websiteUrl,
isExitAvailable: kybOnExitAction === 'send-event' || isIframe() ? true : !!customer?.websiteUrl,
};
};
10 changes: 10 additions & 0 deletions apps/workflows-dashboard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @ballerine/workflows-dashboard

## 0.2.26

### Patch Changes

- bump
- Updated dependencies
- @ballerine/common@0.9.55
- @ballerine/ui@0.5.48

## 0.2.25

### Patch Changes
Expand Down Expand Up @@ -33,6 +42,7 @@

- bump
- Updated dependencies
- @ballerine/common@0.9.44
- @ballerine/common@0.9.45
- @ballerine/ui@0.5.40

Expand Down
10 changes: 5 additions & 5 deletions apps/workflows-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/workflows-dashboard",
"private": false,
"version": "0.2.25",
"version": "0.2.26",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
Expand All @@ -15,8 +15,8 @@
"test": "NODE_ENV=test jest"
},
"dependencies": {
"@ballerine/common": "^0.9.52",
"@ballerine/ui": "^0.5.45",
"@ballerine/common": "^0.9.55",
"@ballerine/ui": "^0.5.48",
"@lukemorales/query-key-factory": "^1.0.3",
"@radix-ui/react-avatar": "^1.0.3",
"@radix-ui/react-dialog": "1.0.4",
Expand Down Expand Up @@ -63,8 +63,8 @@
"zod": "^3.22.3"
},
"devDependencies": {
"@ballerine/config": "^1.1.25",
"@ballerine/eslint-config-react": "^2.0.25",
"@ballerine/config": "^1.1.26",
"@ballerine/eslint-config-react": "^2.0.26",
"@cspell/cspell-types": "^6.31.1",
"@types/axios": "^0.14.0",
"@types/classnames": "^2.3.1",
Expand Down
18 changes: 18 additions & 0 deletions examples/headless-example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @ballerine/headless-example

## 0.3.72

### Patch Changes

- bump
- Updated dependencies
- @ballerine/common@0.9.55
- @ballerine/workflow-browser-sdk@0.6.73

## 0.3.71

### Patch Changes

- Updated dependencies
- @ballerine/workflow-browser-sdk@0.6.72

## 0.3.70

## 0.3.68
Expand Down Expand Up @@ -115,6 +131,8 @@

- bump
- Updated dependencies
- @ballerine/workflow-browser-sdk@0.6.56
- @ballerine/common@0.9.44
- @ballerine/workflow-browser-sdk@0.6.57
- @ballerine/common@0.9.45

Expand Down
6 changes: 3 additions & 3 deletions examples/headless-example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/headless-example",
"private": true,
"version": "0.3.70",
"version": "0.3.72",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
Expand Down Expand Up @@ -34,8 +34,8 @@
"vite": "^4.5.3"
},
"dependencies": {
"@ballerine/common": "0.9.54",
"@ballerine/workflow-browser-sdk": "0.6.71",
"@ballerine/common": "0.9.55",
"@ballerine/workflow-browser-sdk": "0.6.73",
"@felte/reporter-svelte": "^1.1.5",
"@felte/validator-zod": "^1.0.13",
"@fontsource/inter": "^4.5.15",
Expand Down
8 changes: 8 additions & 0 deletions examples/report-generation-example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @ballerine/report-generation-example

## 0.2.25

### Patch Changes

- bump
- Updated dependencies
- @ballerine/react-pdf-toolkit@1.2.48

## 0.2.24

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions examples/report-generation-example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/report-generation-example",
"private": false,
"version": "0.2.24",
"version": "0.2.25",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@ballerine/react-pdf-toolkit": "^1.2.45",
"@ballerine/react-pdf-toolkit": "^1.2.48",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Loading

0 comments on commit db0e3f5

Please sign in to comment.