@uniformdev/canvas-next-rsc 20.49.1 → 20.49.3-alpha.47
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-CfpHU4f0.d.mts → UniformComposition-6i7qTLo3.d.mts} +2 -2
- package/dist/{UniformComposition-CfpHU4f0.d.ts → UniformComposition-6i7qTLo3.d.ts} +2 -2
- package/dist/component.d.mts +1 -1
- package/dist/component.d.ts +1 -1
- package/dist/component.js +1 -1
- package/dist/component.mjs +2 -2
- package/dist/handler.js +18 -5
- package/dist/handler.mjs +18 -5
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/package.json +21 -20
- package/dist/UniformComposition-D_HC6rSo.d.mts +0 -81
- package/dist/UniformComposition-D_HC6rSo.d.ts +0 -81
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PageParameters,
|
|
1
|
+
import { ComponentInstance, ResolvedRouteGetResponse } from '@uniformdev/canvas';
|
|
2
|
+
import { ComponentProps, PageParameters, AppDirectoryServerContext, CompositionContext } from '@uniformdev/canvas-next-rsc-shared';
|
|
3
3
|
import React, { ComponentType } from 'react';
|
|
4
4
|
|
|
5
5
|
type UniformStaticCompositionProps = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PageParameters,
|
|
1
|
+
import { ComponentInstance, ResolvedRouteGetResponse } from '@uniformdev/canvas';
|
|
2
|
+
import { ComponentProps, PageParameters, AppDirectoryServerContext, CompositionContext } from '@uniformdev/canvas-next-rsc-shared';
|
|
3
3
|
import React, { ComponentType } from 'react';
|
|
4
4
|
|
|
5
5
|
type UniformStaticCompositionProps = {
|
package/dist/component.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, CompositionContext, SlotDefinition } from '@uniformdev/canvas-next-rsc-shared';
|
|
2
2
|
export { ComponentProps, CompositionContext } from '@uniformdev/canvas-next-rsc-shared';
|
|
3
3
|
import React, { PropsWithChildren, ReactNode, Key } from 'react';
|
|
4
|
-
export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-
|
|
4
|
+
export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-6i7qTLo3.mjs';
|
|
5
5
|
import { ComponentInstance } from '@uniformdev/canvas';
|
|
6
6
|
import { RichTextNode } from '@uniformdev/richtext';
|
|
7
7
|
import { PureUniformTextProps } from '@uniformdev/canvas-react/core';
|
package/dist/component.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, CompositionContext, SlotDefinition } from '@uniformdev/canvas-next-rsc-shared';
|
|
2
2
|
export { ComponentProps, CompositionContext } from '@uniformdev/canvas-next-rsc-shared';
|
|
3
3
|
import React, { PropsWithChildren, ReactNode, Key } from 'react';
|
|
4
|
-
export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-
|
|
4
|
+
export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-6i7qTLo3.js';
|
|
5
5
|
import { ComponentInstance } from '@uniformdev/canvas';
|
|
6
6
|
import { RichTextNode } from '@uniformdev/richtext';
|
|
7
7
|
import { PureUniformTextProps } from '@uniformdev/canvas-react/core';
|
package/dist/component.js
CHANGED
|
@@ -165,7 +165,7 @@ var import_richtext = require("@uniformdev/richtext");
|
|
|
165
165
|
var import_react5 = __toESM(require("react"));
|
|
166
166
|
var LinkRichTextNode = ({ children, node }) => {
|
|
167
167
|
const { link } = node;
|
|
168
|
-
return /* @__PURE__ */ import_react5.default.createElement("a", {
|
|
168
|
+
return /* @__PURE__ */ import_react5.default.createElement("a", { ...(0, import_richtext.linkParamValueToAnchorProps)(link) }, children);
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
// src/components/nodes/ListItemRichTextNode.tsx
|
package/dist/component.mjs
CHANGED
|
@@ -122,11 +122,11 @@ var LinebreakRichTextNode = () => {
|
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
// src/components/nodes/LinkRichTextNode.tsx
|
|
125
|
-
import {
|
|
125
|
+
import { linkParamValueToAnchorProps } from "@uniformdev/richtext";
|
|
126
126
|
import React5 from "react";
|
|
127
127
|
var LinkRichTextNode = ({ children, node }) => {
|
|
128
128
|
const { link } = node;
|
|
129
|
-
return /* @__PURE__ */ React5.createElement("a", {
|
|
129
|
+
return /* @__PURE__ */ React5.createElement("a", { ...linkParamValueToAnchorProps(link) }, children);
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
// src/components/nodes/ListItemRichTextNode.tsx
|
package/dist/handler.js
CHANGED
|
@@ -127,8 +127,17 @@ var createPreviewGETRouteHandler = (options) => {
|
|
|
127
127
|
};
|
|
128
128
|
};
|
|
129
129
|
function validateLocalRedirectUrl(pathToRedirectTo) {
|
|
130
|
-
if (pathToRedirectTo
|
|
131
|
-
|
|
130
|
+
if (!pathToRedirectTo) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
let resolved;
|
|
134
|
+
try {
|
|
135
|
+
resolved = new URL(pathToRedirectTo, BASE_URL_EXAMPLE);
|
|
136
|
+
} catch (e) {
|
|
137
|
+
throw new Error("Invalid redirect path. Disallowing open redirect.");
|
|
138
|
+
}
|
|
139
|
+
if (resolved.origin !== BASE_URL_EXAMPLE) {
|
|
140
|
+
throw new Error("Tried to redirect off-origin. Disallowing open redirect.");
|
|
132
141
|
}
|
|
133
142
|
}
|
|
134
143
|
var resolveFullPathDefault = ({ slug, path }) => {
|
|
@@ -389,6 +398,7 @@ var isSvixMessage = async (request) => {
|
|
|
389
398
|
};
|
|
390
399
|
};
|
|
391
400
|
var processCompositionChange = async (compositionId) => {
|
|
401
|
+
var _a;
|
|
392
402
|
const projectMapClient = getProjectMapClient({
|
|
393
403
|
cache: {
|
|
394
404
|
type: "no-cache"
|
|
@@ -405,12 +415,15 @@ var processCompositionChange = async (compositionId) => {
|
|
|
405
415
|
if (composition == null ? void 0 : composition.pattern) {
|
|
406
416
|
tags.push("route");
|
|
407
417
|
}
|
|
418
|
+
const config = getServerConfig();
|
|
408
419
|
if (nodes) {
|
|
409
420
|
for (let i = 0; i < nodes.length; i++) {
|
|
410
421
|
const node = nodes[i];
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
422
|
+
if ((_a = config.experimental) == null ? void 0 : _a.edgeCompositions) {
|
|
423
|
+
await processEdgeConfigChange({
|
|
424
|
+
source_url: node.path
|
|
425
|
+
});
|
|
426
|
+
}
|
|
414
427
|
const result = buildProjectMapNodePaths(node.path);
|
|
415
428
|
tags.push(...result.tags);
|
|
416
429
|
if (result.paths) {
|
package/dist/handler.mjs
CHANGED
|
@@ -94,8 +94,17 @@ var createPreviewGETRouteHandler = (options) => {
|
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
function validateLocalRedirectUrl(pathToRedirectTo) {
|
|
97
|
-
if (pathToRedirectTo
|
|
98
|
-
|
|
97
|
+
if (!pathToRedirectTo) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
let resolved;
|
|
101
|
+
try {
|
|
102
|
+
resolved = new URL(pathToRedirectTo, BASE_URL_EXAMPLE);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
throw new Error("Invalid redirect path. Disallowing open redirect.");
|
|
105
|
+
}
|
|
106
|
+
if (resolved.origin !== BASE_URL_EXAMPLE) {
|
|
107
|
+
throw new Error("Tried to redirect off-origin. Disallowing open redirect.");
|
|
99
108
|
}
|
|
100
109
|
}
|
|
101
110
|
var resolveFullPathDefault = ({ slug, path }) => {
|
|
@@ -356,6 +365,7 @@ var isSvixMessage = async (request) => {
|
|
|
356
365
|
};
|
|
357
366
|
};
|
|
358
367
|
var processCompositionChange = async (compositionId) => {
|
|
368
|
+
var _a;
|
|
359
369
|
const projectMapClient = getProjectMapClient({
|
|
360
370
|
cache: {
|
|
361
371
|
type: "no-cache"
|
|
@@ -372,12 +382,15 @@ var processCompositionChange = async (compositionId) => {
|
|
|
372
382
|
if (composition == null ? void 0 : composition.pattern) {
|
|
373
383
|
tags.push("route");
|
|
374
384
|
}
|
|
385
|
+
const config = getServerConfig();
|
|
375
386
|
if (nodes) {
|
|
376
387
|
for (let i = 0; i < nodes.length; i++) {
|
|
377
388
|
const node = nodes[i];
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
389
|
+
if ((_a = config.experimental) == null ? void 0 : _a.edgeCompositions) {
|
|
390
|
+
await processEdgeConfigChange({
|
|
391
|
+
source_url: node.path
|
|
392
|
+
});
|
|
393
|
+
}
|
|
381
394
|
const result = buildProjectMapNodePaths(node.path);
|
|
382
395
|
tags.push(...result.tags);
|
|
383
396
|
if (result.paths) {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CanvasClient, RouteClient,
|
|
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';
|
|
5
5
|
import { ProjectMapClient, ProjectMapNode } from '@uniformdev/project-map';
|
|
6
6
|
import { ContextState, ContextOptions } from '@uniformdev/context';
|
|
7
7
|
import React, { PropsWithChildren } from 'react';
|
|
8
|
-
import { U as UniformCompositionProps } from './UniformComposition-
|
|
9
|
-
export { b as UniformComposition, r as resolveComposition } from './UniformComposition-
|
|
8
|
+
import { U as UniformCompositionProps } from './UniformComposition-6i7qTLo3.mjs';
|
|
9
|
+
export { b as UniformComposition, r as resolveComposition } from './UniformComposition-6i7qTLo3.mjs';
|
|
10
10
|
import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
|
|
11
11
|
|
|
12
12
|
type GetCanvasClientOptions = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CanvasClient, RouteClient,
|
|
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';
|
|
5
5
|
import { ProjectMapClient, ProjectMapNode } from '@uniformdev/project-map';
|
|
6
6
|
import { ContextState, ContextOptions } from '@uniformdev/context';
|
|
7
7
|
import React, { PropsWithChildren } from 'react';
|
|
8
|
-
import { U as UniformCompositionProps } from './UniformComposition-
|
|
9
|
-
export { b as UniformComposition, r as resolveComposition } from './UniformComposition-
|
|
8
|
+
import { U as UniformCompositionProps } from './UniformComposition-6i7qTLo3.js';
|
|
9
|
+
export { b as UniformComposition, r as resolveComposition } from './UniformComposition-6i7qTLo3.js';
|
|
10
10
|
import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
|
|
11
11
|
|
|
12
12
|
type GetCanvasClientOptions = {
|
package/dist/index.js
CHANGED
|
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
ContextUpdateTransfer: () => ContextUpdateTransfer,
|
|
34
34
|
UniformComposition: () => UniformComposition,
|
|
35
35
|
UniformContext: () => UniformContext,
|
|
@@ -54,7 +54,7 @@ __export(src_exports, {
|
|
|
54
54
|
retrieveCompositionBySlug: () => retrieveCompositionBySlug,
|
|
55
55
|
retrieveRoute: () => retrieveRoute
|
|
56
56
|
});
|
|
57
|
-
module.exports = __toCommonJS(
|
|
57
|
+
module.exports = __toCommonJS(index_exports);
|
|
58
58
|
var import_server_only = require("server-only");
|
|
59
59
|
|
|
60
60
|
// src/clients/canvasClient.ts
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc",
|
|
3
|
-
"version": "20.49.
|
|
3
|
+
"version": "20.49.3-alpha.47+9aed70a64d",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
7
7
|
"dev": "tsup --watch",
|
|
8
|
-
"
|
|
9
|
-
"test": "
|
|
10
|
-
"
|
|
8
|
+
"clean": "rimraf dist",
|
|
9
|
+
"test": "vitest run",
|
|
10
|
+
"format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
|
|
11
|
+
"apidocs-extract": "api-extractor run --local"
|
|
11
12
|
},
|
|
12
13
|
"sideEffects": false,
|
|
13
14
|
"main": "dist/index.js",
|
|
@@ -54,37 +55,37 @@
|
|
|
54
55
|
"/dist"
|
|
55
56
|
],
|
|
56
57
|
"devDependencies": {
|
|
57
|
-
"@types/node": "
|
|
58
|
-
"@types/react": "19.2.
|
|
59
|
-
"next": "15.
|
|
58
|
+
"@types/node": "26.0.0",
|
|
59
|
+
"@types/react": "19.2.17",
|
|
60
|
+
"next": "15.5.19",
|
|
60
61
|
"react": "19.2.1",
|
|
61
62
|
"react-dom": "19.2.1"
|
|
62
63
|
},
|
|
63
64
|
"dependencies": {
|
|
64
|
-
"@uniformdev/canvas": "20.49.
|
|
65
|
-
"@uniformdev/canvas-next-rsc-client": "^20.49.
|
|
66
|
-
"@uniformdev/canvas-next-rsc-shared": "^20.49.
|
|
67
|
-
"@uniformdev/canvas-react": "20.49.
|
|
68
|
-
"@uniformdev/context": "20.49.
|
|
69
|
-
"@uniformdev/project-map": "20.49.
|
|
70
|
-
"@uniformdev/redirect": "20.49.
|
|
71
|
-
"@uniformdev/richtext": "20.49.
|
|
72
|
-
"@uniformdev/webhooks": "20.49.
|
|
73
|
-
"@vercel/edge-config": "^
|
|
65
|
+
"@uniformdev/canvas": "20.49.3-alpha.47+9aed70a64d",
|
|
66
|
+
"@uniformdev/canvas-next-rsc-client": "^20.49.3-alpha.47+9aed70a64d",
|
|
67
|
+
"@uniformdev/canvas-next-rsc-shared": "^20.49.3-alpha.47+9aed70a64d",
|
|
68
|
+
"@uniformdev/canvas-react": "20.49.3-alpha.47+9aed70a64d",
|
|
69
|
+
"@uniformdev/context": "20.49.3-alpha.47+9aed70a64d",
|
|
70
|
+
"@uniformdev/project-map": "20.49.3-alpha.47+9aed70a64d",
|
|
71
|
+
"@uniformdev/redirect": "20.49.3-alpha.47+9aed70a64d",
|
|
72
|
+
"@uniformdev/richtext": "20.49.3-alpha.47+9aed70a64d",
|
|
73
|
+
"@uniformdev/webhooks": "20.49.3-alpha.47+9aed70a64d",
|
|
74
|
+
"@vercel/edge-config": "^1.4.3",
|
|
74
75
|
"encoding": "^0.1.13",
|
|
75
76
|
"server-only": "^0.0.1",
|
|
76
|
-
"svix": "^1.
|
|
77
|
+
"svix": "^1.96.0"
|
|
77
78
|
},
|
|
78
79
|
"engines": {
|
|
79
80
|
"node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
|
|
80
81
|
},
|
|
81
82
|
"peerDependencies": {
|
|
82
|
-
"next": ">=15.
|
|
83
|
+
"next": ">=15.5.15",
|
|
83
84
|
"react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
|
|
84
85
|
"react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0"
|
|
85
86
|
},
|
|
86
87
|
"publishConfig": {
|
|
87
88
|
"access": "public"
|
|
88
89
|
},
|
|
89
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "9aed70a64de0ca177d27ea99dc25f1ad053f87ad"
|
|
90
91
|
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { ResolvedRouteGetResponse, ComponentInstance } from '@uniformdev/canvas';
|
|
2
|
-
import { PageParameters, ComponentProps, CompositionContext, AppDirectoryServerContext } from '@uniformdev/canvas-next-rsc-shared';
|
|
3
|
-
import React, { ComponentType, ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
type UniformStaticCompositionProps = {
|
|
6
|
-
/**
|
|
7
|
-
* How to render the composition.
|
|
8
|
-
*/
|
|
9
|
-
mode: 'static';
|
|
10
|
-
};
|
|
11
|
-
type UniformServerCompositionProps = {
|
|
12
|
-
/**
|
|
13
|
-
* How to render the composition.
|
|
14
|
-
*/
|
|
15
|
-
mode: 'server';
|
|
16
|
-
/**
|
|
17
|
-
* The Context instance to use for server-side rendering.
|
|
18
|
-
*/
|
|
19
|
-
serverContext?: AppDirectoryServerContext;
|
|
20
|
-
};
|
|
21
|
-
type UniformCompositionProps = PageParameters & {
|
|
22
|
-
/**
|
|
23
|
-
* The route data to render.
|
|
24
|
-
*/
|
|
25
|
-
route: ResolvedRouteGetResponse | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Function to map composition components to React components.
|
|
28
|
-
*/
|
|
29
|
-
resolveComponent: ResolveComponentFunction;
|
|
30
|
-
/**
|
|
31
|
-
* Function to map empty placeholders to React components.
|
|
32
|
-
*/
|
|
33
|
-
resolveEmptyPlaceholder?: ResolveEmptyPlaceholderFunction;
|
|
34
|
-
} & (UniformStaticCompositionProps | UniformServerCompositionProps);
|
|
35
|
-
declare const UniformComposition: React.FC<UniformCompositionProps>;
|
|
36
|
-
type ResolveComponentFunction = (options: {
|
|
37
|
-
component: ComponentInstance;
|
|
38
|
-
}) => ResolveComponentResult;
|
|
39
|
-
type ResolveEmptyPlaceholderFunction = (options: ResolveEmptyPlaceholderOptions) => ResolveEmptyPlaceholderResult;
|
|
40
|
-
type ResolveEmptyPlaceholderOptions = {
|
|
41
|
-
parentComponent: ComponentInstance | undefined;
|
|
42
|
-
component: ComponentInstance;
|
|
43
|
-
slotName: string;
|
|
44
|
-
slotIndex: number;
|
|
45
|
-
};
|
|
46
|
-
type ResolveComponentResult = {
|
|
47
|
-
component: ComponentType<ComponentProps<any, any>> | null;
|
|
48
|
-
includeContext?: boolean;
|
|
49
|
-
suspense?: {
|
|
50
|
-
fallback: ComponentType<any> | undefined;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
type ResolveEmptyPlaceholderResult = {
|
|
54
|
-
component: ComponentType<ComponentProps<any, any>> | null;
|
|
55
|
-
};
|
|
56
|
-
declare const resolveComposition: (props: Omit<ResolveComponentsOptions, "slotName" | "slotIndex" | "target"> & {
|
|
57
|
-
composition: ComponentInstance;
|
|
58
|
-
compositionContext: CompositionContext;
|
|
59
|
-
}) => React.FunctionComponentElement<{
|
|
60
|
-
children?: ReactNode | undefined;
|
|
61
|
-
}> | null;
|
|
62
|
-
type ResolveComponentsOptions = {
|
|
63
|
-
serverContext?: AppDirectoryServerContext;
|
|
64
|
-
target: {
|
|
65
|
-
type: 'root';
|
|
66
|
-
composition: ComponentInstance;
|
|
67
|
-
} | {
|
|
68
|
-
type: 'slot';
|
|
69
|
-
components: ComponentInstance[];
|
|
70
|
-
parent: ComponentInstance;
|
|
71
|
-
root: ComponentInstance;
|
|
72
|
-
};
|
|
73
|
-
slotName: string | undefined;
|
|
74
|
-
slotIndex: number | undefined;
|
|
75
|
-
resolveComponent: ResolveComponentFunction;
|
|
76
|
-
resolveEmptyPlaceholder: ResolveEmptyPlaceholderFunction | undefined;
|
|
77
|
-
compositionContext: CompositionContext;
|
|
78
|
-
mode: UniformCompositionProps['mode'];
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export { type ResolveComponentFunction as R, type UniformCompositionProps as U, type ResolveComponentResult as a, UniformComposition as b, resolveComposition as r };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { ResolvedRouteGetResponse, ComponentInstance } from '@uniformdev/canvas';
|
|
2
|
-
import { PageParameters, ComponentProps, CompositionContext, AppDirectoryServerContext } from '@uniformdev/canvas-next-rsc-shared';
|
|
3
|
-
import React, { ComponentType, ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
type UniformStaticCompositionProps = {
|
|
6
|
-
/**
|
|
7
|
-
* How to render the composition.
|
|
8
|
-
*/
|
|
9
|
-
mode: 'static';
|
|
10
|
-
};
|
|
11
|
-
type UniformServerCompositionProps = {
|
|
12
|
-
/**
|
|
13
|
-
* How to render the composition.
|
|
14
|
-
*/
|
|
15
|
-
mode: 'server';
|
|
16
|
-
/**
|
|
17
|
-
* The Context instance to use for server-side rendering.
|
|
18
|
-
*/
|
|
19
|
-
serverContext?: AppDirectoryServerContext;
|
|
20
|
-
};
|
|
21
|
-
type UniformCompositionProps = PageParameters & {
|
|
22
|
-
/**
|
|
23
|
-
* The route data to render.
|
|
24
|
-
*/
|
|
25
|
-
route: ResolvedRouteGetResponse | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Function to map composition components to React components.
|
|
28
|
-
*/
|
|
29
|
-
resolveComponent: ResolveComponentFunction;
|
|
30
|
-
/**
|
|
31
|
-
* Function to map empty placeholders to React components.
|
|
32
|
-
*/
|
|
33
|
-
resolveEmptyPlaceholder?: ResolveEmptyPlaceholderFunction;
|
|
34
|
-
} & (UniformStaticCompositionProps | UniformServerCompositionProps);
|
|
35
|
-
declare const UniformComposition: React.FC<UniformCompositionProps>;
|
|
36
|
-
type ResolveComponentFunction = (options: {
|
|
37
|
-
component: ComponentInstance;
|
|
38
|
-
}) => ResolveComponentResult;
|
|
39
|
-
type ResolveEmptyPlaceholderFunction = (options: ResolveEmptyPlaceholderOptions) => ResolveEmptyPlaceholderResult;
|
|
40
|
-
type ResolveEmptyPlaceholderOptions = {
|
|
41
|
-
parentComponent: ComponentInstance | undefined;
|
|
42
|
-
component: ComponentInstance;
|
|
43
|
-
slotName: string;
|
|
44
|
-
slotIndex: number;
|
|
45
|
-
};
|
|
46
|
-
type ResolveComponentResult = {
|
|
47
|
-
component: ComponentType<ComponentProps<any, any>> | null;
|
|
48
|
-
includeContext?: boolean;
|
|
49
|
-
suspense?: {
|
|
50
|
-
fallback: ComponentType<any> | undefined;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
type ResolveEmptyPlaceholderResult = {
|
|
54
|
-
component: ComponentType<ComponentProps<any, any>> | null;
|
|
55
|
-
};
|
|
56
|
-
declare const resolveComposition: (props: Omit<ResolveComponentsOptions, "slotName" | "slotIndex" | "target"> & {
|
|
57
|
-
composition: ComponentInstance;
|
|
58
|
-
compositionContext: CompositionContext;
|
|
59
|
-
}) => React.FunctionComponentElement<{
|
|
60
|
-
children?: ReactNode | undefined;
|
|
61
|
-
}> | null;
|
|
62
|
-
type ResolveComponentsOptions = {
|
|
63
|
-
serverContext?: AppDirectoryServerContext;
|
|
64
|
-
target: {
|
|
65
|
-
type: 'root';
|
|
66
|
-
composition: ComponentInstance;
|
|
67
|
-
} | {
|
|
68
|
-
type: 'slot';
|
|
69
|
-
components: ComponentInstance[];
|
|
70
|
-
parent: ComponentInstance;
|
|
71
|
-
root: ComponentInstance;
|
|
72
|
-
};
|
|
73
|
-
slotName: string | undefined;
|
|
74
|
-
slotIndex: number | undefined;
|
|
75
|
-
resolveComponent: ResolveComponentFunction;
|
|
76
|
-
resolveEmptyPlaceholder: ResolveEmptyPlaceholderFunction | undefined;
|
|
77
|
-
compositionContext: CompositionContext;
|
|
78
|
-
mode: UniformCompositionProps['mode'];
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export { type ResolveComponentFunction as R, type UniformCompositionProps as U, type ResolveComponentResult as a, UniformComposition as b, resolveComposition as r };
|