datastake-daf 0.6.294 → 0.6.296
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/components/index.js +49 -479
- package/dist/utils/index.js +9 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Dashboard/Globe/SimpleGlobe.jsx +40 -108
- package/src/@daf/core/components/Dashboard/Globe/SimpleGlobe.stories.js +0 -32
- package/src/@daf/core/components/Dashboard/Steps/Steps.stories.js +76 -2
- package/src/@daf/core/components/Dashboard/Steps/index.jsx +8 -5
- package/src/@daf/core/components/Dashboard/Steps/style.js +7 -0
- package/src/@daf/core/components/EditForm/storyConfig.js +1 -1
- package/src/@daf/core/components/EditForm/storyConfig2.js +12945 -114
- package/src/constants/locales/en/translation.js +3 -0
- package/src/constants/locales/fr/translation.js +3 -0
- package/src/constants/locales/sp/translation.js +3 -0
- package/src/index.js +0 -2
- package/dist/style/datastake/mapbox-gl.css +0 -330
- package/src/@daf/core/components/Dashboard/Globe/CSSInJSGlobe.jsx +0 -415
- package/src/@daf/core/components/Dashboard/Globe/IsolatedGlobe.jsx +0 -345
- package/src/@daf/core/components/Dashboard/Globe/NoConflictGlobe.jsx +0 -488
- package/src/styles/datastake/mapbox-gl.css +0 -330
package/dist/utils/index.js
CHANGED
|
@@ -6273,6 +6273,9 @@ const userHasInterface = (user, app, intf) => {
|
|
|
6273
6273
|
};
|
|
6274
6274
|
|
|
6275
6275
|
const en = {
|
|
6276
|
+
"No planning required": "No planning required",
|
|
6277
|
+
"No evaluation required": "No evaluation required",
|
|
6278
|
+
"No improvement required": "No improvement required",
|
|
6276
6279
|
"Currently unavailable": "Currently unavailable",
|
|
6277
6280
|
Description: "Description",
|
|
6278
6281
|
"missing-inputs": "Missing Inputs",
|
|
@@ -7466,6 +7469,9 @@ const en = {
|
|
|
7466
7469
|
};
|
|
7467
7470
|
|
|
7468
7471
|
const fr = {
|
|
7472
|
+
"No planning required": "Pas de planification requise",
|
|
7473
|
+
"No evaluation required": "Pas d'évaluation requise",
|
|
7474
|
+
"No improvement required": "Pas d'amélioration requise",
|
|
7469
7475
|
"Currently unavailable": "Actuellement indisponible",
|
|
7470
7476
|
"Description": "Description",
|
|
7471
7477
|
"missing-inputs": "Données Manquantes",
|
|
@@ -9299,6 +9305,9 @@ const fr = {
|
|
|
9299
9305
|
};
|
|
9300
9306
|
|
|
9301
9307
|
const sp = {
|
|
9308
|
+
"No planning required": "No se requiere planeación",
|
|
9309
|
+
"No evaluation required": "No se requiere evaluación",
|
|
9310
|
+
"No improvement required": "No se requiere mejora",
|
|
9302
9311
|
"Currently unavailable": "Actualmente no disponible",
|
|
9303
9312
|
"Description": "Descripción",
|
|
9304
9313
|
"missing-inputs": "Datos que Faltan",
|
package/package.json
CHANGED
|
@@ -47,63 +47,16 @@ const SimpleGlobe = ({
|
|
|
47
47
|
// Set Mapbox access token
|
|
48
48
|
mapboxgl.accessToken = 'pk.eyJ1IjoicmVkaXM5OTkiLCJhIjoiY2x4YWV5MzA5MmtuZzJpcXM5Y201Z2E2YiJ9.m5bwPg-Tj4Akesl1yQUa3w';
|
|
49
49
|
|
|
50
|
-
// Create map with custom Straatos style
|
|
50
|
+
// Create map with custom Straatos style
|
|
51
51
|
map.current = new mapboxgl.Map({
|
|
52
52
|
container: mapContainer.current,
|
|
53
53
|
style: 'mapbox://styles/pietragottardo/cm9tt9zfi00d101pg1vdx26si',
|
|
54
54
|
center: [0, 0],
|
|
55
55
|
zoom: mapConfig.maxZoom || 3,
|
|
56
56
|
projection: 'globe',
|
|
57
|
-
// 3D globe settings for proper rendering
|
|
58
|
-
pitch: 0,
|
|
59
|
-
bearing: 0,
|
|
60
|
-
antialias: true,
|
|
61
|
-
fadeDuration: 0,
|
|
62
57
|
attributionControl: false
|
|
63
58
|
});
|
|
64
59
|
|
|
65
|
-
// Configure 3D globe when style loads
|
|
66
|
-
map.current.on('style.load', () => {
|
|
67
|
-
console.log('🎨 [SIMPLE GLOBE] Style loaded, configuring 3D globe...');
|
|
68
|
-
|
|
69
|
-
// Set fog for the space background effect with stars
|
|
70
|
-
try {
|
|
71
|
-
map.current.setFog({
|
|
72
|
-
'color': 'rgb(0, 0, 0)',
|
|
73
|
-
'high-color': 'rgb(0, 0, 0)',
|
|
74
|
-
'horizon-blend': 0.1,
|
|
75
|
-
'space-color': 'rgb(0, 0, 0)',
|
|
76
|
-
'star-intensity': 0.6
|
|
77
|
-
});
|
|
78
|
-
console.log('✨ [SIMPLE GLOBE] Space background with stars set');
|
|
79
|
-
} catch (e) {
|
|
80
|
-
console.log('⚠️ [SIMPLE GLOBE] Could not set fog, trying alternative...');
|
|
81
|
-
// Fallback: try simpler fog configuration
|
|
82
|
-
try {
|
|
83
|
-
map.current.setFog({
|
|
84
|
-
'color': 'rgb(0, 0, 0)',
|
|
85
|
-
'high-color': 'rgb(0, 0, 0)',
|
|
86
|
-
'horizon-blend': 0.1
|
|
87
|
-
});
|
|
88
|
-
console.log('✨ [SIMPLE GLOBE] Alternative space background set');
|
|
89
|
-
} catch (e2) {
|
|
90
|
-
console.log('⚠️ [SIMPLE GLOBE] Could not set any fog configuration');
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Set lighting for better 3D globe visibility
|
|
95
|
-
try {
|
|
96
|
-
map.current.setLight({
|
|
97
|
-
'anchor': 'viewport',
|
|
98
|
-
'color': 'white',
|
|
99
|
-
'intensity': 0.4
|
|
100
|
-
});
|
|
101
|
-
console.log('💡 [SIMPLE GLOBE] Lighting configured for 3D globe');
|
|
102
|
-
} catch (e) {
|
|
103
|
-
console.log('⚠️ [SIMPLE GLOBE] Could not set lighting');
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
|
|
107
60
|
// Add markers when map loads
|
|
108
61
|
map.current.on('load', () => {
|
|
109
62
|
console.log('🗺️ [SIMPLE GLOBE] Map loaded, adding markers...');
|
|
@@ -124,42 +77,52 @@ const SimpleGlobe = ({
|
|
|
124
77
|
.mapboxgl-canvas {
|
|
125
78
|
overflow: hidden !important;
|
|
126
79
|
}
|
|
127
|
-
|
|
128
|
-
/* Namespace Mapbox styles to avoid Leaflet interference */
|
|
129
|
-
.daf-simple-globe-container .mapboxgl-marker {
|
|
130
|
-
position: absolute !important; /* let Mapbox control positioning */
|
|
131
|
-
transform: none !important; /* let Mapbox handle positioning for 3D globe */
|
|
132
|
-
left: auto !important;
|
|
133
|
-
top: auto !important;
|
|
134
|
-
z-index: 1000 !important; /* ensure markers are visible */
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.daf-simple-globe-container .mapboxgl-marker-pane {
|
|
138
|
-
position: absolute !important;
|
|
139
|
-
z-index: 1000 !important;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.daf-simple-globe-container .mapboxgl-canvas {
|
|
143
|
-
position: absolute !important;
|
|
144
|
-
top: 0;
|
|
145
|
-
left: 0;
|
|
146
|
-
}
|
|
147
|
-
|
|
80
|
+
/* CRITICAL: Override Leaflet CSS interference with Mapbox */
|
|
148
81
|
.daf-simple-globe-container .mapboxgl-canvas-container {
|
|
149
82
|
position: relative !important;
|
|
150
83
|
left: auto !important;
|
|
151
84
|
top: auto !important;
|
|
152
85
|
}
|
|
153
|
-
|
|
154
86
|
.daf-simple-globe-container .mapboxgl-canvas-container canvas {
|
|
155
|
-
position:
|
|
156
|
-
|
|
157
|
-
|
|
87
|
+
position: relative !important;
|
|
88
|
+
left: auto !important;
|
|
89
|
+
top: auto !important;
|
|
158
90
|
transform: none !important;
|
|
159
91
|
}
|
|
92
|
+
/* Prevent Leaflet styles from affecting Mapbox markers */
|
|
93
|
+
.daf-simple-globe-container .daf-globe-marker {
|
|
94
|
+
position: relative !important;
|
|
95
|
+
left: auto !important;
|
|
96
|
+
top: auto !important;
|
|
97
|
+
}
|
|
160
98
|
`;
|
|
161
99
|
document.head.appendChild(style);
|
|
162
100
|
|
|
101
|
+
// Set the space background with stars
|
|
102
|
+
try {
|
|
103
|
+
map.current.setFog({
|
|
104
|
+
'color': 'rgb(0, 0, 0)',
|
|
105
|
+
'high-color': 'rgb(0, 0, 0)',
|
|
106
|
+
'horizon-blend': 0.1,
|
|
107
|
+
'space-color': 'rgb(0, 0, 0)',
|
|
108
|
+
'star-intensity': 0.6
|
|
109
|
+
});
|
|
110
|
+
console.log('✨ [SIMPLE GLOBE] Space background with stars set');
|
|
111
|
+
} catch (e) {
|
|
112
|
+
console.log('⚠️ [SIMPLE GLOBE] Could not set fog, trying alternative...');
|
|
113
|
+
// Fallback: try simpler fog configuration
|
|
114
|
+
try {
|
|
115
|
+
map.current.setFog({
|
|
116
|
+
'color': 'rgb(0, 0, 0)',
|
|
117
|
+
'high-color': 'rgb(0, 0, 0)',
|
|
118
|
+
'horizon-blend': 0.1
|
|
119
|
+
});
|
|
120
|
+
console.log('✨ [SIMPLE GLOBE] Alternative space background set');
|
|
121
|
+
} catch (e2) {
|
|
122
|
+
console.log('⚠️ [SIMPLE GLOBE] Could not set any fog configuration');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
163
126
|
// Calculate bounds to fit all markers
|
|
164
127
|
const bounds = new mapboxgl.LngLatBounds();
|
|
165
128
|
let hasValidCoordinates = false;
|
|
@@ -258,32 +221,20 @@ const SimpleGlobe = ({
|
|
|
258
221
|
const lng = Number(project.longitude);
|
|
259
222
|
const lat = Number(project.latitude);
|
|
260
223
|
|
|
261
|
-
console.log(`📍 [SIMPLE GLOBE] Marker ${index} coordinates:`, {
|
|
262
|
-
lng,
|
|
263
|
-
lat,
|
|
264
|
-
project: project.name
|
|
265
|
-
});
|
|
224
|
+
console.log(`📍 [SIMPLE GLOBE] Marker ${index} coordinates:`, { lng, lat });
|
|
266
225
|
|
|
267
226
|
// Validate coordinates
|
|
268
227
|
if (isNaN(lng) || isNaN(lat) || lng < -180 || lng > 180 || lat < -90 || lat > 90) {
|
|
269
|
-
console.error(`❌ [SIMPLE GLOBE] Invalid coordinates for project ${index}:`, {
|
|
270
|
-
lng,
|
|
271
|
-
lat,
|
|
272
|
-
project: project.name
|
|
273
|
-
});
|
|
228
|
+
console.error(`❌ [SIMPLE GLOBE] Invalid coordinates for project ${index}:`, { lng, lat });
|
|
274
229
|
return;
|
|
275
230
|
}
|
|
276
|
-
console.log(`📍 Marker ${index} coordinates:`, { lng, lat });
|
|
277
231
|
|
|
278
232
|
// Add coordinates to bounds
|
|
279
233
|
bounds.extend([lng, lat]);
|
|
280
234
|
hasValidCoordinates = true;
|
|
281
235
|
|
|
282
|
-
//
|
|
283
|
-
const marker = new mapboxgl.Marker(
|
|
284
|
-
element: el,
|
|
285
|
-
anchor: 'center' // Use center anchor for 3D globe positioning
|
|
286
|
-
})
|
|
236
|
+
// Add marker to map with proper coordinate order [lng, lat]
|
|
237
|
+
const marker = new mapboxgl.Marker(el)
|
|
287
238
|
.setLngLat([lng, lat])
|
|
288
239
|
.setPopup(popup)
|
|
289
240
|
.addTo(map.current);
|
|
@@ -293,17 +244,6 @@ const SimpleGlobe = ({
|
|
|
293
244
|
console.log('📍 [SIMPLE GLOBE] Marker clicked:', project);
|
|
294
245
|
onProjectClick(project);
|
|
295
246
|
});
|
|
296
|
-
|
|
297
|
-
// Verify marker position after a short delay (like other Globe components)
|
|
298
|
-
setTimeout(() => {
|
|
299
|
-
const markerLngLat = marker.getLngLat();
|
|
300
|
-
console.log(`🔍 [SIMPLE GLOBE] Marker ${index} position verification:`, {
|
|
301
|
-
expected: [lng, lat],
|
|
302
|
-
actual: [markerLngLat.lng, markerLngLat.lat],
|
|
303
|
-
project: project.name,
|
|
304
|
-
match: Math.abs(markerLngLat.lng - lng) < 0.0001 && Math.abs(markerLngLat.lat - lat) < 0.0001
|
|
305
|
-
});
|
|
306
|
-
}, 100);
|
|
307
247
|
|
|
308
248
|
console.log(`✅ [SIMPLE GLOBE] Marker ${index} added at:`, [lng, lat]);
|
|
309
249
|
});
|
|
@@ -320,14 +260,6 @@ const SimpleGlobe = ({
|
|
|
320
260
|
} else {
|
|
321
261
|
boundsRef.current = null;
|
|
322
262
|
}
|
|
323
|
-
|
|
324
|
-
// Force resize for 3D globe rendering
|
|
325
|
-
setTimeout(() => {
|
|
326
|
-
if (map.current && map.current.resize) {
|
|
327
|
-
map.current.resize();
|
|
328
|
-
console.log('🔄 [SIMPLE GLOBE] Map resized for 3D globe rendering');
|
|
329
|
-
}
|
|
330
|
-
}, 100);
|
|
331
263
|
});
|
|
332
264
|
|
|
333
265
|
return () => {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import SimpleGlobe from "./SimpleGlobe";
|
|
2
2
|
import SimpleGlobeDebug from "./SimpleGlobeDebug";
|
|
3
|
-
import NoConflictGlobe from "./NoConflictGlobe";
|
|
4
|
-
import CSSInJSGlobe from "./CSSInJSGlobe";
|
|
5
3
|
import ThemeLayout from "../../ThemeLayout";
|
|
6
4
|
import Widget from "../Widget";
|
|
7
5
|
|
|
@@ -284,33 +282,3 @@ export const DebugVersion = {
|
|
|
284
282
|
</div>
|
|
285
283
|
)
|
|
286
284
|
};
|
|
287
|
-
|
|
288
|
-
export const NoConflictVersion = {
|
|
289
|
-
name: "No Conflict Version (Aggressive CSS Isolation)",
|
|
290
|
-
render: () => (
|
|
291
|
-
<div style={{ margin: "3em" }}>
|
|
292
|
-
<ThemeLayout>
|
|
293
|
-
<Widget title="No Conflict Globe (Aggressive CSS Isolation)" className="no-px no-pb-body">
|
|
294
|
-
<div style={{ width: '100%', height: '600px' }}>
|
|
295
|
-
<NoConflictGlobe projects={SAMPLE_PROJECTS} type="location" color="#4ECDC4" />
|
|
296
|
-
</div>
|
|
297
|
-
</Widget>
|
|
298
|
-
</ThemeLayout>
|
|
299
|
-
</div>
|
|
300
|
-
)
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
export const CSSInJSVersion = {
|
|
304
|
-
name: "CSS-in-JS Version (No External CSS)",
|
|
305
|
-
render: () => (
|
|
306
|
-
<div style={{ margin: "3em" }}>
|
|
307
|
-
<ThemeLayout>
|
|
308
|
-
<Widget title="CSS-in-JS Globe (No External CSS)" className="no-px no-pb-body">
|
|
309
|
-
<div style={{ width: '100%', height: '600px' }}>
|
|
310
|
-
<CSSInJSGlobe projects={SAMPLE_PROJECTS} type="location" color="#4ECDC4" />
|
|
311
|
-
</div>
|
|
312
|
-
</Widget>
|
|
313
|
-
</ThemeLayout>
|
|
314
|
-
</div>
|
|
315
|
-
)
|
|
316
|
-
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DAFSteps from "./index";
|
|
3
|
+
import DashboardLayout from "../DashboardLayout/index.jsx";
|
|
4
|
+
import KeyIndicators from "../Widget/KeyIndicators/index.jsx";
|
|
5
|
+
import ActionWidget from "../Widget/ActionWidget/index.jsx";
|
|
6
|
+
import Widget from "../Widget/index.jsx";
|
|
7
|
+
import ThemeLayout from "../../ThemeLayout";
|
|
3
8
|
|
|
4
9
|
export default {
|
|
5
10
|
title: "Dashboard/Steps",
|
|
@@ -14,7 +19,7 @@ VerticalSteps.args = {
|
|
|
14
19
|
direction: "vertical",
|
|
15
20
|
current: 1,
|
|
16
21
|
items: [
|
|
17
|
-
{ title: "
|
|
22
|
+
{ title: "Project Created & Project Area Identification", description: "This is the first step" },
|
|
18
23
|
{ title: "Step 2", description: "This is the second step" },
|
|
19
24
|
{ title: "Step 3", description: "This is the third step" },
|
|
20
25
|
{ title: "Step 3", description: "This is the third step" },
|
|
@@ -34,4 +39,73 @@ HorizontalSteps.args = {
|
|
|
34
39
|
{ title: "Step 2", description: "This is the second step" },
|
|
35
40
|
{ title: "Step 3", description: "This is the third step" },
|
|
36
41
|
],
|
|
37
|
-
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const MultipleWidgets = {
|
|
45
|
+
name: "Multiple Widgets in Row",
|
|
46
|
+
decorators: [
|
|
47
|
+
(Story) => (
|
|
48
|
+
<ThemeLayout>
|
|
49
|
+
<DashboardLayout>
|
|
50
|
+
<Story />
|
|
51
|
+
</DashboardLayout>
|
|
52
|
+
</ThemeLayout>
|
|
53
|
+
),
|
|
54
|
+
],
|
|
55
|
+
render: () => {
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<section style={{display: 'flex', flexDirection: 'row', gap: '10px'}}>
|
|
59
|
+
<DAFSteps
|
|
60
|
+
direction="vertical"
|
|
61
|
+
current={1}
|
|
62
|
+
items={[
|
|
63
|
+
{ title: "Project Created & Project Area Identification Project Created & Project Area Identification", description: "This is the first step" },
|
|
64
|
+
{ title: "Data Collection", description: "This is the second step" },
|
|
65
|
+
{ title: "Analysis", description: "This is the third step" },
|
|
66
|
+
{ title: "Reporting", description: "This is the fourth step" },
|
|
67
|
+
]}
|
|
68
|
+
/>
|
|
69
|
+
<Widget title="Actions" className="with-border-header">
|
|
70
|
+
<div style={{padding: '20px', display: 'flex', flexDirection: 'column', gap: '10px'}}>
|
|
71
|
+
<ActionWidget
|
|
72
|
+
icon="Search"
|
|
73
|
+
title="Find Information"
|
|
74
|
+
onClick={() => console.log('Find Information clicked')}
|
|
75
|
+
/>
|
|
76
|
+
<ActionWidget
|
|
77
|
+
icon="Plus"
|
|
78
|
+
title="Add New Project"
|
|
79
|
+
onClick={() => console.log('Add New Project clicked')}
|
|
80
|
+
/>
|
|
81
|
+
<ActionWidget
|
|
82
|
+
icon="FileText"
|
|
83
|
+
title="Generate Report"
|
|
84
|
+
onClick={() => console.log('Generate Report clicked')}
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</Widget>
|
|
88
|
+
<Widget title="Actions" className="with-border-header">
|
|
89
|
+
<div style={{padding: '20px', display: 'flex', flexDirection: 'column', gap: '10px'}}>
|
|
90
|
+
<ActionWidget
|
|
91
|
+
icon="Search"
|
|
92
|
+
title="Find Information"
|
|
93
|
+
onClick={() => console.log('Find Information clicked')}
|
|
94
|
+
/>
|
|
95
|
+
<ActionWidget
|
|
96
|
+
icon="Plus"
|
|
97
|
+
title="Add New Project"
|
|
98
|
+
onClick={() => console.log('Add New Project clicked')}
|
|
99
|
+
/>
|
|
100
|
+
<ActionWidget
|
|
101
|
+
icon="FileText"
|
|
102
|
+
title="Generate Report"
|
|
103
|
+
onClick={() => console.log('Generate Report clicked')}
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</Widget>
|
|
107
|
+
</section>
|
|
108
|
+
</>
|
|
109
|
+
);
|
|
110
|
+
},
|
|
111
|
+
};
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { Steps } from "antd";
|
|
3
3
|
import Widget from "../../Dashboard/Widget/index.jsx";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
+
import { Style } from "./style";
|
|
5
6
|
|
|
6
7
|
const DAFSteps = ({ direction = "vertical", current = 0, items = [], scrollThreshold = 4 }) => {
|
|
7
8
|
const shouldScroll = items.length > scrollThreshold;
|
|
@@ -25,11 +26,13 @@ const DAFSteps = ({ direction = "vertical", current = 0, items = [], scrollThres
|
|
|
25
26
|
return (
|
|
26
27
|
<Widget title="Life Cycle" className="with-border-header">
|
|
27
28
|
<div style={scrollableStyles}>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
<Style>
|
|
30
|
+
<Steps
|
|
31
|
+
direction={direction}
|
|
32
|
+
current={current}
|
|
33
|
+
items={items}
|
|
34
|
+
/>
|
|
35
|
+
</Style>
|
|
33
36
|
</div>
|
|
34
37
|
</Widget>
|
|
35
38
|
);
|