Compare commits

...

6 Commits

Author SHA1 Message Date
Philipinho de57d05199 0.10.2 2025-04-15 12:48:40 +01:00
Philipinho 89ec990232 sync ee 2025-04-15 12:46:28 +01:00
Philipinho 49d0f1cc9a Add click handler 2025-04-11 13:41:43 +01:00
Philipinho 268001ae26 v0.10.1 2025-04-11 13:23:42 +01:00
Philip Okugbe 27fa45a769 fix local attachment paths in exports (#1013) 2025-04-11 13:18:44 +01:00
Philipinho f9711918a3 fix comment editor padding 2025-04-11 12:32:54 +01:00
8 changed files with 33 additions and 16 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "client",
"private": true,
"version": "0.10.0",
"version": "0.10.2",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
@@ -35,6 +35,12 @@ export default function AppVersion() {
position="middle-end"
style={{ cursor: "pointer" }}
disabled={!hasUpdate}
onClick={() => {
window.open(
"https://github.com/docmost/docmost/releases",
"_blank",
);
}}
>
<Text
size="sm"
@@ -19,8 +19,7 @@
box-shadow: 0 0 0 2px var(--mantine-color-blue-3);
}
.ProseMirror {
width: 100%;
.ProseMirror :global(.ProseMirror){
max-width: 100%;
white-space: pre-wrap;
word-break: break-word;
@@ -29,7 +28,6 @@
padding-right: 6px;
margin-top: 2px;
margin-bottom: 2px;
font-size: 14px;
overflow: hidden auto;
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "server",
"version": "0.10.0",
"version": "0.10.2",
"description": "",
"author": "",
"private": true,
@@ -21,7 +21,7 @@ import {
getProsemirrorContent,
PageExportTree,
replaceInternalLinks,
updateAttachmentUrls,
updateAttachmentUrlsToLocalPaths,
} from './utils';
import { PageRepo } from '@docmost/db/repos/page/page.repo';
import { Node } from '@tiptap/pm/model';
@@ -193,7 +193,7 @@ export class ExportService {
if (includeAttachments) {
await this.zipAttachments(updatedJsonContent, page.spaceId, folder);
updatedJsonContent = updateAttachmentUrls(updatedJsonContent);
updatedJsonContent = updateAttachmentUrlsToLocalPaths(updatedJsonContent);
}
const pageTitle = getPageTitle(page.title);
+20 -7
View File
@@ -62,17 +62,30 @@ export function isAttachmentNode(nodeType: string) {
return attachmentNodeTypes.includes(nodeType);
}
export function updateAttachmentUrls(prosemirrorJson: any) {
export function updateAttachmentUrlsToLocalPaths(prosemirrorJson: any) {
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) => {
if (isAttachmentNode(node.type.name)) {
if (node.attrs.src && node.attrs.src.startsWith('/files')) {
//@ts-expect-error
node.attrs.src = node.attrs.src.replace('/files', 'files');
} else if (node.attrs.url && node.attrs.url.startsWith('/files')) {
//@ts-expect-error
node.attrs.url = node.attrs.url.replace('/files', 'files');
if (node.attrs.src) {
// @ts-ignore
node.attrs.src = replacePrefix(node.attrs.src);
}
if (node.attrs.url) {
// @ts-ignore
node.attrs.url = replacePrefix(node.attrs.url);
}
}
});
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "docmost",
"homepage": "https://docmost.com",
"version": "0.10.0",
"version": "0.10.2",
"private": true,
"scripts": {
"build": "nx run-many -t build",