Skip to content

Commit

Permalink
Merge pull request #5 from ONLYOFFICE/develop
Browse files Browse the repository at this point in the history
Release/v1.1.0
  • Loading branch information
LinneyS committed Dec 9, 2022
2 parents 06b65f0 + 700d7ee commit 150b4f1
Show file tree
Hide file tree
Showing 8 changed files with 1,297 additions and 990 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Change Log

## 1.1.0
- added IConfig

## 1.0.0
- Initial release
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onlyoffice/document-editor-react",
"version": "1.0.1",
"version": "1.1.0",
"description": "React component for ONLYOFFICE Document Server",
"license": "Apache-2.0",
"bugs": {
Expand All @@ -27,15 +27,15 @@
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^8.3.4",
"@storybook/addon-actions": "^6.5.10",
"@storybook/addon-essentials": "^6.5.10",
"@storybook/addon-interactions": "^6.5.10",
"@storybook/addon-links": "^6.5.10",
"@storybook/builder-webpack4": "^6.5.10",
"@storybook/manager-webpack4": "^6.5.10",
"@storybook/react": "^6.5.10",
"@storybook/addon-actions": "^6.5.14",
"@storybook/addon-essentials": "^6.5.14",
"@storybook/addon-interactions": "^6.5.14",
"@storybook/addon-links": "^6.5.14",
"@storybook/builder-webpack4": "^6.5.14",
"@storybook/manager-webpack4": "^6.5.14",
"@storybook/react": "^6.5.14",
"@storybook/testing-library": "^0.0.13",
"@testing-library/react": "^13.3.0",
"@types/jest": "^28.1.6",
Expand All @@ -44,14 +44,14 @@
"babel-jest": "^28.1.3",
"babel-loader": "^8.2.5",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"jest-environment-jsdom": "^29.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^2.77.2",
"rollup": "^2.68.0",
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-filesize": "^9.1.2",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-terser": "^7.0.2",
"@rollup/plugin-terser": "^0.2.0",
"tslib": "^2.4.0",
"typescript": "^4.7.4"
},
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import dts from "rollup-plugin-dts";
import { terser } from "rollup-plugin-terser";
import terser from "@rollup/plugin-terser";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
import filesize from "rollup-plugin-filesize";

Expand Down
5 changes: 2 additions & 3 deletions src/DocumentEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
*/

import React, { useEffect } from "react";
import IConfig from "./model/config";
import loadScript from "./utils/loadScript";

import Config from "./types/Config";

declare global {
interface Window {
DocsAPI?: any;
Expand All @@ -31,7 +30,7 @@ type DocumentEditorProps = {

documentServerUrl: string;

config: Config;
config: IConfig;

document_fileType?: string;
document_title?: string;
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
*/

export { default as DocumentEditor } from "./DocumentEditor";
export * from "./model/config";
176 changes: 176 additions & 0 deletions src/model/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
/*
* (c) Copyright Ascensio System SIA 2022
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

interface IConfig {
documentType?: string;
height?: string;
token?: string;
type?: string;
width?: string;
document: {
fileType: string;
key?: string;
title: string;
url: string;
info?: {
author?: string;
created?: string;
favorite?: boolean;
folder?: string;
owner?: string;
sharingSettings?: any[];
};
permissions?: {
changeHistory?: boolean;
chat?: boolean;
comment?: boolean;
commentGroups?: any;
deleteCommentAuthorOnly?: boolean;
download?: boolean;
edit?: boolean;
editCommentAuthorOnly?: boolean;
fillForms?: boolean;
modifyContentControl?: boolean;
modifyFilter?: boolean;
print?: boolean;
protect?: boolean;
rename?: boolean;
review?: boolean;
reviewGroups?: string[];
userInfoGroups?: string[];
};
};
editorConfig?: {
actionLink?: any;
callbackUrl?: string;
coEditing?: any;
createUrl?: string;
lang?: string;
location?: string;
mode?: string;
recent?: any[];
region?: string;
templates?: any[];
user?: {
firstname?: string;
group?: string;
id?: string;
lastname?: string;
name?: string;
};
customization?: {
anonymous?: {
request?: boolean;
label?: string;
};
autosave?: boolean;
chat?: boolean;
commentAuthorOnly?: boolean;
comments?: boolean;
compactHeader?: boolean;
compactToolbar?: boolean;
compatibleFeatures?: boolean;
customer?: {
address?: string;
info?: string;
logo?: string;
logoDark?: string;
mail?: string;
name?: string;
phone?: string;
www?: string;
};
features?: any;
feedback?: any;
forcesave?: boolean;
goback?: any;
help?: boolean;
hideNotes?: boolean;
hideRightMenu?: boolean;
hideRulers?: boolean;
integrationMode?: string;
logo?: {
image?: string;
imageDark?: string;
imageEmbedded?: string;
url?: string;
};
macros?: boolean;
macrosMode?: string;
mentionShare?: boolean;
plugins?: boolean;
review?: {
hideReviewDisplay?: boolean;
hoverMode?: boolean;
reviewDisplay?: string;
showReviewChanges?: boolean;
trackChanges?: boolean;
};
reviewDisplay?: string;
showReviewChanges?: boolean;
spellcheck?: boolean;
toolbarHideFileName?: boolean;
toolbarNoTabs?: boolean;
trackChanges?: boolean;
uiTheme?: string;
unit?: string;
zoom?: number;
};
embedded?: {
embedUrl?: string;
fullscreenUrl?: string;
saveUrl?: string;
shareUrl?: string;
toolbarDocked?: string;
};
plugins?: {
autostart?: string[];
pluginsData?: string[];
url?: string;
};
};
events?: {
onAppReady?: (event: object) => void;
onCollaborativeChanges?: (event: object) => void;
onDocumentReady?: (event: object) => void;
onDocumentStateChange?: (event: object) => void;
onDownloadAs?: (event: object) => void;
onError?: (event: object) => void;
onInfo?: (event: object) => void;
onMetaChange?: (event: object) => void;
onMakeActionLink?: (event: object) => void;
onOutdatedVersion?: (event: object) => void;
onPluginsReady?: (event: object) => void;
onRequestClose?: (event: object) => void;
onRequestCompareFile?: (event: object) => void;
onRequestCreateNew?: (event: object) => void;
onRequestEditRights?: (event: object) => void;
onRequestHistory?: (event: object) => void;
onRequestHistoryClose?: (event: object) => void;
onRequestHistoryData?: (event: object) => void;
onRequestInsertImage?: (event: object) => void;
onRequestMailMergeRecipients?: (event: object) => void;
onRequestRename?: (event: object) => void;
onRequestRestore?: (event: object) => void;
onRequestSaveAs?: (event: object) => void;
onRequestSendNotify?: (event: object) => void;
onRequestSharingSettings?: (event: object) => void;
onRequestUsers?: (event: object) => void;
onWarning?: (event: object) => void;
}
};

export default IConfig;
54 changes: 0 additions & 54 deletions src/types/Config.ts

This file was deleted.

Loading

0 comments on commit 150b4f1

Please sign in to comment.