mirror of
https://github.com/usememos/memos.git
synced 2026-12-04 08:24:22 +01:00
refactor(api)!: drop the v1 version marker (#6447)
This commit is contained in:
1 parent
b1fa9aefcc
commit
af38e75e2d
447 files changed
+34260
-31472
No files matched your search
@@ -41,7 +41,7 @@ import { useNotifications } from "@/hooks/useUserQueries";
|
||||
import { combineCELFilters } from "@/lib/cel-filter";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { collectionNavigationPath, ROUTES } from "@/router/routes";
|
||||
import { User_Role, UserNotification_Status } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { User_Role, UserNotification_Status } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import CommonSidebarContent from "./CommonSidebarContent";
|
||||
import { getSidebarRouteKind } from "./routes";
|
||||
|
||||
@@ -16,7 +16,7 @@ import { handleError } from "@/lib/error";
|
||||
import { getMemoViewId, isMemoCollectionRoute } from "@/lib/memo-views";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { getCollectionHomePath, ROUTES } from "@/router/routes";
|
||||
import type { MemoView } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { MemoView } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import SidebarRow, {
|
||||
SIDEBAR_ROW_BOX_CLASSES,
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from "lucide-react";
|
||||
import React, { useState } from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { getAttachmentThumbnailUrl, getAttachmentType, getAttachmentUrl } from "@/utils/attachment";
|
||||
import SquareDiv from "./kit/SquareDiv";
|
||||
import PreviewImageDialog from "./PreviewImageDialog";
|
||||
|
||||
@@ -3,7 +3,7 @@ import AudioAttachmentItem from "@/components/MemoMetadata/Attachment/AudioAttac
|
||||
import VideoPoster from "@/components/VideoPoster";
|
||||
import type { AttachmentLibraryListItem } from "@/hooks/useAttachmentLibrary";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import { getAttachmentThumbnailUrl, getAttachmentType, isMotionAttachment } from "@/utils/attachment";
|
||||
import { AttachmentCreator, AttachmentMetadataLine, AttachmentOpenButton, AttachmentSourceChip } from "./AttachmentLibraryPrimitives";
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { extractUsernameFromName } from "@/lib/resource-names";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { getCreatorHomePath } from "@/router/routes";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
interface AttachmentMetadataLineProps {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Badge } from "@/components/ui/badge";
|
||||
import VideoPoster from "@/components/VideoPoster";
|
||||
import type { AttachmentLibraryMediaItem, AttachmentLibraryMonthGroup } from "@/hooks/useAttachmentLibrary";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { formatMediaDuration } from "@/utils/media-metadata";
|
||||
import { AttachmentCreator, AttachmentMetadataLine, AttachmentOpenButton, AttachmentSourceChip } from "./AttachmentLibraryPrimitives";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ArrowRightIcon, CompassIcon } from "lucide-react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { useInstance } from "@/contexts/InstanceContext";
|
||||
import { ROUTES } from "@/router/routes";
|
||||
import { InstanceAccessMode } from "@/types/proto/api/v1/instance_service_pb";
|
||||
import { InstanceAccessMode } from "@/types/proto/api/instance_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import AuthFooter from "./AuthFooter";
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import { formatMonthLabel, getToday, parseLocalDate } from "@/lib/calendar-utils
|
||||
import { combineCELFilters } from "@/lib/cel-filter";
|
||||
import { isMemoBlurred } from "@/lib/tag";
|
||||
import { collectionPathForLocation } from "@/router/routes";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { PREVIEW_MIN_CELL_WIDTH } from "./CalendarDayCell";
|
||||
import { CalendarGrid } from "./CalendarGrid";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { SANITIZE_SCHEMA } from "@/components/MemoContent/constants";
|
||||
import type { MemoTimeBasis } from "@/contexts/ViewContext";
|
||||
import { getMemoSortTime } from "@/hooks/useMemoSorting";
|
||||
import { ISO_DATE_FORMAT } from "@/lib/calendar-utils";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { getAttachmentThumbnailUrl, getAttachmentUrl, isImage } from "@/utils/attachment";
|
||||
import { classifyManagedAttachmentImageURL, extractAttachmentUIDFromName } from "@/utils/managed-attachment";
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import { memoServiceClient } from "@/connect";
|
||||
import { useView } from "@/contexts/ViewContext";
|
||||
import { memoKeys } from "@/hooks/useMemoQueries";
|
||||
import { getLocalMonthTimestampRange, withTimestampRange } from "@/lib/calendar-utils";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import { ListMemosRequestSchema, type Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import { ListMemosRequestSchema, type Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { type BuildCalendarMonthModelOptions, buildCalendarMonthModel } from "./dayModel";
|
||||
|
||||
/** A month usually fits one page; the loop below still drains any that do not. */
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { useUpdateUser } from "@/hooks/useUserQueries";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { User } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { userServiceClient } from "@/connect";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import useLoading from "@/hooks/useLoading";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { CreatePersonalAccessTokenResponse } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { CreatePersonalAccessTokenResponse } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
IdentityProviderSchema,
|
||||
OAuth2Config,
|
||||
OAuth2ConfigSchema,
|
||||
} from "@/types/proto/api/v1/idp_service_pb";
|
||||
} from "@/types/proto/api/idp_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
const DEFAULT_TEMPLATE = "GitHub";
|
||||
|
||||
@@ -13,7 +13,7 @@ import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { useCreateSpace } from "@/hooks/useSpaceQueries";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { Space, Space_Icon } from "@/types/proto/api/v1/space_service_pb";
|
||||
import type { Space, Space_Icon } from "@/types/proto/api/space_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
const SPACE_UID_PATTERN = /^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,34}[a-zA-Z0-9])?$/;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import { userServiceClient } from "@/connect";
|
||||
import useLoading from "@/hooks/useLoading";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { User, User_Role, UserSchema } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { User, User_Role, UserSchema } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { absolutifyLink } from "@/lib/browser";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { ROUTES } from "@/router/routes";
|
||||
import { IdentityProvider, IdentityProvider_Type } from "@/types/proto/api/v1/idp_service_pb";
|
||||
import { IdentityProvider, IdentityProvider_Type } from "@/types/proto/api/idp_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { storeOAuthState } from "@/utils/oauth";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import useNavigateTo from "@/hooks/useNavigateTo";
|
||||
import { useArchiveNotification, useDeleteNotification } from "@/hooks/useUserQueries";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { UserNotification, UserNotification_Status } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { UserNotification, UserNotification_Status } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -6,7 +6,7 @@ import useNavigateTo from "@/hooks/useNavigateTo";
|
||||
import { useArchiveNotification, useDeleteNotification } from "@/hooks/useUserQueries";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { UserNotification, UserNotification_Status } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { UserNotification, UserNotification_Status } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -14,9 +14,9 @@ import { extractSpaceUidFromName } from "@/lib/space-display";
|
||||
import { cn } from "@/lib/utils";
|
||||
import {
|
||||
UserNotification,
|
||||
UserNotification_SpaceInvitationPayload_State,
|
||||
UserNotification_SpaceInvitationPayload_InvitationState,
|
||||
UserNotification_Status,
|
||||
} from "@/types/proto/api/v1/user_service_pb";
|
||||
} from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
interface Props {
|
||||
@@ -79,7 +79,7 @@ function SpaceInvitationMessage({ notification }: Props) {
|
||||
}
|
||||
|
||||
const isUnread = notification.status === UserNotification_Status.UNREAD;
|
||||
const isPending = payload.state === UserNotification_SpaceInvitationPayload_State.PENDING;
|
||||
const isPending = payload.state === UserNotification_SpaceInvitationPayload_InvitationState.PENDING;
|
||||
const isBusy = acceptInvitation.isPending || declineInvitation.isPending;
|
||||
const spaceUid = extractSpaceUidFromName(space.name);
|
||||
const spaceLabel = `${space.title} (${spaceUid})`;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { BasemapLayer } from "@/components/map/BasemapLayer";
|
||||
import { createMarkerIcon, MinimalAttributionControl } from "@/components/map/map-utils";
|
||||
import UserAvatar from "@/components/UserAvatar";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { type MapPin, type MapPinFace, type MapViewport, revealOffset } from "./model";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -13,7 +13,7 @@ import { useSpaceContext } from "@/contexts/SpaceContext";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import useMediaQuery from "@/hooks/useMediaQuery";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { LocationSchema } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { LocationSchema } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { fitMemos, MapCanvas } from "./MapCanvas";
|
||||
import { locationKey, type MapViewport, pointLabel, readViewport, splitLabel } from "./model";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { MemoTimeBasis } from "@/contexts/ViewContext";
|
||||
import { getMemoSortTime } from "@/hooks/useMemoSorting";
|
||||
import type { Location, Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Location, Memo } from "@/types/proto/api/memo_service_pb";
|
||||
|
||||
export interface MapViewport {
|
||||
lat: number;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useView } from "@/contexts/ViewContext";
|
||||
import { useMemoFilters } from "@/hooks/useMemoFilters";
|
||||
import { useInfiniteMemos } from "@/hooks/useMemoQueries";
|
||||
import { combineCELFilters } from "@/lib/cel-filter";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import { mapMemos } from "./model";
|
||||
|
||||
/** What the map can show; the sidebar counts against the same scope. */
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useAuth } from "@/contexts/AuthContext";
|
||||
import { useUsersByUsernames } from "@/hooks/useUserQueries";
|
||||
import { extractUsernameFromName } from "@/lib/resource-names";
|
||||
import { isMemoBlurred } from "@/lib/tag";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { type MapPin, pinFace } from "./model";
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
DropdownMenuSubTrigger,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { createMemoNavigationState } from "../MemoView/navigation";
|
||||
import { useMemoActionHandlers } from "./hooks";
|
||||
|
||||
@@ -10,8 +10,8 @@ import { userKeys } from "@/hooks/useUserQueries";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { extractMemoIdFromName } from "@/lib/resource-names";
|
||||
import { ROUTES } from "@/router/routes";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { checkAllTasks, uncheckAllTasks } from "@/utils/markdown-task-actions";
|
||||
import { isMemoDetailPath } from "../MemoView/navigation";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
||||
import { separateAttachments } from "@/components/MemoMetadata/Attachment/attachmentHelpers";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import { filterInlineManagedAttachments } from "@/utils/managed-attachment";
|
||||
import { type AttachmentVisualItem, buildAttachmentVisualItems, countLogicalAttachmentItems } from "@/utils/media-item";
|
||||
import { getMemoSharePreviewAvatarUrl } from "./memoShareImage";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
|
||||
export interface MemoActionMenuProps {
|
||||
memo: Memo;
|
||||
|
||||
@@ -7,8 +7,8 @@ import { Button } from "@/components/ui/button";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { MEMO_COMMENTS_ANCHOR_ID } from "@/lib/memo-comments";
|
||||
import { extractMemoIdFromName } from "@/lib/resource-names";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { Components } from "react-markdown";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import { buildRehypePlugins, buildRemarkPlugins } from "@/components/MemoContent/pipeline";
|
||||
import { isMentionElement, isTagElement, isTaskListItemElement } from "@/types/markdown";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { lazyWithReload } from "@/utils/lazy";
|
||||
import { resolveManagedAttachmentImageSource } from "@/utils/managed-attachment";
|
||||
import { CodeBlock } from "./CodeBlock";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useQueries } from "@tanstack/react-query";
|
||||
import { createContext, type ReactNode, useContext, useMemo } from "react";
|
||||
import { userDetailQueryOptions, useUsersByUsernames } from "@/hooks/useUserQueries";
|
||||
import { extractUsernameFromName } from "@/lib/resource-names";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import { extractMentionUsernames } from "@/utils/mention-extraction";
|
||||
|
||||
interface UserResolutionContextValue {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type React from "react";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
|
||||
export interface MemoContentProps {
|
||||
content: string;
|
||||
|
||||
@@ -25,8 +25,8 @@ import { useOverflowTitle } from "@/hooks";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { MEMO_COMMENTS_ANCHOR_ID } from "@/lib/memo-comments";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import { Memo, type MemoRelation, Visibility } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import { Memo, type MemoRelation, Visibility } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { canManageMemo } from "@/utils/user";
|
||||
import MemoOutline from "./MemoOutline";
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { getShareUrl, useCreateMemoShare, useDeleteMemoShare, useMemoShares } from "@/hooks/useMemoShareQueries";
|
||||
import type { MemoShare } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { MemoShare } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
type ExpiryOption = "never" | "1d" | "7d" | "30d";
|
||||
|
||||
@@ -16,7 +16,7 @@ import VisibilityIcon from "@/components/VisibilityIcon";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { useSpaces } from "@/hooks/useSpaceQueries";
|
||||
import { extractSpaceUidFromName, getDuplicateSpaceTitles } from "@/lib/space-display";
|
||||
import type { Space_Icon } from "@/types/proto/api/v1/space_service_pb";
|
||||
import type { Space_Icon } from "@/types/proto/api/space_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { getAssignableVisibilityOptions, getVisibilityOption } from "@/utils/memo";
|
||||
import type { AudienceMenuProps } from "../types";
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { FC } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { type Location, Visibility } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { type Location, Visibility } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { primaryModifierGlyph } from "@/utils/platform";
|
||||
import { validationService } from "../services";
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { useDebouncedEffect } from "@/hooks";
|
||||
import type { MemoRelation } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { MemoRelation } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { useFileUpload, useLinkMemo, useLocation } from "../hooks";
|
||||
import { useEditorContext, useEditorSelector } from "../state";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ConnectError } from "@connectrpc/connect";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { toast } from "react-hot-toast";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { transcriptionService } from "../services";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { equals } from "@bufbuild/protobuf";
|
||||
import { useCallback, useEffect, useRef } from "react";
|
||||
import { AttachmentSchema } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import { LocationSchema } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { AttachmentSchema } from "@/types/proto/api/attachment_service_pb";
|
||||
import { LocationSchema } from "@/types/proto/api/memo_service_pb";
|
||||
import { cacheService, type EditorDraft } from "../services";
|
||||
import { type EditorState, useEditorStore } from "../state";
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { create } from "@bufbuild/protobuf";
|
||||
import { useRef } from "react";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { useAuth } from "@/contexts/AuthContext";
|
||||
import { type MotionMedia, MotionMediaFamily, MotionMediaRole, MotionMediaSchema } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import { type MotionMedia, MotionMediaFamily, MotionMediaRole, MotionMediaSchema } from "@/types/proto/api/attachment_service_pb";
|
||||
import { mediaMetadataService } from "../services/mediaMetadataService";
|
||||
import type { LocalFile } from "../types/attachment";
|
||||
import { useBlobUrls } from "./useBlobUrls";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { uniqBy } from "lodash-es";
|
||||
import { type RefObject, useCallback, useEffect, useRef, useState } from "react";
|
||||
import { toast } from "react-hot-toast";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { isImage } from "@/utils/attachment";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { buildManagedAttachmentMarkdown, canInlineAttachment } from "@/utils/managed-attachment";
|
||||
|
||||
@@ -8,10 +8,10 @@ import { buildMemoCreatorFilter } from "@/lib/resource-names";
|
||||
import {
|
||||
type Memo,
|
||||
type MemoRelation,
|
||||
MemoRelation_MemoSchema,
|
||||
MemoRelation_MemoRefSchema,
|
||||
MemoRelation_Type,
|
||||
MemoRelationSchema,
|
||||
} from "@/types/proto/api/v1/memo_service_pb";
|
||||
} from "@/types/proto/api/memo_service_pb";
|
||||
|
||||
interface UseLinkMemoParams {
|
||||
isOpen: boolean;
|
||||
@@ -70,7 +70,7 @@ export const useLinkMemo = ({ isOpen, currentMemoName, existingRelations, onAddR
|
||||
const addMemoRelation = (memo: Memo) => {
|
||||
const relation = create(MemoRelationSchema, {
|
||||
type: MemoRelation_Type.REFERENCE,
|
||||
relatedMemo: create(MemoRelation_MemoSchema, {
|
||||
relatedMemo: create(MemoRelation_MemoRefSchema, {
|
||||
name: memo.name,
|
||||
snippet: memo.snippet,
|
||||
}),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { create } from "@bufbuild/protobuf";
|
||||
import { useCallback, useMemo, useRef, useState } from "react";
|
||||
import type { MapPoint } from "@/components/map/types";
|
||||
import { Location, LocationSchema } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { Location, LocationSchema } from "@/types/proto/api/memo_service_pb";
|
||||
import { LocationState } from "../types/insertMenu";
|
||||
|
||||
export const useLocation = (initialLocation?: Location) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import type { Location, Memo, Visibility } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Location, Memo, Visibility } from "@/types/proto/api/memo_service_pb";
|
||||
import { cacheService, memoService } from "../services";
|
||||
import { useEditorContext } from "../state";
|
||||
import type { EditorController } from "../types/editorController";
|
||||
|
||||
@@ -6,7 +6,7 @@ import { attachmentKeys } from "@/hooks/useAttachmentQueries";
|
||||
import { memoKeys } from "@/hooks/useMemoQueries";
|
||||
import { userKeys } from "@/hooks/useUserQueries";
|
||||
import { handleError } from "@/lib/error";
|
||||
import type { Visibility } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Visibility } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { errorService, memoService, validationService } from "../services";
|
||||
import { useEditorContext } from "../state";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useInstance } from "@/contexts/InstanceContext";
|
||||
import { useLocalStorage } from "@/hooks";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { InstanceSetting_Key } from "@/types/proto/api/v1/instance_service_pb";
|
||||
import { InstanceSetting_Key } from "@/types/proto/api/instance_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { convertVisibilityFromString } from "@/utils/memo";
|
||||
import { canManageMemo } from "@/utils/user";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { fromJson, type JsonValue, toJson } from "@bufbuild/protobuf";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import { AttachmentSchema } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { AttachmentSchema } from "@/types/proto/api/attachment_service_pb";
|
||||
|
||||
import { type Location, LocationSchema, Visibility } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { type Location, LocationSchema, Visibility } from "@/types/proto/api/memo_service_pb";
|
||||
|
||||
export const CACHE_DEBOUNCE_DELAY = 500;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
MediaMetadataSchema,
|
||||
PhotoMetadataSchema,
|
||||
VideoMetadataSchema,
|
||||
} from "@/types/proto/api/v1/attachment_service_pb";
|
||||
} from "@/types/proto/api/attachment_service_pb";
|
||||
import { isImage } from "@/utils/attachment";
|
||||
|
||||
const EXTRACTION_TIMEOUT_MS = 5_000;
|
||||
|
||||
@@ -3,10 +3,10 @@ import { FieldMaskSchema, timestampDate, timestampFromDate } from "@bufbuild/pro
|
||||
import { isEqual } from "lodash-es";
|
||||
import { getEditorReferenceRelations } from "@/components/MemoMetadata/Relation/relationHelpers";
|
||||
import { memoServiceClient } from "@/connect";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import { AttachmentSchema } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { MemoSchema } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { AttachmentSchema } from "@/types/proto/api/attachment_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { MemoSchema } from "@/types/proto/api/memo_service_pb";
|
||||
import type { EditorState } from "../state";
|
||||
import { uploadService } from "./uploadService";
|
||||
|
||||
@@ -127,7 +127,7 @@ export const memoService = {
|
||||
|
||||
const memo = options.parentMemoName
|
||||
? await memoServiceClient.createMemoComment({
|
||||
name: options.parentMemoName,
|
||||
parent: options.parentMemoName,
|
||||
comment: memoData,
|
||||
})
|
||||
: await memoServiceClient.createMemo({ memo: memoData });
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { create } from "@bufbuild/protobuf";
|
||||
import { Code, ConnectError } from "@connectrpc/connect";
|
||||
import { aiServiceClient } from "@/connect";
|
||||
import { TranscribeRequestSchema, TranscriptionAudioSchema } from "@/types/proto/api/v1/ai_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import { TranscribeRequestSchema, TranscriptionAudioSchema } from "@/types/proto/api/ai_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { getAttachmentUrl } from "@/utils/attachment";
|
||||
|
||||
// Mirrors maxTranscriptionAudioSizeBytes in server/api/v1/ai_service.go so an
|
||||
// Mirrors maxTranscriptionAudioSizeBytes in server/api/ai_service.go so an
|
||||
// oversized attachment is rejected before it is downloaded, with the server's error.
|
||||
const MAX_AUDIO_SIZE = 25 * 1024 * 1024;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { create } from "@bufbuild/protobuf";
|
||||
import { Code, ConnectError } from "@connectrpc/connect";
|
||||
import { attachmentServiceClient } from "@/connect";
|
||||
import type { Attachment, UploadAttachmentRequest } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import { AttachmentSchema, MotionMediaSchema, UploadAttachmentSpecSchema } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment, UploadAttachmentRequest } from "@/types/proto/api/attachment_service_pb";
|
||||
import { AttachmentSchema, MotionMediaSchema, UploadAttachmentSpecSchema } from "@/types/proto/api/attachment_service_pb";
|
||||
import type { LocalFile } from "../types/attachment";
|
||||
|
||||
const DEFAULT_CHUNK_SIZE = 2 * 1024 * 1024;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Location, MemoRelation } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { Visibility } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import type { Location, MemoRelation } from "@/types/proto/api/memo_service_pb";
|
||||
import { Visibility } from "@/types/proto/api/memo_service_pb";
|
||||
import type { LocalFile } from "../types/attachment";
|
||||
|
||||
export type LoadingKey = "saving" | "uploading" | "loading" | "transcribing";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Attachment, MediaMetadata, MotionMedia } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import { MotionMediaFamily, MotionMediaRole } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment, MediaMetadata, MotionMedia } from "@/types/proto/api/attachment_service_pb";
|
||||
import { MotionMediaFamily, MotionMediaRole } from "@/types/proto/api/attachment_service_pb";
|
||||
import { getAttachmentThumbnailUrl, getAttachmentType, getAttachmentUrl } from "@/utils/attachment";
|
||||
import { buildAttachmentVisualItems } from "@/utils/media-item";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { MemoSuggestion } from "@/lib/memo-suggestions";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Location, Memo, Visibility } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import type { Location, Memo, Visibility } from "@/types/proto/api/memo_service_pb";
|
||||
import type { EditorFileOrigin } from "../Editor/extensions";
|
||||
import type { AudioRecorderStatus } from "../hooks/useAudioRecorder";
|
||||
import type { LocalFile } from "./attachment";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { getAttachmentThumbnailUrl, getAttachmentType, getAttachmentUrl } from "@/utils/attachment";
|
||||
|
||||
interface AttachmentCardProps {
|
||||
|
||||
@@ -24,7 +24,7 @@ import MetadataSection, {
|
||||
import PreviewImageDialog from "@/components/PreviewImageDialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { formatFileSize, getFileTypeLabel } from "@/utils/format";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { canInlineAttachment, extractAttachmentUIDFromName } from "@/utils/managed-attachment";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useMemo } from "react";
|
||||
import MotionPhotoPreview from "@/components/MotionPhotoPreview";
|
||||
import VideoPoster from "@/components/VideoPoster";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { getAttachmentUrl } from "@/utils/attachment";
|
||||
import type { AttachmentVisualItem, PreviewMediaItem } from "@/utils/media-item";
|
||||
import { buildAttachmentVisualItems } from "@/utils/media-item";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { getAttachmentType } from "@/utils/attachment";
|
||||
import { formatFileSize, getFileTypeLabel } from "@/utils/format";
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
MetadataRowIconSlot,
|
||||
MetadataRowRemoveControl,
|
||||
} from "@/components/MemoMetadata/MetadataSection";
|
||||
import type { Location } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Location } from "@/types/proto/api/memo_service_pb";
|
||||
import { getLocationCoordinatesText, getLocationDisplayText } from "./locationHelpers";
|
||||
|
||||
interface LocationDisplayEditorProps {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useState } from "react";
|
||||
import { METADATA_ROW_CLASSES, METADATA_ROW_TEXT_CLASSES, MetadataRowIconSlot } from "@/components/MemoMetadata/MetadataSection";
|
||||
import { LazyLocationPicker } from "@/components/map/LazyLocationPicker";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import type { Location } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Location } from "@/types/proto/api/memo_service_pb";
|
||||
import { getLocationCoordinatesText, getLocationDisplayText } from "./locationHelpers";
|
||||
|
||||
interface LocationDisplayViewProps {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Location } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Location } from "@/types/proto/api/memo_service_pb";
|
||||
|
||||
export const getLocationDisplayText = (location: Location): string => {
|
||||
return location.placeholder.trim() || getLocationCoordinatesText(location);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useMemo } from "react";
|
||||
import { useNearViewport } from "@/hooks/useNearViewport";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Location, MemoRelation } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import type { Location, MemoRelation } from "@/types/proto/api/memo_service_pb";
|
||||
import { AttachmentRows } from "./Attachment/AttachmentListView";
|
||||
import LocationDisplayView from "./Location/LocationDisplayView";
|
||||
import { METADATA_ROW_LIST_CLASSES } from "./MetadataSection";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle } fr
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { VisuallyHidden } from "@/components/ui/visually-hidden";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
interface LinkMemoDialogProps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { FC } from "react";
|
||||
import { useMemo } from "react";
|
||||
import MetadataSection, { METADATA_ROW_BOX_CLASSES, MetadataRowRemoveControl } from "@/components/MemoMetadata/MetadataSection";
|
||||
import type { MemoRelation } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { MemoRelation } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import RelationRow from "./RelationRow";
|
||||
import { getEditorReferenceRelations } from "./relationHelpers";
|
||||
|
||||
@@ -2,11 +2,11 @@ import { LinkIcon, type LucideIcon } from "lucide-react";
|
||||
import type { ReactNode } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { createMemoNavigationState } from "@/components/MemoView/navigation";
|
||||
import type { MemoRelation_Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { MemoRelation_MemoRef } from "@/types/proto/api/memo_service_pb";
|
||||
import { METADATA_ROW_CLASSES, METADATA_ROW_LABEL_CLASSES, METADATA_ROW_TEXT_CLASSES, MetadataRowIconSlot } from "../MetadataSection";
|
||||
|
||||
interface RelationRowProps {
|
||||
memo: MemoRelation_Memo;
|
||||
memo: MemoRelation_MemoRef;
|
||||
parentPage?: string;
|
||||
icon?: LucideIcon;
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LinkIcon, MilestoneIcon } from "lucide-react";
|
||||
import { useMemo } from "react";
|
||||
import type { MemoRelation } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { MemoRelation } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { METADATA_ROW_DETAIL_CLASSES } from "../MetadataSection";
|
||||
import RelationRow from "./RelationRow";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { MemoRelation } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { MemoRelation_Type } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { MemoRelation } from "@/types/proto/api/memo_service_pb";
|
||||
import { MemoRelation_Type } from "@/types/proto/api/memo_service_pb";
|
||||
|
||||
export type RelationDirection = "referencing" | "referenced";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { create } from "@bufbuild/protobuf";
|
||||
import { useQueries, useQueryClient } from "@tanstack/react-query";
|
||||
import { findMemoInCollectionQueries, memoDetailQueryOptions } from "@/hooks/useMemoQueries";
|
||||
import { type MemoRelation_Memo, MemoRelation_MemoSchema } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { type MemoRelation_MemoRef, MemoRelation_MemoRefSchema } from "@/types/proto/api/memo_service_pb";
|
||||
|
||||
export const useResolvedRelationMemos = (memoNames: string[], options?: { enabled?: boolean }) => {
|
||||
const client = useQueryClient();
|
||||
@@ -13,11 +13,11 @@ export const useResolvedRelationMemos = (memoNames: string[], options?: { enable
|
||||
initialData: () => findMemoInCollectionQueries(client, name, true),
|
||||
})),
|
||||
});
|
||||
const resolved: Record<string, MemoRelation_Memo | null> = {};
|
||||
const resolved: Record<string, MemoRelation_MemoRef | null> = {};
|
||||
queries.forEach((query, index) => {
|
||||
if (query.data === null) resolved[names[index]] = null;
|
||||
else if (query.data) {
|
||||
resolved[names[index]] = create(MemoRelation_MemoSchema, { name: query.data.name, snippet: query.data.snippet });
|
||||
resolved[names[index]] = create(MemoRelation_MemoRefSchema, { name: query.data.name, snippet: query.data.snippet });
|
||||
}
|
||||
});
|
||||
return resolved;
|
||||
|
||||
@@ -11,7 +11,7 @@ import { NewMemoProvider } from "@/contexts/NewMemoContext";
|
||||
import { useSpaceContext } from "@/contexts/SpaceContext";
|
||||
import { useView } from "@/contexts/ViewContext";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
// The cards' own bottom margin sets the gap; the row's edge lines up with theirs.
|
||||
|
||||
@@ -3,9 +3,9 @@ import { FileIcon } from "lucide-react";
|
||||
import { useMemo } from "react";
|
||||
import { extractMemoIdFromName } from "@/lib/resource-names";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import { MemoSchema } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import { MemoSchema } from "@/types/proto/api/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import { getAttachmentType, isMotionAttachment } from "@/utils/attachment";
|
||||
import { filterInlineManagedAttachments } from "@/utils/managed-attachment";
|
||||
import { buildAttachmentVisualItems, countLogicalAttachmentItems } from "@/utils/media-item";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { memo } from "react";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import type { Memo, Reaction } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import type { Memo, Reaction } from "@/types/proto/api/memo_service_pb";
|
||||
import { useReactionGroups } from "./hooks";
|
||||
import ReactionSelector from "./ReactionSelector";
|
||||
import ReactionView from "./ReactionView";
|
||||
|
||||
@@ -3,7 +3,7 @@ import { type ReactElement, useState } from "react";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import { useInstance } from "@/contexts/InstanceContext";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { useReactionActions } from "./hooks";
|
||||
import { REACTION_ADD_CLASSES } from "./ReactionView";
|
||||
|
||||
@@ -2,9 +2,9 @@ import { FOCUS_VISIBLE_OUTLINE_CLASSES } from "@/components/ui/focus";
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import { formatReactionTooltip, useReactionActions } from "./hooks";
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useResolvedUsersByNames } from "@/components/MemoContent/MentionResolut
|
||||
import { memoServiceClient } from "@/connect";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { memoKeys } from "@/hooks/useMemoQueries";
|
||||
import type { Memo, Reaction } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { Memo, Reaction } from "@/types/proto/api/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
|
||||
export type ReactionGroup = Map<string, User[]>;
|
||||
|
||||
@@ -51,7 +51,7 @@ export const useReactionActions = ({ memo, onComplete }: UseReactionActionsOptio
|
||||
await Promise.all(reactions.map((reaction) => memoServiceClient.deleteMemoReaction({ name: reaction.name })));
|
||||
} else {
|
||||
await memoServiceClient.upsertMemoReaction({
|
||||
name: memo.name,
|
||||
parent: memo.name,
|
||||
reaction: { reactionType },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import { useAuth } from "@/contexts/AuthContext";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { isMemoBlurred } from "@/lib/tag";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import { lazyWithReload } from "@/utils/lazy";
|
||||
import { canManageMemo } from "@/utils/user";
|
||||
import { MemoBody, MemoCommentListView, MemoHeader } from "./components";
|
||||
|
||||
@@ -2,9 +2,9 @@ import { timestampDate } from "@bufbuild/protobuf/wkt";
|
||||
import { createContext, useContext } from "react";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { useView } from "@/contexts/ViewContext";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { MemoRelation_Type } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { MemoRelation_Type } from "@/types/proto/api/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import type { PreviewMediaItem } from "@/utils/media-item";
|
||||
import { RELATIVE_TIME_THRESHOLD_MS } from "./constants";
|
||||
import { isMemoDetailPath } from "./navigation";
|
||||
|
||||
@@ -37,7 +37,7 @@ const MemoCommentListView: React.FC = () => {
|
||||
enabled: isNearViewport && !isInMemoDetailPage && commentAmount > 0,
|
||||
pageSize: 3,
|
||||
});
|
||||
const comments = data?.memos ?? [];
|
||||
const comments = data?.comments ?? [];
|
||||
const displayedComments = comments.slice(0, 3);
|
||||
const { data: commentCreators } = useUsersByNames(displayedComments.map((comment) => comment.creator));
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ import { useNewMemo } from "@/contexts/NewMemoContext";
|
||||
import i18n from "@/i18n";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { getCreatorHomePath } from "@/router/routes";
|
||||
import { Visibility } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { Visibility } from "@/types/proto/api/memo_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { getVisibilityOption } from "@/utils/memo";
|
||||
import MemoActionMenu from "../../MemoActionMenu";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
|
||||
/** How the header names the memo's time: relative to now, or just the clock time for lists that already name the day. */
|
||||
export type MemoTimeDisplay = "relative" | "time";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ParenthesesIcon } from "lucide-react";
|
||||
import CustomIcon from "@/components/CustomIcon";
|
||||
import type { MemoView_Icon } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { MemoView_Icon } from "@/types/proto/api/user_service_pb";
|
||||
|
||||
const MemoViewIcon = ({ icon, className }: { icon?: MemoView_Icon; className?: string }) => (
|
||||
<CustomIcon icon={icon} className={className} fallback={ParenthesesIcon} />
|
||||
|
||||
@@ -13,8 +13,8 @@ import { hoistMemoToFront } from "@/hooks/useMemoSorting";
|
||||
import { combineCELFilters } from "@/lib/cel-filter";
|
||||
import { DEFAULT_LIST_MEMOS_PAGE_SIZE, LOADING_INDICATOR_DELAY_MS } from "@/lib/constants";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import ColumnGrid, { ColumnGridUntrappedProvider, columnCountForWidth, GRID_GAP } from "../ColumnGrid";
|
||||
import MemoFilters from "../MemoFilters";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CLAMP_PREVIEW_HEIGHT_PX, CLAMP_TRIGGER_HEIGHT_PX } from "@/components/ClampedSection";
|
||||
import type { Attachment } from "@/types/proto/api/v1/attachment_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import { MemoRelation_Type } from "@/types/proto/api/v1/memo_service_pb";
|
||||
import type { Attachment } from "@/types/proto/api/attachment_service_pb";
|
||||
import type { Memo } from "@/types/proto/api/memo_service_pb";
|
||||
import { MemoRelation_Type } from "@/types/proto/api/memo_service_pb";
|
||||
import { getAttachmentType, isMotionAttachment } from "@/utils/attachment";
|
||||
import { filterInlineManagedAttachments } from "@/utils/managed-attachment";
|
||||
import { buildAttachmentVisualItems } from "@/utils/media-item";
|
||||
|
||||
@@ -52,7 +52,7 @@ function PasswordSignInForm({ redirectPath }: PasswordSignInFormProps) {
|
||||
);
|
||||
// Store access token from login response
|
||||
if (response.accessToken) {
|
||||
setAccessToken(response.accessToken, response.accessTokenExpiresAt ? timestampDate(response.accessTokenExpiresAt) : undefined);
|
||||
setAccessToken(response.accessToken, response.accessTokenExpireTime ? timestampDate(response.accessTokenExpireTime) : undefined);
|
||||
}
|
||||
await initialize();
|
||||
navigateTo(redirectPath || ROUTES.HOME, { replace: true });
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
InstanceSetting_TranscriptionConfig,
|
||||
InstanceSetting_TranscriptionConfigSchema,
|
||||
InstanceSettingSchema,
|
||||
} from "@/types/proto/api/v1/instance_service_pb";
|
||||
} from "@/types/proto/api/instance_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import SettingGroup from "./SettingGroup";
|
||||
import { SettingPanel } from "./SettingList";
|
||||
|
||||
@@ -11,7 +11,7 @@ import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { useDialog } from "@/hooks/useDialog";
|
||||
import { WEB_CLIPPER_URL } from "@/lib/constants";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { CreatePersonalAccessTokenResponse, PersonalAccessToken } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { CreatePersonalAccessTokenResponse, PersonalAccessToken } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import CreateAccessTokenDialog from "../CreateAccessTokenDialog";
|
||||
import SettingSection from "./SettingSection";
|
||||
@@ -20,7 +20,7 @@ const EXPIRING_SOON_MS = 30 * 24 * 60 * 60 * 1000;
|
||||
|
||||
const ApiUsageExample = () => {
|
||||
const t = useTranslate();
|
||||
const example = `curl ${window.location.origin}/api/v1/memos \\\n -H "Authorization: Bearer memos_pat_..."`;
|
||||
const example = `curl ${window.location.origin}/api/memos \\\n -H "Authorization: Bearer memos_pat_..."`;
|
||||
|
||||
const handleCopy = () => {
|
||||
copy(example);
|
||||
@@ -61,8 +61,8 @@ const listAccessTokens = async (parent: string) => {
|
||||
const { personalAccessTokens } = await userServiceClient.listPersonalAccessTokens({ parent });
|
||||
return personalAccessTokens.sort(
|
||||
(a, b) =>
|
||||
((b.createdAt ? timestampDate(b.createdAt) : undefined)?.getTime() ?? 0) -
|
||||
((a.createdAt ? timestampDate(a.createdAt) : undefined)?.getTime() ?? 0),
|
||||
((b.createTime ? timestampDate(b.createTime) : undefined)?.getTime() ?? 0) -
|
||||
((a.createTime ? timestampDate(a.createTime) : undefined)?.getTime() ?? 0),
|
||||
);
|
||||
};
|
||||
|
||||
@@ -160,8 +160,8 @@ const EmptyState = ({ onCreate }: { onCreate: () => void }) => {
|
||||
|
||||
const TokenRow = ({ token, onDelete }: { token: PersonalAccessToken; onDelete: (token: PersonalAccessToken) => void }) => {
|
||||
const t = useTranslate();
|
||||
const lastUsedAt = token.lastUsedAt ? timestampDate(token.lastUsedAt) : undefined;
|
||||
const expiresAt = token.expiresAt ? timestampDate(token.expiresAt) : undefined;
|
||||
const lastUsedAt = token.lastUseTime ? timestampDate(token.lastUseTime) : undefined;
|
||||
const expiresAt = token.expireTime ? timestampDate(token.expireTime) : undefined;
|
||||
const status = getTokenStatus(lastUsedAt, expiresAt);
|
||||
|
||||
return (
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Switch } from "@/components/ui/switch";
|
||||
import { identityProviderServiceClient } from "@/connect";
|
||||
import { useInstance } from "@/contexts/InstanceContext";
|
||||
import useDialog from "@/hooks/useDialog";
|
||||
import { IdentityProvider } from "@/types/proto/api/v1/idp_service_pb";
|
||||
import { IdentityProvider } from "@/types/proto/api/idp_service_pb";
|
||||
import {
|
||||
InstanceAccessMode,
|
||||
InstanceSetting_AccessSetting,
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
InstanceSetting_GeneralSettingSchema,
|
||||
InstanceSetting_Key,
|
||||
InstanceSettingSchema,
|
||||
} from "@/types/proto/api/v1/instance_service_pb";
|
||||
} from "@/types/proto/api/instance_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import UpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog";
|
||||
import SettingGroup from "./SettingGroup";
|
||||
|
||||
@@ -12,7 +12,7 @@ import { useCreateSpaceInvitation } from "@/hooks/useSpaceQueries";
|
||||
import { useUsersByUsernames } from "@/hooks/useUserQueries";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { extractSpaceUidFromName } from "@/lib/space-display";
|
||||
import { type Space, SpaceInvitationSchema, SpaceMember_Role } from "@/types/proto/api/v1/space_service_pb";
|
||||
import { type Space, SpaceInvitationSchema, SpaceMember_Role } from "@/types/proto/api/space_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
const LOOKUP_DELAY_MS = 300;
|
||||
|
||||
@@ -8,8 +8,8 @@ import { identityProviderServiceClient, userServiceClient } from "@/connect";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { absolutifyLink } from "@/lib/browser";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { IdentityProvider, IdentityProvider_Type } from "@/types/proto/api/v1/idp_service_pb";
|
||||
import { LinkedIdentity } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { IdentityProvider, IdentityProvider_Type } from "@/types/proto/api/idp_service_pb";
|
||||
import { LinkedIdentity } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { storeOAuthState } from "@/utils/oauth";
|
||||
import SettingGroup from "./SettingGroup";
|
||||
@@ -20,7 +20,7 @@ interface LinkedIdentityRow extends Record<string, unknown> {
|
||||
providerUid: string;
|
||||
title: string;
|
||||
typeLabel: string;
|
||||
externUid: string;
|
||||
externalUid: string;
|
||||
isLinked: boolean;
|
||||
linkedIdentity?: LinkedIdentity;
|
||||
identityProvider: IdentityProvider;
|
||||
@@ -63,8 +63,8 @@ const LinkedIdentitySection = () => {
|
||||
const linkedIdentityByProviderName = useMemo(() => {
|
||||
const mapping = new Map<string, LinkedIdentity>();
|
||||
for (const linkedIdentity of linkedIdentityList) {
|
||||
if (!mapping.has(linkedIdentity.idpName)) {
|
||||
mapping.set(linkedIdentity.idpName, linkedIdentity);
|
||||
if (!mapping.has(linkedIdentity.identityProvider)) {
|
||||
mapping.set(linkedIdentity.identityProvider, linkedIdentity);
|
||||
}
|
||||
}
|
||||
return mapping;
|
||||
@@ -79,7 +79,7 @@ const LinkedIdentitySection = () => {
|
||||
providerUid: getSSOProviderUid(identityProvider.name),
|
||||
title: identityProvider.title,
|
||||
typeLabel: getIdentityProviderTypeLabel(identityProvider.type),
|
||||
externUid: linkedIdentity?.externUid ?? "",
|
||||
externalUid: linkedIdentity?.externalUid ?? "",
|
||||
isLinked: !!linkedIdentity,
|
||||
linkedIdentity,
|
||||
identityProvider,
|
||||
@@ -163,7 +163,7 @@ const LinkedIdentitySection = () => {
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "externUid",
|
||||
key: "externalUid",
|
||||
header: t("setting.sso.account"),
|
||||
render: (_, row: LinkedIdentityRow) => (
|
||||
<div className="flex min-w-[22rem] flex-col gap-2">
|
||||
@@ -171,8 +171,8 @@ const LinkedIdentitySection = () => {
|
||||
<Badge variant={row.isLinked ? "default" : "outline"} className="rounded-full px-2.5 py-0.5">
|
||||
{row.isLinked ? t("setting.sso.linked") : t("setting.sso.not-linked")}
|
||||
</Badge>
|
||||
{row.isLinked && row.externUid ? (
|
||||
<InfoChip label={t("setting.sso.extern-uid")} value={row.externUid} tooltip={row.externUid} />
|
||||
{row.isLinked && row.externalUid ? (
|
||||
<InfoChip label={t("setting.sso.extern-uid")} value={row.externalUid} tooltip={row.externalUid} />
|
||||
) : null}
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
|
||||
@@ -14,8 +14,8 @@ import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { useDialog } from "@/hooks/useDialog";
|
||||
import { useDeleteUser, useListUsers } from "@/hooks/useUserQueries";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { State } from "@/types/proto/api/v1/common_pb";
|
||||
import { User, User_Role } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { State } from "@/types/proto/api/common_pb";
|
||||
import { User, User_Role } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import CreateUserDialog from "../CreateUserDialog";
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/dropdown-menu";
|
||||
|
||||
@@ -10,8 +10,8 @@ import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { getErrorMessage } from "@/lib/error";
|
||||
import { exportMemos, importStagedMemos, type StagedMemoImport, stageMemoImport } from "@/lib/memo-export";
|
||||
import type { MemoImportIssue, MemoImportReport } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { ImportMemosRequest_ConflictPolicy } from "@/types/proto/api/v1/user_service_pb";
|
||||
import type { ImportMemosIssue, ImportMemosReport } from "@/types/proto/api/user_service_pb";
|
||||
import { ImportMemosRequest_ConflictPolicy } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import SettingGroup from "./SettingGroup";
|
||||
import { SettingList, SettingListItem, StatRow } from "./SettingList";
|
||||
@@ -41,14 +41,14 @@ const POLICIES = [
|
||||
type ImportStage =
|
||||
| { kind: "idle" }
|
||||
| { kind: "review"; file: File; staged: StagedMemoImport; policy: ImportMemosRequest_ConflictPolicy }
|
||||
| { kind: "done"; report: MemoImportReport };
|
||||
| { kind: "done"; report: ImportMemosReport };
|
||||
|
||||
const IssueList = ({ issues, tone }: { issues: MemoImportIssue[]; tone: "warning" | "failure" }) => {
|
||||
const IssueList = ({ issues, tone }: { issues: ImportMemosIssue[]; tone: "warning" | "failure" }) => {
|
||||
if (issues.length === 0) return null;
|
||||
return (
|
||||
<ul className={`flex flex-col gap-1 text-xs ${tone === "failure" ? "text-destructive" : "text-muted-foreground"}`}>
|
||||
{issues.map((issue, index) => (
|
||||
<li key={`${tone}-${index}`}>{issue.memo ? `${issue.memo}: ${issue.message}` : issue.message}</li>
|
||||
<li key={`${tone}-${index}`}>{issue.memoUid ? `${issue.memoUid}: ${issue.message}` : issue.message}</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
@@ -153,8 +153,8 @@ const MemoExportSection = () => {
|
||||
stage.staged.plan.exportTime ? dayjs(timestampDate(stage.staged.plan.exportTime)).format("YYYY-MM-DD HH:mm") : ""
|
||||
}`}
|
||||
/>
|
||||
<StatRow label={t("setting.memo-export.review-memos")} value={String(stage.staged.plan.memos)} />
|
||||
<StatRow label={t("setting.memo-export.review-attachments")} value={String(stage.staged.plan.attachments)} />
|
||||
<StatRow label={t("setting.memo-export.review-memos")} value={String(stage.staged.plan.memoCount)} />
|
||||
<StatRow label={t("setting.memo-export.review-attachments")} value={String(stage.staged.plan.attachmentCount)} />
|
||||
<StatRow label={t("setting.memo-export.review-new")} value={String(stage.staged.plan.new + stage.staged.plan.renamed)} />
|
||||
<StatRow label={t("setting.memo-export.review-existing")} value={String(stage.staged.plan.existing)} />
|
||||
</SettingList>
|
||||
@@ -190,7 +190,9 @@ const MemoExportSection = () => {
|
||||
{t("common.cancel")}
|
||||
</Button>
|
||||
<Button size="sm" disabled={busy} onClick={handleImport}>
|
||||
{busy ? t("setting.memo-export.importing") : t("setting.memo-export.import-confirm", { count: stage.staged.plan.memos })}
|
||||
{busy
|
||||
? t("setting.memo-export.importing")
|
||||
: t("setting.memo-export.import-confirm", { count: stage.staged.plan.memoCount })}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
InstanceSetting_MemoRelatedSetting,
|
||||
InstanceSetting_MemoRelatedSettingSchema,
|
||||
InstanceSettingSchema,
|
||||
} from "@/types/proto/api/v1/instance_service_pb";
|
||||
} from "@/types/proto/api/instance_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import SettingGroup from "./SettingGroup";
|
||||
import { SettingList, SettingListItem, SettingPanel } from "./SettingList";
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
InstanceSetting_NotificationSettingSchema,
|
||||
InstanceSettingSchema,
|
||||
TestInstanceEmailSettingRequestSchema,
|
||||
} from "@/types/proto/api/v1/instance_service_pb";
|
||||
} from "@/types/proto/api/instance_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import SettingGroup from "./SettingGroup";
|
||||
import SettingRow from "./SettingRow";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { useAuth } from "@/contexts/AuthContext";
|
||||
import { useUpdateUserGeneralSetting } from "@/hooks/useUserQueries";
|
||||
import { UserSetting_GeneralSetting, UserSetting_GeneralSettingSchema } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { UserSetting_GeneralSetting, UserSetting_GeneralSettingSchema } from "@/types/proto/api/user_service_pb";
|
||||
import { loadLocale, useTranslate } from "@/utils/i18n";
|
||||
import { convertVisibilityFromString, DEFAULT_VISIBILITY_OPTIONS } from "@/utils/memo";
|
||||
import { loadTheme } from "@/utils/theme";
|
||||
|
||||
@@ -15,7 +15,7 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
|
||||
import { identityProviderServiceClient } from "@/connect";
|
||||
import { useDialog } from "@/hooks/useDialog";
|
||||
import { handleError } from "@/lib/error";
|
||||
import { IdentityProvider } from "@/types/proto/api/v1/idp_service_pb";
|
||||
import { IdentityProvider } from "@/types/proto/api/idp_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import CreateIdentityProviderDialog from "../CreateIdentityProviderDialog";
|
||||
import LearnMore from "../LearnMore";
|
||||
|
||||
@@ -47,8 +47,8 @@ import { handleError } from "@/lib/error";
|
||||
import { extractUsernameFromName } from "@/lib/resource-names";
|
||||
import { extractSpaceUidFromName } from "@/lib/space-display";
|
||||
import { ROUTES } from "@/router/routes";
|
||||
import { type Space, type SpaceInvitation, type SpaceMember, SpaceMember_Role } from "@/types/proto/api/v1/space_service_pb";
|
||||
import type { User } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { type Space, type SpaceInvitation, type SpaceMember, SpaceMember_Role } from "@/types/proto/api/space_service_pb";
|
||||
import type { User } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
type DetailTab = "general" | "members";
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
InstanceSetting_StorageSettingSchema,
|
||||
InstanceSetting_StorageType,
|
||||
InstanceSettingSchema,
|
||||
} from "@/types/proto/api/v1/instance_service_pb";
|
||||
} from "@/types/proto/api/instance_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import SettingGroup from "./SettingGroup";
|
||||
import { SettingPanel } from "./SettingList";
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
UserSetting_TagMetadataSchema,
|
||||
UserSetting_TagsSettingSchema,
|
||||
UserSettingSchema,
|
||||
} from "@/types/proto/api/v1/user_service_pb";
|
||||
} from "@/types/proto/api/user_service_pb";
|
||||
import { ColorSchema } from "@/types/proto/google/type/color_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import SettingGroup from "./SettingGroup";
|
||||
|
||||
@@ -5,7 +5,7 @@ import ConfirmDialog from "@/components/ConfirmDialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { userServiceClient } from "@/connect";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import { UserWebhook } from "@/types/proto/api/v1/user_service_pb";
|
||||
import { UserWebhook } from "@/types/proto/api/user_service_pb";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import CreateWebhookDialog from "../CreateWebhookDialog";
|
||||
import LearnMore from "../LearnMore";
|
||||
|
||||
@@ -32,7 +32,7 @@ import SSOSection from "@/components/Settings/SSOSection";
|
||||
import StorageSection from "@/components/Settings/StorageSection";
|
||||
import TagsSection from "@/components/Settings/TagsSection";
|
||||
import WebhookSection from "@/components/Settings/WebhookSection";
|
||||
import { InstanceSetting_Key } from "@/types/proto/api/v1/instance_service_pb";
|
||||
import { InstanceSetting_Key } from "@/types/proto/api/instance_service_pb";
|
||||
|
||||
export type SettingSectionKey =
|
||||
| "my-account"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { extractIdentityProviderUidFromName } from "@/lib/resource-names";
|
||||
import { type FieldMapping, type IdentityProvider, IdentityProvider_Type, type OAuth2Config } from "@/types/proto/api/v1/idp_service_pb";
|
||||
import { type FieldMapping, type IdentityProvider, IdentityProvider_Type, type OAuth2Config } from "@/types/proto/api/idp_service_pb";
|
||||
import type { Translations } from "@/utils/i18n";
|
||||
|
||||
type Translate = (key: Translations, params?: Record<string, unknown>) => string;
|
||||
|
||||
Loaded 100 of 447 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user