PromucFlow_constructor/app/client/src/widgets/DocumentViewerWidget/constants.ts
Bhavin K 6ea90e7c7b
feat: add document viewer widget (#7666)
* created new widget

* new lib for document viewer

* added cypress tests

* updated icon

* handling different url types with viewer

* add to ignore react-documents in jest transformIgnorePatterns

* added jest test, updated comments

* required changes

* updated cypress test

* updated icon svg

* doc viewer new renderers added

* comment as required

* updated test case

* added url / base64 validations

* updated url checking condition for space and updated test case

* cypress selector update

* updated url validations

* Merge branch 'release' into feature/new-document-viewer

* lazy load external lib
2021-11-29 15:37:49 +00:00

24 lines
667 B
TypeScript

// This file contains common constants which can be used across the widget configuration file (index.ts), widget and component folders.
export const DOCUMENTVIEWER_WIDGET_CONSTANT = "";
// txt and pdf handle by viewerType = "url"
// and other types handle by viewerType = "office"
export const SUPPORTED_EXTENSIONS = [
"txt",
"pdf",
"docx",
"ppt",
"pptx",
"xlsx",
];
export const Renderers = {
DOCUMENT_VIEWER: "DOCUMENT_VIEWER",
DOCX_VIEWER: "DOCX_VIEWER",
XLSX_VIEWER: "XLSX_VIEWER",
ERROR: "ERROR",
};
export type Renderer = typeof Renderers[keyof typeof Renderers];
export type ViewerType = "google" | "office" | "mammoth" | "pdf" | "url";