@onehat/ui 0.3.140 → 0.3.142

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": "@onehat/ui",
3
- "version": "0.3.140",
3
+ "version": "0.3.142",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -412,20 +412,20 @@ export default function withSecondaryEditor(WrappedComponent, isTree = false) {
412
412
  };
413
413
 
414
414
  useEffect(() => {
415
- // When selection changes, set the mode appropriately
415
+ // When secondarySelection changes, set the mode appropriately
416
416
  let mode;
417
417
  if (secondaryIsIgnoreNextSelectionChange) {
418
- // on selection change from onAdd/onDuplicate/etc, calculate whether to put Editor in "add" or "edit" mode
418
+ // on secondarySelection change from onAdd/onDuplicate/etc, calculate whether to put Editor in "add" or "edit" mode
419
419
  mode = calculateEditorMode();
420
420
  } else {
421
- // Most of the time, if selection changed, put the Editor in "view" mode
421
+ // Most of the time, if secondarySelection changed, put the Editor in "view" mode
422
422
  mode = EDITOR_MODE__VIEW;
423
423
  }
424
- setEditorMode(mode);
424
+ secondarySetEditorMode(mode);
425
425
 
426
426
  setSecondaryIsIgnoreNextSelectionChange(false);
427
- setLastSelection(selection);
428
- }, [selection]);
427
+ setLastSelection(secondarySelection);
428
+ }, [secondarySelection]);
429
429
 
430
430
  if (self) {
431
431
  self.secondaryAdd = secondaryOnAdd;
@@ -438,13 +438,13 @@ export default function withSecondaryEditor(WrappedComponent, isTree = false) {
438
438
  secondaryNewEntityDisplayValueRef.current = secondaryNewEntityDisplayValue;
439
439
 
440
440
  if (secondaryLastSelection !== secondarySelection) {
441
- // NOTE: If I don't calculate this on the fly for selection changes,
441
+ // NOTE: If I don't calculate this on the fly for secondarySelection changes,
442
442
  // we see a flash of the previous state, since useEffect hasn't yet run.
443
443
  // (basically redo what's in the useEffect, above)
444
444
  if (secondaryIsIgnoreNextSelectionChange) {
445
- editorMode = calculateEditorMode();
445
+ secondaryEditorMode = calculateEditorMode();
446
446
  } else {
447
- editorMode = EDITOR_MODE__VIEW;
447
+ secondaryEditorMode = EDITOR_MODE__VIEW;
448
448
  }
449
449
  }
450
450