1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 10:50:24 +00:00

Add tldraw file editor (#7273)

* add tldr file type

* add tldraw editor render

* optimize code

* add save mode

* update version

* update dependence

* update dependence

* optimize code

* optimize code

---------

Co-authored-by: 杨顺强 <978987373@qq.com>
This commit is contained in:
Guodong SU
2025-01-04 09:40:56 +08:00
committed by GitHub
parent 0504d5b03a
commit 155d303a12
21 changed files with 7596 additions and 6194 deletions

View File

@@ -1,7 +1,7 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { siteRoot, gettext, username, enableSeadoc, thumbnailSizeForOriginal, thumbnailDefaultSize, fileServerRoot } from '../../utils/constants';
import { siteRoot, gettext, username, enableSeadoc, thumbnailSizeForOriginal, thumbnailDefaultSize, fileServerRoot, enableTldraw } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import TextTranslation from '../../utils/text-translation';
import URLDecorator from '../../utils/url-decorator';
@@ -418,7 +418,8 @@ class DirentListView extends React.Component {
NEW_EXCEL_FILE,
NEW_POWERPOINT_FILE,
NEW_WORD_FILE,
NEW_SEADOC_FILE
NEW_SEADOC_FILE,
NEW_TLDRAW_FILE
} = TextTranslation;
const direntsContainerMenuList = [
@@ -432,9 +433,13 @@ class DirentListView extends React.Component {
NEW_MARKDOWN_FILE,
NEW_EXCEL_FILE,
NEW_POWERPOINT_FILE,
NEW_WORD_FILE
NEW_WORD_FILE,
);
if (enableTldraw) {
direntsContainerMenuList.push(NEW_TLDRAW_FILE);
}
if (this.props.selectedDirentList.length === 0) {
let id = 'dirent-container-menu';
@@ -509,6 +514,9 @@ class DirentListView extends React.Component {
case 'New Word File':
this.onCreateFileToggle('.docx');
break;
case 'New Whiteboard File':
this.onCreateFileToggle('.draw');
break;
case 'New SeaDoc File':
this.onCreateFileToggle('.sdoc');
break;