@uniformdev/canvas-next-rsc 19.147.0 → 19.147.1-alpha.10
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/{UniformComposition-D4tBQ2U4.d.mts → UniformComposition-B-Z17dUt.d.mts} +3 -0
- package/dist/{UniformComposition-D4tBQ2U4.d.ts → UniformComposition-B-Z17dUt.d.ts} +3 -0
- package/dist/component.d.mts +11 -2
- package/dist/component.d.ts +11 -2
- package/dist/component.js +2 -0
- package/dist/component.mjs +1 -0
- package/dist/handler.js +62 -16
- package/dist/handler.mjs +63 -17
- package/dist/index.d.mts +20 -10
- package/dist/index.d.ts +20 -10
- package/dist/index.esm.js +124 -56
- package/dist/index.js +122 -53
- package/dist/index.mjs +124 -56
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { CanvasClient, RouteClient, ResolvedRouteGetResponse, RouteGetParameters } from '@uniformdev/canvas';
|
|
2
|
-
import {
|
|
1
|
+
import { CanvasClient, RouteClient, ResolvedRouteGetResponse, CompositionGetBySlugParameters, RouteGetParameters } from '@uniformdev/canvas';
|
|
2
|
+
import { UniformServerConfig, PageParameters, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
|
|
3
3
|
export { PageParameters, PlaygroundParameters } from '@uniformdev/canvas-next-rsc-shared';
|
|
4
4
|
import { ManifestClient } from '@uniformdev/context/api';
|
|
5
5
|
import { ProjectMapClient, ProjectMapNode } from '@uniformdev/project-map';
|
|
6
6
|
import { ContextState, ContextOptions } from '@uniformdev/context';
|
|
7
7
|
import React__default, { PropsWithChildren } from 'react';
|
|
8
|
-
import { U as UniformCompositionProps } from './UniformComposition-
|
|
9
|
-
export { a as UniformComposition, r as resolveComposition } from './UniformComposition-
|
|
8
|
+
import { U as UniformCompositionProps } from './UniformComposition-B-Z17dUt.js';
|
|
9
|
+
export { a as UniformComposition, r as resolveComposition } from './UniformComposition-B-Z17dUt.js';
|
|
10
10
|
import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
|
|
11
11
|
|
|
12
12
|
type GetCanvasClientOptions = {
|
|
13
|
-
cache:
|
|
13
|
+
cache: NonNullable<UniformServerConfig['canvasCache']>;
|
|
14
14
|
};
|
|
15
15
|
declare const getCanvasClient: (options: GetCanvasClientOptions) => CanvasClient;
|
|
16
16
|
declare const getDefaultCanvasClient: ({ searchParams, }: {
|
|
@@ -18,7 +18,7 @@ declare const getDefaultCanvasClient: ({ searchParams, }: {
|
|
|
18
18
|
}) => CanvasClient;
|
|
19
19
|
|
|
20
20
|
type GetManifestClientOptions = {
|
|
21
|
-
cache:
|
|
21
|
+
cache: NonNullable<UniformServerConfig['manifestCache']>;
|
|
22
22
|
};
|
|
23
23
|
declare const getManifestClient: (options: GetManifestClientOptions) => ManifestClient;
|
|
24
24
|
declare const getDefaultManifestClient: ({ searchParams, }: {
|
|
@@ -183,7 +183,7 @@ declare const getManifest: ({ searchParams }: {
|
|
|
183
183
|
}>;
|
|
184
184
|
|
|
185
185
|
type GetProjectMapClientOptions = {
|
|
186
|
-
cache:
|
|
186
|
+
cache: NonNullable<UniformServerConfig['projectMapCache']>;
|
|
187
187
|
};
|
|
188
188
|
declare const getProjectMapClient: (options: GetProjectMapClientOptions) => ProjectMapClient;
|
|
189
189
|
declare const getDefaultProjectMapClient: ({ searchParams, }: {
|
|
@@ -191,7 +191,7 @@ declare const getDefaultProjectMapClient: ({ searchParams, }: {
|
|
|
191
191
|
}) => ProjectMapClient;
|
|
192
192
|
|
|
193
193
|
type GetRouteClientOptions = {
|
|
194
|
-
cache:
|
|
194
|
+
cache: NonNullable<UniformServerConfig['canvasCache']>;
|
|
195
195
|
};
|
|
196
196
|
declare const getRouteClient: (options: GetRouteClientOptions) => RouteClient;
|
|
197
197
|
declare const getDefaultRouteClient: ({ searchParams }: {
|
|
@@ -243,7 +243,7 @@ declare const isIncontextEditingEnabled: ({ searchParams, }: {
|
|
|
243
243
|
declare const isOnVercelPreviewEnvironment: () => boolean;
|
|
244
244
|
declare const isDevelopmentEnvironment: () => boolean;
|
|
245
245
|
|
|
246
|
-
type
|
|
246
|
+
type RetrieveCommonOptions = {
|
|
247
247
|
/**
|
|
248
248
|
* If true, the manifest will not be prefetched.
|
|
249
249
|
*
|
|
@@ -251,7 +251,17 @@ type RetrieveRouteOptions = PageParameters & {
|
|
|
251
251
|
*/
|
|
252
252
|
skipPrefetch?: boolean;
|
|
253
253
|
};
|
|
254
|
+
type RetrieveRouteOptions = PageParameters & RetrieveCommonOptions;
|
|
255
|
+
type RetrieveSlugOptions = Pick<CompositionGetBySlugParameters, 'slug' | 'locale' | 'releaseId' | 'versionId'> & {
|
|
256
|
+
/**
|
|
257
|
+
* The searchParams object from Next.js router. Used for signal evaluation.
|
|
258
|
+
*/
|
|
259
|
+
searchParams?: {
|
|
260
|
+
[key: string]: string | undefined;
|
|
261
|
+
};
|
|
262
|
+
} & RetrieveCommonOptions;
|
|
254
263
|
type RetrieveRouteFetchOptions = Omit<RouteGetParameters, 'projectId' | 'path' | 'withComponentIDs' | 'withContentSourceMap' | 'state'>;
|
|
264
|
+
declare const retrieveCompositionBySlug: ({ slug, searchParams, skipPrefetch, locale, releaseId, versionId, }: RetrieveSlugOptions) => Promise<ResolvedRouteGetResponse>;
|
|
255
265
|
declare const retrieveRoute: ({ params, searchParams, skipPrefetch }: RetrieveRouteOptions, fetchOptions?: RetrieveRouteFetchOptions) => Promise<ResolvedRouteGetResponse>;
|
|
256
266
|
|
|
257
|
-
export { ContextUpdateTransfer, type ContextUpdateTransferProps, type CreateServerUniformContextProps, type CreateStaticParamsOptions, type GetCanvasClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, UniformCompositionProps, UniformContext, type UniformContextProps, UniformPlayground, type UniformPlaygroundProps, createServerUniformContext, createStaticParams, generateStaticParams, getCanvasClient, getDefaultCanvasClient, getDefaultManifestClient, getDefaultProjectMapClient, getDefaultRouteClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, isDevelopmentEnvironment, isDraftModeEnabled, isIncontextEditingEnabled, isOnVercelPreviewEnvironment, retrieveRoute };
|
|
267
|
+
export { ContextUpdateTransfer, type ContextUpdateTransferProps, type CreateServerUniformContextProps, type CreateStaticParamsOptions, type GetCanvasClientOptions, type GetManifestClientOptions, type GetProjectMapClientOptions, type GetRouteClientOptions, UniformCompositionProps, UniformContext, type UniformContextProps, UniformPlayground, type UniformPlaygroundProps, createServerUniformContext, createStaticParams, generateStaticParams, getCanvasClient, getDefaultCanvasClient, getDefaultManifestClient, getDefaultProjectMapClient, getDefaultRouteClient, getManifest, getManifestClient, getProjectMapClient, getRouteClient, isDevelopmentEnvironment, isDraftModeEnabled, isIncontextEditingEnabled, isOnVercelPreviewEnvironment, retrieveCompositionBySlug, retrieveRoute };
|
package/dist/index.esm.js
CHANGED
|
@@ -174,6 +174,7 @@ var getCanvasClient = (options) => {
|
|
|
174
174
|
apiHost: env.getApiHost(),
|
|
175
175
|
apiKey: env.getApiKey(),
|
|
176
176
|
edgeApiHost: env.getEdgeApiHost(),
|
|
177
|
+
disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
|
|
177
178
|
fetch: (req, init) => {
|
|
178
179
|
let requestedUrl;
|
|
179
180
|
if (typeof req === "string") {
|
|
@@ -205,7 +206,7 @@ var getCanvasClient = (options) => {
|
|
|
205
206
|
cache,
|
|
206
207
|
headers: {
|
|
207
208
|
...init == null ? void 0 : init.headers,
|
|
208
|
-
"x-bypass-cache": "
|
|
209
|
+
"x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
|
|
209
210
|
},
|
|
210
211
|
next: {
|
|
211
212
|
revalidate
|
|
@@ -237,7 +238,7 @@ var getManifestClient = (options) => {
|
|
|
237
238
|
...init,
|
|
238
239
|
headers: {
|
|
239
240
|
...init == null ? void 0 : init.headers,
|
|
240
|
-
"x-bypass-cache": "
|
|
241
|
+
"x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
|
|
241
242
|
},
|
|
242
243
|
cache,
|
|
243
244
|
next: {
|
|
@@ -278,7 +279,7 @@ var getProjectMapClient = (options) => {
|
|
|
278
279
|
...init,
|
|
279
280
|
headers: {
|
|
280
281
|
...init == null ? void 0 : init.headers,
|
|
281
|
-
"x-bypass-cache": "
|
|
282
|
+
"x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
|
|
282
283
|
},
|
|
283
284
|
cache,
|
|
284
285
|
next: {
|
|
@@ -306,6 +307,7 @@ var getRouteClient = (options) => {
|
|
|
306
307
|
projectId: env.getProjectId(),
|
|
307
308
|
apiKey: env.getApiKey(),
|
|
308
309
|
edgeApiHost: env.getEdgeApiHost(),
|
|
310
|
+
disableSWR: typeof options.cache.disableSWR !== "undefined" ? options.cache.disableSWR : true,
|
|
309
311
|
fetch: (req, init) => {
|
|
310
312
|
let requestedUrl;
|
|
311
313
|
if (typeof req === "string") {
|
|
@@ -333,7 +335,7 @@ var getRouteClient = (options) => {
|
|
|
333
335
|
...init,
|
|
334
336
|
headers: {
|
|
335
337
|
...init == null ? void 0 : init.headers,
|
|
336
|
-
"x-bypass-cache": "
|
|
338
|
+
"x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
|
|
337
339
|
},
|
|
338
340
|
cache,
|
|
339
341
|
next: {
|
|
@@ -420,7 +422,7 @@ import {
|
|
|
420
422
|
import { PureContextualEditingComponentWrapper } from "@uniformdev/canvas-react/core";
|
|
421
423
|
import { cookies as cookies2, headers } from "next/headers";
|
|
422
424
|
import { notFound, redirect } from "next/navigation";
|
|
423
|
-
import { createElement as createElement3, Fragment as Fragment3 } from "react";
|
|
425
|
+
import { createElement as createElement3, Fragment as Fragment3, Suspense } from "react";
|
|
424
426
|
|
|
425
427
|
// src/context/createServerUniformContext.ts
|
|
426
428
|
import {
|
|
@@ -458,13 +460,62 @@ import {
|
|
|
458
460
|
} from "@uniformdev/canvas";
|
|
459
461
|
import { getBaseUrl, resolvePath } from "@uniformdev/canvas-next-rsc-shared";
|
|
460
462
|
import { getTargetVariableExpandedUrl } from "@uniformdev/redirect";
|
|
463
|
+
var retrieveCompositionBySlug = async ({
|
|
464
|
+
slug,
|
|
465
|
+
searchParams,
|
|
466
|
+
skipPrefetch,
|
|
467
|
+
locale,
|
|
468
|
+
releaseId,
|
|
469
|
+
versionId
|
|
470
|
+
}) => {
|
|
471
|
+
var _a;
|
|
472
|
+
if (!skipPrefetch) {
|
|
473
|
+
void getManifest({
|
|
474
|
+
searchParams
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
let result;
|
|
478
|
+
const states = determineState({
|
|
479
|
+
searchParams
|
|
480
|
+
});
|
|
481
|
+
for (let i = 0; i < states.length; i++) {
|
|
482
|
+
const state = states[i];
|
|
483
|
+
const canvasClient = getDefaultCanvasClient({
|
|
484
|
+
searchParams
|
|
485
|
+
});
|
|
486
|
+
try {
|
|
487
|
+
const composition = await canvasClient.getCompositionBySlug({
|
|
488
|
+
slug,
|
|
489
|
+
state,
|
|
490
|
+
withComponentIDs: true,
|
|
491
|
+
withContentSourceMap: isOnVercelPreviewEnvironment() && ((_a = getServerConfig().experimental) == null ? void 0 : _a.vercelVisualEditing),
|
|
492
|
+
locale,
|
|
493
|
+
releaseId,
|
|
494
|
+
versionId
|
|
495
|
+
});
|
|
496
|
+
result = {
|
|
497
|
+
type: "composition",
|
|
498
|
+
compositionApiResponse: composition,
|
|
499
|
+
matchedRoute: "slug"
|
|
500
|
+
};
|
|
501
|
+
} catch (e) {
|
|
502
|
+
console.warn(`Failed to retrieve composition by slug: ${slug} with state ${state}`, e);
|
|
503
|
+
}
|
|
504
|
+
if ((result == null ? void 0 : result.type) !== "notFound") {
|
|
505
|
+
break;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return result || {
|
|
509
|
+
type: "notFound"
|
|
510
|
+
};
|
|
511
|
+
};
|
|
461
512
|
var retrieveRoute = async ({ params, searchParams, skipPrefetch }, fetchOptions) => {
|
|
462
513
|
if (!skipPrefetch) {
|
|
463
514
|
void getManifest({
|
|
464
515
|
searchParams
|
|
465
516
|
});
|
|
466
517
|
}
|
|
467
|
-
const {
|
|
518
|
+
const { value } = resolvePath({
|
|
468
519
|
params
|
|
469
520
|
});
|
|
470
521
|
const states = determineState({
|
|
@@ -473,34 +524,15 @@ var retrieveRoute = async ({ params, searchParams, skipPrefetch }, fetchOptions)
|
|
|
473
524
|
let result;
|
|
474
525
|
for (let i = 0; i < states.length; i++) {
|
|
475
526
|
const state = states[i];
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
fetchOptions
|
|
483
|
-
});
|
|
484
|
-
} catch (e) {
|
|
485
|
-
console.warn(`Failed to retrieve route by path: ${value} with state ${state}`, e);
|
|
486
|
-
}
|
|
487
|
-
} else if (type === "slug") {
|
|
488
|
-
const canvasClient = getDefaultCanvasClient({
|
|
489
|
-
searchParams
|
|
527
|
+
try {
|
|
528
|
+
result = await retrieveRouteByPath({
|
|
529
|
+
path: value,
|
|
530
|
+
state,
|
|
531
|
+
searchParams,
|
|
532
|
+
fetchOptions
|
|
490
533
|
});
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
slug: value,
|
|
494
|
-
state
|
|
495
|
-
});
|
|
496
|
-
result = {
|
|
497
|
-
type: "composition",
|
|
498
|
-
compositionApiResponse: composition,
|
|
499
|
-
matchedRoute: "slug"
|
|
500
|
-
};
|
|
501
|
-
} catch (e) {
|
|
502
|
-
console.warn(`Failed to retrieve composition by slug: ${value} with state ${state}`, e);
|
|
503
|
-
}
|
|
534
|
+
} catch (e) {
|
|
535
|
+
console.warn(`Failed to retrieve route by path: ${value} with state ${state}`, e);
|
|
504
536
|
}
|
|
505
537
|
if ((result == null ? void 0 : result.type) !== "notFound") {
|
|
506
538
|
break;
|
|
@@ -585,6 +617,7 @@ var PersonalizeClientWrapper = (props) => {
|
|
|
585
617
|
// src/components/PersonalizeServer.ts
|
|
586
618
|
import { CANVAS_PERSONALIZE_SLOT } from "@uniformdev/canvas";
|
|
587
619
|
import { runPersonalization as runPersonalization2 } from "@uniformdev/canvas-next-rsc-shared";
|
|
620
|
+
import { unstable_noStore as noStore } from "next/cache";
|
|
588
621
|
import { createElement, Fragment } from "react";
|
|
589
622
|
|
|
590
623
|
// src/components/ContextPersonalizationTransfer.tsx
|
|
@@ -596,15 +629,19 @@ var ContextPersonalizationTransfer = ({ event }) => {
|
|
|
596
629
|
|
|
597
630
|
// src/components/PersonalizeServer.ts
|
|
598
631
|
var PersonalizeServer = (props) => {
|
|
599
|
-
var _a;
|
|
632
|
+
var _a, _b;
|
|
633
|
+
if ((_a = getServerConfig().ppr) == null ? void 0 : _a.personalizationSuspense) {
|
|
634
|
+
noStore();
|
|
635
|
+
}
|
|
600
636
|
const { indexes, event } = runPersonalization2(props);
|
|
601
|
-
const slot = (
|
|
637
|
+
const slot = (_b = props.slots) == null ? void 0 : _b[CANVAS_PERSONALIZE_SLOT];
|
|
602
638
|
const components = indexes.map((index) => {
|
|
603
639
|
const component = slot.items[index];
|
|
604
640
|
return component;
|
|
605
641
|
});
|
|
606
642
|
const eventElement = createElement(ContextPersonalizationTransfer, {
|
|
607
|
-
event
|
|
643
|
+
event,
|
|
644
|
+
key: `${props.slotName}-${props.slotIndex}-personalization-transfer`
|
|
608
645
|
});
|
|
609
646
|
return createElement(Fragment, void 0, [...components, eventElement]);
|
|
610
647
|
};
|
|
@@ -614,6 +651,7 @@ import { CANVAS_TEST_SLOT } from "@uniformdev/canvas";
|
|
|
614
651
|
import {
|
|
615
652
|
runTest
|
|
616
653
|
} from "@uniformdev/canvas-next-rsc-shared";
|
|
654
|
+
import { unstable_noStore as noStore2 } from "next/cache";
|
|
617
655
|
import { createElement as createElement2, Fragment as Fragment2 } from "react";
|
|
618
656
|
|
|
619
657
|
// src/components/ContextTestTransfer.tsx
|
|
@@ -624,17 +662,24 @@ var ContextTestTransfer = ({ event }) => {
|
|
|
624
662
|
};
|
|
625
663
|
|
|
626
664
|
// src/components/TestServer.ts
|
|
627
|
-
var TestServer = (props) => {
|
|
628
|
-
var _a, _b, _c, _d;
|
|
665
|
+
var TestServer = async (props) => {
|
|
666
|
+
var _a, _b, _c, _d, _e;
|
|
667
|
+
if ((_a = getServerConfig().ppr) == null ? void 0 : _a.testSuspense) {
|
|
668
|
+
noStore2();
|
|
669
|
+
}
|
|
629
670
|
const { contextInstance, test } = props;
|
|
630
|
-
const isTestDefined = Boolean((
|
|
671
|
+
const isTestDefined = Boolean((_b = contextInstance.manifest.data.project.test) == null ? void 0 : _b[test]);
|
|
631
672
|
if (!isTestDefined && process.env.NODE_ENV !== "production") {
|
|
632
673
|
console.warn(`Test "${test}" is not defined in Uniform manifest.`);
|
|
633
674
|
}
|
|
634
675
|
const { index, event } = runTest(props);
|
|
635
|
-
|
|
676
|
+
if (index === null || event === null) {
|
|
677
|
+
return null;
|
|
678
|
+
}
|
|
679
|
+
const component = typeof index === "number" ? (_e = (_d = (_c = props.slots) == null ? void 0 : _c[CANVAS_TEST_SLOT]) == null ? void 0 : _d.items[index]) != null ? _e : null : null;
|
|
636
680
|
const eventElement = createElement2(ContextTestTransfer, {
|
|
637
|
-
event
|
|
681
|
+
event,
|
|
682
|
+
key: `${props.slotName}-${props.slotIndex}-server-transfer`
|
|
638
683
|
});
|
|
639
684
|
return createElement2(Fragment2, void 0, [component, eventElement]);
|
|
640
685
|
};
|
|
@@ -738,19 +783,24 @@ var isServerComponent = ({
|
|
|
738
783
|
};
|
|
739
784
|
var resolveSystemComponent = ({
|
|
740
785
|
component,
|
|
741
|
-
|
|
786
|
+
server
|
|
742
787
|
}) => {
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
788
|
+
var _a, _b;
|
|
789
|
+
const config = getServerConfig();
|
|
790
|
+
let resolved = null;
|
|
791
|
+
let suspense = void 0;
|
|
747
792
|
if (component.type === CANVAS_PERSONALIZE_TYPE) {
|
|
748
|
-
|
|
793
|
+
resolved = server ? PersonalizeServer : PersonalizeClientWrapper;
|
|
794
|
+
suspense = server && ((_a = config.ppr) == null ? void 0 : _a.personalizationSuspense);
|
|
749
795
|
}
|
|
750
796
|
if (component.type === CANVAS_TEST_TYPE) {
|
|
751
|
-
|
|
797
|
+
resolved = server ? TestServer : TestClient;
|
|
798
|
+
suspense = server && ((_b = config.ppr) == null ? void 0 : _b.testSuspense);
|
|
752
799
|
}
|
|
753
|
-
return
|
|
800
|
+
return {
|
|
801
|
+
component: resolved,
|
|
802
|
+
suspense
|
|
803
|
+
};
|
|
754
804
|
};
|
|
755
805
|
var resolveSlots = ({
|
|
756
806
|
component,
|
|
@@ -827,11 +877,15 @@ var resolveComponents = ({
|
|
|
827
877
|
component,
|
|
828
878
|
serverContext
|
|
829
879
|
});
|
|
830
|
-
const systemComponent = resolveSystemComponent({
|
|
880
|
+
const { component: systemComponent, suspense: systemSuspense } = resolveSystemComponent({
|
|
831
881
|
component,
|
|
832
|
-
|
|
882
|
+
server: isServer
|
|
833
883
|
});
|
|
834
|
-
const {
|
|
884
|
+
const {
|
|
885
|
+
component: regularComponent,
|
|
886
|
+
includeContext,
|
|
887
|
+
suspense: componentSuspense
|
|
888
|
+
} = resolveComponent({ component }) || {
|
|
835
889
|
component: null
|
|
836
890
|
};
|
|
837
891
|
if (!systemComponent && !regularComponent) {
|
|
@@ -846,10 +900,11 @@ var resolveComponents = ({
|
|
|
846
900
|
mode
|
|
847
901
|
});
|
|
848
902
|
const resolvedComponent = systemComponent || regularComponent;
|
|
903
|
+
const wrapInSuspense = systemSuspense || componentSuspense;
|
|
849
904
|
const parameters = (_a = component.parameters) != null ? _a : {};
|
|
850
905
|
const enrichmentTags = (_b = parameters[CANVAS_ENRICHMENT_TAG_PARAM]) == null ? void 0 : _b.value;
|
|
906
|
+
const key = `${slotName}-${componentIndex}-component`;
|
|
851
907
|
const componentProps = {
|
|
852
|
-
key: `${slotName}-${componentIndex}-component`,
|
|
853
908
|
...Object.keys(parameters).reduce((acc, cur) => {
|
|
854
909
|
acc[cur] = parameters[cur].value;
|
|
855
910
|
return acc;
|
|
@@ -861,7 +916,19 @@ var resolveComponents = ({
|
|
|
861
916
|
slotName,
|
|
862
917
|
slotIndex: isRoot ? void 0 : componentIndex
|
|
863
918
|
};
|
|
864
|
-
|
|
919
|
+
let element = null;
|
|
920
|
+
if (wrapInSuspense) {
|
|
921
|
+
element = createElement3(
|
|
922
|
+
Suspense,
|
|
923
|
+
{
|
|
924
|
+
key,
|
|
925
|
+
fallback: typeof wrapInSuspense === "boolean" || typeof (wrapInSuspense == null ? void 0 : wrapInSuspense.fallback) === "undefined" ? void 0 : createElement3(wrapInSuspense.fallback)
|
|
926
|
+
},
|
|
927
|
+
createElement3(resolvedComponent, componentProps)
|
|
928
|
+
);
|
|
929
|
+
} else {
|
|
930
|
+
element = createElement3(resolvedComponent, { ...componentProps, key });
|
|
931
|
+
}
|
|
865
932
|
let tagElement = null;
|
|
866
933
|
if (enrichmentTags == null ? void 0 : enrichmentTags.length) {
|
|
867
934
|
tagElement = createElement3(ContextUpdateTransfer, {
|
|
@@ -935,7 +1002,7 @@ import {
|
|
|
935
1002
|
DefaultUniformClientContext,
|
|
936
1003
|
UniformScript
|
|
937
1004
|
} from "@uniformdev/canvas-next-rsc-client";
|
|
938
|
-
import { Suspense } from "react";
|
|
1005
|
+
import { Suspense as Suspense2 } from "react";
|
|
939
1006
|
import React6 from "react";
|
|
940
1007
|
var UniformContext = async ({
|
|
941
1008
|
clientContextComponent,
|
|
@@ -956,7 +1023,7 @@ var UniformContext = async ({
|
|
|
956
1023
|
disableDevTools,
|
|
957
1024
|
defaultConsent
|
|
958
1025
|
}
|
|
959
|
-
), /* @__PURE__ */ React6.createElement(
|
|
1026
|
+
), /* @__PURE__ */ React6.createElement(Suspense2, { fallback: /* @__PURE__ */ React6.createElement(React6.Fragment, null) }, /* @__PURE__ */ React6.createElement(UniformScript, null)));
|
|
960
1027
|
};
|
|
961
1028
|
|
|
962
1029
|
// src/components/UniformPlayground.tsx
|
|
@@ -1033,5 +1100,6 @@ export {
|
|
|
1033
1100
|
isIncontextEditingEnabled,
|
|
1034
1101
|
isOnVercelPreviewEnvironment,
|
|
1035
1102
|
resolveComposition,
|
|
1103
|
+
retrieveCompositionBySlug,
|
|
1036
1104
|
retrieveRoute
|
|
1037
1105
|
};
|