mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
* Add date mentions to the editor
Introduce a new "date" mention type alongside the existing user,
document and collection mentions. Typing @ with a natural language date
(e.g. "tomorrow", "next friday", "jan 2") surfaces a date suggestion,
parsed via chrono-node. Dates are stored as date-only ISO strings and
displayed with increasing granularity (Today / Tomorrow / January 2nd /
February 3rd, 2024), recomputed dynamically so relative labels stay
fresh. Clicking a date mention opens a Radix popover calendar to change
it.
* Load chrono-node lazily to keep it out of the main bundle
Convert parseNaturalLanguageDate to dynamically import chrono-node on
first use so the bundler splits it into a separate chunk fetched only
when a date is actually parsed. The mention menu now resolves the parse
asynchronously in an effect.
* Add DynamicCalendarIcon
* Lock page scroll while the date mention picker is open
Wrap the date picker popover content in RemoveScroll (via a Slot, with
the Radix content asChild), mirroring the inline editor menu, so the
page can't scroll behind the open calendar.
* Restyle the date mention calendar picker
The react-day-picker base stylesheet isn't loaded in the editor, so day
cells fell back to default browser button styling. Style the calendar
from scratch to match the rest of the app: reset button chrome, show
outside (previous/next month) days clearly de-emphasised, render the
selected day as a solid accent-filled circle, and emphasise today with
the accent colour. Enable showOutsideDays and fixedWeeks for a stable
6-week grid.
* Share one themed Calendar between the date mention and API key pickers
Extract the custom react-day-picker styling into a reusable Calendar
component and use it in both the date mention picker and the API key
expiry picker, so they look identical. The calendar owns its own padding
and the API key scene no longer needs the library's base stylesheet.
* Make the ISO date the single source of truth for date mentions
Date mentions no longer persist a human-readable label in the ProseMirror
data. Instead the displayed text, plaintext, DOM text and markdown link
text are all derived from the ISO modelId, so the saved data can never
drift or go stale. parseDOM/parseMarkdown no longer capture rendered text
as a label for dates, and the mention menu/picker stop writing one.
* tweaks
* Make DynamicCalendarIcon day text contrast with its fill
The day number is rendered white with mix-blend-mode difference, which
produces the exact inverse of the icon's (currentColor) fill, so it stays
legible whatever colour the icon takes. The SVG is isolated so the blend
only considers the icon's own fill.
* Lazy-load the date picker to keep Radix out of the editor schema graph
Importing @radix-ui/react-popover and react-day-picker at the top of
Mentions.tsx pulled them into the editor schema's static import graph,
which is also loaded on the server. Radix's prebuilt ESM does a bare
"react/jsx-runtime" import that the node/shared test resolvers can't
resolve, breaking all server and shared editor test suites.
Move the popover + calendar into DateMentionPicker, loaded via
React.lazy, so the browser-only dependencies are code-split out of the
schema graph and only fetched when an editable date mention renders.
* Deprecate block menu date/time commands in favor of date mention
Replace the block menu "Current date" entry so it inserts a date mention
for today instead of a static string/template token, and remove the
"Current time" and "Current date and time" entries. The underlying
DateTime extension and its {date}/{time}/{datetime} template placeholders
are left intact so existing documents and templates keep working.
* Omit the year from dateToReadable within the current year
dateToReadable now formats current-year dates without the year (e.g.
"June 8th") and includes it otherwise (e.g. "February 3rd, 2024"). This
keeps the mention menu subtitle compact while the relative title shows
"Today"/"Tomorrow".
* Let date mentions inherit surrounding font weight
The .mention style fixes font-weight to 500, which prevented a date
mention placed inside a heading from rendering bold like the rest of the
heading. Date mentions are plain text, so they now inherit the font
weight of their context.
* Address review feedback on date mentions
- MentionMenu: catch rejected date-parse promises so a chunk-load failure
clears the suggestion instead of leaving stale state / an unhandled rejection.
- parseNaturalLanguageDate: don't cache a rejected chrono import so a later
parse can retry after a transient failure.
- parseISODate: reject strings with a time component to honor the date-only
contract and keep day-granular comparisons correct.
- DynamicCalendarIcon: mark the decorative SVG aria-hidden / focusable=false.
* tweaks
---------
Co-authored-by: Claude <noreply@anthropic.com>
790 lines
21 KiB
TypeScript
790 lines
21 KiB
TypeScript
/** Available user roles. */
|
|
export enum UserRole {
|
|
Admin = "admin",
|
|
Member = "member",
|
|
Viewer = "viewer",
|
|
Guest = "guest",
|
|
}
|
|
|
|
/** Scopes for OAuth and API keys. */
|
|
export enum Scope {
|
|
Read = "read",
|
|
Write = "write",
|
|
Create = "create",
|
|
}
|
|
|
|
export type DateFilter = "day" | "week" | "month" | "year";
|
|
|
|
export enum StatusFilter {
|
|
Published = "published",
|
|
Archived = "archived",
|
|
Draft = "draft",
|
|
}
|
|
|
|
export enum SortFilter {
|
|
CreatedAt = "createdAt",
|
|
UpdatedAt = "updatedAt",
|
|
Title = "title",
|
|
}
|
|
|
|
export enum DirectionFilter {
|
|
ASC = "ASC",
|
|
DESC = "DESC",
|
|
}
|
|
|
|
/** Model types that support search indexing. */
|
|
export enum SearchableModel {
|
|
Document = "document",
|
|
Collection = "collection",
|
|
Comment = "comment",
|
|
}
|
|
|
|
export enum CollectionStatusFilter {
|
|
Archived = "archived",
|
|
}
|
|
|
|
export enum CommentStatusFilter {
|
|
Resolved = "resolved",
|
|
Unresolved = "unresolved",
|
|
}
|
|
|
|
export enum Client {
|
|
Web = "web",
|
|
Desktop = "desktop",
|
|
}
|
|
|
|
export enum ExportContentType {
|
|
Markdown = "text/markdown",
|
|
Html = "text/html",
|
|
Pdf = "application/pdf",
|
|
}
|
|
|
|
export enum FileOperationFormat {
|
|
JSON = "json",
|
|
MarkdownZip = "outline-markdown",
|
|
HTMLZip = "html",
|
|
PDF = "pdf",
|
|
Notion = "notion",
|
|
}
|
|
|
|
export enum FileOperationType {
|
|
Import = "import",
|
|
Export = "export",
|
|
}
|
|
|
|
export enum FileOperationState {
|
|
Creating = "creating",
|
|
Uploading = "uploading",
|
|
Complete = "complete",
|
|
Error = "error",
|
|
Expired = "expired",
|
|
}
|
|
|
|
export enum ImportState {
|
|
Created = "created",
|
|
InProgress = "in_progress",
|
|
Processed = "processed",
|
|
Completed = "completed",
|
|
Errored = "errored",
|
|
Canceled = "canceled",
|
|
}
|
|
|
|
export enum ImportTaskState {
|
|
Created = "created",
|
|
InProgress = "in_progress",
|
|
Completed = "completed",
|
|
Errored = "errored",
|
|
Canceled = "canceled",
|
|
}
|
|
|
|
/**
|
|
* Classifies the work an `ImportTask` row represents. Set when the task is
|
|
* created and used by `APIImportTask` to dispatch to the right handler.
|
|
*
|
|
* - `Bootstrap` runs once per import on a worker that owns the source
|
|
* artifact (e.g. extracts a zip, discovers structure, schedules child
|
|
* tasks). Subclasses without a bootstrap step never produce these.
|
|
* - `Page` is the per-document work that the bootstrap (or `ImportsProcessor`
|
|
* for sources without a bootstrap, like Notion) fans out into.
|
|
*/
|
|
export enum ImportTaskPhase {
|
|
Bootstrap = "bootstrap",
|
|
Page = "page",
|
|
}
|
|
|
|
export enum MentionType {
|
|
User = "user",
|
|
Document = "document",
|
|
Collection = "collection",
|
|
Group = "group",
|
|
Issue = "issue",
|
|
PullRequest = "pull_request",
|
|
Project = "project",
|
|
URL = "url",
|
|
Date = "date",
|
|
}
|
|
|
|
export type PublicEnv = {
|
|
ROOT_SHARE_ID?: string;
|
|
analytics: {
|
|
service: IntegrationService;
|
|
settings: IntegrationSettings<IntegrationType.Analytics>;
|
|
}[];
|
|
};
|
|
|
|
export enum AttachmentPreset {
|
|
DocumentAttachment = "documentAttachment",
|
|
WorkspaceImport = "workspaceImport",
|
|
Import = "import",
|
|
Avatar = "avatar",
|
|
Emoji = "emoji",
|
|
}
|
|
|
|
export enum IntegrationType {
|
|
/** An integration that posts updates to an external system. */
|
|
Post = "post",
|
|
/** An integration that listens for commands from an external system. */
|
|
Command = "command",
|
|
/** An integration that embeds content from an external system. */
|
|
Embed = "embed",
|
|
/** An integration that captures analytics data. */
|
|
Analytics = "analytics",
|
|
/** An integration that maps an Outline user to an external service. */
|
|
LinkedAccount = "linkedAccount",
|
|
/** An integration that imports documents into Outline. */
|
|
Import = "import",
|
|
}
|
|
|
|
export enum IntegrationService {
|
|
Diagrams = "diagrams",
|
|
Grist = "grist",
|
|
Slack = "slack",
|
|
GoogleAnalytics = "google-analytics",
|
|
Matomo = "matomo",
|
|
Umami = "umami",
|
|
GitHub = "github",
|
|
GitLab = "gitlab",
|
|
Linear = "linear",
|
|
Figma = "figma",
|
|
Notion = "notion",
|
|
Markdown = "markdown",
|
|
JSON = "json",
|
|
}
|
|
|
|
export type ImportableIntegrationService = Extract<
|
|
IntegrationService,
|
|
| IntegrationService.Notion
|
|
| IntegrationService.Markdown
|
|
| IntegrationService.JSON
|
|
>;
|
|
|
|
export const ImportableIntegrationService = {
|
|
Notion: IntegrationService.Notion,
|
|
Markdown: IntegrationService.Markdown,
|
|
JSON: IntegrationService.JSON,
|
|
} as const;
|
|
|
|
export type IssueTrackerIntegrationService = Extract<
|
|
IntegrationService,
|
|
| IntegrationService.GitHub
|
|
| IntegrationService.GitLab
|
|
| IntegrationService.Linear
|
|
>;
|
|
|
|
export const IssueTrackerIntegrationService = {
|
|
GitHub: IntegrationService.GitHub,
|
|
GitLab: IntegrationService.GitLab,
|
|
Linear: IntegrationService.Linear,
|
|
} as const;
|
|
|
|
export type UserCreatableIntegrationService = Extract<
|
|
IntegrationService,
|
|
| IntegrationService.Diagrams
|
|
| IntegrationService.Grist
|
|
| IntegrationService.GoogleAnalytics
|
|
| IntegrationService.Matomo
|
|
| IntegrationService.Umami
|
|
| IntegrationService.GitLab
|
|
>;
|
|
|
|
export const UserCreatableIntegrationService = {
|
|
Diagrams: IntegrationService.Diagrams,
|
|
Grist: IntegrationService.Grist,
|
|
GoogleAnalytics: IntegrationService.GoogleAnalytics,
|
|
Matomo: IntegrationService.Matomo,
|
|
Umami: IntegrationService.Umami,
|
|
GitLab: IntegrationService.GitLab,
|
|
} as const;
|
|
|
|
export enum CollectionPermission {
|
|
Read = "read",
|
|
ReadWrite = "read_write",
|
|
Admin = "admin",
|
|
}
|
|
|
|
export enum DocumentPermission {
|
|
Read = "read",
|
|
ReadWrite = "read_write",
|
|
Admin = "admin",
|
|
}
|
|
|
|
export enum GroupPermission {
|
|
Member = "member",
|
|
Admin = "admin",
|
|
}
|
|
|
|
/** Settings stored on an AuthenticationProvider for group synchronization. */
|
|
export interface AuthenticationProviderSettings {
|
|
/** Whether group sync from this provider is enabled. */
|
|
groupSyncEnabled?: boolean;
|
|
/**
|
|
* The claim path in the OIDC userinfo/id_token response that contains
|
|
* group data (e.g. "groups", "roles", "custom.groups").
|
|
*/
|
|
groupClaim?: string;
|
|
/**
|
|
* Additional scopes to request when group sync is enabled
|
|
* (e.g. "groups" for OIDC).
|
|
*/
|
|
groupSyncScopes?: string[];
|
|
}
|
|
|
|
export type IntegrationSettings<T> = T extends IntegrationType.Embed
|
|
? {
|
|
url?: string;
|
|
github?: {
|
|
installation: {
|
|
id: number;
|
|
account: { id: number; name: string; avatarUrl: string };
|
|
};
|
|
};
|
|
gitlab?: {
|
|
url?: string;
|
|
installation?: {
|
|
id: number;
|
|
account: { id: number; name: string; avatarUrl: string };
|
|
};
|
|
};
|
|
linear?: {
|
|
workspace: { id: string; name: string; key: string; logoUrl?: string };
|
|
};
|
|
diagrams?: {
|
|
url: string;
|
|
};
|
|
}
|
|
: 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 };
|
|
}
|
|
: T extends IntegrationType.LinkedAccount
|
|
? {
|
|
slack?: { serviceTeamId: string; serviceUserId: string };
|
|
figma?: {
|
|
account: {
|
|
id: string;
|
|
name: string;
|
|
email: string;
|
|
avatarUrl: string;
|
|
};
|
|
};
|
|
}
|
|
:
|
|
| { url: string }
|
|
| {
|
|
github?: {
|
|
installation: {
|
|
id: number;
|
|
account: {
|
|
id?: number;
|
|
name: string;
|
|
avatarUrl?: string;
|
|
};
|
|
};
|
|
};
|
|
gitlab?: {
|
|
url?: string;
|
|
installation?: {
|
|
id: number;
|
|
account: {
|
|
id?: number;
|
|
name: string;
|
|
avatarUrl?: string;
|
|
};
|
|
};
|
|
};
|
|
diagrams?: {
|
|
url: string;
|
|
};
|
|
}
|
|
| { serviceTeamId: string }
|
|
| { measurementId: string }
|
|
| undefined;
|
|
|
|
export enum UserPreference {
|
|
/** Whether reopening the app should redirect to the last viewed document. */
|
|
RememberLastPath = "rememberLastPath",
|
|
/** If web-style hand pointer should be used on interactive elements. */
|
|
UseCursorPointer = "useCursorPointer",
|
|
/** Whether code blocks should show line numbers. */
|
|
CodeBlockLineNumers = "codeBlockLineNumbers",
|
|
/** Whether documents have a separate edit mode instead of always editing. */
|
|
SeamlessEdit = "seamlessEdit",
|
|
/** Whether documents should start in full-width mode. */
|
|
FullWidthDocuments = "fullWidthDocuments",
|
|
/** Whether to sort the comments by their order in the document. */
|
|
SortCommentsByOrderInDocument = "sortCommentsByOrderInDocument",
|
|
/** Whether smart text replacements should be enabled. */
|
|
EnableSmartText = "enableSmartText",
|
|
/** The style of notification badge to display. */
|
|
NotificationBadge = "notificationBadge",
|
|
}
|
|
|
|
export enum NotificationBadgeType {
|
|
/** Do not show a notification badge. */
|
|
Disabled = "disabled",
|
|
/** Show the unread notification count. */
|
|
Count = "count",
|
|
/** Show an unread indicator dot. */
|
|
Indicator = "indicator",
|
|
}
|
|
|
|
export type UserPreferences = {
|
|
[UserPreference.RememberLastPath]?: boolean;
|
|
[UserPreference.UseCursorPointer]?: boolean;
|
|
[UserPreference.CodeBlockLineNumers]?: boolean;
|
|
[UserPreference.SeamlessEdit]?: boolean;
|
|
[UserPreference.FullWidthDocuments]?: boolean;
|
|
[UserPreference.SortCommentsByOrderInDocument]?: boolean;
|
|
[UserPreference.EnableSmartText]?: boolean;
|
|
[UserPreference.NotificationBadge]?: NotificationBadgeType;
|
|
};
|
|
|
|
export type SourceMetadata = {
|
|
/** The original source file name. */
|
|
fileName?: string;
|
|
/** The original source mime type. */
|
|
mimeType?: string;
|
|
/** The creator of the original external source. */
|
|
createdByName?: string;
|
|
/** An ID in the external source. */
|
|
externalId?: string;
|
|
/** Original name in the external source. */
|
|
externalName?: string;
|
|
/** Whether the item was created through a trial license. */
|
|
trial?: boolean;
|
|
/** The ID of the original document when this document was duplicated. */
|
|
originalDocumentId?: string;
|
|
};
|
|
|
|
export type CustomTheme = {
|
|
accent: string;
|
|
accentText: string;
|
|
};
|
|
|
|
export type PublicTeam = {
|
|
avatarUrl: string;
|
|
name: string;
|
|
customTheme: Partial<CustomTheme>;
|
|
tocPosition: TOCPosition;
|
|
};
|
|
|
|
export enum TOCPosition {
|
|
Left = "left",
|
|
Right = "right",
|
|
}
|
|
|
|
export enum EmailDisplay {
|
|
None = "none",
|
|
Members = "members",
|
|
Everyone = "everyone",
|
|
}
|
|
|
|
export enum TeamPreference {
|
|
/** Whether documents have a separate edit mode instead of always editing. */
|
|
SeamlessEdit = "seamlessEdit",
|
|
/** Whether to use team logo across the app for branding. */
|
|
PublicBranding = "publicBranding",
|
|
/** Whether viewers should see download options. */
|
|
ViewersCanExport = "viewersCanExport",
|
|
/** Whether members can invite new users. */
|
|
MembersCanInvite = "membersCanInvite",
|
|
/** Whether members can create API keys. */
|
|
MembersCanCreateApiKey = "membersCanCreateApiKey",
|
|
/** Whether members can delete their user account. */
|
|
MembersCanDeleteAccount = "membersCanDeleteAccount",
|
|
/** Whether notification emails include document and comment content. */
|
|
PreviewsInEmails = "previewsInEmails",
|
|
/** Whether users can comment on documents. */
|
|
Commenting = "commenting",
|
|
/** The custom theme for the team. */
|
|
CustomTheme = "customTheme",
|
|
/** Side to display the document's table of contents in relation to the main content. */
|
|
TocPosition = "tocPosition",
|
|
/** Whether to prevent shared documents from being embedded in iframes on external websites. */
|
|
PreventDocumentEmbedding = "preventDocumentEmbedding",
|
|
/** Who can see user email addresses. */
|
|
EmailDisplay = "emailDisplay",
|
|
/** Whether external MCP clients can connect to the workspace. */
|
|
MCP = "mcp",
|
|
/** List of disabled embed provider titles. */
|
|
DisabledEmbeds = "disabledEmbeds",
|
|
}
|
|
|
|
export type TeamPreferences = {
|
|
[TeamPreference.SeamlessEdit]?: boolean;
|
|
[TeamPreference.PublicBranding]?: boolean;
|
|
[TeamPreference.ViewersCanExport]?: boolean;
|
|
[TeamPreference.MembersCanInvite]?: boolean;
|
|
[TeamPreference.MembersCanCreateApiKey]?: boolean;
|
|
[TeamPreference.MembersCanDeleteAccount]?: boolean;
|
|
[TeamPreference.PreviewsInEmails]?: boolean;
|
|
[TeamPreference.Commenting]?: boolean;
|
|
[TeamPreference.CustomTheme]?: Partial<CustomTheme>;
|
|
[TeamPreference.TocPosition]?: TOCPosition;
|
|
[TeamPreference.PreventDocumentEmbedding]?: boolean;
|
|
[TeamPreference.EmailDisplay]?: EmailDisplay;
|
|
[TeamPreference.MCP]?: boolean;
|
|
[TeamPreference.DisabledEmbeds]?: string[];
|
|
};
|
|
|
|
export enum NavigationNodeType {
|
|
Collection = "collection",
|
|
Document = "document",
|
|
UserMembership = "userMembership",
|
|
GroupMembership = "groupMembership",
|
|
}
|
|
|
|
export type NavigationNode = {
|
|
id: string;
|
|
title: string;
|
|
url: string;
|
|
emoji?: string;
|
|
icon?: string;
|
|
color?: string;
|
|
children: NavigationNode[];
|
|
isDraft?: boolean;
|
|
collectionId?: string;
|
|
type?: NavigationNodeType;
|
|
parent?: NavigationNode | null;
|
|
depth?: number;
|
|
};
|
|
|
|
export type CollectionSort = {
|
|
field: string;
|
|
direction: "asc" | "desc";
|
|
};
|
|
|
|
export enum SubscriptionType {
|
|
Document = "documents.update",
|
|
}
|
|
|
|
export enum NotificationEventType {
|
|
PublishDocument = "documents.publish",
|
|
UpdateDocument = "documents.update",
|
|
AddUserToDocument = "documents.add_user",
|
|
AddUserToCollection = "collections.add_user",
|
|
CreateRevision = "revisions.create",
|
|
CreateCollection = "collections.create",
|
|
CreateComment = "comments.create",
|
|
ResolveComment = "comments.resolve",
|
|
ReactionsCreate = "reactions.create",
|
|
MentionedInDocument = "documents.mentioned",
|
|
MentionedInComment = "comments.mentioned",
|
|
GroupMentionedInDocument = "documents.group_mentioned",
|
|
GroupMentionedInComment = "comments.group_mentioned",
|
|
InviteAccepted = "emails.invite_accepted",
|
|
Onboarding = "emails.onboarding",
|
|
Features = "emails.features",
|
|
ExportCompleted = "emails.export_completed",
|
|
RequestDocumentAccess = "access_requests.create",
|
|
}
|
|
|
|
export enum NotificationChannelType {
|
|
App = "app",
|
|
Email = "email",
|
|
Chat = "chat",
|
|
}
|
|
|
|
export type NotificationData = {
|
|
emoji?: string;
|
|
};
|
|
|
|
export type NotificationSettings = {
|
|
[event in NotificationEventType]?:
|
|
| {
|
|
[type in NotificationChannelType]?: boolean;
|
|
}
|
|
| boolean;
|
|
};
|
|
|
|
export const NotificationEventDefaults: Record<NotificationEventType, boolean> =
|
|
{
|
|
[NotificationEventType.PublishDocument]: false,
|
|
[NotificationEventType.UpdateDocument]: true,
|
|
[NotificationEventType.CreateCollection]: false,
|
|
[NotificationEventType.CreateComment]: true,
|
|
[NotificationEventType.ResolveComment]: true,
|
|
[NotificationEventType.ReactionsCreate]: true,
|
|
[NotificationEventType.CreateRevision]: false,
|
|
[NotificationEventType.MentionedInDocument]: true,
|
|
[NotificationEventType.MentionedInComment]: true,
|
|
[NotificationEventType.GroupMentionedInDocument]: true,
|
|
[NotificationEventType.GroupMentionedInComment]: true,
|
|
[NotificationEventType.InviteAccepted]: true,
|
|
[NotificationEventType.Onboarding]: true,
|
|
[NotificationEventType.Features]: true,
|
|
[NotificationEventType.ExportCompleted]: true,
|
|
[NotificationEventType.AddUserToDocument]: true,
|
|
[NotificationEventType.AddUserToCollection]: true,
|
|
[NotificationEventType.RequestDocumentAccess]: true,
|
|
};
|
|
|
|
export enum UnfurlResourceType {
|
|
URL = "url",
|
|
Mention = "mention",
|
|
Group = "group",
|
|
Document = "document",
|
|
Issue = "issue",
|
|
PR = "pull",
|
|
Project = "project",
|
|
}
|
|
|
|
export type UnfurlResponse = {
|
|
[UnfurlResourceType.URL]: {
|
|
/** The resource type */
|
|
type: UnfurlResourceType.URL;
|
|
/** URL pointing to the resource */
|
|
url: string;
|
|
/** A text title, describing the resource */
|
|
title: string;
|
|
/** A color representing the resource */
|
|
color?: string;
|
|
/** A brief description about the resource */
|
|
description: string;
|
|
/** A URL to a thumbnail image representing the resource */
|
|
thumbnailUrl: string;
|
|
/** A URL to a favicon representing the resource */
|
|
faviconUrl: string;
|
|
};
|
|
[UnfurlResourceType.Mention]: {
|
|
/** The resource type */
|
|
type: UnfurlResourceType.Mention;
|
|
/** Mentioned user's name */
|
|
name: string;
|
|
/** Mentioned user's email */
|
|
email: string | null;
|
|
/** Mentioned user's avatar URL */
|
|
avatarUrl: string | null;
|
|
/** Used to create mentioned user's avatar if no avatar URL provided */
|
|
color: string;
|
|
/** Mentiond user's recent activity */
|
|
lastActive: string;
|
|
};
|
|
[UnfurlResourceType.Group]: {
|
|
/** The resource type */
|
|
type: UnfurlResourceType.Group;
|
|
/** Group name */
|
|
name: string;
|
|
/** Group description */
|
|
description: string | null;
|
|
/** Number of members in the group */
|
|
memberCount: number;
|
|
/** Array of group members (limited to display count) */
|
|
users: Array<{
|
|
id: string;
|
|
name: string;
|
|
avatarUrl: string | null;
|
|
color: string;
|
|
}>;
|
|
};
|
|
[UnfurlResourceType.Document]: {
|
|
/** The resource type */
|
|
type: UnfurlResourceType.Document;
|
|
/** URL pointing to the resource */
|
|
url: string;
|
|
/** Document id */
|
|
id: string;
|
|
/** Document title */
|
|
title: string;
|
|
/** Document summary */
|
|
summary: string;
|
|
/** Viewer's last activity on this document */
|
|
lastActivityByViewer?: string;
|
|
};
|
|
[UnfurlResourceType.Issue]: {
|
|
/** The resource type */
|
|
type: UnfurlResourceType.Issue;
|
|
/** Issue link */
|
|
url: string;
|
|
/** Issue identifier */
|
|
id: string;
|
|
/** Issue title */
|
|
title: string;
|
|
/** Issue description */
|
|
description: string | null;
|
|
/** Issue's author */
|
|
author: { name: string; avatarUrl: string };
|
|
/** Issue's labels */
|
|
labels: Array<{ name: string; color: string }>;
|
|
/** Issue's status */
|
|
state: {
|
|
type?: string;
|
|
name: string;
|
|
color: string;
|
|
completionPercentage?: number;
|
|
};
|
|
/** Issue's creation time */
|
|
createdAt: string;
|
|
};
|
|
[UnfurlResourceType.PR]: {
|
|
/** The resource type */
|
|
type: UnfurlResourceType.PR;
|
|
/** Pull Request link */
|
|
url: string;
|
|
/** Pull Request identifier */
|
|
id: string;
|
|
/** Pull Request title */
|
|
title: string;
|
|
/** Pull Request description */
|
|
description: string | null;
|
|
/** Pull Request author */
|
|
author: { name: string; avatarUrl: string };
|
|
/** Pull Request status */
|
|
state: { name: string; color: string; draft?: boolean };
|
|
/** Pull Request creation time */
|
|
createdAt: string;
|
|
};
|
|
[UnfurlResourceType.Project]: {
|
|
/** The resource type */
|
|
type: UnfurlResourceType.Project;
|
|
/** Project link */
|
|
url: string;
|
|
/** Project identifier */
|
|
id: string;
|
|
/** Project name */
|
|
name: string;
|
|
/** Project color */
|
|
color: string;
|
|
/** Project avatar URL */
|
|
avatarUrl?: string;
|
|
/** Project description */
|
|
description: string | null;
|
|
/** Project lead */
|
|
lead: { name: string; avatarUrl: string } | null;
|
|
/** Project state */
|
|
state: {
|
|
name: string;
|
|
color: string;
|
|
type: string;
|
|
};
|
|
/** Project labels */
|
|
labels: Array<{ name: string; color: string }>;
|
|
/** Project progress (0-1) */
|
|
progress?: number;
|
|
/** Project creation time */
|
|
createdAt: string;
|
|
/** Project target date */
|
|
targetDate: string | null;
|
|
};
|
|
};
|
|
|
|
export enum QueryNotices {
|
|
UnsubscribeDocument = "unsubscribe-document",
|
|
UnsubscribeCollection = "unsubscribe-collection",
|
|
Subscribed = "subscribed",
|
|
Unsubscribed = "unsubscribed",
|
|
}
|
|
|
|
export type JSONValue =
|
|
| string
|
|
| number
|
|
| boolean
|
|
| undefined
|
|
| null
|
|
| { [x: string]: JSONValue }
|
|
| Array<JSONValue>;
|
|
|
|
export type JSONObject = { [x: string]: JSONValue };
|
|
|
|
export type ProsemirrorMark = {
|
|
type: string;
|
|
attrs?: JSONObject;
|
|
};
|
|
|
|
export type ProsemirrorData = {
|
|
type: string;
|
|
content?: ProsemirrorData[];
|
|
text?: string;
|
|
attrs?: JSONObject;
|
|
marks?: ProsemirrorMark[];
|
|
};
|
|
|
|
export type ProsemirrorDoc = {
|
|
type: "doc";
|
|
content: ProsemirrorData[];
|
|
};
|
|
|
|
export enum IconType {
|
|
SVG = "svg",
|
|
Emoji = "emoji",
|
|
Custom = "custom",
|
|
}
|
|
|
|
/** Edit modes for document text updates. */
|
|
export enum TextEditMode {
|
|
/** Replace existing content with new content (default). */
|
|
Replace = "replace",
|
|
/** Append new content to the end of the document. */
|
|
Append = "append",
|
|
/** Prepend new content to the beginning of the document. */
|
|
Prepend = "prepend",
|
|
/** Patch specific content within the document by finding and replacing text. */
|
|
Patch = "patch",
|
|
}
|
|
|
|
export enum EmojiCategory {
|
|
People = "People",
|
|
Nature = "Nature",
|
|
Foods = "Foods",
|
|
Activity = "Activity",
|
|
Places = "Places",
|
|
Objects = "Objects",
|
|
Symbols = "Symbols",
|
|
Flags = "Flags",
|
|
}
|
|
|
|
export enum EmojiSkinTone {
|
|
Default = "Default",
|
|
Light = "Light",
|
|
MediumLight = "MediumLight",
|
|
Medium = "Medium",
|
|
MediumDark = "MediumDark",
|
|
Dark = "Dark",
|
|
}
|
|
|
|
export type Emoji = {
|
|
id: string;
|
|
name: string;
|
|
value: string;
|
|
};
|
|
|
|
export type EmojiVariants = {
|
|
[EmojiSkinTone.Default]: Emoji;
|
|
[EmojiSkinTone.Light]?: Emoji;
|
|
[EmojiSkinTone.MediumLight]?: Emoji;
|
|
[EmojiSkinTone.Medium]?: Emoji;
|
|
[EmojiSkinTone.MediumDark]?: Emoji;
|
|
[EmojiSkinTone.Dark]?: Emoji;
|
|
};
|
|
|
|
export type ReactionSummary = {
|
|
emoji: string;
|
|
userIds: string[];
|
|
};
|