@uniformdev/canvas-next-rsc 19.173.2-alpha.8 → 19.175.1-alpha.35
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 +2 -1
- package/dist/handler.mjs +2 -1
- package/dist/index.esm.js +28 -8
- package/dist/index.js +47 -28
- package/dist/index.mjs +28 -8
- package/package.json +11 -11
package/dist/handler.js
CHANGED
|
@@ -263,7 +263,8 @@ var getCanvasClient = (options) => {
|
|
|
263
263
|
"x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
|
|
264
264
|
},
|
|
265
265
|
next: {
|
|
266
|
-
revalidate
|
|
266
|
+
revalidate,
|
|
267
|
+
tags: tags.length ? tags : void 0
|
|
267
268
|
}
|
|
268
269
|
});
|
|
269
270
|
}
|
package/dist/handler.mjs
CHANGED
|
@@ -247,7 +247,8 @@ var getCanvasClient = (options) => {
|
|
|
247
247
|
"x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
|
|
248
248
|
},
|
|
249
249
|
next: {
|
|
250
|
-
revalidate
|
|
250
|
+
revalidate,
|
|
251
|
+
tags: tags.length ? tags : void 0
|
|
251
252
|
}
|
|
252
253
|
});
|
|
253
254
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -209,7 +209,8 @@ var getCanvasClient = (options) => {
|
|
|
209
209
|
"x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
|
|
210
210
|
},
|
|
211
211
|
next: {
|
|
212
|
-
revalidate
|
|
212
|
+
revalidate,
|
|
213
|
+
tags: tags.length ? tags : void 0
|
|
213
214
|
}
|
|
214
215
|
});
|
|
215
216
|
}
|
|
@@ -412,6 +413,7 @@ import {
|
|
|
412
413
|
CANVAS_ENRICHMENT_TAG_PARAM,
|
|
413
414
|
CANVAS_PERSONALIZE_TYPE,
|
|
414
415
|
CANVAS_TEST_TYPE,
|
|
416
|
+
CANVAS_VIZ_CONTROL_PARAM,
|
|
415
417
|
isComponentPlaceholderId,
|
|
416
418
|
walkNodeTree
|
|
417
419
|
} from "@uniformdev/canvas";
|
|
@@ -684,6 +686,13 @@ var TestServer = async (props) => {
|
|
|
684
686
|
return createElement2(Fragment2, void 0, [component, eventElement]);
|
|
685
687
|
};
|
|
686
688
|
|
|
689
|
+
// src/components/VisibilityRulesWrapper.tsx
|
|
690
|
+
import { VisibilityRulesWrapperClient } from "@uniformdev/canvas-next-rsc-client";
|
|
691
|
+
import React6 from "react";
|
|
692
|
+
var VisibilityRulesWrapper = (props) => {
|
|
693
|
+
return /* @__PURE__ */ React6.createElement(VisibilityRulesWrapperClient, { ...props });
|
|
694
|
+
};
|
|
695
|
+
|
|
687
696
|
// src/components/UniformComposition.ts
|
|
688
697
|
var UniformComposition = async ({
|
|
689
698
|
resolveComponent,
|
|
@@ -872,7 +881,7 @@ var resolveComponents = ({
|
|
|
872
881
|
parent = target.parent;
|
|
873
882
|
}
|
|
874
883
|
const resolved = components.map((component, componentIndex) => {
|
|
875
|
-
var _a, _b;
|
|
884
|
+
var _a, _b, _c;
|
|
876
885
|
const isServer = isServerComponent({
|
|
877
886
|
component,
|
|
878
887
|
serverContext
|
|
@@ -903,6 +912,7 @@ var resolveComponents = ({
|
|
|
903
912
|
const wrapInSuspense = systemSuspense || componentSuspense;
|
|
904
913
|
const parameters = (_a = component.parameters) != null ? _a : {};
|
|
905
914
|
const enrichmentTags = (_b = parameters[CANVAS_ENRICHMENT_TAG_PARAM]) == null ? void 0 : _b.value;
|
|
915
|
+
const visibilityRules = (_c = parameters[CANVAS_VIZ_CONTROL_PARAM]) == null ? void 0 : _c.value;
|
|
906
916
|
const key = `${slotName}-${componentIndex}-component`;
|
|
907
917
|
const componentProps = {
|
|
908
918
|
...Object.keys(parameters).reduce((acc, cur) => {
|
|
@@ -986,6 +996,16 @@ var resolveComponents = ({
|
|
|
986
996
|
}
|
|
987
997
|
childNode = elements;
|
|
988
998
|
}
|
|
999
|
+
if (visibilityRules) {
|
|
1000
|
+
childNode = createElement3(
|
|
1001
|
+
VisibilityRulesWrapper,
|
|
1002
|
+
{
|
|
1003
|
+
key: `${slotName}-${componentIndex}-visibility`,
|
|
1004
|
+
parameter: visibilityRules
|
|
1005
|
+
},
|
|
1006
|
+
childNode
|
|
1007
|
+
);
|
|
1008
|
+
}
|
|
989
1009
|
return createElement3(
|
|
990
1010
|
Fragment3,
|
|
991
1011
|
{
|
|
@@ -1003,7 +1023,7 @@ import {
|
|
|
1003
1023
|
UniformScript
|
|
1004
1024
|
} from "@uniformdev/canvas-next-rsc-client";
|
|
1005
1025
|
import { Suspense as Suspense2 } from "react";
|
|
1006
|
-
import
|
|
1026
|
+
import React7 from "react";
|
|
1007
1027
|
var UniformContext = async ({
|
|
1008
1028
|
clientContextComponent,
|
|
1009
1029
|
children
|
|
@@ -1016,23 +1036,23 @@ var UniformContext = async ({
|
|
|
1016
1036
|
const serverConfig = getServerConfig();
|
|
1017
1037
|
const disableDevTools = ((_a = serverConfig.context) == null ? void 0 : _a.disableDevTools) || false;
|
|
1018
1038
|
const defaultConsent = serverConfig.defaultConsent || false;
|
|
1019
|
-
return /* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, children, /* @__PURE__ */ React7.createElement(
|
|
1020
1040
|
ContextComponent,
|
|
1021
1041
|
{
|
|
1022
1042
|
manifest,
|
|
1023
1043
|
disableDevTools,
|
|
1024
1044
|
defaultConsent
|
|
1025
1045
|
}
|
|
1026
|
-
), /* @__PURE__ */
|
|
1046
|
+
), /* @__PURE__ */ React7.createElement(Suspense2, { fallback: /* @__PURE__ */ React7.createElement(React7.Fragment, null) }, /* @__PURE__ */ React7.createElement(UniformScript, null)));
|
|
1027
1047
|
};
|
|
1028
1048
|
|
|
1029
1049
|
// src/components/UniformPlayground.tsx
|
|
1030
1050
|
import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE3, CANVAS_EDITOR_STATE as CANVAS_EDITOR_STATE3 } from "@uniformdev/canvas";
|
|
1031
1051
|
import { notFound as notFound2 } from "next/navigation";
|
|
1032
|
-
import
|
|
1052
|
+
import React8 from "react";
|
|
1033
1053
|
var UniformPlayground = async ({ searchParams, ...rest }) => {
|
|
1034
1054
|
if (!isDraftModeEnabled({ searchParams })) {
|
|
1035
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ React8.createElement("div", null, /* @__PURE__ */ React8.createElement("h1", null, "Playground is only available in draft mode"));
|
|
1036
1056
|
}
|
|
1037
1057
|
const id = searchParams["id"];
|
|
1038
1058
|
if (!id) {
|
|
@@ -1063,7 +1083,7 @@ var UniformPlayground = async ({ searchParams, ...rest }) => {
|
|
|
1063
1083
|
if (!composition) {
|
|
1064
1084
|
notFound2();
|
|
1065
1085
|
}
|
|
1066
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1067
1087
|
UniformComposition,
|
|
1068
1088
|
{
|
|
1069
1089
|
mode: "server",
|
package/dist/index.js
CHANGED
|
@@ -258,7 +258,8 @@ var getCanvasClient = (options) => {
|
|
|
258
258
|
"x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
|
|
259
259
|
},
|
|
260
260
|
next: {
|
|
261
|
-
revalidate
|
|
261
|
+
revalidate,
|
|
262
|
+
tags: tags.length ? tags : void 0
|
|
262
263
|
}
|
|
263
264
|
});
|
|
264
265
|
}
|
|
@@ -456,12 +457,12 @@ async function generateStaticParams() {
|
|
|
456
457
|
|
|
457
458
|
// src/components/UniformComposition.ts
|
|
458
459
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
459
|
-
var
|
|
460
|
+
var import_canvas_next_rsc_client7 = require("@uniformdev/canvas-next-rsc-client");
|
|
460
461
|
var import_canvas_next_rsc_shared6 = require("@uniformdev/canvas-next-rsc-shared");
|
|
461
462
|
var import_core = require("@uniformdev/canvas-react/core");
|
|
462
463
|
var import_headers3 = require("next/headers");
|
|
463
464
|
var import_navigation = require("next/navigation");
|
|
464
|
-
var
|
|
465
|
+
var import_react9 = require("react");
|
|
465
466
|
|
|
466
467
|
// src/context/createServerUniformContext.ts
|
|
467
468
|
var import_canvas_next_rsc_shared = require("@uniformdev/canvas-next-rsc-shared");
|
|
@@ -715,6 +716,13 @@ var TestServer = async (props) => {
|
|
|
715
716
|
return (0, import_react7.createElement)(import_react7.Fragment, void 0, [component, eventElement]);
|
|
716
717
|
};
|
|
717
718
|
|
|
719
|
+
// src/components/VisibilityRulesWrapper.tsx
|
|
720
|
+
var import_canvas_next_rsc_client6 = require("@uniformdev/canvas-next-rsc-client");
|
|
721
|
+
var import_react8 = __toESM(require("react"));
|
|
722
|
+
var VisibilityRulesWrapper = (props) => {
|
|
723
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_canvas_next_rsc_client6.VisibilityRulesWrapperClient, { ...props });
|
|
724
|
+
};
|
|
725
|
+
|
|
718
726
|
// src/components/UniformComposition.ts
|
|
719
727
|
var UniformComposition = async ({
|
|
720
728
|
resolveComponent,
|
|
@@ -777,7 +785,7 @@ var UniformComposition = async ({
|
|
|
777
785
|
if (props.mode === "server") {
|
|
778
786
|
const headersValue = (0, import_headers3.headers)();
|
|
779
787
|
const missingQuirkValue = "unknown";
|
|
780
|
-
transfer = (0,
|
|
788
|
+
transfer = (0, import_react9.createElement)(ContextUpdateTransfer, {
|
|
781
789
|
serverContext,
|
|
782
790
|
update: {
|
|
783
791
|
params: props.params,
|
|
@@ -794,11 +802,11 @@ var UniformComposition = async ({
|
|
|
794
802
|
}
|
|
795
803
|
});
|
|
796
804
|
} else if (props.mode === "static") {
|
|
797
|
-
transfer = (0,
|
|
805
|
+
transfer = (0, import_react9.createElement)(ContextUpdateTrigger, {
|
|
798
806
|
path
|
|
799
807
|
});
|
|
800
808
|
}
|
|
801
|
-
return (0,
|
|
809
|
+
return (0, import_react9.createElement)(import_react9.Fragment, void 0, transfer, resolved);
|
|
802
810
|
};
|
|
803
811
|
var isServerComponent = ({
|
|
804
812
|
component,
|
|
@@ -825,7 +833,7 @@ var resolveSystemComponent = ({
|
|
|
825
833
|
suspense = server && ((_a = config.ppr) == null ? void 0 : _a.personalizationSuspense);
|
|
826
834
|
}
|
|
827
835
|
if (component.type === import_canvas7.CANVAS_TEST_TYPE) {
|
|
828
|
-
resolved = server ? TestServer :
|
|
836
|
+
resolved = server ? TestServer : import_canvas_next_rsc_client7.TestClient;
|
|
829
837
|
suspense = server && ((_b = config.ppr) == null ? void 0 : _b.testSuspense);
|
|
830
838
|
}
|
|
831
839
|
return {
|
|
@@ -903,7 +911,7 @@ var resolveComponents = ({
|
|
|
903
911
|
parent = target.parent;
|
|
904
912
|
}
|
|
905
913
|
const resolved = components.map((component, componentIndex) => {
|
|
906
|
-
var _a, _b;
|
|
914
|
+
var _a, _b, _c;
|
|
907
915
|
const isServer = isServerComponent({
|
|
908
916
|
component,
|
|
909
917
|
serverContext
|
|
@@ -934,6 +942,7 @@ var resolveComponents = ({
|
|
|
934
942
|
const wrapInSuspense = systemSuspense || componentSuspense;
|
|
935
943
|
const parameters = (_a = component.parameters) != null ? _a : {};
|
|
936
944
|
const enrichmentTags = (_b = parameters[import_canvas7.CANVAS_ENRICHMENT_TAG_PARAM]) == null ? void 0 : _b.value;
|
|
945
|
+
const visibilityRules = (_c = parameters[import_canvas7.CANVAS_VIZ_CONTROL_PARAM]) == null ? void 0 : _c.value;
|
|
937
946
|
const key = `${slotName}-${componentIndex}-component`;
|
|
938
947
|
const componentProps = {
|
|
939
948
|
...Object.keys(parameters).reduce((acc, cur) => {
|
|
@@ -949,20 +958,20 @@ var resolveComponents = ({
|
|
|
949
958
|
};
|
|
950
959
|
let element = null;
|
|
951
960
|
if (wrapInSuspense) {
|
|
952
|
-
element = (0,
|
|
953
|
-
|
|
961
|
+
element = (0, import_react9.createElement)(
|
|
962
|
+
import_react9.Suspense,
|
|
954
963
|
{
|
|
955
964
|
key,
|
|
956
|
-
fallback: typeof wrapInSuspense === "boolean" || typeof (wrapInSuspense == null ? void 0 : wrapInSuspense.fallback) === "undefined" ? void 0 : (0,
|
|
965
|
+
fallback: typeof wrapInSuspense === "boolean" || typeof (wrapInSuspense == null ? void 0 : wrapInSuspense.fallback) === "undefined" ? void 0 : (0, import_react9.createElement)(wrapInSuspense.fallback)
|
|
957
966
|
},
|
|
958
|
-
(0,
|
|
967
|
+
(0, import_react9.createElement)(resolvedComponent, componentProps)
|
|
959
968
|
);
|
|
960
969
|
} else {
|
|
961
|
-
element = (0,
|
|
970
|
+
element = (0, import_react9.createElement)(resolvedComponent, { ...componentProps, key });
|
|
962
971
|
}
|
|
963
972
|
let tagElement = null;
|
|
964
973
|
if (enrichmentTags == null ? void 0 : enrichmentTags.length) {
|
|
965
|
-
tagElement = (0,
|
|
974
|
+
tagElement = (0, import_react9.createElement)(ContextUpdateTransfer, {
|
|
966
975
|
key: `${slotName}-${componentIndex}-tags`,
|
|
967
976
|
update: {
|
|
968
977
|
enrichments: enrichmentTags
|
|
@@ -977,7 +986,7 @@ var resolveComponents = ({
|
|
|
977
986
|
elements.push(tagElement);
|
|
978
987
|
}
|
|
979
988
|
const isPlaceholder = (0, import_canvas7.isComponentPlaceholderId)(component == null ? void 0 : component._id);
|
|
980
|
-
childNode = (0,
|
|
989
|
+
childNode = (0, import_react9.createElement)(
|
|
981
990
|
import_core.PureContextualEditingComponentWrapper,
|
|
982
991
|
{
|
|
983
992
|
key: `${slotName}-${componentIndex}-wrapper`,
|
|
@@ -996,8 +1005,8 @@ var resolveComponents = ({
|
|
|
996
1005
|
if (tagElement) {
|
|
997
1006
|
elements.push(tagElement);
|
|
998
1007
|
}
|
|
999
|
-
childNode = (0,
|
|
1000
|
-
|
|
1008
|
+
childNode = (0, import_react9.createElement)(
|
|
1009
|
+
import_canvas_next_rsc_client7.ClientContextualEditingComponentWrapper,
|
|
1001
1010
|
{
|
|
1002
1011
|
key: `${slotName}-${componentIndex}-wrapper`,
|
|
1003
1012
|
isPlaceholder: false,
|
|
@@ -1017,8 +1026,18 @@ var resolveComponents = ({
|
|
|
1017
1026
|
}
|
|
1018
1027
|
childNode = elements;
|
|
1019
1028
|
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1029
|
+
if (visibilityRules) {
|
|
1030
|
+
childNode = (0, import_react9.createElement)(
|
|
1031
|
+
VisibilityRulesWrapper,
|
|
1032
|
+
{
|
|
1033
|
+
key: `${slotName}-${componentIndex}-visibility`,
|
|
1034
|
+
parameter: visibilityRules
|
|
1035
|
+
},
|
|
1036
|
+
childNode
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
return (0, import_react9.createElement)(
|
|
1040
|
+
import_react9.Fragment,
|
|
1022
1041
|
{
|
|
1023
1042
|
key: !isRoot ? `${slotName}-${componentIndex}` : void 0
|
|
1024
1043
|
},
|
|
@@ -1029,9 +1048,9 @@ var resolveComponents = ({
|
|
|
1029
1048
|
};
|
|
1030
1049
|
|
|
1031
1050
|
// src/components/UniformContext.tsx
|
|
1032
|
-
var
|
|
1033
|
-
var
|
|
1034
|
-
var
|
|
1051
|
+
var import_canvas_next_rsc_client8 = require("@uniformdev/canvas-next-rsc-client");
|
|
1052
|
+
var import_react10 = require("react");
|
|
1053
|
+
var import_react11 = __toESM(require("react"));
|
|
1035
1054
|
var UniformContext = async ({
|
|
1036
1055
|
clientContextComponent,
|
|
1037
1056
|
children
|
|
@@ -1040,27 +1059,27 @@ var UniformContext = async ({
|
|
|
1040
1059
|
const manifest = await getManifest({
|
|
1041
1060
|
searchParams: {}
|
|
1042
1061
|
});
|
|
1043
|
-
const ContextComponent = clientContextComponent ||
|
|
1062
|
+
const ContextComponent = clientContextComponent || import_canvas_next_rsc_client8.DefaultUniformClientContext;
|
|
1044
1063
|
const serverConfig = getServerConfig();
|
|
1045
1064
|
const disableDevTools = ((_a = serverConfig.context) == null ? void 0 : _a.disableDevTools) || false;
|
|
1046
1065
|
const defaultConsent = serverConfig.defaultConsent || false;
|
|
1047
|
-
return /* @__PURE__ */
|
|
1066
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, children, /* @__PURE__ */ import_react11.default.createElement(
|
|
1048
1067
|
ContextComponent,
|
|
1049
1068
|
{
|
|
1050
1069
|
manifest,
|
|
1051
1070
|
disableDevTools,
|
|
1052
1071
|
defaultConsent
|
|
1053
1072
|
}
|
|
1054
|
-
), /* @__PURE__ */
|
|
1073
|
+
), /* @__PURE__ */ import_react11.default.createElement(import_react10.Suspense, { fallback: /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null) }, /* @__PURE__ */ import_react11.default.createElement(import_canvas_next_rsc_client8.UniformScript, null)));
|
|
1055
1074
|
};
|
|
1056
1075
|
|
|
1057
1076
|
// src/components/UniformPlayground.tsx
|
|
1058
1077
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
1059
1078
|
var import_navigation2 = require("next/navigation");
|
|
1060
|
-
var
|
|
1079
|
+
var import_react12 = __toESM(require("react"));
|
|
1061
1080
|
var UniformPlayground = async ({ searchParams, ...rest }) => {
|
|
1062
1081
|
if (!isDraftModeEnabled({ searchParams })) {
|
|
1063
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("h1", null, "Playground is only available in draft mode"));
|
|
1064
1083
|
}
|
|
1065
1084
|
const id = searchParams["id"];
|
|
1066
1085
|
if (!id) {
|
|
@@ -1091,7 +1110,7 @@ var UniformPlayground = async ({ searchParams, ...rest }) => {
|
|
|
1091
1110
|
if (!composition) {
|
|
1092
1111
|
(0, import_navigation2.notFound)();
|
|
1093
1112
|
}
|
|
1094
|
-
return /* @__PURE__ */
|
|
1113
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
1095
1114
|
UniformComposition,
|
|
1096
1115
|
{
|
|
1097
1116
|
mode: "server",
|
package/dist/index.mjs
CHANGED
|
@@ -209,7 +209,8 @@ var getCanvasClient = (options) => {
|
|
|
209
209
|
"x-bypass-cache": typeof options.cache.bypassCache !== "undefined" ? options.cache.bypassCache.toString() : "false"
|
|
210
210
|
},
|
|
211
211
|
next: {
|
|
212
|
-
revalidate
|
|
212
|
+
revalidate,
|
|
213
|
+
tags: tags.length ? tags : void 0
|
|
213
214
|
}
|
|
214
215
|
});
|
|
215
216
|
}
|
|
@@ -412,6 +413,7 @@ import {
|
|
|
412
413
|
CANVAS_ENRICHMENT_TAG_PARAM,
|
|
413
414
|
CANVAS_PERSONALIZE_TYPE,
|
|
414
415
|
CANVAS_TEST_TYPE,
|
|
416
|
+
CANVAS_VIZ_CONTROL_PARAM,
|
|
415
417
|
isComponentPlaceholderId,
|
|
416
418
|
walkNodeTree
|
|
417
419
|
} from "@uniformdev/canvas";
|
|
@@ -684,6 +686,13 @@ var TestServer = async (props) => {
|
|
|
684
686
|
return createElement2(Fragment2, void 0, [component, eventElement]);
|
|
685
687
|
};
|
|
686
688
|
|
|
689
|
+
// src/components/VisibilityRulesWrapper.tsx
|
|
690
|
+
import { VisibilityRulesWrapperClient } from "@uniformdev/canvas-next-rsc-client";
|
|
691
|
+
import React6 from "react";
|
|
692
|
+
var VisibilityRulesWrapper = (props) => {
|
|
693
|
+
return /* @__PURE__ */ React6.createElement(VisibilityRulesWrapperClient, { ...props });
|
|
694
|
+
};
|
|
695
|
+
|
|
687
696
|
// src/components/UniformComposition.ts
|
|
688
697
|
var UniformComposition = async ({
|
|
689
698
|
resolveComponent,
|
|
@@ -872,7 +881,7 @@ var resolveComponents = ({
|
|
|
872
881
|
parent = target.parent;
|
|
873
882
|
}
|
|
874
883
|
const resolved = components.map((component, componentIndex) => {
|
|
875
|
-
var _a, _b;
|
|
884
|
+
var _a, _b, _c;
|
|
876
885
|
const isServer = isServerComponent({
|
|
877
886
|
component,
|
|
878
887
|
serverContext
|
|
@@ -903,6 +912,7 @@ var resolveComponents = ({
|
|
|
903
912
|
const wrapInSuspense = systemSuspense || componentSuspense;
|
|
904
913
|
const parameters = (_a = component.parameters) != null ? _a : {};
|
|
905
914
|
const enrichmentTags = (_b = parameters[CANVAS_ENRICHMENT_TAG_PARAM]) == null ? void 0 : _b.value;
|
|
915
|
+
const visibilityRules = (_c = parameters[CANVAS_VIZ_CONTROL_PARAM]) == null ? void 0 : _c.value;
|
|
906
916
|
const key = `${slotName}-${componentIndex}-component`;
|
|
907
917
|
const componentProps = {
|
|
908
918
|
...Object.keys(parameters).reduce((acc, cur) => {
|
|
@@ -986,6 +996,16 @@ var resolveComponents = ({
|
|
|
986
996
|
}
|
|
987
997
|
childNode = elements;
|
|
988
998
|
}
|
|
999
|
+
if (visibilityRules) {
|
|
1000
|
+
childNode = createElement3(
|
|
1001
|
+
VisibilityRulesWrapper,
|
|
1002
|
+
{
|
|
1003
|
+
key: `${slotName}-${componentIndex}-visibility`,
|
|
1004
|
+
parameter: visibilityRules
|
|
1005
|
+
},
|
|
1006
|
+
childNode
|
|
1007
|
+
);
|
|
1008
|
+
}
|
|
989
1009
|
return createElement3(
|
|
990
1010
|
Fragment3,
|
|
991
1011
|
{
|
|
@@ -1003,7 +1023,7 @@ import {
|
|
|
1003
1023
|
UniformScript
|
|
1004
1024
|
} from "@uniformdev/canvas-next-rsc-client";
|
|
1005
1025
|
import { Suspense as Suspense2 } from "react";
|
|
1006
|
-
import
|
|
1026
|
+
import React7 from "react";
|
|
1007
1027
|
var UniformContext = async ({
|
|
1008
1028
|
clientContextComponent,
|
|
1009
1029
|
children
|
|
@@ -1016,23 +1036,23 @@ var UniformContext = async ({
|
|
|
1016
1036
|
const serverConfig = getServerConfig();
|
|
1017
1037
|
const disableDevTools = ((_a = serverConfig.context) == null ? void 0 : _a.disableDevTools) || false;
|
|
1018
1038
|
const defaultConsent = serverConfig.defaultConsent || false;
|
|
1019
|
-
return /* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, children, /* @__PURE__ */ React7.createElement(
|
|
1020
1040
|
ContextComponent,
|
|
1021
1041
|
{
|
|
1022
1042
|
manifest,
|
|
1023
1043
|
disableDevTools,
|
|
1024
1044
|
defaultConsent
|
|
1025
1045
|
}
|
|
1026
|
-
), /* @__PURE__ */
|
|
1046
|
+
), /* @__PURE__ */ React7.createElement(Suspense2, { fallback: /* @__PURE__ */ React7.createElement(React7.Fragment, null) }, /* @__PURE__ */ React7.createElement(UniformScript, null)));
|
|
1027
1047
|
};
|
|
1028
1048
|
|
|
1029
1049
|
// src/components/UniformPlayground.tsx
|
|
1030
1050
|
import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE3, CANVAS_EDITOR_STATE as CANVAS_EDITOR_STATE3 } from "@uniformdev/canvas";
|
|
1031
1051
|
import { notFound as notFound2 } from "next/navigation";
|
|
1032
|
-
import
|
|
1052
|
+
import React8 from "react";
|
|
1033
1053
|
var UniformPlayground = async ({ searchParams, ...rest }) => {
|
|
1034
1054
|
if (!isDraftModeEnabled({ searchParams })) {
|
|
1035
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ React8.createElement("div", null, /* @__PURE__ */ React8.createElement("h1", null, "Playground is only available in draft mode"));
|
|
1036
1056
|
}
|
|
1037
1057
|
const id = searchParams["id"];
|
|
1038
1058
|
if (!id) {
|
|
@@ -1063,7 +1083,7 @@ var UniformPlayground = async ({ searchParams, ...rest }) => {
|
|
|
1063
1083
|
if (!composition) {
|
|
1064
1084
|
notFound2();
|
|
1065
1085
|
}
|
|
1066
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1067
1087
|
UniformComposition,
|
|
1068
1088
|
{
|
|
1069
1089
|
mode: "server",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.175.1-alpha.35+f2ac62967d",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
"react-dom": "18.2.0"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@uniformdev/canvas": "19.
|
|
65
|
-
"@uniformdev/canvas-next-rsc-client": "^19.
|
|
66
|
-
"@uniformdev/canvas-next-rsc-shared": "^19.
|
|
67
|
-
"@uniformdev/canvas-react": "19.
|
|
68
|
-
"@uniformdev/context": "19.
|
|
69
|
-
"@uniformdev/project-map": "19.
|
|
70
|
-
"@uniformdev/redirect": "19.
|
|
71
|
-
"@uniformdev/richtext": "19.
|
|
72
|
-
"@uniformdev/webhooks": "19.
|
|
64
|
+
"@uniformdev/canvas": "19.175.1-alpha.35+f2ac62967d",
|
|
65
|
+
"@uniformdev/canvas-next-rsc-client": "^19.175.1-alpha.35+f2ac62967d",
|
|
66
|
+
"@uniformdev/canvas-next-rsc-shared": "^19.175.1-alpha.35+f2ac62967d",
|
|
67
|
+
"@uniformdev/canvas-react": "19.175.1-alpha.35+f2ac62967d",
|
|
68
|
+
"@uniformdev/context": "19.175.1-alpha.35+f2ac62967d",
|
|
69
|
+
"@uniformdev/project-map": "19.175.1-alpha.35+f2ac62967d",
|
|
70
|
+
"@uniformdev/redirect": "19.175.1-alpha.35+f2ac62967d",
|
|
71
|
+
"@uniformdev/richtext": "19.175.1-alpha.35+f2ac62967d",
|
|
72
|
+
"@uniformdev/webhooks": "19.175.1-alpha.35+f2ac62967d",
|
|
73
73
|
"@vercel/edge-config": "^0.4.0",
|
|
74
74
|
"encoding": "^0.1.13",
|
|
75
75
|
"server-only": "^0.0.1",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "f2ac62967d4046285a3cf007cf90fd2889510262"
|
|
90
90
|
}
|