@univerjs/core 1.0.3 → 1.0.4

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/lib/cjs/index.js CHANGED
@@ -1699,7 +1699,7 @@ let ThemeColors = /* @__PURE__ */ function(ThemeColors) {
1699
1699
  //#endregion
1700
1700
  //#region package.json
1701
1701
  var name = "@univerjs/core";
1702
- var version = "1.0.3";
1702
+ var version = "1.0.4";
1703
1703
 
1704
1704
  //#endregion
1705
1705
  //#region src/common/array.ts
@@ -25836,17 +25836,22 @@ let LocalUndoRedoService = class LocalUndoRedoService extends Disposable {
25836
25836
  let unitID = "";
25837
25837
  const isFocusSheet = this._contextService.getContextValue(FOCUSING_SHEET);
25838
25838
  const isFocusFormulaEditor = this._contextService.getContextValue(FOCUSING_FX_BAR_EDITOR);
25839
+ const isFocusShapeEditor = this._contextService.getContextValue(FOCUSING_SHAPE_TEXT_EDITOR);
25839
25840
  const isFocusEditor = this._contextService.getContextValue(EDITOR_ACTIVATED);
25841
+ if (isFocusEditor && isFocusShapeEditor) {
25842
+ var _this$_univerInstance;
25843
+ return ((_this$_univerInstance = this._univerInstanceService.getCurrentUnitOfType(_univerjs_protocol.UniverType.UNIVER_DOC)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getUnitId()) ?? "";
25844
+ }
25840
25845
  if (isFocusSheet) {
25841
25846
  if (isFocusFormulaEditor && isFocusEditor) unitID = DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY;
25842
25847
  else if (isFocusEditor) unitID = DOCS_NORMAL_EDITOR_UNIT_ID_KEY;
25843
25848
  else {
25844
- var _this$_univerInstance;
25845
- unitID = ((_this$_univerInstance = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getUnitId()) ?? "";
25849
+ var _this$_univerInstance2;
25850
+ unitID = ((_this$_univerInstance2 = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance2 === void 0 ? void 0 : _this$_univerInstance2.getUnitId()) ?? "";
25846
25851
  }
25847
25852
  } else {
25848
- var _this$_univerInstance2;
25849
- unitID = ((_this$_univerInstance2 = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance2 === void 0 ? void 0 : _this$_univerInstance2.getUnitId()) ?? "";
25853
+ var _this$_univerInstance3;
25854
+ unitID = ((_this$_univerInstance3 = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance3 === void 0 ? void 0 : _this$_univerInstance3.getUnitId()) ?? "";
25850
25855
  }
25851
25856
  return unitID;
25852
25857
  }
package/lib/es/index.js CHANGED
@@ -1670,7 +1670,7 @@ let ThemeColors = /* @__PURE__ */ function(ThemeColors) {
1670
1670
  //#endregion
1671
1671
  //#region package.json
1672
1672
  var name = "@univerjs/core";
1673
- var version = "1.0.3";
1673
+ var version = "1.0.4";
1674
1674
 
1675
1675
  //#endregion
1676
1676
  //#region src/common/array.ts
@@ -25807,17 +25807,22 @@ let LocalUndoRedoService = class LocalUndoRedoService extends Disposable {
25807
25807
  let unitID = "";
25808
25808
  const isFocusSheet = this._contextService.getContextValue(FOCUSING_SHEET);
25809
25809
  const isFocusFormulaEditor = this._contextService.getContextValue(FOCUSING_FX_BAR_EDITOR);
25810
+ const isFocusShapeEditor = this._contextService.getContextValue(FOCUSING_SHAPE_TEXT_EDITOR);
25810
25811
  const isFocusEditor = this._contextService.getContextValue(EDITOR_ACTIVATED);
25812
+ if (isFocusEditor && isFocusShapeEditor) {
25813
+ var _this$_univerInstance;
25814
+ return ((_this$_univerInstance = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getUnitId()) ?? "";
25815
+ }
25811
25816
  if (isFocusSheet) {
25812
25817
  if (isFocusFormulaEditor && isFocusEditor) unitID = DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY;
25813
25818
  else if (isFocusEditor) unitID = DOCS_NORMAL_EDITOR_UNIT_ID_KEY;
25814
25819
  else {
25815
- var _this$_univerInstance;
25816
- unitID = ((_this$_univerInstance = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getUnitId()) ?? "";
25820
+ var _this$_univerInstance2;
25821
+ unitID = ((_this$_univerInstance2 = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance2 === void 0 ? void 0 : _this$_univerInstance2.getUnitId()) ?? "";
25817
25822
  }
25818
25823
  } else {
25819
- var _this$_univerInstance2;
25820
- unitID = ((_this$_univerInstance2 = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance2 === void 0 ? void 0 : _this$_univerInstance2.getUnitId()) ?? "";
25824
+ var _this$_univerInstance3;
25825
+ unitID = ((_this$_univerInstance3 = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance3 === void 0 ? void 0 : _this$_univerInstance3.getUnitId()) ?? "";
25821
25826
  }
25822
25827
  return unitID;
25823
25828
  }
package/lib/index.js CHANGED
@@ -1670,7 +1670,7 @@ let ThemeColors = /* @__PURE__ */ function(ThemeColors) {
1670
1670
  //#endregion
1671
1671
  //#region package.json
1672
1672
  var name = "@univerjs/core";
1673
- var version = "1.0.3";
1673
+ var version = "1.0.4";
1674
1674
 
1675
1675
  //#endregion
1676
1676
  //#region src/common/array.ts
@@ -25807,17 +25807,22 @@ let LocalUndoRedoService = class LocalUndoRedoService extends Disposable {
25807
25807
  let unitID = "";
25808
25808
  const isFocusSheet = this._contextService.getContextValue(FOCUSING_SHEET);
25809
25809
  const isFocusFormulaEditor = this._contextService.getContextValue(FOCUSING_FX_BAR_EDITOR);
25810
+ const isFocusShapeEditor = this._contextService.getContextValue(FOCUSING_SHAPE_TEXT_EDITOR);
25810
25811
  const isFocusEditor = this._contextService.getContextValue(EDITOR_ACTIVATED);
25812
+ if (isFocusEditor && isFocusShapeEditor) {
25813
+ var _this$_univerInstance;
25814
+ return ((_this$_univerInstance = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getUnitId()) ?? "";
25815
+ }
25811
25816
  if (isFocusSheet) {
25812
25817
  if (isFocusFormulaEditor && isFocusEditor) unitID = DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY;
25813
25818
  else if (isFocusEditor) unitID = DOCS_NORMAL_EDITOR_UNIT_ID_KEY;
25814
25819
  else {
25815
- var _this$_univerInstance;
25816
- unitID = ((_this$_univerInstance = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getUnitId()) ?? "";
25820
+ var _this$_univerInstance2;
25821
+ unitID = ((_this$_univerInstance2 = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance2 === void 0 ? void 0 : _this$_univerInstance2.getUnitId()) ?? "";
25817
25822
  }
25818
25823
  } else {
25819
- var _this$_univerInstance2;
25820
- unitID = ((_this$_univerInstance2 = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance2 === void 0 ? void 0 : _this$_univerInstance2.getUnitId()) ?? "";
25824
+ var _this$_univerInstance3;
25825
+ unitID = ((_this$_univerInstance3 = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance3 === void 0 ? void 0 : _this$_univerInstance3.getUnitId()) ?? "";
25821
25826
  }
25822
25827
  return unitID;
25823
25828
  }
@@ -44,9 +44,9 @@ export interface IUndoRedoService {
44
44
  * group to commands or undo redo items.
45
45
  */
46
46
  beginUndoRedoGroup(unitId: string, groupId: string, mode?: 'replace' | 'append'): IDisposable;
47
- /** Pitch the top redo element of the currently focused Univer document instance. */
47
+ /** Read the top undo entry for the focused editor or unit. */
48
48
  pitchTopUndoElement(): Nullable<IUndoRedoItem>;
49
- /** Pitch the top undo element of the currently focused Univer document instance. */
49
+ /** Read the top redo entry for the focused editor or unit. */
50
50
  pitchTopRedoElement(): Nullable<IUndoRedoItem>;
51
51
  popUndoToRedo(): void;
52
52
  popRedoToUndo(): void;