@uniformdev/canvas-next-rsc 20.35.0 → 20.35.1-alpha.210
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-D_HC6rSo.d.mts → UniformComposition-CfpHU4f0.d.mts} +2 -4
- package/dist/{UniformComposition-D_HC6rSo.d.ts → UniformComposition-CfpHU4f0.d.ts} +2 -4
- package/dist/component.d.mts +3 -3
- package/dist/component.d.ts +3 -3
- package/dist/handler.js +10 -1
- package/dist/handler.mjs +10 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +31 -29
- package/dist/index.js +31 -29
- package/dist/index.mjs +31 -29
- package/package.json +14 -14
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResolvedRouteGetResponse, ComponentInstance } from '@uniformdev/canvas';
|
|
2
2
|
import { PageParameters, ComponentProps, CompositionContext, AppDirectoryServerContext } from '@uniformdev/canvas-next-rsc-shared';
|
|
3
|
-
import React, { ComponentType
|
|
3
|
+
import React, { ComponentType } from 'react';
|
|
4
4
|
|
|
5
5
|
type UniformStaticCompositionProps = {
|
|
6
6
|
/**
|
|
@@ -56,9 +56,7 @@ type ResolveEmptyPlaceholderResult = {
|
|
|
56
56
|
declare const resolveComposition: (props: Omit<ResolveComponentsOptions, "slotName" | "slotIndex" | "target"> & {
|
|
57
57
|
composition: ComponentInstance;
|
|
58
58
|
compositionContext: CompositionContext;
|
|
59
|
-
}) => React.FunctionComponentElement<
|
|
60
|
-
children?: ReactNode | undefined;
|
|
61
|
-
}> | null;
|
|
59
|
+
}) => React.FunctionComponentElement<React.FragmentProps> | null;
|
|
62
60
|
type ResolveComponentsOptions = {
|
|
63
61
|
serverContext?: AppDirectoryServerContext;
|
|
64
62
|
target: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResolvedRouteGetResponse, ComponentInstance } from '@uniformdev/canvas';
|
|
2
2
|
import { PageParameters, ComponentProps, CompositionContext, AppDirectoryServerContext } from '@uniformdev/canvas-next-rsc-shared';
|
|
3
|
-
import React, { ComponentType
|
|
3
|
+
import React, { ComponentType } from 'react';
|
|
4
4
|
|
|
5
5
|
type UniformStaticCompositionProps = {
|
|
6
6
|
/**
|
|
@@ -56,9 +56,7 @@ type ResolveEmptyPlaceholderResult = {
|
|
|
56
56
|
declare const resolveComposition: (props: Omit<ResolveComponentsOptions, "slotName" | "slotIndex" | "target"> & {
|
|
57
57
|
composition: ComponentInstance;
|
|
58
58
|
compositionContext: CompositionContext;
|
|
59
|
-
}) => React.FunctionComponentElement<
|
|
60
|
-
children?: ReactNode | undefined;
|
|
61
|
-
}> | null;
|
|
59
|
+
}) => React.FunctionComponentElement<React.FragmentProps> | null;
|
|
62
60
|
type ResolveComponentsOptions = {
|
|
63
61
|
serverContext?: AppDirectoryServerContext;
|
|
64
62
|
target: {
|
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
|
-
import React, { PropsWithChildren, ReactNode, Key
|
|
4
|
-
export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-
|
|
3
|
+
import React, { PropsWithChildren, ReactNode, Key } from 'react';
|
|
4
|
+
export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-CfpHU4f0.mjs';
|
|
5
5
|
import { ComponentInstance } from '@uniformdev/canvas';
|
|
6
6
|
import { RichTextNode } from '@uniformdev/richtext';
|
|
7
7
|
import { PureUniformTextProps } from '@uniformdev/canvas-react/core';
|
|
@@ -88,7 +88,7 @@ type CustomSlotChildRenderFunc = (options: {
|
|
|
88
88
|
key: Key;
|
|
89
89
|
slotName: string;
|
|
90
90
|
slotIndex: number;
|
|
91
|
-
}) =>
|
|
91
|
+
}) => ReactNode;
|
|
92
92
|
type UniformSlotProps = {
|
|
93
93
|
data: ComponentInstance;
|
|
94
94
|
context: CompositionContext;
|
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
|
-
import React, { PropsWithChildren, ReactNode, Key
|
|
4
|
-
export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-
|
|
3
|
+
import React, { PropsWithChildren, ReactNode, Key } from 'react';
|
|
4
|
+
export { R as ResolveComponentFunction, a as ResolveComponentResult } from './UniformComposition-CfpHU4f0.js';
|
|
5
5
|
import { ComponentInstance } from '@uniformdev/canvas';
|
|
6
6
|
import { RichTextNode } from '@uniformdev/richtext';
|
|
7
7
|
import { PureUniformTextProps } from '@uniformdev/canvas-react/core';
|
|
@@ -88,7 +88,7 @@ type CustomSlotChildRenderFunc = (options: {
|
|
|
88
88
|
key: Key;
|
|
89
89
|
slotName: string;
|
|
90
90
|
slotIndex: number;
|
|
91
|
-
}) =>
|
|
91
|
+
}) => ReactNode;
|
|
92
92
|
type UniformSlotProps = {
|
|
93
93
|
data: ComponentInstance;
|
|
94
94
|
context: CompositionContext;
|
package/dist/handler.js
CHANGED
|
@@ -204,9 +204,18 @@ var env = {
|
|
|
204
204
|
};
|
|
205
205
|
|
|
206
206
|
// src/utils/tag.ts
|
|
207
|
+
var encodePathForTag = (path) => {
|
|
208
|
+
return path.split("/").map((segment) => {
|
|
209
|
+
if (/[^\x00-\x7F]/.test(segment)) {
|
|
210
|
+
return encodeURIComponent(segment);
|
|
211
|
+
}
|
|
212
|
+
return segment;
|
|
213
|
+
}).join("/");
|
|
214
|
+
};
|
|
207
215
|
var buildPathTag = (path) => {
|
|
208
216
|
const actualPath = path.startsWith("/") ? path : `/${path}`;
|
|
209
|
-
|
|
217
|
+
const encodedPath = encodePathForTag(actualPath);
|
|
218
|
+
return `path:${encodedPath}`.toLowerCase();
|
|
210
219
|
};
|
|
211
220
|
var buildCompositionTag = (compositionId) => {
|
|
212
221
|
return `composition:${compositionId}`.toLowerCase();
|
package/dist/handler.mjs
CHANGED
|
@@ -171,9 +171,18 @@ var env = {
|
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
// src/utils/tag.ts
|
|
174
|
+
var encodePathForTag = (path) => {
|
|
175
|
+
return path.split("/").map((segment) => {
|
|
176
|
+
if (/[^\x00-\x7F]/.test(segment)) {
|
|
177
|
+
return encodeURIComponent(segment);
|
|
178
|
+
}
|
|
179
|
+
return segment;
|
|
180
|
+
}).join("/");
|
|
181
|
+
};
|
|
174
182
|
var buildPathTag = (path) => {
|
|
175
183
|
const actualPath = path.startsWith("/") ? path : `/${path}`;
|
|
176
|
-
|
|
184
|
+
const encodedPath = encodePathForTag(actualPath);
|
|
185
|
+
return `path:${encodedPath}`.toLowerCase();
|
|
177
186
|
};
|
|
178
187
|
var buildCompositionTag = (compositionId) => {
|
|
179
188
|
return `composition:${compositionId}`.toLowerCase();
|
package/dist/index.d.mts
CHANGED
|
@@ -5,8 +5,8 @@ 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-CfpHU4f0.mjs';
|
|
9
|
+
export { b as UniformComposition, r as resolveComposition } from './UniformComposition-CfpHU4f0.mjs';
|
|
10
10
|
import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
|
|
11
11
|
|
|
12
12
|
type GetCanvasClientOptions = {
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ 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-CfpHU4f0.js';
|
|
9
|
+
export { b as UniformComposition, r as resolveComposition } from './UniformComposition-CfpHU4f0.js';
|
|
10
10
|
import { ClientContextComponent } from '@uniformdev/canvas-next-rsc-client';
|
|
11
11
|
|
|
12
12
|
type GetCanvasClientOptions = {
|
package/dist/index.esm.js
CHANGED
|
@@ -150,9 +150,18 @@ var env = {
|
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
// src/utils/tag.ts
|
|
153
|
+
var encodePathForTag = (path) => {
|
|
154
|
+
return path.split("/").map((segment) => {
|
|
155
|
+
if (/[^\x00-\x7F]/.test(segment)) {
|
|
156
|
+
return encodeURIComponent(segment);
|
|
157
|
+
}
|
|
158
|
+
return segment;
|
|
159
|
+
}).join("/");
|
|
160
|
+
};
|
|
153
161
|
var buildPathTag = (path) => {
|
|
154
162
|
const actualPath = path.startsWith("/") ? path : `/${path}`;
|
|
155
|
-
|
|
163
|
+
const encodedPath = encodePathForTag(actualPath);
|
|
164
|
+
return `path:${encodedPath}`.toLowerCase();
|
|
156
165
|
};
|
|
157
166
|
var buildCompositionTag = (compositionId) => {
|
|
158
167
|
return `composition:${compositionId}`.toLowerCase();
|
|
@@ -628,18 +637,11 @@ var ContextUpdateTrigger = ({ path }) => {
|
|
|
628
637
|
// src/components/PersonalizeClientWrapper.tsx
|
|
629
638
|
import { PersonalizeClient } from "@uniformdev/canvas-next-rsc-client";
|
|
630
639
|
import React3 from "react";
|
|
631
|
-
var PersonalizeClientWrapper = (
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
count: props.count,
|
|
637
|
-
slots: props.slots,
|
|
638
|
-
trackingEventName: props.trackingEventName,
|
|
639
|
-
algorithm: props.algorithm,
|
|
640
|
-
indexes: []
|
|
641
|
-
}
|
|
642
|
-
);
|
|
640
|
+
var PersonalizeClientWrapper = ({
|
|
641
|
+
contextInstance,
|
|
642
|
+
...props
|
|
643
|
+
}) => {
|
|
644
|
+
return /* @__PURE__ */ React3.createElement(PersonalizeClient, { ...props, indexes: [] });
|
|
643
645
|
};
|
|
644
646
|
|
|
645
647
|
// src/components/PersonalizeServer.ts
|
|
@@ -678,19 +680,12 @@ var PersonalizeServer = (props) => {
|
|
|
678
680
|
import { PersonalizeClient as PersonalizeClient2 } from "@uniformdev/canvas-next-rsc-client";
|
|
679
681
|
import { runPersonalization as runPersonalization2 } from "@uniformdev/canvas-next-rsc-shared";
|
|
680
682
|
import React5 from "react";
|
|
681
|
-
var PersonalizeServerHybrid = (
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
count: props.count,
|
|
688
|
-
slots: props.slots,
|
|
689
|
-
trackingEventName: props.trackingEventName,
|
|
690
|
-
algorithm: props.algorithm,
|
|
691
|
-
indexes
|
|
692
|
-
}
|
|
693
|
-
);
|
|
683
|
+
var PersonalizeServerHybrid = ({
|
|
684
|
+
contextInstance,
|
|
685
|
+
...props
|
|
686
|
+
}) => {
|
|
687
|
+
const { indexes } = runPersonalization2({ ...props, contextInstance });
|
|
688
|
+
return /* @__PURE__ */ React5.createElement(PersonalizeClient2, { ...props, indexes });
|
|
694
689
|
};
|
|
695
690
|
|
|
696
691
|
// src/components/TestServer.ts
|
|
@@ -753,6 +748,7 @@ var UniformComposition = async ({
|
|
|
753
748
|
route,
|
|
754
749
|
...props
|
|
755
750
|
}) => {
|
|
751
|
+
var _a;
|
|
756
752
|
let searchParams;
|
|
757
753
|
let serverContext = void 0;
|
|
758
754
|
if (props.mode === "static") {
|
|
@@ -777,10 +773,10 @@ var UniformComposition = async ({
|
|
|
777
773
|
const state = route.compositionApiResponse.state;
|
|
778
774
|
if (state === CANVAS_DRAFT_STATE2 || state === CANVAS_EDITOR_STATE2) {
|
|
779
775
|
walkNodeTree(route.compositionApiResponse.composition, (node) => {
|
|
780
|
-
var
|
|
776
|
+
var _a2, _b;
|
|
781
777
|
if (node.type === "component" && node.node.parameters) {
|
|
782
778
|
const contextualEditing = node.node.parameters[CANVAS_CONTEXTUAL_EDITING_PARAM];
|
|
783
|
-
const editableFields = (_b = (
|
|
779
|
+
const editableFields = (_b = (_a2 = contextualEditing == null ? void 0 : contextualEditing.value) == null ? void 0 : _a2.editableParameters) != null ? _b : [];
|
|
784
780
|
Object.keys(node.node.parameters).forEach((key) => {
|
|
785
781
|
const parameter = node.node.parameters[key];
|
|
786
782
|
if (parameter.type === "text") {
|
|
@@ -797,7 +793,8 @@ var UniformComposition = async ({
|
|
|
797
793
|
composition: route.compositionApiResponse.composition,
|
|
798
794
|
matchedRoute: route.matchedRoute,
|
|
799
795
|
searchParams,
|
|
800
|
-
|
|
796
|
+
// provide default non-undefined values to avoid serialization issues
|
|
797
|
+
dynamicInputs: (_a = route.dynamicInputs) != null ? _a : {},
|
|
801
798
|
type: "composition",
|
|
802
799
|
isContextualEditing: isIncontextEditingEnabled({ searchParams }),
|
|
803
800
|
isDraftMode: await isDraftModeEnabled({ searchParams }),
|
|
@@ -829,6 +826,11 @@ var UniformComposition = async ({
|
|
|
829
826
|
},
|
|
830
827
|
{}
|
|
831
828
|
),
|
|
829
|
+
compositionMetadata: {
|
|
830
|
+
compositionId: route.compositionApiResponse.composition._id,
|
|
831
|
+
matchedRoute: route.matchedRoute,
|
|
832
|
+
dynamicInputs: route.dynamicInputs
|
|
833
|
+
},
|
|
832
834
|
quirks: {
|
|
833
835
|
"vc-country": headersValue.get("x-vercel-ip-country") || missingQuirkValue,
|
|
834
836
|
"vc-region": headersValue.get("x-vercel-ip-country-region") || missingQuirkValue,
|
package/dist/index.js
CHANGED
|
@@ -203,9 +203,18 @@ var env = {
|
|
|
203
203
|
};
|
|
204
204
|
|
|
205
205
|
// src/utils/tag.ts
|
|
206
|
+
var encodePathForTag = (path) => {
|
|
207
|
+
return path.split("/").map((segment) => {
|
|
208
|
+
if (/[^\x00-\x7F]/.test(segment)) {
|
|
209
|
+
return encodeURIComponent(segment);
|
|
210
|
+
}
|
|
211
|
+
return segment;
|
|
212
|
+
}).join("/");
|
|
213
|
+
};
|
|
206
214
|
var buildPathTag = (path) => {
|
|
207
215
|
const actualPath = path.startsWith("/") ? path : `/${path}`;
|
|
208
|
-
|
|
216
|
+
const encodedPath = encodePathForTag(actualPath);
|
|
217
|
+
return `path:${encodedPath}`.toLowerCase();
|
|
209
218
|
};
|
|
210
219
|
var buildCompositionTag = (compositionId) => {
|
|
211
220
|
return `composition:${compositionId}`.toLowerCase();
|
|
@@ -656,18 +665,11 @@ var ContextUpdateTrigger = ({ path }) => {
|
|
|
656
665
|
// src/components/PersonalizeClientWrapper.tsx
|
|
657
666
|
var import_canvas_next_rsc_client3 = require("@uniformdev/canvas-next-rsc-client");
|
|
658
667
|
var import_react3 = __toESM(require("react"));
|
|
659
|
-
var PersonalizeClientWrapper = (
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
count: props.count,
|
|
665
|
-
slots: props.slots,
|
|
666
|
-
trackingEventName: props.trackingEventName,
|
|
667
|
-
algorithm: props.algorithm,
|
|
668
|
-
indexes: []
|
|
669
|
-
}
|
|
670
|
-
);
|
|
668
|
+
var PersonalizeClientWrapper = ({
|
|
669
|
+
contextInstance,
|
|
670
|
+
...props
|
|
671
|
+
}) => {
|
|
672
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_canvas_next_rsc_client3.PersonalizeClient, { ...props, indexes: [] });
|
|
671
673
|
};
|
|
672
674
|
|
|
673
675
|
// src/components/PersonalizeServer.ts
|
|
@@ -706,19 +708,12 @@ var PersonalizeServer = (props) => {
|
|
|
706
708
|
var import_canvas_next_rsc_client5 = require("@uniformdev/canvas-next-rsc-client");
|
|
707
709
|
var import_canvas_next_rsc_shared4 = require("@uniformdev/canvas-next-rsc-shared");
|
|
708
710
|
var import_react6 = __toESM(require("react"));
|
|
709
|
-
var PersonalizeServerHybrid = (
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
count: props.count,
|
|
716
|
-
slots: props.slots,
|
|
717
|
-
trackingEventName: props.trackingEventName,
|
|
718
|
-
algorithm: props.algorithm,
|
|
719
|
-
indexes
|
|
720
|
-
}
|
|
721
|
-
);
|
|
711
|
+
var PersonalizeServerHybrid = ({
|
|
712
|
+
contextInstance,
|
|
713
|
+
...props
|
|
714
|
+
}) => {
|
|
715
|
+
const { indexes } = (0, import_canvas_next_rsc_shared4.runPersonalization)({ ...props, contextInstance });
|
|
716
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_canvas_next_rsc_client5.PersonalizeClient, { ...props, indexes });
|
|
722
717
|
};
|
|
723
718
|
|
|
724
719
|
// src/components/TestServer.ts
|
|
@@ -776,6 +771,7 @@ var UniformComposition = async ({
|
|
|
776
771
|
route,
|
|
777
772
|
...props
|
|
778
773
|
}) => {
|
|
774
|
+
var _a;
|
|
779
775
|
let searchParams;
|
|
780
776
|
let serverContext = void 0;
|
|
781
777
|
if (props.mode === "static") {
|
|
@@ -800,10 +796,10 @@ var UniformComposition = async ({
|
|
|
800
796
|
const state = route.compositionApiResponse.state;
|
|
801
797
|
if (state === import_canvas8.CANVAS_DRAFT_STATE || state === import_canvas8.CANVAS_EDITOR_STATE) {
|
|
802
798
|
(0, import_canvas8.walkNodeTree)(route.compositionApiResponse.composition, (node) => {
|
|
803
|
-
var
|
|
799
|
+
var _a2, _b;
|
|
804
800
|
if (node.type === "component" && node.node.parameters) {
|
|
805
801
|
const contextualEditing = node.node.parameters[import_canvas8.CANVAS_CONTEXTUAL_EDITING_PARAM];
|
|
806
|
-
const editableFields = (_b = (
|
|
802
|
+
const editableFields = (_b = (_a2 = contextualEditing == null ? void 0 : contextualEditing.value) == null ? void 0 : _a2.editableParameters) != null ? _b : [];
|
|
807
803
|
Object.keys(node.node.parameters).forEach((key) => {
|
|
808
804
|
const parameter = node.node.parameters[key];
|
|
809
805
|
if (parameter.type === "text") {
|
|
@@ -820,7 +816,8 @@ var UniformComposition = async ({
|
|
|
820
816
|
composition: route.compositionApiResponse.composition,
|
|
821
817
|
matchedRoute: route.matchedRoute,
|
|
822
818
|
searchParams,
|
|
823
|
-
|
|
819
|
+
// provide default non-undefined values to avoid serialization issues
|
|
820
|
+
dynamicInputs: (_a = route.dynamicInputs) != null ? _a : {},
|
|
824
821
|
type: "composition",
|
|
825
822
|
isContextualEditing: isIncontextEditingEnabled({ searchParams }),
|
|
826
823
|
isDraftMode: await isDraftModeEnabled({ searchParams }),
|
|
@@ -852,6 +849,11 @@ var UniformComposition = async ({
|
|
|
852
849
|
},
|
|
853
850
|
{}
|
|
854
851
|
),
|
|
852
|
+
compositionMetadata: {
|
|
853
|
+
compositionId: route.compositionApiResponse.composition._id,
|
|
854
|
+
matchedRoute: route.matchedRoute,
|
|
855
|
+
dynamicInputs: route.dynamicInputs
|
|
856
|
+
},
|
|
855
857
|
quirks: {
|
|
856
858
|
"vc-country": headersValue.get("x-vercel-ip-country") || missingQuirkValue,
|
|
857
859
|
"vc-region": headersValue.get("x-vercel-ip-country-region") || missingQuirkValue,
|
package/dist/index.mjs
CHANGED
|
@@ -150,9 +150,18 @@ var env = {
|
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
// src/utils/tag.ts
|
|
153
|
+
var encodePathForTag = (path) => {
|
|
154
|
+
return path.split("/").map((segment) => {
|
|
155
|
+
if (/[^\x00-\x7F]/.test(segment)) {
|
|
156
|
+
return encodeURIComponent(segment);
|
|
157
|
+
}
|
|
158
|
+
return segment;
|
|
159
|
+
}).join("/");
|
|
160
|
+
};
|
|
153
161
|
var buildPathTag = (path) => {
|
|
154
162
|
const actualPath = path.startsWith("/") ? path : `/${path}`;
|
|
155
|
-
|
|
163
|
+
const encodedPath = encodePathForTag(actualPath);
|
|
164
|
+
return `path:${encodedPath}`.toLowerCase();
|
|
156
165
|
};
|
|
157
166
|
var buildCompositionTag = (compositionId) => {
|
|
158
167
|
return `composition:${compositionId}`.toLowerCase();
|
|
@@ -628,18 +637,11 @@ var ContextUpdateTrigger = ({ path }) => {
|
|
|
628
637
|
// src/components/PersonalizeClientWrapper.tsx
|
|
629
638
|
import { PersonalizeClient } from "@uniformdev/canvas-next-rsc-client";
|
|
630
639
|
import React3 from "react";
|
|
631
|
-
var PersonalizeClientWrapper = (
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
count: props.count,
|
|
637
|
-
slots: props.slots,
|
|
638
|
-
trackingEventName: props.trackingEventName,
|
|
639
|
-
algorithm: props.algorithm,
|
|
640
|
-
indexes: []
|
|
641
|
-
}
|
|
642
|
-
);
|
|
640
|
+
var PersonalizeClientWrapper = ({
|
|
641
|
+
contextInstance,
|
|
642
|
+
...props
|
|
643
|
+
}) => {
|
|
644
|
+
return /* @__PURE__ */ React3.createElement(PersonalizeClient, { ...props, indexes: [] });
|
|
643
645
|
};
|
|
644
646
|
|
|
645
647
|
// src/components/PersonalizeServer.ts
|
|
@@ -678,19 +680,12 @@ var PersonalizeServer = (props) => {
|
|
|
678
680
|
import { PersonalizeClient as PersonalizeClient2 } from "@uniformdev/canvas-next-rsc-client";
|
|
679
681
|
import { runPersonalization as runPersonalization2 } from "@uniformdev/canvas-next-rsc-shared";
|
|
680
682
|
import React5 from "react";
|
|
681
|
-
var PersonalizeServerHybrid = (
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
count: props.count,
|
|
688
|
-
slots: props.slots,
|
|
689
|
-
trackingEventName: props.trackingEventName,
|
|
690
|
-
algorithm: props.algorithm,
|
|
691
|
-
indexes
|
|
692
|
-
}
|
|
693
|
-
);
|
|
683
|
+
var PersonalizeServerHybrid = ({
|
|
684
|
+
contextInstance,
|
|
685
|
+
...props
|
|
686
|
+
}) => {
|
|
687
|
+
const { indexes } = runPersonalization2({ ...props, contextInstance });
|
|
688
|
+
return /* @__PURE__ */ React5.createElement(PersonalizeClient2, { ...props, indexes });
|
|
694
689
|
};
|
|
695
690
|
|
|
696
691
|
// src/components/TestServer.ts
|
|
@@ -753,6 +748,7 @@ var UniformComposition = async ({
|
|
|
753
748
|
route,
|
|
754
749
|
...props
|
|
755
750
|
}) => {
|
|
751
|
+
var _a;
|
|
756
752
|
let searchParams;
|
|
757
753
|
let serverContext = void 0;
|
|
758
754
|
if (props.mode === "static") {
|
|
@@ -777,10 +773,10 @@ var UniformComposition = async ({
|
|
|
777
773
|
const state = route.compositionApiResponse.state;
|
|
778
774
|
if (state === CANVAS_DRAFT_STATE2 || state === CANVAS_EDITOR_STATE2) {
|
|
779
775
|
walkNodeTree(route.compositionApiResponse.composition, (node) => {
|
|
780
|
-
var
|
|
776
|
+
var _a2, _b;
|
|
781
777
|
if (node.type === "component" && node.node.parameters) {
|
|
782
778
|
const contextualEditing = node.node.parameters[CANVAS_CONTEXTUAL_EDITING_PARAM];
|
|
783
|
-
const editableFields = (_b = (
|
|
779
|
+
const editableFields = (_b = (_a2 = contextualEditing == null ? void 0 : contextualEditing.value) == null ? void 0 : _a2.editableParameters) != null ? _b : [];
|
|
784
780
|
Object.keys(node.node.parameters).forEach((key) => {
|
|
785
781
|
const parameter = node.node.parameters[key];
|
|
786
782
|
if (parameter.type === "text") {
|
|
@@ -797,7 +793,8 @@ var UniformComposition = async ({
|
|
|
797
793
|
composition: route.compositionApiResponse.composition,
|
|
798
794
|
matchedRoute: route.matchedRoute,
|
|
799
795
|
searchParams,
|
|
800
|
-
|
|
796
|
+
// provide default non-undefined values to avoid serialization issues
|
|
797
|
+
dynamicInputs: (_a = route.dynamicInputs) != null ? _a : {},
|
|
801
798
|
type: "composition",
|
|
802
799
|
isContextualEditing: isIncontextEditingEnabled({ searchParams }),
|
|
803
800
|
isDraftMode: await isDraftModeEnabled({ searchParams }),
|
|
@@ -829,6 +826,11 @@ var UniformComposition = async ({
|
|
|
829
826
|
},
|
|
830
827
|
{}
|
|
831
828
|
),
|
|
829
|
+
compositionMetadata: {
|
|
830
|
+
compositionId: route.compositionApiResponse.composition._id,
|
|
831
|
+
matchedRoute: route.matchedRoute,
|
|
832
|
+
dynamicInputs: route.dynamicInputs
|
|
833
|
+
},
|
|
832
834
|
quirks: {
|
|
833
835
|
"vc-country": headersValue.get("x-vercel-ip-country") || missingQuirkValue,
|
|
834
836
|
"vc-region": headersValue.get("x-vercel-ip-country-region") || missingQuirkValue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc",
|
|
3
|
-
"version": "20.35.
|
|
3
|
+
"version": "20.35.1-alpha.210+4fa236da76",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -55,21 +55,21 @@
|
|
|
55
55
|
],
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/node": "24.3.1",
|
|
58
|
-
"@types/react": "
|
|
58
|
+
"@types/react": "19.2.2",
|
|
59
59
|
"next": "15.2.5",
|
|
60
|
-
"react": "
|
|
61
|
-
"react-dom": "
|
|
60
|
+
"react": "19.2.1",
|
|
61
|
+
"react-dom": "19.2.1"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@uniformdev/canvas": "20.35.
|
|
65
|
-
"@uniformdev/canvas-next-rsc-client": "^20.35.
|
|
66
|
-
"@uniformdev/canvas-next-rsc-shared": "^20.35.
|
|
67
|
-
"@uniformdev/canvas-react": "20.35.
|
|
68
|
-
"@uniformdev/context": "20.35.
|
|
69
|
-
"@uniformdev/project-map": "20.35.
|
|
70
|
-
"@uniformdev/redirect": "20.35.
|
|
71
|
-
"@uniformdev/richtext": "20.35.
|
|
72
|
-
"@uniformdev/webhooks": "20.35.
|
|
64
|
+
"@uniformdev/canvas": "20.35.1-alpha.210+4fa236da76",
|
|
65
|
+
"@uniformdev/canvas-next-rsc-client": "^20.35.1-alpha.210+4fa236da76",
|
|
66
|
+
"@uniformdev/canvas-next-rsc-shared": "^20.35.1-alpha.210+4fa236da76",
|
|
67
|
+
"@uniformdev/canvas-react": "20.35.1-alpha.210+4fa236da76",
|
|
68
|
+
"@uniformdev/context": "20.35.1-alpha.210+4fa236da76",
|
|
69
|
+
"@uniformdev/project-map": "20.35.1-alpha.210+4fa236da76",
|
|
70
|
+
"@uniformdev/redirect": "20.35.1-alpha.210+4fa236da76",
|
|
71
|
+
"@uniformdev/richtext": "20.35.1-alpha.210+4fa236da76",
|
|
72
|
+
"@uniformdev/webhooks": "20.35.1-alpha.210+4fa236da76",
|
|
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": "4fa236da76e057582eae6c2595a2fa763fda886a"
|
|
90
90
|
}
|