@treely/strapi-slices 8.2.7 → 8.3.1
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/constants/strapi.d.ts +1 -1
- package/dist/constants/strapi.d.ts.map +1 -1
- package/dist/index.cjs +10 -18
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +10 -18
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
|
@@ -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) => {
|
|
@@ -307,10 +307,8 @@ var SLICES_WITH_PROJECTS = [
|
|
|
307
307
|
|
|
308
308
|
// src/utils/mergeGlobalAndStrapiBlogPostData.ts
|
|
309
309
|
var mergeGlobalAndStrapiBlogPostData = (context, global, post, blog, projects) => {
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
"large"
|
|
313
|
-
) : DEFAULT_SHARE_IMAGE;
|
|
310
|
+
const metaShareImageMedia = post.attributes.metadata?.shareImage?.media ?? global.attributes.metadata.shareImage?.media;
|
|
311
|
+
const metaShareImageUrl = metaShareImageMedia ? strapiMediaUrl_default(metaShareImageMedia, "large") : DEFAULT_SHARE_IMAGE;
|
|
314
312
|
const schemaMarkupTypes = post.attributes.metadata?.schemaMarkupTypes ?? global.attributes.metadata?.schemaMarkupTypes ?? [];
|
|
315
313
|
const returnBlog = post.attributes.slices.some(
|
|
316
314
|
(slice) => SLICES_WITH_BLOG_POSTS.includes(slice.__component)
|
|
@@ -359,10 +357,8 @@ var mergeGlobalAndStrapiBlogPostData_default = mergeGlobalAndStrapiBlogPostData;
|
|
|
359
357
|
|
|
360
358
|
// src/utils/mergeGlobalAndStrapiCustomerStoryData.ts
|
|
361
359
|
var mergeGlobalAndStrapiCustomerStoryData = (context, global, customerStory, customerStories) => {
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
"large"
|
|
365
|
-
) : DEFAULT_SHARE_IMAGE;
|
|
360
|
+
const metaShareImageMedia = customerStory.attributes.metadata?.shareImage?.media ?? global.attributes.metadata.shareImage?.media;
|
|
361
|
+
const metaShareImageUrl = metaShareImageMedia ? strapiMediaUrl_default(metaShareImageMedia, "large") : DEFAULT_SHARE_IMAGE;
|
|
366
362
|
const schemaMarkupTypes = customerStory.attributes.metadata?.schemaMarkupTypes ?? global.attributes.metadata?.schemaMarkupTypes ?? [];
|
|
367
363
|
const returnCustomerStories = customerStory.attributes.slices.some(
|
|
368
364
|
(slice) => SLICES_WITH_CUSTOMER_STORIES.includes(slice.__component)
|
|
@@ -407,10 +403,8 @@ var mergeGlobalAndStrapiCustomerStoryData_default = mergeGlobalAndStrapiCustomer
|
|
|
407
403
|
|
|
408
404
|
// src/utils/mergeGlobalAndStrapiPageData.ts
|
|
409
405
|
var mergeGlobalAndStrapiPageData = (context, global, page, blogPosts, customerStories, projects) => {
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
"large"
|
|
413
|
-
) : DEFAULT_SHARE_IMAGE;
|
|
406
|
+
const metaShareImageMedia = page.attributes.metadata?.shareImage?.media ?? global.attributes.metadata.shareImage?.media;
|
|
407
|
+
const metaShareImageUrl = metaShareImageMedia ? strapiMediaUrl_default(metaShareImageMedia, "large") : DEFAULT_SHARE_IMAGE;
|
|
414
408
|
const schemaMarkupTypes = page.attributes.metadata?.schemaMarkupTypes ?? global.attributes.metadata?.schemaMarkupTypes ?? [];
|
|
415
409
|
const returnBlogPosts = page.attributes.slices.some(
|
|
416
410
|
(slice) => SLICES_WITH_BLOG_POSTS.includes(slice.__component)
|
|
@@ -466,10 +460,8 @@ var mergeGlobalAndStrapiPageData_default = mergeGlobalAndStrapiPageData;
|
|
|
466
460
|
|
|
467
461
|
// src/utils/mergeGlobalAndStrapiProjectData.ts
|
|
468
462
|
var mergeGlobalAndStrapiProject = (context, global, project, blogPosts, projects) => {
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
"large"
|
|
472
|
-
) : DEFAULT_SHARE_IMAGE;
|
|
463
|
+
const metaShareImageMedia = project.attributes.metadata?.shareImage?.media ?? global.attributes.metadata.shareImage?.media;
|
|
464
|
+
const metaShareImageUrl = metaShareImageMedia ? strapiMediaUrl_default(metaShareImageMedia, "large") : DEFAULT_SHARE_IMAGE;
|
|
473
465
|
const schemaMarkupTypes = project.attributes.metadata?.schemaMarkupTypes ?? global.attributes.metadata?.schemaMarkupTypes ?? [];
|
|
474
466
|
const returnBlogPosts = project.attributes.slices.some(
|
|
475
467
|
(slice) => SLICES_WITH_BLOG_POSTS.includes(slice.__component)
|