@elytracms/next 0.0.64 → 0.0.66

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.
@@ -47,6 +47,12 @@ interface HostImageAsset {
47
47
  x: number;
48
48
  y: number;
49
49
  } | null;
50
+ /**
51
+ * LQIP blur-placeholder data URI (EC-420) → next/image blurDataURL. Optional so a
52
+ * consumer mapping a `ResolvedAsset` in stays source-compatible; when present the
53
+ * delivered image blurs up while the optimized bytes load.
54
+ */
55
+ lqip?: string | null;
50
56
  }
51
57
  interface HostImageProps {
52
58
  asset: HostImageAsset;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/host-image.ts"],"names":[],"mappings":";AA8DA,IAAI,SAAA,GAAsC,IAAA;AAGnC,SAAS,aAAa,QAAA,EAA0C;AACrE,EAAA,SAAA,GAAY,QAAA;AACd;AAGO,SAAS,YAAA,GAAyC;AACvD,EAAA,OAAO,SAAA;AACT;AAiBO,IAAM,yBAAA,GAAgF;AAAA,EAC3F,EAAE,QAAA,EAAU,OAAA,EAAS,QAAA,EAAU,gBAAA;AACjC","file":"host-image.js","sourcesContent":["import type { ReactNode } from 'react'\n\n/**\n * `@elytracms/next/host-image` — the host image-delivery seam for DUAL-RENDERED\n * project components (EC-368, from the consumer-proven EC-271 pattern).\n *\n * The `project.*` page-builder components are dual-rendered: the SAME module\n * renders in the Vite studio canvas AND the Next host (AD-2/AD-11), so it may\n * not statically import `next/image` — that would break the Vite build. And in\n * the Next host these components render as Server Components, where React\n * context is unavailable, so an optimized `<Image>` can't be threaded through a\n * provider either.\n *\n * The seam that satisfies both: a tiny module singleton the host sets once at\n * boot. The studio never sets it (it renders the components via the root\n * `elytra.config`, which never imports the Next host), so the canvas keeps a\n * plain-`<img>` fallback; the Next host injects the `ElytraImage`-backed\n * renderer so content images go through `next/image`'s optimizer:\n *\n * ```ts\n * // frontend/lib/host.ts — imported once by the catch-all route at boot\n * import { elytraHostImage } from '@elytracms/next'\n * import { setHostImage } from '@elytracms/next/host-image'\n *\n * setHostImage(elytraHostImage())\n * ```\n *\n * WHEN (and whether) to register stays consumer-owned — legacy-interop windows\n * are real: a host whose global `next/image` config is still owned by a\n * previous stack (e.g. a Sanity-era custom loader) deliberately skips\n * registration until the conflict clears, and its components keep the honest\n * plain-`<img>` fallback.\n *\n * This module is deliberately its OWN subpath entry importing nothing but React\n * types — safe in Vite, in RSC, and in `next.config.*`. The main\n * `@elytracms/next` entry never imports it at runtime (that would bundle a\n * second singleton instance into the server entry, disconnecting\n * `setHostImage` from `getHostImage` — pinned by `package-build.test.ts`).\n */\n\n/** The resolved-asset slice a host image renderer needs (mirrors `ResolvedAsset`). */\nexport interface HostImageAsset {\n url: string\n width: number | null\n height: number | null\n alt: string | null\n focalPoint: { x: number; y: number } | null\n}\n\nexport interface HostImageProps {\n asset: HostImageAsset\n alt: string\n className?: string\n loading?: 'eager' | 'lazy'\n /** Above-the-fold opt-out of lazy-loading (the hero image). */\n priority?: boolean\n /** Responsive `sizes` hint so the optimizer serves a column-sized variant. */\n sizes?: string\n}\n\nexport type HostImageRenderer = (props: HostImageProps) => ReactNode\n\nlet hostImage: HostImageRenderer | null = null\n\n/** Host-only: register the optimized image renderer (called once at host boot). */\nexport function setHostImage(renderer: HostImageRenderer | null): void {\n hostImage = renderer\n}\n\n/** The registered host renderer, or `null` in the studio canvas (plain-`<img>` fallback). */\nexport function getHostImage(): HostImageRenderer | null {\n return hostImage\n}\n\n/**\n * The `next.config.*` `images.remotePatterns` preset for Elytra asset delivery\n * (EC-368 image defaults): Convex file-storage serve URLs, where uploaded\n * assets live in connected mode. Without it `next/image` refuses the remote\n * origin and delivery images 400 — spread it into your config:\n *\n * ```js\n * // next.config.mjs\n * import { convexAssetRemotePatterns } from '@elytracms/next/host-image'\n *\n * const nextConfig = {\n * images: { remotePatterns: [...convexAssetRemotePatterns] },\n * }\n * ```\n */\nexport const convexAssetRemotePatterns: readonly { protocol: 'https'; hostname: string }[] = [\n { protocol: 'https', hostname: '*.convex.cloud' },\n]\n"]}
1
+ {"version":3,"sources":["../src/host-image.ts"],"names":[],"mappings":";AAoEA,IAAI,SAAA,GAAsC,IAAA;AAGnC,SAAS,aAAa,QAAA,EAA0C;AACrE,EAAA,SAAA,GAAY,QAAA;AACd;AAGO,SAAS,YAAA,GAAyC;AACvD,EAAA,OAAO,SAAA;AACT;AAiBO,IAAM,yBAAA,GAAgF;AAAA,EAC3F,EAAE,QAAA,EAAU,OAAA,EAAS,QAAA,EAAU,gBAAA;AACjC","file":"host-image.js","sourcesContent":["import type { ReactNode } from 'react'\n\n/**\n * `@elytracms/next/host-image` — the host image-delivery seam for DUAL-RENDERED\n * project components (EC-368, from the consumer-proven EC-271 pattern).\n *\n * The `project.*` page-builder components are dual-rendered: the SAME module\n * renders in the Vite studio canvas AND the Next host (AD-2/AD-11), so it may\n * not statically import `next/image` — that would break the Vite build. And in\n * the Next host these components render as Server Components, where React\n * context is unavailable, so an optimized `<Image>` can't be threaded through a\n * provider either.\n *\n * The seam that satisfies both: a tiny module singleton the host sets once at\n * boot. The studio never sets it (it renders the components via the root\n * `elytra.config`, which never imports the Next host), so the canvas keeps a\n * plain-`<img>` fallback; the Next host injects the `ElytraImage`-backed\n * renderer so content images go through `next/image`'s optimizer:\n *\n * ```ts\n * // frontend/lib/host.ts — imported once by the catch-all route at boot\n * import { elytraHostImage } from '@elytracms/next'\n * import { setHostImage } from '@elytracms/next/host-image'\n *\n * setHostImage(elytraHostImage())\n * ```\n *\n * WHEN (and whether) to register stays consumer-owned — legacy-interop windows\n * are real: a host whose global `next/image` config is still owned by a\n * previous stack (e.g. a Sanity-era custom loader) deliberately skips\n * registration until the conflict clears, and its components keep the honest\n * plain-`<img>` fallback.\n *\n * This module is deliberately its OWN subpath entry importing nothing but React\n * types — safe in Vite, in RSC, and in `next.config.*`. The main\n * `@elytracms/next` entry never imports it at runtime (that would bundle a\n * second singleton instance into the server entry, disconnecting\n * `setHostImage` from `getHostImage` — pinned by `package-build.test.ts`).\n */\n\n/** The resolved-asset slice a host image renderer needs (mirrors `ResolvedAsset`). */\nexport interface HostImageAsset {\n url: string\n width: number | null\n height: number | null\n alt: string | null\n focalPoint: { x: number; y: number } | null\n /**\n * LQIP blur-placeholder data URI (EC-420) → next/image blurDataURL. Optional so a\n * consumer mapping a `ResolvedAsset` in stays source-compatible; when present the\n * delivered image blurs up while the optimized bytes load.\n */\n lqip?: string | null\n}\n\nexport interface HostImageProps {\n asset: HostImageAsset\n alt: string\n className?: string\n loading?: 'eager' | 'lazy'\n /** Above-the-fold opt-out of lazy-loading (the hero image). */\n priority?: boolean\n /** Responsive `sizes` hint so the optimizer serves a column-sized variant. */\n sizes?: string\n}\n\nexport type HostImageRenderer = (props: HostImageProps) => ReactNode\n\nlet hostImage: HostImageRenderer | null = null\n\n/** Host-only: register the optimized image renderer (called once at host boot). */\nexport function setHostImage(renderer: HostImageRenderer | null): void {\n hostImage = renderer\n}\n\n/** The registered host renderer, or `null` in the studio canvas (plain-`<img>` fallback). */\nexport function getHostImage(): HostImageRenderer | null {\n return hostImage\n}\n\n/**\n * The `next.config.*` `images.remotePatterns` preset for Elytra asset delivery\n * (EC-368 image defaults): Convex file-storage serve URLs, where uploaded\n * assets live in connected mode. Without it `next/image` refuses the remote\n * origin and delivery images 400 — spread it into your config:\n *\n * ```js\n * // next.config.mjs\n * import { convexAssetRemotePatterns } from '@elytracms/next/host-image'\n *\n * const nextConfig = {\n * images: { remotePatterns: [...convexAssetRemotePatterns] },\n * }\n * ```\n */\nexport const convexAssetRemotePatterns: readonly { protocol: 'https'; hostname: string }[] = [\n { protocol: 'https', hostname: '*.convex.cloud' },\n]\n"]}
package/dist/index.d.ts CHANGED
@@ -5,8 +5,8 @@ import { ComponentImplementations, ResolveBinding, RelationTarget } from '@elytr
5
5
  export { ComponentImplementations, RenderAsset } from '@elytracms/core/runtime-renderer';
6
6
  import { ResolvePageResult, ResolvedAsset, Perspective, ContentClient, CacheTags, ContentDocumentSource, ResolvedDocument } from '@elytracms/core/content';
7
7
  export { Perspective } from '@elytracms/core/content';
8
- import { LocaleConfig, Locale, RouteRecord, RedirectRecord, CollectionDef, CmsDocument } from '@elytracms/core/cms-core';
9
- export { CmsDocument, CollectionDef, FieldDef, Locale, LocaleConfig, RedirectRecord, RouteRecord, documentSchema, localeConfigSchema, redirectRecordSchema, routeRecordSchema } from '@elytracms/core/cms-core';
8
+ import { LocaleConfig, Locale, RouteRecord, RedirectRecord, CollectionDef } from '@elytracms/core/cms-core';
9
+ export { CmsDocument, CollectionDef, FieldDef, Locale, LocaleConfig, RedirectRecord, RouteRecord, documentSchema, fallbackHomeRoutes, localeConfigSchema, mergeRouteRecords, redirectRecordSchema, routeRecordSchema } from '@elytracms/core/cms-core';
10
10
  import { ComponentNode } from '@elytracms/core/project-graph';
11
11
  export { ComponentNode } from '@elytracms/core/project-graph';
12
12
  import { AssetRecord, PersistenceAdapter } from '@elytracms/core/persistence';
@@ -359,18 +359,7 @@ interface StaticContentData {
359
359
  */
360
360
  sources?: readonly CanvasDataSource[];
361
361
  }
362
- /**
363
- * Merge stored route records with derived fallback routes (EC-177 gap 2):
364
- * stored records win per pattern+locale; fallback routes only fill patterns
365
- * the stored set does not cover. Never XOR — the first stored route must not
366
- * drop the implicit per-locale home-page fallback (or vice versa).
367
- *
368
- * Coverage rules mirror the router's locale matching (EC-018/019): a stored
369
- * locale-agnostic route (no `locale`) covers its pattern for every locale; a
370
- * locale-specific stored route covers only that locale, so fallbacks for the
371
- * other locales still apply.
372
- */
373
- declare function mergeRouteRecords(stored: readonly RouteRecord[], fallback: readonly RouteRecord[]): RouteRecord[];
362
+
374
363
  /**
375
364
  * Assemble a `ContentSource` from plain prefetched data — the pure half of
376
365
  * {@link createContentSnapshot}, shared with hosts that fetched the data
@@ -931,7 +920,14 @@ declare function createRevalidateRoute(options: RevalidateRouteOptions): Revalid
931
920
  * the resolvable URL, intrinsic dimensions for layout stability, and alt
932
921
  * text. Structurally satisfied by every `ResolvedAsset`.
933
922
  */
934
- type ElytraImageAsset = Pick<ResolvedAsset, 'url' | 'width' | 'height' | 'alt' | 'focalPoint'>;
923
+ type ElytraImageAsset = Pick<ResolvedAsset, 'url' | 'width' | 'height' | 'alt' | 'focalPoint'> & {
924
+ /**
925
+ * LQIP blur-placeholder data URI (EC-420) → `next/image` `blurDataURL`. Optional
926
+ * so existing call sites are unaffected; when present, the optimized image blurs
927
+ * up while loading. `null`/absent = today's behaviour (no placeholder).
928
+ */
929
+ lqip?: string | null;
930
+ };
935
931
  interface ElytraImageProps {
936
932
  /** The resolved asset (delivery shape). `null` renders nothing. */
937
933
  asset: ElytraImageAsset | null | undefined;
@@ -1454,14 +1450,7 @@ interface DeliverySnapshotPayload {
1454
1450
  documents: unknown[];
1455
1451
  assets: unknown[];
1456
1452
  }
1457
- /**
1458
- * Implicit fallback route table (EC-187): `/` → the first `page`-collection
1459
- * document (lowest id), once per configured locale. Merged UNDER the stored
1460
- * records. The delivery snapshot is already perspective-filtered server-side,
1461
- * so in draft mode this correctly previews the draft home even when
1462
- * unpublished.
1463
- */
1464
- declare function fallbackHomeRoutes(documents: readonly CmsDocument[], locales: LocaleConfig): RouteRecord[];
1453
+
1465
1454
  /**
1466
1455
  * Assemble a fetched delivery-snapshot payload into a `ContentSource` — the
1467
1456
  * pure half of {@link loadLiveContent}, exported so the parsing/assembly rules
@@ -1540,4 +1529,4 @@ declare function evaluatePreviewRequest(requestUrl: string | URL, expectedToken:
1540
1529
  */
1541
1530
  declare const PACKAGE = "@elytracms/next";
1542
1531
 
1543
- export { type AssetImageLoaderOptions, type BindingPayloads, type CacheWrapper, type CacheWrapperOptions, type CachedEntry, type CanvasCacheOptions, type CanvasContentRequest, type CanvasDataSource, type CanvasPageOutcome, type CanvasPayloadContext, type CanvasPayloadsFactory, CanvasRenderer, type CanvasRendererProps, type CanvasRequestInfo, type CanvasRoute, type CanvasRouteOptions, type CanvasRouteProps, type CanvasSitemapOptions, type CanvasSitemapResult, type ContentSnapshot, type ContentSnapshotOptions, type ContentSource, type CreateCanvasSitemapOptions, type DefineHostComponentsOptions, ELYTRA_HOST_ENV_KEYS, type ElytraHost, type ElytraHostEnv, type ElytraHostImageOptions, type ElytraHostOptions, ElytraImage, type ElytraImageAsset, type ElytraImageProps, type GlobalsConventions, type HostCanvasRouteOptions, type HostComponent, type HostComponents, type LiveContentOptions, type LoadGlobalsOptions, type MaterializeSourcePayloadsInput, type MaterializedSourcePayloads, type NextImagePrimitiveOptions, PACKAGE, type PreviewEvaluation, type PreviewRouteHandlers, type PreviewRouteOptions, REVALIDATE_SIGNATURE_HEADER, type ResolveCanvasPageOptions, type ResolveGlobalsOptions, type ResolvedLink, type ResolvedNavEntry, type ResolvedNavLink, type RevalidateEvaluation, type RevalidatePayload, type RevalidateRouteHandlers, type RevalidateRouteOptions, type SiteGlobals, type SitemapParamsProvider, type SitemapRouteContext, type SitemapSkippedRoute, type SourcePayloadError, type StaticContentData, assembleLiveSource, canvasPageMetadata, canvasSitemapEntries, collectBindingSourceIds, collectionCacheTag, createAssetImageLoader, createBindingResolver, createCanvasRoute, createCanvasSitemap, createContentSnapshot, createElytraHost, createPreviewDisableRoute, createPreviewRoute, createRevalidateRoute, createStaticContentSource, defaultBindingPayloads, defineHostComponents, docCacheTag, elytraHostImage, evaluatePreviewRequest, evaluateRevalidateRequest, fallbackHomeRoutes, firstBlockFullBleed, isSourcePayloadError, loadCachedEntry, loadLiveContent, materializeSourcePayloads, mergeCacheTags, mergeRouteRecords, nextCacheTags, nextImagePrimitive, pathFromSlug, projectSweepTag, resolveCanvasPage, resolveGlobals, resolveHostEnv, resolvePayloadToken, revalidatePayloadSchema, routeCacheTag, safeRedirectTarget, scopeCacheTag, signRevalidateBody, sourcePayloadError, splitLocalePath };
1532
+ export { type AssetImageLoaderOptions, type BindingPayloads, type CacheWrapper, type CacheWrapperOptions, type CachedEntry, type CanvasCacheOptions, type CanvasContentRequest, type CanvasDataSource, type CanvasPageOutcome, type CanvasPayloadContext, type CanvasPayloadsFactory, CanvasRenderer, type CanvasRendererProps, type CanvasRequestInfo, type CanvasRoute, type CanvasRouteOptions, type CanvasRouteProps, type CanvasSitemapOptions, type CanvasSitemapResult, type ContentSnapshot, type ContentSnapshotOptions, type ContentSource, type CreateCanvasSitemapOptions, type DefineHostComponentsOptions, ELYTRA_HOST_ENV_KEYS, type ElytraHost, type ElytraHostEnv, type ElytraHostImageOptions, type ElytraHostOptions, ElytraImage, type ElytraImageAsset, type ElytraImageProps, type GlobalsConventions, type HostCanvasRouteOptions, type HostComponent, type HostComponents, type LiveContentOptions, type LoadGlobalsOptions, type MaterializeSourcePayloadsInput, type MaterializedSourcePayloads, type NextImagePrimitiveOptions, PACKAGE, type PreviewEvaluation, type PreviewRouteHandlers, type PreviewRouteOptions, REVALIDATE_SIGNATURE_HEADER, type ResolveCanvasPageOptions, type ResolveGlobalsOptions, type ResolvedLink, type ResolvedNavEntry, type ResolvedNavLink, type RevalidateEvaluation, type RevalidatePayload, type RevalidateRouteHandlers, type RevalidateRouteOptions, type SiteGlobals, type SitemapParamsProvider, type SitemapRouteContext, type SitemapSkippedRoute, type SourcePayloadError, type StaticContentData, assembleLiveSource, canvasPageMetadata, canvasSitemapEntries, collectBindingSourceIds, collectionCacheTag, createAssetImageLoader, createBindingResolver, createCanvasRoute, createCanvasSitemap, createContentSnapshot, createElytraHost, createPreviewDisableRoute, createPreviewRoute, createRevalidateRoute, createStaticContentSource, defaultBindingPayloads, defineHostComponents, docCacheTag, elytraHostImage, evaluatePreviewRequest, evaluateRevalidateRequest, firstBlockFullBleed, isSourcePayloadError, loadCachedEntry, loadLiveContent, materializeSourcePayloads, mergeCacheTags, nextCacheTags, nextImagePrimitive, pathFromSlug, projectSweepTag, resolveCanvasPage, resolveGlobals, resolveHostEnv, resolvePayloadToken, revalidatePayloadSchema, routeCacheTag, safeRedirectTarget, scopeCacheTag, signRevalidateBody, sourcePayloadError, splitLocalePath };
package/dist/index.js CHANGED
@@ -4,8 +4,8 @@ import { basePrimitives, getImplementation, renderComposition, ImageManifest, se
4
4
  import { isValidElement } from 'react';
5
5
  import { jsx, Fragment } from 'react/jsx-runtime';
6
6
  import { cacheTags, isSectionSourceId, parseCmsSourceQueryConfig, listQueryOfCmsConfig, isDocumentHistory, resolvedAsset, createContentClient, createContentContext } from '@elytracms/core/content';
7
- import { documentKey, splitPath, hierarchyMount, composePath, documentSchema, redirectRecordSchema } from '@elytracms/core/cms-core';
8
- export { documentSchema, localeConfigSchema, redirectRecordSchema, routeRecordSchema } from '@elytracms/core/cms-core';
7
+ import { documentKey, splitPath, hierarchyMount, composePath, mergeRouteRecords, fallbackHomeRoutes, documentSchema, redirectRecordSchema } from '@elytracms/core/cms-core';
8
+ export { documentSchema, fallbackHomeRoutes, localeConfigSchema, mergeRouteRecords, redirectRecordSchema, routeRecordSchema } from '@elytracms/core/cms-core';
9
9
  import { revalidateTag, unstable_cache } from 'next/cache';
10
10
  import { draftMode } from 'next/headers';
11
11
  import { redirect, notFound, permanentRedirect } from 'next/navigation';
@@ -102,6 +102,8 @@ function assetResolver(assets) {
102
102
  height: asset.height,
103
103
  alt: asset.alt,
104
104
  focalPoint: asset.focalPoint,
105
+ // EC-420: carry the LQIP so a placed base.Image blurs up on delivery.
106
+ lqip: asset.lqip,
105
107
  meta: asset.meta
106
108
  } : null;
107
109
  };
@@ -218,23 +220,6 @@ function materializeSourcePayloads(input) {
218
220
  return { payloads, tags };
219
221
  }
220
222
  var DEFAULT_LOCALES = { default: "en", locales: ["en"] };
221
- function patternKey(pattern) {
222
- return "/" + splitPath(pattern).join("/");
223
- }
224
- function mergeRouteRecords(stored, fallback) {
225
- const agnostic = /* @__PURE__ */ new Set();
226
- const localized = /* @__PURE__ */ new Set();
227
- for (const route of stored) {
228
- if (route.locale === void 0) agnostic.add(patternKey(route.pattern));
229
- else localized.add(`${route.locale}|${patternKey(route.pattern)}`);
230
- }
231
- const covered = (route) => {
232
- const key = patternKey(route.pattern);
233
- if (agnostic.has(key)) return true;
234
- return route.locale !== void 0 && localized.has(`${route.locale}|${key}`);
235
- };
236
- return [...stored, ...fallback.filter((route) => !covered(route))];
237
- }
238
223
  function createStaticContentSource(data) {
239
224
  const locales = data.locales ?? DEFAULT_LOCALES;
240
225
  const routes = data.routes ?? [];
@@ -838,6 +823,7 @@ function ElytraImage(props) {
838
823
  if (!asset || asset.url.length === 0) return null;
839
824
  const alt = asset.alt ?? "";
840
825
  const objectPosition = asset.focalPoint ? `${asset.focalPoint.x * 100}% ${asset.focalPoint.y * 100}%` : void 0;
826
+ const blur = asset.lqip ? { placeholder: "blur", blurDataURL: asset.lqip } : {};
841
827
  if (asset.width === null || asset.height === null) {
842
828
  return /* @__PURE__ */ jsx(
843
829
  "img",
@@ -863,6 +849,7 @@ function ElytraImage(props) {
863
849
  ...quality !== void 0 ? { quality } : {},
864
850
  ...className !== void 0 ? { className } : {},
865
851
  ...loader !== void 0 ? { loader } : {},
852
+ ...blur,
866
853
  ...objectPosition ? { style: { objectPosition } } : {}
867
854
  }
868
855
  );
@@ -878,12 +865,12 @@ function createAssetImageLoader(options = {}) {
878
865
  }
879
866
  function createNextImagePrimitive(options) {
880
867
  return function NextImagePrimitive(props) {
881
- const { url, width, height, alt, focalPoint } = normalizeImageSource(props);
868
+ const { url, width, height, alt, focalPoint, lqip } = normalizeImageSource(props);
882
869
  if (url.length === 0) return null;
883
870
  return /* @__PURE__ */ jsx(
884
871
  ElytraImage,
885
872
  {
886
- asset: { url, width: width ?? null, height: height ?? null, alt, focalPoint },
873
+ asset: { url, width: width ?? null, height: height ?? null, alt, focalPoint, lqip },
887
874
  ...props.priority === true ? { priority: true } : {},
888
875
  ...options.loader !== void 0 ? { loader: options.loader } : {},
889
876
  ...options.sizes !== void 0 ? { sizes: options.sizes } : {},
@@ -985,16 +972,6 @@ function parseSources(rows) {
985
972
  }
986
973
  return sources;
987
974
  }
988
- function fallbackHomeRoutes(documents, locales) {
989
- const homePage = [...documents].filter((doc) => doc.collection === "page").sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0)[0];
990
- if (!homePage) return [];
991
- return locales.locales.map((locale) => ({
992
- id: `r-live-home-${locale}`,
993
- pattern: "/",
994
- locale,
995
- document: { collection: "page", id: homePage.id }
996
- }));
997
- }
998
975
  function assembleLiveSource(payload, options, perspective) {
999
976
  const locales = options.locales;
1000
977
  const documents = parseDocuments(payload.documents);
@@ -1306,6 +1283,6 @@ function createElytraHost(options) {
1306
1283
  }
1307
1284
  var PACKAGE = "@elytracms/next";
1308
1285
 
1309
- export { CanvasRenderer, ELYTRA_HOST_ENV_KEYS, ElytraImage, PACKAGE, REVALIDATE_SIGNATURE_HEADER, assembleLiveSource, canvasPageMetadata, canvasSitemapEntries, collectBindingSourceIds, collectionCacheTag, createAssetImageLoader, createBindingResolver, createCanvasRoute, createCanvasSitemap, createContentSnapshot, createElytraHost, createPreviewDisableRoute, createPreviewRoute, createRevalidateRoute, createStaticContentSource, defaultBindingPayloads, defineHostComponents, docCacheTag, elytraHostImage, evaluatePreviewRequest, evaluateRevalidateRequest, fallbackHomeRoutes, firstBlockFullBleed, isSourcePayloadError, loadCachedEntry, loadLiveContent, materializeSourcePayloads, mergeCacheTags, mergeRouteRecords, nextCacheTags, nextImagePrimitive, pathFromSlug, projectSweepTag, resolveCanvasPage, resolveGlobals, resolveHostEnv, resolvePayloadToken, revalidatePayloadSchema, routeCacheTag, safeRedirectTarget, scopeCacheTag, signRevalidateBody, sourcePayloadError, splitLocalePath };
1286
+ export { CanvasRenderer, ELYTRA_HOST_ENV_KEYS, ElytraImage, PACKAGE, REVALIDATE_SIGNATURE_HEADER, assembleLiveSource, canvasPageMetadata, canvasSitemapEntries, collectBindingSourceIds, collectionCacheTag, createAssetImageLoader, createBindingResolver, createCanvasRoute, createCanvasSitemap, createContentSnapshot, createElytraHost, createPreviewDisableRoute, createPreviewRoute, createRevalidateRoute, createStaticContentSource, defaultBindingPayloads, defineHostComponents, docCacheTag, elytraHostImage, evaluatePreviewRequest, evaluateRevalidateRequest, firstBlockFullBleed, isSourcePayloadError, loadCachedEntry, loadLiveContent, materializeSourcePayloads, mergeCacheTags, nextCacheTags, nextImagePrimitive, pathFromSlug, projectSweepTag, resolveCanvasPage, resolveGlobals, resolveHostEnv, resolvePayloadToken, revalidatePayloadSchema, routeCacheTag, safeRedirectTarget, scopeCacheTag, signRevalidateBody, sourcePayloadError, splitLocalePath };
1310
1287
  //# sourceMappingURL=index.js.map
1311
1288
  //# sourceMappingURL=index.js.map