mirror of
https://github.com/outline/outline.git
synced 2026-12-05 18:55:10 +03:00
chore: Remove unused code (#14133)
* chore: Remove unused code * Restore DiscordClient
This commit is contained in:
1 parent
e14dfcfcb4
commit
9d4304a332
9 files changed
+1
-151
No files matched your search
@@ -10,7 +10,6 @@ import {
|
||||
LogoutIcon,
|
||||
ProfileIcon,
|
||||
BrowserIcon,
|
||||
ShapesIcon,
|
||||
DraftsIcon,
|
||||
BugIcon,
|
||||
ImportIcon,
|
||||
@@ -140,15 +139,6 @@ export const navigateToProfileSettings = createInternalLinkAction({
|
||||
to: settingsPath(),
|
||||
});
|
||||
|
||||
export const navigateToTemplateSettings = createInternalLinkAction({
|
||||
name: ({ t }) => t("Templates"),
|
||||
analyticsName: "Navigate to template settings",
|
||||
section: NavigationSection,
|
||||
iconInContextMenu: false,
|
||||
icon: <ShapesIcon />,
|
||||
to: settingsPath("templates"),
|
||||
});
|
||||
|
||||
export const navigateToNotificationSettings = createInternalLinkAction({
|
||||
name: ({ t, isMenu }) =>
|
||||
isMenu ? t("Notification settings") : t("Notifications"),
|
||||
|
||||
@@ -10,12 +10,6 @@ export const fadeOut = keyframes`
|
||||
to { opacity: 0; }
|
||||
`;
|
||||
|
||||
export const fadeOutCursor = keyframes`
|
||||
0% { opacity: 1; }
|
||||
90% { opacity: 1; }
|
||||
100% { opacity: 0; }
|
||||
`;
|
||||
|
||||
export const fadeAndScaleIn = keyframes`
|
||||
from {
|
||||
opacity: 0;
|
||||
@@ -76,18 +70,6 @@ export const fadeOutAndSlideRight = keyframes`
|
||||
}
|
||||
`;
|
||||
|
||||
export const mobileContextMenu = keyframes`
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(.98) translateY(10vh);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: scale(1) translateY(0px);
|
||||
}
|
||||
`;
|
||||
|
||||
export const bounceIn = keyframes`
|
||||
from,
|
||||
20%,
|
||||
@@ -162,12 +144,6 @@ export const pulse = keyframes`
|
||||
100% { transform: scale(1); }
|
||||
`;
|
||||
|
||||
export const bigPulse = keyframes`
|
||||
0% { transform: scale(1); }
|
||||
50% { transform: scale(1.2); }
|
||||
100% { transform: scale(1); }
|
||||
`;
|
||||
|
||||
/**
|
||||
* The duration of the sidebar appearing animation in ms
|
||||
*/
|
||||
|
||||
@@ -10,11 +10,7 @@ import type RootStore from "~/stores/RootStore";
|
||||
import type { SidebarContextType } from "./components/Sidebar/components/SidebarContext";
|
||||
import type Model from "./models/base/Model";
|
||||
import type Document from "./models/Document";
|
||||
import type FileOperation from "./models/FileOperation";
|
||||
import type Pin from "./models/Pin";
|
||||
import type Star from "./models/Star";
|
||||
import type User from "./models/User";
|
||||
import type UserMembership from "./models/UserMembership";
|
||||
import type Policy from "./models/Policy";
|
||||
|
||||
export type PartialExcept<T, K extends keyof T> = Partial<Omit<T, K>> &
|
||||
@@ -225,10 +221,6 @@ export type CommandBarAction = {
|
||||
parent?: string;
|
||||
};
|
||||
|
||||
export type LocationWithState = Location & {
|
||||
state: Record<string, string>;
|
||||
};
|
||||
|
||||
export type FetchOptions = {
|
||||
prefetch?: boolean;
|
||||
revisionId?: string;
|
||||
@@ -287,16 +279,6 @@ export type WebsocketCommentReactionEvent = {
|
||||
user: User;
|
||||
};
|
||||
|
||||
export type WebsocketEvent =
|
||||
| PartialExcept<Pin, "id">
|
||||
| PartialExcept<Star, "id">
|
||||
| PartialExcept<FileOperation, "id">
|
||||
| PartialExcept<UserMembership, "id">
|
||||
| WebsocketCollectionUpdateIndexEvent
|
||||
| WebsocketEntityDeletedEvent
|
||||
| WebsocketEntitiesEvent
|
||||
| WebsocketCommentReactionEvent;
|
||||
|
||||
type CursorPosition = {
|
||||
type: {
|
||||
client: number;
|
||||
|
||||
@@ -62,11 +62,6 @@ for (const extension of basicExtensionManager.extensions) {
|
||||
extension.bindEditor(stubEditor(basicSchema));
|
||||
}
|
||||
|
||||
export const basicParser = basicExtensionManager.parser({
|
||||
schema: basicSchema,
|
||||
plugins: basicExtensionManager.rulePlugins,
|
||||
});
|
||||
|
||||
const commentExtensions = [...basicExtensions, CodeBlock, CodeFence, Mention];
|
||||
export const commentExtensionManager = new ExtensionManager(commentExtensions);
|
||||
|
||||
|
||||
@@ -73,41 +73,6 @@ export function getRowIndex(state: EditorState): number | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual row index in the table map for a given visual row index
|
||||
* when merged cells are present.
|
||||
*
|
||||
* @param visualRowIndex The visual row index (0-based)
|
||||
* @param state The editor state
|
||||
* @returns The actual row index in the table map, or -1 if not found
|
||||
*/
|
||||
export function getRowIndexInMap(
|
||||
visualRowIndex: number,
|
||||
state: EditorState
|
||||
): number {
|
||||
if (!isInTable(state)) {
|
||||
return -1;
|
||||
}
|
||||
const rect = selectedRect(state);
|
||||
const cells = getCellsInColumn(0)(state);
|
||||
|
||||
if (visualRowIndex >= 0 && visualRowIndex < cells.length) {
|
||||
const cellPos = cells[visualRowIndex] - rect.tableStart;
|
||||
|
||||
// Find the row index in the table map for this cell position
|
||||
for (let row = 0; row < rect.map.height; row++) {
|
||||
const rowStart = row * rect.map.width;
|
||||
for (let col = 0; col < rect.map.width; col++) {
|
||||
if (rect.map.map[rowStart + col] === cellPos) {
|
||||
return row;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual row positions in the table map, accounting for merged cells.
|
||||
*
|
||||
@@ -142,37 +107,6 @@ export function getRowsInTable(state: EditorState): number[] {
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual column positions in the table map, accounting for merged cells.
|
||||
*
|
||||
* @param state The editor state
|
||||
* @returns Array of cell positions representing the first unique cell in each column
|
||||
*/
|
||||
export function getColumnsInTable(state: EditorState): number[] {
|
||||
if (!isInTable(state)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const rect = selectedRect(state);
|
||||
const columns: number[] = [];
|
||||
const seenCells = new Set<number>();
|
||||
|
||||
for (let col = 0; col < rect.map.width; col++) {
|
||||
// Find the topmost cell in this column
|
||||
for (let row = 0; row < rect.map.height; row++) {
|
||||
const cellPos =
|
||||
rect.tableStart + rect.map.map[row * rect.map.width + col];
|
||||
if (!seenCells.has(cellPos)) {
|
||||
columns.push(cellPos);
|
||||
seenCells.add(cellPos);
|
||||
break; // Only add the first unique cell per column
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return columns;
|
||||
}
|
||||
|
||||
export function getCellsInColumn(index: number) {
|
||||
return (state: EditorState): number[] => {
|
||||
if (!isInTable(state)) {
|
||||
|
||||
@@ -11,8 +11,6 @@ export type NodeWithPos = {
|
||||
node: ProsemirrorNode;
|
||||
};
|
||||
|
||||
export type PlainTextSerializer = (node: ProsemirrorNode) => string;
|
||||
|
||||
/** The severity of a notice surfaced to the user from the editor. */
|
||||
export type EditorNoticeType = "info" | "success" | "warning" | "error";
|
||||
|
||||
|
||||
@@ -180,7 +180,6 @@
|
||||
"Settings": "Settings",
|
||||
"Import docs": "Import docs",
|
||||
"Profile": "Profile",
|
||||
"Templates": "Templates",
|
||||
"Notification settings": "Notification settings",
|
||||
"Notifications": "Notifications",
|
||||
"Preferences": "Preferences",
|
||||
@@ -755,6 +754,7 @@
|
||||
"Last seen": "Last seen",
|
||||
"{{ time }} local time": "{{ time }} local time",
|
||||
"Your import completed": "Your import completed",
|
||||
"Templates": "Templates",
|
||||
"View comment thread": "View comment thread",
|
||||
"Previous match": "Previous match",
|
||||
"Next match": "Next match",
|
||||
|
||||
@@ -29,29 +29,6 @@ export const stringToColor = (input: string) => {
|
||||
return palette[inputAsNumber % palette.length];
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts a color to string of RGB values separated by commas
|
||||
*
|
||||
* @param color - A color string
|
||||
* @returns A string of RGB values separated by commas
|
||||
*/
|
||||
export const toRGB = (color: string) =>
|
||||
Object.values(parseToRgb(color)).join(", ");
|
||||
|
||||
/**
|
||||
* Returns the text color that contrasts the given background color
|
||||
*
|
||||
* @param background - A color string
|
||||
* @returns A color string
|
||||
*/
|
||||
export const getTextColor = (background: string) => {
|
||||
const r = parseInt(background.substring(1, 3), 16);
|
||||
const g = parseInt(background.substring(3, 5), 16);
|
||||
const b = parseInt(background.substring(5, 7), 16);
|
||||
const yiq = (r * 299 + g * 587 + b * 114) / 1000;
|
||||
return yiq >= 128 ? "black" : "white";
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the color when it is visible against the theme background, otherwise
|
||||
* the fallback. Very dark colors are not visible in the dark theme and very
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
export const validateIndexCharacters = (index: string) =>
|
||||
new RegExp("^[\x20-\x7E]+$").test(index);
|
||||
Reference in new issue
Block a user