diff --git a/docs/docassets/images/renditions.png b/docs/docassets/images/renditions.png deleted file mode 100644 index 02198cbf85..0000000000 Binary files a/docs/docassets/images/renditions.png and /dev/null differ diff --git a/docs/viewer.component.md b/docs/viewer.component.md index 82169a7dcb..96bfa555ff 100644 --- a/docs/viewer.component.md +++ b/docs/viewer.component.md @@ -7,7 +7,7 @@ See it live: [Viewer Quickstart](https://embed.plnkr.co/iTuG1lFIXfsP95l6bDW6/) - [Basic usage](#basic-usage) - * [Properties](#properties) +- [Properties](#properties) - [Details](#details) * [Supported file formats](#supported-file-formats) * [PDF Conversion](#pdf-conversion) @@ -39,9 +39,9 @@ Using with file url: ``` -### Properties +## Properties -| Attribute | Options | Default | Description | +| Name | Type | Default | Description | | --- | --- | --- | --- | | fileNodeId | string | | Node Id of the file to load | | urlFile | string | | If you want to load an external file that does not come from ECM you can use this Url where to load the file | @@ -50,6 +50,13 @@ Using with file url: | showViewer | boolean | true | Hide or show the viewer | | showToolbar | boolean | true | Hide or show the toolbars | | displayName | string | | You can specify the name of the file | +| allowGoBack | boolean | true | Allow `back` navigation | +| allowOpenWith | boolean | true | Toggle `Open With` options | +| allowDownload | boolean | true | Toggle download feature | +| allowPrint | boolean | true | Toggle printing feature | +| allowShare | boolean | true | Toggle sharing feature | +| allowInfoDrawer | boolean | true | Toogle info drawer feature | +| showInfoDrawer | boolean | false | Toggles info drawer visibility. Requires `allowInfoDrawer` to be set to `true`. | ## Details @@ -63,9 +70,7 @@ Using with file url: ### PDF Conversion - - -Note for unsupported extensions the viewer will offer the possibility to convert to PDF if that kind of extension is supported by the [content service renditions service](https://community.alfresco.com/docs/DOC-5879-rendition-service) +For unsupported extensions or mime types the viewer will try to fetch PDF rendition utilising the [renditions service api](https://community.alfresco.com/docs/DOC-5879-rendition-service) ### Configuring PDF.js library diff --git a/ng2-components/ng2-alfresco-viewer/index.ts b/ng2-components/ng2-alfresco-viewer/index.ts index 276bee5c2f..8aa27e7eb6 100644 --- a/ng2-components/ng2-alfresco-viewer/index.ts +++ b/ng2-components/ng2-alfresco-viewer/index.ts @@ -23,12 +23,13 @@ import { MaterialModule } from './src/material.module'; export { ViewerComponent } from './src/components/viewer.component'; import { ImgViewerComponent } from './src/components/imgViewer.component'; import { MediaPlayerComponent } from './src/components/mediaPlayer.component'; -import { NotSupportedFormatComponent } from './src/components/notSupportedFormat.component'; import { PdfViewerComponent } from './src/components/pdfViewer.component'; import { TxtViewerComponent } from './src/components/txtViewer.component'; +import { UnknownFormatComponent } from './src/components/unknown-format/unknown-format.component'; import { PdfViewComponent } from './src/components/viewer-dialog/pdf-view/pdf-view.component'; import { ViewerDialogComponent } from './src/components/viewer-dialog/viewer-dialog.component'; import { ViewerComponent } from './src/components/viewer.component'; + import { ExtensionViewerDirective } from './src/directives/extension-viewer.directive'; import { RenderingQueueServices } from './src/services/rendering-queue.services'; @@ -38,33 +39,33 @@ export { ViewerDialogComponent } from './src/components/viewer-dialog/viewer-dia export { ViewerDialogSettings } from './src/components/viewer-dialog/viewer-dialog.settings'; export { ViewerService } from './src/services/viewer.service'; -export const VIEWER_DIRECTIVES: any[] = [ - ViewerComponent, - ImgViewerComponent, - TxtViewerComponent, - MediaPlayerComponent, - NotSupportedFormatComponent, - PdfViewerComponent, - ExtensionViewerDirective, - ViewerDialogComponent, - PdfViewComponent -]; +export function declarations() { + return [ + ViewerComponent, + ImgViewerComponent, + TxtViewerComponent, + MediaPlayerComponent, + PdfViewerComponent, + ExtensionViewerDirective, + ViewerDialogComponent, + PdfViewComponent, + UnknownFormatComponent + ]; +} @NgModule({ imports: [ CoreModule, MaterialModule ], - declarations: [ - ...VIEWER_DIRECTIVES - ], + declarations: declarations(), providers: [ RenderingQueueServices, ViewerService ], exports: [ MaterialModule, - ...VIEWER_DIRECTIVES + ...declarations() ], entryComponents: [ ViewerDialogComponent diff --git a/ng2-components/ng2-alfresco-viewer/src/components/imgViewer.component.scss b/ng2-components/ng2-alfresco-viewer/src/components/imgViewer.component.scss index b62e87f509..3c78ff223c 100644 --- a/ng2-components/ng2-alfresco-viewer/src/components/imgViewer.component.scss +++ b/ng2-components/ng2-alfresco-viewer/src/components/imgViewer.component.scss @@ -7,6 +7,7 @@ justify-content: center; height: 90vh; img { + width: 100%; object-fit: contain; } } diff --git a/ng2-components/ng2-alfresco-viewer/src/components/notSupportedFormat.component.html b/ng2-components/ng2-alfresco-viewer/src/components/notSupportedFormat.component.html deleted file mode 100644 index 01d5009114..0000000000 --- a/ng2-components/ng2-alfresco-viewer/src/components/notSupportedFormat.component.html +++ /dev/null @@ -1,47 +0,0 @@ -
diff --git a/docs/docassets/images/renditions.png b/docs/docassets/images/renditions.png deleted file mode 100644 index 02198cbf85..0000000000 Binary files a/docs/docassets/images/renditions.png and /dev/null differ diff --git a/docs/viewer.component.md b/docs/viewer.component.md index 82169a7dcb..96bfa555ff 100644 --- a/docs/viewer.component.md +++ b/docs/viewer.component.md @@ -7,7 +7,7 @@ See it live: [Viewer Quickstart](https://embed.plnkr.co/iTuG1lFIXfsP95l6bDW6/) - [Basic usage](#basic-usage) - * [Properties](#properties) +- [Properties](#properties) - [Details](#details) * [Supported file formats](#supported-file-formats) * [PDF Conversion](#pdf-conversion) @@ -39,9 +39,9 @@ Using with file url: ``` -### Properties +## Properties -| Attribute | Options | Default | Description | +| Name | Type | Default | Description | | --- | --- | --- | --- | | fileNodeId | string | | Node Id of the file to load | | urlFile | string | | If you want to load an external file that does not come from ECM you can use this Url where to load the file | @@ -50,6 +50,13 @@ Using with file url: | showViewer | boolean | true | Hide or show the viewer | | showToolbar | boolean | true | Hide or show the toolbars | | displayName | string | | You can specify the name of the file | +| allowGoBack | boolean | true | Allow `back` navigation | +| allowOpenWith | boolean | true | Toggle `Open With` options | +| allowDownload | boolean | true | Toggle download feature | +| allowPrint | boolean | true | Toggle printing feature | +| allowShare | boolean | true | Toggle sharing feature | +| allowInfoDrawer | boolean | true | Toogle info drawer feature | +| showInfoDrawer | boolean | false | Toggles info drawer visibility. Requires `allowInfoDrawer` to be set to `true`. | ## Details @@ -63,9 +70,7 @@ Using with file url: ### PDF Conversion - - -Note for unsupported extensions the viewer will offer the possibility to convert to PDF if that kind of extension is supported by the [content service renditions service](https://community.alfresco.com/docs/DOC-5879-rendition-service) +For unsupported extensions or mime types the viewer will try to fetch PDF rendition utilising the [renditions service api](https://community.alfresco.com/docs/DOC-5879-rendition-service) ### Configuring PDF.js library diff --git a/ng2-components/ng2-alfresco-viewer/index.ts b/ng2-components/ng2-alfresco-viewer/index.ts index 276bee5c2f..8aa27e7eb6 100644 --- a/ng2-components/ng2-alfresco-viewer/index.ts +++ b/ng2-components/ng2-alfresco-viewer/index.ts @@ -23,12 +23,13 @@ import { MaterialModule } from './src/material.module'; export { ViewerComponent } from './src/components/viewer.component'; import { ImgViewerComponent } from './src/components/imgViewer.component'; import { MediaPlayerComponent } from './src/components/mediaPlayer.component'; -import { NotSupportedFormatComponent } from './src/components/notSupportedFormat.component'; import { PdfViewerComponent } from './src/components/pdfViewer.component'; import { TxtViewerComponent } from './src/components/txtViewer.component'; +import { UnknownFormatComponent } from './src/components/unknown-format/unknown-format.component'; import { PdfViewComponent } from './src/components/viewer-dialog/pdf-view/pdf-view.component'; import { ViewerDialogComponent } from './src/components/viewer-dialog/viewer-dialog.component'; import { ViewerComponent } from './src/components/viewer.component'; + import { ExtensionViewerDirective } from './src/directives/extension-viewer.directive'; import { RenderingQueueServices } from './src/services/rendering-queue.services'; @@ -38,33 +39,33 @@ export { ViewerDialogComponent } from './src/components/viewer-dialog/viewer-dia export { ViewerDialogSettings } from './src/components/viewer-dialog/viewer-dialog.settings'; export { ViewerService } from './src/services/viewer.service'; -export const VIEWER_DIRECTIVES: any[] = [ - ViewerComponent, - ImgViewerComponent, - TxtViewerComponent, - MediaPlayerComponent, - NotSupportedFormatComponent, - PdfViewerComponent, - ExtensionViewerDirective, - ViewerDialogComponent, - PdfViewComponent -]; +export function declarations() { + return [ + ViewerComponent, + ImgViewerComponent, + TxtViewerComponent, + MediaPlayerComponent, + PdfViewerComponent, + ExtensionViewerDirective, + ViewerDialogComponent, + PdfViewComponent, + UnknownFormatComponent + ]; +} @NgModule({ imports: [ CoreModule, MaterialModule ], - declarations: [ - ...VIEWER_DIRECTIVES - ], + declarations: declarations(), providers: [ RenderingQueueServices, ViewerService ], exports: [ MaterialModule, - ...VIEWER_DIRECTIVES + ...declarations() ], entryComponents: [ ViewerDialogComponent diff --git a/ng2-components/ng2-alfresco-viewer/src/components/imgViewer.component.scss b/ng2-components/ng2-alfresco-viewer/src/components/imgViewer.component.scss index b62e87f509..3c78ff223c 100644 --- a/ng2-components/ng2-alfresco-viewer/src/components/imgViewer.component.scss +++ b/ng2-components/ng2-alfresco-viewer/src/components/imgViewer.component.scss @@ -7,6 +7,7 @@ justify-content: center; height: 90vh; img { + width: 100%; object-fit: contain; } } diff --git a/ng2-components/ng2-alfresco-viewer/src/components/notSupportedFormat.component.html b/ng2-components/ng2-alfresco-viewer/src/components/notSupportedFormat.component.html deleted file mode 100644 index 01d5009114..0000000000 --- a/ng2-components/ng2-alfresco-viewer/src/components/notSupportedFormat.component.html +++ /dev/null @@ -1,47 +0,0 @@ -