@uniformdev/canvas-next-rsc-shared 19.201.1 → 19.202.0

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.d.mts CHANGED
@@ -212,7 +212,7 @@ type TestProps = {
212
212
  test: string;
213
213
  };
214
214
 
215
- declare const runTest: ({ test, component, contextInstance, }: ComponentProps<TestProps> & {
215
+ declare const runTest: ({ test, component, contextInstance, context, }: ComponentProps<TestProps> & {
216
216
  contextInstance: Pick<ContextInstance, "test" | "manifest"> | undefined;
217
217
  }) => {
218
218
  index: number | null;
package/dist/index.d.ts CHANGED
@@ -212,7 +212,7 @@ type TestProps = {
212
212
  test: string;
213
213
  };
214
214
 
215
- declare const runTest: ({ test, component, contextInstance, }: ComponentProps<TestProps> & {
215
+ declare const runTest: ({ test, component, contextInstance, context, }: ComponentProps<TestProps> & {
216
216
  contextInstance: Pick<ContextInstance, "test" | "manifest"> | undefined;
217
217
  }) => {
218
218
  index: number | null;
package/dist/index.esm.js CHANGED
@@ -244,14 +244,18 @@ var runPersonalization = ({
244
244
 
245
245
  // src/runTest.ts
246
246
  import { CANVAS_TEST_SLOT, CANVAS_TEST_VARIANT_PARAM } from "@uniformdev/canvas";
247
+ import { CONTEXTUAL_EDITING_TEST_NAME } from "@uniformdev/context";
247
248
  var runTest = ({
248
249
  test,
249
250
  component,
250
- contextInstance
251
+ contextInstance,
252
+ context
251
253
  }) => {
252
254
  var _a, _b;
253
255
  const isTestDefined = Boolean((_a = contextInstance == null ? void 0 : contextInstance.manifest.data.project.test) == null ? void 0 : _a[test]);
254
- if (!isTestDefined && process.env.NODE_ENV !== "production") {
256
+ const isContextualTest = context.isContextualEditing && test === CONTEXTUAL_EDITING_TEST_NAME;
257
+ const shouldShowTest = isTestDefined || isContextualTest;
258
+ if (!shouldShowTest && process.env.NODE_ENV !== "production") {
255
259
  console.warn(`Test "${test}" is not defined in Uniform manifest.`);
256
260
  return {
257
261
  index: null,
package/dist/index.js CHANGED
@@ -271,14 +271,18 @@ var runPersonalization = ({
271
271
 
272
272
  // src/runTest.ts
273
273
  var import_canvas2 = require("@uniformdev/canvas");
274
+ var import_context2 = require("@uniformdev/context");
274
275
  var runTest = ({
275
276
  test,
276
277
  component,
277
- contextInstance
278
+ contextInstance,
279
+ context
278
280
  }) => {
279
281
  var _a, _b;
280
282
  const isTestDefined = Boolean((_a = contextInstance == null ? void 0 : contextInstance.manifest.data.project.test) == null ? void 0 : _a[test]);
281
- if (!isTestDefined && process.env.NODE_ENV !== "production") {
283
+ const isContextualTest = context.isContextualEditing && test === import_context2.CONTEXTUAL_EDITING_TEST_NAME;
284
+ const shouldShowTest = isTestDefined || isContextualTest;
285
+ if (!shouldShowTest && process.env.NODE_ENV !== "production") {
282
286
  console.warn(`Test "${test}" is not defined in Uniform manifest.`);
283
287
  return {
284
288
  index: null,
package/dist/index.mjs CHANGED
@@ -244,14 +244,18 @@ var runPersonalization = ({
244
244
 
245
245
  // src/runTest.ts
246
246
  import { CANVAS_TEST_SLOT, CANVAS_TEST_VARIANT_PARAM } from "@uniformdev/canvas";
247
+ import { CONTEXTUAL_EDITING_TEST_NAME } from "@uniformdev/context";
247
248
  var runTest = ({
248
249
  test,
249
250
  component,
250
- contextInstance
251
+ contextInstance,
252
+ context
251
253
  }) => {
252
254
  var _a, _b;
253
255
  const isTestDefined = Boolean((_a = contextInstance == null ? void 0 : contextInstance.manifest.data.project.test) == null ? void 0 : _a[test]);
254
- if (!isTestDefined && process.env.NODE_ENV !== "production") {
256
+ const isContextualTest = context.isContextualEditing && test === CONTEXTUAL_EDITING_TEST_NAME;
257
+ const shouldShowTest = isTestDefined || isContextualTest;
258
+ if (!shouldShowTest && process.env.NODE_ENV !== "production") {
255
259
  console.warn(`Test "${test}" is not defined in Uniform manifest.`);
256
260
  return {
257
261
  index: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next-rsc-shared",
3
- "version": "19.201.1",
3
+ "version": "19.202.0",
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": "19.201.1",
36
- "@uniformdev/context": "19.201.1"
35
+ "@uniformdev/canvas": "19.202.0",
36
+ "@uniformdev/context": "19.202.0"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=16.14.0"
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "2e20dee3fc5ce005f6d73eddf939cc89cbad83de"
49
+ "gitHead": "133a9ea4d2d3794e2d05ad8277f6bb3803d109d7"
50
50
  }