@movable/studio-framework 3.13.1-test-logs-canvas-key.0 → 3.14.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
@@ -2742,20 +2742,25 @@ class StudioFramework {
2742
2742
  propertyPath = '',
2743
2743
  context = {}
2744
2744
  } = operand;
2745
- return this.getPropertyTuple(propertyGroupKey, propertyPath, this.resolveDynamicFieldContext(context));
2745
+ const resolvedContext = await this.resolveDynamicFieldContext(context);
2746
+ return this.getPropertyTuple(propertyGroupKey, propertyPath, resolvedContext);
2746
2747
  }
2747
- /** resolves `context` values that are Dynamic Fields */
2748
+ /** resolves `context` values that are property references (Dynamic Fields, Custom Properties, Data Source Properties, etc.) */
2748
2749
 
2749
2750
 
2750
- resolveDynamicFieldContext(context) {
2751
+ async resolveDynamicFieldContext(context) {
2751
2752
  const resolvedContext = {};
2752
2753
 
2753
2754
  for (const [contextKey, contextValue] of Object.entries(context)) {
2754
- if (isDynamicProperty(contextValue) && contextValue.propertyGroupKey === 'param') {
2755
- const resolvedValue = this.getProperty(contextValue.propertyGroupKey, // "param"
2756
- contextValue.propertyPath // "params.[something]"
2757
- );
2758
- resolvedContext[contextKey] = resolvedValue;
2755
+ if (isDynamicProperty(contextValue)) {
2756
+ const [resolvedValue, error] = await this.getPropertyTuple(contextValue.propertyGroupKey, contextValue.propertyPath, contextValue.context || {});
2757
+
2758
+ if (error) {
2759
+ console.warn(`Failed to resolve ${contextValue.propertyPath}:`, error);
2760
+ resolvedContext[contextKey] = null;
2761
+ } else {
2762
+ resolvedContext[contextKey] = resolvedValue;
2763
+ }
2759
2764
  } else {
2760
2765
  resolvedContext[contextKey] = contextValue;
2761
2766
  }
@@ -3136,10 +3141,6 @@ class StudioFramework {
3136
3141
  }
3137
3142
 
3138
3143
  logCurrentCanvas(currentCanvas) {
3139
- console.log('Current Canvas:', currentCanvas);
3140
- console.log('Canvas Name:', currentCanvas?.name || 'Unnamed Canvas');
3141
- console.log(window.MICapture?.setCanvasKey && window.MICapture);
3142
-
3143
3144
  if (window.MICapture?.setCanvasKey) {
3144
3145
  window.MICapture.setCanvasKey(currentCanvas.name);
3145
3146
  }
package/dist/index.js CHANGED
@@ -2752,20 +2752,25 @@ class StudioFramework {
2752
2752
  propertyPath = '',
2753
2753
  context = {}
2754
2754
  } = operand;
2755
- return this.getPropertyTuple(propertyGroupKey, propertyPath, this.resolveDynamicFieldContext(context));
2755
+ const resolvedContext = await this.resolveDynamicFieldContext(context);
2756
+ return this.getPropertyTuple(propertyGroupKey, propertyPath, resolvedContext);
2756
2757
  }
2757
- /** resolves `context` values that are Dynamic Fields */
2758
+ /** resolves `context` values that are property references (Dynamic Fields, Custom Properties, Data Source Properties, etc.) */
2758
2759
 
2759
2760
 
2760
- resolveDynamicFieldContext(context) {
2761
+ async resolveDynamicFieldContext(context) {
2761
2762
  const resolvedContext = {};
2762
2763
 
2763
2764
  for (const [contextKey, contextValue] of Object.entries(context)) {
2764
- if (isDynamicProperty(contextValue) && contextValue.propertyGroupKey === 'param') {
2765
- const resolvedValue = this.getProperty(contextValue.propertyGroupKey, // "param"
2766
- contextValue.propertyPath // "params.[something]"
2767
- );
2768
- resolvedContext[contextKey] = resolvedValue;
2765
+ if (isDynamicProperty(contextValue)) {
2766
+ const [resolvedValue, error] = await this.getPropertyTuple(contextValue.propertyGroupKey, contextValue.propertyPath, contextValue.context || {});
2767
+
2768
+ if (error) {
2769
+ console.warn(`Failed to resolve ${contextValue.propertyPath}:`, error);
2770
+ resolvedContext[contextKey] = null;
2771
+ } else {
2772
+ resolvedContext[contextKey] = resolvedValue;
2773
+ }
2769
2774
  } else {
2770
2775
  resolvedContext[contextKey] = contextValue;
2771
2776
  }
@@ -3146,10 +3151,6 @@ class StudioFramework {
3146
3151
  }
3147
3152
 
3148
3153
  logCurrentCanvas(currentCanvas) {
3149
- console.log('Current Canvas:', currentCanvas);
3150
- console.log('Canvas Name:', currentCanvas?.name || 'Unnamed Canvas');
3151
- console.log(window.MICapture?.setCanvasKey && window.MICapture);
3152
-
3153
3154
  if (window.MICapture?.setCanvasKey) {
3154
3155
  window.MICapture.setCanvasKey(currentCanvas.name);
3155
3156
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movable/studio-framework",
3
- "version": "3.13.1-test-logs-canvas-key.0",
3
+ "version": "3.14.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.13.1-test-logs-canvas-key.0",
35
- "@movable/studio-framework-test-helpers": "^3.13.1-test-logs-canvas-key.0",
34
+ "@movable/framework-types": "^3.14.0",
35
+ "@movable/studio-framework-test-helpers": "^3.14.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": "27a5804388e702148357418cd7c5218cac6234c0"
69
+ "gitHead": "15063656c0521af765b465548ce3001b363e4163"
70
70
  }