datastake-daf 0.6.408 → 0.6.409

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.
@@ -15,7 +15,6 @@ var dayjs = require('dayjs');
15
15
  require('antd/es/date-picker/locale/en_US');
16
16
  require('antd/es/date-picker/locale/fr_FR');
17
17
  require('react-collapsed');
18
- require('@react-pdf/renderer');
19
18
  require('leaflet-geosearch');
20
19
  var L$2 = require('leaflet');
21
20
  require('deepmerge');
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.408",
3
+ "version": "0.6.409",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
7
7
  "@antv/g2plot": "^2.4.32",
8
8
  "@elfalem/leaflet-curve": "^0.9.2",
9
- "@react-pdf/renderer": "^4.3.1",
10
9
  "@testing-library/jest-dom": "^5.16.5",
11
10
  "@testing-library/react": "^13.4.0",
12
11
  "@testing-library/user-event": "^13.5.0",
@@ -20,7 +19,6 @@
20
19
  "dayjs": "^1.11.12",
21
20
  "deepmerge": "^4.3.1",
22
21
  "dot-object": "^2.1.5",
23
- "html2canvas": "^1.4.1",
24
22
  "leaflet": "^1.0.3",
25
23
  "leaflet-editable": "^1.3.0",
26
24
  "leaflet-geosearch": "^3.1.0",
package/rollup.config.js CHANGED
@@ -40,13 +40,6 @@ const external = [
40
40
  "@xyflow/react",
41
41
  "zustand/shallow",
42
42
  "@elfalem/leaflet-curve",
43
- // PDF rendering related packages (externalize to avoid bundling CJS/UMD issues)
44
- "@react-pdf/renderer",
45
- "@react-pdf/textkit",
46
- "hyphen",
47
- "hyphen/patterns/en-us.js",
48
- "unicode-properties",
49
- "bidi-js",
50
43
  ];
51
44
 
52
45
  // Four builds, components, utils, hooks, context
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { useCallback, useEffect, useRef, useState } from "react";
4
4
  import { formatClassname } from "../../../../../helpers/ClassesHelper";
5
5
 
6
- const PAGE_HEIGHT = 1587;
6
+ const PAGE_HEIGHT = 3508;
7
7
  // margin-top: 20, bottom: 20;
8
8
  const FOOTER_HEIGHT = 70;
9
9
  const HEADER_HEIGHT = 100;
@@ -1,6 +1,6 @@
1
1
  import Widget from "../index.jsx";
2
2
  import { Empty, Image } from "antd";
3
- import { View, Image as PdfImage, Text as PdfText, StyleSheet as PdfStyleSheet } from "@react-pdf/renderer";
3
+
4
4
  export default function ImageWidget({
5
5
  loading = false,
6
6
  title,
@@ -12,68 +12,8 @@ export default function ImageWidget({
12
12
  ...props
13
13
  }) {
14
14
  const expandable = isPdf ? false : props.expandable
15
-
16
- if (isPdf) {
17
- const pdfStyles = PdfStyleSheet.create({
18
- row: {
19
- flexDirection: 'row',
20
- gap: 12,
21
- },
22
- image: {
23
- height: 100,
24
- width: 100,
25
- borderRadius: 6,
26
- objectFit: 'cover',
27
- },
28
- desc: {
29
- fontSize: 12,
30
- color: '#111827',
31
- },
32
- noDesc: {
33
- flexGrow: 1,
34
- fontSize: 12,
35
- color: '#9CA3AF',
36
- },
37
- noImageBox: {
38
- height: 100,
39
- width: 100,
40
- borderColor: '#E5E7EB',
41
- borderWidth: 1,
42
- borderRadius: 6,
43
- backgroundColor: '#FCFCFD',
44
- alignItems: 'center',
45
- justifyContent: 'center',
46
- },
47
- noImageText: {
48
- fontSize: 10,
49
- color: '#9CA3AF',
50
- }
51
- });
52
-
53
- return (
54
- <View>
55
- <Widget loading={loading} title={title} isPdf={isPdf}>
56
- <View style={pdfStyles.row}>
57
- {image ? (
58
- <PdfImage src={image} style={pdfStyles.image} />
59
- ) : (
60
- <View style={pdfStyles.noImageBox}>
61
- <PdfText style={pdfStyles.noImageText}>{imgAlt || "No image"}</PdfText>
62
- </View>
63
- )}
64
- {description ? (
65
- <PdfText style={pdfStyles.desc}>{description}</PdfText>
66
- ) : (
67
- <PdfText style={pdfStyles.noDesc}>{noDescriptionText || "No description provided"}</PdfText>
68
- )}
69
- </View>
70
- </Widget>
71
- </View>
72
- )
73
- }
74
-
75
15
  return (
76
- <Widget loading={loading} title={title} className="with-border-header" isPdf={isPdf} expandable={expandable} {...props}>
16
+ <Widget loading={loading} title={title} className="with-border-header" expandable={expandable} {...props}>
77
17
  <div className="flex gap-4">
78
18
  {image ? (
79
19
  <Image
@@ -15,7 +15,6 @@ import SelectFilters from "../../Filters/selectFilters/index.jsx";
15
15
  import { formatClassname } from "../../../../../helpers/ClassesHelper";
16
16
  import TabsHeader from "../../Header/TabsHeader/index.jsx";
17
17
  import { useCollapse } from "react-collapsed";
18
- import { View, StyleSheet, Text } from "@react-pdf/renderer";
19
18
 
20
19
  const { Paragraph } = Typography
21
20
 
@@ -40,55 +39,7 @@ export default function Widget({
40
39
  defaultCollapsed = false,
41
40
  onExpandChange,
42
41
  description,
43
- isPdf = false,
44
42
  }) {
45
- // IMPORTANT: Early-return for PDF before any hooks run to avoid DOM hooks in @react-pdf
46
- if (isPdf) {
47
- const styles = StyleSheet.create({
48
- container: {
49
- backgroundColor: '#FFFFFF',
50
- borderColor: '#E5E7EB',
51
- borderWidth: 1,
52
- borderRadius: 6,
53
- marginHorizontal: 24,
54
- marginVertical: 8,
55
- overflow: 'hidden',
56
- },
57
- header: {
58
- paddingHorizontal: 24,
59
- paddingVertical: 16,
60
- borderBottomColor: '#F3F4F6',
61
- borderBottomWidth: 1,
62
- },
63
- title: {
64
- fontSize: 16,
65
- fontWeight: 600,
66
- color: '#111827',
67
- marginBottom: 0,
68
- },
69
- description: {
70
- fontSize: 12,
71
- marginTop: 6,
72
- marginBottom: 0,
73
- color: '#4B5563',
74
- },
75
- body: {
76
- paddingHorizontal: 24,
77
- paddingVertical: 16,
78
- },
79
- });
80
-
81
- return (
82
- <View style={styles.container}>
83
- <View style={styles.header}>
84
- <Text style={styles.title}>{title}</Text>
85
- {description && <Text style={styles.description}>{description}</Text>}
86
- </View>
87
- {children ? <View style={styles.body}>{children}</View> : null}
88
- </View>
89
- )
90
- }
91
-
92
43
  const [showFilters, setShowFilters] = useState(false);
93
44
  const [isCollapsed, setIsCollapsed] = useState(defaultCollapsed);
94
45
  const { getCollapseProps, getToggleProps, isExpanded, setExpanded } = useCollapse();
@@ -235,8 +235,6 @@ export function AjaxSelectMain({
235
235
  setIsFetching(true);
236
236
  setLastFilters(filterValues);
237
237
 
238
- console.log({filterValues, preSelected, filters})
239
-
240
238
  axios
241
239
  .post(
242
240
  endpoint,