@uniformdev/canvas-next-rsc 19.55.2-alpha.22 → 19.55.2-alpha.28
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 +14 -7
- package/dist/handler.mjs +14 -7
- package/dist/index.esm.js +20 -16
- package/dist/index.js +24 -20
- package/dist/index.mjs +20 -16
- package/package.json +11 -11
package/dist/handler.js
CHANGED
|
@@ -64,16 +64,19 @@ var isDevelopmentEnvironment = () => {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
// src/config/helpers.ts
|
|
67
|
+
var shouldCacheBeDisabled = (options) => {
|
|
68
|
+
return isDraftModeEnabled(options) || isIncontextEditingEnabled(options);
|
|
69
|
+
};
|
|
67
70
|
var getCanvasCacheStrategy = (options) => {
|
|
68
|
-
|
|
69
|
-
if (config.canvasCache) {
|
|
70
|
-
return config.canvasCache;
|
|
71
|
-
}
|
|
72
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
71
|
+
if (shouldCacheBeDisabled(options)) {
|
|
73
72
|
return {
|
|
74
73
|
type: "no-cache"
|
|
75
74
|
};
|
|
76
75
|
}
|
|
76
|
+
const config = getServerConfig();
|
|
77
|
+
if (config.canvasCache) {
|
|
78
|
+
return config.canvasCache;
|
|
79
|
+
}
|
|
77
80
|
return {
|
|
78
81
|
type: "force-cache"
|
|
79
82
|
};
|
|
@@ -312,7 +315,9 @@ var isSvixMessage = async (request) => {
|
|
|
312
315
|
};
|
|
313
316
|
var processCompositionChange = async (compositionId) => {
|
|
314
317
|
const projectMapClient = getProjectMapClient({
|
|
315
|
-
|
|
318
|
+
cache: {
|
|
319
|
+
type: "no-cache"
|
|
320
|
+
}
|
|
316
321
|
});
|
|
317
322
|
const { nodes } = await projectMapClient.getNodes({
|
|
318
323
|
compositionId
|
|
@@ -376,7 +381,9 @@ var processEdgeConfigChange = async ({ source_url }) => {
|
|
|
376
381
|
}
|
|
377
382
|
const config = getServerConfig();
|
|
378
383
|
const routeClient = getRouteClient({
|
|
379
|
-
|
|
384
|
+
cache: {
|
|
385
|
+
type: "no-cache"
|
|
386
|
+
}
|
|
380
387
|
});
|
|
381
388
|
const route = await routeClient.getRoute({
|
|
382
389
|
path: source_url
|
package/dist/handler.mjs
CHANGED
|
@@ -49,16 +49,19 @@ var isDevelopmentEnvironment = () => {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
// src/config/helpers.ts
|
|
52
|
+
var shouldCacheBeDisabled = (options) => {
|
|
53
|
+
return isDraftModeEnabled(options) || isIncontextEditingEnabled(options);
|
|
54
|
+
};
|
|
52
55
|
var getCanvasCacheStrategy = (options) => {
|
|
53
|
-
|
|
54
|
-
if (config.canvasCache) {
|
|
55
|
-
return config.canvasCache;
|
|
56
|
-
}
|
|
57
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
56
|
+
if (shouldCacheBeDisabled(options)) {
|
|
58
57
|
return {
|
|
59
58
|
type: "no-cache"
|
|
60
59
|
};
|
|
61
60
|
}
|
|
61
|
+
const config = getServerConfig();
|
|
62
|
+
if (config.canvasCache) {
|
|
63
|
+
return config.canvasCache;
|
|
64
|
+
}
|
|
62
65
|
return {
|
|
63
66
|
type: "force-cache"
|
|
64
67
|
};
|
|
@@ -302,7 +305,9 @@ var isSvixMessage = async (request) => {
|
|
|
302
305
|
};
|
|
303
306
|
var processCompositionChange = async (compositionId) => {
|
|
304
307
|
const projectMapClient = getProjectMapClient({
|
|
305
|
-
|
|
308
|
+
cache: {
|
|
309
|
+
type: "no-cache"
|
|
310
|
+
}
|
|
306
311
|
});
|
|
307
312
|
const { nodes } = await projectMapClient.getNodes({
|
|
308
313
|
compositionId
|
|
@@ -366,7 +371,9 @@ var processEdgeConfigChange = async ({ source_url }) => {
|
|
|
366
371
|
}
|
|
367
372
|
const config = getServerConfig();
|
|
368
373
|
const routeClient = getRouteClient({
|
|
369
|
-
|
|
374
|
+
cache: {
|
|
375
|
+
type: "no-cache"
|
|
376
|
+
}
|
|
370
377
|
});
|
|
371
378
|
const route = await routeClient.getRoute({
|
|
372
379
|
path: source_url
|
package/dist/index.esm.js
CHANGED
|
@@ -39,44 +39,47 @@ var isDevelopmentEnvironment = () => {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
// src/config/helpers.ts
|
|
42
|
+
var shouldCacheBeDisabled = (options) => {
|
|
43
|
+
return isDraftModeEnabled(options) || isIncontextEditingEnabled(options);
|
|
44
|
+
};
|
|
42
45
|
var getCanvasCacheStrategy = (options) => {
|
|
43
|
-
|
|
44
|
-
if (config.canvasCache) {
|
|
45
|
-
return config.canvasCache;
|
|
46
|
-
}
|
|
47
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
46
|
+
if (shouldCacheBeDisabled(options)) {
|
|
48
47
|
return {
|
|
49
48
|
type: "no-cache"
|
|
50
49
|
};
|
|
51
50
|
}
|
|
51
|
+
const config = getServerConfig();
|
|
52
|
+
if (config.canvasCache) {
|
|
53
|
+
return config.canvasCache;
|
|
54
|
+
}
|
|
52
55
|
return {
|
|
53
56
|
type: "force-cache"
|
|
54
57
|
};
|
|
55
58
|
};
|
|
56
59
|
var getManifestCacheStrategy = (options) => {
|
|
57
|
-
|
|
58
|
-
if (config.manifestCache) {
|
|
59
|
-
return config.manifestCache;
|
|
60
|
-
}
|
|
61
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
60
|
+
if (shouldCacheBeDisabled(options)) {
|
|
62
61
|
return {
|
|
63
62
|
type: "no-cache"
|
|
64
63
|
};
|
|
65
64
|
}
|
|
65
|
+
const config = getServerConfig();
|
|
66
|
+
if (config.manifestCache) {
|
|
67
|
+
return config.manifestCache;
|
|
68
|
+
}
|
|
66
69
|
return {
|
|
67
70
|
type: "force-cache"
|
|
68
71
|
};
|
|
69
72
|
};
|
|
70
73
|
var getProjectMapCacheStrategy = (options) => {
|
|
71
|
-
|
|
72
|
-
if (config.projectMapCache) {
|
|
73
|
-
return config.projectMapCache;
|
|
74
|
-
}
|
|
75
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
74
|
+
if (shouldCacheBeDisabled(options)) {
|
|
76
75
|
return {
|
|
77
76
|
type: "no-cache"
|
|
78
77
|
};
|
|
79
78
|
}
|
|
79
|
+
const config = getServerConfig();
|
|
80
|
+
if (config.projectMapCache) {
|
|
81
|
+
return config.projectMapCache;
|
|
82
|
+
}
|
|
80
83
|
return {
|
|
81
84
|
type: "force-cache"
|
|
82
85
|
};
|
|
@@ -874,6 +877,7 @@ var resolveComponents = ({
|
|
|
874
877
|
|
|
875
878
|
// src/components/UniformContext.tsx
|
|
876
879
|
import { UniformScript } from "@uniformdev/canvas-next-rsc-client";
|
|
880
|
+
import { Suspense } from "react";
|
|
877
881
|
import { Fragment as Fragment4, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
878
882
|
var UniformContext = async ({
|
|
879
883
|
clientContextComponent,
|
|
@@ -886,7 +890,7 @@ var UniformContext = async ({
|
|
|
886
890
|
return /* @__PURE__ */ jsxs2(Fragment4, { children: [
|
|
887
891
|
children,
|
|
888
892
|
/* @__PURE__ */ jsx2(ContextComponent, { manifest }),
|
|
889
|
-
/* @__PURE__ */ jsx2(UniformScript, {})
|
|
893
|
+
/* @__PURE__ */ jsx2(Suspense, { fallback: /* @__PURE__ */ jsx2(Fragment4, {}), children: /* @__PURE__ */ jsx2(UniformScript, {}) })
|
|
890
894
|
] });
|
|
891
895
|
};
|
|
892
896
|
|
package/dist/index.js
CHANGED
|
@@ -93,44 +93,47 @@ var isDevelopmentEnvironment = () => {
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
// src/config/helpers.ts
|
|
96
|
+
var shouldCacheBeDisabled = (options) => {
|
|
97
|
+
return isDraftModeEnabled(options) || isIncontextEditingEnabled(options);
|
|
98
|
+
};
|
|
96
99
|
var getCanvasCacheStrategy = (options) => {
|
|
97
|
-
|
|
98
|
-
if (config.canvasCache) {
|
|
99
|
-
return config.canvasCache;
|
|
100
|
-
}
|
|
101
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
100
|
+
if (shouldCacheBeDisabled(options)) {
|
|
102
101
|
return {
|
|
103
102
|
type: "no-cache"
|
|
104
103
|
};
|
|
105
104
|
}
|
|
105
|
+
const config = getServerConfig();
|
|
106
|
+
if (config.canvasCache) {
|
|
107
|
+
return config.canvasCache;
|
|
108
|
+
}
|
|
106
109
|
return {
|
|
107
110
|
type: "force-cache"
|
|
108
111
|
};
|
|
109
112
|
};
|
|
110
113
|
var getManifestCacheStrategy = (options) => {
|
|
111
|
-
|
|
112
|
-
if (config.manifestCache) {
|
|
113
|
-
return config.manifestCache;
|
|
114
|
-
}
|
|
115
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
114
|
+
if (shouldCacheBeDisabled(options)) {
|
|
116
115
|
return {
|
|
117
116
|
type: "no-cache"
|
|
118
117
|
};
|
|
119
118
|
}
|
|
119
|
+
const config = getServerConfig();
|
|
120
|
+
if (config.manifestCache) {
|
|
121
|
+
return config.manifestCache;
|
|
122
|
+
}
|
|
120
123
|
return {
|
|
121
124
|
type: "force-cache"
|
|
122
125
|
};
|
|
123
126
|
};
|
|
124
127
|
var getProjectMapCacheStrategy = (options) => {
|
|
125
|
-
|
|
126
|
-
if (config.projectMapCache) {
|
|
127
|
-
return config.projectMapCache;
|
|
128
|
-
}
|
|
129
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
128
|
+
if (shouldCacheBeDisabled(options)) {
|
|
130
129
|
return {
|
|
131
130
|
type: "no-cache"
|
|
132
131
|
};
|
|
133
132
|
}
|
|
133
|
+
const config = getServerConfig();
|
|
134
|
+
if (config.projectMapCache) {
|
|
135
|
+
return config.projectMapCache;
|
|
136
|
+
}
|
|
134
137
|
return {
|
|
135
138
|
type: "force-cache"
|
|
136
139
|
};
|
|
@@ -912,6 +915,7 @@ var resolveComponents = ({
|
|
|
912
915
|
|
|
913
916
|
// src/components/UniformContext.tsx
|
|
914
917
|
var import_canvas_next_rsc_client3 = require("@uniformdev/canvas-next-rsc-client");
|
|
918
|
+
var import_react4 = require("react");
|
|
915
919
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
916
920
|
var UniformContext = async ({
|
|
917
921
|
clientContextComponent,
|
|
@@ -924,13 +928,13 @@ var UniformContext = async ({
|
|
|
924
928
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
925
929
|
children,
|
|
926
930
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ContextComponent, { manifest }),
|
|
927
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_canvas_next_rsc_client3.UniformScript, {})
|
|
931
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_canvas_next_rsc_client3.UniformScript, {}) })
|
|
928
932
|
] });
|
|
929
933
|
};
|
|
930
934
|
|
|
931
935
|
// src/components/UniformRichText.tsx
|
|
932
936
|
var import_richtext5 = require("@uniformdev/richtext");
|
|
933
|
-
var
|
|
937
|
+
var import_react6 = __toESM(require("react"));
|
|
934
938
|
|
|
935
939
|
// src/components/UniformRichTextNode.tsx
|
|
936
940
|
var import_richtext4 = require("@uniformdev/richtext");
|
|
@@ -1004,7 +1008,7 @@ var TextRichTextNode = ({ node }) => {
|
|
|
1004
1008
|
|
|
1005
1009
|
// src/components/UniformRichTextNode.tsx
|
|
1006
1010
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1007
|
-
var
|
|
1011
|
+
var import_react5 = require("react");
|
|
1008
1012
|
function UniformRichTextNode({ node, ...props }) {
|
|
1009
1013
|
var _a;
|
|
1010
1014
|
if (!(0, import_richtext4.isRichTextNode)(node))
|
|
@@ -1016,7 +1020,7 @@ function UniformRichTextNode({ node, ...props }) {
|
|
|
1016
1020
|
if (!NodeRenderer) {
|
|
1017
1021
|
return null;
|
|
1018
1022
|
}
|
|
1019
|
-
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ (0,
|
|
1023
|
+
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ (0, import_react5.createElement)(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
|
|
1020
1024
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(NodeRenderer, { node, children });
|
|
1021
1025
|
}
|
|
1022
1026
|
var rendererMap = /* @__PURE__ */ new Map([
|
|
@@ -1041,7 +1045,7 @@ var resolveRichTextDefaultRenderer = (node) => {
|
|
|
1041
1045
|
|
|
1042
1046
|
// src/components/UniformRichText.tsx
|
|
1043
1047
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1044
|
-
var UniformRichText =
|
|
1048
|
+
var UniformRichText = import_react6.default.forwardRef(function UniformRichText2({ parameterId, component, resolveRichTextRenderer, as: Tag = "div", ...props }, ref) {
|
|
1045
1049
|
var _a;
|
|
1046
1050
|
const parameter = (_a = component == null ? void 0 : component.parameters) == null ? void 0 : _a[parameterId];
|
|
1047
1051
|
const value = parameter == null ? void 0 : parameter.value;
|
package/dist/index.mjs
CHANGED
|
@@ -39,44 +39,47 @@ var isDevelopmentEnvironment = () => {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
// src/config/helpers.ts
|
|
42
|
+
var shouldCacheBeDisabled = (options) => {
|
|
43
|
+
return isDraftModeEnabled(options) || isIncontextEditingEnabled(options);
|
|
44
|
+
};
|
|
42
45
|
var getCanvasCacheStrategy = (options) => {
|
|
43
|
-
|
|
44
|
-
if (config.canvasCache) {
|
|
45
|
-
return config.canvasCache;
|
|
46
|
-
}
|
|
47
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
46
|
+
if (shouldCacheBeDisabled(options)) {
|
|
48
47
|
return {
|
|
49
48
|
type: "no-cache"
|
|
50
49
|
};
|
|
51
50
|
}
|
|
51
|
+
const config = getServerConfig();
|
|
52
|
+
if (config.canvasCache) {
|
|
53
|
+
return config.canvasCache;
|
|
54
|
+
}
|
|
52
55
|
return {
|
|
53
56
|
type: "force-cache"
|
|
54
57
|
};
|
|
55
58
|
};
|
|
56
59
|
var getManifestCacheStrategy = (options) => {
|
|
57
|
-
|
|
58
|
-
if (config.manifestCache) {
|
|
59
|
-
return config.manifestCache;
|
|
60
|
-
}
|
|
61
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
60
|
+
if (shouldCacheBeDisabled(options)) {
|
|
62
61
|
return {
|
|
63
62
|
type: "no-cache"
|
|
64
63
|
};
|
|
65
64
|
}
|
|
65
|
+
const config = getServerConfig();
|
|
66
|
+
if (config.manifestCache) {
|
|
67
|
+
return config.manifestCache;
|
|
68
|
+
}
|
|
66
69
|
return {
|
|
67
70
|
type: "force-cache"
|
|
68
71
|
};
|
|
69
72
|
};
|
|
70
73
|
var getProjectMapCacheStrategy = (options) => {
|
|
71
|
-
|
|
72
|
-
if (config.projectMapCache) {
|
|
73
|
-
return config.projectMapCache;
|
|
74
|
-
}
|
|
75
|
-
if (isDevelopmentEnvironment() || isDraftModeEnabled(options) || isOnVercelPreviewEnvironment()) {
|
|
74
|
+
if (shouldCacheBeDisabled(options)) {
|
|
76
75
|
return {
|
|
77
76
|
type: "no-cache"
|
|
78
77
|
};
|
|
79
78
|
}
|
|
79
|
+
const config = getServerConfig();
|
|
80
|
+
if (config.projectMapCache) {
|
|
81
|
+
return config.projectMapCache;
|
|
82
|
+
}
|
|
80
83
|
return {
|
|
81
84
|
type: "force-cache"
|
|
82
85
|
};
|
|
@@ -874,6 +877,7 @@ var resolveComponents = ({
|
|
|
874
877
|
|
|
875
878
|
// src/components/UniformContext.tsx
|
|
876
879
|
import { UniformScript } from "@uniformdev/canvas-next-rsc-client";
|
|
880
|
+
import { Suspense } from "react";
|
|
877
881
|
import { Fragment as Fragment4, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
878
882
|
var UniformContext = async ({
|
|
879
883
|
clientContextComponent,
|
|
@@ -886,7 +890,7 @@ var UniformContext = async ({
|
|
|
886
890
|
return /* @__PURE__ */ jsxs2(Fragment4, { children: [
|
|
887
891
|
children,
|
|
888
892
|
/* @__PURE__ */ jsx2(ContextComponent, { manifest }),
|
|
889
|
-
/* @__PURE__ */ jsx2(UniformScript, {})
|
|
893
|
+
/* @__PURE__ */ jsx2(Suspense, { fallback: /* @__PURE__ */ jsx2(Fragment4, {}), children: /* @__PURE__ */ jsx2(UniformScript, {}) })
|
|
890
894
|
] });
|
|
891
895
|
};
|
|
892
896
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc",
|
|
3
|
-
"version": "19.55.2-alpha.
|
|
3
|
+
"version": "19.55.2-alpha.28+2ac0494ad",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
"react-dom": "18.2.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@uniformdev/canvas": "19.55.2-alpha.
|
|
57
|
-
"@uniformdev/canvas-next-rsc-client": "^19.55.2-alpha.
|
|
58
|
-
"@uniformdev/canvas-next-rsc-shared": "^19.55.2-alpha.
|
|
59
|
-
"@uniformdev/canvas-react": "19.55.2-alpha.
|
|
60
|
-
"@uniformdev/context": "19.55.2-alpha.
|
|
61
|
-
"@uniformdev/project-map": "19.55.2-alpha.
|
|
62
|
-
"@uniformdev/redirect": "19.55.2-alpha.
|
|
63
|
-
"@uniformdev/richtext": "19.55.2-alpha.
|
|
64
|
-
"@uniformdev/webhooks": "19.55.2-alpha.
|
|
56
|
+
"@uniformdev/canvas": "19.55.2-alpha.28+2ac0494ad",
|
|
57
|
+
"@uniformdev/canvas-next-rsc-client": "^19.55.2-alpha.28+2ac0494ad",
|
|
58
|
+
"@uniformdev/canvas-next-rsc-shared": "^19.55.2-alpha.28+2ac0494ad",
|
|
59
|
+
"@uniformdev/canvas-react": "19.55.2-alpha.28+2ac0494ad",
|
|
60
|
+
"@uniformdev/context": "19.55.2-alpha.28+2ac0494ad",
|
|
61
|
+
"@uniformdev/project-map": "19.55.2-alpha.28+2ac0494ad",
|
|
62
|
+
"@uniformdev/redirect": "19.55.2-alpha.28+2ac0494ad",
|
|
63
|
+
"@uniformdev/richtext": "19.55.2-alpha.28+2ac0494ad",
|
|
64
|
+
"@uniformdev/webhooks": "19.55.2-alpha.28+2ac0494ad",
|
|
65
65
|
"@vercel/edge-config": "^0.4.0",
|
|
66
66
|
"svix": "^1.5.0"
|
|
67
67
|
},
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "2ac0494ad92320b4a314433b89df24f45bdf0f00"
|
|
80
80
|
}
|