Skip to content

Commit

Permalink
chore: 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ptchayap committed Jun 24, 2024
1 parent 038dfcb commit 4952afb
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 42 deletions.
36 changes: 22 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,51 @@

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.8 (2024-06-24)
## 3.6.0 (2024-06-07)

## 4.0.0-beta.7 (2024-06-18)
### Bug Fixes

## 4.0.0-beta.6 (2024-06-07)
- remove v4 ([c3d005c](https://github.com/AmityCo/Amity-Social-Cloud-UIKit-Web-OpenSource/commit/c3d005ce97203cd412fb38c9a6e8539b4e16613e))

## 4.0.0-beta.5 (2024-05-28)
## 3.5.0 (2024-04-26)

## 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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@amityco/ui-kit-open-source",
"version": "4.0.0-beta.8",
"version": "3.6.0",
"engines": {
"node": ">=20",
"pnpm": "9"
"node": ">=16",
"pnpm": ">=8"
},
"module": "dist/esm/index.js",
"main": "dist/index.js",
Expand Down
26 changes: 19 additions & 7 deletions src/core/providers/UiKitProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ interface UiKitProviderProps {
onConnected?: () => void;
onDisconnected?: () => void;
pageBehavior?: Record<string, unknown>;
getAuthToken?: () => Promise<string>;
}

const UiKitProvider = ({
Expand All @@ -75,6 +76,7 @@ const UiKitProvider = ({
actionHandlers,
onConnectionStatusChange,
onDisconnected,
getAuthToken,
}: UiKitProviderProps) => {
const queryClient = new QueryClient();
const [isConnected, setIsConnected] = useState(false);
Expand Down Expand Up @@ -104,20 +106,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
18 changes: 1 addition & 17 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as AmityUiKitProvider } from '~/v4/core/providers/AmityUIKitProvider';
export { default as AmityUiKitProvider } from '~/core/providers/UiKitProvider';
export { default as AmityUiKitFeed } from '~/social/components/Feed';
export { default as AmityUiKitSocial } from '~/social/pages/Application';
export { default as AmityUiKitChat } from '~/chat/pages/Application';
Expand Down Expand Up @@ -26,28 +26,12 @@ export {
StoryTab as AmityStoryTabComponent,
} from '~/v4/social/components';

// Chat v4
export {
AmityLiveChatHeader,
AmityLiveChatMessageList,
AmityLiveChatMessageReceiverView,
AmityLiveChatMessageSenderView,
AmityLiveChatMessageComposeBar,
} from '~/v4/chat/components';

export { MessageReactionPreview as AmityLiveChatMessageReactionPreview } from '~/v4/chat/components/MessageReactionPreview';
export { MessageReactionPicker as AmityLiveChatMessageReactionPicker } from '~/v4/chat/components/MessageReactionPicker';
export { MessageQuickReaction as AmityLiveChatMessageQuickReaction } from '~/v4/chat/components/MessageQuickReaction';
export { ReactionList as AmityReactionList } from '~/v4/social/components/ReactionList';

import type { AmityMessageActionType } from '~/v4/chat/components';
import type { ReactionListProps } from '~/v4/social/components/ReactionList';

export type { AmityMessageActionType };
export type { ReactionListProps as AmityReactionListProps };

export { AmityLiveChatPage } from '~/v4/chat/pages';

// v4 internal use only (Amity Console)
export { StoryPreview as AmityStoryPreview } from './v4/social/internal-components/StoryPreview';

Expand Down
1 change: 0 additions & 1 deletion src/social/providers/PostRendererProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const defaultPostRenderer: PostRendererConfigType = {
[PostContentType.POLL]: (props: PostRendererProps) => <DefaultPostRenderer {...props} />,
[PostContentType.TEXT]: (props: PostRendererProps) => <DefaultPostRenderer {...props} />,
[PostContentType.VIDEO]: (props: PostRendererProps) => <DefaultPostRenderer {...props} />,
[PostContentType.CUSTOM]: (props: PostRendererProps) => <DefaultPostRenderer {...props} />,
};

const PostRendererContext = createContext(defaultPostRenderer);
Expand Down

0 comments on commit 4952afb

Please sign in to comment.