merge main

This commit is contained in:
Philipinho
2025-09-10 04:19:04 +01:00
parent 2d710612b1
commit e7e85e9fdd
7 changed files with 864 additions and 629 deletions
@@ -1,15 +1,11 @@
import {
BubbleMenu as BaseBubbleMenu,
posToDOMRect,
findParentNode,
} from "@tiptap/react";
import { BubbleMenu as BaseBubbleMenu } from "@tiptap/react/menus";
import { posToDOMRect, findParentNode } from "@tiptap/react";
import { Node as PMNode } from "@tiptap/pm/model";
import React, { useCallback } from "react";
import { ActionIcon, Tooltip } from "@mantine/core";
import { IconTrash } from "@tabler/icons-react";
import { useTranslation } from "react-i18next";
import { Editor } from "@tiptap/core";
import { sticky } from "tippy.js";
interface SubpagesMenuProps {
editor: Editor;
@@ -64,7 +60,7 @@ export const SubpagesMenu = React.memo(
editor={editor}
pluginKey={`subpages-menu}`}
updateDelay={0}
tippyOptions={{
/* tippyOptions={{
getReferenceClientRect,
offset: [0, 8],
zIndex: 99,
@@ -73,7 +69,7 @@ export const SubpagesMenu = React.memo(
},
plugins: [sticky],
sticky: "popper",
}}
}}*/
shouldShow={shouldShow}
>
<Tooltip position="top" label={t("Delete")}>
@@ -19,6 +19,7 @@ export default function SubpagesView(props: NodeViewProps) {
const { spaceSlug, shareId } = useParams();
const { t } = useTranslation();
//@ts-ignore
const currentPageId = editor.storage.pageId;
// Get subpages from shared tree if we're in a shared context
@@ -1,13 +1,7 @@
import { StarterKit } from "@tiptap/starter-kit";
import { TextAlign } from "@tiptap/extension-text-align";
import {
TaskList,
TaskItem,
} from "@tiptap/extension-list";
import {
Placeholder,
CharacterCount,
} from "@tiptap/extensions";
import { TaskList, TaskItem } from "@tiptap/extension-list";
import { Placeholder, CharacterCount } from "@tiptap/extensions";
import { Superscript } from "@tiptap/extension-superscript";
import SubScript from "@tiptap/extension-subscript";
import { Highlight } from "@tiptap/extension-highlight";
@@ -17,6 +11,7 @@ import { Color } from "@tiptap/extension-color";
import SlashCommand from "@/features/editor/extensions/slash-command";
import { Collaboration } from "@tiptap/extension-collaboration";
import { CollaborationCaret } from "@tiptap/extension-collaboration-caret";
import { HocuspocusProvider } from "@hocuspocus/provider";
import {
Comment,
@@ -42,8 +37,8 @@ import {
Embed,
SearchAndReplace,
Mention,
Subpages,
TableDndExtension,
Subpages,
} from "@docmost/editor-ext";
import {
randomElement,
@@ -63,7 +58,6 @@ import CodeBlockView from "@/features/editor/components/code-block/code-block-vi
import DrawioView from "../components/drawio/drawio-view";
import ExcalidrawView from "@/features/editor/components/excalidraw/excalidraw-view.tsx";
import EmbedView from "@/features/editor/components/embed/embed-view.tsx";
import SubpagesView from "@/features/editor/components/subpages/subpages-view.tsx";
import plaintext from "highlight.js/lib/languages/plaintext";
import powershell from "highlight.js/lib/languages/powershell";
import abap from "highlightjs-sap-abap";
@@ -81,6 +75,7 @@ import i18n from "@/i18n.ts";
import { MarkdownClipboard } from "@/features/editor/extensions/markdown-clipboard.ts";
import EmojiCommand from "./emoji-command";
import { countWords } from "alfaaz";
import SubpagesView from "@/features/editor/components/subpages/subpages-view.tsx";
const lowlight = createLowlight(common);
lowlight.register("mermaid", plaintext);
@@ -97,6 +92,8 @@ lowlight.register("scala", scala);
export const mainExtensions = [
StarterKit.configure({
undoRedo: false,
link: false,
trailingNode: false,
dropcursor: {
width: 3,
color: "#70CFF8",
@@ -107,8 +104,6 @@ export const mainExtensions = [
spellcheck: false,
},
},
link: false,
trailingNode: false,
}),
Placeholder.configure({
placeholder: ({ node }) => {
@@ -55,6 +55,7 @@ export default function ReadonlyPageEditor({
onCreate={({ editor }) => {
if (editor) {
if (pageId) {
// @ts-ignore
editor.storage.pageId = pageId;
}
// @ts-ignore
+28 -28
View File
@@ -28,34 +28,34 @@
"@joplin/turndown": "^4.0.74",
"@joplin/turndown-plugin-gfm": "^1.0.56",
"@sindresorhus/slugify": "1.1.0",
"@tiptap/core": "^3.2.0",
"@tiptap/extension-code-block": "^3.2.0",
"@tiptap/extension-collaboration": "^3.2.0",
"@tiptap/extension-collaboration-caret": "^3.2.0",
"@tiptap/extension-color": "^3.2.0",
"@tiptap/extension-document": "^3.2.0",
"@tiptap/extension-heading": "^3.2.0",
"@tiptap/extension-highlight": "^3.2.0",
"@tiptap/extension-history": "^3.2.0",
"@tiptap/extension-image": "^3.2.0",
"@tiptap/extension-link": "^3.2.0",
"@tiptap/extension-list": "^3.2.0",
"@tiptap/extension-list-item": "^3.2.0",
"@tiptap/extension-list-keymap": "^3.2.0",
"@tiptap/extension-placeholder": "^3.2.0",
"@tiptap/extension-subscript": "^3.2.0",
"@tiptap/extension-superscript": "^3.2.0",
"@tiptap/extension-table": "^3.2.0",
"@tiptap/extension-text": "^3.2.0",
"@tiptap/extension-text-align": "^3.2.0",
"@tiptap/extension-text-style": "^3.2.0",
"@tiptap/extension-typography": "^3.2.0",
"@tiptap/extension-youtube": "^3.2.0",
"@tiptap/html": "^3.2.0",
"@tiptap/pm": "^3.2.0",
"@tiptap/react": "^3.2.0",
"@tiptap/starter-kit": "^3.2.0",
"@tiptap/suggestion": "^3.2.0",
"@tiptap/core": "^3.4.2",
"@tiptap/extension-code-block": "^3.4.2",
"@tiptap/extension-collaboration": "^3.4.2",
"@tiptap/extension-collaboration-caret": "^3.4.2",
"@tiptap/extension-color": "^3.4.2",
"@tiptap/extension-document": "^3.4.2",
"@tiptap/extension-heading": "^3.4.2",
"@tiptap/extension-highlight": "^3.4.2",
"@tiptap/extension-history": "^3.4.2",
"@tiptap/extension-image": "^3.4.2",
"@tiptap/extension-link": "^3.4.2",
"@tiptap/extension-list": "^3.4.2",
"@tiptap/extension-list-item": "^3.4.2",
"@tiptap/extension-list-keymap": "^3.4.2",
"@tiptap/extension-placeholder": "^3.4.2",
"@tiptap/extension-subscript": "^3.4.2",
"@tiptap/extension-superscript": "^3.4.2",
"@tiptap/extension-table": "^3.4.2",
"@tiptap/extension-text": "^3.4.2",
"@tiptap/extension-text-align": "^3.4.2",
"@tiptap/extension-text-style": "^3.4.2",
"@tiptap/extension-typography": "^3.4.2",
"@tiptap/extension-youtube": "^3.4.2",
"@tiptap/html": "^3.4.2",
"@tiptap/pm": "^3.4.2",
"@tiptap/react": "^3.4.2",
"@tiptap/starter-kit": "^3.4.2",
"@tiptap/suggestion": "^3.4.2",
"@types/qrcode": "^1.5.5",
"bytes": "^3.1.2",
"cross-env": "^7.0.3",
+822 -580
View File
File diff suppressed because it is too large Load Diff