diff --git a/app/actions/definitions/users.tsx b/app/actions/definitions/users.tsx index 2d78562ef4..ffa1becdea 100644 --- a/app/actions/definitions/users.tsx +++ b/app/actions/definitions/users.tsx @@ -45,8 +45,8 @@ export const updateUserRoleActionFactory = (user: User, role: UserRole) => return UserRoleHelper.isRoleHigher(role, user.role) ? can.promote : UserRoleHelper.isRoleLower(role, user.role) - ? can.demote - : false; + ? can.demote + : false; }, perform: ({ t }) => { stores.dialogs.openModal({ diff --git a/app/actions/index.ts b/app/actions/index.ts index a7076bb410..bf0797bd3a 100644 --- a/app/actions/index.ts +++ b/app/actions/index.ts @@ -27,8 +27,8 @@ export function createAction(definition: Optional): Action { context: context.isButton ? "button" : context.isCommandBar - ? "commandbar" - : "contextmenu", + ? "commandbar" + : "contextmenu", }); } @@ -99,7 +99,7 @@ export function actionToKBar( const sectionPriority = typeof action.section !== "string" && "priority" in action.section - ? (action.section.priority as number) ?? 0 + ? ((action.section.priority as number) ?? 0) : 0; return [ diff --git a/app/components/Badge.ts b/app/components/Badge.ts index 809cb7b593..7b937b543a 100644 --- a/app/components/Badge.ts +++ b/app/components/Badge.ts @@ -10,8 +10,8 @@ const Badge = styled.span<{ yellow?: boolean; primary?: boolean }>` primary ? theme.accentText : yellow - ? theme.almostBlack - : theme.textTertiary}; + ? theme.almostBlack + : theme.textTertiary}; border: 1px solid ${({ primary, yellow, theme }) => primary || yellow diff --git a/app/components/Button.tsx b/app/components/Button.tsx index c3e320f470..b17fe20697 100644 --- a/app/components/Button.tsx +++ b/app/components/Button.tsx @@ -176,7 +176,7 @@ const Button = ( ...rest } = props; const hasText = !!children || value !== undefined; - const ic = hideIcon ? undefined : action?.icon ?? icon; + const ic = hideIcon ? undefined : (action?.icon ?? icon); const hasIcon = ic !== undefined; return ( diff --git a/app/components/Collaborators.tsx b/app/components/Collaborators.tsx index 3e1323e8ca..599bd7177b 100644 --- a/app/components/Collaborators.tsx +++ b/app/components/Collaborators.tsx @@ -116,11 +116,11 @@ function Collaborators(props: Props) { // Memoize onClick handler to avoid inline function creation const handleAvatarClick = useCallback( ( - collaboratorId: string, - isPresent: boolean, - isObserving: boolean, - isObservable: boolean - ) => + collaboratorId: string, + isPresent: boolean, + isObserving: boolean, + isObservable: boolean + ) => (ev: React.MouseEvent) => { if (isObservable && isPresent) { ev.preventDefault(); diff --git a/app/components/Collection/CollectionForm.tsx b/app/components/Collection/CollectionForm.tsx index 0c6936ea19..17c029a56f 100644 --- a/app/components/Collection/CollectionForm.tsx +++ b/app/components/Collection/CollectionForm.tsx @@ -224,8 +224,8 @@ export const CollectionForm = observer(function CollectionForm_({ ? `${t("Saving")}…` : t("Save") : formState.isSubmitting - ? `${t("Creating")}…` - : t("Create")} + ? `${t("Creating")}…` + : t("Create")} diff --git a/app/components/ConfirmationDialog.tsx b/app/components/ConfirmationDialog.tsx index 7475dfbf58..6dc927d312 100644 --- a/app/components/ConfirmationDialog.tsx +++ b/app/components/ConfirmationDialog.tsx @@ -64,7 +64,7 @@ const ConfirmationDialog: React.FC = ({ danger={danger} autoFocus > - {isSaving && savingText ? savingText : submitText ?? t("Confirm")} + {isSaving && savingText ? savingText : (submitText ?? t("Confirm"))} diff --git a/app/components/DocumentBreadcrumb.tsx b/app/components/DocumentBreadcrumb.tsx index 5b1da8b897..c2f851affc 100644 --- a/app/components/DocumentBreadcrumb.tsx +++ b/app/components/DocumentBreadcrumb.tsx @@ -138,8 +138,8 @@ function DocumentBreadcrumb( ? output.slice(-depth) : output : depth !== undefined - ? output.slice(0, depth) - : output; + ? output.slice(0, depth) + : output; }, [t, path, category, sidebarContext, collectionNode, reverse, depth]); if (!collections.isLoaded) { diff --git a/app/components/DocumentListItem.tsx b/app/components/DocumentListItem.tsx index de93804b7c..19bcadb7d7 100644 --- a/app/components/DocumentListItem.tsx +++ b/app/components/DocumentListItem.tsx @@ -177,7 +177,9 @@ const Actions = styled(EventBoundary)` color: ${s("textSecondary")}; ${NudeButton} { - &: ${hover}, &[aria-expanded= "true"] { + &: + ${hover}, + &[aria-expanded= "true"] { background: ${s("sidebarControlHoverBackground")}; } } diff --git a/app/components/Guide.tsx b/app/components/Guide.tsx index 439dbab581..bbc55b51b0 100644 --- a/app/components/Guide.tsx +++ b/app/components/Guide.tsx @@ -98,7 +98,9 @@ const Scene = styled.div` outline: none; opacity: 0; transform: translateX(16px); - transition: transform 250ms ease, opacity 250ms ease; + transition: + transform 250ms ease, + opacity 250ms ease; &[data-enter] { opacity: 1; diff --git a/app/components/HoverPreview/Components.tsx b/app/components/HoverPreview/Components.tsx index de57687381..6cc6d7b3a2 100644 --- a/app/components/HoverPreview/Components.tsx +++ b/app/components/HoverPreview/Components.tsx @@ -20,7 +20,8 @@ export const Preview = styled(Link)` cursor: ${(props: { as?: string }) => props.as === "div" ? "default" : "var(--pointer)"}; border-radius: 4px; - box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.3), + box-shadow: + 0 30px 90px -20px rgba(0, 0, 0, 0.3), 0 0 1px 1px rgba(0, 0, 0, 0.05); overflow: hidden; position: absolute; diff --git a/app/components/IconPicker/components/GridTemplate.tsx b/app/components/IconPicker/components/GridTemplate.tsx index e571c5eba1..fa093049b6 100644 --- a/app/components/IconPicker/components/GridTemplate.tsx +++ b/app/components/IconPicker/components/GridTemplate.tsx @@ -115,7 +115,9 @@ const CategoryName = styled(Text)` `; const Icon = styled.svg` - transition: color 150ms ease-in-out, fill 150ms ease-in-out; + transition: + color 150ms ease-in-out, + fill 150ms ease-in-out; transition-delay: var(--delay); `; diff --git a/app/components/IconPicker/components/PopoverButton.tsx b/app/components/IconPicker/components/PopoverButton.tsx index b67c8e7157..1171822ff7 100644 --- a/app/components/IconPicker/components/PopoverButton.tsx +++ b/app/components/IconPicker/components/PopoverButton.tsx @@ -12,7 +12,8 @@ export const PopoverButton = styled(NudeButton)<{ $borderOnHover?: boolean }>` $borderOnHover && css` background: ${s("buttonNeutralBackground")}; - box-shadow: rgba(0, 0, 0, 0.07) 0px 1px 2px, + box-shadow: + rgba(0, 0, 0, 0.07) 0px 1px 2px, ${s("buttonNeutralBorder")} 0 0 0 1px inset; `}; } diff --git a/app/components/Input.tsx b/app/components/Input.tsx index df9d334164..68b698137c 100644 --- a/app/components/Input.tsx +++ b/app/components/Input.tsx @@ -107,8 +107,8 @@ export const Outline = styled(Flex)<{ props.hasError ? props.theme.danger : props.focused - ? props.theme.inputBorderFocused - : props.theme.inputBorder}; + ? props.theme.inputBorderFocused + : props.theme.inputBorder}; border-radius: 4px; font-weight: normal; align-items: center; diff --git a/app/components/OAuthClient/OAuthClientForm.tsx b/app/components/OAuthClient/OAuthClientForm.tsx index ee8e271adb..5b861ff57d 100644 --- a/app/components/OAuthClient/OAuthClientForm.tsx +++ b/app/components/OAuthClient/OAuthClientForm.tsx @@ -140,8 +140,8 @@ export const OAuthClientForm = observer(function OAuthClientForm_({ ? `${t("Saving")}…` : t("Save") : formState.isSubmitting - ? `${t("Creating")}…` - : t("Create")} + ? `${t("Creating")}…` + : t("Create")} diff --git a/app/components/PaginatedList.tsx b/app/components/PaginatedList.tsx index 29bbcdc6a0..21906bb4de 100644 --- a/app/components/PaginatedList.tsx +++ b/app/components/PaginatedList.tsx @@ -278,8 +278,8 @@ const PaginatedList = ({ "updatedAt" in item && item.updatedAt ? item.updatedAt : "createdAt" in item && item.createdAt - ? item.createdAt - : previousHeading; + ? item.createdAt + : previousHeading; const currentHeading = dateToHeading( currentDate, t, diff --git a/app/components/PinnedDocuments.tsx b/app/components/PinnedDocuments.tsx index 93294c3bb6..1b1e62d307 100644 --- a/app/components/PinnedDocuments.tsx +++ b/app/components/PinnedDocuments.tsx @@ -86,8 +86,8 @@ function PinnedDocuments({ overPos === 0 ? fractionalIndex(null, overIndex) : activePos > overPos - ? fractionalIndex(prevIndex, overIndex) - : fractionalIndex(overIndex, nextIndex), + ? fractionalIndex(prevIndex, overIndex) + : fractionalIndex(overIndex, nextIndex), }) .catch(() => setItems(existing)); diff --git a/app/components/Sharing/Document/PublicAccess.tsx b/app/components/Sharing/Document/PublicAccess.tsx index ae3ecc149f..97452d366e 100644 --- a/app/components/Sharing/Document/PublicAccess.tsx +++ b/app/components/Sharing/Document/PublicAccess.tsx @@ -129,7 +129,7 @@ function PublicAccess({ document, share, sharedParent }: Props) { const shareUrl = sharedParent?.url ? `${sharedParent.url}${document.url}` - : share?.url ?? ""; + : (share?.url ?? ""); const copyButton = ( diff --git a/app/components/Sharing/components/Suggestions.tsx b/app/components/Sharing/components/Suggestions.tsx index 3029777529..e252a2bca4 100644 --- a/app/components/Sharing/components/Suggestions.tsx +++ b/app/components/Sharing/components/Suggestions.tsx @@ -97,8 +97,8 @@ export const Suggestions = observer( .notInDocument(document.id, query) .filter((u) => u.id !== user.id) : collection - ? users.notInCollection(collection.id, query) - : users.activeOrInvited + ? users.notInCollection(collection.id, query) + : users.activeOrInvited ).filter((u) => !u.isSuspended); if (isEmail(query)) { @@ -109,8 +109,8 @@ export const Suggestions = observer( ...(document ? groups.notInDocument(document.id, query) : collection - ? groups.notInCollection(collection.id, query) - : []), + ? groups.notInCollection(collection.id, query) + : []), ...filtered, ]; }, [ @@ -133,7 +133,7 @@ export const Suggestions = observer( .map((id) => isEmail(id) ? getSuggestionForEmail(id) - : users.get(id) ?? groups.get(id) + : (users.get(id) ?? groups.get(id)) ) .filter(Boolean) as User[], [users, groups, getSuggestionForEmail, pendingIds] @@ -158,8 +158,8 @@ export const Suggestions = observer( subtitle: suggestion.email ? suggestion.email : suggestion.isViewer - ? t("Viewer") - : t("Editor"), + ? t("Viewer") + : t("Editor"), image: , }; } diff --git a/app/components/Sidebar/Shared.tsx b/app/components/Sidebar/Shared.tsx index 1513dfe644..2a17187ab3 100644 --- a/app/components/Sidebar/Shared.tsx +++ b/app/components/Sidebar/Shared.tsx @@ -121,7 +121,9 @@ const ToggleWrapper = styled.div` right: 0; opacity: 0; transform: translateX(10px); - transition: opacity 100ms ease-out, transform 100ms ease-out; + transition: + opacity 100ms ease-out, + transform 100ms ease-out; `; const StyledSidebar = styled(Sidebar)<{ $hoverTransition: boolean }>` diff --git a/app/components/Sidebar/Sidebar.tsx b/app/components/Sidebar/Sidebar.tsx index f2fcf87a35..065b55997a 100644 --- a/app/components/Sidebar/Sidebar.tsx +++ b/app/components/Sidebar/Sidebar.tsx @@ -294,8 +294,8 @@ const hoverStyles = (props: ContainerProps) => ` props.$collapsed ? "rgba(0, 0, 0, 0.2) 1px 0 4px" : props.$isSmallerThanMinimum - ? "rgba(0, 0, 0, 0.1) inset -1px 0 2px" - : "none" + ? "rgba(0, 0, 0, 0.1) inset -1px 0 2px" + : "none" }; ${ToggleButton} { @@ -309,7 +309,9 @@ const Container = styled(Flex)` bottom: 0; width: 100%; background: ${s("sidebarBackground")}; - transition: box-shadow 150ms ease-in-out, transform 150ms ease-out, + transition: + box-shadow 150ms ease-in-out, + transform 150ms ease-out, ${(props: ContainerProps) => props.$isAnimating ? `,width ${ANIMATION_MS}ms ease-out` : ""}; transform: translateX( diff --git a/app/components/Sidebar/components/Disclosure.tsx b/app/components/Sidebar/components/Disclosure.tsx index 880fded081..1071f801fa 100644 --- a/app/components/Sidebar/components/Disclosure.tsx +++ b/app/components/Sidebar/components/Disclosure.tsx @@ -54,7 +54,10 @@ const Button = styled(NudeButton)<{ $root?: boolean }>` const StyledCollapsedIcon = styled(CollapsedIcon)<{ expanded?: boolean; }>` - transition: opacity 100ms ease, transform 100ms ease, fill 50ms !important; + transition: + opacity 100ms ease, + transform 100ms ease, + fill 50ms !important; ${(props) => !props.expanded && "transform: rotate(-90deg);"}; `; diff --git a/app/components/Sidebar/components/Header.tsx b/app/components/Sidebar/components/Header.tsx index c8ab64666d..ded2c0354c 100644 --- a/app/components/Sidebar/components/Header.tsx +++ b/app/components/Sidebar/components/Header.tsx @@ -91,7 +91,10 @@ const Button = styled.button` `; const Disclosure = styled(CollapsedIcon)<{ expanded?: boolean }>` - transition: opacity 100ms ease, transform 100ms ease, fill 50ms !important; + transition: + opacity 100ms ease, + transform 100ms ease, + fill 50ms !important; ${({ expanded }) => !expanded && "transform: rotate(-90deg);"}; opacity: 0; `; diff --git a/app/components/Sidebar/hooks/useDragAndDrop.tsx b/app/components/Sidebar/hooks/useDragAndDrop.tsx index 58ade6c59c..1170898a14 100644 --- a/app/components/Sidebar/hooks/useDragAndDrop.tsx +++ b/app/components/Sidebar/hooks/useDragAndDrop.tsx @@ -189,7 +189,7 @@ export function useDragDocument( depth, icon: icon ? : undefined, collectionId: document?.collectionId || "", - } as DragObject), + }) as DragObject, canDrag: () => !!document?.isActive && !isEditing, collect: (monitor) => ({ isDragging: monitor.isDragging(), @@ -505,7 +505,7 @@ export function useDragMembership( id, title, icon, - } as DragObject), + }) as DragObject, collect: (monitor) => ({ isDragging: !!monitor.isDragging(), }), diff --git a/app/components/Star.tsx b/app/components/Star.tsx index 1601ac49a8..a8ab7b8ef0 100644 --- a/app/components/Star.tsx +++ b/app/components/Star.tsx @@ -52,10 +52,10 @@ function Star({ size, document, collection, color, ...rest }: Props) { ? unstarCollection : starCollection : document - ? document.isStarred - ? unstarDocument - : starDocument - : undefined + ? document.isStarred + ? unstarDocument + : starDocument + : undefined } size={size} {...rest} diff --git a/app/components/withStores.tsx b/app/components/withStores.tsx index 1a685fa39c..7548549c6e 100644 --- a/app/components/withStores.tsx +++ b/app/components/withStores.tsx @@ -10,7 +10,7 @@ function withStores< ResolvedProps = JSX.LibraryManagedAttributes< P, Omit, StoreProps> - > + >, >(WrappedComponent: P): React.FC { const ComponentWithStore = (props: ResolvedProps) => { const stores = useStores(); diff --git a/app/editor/components/FloatingToolbar.tsx b/app/editor/components/FloatingToolbar.tsx index be304adc86..cfcbe77d46 100644 --- a/app/editor/components/FloatingToolbar.tsx +++ b/app/editor/components/FloatingToolbar.tsx @@ -87,8 +87,8 @@ function usePosition({ const position = codeBlock ? codeBlock.pos : noticeBlock - ? noticeBlock.pos - : null; + ? noticeBlock.pos + : null; if (position !== null) { const element = view.nodeDOM(position); @@ -345,7 +345,8 @@ const Wrapper = styled.div` box-shadow: ${s("menuShadow")}; border-radius: 4px; transform: scale(0.95); - transition: opacity 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275), + transition: + opacity 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275); transition-delay: 150ms; line-height: 0; diff --git a/app/editor/components/MentionMenu.tsx b/app/editor/components/MentionMenu.tsx index 481db5b4a8..f20a597b1b 100644 --- a/app/editor/components/MentionMenu.tsx +++ b/app/editor/components/MentionMenu.tsx @@ -98,7 +98,7 @@ function MentionMenu({ search, isActive, ...rest }: Props) { actorId, label: user.name, }, - } as MentionItem) + }) as MentionItem ) .concat( documents @@ -130,7 +130,7 @@ function MentionMenu({ search, isActive, ...rest }: Props) { actorId, label: doc.title, }, - } as MentionItem) + }) as MentionItem ) ) .concat( @@ -158,7 +158,7 @@ function MentionMenu({ search, isActive, ...rest }: Props) { actorId, label: collection.name, }, - } as MentionItem) + }) as MentionItem ) ) .concat([ diff --git a/app/editor/components/SuggestionsMenu.tsx b/app/editor/components/SuggestionsMenu.tsx index 386af1b14f..966d451c77 100644 --- a/app/editor/components/SuggestionsMenu.tsx +++ b/app/editor/components/SuggestionsMenu.tsx @@ -470,7 +470,7 @@ function SuggestionsMenu(props: Props) { item, section: "section" in item && item.section && "priority" in item.section - ? (item.section.priority as number) ?? 0 + ? ((item.section.priority as number) ?? 0) : 0, priority: "priority" in item ? item.priority : 0, score: @@ -596,8 +596,8 @@ function SuggestionsMenu(props: Props) { "placeholder" in insertItem ? insertItem.placeholder : insertItem.title - ? dictionary.pasteLinkWithTitle(insertItem.title) - : dictionary.pasteLink + ? dictionary.pasteLinkWithTitle(insertItem.title) + : dictionary.pasteLink } onKeyDown={handleLinkInputKeydown} onPaste={handleLinkInputPaste} @@ -740,11 +740,14 @@ export const Wrapper = styled(Scrollable)<{ left: ${(props) => props.left}px; background: ${s("menuBackground")}; border-radius: 6px; - box-shadow: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, - rgba(0, 0, 0, 0.08) 0px 4px 8px, rgba(0, 0, 0, 0.08) 0px 2px 4px; + box-shadow: + rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, + rgba(0, 0, 0, 0.08) 0px 4px 8px, + rgba(0, 0, 0, 0.08) 0px 2px 4px; opacity: 0; transform: scale(0.95); - transition: opacity 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275), + transition: + opacity 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275); transition-delay: 150ms; line-height: 0; diff --git a/app/hooks/useBuildTheme.ts b/app/hooks/useBuildTheme.ts index 0e35f151f4..45ac11a5d4 100644 --- a/app/hooks/useBuildTheme.ts +++ b/app/hooks/useBuildTheme.ts @@ -32,12 +32,12 @@ export default function useBuildTheme( isPrinting ? buildLightTheme(customTheme) : isMobile - ? resolvedTheme === "dark" - ? buildPitchBlackTheme(customTheme) - : buildLightTheme(customTheme) - : resolvedTheme === "dark" - ? buildDarkTheme(customTheme) - : buildLightTheme(customTheme), + ? resolvedTheme === "dark" + ? buildPitchBlackTheme(customTheme) + : buildLightTheme(customTheme) + : resolvedTheme === "dark" + ? buildDarkTheme(customTheme) + : buildLightTheme(customTheme), [customTheme, isMobile, isPrinting, resolvedTheme] ); diff --git a/app/hooks/useKeyDown.ts b/app/hooks/useKeyDown.ts index 2f885fe93f..9a6ef7059a 100644 --- a/app/hooks/useKeyDown.ts +++ b/app/hooks/useKeyDown.ts @@ -28,10 +28,10 @@ const createKeyPredicate = (keyFilter: KeyFilter) => typeof keyFilter === "function" ? keyFilter : typeof keyFilter === "string" - ? (event: KeyboardEvent) => event.key === keyFilter - : keyFilter - ? (_event: KeyboardEvent) => true - : (_event: KeyboardEvent) => false; + ? (event: KeyboardEvent) => event.key === keyFilter + : keyFilter + ? (_event: KeyboardEvent) => true + : (_event: KeyboardEvent) => false; export default function useKeyDown( key: KeyFilter, diff --git a/app/hooks/usePinnedDocuments.ts b/app/hooks/usePinnedDocuments.ts index 3e129d5397..ed1d5b3c2a 100644 --- a/app/hooks/usePinnedDocuments.ts +++ b/app/hooks/usePinnedDocuments.ts @@ -17,8 +17,8 @@ export function usePinnedDocuments(urlId: UrlId, collectionId?: string) { return urlId === "home" ? pins.home : collectionId - ? pins.inCollection(collectionId) - : []; + ? pins.inCollection(collectionId) + : []; } useEffect(() => { diff --git a/app/scenes/ApiKeyNew/components/ExpiryDatePicker.tsx b/app/scenes/ApiKeyNew/components/ExpiryDatePicker.tsx index 242c6e33e7..55650fa5e0 100644 --- a/app/scenes/ApiKeyNew/components/ExpiryDatePicker.tsx +++ b/app/scenes/ApiKeyNew/components/ExpiryDatePicker.tsx @@ -35,7 +35,7 @@ const ExpiryDatePicker = ({ selectedDate, onSelect }: Props) => { "--rdp-accent-color-dark": theme.accent, "--rdp-background-color": theme.listItemHoverBackground, "--rdp-background-color-dark": theme.listItemHoverBackground, - } as React.CSSProperties), + }) as React.CSSProperties, [theme] ); diff --git a/app/scenes/Document/Shared.tsx b/app/scenes/Document/Shared.tsx index 11bfbbdf4b..ade85c0ee9 100644 --- a/app/scenes/Document/Shared.tsx +++ b/app/scenes/Document/Shared.tsx @@ -231,7 +231,7 @@ const SharedDocument = observer( } const tocPosition = hasHeadings - ? response.team?.tocPosition ?? TOCPosition.Left + ? (response.team?.tocPosition ?? TOCPosition.Left) : false; setDocument(response.document); diff --git a/app/scenes/Document/components/CommentThreadItem.tsx b/app/scenes/Document/components/CommentThreadItem.tsx index 6b6968d152..4456a3dd4e 100644 --- a/app/scenes/Document/components/CommentThreadItem.tsx +++ b/app/scenes/Document/components/CommentThreadItem.tsx @@ -353,7 +353,9 @@ const Action = styled.span<{ $rounded?: boolean }>` opacity: 0.5; } - &: ${hover}, &[aria-expanded= "true"] { + &: + ${hover}, + &[aria-expanded= "true"] { background: ${s("backgroundQuaternary")}; svg { @@ -406,7 +408,9 @@ export const Bubble = styled(Flex)<{ min-width: 2em; margin-bottom: 1px; padding: 8px 12px; - transition: color 100ms ease-out, background 100ms ease-out; + transition: + color 100ms ease-out, + background 100ms ease-out; ${({ $lastOfThread, $canReply }) => $lastOfThread && diff --git a/app/scenes/Document/components/Comments.tsx b/app/scenes/Document/components/Comments.tsx index f17dfa66c5..079ccc0c19 100644 --- a/app/scenes/Document/components/Comments.tsx +++ b/app/scenes/Document/components/Comments.tsx @@ -64,8 +64,8 @@ function Comments() { const threads = !document ? [] : viewingResolved - ? comments.resolvedThreadsInDocument(document.id, sortOption) - : comments.unresolvedThreadsInDocument(document.id, sortOption); + ? comments.resolvedThreadsInDocument(document.id, sortOption) + : comments.unresolvedThreadsInDocument(document.id, sortOption); const hasComments = threads.length > 0; const scrollToBottom = () => { diff --git a/app/scenes/Document/components/Header.tsx b/app/scenes/Document/components/Header.tsx index 8e030a1ccf..9d156d0781 100644 --- a/app/scenes/Document/components/Header.tsx +++ b/app/scenes/Document/components/Header.tsx @@ -136,8 +136,8 @@ function DocumentHeader({ showContents ? t("Hide contents") : hasHeadings - ? t("Show contents") - : `${t("Show contents")} (${t("available when headings are added")})` + ? t("Show contents") + : `${t("Show contents")} (${t("available when headings are added")})` } shortcut={`Ctrl+${altDisplay}+h`} placement="bottom" diff --git a/app/scenes/Document/components/Insights.tsx b/app/scenes/Document/components/Insights.tsx index f60a4a8fe1..7f135f2939 100644 --- a/app/scenes/Document/components/Insights.tsx +++ b/app/scenes/Document/components/Insights.tsx @@ -157,8 +157,8 @@ function Insights() { ? t("Imported") : t("Creator") : model.id === document.updatedBy?.id - ? t("Last edited") - : t("Previously edited") + ? t("Last edited") + : t("Previously edited") } border={false} small diff --git a/app/scenes/Search/Search.tsx b/app/scenes/Search/Search.tsx index 36b5699d3a..3d8f2ff32f 100644 --- a/app/scenes/Search/Search.tsx +++ b/app/scenes/Search/Search.tsx @@ -222,8 +222,8 @@ function Search() { documentId ? t("Search in document") : collectionId - ? t("Search in collection") - : t("Search") + ? t("Search in collection") + : t("Search") }…`} onKeyDown={handleKeyDown} defaultValue={query ?? ""} diff --git a/app/scenes/Settings/Preferences.tsx b/app/scenes/Settings/Preferences.tsx index c456f000f1..bb13431cc5 100644 --- a/app/scenes/Settings/Preferences.tsx +++ b/app/scenes/Settings/Preferences.tsx @@ -34,7 +34,7 @@ function Preferences() { type: "item", label: lang.label, value: lang.value, - } satisfies Option) + }) satisfies Option ), [] ); diff --git a/app/scenes/Settings/components/IntegrationCard.tsx b/app/scenes/Settings/components/IntegrationCard.tsx index bdb5125ead..4ba0efc606 100644 --- a/app/scenes/Settings/components/IntegrationCard.tsx +++ b/app/scenes/Settings/components/IntegrationCard.tsx @@ -49,7 +49,9 @@ const Card = styled.div` cursor: var(--pointer); &:hover { - box-shadow: rgba(0, 0, 0, 0.08) 0px 2px 4px, rgba(0, 0, 0, 0.06) 0px 4px 8px; + box-shadow: + rgba(0, 0, 0, 0.08) 0px 2px 4px, + rgba(0, 0, 0, 0.06) 0px 4px 8px; } `; diff --git a/app/stores/GroupMembershipsStore.ts b/app/stores/GroupMembershipsStore.ts index c9ccf2eae2..88356cdd4d 100644 --- a/app/stores/GroupMembershipsStore.ts +++ b/app/stores/GroupMembershipsStore.ts @@ -23,12 +23,11 @@ export default class GroupMembershipsStore extends Store { collectionId, documentId, ...params - }: - | PaginationParams & { - documentId?: string; - collectionId?: string; - groupId?: string; - }): Promise> => { + }: PaginationParams & { + documentId?: string; + collectionId?: string; + groupId?: string; + }): Promise> => { this.isFetching = true; try { @@ -38,11 +37,11 @@ export default class GroupMembershipsStore extends Store { ...params, }) : documentId - ? await client.post(`/documents.group_memberships`, { - id: documentId, - ...params, - }) - : await client.post(`/groupMemberships.list`, params); + ? await client.post(`/documents.group_memberships`, { + id: documentId, + ...params, + }) + : await client.post(`/groupMemberships.list`, params); invariant(res?.data, "Data not available"); let response: PaginatedResponse = []; diff --git a/app/utils/FeatureFlags.ts b/app/utils/FeatureFlags.ts index 18ce3741ff..9adda1427d 100644 --- a/app/utils/FeatureFlags.ts +++ b/app/utils/FeatureFlags.ts @@ -28,7 +28,7 @@ export class FeatureFlags { this.initalized = true; } - return this.cache.has(flag) ? true : FeatureDefaults[flag] ?? false; + return this.cache.has(flag) ? true : (FeatureDefaults[flag] ?? false); } public static enable(flag: Feature) { diff --git a/app/utils/mention.ts b/app/utils/mention.ts index 5bf62c460a..40de276766 100644 --- a/app/utils/mention.ts +++ b/app/utils/mention.ts @@ -58,8 +58,8 @@ export const determineMentionType = ({ return type === "pull" ? MentionType.PullRequest : type === "issues" - ? MentionType.Issue - : undefined; + ? MentionType.Issue + : undefined; } case IntegrationService.Linear: { diff --git a/package.json b/package.json index 74ac7d16d5..96ab8d1d80 100644 --- a/package.json +++ b/package.json @@ -354,7 +354,7 @@ "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-lodash": "^7.4.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.5.1", "eslint-plugin-react": "^7.37.3", "eslint-plugin-react-hooks": "^4.6.2", "husky": "^8.0.3", @@ -365,7 +365,7 @@ "lint-staged": "^13.3.0", "nodemon": "^3.1.10", "postinstall-postinstall": "^2.1.0", - "prettier": "^2.8.8", + "prettier": "^3.6.2", "react-refresh": "^0.17.0", "rimraf": "^2.5.4", "rollup-plugin-webpack-stats": "^2.0.5", diff --git a/plugins/github/server/api/github.ts b/plugins/github/server/api/github.ts index b961df3132..96faa2d67d 100644 --- a/plugins/github/server/api/github.ts +++ b/plugins/github/server/api/github.ts @@ -80,9 +80,8 @@ router.get( id: installationId!, account: { id: installation.account?.id, - name: - // @ts-expect-error Property 'login' does not exist on type - installation.account?.login, + // @ts-expect-error Property 'login' does not exist on type + name: installation.account?.login, avatarUrl: installation.account?.avatar_url, }, }, diff --git a/plugins/oidc/server/auth/oidcRouter.ts b/plugins/oidc/server/auth/oidcRouter.ts index 568cbb0898..db1e19c309 100644 --- a/plugins/oidc/server/auth/oidcRouter.ts +++ b/plugins/oidc/server/auth/oidcRouter.ts @@ -123,7 +123,7 @@ export function createOIDCRouter( // Only a single OIDC provider is supported – find the existing, if any. const authenticationProvider = team - ? (await AuthenticationProvider.findOne({ + ? ((await AuthenticationProvider.findOne({ where: { name: "oidc", teamId: team.id, @@ -135,7 +135,7 @@ export function createOIDCRouter( name: "oidc", teamId: team.id, }, - })) + }))) : undefined; // Derive a providerId from the OIDC location if there is no existing provider. diff --git a/plugins/slack/server/api/hooks.ts b/plugins/slack/server/api/hooks.ts index f280673265..88c59aeafb 100644 --- a/plugins/slack/server/api/hooks.ts +++ b/plugins/slack/server/api/hooks.ts @@ -164,9 +164,8 @@ router.post( verifySlackToken(token); // we find the document based on the users teamId to ensure access - const document = await Document.scope("withCollection").findByPk( - callback_id - ); + const document = + await Document.scope("withCollection").findByPk(callback_id); if (!document) { throw InvalidRequestError("Invalid callback_id"); diff --git a/plugins/webhooks/client/components/WebhookSubscriptionForm.tsx b/plugins/webhooks/client/components/WebhookSubscriptionForm.tsx index 7a5912a83b..36ef84ed5f 100644 --- a/plugins/webhooks/client/components/WebhookSubscriptionForm.tsx +++ b/plugins/webhooks/client/components/WebhookSubscriptionForm.tsx @@ -218,8 +218,8 @@ function WebhookSubscriptionForm({ handleSubmit, webhookSubscription }: Props) { value === "*" ? AllEventCheckboxLabel : Object.keys(WEBHOOK_EVENTS).includes(value) - ? GroupEventCheckboxLabel - : EventCheckboxLabel; + ? GroupEventCheckboxLabel + : EventCheckboxLabel; return ( diff --git a/server/commands/documentCreator.ts b/server/commands/documentCreator.ts index ce577ff3ed..d3e2cdea93 100644 --- a/server/commands/documentCreator.ts +++ b/server/commands/documentCreator.ts @@ -95,13 +95,13 @@ export default async function documentCreator({ const contentWithReplacements = text ? ProsemirrorHelper.toProsemirror(text).toJSON() : templateDocument - ? template - ? templateDocument.content - : SharedProsemirrorHelper.replaceTemplateVariables( - await DocumentHelper.toJSON(templateDocument), - user - ) - : content; + ? template + ? templateDocument.content + : SharedProsemirrorHelper.replaceTemplateVariables( + await DocumentHelper.toJSON(templateDocument), + user + ) + : content; const document = Document.build({ id, diff --git a/server/commands/userInviter.ts b/server/commands/userInviter.ts index b192549402..879eb11c74 100644 --- a/server/commands/userInviter.ts +++ b/server/commands/userInviter.ts @@ -64,8 +64,8 @@ export default async function userInviter({ user.isAdmin && invite.role === UserRole.Admin ? UserRole.Admin : user.isViewer || invite.role === UserRole.Viewer - ? UserRole.Viewer - : UserRole.Member, + ? UserRole.Viewer + : UserRole.Member, invitedById: user.id, flags: { [UserFlag.InviteSent]: 1, diff --git a/server/emails/templates/BaseEmail.tsx b/server/emails/templates/BaseEmail.tsx index 7021ef0fc2..583259bdb6 100644 --- a/server/emails/templates/BaseEmail.tsx +++ b/server/emails/templates/BaseEmail.tsx @@ -35,7 +35,7 @@ export interface EmailProps { export default abstract class BaseEmail< T extends EmailProps, - S extends Record | void = void + S extends Record | void = void, > { private props: T; private metadata?: NotificationMetadata; diff --git a/server/emails/templates/CollectionSharedEmail.tsx b/server/emails/templates/CollectionSharedEmail.tsx index 4939bbc128..f2376d13a8 100644 --- a/server/emails/templates/CollectionSharedEmail.tsx +++ b/server/emails/templates/CollectionSharedEmail.tsx @@ -80,8 +80,8 @@ View Document: ${teamUrl}${collection.path} membership.permission === CollectionPermission.ReadWrite ? "view and edit" : membership.permission === CollectionPermission.Admin - ? "manage" - : "view"; + ? "manage" + : "view"; return ( any, P extends Parameters, - R extends ReturnType + R extends ReturnType, >( target: F ): F => diff --git a/server/middlewares/passport.ts b/server/middlewares/passport.ts index 465ae33eb2..ee01c0c7cd 100644 --- a/server/middlewares/passport.ts +++ b/server/middlewares/passport.ts @@ -44,7 +44,7 @@ export default function createMiddleware(providerName: string) { const requestHost = err instanceof OAuthStateMismatchError ? ctx.hostname - : state?.host ?? ctx.hostname; + : (state?.host ?? ctx.hostname); const url = new URL( env.isCloudHosted ? `${reqProtocol}://${requestHost}${redirectPath}` diff --git a/server/models/Collection.ts b/server/models/Collection.ts index b4e30237c3..13915d9470 100644 --- a/server/models/Collection.ts +++ b/server/models/Collection.ts @@ -894,8 +894,8 @@ class Collection extends ParanoidModel< index !== undefined ? index : options.insertOrder === "prepend" - ? 0 - : childDocument.children.length; + ? 0 + : childDocument.children.length; childDocument.children.splice(childInsertionIndex, 0, documentJson); } else { childDocument.children = placeDocument(childDocument.children); diff --git a/server/models/ImportTask.ts b/server/models/ImportTask.ts index 4b72d6107c..cf3deeb2a5 100644 --- a/server/models/ImportTask.ts +++ b/server/models/ImportTask.ts @@ -24,7 +24,7 @@ export type ImportTaskAttributes = InferAttributes> & NonInferredAttributes; export type ImportTaskCreationAttributes< - T extends ImportableIntegrationService + T extends ImportableIntegrationService, > = Partial>> & Partial>; diff --git a/server/models/base/ArchivableModel.ts b/server/models/base/ArchivableModel.ts index 2b043c4558..6018a95e00 100644 --- a/server/models/base/ArchivableModel.ts +++ b/server/models/base/ArchivableModel.ts @@ -3,7 +3,7 @@ import ParanoidModel from "./ParanoidModel"; class ArchivableModel< TModelAttributes extends object = any, - TCreationAttributes extends object = TModelAttributes + TCreationAttributes extends object = TModelAttributes, > extends ParanoidModel { /** Whether the document is archived, and if so when. */ @AllowNull diff --git a/server/models/base/IdModel.ts b/server/models/base/IdModel.ts index 6d71963048..2d8e5375bf 100644 --- a/server/models/base/IdModel.ts +++ b/server/models/base/IdModel.ts @@ -11,7 +11,7 @@ import Model from "./Model"; class IdModel< TModelAttributes extends object = any, - TCreationAttributes extends object = TModelAttributes + TCreationAttributes extends object = TModelAttributes, > extends Model { @IsUUID(4) @PrimaryKey diff --git a/server/models/base/Model.ts b/server/models/base/Model.ts index 8c13d0107e..1b12f93d82 100644 --- a/server/models/base/Model.ts +++ b/server/models/base/Model.ts @@ -47,7 +47,7 @@ export type HookContext = APIContext["context"] & { event?: EventOptions }; class Model< TModelAttributes extends object = any, - TCreationAttributes extends object = TModelAttributes + TCreationAttributes extends object = TModelAttributes, > extends SequelizeModel { /** * The namespace to use for events - defaults to the table name if none is provided. @@ -245,26 +245,26 @@ class Model< "collectionId" in model ? model.collectionId : model instanceof models.collection - ? model.id - : undefined, + ? model.id + : undefined, documentId: "documentId" in model ? model.documentId : model instanceof models.document - ? model.id - : undefined, + ? model.id + : undefined, userId: "userId" in model ? model.userId : model instanceof models.user - ? model.id - : undefined, + ? model.id + : undefined, teamId: "teamId" in model ? model.teamId : model instanceof models.team - ? model.id - : context.auth?.user.teamId, + ? model.id + : context.auth?.user.teamId, actorId: context.auth?.user?.id, authType: context.auth?.type, ip: context.ip, diff --git a/server/models/base/ParanoidModel.ts b/server/models/base/ParanoidModel.ts index 38270df16f..0f84e23779 100644 --- a/server/models/base/ParanoidModel.ts +++ b/server/models/base/ParanoidModel.ts @@ -3,7 +3,7 @@ import IdModel from "./IdModel"; class ParanoidModel< TModelAttributes extends object = any, - TCreationAttributes extends object = TModelAttributes + TCreationAttributes extends object = TModelAttributes, > extends IdModel { @DeletedAt deletedAt: Date | null; diff --git a/server/models/decorators/CounterCache.ts b/server/models/decorators/CounterCache.ts index 44de893c0b..c7d3b4371b 100644 --- a/server/models/decorators/CounterCache.ts +++ b/server/models/decorators/CounterCache.ts @@ -19,7 +19,7 @@ type RelationOptions = { export function CounterCache< TCreationAttributes extends InferAttributes, TModelAttributes extends InferAttributes, - T extends typeof Model + T extends typeof Model, >( classResolver: ModelClassGetter, options: RelationOptions diff --git a/server/queues/processors/ImportsProcessor.ts b/server/queues/processors/ImportsProcessor.ts index 416c6a0d4b..3a14c0a565 100644 --- a/server/queues/processors/ImportsProcessor.ts +++ b/server/queues/processors/ImportsProcessor.ts @@ -40,7 +40,7 @@ import BaseProcessor from "./BaseProcessor"; export const PagePerImportTask = 3; export default abstract class ImportsProcessor< - T extends ImportableIntegrationService + T extends ImportableIntegrationService, > extends BaseProcessor { static applicableEvents: Event["name"][] = [ "imports.create", @@ -520,8 +520,8 @@ export default abstract class ImportsProcessor< node.type.name === "mention" ? transformMentionNode(node) : node.type.name === "attachment" - ? transformAttachmentNode(node) - : node.copy(transformFragment(node.content)) + ? transformAttachmentNode(node) + : node.copy(transformFragment(node.content)) ); }); diff --git a/server/queues/tasks/APIImportTask.ts b/server/queues/tasks/APIImportTask.ts index 2c96c1c60d..fdaabb054a 100644 --- a/server/queues/tasks/APIImportTask.ts +++ b/server/queues/tasks/APIImportTask.ts @@ -37,7 +37,7 @@ type Props = { }; export default abstract class APIImportTask< - T extends ImportableIntegrationService + T extends ImportableIntegrationService, > extends BaseTask { /** * Run the import task. diff --git a/server/queues/tasks/ImportTask.ts b/server/queues/tasks/ImportTask.ts index 5824e0649c..b1323c3b6f 100644 --- a/server/queues/tasks/ImportTask.ts +++ b/server/queues/tasks/ImportTask.ts @@ -370,7 +370,8 @@ export default abstract class ImportTask extends BaseTask { sort: item.sort, createdById: fileOperation.userId, permission: - item.permission ?? fileOperation.options?.permission !== undefined + (item.permission ?? + fileOperation.options?.permission !== undefined) ? fileOperation.options?.permission : CollectionPermission.ReadWrite, importId: fileOperation.id, diff --git a/server/routes/api/groups/groups.ts b/server/routes/api/groups/groups.ts index 8e40857110..04e812e911 100644 --- a/server/routes/api/groups/groups.ts +++ b/server/routes/api/groups/groups.ts @@ -103,8 +103,8 @@ router.post( const group = id ? await Group.findByPk(id) : externalId - ? await Group.findOne({ where: { externalId } }) - : null; + ? await Group.findOne({ where: { externalId } }) + : null; authorize(user, "read", group); ctx.body = { diff --git a/server/routes/api/installation/installation.ts b/server/routes/api/installation/installation.ts index 195b1ee86a..d3ee382a08 100644 --- a/server/routes/api/installation/installation.ts +++ b/server/routes/api/installation/installation.ts @@ -61,9 +61,8 @@ router.post( router.post("installation.info", auth(), async (ctx: APIContext) => { const currentVersion = getVersion(); - const { latestVersion, versionsBehind } = await getVersionInfo( - currentVersion - ); + const { latestVersion, versionsBehind } = + await getVersionInfo(currentVersion); ctx.body = { data: { diff --git a/server/routes/api/subscriptions/subscriptions.ts b/server/routes/api/subscriptions/subscriptions.ts index 650b57f01f..4ad5d1334f 100644 --- a/server/routes/api/subscriptions/subscriptions.ts +++ b/server/routes/api/subscriptions/subscriptions.ts @@ -224,8 +224,8 @@ router.get( collectionSubscription ? QueryNotices.UnsubscribeCollection : documentSubscription - ? QueryNotices.UnsubscribeDocument - : "" + ? QueryNotices.UnsubscribeDocument + : "" }` ); } diff --git a/server/storage/database.ts b/server/storage/database.ts index ca5ff290f5..b797b1ab81 100644 --- a/server/storage/database.ts +++ b/server/storage/database.ts @@ -130,7 +130,7 @@ export function createMigrationRunner( { cwd?: string | undefined; ignore?: string | string[] | undefined; - } + }, ] ) { return new Umzug({ diff --git a/server/typings/outlinewiki__koa-passport.d.ts b/server/typings/outlinewiki__koa-passport.d.ts index 80eb405ce4..13a7edd7f9 100644 --- a/server/typings/outlinewiki__koa-passport.d.ts +++ b/server/typings/outlinewiki__koa-passport.d.ts @@ -43,7 +43,7 @@ declare module "@outlinewiki/koa-passport" { InitializeRet = IMiddleware, AuthenticateRet = any, AuthorizeRet = AuthenticateRet, - AuthorizeOptions = AuthenticateOptions + AuthorizeOptions = AuthenticateOptions, > { use(strategy: Strategy): this; use(name: string, strategy: Strategy): this; @@ -178,7 +178,7 @@ declare module "@outlinewiki/koa-passport" { interface Framework< InitializeRet = any, AuthenticateRet = any, - AuthorizeRet = AuthenticateRet + AuthorizeRet = AuthenticateRet, > { initialize( passport: Authenticator, diff --git a/server/utils/oauth/OAuthInterface.ts b/server/utils/oauth/OAuthInterface.ts index f4aa7f12e6..487d5286c6 100644 --- a/server/utils/oauth/OAuthInterface.ts +++ b/server/utils/oauth/OAuthInterface.ts @@ -59,9 +59,8 @@ export const OAuthInterface: RefreshTokenModel & }, async getAccessToken(accessToken: string) { - const authentication = await OAuthAuthentication.findByAccessToken( - accessToken - ); + const authentication = + await OAuthAuthentication.findByAccessToken(accessToken); if (!authentication) { return false; } @@ -79,9 +78,8 @@ export const OAuthInterface: RefreshTokenModel & }, async getRefreshToken(refreshToken: string) { - const authentication = await OAuthAuthentication.findByRefreshToken( - refreshToken - ); + const authentication = + await OAuthAuthentication.findByRefreshToken(refreshToken); if (!authentication) { return false; } diff --git a/server/utils/zod.ts b/server/utils/zod.ts index caedca0b51..0a10eeb193 100644 --- a/server/utils/zod.ts +++ b/server/utils/zod.ts @@ -5,7 +5,7 @@ import { UrlHelper } from "@shared/utils/UrlHelper"; export function zodEnumFromObjectKeys< TI extends Record, - R extends string = TI extends Record ? R : never + R extends string = TI extends Record ? R : never, >(input: TI): z.ZodEnum<[R, ...R[]]> { const [firstKey, ...otherKeys] = Object.keys(input) as [R, ...R[]]; return z.enum([firstKey, ...otherKeys]); diff --git a/shared/components/Flex.tsx b/shared/components/Flex.tsx index 5b904e3868..d24a22e25e 100644 --- a/shared/components/Flex.tsx +++ b/shared/components/Flex.tsx @@ -35,8 +35,8 @@ const Flex = styled.div<{ ? "column-reverse" : "row-reverse" : column - ? "column" - : "row"}; + ? "column" + : "row"}; align-items: ${({ align }) => align}; justify-content: ${({ justify }) => justify}; flex-wrap: ${({ wrap }) => (wrap ? "wrap" : "initial")}; diff --git a/shared/components/IssueStatusIcon/LinearIssueStatusIcon.tsx b/shared/components/IssueStatusIcon/LinearIssueStatusIcon.tsx index 0493537c82..4f952ce1c4 100644 --- a/shared/components/IssueStatusIcon/LinearIssueStatusIcon.tsx +++ b/shared/components/IssueStatusIcon/LinearIssueStatusIcon.tsx @@ -21,8 +21,8 @@ export function LinearIssueStatusIcon(props: BaseIconProps) { state.type === StateType.Unstarted ? 0 : state.type === StateType.Started - ? state.completionPercentage ?? 0.5 - : 1; + ? (state.completionPercentage ?? 0.5) + : 1; const isTriage = state.type === StateType.Triage; const isBacklog = state.type === StateType.Backlog; const isCompleted = state.type === StateType.Completed; diff --git a/shared/components/Text.tsx b/shared/components/Text.tsx index 812eeb6a48..a986e60ae8 100644 --- a/shared/components/Text.tsx +++ b/shared/components/Text.tsx @@ -31,22 +31,22 @@ const Text = styled.span` props.type === "secondary" ? props.theme.textSecondary : props.type === "tertiary" - ? props.theme.textTertiary - : props.type === "danger" - ? props.theme.brand.red - : props.theme.text}; + ? props.theme.textTertiary + : props.type === "danger" + ? props.theme.brand.red + : props.theme.text}; font-size: ${(props) => props.size === "xlarge" ? "26px" : props.size === "large" - ? "18px" - : props.size === "medium" - ? "16px" - : props.size === "small" - ? "14px" - : props.size === "xsmall" - ? "13px" - : "inherit"}; + ? "18px" + : props.size === "medium" + ? "16px" + : props.size === "small" + ? "14px" + : props.size === "xsmall" + ? "13px" + : "inherit"}; ${(props) => props.weight && @@ -54,10 +54,10 @@ const Text = styled.span` font-weight: ${props.weight === "xbold" ? 600 : props.weight === "bold" - ? 500 - : props.weight === "normal" - ? 400 - : "inherit"}; + ? 500 + : props.weight === "normal" + ? 400 + : "inherit"}; `} font-style: ${(props) => (props.italic ? "italic" : "normal")}; diff --git a/shared/editor/commands/insertFiles.ts b/shared/editor/commands/insertFiles.ts index a4ef1e8bf7..2021213140 100644 --- a/shared/editor/commands/insertFiles.ts +++ b/shared/editor/commands/insertFiles.ts @@ -68,8 +68,8 @@ const insertFiles = async function ( const getDimensions = isImage ? FileHelper.getImageDimensions : isVideo - ? FileHelper.getVideoDimensions - : undefined; + ? FileHelper.getVideoDimensions + : undefined; return { id: `upload-${uuidv4()}`, diff --git a/shared/editor/components/Styles.ts b/shared/editor/components/Styles.ts index 05182522e2..3b0ad96187 100644 --- a/shared/editor/components/Styles.ts +++ b/shared/editor/components/Styles.ts @@ -1755,8 +1755,8 @@ table { &:hover { scrollbar-color: ${props.theme.scrollbarThumb} ${ - props.theme.scrollbarBackground -}; + props.theme.scrollbarBackground + }; } & ::-webkit-scrollbar { diff --git a/shared/editor/lib/code.ts b/shared/editor/lib/code.ts index 44dee2f50e..90571fb613 100644 --- a/shared/editor/lib/code.ts +++ b/shared/editor/lib/code.ts @@ -407,7 +407,7 @@ export const getFrequentCodeLanguages = () => { const recentLang = Storage.get(RecentlyUsedStorageKey); const frequentLangEntries = Object.entries(Storage.get(StorageKey) ?? {}) as [ keyof typeof codeLanguages, - number + number, ][]; const frequentLangs = sortFrequencies(frequentLangEntries) diff --git a/shared/editor/lib/table.ts b/shared/editor/lib/table.ts index 9ee25d1ab0..588d1d0060 100644 --- a/shared/editor/lib/table.ts +++ b/shared/editor/lib/table.ts @@ -40,8 +40,8 @@ export function getCellAttrs(dom: HTMLElement | string): Attrs { dom.style.textAlign === "center" ? "center" : dom.style.textAlign === "right" - ? "right" - : null, + ? "right" + : null, } satisfies CellAttrs; } diff --git a/shared/editor/nodes/Mention.tsx b/shared/editor/nodes/Mention.tsx index d2bea3cb64..63d8a6f9bc 100644 --- a/shared/editor/nodes/Mention.tsx +++ b/shared/editor/nodes/Mention.tsx @@ -99,10 +99,10 @@ export default class Mention extends Node { node.attrs.type === MentionType.User ? undefined : node.attrs.type === MentionType.Document - ? `${env.URL}/doc/${node.attrs.modelId}` - : node.attrs.type === MentionType.Collection - ? `${env.URL}/collection/${node.attrs.modelId}` - : node.attrs.href, + ? `${env.URL}/doc/${node.attrs.modelId}` + : node.attrs.type === MentionType.Collection + ? `${env.URL}/collection/${node.attrs.modelId}` + : node.attrs.href, "data-type": node.attrs.type, "data-id": node.attrs.modelId, "data-actorid": node.attrs.actorId, diff --git a/shared/editor/nodes/Notice.tsx b/shared/editor/nodes/Notice.tsx index 1e1cba6079..f63f6b2ed9 100644 --- a/shared/editor/nodes/Notice.tsx +++ b/shared/editor/nodes/Notice.tsx @@ -49,10 +49,10 @@ export default class Notice extends Node { style: dom.className.includes(NoticeTypes.Tip) ? NoticeTypes.Tip : dom.className.includes(NoticeTypes.Warning) - ? NoticeTypes.Warning - : dom.className.includes(NoticeTypes.Success) - ? NoticeTypes.Success - : undefined, + ? NoticeTypes.Warning + : dom.className.includes(NoticeTypes.Success) + ? NoticeTypes.Success + : undefined, }), }, // Quill editor parsing @@ -71,8 +71,8 @@ export default class Notice extends Node { style: dom.className.includes(NoticeTypes.Warning) ? NoticeTypes.Warning : dom.className.includes(NoticeTypes.Success) - ? NoticeTypes.Success - : undefined, + ? NoticeTypes.Success + : undefined, }), }, // Confluence parsing @@ -83,10 +83,10 @@ export default class Notice extends Node { style: dom.className.includes("confluence-information-macro-tip") ? NoticeTypes.Success : dom.className.includes("confluence-information-macro-note") - ? NoticeTypes.Tip - : dom.className.includes("confluence-information-macro-warning") - ? NoticeTypes.Warning - : undefined, + ? NoticeTypes.Tip + : dom.className.includes("confluence-information-macro-warning") + ? NoticeTypes.Warning + : undefined, }), }, ], diff --git a/shared/editor/nodes/TableView.ts b/shared/editor/nodes/TableView.ts index fd68d84e29..544b68c2a1 100644 --- a/shared/editor/nodes/TableView.ts +++ b/shared/editor/nodes/TableView.ts @@ -4,7 +4,10 @@ import { EditorStyleHelper } from "../styles/EditorStyleHelper"; import { TableLayout } from "../types"; export class TableView extends ProsemirrorTableView { - public constructor(public node: Node, public cellMinWidth: number) { + public constructor( + public node: Node, + public cellMinWidth: number + ) { super(node, cellMinWidth); this.dom.removeChild(this.table); diff --git a/shared/types.ts b/shared/types.ts index c1346ccc37..6cb817bcbe 100644 --- a/shared/types.ts +++ b/shared/types.ts @@ -1,3 +1,4 @@ +/** Available user roles. */ export enum UserRole { Admin = "admin", Member = "member", @@ -5,9 +6,7 @@ export enum UserRole { Guest = "guest", } -/** - * Scopes for OAuth and API keys. - */ +/** Scopes for OAuth and API keys. */ export enum Scope { Read = "read", Write = "write", @@ -192,28 +191,34 @@ export type IntegrationSettings = T extends IntegrationType.Embed }; } : T extends IntegrationType.Analytics - ? { measurementId: string; instanceUrl?: string; scriptName?: string } - : T extends IntegrationType.Post - ? { url: string; channel: string; channelId: string } - : T extends IntegrationType.Command - ? { serviceTeamId: string } - : T extends IntegrationType.Import - ? { externalWorkspace: { id: string; name: string; iconUrl?: string } } - : - | { url: string } - | { - github?: { - installation: { - id: number; - account: { id?: number; name: string; avatarUrl?: string }; - }; - }; - } - | { url: string; channel: string; channelId: string } - | { serviceTeamId: string } - | { measurementId: string } - | { slack: { serviceTeamId: string; serviceUserId: string } } - | undefined; + ? { measurementId: string; instanceUrl?: string; scriptName?: string } + : T extends IntegrationType.Post + ? { url: string; channel: string; channelId: string } + : T extends IntegrationType.Command + ? { serviceTeamId: string } + : T extends IntegrationType.Import + ? { + externalWorkspace: { id: string; name: string; iconUrl?: string }; + } + : + | { url: string } + | { + github?: { + installation: { + id: number; + account: { + id?: number; + name: string; + avatarUrl?: string; + }; + }; + }; + } + | { url: string; channel: string; channelId: string } + | { serviceTeamId: string } + | { measurementId: string } + | { slack: { serviceTeamId: string; serviceUserId: string } } + | undefined; export enum UserPreference { /** Whether reopening the app should redirect to the last viewed document. */ diff --git a/shared/utils/emoji.ts b/shared/utils/emoji.ts index 24812f2140..ce58c81d24 100644 --- a/shared/utils/emoji.ts +++ b/shared/utils/emoji.ts @@ -143,15 +143,18 @@ const EMOJI_ID_TO_VARIANTS = Object.entries(Emojis).reduce( ); const CATEGORY_TO_EMOJI_IDS: Record = - Categories.reduce((obj, { id, emojis }) => { - const key = capitalize(id) as EmojiCategory; - const category = EmojiCategory[key]; - if (!category) { + Categories.reduce( + (obj, { id, emojis }) => { + const key = capitalize(id) as EmojiCategory; + const category = EmojiCategory[key]; + if (!category) { + return obj; + } + obj[category] = emojis; return obj; - } - obj[category] = emojis; - return obj; - }, {} as Record); + }, + {} as Record + ); export const getEmojis = ({ ids, @@ -171,16 +174,19 @@ export const getEmojisWithCategory = ({ }: { skinTone: EmojiSkinTone; }): Record => - Object.keys(CATEGORY_TO_EMOJI_IDS).reduce((obj, category: EmojiCategory) => { - const emojiIds = CATEGORY_TO_EMOJI_IDS[category]; - const emojis = emojiIds.map( - (emojiId) => - EMOJI_ID_TO_VARIANTS[emojiId][skinTone] ?? - EMOJI_ID_TO_VARIANTS[emojiId][EmojiSkinTone.Default] - ); - obj[category] = emojis; - return obj; - }, {} as Record); + Object.keys(CATEGORY_TO_EMOJI_IDS).reduce( + (obj, category: EmojiCategory) => { + const emojiIds = CATEGORY_TO_EMOJI_IDS[category]; + const emojis = emojiIds.map( + (emojiId) => + EMOJI_ID_TO_VARIANTS[emojiId][skinTone] ?? + EMOJI_ID_TO_VARIANTS[emojiId][EmojiSkinTone.Default] + ); + obj[category] = emojis; + return obj; + }, + {} as Record + ); export const getEmojiVariants = ({ id }: { id: string }) => EMOJI_ID_TO_VARIANTS[id]; diff --git a/yarn.lock b/yarn.lock index 8ebff110b6..addf2ba986 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3247,6 +3247,11 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@pkgr/core@^0.2.4": + version "0.2.7" + resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.7.tgz#eb5014dfd0b03e7f3ba2eeeff506eed89b028058" + integrity sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg== + "@popperjs/core@^2.5.4": version "2.11.8" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" @@ -9144,12 +9149,13 @@ eslint-plugin-node@^11.1.0: resolve "^1.10.1" semver "^6.1.0" -eslint-plugin-prettier@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" - integrity "sha1-ZRy7iLHauYv9QvAXoS+mstmT+Us= sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==" +eslint-plugin-prettier@^5.5.1: + version "5.5.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz#470820964de9aedb37e9ce62c3266d2d26d08d15" + integrity sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw== dependencies: prettier-linter-helpers "^1.0.0" + synckit "^0.11.7" eslint-plugin-react-hooks@^4.6.2: version "4.6.2" @@ -13482,10 +13488,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.8.8: - version "2.8.8" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" - integrity "sha1-6MXX6YpDBf/j3i4fxKyhpxwosdo= sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==" +prettier@^3.6.2: + version "3.6.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393" + integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ== pretty-bytes@^5.3.0: version "5.6.0" @@ -15406,6 +15412,13 @@ symlink-or-copy@^1.1.8, symlink-or-copy@^1.2.0, symlink-or-copy@^1.3.1: resolved "https://registry.yarnpkg.com/symlink-or-copy/-/symlink-or-copy-1.3.1.tgz#9506dd64d8e98fa21dcbf4018d1eab23e77f71fe" integrity "sha1-lQbdZNjpj6Idy/QBjR6rI+d/cf4= sha512-0K91MEXFpBUaywiwSSkmKjnGcasG/rVBXFLJz5DrgGabpYD6N+3yZrfD6uUIfpuTu65DZLHi7N8CizHc07BPZA==" +synckit@^0.11.7: + version "0.11.8" + resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.11.8.tgz#b2aaae998a4ef47ded60773ad06e7cb821f55457" + integrity sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A== + dependencies: + "@pkgr/core" "^0.2.4" + teex@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/teex/-/teex-1.0.1.tgz#b8fa7245ef8e8effa8078281946c85ab780a0b12"