Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/v3' into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ptchayap committed Apr 26, 2024
2 parents 4dfd42b + c6d3cfc commit f50c3ca
Show file tree
Hide file tree
Showing 305 changed files with 88 additions and 18,619 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
run: pnpm install

- name: increase version (patch)
run: pnpm standard-version --yes
run: pnpm standard-version --yes --release-as patch
if: github.event.inputs.release_as == 'patch' && github.event.inputs.pre-release == ''

- name: increase version (patch) (pre-release)
Expand All @@ -75,6 +75,10 @@ jobs:
run: pnpm standard-version --prerelease ${{ github.event.inputs.pre-release }}
if: github.event.inputs.release_as == '' && github.event.inputs.pre-release != ''

- name: increase version (custom)
run: pnpm standard-version --yes --release-as ${{ github.event.inputs.custom_version }}
if: github.event.inputs.release_as == 'custom'

- name: build
run: pnpm run build

Expand Down
1 change: 0 additions & 1 deletion .storybook/decorators/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { default as FluidControl } from './FluidControl';
export { default as UiKitDecorator } from './UiKitDecorator';
export { default as UiKitV4Decorator } from './UiKitV4Decorator';
7 changes: 1 addition & 6 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { Preview } from '@storybook/react';
import { FluidControl, UiKitDecorator, UiKitV4Decorator } from './decorators';
import { FluidControl, UiKitDecorator } from './decorators';

const preview: Preview = {
decorators: [
FluidControl.decorator,
(Story, ctx) => {
if (ctx.componentId.toLocaleLowerCase().includes('v4')) {
return UiKitV4Decorator.decorator(Story, ctx);
}
return UiKitDecorator.decorator(Story, ctx);
},
],
Expand All @@ -21,7 +18,6 @@ const preview: Preview = {
['Social', 'Chat'],
'Utilities',
'Assets',
'V4',
['Chat'],
],
},
Expand All @@ -30,7 +26,6 @@ const preview: Preview = {
globalTypes: {
...FluidControl.global,
...UiKitDecorator.global,
...UiKitV4Decorator.global,
},
};

Expand Down
28 changes: 18 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,43 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## 4.0.0-beta.3 (2024-04-26)
## 3.5.0 (2024-04-26)

### Bug Fixes

- path ([6b130f8](https://github.com/AmityCo/Amity-Social-Cloud-UIKit-Web-OpenSource/commit/6b130f840311ea6723061400a9f16db37444abe0))
- cherry-pick fix comment disappear bug ([d70f874](https://github.com/EkoCommunications/AmityUiKitWeb/commit/d70f8748d2e6f4588a19a1fe061ad7b74ce37907))

## 4.0.0-beta.3 (2024-04-26)
## 3.4.0 (2024-04-05)

### Bug Fixes

- cherry-pick bugs from v3 ([7b01a95](https://github.com/EkoCommunications/AmityUiKitWeb/commit/7b01a956db5a7c019164ee4ffaf781a55c588714))
- ASC-21481 - remove unnecessary request to prevent rate limit ([#230](https://github.com/EkoCommunications/AmityUiKitWeb/issues/230)) ([b2f2ce1](https://github.com/EkoCommunications/AmityUiKitWeb/commit/b2f2ce116b301f8fe9af124b506050abee1f29d2))

## 4.0.0-beta.2 (2024-04-12)
## 3.3.0 (2024-03-22)

### Bug Fixes

- export wrong path ([#264](https://github.com/EkoCommunications/AmityUiKitWeb/issues/264)) ([af08529](https://github.com/EkoCommunications/AmityUiKitWeb/commit/af08529265a6b620d7a543b438f96e44e1ef9eb1))
- ASC-21052 - fix undefined runtime error ([#184](https://github.com/EkoCommunications/AmityUiKitWeb/issues/184)) ([2385d3e](https://github.com/EkoCommunications/AmityUiKitWeb/commit/2385d3ec364ea74e4edf59ecffc0db088db7570e))

## 4.0.0-beta.1 (2024-04-05)
### 3.2.4 (2024-03-11)

### Bug Fixes

- update ts-sdk version ([84204c0](https://github.com/EkoCommunications/AmityUiKitWeb/commit/84204c0194d2421513f20f7ef15aea3e12b09e74))
- ASC-20601 - comment with blocked word should show noti ([#154](https://github.com/EkoCommunications/AmityUiKitWeb/issues/154)) ([ba4e3f0](https://github.com/EkoCommunications/AmityUiKitWeb/commit/ba4e3f044f08a3aef4d78910203350661cc59076))

## 4.0.0-beta.0 (2024-03-25)
### 3.2.3 (2024-03-01)

### Bug Fixes

- add pre-release condition ([#193](https://github.com/EkoCommunications/AmityUiKitWeb/issues/193)) ([ec9c0ca](https://github.com/EkoCommunications/AmityUiKitWeb/commit/ec9c0cab3c821842fae025ba30b54813e0999103))
- typo ([02875bb](https://github.com/EkoCommunications/AmityUiKitWeb/commit/02875bb8d10f174525424d12a3d69d7d92bf8c98))

### 3.2.1 (2024-02-27)

## 3.2.0 (2024-02-27)

### Features

- ASC-19739 - remove font awesome pro ([#129](https://github.com/EkoCommunications/AmityUiKitWeb/issues/129)) ([f7b35bc](https://github.com/EkoCommunications/AmityUiKitWeb/commit/f7b35bcb75fab8457aa5fd41ed31c6ea8b03487f)), closes [#127](https://github.com/EkoCommunications/AmityUiKitWeb/issues/127) [#118](https://github.com/EkoCommunications/AmityUiKitWeb/issues/118) [#116](https://github.com/EkoCommunications/AmityUiKitWeb/issues/116) [#128](https://github.com/EkoCommunications/AmityUiKitWeb/issues/128) [#123](https://github.com/EkoCommunications/AmityUiKitWeb/issues/123) [#142](https://github.com/EkoCommunications/AmityUiKitWeb/issues/142)

## 3.1.0 (2024-01-25)

Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amityco/ui-kit-open-source",
"version": "4.0.0-beta.3",
"version": "3.4.0",
"engines": {
"node": ">=16",
"pnpm": ">=8"
Expand Down Expand Up @@ -112,11 +112,9 @@
"polished": "^4.3.1",
"react-hook-form": "^7.49.2",
"react-infinite-scroll-component": "^6.1.0",
"react-insta-stories": "^2.6.2",
"react-intl": "^6.5.5",
"react-loading-skeleton": "^3.3.1",
"react-mentions": "^4.4.10",
"react-modal-sheet": "^2.2.0",
"react-sizeme": "^3.0.2",
"react-textarea-autosize": "^8.5.3",
"react-timeago": "^7.2.0",
Expand Down
109 changes: 0 additions & 109 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/core/components/Tabs/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export const TabButton = styled.button`
border-bottom: 2px solid transparent;
cursor: pointer;
outline: none;
color: ${({ theme }) => theme.v4.colors.base.shade3};
color: #abaeba;
${({ theme }) => theme.typography.bodyBold}
text-align: center;
&:hover {
Expand All @@ -33,8 +34,8 @@ export const TabButton = styled.button`
&.active {
${({ theme }) => `
border-bottom: 2px solid ${theme.v4.colors.primary.default};
color: ${theme.v4.colors.primary.default};
border-bottom: 2px solid ${theme.palette.primary.main};
color: ${theme.palette.primary.main};
`}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/hooks/useErrorNotification.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import { useNotifications } from '~/v4/core/providers/NotificationProvider';
import { useNotifications } from '~/core/providers/NotificationProvider';

const useErrorNotification = () => {
const [error, setError] = useState<string | null>(null);
Expand Down
28 changes: 19 additions & 9 deletions src/core/providers/UiKitProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ interface UiKitProviderProps {
http?: string;
mqtt?: string;
};
authToken?: string;
userId: string;
displayName: string;
customComponents?: CustomComponentType;
Expand All @@ -52,7 +51,7 @@ interface UiKitProviderProps {
onConnectionStatusChange?: (state: Amity.SessionStates) => void;
onConnected?: () => void;
onDisconnected?: () => void;
pageBehavior?: Record<string, unknown>;
getAuthToken?: () => Promise<string>;
}

const UiKitProvider = ({
Expand All @@ -69,6 +68,7 @@ const UiKitProvider = ({
actionHandlers,
onConnectionStatusChange,
onDisconnected,
getAuthToken,
}: UiKitProviderProps) => {
const queryClient = new QueryClient();
const [isConnected, setIsConnected] = useState(false);
Expand Down Expand Up @@ -98,20 +98,30 @@ const UiKitProvider = ({
setClient(ascClient);
}

await ASCClient.login(
{ userId, displayName, authToken },
{
sessionWillRenewAccessToken(renewal) {
const currentIsConnected = ASCClient.isConnected();

if (!currentIsConnected) {
let params: Amity.ConnectClientParams = { userId, displayName };

if (getAuthToken) {
const authToken = await getAuthToken();
params = { ...params, authToken };
}

await ASCClient.login(params, {
async sessionWillRenewAccessToken(renewal: Amity.AccessTokenRenewal) {
// secure mode
if (authToken) {
if (getAuthToken) {
const authToken = await getAuthToken();
renewal.renewWithAuthToken(authToken);
return;
}

renewal.renew();
},
},
);
});
}

setIsConnected(true);

if (stateChangeRef.current == null) {
Expand Down
Loading

0 comments on commit f50c3ca

Please sign in to comment.