@treely/strapi-slices 8.2.6 → 8.3.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const STRAPI_URI: string;
|
|
2
|
-
export declare const STRAPI_DEFAULT_PAGE_SIZE = "
|
|
2
|
+
export declare const STRAPI_DEFAULT_PAGE_SIZE = "1000";
|
|
3
3
|
export declare const STRAPI_DEFAULT_POPULATE_DEPTH = "6";
|
|
4
4
|
export declare const STRAPI_FALLBACK_LOCALE = "en";
|
|
5
5
|
//# sourceMappingURL=strapi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strapi.d.ts","sourceRoot":"","sources":["../../src/constants/strapi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QACwC,CAAC;AAEhE,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"strapi.d.ts","sourceRoot":"","sources":["../../src/constants/strapi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,QACwC,CAAC;AAEhE,eAAO,MAAM,wBAAwB,SAAS,CAAC;AAC/C,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,eAAO,MAAM,sBAAsB,OAAO,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -54,7 +54,7 @@ var import_axios_cache_interceptor = require("axios-cache-interceptor");
|
|
|
54
54
|
|
|
55
55
|
// src/constants/strapi.ts
|
|
56
56
|
var STRAPI_URI = process.env.NEXT_PUBLIC_STRAPI_URI || "http://127.0.0.1:1337";
|
|
57
|
-
var STRAPI_DEFAULT_PAGE_SIZE = "
|
|
57
|
+
var STRAPI_DEFAULT_PAGE_SIZE = "1000";
|
|
58
58
|
var STRAPI_DEFAULT_POPULATE_DEPTH = "6";
|
|
59
59
|
var STRAPI_FALLBACK_LOCALE = "en";
|
|
60
60
|
|
|
@@ -175,7 +175,7 @@ var getStrapiProjects_default = getStrapiProjects;
|
|
|
175
175
|
var getPortfolioProjects = async (locale = "en", preview = false) => {
|
|
176
176
|
const cache2 = preview ? false : void 0;
|
|
177
177
|
const [{ data: fpmProjects }, strapiProjects] = await Promise.all([
|
|
178
|
-
fpmClient_default.get("/public/projects", { cache: cache2 }),
|
|
178
|
+
fpmClient_default.get("/public/projects?limit=1000", { cache: cache2 }),
|
|
179
179
|
getStrapiProjects_default(locale, STRAPI_DEFAULT_POPULATE_DEPTH, preview)
|
|
180
180
|
]);
|
|
181
181
|
return fpmProjects.map((fpmProject) => {
|
|
@@ -4986,7 +4986,11 @@ var ProjectsMap = ({
|
|
|
4986
4986
|
[fetchProjectsData, isBboxContained]
|
|
4987
4987
|
);
|
|
4988
4988
|
const addProjectsLayer = (0, import_react34.useCallback)(() => {
|
|
4989
|
-
if (!map.current || !featureCollection
|
|
4989
|
+
if (!map.current || !featureCollection) {
|
|
4990
|
+
return;
|
|
4991
|
+
}
|
|
4992
|
+
if (!map.current.isStyleLoaded()) {
|
|
4993
|
+
setTimeout(() => addProjectsLayer(), 100);
|
|
4990
4994
|
return;
|
|
4991
4995
|
}
|
|
4992
4996
|
const filteredFeatureCollection = {
|
|
@@ -5225,7 +5229,7 @@ var ProjectsMap = ({
|
|
|
5225
5229
|
} else {
|
|
5226
5230
|
source.setData(filteredFeatureCollection);
|
|
5227
5231
|
}
|
|
5228
|
-
}, [featureCollection,
|
|
5232
|
+
}, [featureCollection, formatMessage]);
|
|
5229
5233
|
(0, import_react34.useEffect)(() => {
|
|
5230
5234
|
if (map.current || !mapContainer.current) return;
|
|
5231
5235
|
let initialCenter;
|
|
@@ -5314,6 +5318,7 @@ var ProjectsMap = ({
|
|
|
5314
5318
|
});
|
|
5315
5319
|
const buffer = 1;
|
|
5316
5320
|
const bbox = `${userLoc.lon - buffer},${userLoc.lat - buffer},${userLoc.lon + buffer},${userLoc.lat + buffer}`;
|
|
5321
|
+
initialBboxRef.current = bbox;
|
|
5317
5322
|
fetchProjectsData(bbox);
|
|
5318
5323
|
}
|
|
5319
5324
|
},
|
|
@@ -5331,7 +5336,7 @@ var ProjectsMap = ({
|
|
|
5331
5336
|
fetchProjectsData
|
|
5332
5337
|
]);
|
|
5333
5338
|
(0, import_react34.useEffect)(() => {
|
|
5334
|
-
if (isMapReady && featureCollection
|
|
5339
|
+
if (isMapReady && featureCollection) {
|
|
5335
5340
|
addProjectsLayer();
|
|
5336
5341
|
}
|
|
5337
5342
|
}, [isMapReady, featureCollection, addProjectsLayer]);
|