@decocms/start 0.29.3 → 0.30.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/start",
3
- "version": "0.29.3",
3
+ "version": "0.30.0",
4
4
  "type": "module",
5
5
  "description": "Deco framework for TanStack Start - CMS bridge, admin protocol, hooks, schema generation",
6
6
  "main": "./src/index.ts",
@@ -228,6 +228,33 @@ export const loadDeferredSection = createServerFn({ method: "POST" })
228
228
  return normalizeUrlsInObject(enriched);
229
229
  });
230
230
 
231
+ // ---------------------------------------------------------------------------
232
+ // Pre-wrapped deferred section loader for IntersectionObserver-based rendering
233
+ // ---------------------------------------------------------------------------
234
+
235
+ /**
236
+ * Convenience wrapper around `loadDeferredSection` that matches the
237
+ * `loadDeferredSectionFn` prop signature of `DecoPageRenderer`.
238
+ *
239
+ * Pass this directly to `<DecoPageRenderer loadDeferredSectionFn={deferredSectionLoader} />`
240
+ * to enable IntersectionObserver-based lazy loading of deferred sections.
241
+ */
242
+ export const deferredSectionLoader = async ({
243
+ component,
244
+ rawProps,
245
+ pagePath,
246
+ pageUrl,
247
+ }: {
248
+ component: string;
249
+ rawProps: Record<string, unknown>;
250
+ pagePath: string;
251
+ pageUrl?: string;
252
+ }): Promise<ResolvedSection | null> => {
253
+ return loadDeferredSection({
254
+ data: { component, rawProps, pagePath, pageUrl },
255
+ });
256
+ };
257
+
231
258
  // ---------------------------------------------------------------------------
232
259
  // Default pending component — shown during SPA navigation while loader runs
233
260
  // ---------------------------------------------------------------------------
@@ -8,6 +8,7 @@ export {
8
8
  type CmsRouteOptions,
9
9
  cmsHomeRouteConfig,
10
10
  cmsRouteConfig,
11
+ deferredSectionLoader,
11
12
  loadCmsHomePage,
12
13
  loadCmsPage,
13
14
  loadDeferredSection,