mirror of
https://github.com/outline/outline.git
synced 2026-06-13 19:35:02 +03:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e49d2e99a3 | |||
| bfd462939c |
@@ -42,9 +42,7 @@ export const changeTheme = createAction({
|
||||
isContextMenu ? t("Appearance") : t("Change theme"),
|
||||
analyticsName: "Change theme",
|
||||
placeholder: ({ t }) => t("Change theme to"),
|
||||
icon: function _Icon() {
|
||||
return stores.ui.resolvedTheme === "light" ? <SunIcon /> : <MoonIcon />;
|
||||
},
|
||||
icon: stores.ui.resolvedTheme === "light" ? <SunIcon /> : <MoonIcon />,
|
||||
keywords: "appearance display",
|
||||
section: SettingsSection,
|
||||
children: [changeToLightTheme, changeToDarkTheme, changeToSystemTheme],
|
||||
|
||||
@@ -17,20 +17,18 @@ export const switchTeamsList = ({ stores }: { stores: RootStore }) =>
|
||||
analyticsName: "Switch workspace",
|
||||
section: TeamSection,
|
||||
keywords: "change switch workspace organization team",
|
||||
icon: function _Icon() {
|
||||
return (
|
||||
<StyledTeamLogo
|
||||
alt={session.name}
|
||||
model={{
|
||||
initial: session.name[0],
|
||||
avatarUrl: session.avatarUrl,
|
||||
id: session.id,
|
||||
color: stringToColor(session.id),
|
||||
}}
|
||||
size={24}
|
||||
/>
|
||||
);
|
||||
},
|
||||
icon: (
|
||||
<StyledTeamLogo
|
||||
alt={session.name}
|
||||
model={{
|
||||
initial: session.name[0],
|
||||
avatarUrl: session.avatarUrl,
|
||||
id: session.id,
|
||||
color: stringToColor(session.id),
|
||||
}}
|
||||
size={24}
|
||||
/>
|
||||
),
|
||||
visible: ({ currentTeamId }: ActionContext) => currentTeamId !== session.id,
|
||||
perform: () => (window.location.href = session.url),
|
||||
})) ?? [];
|
||||
|
||||
@@ -2,7 +2,7 @@ import { action } from "mobx";
|
||||
import { PlusIcon } from "outline-icons";
|
||||
import { Plugin } from "prosemirror-state";
|
||||
import { Decoration, DecorationSet } from "prosemirror-view";
|
||||
import ReactDOM from "react-dom";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { WidgetProps } from "@shared/editor/lib/Extension";
|
||||
import { PlaceholderPlugin } from "@shared/editor/plugins/PlaceholderPlugin";
|
||||
import { findParentNode } from "@shared/editor/queries/findParentNode";
|
||||
@@ -27,7 +27,7 @@ export default class BlockMenuExtension extends Suggestion {
|
||||
const button = document.createElement("button");
|
||||
button.className = "block-menu-trigger";
|
||||
button.type = "button";
|
||||
ReactDOM.render(<PlusIcon />, button);
|
||||
createRoot(button).render(<PlusIcon />);
|
||||
|
||||
return [
|
||||
...super.plugins,
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ import { LazyMotion } from "framer-motion";
|
||||
import { KBarProvider } from "kbar";
|
||||
import { Provider } from "mobx-react";
|
||||
import { StrictMode } from "react";
|
||||
import { render } from "react-dom";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { HelmetProvider } from "react-helmet-async";
|
||||
import { Router } from "react-router-dom";
|
||||
import stores from "~/stores";
|
||||
@@ -79,7 +79,7 @@ if (element) {
|
||||
</StrictMode>
|
||||
);
|
||||
|
||||
render(<App />, element);
|
||||
createRoot(element).render(<App />);
|
||||
}
|
||||
|
||||
window.addEventListener("load", async () => {
|
||||
|
||||
+7
-5
@@ -202,13 +202,13 @@
|
||||
"query-string": "^7.1.3",
|
||||
"randomstring": "1.3.1",
|
||||
"rate-limiter-flexible": "^2.4.2",
|
||||
"react": "^17.0.2",
|
||||
"react": "^18.2.0",
|
||||
"react-avatar-editor": "^13.0.2",
|
||||
"react-color": "^2.17.3",
|
||||
"react-day-picker": "^8.10.1",
|
||||
"react-dnd": "^16.0.1",
|
||||
"react-dnd-html5-backend": "^16.0.1",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-dropzone": "^11.7.1",
|
||||
"react-helmet-async": "^2.0.5",
|
||||
"react-hook-form": "^7.54.2",
|
||||
@@ -312,10 +312,10 @@
|
||||
"@types/png-chunks-extract": "^1.0.2",
|
||||
"@types/quoted-printable": "^1.0.2",
|
||||
"@types/randomstring": "^1.3.0",
|
||||
"@types/react": "^17.0.34",
|
||||
"@types/react": "^18.2.0",
|
||||
"@types/react-avatar-editor": "^13.0.4",
|
||||
"@types/react-color": "^3.0.13",
|
||||
"@types/react-dom": "^17.0.11",
|
||||
"@types/react-dom": "^18.2.0",
|
||||
"@types/react-helmet": "^6.1.11",
|
||||
"@types/react-portal": "^4.0.7",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
@@ -382,7 +382,9 @@
|
||||
"node-fetch": "^2.7.0",
|
||||
"js-yaml": "^3.14.1",
|
||||
"qs": "6.9.7",
|
||||
"prismjs": "1.30.0"
|
||||
"prismjs": "1.30.0",
|
||||
"@types/react": "^18.2.0",
|
||||
"@types/react-dom": "^18.2.0"
|
||||
},
|
||||
"version": "0.84.0",
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EditorState, Plugin } from "prosemirror-state";
|
||||
import { Decoration, DecorationSet } from "prosemirror-view";
|
||||
import * as React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import FileExtension from "../components/FileExtension";
|
||||
import { isRemoteTransaction } from "./multiplayer";
|
||||
import { recreateTransform } from "./prosemirror-recreate-transform";
|
||||
@@ -100,7 +100,9 @@ const uploadPlaceholder = new Plugin({
|
||||
subtitle.className = "subtitle";
|
||||
subtitle.innerText = "Uploading…";
|
||||
|
||||
ReactDOM.render(<FileExtension title={action.add.file.name} />, icon);
|
||||
createRoot(icon).render(
|
||||
<FileExtension title={action.add.file.name} />
|
||||
);
|
||||
|
||||
element.appendChild(icon);
|
||||
element.appendChild(title);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { wrappingInputRule } from "prosemirror-inputrules";
|
||||
import { NodeSpec, Node as ProsemirrorNode, NodeType } from "prosemirror-model";
|
||||
import { Command, EditorState, Transaction } from "prosemirror-state";
|
||||
import * as React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { Primitive } from "utility-types";
|
||||
import toggleWrap from "../commands/toggleWrap";
|
||||
import { MarkdownSerializerState } from "../lib/markdown/serializer";
|
||||
@@ -107,7 +107,7 @@ export default class Notice extends Node {
|
||||
|
||||
icon = document.createElement("div");
|
||||
icon.className = "icon";
|
||||
ReactDOM.render(component, icon);
|
||||
createRoot(icon).render(component);
|
||||
}
|
||||
|
||||
return [
|
||||
|
||||
+9
-4
@@ -18,13 +18,14 @@
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"noErrorTruncation": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitAny": false,
|
||||
"noImplicitOverride": false,
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitReturns": false,
|
||||
"noImplicitThis": false,
|
||||
"strict": false,
|
||||
"sourceMap": true,
|
||||
"resolveJsonModule": true,
|
||||
"strictNullChecks": true,
|
||||
"strictNullChecks": false,
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true,
|
||||
"ignoreDeprecations": "5.0",
|
||||
@@ -41,9 +42,13 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"**/*",
|
||||
"types/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"build",
|
||||
"server/migrations"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+70
@@ -0,0 +1,70 @@
|
||||
// React 18 compatibility fixes
|
||||
// Note: We avoid overriding React.ReactNode to prevent conflicts
|
||||
|
||||
// Missing type definitions
|
||||
declare module 'dotenv' {
|
||||
export function config(options?: any): any;
|
||||
export const config: any;
|
||||
}
|
||||
|
||||
declare module 'emoji-regex' {
|
||||
function emojiRegex(): RegExp;
|
||||
export = emojiRegex;
|
||||
}
|
||||
|
||||
declare module 'form-data' {
|
||||
class FormData {
|
||||
append(name: string, value: any, options?: any): void;
|
||||
[key: string]: any;
|
||||
}
|
||||
export = FormData;
|
||||
}
|
||||
|
||||
// Fix for styled-components compatibility with React 18
|
||||
declare module 'styled-components' {
|
||||
interface DefaultTheme {}
|
||||
|
||||
// Allow ForwardRefExoticComponent to be used with styled()
|
||||
function styled<T extends keyof JSX.IntrinsicElements | React.ComponentType<any>>(
|
||||
component: T
|
||||
): any;
|
||||
}
|
||||
|
||||
// Fix for React Router compatibility
|
||||
declare module 'react-router-dom' {
|
||||
import { ComponentType } from 'react';
|
||||
|
||||
export const Route: ComponentType<any>;
|
||||
export const Switch: ComponentType<any>;
|
||||
export const Redirect: ComponentType<any>;
|
||||
}
|
||||
|
||||
// Fix for FontAwesome compatibility
|
||||
declare module '@fortawesome/react-fontawesome' {
|
||||
import { ComponentType } from 'react';
|
||||
|
||||
export interface FAProps {
|
||||
icon?: any;
|
||||
color?: string;
|
||||
size?: any;
|
||||
className?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export const FontAwesomeIcon: ComponentType<FAProps>;
|
||||
}
|
||||
|
||||
// Fix for framer-motion AnimatePresence
|
||||
declare module 'framer-motion' {
|
||||
import { ComponentType, ReactNode } from 'react';
|
||||
|
||||
export interface AnimatePresenceProps {
|
||||
children?: ReactNode;
|
||||
initial?: boolean;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export const AnimatePresence: ComponentType<AnimatePresenceProps>;
|
||||
}
|
||||
|
||||
export {};
|
||||
@@ -5810,12 +5810,10 @@
|
||||
dependencies:
|
||||
"@types/reactcss" "*"
|
||||
|
||||
"@types/react-dom@<18.0.0", "@types/react-dom@^17.0.11":
|
||||
version "17.0.25"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.25.tgz#e0e5b3571e1069625b3a3da2b279379aa33a0cb5"
|
||||
integrity sha512-urx7A7UxkZQmThYA4So0NelOVjx3V4rNFVJwp0WZlbIK5eM4rNJDiN3R/E9ix0MBh6kAEojk/9YL+Te6D9zHNA==
|
||||
dependencies:
|
||||
"@types/react" "^17"
|
||||
"@types/react-dom@<18.0.0", "@types/react-dom@^18.2.0":
|
||||
version "18.3.7"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.7.tgz#b89ddf2cd83b4feafcc4e2ea41afdfb95a0d194f"
|
||||
integrity sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==
|
||||
|
||||
"@types/react-helmet@^6.1.11":
|
||||
version "6.1.11"
|
||||
@@ -5861,13 +5859,12 @@
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react@*", "@types/react@^17", "@types/react@^17.0.34":
|
||||
version "17.0.75"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.75.tgz#cffbc76840a12fcadaf5a3cf14878bb06efcf73d"
|
||||
integrity sha512-MSA+NzEzXnQKrqpO63CYqNstFjsESgvJAdAyyJ1n6ZQq/GLgf6nOfIKwk+Twuz0L1N6xPe+qz5xRCJrbhMaLsw==
|
||||
"@types/react@*", "@types/react@^18.2.0":
|
||||
version "18.3.23"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.23.tgz#86ae6f6b95a48c418fecdaccc8069e0fbb63696a"
|
||||
integrity sha512-/LDXMQh55EzZQ0uVAZmKKhfENivEvWz6E+EYzh+/MCjMhNsotd+ZHhBGIjFDTi6+fz0OhQQQLbTgdQIxxCsC0w==
|
||||
dependencies:
|
||||
"@types/prop-types" "*"
|
||||
"@types/scheduler" "*"
|
||||
csstype "^3.0.2"
|
||||
|
||||
"@types/reactcss@*":
|
||||
@@ -5914,11 +5911,6 @@
|
||||
dependencies:
|
||||
sanitize-filename "*"
|
||||
|
||||
"@types/scheduler@*":
|
||||
version "0.16.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
|
||||
integrity "sha1-GmL4lSVyPd4kuhsBsJK/XfitTTk= sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew=="
|
||||
|
||||
"@types/semver@^7.7.0":
|
||||
version "7.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.7.0.tgz#64c441bdae033b378b6eef7d0c3d77c329b9378e"
|
||||
@@ -13843,14 +13835,13 @@ react-dnd@^16.0.1:
|
||||
fast-deep-equal "^3.1.3"
|
||||
hoist-non-react-statics "^3.3.2"
|
||||
|
||||
react-dom@^17.0.2:
|
||||
version "17.0.2"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
|
||||
integrity "sha1-7P+2hF462Nv83EmPDQqTlzZQLCM= sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA=="
|
||||
react-dom@^18.2.0:
|
||||
version "18.3.1"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4"
|
||||
integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
scheduler "^0.20.2"
|
||||
scheduler "^0.23.2"
|
||||
|
||||
react-dropzone@^11.7.1:
|
||||
version "11.7.1"
|
||||
@@ -14015,13 +14006,12 @@ react-window@^1.8.11:
|
||||
"@babel/runtime" "^7.0.0"
|
||||
memoize-one ">=3.1.1 <6"
|
||||
|
||||
react@^17.0.2:
|
||||
version "17.0.2"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
|
||||
integrity "sha1-0LXMUW0p6z7uOD91tihkz7aAADc= sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA=="
|
||||
react@^18.2.0:
|
||||
version "18.3.1"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"
|
||||
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
|
||||
reactcss@^1.2.0:
|
||||
version "1.2.3"
|
||||
@@ -14575,13 +14565,12 @@ saxes@^6.0.0:
|
||||
dependencies:
|
||||
xmlchars "^2.2.0"
|
||||
|
||||
scheduler@^0.20.2:
|
||||
version "0.20.2"
|
||||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
|
||||
integrity "sha1-S67jlDbjSqk7SHS93L8P6Li1DpE= sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ=="
|
||||
scheduler@^0.23.2:
|
||||
version "0.23.2"
|
||||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3"
|
||||
integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
|
||||
scroll-into-view-if-needed@^3.1.0:
|
||||
version "3.1.0"
|
||||
|
||||
Reference in New Issue
Block a user