@flozy/editor 9.1.7 → 9.1.9
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.
@@ -1,9 +1,19 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { useTheme, ThemeProvider, createTheme } from "@mui/material";
|
3
3
|
import { isStimulator, STIMULATOR_MOCK } from "../../../hooks/useBreakpoints";
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
+
const isPdf = () => {
|
6
|
+
try {
|
7
|
+
const hash = window.location.hash;
|
8
|
+
const queryString = hash.split("?")[1]; // Get part after "?"
|
9
|
+
const params = new URLSearchParams(queryString);
|
10
|
+
return params.get("isPdf");
|
11
|
+
} catch (err) {
|
12
|
+
console.log(err);
|
13
|
+
}
|
14
|
+
};
|
4
15
|
|
5
16
|
// Custom breakpoints functions
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
7
17
|
const customUp = (key, breakpoints) => {
|
8
18
|
const MOCK_BREAKPOINT = isStimulator();
|
9
19
|
if (key === "xs") {
|
@@ -38,17 +48,25 @@ const customOnly = (key, breakpoints) => {
|
|
38
48
|
}
|
39
49
|
return `@media (min-width: ${breakpoints[key]}px) and (max-width: ${breakpoints[key + 1]}px)`;
|
40
50
|
};
|
41
|
-
|
42
|
-
|
43
|
-
const extendedTheme = prevTheme => createTheme({
|
44
|
-
...prevTheme,
|
45
|
-
breakpoints: {
|
51
|
+
const getBreakPoints = prevTheme => {
|
52
|
+
return {
|
46
53
|
...prevTheme.breakpoints,
|
47
54
|
up: key => customUp(key, prevTheme.breakpoints.values),
|
48
55
|
down: key => customDown(key, prevTheme.breakpoints.values),
|
49
56
|
between: (start, end) => customBetween(start, end, prevTheme.breakpoints.values),
|
50
57
|
only: key => customOnly(key, prevTheme.breakpoints.values)
|
51
|
-
}
|
58
|
+
};
|
59
|
+
};
|
60
|
+
|
61
|
+
// Extend the existing theme with custom breakpoint functions
|
62
|
+
const extendedTheme = prevTheme => createTheme({
|
63
|
+
...prevTheme,
|
64
|
+
breakpoints: isPdf() ? {
|
65
|
+
values: {
|
66
|
+
...prevTheme.breakpoints.values,
|
67
|
+
md: 400 // To resolve, while taking pdf on A4 size, it is getting mobile view because of breakpoint
|
68
|
+
}
|
69
|
+
} : getBreakPoints(prevTheme)
|
52
70
|
});
|
53
71
|
const ViewportStimulator = ({
|
54
72
|
children
|