@movable/studio-framework 3.14.2-canary.0 → 3.15.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.es.js CHANGED
@@ -1477,11 +1477,9 @@ class AsyncComputed {
1477
1477
 
1478
1478
  getProperty(...args) {
1479
1479
  const [grouping, path, context = {}] = parseGetPropertyArgs(args);
1480
- console.log(`getProperty called: ${grouping}.${path}`);
1481
1480
  const property = this.getPropertyInstance(grouping, path);
1482
1481
 
1483
1482
  if (!property) {
1484
- console.log(`⚠️ Property not found: ${grouping}.${path}`);
1485
1483
  return null;
1486
1484
  }
1487
1485
 
@@ -1499,22 +1497,7 @@ class AsyncComputed {
1499
1497
  requestEvent = createInertEvent();
1500
1498
  }
1501
1499
 
1502
- const result = property.compute(context, requestEvent);
1503
- console.log(`getProperty result for ${grouping}.${path}:`, result);
1504
- console.log(` - typeof result:`, typeof result);
1505
- console.log(` - is Promise?`, result instanceof Promise);
1506
- console.log(` - is Array?`, Array.isArray(result));
1507
-
1508
- if (result && typeof result === 'object') {
1509
- console.log(` - Object.keys():`, Object.keys(result));
1510
- console.log(` - constructor name:`, result.constructor?.name); // Try to see if it's a primitive wrapper or has a valueOf
1511
-
1512
- if (typeof result.valueOf === 'function') {
1513
- console.log(` - valueOf():`, result.valueOf());
1514
- }
1515
- }
1516
-
1517
- return result;
1500
+ return property.compute(context, requestEvent);
1518
1501
  }
1519
1502
 
1520
1503
  async getPropertyTuple(...args) {
@@ -2750,8 +2733,6 @@ class StudioFramework {
2750
2733
  }
2751
2734
 
2752
2735
  async evaluateOperand(operand) {
2753
- console.log('evaluateOperand');
2754
-
2755
2736
  if ('operator' in operand) {
2756
2737
  return this.resolveCondition(operand);
2757
2738
  }
@@ -2761,44 +2742,30 @@ class StudioFramework {
2761
2742
  propertyPath = '',
2762
2743
  context = {}
2763
2744
  } = operand;
2764
- return this.getPropertyTuple(propertyGroupKey, propertyPath, this.resolveDynamicFieldContext(context));
2745
+ const resolvedContext = await this.resolveDynamicFieldContext(context);
2746
+ return this.getPropertyTuple(propertyGroupKey, propertyPath, resolvedContext);
2765
2747
  }
2766
2748
  /** resolves `context` values that are property references (Dynamic Fields, Custom Properties, Data Source Properties, etc.) */
2767
2749
 
2768
2750
 
2769
- resolveDynamicFieldContext(context) {
2751
+ async resolveDynamicFieldContext(context) {
2770
2752
  const resolvedContext = {};
2771
- console.log('===== resolveDynamicFieldContext START =====');
2772
- console.log('Full context object:', context);
2773
2753
 
2774
2754
  for (const [contextKey, contextValue] of Object.entries(context)) {
2775
- console.log(`\n--- Processing context key: "${contextKey}" ---`);
2776
- console.log('contextValue:', contextValue);
2777
- console.log('contextValue type:', typeof contextValue);
2778
- console.log('contextValue has propertyPath?', contextValue?.propertyPath !== undefined);
2779
- console.log('contextValue.propertyPath value:', contextValue?.propertyPath);
2780
- console.log('contextValue.propertyGroupKey value:', contextValue?.propertyGroupKey);
2781
-
2782
2755
  if (isDynamicProperty(contextValue)) {
2783
- console.log('✓ isDynamicProperty=true - will resolve'); // Debug: check what raw data is available
2756
+ const [resolvedValue, error] = await this.getPropertyTuple(contextValue.propertyGroupKey, contextValue.propertyPath, contextValue.context || {});
2784
2757
 
2785
- if (contextValue.propertyPath?.includes('product_current_price')) {
2786
- console.log('DEBUG: Checking raw data.product_current_price');
2787
- const rawData = this.getProperty('data', 'product_current_price', {});
2788
- console.log(' raw data.product_current_price:', rawData);
2758
+ if (error) {
2759
+ console.warn(`Failed to resolve ${contextValue.propertyPath}:`, error);
2760
+ resolvedContext[contextKey] = null;
2761
+ } else {
2762
+ resolvedContext[contextKey] = resolvedValue;
2789
2763
  }
2790
-
2791
- const resolvedValue = this.getProperty(contextValue.propertyGroupKey, contextValue.propertyPath, contextValue.context || {});
2792
- console.log('resolvedValue:', resolvedValue);
2793
- resolvedContext[contextKey] = resolvedValue;
2794
2764
  } else {
2795
- console.log('✗ isDynamicProperty=false - using as-is');
2796
2765
  resolvedContext[contextKey] = contextValue;
2797
2766
  }
2798
2767
  }
2799
2768
 
2800
- console.log('\n===== resolveDynamicFieldContext END =====');
2801
- console.log('Resolved context:', resolvedContext);
2802
2769
  return resolvedContext;
2803
2770
  }
2804
2771
 
@@ -3187,6 +3154,12 @@ class StudioFramework {
3187
3154
  CD.pause();
3188
3155
  currentCanvas = await this.getCurrentCanvas();
3189
3156
  this.logCurrentCanvas(currentCanvas);
3157
+ const canvasRedirect = currentCanvas?.canvasRedirect;
3158
+
3159
+ if (canvasRedirect) {
3160
+ CD.setImageRedirect(canvasRedirect);
3161
+ }
3162
+
3190
3163
  const clickthroughURL = await this.handleClickthrough(currentCanvas);
3191
3164
  const canvasTags = currentCanvas?.tags || [];
3192
3165
  const tags = await this.getCurrentTags(canvasTags, currentCanvas);
package/dist/index.js CHANGED
@@ -1487,11 +1487,9 @@ class AsyncComputed {
1487
1487
 
1488
1488
  getProperty(...args) {
1489
1489
  const [grouping, path, context = {}] = parseGetPropertyArgs(args);
1490
- console.log(`getProperty called: ${grouping}.${path}`);
1491
1490
  const property = this.getPropertyInstance(grouping, path);
1492
1491
 
1493
1492
  if (!property) {
1494
- console.log(`⚠️ Property not found: ${grouping}.${path}`);
1495
1493
  return null;
1496
1494
  }
1497
1495
 
@@ -1509,22 +1507,7 @@ class AsyncComputed {
1509
1507
  requestEvent = createInertEvent();
1510
1508
  }
1511
1509
 
1512
- const result = property.compute(context, requestEvent);
1513
- console.log(`getProperty result for ${grouping}.${path}:`, result);
1514
- console.log(` - typeof result:`, typeof result);
1515
- console.log(` - is Promise?`, result instanceof Promise);
1516
- console.log(` - is Array?`, Array.isArray(result));
1517
-
1518
- if (result && typeof result === 'object') {
1519
- console.log(` - Object.keys():`, Object.keys(result));
1520
- console.log(` - constructor name:`, result.constructor?.name); // Try to see if it's a primitive wrapper or has a valueOf
1521
-
1522
- if (typeof result.valueOf === 'function') {
1523
- console.log(` - valueOf():`, result.valueOf());
1524
- }
1525
- }
1526
-
1527
- return result;
1510
+ return property.compute(context, requestEvent);
1528
1511
  }
1529
1512
 
1530
1513
  async getPropertyTuple(...args) {
@@ -2760,8 +2743,6 @@ class StudioFramework {
2760
2743
  }
2761
2744
 
2762
2745
  async evaluateOperand(operand) {
2763
- console.log('evaluateOperand');
2764
-
2765
2746
  if ('operator' in operand) {
2766
2747
  return this.resolveCondition(operand);
2767
2748
  }
@@ -2771,44 +2752,30 @@ class StudioFramework {
2771
2752
  propertyPath = '',
2772
2753
  context = {}
2773
2754
  } = operand;
2774
- return this.getPropertyTuple(propertyGroupKey, propertyPath, this.resolveDynamicFieldContext(context));
2755
+ const resolvedContext = await this.resolveDynamicFieldContext(context);
2756
+ return this.getPropertyTuple(propertyGroupKey, propertyPath, resolvedContext);
2775
2757
  }
2776
2758
  /** resolves `context` values that are property references (Dynamic Fields, Custom Properties, Data Source Properties, etc.) */
2777
2759
 
2778
2760
 
2779
- resolveDynamicFieldContext(context) {
2761
+ async resolveDynamicFieldContext(context) {
2780
2762
  const resolvedContext = {};
2781
- console.log('===== resolveDynamicFieldContext START =====');
2782
- console.log('Full context object:', context);
2783
2763
 
2784
2764
  for (const [contextKey, contextValue] of Object.entries(context)) {
2785
- console.log(`\n--- Processing context key: "${contextKey}" ---`);
2786
- console.log('contextValue:', contextValue);
2787
- console.log('contextValue type:', typeof contextValue);
2788
- console.log('contextValue has propertyPath?', contextValue?.propertyPath !== undefined);
2789
- console.log('contextValue.propertyPath value:', contextValue?.propertyPath);
2790
- console.log('contextValue.propertyGroupKey value:', contextValue?.propertyGroupKey);
2791
-
2792
2765
  if (isDynamicProperty(contextValue)) {
2793
- console.log('✓ isDynamicProperty=true - will resolve'); // Debug: check what raw data is available
2766
+ const [resolvedValue, error] = await this.getPropertyTuple(contextValue.propertyGroupKey, contextValue.propertyPath, contextValue.context || {});
2794
2767
 
2795
- if (contextValue.propertyPath?.includes('product_current_price')) {
2796
- console.log('DEBUG: Checking raw data.product_current_price');
2797
- const rawData = this.getProperty('data', 'product_current_price', {});
2798
- console.log(' raw data.product_current_price:', rawData);
2768
+ if (error) {
2769
+ console.warn(`Failed to resolve ${contextValue.propertyPath}:`, error);
2770
+ resolvedContext[contextKey] = null;
2771
+ } else {
2772
+ resolvedContext[contextKey] = resolvedValue;
2799
2773
  }
2800
-
2801
- const resolvedValue = this.getProperty(contextValue.propertyGroupKey, contextValue.propertyPath, contextValue.context || {});
2802
- console.log('resolvedValue:', resolvedValue);
2803
- resolvedContext[contextKey] = resolvedValue;
2804
2774
  } else {
2805
- console.log('✗ isDynamicProperty=false - using as-is');
2806
2775
  resolvedContext[contextKey] = contextValue;
2807
2776
  }
2808
2777
  }
2809
2778
 
2810
- console.log('\n===== resolveDynamicFieldContext END =====');
2811
- console.log('Resolved context:', resolvedContext);
2812
2779
  return resolvedContext;
2813
2780
  }
2814
2781
 
@@ -3197,6 +3164,12 @@ class StudioFramework {
3197
3164
  CD__default['default'].pause();
3198
3165
  currentCanvas = await this.getCurrentCanvas();
3199
3166
  this.logCurrentCanvas(currentCanvas);
3167
+ const canvasRedirect = currentCanvas?.canvasRedirect;
3168
+
3169
+ if (canvasRedirect) {
3170
+ CD__default['default'].setImageRedirect(canvasRedirect);
3171
+ }
3172
+
3200
3173
  const clickthroughURL = await this.handleClickthrough(currentCanvas);
3201
3174
  const canvasTags = currentCanvas?.tags || [];
3202
3175
  const tags = await this.getCurrentTags(canvasTags, currentCanvas);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movable/studio-framework",
3
- "version": "3.14.2-canary.0",
3
+ "version": "3.15.0",
4
4
  "description": "A Component library for reactive Studio apps.",
5
5
  "author": "Movable Ink",
6
6
  "repository": "movableink/studio-framework",
@@ -31,8 +31,8 @@
31
31
  "@babel/preset-react": "^7.14.5",
32
32
  "@babel/preset-typescript": "^7.13.0",
33
33
  "@movable/eslint-config-react": "^1.0.1",
34
- "@movable/framework-types": "^3.14.2-canary.0",
35
- "@movable/studio-framework-test-helpers": "^3.14.2-canary.0",
34
+ "@movable/framework-types": "^3.15.0",
35
+ "@movable/studio-framework-test-helpers": "^3.15.0",
36
36
  "@types/qunit": "^2.11.1",
37
37
  "@types/qunit-dom": "^0.7.0",
38
38
  "@types/react": "^17.0.6",
@@ -66,5 +66,5 @@
66
66
  "volta": {
67
67
  "extends": "../../package.json"
68
68
  },
69
- "gitHead": "51719a4a64a8cb54a2428568c0257cc3ee266719"
69
+ "gitHead": "b4a816a2ca3ccce5c241c99d88a5eda5020eeb0d"
70
70
  }