mirror of
https://github.com/docmost/docmost.git
synced 2026-05-16 14:14:06 +08:00
Compare commits
11 Commits
v0.10.0
...
vite-rolldown
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d719447f1 | |||
| ea0ce908cf | |||
| 10b67929ea | |||
| 5c957fda8d | |||
| 862f6d4820 | |||
| de57d05199 | |||
| 89ec990232 | |||
| 49d0f1cc9a | |||
| 268001ae26 | |||
| 27fa45a769 | |||
| f9711918a3 |
@@ -4,14 +4,15 @@
|
|||||||
Open-source collaborative wiki and documentation software.
|
Open-source collaborative wiki and documentation software.
|
||||||
<br />
|
<br />
|
||||||
<a href="https://docmost.com"><strong>Website</strong></a> |
|
<a href="https://docmost.com"><strong>Website</strong></a> |
|
||||||
<a href="https://docmost.com/docs"><strong>Documentation</strong></a>
|
<a href="https://docmost.com/docs"><strong>Documentation</strong></a> |
|
||||||
|
<a href="https://twitter.com/DocmostHQ"><strong>Twitter / X</strong></a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
To get started with Docmost, please refer to our [documentation](https://docmost.com/docs).
|
To get started with Docmost, please refer to our [documentation](https://docmost.com/docs) or try our [cloud version](https://docmost.com/pricing) .
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -46,3 +47,16 @@ All files in the following directories are licensed under the Docmost Enterprise
|
|||||||
### Contributing
|
### Contributing
|
||||||
|
|
||||||
See the [development documentation](https://docmost.com/docs/self-hosting/development)
|
See the [development documentation](https://docmost.com/docs/self-hosting/development)
|
||||||
|
|
||||||
|
## Thanks
|
||||||
|
Special thanks to;
|
||||||
|
|
||||||
|
<img width="100" alt="Crowdin" src="https://github.com/user-attachments/assets/a6c3d352-e41b-448d-b6cd-3fbca3109f07" />
|
||||||
|
|
||||||
|
[Crowdin](https://crowdin.com/) for providing access to their localization platform.
|
||||||
|
|
||||||
|
|
||||||
|
<img width="48" alt="Algolia-mark-square-white" src="https://github.com/user-attachments/assets/6ccad04a-9589-4965-b6a1-d5cb1f4f9e94" />
|
||||||
|
|
||||||
|
[Algolia](https://www.algolia.com/) for providing full-text search to the docs.
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "client",
|
"name": "client",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.10.0",
|
"version": "0.10.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"@tabler/icons-react": "^3.22.0",
|
"@tabler/icons-react": "^3.22.0",
|
||||||
"@tanstack/react-query": "^5.61.4",
|
"@tanstack/react-query": "^5.61.4",
|
||||||
"@tiptap/extension-character-count": "^2.11.5",
|
"@tiptap/extension-character-count": "^2.11.5",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.8.4",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"emoji-mart": "^5.6.0",
|
"emoji-mart": "^5.6.0",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
"@types/node": "22.10.0",
|
"@types/node": "22.10.0",
|
||||||
"@types/react": "^18.3.12",
|
"@types/react": "^18.3.12",
|
||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"@vitejs/plugin-react": "^4.3.4",
|
"@vitejs/plugin-react": "^4.4.1",
|
||||||
"eslint": "^9.15.0",
|
"eslint": "^9.15.0",
|
||||||
"eslint-plugin-react": "^7.37.2",
|
"eslint-plugin-react": "^7.37.2",
|
||||||
"eslint-plugin-react-hooks": "^5.1.0",
|
"eslint-plugin-react-hooks": "^5.1.0",
|
||||||
@@ -76,6 +76,6 @@
|
|||||||
"prettier": "^3.4.1",
|
"prettier": "^3.4.1",
|
||||||
"typescript": "^5.7.2",
|
"typescript": "^5.7.2",
|
||||||
"typescript-eslint": "^8.17.0",
|
"typescript-eslint": "^8.17.0",
|
||||||
"vite": "^6.1.0"
|
"vite": "npm:rolldown-vite@latest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ export default function AppVersion() {
|
|||||||
position="middle-end"
|
position="middle-end"
|
||||||
style={{ cursor: "pointer" }}
|
style={{ cursor: "pointer" }}
|
||||||
disabled={!hasUpdate}
|
disabled={!hasUpdate}
|
||||||
|
onClick={() => {
|
||||||
|
window.open(
|
||||||
|
"https://github.com/docmost/docmost/releases",
|
||||||
|
"_blank",
|
||||||
|
);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|||||||
@@ -19,8 +19,7 @@
|
|||||||
box-shadow: 0 0 0 2px var(--mantine-color-blue-3);
|
box-shadow: 0 0 0 2px var(--mantine-color-blue-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ProseMirror {
|
.ProseMirror :global(.ProseMirror){
|
||||||
width: 100%;
|
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
@@ -29,7 +28,6 @@
|
|||||||
padding-right: 6px;
|
padding-right: 6px;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
font-size: 14px;
|
|
||||||
overflow: hidden auto;
|
overflow: hidden auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
usePageQuery,
|
usePageQuery,
|
||||||
useUpdatePageMutation,
|
useUpdatePageMutation,
|
||||||
} from "@/features/page/queries/page-query.ts";
|
} from "@/features/page/queries/page-query.ts";
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
import classes from "@/features/page/tree/styles/tree.module.css";
|
import classes from "@/features/page/tree/styles/tree.module.css";
|
||||||
import { ActionIcon, Menu, rem } from "@mantine/core";
|
import { ActionIcon, Menu, rem } from "@mantine/core";
|
||||||
@@ -84,7 +84,7 @@ export default function SpaceTree({ spaceId, readOnly }: SpaceTreeProps) {
|
|||||||
const rootElement = useRef<HTMLDivElement>();
|
const rootElement = useRef<HTMLDivElement>();
|
||||||
const { ref: sizeRef, width, height } = useElementSize();
|
const { ref: sizeRef, width, height } = useElementSize();
|
||||||
const mergedRef = useMergedRef(rootElement, sizeRef);
|
const mergedRef = useMergedRef(rootElement, sizeRef);
|
||||||
const isDataLoaded = useRef(false);
|
const [isDataLoaded, setIsDataLoaded] = useState(false);
|
||||||
const { data: currentPage } = usePageQuery({
|
const { data: currentPage } = usePageQuery({
|
||||||
pageId: extractPageSlugId(pageSlug),
|
pageId: extractPageSlugId(pageSlug),
|
||||||
});
|
});
|
||||||
@@ -108,7 +108,7 @@ export default function SpaceTree({ spaceId, readOnly }: SpaceTreeProps) {
|
|||||||
// and append root pages instead of resetting the entire tree
|
// and append root pages instead of resetting the entire tree
|
||||||
// which looses async loaded children too
|
// which looses async loaded children too
|
||||||
setData(treeData);
|
setData(treeData);
|
||||||
isDataLoaded.current = true;
|
setIsDataLoaded(true);
|
||||||
setOpenTreeNodes({});
|
setOpenTreeNodes({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ export default function SpaceTree({ spaceId, readOnly }: SpaceTreeProps) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
if (isDataLoaded.current && currentPage) {
|
if (isDataLoaded && currentPage) {
|
||||||
// check if pageId node is present in the tree
|
// check if pageId node is present in the tree
|
||||||
const node = dfs(treeApiRef.current?.root, currentPage.id);
|
const node = dfs(treeApiRef.current?.root, currentPage.id);
|
||||||
if (node) {
|
if (node) {
|
||||||
@@ -178,7 +178,7 @@ export default function SpaceTree({ spaceId, readOnly }: SpaceTreeProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
fetchData();
|
fetchData();
|
||||||
}, [isDataLoaded.current, currentPage?.id]);
|
}, [isDataLoaded, currentPage?.id]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (currentPage?.id) {
|
if (currentPage?.id) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.10.0",
|
"version": "0.10.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
@@ -59,14 +59,13 @@
|
|||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"class-validator": "^0.14.1",
|
"class-validator": "^0.14.1",
|
||||||
"cookie": "^1.0.2",
|
"cookie": "^1.0.2",
|
||||||
"fix-esm": "^1.0.1",
|
|
||||||
"fs-extra": "^11.3.0",
|
"fs-extra": "^11.3.0",
|
||||||
"happy-dom": "^15.11.6",
|
"happy-dom": "^15.11.6",
|
||||||
"jsonwebtoken": "^9.0.2",
|
"jsonwebtoken": "^9.0.2",
|
||||||
"kysely": "^0.27.5",
|
"kysely": "^0.27.5",
|
||||||
"kysely-migration-cli": "^0.4.2",
|
"kysely-migration-cli": "^0.4.2",
|
||||||
"mime-types": "^2.1.35",
|
"mime-types": "^2.1.35",
|
||||||
"nanoid": "^5.1.0",
|
"nanoid": "3.3.11",
|
||||||
"nestjs-kysely": "^1.1.0",
|
"nestjs-kysely": "^1.1.0",
|
||||||
"nodemailer": "^6.10.0",
|
"nodemailer": "^6.10.0",
|
||||||
"openid-client": "^5.7.1",
|
"openid-client": "^5.7.1",
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
import { customAlphabet } from 'nanoid';
|
||||||
const { customAlphabet } = require('fix-esm').require('nanoid');
|
|
||||||
|
|
||||||
const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz';
|
const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz';
|
||||||
export const nanoIdGen = customAlphabet(alphabet, 10);
|
export const nanoIdGen = customAlphabet(alphabet, 10);
|
||||||
|
|
||||||
const slugIdAlphabet =
|
const slugIdAlphabet =
|
||||||
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||||
export const generateSlugId = customAlphabet(slugIdAlphabet, 10);
|
export const generateSlugId = customAlphabet(slugIdAlphabet, 10);
|
||||||
+1
-1
Submodule apps/server/src/ee updated: a04fcc224e...d3095f2d8b
@@ -21,7 +21,7 @@ import {
|
|||||||
getProsemirrorContent,
|
getProsemirrorContent,
|
||||||
PageExportTree,
|
PageExportTree,
|
||||||
replaceInternalLinks,
|
replaceInternalLinks,
|
||||||
updateAttachmentUrls,
|
updateAttachmentUrlsToLocalPaths,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
import { PageRepo } from '@docmost/db/repos/page/page.repo';
|
import { PageRepo } from '@docmost/db/repos/page/page.repo';
|
||||||
import { Node } from '@tiptap/pm/model';
|
import { Node } from '@tiptap/pm/model';
|
||||||
@@ -193,7 +193,7 @@ export class ExportService {
|
|||||||
|
|
||||||
if (includeAttachments) {
|
if (includeAttachments) {
|
||||||
await this.zipAttachments(updatedJsonContent, page.spaceId, folder);
|
await this.zipAttachments(updatedJsonContent, page.spaceId, folder);
|
||||||
updatedJsonContent = updateAttachmentUrls(updatedJsonContent);
|
updatedJsonContent = updateAttachmentUrlsToLocalPaths(updatedJsonContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pageTitle = getPageTitle(page.title);
|
const pageTitle = getPageTitle(page.title);
|
||||||
|
|||||||
@@ -62,17 +62,30 @@ export function isAttachmentNode(nodeType: string) {
|
|||||||
return attachmentNodeTypes.includes(nodeType);
|
return attachmentNodeTypes.includes(nodeType);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateAttachmentUrls(prosemirrorJson: any) {
|
export function updateAttachmentUrlsToLocalPaths(prosemirrorJson: any) {
|
||||||
const doc = jsonToNode(prosemirrorJson);
|
const doc = jsonToNode(prosemirrorJson);
|
||||||
|
if (!doc) return null;
|
||||||
|
|
||||||
|
// Helper function to replace specific URL prefixes
|
||||||
|
const replacePrefix = (url: string): string => {
|
||||||
|
const prefixes = ['/files', '/api/files'];
|
||||||
|
for (const prefix of prefixes) {
|
||||||
|
if (url.startsWith(prefix)) {
|
||||||
|
return url.replace(prefix, 'files');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
};
|
||||||
|
|
||||||
doc?.descendants((node: Node) => {
|
doc?.descendants((node: Node) => {
|
||||||
if (isAttachmentNode(node.type.name)) {
|
if (isAttachmentNode(node.type.name)) {
|
||||||
if (node.attrs.src && node.attrs.src.startsWith('/files')) {
|
if (node.attrs.src) {
|
||||||
//@ts-expect-error
|
// @ts-ignore
|
||||||
node.attrs.src = node.attrs.src.replace('/files', 'files');
|
node.attrs.src = replacePrefix(node.attrs.src);
|
||||||
} else if (node.attrs.url && node.attrs.url.startsWith('/files')) {
|
}
|
||||||
//@ts-expect-error
|
if (node.attrs.url) {
|
||||||
node.attrs.url = node.attrs.url.replace('/files', 'files');
|
// @ts-ignore
|
||||||
|
node.attrs.url = replacePrefix(node.attrs.url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "docmost",
|
"name": "docmost",
|
||||||
"homepage": "https://docmost.com",
|
"homepage": "https://docmost.com",
|
||||||
"version": "0.10.0",
|
"version": "0.10.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nx run-many -t build",
|
"build": "nx run-many -t build",
|
||||||
|
|||||||
Generated
+484
-768
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user