@uniformdev/canvas-next-rsc 20.50.2-alpha.167 → 20.50.2-alpha.180
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/handler.js +3 -3
- package/dist/handler.mjs +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.js +9 -5
- package/dist/index.js +8 -4
- package/dist/index.mjs +9 -5
- package/package.json +11 -11
package/dist/handler.js
CHANGED
|
@@ -248,7 +248,7 @@ var determineFetchCacheOptions = (mode) => {
|
|
|
248
248
|
|
|
249
249
|
// src/clients/canvasClient.ts
|
|
250
250
|
var getCanvasClient = (options) => {
|
|
251
|
-
return new import_canvas2.
|
|
251
|
+
return new import_canvas2.CanvasClient({
|
|
252
252
|
projectId: env.getProjectId(),
|
|
253
253
|
apiHost: env.getApiHost(),
|
|
254
254
|
apiKey: env.getApiKey(),
|
|
@@ -444,7 +444,7 @@ var getComposition = async ({ compositionId }) => {
|
|
|
444
444
|
}
|
|
445
445
|
});
|
|
446
446
|
try {
|
|
447
|
-
const composition = await canvasClient.
|
|
447
|
+
const composition = await canvasClient.getCompositionById({
|
|
448
448
|
compositionId
|
|
449
449
|
});
|
|
450
450
|
return composition;
|
|
@@ -510,7 +510,7 @@ var processEdgeConfigChange = async ({ source_url }) => {
|
|
|
510
510
|
type: "no-cache"
|
|
511
511
|
}
|
|
512
512
|
});
|
|
513
|
-
const route = await routeClient.
|
|
513
|
+
const route = await routeClient.getRoute({
|
|
514
514
|
path: source_url
|
|
515
515
|
});
|
|
516
516
|
let valueToStore = void 0;
|
package/dist/handler.mjs
CHANGED
|
@@ -155,7 +155,7 @@ import { parseConnectionString } from "@vercel/edge-config";
|
|
|
155
155
|
import { Webhook } from "svix";
|
|
156
156
|
|
|
157
157
|
// src/clients/canvasClient.ts
|
|
158
|
-
import {
|
|
158
|
+
import { CanvasClient } from "@uniformdev/canvas";
|
|
159
159
|
|
|
160
160
|
// src/config/helpers.ts
|
|
161
161
|
import serverConfig from "uniform.server.config";
|
|
@@ -215,7 +215,7 @@ var determineFetchCacheOptions = (mode) => {
|
|
|
215
215
|
|
|
216
216
|
// src/clients/canvasClient.ts
|
|
217
217
|
var getCanvasClient = (options) => {
|
|
218
|
-
return new
|
|
218
|
+
return new CanvasClient({
|
|
219
219
|
projectId: env.getProjectId(),
|
|
220
220
|
apiHost: env.getApiHost(),
|
|
221
221
|
apiKey: env.getApiKey(),
|
|
@@ -411,7 +411,7 @@ var getComposition = async ({ compositionId }) => {
|
|
|
411
411
|
}
|
|
412
412
|
});
|
|
413
413
|
try {
|
|
414
|
-
const composition = await canvasClient.
|
|
414
|
+
const composition = await canvasClient.getCompositionById({
|
|
415
415
|
compositionId
|
|
416
416
|
});
|
|
417
417
|
return composition;
|
|
@@ -477,7 +477,7 @@ var processEdgeConfigChange = async ({ source_url }) => {
|
|
|
477
477
|
type: "no-cache"
|
|
478
478
|
}
|
|
479
479
|
});
|
|
480
|
-
const route = await routeClient.
|
|
480
|
+
const route = await routeClient.getRoute({
|
|
481
481
|
path: source_url
|
|
482
482
|
});
|
|
483
483
|
let valueToStore = void 0;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CanvasClient, RouteClient, CompositionGetBySlugParameters, ResolvedRouteGetResponse, RouteGetParameters } from '@uniformdev/canvas';
|
|
2
2
|
import { UniformServerConfig, CompositionContext, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters, AwaitedPageParameters, PageParameters } 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';
|
|
@@ -12,8 +12,8 @@ import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
|
|
|
12
12
|
type GetCanvasClientOptions = {
|
|
13
13
|
cache: NonNullable<UniformServerConfig['canvasCache']>;
|
|
14
14
|
};
|
|
15
|
-
declare const getCanvasClient: (options: GetCanvasClientOptions) =>
|
|
16
|
-
declare const getDefaultCanvasClient: (options: Pick<CompositionContext, "searchParams">) => Promise<
|
|
15
|
+
declare const getCanvasClient: (options: GetCanvasClientOptions) => CanvasClient;
|
|
16
|
+
declare const getDefaultCanvasClient: (options: Pick<CompositionContext, "searchParams">) => Promise<CanvasClient>;
|
|
17
17
|
|
|
18
18
|
type GetManifestClientOptions = {
|
|
19
19
|
cache: NonNullable<UniformServerConfig['manifestCache']>;
|
|
@@ -248,7 +248,7 @@ type RetrieveSlugOptions = Pick<CompositionGetBySlugParameters, 'slug' | 'locale
|
|
|
248
248
|
[key: string]: string | undefined;
|
|
249
249
|
};
|
|
250
250
|
} & RetrieveCommonOptions;
|
|
251
|
-
type RetrieveRouteFetchOptions = Omit<RouteGetParameters, 'projectId' | 'path' | 'withComponentIDs' | 'state'>;
|
|
251
|
+
type RetrieveRouteFetchOptions = Omit<RouteGetParameters, 'projectId' | 'path' | 'withComponentIDs' | 'withContentSourceMap' | 'state'>;
|
|
252
252
|
declare const retrieveCompositionBySlug: ({ slug, searchParams, skipPrefetch, locale, releaseId, versionId, }: RetrieveSlugOptions) => Promise<ResolvedRouteGetResponse>;
|
|
253
253
|
declare const retrieveRoute: ({ params, searchParams: providedSearchParams, skipPrefetch }: RetrieveRouteOptions, fetchOptions?: RetrieveRouteFetchOptions) => Promise<ResolvedRouteGetResponse>;
|
|
254
254
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CanvasClient, RouteClient, CompositionGetBySlugParameters, ResolvedRouteGetResponse, RouteGetParameters } from '@uniformdev/canvas';
|
|
2
2
|
import { UniformServerConfig, CompositionContext, AppDirectoryContextState, AppDirectoryServerContext, PlaygroundParameters, AwaitedPageParameters, PageParameters } 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';
|
|
@@ -12,8 +12,8 @@ import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
|
|
|
12
12
|
type GetCanvasClientOptions = {
|
|
13
13
|
cache: NonNullable<UniformServerConfig['canvasCache']>;
|
|
14
14
|
};
|
|
15
|
-
declare const getCanvasClient: (options: GetCanvasClientOptions) =>
|
|
16
|
-
declare const getDefaultCanvasClient: (options: Pick<CompositionContext, "searchParams">) => Promise<
|
|
15
|
+
declare const getCanvasClient: (options: GetCanvasClientOptions) => CanvasClient;
|
|
16
|
+
declare const getDefaultCanvasClient: (options: Pick<CompositionContext, "searchParams">) => Promise<CanvasClient>;
|
|
17
17
|
|
|
18
18
|
type GetManifestClientOptions = {
|
|
19
19
|
cache: NonNullable<UniformServerConfig['manifestCache']>;
|
|
@@ -248,7 +248,7 @@ type RetrieveSlugOptions = Pick<CompositionGetBySlugParameters, 'slug' | 'locale
|
|
|
248
248
|
[key: string]: string | undefined;
|
|
249
249
|
};
|
|
250
250
|
} & RetrieveCommonOptions;
|
|
251
|
-
type RetrieveRouteFetchOptions = Omit<RouteGetParameters, 'projectId' | 'path' | 'withComponentIDs' | 'state'>;
|
|
251
|
+
type RetrieveRouteFetchOptions = Omit<RouteGetParameters, 'projectId' | 'path' | 'withComponentIDs' | 'withContentSourceMap' | 'state'>;
|
|
252
252
|
declare const retrieveCompositionBySlug: ({ slug, searchParams, skipPrefetch, locale, releaseId, versionId, }: RetrieveSlugOptions) => Promise<ResolvedRouteGetResponse>;
|
|
253
253
|
declare const retrieveRoute: ({ params, searchParams: providedSearchParams, skipPrefetch }: RetrieveRouteOptions, fetchOptions?: RetrieveRouteFetchOptions) => Promise<ResolvedRouteGetResponse>;
|
|
254
254
|
|
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "server-only";
|
|
3
3
|
|
|
4
4
|
// src/clients/canvasClient.ts
|
|
5
|
-
import {
|
|
5
|
+
import { CanvasClient } from "@uniformdev/canvas";
|
|
6
6
|
|
|
7
7
|
// src/config/helpers.ts
|
|
8
8
|
import serverConfig from "uniform.server.config";
|
|
@@ -185,7 +185,7 @@ var determineFetchCacheOptions = (mode) => {
|
|
|
185
185
|
|
|
186
186
|
// src/clients/canvasClient.ts
|
|
187
187
|
var getCanvasClient = (options) => {
|
|
188
|
-
return new
|
|
188
|
+
return new CanvasClient({
|
|
189
189
|
projectId: env.getProjectId(),
|
|
190
190
|
apiHost: env.getApiHost(),
|
|
191
191
|
apiKey: env.getApiKey(),
|
|
@@ -477,6 +477,7 @@ var retrieveCompositionBySlug = async ({
|
|
|
477
477
|
releaseId,
|
|
478
478
|
versionId
|
|
479
479
|
}) => {
|
|
480
|
+
var _a;
|
|
480
481
|
if (!skipPrefetch) {
|
|
481
482
|
void getManifest({
|
|
482
483
|
searchParams
|
|
@@ -492,10 +493,11 @@ var retrieveCompositionBySlug = async ({
|
|
|
492
493
|
searchParams
|
|
493
494
|
});
|
|
494
495
|
try {
|
|
495
|
-
const composition = await canvasClient.
|
|
496
|
+
const composition = await canvasClient.getCompositionBySlug({
|
|
496
497
|
slug,
|
|
497
498
|
state,
|
|
498
499
|
withComponentIDs: true,
|
|
500
|
+
withContentSourceMap: isOnVercelPreviewEnvironment() && ((_a = getServerConfig().experimental) == null ? void 0 : _a.vercelVisualEditing),
|
|
499
501
|
locale,
|
|
500
502
|
releaseId,
|
|
501
503
|
versionId
|
|
@@ -569,6 +571,7 @@ var retrieveRouteByPath = async ({
|
|
|
569
571
|
fetchOptions,
|
|
570
572
|
releaseId
|
|
571
573
|
}) => {
|
|
574
|
+
var _a;
|
|
572
575
|
const client = await getDefaultRouteClient({
|
|
573
576
|
searchParams
|
|
574
577
|
});
|
|
@@ -585,12 +588,13 @@ var retrieveRouteByPath = async ({
|
|
|
585
588
|
queryPath = `${helper.pathname}${helper.search}`;
|
|
586
589
|
}
|
|
587
590
|
}
|
|
588
|
-
return await client.
|
|
591
|
+
return await client.getRoute({
|
|
589
592
|
...fetchOptions,
|
|
590
593
|
path: queryPath,
|
|
591
594
|
state,
|
|
592
595
|
dataSourceVariant: getDataSourceVariantFromRouteGetParams(fetchOptions != null ? fetchOptions : {}, state),
|
|
593
596
|
withComponentIDs: true,
|
|
597
|
+
withContentSourceMap: isOnVercelPreviewEnvironment() && ((_a = getServerConfig().experimental) == null ? void 0 : _a.vercelVisualEditing),
|
|
594
598
|
releaseId
|
|
595
599
|
});
|
|
596
600
|
};
|
|
@@ -1164,7 +1168,7 @@ var UniformPlayground = async ({ searchParams, ...rest }) => {
|
|
|
1164
1168
|
for (let i = 0; i < possibleStates.length; i++) {
|
|
1165
1169
|
const state = possibleStates[i];
|
|
1166
1170
|
try {
|
|
1167
|
-
composition = await canvasClient.
|
|
1171
|
+
composition = await canvasClient.getCompositionById({
|
|
1168
1172
|
compositionId: id,
|
|
1169
1173
|
state,
|
|
1170
1174
|
withComponentIDs: true
|
package/dist/index.js
CHANGED
|
@@ -238,7 +238,7 @@ var determineFetchCacheOptions = (mode) => {
|
|
|
238
238
|
|
|
239
239
|
// src/clients/canvasClient.ts
|
|
240
240
|
var getCanvasClient = (options) => {
|
|
241
|
-
return new import_canvas2.
|
|
241
|
+
return new import_canvas2.CanvasClient({
|
|
242
242
|
projectId: env.getProjectId(),
|
|
243
243
|
apiHost: env.getApiHost(),
|
|
244
244
|
apiKey: env.getApiKey(),
|
|
@@ -505,6 +505,7 @@ var retrieveCompositionBySlug = async ({
|
|
|
505
505
|
releaseId,
|
|
506
506
|
versionId
|
|
507
507
|
}) => {
|
|
508
|
+
var _a;
|
|
508
509
|
if (!skipPrefetch) {
|
|
509
510
|
void getManifest({
|
|
510
511
|
searchParams
|
|
@@ -520,10 +521,11 @@ var retrieveCompositionBySlug = async ({
|
|
|
520
521
|
searchParams
|
|
521
522
|
});
|
|
522
523
|
try {
|
|
523
|
-
const composition = await canvasClient.
|
|
524
|
+
const composition = await canvasClient.getCompositionBySlug({
|
|
524
525
|
slug,
|
|
525
526
|
state,
|
|
526
527
|
withComponentIDs: true,
|
|
528
|
+
withContentSourceMap: isOnVercelPreviewEnvironment() && ((_a = getServerConfig().experimental) == null ? void 0 : _a.vercelVisualEditing),
|
|
527
529
|
locale,
|
|
528
530
|
releaseId,
|
|
529
531
|
versionId
|
|
@@ -597,6 +599,7 @@ var retrieveRouteByPath = async ({
|
|
|
597
599
|
fetchOptions,
|
|
598
600
|
releaseId
|
|
599
601
|
}) => {
|
|
602
|
+
var _a;
|
|
600
603
|
const client = await getDefaultRouteClient({
|
|
601
604
|
searchParams
|
|
602
605
|
});
|
|
@@ -613,12 +616,13 @@ var retrieveRouteByPath = async ({
|
|
|
613
616
|
queryPath = `${helper.pathname}${helper.search}`;
|
|
614
617
|
}
|
|
615
618
|
}
|
|
616
|
-
return await client.
|
|
619
|
+
return await client.getRoute({
|
|
617
620
|
...fetchOptions,
|
|
618
621
|
path: queryPath,
|
|
619
622
|
state,
|
|
620
623
|
dataSourceVariant: (0, import_canvas4.getDataSourceVariantFromRouteGetParams)(fetchOptions != null ? fetchOptions : {}, state),
|
|
621
624
|
withComponentIDs: true,
|
|
625
|
+
withContentSourceMap: isOnVercelPreviewEnvironment() && ((_a = getServerConfig().experimental) == null ? void 0 : _a.vercelVisualEditing),
|
|
622
626
|
releaseId
|
|
623
627
|
});
|
|
624
628
|
};
|
|
@@ -1184,7 +1188,7 @@ var UniformPlayground = async ({ searchParams, ...rest }) => {
|
|
|
1184
1188
|
for (let i = 0; i < possibleStates.length; i++) {
|
|
1185
1189
|
const state = possibleStates[i];
|
|
1186
1190
|
try {
|
|
1187
|
-
composition = await canvasClient.
|
|
1191
|
+
composition = await canvasClient.getCompositionById({
|
|
1188
1192
|
compositionId: id,
|
|
1189
1193
|
state,
|
|
1190
1194
|
withComponentIDs: true
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "server-only";
|
|
3
3
|
|
|
4
4
|
// src/clients/canvasClient.ts
|
|
5
|
-
import {
|
|
5
|
+
import { CanvasClient } from "@uniformdev/canvas";
|
|
6
6
|
|
|
7
7
|
// src/config/helpers.ts
|
|
8
8
|
import serverConfig from "uniform.server.config";
|
|
@@ -185,7 +185,7 @@ var determineFetchCacheOptions = (mode) => {
|
|
|
185
185
|
|
|
186
186
|
// src/clients/canvasClient.ts
|
|
187
187
|
var getCanvasClient = (options) => {
|
|
188
|
-
return new
|
|
188
|
+
return new CanvasClient({
|
|
189
189
|
projectId: env.getProjectId(),
|
|
190
190
|
apiHost: env.getApiHost(),
|
|
191
191
|
apiKey: env.getApiKey(),
|
|
@@ -477,6 +477,7 @@ var retrieveCompositionBySlug = async ({
|
|
|
477
477
|
releaseId,
|
|
478
478
|
versionId
|
|
479
479
|
}) => {
|
|
480
|
+
var _a;
|
|
480
481
|
if (!skipPrefetch) {
|
|
481
482
|
void getManifest({
|
|
482
483
|
searchParams
|
|
@@ -492,10 +493,11 @@ var retrieveCompositionBySlug = async ({
|
|
|
492
493
|
searchParams
|
|
493
494
|
});
|
|
494
495
|
try {
|
|
495
|
-
const composition = await canvasClient.
|
|
496
|
+
const composition = await canvasClient.getCompositionBySlug({
|
|
496
497
|
slug,
|
|
497
498
|
state,
|
|
498
499
|
withComponentIDs: true,
|
|
500
|
+
withContentSourceMap: isOnVercelPreviewEnvironment() && ((_a = getServerConfig().experimental) == null ? void 0 : _a.vercelVisualEditing),
|
|
499
501
|
locale,
|
|
500
502
|
releaseId,
|
|
501
503
|
versionId
|
|
@@ -569,6 +571,7 @@ var retrieveRouteByPath = async ({
|
|
|
569
571
|
fetchOptions,
|
|
570
572
|
releaseId
|
|
571
573
|
}) => {
|
|
574
|
+
var _a;
|
|
572
575
|
const client = await getDefaultRouteClient({
|
|
573
576
|
searchParams
|
|
574
577
|
});
|
|
@@ -585,12 +588,13 @@ var retrieveRouteByPath = async ({
|
|
|
585
588
|
queryPath = `${helper.pathname}${helper.search}`;
|
|
586
589
|
}
|
|
587
590
|
}
|
|
588
|
-
return await client.
|
|
591
|
+
return await client.getRoute({
|
|
589
592
|
...fetchOptions,
|
|
590
593
|
path: queryPath,
|
|
591
594
|
state,
|
|
592
595
|
dataSourceVariant: getDataSourceVariantFromRouteGetParams(fetchOptions != null ? fetchOptions : {}, state),
|
|
593
596
|
withComponentIDs: true,
|
|
597
|
+
withContentSourceMap: isOnVercelPreviewEnvironment() && ((_a = getServerConfig().experimental) == null ? void 0 : _a.vercelVisualEditing),
|
|
594
598
|
releaseId
|
|
595
599
|
});
|
|
596
600
|
};
|
|
@@ -1164,7 +1168,7 @@ var UniformPlayground = async ({ searchParams, ...rest }) => {
|
|
|
1164
1168
|
for (let i = 0; i < possibleStates.length; i++) {
|
|
1165
1169
|
const state = possibleStates[i];
|
|
1166
1170
|
try {
|
|
1167
|
-
composition = await canvasClient.
|
|
1171
|
+
composition = await canvasClient.getCompositionById({
|
|
1168
1172
|
compositionId: id,
|
|
1169
1173
|
state,
|
|
1170
1174
|
withComponentIDs: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc",
|
|
3
|
-
"version": "20.50.2-alpha.
|
|
3
|
+
"version": "20.50.2-alpha.180+0be2307590",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -60,15 +60,15 @@
|
|
|
60
60
|
"react-dom": "19.2.1"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@uniformdev/canvas": "20.50.2-alpha.
|
|
64
|
-
"@uniformdev/canvas-next-rsc-client": "^20.50.2-alpha.
|
|
65
|
-
"@uniformdev/canvas-next-rsc-shared": "^20.50.2-alpha.
|
|
66
|
-
"@uniformdev/canvas-react": "20.50.2-alpha.
|
|
67
|
-
"@uniformdev/context": "20.50.2-alpha.
|
|
68
|
-
"@uniformdev/project-map": "20.50.2-alpha.
|
|
69
|
-
"@uniformdev/redirect": "20.50.2-alpha.
|
|
70
|
-
"@uniformdev/richtext": "20.50.2-alpha.
|
|
71
|
-
"@uniformdev/webhooks": "20.50.2-alpha.
|
|
63
|
+
"@uniformdev/canvas": "20.50.2-alpha.180+0be2307590",
|
|
64
|
+
"@uniformdev/canvas-next-rsc-client": "^20.50.2-alpha.180+0be2307590",
|
|
65
|
+
"@uniformdev/canvas-next-rsc-shared": "^20.50.2-alpha.180+0be2307590",
|
|
66
|
+
"@uniformdev/canvas-react": "20.50.2-alpha.180+0be2307590",
|
|
67
|
+
"@uniformdev/context": "20.50.2-alpha.180+0be2307590",
|
|
68
|
+
"@uniformdev/project-map": "20.50.2-alpha.180+0be2307590",
|
|
69
|
+
"@uniformdev/redirect": "20.50.2-alpha.180+0be2307590",
|
|
70
|
+
"@uniformdev/richtext": "20.50.2-alpha.180+0be2307590",
|
|
71
|
+
"@uniformdev/webhooks": "20.50.2-alpha.180+0be2307590",
|
|
72
72
|
"@vercel/edge-config": "^1.4.3",
|
|
73
73
|
"encoding": "^0.1.13",
|
|
74
74
|
"server-only": "^0.0.1",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "0be23075901a6fd0acd8166a2bea65fbd5589789"
|
|
89
89
|
}
|