@limetech/lime-elements 37.76.2 → 37.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
- package/dist/collection/components/file-viewer/file-viewer.js +4 -3
- package/dist/collection/components/file-viewer/file-viewer.js.map +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/link-plugin.js +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/link-plugin.js.map +1 -1
- package/dist/esm/limel-file-viewer.entry.js +1 -1
- package/dist/esm/limel-file-viewer.entry.js.map +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-488decb0.entry.js → p-17da2b0a.entry.js} +2 -2
- package/dist/lime-elements/p-17da2b0a.entry.js.map +1 -0
- package/dist/lime-elements/{p-5ace2e19.entry.js → p-1db8aa67.entry.js} +2 -2
- package/dist/lime-elements/{p-5ace2e19.entry.js.map → p-1db8aa67.entry.js.map} +1 -1
- package/dist/types/components.d.ts +8 -8
- package/package.json +3 -3
- package/dist/lime-elements/p-488decb0.entry.js.map +0 -1
|
@@ -1260,13 +1260,13 @@ export namespace Components {
|
|
|
1260
1260
|
* This will allow users to preview the file in a fullscreen mode with the
|
|
1261
1261
|
* browser and take advantage of for example native zooming and panning
|
|
1262
1262
|
* functionalities.
|
|
1263
|
-
* @exampleComponent limel-example-file-viewer
|
|
1263
|
+
* @exampleComponent limel-example-file-viewer-basic
|
|
1264
1264
|
* @exampleComponent limel-example-file-viewer-office
|
|
1265
1265
|
* @exampleComponent limel-example-file-viewer-filename
|
|
1266
1266
|
* @exampleComponent limel-example-file-viewer-inbuilt-actions
|
|
1267
1267
|
* @exampleComponent limel-example-file-viewer-custom-actions
|
|
1268
1268
|
* @exampleComponent limel-example-file-viewer-with-picker
|
|
1269
|
-
* @
|
|
1269
|
+
* @beta
|
|
1270
1270
|
*/
|
|
1271
1271
|
interface LimelFileViewer {
|
|
1272
1272
|
/**
|
|
@@ -3663,13 +3663,13 @@ declare global {
|
|
|
3663
3663
|
* This will allow users to preview the file in a fullscreen mode with the
|
|
3664
3664
|
* browser and take advantage of for example native zooming and panning
|
|
3665
3665
|
* functionalities.
|
|
3666
|
-
* @exampleComponent limel-example-file-viewer
|
|
3666
|
+
* @exampleComponent limel-example-file-viewer-basic
|
|
3667
3667
|
* @exampleComponent limel-example-file-viewer-office
|
|
3668
3668
|
* @exampleComponent limel-example-file-viewer-filename
|
|
3669
3669
|
* @exampleComponent limel-example-file-viewer-inbuilt-actions
|
|
3670
3670
|
* @exampleComponent limel-example-file-viewer-custom-actions
|
|
3671
3671
|
* @exampleComponent limel-example-file-viewer-with-picker
|
|
3672
|
-
* @
|
|
3672
|
+
* @beta
|
|
3673
3673
|
*/
|
|
3674
3674
|
interface HTMLLimelFileViewerElement extends Components.LimelFileViewer, HTMLStencilElement {
|
|
3675
3675
|
}
|
|
@@ -5821,13 +5821,13 @@ declare namespace LocalJSX {
|
|
|
5821
5821
|
* This will allow users to preview the file in a fullscreen mode with the
|
|
5822
5822
|
* browser and take advantage of for example native zooming and panning
|
|
5823
5823
|
* functionalities.
|
|
5824
|
-
* @exampleComponent limel-example-file-viewer
|
|
5824
|
+
* @exampleComponent limel-example-file-viewer-basic
|
|
5825
5825
|
* @exampleComponent limel-example-file-viewer-office
|
|
5826
5826
|
* @exampleComponent limel-example-file-viewer-filename
|
|
5827
5827
|
* @exampleComponent limel-example-file-viewer-inbuilt-actions
|
|
5828
5828
|
* @exampleComponent limel-example-file-viewer-custom-actions
|
|
5829
5829
|
* @exampleComponent limel-example-file-viewer-with-picker
|
|
5830
|
-
* @
|
|
5830
|
+
* @beta
|
|
5831
5831
|
*/
|
|
5832
5832
|
interface LimelFileViewer {
|
|
5833
5833
|
/**
|
|
@@ -8154,13 +8154,13 @@ declare module "@stencil/core" {
|
|
|
8154
8154
|
* This will allow users to preview the file in a fullscreen mode with the
|
|
8155
8155
|
* browser and take advantage of for example native zooming and panning
|
|
8156
8156
|
* functionalities.
|
|
8157
|
-
* @exampleComponent limel-example-file-viewer
|
|
8157
|
+
* @exampleComponent limel-example-file-viewer-basic
|
|
8158
8158
|
* @exampleComponent limel-example-file-viewer-office
|
|
8159
8159
|
* @exampleComponent limel-example-file-viewer-filename
|
|
8160
8160
|
* @exampleComponent limel-example-file-viewer-inbuilt-actions
|
|
8161
8161
|
* @exampleComponent limel-example-file-viewer-custom-actions
|
|
8162
8162
|
* @exampleComponent limel-example-file-viewer-with-picker
|
|
8163
|
-
* @
|
|
8163
|
+
* @beta
|
|
8164
8164
|
*/
|
|
8165
8165
|
"limel-file-viewer": LocalJSX.LimelFileViewer & JSXBase.HTMLAttributes<HTMLLimelFileViewerElement>;
|
|
8166
8166
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/lime-elements",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.77.0",
|
|
4
4
|
"description": "Lime Elements",
|
|
5
5
|
"author": "Lime Technologies",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"lint:fix": "npm run lint:src:fix && npm run lint:scss:fix",
|
|
29
29
|
"lint:prod": "npm run lint:src:prod && npm run lint:scss:prod",
|
|
30
30
|
"lint:src": "eslint \"**/*.{ts,tsx,js}\" --max-warnings=99 && prettier -c \"{!(package*).json,.prettierrc}\"",
|
|
31
|
-
"lint:src:fix": "eslint \"**/*.{ts,tsx,js}\" --fix && prettier --write \"{!(package*).json,.prettierrc}\"",
|
|
31
|
+
"lint:src:fix": "eslint \"**/*.{ts,tsx,js}\" --fix --quiet && prettier --write \"{!(package*).json,.prettierrc}\"",
|
|
32
32
|
"lint:src:prod": "eslint \"**/*.{ts,tsx,js}\" --rule \"linebreak-style: [error, unix]\" --max-warnings=99 && prettier -c \"{!(package*).json,.prettierrc}\"",
|
|
33
33
|
"lint:scss": "prettier -c --ignore-path ./.gitignore **/*.scss",
|
|
34
34
|
"lint:scss:fix": "prettier --write --ignore-path ./.gitignore **/*.scss",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"eslint-plugin-sonarjs": "^3.0.1",
|
|
74
74
|
"eslint-plugin-tsdoc": "^0.4.0",
|
|
75
75
|
"flatpickr": "^4.6.13",
|
|
76
|
-
"globals": "^15.
|
|
76
|
+
"globals": "^15.14.0",
|
|
77
77
|
"html-escaper": "^3.0.3",
|
|
78
78
|
"jest": "^27.5.1",
|
|
79
79
|
"jest-cli": "^27.5.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["detectExtension","fileName","url","pathLike","extension","split","pop","toLowerCase","extensionsToTypes","pdf","jpg","jpeg","heic","bmp","png","gif","svg","svgz","ep","eps","avi","flv","h264","mov","mp4","mwv","mkv","mp3","wav","wma","ogg","txt","json","html","xml","doc","docx","odt","dot","dotx","docm","dotm","pot","ppt","pptx","odp","potx","potm","pps","ppsx","ppsm","pptm","ppam","pages","xls","xlsx","xlsm","xlsb","ods","csv","numbers","Fullscreen","constructor","element","this","requestFullscreen","enter","exitFullscreen","exit","bind","window","document","toggle","isFullscreen","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","msRequestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msExitFullscreen","mozCancelFullScreen","webkitExitFullscreen","isSupported","fileViewerCss","FileViewer","hostRef","renderPdf","h","class","renderActionMenu","src","fileUrl","loading","renderImage","renderButtons","alt","renderVideo","controls","renderAudio","renderText","data","type","renderOffice","getOfficeViewerUrl","isOfficeFileAccessibleViaURL","fileType","startsWith","officeViewers","officeViewer","renderNoFileSupportMessage","name","size","role","getTranslation","renderDownloadButton","renderToggleFullscreenButton","renderOpenInNewTabButton","allowFullscreen","fullscreen","icon","label","id","onClick","handleToggleFullscreen","elementId","openDirection","allowDownload","download","filename","href","target","allowOpenInNewTab","rel","actions","items","onSelect","emitOnAction","slot","createURL","async","includes","response","fetch","blob","URL","createObjectURL","event","stopPropagation","action","emit","detail","HostElement","render","limeBranded","renderFileViewer","newUrl","oldUrl","fileViewerFunctions","image","video","audio","text","office","fileViewerFunction","key","translate","get","language"],"sources":["./src/components/file-viewer/extension-mapping.tsx","./src/components/file-viewer/fullscreen.ts","./src/components/file-viewer/file-viewer.scss?tag=limel-file-viewer&encapsulation=shadow","./src/components/file-viewer/file-viewer.tsx"],"sourcesContent":["export function detectExtension(fileName, url): any {\n const pathLike = fileName || url;\n if (!pathLike) {\n return 'unknown';\n }\n\n const extension = pathLike.split('.').pop().toLowerCase();\n const extensionsToTypes = {\n pdf: 'pdf',\n jpg: 'image',\n jpeg: 'image',\n heic: 'image',\n bmp: 'image',\n png: 'image',\n gif: 'image',\n svg: 'image',\n svgz: 'image',\n ep: 'image',\n eps: 'image',\n avi: 'video',\n flv: 'video',\n h264: 'video',\n mov: 'video',\n mp4: 'video',\n mwv: 'video',\n mkv: 'video',\n mp3: 'audio',\n wav: 'audio',\n wma: 'audio',\n ogg: 'audio',\n txt: 'text',\n json: 'text',\n html: 'text',\n xml: 'text',\n // Word\n doc: 'office',\n docx: 'office',\n odt: 'office',\n dot: 'office',\n dotx: 'office',\n docm: 'office', // not supported\n dotm: 'office', // not yet tested\n // Presentation\n pot: 'office', // not tested\n ppt: 'office',\n pptx: 'office',\n odp: 'office',\n potx: 'office', // not supported\n potm: 'office', // not supported\n pps: 'office',\n ppsx: 'office',\n ppsm: 'office', // not supported\n pptm: 'office', // not supported\n ppam: 'office', // not tested\n pages: 'office', // not supported (Apple)\n // Spreadsheet\n xls: 'office',\n xlsx: 'office',\n xlsm: 'office',\n xlsb: 'office',\n ods: 'office',\n csv: 'office', // not supported\n numbers: 'office', // not supported (Apple)\n };\n\n return extensionsToTypes[extension] || 'unknown';\n}\n","export class Fullscreen {\n private enter: () => void;\n private exit: () => void;\n\n constructor(element: any) {\n this.enter =\n element.requestFullscreen ||\n element.msRequestFullscreen ||\n element.mozRequestFullScreen ||\n element.webkitRequestFullscreen;\n this.enter = this.enter.bind(element);\n const doc: any = window.document;\n this.exit =\n doc.exitFullscreen ||\n doc.msExitFullscreen ||\n doc.mozCancelFullScreen ||\n doc.webkitExitFullscreen;\n }\n\n public requestFullscreen = () => {\n if (this.enter) {\n this.enter();\n }\n };\n\n public exitFullscreen = () => {\n if (this.exit) {\n this.exit.bind(window.document)();\n }\n };\n\n public toggle = () => {\n const doc: any = window.document;\n const isFullscreen =\n doc.fullscreenElement ||\n doc.mozFullScreenElement ||\n doc.webkitFullscreenElement ||\n doc.msFullscreenElement;\n\n if (isFullscreen) {\n this.exitFullscreen();\n } else {\n this.requestFullscreen();\n }\n };\n\n public isSupported(): boolean {\n return !!this.requestFullscreen;\n }\n}\n","@use '../../style/internal/variables';\n@use '../../style/internal/shared_input-select-picker';\n@use '../../style/mixins';\n\n$size-of-buttons: 2rem;\n\n:host {\n isolation: isolate;\n position: relative;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n}\n\n* {\n box-sizing: border-box;\n}\n\nimg,\nvideo,\naudio,\nobject,\niframe {\n max-height: 100%;\n max-width: 100%;\n box-sizing: border-box;\n}\n\niframe {\n border: none;\n width: 100%;\n height: 100%;\n min-height: 20rem; // makes sure to get minimum comfortable space for viewing office files, and Microsoft Office viewers toolbars\n}\n\nimg {\n min-width: 7rem;\n object-fit: contain; // increases or decreases the size of the image to fill the box whilst preserving its aspect-ratio.\n}\n\nvideo {\n width: 100%;\n height: auto;\n}\n\naudio {\n width: 100%;\n}\n\nobject {\n width: 100%;\n height: 100%;\n}\n\nobject[type='application/pdf'] {\n min-height: 20rem;\n // makes sure to get browsers' native controls for the PDF\n}\n\nobject[type='text/plain'] {\n border-radius: 0.25rem;\n padding-right: $size-of-buttons;\n\n overflow-y: auto;\n}\n\n@mixin plain-text-in-fullscreen {\n background-color: rgb(var(--color-gray-darker));\n\n object[type='text/plain'] {\n max-width: 50rem;\n max-height: calc(100% - 2rem);\n }\n}\n\n:host(:fullscreen) {\n @include plain-text-in-fullscreen;\n}\n:host(:-webkit-full-screen) {\n // this is repetition of the previous block,\n // but needed for Safari to work.\n // Cannot write SCSS rules for `:host` using commas for some reason.\n // e.g.: `:host(:fullscreen), :host(:-webkit-full-screen)`.\n // So you have to repeat it sadly.\n @include plain-text-in-fullscreen;\n}\n\n@import './partial-styles/ui-controls.scss';\n","import {\n Component,\n Element,\n h,\n Prop,\n State,\n Event,\n EventEmitter,\n Watch,\n} from '@stencil/core';\nimport { Languages } from '../date-picker/date.types';\nimport { ListItem } from '../list/list-item.types';\nimport translate from '../../global/translations';\nimport { detectExtension } from './extension-mapping';\nimport { Fullscreen } from './fullscreen';\nimport { FileType, OfficeViewer } from './file-viewer.types';\nimport { LimelMenuCustomEvent } from '../../components';\n\n/**\n * This is a smart component that automatically detects\n * the most common file types such as image, audio, video, and text,\n * and properly displays them in the browser.\n * The component is also capable to render the most common office files.\n *\n * :::note\n * Image files will always be contained in their containers, which means\n * they automatically increase or decrease in size to fill their containing box\n * whilst preserving their aspect-ratio.\n *\n * Text and PDF files will also always respect the width and height of the\n * container in which the `limel-file-viewer` is loaded.\n * :::\n *\n * For some file types such as text and images, the component will display a\n * download button and a button to open the file in a new browser tab.\n * This will allow users to preview the file in a fullscreen mode with the\n * browser and take advantage of for example native zooming and panning\n * functionalities.\n *\n * @exampleComponent limel-example-file-viewer\n * @exampleComponent limel-example-file-viewer-office\n * @exampleComponent limel-example-file-viewer-filename\n * @exampleComponent limel-example-file-viewer-inbuilt-actions\n * @exampleComponent limel-example-file-viewer-custom-actions\n * @exampleComponent limel-example-file-viewer-with-picker\n * @private\n */\n\n@Component({\n tag: 'limel-file-viewer',\n shadow: true,\n styleUrl: 'file-viewer.scss',\n})\nexport class FileViewer {\n /**\n * Link to the file\n */\n @Prop({ reflect: true })\n public url: string;\n\n /**\n * The name of the file that must also contains its extension.\n * This overrides the filename that the `url` ends with.\n * Useful when the `url` does not contain the filename.\n * When specified, the `filename` will be used as filename of\n * the downloaded file.\n */\n @Prop({ reflect: true })\n public filename?: string;\n\n /**\n * An optional alternative text, mainly for assistive technologies and screen readers.\n * It is used for only image files, as an `alt` attribute.\n * Should optimally hold a description of the image,\n * which is also displayed on the page if the image can't be loaded for some reason.\n */\n @Prop({ reflect: true })\n public alt?: string;\n\n /**\n * Displays a button that allows the user to view the file\n * in fullscreen mode.\n * Not displayed for office files!\n */\n @Prop({ reflect: true })\n public allowFullscreen?: boolean = false;\n\n /**\n * Displays a button that allows the user to open the file\n * in a new browser tab.\n * Not displayed for office files!\n */\n @Prop({ reflect: true })\n public allowOpenInNewTab?: boolean = false;\n\n /**\n * Displays a button that allows the user to download the file.\n * Note that due to the browser's security policies,\n * the file should be hosted on the same domain\n * for the download button to work properly.\n * Not displayed for office files!\n */\n @Prop({ reflect: true })\n public allowDownload?: boolean = false;\n\n /**\n * Defines the localization for translations.\n */\n @Prop()\n public language: Languages = 'en';\n\n /**\n * Defines the third-party viewer that should be used to render\n * the content of office files, such as word processing documents,\n * presentations, or spreadsheets.\n */\n @Prop({ reflect: true })\n public officeViewer: OfficeViewer = 'microsoft-office';\n\n /**\n * An array of custom actions that can be displayed\n * as an action menu on the file which is being displayed.\n */\n @Prop()\n public actions: ListItem[];\n\n /**\n * Emitted when a custom action is selected from the action menu.\n */\n @Event()\n public action: EventEmitter<ListItem>;\n\n @Element()\n public HostElement: HTMLLimelFileViewerElement;\n\n private fullscreen: Fullscreen;\n\n @State()\n private isFullscreen: boolean = false;\n\n @State()\n private fileType: FileType;\n\n /**\n * True while the file is being loaded.\n */\n @State()\n private loading: boolean = true;\n\n @State()\n private fileUrl: string = '';\n\n constructor() {\n this.fullscreen = new Fullscreen(this.HostElement);\n }\n\n public async componentWillLoad() {\n this.fileType = detectExtension(this.filename, this.url);\n await this.createURL(this.fileType);\n }\n\n public render() {\n if (!this.isOfficeFileAccessibleViaURL) {\n return this.renderNoFileSupportMessage();\n }\n\n if (this.loading) {\n return <limel-spinner size=\"x-small\" limeBranded={false} />;\n }\n\n return this.renderFileViewer();\n }\n\n @Watch('url')\n protected async watchUrl(newUrl: string, oldUrl: string) {\n if (newUrl === oldUrl) {\n return;\n }\n\n this.loading = true;\n this.fileType = detectExtension(this.filename, this.fileUrl);\n await this.createURL(this.fileType);\n }\n\n private renderFileViewer() {\n const fileViewerFunctions = {\n pdf: this.renderPdf,\n image: this.renderImage,\n video: this.renderVideo,\n audio: this.renderAudio,\n text: this.renderText,\n office: this.renderOffice,\n };\n const fileViewerFunction =\n fileViewerFunctions[this.fileType] ||\n this.renderNoFileSupportMessage;\n\n return fileViewerFunction();\n }\n\n private renderPdf = () => {\n return [\n <div class=\"action-menu-for-pdf-files\">\n {this.renderActionMenu()}\n </div>,\n <iframe src={this.fileUrl} loading=\"lazy\" />,\n ];\n };\n\n private renderImage = () => {\n return [\n this.renderButtons(),\n <img src={this.fileUrl} alt={this.alt} loading=\"lazy\" />,\n ];\n };\n\n private renderVideo = () => {\n return (\n <video controls>\n <source src={this.fileUrl} />\n </video>\n );\n };\n\n private renderAudio = () => {\n return (\n <audio controls>\n <source src={this.fileUrl} />\n </audio>\n );\n };\n\n private renderText = () => {\n return [\n this.renderButtons(),\n <object data={this.fileUrl} type=\"text/plain\" />,\n ];\n };\n\n private renderOffice = () => {\n return [\n <div class=\"action-menu-for-office-files\">\n {this.renderActionMenu()}\n </div>,\n <iframe\n src={\n this.getOfficeViewerUrl() + this.fileUrl + '&embedded=true'\n }\n loading=\"lazy\"\n />,\n ];\n };\n\n private isOfficeFileAccessibleViaURL = () => {\n return (\n this.fileType === 'office' &&\n !(\n this.fileUrl.startsWith('http://') ||\n this.fileUrl.startsWith('https://')\n )\n );\n };\n\n private getOfficeViewerUrl = () => {\n const officeViewers = {\n 'microsoft-office':\n 'https://view.officeapps.live.com/op/embed.aspx?src=',\n 'google-drive': 'https://docs.google.com/gview?url=',\n };\n\n return officeViewers[this.officeViewer];\n };\n\n private renderNoFileSupportMessage = () => {\n return (\n <div class=\"no-support\">\n <limel-icon\n class=\"icon--warning\"\n name=\"brake_warning\"\n size=\"large\"\n role=\"presentation\"\n />\n <p>{this.getTranslation('message.unsupported-filetype')}</p>\n {this.renderDownloadButton()}\n </div>\n );\n };\n\n private renderButtons = () => {\n return (\n <div class=\"buttons\">\n {this.renderActionMenu()}\n {this.renderToggleFullscreenButton()}\n {this.renderDownloadButton()}\n {this.renderOpenInNewTabButton()}\n </div>\n );\n };\n\n private renderToggleFullscreenButton = () => {\n if (!this.allowFullscreen || !this.fullscreen.isSupported()) {\n return;\n }\n\n const icon = this.isFullscreen ? 'multiply' : 'fit_to_width';\n // eslint-disable-next-line multiline-ternary\n const label = this.isFullscreen\n ? // eslint-disable-next-line multiline-ternary\n this.getTranslation('exit-fullscreen')\n : this.getTranslation('open-in-fullscreen');\n\n return [\n <button\n class=\"button--toggle-fullscreen\"\n id=\"tooltip-toggle-fullscreen\"\n role=\"button\"\n onClick={this.handleToggleFullscreen}\n >\n <limel-icon name={icon} />\n <limel-tooltip\n label={label}\n elementId=\"tooltip-toggle-fullscreen\"\n openDirection=\"left\"\n />\n </button>,\n ];\n };\n\n private renderDownloadButton = () => {\n if (!this.allowDownload || this.isFullscreen) {\n return;\n }\n\n return (\n <a\n class=\"button--download\"\n id=\"tooltip-download\"\n role=\"button\"\n download={this.filename ? this.filename : ''}\n href={this.fileUrl}\n target=\"_blank\"\n >\n <limel-icon name=\"download_2\" />\n <limel-tooltip\n label={this.getTranslation('download')}\n elementId=\"tooltip-download\"\n openDirection=\"left\"\n />\n </a>\n );\n };\n\n private renderOpenInNewTabButton = () => {\n if (!this.allowOpenInNewTab || this.isFullscreen) {\n return;\n }\n\n return (\n <a\n class=\"button--new-tab\"\n id=\"tooltip-new-tab\"\n role=\"button\"\n href={this.fileUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <limel-icon name=\"external_link\" />\n <limel-tooltip\n label={this.getTranslation('open-in-new-tab')}\n elementId=\"tooltip-new-tab\"\n openDirection=\"left\"\n />\n </a>\n );\n };\n\n private renderActionMenu = () => {\n if (!this.actions || this.isFullscreen) {\n return;\n }\n\n return (\n <limel-menu\n class=\"action-menu\"\n items={this.actions}\n onSelect={this.emitOnAction}\n open-direction=\"left\"\n >\n <button\n class=\"button--action\"\n id=\"tooltip-more\"\n role=\"button\"\n slot=\"trigger\"\n >\n <limel-icon name=\"menu_2\" />\n <limel-tooltip\n label={this.getTranslation('more-actions')}\n elementId=\"tooltip-more\"\n openDirection=\"left\"\n />\n </button>\n </limel-menu>\n );\n };\n\n private createURL = async (fileType: string) => {\n if (['pdf'].includes(fileType)) {\n const response = await fetch(this.url);\n const blob = await response.blob();\n\n this.fileUrl = URL.createObjectURL(blob);\n } else {\n this.fileUrl = this.url;\n }\n\n this.loading = false;\n };\n\n private handleToggleFullscreen = () => {\n if (this.fullscreen.isSupported()) {\n this.fullscreen.toggle();\n this.isFullscreen = !this.isFullscreen;\n }\n };\n\n private emitOnAction = (event: LimelMenuCustomEvent<ListItem>) => {\n event.stopPropagation();\n this.action.emit(event.detail);\n };\n\n private getTranslation(key: string) {\n return translate.get(`file-viewer.${key}`, this.language);\n }\n}\n"],"mappings":"sGAAgBA,EAAgBC,EAAUC,GACtC,MAAMC,EAAWF,GAAYC,EAC7B,IAAKC,EAAU,CACX,MAAO,S,CAGX,MAAMC,EAAYD,EAASE,MAAM,KAAKC,MAAMC,cAC5C,MAAMC,EAAoB,CACtBC,IAAK,MACLC,IAAK,QACLC,KAAM,QACNC,KAAM,QACNC,IAAK,QACLC,IAAK,QACLC,IAAK,QACLC,IAA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