@uniformdev/canvas-next-rsc-shared 20.26.0 → 20.26.1
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/index.esm.js +6 -14
- package/dist/index.js +4 -12
- package/dist/index.mjs +6 -14
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -171,7 +171,7 @@ var AppDirectoryContextInstance = class {
|
|
|
171
171
|
_context = new WeakMap();
|
|
172
172
|
|
|
173
173
|
// src/runPersonalization.ts
|
|
174
|
-
import {
|
|
174
|
+
import { CANVAS_PERSONALIZE_SLOT, mapSlotToPersonalizedVariations } from "@uniformdev/canvas";
|
|
175
175
|
var runPersonalization = ({
|
|
176
176
|
component,
|
|
177
177
|
trackingEventName,
|
|
@@ -181,13 +181,9 @@ var runPersonalization = ({
|
|
|
181
181
|
}) => {
|
|
182
182
|
var _a;
|
|
183
183
|
const slot = ((_a = component.slots) == null ? void 0 : _a[CANVAS_PERSONALIZE_SLOT]) || [];
|
|
184
|
-
const componentVariations = slot.map((v, i) => {
|
|
185
|
-
var _a2, _b;
|
|
186
|
-
const contextTag = (_b = (_a2 = v.parameters) == null ? void 0 : _a2[CANVAS_PERSONALIZATION_PARAM]) == null ? void 0 : _b.value;
|
|
187
|
-
const id = v._id || `pz-${i}-${v.type}`;
|
|
184
|
+
const componentVariations = mapSlotToPersonalizedVariations(slot).map((v, i) => {
|
|
188
185
|
return {
|
|
189
|
-
|
|
190
|
-
pz: contextTag,
|
|
186
|
+
...v,
|
|
191
187
|
index: i
|
|
192
188
|
};
|
|
193
189
|
});
|
|
@@ -232,7 +228,7 @@ var runPersonalization = ({
|
|
|
232
228
|
};
|
|
233
229
|
|
|
234
230
|
// src/runTest.ts
|
|
235
|
-
import { CANVAS_TEST_SLOT,
|
|
231
|
+
import { CANVAS_TEST_SLOT, mapSlotToTestVariations } from "@uniformdev/canvas";
|
|
236
232
|
import { CONTEXTUAL_EDITING_TEST_NAME } from "@uniformdev/context";
|
|
237
233
|
var runTest = ({
|
|
238
234
|
test,
|
|
@@ -252,13 +248,9 @@ var runTest = ({
|
|
|
252
248
|
};
|
|
253
249
|
}
|
|
254
250
|
const slot = ((_b = component.slots) == null ? void 0 : _b[CANVAS_TEST_SLOT]) || [];
|
|
255
|
-
const componentVariations = slot.map((v, i) => {
|
|
256
|
-
var _a2, _b2, _c;
|
|
257
|
-
const contextTag = (_b2 = (_a2 = v.parameters) == null ? void 0 : _a2[CANVAS_TEST_VARIANT_PARAM]) == null ? void 0 : _b2.value;
|
|
258
|
-
const id = (_c = contextTag == null ? void 0 : contextTag.id) != null ? _c : "testId" in v ? v.testId : `ab-${i}-${v.type}`;
|
|
251
|
+
const componentVariations = mapSlotToTestVariations(slot).map((v, i) => {
|
|
259
252
|
return {
|
|
260
|
-
|
|
261
|
-
testDistribution: contextTag == null ? void 0 : contextTag.testDistribution,
|
|
253
|
+
...v,
|
|
262
254
|
index: i
|
|
263
255
|
};
|
|
264
256
|
});
|
package/dist/index.js
CHANGED
|
@@ -208,13 +208,9 @@ var runPersonalization = ({
|
|
|
208
208
|
}) => {
|
|
209
209
|
var _a;
|
|
210
210
|
const slot = ((_a = component.slots) == null ? void 0 : _a[import_canvas.CANVAS_PERSONALIZE_SLOT]) || [];
|
|
211
|
-
const componentVariations = slot.map((v, i) => {
|
|
212
|
-
var _a2, _b;
|
|
213
|
-
const contextTag = (_b = (_a2 = v.parameters) == null ? void 0 : _a2[import_canvas.CANVAS_PERSONALIZATION_PARAM]) == null ? void 0 : _b.value;
|
|
214
|
-
const id = v._id || `pz-${i}-${v.type}`;
|
|
211
|
+
const componentVariations = (0, import_canvas.mapSlotToPersonalizedVariations)(slot).map((v, i) => {
|
|
215
212
|
return {
|
|
216
|
-
|
|
217
|
-
pz: contextTag,
|
|
213
|
+
...v,
|
|
218
214
|
index: i
|
|
219
215
|
};
|
|
220
216
|
});
|
|
@@ -279,13 +275,9 @@ var runTest = ({
|
|
|
279
275
|
};
|
|
280
276
|
}
|
|
281
277
|
const slot = ((_b = component.slots) == null ? void 0 : _b[import_canvas2.CANVAS_TEST_SLOT]) || [];
|
|
282
|
-
const componentVariations = slot.map((v, i) => {
|
|
283
|
-
var _a2, _b2, _c;
|
|
284
|
-
const contextTag = (_b2 = (_a2 = v.parameters) == null ? void 0 : _a2[import_canvas2.CANVAS_TEST_VARIANT_PARAM]) == null ? void 0 : _b2.value;
|
|
285
|
-
const id = (_c = contextTag == null ? void 0 : contextTag.id) != null ? _c : "testId" in v ? v.testId : `ab-${i}-${v.type}`;
|
|
278
|
+
const componentVariations = (0, import_canvas2.mapSlotToTestVariations)(slot).map((v, i) => {
|
|
286
279
|
return {
|
|
287
|
-
|
|
288
|
-
testDistribution: contextTag == null ? void 0 : contextTag.testDistribution,
|
|
280
|
+
...v,
|
|
289
281
|
index: i
|
|
290
282
|
};
|
|
291
283
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -171,7 +171,7 @@ var AppDirectoryContextInstance = class {
|
|
|
171
171
|
_context = new WeakMap();
|
|
172
172
|
|
|
173
173
|
// src/runPersonalization.ts
|
|
174
|
-
import {
|
|
174
|
+
import { CANVAS_PERSONALIZE_SLOT, mapSlotToPersonalizedVariations } from "@uniformdev/canvas";
|
|
175
175
|
var runPersonalization = ({
|
|
176
176
|
component,
|
|
177
177
|
trackingEventName,
|
|
@@ -181,13 +181,9 @@ var runPersonalization = ({
|
|
|
181
181
|
}) => {
|
|
182
182
|
var _a;
|
|
183
183
|
const slot = ((_a = component.slots) == null ? void 0 : _a[CANVAS_PERSONALIZE_SLOT]) || [];
|
|
184
|
-
const componentVariations = slot.map((v, i) => {
|
|
185
|
-
var _a2, _b;
|
|
186
|
-
const contextTag = (_b = (_a2 = v.parameters) == null ? void 0 : _a2[CANVAS_PERSONALIZATION_PARAM]) == null ? void 0 : _b.value;
|
|
187
|
-
const id = v._id || `pz-${i}-${v.type}`;
|
|
184
|
+
const componentVariations = mapSlotToPersonalizedVariations(slot).map((v, i) => {
|
|
188
185
|
return {
|
|
189
|
-
|
|
190
|
-
pz: contextTag,
|
|
186
|
+
...v,
|
|
191
187
|
index: i
|
|
192
188
|
};
|
|
193
189
|
});
|
|
@@ -232,7 +228,7 @@ var runPersonalization = ({
|
|
|
232
228
|
};
|
|
233
229
|
|
|
234
230
|
// src/runTest.ts
|
|
235
|
-
import { CANVAS_TEST_SLOT,
|
|
231
|
+
import { CANVAS_TEST_SLOT, mapSlotToTestVariations } from "@uniformdev/canvas";
|
|
236
232
|
import { CONTEXTUAL_EDITING_TEST_NAME } from "@uniformdev/context";
|
|
237
233
|
var runTest = ({
|
|
238
234
|
test,
|
|
@@ -252,13 +248,9 @@ var runTest = ({
|
|
|
252
248
|
};
|
|
253
249
|
}
|
|
254
250
|
const slot = ((_b = component.slots) == null ? void 0 : _b[CANVAS_TEST_SLOT]) || [];
|
|
255
|
-
const componentVariations = slot.map((v, i) => {
|
|
256
|
-
var _a2, _b2, _c;
|
|
257
|
-
const contextTag = (_b2 = (_a2 = v.parameters) == null ? void 0 : _a2[CANVAS_TEST_VARIANT_PARAM]) == null ? void 0 : _b2.value;
|
|
258
|
-
const id = (_c = contextTag == null ? void 0 : contextTag.id) != null ? _c : "testId" in v ? v.testId : `ab-${i}-${v.type}`;
|
|
251
|
+
const componentVariations = mapSlotToTestVariations(slot).map((v, i) => {
|
|
259
252
|
return {
|
|
260
|
-
|
|
261
|
-
testDistribution: contextTag == null ? void 0 : contextTag.testDistribution,
|
|
253
|
+
...v,
|
|
262
254
|
index: i
|
|
263
255
|
};
|
|
264
256
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc-shared",
|
|
3
|
-
"version": "20.26.
|
|
3
|
+
"version": "20.26.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"react-dom": "18.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@uniformdev/canvas": "20.26.
|
|
36
|
-
"@uniformdev/context": "20.26.
|
|
35
|
+
"@uniformdev/canvas": "20.26.1",
|
|
36
|
+
"@uniformdev/context": "20.26.1"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "c4bd481585fa23aa034abf0a0b002bce25a36fd6"
|
|
50
50
|
}
|