mirror of
https://github.com/outline/outline.git
synced 2025-12-20 10:09:43 -06:00
Upgrade Prettier to v3.6.2 (#9500)
* Upgrade Prettier to v3.6.2 and eslint-plugin-prettier to v5.5.1 - Upgraded prettier from ^2.8.8 to ^3.6.2 (latest version) - Upgraded eslint-plugin-prettier from ^4.2.1 to ^5.5.1 for compatibility - Applied automatic formatting changes from new Prettier version - All existing ESLint and Prettier configurations remain compatible * Applied automatic fixes * Trigger CI --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom@getoutline.com>
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -27,8 +27,8 @@ export function createAction(definition: Optional<Action, "id">): 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 [
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -176,7 +176,7 @@ const Button = <T extends React.ElementType = "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 (
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -224,8 +224,8 @@ export const CollectionForm = observer(function CollectionForm_({
|
||||
? `${t("Saving")}…`
|
||||
: t("Save")
|
||||
: formState.isSubmitting
|
||||
? `${t("Creating")}…`
|
||||
: t("Create")}
|
||||
? `${t("Creating")}…`
|
||||
: t("Create")}
|
||||
</Button>
|
||||
</Flex>
|
||||
</form>
|
||||
|
||||
@@ -64,7 +64,7 @@ const ConfirmationDialog: React.FC<Props> = ({
|
||||
danger={danger}
|
||||
autoFocus
|
||||
>
|
||||
{isSaving && savingText ? savingText : submitText ?? t("Confirm")}
|
||||
{isSaving && savingText ? savingText : (submitText ?? t("Confirm"))}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Flex>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -177,7 +177,9 @@ const Actions = styled(EventBoundary)`
|
||||
color: ${s("textSecondary")};
|
||||
|
||||
${NudeButton} {
|
||||
&: ${hover}, &[aria-expanded= "true"] {
|
||||
&:
|
||||
${hover},
|
||||
&[aria-expanded= "true"] {
|
||||
background: ${s("sidebarControlHoverBackground")};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
`;
|
||||
|
||||
|
||||
@@ -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;
|
||||
`};
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -140,8 +140,8 @@ export const OAuthClientForm = observer(function OAuthClientForm_({
|
||||
? `${t("Saving")}…`
|
||||
: t("Save")
|
||||
: formState.isSubmitting
|
||||
? `${t("Creating")}…`
|
||||
: t("Create")}
|
||||
? `${t("Creating")}…`
|
||||
: t("Create")}
|
||||
</Button>
|
||||
</Flex>
|
||||
</form>
|
||||
|
||||
@@ -278,8 +278,8 @@ const PaginatedList = <T extends PaginatedItem>({
|
||||
"updatedAt" in item && item.updatedAt
|
||||
? item.updatedAt
|
||||
: "createdAt" in item && item.createdAt
|
||||
? item.createdAt
|
||||
: previousHeading;
|
||||
? item.createdAt
|
||||
: previousHeading;
|
||||
const currentHeading = dateToHeading(
|
||||
currentDate,
|
||||
t,
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ function PublicAccess({ document, share, sharedParent }: Props) {
|
||||
|
||||
const shareUrl = sharedParent?.url
|
||||
? `${sharedParent.url}${document.url}`
|
||||
: share?.url ?? "";
|
||||
: (share?.url ?? "");
|
||||
|
||||
const copyButton = (
|
||||
<Tooltip content={t("Copy public link")} placement="top">
|
||||
|
||||
@@ -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: <Avatar model={suggestion} size={AvatarSize.Medium} />,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 }>`
|
||||
|
||||
@@ -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)<ContainerProps>`
|
||||
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(
|
||||
|
||||
@@ -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);"};
|
||||
`;
|
||||
|
||||
|
||||
@@ -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;
|
||||
`;
|
||||
|
||||
@@ -189,7 +189,7 @@ export function useDragDocument(
|
||||
depth,
|
||||
icon: icon ? <Icon value={icon} color={color} /> : 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(),
|
||||
}),
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -10,7 +10,7 @@ function withStores<
|
||||
ResolvedProps = JSX.LibraryManagedAttributes<
|
||||
P,
|
||||
Omit<React.ComponentProps<P>, StoreProps>
|
||||
>
|
||||
>,
|
||||
>(WrappedComponent: P): React.FC<ResolvedProps> {
|
||||
const ComponentWithStore = (props: ResolvedProps) => {
|
||||
const stores = useStores();
|
||||
|
||||
@@ -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<WrapperProps>`
|
||||
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;
|
||||
|
||||
@@ -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([
|
||||
|
||||
@@ -470,7 +470,7 @@ function SuggestionsMenu<T extends MenuItem>(props: Props<T>) {
|
||||
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<T extends MenuItem>(props: Props<T>) {
|
||||
"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;
|
||||
|
||||
@@ -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]
|
||||
);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -17,8 +17,8 @@ export function usePinnedDocuments(urlId: UrlId, collectionId?: string) {
|
||||
return urlId === "home"
|
||||
? pins.home
|
||||
: collectionId
|
||||
? pins.inCollection(collectionId)
|
||||
: [];
|
||||
? pins.inCollection(collectionId)
|
||||
: [];
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -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]
|
||||
);
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ const SharedDocument = observer(
|
||||
}
|
||||
|
||||
const tocPosition = hasHeadings
|
||||
? response.team?.tocPosition ?? TOCPosition.Left
|
||||
? (response.team?.tocPosition ?? TOCPosition.Left)
|
||||
: false;
|
||||
setDocument(response.document);
|
||||
|
||||
|
||||
@@ -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 &&
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ?? ""}
|
||||
|
||||
@@ -34,7 +34,7 @@ function Preferences() {
|
||||
type: "item",
|
||||
label: lang.label,
|
||||
value: lang.value,
|
||||
} satisfies Option)
|
||||
}) satisfies Option
|
||||
),
|
||||
[]
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@@ -23,12 +23,11 @@ export default class GroupMembershipsStore extends Store<GroupMembership> {
|
||||
collectionId,
|
||||
documentId,
|
||||
...params
|
||||
}:
|
||||
| PaginationParams & {
|
||||
documentId?: string;
|
||||
collectionId?: string;
|
||||
groupId?: string;
|
||||
}): Promise<PaginatedResponse<GroupMembership>> => {
|
||||
}: PaginationParams & {
|
||||
documentId?: string;
|
||||
collectionId?: string;
|
||||
groupId?: string;
|
||||
}): Promise<PaginatedResponse<GroupMembership>> => {
|
||||
this.isFetching = true;
|
||||
|
||||
try {
|
||||
@@ -38,11 +37,11 @@ export default class GroupMembershipsStore extends Store<GroupMembership> {
|
||||
...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<GroupMembership> = [];
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -58,8 +58,8 @@ export const determineMentionType = ({
|
||||
return type === "pull"
|
||||
? MentionType.PullRequest
|
||||
: type === "issues"
|
||||
? MentionType.Issue
|
||||
: undefined;
|
||||
? MentionType.Issue
|
||||
: undefined;
|
||||
}
|
||||
|
||||
case IntegrationService.Linear: {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -218,8 +218,8 @@ function WebhookSubscriptionForm({ handleSubmit, webhookSubscription }: Props) {
|
||||
value === "*"
|
||||
? AllEventCheckboxLabel
|
||||
: Object.keys(WEBHOOK_EVENTS).includes(value)
|
||||
? GroupEventCheckboxLabel
|
||||
: EventCheckboxLabel;
|
||||
? GroupEventCheckboxLabel
|
||||
: EventCheckboxLabel;
|
||||
|
||||
return (
|
||||
<LabelComponent>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -35,7 +35,7 @@ export interface EmailProps {
|
||||
|
||||
export default abstract class BaseEmail<
|
||||
T extends EmailProps,
|
||||
S extends Record<string, unknown> | void = void
|
||||
S extends Record<string, unknown> | void = void,
|
||||
> {
|
||||
private props: T;
|
||||
private metadata?: NotificationMetadata;
|
||||
|
||||
@@ -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 (
|
||||
<EmailTemplate
|
||||
|
||||
@@ -66,7 +66,7 @@ export default class CommentCreatedEmail extends BaseEmail<
|
||||
}
|
||||
|
||||
const parentComment = comment.parentCommentId
|
||||
? (await comment.$get("parentComment")) ?? undefined
|
||||
? ((await comment.$get("parentComment")) ?? undefined)
|
||||
: undefined;
|
||||
|
||||
const body = await this.htmlForData(
|
||||
|
||||
@@ -60,7 +60,7 @@ export const traceFunction =
|
||||
<
|
||||
F extends (...args: any[]) => any,
|
||||
P extends Parameters<F>,
|
||||
R extends ReturnType<F>
|
||||
R extends ReturnType<F>,
|
||||
>(
|
||||
target: F
|
||||
): F =>
|
||||
|
||||
@@ -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}`
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -24,7 +24,7 @@ export type ImportTaskAttributes<T extends ImportableIntegrationService> =
|
||||
InferAttributes<ImportTask<T>> & NonInferredAttributes<T>;
|
||||
|
||||
export type ImportTaskCreationAttributes<
|
||||
T extends ImportableIntegrationService
|
||||
T extends ImportableIntegrationService,
|
||||
> = Partial<InferCreationAttributes<ImportTask<T>>> &
|
||||
Partial<NonInferredAttributes<T>>;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import ParanoidModel from "./ParanoidModel";
|
||||
|
||||
class ArchivableModel<
|
||||
TModelAttributes extends object = any,
|
||||
TCreationAttributes extends object = TModelAttributes
|
||||
TCreationAttributes extends object = TModelAttributes,
|
||||
> extends ParanoidModel<TModelAttributes, TCreationAttributes> {
|
||||
/** Whether the document is archived, and if so when. */
|
||||
@AllowNull
|
||||
|
||||
@@ -11,7 +11,7 @@ import Model from "./Model";
|
||||
|
||||
class IdModel<
|
||||
TModelAttributes extends object = any,
|
||||
TCreationAttributes extends object = TModelAttributes
|
||||
TCreationAttributes extends object = TModelAttributes,
|
||||
> extends Model<TModelAttributes, TCreationAttributes> {
|
||||
@IsUUID(4)
|
||||
@PrimaryKey
|
||||
|
||||
@@ -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<TModelAttributes, TCreationAttributes> {
|
||||
/**
|
||||
* 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,
|
||||
|
||||
@@ -3,7 +3,7 @@ import IdModel from "./IdModel";
|
||||
|
||||
class ParanoidModel<
|
||||
TModelAttributes extends object = any,
|
||||
TCreationAttributes extends object = TModelAttributes
|
||||
TCreationAttributes extends object = TModelAttributes,
|
||||
> extends IdModel<TModelAttributes, TCreationAttributes> {
|
||||
@DeletedAt
|
||||
deletedAt: Date | null;
|
||||
|
||||
@@ -19,7 +19,7 @@ type RelationOptions = {
|
||||
export function CounterCache<
|
||||
TCreationAttributes extends InferAttributes<Model>,
|
||||
TModelAttributes extends InferAttributes<Model>,
|
||||
T extends typeof Model
|
||||
T extends typeof Model,
|
||||
>(
|
||||
classResolver: ModelClassGetter<TCreationAttributes, TModelAttributes>,
|
||||
options: RelationOptions
|
||||
|
||||
@@ -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))
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ type Props = {
|
||||
};
|
||||
|
||||
export default abstract class APIImportTask<
|
||||
T extends ImportableIntegrationService
|
||||
T extends ImportableIntegrationService,
|
||||
> extends BaseTask<Props> {
|
||||
/**
|
||||
* Run the import task.
|
||||
|
||||
@@ -370,7 +370,8 @@ export default abstract class ImportTask extends BaseTask<Props> {
|
||||
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,
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -224,8 +224,8 @@ router.get(
|
||||
collectionSubscription
|
||||
? QueryNotices.UnsubscribeCollection
|
||||
: documentSubscription
|
||||
? QueryNotices.UnsubscribeDocument
|
||||
: ""
|
||||
? QueryNotices.UnsubscribeDocument
|
||||
: ""
|
||||
}`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ export function createMigrationRunner(
|
||||
{
|
||||
cwd?: string | undefined;
|
||||
ignore?: string | string[] | undefined;
|
||||
}
|
||||
},
|
||||
]
|
||||
) {
|
||||
return new Umzug({
|
||||
|
||||
@@ -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<InitializeRet, AuthenticateRet, AuthorizeRet>,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { UrlHelper } from "@shared/utils/UrlHelper";
|
||||
|
||||
export function zodEnumFromObjectKeys<
|
||||
TI extends Record<string, any>,
|
||||
R extends string = TI extends Record<infer R, any> ? R : never
|
||||
R extends string = TI extends Record<infer R, any> ? R : never,
|
||||
>(input: TI): z.ZodEnum<[R, ...R[]]> {
|
||||
const [firstKey, ...otherKeys] = Object.keys(input) as [R, ...R[]];
|
||||
return z.enum([firstKey, ...otherKeys]);
|
||||
|
||||
@@ -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")};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -31,22 +31,22 @@ const Text = styled.span<Props>`
|
||||
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<Props>`
|
||||
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")};
|
||||
|
||||
@@ -68,8 +68,8 @@ const insertFiles = async function (
|
||||
const getDimensions = isImage
|
||||
? FileHelper.getImageDimensions
|
||||
: isVideo
|
||||
? FileHelper.getVideoDimensions
|
||||
: undefined;
|
||||
? FileHelper.getVideoDimensions
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
id: `upload-${uuidv4()}`,
|
||||
|
||||
@@ -1755,8 +1755,8 @@ table {
|
||||
|
||||
&:hover {
|
||||
scrollbar-color: ${props.theme.scrollbarThumb} ${
|
||||
props.theme.scrollbarBackground
|
||||
};
|
||||
props.theme.scrollbarBackground
|
||||
};
|
||||
}
|
||||
|
||||
& ::-webkit-scrollbar {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
}),
|
||||
},
|
||||
],
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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> = 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. */
|
||||
|
||||
@@ -143,15 +143,18 @@ const EMOJI_ID_TO_VARIANTS = Object.entries(Emojis).reduce(
|
||||
);
|
||||
|
||||
const CATEGORY_TO_EMOJI_IDS: Record<EmojiCategory, string[]> =
|
||||
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<EmojiCategory, string[]>);
|
||||
},
|
||||
{} as Record<EmojiCategory, string[]>
|
||||
);
|
||||
|
||||
export const getEmojis = ({
|
||||
ids,
|
||||
@@ -171,16 +174,19 @@ export const getEmojisWithCategory = ({
|
||||
}: {
|
||||
skinTone: EmojiSkinTone;
|
||||
}): Record<EmojiCategory, Emoji[]> =>
|
||||
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<EmojiCategory, Emoji[]>);
|
||||
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<EmojiCategory, Emoji[]>
|
||||
);
|
||||
|
||||
export const getEmojiVariants = ({ id }: { id: string }) =>
|
||||
EMOJI_ID_TO_VARIANTS[id];
|
||||
|
||||
29
yarn.lock
29
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"
|
||||
|
||||
Reference in New Issue
Block a user