ocp-viewer-core 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ocp-viewer-core",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Shared viewer policy for ocp_vscode, ocp_viewer, Jupyter CadQuery and build123d Studio",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/page.js CHANGED
@@ -455,7 +455,7 @@ export function createPage({
455
455
  }
456
456
  // One dispatch for every key, shared with every other host, so
457
457
  // that a setter cannot exist in one client and not another.
458
- applyConfig(viewer, data.config, {
458
+ const applied = applyConfig(viewer, data.config, {
459
459
  // Only the host knows the other two dimensions, so a
460
460
  // viewport key is a resize rather than a setter.
461
461
  resize: (key, value) => {
@@ -475,6 +475,15 @@ export function createPage({
475
475
  debugLog(`ui: no setter for '${key}'`);
476
476
  }
477
477
  });
478
+ // The viewer changed; _config follows, for exactly the applied
479
+ // keys. Without this the two disagree, and resize() - a window
480
+ // resize, a splitter drag, Studio's pane observer on every Run -
481
+ // re-derives geometry from the value the ui call just replaced:
482
+ // set_viewer_config(glass=False) held until the next resize
483
+ // snapped glass back on. Same family: tools, treeWidth, theme.
484
+ for (const key of applied) {
485
+ _config[key] = data.config[key];
486
+ }
478
487
  } else if (data.type === "animation") {
479
488
  // Explode goes off first: both transform the same objects,
480
489
  // and animating an already-displaced model is wrong.
package/src/version.js CHANGED
@@ -24,4 +24,4 @@
24
24
  limitations under the License.
25
25
  */
26
26
 
27
- export const VERSION = "1.0.2";
27
+ export const VERSION = "1.0.3";