@uniformdev/canvas-next-rsc 20.37.0 → 20.37.1-alpha.11

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 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
- return `path:${actualPath}`.toLowerCase();
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
- return `path:${actualPath}`.toLowerCase();
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.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
- return `path:${actualPath}`.toLowerCase();
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 = (props) => {
632
- return /* @__PURE__ */ React3.createElement(
633
- PersonalizeClient,
634
- {
635
- component: props.component,
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 = (props) => {
682
- const { indexes } = runPersonalization2(props);
683
- return /* @__PURE__ */ React5.createElement(
684
- PersonalizeClient2,
685
- {
686
- component: props.component,
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
@@ -829,6 +824,11 @@ var UniformComposition = async ({
829
824
  },
830
825
  {}
831
826
  ),
827
+ compositionMetadata: {
828
+ compositionId: route.compositionApiResponse.composition._id,
829
+ matchedRoute: route.matchedRoute,
830
+ dynamicInputs: route.dynamicInputs
831
+ },
832
832
  quirks: {
833
833
  "vc-country": headersValue.get("x-vercel-ip-country") || missingQuirkValue,
834
834
  "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
- return `path:${actualPath}`.toLowerCase();
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 = (props) => {
660
- return /* @__PURE__ */ import_react3.default.createElement(
661
- import_canvas_next_rsc_client3.PersonalizeClient,
662
- {
663
- component: props.component,
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 = (props) => {
710
- const { indexes } = (0, import_canvas_next_rsc_shared4.runPersonalization)(props);
711
- return /* @__PURE__ */ import_react6.default.createElement(
712
- import_canvas_next_rsc_client5.PersonalizeClient,
713
- {
714
- component: props.component,
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
@@ -852,6 +847,11 @@ var UniformComposition = async ({
852
847
  },
853
848
  {}
854
849
  ),
850
+ compositionMetadata: {
851
+ compositionId: route.compositionApiResponse.composition._id,
852
+ matchedRoute: route.matchedRoute,
853
+ dynamicInputs: route.dynamicInputs
854
+ },
855
855
  quirks: {
856
856
  "vc-country": headersValue.get("x-vercel-ip-country") || missingQuirkValue,
857
857
  "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
- return `path:${actualPath}`.toLowerCase();
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 = (props) => {
632
- return /* @__PURE__ */ React3.createElement(
633
- PersonalizeClient,
634
- {
635
- component: props.component,
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 = (props) => {
682
- const { indexes } = runPersonalization2(props);
683
- return /* @__PURE__ */ React5.createElement(
684
- PersonalizeClient2,
685
- {
686
- component: props.component,
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
@@ -829,6 +824,11 @@ var UniformComposition = async ({
829
824
  },
830
825
  {}
831
826
  ),
827
+ compositionMetadata: {
828
+ compositionId: route.compositionApiResponse.composition._id,
829
+ matchedRoute: route.matchedRoute,
830
+ dynamicInputs: route.dynamicInputs
831
+ },
832
832
  quirks: {
833
833
  "vc-country": headersValue.get("x-vercel-ip-country") || missingQuirkValue,
834
834
  "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.37.0",
3
+ "version": "20.37.1-alpha.11+f4e46464b5",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -61,15 +61,15 @@
61
61
  "react-dom": "18.3.1"
62
62
  },
63
63
  "dependencies": {
64
- "@uniformdev/canvas": "20.37.0",
65
- "@uniformdev/canvas-next-rsc-client": "^20.37.0",
66
- "@uniformdev/canvas-next-rsc-shared": "^20.37.0",
67
- "@uniformdev/canvas-react": "20.37.0",
68
- "@uniformdev/context": "20.37.0",
69
- "@uniformdev/project-map": "20.37.0",
70
- "@uniformdev/redirect": "20.37.0",
71
- "@uniformdev/richtext": "20.37.0",
72
- "@uniformdev/webhooks": "20.37.0",
64
+ "@uniformdev/canvas": "20.37.1-alpha.11+f4e46464b5",
65
+ "@uniformdev/canvas-next-rsc-client": "^20.37.1-alpha.11+f4e46464b5",
66
+ "@uniformdev/canvas-next-rsc-shared": "^20.37.1-alpha.11+f4e46464b5",
67
+ "@uniformdev/canvas-react": "20.37.1-alpha.11+f4e46464b5",
68
+ "@uniformdev/context": "20.37.1-alpha.11+f4e46464b5",
69
+ "@uniformdev/project-map": "20.37.1-alpha.11+f4e46464b5",
70
+ "@uniformdev/redirect": "20.37.1-alpha.11+f4e46464b5",
71
+ "@uniformdev/richtext": "20.37.1-alpha.11+f4e46464b5",
72
+ "@uniformdev/webhooks": "20.37.1-alpha.11+f4e46464b5",
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": "4b42aec368d447a0b0ebc619451abdd5df413365"
89
+ "gitHead": "f4e46464b5578eadab4feec5dcb102446067e053"
90
90
  }