diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index f55defe2c..4700c1761 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -5,9 +5,9 @@ on: inputs: release_as: description: 'release as' - required: false - pre-release: - description: 'prerelease' + required: true + custom_version: + description: 'custom version' required: false jobs: @@ -48,12 +48,8 @@ jobs: run: pnpm install - name: increase version (patch) - run: pnpm standard-version --yes - if: github.event.inputs.release_as == 'patch' && github.event.inputs.pre-release == '' - - - name: increase version (patch) (pre-release) - run: pnpm standard-version --yes --release-as patch --prerelease ${{ github.event.inputs.pre-release }} - if: github.event.inputs.release_as == 'patch' && github.event.inputs.pre-release != '' + run: pnpm standard-version --yes --release-as patch + if: github.event.inputs.release_as == 'patch' - name: increase version (minor) run: pnpm standard-version --yes --release-as minor @@ -75,6 +71,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 diff --git a/CHANGELOG.md b/CHANGELOG.md index e67db5c6b..4c91c4287 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,17 +2,37 @@ 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.1 (2024-04-05) +## 3.4.0 (2024-04-05) ### Bug Fixes -- update ts-sdk version ([84204c0](https://github.com/EkoCommunications/AmityUiKitWeb/commit/84204c0194d2421513f20f7ef15aea3e12b09e74)) +- 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.0 (2024-03-25) +## 3.3.0 (2024-03-22) ### Bug Fixes -- add pre-release condition ([#193](https://github.com/EkoCommunications/AmityUiKitWeb/issues/193)) ([ec9c0ca](https://github.com/EkoCommunications/AmityUiKitWeb/commit/ec9c0cab3c821842fae025ba30b54813e0999103)) +- ASC-21052 - fix undefined runtime error ([#184](https://github.com/EkoCommunications/AmityUiKitWeb/issues/184)) ([2385d3e](https://github.com/EkoCommunications/AmityUiKitWeb/commit/2385d3ec364ea74e4edf59ecffc0db088db7570e)) + +### 3.2.4 (2024-03-11) + +### Bug Fixes + +- 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)) + +### 3.2.3 (2024-03-01) + +### Bug Fixes + +- 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) diff --git a/package.json b/package.json index ff599f096..9e19aedf6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@amityco/ui-kit", - "version": "4.0.0-beta.1", + "name": "@amityco/ui-kit-open-source", + "version": "3.4.0", "engines": { "node": ">=16", "pnpm": ">=8" @@ -111,11 +111,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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b5ab3320..8b12925c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,9 +56,6 @@ dependencies: react-infinite-scroll-component: specifier: ^6.1.0 version: 6.1.0(react@18.2.0) - react-insta-stories: - specifier: ^2.6.2 - version: 2.6.2(react@18.2.0) react-intl: specifier: ^6.5.5 version: 6.6.2(react@18.2.0)(typescript@4.9.5) @@ -68,9 +65,6 @@ dependencies: react-mentions: specifier: ^4.4.10 version: 4.4.10(react-dom@18.2.0)(react@18.2.0) - react-modal-sheet: - specifier: ^2.2.0 - version: 2.2.0(framer-motion@11.0.25)(react@18.2.0) react-sizeme: specifier: ^3.0.2 version: 3.0.2 @@ -3147,46 +3141,6 @@ packages: '@babel/runtime': 7.23.9 dev: true - /@react-aria/ssr@3.9.2(react@18.2.0): - resolution: {integrity: sha512-0gKkgDYdnq1w+ey8KzG9l+H5Z821qh9vVjztk55rUg71vTk/Eaebeir+WtzcLLwTjw3m/asIjx8Y59y1lJZhBw==} - engines: {node: '>= 12'} - peerDependencies: - react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 - dependencies: - '@swc/helpers': 0.5.8 - react: 18.2.0 - dev: false - - /@react-aria/utils@3.17.0(react@18.2.0): - resolution: {integrity: sha512-NEul0cQ6tQPdNSHYzNYD+EfFabeYNvDwEiHB82kK/Tsfhfm84SM+baben/at2N51K7iRrJPr5hC5fi4+P88lNg==} - peerDependencies: - react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 - dependencies: - '@react-aria/ssr': 3.9.2(react@18.2.0) - '@react-stately/utils': 3.9.1(react@18.2.0) - '@react-types/shared': 3.22.1(react@18.2.0) - '@swc/helpers': 0.4.36 - clsx: 1.2.1 - react: 18.2.0 - dev: false - - /@react-stately/utils@3.9.1(react@18.2.0): - resolution: {integrity: sha512-yzw75GE0iUWiyps02BOAPTrybcsMIxEJlzXqtvllAb01O9uX5n0i3X+u2eCpj2UoDF4zS08Ps0jPgWxg8xEYtA==} - peerDependencies: - react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 - dependencies: - '@swc/helpers': 0.5.8 - react: 18.2.0 - dev: false - - /@react-types/shared@3.22.1(react@18.2.0): - resolution: {integrity: sha512-PCpa+Vo6BKnRMuOEzy5zAZ3/H5tnQg1e80khMhK2xys0j6ZqzkgQC+fHMNZ7VDFNLqqNMj/o0eVeSBDh2POjkw==} - peerDependencies: - react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 - dependencies: - react: 18.2.0 - dev: false - /@remix-run/router@1.15.1: resolution: {integrity: sha512-zcU0gM3z+3iqj8UX45AmWY810l3oUmXM7uH4dt5xtzvMhRtYVhKGOmgOd1877dOPPepfCjUv57w+syamWIYe7w==} engines: {node: '>=14.0.0'} @@ -4013,25 +3967,6 @@ packages: file-system-cache: 2.3.0 dev: true - /@swc/helpers@0.4.14: - resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==} - dependencies: - tslib: 2.6.2 - dev: false - - /@swc/helpers@0.4.36: - resolution: {integrity: sha512-5lxnyLEYFskErRPenYItLRSge5DjrJngYKdVjRSrWfza9G6KkgHEXi0vUZiyUeMU5JfXH1YnvXZzSp8ul88o2Q==} - dependencies: - legacy-swc-helpers: /@swc/helpers@0.4.14 - tslib: 2.6.2 - dev: false - - /@swc/helpers@0.5.8: - resolution: {integrity: sha512-lruDGw3pnfM3wmZHeW7JuhkGQaJjPyiKjxeGhdmfoOT53Ic9qb5JLDNaK2HUdl1zLDeX28H221UvKjfdvSLVMg==} - dependencies: - tslib: 2.6.2 - dev: false - /@tanstack/query-core@5.28.13: resolution: {integrity: sha512-C3+CCOcza+mrZ7LglQbjeYEOTEC3LV0VN0eYaIN6GvqAZ8Foegdgch7n6QYPtT4FuLae5ALy+m+ZMEKpD6tMCQ==} dev: false @@ -5586,11 +5521,6 @@ packages: engines: {node: '>=0.8'} dev: true - /clsx@1.2.1: - resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} - engines: {node: '>=6'} - dev: false - /clsx@2.1.0: resolution: {integrity: sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==} engines: {node: '>=6'} @@ -7208,25 +7138,6 @@ packages: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} dev: true - /framer-motion@11.0.25(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-mRt7vQGzA7++wTgb+PW1TrlXXgndqR6hCiJ48fXr2X9alte2hPQiAq556HRwDCt0Q5X98MNvcSe4KUa27Gm5Lg==} - peerDependencies: - '@emotion/is-prop-valid': '*' - react: ^18.0.0 - react-dom: ^18.0.0 - peerDependenciesMeta: - '@emotion/is-prop-valid': - optional: true - react: - optional: true - react-dom: - optional: true - dependencies: - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - tslib: 2.6.2 - dev: false - /fresh@0.5.2: resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} @@ -10071,14 +9982,6 @@ packages: throttle-debounce: 2.3.0 dev: false - /react-insta-stories@2.6.2(react@18.2.0): - resolution: {integrity: sha512-eM1YHr92bV7WK5h9sECjyYnqZtPxnzJrZFr9IaoDcaZaAEOHVRav+pST513DIG8Hk8QjSTHtdvHHZ0Ka5HwH8w==} - peerDependencies: - react: '>=16.8.2' - dependencies: - react: 18.2.0 - dev: false - /react-intl@6.6.2(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-IpW2IkLtGENSFlX3vfH11rjuCIsW0VyjT0Q1pPKMZPtT2z1FxLt4weFT5Ezti2TScT1xiyb3aQBFth9EB7jzAg==} peerDependencies: @@ -10135,18 +10038,6 @@ packages: substyle: 9.4.1(react@18.2.0) dev: false - /react-modal-sheet@2.2.0(framer-motion@11.0.25)(react@18.2.0): - resolution: {integrity: sha512-OAIWuVWxMx3zQqrMLbYWnczadplg0WLd+AaBWmN5+ysNF5/pneqjkOV3AWaIZOCIF4TcrejiCsTduutbzCRP2Q==} - engines: {node: '>=16'} - peerDependencies: - framer-motion: '>=6' - react: '>=16' - dependencies: - '@react-aria/utils': 3.17.0(react@18.2.0) - framer-motion: 11.0.25(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - dev: false - /react-native-uuid@2.0.1: resolution: {integrity: sha512-cptnoIbL53GTCrWlb/+jrDC6tvb7ypIyzbXNJcpR3Vab0mkeaaVd5qnB3f0whXYzS+SMoSQLcUUB0gEWqkPC0g==} engines: {node: '>=10.0.0', npm: '>=6.0.0'} diff --git a/src/core/providers/UiKitProvider/index.tsx b/src/core/providers/UiKitProvider/index.tsx index 71b3d43ab..f392cfbd9 100644 --- a/src/core/providers/UiKitProvider/index.tsx +++ b/src/core/providers/UiKitProvider/index.tsx @@ -31,7 +31,6 @@ interface UiKitProviderProps { http?: string; mqtt?: string; }; - authToken?: string; userId: string; displayName: string; customComponents?: CustomComponentType; @@ -56,13 +55,13 @@ interface UiKitProviderProps { onConnectionStatusChange?: (state: Amity.SessionStates) => void; onConnected?: () => void; onDisconnected?: () => void; + getAuthToken?: () => Promise; } const UiKitProvider = ({ apiKey, apiRegion, apiEndpoint, - authToken, userId, displayName, customComponents = {}, @@ -74,6 +73,7 @@ const UiKitProvider = ({ pageBehavior, onConnectionStatusChange, onDisconnected, + getAuthToken, }: UiKitProviderProps) => { const queryClient = new QueryClient(); const [isConnected, setIsConnected] = useState(false); @@ -103,21 +103,6 @@ const UiKitProvider = ({ setClient(ascClient); } - await ASCClient.login( - { userId, displayName, authToken }, - { - sessionWillRenewAccessToken(renewal) { - // secure mode - if (authToken) { - renewal.renewWithAuthToken(authToken); - return; - } - - renewal.renew(); - }, - }, - ); - setIsConnected(true); if (stateChangeRef.current == null) { diff --git a/src/i18n/en.json b/src/i18n/en.json index d53663475..98bab1c15 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -92,15 +92,10 @@ "UserFeed.tabs.timeline": "Timeline", "community.exploreCommunities": "Explore Community", "community.permissions.postReview": "Post review", - "community.permissions.storyComments": "Story comments", "community.permissions.approvePosts": "Approve member posts", - "community.permissions.allowStoryComments": "Allow comments on community stories", "community.permissions.approvePosts.prompt": "Posts by members have to be reviewed and approved by community moderator.", - "community.permissions.storyComments.prompt": "Turn on to receive comments on stories in this community.", "community.permissions.error.needApprovalOnPostCreation.turnOn": "Unable to turn on post review", "community.permissions.error.needApprovalOnPostCreation.turnOff": "Unable to turn off post review", - "community.permissions.error.storyComments.turnOn": "Unable to turn on post review", - "community.permissions.error.storyComments.turnOff": "Unable to turn off post review", "community.review.declinePendingPosts": "Decline pending post will permanently delete the selected post from community.", "community.pendingPostsBanner.title": "Pending posts", @@ -347,41 +342,6 @@ "pollComposer.overMentionees": "You have reached maximum 30 mentioned users in a post.", "pollComposer.okText": "OK", - "storyCreation.hyperlink.bottomSheet.cancel": "Cancel", - "storyCreation.hyperlink.bottomSheet.title": "Add link", - "storyCreation.hyperlink.bottomSheet.submit": "Done", - "storyCreation.hyperlink.form.urlLabel": "URL", - "storyCreation.hyperlink.form.urlPlaceholder": "https://example.com", - "storyCreation.hyperlink.form.linkTextLabel": "Customize link text", - "storyCreation.hyperlink.form.linkTextPlaceholder": "Name your link", - "storyCreation.hyperlink.form.linkTextDescription": "This text will show on the link instead of URL.", - "storyCreation.hyperlink.validation.invalidUrl": "Please enter a valid URL.", - "storyCreation.hyperlink.form.removeButton": "Remove link", - "storyCreation.hyperlink.removeConfirm.title": "Remove link", - "storyCreation.hyperlink.removeConfirm.content": "This link will be removed from story.", - "storyCreation.hyperlink.removeConfirm.cancel": "Cancel", - "storyCreation.hyperlink.removeConfirm.confirm": "Remove", - "storyCreation.hyperlink.validation.error.whitelisted": "Please enter a whitelisted URL.", - "storyCreation.hyperlink.validation.error.blocked": "Your text contains a blocklisted word.", - - "storyViewer.actions.deleteStory": "Delete story", - "storyViewer.action.confirmModal.title": "Delete this story?", - "storyViewer.action.confirmModal.content": "This story will be permanently deleted. You’ll no longer to see and find this story.", - "storyViewer.notification.deleted": "Story deleted", - "storyViewer.notification.success": "Successfully shared story", - "storyViewer.notification.error": "Failed to share story", - "storyViewer.footer.failed": "Failed to upload", - "storyViewer.footer.uploading": "Uploading...", - "storyViewer.commentSheet.title": "Comments", - "storyViewer.commentSheet.empty": "No comments yet", - "storyViewer.commentSheet.disabled": "Comments are disabled for this story", - "storyViewer.commentSheet.replyingTo": "Replying to", - "storyViewer.toast.like.disabled": "Join community to interact with all stories", - - "storyViewer.commentComposeBar.submit": "Post", - - "storyDraft.button.shareStory": "Share story", - "select.chatType.item": "{answerType} type", "chatComposer.label.channelId": "Channel ID", "chatComposer.label.displayName": "Display Name", diff --git a/src/social/components/Comment/index.tsx b/src/social/components/Comment/index.tsx index 8a6ecb9e1..17252998c 100644 --- a/src/social/components/Comment/index.tsx +++ b/src/social/components/Comment/index.tsx @@ -36,8 +36,7 @@ import { CommentRepository } from '@amityco/ts-sdk'; import { useCustomComponent } from '~/core/providers/CustomComponentsProvider'; import useCommentFlaggedByMe from '~/social/hooks/useCommentFlaggedByMe'; import useCommentPermission from '~/social/hooks/useCommentPermission'; -import useCommentSubscription from '~/social/hooks/useCommentSubscription'; -import useStory from '~/social/hooks/useStory'; +import useCommentSubscription from '~/social/hooks/useCommentSubsc import { ERROR_RESPONSE } from '~/social/constants'; const REPLIES_PER_PAGE = 5; diff --git a/src/social/components/CommunityInfo/UICommunityInfo.tsx b/src/social/components/CommunityInfo/UICommunityInfo.tsx index 68dc74926..462aa7a7a 100644 --- a/src/social/components/CommunityInfo/UICommunityInfo.tsx +++ b/src/social/components/CommunityInfo/UICommunityInfo.tsx @@ -26,7 +26,6 @@ import { import { useCustomComponent } from '~/core/providers/CustomComponentsProvider'; import millify from 'millify'; import { isNonNullable } from '~/helpers/utils'; -import { StoryTab } from '~/social/v4/components/StoryTab'; interface UICommunityInfoProps { communityId: string; @@ -45,15 +44,8 @@ interface UICommunityInfoProps { onClickLeaveCommunity: (communityId: string) => void; canLeaveCommunity: boolean; canReviewPosts: boolean; - isStorySyncing: boolean; - haveStories: boolean; - haveStoryPermission: boolean; - isStoryErrored: boolean; - isSeen: boolean; name: string; postSetting: ValueOf; - setStoryFile: React.Dispatch>; - onClickStory: (communityId: string) => void; } const UICommunityInfo = ({ @@ -66,11 +58,6 @@ const UICommunityInfo = ({ isJoined, isOfficial, isPublic, - isStorySyncing, - isSeen, - isStoryErrored, - haveStories, - haveStoryPermission, avatarFileUrl, canEditCommunity, onEditCommunity, @@ -80,8 +67,6 @@ const UICommunityInfo = ({ canReviewPosts, name, postSetting, - setStoryFile, - onClickStory, }: UICommunityInfoProps) => { const { formatMessage } = useIntl(); @@ -156,17 +141,6 @@ const UICommunityInfo = ({ )} - onClickStory(communityId)} - onChange={setStoryFile} - /> - {isJoined && canEditCommunity && (