@limetech/lime-crm-building-blocks 1.92.2 → 1.93.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 +13 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
- package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +94 -72
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/limeobject/file-viewer/extension-mapping.js +51 -0
- package/dist/collection/components/limeobject/file-viewer/file-viewer.js +44 -44
- package/dist/components/limebb-limeobject-file-viewer.js +101 -73
- package/dist/esm/lime-crm-building-blocks.js +1 -1
- package/dist/esm/limebb-limeobject-file-viewer.entry.js +94 -72
- package/dist/esm/loader.js +1 -1
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/p-a1818969.entry.js +1 -0
- package/dist/types/components/limeobject/file-viewer/extension-mapping.d.ts +9 -0
- package/dist/types/components/limeobject/file-viewer/file-viewer.d.ts +1 -1
- package/package.json +1 -1
- package/dist/lime-crm-building-blocks/p-42f6a0d2.entry.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [1.93.0](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.92.2...v1.93.0) (2025-09-26)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
* **file-viwer:** add support for unsupported LiveDocs rendering ([9120fbd](https://github.com/Lundalogik/lime-crm-building-blocks/commit/9120fbdfa29b15fcabe83a57ee3fb1178d5cb44d))
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
* **file-viewer:** allow opening a file in a new tab ([6a58065](https://github.com/Lundalogik/lime-crm-building-blocks/commit/6a580659be92117f0f2cc21e386df27e41b2ceb8))
|
|
11
|
+
* **file-viewer:** prevent downloading a file ([0149b46](https://github.com/Lundalogik/lime-crm-building-blocks/commit/0149b46f9526da9f368f4894e618d0383022b291))
|
|
12
|
+
* **file-viwer:** show live doc info message when the feature switch is false ([a805989](https://github.com/Lundalogik/lime-crm-building-blocks/commit/a805989701c9f3ed8bd90cb1120b253612c3db76))
|
|
13
|
+
|
|
1
14
|
## [1.92.2](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.92.1...v1.92.2) (2025-09-26)
|
|
2
15
|
|
|
3
16
|
### Bug Fixes
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["limebb-feed.cjs",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[1],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["limebb-kanban.cjs",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["limebb-chat-list.cjs",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["limebb-text-editor.cjs",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["limebb-date-range.cjs",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format.cjs",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-
|
|
22
|
+
return index.bootstrapLazy([["limebb-feed.cjs",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[1],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["limebb-kanban.cjs",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["limebb-chat-list.cjs",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["limebb-limeobject-file-viewer.cjs",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["limebb-text-editor.cjs",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["limebb-date-range.cjs",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format.cjs",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-notification-list.cjs",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":["handleItemsChange"]}]]],["limebb-browser.cjs",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["limebb-component-config.cjs",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":["watchFormInfo"],"configComponent":["watchconfigComponent"]}]]],["limebb-component-picker.cjs",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-dashboard-widget.cjs",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["limebb-icon-picker.cjs",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-info-tile.cjs",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]},null,{"filterId":["watchFilterId"],"propertyName":["watchPropertyName"],"aggregateOperator":["watchAggregateOperator"]}]]],["limebb-info-tile-date-format.cjs",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["limebb-info-tile-decimal-format.cjs",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["limebb-info-tile-format.cjs",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["limebb-info-tile-relative-date-format.cjs",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["limebb-info-tile-unit-format.cjs",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["limebb-loader.cjs",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["limebb-locale-picker.cjs",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["limebb-mention.cjs",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["limebb-mention-group-counter.cjs",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["limebb-percentage-visualizer.cjs",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":["valueChanged"]}]]],["limebb-trend-indicator.cjs",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":["valueChanged"]}]]],["limebb-feed-item-thumbnail-file-info.cjs",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["limebb-navigation-button_2.cjs",[[1,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["limebb-feed-timeline-item.cjs",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["limebb-kanban-group.cjs",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["limebb-text-editor-picker.cjs",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":["watchOpen"]}]]],["limebb-currency-picker.cjs",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["limebb-date-picker.cjs",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["limebb-live-docs-info.cjs",[[1,"limebb-live-docs-info"]]],["limebb-notification-item.cjs",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["limebb-kanban-item.cjs",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["limebb-chat-item_2.cjs",[[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["limebb-empty-state.cjs",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -7,35 +7,58 @@ const index_esm = require('./index.esm-a894ac76.js');
|
|
|
7
7
|
const negate = require('./negate-e0a2bf77.js');
|
|
8
8
|
|
|
9
9
|
const LIVE_DOCS_TYPES = ['pdf', 'edit', 'view'];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
|
|
10
|
+
|
|
11
|
+
// Map of file extensions to their preview type
|
|
12
|
+
const previewExtensionMap = {
|
|
13
|
+
// Browser-native preview
|
|
14
|
+
avi: 'browser',
|
|
15
|
+
bmp: 'browser',
|
|
16
|
+
csv: 'browser', // CSV shows as plain text
|
|
17
|
+
gif: 'browser',
|
|
18
|
+
heic: 'browser',
|
|
19
|
+
html: 'browser',
|
|
20
|
+
jpeg: 'browser',
|
|
21
|
+
jpg: 'browser',
|
|
22
|
+
json: 'browser',
|
|
23
|
+
mp3: 'browser',
|
|
24
|
+
mp4: 'browser',
|
|
25
|
+
mov: 'browser',
|
|
26
|
+
ogg: 'browser',
|
|
27
|
+
pdf: 'browser',
|
|
28
|
+
png: 'browser',
|
|
29
|
+
svg: 'browser',
|
|
30
|
+
svgz: 'browser',
|
|
31
|
+
txt: 'browser',
|
|
32
|
+
wav: 'browser',
|
|
33
|
+
wmv: 'browser',
|
|
34
|
+
xml: 'browser',
|
|
35
|
+
// SharePoint PDF preview
|
|
36
|
+
doc: 'sharepoint',
|
|
37
|
+
docx: 'sharepoint',
|
|
38
|
+
dot: 'sharepoint',
|
|
39
|
+
dotx: 'sharepoint',
|
|
40
|
+
odp: 'sharepoint',
|
|
41
|
+
ods: 'sharepoint',
|
|
42
|
+
pot: 'sharepoint',
|
|
43
|
+
ppt: 'sharepoint',
|
|
44
|
+
pptx: 'sharepoint',
|
|
45
|
+
pps: 'sharepoint',
|
|
46
|
+
ppsx: 'sharepoint',
|
|
47
|
+
xls: 'sharepoint',
|
|
48
|
+
xlsb: 'sharepoint',
|
|
49
|
+
xlsm: 'sharepoint',
|
|
50
|
+
xlsx: 'sharepoint',
|
|
51
|
+
odt: 'sharepoint',
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Determines how a file can be previewed.
|
|
55
|
+
*
|
|
56
|
+
* @param extension - The file extension (case-insensitive).
|
|
57
|
+
* @returns The preview type.
|
|
58
|
+
*/
|
|
59
|
+
function getPreviewType(extension) {
|
|
60
|
+
return previewExtensionMap[extension.toLowerCase()] || 'unsupported';
|
|
61
|
+
}
|
|
39
62
|
|
|
40
63
|
const fileViewerCss = ".not-found{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;line-height:1rem;color:rgb(var(--contrast-1100))}.not-found limel-icon{color:rgb(var(--color-red-default))}iframe{height:100%;width:100%}";
|
|
41
64
|
const LimebbLimeobjectFileViewerStyle0 = fileViewerCss;
|
|
@@ -59,41 +82,51 @@ const FileViewer = class {
|
|
|
59
82
|
* The first available one will be used
|
|
60
83
|
*/
|
|
61
84
|
this.fileTypes = ['view', 'contents', 'download'];
|
|
85
|
+
this.renderLiveDocs = (file) => {
|
|
86
|
+
if (!this.isLiveDocsAvailable(file)) {
|
|
87
|
+
return index.h("limebb-live-docs-info", null);
|
|
88
|
+
}
|
|
89
|
+
if (!this.platform.isFeatureEnabled('useOfficeFilePreview')) {
|
|
90
|
+
return (index.h("limebb-empty-state", { value: 'Preview of this file type will be available soon', icon: {
|
|
91
|
+
name: 'attention',
|
|
92
|
+
color: 'rgb(var(--color-blue-light))',
|
|
93
|
+
} }));
|
|
94
|
+
}
|
|
95
|
+
const url = this.getLiveDocsUrl(file);
|
|
96
|
+
return (index.h("iframe", { src: url, frameBorder: 0, marginHeight: 0, marginWidth: 0 }));
|
|
97
|
+
};
|
|
98
|
+
this.renderFileViewer = (file) => {
|
|
99
|
+
const filename = file.filename;
|
|
100
|
+
const url = this.getFileUrl(file);
|
|
101
|
+
if (!url) {
|
|
102
|
+
return this.renderNotFound();
|
|
103
|
+
}
|
|
104
|
+
return (index.h("limel-file-viewer", { filename: filename, url: url, allowFullscreen: true, allowOpenInNewTab: true }));
|
|
105
|
+
};
|
|
106
|
+
this.renderUnsupported = (file) => {
|
|
107
|
+
return (index.h("limel-file-viewer", { filename: file.filename, url: undefined, allowFullscreen: true, allowOpenInNewTab: true }));
|
|
108
|
+
};
|
|
109
|
+
this.renderNotFound = () => {
|
|
110
|
+
return [
|
|
111
|
+
index.h("section", { class: "not-found" }, index.h("limel-icon", { name: "error", size: "large" }), index.h("h2", null, this.translator.get('webclient.not-found')), index.h("p", null, this.translator.get('webclient.no-files-attached', {
|
|
112
|
+
object: this.getDescriptive(this.limeobject),
|
|
113
|
+
}))),
|
|
114
|
+
];
|
|
115
|
+
};
|
|
62
116
|
}
|
|
63
117
|
render() {
|
|
64
118
|
const file = this.getFile();
|
|
65
119
|
if (!file) {
|
|
66
120
|
return this.renderNotFound();
|
|
67
121
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
renderLiveDocs(file) {
|
|
77
|
-
const url = this.getLiveDocsUrl(file);
|
|
78
|
-
if (!url) {
|
|
79
|
-
return this.renderNotFound();
|
|
80
|
-
}
|
|
81
|
-
return (index.h("iframe", { src: url, frameBorder: 0, marginHeight: 0, marginWidth: 0 }));
|
|
82
|
-
}
|
|
83
|
-
renderFileViewer(file) {
|
|
84
|
-
const filename = file.filename;
|
|
85
|
-
const url = this.getFileUrl(file);
|
|
86
|
-
if (!url) {
|
|
87
|
-
return this.renderNotFound();
|
|
88
|
-
}
|
|
89
|
-
return (index.h("limel-file-viewer", { filename: filename, url: url, allowDownload: true, allowFullscreen: true }));
|
|
90
|
-
}
|
|
91
|
-
renderNotFound() {
|
|
92
|
-
return [
|
|
93
|
-
index.h("section", { class: "not-found" }, index.h("limel-icon", { name: "error", size: "large" }), index.h("h2", null, this.translator.get('webclient.not-found')), index.h("p", null, this.translator.get('webclient.no-files-attached', {
|
|
94
|
-
object: this.getDescriptive(this.limeobject),
|
|
95
|
-
}))),
|
|
96
|
-
];
|
|
122
|
+
const fileType = getPreviewType(file.extension);
|
|
123
|
+
const fileViewerFunctions = {
|
|
124
|
+
browser: this.renderFileViewer,
|
|
125
|
+
sharepoint: this.renderLiveDocs,
|
|
126
|
+
unsupported: this.renderUnsupported,
|
|
127
|
+
};
|
|
128
|
+
const fileViewerFunction = fileViewerFunctions[fileType];
|
|
129
|
+
return fileViewerFunction(file);
|
|
97
130
|
}
|
|
98
131
|
getLiveDocsUrl(file) {
|
|
99
132
|
let fileTypes = [...this.fileTypes];
|
|
@@ -118,9 +151,6 @@ const FileViewer = class {
|
|
|
118
151
|
}
|
|
119
152
|
return this.limeobject.getFile(property.name);
|
|
120
153
|
}
|
|
121
|
-
isLiveDocsExtension(file) {
|
|
122
|
-
return LIVE_DOCS_EXTENSIONS.includes(file.extension);
|
|
123
|
-
}
|
|
124
154
|
isLiveDocsAvailable(file) {
|
|
125
155
|
return LIVE_DOCS_TYPES.some((type) => file.getUrl(type));
|
|
126
156
|
}
|
|
@@ -129,17 +159,9 @@ const FileViewer = class {
|
|
|
129
159
|
}
|
|
130
160
|
getDescriptive(limeobject) {
|
|
131
161
|
var _a;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
if (!descriptive) {
|
|
137
|
-
descriptive = (_a = this.limetype) === null || _a === void 0 ? void 0 : _a.localname.singular;
|
|
138
|
-
}
|
|
139
|
-
if (!descriptive) {
|
|
140
|
-
descriptive = this.translator.get('object');
|
|
141
|
-
}
|
|
142
|
-
return descriptive;
|
|
162
|
+
return ((limeobject === null || limeobject === void 0 ? void 0 : limeobject.descriptive) ||
|
|
163
|
+
((_a = this.limetype) === null || _a === void 0 ? void 0 : _a.localname.singular) ||
|
|
164
|
+
this.translator.get('object'));
|
|
143
165
|
}
|
|
144
166
|
get fileProperty() {
|
|
145
167
|
if (!this.limeobject) {
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["limebb-feed.cjs",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[1],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["limebb-kanban.cjs",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["limebb-chat-list.cjs",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["limebb-text-editor.cjs",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["limebb-date-range.cjs",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format.cjs",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-
|
|
11
|
+
return index.bootstrapLazy([["limebb-feed.cjs",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[1],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["limebb-kanban.cjs",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["limebb-chat-list.cjs",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["limebb-limeobject-file-viewer.cjs",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["limebb-text-editor.cjs",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["limebb-date-range.cjs",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format.cjs",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-notification-list.cjs",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":["handleItemsChange"]}]]],["limebb-browser.cjs",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["limebb-component-config.cjs",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":["watchFormInfo"],"configComponent":["watchconfigComponent"]}]]],["limebb-component-picker.cjs",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-dashboard-widget.cjs",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["limebb-icon-picker.cjs",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-info-tile.cjs",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]},null,{"filterId":["watchFilterId"],"propertyName":["watchPropertyName"],"aggregateOperator":["watchAggregateOperator"]}]]],["limebb-info-tile-date-format.cjs",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["limebb-info-tile-decimal-format.cjs",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["limebb-info-tile-format.cjs",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["limebb-info-tile-relative-date-format.cjs",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["limebb-info-tile-unit-format.cjs",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["limebb-loader.cjs",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["limebb-locale-picker.cjs",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["limebb-mention.cjs",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["limebb-mention-group-counter.cjs",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["limebb-percentage-visualizer.cjs",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":["valueChanged"]}]]],["limebb-trend-indicator.cjs",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":["valueChanged"]}]]],["limebb-feed-item-thumbnail-file-info.cjs",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["limebb-navigation-button_2.cjs",[[1,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["limebb-feed-timeline-item.cjs",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["limebb-kanban-group.cjs",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["limebb-text-editor-picker.cjs",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":["watchOpen"]}]]],["limebb-currency-picker.cjs",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["limebb-date-picker.cjs",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["limebb-live-docs-info.cjs",[[1,"limebb-live-docs-info"]]],["limebb-notification-item.cjs",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["limebb-kanban-item.cjs",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["limebb-chat-item_2.cjs",[[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["limebb-empty-state.cjs",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Map of file extensions to their preview type
|
|
2
|
+
const previewExtensionMap = {
|
|
3
|
+
// Browser-native preview
|
|
4
|
+
avi: 'browser',
|
|
5
|
+
bmp: 'browser',
|
|
6
|
+
csv: 'browser', // CSV shows as plain text
|
|
7
|
+
gif: 'browser',
|
|
8
|
+
heic: 'browser',
|
|
9
|
+
html: 'browser',
|
|
10
|
+
jpeg: 'browser',
|
|
11
|
+
jpg: 'browser',
|
|
12
|
+
json: 'browser',
|
|
13
|
+
mp3: 'browser',
|
|
14
|
+
mp4: 'browser',
|
|
15
|
+
mov: 'browser',
|
|
16
|
+
ogg: 'browser',
|
|
17
|
+
pdf: 'browser',
|
|
18
|
+
png: 'browser',
|
|
19
|
+
svg: 'browser',
|
|
20
|
+
svgz: 'browser',
|
|
21
|
+
txt: 'browser',
|
|
22
|
+
wav: 'browser',
|
|
23
|
+
wmv: 'browser',
|
|
24
|
+
xml: 'browser',
|
|
25
|
+
// SharePoint PDF preview
|
|
26
|
+
doc: 'sharepoint',
|
|
27
|
+
docx: 'sharepoint',
|
|
28
|
+
dot: 'sharepoint',
|
|
29
|
+
dotx: 'sharepoint',
|
|
30
|
+
odp: 'sharepoint',
|
|
31
|
+
ods: 'sharepoint',
|
|
32
|
+
pot: 'sharepoint',
|
|
33
|
+
ppt: 'sharepoint',
|
|
34
|
+
pptx: 'sharepoint',
|
|
35
|
+
pps: 'sharepoint',
|
|
36
|
+
ppsx: 'sharepoint',
|
|
37
|
+
xls: 'sharepoint',
|
|
38
|
+
xlsb: 'sharepoint',
|
|
39
|
+
xlsm: 'sharepoint',
|
|
40
|
+
xlsx: 'sharepoint',
|
|
41
|
+
odt: 'sharepoint',
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Determines how a file can be previewed.
|
|
45
|
+
*
|
|
46
|
+
* @param extension - The file extension (case-insensitive).
|
|
47
|
+
* @returns The preview type.
|
|
48
|
+
*/
|
|
49
|
+
export function getPreviewType(extension) {
|
|
50
|
+
return previewExtensionMap[extension.toLowerCase()] || 'unsupported';
|
|
51
|
+
}
|
|
@@ -11,7 +11,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
11
11
|
import { h } from "@stencil/core";
|
|
12
12
|
import { PlatformServiceName, SelectCurrentLimeObject, SelectCurrentLimeType, } from "@limetech/lime-web-components";
|
|
13
13
|
import { negate } from "lodash-es";
|
|
14
|
-
import {
|
|
14
|
+
import { LIVE_DOCS_TYPES } from "./constants";
|
|
15
|
+
import { getPreviewType } from "./extension-mapping";
|
|
15
16
|
/**
|
|
16
17
|
* Component for displaying the contents of an attached file on a limeobject
|
|
17
18
|
*
|
|
@@ -30,41 +31,51 @@ export class FileViewer {
|
|
|
30
31
|
* The first available one will be used
|
|
31
32
|
*/
|
|
32
33
|
this.fileTypes = ['view', 'contents', 'download'];
|
|
34
|
+
this.renderLiveDocs = (file) => {
|
|
35
|
+
if (!this.isLiveDocsAvailable(file)) {
|
|
36
|
+
return h("limebb-live-docs-info", null);
|
|
37
|
+
}
|
|
38
|
+
if (!this.platform.isFeatureEnabled('useOfficeFilePreview')) {
|
|
39
|
+
return (h("limebb-empty-state", { value: 'Preview of this file type will be available soon', icon: {
|
|
40
|
+
name: 'attention',
|
|
41
|
+
color: 'rgb(var(--color-blue-light))',
|
|
42
|
+
} }));
|
|
43
|
+
}
|
|
44
|
+
const url = this.getLiveDocsUrl(file);
|
|
45
|
+
return (h("iframe", { src: url, frameBorder: 0, marginHeight: 0, marginWidth: 0 }));
|
|
46
|
+
};
|
|
47
|
+
this.renderFileViewer = (file) => {
|
|
48
|
+
const filename = file.filename;
|
|
49
|
+
const url = this.getFileUrl(file);
|
|
50
|
+
if (!url) {
|
|
51
|
+
return this.renderNotFound();
|
|
52
|
+
}
|
|
53
|
+
return (h("limel-file-viewer", { filename: filename, url: url, allowFullscreen: true, allowOpenInNewTab: true }));
|
|
54
|
+
};
|
|
55
|
+
this.renderUnsupported = (file) => {
|
|
56
|
+
return (h("limel-file-viewer", { filename: file.filename, url: undefined, allowFullscreen: true, allowOpenInNewTab: true }));
|
|
57
|
+
};
|
|
58
|
+
this.renderNotFound = () => {
|
|
59
|
+
return [
|
|
60
|
+
h("section", { class: "not-found" }, h("limel-icon", { name: "error", size: "large" }), h("h2", null, this.translator.get('webclient.not-found')), h("p", null, this.translator.get('webclient.no-files-attached', {
|
|
61
|
+
object: this.getDescriptive(this.limeobject),
|
|
62
|
+
}))),
|
|
63
|
+
];
|
|
64
|
+
};
|
|
33
65
|
}
|
|
34
66
|
render() {
|
|
35
67
|
const file = this.getFile();
|
|
36
68
|
if (!file) {
|
|
37
69
|
return this.renderNotFound();
|
|
38
70
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
renderLiveDocs(file) {
|
|
48
|
-
const url = this.getLiveDocsUrl(file);
|
|
49
|
-
if (!url) {
|
|
50
|
-
return this.renderNotFound();
|
|
51
|
-
}
|
|
52
|
-
return (h("iframe", { src: url, frameBorder: 0, marginHeight: 0, marginWidth: 0 }));
|
|
53
|
-
}
|
|
54
|
-
renderFileViewer(file) {
|
|
55
|
-
const filename = file.filename;
|
|
56
|
-
const url = this.getFileUrl(file);
|
|
57
|
-
if (!url) {
|
|
58
|
-
return this.renderNotFound();
|
|
59
|
-
}
|
|
60
|
-
return (h("limel-file-viewer", { filename: filename, url: url, allowDownload: true, allowFullscreen: true }));
|
|
61
|
-
}
|
|
62
|
-
renderNotFound() {
|
|
63
|
-
return [
|
|
64
|
-
h("section", { class: "not-found" }, h("limel-icon", { name: "error", size: "large" }), h("h2", null, this.translator.get('webclient.not-found')), h("p", null, this.translator.get('webclient.no-files-attached', {
|
|
65
|
-
object: this.getDescriptive(this.limeobject),
|
|
66
|
-
}))),
|
|
67
|
-
];
|
|
71
|
+
const fileType = getPreviewType(file.extension);
|
|
72
|
+
const fileViewerFunctions = {
|
|
73
|
+
browser: this.renderFileViewer,
|
|
74
|
+
sharepoint: this.renderLiveDocs,
|
|
75
|
+
unsupported: this.renderUnsupported,
|
|
76
|
+
};
|
|
77
|
+
const fileViewerFunction = fileViewerFunctions[fileType];
|
|
78
|
+
return fileViewerFunction(file);
|
|
68
79
|
}
|
|
69
80
|
getLiveDocsUrl(file) {
|
|
70
81
|
let fileTypes = [...this.fileTypes];
|
|
@@ -89,9 +100,6 @@ export class FileViewer {
|
|
|
89
100
|
}
|
|
90
101
|
return this.limeobject.getFile(property.name);
|
|
91
102
|
}
|
|
92
|
-
isLiveDocsExtension(file) {
|
|
93
|
-
return LIVE_DOCS_EXTENSIONS.includes(file.extension);
|
|
94
|
-
}
|
|
95
103
|
isLiveDocsAvailable(file) {
|
|
96
104
|
return LIVE_DOCS_TYPES.some((type) => file.getUrl(type));
|
|
97
105
|
}
|
|
@@ -100,17 +108,9 @@ export class FileViewer {
|
|
|
100
108
|
}
|
|
101
109
|
getDescriptive(limeobject) {
|
|
102
110
|
var _a;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
if (!descriptive) {
|
|
108
|
-
descriptive = (_a = this.limetype) === null || _a === void 0 ? void 0 : _a.localname.singular;
|
|
109
|
-
}
|
|
110
|
-
if (!descriptive) {
|
|
111
|
-
descriptive = this.translator.get('object');
|
|
112
|
-
}
|
|
113
|
-
return descriptive;
|
|
111
|
+
return ((limeobject === null || limeobject === void 0 ? void 0 : limeobject.descriptive) ||
|
|
112
|
+
((_a = this.limetype) === null || _a === void 0 ? void 0 : _a.localname.singular) ||
|
|
113
|
+
this.translator.get('object'));
|
|
114
114
|
}
|
|
115
115
|
get fileProperty() {
|
|
116
116
|
if (!this.limeobject) {
|
|
@@ -1,38 +1,62 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { G as Ge, L as Le, c } from './index.esm.js';
|
|
3
|
+
import { d as defineCustomElement$3 } from './empty-state.js';
|
|
3
4
|
import { d as defineCustomElement$2 } from './live-docs-info.js';
|
|
4
5
|
import { n as negate } from './negate.js';
|
|
5
6
|
|
|
6
7
|
const LIVE_DOCS_TYPES = ['pdf', 'edit', 'view'];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
|
|
8
|
+
|
|
9
|
+
// Map of file extensions to their preview type
|
|
10
|
+
const previewExtensionMap = {
|
|
11
|
+
// Browser-native preview
|
|
12
|
+
avi: 'browser',
|
|
13
|
+
bmp: 'browser',
|
|
14
|
+
csv: 'browser', // CSV shows as plain text
|
|
15
|
+
gif: 'browser',
|
|
16
|
+
heic: 'browser',
|
|
17
|
+
html: 'browser',
|
|
18
|
+
jpeg: 'browser',
|
|
19
|
+
jpg: 'browser',
|
|
20
|
+
json: 'browser',
|
|
21
|
+
mp3: 'browser',
|
|
22
|
+
mp4: 'browser',
|
|
23
|
+
mov: 'browser',
|
|
24
|
+
ogg: 'browser',
|
|
25
|
+
pdf: 'browser',
|
|
26
|
+
png: 'browser',
|
|
27
|
+
svg: 'browser',
|
|
28
|
+
svgz: 'browser',
|
|
29
|
+
txt: 'browser',
|
|
30
|
+
wav: 'browser',
|
|
31
|
+
wmv: 'browser',
|
|
32
|
+
xml: 'browser',
|
|
33
|
+
// SharePoint PDF preview
|
|
34
|
+
doc: 'sharepoint',
|
|
35
|
+
docx: 'sharepoint',
|
|
36
|
+
dot: 'sharepoint',
|
|
37
|
+
dotx: 'sharepoint',
|
|
38
|
+
odp: 'sharepoint',
|
|
39
|
+
ods: 'sharepoint',
|
|
40
|
+
pot: 'sharepoint',
|
|
41
|
+
ppt: 'sharepoint',
|
|
42
|
+
pptx: 'sharepoint',
|
|
43
|
+
pps: 'sharepoint',
|
|
44
|
+
ppsx: 'sharepoint',
|
|
45
|
+
xls: 'sharepoint',
|
|
46
|
+
xlsb: 'sharepoint',
|
|
47
|
+
xlsm: 'sharepoint',
|
|
48
|
+
xlsx: 'sharepoint',
|
|
49
|
+
odt: 'sharepoint',
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Determines how a file can be previewed.
|
|
53
|
+
*
|
|
54
|
+
* @param extension - The file extension (case-insensitive).
|
|
55
|
+
* @returns The preview type.
|
|
56
|
+
*/
|
|
57
|
+
function getPreviewType(extension) {
|
|
58
|
+
return previewExtensionMap[extension.toLowerCase()] || 'unsupported';
|
|
59
|
+
}
|
|
36
60
|
|
|
37
61
|
const fileViewerCss = ".not-found{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;line-height:1rem;color:rgb(var(--contrast-1100))}.not-found limel-icon{color:rgb(var(--color-red-default))}iframe{height:100%;width:100%}";
|
|
38
62
|
const LimebbLimeobjectFileViewerStyle0 = fileViewerCss;
|
|
@@ -58,41 +82,51 @@ const FileViewer = /*@__PURE__*/ proxyCustomElement(class FileViewer extends HTM
|
|
|
58
82
|
* The first available one will be used
|
|
59
83
|
*/
|
|
60
84
|
this.fileTypes = ['view', 'contents', 'download'];
|
|
85
|
+
this.renderLiveDocs = (file) => {
|
|
86
|
+
if (!this.isLiveDocsAvailable(file)) {
|
|
87
|
+
return h("limebb-live-docs-info", null);
|
|
88
|
+
}
|
|
89
|
+
if (!this.platform.isFeatureEnabled('useOfficeFilePreview')) {
|
|
90
|
+
return (h("limebb-empty-state", { value: 'Preview of this file type will be available soon', icon: {
|
|
91
|
+
name: 'attention',
|
|
92
|
+
color: 'rgb(var(--color-blue-light))',
|
|
93
|
+
} }));
|
|
94
|
+
}
|
|
95
|
+
const url = this.getLiveDocsUrl(file);
|
|
96
|
+
return (h("iframe", { src: url, frameBorder: 0, marginHeight: 0, marginWidth: 0 }));
|
|
97
|
+
};
|
|
98
|
+
this.renderFileViewer = (file) => {
|
|
99
|
+
const filename = file.filename;
|
|
100
|
+
const url = this.getFileUrl(file);
|
|
101
|
+
if (!url) {
|
|
102
|
+
return this.renderNotFound();
|
|
103
|
+
}
|
|
104
|
+
return (h("limel-file-viewer", { filename: filename, url: url, allowFullscreen: true, allowOpenInNewTab: true }));
|
|
105
|
+
};
|
|
106
|
+
this.renderUnsupported = (file) => {
|
|
107
|
+
return (h("limel-file-viewer", { filename: file.filename, url: undefined, allowFullscreen: true, allowOpenInNewTab: true }));
|
|
108
|
+
};
|
|
109
|
+
this.renderNotFound = () => {
|
|
110
|
+
return [
|
|
111
|
+
h("section", { class: "not-found" }, h("limel-icon", { name: "error", size: "large" }), h("h2", null, this.translator.get('webclient.not-found')), h("p", null, this.translator.get('webclient.no-files-attached', {
|
|
112
|
+
object: this.getDescriptive(this.limeobject),
|
|
113
|
+
}))),
|
|
114
|
+
];
|
|
115
|
+
};
|
|
61
116
|
}
|
|
62
117
|
render() {
|
|
63
118
|
const file = this.getFile();
|
|
64
119
|
if (!file) {
|
|
65
120
|
return this.renderNotFound();
|
|
66
121
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
renderLiveDocs(file) {
|
|
76
|
-
const url = this.getLiveDocsUrl(file);
|
|
77
|
-
if (!url) {
|
|
78
|
-
return this.renderNotFound();
|
|
79
|
-
}
|
|
80
|
-
return (h("iframe", { src: url, frameBorder: 0, marginHeight: 0, marginWidth: 0 }));
|
|
81
|
-
}
|
|
82
|
-
renderFileViewer(file) {
|
|
83
|
-
const filename = file.filename;
|
|
84
|
-
const url = this.getFileUrl(file);
|
|
85
|
-
if (!url) {
|
|
86
|
-
return this.renderNotFound();
|
|
87
|
-
}
|
|
88
|
-
return (h("limel-file-viewer", { filename: filename, url: url, allowDownload: true, allowFullscreen: true }));
|
|
89
|
-
}
|
|
90
|
-
renderNotFound() {
|
|
91
|
-
return [
|
|
92
|
-
h("section", { class: "not-found" }, h("limel-icon", { name: "error", size: "large" }), h("h2", null, this.translator.get('webclient.not-found')), h("p", null, this.translator.get('webclient.no-files-attached', {
|
|
93
|
-
object: this.getDescriptive(this.limeobject),
|
|
94
|
-
}))),
|
|
95
|
-
];
|
|
122
|
+
const fileType = getPreviewType(file.extension);
|
|
123
|
+
const fileViewerFunctions = {
|
|
124
|
+
browser: this.renderFileViewer,
|
|
125
|
+
sharepoint: this.renderLiveDocs,
|
|
126
|
+
unsupported: this.renderUnsupported,
|
|
127
|
+
};
|
|
128
|
+
const fileViewerFunction = fileViewerFunctions[fileType];
|
|
129
|
+
return fileViewerFunction(file);
|
|
96
130
|
}
|
|
97
131
|
getLiveDocsUrl(file) {
|
|
98
132
|
let fileTypes = [...this.fileTypes];
|
|
@@ -117,9 +151,6 @@ const FileViewer = /*@__PURE__*/ proxyCustomElement(class FileViewer extends HTM
|
|
|
117
151
|
}
|
|
118
152
|
return this.limeobject.getFile(property.name);
|
|
119
153
|
}
|
|
120
|
-
isLiveDocsExtension(file) {
|
|
121
|
-
return LIVE_DOCS_EXTENSIONS.includes(file.extension);
|
|
122
|
-
}
|
|
123
154
|
isLiveDocsAvailable(file) {
|
|
124
155
|
return LIVE_DOCS_TYPES.some((type) => file.getUrl(type));
|
|
125
156
|
}
|
|
@@ -128,17 +159,9 @@ const FileViewer = /*@__PURE__*/ proxyCustomElement(class FileViewer extends HTM
|
|
|
128
159
|
}
|
|
129
160
|
getDescriptive(limeobject) {
|
|
130
161
|
var _a;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
if (!descriptive) {
|
|
136
|
-
descriptive = (_a = this.limetype) === null || _a === void 0 ? void 0 : _a.localname.singular;
|
|
137
|
-
}
|
|
138
|
-
if (!descriptive) {
|
|
139
|
-
descriptive = this.translator.get('object');
|
|
140
|
-
}
|
|
141
|
-
return descriptive;
|
|
162
|
+
return ((limeobject === null || limeobject === void 0 ? void 0 : limeobject.descriptive) ||
|
|
163
|
+
((_a = this.limetype) === null || _a === void 0 ? void 0 : _a.localname.singular) ||
|
|
164
|
+
this.translator.get('object'));
|
|
142
165
|
}
|
|
143
166
|
get fileProperty() {
|
|
144
167
|
if (!this.limeobject) {
|
|
@@ -176,13 +199,18 @@ function defineCustomElement$1() {
|
|
|
176
199
|
if (typeof customElements === "undefined") {
|
|
177
200
|
return;
|
|
178
201
|
}
|
|
179
|
-
const components = ["limebb-limeobject-file-viewer", "limebb-live-docs-info"];
|
|
202
|
+
const components = ["limebb-limeobject-file-viewer", "limebb-empty-state", "limebb-live-docs-info"];
|
|
180
203
|
components.forEach(tagName => { switch (tagName) {
|
|
181
204
|
case "limebb-limeobject-file-viewer":
|
|
182
205
|
if (!customElements.get(tagName)) {
|
|
183
206
|
customElements.define(tagName, FileViewer);
|
|
184
207
|
}
|
|
185
208
|
break;
|
|
209
|
+
case "limebb-empty-state":
|
|
210
|
+
if (!customElements.get(tagName)) {
|
|
211
|
+
defineCustomElement$3();
|
|
212
|
+
}
|
|
213
|
+
break;
|
|
186
214
|
case "limebb-live-docs-info":
|
|
187
215
|
if (!customElements.get(tagName)) {
|
|
188
216
|
defineCustomElement$2();
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["limebb-feed",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[1],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["limebb-kanban",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["limebb-chat-list",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["limebb-text-editor",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["limebb-date-range",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-
|
|
19
|
+
return bootstrapLazy([["limebb-feed",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[1],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["limebb-kanban",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["limebb-chat-list",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["limebb-limeobject-file-viewer",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["limebb-text-editor",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["limebb-date-range",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-notification-list",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":["handleItemsChange"]}]]],["limebb-browser",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["limebb-component-config",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":["watchFormInfo"],"configComponent":["watchconfigComponent"]}]]],["limebb-component-picker",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-dashboard-widget",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["limebb-icon-picker",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-info-tile",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]},null,{"filterId":["watchFilterId"],"propertyName":["watchPropertyName"],"aggregateOperator":["watchAggregateOperator"]}]]],["limebb-info-tile-date-format",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["limebb-info-tile-decimal-format",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["limebb-info-tile-format",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["limebb-info-tile-relative-date-format",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["limebb-info-tile-unit-format",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["limebb-loader",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["limebb-locale-picker",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["limebb-mention",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["limebb-mention-group-counter",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["limebb-percentage-visualizer",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":["valueChanged"]}]]],["limebb-trend-indicator",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":["valueChanged"]}]]],["limebb-feed-item-thumbnail-file-info",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["limebb-navigation-button_2",[[1,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["limebb-feed-timeline-item",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["limebb-kanban-group",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["limebb-text-editor-picker",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":["watchOpen"]}]]],["limebb-currency-picker",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["limebb-date-picker",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["limebb-live-docs-info",[[1,"limebb-live-docs-info"]]],["limebb-notification-item",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["limebb-kanban-item",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["limebb-chat-item_2",[[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["limebb-empty-state",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]]], options);
|
|
20
20
|
});
|
|
@@ -3,35 +3,58 @@ import { G as Ge, L as Le, c } from './index.esm-d8fdeb18.js';
|
|
|
3
3
|
import { n as negate } from './negate-55744008.js';
|
|
4
4
|
|
|
5
5
|
const LIVE_DOCS_TYPES = ['pdf', 'edit', 'view'];
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
|
|
6
|
+
|
|
7
|
+
// Map of file extensions to their preview type
|
|
8
|
+
const previewExtensionMap = {
|
|
9
|
+
// Browser-native preview
|
|
10
|
+
avi: 'browser',
|
|
11
|
+
bmp: 'browser',
|
|
12
|
+
csv: 'browser', // CSV shows as plain text
|
|
13
|
+
gif: 'browser',
|
|
14
|
+
heic: 'browser',
|
|
15
|
+
html: 'browser',
|
|
16
|
+
jpeg: 'browser',
|
|
17
|
+
jpg: 'browser',
|
|
18
|
+
json: 'browser',
|
|
19
|
+
mp3: 'browser',
|
|
20
|
+
mp4: 'browser',
|
|
21
|
+
mov: 'browser',
|
|
22
|
+
ogg: 'browser',
|
|
23
|
+
pdf: 'browser',
|
|
24
|
+
png: 'browser',
|
|
25
|
+
svg: 'browser',
|
|
26
|
+
svgz: 'browser',
|
|
27
|
+
txt: 'browser',
|
|
28
|
+
wav: 'browser',
|
|
29
|
+
wmv: 'browser',
|
|
30
|
+
xml: 'browser',
|
|
31
|
+
// SharePoint PDF preview
|
|
32
|
+
doc: 'sharepoint',
|
|
33
|
+
docx: 'sharepoint',
|
|
34
|
+
dot: 'sharepoint',
|
|
35
|
+
dotx: 'sharepoint',
|
|
36
|
+
odp: 'sharepoint',
|
|
37
|
+
ods: 'sharepoint',
|
|
38
|
+
pot: 'sharepoint',
|
|
39
|
+
ppt: 'sharepoint',
|
|
40
|
+
pptx: 'sharepoint',
|
|
41
|
+
pps: 'sharepoint',
|
|
42
|
+
ppsx: 'sharepoint',
|
|
43
|
+
xls: 'sharepoint',
|
|
44
|
+
xlsb: 'sharepoint',
|
|
45
|
+
xlsm: 'sharepoint',
|
|
46
|
+
xlsx: 'sharepoint',
|
|
47
|
+
odt: 'sharepoint',
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Determines how a file can be previewed.
|
|
51
|
+
*
|
|
52
|
+
* @param extension - The file extension (case-insensitive).
|
|
53
|
+
* @returns The preview type.
|
|
54
|
+
*/
|
|
55
|
+
function getPreviewType(extension) {
|
|
56
|
+
return previewExtensionMap[extension.toLowerCase()] || 'unsupported';
|
|
57
|
+
}
|
|
35
58
|
|
|
36
59
|
const fileViewerCss = ".not-found{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;line-height:1rem;color:rgb(var(--contrast-1100))}.not-found limel-icon{color:rgb(var(--color-red-default))}iframe{height:100%;width:100%}";
|
|
37
60
|
const LimebbLimeobjectFileViewerStyle0 = fileViewerCss;
|
|
@@ -55,41 +78,51 @@ const FileViewer = class {
|
|
|
55
78
|
* The first available one will be used
|
|
56
79
|
*/
|
|
57
80
|
this.fileTypes = ['view', 'contents', 'download'];
|
|
81
|
+
this.renderLiveDocs = (file) => {
|
|
82
|
+
if (!this.isLiveDocsAvailable(file)) {
|
|
83
|
+
return h("limebb-live-docs-info", null);
|
|
84
|
+
}
|
|
85
|
+
if (!this.platform.isFeatureEnabled('useOfficeFilePreview')) {
|
|
86
|
+
return (h("limebb-empty-state", { value: 'Preview of this file type will be available soon', icon: {
|
|
87
|
+
name: 'attention',
|
|
88
|
+
color: 'rgb(var(--color-blue-light))',
|
|
89
|
+
} }));
|
|
90
|
+
}
|
|
91
|
+
const url = this.getLiveDocsUrl(file);
|
|
92
|
+
return (h("iframe", { src: url, frameBorder: 0, marginHeight: 0, marginWidth: 0 }));
|
|
93
|
+
};
|
|
94
|
+
this.renderFileViewer = (file) => {
|
|
95
|
+
const filename = file.filename;
|
|
96
|
+
const url = this.getFileUrl(file);
|
|
97
|
+
if (!url) {
|
|
98
|
+
return this.renderNotFound();
|
|
99
|
+
}
|
|
100
|
+
return (h("limel-file-viewer", { filename: filename, url: url, allowFullscreen: true, allowOpenInNewTab: true }));
|
|
101
|
+
};
|
|
102
|
+
this.renderUnsupported = (file) => {
|
|
103
|
+
return (h("limel-file-viewer", { filename: file.filename, url: undefined, allowFullscreen: true, allowOpenInNewTab: true }));
|
|
104
|
+
};
|
|
105
|
+
this.renderNotFound = () => {
|
|
106
|
+
return [
|
|
107
|
+
h("section", { class: "not-found" }, h("limel-icon", { name: "error", size: "large" }), h("h2", null, this.translator.get('webclient.not-found')), h("p", null, this.translator.get('webclient.no-files-attached', {
|
|
108
|
+
object: this.getDescriptive(this.limeobject),
|
|
109
|
+
}))),
|
|
110
|
+
];
|
|
111
|
+
};
|
|
58
112
|
}
|
|
59
113
|
render() {
|
|
60
114
|
const file = this.getFile();
|
|
61
115
|
if (!file) {
|
|
62
116
|
return this.renderNotFound();
|
|
63
117
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
renderLiveDocs(file) {
|
|
73
|
-
const url = this.getLiveDocsUrl(file);
|
|
74
|
-
if (!url) {
|
|
75
|
-
return this.renderNotFound();
|
|
76
|
-
}
|
|
77
|
-
return (h("iframe", { src: url, frameBorder: 0, marginHeight: 0, marginWidth: 0 }));
|
|
78
|
-
}
|
|
79
|
-
renderFileViewer(file) {
|
|
80
|
-
const filename = file.filename;
|
|
81
|
-
const url = this.getFileUrl(file);
|
|
82
|
-
if (!url) {
|
|
83
|
-
return this.renderNotFound();
|
|
84
|
-
}
|
|
85
|
-
return (h("limel-file-viewer", { filename: filename, url: url, allowDownload: true, allowFullscreen: true }));
|
|
86
|
-
}
|
|
87
|
-
renderNotFound() {
|
|
88
|
-
return [
|
|
89
|
-
h("section", { class: "not-found" }, h("limel-icon", { name: "error", size: "large" }), h("h2", null, this.translator.get('webclient.not-found')), h("p", null, this.translator.get('webclient.no-files-attached', {
|
|
90
|
-
object: this.getDescriptive(this.limeobject),
|
|
91
|
-
}))),
|
|
92
|
-
];
|
|
118
|
+
const fileType = getPreviewType(file.extension);
|
|
119
|
+
const fileViewerFunctions = {
|
|
120
|
+
browser: this.renderFileViewer,
|
|
121
|
+
sharepoint: this.renderLiveDocs,
|
|
122
|
+
unsupported: this.renderUnsupported,
|
|
123
|
+
};
|
|
124
|
+
const fileViewerFunction = fileViewerFunctions[fileType];
|
|
125
|
+
return fileViewerFunction(file);
|
|
93
126
|
}
|
|
94
127
|
getLiveDocsUrl(file) {
|
|
95
128
|
let fileTypes = [...this.fileTypes];
|
|
@@ -114,9 +147,6 @@ const FileViewer = class {
|
|
|
114
147
|
}
|
|
115
148
|
return this.limeobject.getFile(property.name);
|
|
116
149
|
}
|
|
117
|
-
isLiveDocsExtension(file) {
|
|
118
|
-
return LIVE_DOCS_EXTENSIONS.includes(file.extension);
|
|
119
|
-
}
|
|
120
150
|
isLiveDocsAvailable(file) {
|
|
121
151
|
return LIVE_DOCS_TYPES.some((type) => file.getUrl(type));
|
|
122
152
|
}
|
|
@@ -125,17 +155,9 @@ const FileViewer = class {
|
|
|
125
155
|
}
|
|
126
156
|
getDescriptive(limeobject) {
|
|
127
157
|
var _a;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
if (!descriptive) {
|
|
133
|
-
descriptive = (_a = this.limetype) === null || _a === void 0 ? void 0 : _a.localname.singular;
|
|
134
|
-
}
|
|
135
|
-
if (!descriptive) {
|
|
136
|
-
descriptive = this.translator.get('object');
|
|
137
|
-
}
|
|
138
|
-
return descriptive;
|
|
158
|
+
return ((limeobject === null || limeobject === void 0 ? void 0 : limeobject.descriptive) ||
|
|
159
|
+
((_a = this.limetype) === null || _a === void 0 ? void 0 : _a.localname.singular) ||
|
|
160
|
+
this.translator.get('object'));
|
|
139
161
|
}
|
|
140
162
|
get fileProperty() {
|
|
141
163
|
if (!this.limeobject) {
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["limebb-feed",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[1],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["limebb-kanban",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["limebb-chat-list",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["limebb-text-editor",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["limebb-date-range",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-
|
|
8
|
+
return bootstrapLazy([["limebb-feed",[[1,"limebb-feed",{"platform":[16],"context":[16],"items":[16],"emptyStateMessage":[1,"empty-state-message"],"heading":[1],"loading":[4],"minutesOfProximity":[2,"minutes-of-proximity"],"totalCount":[2,"total-count"],"direction":[1],"lastVisitedTimestamp":[1,"last-visited-timestamp"],"highlightedItemId":[8,"highlighted-item-id"]},null,{"highlightedItemId":["highlightedItemIdChanged"]}]]],["limebb-kanban",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["limebb-chat-list",[[1,"limebb-chat-list",{"platform":[16],"context":[16],"items":[16],"loading":[516],"isTypingIndicatorVisible":[516,"is-typing-indicator-visible"],"lastVisitedTimestamp":[513,"last-visited-timestamp"],"order":[513]},null,{"items":["handleItemsChange"]}]]],["limebb-limeobject-file-viewer",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["limebb-text-editor",[[1,"limebb-text-editor",{"platform":[16],"context":[16],"allowMentioning":[4,"allow-mentioning"],"contentType":[1,"content-type"],"language":[513],"disabled":[516],"readonly":[516],"helperText":[513,"helper-text"],"placeholder":[513],"label":[513],"invalid":[516],"required":[516],"selectedContext":[16],"ui":[513],"allowResize":[4,"allow-resize"],"value":[1],"draftIdentifier":[1,"draft-identifier"],"triggerMap":[16],"customElements":[16],"allowInlineImages":[4,"allow-inline-images"],"items":[32],"highlightedItemIndex":[32],"editorPickerQuery":[32],"searchableLimetypes":[32],"isPickerOpen":[32],"isSearching":[32]},null,{"isPickerOpen":["watchOpen"],"editorPickerQuery":["watchQuery"]}]]],["limebb-date-range",[[1,"limebb-date-range",{"platform":[16],"context":[16],"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-info-tile-currency-format",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["limebb-notification-list",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":["handleItemsChange"]}]]],["limebb-browser",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["limebb-component-config",[[1,"limebb-component-config",{"platform":[16],"context":[16],"value":[16],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"formInfo":[16],"type":[1],"nameField":[1,"name-field"],"configComponent":[32],"configViewType":[32]},null,{"formInfo":["watchFormInfo"],"configComponent":["watchconfigComponent"]}]]],["limebb-component-picker",[[1,"limebb-component-picker",{"platform":[16],"context":[16],"type":[1],"tags":[16],"value":[1],"copyLabel":[1,"copy-label"],"hideCopyButton":[4,"hide-copy-button"],"required":[4],"readonly":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-dashboard-widget",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["limebb-icon-picker",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["limebb-info-tile",[[1,"limebb-info-tile",{"platform":[16],"context":[16],"filterId":[513,"filter-id"],"disabled":[4],"icon":[513],"label":[1],"prefix":[1],"suffix":[1],"propertyName":[1,"property-name"],"aggregateOperator":[1,"aggregate-operator"],"format":[16],"config":[32],"filters":[32],"value":[32],"loading":[32],"error":[32]},null,{"filterId":["watchFilterId"],"propertyName":["watchPropertyName"],"aggregateOperator":["watchAggregateOperator"]}]]],["limebb-info-tile-date-format",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["limebb-info-tile-decimal-format",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["limebb-info-tile-format",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["limebb-info-tile-relative-date-format",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["limebb-info-tile-unit-format",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["limebb-loader",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["limebb-locale-picker",[[1,"limebb-locale-picker",{"platform":[16],"context":[16],"value":[1],"required":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"],"readonly":[4],"multipleChoice":[4,"multiple-choice"],"allLanguages":[32]}]]],["limebb-mention",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["limebb-mention-group-counter",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["limebb-percentage-visualizer",[[1,"limebb-percentage-visualizer",{"platform":[16],"context":[16],"value":[520],"rangeMax":[514,"range-max"],"rangeMin":[514,"range-min"],"multiplier":[514],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"],"displayPercentageColors":[516,"display-percentage-colors"]},null,{"value":["valueChanged"]}]]],["limebb-trend-indicator",[[1,"limebb-trend-indicator",{"platform":[16],"context":[16],"value":[520],"formerValue":[514,"former-value"],"suffix":[513],"label":[513],"invalid":[516],"required":[516],"helperText":[513,"helper-text"],"reducePresence":[516,"reduce-presence"]},null,{"value":["valueChanged"]}]]],["limebb-feed-item-thumbnail-file-info",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["limebb-navigation-button_2",[[1,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[16],"icon":[513],"value":[1],"openDirection":[513,"open-direction"],"popoverMaxWidth":[513,"popover-max-width"],"popoverMaxHeight":[513,"popover-max-height"],"actions":[16],"isPopoverOpen":[32]}],[17,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]],["limebb-feed-timeline-item",[[1,"limebb-feed-timeline-item",{"platform":[16],"context":[16],"item":[16],"ui":[513],"helperText":[1,"helper-text"],"hasError":[516,"has-error"],"isBundled":[516,"is-bundled"],"headingCanExpand":[32],"isHeadingExpanded":[32],"showMore":[32],"isTall":[32]}]]],["limebb-kanban-group",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["limebb-text-editor-picker",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":["watchOpen"]}]]],["limebb-currency-picker",[[1,"limebb-currency-picker",{"platform":[16],"context":[16],"label":[513],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"invalid":[516],"disabled":[516],"value":[1]}]]],["limebb-date-picker",[[1,"limebb-date-picker",{"platform":[16],"context":[16],"disabled":[516],"readonly":[516],"invalid":[516],"label":[513],"placeholder":[513],"helperText":[513,"helper-text"],"required":[516],"value":[1],"type":[513]}]]],["limebb-live-docs-info",[[1,"limebb-live-docs-info"]]],["limebb-notification-item",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["limebb-kanban-item",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["limebb-chat-item_2",[[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["limebb-empty-state",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-1556b545.js";export{s as setNonce}from"./p-1556b545.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t([["p-bebe4db0",[[1,"limebb-feed",{platform:[16],context:[16],items:[16],emptyStateMessage:[1,"empty-state-message"],heading:[1],loading:[4],minutesOfProximity:[2,"minutes-of-proximity"],totalCount:[2,"total-count"],direction:[1],lastVisitedTimestamp:[1,"last-visited-timestamp"],highlightedItemId:[8,"highlighted-item-id"]},null,{highlightedItemId:["highlightedItemIdChanged"]}]]],["p-3a406a20",[[1,"limebb-kanban",{platform:[16],context:[16],groups:[16]}]]],["p-8c8b7115",[[1,"limebb-chat-list",{platform:[16],context:[16],items:[16],loading:[516],isTypingIndicatorVisible:[516,"is-typing-indicator-visible"],lastVisitedTimestamp:[513,"last-visited-timestamp"],order:[513]},null,{items:["handleItemsChange"]}]]],["p-efc9d455",[[1,"limebb-text-editor",{platform:[16],context:[16],allowMentioning:[4,"allow-mentioning"],contentType:[1,"content-type"],language:[513],disabled:[516],readonly:[516],helperText:[513,"helper-text"],placeholder:[513],label:[513],invalid:[516],required:[516],selectedContext:[16],ui:[513],allowResize:[4,"allow-resize"],value:[1],draftIdentifier:[1,"draft-identifier"],triggerMap:[16],customElements:[16],allowInlineImages:[4,"allow-inline-images"],items:[32],highlightedItemIndex:[32],editorPickerQuery:[32],searchableLimetypes:[32],isPickerOpen:[32],isSearching:[32]},null,{isPickerOpen:["watchOpen"],editorPickerQuery:["watchQuery"]}]]],["p-8491aaa1",[[1,"limebb-date-range",{platform:[16],context:[16],startTime:[16],endTime:[16],startTimeLabel:[1,"start-time-label"],endTimeLabel:[1,"end-time-label"],language:[1],timeFormat:[1,"time-format"],type:[1]}]]],["p-568b7520",[[1,"limebb-info-tile-currency-format",{platform:[16],context:[16],value:[16]}]]],["p-
|
|
1
|
+
import{p as e,b as t}from"./p-1556b545.js";export{s as setNonce}from"./p-1556b545.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t([["p-bebe4db0",[[1,"limebb-feed",{platform:[16],context:[16],items:[16],emptyStateMessage:[1,"empty-state-message"],heading:[1],loading:[4],minutesOfProximity:[2,"minutes-of-proximity"],totalCount:[2,"total-count"],direction:[1],lastVisitedTimestamp:[1,"last-visited-timestamp"],highlightedItemId:[8,"highlighted-item-id"]},null,{highlightedItemId:["highlightedItemIdChanged"]}]]],["p-3a406a20",[[1,"limebb-kanban",{platform:[16],context:[16],groups:[16]}]]],["p-8c8b7115",[[1,"limebb-chat-list",{platform:[16],context:[16],items:[16],loading:[516],isTypingIndicatorVisible:[516,"is-typing-indicator-visible"],lastVisitedTimestamp:[513,"last-visited-timestamp"],order:[513]},null,{items:["handleItemsChange"]}]]],["p-a1818969",[[1,"limebb-limeobject-file-viewer",{platform:[16],context:[16],property:[1],fileTypes:[16],limeobject:[32],limetype:[32]}]]],["p-efc9d455",[[1,"limebb-text-editor",{platform:[16],context:[16],allowMentioning:[4,"allow-mentioning"],contentType:[1,"content-type"],language:[513],disabled:[516],readonly:[516],helperText:[513,"helper-text"],placeholder:[513],label:[513],invalid:[516],required:[516],selectedContext:[16],ui:[513],allowResize:[4,"allow-resize"],value:[1],draftIdentifier:[1,"draft-identifier"],triggerMap:[16],customElements:[16],allowInlineImages:[4,"allow-inline-images"],items:[32],highlightedItemIndex:[32],editorPickerQuery:[32],searchableLimetypes:[32],isPickerOpen:[32],isSearching:[32]},null,{isPickerOpen:["watchOpen"],editorPickerQuery:["watchQuery"]}]]],["p-8491aaa1",[[1,"limebb-date-range",{platform:[16],context:[16],startTime:[16],endTime:[16],startTimeLabel:[1,"start-time-label"],endTimeLabel:[1,"end-time-label"],language:[1],timeFormat:[1,"time-format"],type:[1]}]]],["p-568b7520",[[1,"limebb-info-tile-currency-format",{platform:[16],context:[16],value:[16]}]]],["p-d4016891",[[1,"limebb-notification-list",{platform:[16],context:[16],items:[16],loading:[4],lastVisitedTimestamp:[1,"last-visited-timestamp"]},null,{items:["handleItemsChange"]}]]],["p-5e4ba110",[[17,"limebb-browser",{platform:[16],context:[16],items:[16],layout:[1],filter:[32]}]]],["p-92ec9205",[[1,"limebb-component-config",{platform:[16],context:[16],value:[16],required:[4],readonly:[4],disabled:[4],label:[1],helperText:[1,"helper-text"],formInfo:[16],type:[1],nameField:[1,"name-field"],configComponent:[32],configViewType:[32]},null,{formInfo:["watchFormInfo"],configComponent:["watchconfigComponent"]}]]],["p-42e52b50",[[1,"limebb-component-picker",{platform:[16],context:[16],type:[1],tags:[16],value:[1],copyLabel:[1,"copy-label"],hideCopyButton:[4,"hide-copy-button"],required:[4],readonly:[4],disabled:[4],label:[1],helperText:[1,"helper-text"]}]]],["p-10ac8b3e",[[1,"limebb-dashboard-widget",{heading:[513],subheading:[513],supportingText:[513,"supporting-text"],icon:[513]}]]],["p-46d2f604",[[1,"limebb-icon-picker",{value:[1],required:[4],readonly:[4],invalid:[4],disabled:[4],label:[1],helperText:[1,"helper-text"]}]]],["p-16199127",[[1,"limebb-info-tile",{platform:[16],context:[16],filterId:[513,"filter-id"],disabled:[4],icon:[513],label:[1],prefix:[1],suffix:[1],propertyName:[1,"property-name"],aggregateOperator:[1,"aggregate-operator"],format:[16],config:[32],filters:[32],value:[32],loading:[32],error:[32]},null,{filterId:["watchFilterId"],propertyName:["watchPropertyName"],aggregateOperator:["watchAggregateOperator"]}]]],["p-01cff04f",[[1,"limebb-info-tile-date-format",{value:[16]}]]],["p-4caa8bbe",[[1,"limebb-info-tile-decimal-format",{value:[16]}]]],["p-d6af09a8",[[1,"limebb-info-tile-format",{platform:[16],context:[16],type:[1],value:[16]}]]],["p-25e1a434",[[1,"limebb-info-tile-relative-date-format",{value:[16]}]]],["p-6c56121c",[[1,"limebb-info-tile-unit-format",{value:[16]}]]],["p-2aa18c2b",[[1,"limebb-loader",{platform:[16],context:[16]}]]],["p-98c63d2d",[[1,"limebb-locale-picker",{platform:[16],context:[16],value:[1],required:[4],disabled:[4],label:[1],helperText:[1,"helper-text"],readonly:[4],multipleChoice:[4,"multiple-choice"],allLanguages:[32]}]]],["p-3a620226",[[1,"limebb-mention",{limetype:[1],objectid:[2],limeobject:[32]}]]],["p-5821e0c8",[[1,"limebb-mention-group-counter",{count:[2],limetype:[16],helperLabel:[1,"helper-label"]}]]],["p-df6ff5d6",[[1,"limebb-percentage-visualizer",{platform:[16],context:[16],value:[520],rangeMax:[514,"range-max"],rangeMin:[514,"range-min"],multiplier:[514],label:[513],invalid:[516],required:[516],helperText:[513,"helper-text"],reducePresence:[516,"reduce-presence"],displayPercentageColors:[516,"display-percentage-colors"]},null,{value:["valueChanged"]}]]],["p-aac46e3c",[[1,"limebb-trend-indicator",{platform:[16],context:[16],value:[520],formerValue:[514,"former-value"],suffix:[513],label:[513],invalid:[516],required:[516],helperText:[513,"helper-text"],reducePresence:[516,"reduce-presence"]},null,{value:["valueChanged"]}]]],["p-a44f543c",[[1,"limebb-feed-item-thumbnail-file-info",{description:[1]}]]],["p-5f336ee9",[[1,"limebb-summary-popover",{triggerDelay:[514,"trigger-delay"],heading:[513],subheading:[513],image:[16],icon:[513],value:[1],openDirection:[513,"open-direction"],popoverMaxWidth:[513,"popover-max-width"],popoverMaxHeight:[513,"popover-max-height"],actions:[16],isPopoverOpen:[32]}],[17,"limebb-navigation-button",{href:[513],tooltipLabel:[513,"tooltip-label"],tooltipHelperLabel:[513,"tooltip-helper-label"],type:[513]}]]],["p-e2f9e0cc",[[1,"limebb-feed-timeline-item",{platform:[16],context:[16],item:[16],ui:[513],helperText:[1,"helper-text"],hasError:[516,"has-error"],isBundled:[516,"is-bundled"],headingCanExpand:[32],isHeadingExpanded:[32],showMore:[32],isTall:[32]}]]],["p-88cc5b66",[[1,"limebb-kanban-group",{platform:[16],context:[16],identifier:[1],heading:[513],help:[1],items:[16],summary:[1],loading:[516],totalCount:[514,"total-count"]}]]],["p-218b7f38",[[1,"limebb-text-editor-picker",{items:[16],open:[516],isSearching:[4,"is-searching"],emptyMessage:[1,"empty-message"]},null,{open:["watchOpen"]}]]],["p-34357744",[[1,"limebb-currency-picker",{platform:[16],context:[16],label:[513],currencies:[16],helperText:[513,"helper-text"],required:[516],readonly:[516],invalid:[516],disabled:[516],value:[1]}]]],["p-f402184f",[[1,"limebb-date-picker",{platform:[16],context:[16],disabled:[516],readonly:[516],invalid:[516],label:[513],placeholder:[513],helperText:[513,"helper-text"],required:[516],value:[1],type:[513]}]]],["p-8274ea5c",[[1,"limebb-live-docs-info"]]],["p-e3c0183c",[[1,"limebb-notification-item",{platform:[16],context:[16],item:[16]}]]],["p-5be6acf1",[[1,"limebb-kanban-item",{platform:[16],context:[16],item:[16]}]]],["p-3b42fbbc",[[1,"limebb-chat-item",{platform:[16],context:[16],item:[16],helperText:[1,"helper-text"],hasError:[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-292631ea",[[1,"limebb-empty-state",{heading:[513],value:[513],icon:[16]}]]]],e))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as r}from"./p-1556b545.js";import{G as t,L as i,c as o}from"./p-1fba0ade.js";import{n as s}from"./p-7c9484b1.js";const n=["pdf","edit","view"],l={avi:"browser",bmp:"browser",csv:"browser",gif:"browser",heic:"browser",html:"browser",jpeg:"browser",jpg:"browser",json:"browser",mp3:"browser",mp4:"browser",mov:"browser",ogg:"browser",pdf:"browser",png:"browser",svg:"browser",svgz:"browser",txt:"browser",wav:"browser",wmv:"browser",xml:"browser",doc:"sharepoint",docx:"sharepoint",dot:"sharepoint",dotx:"sharepoint",odp:"sharepoint",ods:"sharepoint",pot:"sharepoint",ppt:"sharepoint",pptx:"sharepoint",pps:"sharepoint",ppsx:"sharepoint",xls:"sharepoint",xlsb:"sharepoint",xlsm:"sharepoint",xlsx:"sharepoint",odt:"sharepoint"};var a=function(e,r,t,i){var o,s=arguments.length,n=s<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,r,t,i);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(s<3?o(n):s>3?o(r,t,n):o(r,t))||n);return s>3&&n&&Object.defineProperty(r,t,n),n};const h=class{constructor(t){e(this,t),this.fileTypes=["view","contents","download"],this.renderLiveDocs=e=>{if(!this.isLiveDocsAvailable(e))return r("limebb-live-docs-info",null);if(!this.platform.isFeatureEnabled("useOfficeFilePreview"))return r("limebb-empty-state",{value:"Preview of this file type will be available soon",icon:{name:"attention",color:"rgb(var(--color-blue-light))"}});const t=this.getLiveDocsUrl(e);return r("iframe",{src:t,frameBorder:0,marginHeight:0,marginWidth:0})},this.renderFileViewer=e=>{const t=e.filename,i=this.getFileUrl(e);return i?r("limel-file-viewer",{filename:t,url:i,allowFullscreen:!0,allowOpenInNewTab:!0}):this.renderNotFound()},this.renderUnsupported=e=>r("limel-file-viewer",{filename:e.filename,url:void 0,allowFullscreen:!0,allowOpenInNewTab:!0}),this.renderNotFound=()=>[r("section",{class:"not-found"},r("limel-icon",{name:"error",size:"large"}),r("h2",null,this.translator.get("webclient.not-found")),r("p",null,this.translator.get("webclient.no-files-attached",{object:this.getDescriptive(this.limeobject)})))]}render(){const e=this.getFile();if(!e)return this.renderNotFound();const r=l[e.extension.toLowerCase()]||"unsupported";return(0,{browser:this.renderFileViewer,sharepoint:this.renderLiveDocs,unsupported:this.renderUnsupported}[r])(e)}getLiveDocsUrl(e){let r=[...this.fileTypes];return this.platform.isFeatureEnabled("useOfficeFilePreview")&&(r=["pdf",...r]),r.filter(this.isLiveDocsType).map((r=>e.getUrl(r))).find(Boolean)}getFileUrl(e){return this.fileTypes.filter(s(this.isLiveDocsType)).map((r=>e.getUrl(r))).find(Boolean)}getFile(){const e=this.fileProperty;if(e)return this.limeobject.getFile(e.name)}isLiveDocsAvailable(e){return n.some((r=>e.getUrl(r)))}isLiveDocsType(e){return n.includes(e)}getDescriptive(e){var r;return(null==e?void 0:e.descriptive)||(null===(r=this.limetype)||void 0===r?void 0:r.localname.singular)||this.translator.get("object")}get fileProperty(){if(this.limeobject){if(this.property){const e=this.limeobject.getLimetype().getProperty(this.property);if("file"===e.type)return e}return Object.values(this.limeobject.getLimetype().properties).find((e=>"file"===e.type))}}get translator(){return this.platform.get(o.Translate)}};a([t()],h.prototype,"limeobject",void 0),a([i()],h.prototype,"limetype",void 0),h.style=".not-found{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;line-height:1rem;color:rgb(var(--contrast-1100))}.not-found limel-icon{color:rgb(var(--color-red-default))}iframe{height:100%;width:100%}";export{h as limebb_limeobject_file_viewer}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type PreviewType = 'browser' | 'sharepoint' | 'unsupported';
|
|
2
|
+
/**
|
|
3
|
+
* Determines how a file can be previewed.
|
|
4
|
+
*
|
|
5
|
+
* @param extension - The file extension (case-insensitive).
|
|
6
|
+
* @returns The preview type.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPreviewType(extension: string): PreviewType;
|
|
9
|
+
//# sourceMappingURL=extension-mapping.d.ts.map
|
|
@@ -29,11 +29,11 @@ export declare class FileViewer implements LimeWebComponent {
|
|
|
29
29
|
render(): any;
|
|
30
30
|
private renderLiveDocs;
|
|
31
31
|
private renderFileViewer;
|
|
32
|
+
private renderUnsupported;
|
|
32
33
|
private renderNotFound;
|
|
33
34
|
private getLiveDocsUrl;
|
|
34
35
|
private getFileUrl;
|
|
35
36
|
private getFile;
|
|
36
|
-
private isLiveDocsExtension;
|
|
37
37
|
private isLiveDocsAvailable;
|
|
38
38
|
private isLiveDocsType;
|
|
39
39
|
private getDescriptive;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t}from"./p-1556b545.js";import{G as i,L as r,c as o}from"./p-1fba0ade.js";import{n as s}from"./p-7c9484b1.js";const n=["pdf","edit","view"],l=["ai","aspx","doc","docm","docx","dotm","dotx","emf","html","htm","obj","potm","potx","ppsm","ppsx","ppt","pptm","pptx","psd","rtf","tif","tiff","txt","wmf","xls","xlsx","zip"];var c=function(e,t,i,r){var o,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(s<3?o(n):s>3?o(t,i,n):o(t,i))||n);return s>3&&n&&Object.defineProperty(t,i,n),n};const f=class{constructor(t){e(this,t),this.fileTypes=["view","contents","download"]}render(){const e=this.getFile();return e?this.isLiveDocsExtension(e)?this.isLiveDocsAvailable(e)?this.renderLiveDocs(e):t("limebb-live-docs-info",null):this.renderFileViewer(e):this.renderNotFound()}renderLiveDocs(e){const i=this.getLiveDocsUrl(e);return i?t("iframe",{src:i,frameBorder:0,marginHeight:0,marginWidth:0}):this.renderNotFound()}renderFileViewer(e){const i=e.filename,r=this.getFileUrl(e);return r?t("limel-file-viewer",{filename:i,url:r,allowDownload:!0,allowFullscreen:!0}):this.renderNotFound()}renderNotFound(){return[t("section",{class:"not-found"},t("limel-icon",{name:"error",size:"large"}),t("h2",null,this.translator.get("webclient.not-found")),t("p",null,this.translator.get("webclient.no-files-attached",{object:this.getDescriptive(this.limeobject)})))]}getLiveDocsUrl(e){let t=[...this.fileTypes];return this.platform.isFeatureEnabled("useOfficeFilePreview")&&(t=["pdf",...t]),t.filter(this.isLiveDocsType).map((t=>e.getUrl(t))).find(Boolean)}getFileUrl(e){return this.fileTypes.filter(s(this.isLiveDocsType)).map((t=>e.getUrl(t))).find(Boolean)}getFile(){const e=this.fileProperty;if(e)return this.limeobject.getFile(e.name)}isLiveDocsExtension(e){return l.includes(e.extension)}isLiveDocsAvailable(e){return n.some((t=>e.getUrl(t)))}isLiveDocsType(e){return n.includes(e)}getDescriptive(e){var t;let i="";return(null==e?void 0:e.descriptive)&&(i=e.descriptive),i||(i=null===(t=this.limetype)||void 0===t?void 0:t.localname.singular),i||(i=this.translator.get("object")),i}get fileProperty(){if(this.limeobject){if(this.property){const e=this.limeobject.getLimetype().getProperty(this.property);if("file"===e.type)return e}return Object.values(this.limeobject.getLimetype().properties).find((e=>"file"===e.type))}}get translator(){return this.platform.get(o.Translate)}};c([i()],f.prototype,"limeobject",void 0),c([r()],f.prototype,"limetype",void 0),f.style=".not-found{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center;line-height:1rem;color:rgb(var(--contrast-1100))}.not-found limel-icon{color:rgb(var(--color-red-default))}iframe{height:100%;width:100%}";export{f as limebb_limeobject_file_viewer}
|