@jobber/components 4.71.5 → 4.71.6
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/dist/FormatFile/index.js
CHANGED
|
@@ -53,11 +53,52 @@ function InternalThumbnailImage({ file }) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
// This function comes from MDN: https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator
|
|
57
|
+
function getClientBrowser(userAgent) {
|
|
58
|
+
// The order matters here, and this may report false positives for unlisted browsers.
|
|
59
|
+
if (userAgent.includes("Firefox")) {
|
|
60
|
+
// "Mozilla/5.0 (X11; Linux i686; rv:104.0) Gecko/20100101 Firefox/104.0"
|
|
61
|
+
return "Mozilla Firefox";
|
|
62
|
+
}
|
|
63
|
+
else if (userAgent.includes("SamsungBrowser")) {
|
|
64
|
+
// "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G955F Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.4 Chrome/67.0.3396.87 Mobile Safari/537.36"
|
|
65
|
+
return "Samsung Internet";
|
|
66
|
+
}
|
|
67
|
+
else if (userAgent.includes("Opera") || userAgent.includes("OPR")) {
|
|
68
|
+
// "Mozilla/5.0 (Macintosh; Intel Mac OS X 12_5_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36 OPR/90.0.4480.54"
|
|
69
|
+
return "Opera";
|
|
70
|
+
}
|
|
71
|
+
else if (userAgent.includes("Edge")) {
|
|
72
|
+
// "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299"
|
|
73
|
+
return "Microsoft Edge (Legacy)";
|
|
74
|
+
}
|
|
75
|
+
else if (userAgent.includes("Edg")) {
|
|
76
|
+
// "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36 Edg/104.0.1293.70"
|
|
77
|
+
return "Microsoft Edge (Chromium)";
|
|
78
|
+
}
|
|
79
|
+
else if (userAgent.includes("Chrome")) {
|
|
80
|
+
// "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"
|
|
81
|
+
return "Google Chrome or Chromium";
|
|
82
|
+
}
|
|
83
|
+
else if (userAgent.includes("Safari")) {
|
|
84
|
+
// "Mozilla/5.0 (iPhone; CPU iPhone OS 15_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Mobile/15E148 Safari/604.1"
|
|
85
|
+
return "Apple Safari";
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return "unknown";
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function isSafari(userAgent) {
|
|
92
|
+
return getClientBrowser(userAgent) === "Apple Safari";
|
|
93
|
+
}
|
|
94
|
+
|
|
56
95
|
function InternalThumbnail({ compact = false, size, file, }) {
|
|
57
96
|
const { name, type } = file;
|
|
58
97
|
const iconName = getIconNameFromType(type);
|
|
59
98
|
const hasName = Boolean(name) && compact;
|
|
60
|
-
|
|
99
|
+
const nonHeicImage = !type.startsWith("image/heic");
|
|
100
|
+
const userAgent = typeof document === "undefined" ? "" : window.navigator.userAgent;
|
|
101
|
+
if (type.startsWith("image/") && (nonHeicImage || isSafari(userAgent))) {
|
|
61
102
|
return React__default["default"].createElement(InternalThumbnailImage, { file: file });
|
|
62
103
|
}
|
|
63
104
|
return (React__default["default"].createElement("div", { className: classnames__default["default"](styles$1.content, styles$1[size], {
|
|
@@ -69,7 +110,7 @@ function InternalThumbnail({ compact = false, size, file, }) {
|
|
|
69
110
|
}
|
|
70
111
|
function getIconNameFromType(mimeType) {
|
|
71
112
|
if (mimeType.startsWith("image/"))
|
|
72
|
-
return "
|
|
113
|
+
return "image";
|
|
73
114
|
if (mimeType.startsWith("video/"))
|
|
74
115
|
return "video";
|
|
75
116
|
switch (mimeType) {
|
package/dist/Gallery/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var React = require('react');
|
|
|
6
6
|
var classnames = require('classnames');
|
|
7
7
|
var styleInject_es = require('../style-inject.es-9d2f5f4e.js');
|
|
8
8
|
var LightBox = require('../LightBox-a89d8863.js');
|
|
9
|
-
var FormatFile = require('../FormatFile-
|
|
9
|
+
var FormatFile = require('../FormatFile-cc949eaf.js');
|
|
10
10
|
var Button = require('../Button-b73a5e01.js');
|
|
11
11
|
require('framer-motion');
|
|
12
12
|
require('react-dom');
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function getClientBrowser(userAgent: string): "Mozilla Firefox" | "Samsung Internet" | "Opera" | "Microsoft Edge (Legacy)" | "Microsoft Edge (Chromium)" | "Google Chrome or Chromium" | "Apple Safari" | "unknown";
|
|
2
|
+
export declare function isSafari(userAgent: string): boolean;
|
|
3
|
+
export declare function isChrome(userAgent: string): boolean;
|
|
4
|
+
export declare function isFirefox(userAgent: string): boolean;
|
|
5
|
+
export declare function isEdge(userAgent: string): boolean;
|
|
6
|
+
export declare function isOpera(userAgent: string): boolean;
|
|
7
|
+
export declare function isSamsung(userAgent: string): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "4.71.
|
|
3
|
+
"version": "4.71.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"> 1%",
|
|
84
84
|
"IE 10"
|
|
85
85
|
],
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "668971377e3bb3ddcb5dd30c128f6a6db7ae316d"
|
|
87
87
|
}
|