mirror of
https://github.com/docmost/docmost.git
synced 2026-05-25 12:04:35 +08:00
Merge branch 'main' into tiptap3-migration
This commit is contained in:
+4
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM node:22-alpine AS base
|
FROM node:22-slim AS base
|
||||||
LABEL org.opencontainers.image.source="https://github.com/docmost/docmost"
|
LABEL org.opencontainers.image.source="https://github.com/docmost/docmost"
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
@@ -13,7 +13,9 @@ RUN pnpm build
|
|||||||
|
|
||||||
FROM base AS installer
|
FROM base AS installer
|
||||||
|
|
||||||
RUN apk add --no-cache curl bash
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends curl bash \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "client",
|
"name": "client",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.24.0",
|
"version": "0.24.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
|
|||||||
@@ -37,14 +37,18 @@ export async function askAi(
|
|||||||
|
|
||||||
let answer = "";
|
let answer = "";
|
||||||
let sources: any[] = [];
|
let sources: any[] = [];
|
||||||
|
let buffer = "";
|
||||||
|
|
||||||
if (reader) {
|
if (reader) {
|
||||||
while (true) {
|
while (true) {
|
||||||
const { done, value } = await reader.read();
|
const { done, value } = await reader.read();
|
||||||
if (done) break;
|
if (done) break;
|
||||||
|
|
||||||
const chunk = decoder.decode(value);
|
buffer += decoder.decode(value, { stream: true });
|
||||||
const lines = chunk.split("\n");
|
const lines = buffer.split("\n");
|
||||||
|
|
||||||
|
// Keep the last incomplete line in the buffer
|
||||||
|
buffer = lines.pop() || "";
|
||||||
|
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
if (line.startsWith("data: ")) {
|
if (line.startsWith("data: ")) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.24.0",
|
"version": "0.24.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
+1
-1
Submodule apps/server/src/ee updated: 18e00b1866...075761c2d9
@@ -117,7 +117,7 @@ export class EnvironmentVariables {
|
|||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@ValidateIf((obj) => obj.AI_EMBEDDING_DIMENSION)
|
@ValidateIf((obj) => obj.AI_EMBEDDING_DIMENSION)
|
||||||
@IsIn(['768', '1024', '1536'])
|
@IsIn(['768', '1024', '1536', '2000'])
|
||||||
@IsString()
|
@IsString()
|
||||||
AI_EMBEDDING_DIMENSION: string;
|
AI_EMBEDDING_DIMENSION: string;
|
||||||
|
|
||||||
|
|||||||
@@ -15,10 +15,12 @@ async function bootstrap() {
|
|||||||
const app = await NestFactory.create<NestFastifyApplication>(
|
const app = await NestFactory.create<NestFastifyApplication>(
|
||||||
AppModule,
|
AppModule,
|
||||||
new FastifyAdapter({
|
new FastifyAdapter({
|
||||||
ignoreTrailingSlash: true,
|
|
||||||
ignoreDuplicateSlashes: true,
|
|
||||||
maxParamLength: 1000,
|
|
||||||
trustProxy: true,
|
trustProxy: true,
|
||||||
|
routerOptions: {
|
||||||
|
maxParamLength: 1000,
|
||||||
|
ignoreTrailingSlash: true,
|
||||||
|
ignoreDuplicateSlashes: true,
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
rawBody: true,
|
rawBody: true,
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "docmost",
|
"name": "docmost",
|
||||||
"homepage": "https://docmost.com",
|
"homepage": "https://docmost.com",
|
||||||
"version": "0.24.0",
|
"version": "0.24.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nx run-many -t build",
|
"build": "nx run-many -t build",
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { Editor, findParentNode, isTextSelection } from "@tiptap/core";
|
import { Editor, findParentNode, isTextSelection } from "@tiptap/core";
|
||||||
import { EditorState, Selection, Transaction } from '@tiptap/pm/state';
|
import { EditorState, Selection, Transaction } from "@tiptap/pm/state";
|
||||||
|
import { EditorView } from "@tiptap/pm/view";
|
||||||
import { CellSelection, TableMap } from "@tiptap/pm/tables";
|
import { CellSelection, TableMap } from "@tiptap/pm/tables";
|
||||||
import { Node, ResolvedPos } from "@tiptap/pm/model";
|
import { Node, ResolvedPos } from "@tiptap/pm/model";
|
||||||
import { Table } from "@tiptap/extension-table";
|
|
||||||
import { sanitizeUrl as braintreeSanitizeUrl } from "@braintree/sanitize-url";
|
import { sanitizeUrl as braintreeSanitizeUrl } from "@braintree/sanitize-url";
|
||||||
import { EditorView } from '@tiptap/pm/view';
|
|
||||||
import { customAlphabet } from "nanoid";
|
import { customAlphabet } from "nanoid";
|
||||||
|
|
||||||
export const isRectSelected = (rect: any) => (selection: CellSelection) => {
|
export const isRectSelected = (rect: any) => (selection: CellSelection) => {
|
||||||
@@ -288,11 +287,7 @@ export const isColumnGripSelected = ({
|
|||||||
const nodeDOM = view.nodeDOM(from) as HTMLElement;
|
const nodeDOM = view.nodeDOM(from) as HTMLElement;
|
||||||
const node = nodeDOM || domAtPos;
|
const node = nodeDOM || domAtPos;
|
||||||
|
|
||||||
if (
|
if (!editor.isActive("table") || !node || isTableSelected(state.selection)) {
|
||||||
!editor.isActive(Table.name) ||
|
|
||||||
!node ||
|
|
||||||
isTableSelected(state.selection)
|
|
||||||
) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,11 +320,7 @@ export const isRowGripSelected = ({
|
|||||||
const nodeDOM = view.nodeDOM(from) as HTMLElement;
|
const nodeDOM = view.nodeDOM(from) as HTMLElement;
|
||||||
const node = nodeDOM || domAtPos;
|
const node = nodeDOM || domAtPos;
|
||||||
|
|
||||||
if (
|
if (!editor.isActive("table") || !node || isTableSelected(state.selection)) {
|
||||||
!editor.isActive(Table.name) ||
|
|
||||||
!node ||
|
|
||||||
isTableSelected(state.selection)
|
|
||||||
) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user