Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
ed32b20c
Commit
ed32b20c
authored
Jan 27, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update frontend dependencies
parent
10d709c1
Changes
55
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
469 additions
and
550 deletions
+469
-550
package.json
web/package.json
+12
-13
pnpm-lock.yaml
web/pnpm-lock.yaml
+373
-456
ActivityCalendar.tsx
web/src/components/ActivityCalendar.tsx
+2
-2
ChangeMemberPasswordDialog.tsx
web/src/components/ChangeMemberPasswordDialog.tsx
+2
-2
ChangeMemoCreatedTsDialog.tsx
web/src/components/ChangeMemoCreatedTsDialog.tsx
+2
-2
ChangePasswordDialog.tsx
web/src/components/ChangePasswordDialog.tsx
+2
-2
CreateAccessTokenDialog.tsx
web/src/components/CreateAccessTokenDialog.tsx
+1
-1
CreateIdentityProviderDialog.tsx
web/src/components/CreateIdentityProviderDialog.tsx
+1
-1
CreateMemoRelationDialog.tsx
web/src/components/CreateMemoRelationDialog.tsx
+3
-3
CreateResourceDialog.tsx
web/src/components/CreateResourceDialog.tsx
+1
-1
CreateStorageServiceDialog.tsx
web/src/components/CreateStorageServiceDialog.tsx
+1
-1
CreateTagDialog.tsx
web/src/components/CreateTagDialog.tsx
+1
-1
CreateWebhookDialog.tsx
web/src/components/CreateWebhookDialog.tsx
+1
-1
BaseDialog.tsx
web/src/components/Dialog/BaseDialog.tsx
+1
-1
CommonDialog.tsx
web/src/components/Dialog/CommonDialog.tsx
+1
-1
DisablePasswordLoginDialog.tsx
web/src/components/DisablePasswordLoginDialog.tsx
+1
-1
HomeSidebar.tsx
web/src/components/HomeSidebar.tsx
+1
-1
MemoCommentMessage.tsx
web/src/components/Inbox/MemoCommentMessage.tsx
+3
-3
VersionUpdateMessage.tsx
web/src/components/Inbox/VersionUpdateMessage.tsx
+3
-3
Tag.tsx
web/src/components/MemoContent/Tag.tsx
+1
-1
TaskList.tsx
web/src/components/MemoContent/TaskList.tsx
+1
-1
AddMemoRelationButton.tsx
...ponents/MemoEditor/ActionButton/AddMemoRelationButton.tsx
+2
-2
TagSuggestions.tsx
web/src/components/MemoEditor/Editor/TagSuggestions.tsx
+1
-1
index.tsx
web/src/components/MemoEditor/Editor/index.tsx
+1
-1
MemoEditorDialog.tsx
web/src/components/MemoEditor/MemoEditorDialog.tsx
+1
-1
index.tsx
web/src/components/MemoEditor/index.tsx
+3
-3
MemoFilter.tsx
web/src/components/MemoFilter.tsx
+1
-1
MemoRelationListView.tsx
web/src/components/MemoRelationListView.tsx
+2
-2
MemoView.tsx
web/src/components/MemoView.tsx
+3
-3
MobileHeader.tsx
web/src/components/MobileHeader.tsx
+1
-1
Navigation.tsx
web/src/components/Navigation.tsx
+8
-5
PreviewImageDialog.tsx
web/src/components/PreviewImageDialog.tsx
+1
-1
PreviewMarkdownDialog.tsx
web/src/components/PreviewMarkdownDialog.tsx
+1
-1
RenameTagDialog.tsx
web/src/components/RenameTagDialog.tsx
+1
-1
SearchBar.tsx
web/src/components/SearchBar.tsx
+1
-1
PreferencesSection.tsx
web/src/components/Settings/PreferencesSection.tsx
+4
-4
ShareMemoDialog.tsx
web/src/components/ShareMemoDialog.tsx
+1
-1
UpdateAccountDialog.tsx
web/src/components/UpdateAccountDialog.tsx
+2
-2
UpdateCustomizedProfileDialog.tsx
web/src/components/UpdateCustomizedProfileDialog.tsx
+1
-1
UpdateLocalStorageDialog.tsx
web/src/components/UpdateLocalStorageDialog.tsx
+1
-1
UserBanner.tsx
web/src/components/UserBanner.tsx
+1
-1
grpcweb.ts
web/src/grpcweb.ts
+1
-1
i18n.ts
web/src/i18n.ts
+1
-1
Root.tsx
web/src/layouts/Root.tsx
+2
-2
main.tsx
web/src/main.tsx
+1
-1
Archived.tsx
web/src/pages/Archived.tsx
+1
-1
MemoDetail.tsx
web/src/pages/MemoDetail.tsx
+1
-1
SignIn.tsx
web/src/pages/SignIn.tsx
+1
-1
Timeline.tsx
web/src/pages/Timeline.tsx
+1
-1
filter.ts
web/src/store/module/filter.ts
+4
-4
global.ts
web/src/store/module/global.ts
+1
-1
inbox.ts
web/src/store/v1/inbox.ts
+1
-1
memo.ts
web/src/store/v1/memo.ts
+1
-1
resource.ts
web/src/store/v1/resource.ts
+1
-1
user.ts
web/src/store/v1/user.ts
+1
-1
No files found.
web/package.json
View file @
ed32b20c
...
...
@@ -4,7 +4,6 @@
"dev"
:
"vite"
,
"build"
:
"tsc && vite build"
,
"lint"
:
"eslint --ext .js,.ts,.tsx, src"
,
"lint-fix"
:
"eslint --ext .js,.ts,.tsx, src --fix"
,
"type-gen"
:
"cd ../proto && buf generate"
,
"type-check"
:
"tsc"
},
...
...
@@ -16,7 +15,7 @@
"@mui/base"
:
"5.0.0-beta.32"
,
"@mui/joy"
:
"5.0.0-beta.23"
,
"@reduxjs/toolkit"
:
"^1.9.7"
,
"axios"
:
"^1.6.
5
"
,
"axios"
:
"^1.6.
7
"
,
"classnames"
:
"^2.5.1"
,
"copy-to-clipboard"
:
"^3.3.3"
,
"highlight.js"
:
"^11.9.0"
,
...
...
@@ -34,36 +33,36 @@
"react-i18next"
:
"^11.18.6"
,
"react-redux"
:
"^8.1.3"
,
"react-router-dom"
:
"^6.21.3"
,
"react-use"
:
"^17.
4.3
"
,
"react-use"
:
"^17.
5.0
"
,
"tailwindcss"
:
"^3.4.1"
,
"textarea-caret"
:
"^3.1.0"
,
"uuid"
:
"^9.0.1"
,
"zustand"
:
"^4.
4.7
"
"zustand"
:
"^4.
5.0
"
},
"devDependencies"
:
{
"@bufbuild/buf"
:
"^1.2
8.1
"
,
"@trivago/prettier-plugin-sort-imports"
:
"^
3.4
.0"
,
"@bufbuild/buf"
:
"^1.2
9.0
"
,
"@trivago/prettier-plugin-sort-imports"
:
"^
4.3
.0"
,
"@types/katex"
:
"^0.16.7"
,
"@types/lodash-es"
:
"^4.17.12"
,
"@types/node"
:
"^20.11.
5
"
,
"@types/node"
:
"^20.11.
7
"
,
"@types/qs"
:
"^6.9.11"
,
"@types/react"
:
"^18.2.48"
,
"@types/react-dom"
:
"^18.2.18"
,
"@types/textarea-caret"
:
"^3.0.3"
,
"@types/uuid"
:
"^9.0.
7
"
,
"@typescript-eslint/eslint-plugin"
:
"^6.19.
0
"
,
"@typescript-eslint/parser"
:
"^6.19.
0
"
,
"@types/uuid"
:
"^9.0.
8
"
,
"@typescript-eslint/eslint-plugin"
:
"^6.19.
1
"
,
"@typescript-eslint/parser"
:
"^6.19.
1
"
,
"@vitejs/plugin-react"
:
"^4.2.1"
,
"autoprefixer"
:
"^10.4.17"
,
"eslint"
:
"^8.56.0"
,
"eslint-config-prettier"
:
"^8.10.0"
,
"eslint-plugin-prettier"
:
"^
4.2.1
"
,
"eslint-plugin-prettier"
:
"^
5.1.3
"
,
"eslint-plugin-react"
:
"^7.33.2"
,
"less"
:
"^4.2.0"
,
"postcss"
:
"^8.4.33"
,
"prettier"
:
"
2.6.2
"
,
"prettier"
:
"
^3.2.4
"
,
"typescript"
:
"^5.3.3"
,
"vite"
:
"^5.0.1
1
"
"vite"
:
"^5.0.1
2
"
},
"resolutions"
:
{
"csstype"
:
"3.1.2"
...
...
web/pnpm-lock.yaml
View file @
ed32b20c
This diff is collapsed.
Click to expand it.
web/src/components/ActivityCalendar.tsx
View file @
ed32b20c
...
...
@@ -59,7 +59,7 @@ const ActivityCalendar = (props: Props) => {
className=
{
classNames
(
"w-4 h-4 text-[9px] rounded-md flex justify-center items-center border border-transparent"
,
getCellAdditionalStyles
(
count
,
maxCount
),
isToday
&&
"border-gray-600 dark:!border-gray-500"
isToday
&&
"border-gray-600 dark:!border-gray-500"
,
)
}
onClick=
{
()
=>
count
&&
onClick
&&
onClick
(
date
)
}
>
...
...
@@ -71,7 +71,7 @@ const ActivityCalendar = (props: Props) => {
key=
{
`${date}-${index}`
}
className=
{
classNames
(
"shrink-0 opacity-30 w-4 h-4 rounded-md flex justify-center items-center border border-transparent"
,
getCellAdditionalStyles
(
count
,
maxCount
)
getCellAdditionalStyles
(
count
,
maxCount
)
,
)
}
></
div
>
);
...
...
web/src/components/ChangeMemberPasswordDialog.tsx
View file @
ed32b20c
...
...
@@ -54,7 +54,7 @@ const ChangeMemberPasswordDialog: React.FC<Props> = (props: Props) => {
name
:
user
.
name
,
password
:
newPassword
,
},
[
"password"
]
[
"password"
]
,
);
toast
(
t
(
"message.password-changed"
));
handleCloseBtnClick
();
...
...
@@ -111,7 +111,7 @@ function showChangeMemberPasswordDialog(user: User) {
dialogName
:
"change-member-password-dialog"
,
},
ChangeMemberPasswordDialog
,
{
user
}
{
user
}
,
);
}
...
...
web/src/components/ChangeMemoCreatedTsDialog.tsx
View file @
ed32b20c
...
...
@@ -46,7 +46,7 @@ const ChangeMemoCreatedTsDialog: React.FC<Props> = (props: Props) => {
id
:
memoId
,
createTime
:
new
Date
(
createdAt
),
},
[
"created_ts"
]
[
"created_ts"
]
,
);
toast
.
success
(
t
(
"message.memo-updated-datetime"
));
handleCloseBtnClick
();
...
...
@@ -98,7 +98,7 @@ function showChangeMemoCreatedTsDialog(memoId: number) {
ChangeMemoCreatedTsDialog
,
{
memoId
,
}
}
,
);
}
...
...
web/src/components/ChangePasswordDialog.tsx
View file @
ed32b20c
...
...
@@ -56,7 +56,7 @@ const ChangePasswordDialog: React.FC<Props> = ({ destroy }: Props) => {
name
:
currentUser
.
name
,
password
:
newPassword
,
},
[
"password"
]
[
"password"
]
,
);
toast
.
success
(
t
(
"message.password-changed"
));
handleCloseBtnClick
();
...
...
@@ -110,7 +110,7 @@ function showChangePasswordDialog() {
className
:
"change-password-dialog"
,
dialogName
:
"change-password-dialog"
,
},
ChangePasswordDialog
ChangePasswordDialog
,
);
}
...
...
web/src/components/CreateAccessTokenDialog.tsx
View file @
ed32b20c
...
...
@@ -139,7 +139,7 @@ function showCreateAccessTokenDialog(onConfirm: () => void) {
CreateAccessTokenDialog
,
{
onConfirm
,
}
}
,
);
}
...
...
web/src/components/CreateIdentityProviderDialog.tsx
View file @
ed32b20c
...
...
@@ -426,7 +426,7 @@ function showCreateIdentityProviderDialog(identityProvider?: IdentityProvider, c
dialogName
:
"create-identity-provider-dialog"
,
},
CreateIdentityProviderDialog
,
{
identityProvider
,
confirmCallback
}
{
identityProvider
,
confirmCallback
}
,
);
}
...
...
web/src/components/CreateMemoRelationDialog.tsx
View file @
ed32b20c
...
...
@@ -46,7 +46,7 @@ const CreateMemoRelationDialog: React.FC<Props> = (props: Props) => {
setIsFetching
(
false
);
},
300
,
[
searchText
]
[
searchText
]
,
);
const
getHighlightedContent
=
(
content
:
string
)
=>
{
...
...
@@ -80,7 +80,7 @@ const CreateMemoRelationDialog: React.FC<Props> = (props: Props) => {
const
handleConfirmBtnClick
=
async
()
=>
{
onConfirm
(
selectedMemos
.
map
((
memo
)
=>
memo
.
id
),
embedded
embedded
,
);
destroy
();
};
...
...
@@ -155,7 +155,7 @@ function showCreateMemoRelationDialog(props: Omit<Props, "destroy" | "hide">) {
dialogName
:
"create-memo-relation-dialog"
,
},
CreateMemoRelationDialog
,
props
props
,
);
}
...
...
web/src/components/CreateResourceDialog.tsx
View file @
ed32b20c
...
...
@@ -299,7 +299,7 @@ function showCreateResourceDialog(props: Omit<Props, "destroy" | "hide">) {
dialogName
:
"create-resource-dialog"
,
},
CreateResourceDialog
,
props
props
,
);
}
...
...
web/src/components/CreateStorageServiceDialog.tsx
View file @
ed32b20c
...
...
@@ -240,7 +240,7 @@ function showCreateStorageServiceDialog(storage?: ObjectStorage, confirmCallback
dialogName
:
"create-storage-service-dialog"
,
},
CreateStorageServiceDialog
,
{
storage
,
confirmCallback
}
{
storage
,
confirmCallback
}
,
);
}
...
...
web/src/components/CreateTagDialog.tsx
View file @
ed32b20c
...
...
@@ -170,7 +170,7 @@ function showCreateTagDialog() {
className
:
"create-tag-dialog"
,
dialogName
:
"create-tag-dialog"
,
},
CreateTagDialog
CreateTagDialog
,
);
}
...
...
web/src/components/CreateWebhookDialog.tsx
View file @
ed32b20c
...
...
@@ -155,7 +155,7 @@ function showCreateWebhookDialog(onConfirm: () => void) {
CreateWebhookDialog
,
{
onConfirm
,
}
}
,
);
}
...
...
web/src/components/Dialog/BaseDialog.tsx
View file @
ed32b20c
...
...
@@ -68,7 +68,7 @@ const BaseDialog: React.FC<Props> = (props: Props) => {
export
function
generateDialog
<
T
extends
DialogProps
>
(
config
:
DialogConfig
,
DialogComponent
:
React
.
FC
<
T
>
,
props
?:
Omit
<
T
,
"destroy"
|
"hide"
>
props
?:
Omit
<
T
,
"destroy"
|
"hide"
>
,
):
DialogCallback
{
const
tempDiv
=
document
.
createElement
(
"div"
);
const
dialog
=
createRoot
(
tempDiv
);
...
...
web/src/components/Dialog/CommonDialog.tsx
View file @
ed32b20c
...
...
@@ -86,6 +86,6 @@ export const showCommonDialog = (props: CommonDialogProps) => {
dialogName: `
common
-
dialog
$
{
props
?.
className
??
""
}
`,
},
CommonDialog,
props
props
,
);
};
web/src/components/DisablePasswordLoginDialog.tsx
View file @
ed32b20c
...
...
@@ -91,7 +91,7 @@ function showDisablePasswordLoginDialog() {
className
:
"disable-password-login-dialog"
,
dialogName
:
"disable-password-login-dialog"
,
},
DisablePasswordLoginDialog
DisablePasswordLoginDialog
,
);
}
...
...
web/src/components/HomeSidebar.tsx
View file @
ed32b20c
...
...
@@ -15,7 +15,7 @@ const HomeSidebar = (props: Props) => {
<
aside
className=
{
classNames
(
"relative w-full h-auto max-h-screen overflow-auto hide-scrollbar flex flex-col justify-start items-start"
,
props
.
className
props
.
className
,
)
}
>
<
SearchBar
/>
...
...
web/src/components/Inbox/MemoCommentMessage.tsx
View file @
ed32b20c
...
...
@@ -59,7 +59,7 @@ const MemoCommentMessage = ({ inbox }: Props) => {
name
:
inbox
.
name
,
status
:
Inbox_Status
.
ARCHIVED
,
},
[
"status"
]
[
"status"
]
,
);
if
(
!
silence
)
{
toast
.
success
(
"Archived"
);
...
...
@@ -73,7 +73,7 @@ const MemoCommentMessage = ({ inbox }: Props) => {
"shrink-0 mt-2 p-2 rounded-full border"
,
inbox
.
status
===
Inbox_Status
.
UNREAD
?
"border-blue-600 text-blue-600 bg-blue-50 dark:bg-zinc-800"
:
"border-gray-500 text-gray-500 bg-gray-50 dark:bg-zinc-800"
:
"border-gray-500 text-gray-500 bg-gray-50 dark:bg-zinc-800"
,
)
}
>
<
Tooltip
title=
{
"Comment"
}
placement=
"bottom"
>
...
...
@@ -83,7 +83,7 @@ const MemoCommentMessage = ({ inbox }: Props) => {
<
div
className=
{
classNames
(
"border w-full p-3 px-4 rounded-lg flex flex-col justify-start items-start gap-2 dark:border-zinc-700 hover:bg-gray-100 dark:hover:bg-zinc-700"
,
inbox
.
status
!==
Inbox_Status
.
UNREAD
&&
"opacity-60"
inbox
.
status
!==
Inbox_Status
.
UNREAD
&&
"opacity-60"
,
)
}
>
<
div
className=
"w-full flex flex-row justify-between items-center"
>
...
...
web/src/components/Inbox/VersionUpdateMessage.tsx
View file @
ed32b20c
...
...
@@ -49,7 +49,7 @@ const VersionUpdateMessage = ({ inbox }: Props) => {
name: inbox.name,
status: Inbox_Status.ARCHIVED,
},
["status"]
["status"]
,
);
if (!silence) {
toast.success("Archived");
...
...
@@ -63,7 +63,7 @@ const VersionUpdateMessage = ({ inbox }: Props) => {
"shrink-0 mt-2 p-2 rounded-full border",
inbox.status === Inbox_Status.UNREAD
? "border-blue-600 text-blue-600 bg-blue-50 dark:bg-zinc-800"
: "border-gray-500 text-gray-500 bg-gray-50 dark:bg-zinc-800"
: "border-gray-500 text-gray-500 bg-gray-50 dark:bg-zinc-800"
,
)}
>
<Tooltip title={"Update"} placement="bottom">
...
...
@@ -73,7 +73,7 @@ const VersionUpdateMessage = ({ inbox }: Props) => {
<div
className={classNames(
"border w-full p-3 px-4 rounded-lg flex flex-col justify-start items-start gap-2 dark:border-zinc-700 hover:bg-gray-100 dark:hover:bg-zinc-700",
inbox.status !== Inbox_Status.UNREAD && "opacity-60"
inbox.status !== Inbox_Status.UNREAD && "opacity-60"
,
)}
>
<div className="w-full flex flex-row justify-between items-center">
...
...
web/src/components/MemoContent/Tag.tsx
View file @
ed32b20c
...
...
@@ -28,7 +28,7 @@ const Tag: React.FC<Props> = ({ content }: Props) => {
<
span
className=
{
classNames
(
"inline-block w-auto text-blue-600 dark:text-blue-400"
,
context
.
disableFilter
?
""
:
"cursor-pointer hover:opacity-80"
context
.
disableFilter
?
""
:
"cursor-pointer hover:opacity-80"
,
)
}
onClick=
{
handleTagClick
}
>
...
...
web/src/components/MemoContent/TaskList.tsx
View file @
ed32b20c
...
...
@@ -40,7 +40,7 @@ const TaskList: React.FC<Props> = ({ index, indent, complete, children }: Props)
id
:
context
.
memoId
,
nodes
:
context
.
nodes
,
},
[
"nodes"
]
[
"nodes"
]
,
);
};
...
...
web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx
View file @
ed32b20c
...
...
@@ -51,8 +51,8 @@ const AddMemoRelationButton = (props: Props) => {
...
memoIdList
.
map
((
id
)
=>
({
memoId
:
context
.
memoId
||
UNKNOWN_ID
,
relatedMemoId
:
id
,
type
:
MemoRelation_Type
.
REFERENCE
})),
...
context
.
relationList
,
].
filter
((
relation
)
=>
relation
.
relatedMemoId
!==
(
context
.
memoId
||
UNKNOWN_ID
)),
"relatedMemoId"
)
"relatedMemoId"
,
)
,
);
},
});
...
...
web/src/components/MemoEditor/Editor/TagSuggestions.tsx
View file @
ed32b20c
...
...
@@ -123,7 +123,7 @@ const TagSuggestions = ({ editorRef, editorActions }: Props) => {
onMouseDown=
{
()
=>
autocomplete
(
tag
)
}
className=
{
classNames
(
"rounded p-1 px-2 w-full truncate text-sm dark:text-gray-300 cursor-pointer hover:bg-zinc-200 dark:hover:bg-zinc-800"
,
i
===
selected
?
"bg-zinc-300 dark:bg-zinc-700"
:
""
i
===
selected
?
"bg-zinc-300 dark:bg-zinc-700"
:
""
,
)
}
>
<
OverflowTip
>
#
{
tag
}
</
OverflowTip
>
...
...
web/src/components/MemoEditor/Editor/index.tsx
View file @
ed32b20c
...
...
@@ -136,7 +136,7 @@ const Editor = forwardRef(function Editor(props: Props, ref: React.ForwardedRef<
}
},
}),
[]
[]
,
);
const
handleEditorInput
=
useCallback
(()
=>
{
...
...
web/src/components/MemoEditor/MemoEditorDialog.tsx
View file @
ed32b20c
...
...
@@ -58,6 +58,6 @@ export default function showMemoEditorDialog(props: Pick<Props, "memoId" | "cach
containerClassName
:
"dark:!bg-zinc-800"
,
},
MemoEditorDialog
,
props
props
,
);
}
web/src/components/MemoEditor/index.tsx
View file @
ed32b20c
...
...
@@ -69,7 +69,7 @@ const MemoEditor = (props: Props) => {
const
userSetting
=
userStore
.
userSetting
as
UserSetting
;
const
referenceRelations
=
memoId
?
state
.
relationList
.
filter
(
(
relation
)
=>
relation
.
memoId
===
memoId
&&
relation
.
relatedMemoId
!==
memoId
&&
relation
.
type
===
MemoRelation_Type
.
REFERENCE
(
relation
)
=>
relation
.
memoId
===
memoId
&&
relation
.
relatedMemoId
!==
memoId
&&
relation
.
type
===
MemoRelation_Type
.
REFERENCE
,
)
:
state
.
relationList
.
filter
((
relation
)
=>
relation
.
type
===
MemoRelation_Type
.
REFERENCE
);
...
...
@@ -275,7 +275,7 @@ const MemoEditor = (props: Props) => {
content
,
visibility
:
state
.
memoVisibility
,
},
[
"content"
,
"visibility"
]
[
"content"
,
"visibility"
]
,
);
await
memoServiceClient
.
setMemoResources
({
id
:
memo
.
id
,
...
...
@@ -348,7 +348,7 @@ const MemoEditor = (props: Props) => {
onContentChange
:
handleContentChange
,
onPaste
:
handlePasteEvent
,
}),
[
i18n
.
language
]
[
i18n
.
language
]
,
);
const
allowSave
=
(
hasContent
||
state
.
resourceList
.
length
>
0
)
&&
!
state
.
isUploadingResource
&&
!
state
.
isRequesting
;
...
...
web/src/components/MemoFilter.tsx
View file @
ed32b20c
...
...
@@ -29,7 +29,7 @@ const MemoFilter = (props: Props) => {
<
div
className=
{
classNames
(
`w-full flex flex-row justify-start items-start flex-wrap gap-2 text-sm leading-7 dark:text-gray-400`
,
props
.
className
props
.
className
,
)
}
>
<
div
className=
"shrink-0 flex flex-row justify-start items-center text-gray-400"
>
...
...
web/src/components/MemoRelationListView.tsx
View file @
ed32b20c
...
...
@@ -22,13 +22,13 @@ const MemoRelationListView = (props: Props) => {
const
referencingMemoList
=
await
Promise
.
all
(
relationList
.
filter
((
relation
)
=>
relation
.
memoId
===
memo
.
id
&&
relation
.
relatedMemoId
!==
memo
.
id
)
.
map
((
relation
)
=>
memoStore
.
getOrFetchMemoById
(
relation
.
relatedMemoId
,
{
skipStore
:
true
}))
.
map
((
relation
)
=>
memoStore
.
getOrFetchMemoById
(
relation
.
relatedMemoId
,
{
skipStore
:
true
}))
,
);
setReferencingMemoList
(
referencingMemoList
);
const
referencedMemoList
=
await
Promise
.
all
(
relationList
.
filter
((
relation
)
=>
relation
.
memoId
!==
memo
.
id
&&
relation
.
relatedMemoId
===
memo
.
id
)
.
map
((
relation
)
=>
memoStore
.
getOrFetchMemoById
(
relation
.
memoId
,
{
skipStore
:
true
}))
.
map
((
relation
)
=>
memoStore
.
getOrFetchMemoById
(
relation
.
memoId
,
{
skipStore
:
true
}))
,
);
setReferencedMemoList
(
referencedMemoList
);
})();
...
...
web/src/components/MemoView.tsx
View file @
ed32b20c
...
...
@@ -87,7 +87,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
id
:
memo
.
id
,
pinned
:
false
,
},
[
"pinned"
]
[
"pinned"
]
,
);
}
else
{
await
memoStore
.
updateMemo
(
...
...
@@ -95,7 +95,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
id
:
memo
.
id
,
pinned
:
true
,
},
[
"pinned"
]
[
"pinned"
]
,
);
}
}
catch
(
error
)
{
...
...
@@ -129,7 +129,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
id
:
memo
.
id
,
rowStatus
:
RowStatus
.
ARCHIVED
,
},
[
"row_status"
]
[
"row_status"
]
,
);
}
catch
(
error
:
any
)
{
console
.
error
(
error
);
...
...
web/src/components/MobileHeader.tsx
View file @
ed32b20c
...
...
@@ -23,7 +23,7 @@ const MobileHeader = (props: Props) => {
className=
{
classNames
(
"sticky top-0 pt-3 pb-2 sm:pt-2 px-4 sm:px-6 sm:mb-1 bg-zinc-100 dark:bg-zinc-900 bg-opacity-80 backdrop-blur-lg flex md:hidden flex-row justify-between items-center w-full h-auto flex-nowrap shrink-0 z-1"
,
offsetTop
>
0
&&
"shadow-md"
,
className
className
,
)
}
>
<
div
className=
"flex flex-row justify-start items-center mr-2 shrink-0 overflow-hidden"
>
...
...
web/src/components/Navigation.tsx
View file @
ed32b20c
...
...
@@ -35,9 +35,12 @@ const Navigation = (props: Props) => {
inboxStore
.
fetchInboxes
();
// Fetch inboxes every 5 minutes.
const
timer
=
setInterval
(
async
()
=>
{
await
inboxStore
.
fetchInboxes
();
},
1000
*
60
*
5
);
const
timer
=
setInterval
(
async
()
=>
{
await
inboxStore
.
fetchInboxes
();
},
1000
*
60
*
5
,
);
return
()
=>
{
clearInterval
(
timer
);
...
...
@@ -120,7 +123,7 @@ const Navigation = (props: Props) => {
<
header
className=
{
classNames
(
"w-full h-full overflow-auto flex flex-col justify-start items-start py-4 md:pt-6 z-30 hide-scrollbar"
,
className
className
,
)
}
>
<
UserBanner
collapsed=
{
collapsed
}
/>
...
...
@@ -131,7 +134,7 @@ const Navigation = (props: Props) => {
classNames
(
"px-2 py-2 rounded-2xl border flex flex-row items-center text-lg text-gray-800 dark:text-gray-300 hover:bg-white hover:border-gray-200 dark:hover:border-zinc-700 dark:hover:bg-zinc-800"
,
collapsed
?
""
:
"w-full px-4"
,
isActive
?
"bg-white drop-shadow-sm dark:bg-zinc-800 border-gray-200 dark:border-zinc-700"
:
"border-transparent"
isActive
?
"bg-white drop-shadow-sm dark:bg-zinc-800 border-gray-200 dark:border-zinc-700"
:
"border-transparent"
,
)
}
key=
{
navLink
.
id
}
...
...
web/src/components/PreviewImageDialog.tsx
View file @
ed32b20c
...
...
@@ -146,6 +146,6 @@ export default function showPreviewImageDialog(imgUrls: string[] | string, initi
{
imgUrls
:
Array
.
isArray
(
imgUrls
)
?
imgUrls
:
[
imgUrls
],
initialIndex
:
initialIndex
||
0
,
}
}
,
);
}
web/src/components/PreviewMarkdownDialog.tsx
View file @
ed32b20c
...
...
@@ -53,6 +53,6 @@ export default function showPreviewMarkdownDialog(content: string): void {
PreviewMarkdownDialog
,
{
content
,
}
}
,
);
}
web/src/components/RenameTagDialog.tsx
View file @
ed32b20c
...
...
@@ -100,7 +100,7 @@ function showRenameTagDialog(props: Pick<Props, "tag">) {
dialogName
:
"rename-tag-dialog"
,
},
RenameTagDialog
,
props
props
,
);
}
...
...
web/src/components/SearchBar.tsx
View file @
ed32b20c
...
...
@@ -20,7 +20,7 @@ const SearchBar = () => {
filterStore
.
setTextFilter
(
queryText
.
length
===
0
?
undefined
:
queryText
);
},
1000
,
[
queryText
]
[
queryText
]
,
);
const
handleTextQueryInput
=
(
event
:
React
.
FormEvent
<
HTMLInputElement
>
)
=>
{
...
...
web/src/components/Settings/PreferencesSection.tsx
View file @
ed32b20c
...
...
@@ -26,7 +26,7 @@ const PreferencesSection = () => {
{
locale
,
},
[
"locale"
]
[
"locale"
]
,
);
globalStore
.
setLocale
(
locale
);
};
...
...
@@ -36,7 +36,7 @@ const PreferencesSection = () => {
{
appearance
,
},
[
"appearance"
]
[
"appearance"
]
,
);
globalStore
.
setAppearance
(
appearance
);
};
...
...
@@ -46,7 +46,7 @@ const PreferencesSection = () => {
{
memoVisibility
:
value
,
},
[
"memo_visibility"
]
[
"memo_visibility"
]
,
);
};
...
...
@@ -56,7 +56,7 @@ const PreferencesSection = () => {
{
telegramUserId
:
telegramUserId
,
},
[
"telegram_user_id"
]
[
"telegram_user_id"
]
,
);
toast
.
success
(
t
(
"message.update-succeed"
));
}
catch
(
error
:
any
)
{
...
...
web/src/components/ShareMemoDialog.tsx
View file @
ed32b20c
...
...
@@ -140,6 +140,6 @@ export default function showShareMemoDialog(memo: Memo): void {
dialogName
:
"share-memo-dialog"
,
},
ShareMemoDialog
,
{
memo
}
{
memo
}
,
);
}
web/src/components/UpdateAccountDialog.tsx
View file @
ed32b20c
...
...
@@ -113,7 +113,7 @@ const UpdateAccountDialog: React.FC<Props> = ({ destroy }: Props) => {
email
:
state
.
email
,
avatarUrl
:
state
.
avatarUrl
,
}),
updateMask
updateMask
,
);
toast
.
success
(
t
(
"message.update-succeed"
));
handleCloseBtnClick
();
...
...
@@ -183,7 +183,7 @@ function showUpdateAccountDialog() {
className
:
"update-account-dialog"
,
dialogName
:
"update-account-dialog"
,
},
UpdateAccountDialog
UpdateAccountDialog
,
);
}
...
...
web/src/components/UpdateCustomizedProfileDialog.tsx
View file @
ed32b20c
...
...
@@ -137,7 +137,7 @@ function showUpdateCustomizedProfileDialog() {
className
:
"update-customized-profile-dialog"
,
dialogName
:
"update-customized-profile-dialog"
,
},
UpdateCustomizedProfileDialog
UpdateCustomizedProfileDialog
,
);
}
...
...
web/src/components/UpdateLocalStorageDialog.tsx
View file @
ed32b20c
...
...
@@ -88,7 +88,7 @@ function showUpdateLocalStorageDialog(localStoragePath?: string, confirmCallback
dialogName
:
"update-local-storage-dialog"
,
},
UpdateLocalStorageDialog
,
{
localStoragePath
,
confirmCallback
}
{
localStoragePath
,
confirmCallback
}
,
);
}
...
...
web/src/components/UserBanner.tsx
View file @
ed32b20c
...
...
@@ -32,7 +32,7 @@ const UserBanner = (props: Props) => {
<
div
className=
{
classNames
(
"py-1 my-1 w-auto flex flex-row justify-start items-center cursor-pointer rounded-2xl border border-transparent text-gray-800 dark:text-gray-300"
,
collapsed
?
"px-1"
:
"px-3"
collapsed
?
"px-1"
:
"px-3"
,
)
}
>
<
UserAvatar
className=
"shadow shrink-0"
avatarUrl=
{
avatarUrl
}
/>
...
...
web/src/grpcweb.ts
View file @
ed32b20c
...
...
@@ -14,7 +14,7 @@ const channel = createChannel(
window
.
location
.
origin
,
FetchTransport
({
credentials
:
"include"
,
})
})
,
);
const
clientFactory
=
createClientFactory
();
...
...
web/src/i18n.ts
View file @
ed32b20c
...
...
@@ -58,4 +58,4 @@ for (const locale of availableLocales) {
}
export
default
i18n
;
export
type
TLocale
=
typeof
availableLocales
[
number
];
export
type
TLocale
=
(
typeof
availableLocales
)
[
number
];
web/src/layouts/Root.tsx
View file @
ed32b20c
...
...
@@ -17,14 +17,14 @@ function Root() {
<
div
className=
{
classNames
(
"w-full transition-all mx-auto flex flex-row justify-center items-start"
,
collapsed
?
"sm:pl-16"
:
"sm:pl-56"
collapsed
?
"sm:pl-16"
:
"sm:pl-56"
,
)
}
>
{
sm
&&
(
<
div
className=
{
classNames
(
"group flex flex-col justify-start items-start fixed top-0 left-0 select-none border-r dark:border-zinc-800 h-full bg-zinc-50 dark:bg-zinc-800 dark:bg-opacity-40 transition-all hover:shadow-xl z-2"
,
collapsed
?
"w-16 px-2"
:
"w-56 px-4"
collapsed
?
"w-16 px-2"
:
"w-56 px-4"
,
)
}
>
<
Navigation
className=
"!h-auto"
collapsed=
{
collapsed
}
/>
...
...
web/src/main.tsx
View file @
ed32b20c
...
...
@@ -20,5 +20,5 @@ root.render(
<
RouterProvider
router=
{
router
}
/>
<
Toaster
position=
"top-right"
/>
</
CssVarsProvider
>
</
Provider
>
</
Provider
>
,
);
web/src/pages/Archived.tsx
View file @
ed32b20c
...
...
@@ -72,7 +72,7 @@ const Archived = () => {
id
:
memo
.
id
,
rowStatus
:
RowStatus
.
ACTIVE
,
},
[
"row_status"
]
[
"row_status"
]
,
);
setArchivedMemos
((
prev
)
=>
prev
.
filter
((
m
)
=>
m
.
id
!==
memo
.
id
));
toast
(
t
(
"message.restored-successfully"
));
...
...
web/src/pages/MemoDetail.tsx
View file @
ed32b20c
...
...
@@ -88,7 +88,7 @@ const MemoDetail = () => {
id
:
memo
.
id
,
visibility
:
visibility
,
},
[
"visibility"
]
[
"visibility"
]
,
);
};
...
...
web/src/pages/SignIn.tsx
View file @
ed32b20c
...
...
@@ -97,7 +97,7 @@ const SignIn = () => {
const
authUrl
=
`
${
oauth2Config
.
authUrl
}
?client_id=
${
oauth2Config
.
clientId
}
&redirect_uri=
${
redirectUri
}
&state=
${
stateQueryParameter
}
&response_type=code&scope=
${
encodeURIComponent
(
oauth2Config
.
scopes
.
join
(
" "
)
oauth2Config
.
scopes
.
join
(
" "
)
,
)}
`
;
window
.
location
.
href
=
authUrl
;
}
...
...
web/src/pages/Timeline.tsx
View file @
ed32b20c
...
...
@@ -100,7 +100,7 @@ const Timeline = () => {
if
(
selectedDay
)
{
const
selectedDateStamp
=
getTimeStampByDate
(
selectedDay
)
+
new
Date
().
getTimezoneOffset
()
*
60
*
1000
;
filters
.
push
(
...[
`display_time_after ==
${
selectedDateStamp
/
1000
}
`
,
`display_time_before ==
${(
selectedDateStamp
+
DAILY_TIMESTAMP
)
/
1000
}
`
]
...[
`display_time_after ==
${
selectedDateStamp
/
1000
}
`
,
`display_time_before ==
${(
selectedDateStamp
+
DAILY_TIMESTAMP
)
/
1000
}
`
]
,
);
}
setIsRequesting
(
true
);
...
...
web/src/store/module/filter.ts
View file @
ed32b20c
...
...
@@ -18,28 +18,28 @@ export const useFilterStore = () => {
tag
:
undefined
,
text
:
undefined
,
visibility
:
undefined
,
})
})
,
);
},
setTextFilter
:
(
text
?:
string
)
=>
{
store
.
dispatch
(
setFilter
({
text
:
text
,
})
})
,
);
},
setTagFilter
:
(
tag
?:
string
)
=>
{
store
.
dispatch
(
setFilter
({
tag
:
tag
,
})
})
,
);
},
setMemoVisibilityFilter
:
(
visibility
?:
Visibility
)
=>
{
store
.
dispatch
(
setFilter
({
visibility
:
visibility
,
})
})
,
);
},
};
...
...
web/src/store/module/global.ts
View file @
ed32b20c
...
...
@@ -84,7 +84,7 @@ export const useGlobalStore = () => {
...
state
.
systemStatus
,
...
systemStatus
,
},
})
})
,
);
},
setLocale
:
(
locale
:
Locale
)
=>
{
...
...
web/src/store/v1/inbox.ts
View file @
ed32b20c
...
...
@@ -30,5 +30,5 @@ export const useInboxStore = create(
set
({
inboxes
:
inboxes
.
map
((
i
)
=>
(
i
.
name
===
updatedInbox
.
name
?
updatedInbox
:
i
))
});
return
updatedInbox
;
},
}))
}))
,
);
web/src/store/v1/memo.ts
View file @
ed32b20c
...
...
@@ -104,7 +104,7 @@ export const useMemoStore = create(
delete
memoMap
[
id
];
set
({
memoMapById
:
memoMap
});
},
}))
}))
,
);
export
const
useMemoList
=
()
=>
{
...
...
web/src/store/v1/resource.ts
View file @
ed32b20c
...
...
@@ -62,5 +62,5 @@ export const useResourceStore = create(
const
resourceMap
=
get
().
resourceMapById
;
return
Object
.
values
(
resourceMap
).
find
((
r
)
=>
r
.
name
===
name
);
},
}))
}))
,
);
web/src/store/v1/user.ts
View file @
ed32b20c
...
...
@@ -123,7 +123,7 @@ export const useUserStore = create(
set
({
userSetting
:
updatedUserSetting
});
return
updatedUserSetting
;
},
}))
}))
,
);
export
const
stringifyUserRole
=
(
role
:
User_Role
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment