@univerjs/sheets 0.12.1 → 0.12.2-nightly.202511241159

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/es/facade.js CHANGED
@@ -1,10 +1,10 @@
1
1
  var Dt = Object.defineProperty;
2
2
  var Mt = (s, e, t) => e in s ? Dt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
3
  var _ = (s, e, t) => Mt(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { Inject as l, Injector as p, ICommandService as S, IPermissionService as K, IAuthzIoService as ee, LocaleService as wt, generateRandomId as St, Rectangle as B, cellToRange as Wt, HorizontalAlign as L, VerticalAlign as z, RANGE_TYPE as f, ILogService as Ct, Direction as ne, BooleanNumber as C, WrapStrategy as ae, ObjectMatrix as ke, covertCellValue as Ee, TextStyleValue as Ke, RichTextValue as F, DEFAULT_STYLES as Je, covertCellValues as qe, Dimension as H, isNullCell as J, mergeWorksheetSnapshotWithDefault as Ye, Tools as Ze, UndoCommand as Nt, RedoCommand as jt, toDisposable as kt, UniverInstanceType as T, IResourceLoaderService as Ot, IUniverInstanceService as Ue, CanceledError as y } from "@univerjs/core";
5
- import { FBase as Be, FBaseInitialable as Fe, FUniver as bt, FEnum as Tt, FEventName as Vt } from "@univerjs/core/facade";
6
- import { WorksheetProtectionRuleModel as It, RangeProtectionRuleModel as te, WorksheetProtectionPointModel as He, SetDefinedNameCommand as xe, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as X, RemoveDefinedNameCommand as At, WorkbookPermissionService as Bt, PermissionPointsDefinitions as Ft, WorkbookEditablePermission as $e, UnitObject as W, AddWorksheetProtectionMutation as Ht, DeleteWorksheetProtectionMutation as $t, getAllWorksheetPermissionPoint as Lt, getAllWorksheetPermissionPointByPointPanel as Qe, SetWorksheetPermissionPointsMutation as zt, AddRangeProtectionMutation as Le, DeleteRangeProtectionMutation as Se, SetRangeProtectionMutation as De, WorksheetEditPermission as ft, WorksheetViewPermission as vt, getPrimaryForRange as he, SetSelectionsOperation as ze, getNextPrimaryCell as Gt, WorkbookCopySheetPermission as Kt, WorkbookDeleteColumnPermission as Jt, WorkbookDeleteRowPermission as qt, WorkbookInsertColumnPermission as Yt, WorkbookInsertRowPermission as Zt, WorkbookCreateProtectPermission as Qt, WorkbookRecoverHistoryPermission as Xt, WorkbookHistoryPermission as en, WorkbookViewHistoryPermission as tn, WorkbookHideSheetPermission as nn, WorkbookMoveSheetPermission as sn, WorkbookRenameSheetPermission as rn, WorkbookDeleteSheetPermission as on, WorkbookCreateSheetPermission as an, WorkbookManageCollaboratorPermission as hn, WorkbookCommentPermission as cn, WorkbookDuplicatePermission as dn, WorkbookCopyPermission as un, WorkbookSharePermission as ln, WorkbookExportPermission as mn, WorkbookPrintPermission as gn, WorkbookViewPermission as _n, WorksheetSelectUnProtectedCellsPermission as wn, WorksheetSelectProtectedCellsPermission as Sn, WorksheetDeleteProtectionPermission as Cn, WorksheetManageCollaboratorPermission as kn, WorksheetEditExtraObjectPermission as bn, WorksheetInsertHyperlinkPermission as In, WorksheetPivotTablePermission as fn, WorksheetFilterPermission as vn, WorksheetSortPermission as pn, WorksheetDeleteColumnPermission as Rn, WorksheetDeleteRowPermission as Pn, WorksheetInsertColumnPermission as yn, WorksheetInsertRowPermission as En, WorksheetSetColumnStylePermission as Un, WorksheetSetRowStylePermission as xn, WorksheetSetCellStylePermission as Dn, WorksheetSetCellValuePermission as Mn, WorksheetCopyPermission as Wn, RangeProtectionPermissionDeleteProtectionPoint as Nn, RangeProtectionPermissionManageCollaPoint as jn, RangeProtectionPermissionViewPoint as On, RangeProtectionPermissionEditPoint as Tn, ViewStateEnum as V, EditStateEnum as A, SheetsSelectionsService as pt, SetWorksheetDefaultStyleMutation as Vn, SetColDataCommand as Xe, SetRowDataCommand as et, copyRangeStyles as se, InsertRowByRangeCommand as tt, RemoveRowByRangeCommand as An, MoveRowsCommand as Bn, SetRowHiddenCommand as nt, SetSpecificRowsVisibleCommand as st, SetTextWrapCommand as Me, SetWorksheetRowIsAutoHeightMutation as Fn, SetRowHeightCommand as it, SetWorksheetRowIsAutoHeightCommand as be, InsertColByRangeCommand as rt, RemoveColByRangeCommand as Hn, MoveColsCommand as $n, SetColHiddenCommand as ot, SetSpecificColsVisibleCommand as at, SetColWidthCommand as Ln, SetFrozenCommand as Ie, CancelFrozenCommand as zn, ToggleGridlinesCommand as We, SetGridlinesColorCommand as Ne, SetTabColorCommand as Gn, SetRangeValuesMutation as ht, SetWorksheetHideCommand as Kn, SetWorksheetShowCommand as Jn, SetWorksheetNameCommand as je, ClearSelectionAllCommand as Rt, ClearSelectionContentCommand as Pt, ClearSelectionFormatCommand as yt, AppendRowCommand as qn, SetWorksheetRowCountCommand as Yn, SetWorksheetColumnCountCommand as Zn, SetBorderBasicCommand as Qn, SetStyleCommand as D, SetTextRotationCommand as Xn, SetRangeValuesCommand as q, SetVerticalTextAlignCommand as es, SetHorizontalTextAlignCommand as ts, addMergeCellsUtil as fe, getAddMergeMutationRangeByType as ct, RemoveWorksheetMergeCommand as ns, SplitTextToColumnsCommand as ss, SetWorksheetRangeThemeStyleCommand as is, DeleteWorksheetRangeThemeStyleCommand as rs, SheetRangeThemeService as Et, InsertRangeMoveDownCommand as os, InsertRangeMoveRightCommand as as, DeleteRangeMoveUpCommand as hs, DeleteRangeMoveLeftCommand as cs, SetWorkbookNameCommand as ds, InsertSheetCommand as ce, SetWorksheetActiveOperation as Z, RemoveSheetCommand as Oe, CopySheetCommand as us, SetWorksheetOrderCommand as ls, RegisterWorksheetRangeThemeStyleCommand as ms, UnregisterWorksheetRangeThemeStyleCommand as gs, RangeThemeStyle as _s, SetWorksheetOrderMutation as dt, SetTabColorMutation as ut, SetWorksheetHideMutation as lt, COMMAND_LISTENER_VALUE_CHANGE as ws, getValueChangedEffectedRange as Ss, SheetsFreezeSyncController as Cs, SheetValueChangeType as ks, SheetSkeletonChangeType as bs, SplitDelimiterEnum as Is } from "@univerjs/sheets";
7
- import { IDefinedNamesService as Ut, serializeRange as Ge, deserializeRangeWithSheet as fs, serializeRangeWithSheet as vs, FormulaDataModel as ps } from "@univerjs/engine-formula";
4
+ import { Inject as l, Injector as p, ICommandService as S, IPermissionService as K, IAuthzIoService as ee, LocaleService as St, generateRandomId as Ct, Rectangle as B, cellToRange as Wt, HorizontalAlign as L, VerticalAlign as z, RANGE_TYPE as f, ILogService as kt, Direction as ne, BooleanNumber as k, WrapStrategy as ae, ObjectMatrix as ke, covertCellValue as Ee, TextStyleValue as Je, RichTextValue as F, DEFAULT_STYLES as qe, covertCellValues as Ye, Dimension as H, isNullCell as J, mergeWorksheetSnapshotWithDefault as Ze, Tools as Qe, UndoCommand as Nt, RedoCommand as jt, toDisposable as bt, UniverInstanceType as T, IResourceLoaderService as Ot, IUniverInstanceService as Ue, CanceledError as y } from "@univerjs/core";
5
+ import { FBase as Be, FBaseInitialable as Fe, FUniver as It, FEnum as Tt, FEventName as Vt } from "@univerjs/core/facade";
6
+ import { WorksheetProtectionRuleModel as ft, RangeProtectionRuleModel as te, WorksheetProtectionPointModel as He, SetDefinedNameCommand as xe, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as X, RemoveDefinedNameCommand as At, WorkbookPermissionService as Bt, PermissionPointsDefinitions as Ft, WorkbookEditablePermission as $e, UnitObject as W, AddWorksheetProtectionMutation as Ht, DeleteWorksheetProtectionMutation as $t, getAllWorksheetPermissionPoint as Lt, getAllWorksheetPermissionPointByPointPanel as Xe, SetWorksheetPermissionPointsMutation as zt, AddRangeProtectionMutation as Le, DeleteRangeProtectionMutation as Se, SetRangeProtectionMutation as De, WorksheetEditPermission as vt, WorksheetViewPermission as pt, getPrimaryForRange as he, SetSelectionsOperation as ze, getNextPrimaryCell as Gt, WorkbookCopySheetPermission as Kt, WorkbookDeleteColumnPermission as Jt, WorkbookDeleteRowPermission as qt, WorkbookInsertColumnPermission as Yt, WorkbookInsertRowPermission as Zt, WorkbookCreateProtectPermission as Qt, WorkbookRecoverHistoryPermission as Xt, WorkbookHistoryPermission as en, WorkbookViewHistoryPermission as tn, WorkbookHideSheetPermission as nn, WorkbookMoveSheetPermission as sn, WorkbookRenameSheetPermission as rn, WorkbookDeleteSheetPermission as on, WorkbookCreateSheetPermission as an, WorkbookManageCollaboratorPermission as hn, WorkbookCommentPermission as cn, WorkbookDuplicatePermission as dn, WorkbookCopyPermission as un, WorkbookSharePermission as ln, WorkbookExportPermission as mn, WorkbookPrintPermission as gn, WorkbookViewPermission as _n, WorksheetSelectUnProtectedCellsPermission as wn, WorksheetSelectProtectedCellsPermission as Sn, WorksheetDeleteProtectionPermission as Cn, WorksheetManageCollaboratorPermission as kn, WorksheetEditExtraObjectPermission as bn, WorksheetInsertHyperlinkPermission as In, WorksheetPivotTablePermission as fn, WorksheetFilterPermission as vn, WorksheetSortPermission as pn, WorksheetDeleteColumnPermission as Rn, WorksheetDeleteRowPermission as Pn, WorksheetInsertColumnPermission as yn, WorksheetInsertRowPermission as En, WorksheetSetColumnStylePermission as Un, WorksheetSetRowStylePermission as xn, WorksheetSetCellStylePermission as Dn, WorksheetSetCellValuePermission as Mn, WorksheetCopyPermission as Wn, RangeProtectionPermissionDeleteProtectionPoint as Nn, RangeProtectionPermissionManageCollaPoint as jn, RangeProtectionPermissionViewPoint as On, RangeProtectionPermissionEditPoint as Tn, ViewStateEnum as V, EditStateEnum as A, SheetsSelectionsService as Rt, SetWorksheetDefaultStyleMutation as Vn, SetColDataCommand as et, SetRowDataCommand as tt, copyRangeStyles as se, InsertRowByRangeCommand as nt, RemoveRowByRangeCommand as An, MoveRowsCommand as Bn, SetRowHiddenCommand as st, SetSpecificRowsVisibleCommand as it, SetTextWrapCommand as Me, SetWorksheetRowIsAutoHeightMutation as Fn, SetRowHeightCommand as rt, SetWorksheetRowIsAutoHeightCommand as be, InsertColByRangeCommand as ot, RemoveColByRangeCommand as Hn, MoveColsCommand as $n, SetColHiddenCommand as at, SetSpecificColsVisibleCommand as ht, SetColWidthCommand as Ln, SetFrozenCommand as Ie, CancelFrozenCommand as zn, ToggleGridlinesCommand as We, SetGridlinesColorCommand as Ne, SetTabColorCommand as Gn, SetRangeValuesMutation as ct, SetWorksheetHideCommand as Kn, SetWorksheetShowCommand as Jn, SetWorksheetNameCommand as je, ClearSelectionAllCommand as Pt, ClearSelectionContentCommand as yt, ClearSelectionFormatCommand as Et, AppendRowCommand as qn, SetWorksheetRowCountCommand as Yn, SetWorksheetColumnCountCommand as Zn, SetBorderBasicCommand as Qn, SetStyleCommand as D, SetTextRotationCommand as Xn, SetRangeValuesCommand as q, SetVerticalTextAlignCommand as es, SetHorizontalTextAlignCommand as ts, addMergeCellsUtil as fe, getAddMergeMutationRangeByType as dt, RemoveWorksheetMergeCommand as ns, SplitTextToColumnsCommand as ss, SetWorksheetRangeThemeStyleCommand as is, DeleteWorksheetRangeThemeStyleCommand as rs, SheetRangeThemeService as Ut, InsertRangeMoveDownCommand as os, InsertRangeMoveRightCommand as as, DeleteRangeMoveUpCommand as hs, DeleteRangeMoveLeftCommand as cs, SetWorkbookNameCommand as ds, InsertSheetCommand as ce, SetWorksheetActiveOperation as Z, RemoveSheetCommand as Oe, CopySheetCommand as us, SetWorksheetOrderCommand as ls, RegisterWorksheetRangeThemeStyleCommand as ms, UnregisterWorksheetRangeThemeStyleCommand as gs, RangeThemeStyle as _s, SetWorksheetOrderMutation as ut, SetTabColorMutation as lt, SetWorksheetHideMutation as mt, COMMAND_LISTENER_VALUE_CHANGE as ws, getValueChangedEffectedRange as Ss, SheetsFreezeSyncController as Cs, SheetValueChangeType as ks, SheetSkeletonChangeType as bs, SplitDelimiterEnum as Is } from "@univerjs/sheets";
7
+ import { IDefinedNamesService as xt, serializeRange as Ge, deserializeRangeWithSheet as fs, serializeRangeWithSheet as vs, FormulaDataModel as ps } from "@univerjs/engine-formula";
8
8
  import { BehaviorSubject as de, Subject as Rs } from "rxjs";
9
9
  import { filter as R, distinctUntilChanged as ue, shareReplay as x, map as le } from "rxjs/operators";
10
10
  var Ps = Object.getOwnPropertyDescriptor, ys = (s, e, t, n) => {
@@ -31,7 +31,7 @@ class Ce {
31
31
  constructor() {
32
32
  _(this, "_definedNameParam");
33
33
  this._definedNameParam = {
34
- id: St(10),
34
+ id: Ct(10),
35
35
  unitId: "",
36
36
  name: "",
37
37
  formulaOrRefString: "",
@@ -453,12 +453,12 @@ me = ys([
453
453
  E(1, l(p)),
454
454
  E(2, S),
455
455
  E(3, K),
456
- E(4, l(It)),
456
+ E(4, l(ft)),
457
457
  E(5, l(te)),
458
458
  E(6, l(He)),
459
459
  E(7, l(ee)),
460
- E(8, l(wt)),
461
- E(9, Ut)
460
+ E(8, l(St)),
461
+ E(9, xt)
462
462
  ], me);
463
463
  var Us = Object.getOwnPropertyDescriptor, xs = (s, e, t, n) => {
464
464
  for (var i = n > 1 ? void 0 : n ? Us(e, t) : e, r = s.length - 1, o; r >= 0; r--)
@@ -608,7 +608,7 @@ let ge = class extends Be {
608
608
  this._commandService.syncExecuteCommand($t.id, {
609
609
  unitId: e,
610
610
  subUnitId: t
611
- }), [...Lt(), ...Qe()].forEach((n) => {
611
+ }), [...Lt(), ...Xe()].forEach((n) => {
612
612
  const i = new n(e, t);
613
613
  this._permissionService.updatePermissionPoint(i.id, !0);
614
614
  }), this._worksheetProtectionPointRuleModel.deleteRule(e, t);
@@ -638,7 +638,7 @@ let ge = class extends Be {
638
638
  async setWorksheetPermissionPoint(e, t, n, i) {
639
639
  const r = this._worksheetProtectionRuleModel.getRule(e, t);
640
640
  let o;
641
- if (n === ft || n === vt)
641
+ if (n === vt || n === pt)
642
642
  if (r)
643
643
  o = r.permissionId;
644
644
  else {
@@ -730,7 +730,7 @@ let ge = class extends Be {
730
730
  name: "",
731
731
  scope: void 0
732
732
  }
733
- }), r = `ruleId_${St(6)}`;
733
+ }), r = `ruleId_${Ct(6)}`;
734
734
  if (this._worksheetProtectionRuleModel.getRule(e, t))
735
735
  throw new Error("sheet protection cannot intersect with range protection");
736
736
  if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).some((d) => d.ranges.some((w) => n.some((g) => B.intersects(g.getRange(), w)))))
@@ -785,7 +785,7 @@ let ge = class extends Be {
785
785
  unitId: e,
786
786
  subUnitId: t,
787
787
  ruleIds: n
788
- }) && this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length === 0 && (this._worksheetProtectionPointRuleModel.deleteRule(e, t), [...Qe()].forEach((o) => {
788
+ }) && this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length === 0 && (this._worksheetProtectionPointRuleModel.deleteRule(e, t), [...Xe()].forEach((o) => {
789
789
  const a = new o(e, t);
790
790
  this._permissionService.updatePermissionPoint(a.id, a.value);
791
791
  }));
@@ -914,7 +914,7 @@ ge = xs([
914
914
  M(0, l(p)),
915
915
  M(1, S),
916
916
  M(2, K),
917
- M(3, l(It)),
917
+ M(3, l(ft)),
918
918
  M(4, l(te)),
919
919
  M(5, l(He)),
920
920
  M(6, l(Bt)),
@@ -1096,7 +1096,7 @@ let N = class {
1096
1096
  * @example
1097
1097
  * ```ts
1098
1098
  * const worksheet = univerAPI.getActiveWorkbook()?.getActiveSheet();
1099
- * const permission = worksheet?.permission();
1099
+ * const permission = worksheet?.getWorksheetPermission();
1100
1100
  * const rules = await permission?.listRangeProtectionRules();
1101
1101
  * const ruleId = rules?.[0]?.id;
1102
1102
  * console.log(ruleId);
@@ -1111,7 +1111,7 @@ let N = class {
1111
1111
  * @example
1112
1112
  * ```ts
1113
1113
  * const worksheet = univerAPI.getActiveWorkbook()?.getActiveSheet();
1114
- * const permission = worksheet?.permission();
1114
+ * const permission = worksheet?.getWorksheetPermission();
1115
1115
  * const rules = await permission?.listRangeProtectionRules();
1116
1116
  * const ranges = rules?.[0]?.ranges;
1117
1117
  * console.log(ranges);
@@ -1126,7 +1126,7 @@ let N = class {
1126
1126
  * @example
1127
1127
  * ```ts
1128
1128
  * const worksheet = univerAPI.getActiveWorkbook()?.getActiveSheet();
1129
- * const permission = worksheet?.permission();
1129
+ * const permission = worksheet?.getWorksheetPermission();
1130
1130
  * const rules = await permission?.listRangeProtectionRules();
1131
1131
  * const options = rules?.[0]?.options;
1132
1132
  * console.log(options);
@@ -1142,7 +1142,7 @@ let N = class {
1142
1142
  * @example
1143
1143
  * ```ts
1144
1144
  * const worksheet = univerAPI.getActiveWorkbook()?.getActiveSheet();
1145
- * const permission = worksheet?.permission();
1145
+ * const permission = worksheet?.getWorksheetPermission();
1146
1146
  * const rules = await permission?.listRangeProtectionRules();
1147
1147
  * const rule = rules?.[0];
1148
1148
  * await rule?.updateRanges([worksheet.getRange('A1:C3')]);
@@ -1180,7 +1180,7 @@ let N = class {
1180
1180
  * @example
1181
1181
  * ```ts
1182
1182
  * const worksheet = univerAPI.getActiveWorkbook()?.getActiveSheet();
1183
- * const permission = worksheet?.permission();
1183
+ * const permission = worksheet?.getWorksheetPermission();
1184
1184
  * const rules = await permission?.listRangeProtectionRules();
1185
1185
  * const rule = rules?.[0];
1186
1186
  * await rule?.updateOptions({ name: 'New Protection Name', allowEdit: true });
@@ -1209,7 +1209,7 @@ let N = class {
1209
1209
  * @example
1210
1210
  * ```ts
1211
1211
  * const worksheet = univerAPI.getActiveWorkbook()?.getActiveSheet();
1212
- * const permission = worksheet?.permission();
1212
+ * const permission = worksheet?.getWorksheetPermission();
1213
1213
  * const rules = await permission?.listRangeProtectionRules();
1214
1214
  * const rule = rules?.[0];
1215
1215
  * await rule?.remove();
@@ -1236,7 +1236,7 @@ N = js([
1236
1236
  ve(7, l(S)),
1237
1237
  ve(8, l(te))
1238
1238
  ], N);
1239
- var xt = /* @__PURE__ */ ((s) => (s[s.Reader = 0] = "Reader", s[s.Editor = 1] = "Editor", s[s.Owner = 2] = "Owner", s))(xt || {}), u = /* @__PURE__ */ ((s) => (s.Edit = "WorkbookEdit", s.View = "WorkbookView", s.Print = "WorkbookPrint", s.Export = "WorkbookExport", s.Share = "WorkbookShare", s.CopyContent = "WorkbookCopy", s.DuplicateFile = "WorkbookDuplicate", s.Comment = "WorkbookComment", s.ManageCollaborator = "WorkbookManageCollaborator", s.CreateSheet = "WorkbookCreateSheet", s.DeleteSheet = "WorkbookDeleteSheet", s.RenameSheet = "WorkbookRenameSheet", s.MoveSheet = "WorkbookMoveSheet", s.HideSheet = "WorkbookHideSheet", s.ViewHistory = "WorkbookViewHistory", s.ManageHistory = "WorkbookHistory", s.RecoverHistory = "WorkbookRecoverHistory", s.CreateProtection = "WorkbookCreateProtect", s.InsertRow = "WorkbookInsertRow", s.InsertColumn = "WorkbookInsertColumn", s.DeleteRow = "WorkbookDeleteRow", s.DeleteColumn = "WorkbookDeleteColumn", s.CopySheet = "WorkbookCopySheet", s))(u || {}), m = /* @__PURE__ */ ((s) => (s.Edit = "WorksheetEdit", s.View = "WorksheetView", s.Copy = "WorksheetCopy", s.SetCellValue = "WorksheetSetCellValue", s.SetCellStyle = "WorksheetSetCellStyle", s.SetRowStyle = "WorksheetSetRowStyle", s.SetColumnStyle = "WorksheetSetColumnStyle", s.InsertRow = "WorksheetInsertRow", s.InsertColumn = "WorksheetInsertColumn", s.DeleteRow = "WorksheetDeleteRow", s.DeleteColumn = "WorksheetDeleteColumn", s.Sort = "WorksheetSort", s.Filter = "WorksheetFilter", s.PivotTable = "WorksheetPivotTable", s.InsertHyperlink = "WorksheetInsertHyperlink", s.EditExtraObject = "WorksheetEditExtraObject", s.ManageCollaborator = "WorksheetManageCollaborator", s.DeleteProtection = "WorksheetDeleteProtection", s.SelectProtectedCells = "WorksheetSelectProtectedCells", s.SelectUnProtectedCells = "WorksheetSelectUnProtectedCells", s))(m || {}), k = /* @__PURE__ */ ((s) => (s.Edit = "RangeEdit", s.View = "RangeView", s.ManageCollaborator = "RangeManageCollaborator", s.Delete = "RangeDeleteProtection", s))(k || {});
1239
+ var Ke = /* @__PURE__ */ ((s) => (s[s.Reader = 0] = "Reader", s[s.Editor = 1] = "Editor", s[s.Owner = 2] = "Owner", s))(Ke || {}), u = /* @__PURE__ */ ((s) => (s.Edit = "WorkbookEdit", s.View = "WorkbookView", s.Print = "WorkbookPrint", s.Export = "WorkbookExport", s.Share = "WorkbookShare", s.CopyContent = "WorkbookCopy", s.DuplicateFile = "WorkbookDuplicate", s.Comment = "WorkbookComment", s.ManageCollaborator = "WorkbookManageCollaborator", s.CreateSheet = "WorkbookCreateSheet", s.DeleteSheet = "WorkbookDeleteSheet", s.RenameSheet = "WorkbookRenameSheet", s.MoveSheet = "WorkbookMoveSheet", s.HideSheet = "WorkbookHideSheet", s.ViewHistory = "WorkbookViewHistory", s.ManageHistory = "WorkbookHistory", s.RecoverHistory = "WorkbookRecoverHistory", s.CreateProtection = "WorkbookCreateProtect", s.InsertRow = "WorkbookInsertRow", s.InsertColumn = "WorkbookInsertColumn", s.DeleteRow = "WorkbookDeleteRow", s.DeleteColumn = "WorkbookDeleteColumn", s.CopySheet = "WorkbookCopySheet", s))(u || {}), m = /* @__PURE__ */ ((s) => (s.Edit = "WorksheetEdit", s.View = "WorksheetView", s.Copy = "WorksheetCopy", s.SetCellValue = "WorksheetSetCellValue", s.SetCellStyle = "WorksheetSetCellStyle", s.SetRowStyle = "WorksheetSetRowStyle", s.SetColumnStyle = "WorksheetSetColumnStyle", s.InsertRow = "WorksheetInsertRow", s.InsertColumn = "WorksheetInsertColumn", s.DeleteRow = "WorksheetDeleteRow", s.DeleteColumn = "WorksheetDeleteColumn", s.Sort = "WorksheetSort", s.Filter = "WorksheetFilter", s.PivotTable = "WorksheetPivotTable", s.InsertHyperlink = "WorksheetInsertHyperlink", s.EditExtraObject = "WorksheetEditExtraObject", s.ManageCollaborator = "WorksheetManageCollaborator", s.DeleteProtection = "WorksheetDeleteProtection", s.SelectProtectedCells = "WorksheetSelectProtectedCells", s.SelectUnProtectedCells = "WorksheetSelectUnProtectedCells", s))(m || {}), C = /* @__PURE__ */ ((s) => (s.Edit = "RangeEdit", s.View = "RangeView", s.ManageCollaborator = "RangeManageCollaborator", s.Delete = "RangeDeleteProtection", s))(C || {});
1240
1240
  const ie = {
1241
1241
  [u.Edit]: $e,
1242
1242
  [u.View]: _n,
@@ -1262,8 +1262,8 @@ const ie = {
1262
1262
  [u.DeleteColumn]: Jt,
1263
1263
  [u.CopySheet]: Kt
1264
1264
  }, re = {
1265
- [m.Edit]: ft,
1266
- [m.View]: vt,
1265
+ [m.Edit]: vt,
1266
+ [m.View]: pt,
1267
1267
  [m.Copy]: Wn,
1268
1268
  [m.SetCellValue]: Mn,
1269
1269
  [m.SetCellStyle]: Dn,
@@ -1283,10 +1283,10 @@ const ie = {
1283
1283
  [m.SelectProtectedCells]: Sn,
1284
1284
  [m.SelectUnProtectedCells]: wn
1285
1285
  }, Q = {
1286
- [k.Edit]: Tn,
1287
- [k.View]: On,
1288
- [k.ManageCollaborator]: jn,
1289
- [k.Delete]: Nn
1286
+ [C.Edit]: Tn,
1287
+ [C.View]: On,
1288
+ [C.ManageCollaborator]: jn,
1289
+ [C.Delete]: Nn
1290
1290
  };
1291
1291
  var Os = Object.getOwnPropertyDescriptor, Ts = (s, e, t, n) => {
1292
1292
  for (var i = n > 1 ? void 0 : n ? Os(e, t) : e, r = s.length - 1, o; r >= 0; r--)
@@ -1401,7 +1401,7 @@ let Te = class {
1401
1401
  */
1402
1402
  _getRuleEditPermission(s) {
1403
1403
  var i;
1404
- const e = Q[k.Edit];
1404
+ const e = Q[C.Edit];
1405
1405
  if (!e)
1406
1406
  return !1;
1407
1407
  const t = new e(
@@ -1633,7 +1633,7 @@ let Te = class {
1633
1633
  * ```ts
1634
1634
  * const worksheet = univerAPI.getActiveWorkbook()?.getActiveSheet();
1635
1635
  * const permission = worksheet?.getWorksheetPermission();
1636
- * await permission?.setPoint(WorksheetPermissionPoint.InsertRow, false);
1636
+ * await permission?.setPoint(univerAPI.Enum.WorksheetPermissionPoint.InsertRow, false);
1637
1637
  * ```
1638
1638
  */
1639
1639
  async setPoint(s, e) {
@@ -1655,7 +1655,7 @@ let Te = class {
1655
1655
  * ```ts
1656
1656
  * const worksheet = univerAPI.getActiveWorkbook()?.getActiveSheet();
1657
1657
  * const permission = worksheet?.getWorksheetPermission();
1658
- * const canInsertRow = permission?.getPoint(WorksheetPermissionPoint.InsertRow);
1658
+ * const canInsertRow = permission?.getPoint(univerAPI.Enum.WorksheetPermissionPoint.InsertRow);
1659
1659
  * console.log(canInsertRow);
1660
1660
  * ```
1661
1661
  */
@@ -1692,8 +1692,8 @@ let Te = class {
1692
1692
  * await permission?.applyConfig({
1693
1693
  * mode: 'readOnly',
1694
1694
  * points: {
1695
- * [WorksheetPermissionPoint.View]: true,
1696
- * [WorksheetPermissionPoint.Edit]: false
1695
+ * [univerAPI.Enum.WorksheetPermissionPoint.View]: true,
1696
+ * [univerAPI.Enum.WorksheetPermissionPoint.Edit]: false
1697
1697
  * }
1698
1698
  * });
1699
1699
  * ```
@@ -1721,11 +1721,11 @@ let Te = class {
1721
1721
  * const rules = await permission?.protectRanges([
1722
1722
  * {
1723
1723
  * ranges: [worksheet.getRange('A1:B2')],
1724
- * options: { name: 'Protected Area 1', allowEdit: false, allowView: true }
1724
+ * options: { name: 'Protected Area 1', allowEdit: false, allowViewByOthers: true }
1725
1725
  * },
1726
1726
  * {
1727
1727
  * ranges: [worksheet.getRange('C3:D4')],
1728
- * options: { name: 'Protected Area 2', allowEdit: true, allowView: false }
1728
+ * options: { name: 'Protected Area 2', allowEdit: true, allowViewByOthers: false }
1729
1729
  * }
1730
1730
  * ]);
1731
1731
  * console.log(rules);
@@ -1807,7 +1807,7 @@ let Te = class {
1807
1807
  if (!e)
1808
1808
  return;
1809
1809
  const t = (n, i) => n === void 0 ? i : typeof n == "boolean" ? n : !0;
1810
- await this._setPermissionPoint(s, k.Edit, t(e.allowEdit, !1)), await this._setPermissionPoint(s, k.View, t(e.allowViewByOthers, !0));
1810
+ await this._setPermissionPoint(s, C.Edit, t(e.allowEdit, !1)), await this._setPermissionPoint(s, C.View, t(e.allowViewByOthers, !0));
1811
1811
  }
1812
1812
  /**
1813
1813
  * Set a single permission point
@@ -1898,7 +1898,7 @@ function Vs(s) {
1898
1898
  throw new Error(`Invalid horizontal alignment: ${s}`);
1899
1899
  }
1900
1900
  }
1901
- function mt(s) {
1901
+ function gt(s) {
1902
1902
  switch (s) {
1903
1903
  case L.LEFT:
1904
1904
  return "left";
@@ -1922,7 +1922,7 @@ function As(s) {
1922
1922
  throw new Error(`Invalid vertical alignment: ${s}`);
1923
1923
  }
1924
1924
  }
1925
- function gt(s) {
1925
+ function _t(s) {
1926
1926
  switch (s) {
1927
1927
  case z.TOP:
1928
1928
  return "top";
@@ -2162,7 +2162,7 @@ let b = class extends Fe {
2162
2162
  }
2163
2163
  }
2164
2164
  };
2165
- return this._commandService.syncExecuteCommand(Xe.id, r), this;
2165
+ return this._commandService.syncExecuteCommand(et.id, r), this;
2166
2166
  }
2167
2167
  /**
2168
2168
  * Set the default style of the worksheet column
@@ -2188,7 +2188,7 @@ let b = class extends Fe {
2188
2188
  }
2189
2189
  }
2190
2190
  };
2191
- return this._commandService.syncExecuteCommand(et.id, r), this;
2191
+ return this._commandService.syncExecuteCommand(tt.id, r), this;
2192
2192
  }
2193
2193
  getRange(e, t, n, i) {
2194
2194
  let r, o;
@@ -2314,7 +2314,7 @@ let b = class extends Fe {
2314
2314
  */
2315
2315
  insertRowsAfter(e, t) {
2316
2316
  const n = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), r = ne.DOWN, o = e + 1, a = e + t, h = 0, c = this._worksheet.getColumnCount() - 1, d = se(this._worksheet, o, a, h, c, !0, e);
2317
- return this._commandService.syncExecuteCommand(tt.id, {
2317
+ return this._commandService.syncExecuteCommand(nt.id, {
2318
2318
  unitId: n,
2319
2319
  subUnitId: i,
2320
2320
  direction: r,
@@ -2343,7 +2343,7 @@ let b = class extends Fe {
2343
2343
  */
2344
2344
  insertRowsBefore(e, t) {
2345
2345
  const n = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), r = ne.UP, o = e, a = e + t - 1, h = 0, c = this._worksheet.getColumnCount() - 1, d = se(this._worksheet, o, a, h, c, !0, e - 1);
2346
- return this._commandService.syncExecuteCommand(tt.id, {
2346
+ return this._commandService.syncExecuteCommand(nt.id, {
2347
2347
  unitId: n,
2348
2348
  subUnitId: i,
2349
2349
  direction: r,
@@ -2447,7 +2447,7 @@ let b = class extends Fe {
2447
2447
  */
2448
2448
  hideRow(e) {
2449
2449
  const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i = pe(e.getRange(), this._worksheet);
2450
- return this._commandService.syncExecuteCommand(nt.id, {
2450
+ return this._commandService.syncExecuteCommand(st.id, {
2451
2451
  unitId: t,
2452
2452
  subUnitId: n,
2453
2453
  ranges: [i]
@@ -2475,7 +2475,7 @@ let b = class extends Fe {
2475
2475
  endColumn: this._worksheet.getColumnCount() - 1,
2476
2476
  rangeType: f.ROW
2477
2477
  };
2478
- return this._commandService.syncExecuteCommand(nt.id, {
2478
+ return this._commandService.syncExecuteCommand(st.id, {
2479
2479
  unitId: n,
2480
2480
  subUnitId: i,
2481
2481
  ranges: [r]
@@ -2498,7 +2498,7 @@ let b = class extends Fe {
2498
2498
  */
2499
2499
  unhideRow(e) {
2500
2500
  const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i = pe(e.getRange(), this._worksheet);
2501
- return this._commandService.syncExecuteCommand(st.id, {
2501
+ return this._commandService.syncExecuteCommand(it.id, {
2502
2502
  unitId: t,
2503
2503
  subUnitId: n,
2504
2504
  ranges: [i]
@@ -2526,7 +2526,7 @@ let b = class extends Fe {
2526
2526
  endColumn: this._worksheet.getColumnCount() - 1,
2527
2527
  rangeType: f.ROW
2528
2528
  };
2529
- return this._commandService.syncExecuteCommand(st.id, {
2529
+ return this._commandService.syncExecuteCommand(it.id, {
2530
2530
  unitId: n,
2531
2531
  subUnitId: i,
2532
2532
  ranges: [r]
@@ -2560,7 +2560,7 @@ let b = class extends Fe {
2560
2560
  * fWorkSheet.autoFitRow(24);
2561
2561
  * ```
2562
2562
  */
2563
- autoFitRow(e, t = C.TRUE) {
2563
+ autoFitRow(e, t = k.TRUE) {
2564
2564
  const n = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), r = [{
2565
2565
  startRow: e,
2566
2566
  endRow: e,
@@ -2604,7 +2604,7 @@ let b = class extends Fe {
2604
2604
  };
2605
2605
  n <= w ? a.push(g) : h.push(g);
2606
2606
  }
2607
- return h.length > 0 && this._commandService.syncExecuteCommand(it.id, {
2607
+ return h.length > 0 && this._commandService.syncExecuteCommand(rt.id, {
2608
2608
  unitId: i,
2609
2609
  subUnitId: r,
2610
2610
  ranges: h,
@@ -2704,7 +2704,7 @@ let b = class extends Fe {
2704
2704
  endColumn: this._worksheet.getColumnCount() - 1
2705
2705
  }
2706
2706
  ];
2707
- return this._commandService.syncExecuteCommand(it.id, {
2707
+ return this._commandService.syncExecuteCommand(rt.id, {
2708
2708
  unitId: i,
2709
2709
  subUnitId: r,
2710
2710
  ranges: o,
@@ -2733,7 +2733,7 @@ let b = class extends Fe {
2733
2733
  subUnitId: n,
2734
2734
  rowData: i
2735
2735
  };
2736
- return this._commandService.syncExecuteCommand(et.id, r), this;
2736
+ return this._commandService.syncExecuteCommand(tt.id, r), this;
2737
2737
  }
2738
2738
  // #region Column
2739
2739
  /**
@@ -2801,7 +2801,7 @@ let b = class extends Fe {
2801
2801
  */
2802
2802
  insertColumnsAfter(e, t) {
2803
2803
  const n = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), r = ne.RIGHT, o = 0, a = this._worksheet.getRowCount() - 1, h = e + 1, c = e + t, d = se(this._worksheet, o, a, h, c, !1, e);
2804
- return this._commandService.syncExecuteCommand(rt.id, {
2804
+ return this._commandService.syncExecuteCommand(ot.id, {
2805
2805
  unitId: n,
2806
2806
  subUnitId: i,
2807
2807
  direction: r,
@@ -2830,7 +2830,7 @@ let b = class extends Fe {
2830
2830
  */
2831
2831
  insertColumnsBefore(e, t) {
2832
2832
  const n = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), r = ne.LEFT, o = 0, a = this._worksheet.getRowCount() - 1, h = e, c = e + t - 1, d = se(this._worksheet, o, a, h, c, !1, e - 1);
2833
- return this._commandService.syncExecuteCommand(rt.id, {
2833
+ return this._commandService.syncExecuteCommand(ot.id, {
2834
2834
  unitId: n,
2835
2835
  subUnitId: i,
2836
2836
  direction: r,
@@ -2934,7 +2934,7 @@ let b = class extends Fe {
2934
2934
  */
2935
2935
  hideColumn(e) {
2936
2936
  const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i = Re(e.getRange(), this._worksheet);
2937
- return this._commandService.syncExecuteCommand(ot.id, {
2937
+ return this._commandService.syncExecuteCommand(at.id, {
2938
2938
  unitId: t,
2939
2939
  subUnitId: n,
2940
2940
  ranges: [i]
@@ -2962,7 +2962,7 @@ let b = class extends Fe {
2962
2962
  endColumn: e + t - 1,
2963
2963
  rangeType: f.COLUMN
2964
2964
  };
2965
- return this._commandService.syncExecuteCommand(ot.id, {
2965
+ return this._commandService.syncExecuteCommand(at.id, {
2966
2966
  unitId: n,
2967
2967
  subUnitId: i,
2968
2968
  ranges: [r]
@@ -2985,7 +2985,7 @@ let b = class extends Fe {
2985
2985
  */
2986
2986
  unhideColumn(e) {
2987
2987
  const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i = Re(e.getRange(), this._worksheet);
2988
- return this._commandService.syncExecuteCommand(at.id, {
2988
+ return this._commandService.syncExecuteCommand(ht.id, {
2989
2989
  unitId: t,
2990
2990
  subUnitId: n,
2991
2991
  ranges: [i]
@@ -3013,7 +3013,7 @@ let b = class extends Fe {
3013
3013
  endColumn: e + t - 1,
3014
3014
  rangeType: f.COLUMN
3015
3015
  };
3016
- return this._commandService.syncExecuteCommand(at.id, {
3016
+ return this._commandService.syncExecuteCommand(ht.id, {
3017
3017
  unitId: n,
3018
3018
  subUnitId: i,
3019
3019
  ranges: [r]
@@ -3108,7 +3108,7 @@ let b = class extends Fe {
3108
3108
  subUnitId: n,
3109
3109
  columnData: i
3110
3110
  };
3111
- return this._commandService.syncExecuteCommand(Xe.id, r), this;
3111
+ return this._commandService.syncExecuteCommand(et.id, r), this;
3112
3112
  }
3113
3113
  // #region merge cells
3114
3114
  /**
@@ -3387,7 +3387,7 @@ let b = class extends Fe {
3387
3387
  * ```
3388
3388
  */
3389
3389
  hasHiddenGridLines() {
3390
- return this._worksheet.getConfig().showGridlines === C.FALSE;
3390
+ return this._worksheet.getConfig().showGridlines === k.FALSE;
3391
3391
  }
3392
3392
  /**
3393
3393
  * Hides or reveals the sheet gridlines.
@@ -3404,7 +3404,7 @@ let b = class extends Fe {
3404
3404
  return this._commandService.syncExecuteCommand(We.id, {
3405
3405
  unitId: this._workbook.getUnitId(),
3406
3406
  subUnitId: this._worksheet.getSheetId(),
3407
- showGridlines: e ? C.FALSE : C.TRUE
3407
+ showGridlines: e ? k.FALSE : k.TRUE
3408
3408
  }), this;
3409
3409
  }
3410
3410
  /**
@@ -3478,7 +3478,7 @@ let b = class extends Fe {
3478
3478
  */
3479
3479
  onCellDataChange(e) {
3480
3480
  return this._injector.get(S).onCommandExecuted((n) => {
3481
- if (n.id === ht.id) {
3481
+ if (n.id === ct.id) {
3482
3482
  const i = n.params;
3483
3483
  i.unitId === this._workbook.getUnitId() && i.subUnitId === this._worksheet.getSheetId() && i.cellValue && e(new ke(i.cellValue));
3484
3484
  }
@@ -3489,7 +3489,7 @@ let b = class extends Fe {
3489
3489
  */
3490
3490
  onBeforeCellDataChange(e) {
3491
3491
  return this._injector.get(S).beforeCommandExecuted((n) => {
3492
- if (n.id === ht.id) {
3492
+ if (n.id === ct.id) {
3493
3493
  const i = n.params;
3494
3494
  i.unitId === this._workbook.getUnitId() && i.subUnitId === this._worksheet.getSheetId() && i.cellValue && e(new ke(i.cellValue));
3495
3495
  }
@@ -3508,7 +3508,7 @@ let b = class extends Fe {
3508
3508
  */
3509
3509
  hideSheet() {
3510
3510
  const e = this._injector.get(S);
3511
- if (this._workbook.getSheets().filter((r) => r.isSheetHidden() !== C.TRUE).length <= 1)
3511
+ if (this._workbook.getSheets().filter((r) => r.isSheetHidden() !== k.TRUE).length <= 1)
3512
3512
  throw new Error("Cannot hide the only visible sheet");
3513
3513
  return e.syncExecuteCommand(Kn.id, {
3514
3514
  unitId: this._workbook.getUnitId(),
@@ -3544,7 +3544,7 @@ let b = class extends Fe {
3544
3544
  * ```
3545
3545
  */
3546
3546
  isSheetHidden() {
3547
- return this._worksheet.isSheetHidden() === C.TRUE;
3547
+ return this._worksheet.isSheetHidden() === k.TRUE;
3548
3548
  }
3549
3549
  /**
3550
3550
  * Sets the sheet name.
@@ -3621,7 +3621,7 @@ let b = class extends Fe {
3621
3621
  startColumn: 0,
3622
3622
  endColumn: this._worksheet.getColumnCount() - 1
3623
3623
  };
3624
- return i.syncExecuteCommand(Rt.id, {
3624
+ return i.syncExecuteCommand(Pt.id, {
3625
3625
  unitId: t,
3626
3626
  subUnitId: n,
3627
3627
  ranges: [r],
@@ -3646,7 +3646,7 @@ let b = class extends Fe {
3646
3646
  startColumn: 0,
3647
3647
  endColumn: this._worksheet.getColumnCount() - 1
3648
3648
  };
3649
- return n.syncExecuteCommand(Pt.id, {
3649
+ return n.syncExecuteCommand(yt.id, {
3650
3650
  unitId: e,
3651
3651
  subUnitId: t,
3652
3652
  ranges: [i]
@@ -3670,7 +3670,7 @@ let b = class extends Fe {
3670
3670
  startColumn: 0,
3671
3671
  endColumn: this._worksheet.getColumnCount() - 1
3672
3672
  };
3673
- return n.syncExecuteCommand(yt.id, {
3673
+ return n.syncExecuteCommand(Et.id, {
3674
3674
  unitId: e,
3675
3675
  subUnitId: t,
3676
3676
  ranges: [i]
@@ -3979,8 +3979,8 @@ let b = class extends Fe {
3979
3979
  };
3980
3980
  b = Fs([
3981
3981
  oe(3, l(p)),
3982
- oe(4, l(pt)),
3983
- oe(5, l(Ct)),
3982
+ oe(4, l(Rt)),
3983
+ oe(5, l(kt)),
3984
3984
  oe(6, S)
3985
3985
  ], b);
3986
3986
  var Hs = Object.getOwnPropertyDescriptor, $s = (s, e, t, n) => {
@@ -4082,7 +4082,7 @@ let Ve = class {
4082
4082
  * ```ts
4083
4083
  * const range = univerAPI.getActiveWorkbook()?.getActiveSheet()?.getRange('A1:B2');
4084
4084
  * const permission = range?.getRangePermission();
4085
- * const canEdit = permission?.getPoint(RangePermissionPoint.Edit);
4085
+ * const canEdit = permission?.getPoint(univerAPI.Enum.RangePermissionPoint.Edit);
4086
4086
  * console.log(canEdit);
4087
4087
  * ```
4088
4088
  */
@@ -4140,7 +4140,7 @@ let Ve = class {
4140
4140
  * ```
4141
4141
  */
4142
4142
  canEdit() {
4143
- return this.getPoint(k.Edit);
4143
+ return this.getPoint(C.Edit);
4144
4144
  }
4145
4145
  /**
4146
4146
  * Check if the current user can view this range.
@@ -4155,7 +4155,7 @@ let Ve = class {
4155
4155
  * ```
4156
4156
  */
4157
4157
  canView() {
4158
- return this.getPoint(k.View);
4158
+ return this.getPoint(C.View);
4159
4159
  }
4160
4160
  /**
4161
4161
  * Check if the current user can manage collaborators for this range.
@@ -4170,7 +4170,7 @@ let Ve = class {
4170
4170
  * ```
4171
4171
  */
4172
4172
  canManageCollaborator() {
4173
- return this.getPoint(k.ManageCollaborator);
4173
+ return this.getPoint(C.ManageCollaborator);
4174
4174
  }
4175
4175
  /**
4176
4176
  * Check if the current user can delete this protection rule.
@@ -4185,7 +4185,7 @@ let Ve = class {
4185
4185
  * ```
4186
4186
  */
4187
4187
  canDelete() {
4188
- return this.getPoint(k.Delete);
4188
+ return this.getPoint(C.Delete);
4189
4189
  }
4190
4190
  /**
4191
4191
  * Set a specific permission point for the range (low-level API for local runtime control).
@@ -4199,8 +4199,8 @@ let Ve = class {
4199
4199
  * const range = univerAPI.getActiveWorkbook()?.getActiveSheet()?.getRange('A1:B2');
4200
4200
  * const permission = range?.getRangePermission();
4201
4201
  * // Can set permission points without calling protect() first (local-only mode)
4202
- * await permission?.setPoint(RangePermissionPoint.Edit, false); // Disable edit
4203
- * await permission?.setPoint(RangePermissionPoint.View, true); // Enable view
4202
+ * await permission?.setPoint(univerAPI.Enum.RangePermissionPoint.Edit, false); // Disable edit
4203
+ * await permission?.setPoint(univerAPI.Enum.RangePermissionPoint.View, true); // Enable view
4204
4204
  * ```
4205
4205
  */
4206
4206
  async setPoint(s, e) {
@@ -4299,7 +4299,7 @@ let Ve = class {
4299
4299
  if (!e)
4300
4300
  return;
4301
4301
  const t = (n, i) => n === void 0 ? i : typeof n == "boolean" ? n : !0;
4302
- await this._setPermissionPoint(s, k.Edit, t(e.allowEdit, !1)), await this._setPermissionPoint(s, k.View, t(e.allowViewByOthers, !0));
4302
+ await this._setPermissionPoint(s, C.Edit, t(e.allowEdit, !1)), await this._setPermissionPoint(s, C.View, t(e.allowViewByOthers, !0));
4303
4303
  }
4304
4304
  /**
4305
4305
  * Set a single permission point
@@ -4461,7 +4461,7 @@ let Ve = class {
4461
4461
  */
4462
4462
  _buildSnapshot() {
4463
4463
  const s = {};
4464
- return Object.values(k).forEach((e) => {
4464
+ return Object.values(C).forEach((e) => {
4465
4465
  s[e] = this.getPoint(e);
4466
4466
  }), s;
4467
4467
  }
@@ -4737,7 +4737,7 @@ let I = (G = class extends Fe {
4737
4737
  */
4738
4738
  getCellStyle(e = "row") {
4739
4739
  const t = this.getCellStyleData(e);
4740
- return t ? Ke.create(t) : null;
4740
+ return t ? Je.create(t) : null;
4741
4741
  }
4742
4742
  /**
4743
4743
  * Returns the cell styles for the cells in the range.
@@ -4760,7 +4760,7 @@ let I = (G = class extends Fe {
4760
4760
  return this.getCellDatas().map((n, i) => n.map((r, o) => {
4761
4761
  if (!r) return null;
4762
4762
  const a = e !== "cell" ? this._worksheet.getComposedCellStyle(i + this._range.startRow, o + this._range.startColumn, e === "row") : this._worksheet.getCellStyle(i + this._range.startRow, o + this._range.startColumn);
4763
- return a ? Ke.create(a) : null;
4763
+ return a ? Je.create(a) : null;
4764
4764
  }));
4765
4765
  }
4766
4766
  getValue(e) {
@@ -5107,7 +5107,7 @@ let I = (G = class extends Fe {
5107
5107
  * ```
5108
5108
  */
5109
5109
  getWrap() {
5110
- return this._worksheet.getRange(this._range).getWrap() === C.TRUE;
5110
+ return this._worksheet.getRange(this._range).getWrap() === k.TRUE;
5111
5111
  }
5112
5112
  /**
5113
5113
  * Gets whether text wrapping is enabled for cells in the range.
@@ -5153,7 +5153,7 @@ let I = (G = class extends Fe {
5153
5153
  */
5154
5154
  getHorizontalAlignment() {
5155
5155
  const e = this._worksheet.getRange(this._range).getHorizontalAlignment();
5156
- return mt(e);
5156
+ return gt(e);
5157
5157
  }
5158
5158
  /**
5159
5159
  * Returns the horizontal alignments of the cells in the range.
@@ -5167,7 +5167,7 @@ let I = (G = class extends Fe {
5167
5167
  * ```
5168
5168
  */
5169
5169
  getHorizontalAlignments() {
5170
- return this._worksheet.getRange(this._range).getHorizontalAlignments().map((t) => t.map((n) => mt(n)));
5170
+ return this._worksheet.getRange(this._range).getHorizontalAlignments().map((t) => t.map((n) => gt(n)));
5171
5171
  }
5172
5172
  /**
5173
5173
  * Returns the vertical alignment (top/middle/bottom) of the top-left cell in the range.
@@ -5181,7 +5181,7 @@ let I = (G = class extends Fe {
5181
5181
  * ```
5182
5182
  */
5183
5183
  getVerticalAlignment() {
5184
- return gt(this._worksheet.getRange(this._range).getVerticalAlignment());
5184
+ return _t(this._worksheet.getRange(this._range).getVerticalAlignment());
5185
5185
  }
5186
5186
  /**
5187
5187
  * Returns the vertical alignments of the cells in the range.
@@ -5195,7 +5195,7 @@ let I = (G = class extends Fe {
5195
5195
  * ```
5196
5196
  */
5197
5197
  getVerticalAlignments() {
5198
- return this._worksheet.getRange(this._range).getVerticalAlignments().map((t) => t.map((n) => gt(n)));
5198
+ return this._worksheet.getRange(this._range).getVerticalAlignments().map((t) => t.map((n) => _t(n)));
5199
5199
  }
5200
5200
  /**
5201
5201
  * Set custom meta data for first cell in current range.
@@ -5306,7 +5306,7 @@ let I = (G = class extends Fe {
5306
5306
  getBackground() {
5307
5307
  var t, n;
5308
5308
  const e = this.getCellStyle();
5309
- return (n = (t = e == null ? void 0 : e.background) == null ? void 0 : t.rgb) != null ? n : Je.bg.rgb;
5309
+ return (n = (t = e == null ? void 0 : e.background) == null ? void 0 : t.rgb) != null ? n : qe.bg.rgb;
5310
5310
  }
5311
5311
  /**
5312
5312
  * Returns the background colors of the cells in the range.
@@ -5322,7 +5322,7 @@ let I = (G = class extends Fe {
5322
5322
  getBackgrounds() {
5323
5323
  return this.getCellStyles().map((t) => t.map((n) => {
5324
5324
  var i, r;
5325
- return (r = (i = n == null ? void 0 : n.background) == null ? void 0 : i.rgb) != null ? r : Je.bg.rgb;
5325
+ return (r = (i = n == null ? void 0 : n.background) == null ? void 0 : i.rgb) != null ? r : qe.bg.rgb;
5326
5326
  }));
5327
5327
  }
5328
5328
  /**
@@ -5498,7 +5498,7 @@ let I = (G = class extends Fe {
5498
5498
  * ```
5499
5499
  */
5500
5500
  setRichTextValues(e) {
5501
- const t = e.map((r) => r.map((o) => o && { p: o instanceof F ? o.getData() : o })), n = qe(t, this._range), i = {
5501
+ const t = e.map((r) => r.map((o) => o && { p: o instanceof F ? o.getData() : o })), n = Ye(t, this._range), i = {
5502
5502
  unitId: this._workbook.getUnitId(),
5503
5503
  subUnitId: this._worksheet.getSheetId(),
5504
5504
  range: this._range,
@@ -5605,7 +5605,7 @@ let I = (G = class extends Fe {
5605
5605
  * ```
5606
5606
  */
5607
5607
  setValues(e) {
5608
- const t = qe(e, this._range);
5608
+ const t = Ye(e, this._range);
5609
5609
  return this._commandService.syncExecuteCommand(q.id, {
5610
5610
  unitId: this._workbook.getUnitId(),
5611
5611
  subUnitId: this._worksheet.getSheetId(),
@@ -5628,9 +5628,9 @@ let I = (G = class extends Fe {
5628
5628
  setFontWeight(e) {
5629
5629
  let t;
5630
5630
  if (e === "bold")
5631
- t = C.TRUE;
5631
+ t = k.TRUE;
5632
5632
  else if (e === "normal")
5633
- t = C.FALSE;
5633
+ t = k.FALSE;
5634
5634
  else if (e === null)
5635
5635
  t = null;
5636
5636
  else
@@ -5661,9 +5661,9 @@ let I = (G = class extends Fe {
5661
5661
  setFontStyle(e) {
5662
5662
  let t;
5663
5663
  if (e === "italic")
5664
- t = C.TRUE;
5664
+ t = k.TRUE;
5665
5665
  else if (e === "normal")
5666
- t = C.FALSE;
5666
+ t = k.FALSE;
5667
5667
  else if (e === null)
5668
5668
  t = null;
5669
5669
  else
@@ -5694,17 +5694,17 @@ let I = (G = class extends Fe {
5694
5694
  setFontLine(e) {
5695
5695
  if (e === "underline")
5696
5696
  this._setFontUnderline({
5697
- s: C.TRUE
5697
+ s: k.TRUE
5698
5698
  });
5699
5699
  else if (e === "line-through")
5700
5700
  this._setFontStrikethrough({
5701
- s: C.TRUE
5701
+ s: k.TRUE
5702
5702
  });
5703
5703
  else if (e === "none")
5704
5704
  this._setFontUnderline({
5705
- s: C.FALSE
5705
+ s: k.FALSE
5706
5706
  }), this._setFontStrikethrough({
5707
- s: C.FALSE
5707
+ s: k.FALSE
5708
5708
  });
5709
5709
  else if (e === null)
5710
5710
  this._setFontUnderline(null), this._setFontStrikethrough(null);
@@ -5856,7 +5856,7 @@ let I = (G = class extends Fe {
5856
5856
  * ```
5857
5857
  */
5858
5858
  mergeAcross(e = !0) {
5859
- const t = ct([this._range], H.ROWS), n = this._workbook.getUnitId(), i = this._worksheet.getSheetId();
5859
+ const t = dt([this._range], H.ROWS), n = this._workbook.getUnitId(), i = this._worksheet.getSheetId();
5860
5860
  return fe(this._injector, n, i, t, e), this;
5861
5861
  }
5862
5862
  /**
@@ -5878,7 +5878,7 @@ let I = (G = class extends Fe {
5878
5878
  * ```
5879
5879
  */
5880
5880
  mergeVertically(e = !0) {
5881
- const t = ct([this._range], H.COLUMNS), n = this._workbook.getUnitId(), i = this._worksheet.getSheetId();
5881
+ const t = dt([this._range], H.COLUMNS), n = this._workbook.getUnitId(), i = this._worksheet.getSheetId();
5882
5882
  return fe(this._injector, n, i, t, e), this;
5883
5883
  }
5884
5884
  /**
@@ -6148,7 +6148,7 @@ let I = (G = class extends Fe {
6148
6148
  * ```
6149
6149
  */
6150
6150
  getUsedThemeStyle() {
6151
- return this._injector.get(Et).getAppliedRangeThemeStyle({
6151
+ return this._injector.get(Ut).getAppliedRangeThemeStyle({
6152
6152
  unitId: this._workbook.getUnitId(),
6153
6153
  subUnitId: this._worksheet.getSheetId(),
6154
6154
  range: this._range
@@ -6174,7 +6174,7 @@ let I = (G = class extends Fe {
6174
6174
  * ```
6175
6175
  */
6176
6176
  clear(e) {
6177
- return e && e.contentsOnly && !e.formatOnly ? this.clearContent() : e && e.formatOnly && !e.contentsOnly ? this.clearFormat() : (this._commandService.syncExecuteCommand(Rt.id, {
6177
+ return e && e.contentsOnly && !e.formatOnly ? this.clearContent() : e && e.formatOnly && !e.contentsOnly ? this.clearFormat() : (this._commandService.syncExecuteCommand(Pt.id, {
6178
6178
  unitId: this._workbook.getUnitId(),
6179
6179
  subUnitId: this._worksheet.getSheetId(),
6180
6180
  ranges: [this._range],
@@ -6195,7 +6195,7 @@ let I = (G = class extends Fe {
6195
6195
  * ```
6196
6196
  */
6197
6197
  clearContent() {
6198
- return this._commandService.syncExecuteCommand(Pt.id, {
6198
+ return this._commandService.syncExecuteCommand(yt.id, {
6199
6199
  unitId: this._workbook.getUnitId(),
6200
6200
  subUnitId: this._worksheet.getSheetId(),
6201
6201
  ranges: [this._range]
@@ -6214,7 +6214,7 @@ let I = (G = class extends Fe {
6214
6214
  * ```
6215
6215
  */
6216
6216
  clearFormat() {
6217
- return this._commandService.syncExecuteCommand(yt.id, {
6217
+ return this._commandService.syncExecuteCommand(Et.id, {
6218
6218
  unitId: this._workbook.getUnitId(),
6219
6219
  subUnitId: this._worksheet.getSheetId(),
6220
6220
  ranges: [this._range]
@@ -6750,7 +6750,7 @@ let Ae = class {
6750
6750
  * ```ts
6751
6751
  * const workbook = univerAPI.getActiveWorkbook();
6752
6752
  * const permission = workbook?.getWorkbookPermission();
6753
- * await permission?.setPoint(WorkbookPermissionPoint.Print, false);
6753
+ * await permission?.setPoint(univerAPI.Enum.WorkbookPermissionPoint.Print, false);
6754
6754
  * ```
6755
6755
  */
6756
6756
  async setPoint(s, e) {
@@ -6772,7 +6772,7 @@ let Ae = class {
6772
6772
  * ```ts
6773
6773
  * const workbook = univerAPI.getActiveWorkbook();
6774
6774
  * const permission = workbook?.getWorkbookPermission();
6775
- * const canPrint = permission?.getPoint(WorkbookPermissionPoint.Print);
6775
+ * const canPrint = permission?.getPoint(univerAPI.Enum.WorkbookPermissionPoint.Print);
6776
6776
  * console.log(canPrint);
6777
6777
  * ```
6778
6778
  */
@@ -6809,11 +6809,11 @@ let Ae = class {
6809
6809
  * await permission?.setCollaborators([
6810
6810
  * {
6811
6811
  * user: { userID: 'user1', name: 'John Doe', avatar: 'https://...' },
6812
- * role: UnitRole.Editor
6812
+ * role: univerAPI.Enum.UnitRole.Editor
6813
6813
  * },
6814
6814
  * {
6815
6815
  * user: { userID: 'user2', name: 'Jane Smith', avatar: '' },
6816
- * role: UnitRole.Reader
6816
+ * role: univerAPI.Enum.UnitRole.Reader
6817
6817
  * }
6818
6818
  * ]);
6819
6819
  * ```
@@ -6849,7 +6849,7 @@ let Ae = class {
6849
6849
  * const permission = workbook?.getWorkbookPermission();
6850
6850
  * await permission?.addCollaborator(
6851
6851
  * { userID: 'user1', name: 'John Doe', avatar: 'https://...' },
6852
- * UnitRole.Editor
6852
+ * univerAPI.Enum.UnitRole.Editor
6853
6853
  * );
6854
6854
  * ```
6855
6855
  */
@@ -6881,7 +6881,7 @@ let Ae = class {
6881
6881
  * const permission = workbook?.getWorkbookPermission();
6882
6882
  * await permission?.updateCollaborator(
6883
6883
  * { userID: 'user1', name: 'John Doe Updated', avatar: 'https://...' },
6884
- * UnitRole.Reader
6884
+ * univerAPI.Enum.UnitRole.Reader
6885
6885
  * );
6886
6886
  * ```
6887
6887
  */
@@ -6922,7 +6922,7 @@ let Ae = class {
6922
6922
  type: "delete",
6923
6923
  collaborator: {
6924
6924
  user: { id: s },
6925
- role: xt.Reader
6925
+ role: Ke.Reader
6926
6926
  // Placeholder value
6927
6927
  }
6928
6928
  });
@@ -7167,7 +7167,7 @@ let v = class extends Fe {
7167
7167
  */
7168
7168
  create(e, t, n, i) {
7169
7169
  var h, c, d;
7170
- const r = Ye(Ze.deepClone((h = i == null ? void 0 : i.sheet) != null ? h : {}));
7170
+ const r = Ze(Qe.deepClone((h = i == null ? void 0 : i.sheet) != null ? h : {}));
7171
7171
  r.name = e, r.rowCount = t, r.columnCount = n, r.id = (c = i == null ? void 0 : i.sheet) == null ? void 0 : c.id;
7172
7172
  const o = (d = i == null ? void 0 : i.index) != null ? d : this._workbook.getSheets().length;
7173
7173
  this._commandService.syncExecuteCommand(ce.id, {
@@ -7274,7 +7274,7 @@ let v = class extends Fe {
7274
7274
  */
7275
7275
  insertSheet(e, t) {
7276
7276
  var o, a, h;
7277
- const n = Ye(Ze.deepClone((o = t == null ? void 0 : t.sheet) != null ? o : {}));
7277
+ const n = Ze(Qe.deepClone((o = t == null ? void 0 : t.sheet) != null ? o : {}));
7278
7278
  n.name = e, n.id = (a = t == null ? void 0 : t.sheet) == null ? void 0 : a.id;
7279
7279
  const i = (h = t == null ? void 0 : t.index) != null ? h : this._workbook.getSheets().length;
7280
7280
  this._commandService.syncExecuteCommand(ce.id, {
@@ -7406,7 +7406,7 @@ let v = class extends Fe {
7406
7406
  * ```
7407
7407
  */
7408
7408
  onSelectionChange(e) {
7409
- return kt(
7409
+ return bt(
7410
7410
  this._selectionManagerService.selectionMoveEnd$.subscribe((t) => {
7411
7411
  this._univerInstanceService.getCurrentUnitForType(T.UNIVER_SHEET).getUnitId() === this.id && (t != null && t.length ? e(t.map((n) => n.range)) : e([]));
7412
7412
  })
@@ -7791,7 +7791,7 @@ let v = class extends Fe {
7791
7791
  * ```
7792
7792
  */
7793
7793
  getRegisteredRangeThemes() {
7794
- return this._injector.get(Et).getRegisteredRangeThemes();
7794
+ return this._injector.get(Ut).getRegisteredRangeThemes();
7795
7795
  }
7796
7796
  /**
7797
7797
  * Register a custom range theme style.
@@ -7959,15 +7959,15 @@ let v = class extends Fe {
7959
7959
  v = qs([
7960
7960
  U(1, l(p)),
7961
7961
  U(2, l(Ot)),
7962
- U(3, l(pt)),
7962
+ U(3, l(Rt)),
7963
7963
  U(4, Ue),
7964
7964
  U(5, S),
7965
7965
  U(6, K),
7966
- U(7, Ct),
7967
- U(8, l(wt)),
7968
- U(9, Ut)
7966
+ U(7, kt),
7967
+ U(8, l(St)),
7968
+ U(9, xt)
7969
7969
  ], v);
7970
- class Ys extends bt {
7970
+ class Ys extends It {
7971
7971
  getCommandSheetTarget(e) {
7972
7972
  var r;
7973
7973
  const t = e.params;
@@ -8071,7 +8071,7 @@ class Ys extends bt {
8071
8071
  ), this.registerEventHandler(
8072
8072
  this.Event.BeforeSheetMove,
8073
8073
  () => t.beforeCommandExecuted((n) => {
8074
- if (n.id === dt.id) {
8074
+ if (n.id === ut.id) {
8075
8075
  const { fromOrder: i, toOrder: r } = n.params, o = this.getCommandSheetTarget(n);
8076
8076
  if (!o) return;
8077
8077
  const a = {
@@ -8103,7 +8103,7 @@ class Ys extends bt {
8103
8103
  ), this.registerEventHandler(
8104
8104
  this.Event.BeforeSheetTabColorChange,
8105
8105
  () => t.beforeCommandExecuted((n) => {
8106
- if (n.id === ut.id) {
8106
+ if (n.id === lt.id) {
8107
8107
  const { color: i } = n.params, r = this.getCommandSheetTarget(n);
8108
8108
  if (!r) return;
8109
8109
  const o = {
@@ -8119,7 +8119,7 @@ class Ys extends bt {
8119
8119
  ), this.registerEventHandler(
8120
8120
  this.Event.BeforeSheetHideChange,
8121
8121
  () => t.beforeCommandExecuted((n) => {
8122
- if (n.id === lt.id) {
8122
+ if (n.id === mt.id) {
8123
8123
  const { hidden: i } = n.params, r = this.getCommandSheetTarget(n);
8124
8124
  if (!r) return;
8125
8125
  const o = {
@@ -8223,7 +8223,7 @@ class Ys extends bt {
8223
8223
  ), this.registerEventHandler(
8224
8224
  this.Event.SheetMoved,
8225
8225
  () => t.onCommandExecuted((n) => {
8226
- if (n.id === dt.id) {
8226
+ if (n.id === ut.id) {
8227
8227
  const { toOrder: i } = n.params, r = this.getCommandSheetTarget(n);
8228
8228
  if (!r) return;
8229
8229
  this._fireSheetMoved(r.workbook, r.worksheet, i);
@@ -8241,7 +8241,7 @@ class Ys extends bt {
8241
8241
  ), this.registerEventHandler(
8242
8242
  this.Event.SheetTabColorChanged,
8243
8243
  () => t.onCommandExecuted((n) => {
8244
- if (n.id === ut.id) {
8244
+ if (n.id === lt.id) {
8245
8245
  const { color: i } = n.params, r = this.getCommandSheetTarget(n);
8246
8246
  if (!r) return;
8247
8247
  this._fireSheetTabColorChanged(r.workbook, r.worksheet, i);
@@ -8250,7 +8250,7 @@ class Ys extends bt {
8250
8250
  ), this.registerEventHandler(
8251
8251
  this.Event.SheetHideChanged,
8252
8252
  () => t.onCommandExecuted((n) => {
8253
- if (n.id === lt.id) {
8253
+ if (n.id === mt.id) {
8254
8254
  const { hidden: i } = n.params, r = this.getCommandSheetTarget(n);
8255
8255
  if (!r) return;
8256
8256
  this._fireSheetHideChanged(r.workbook, r.worksheet, !!i);
@@ -8300,7 +8300,7 @@ class Ys extends bt {
8300
8300
  const i = this._injector.createInstance(v, n);
8301
8301
  e(i);
8302
8302
  });
8303
- return kt(t);
8303
+ return bt(t);
8304
8304
  }
8305
8305
  newDefinedName() {
8306
8306
  return this._injector.createInstance(Ce);
@@ -8356,7 +8356,7 @@ class Ys extends bt {
8356
8356
  });
8357
8357
  }
8358
8358
  }
8359
- bt.extend(Ys);
8359
+ It.extend(Ys);
8360
8360
  class Zs {
8361
8361
  get SheetValueChangeType() {
8362
8362
  return ks;
@@ -8367,6 +8367,18 @@ class Zs {
8367
8367
  get SplitDelimiterType() {
8368
8368
  return Is;
8369
8369
  }
8370
+ get UnitRole() {
8371
+ return Ke;
8372
+ }
8373
+ get WorkbookPermissionPoint() {
8374
+ return u;
8375
+ }
8376
+ get WorksheetPermissionPoint() {
8377
+ return m;
8378
+ }
8379
+ get RangePermissionPoint() {
8380
+ return C;
8381
+ }
8370
8382
  }
8371
8383
  Tt.extend(Zs);
8372
8384
  class Qs {
@@ -8437,20 +8449,20 @@ var Xs = Object.getOwnPropertyDescriptor, ei = (s, e, t, n) => {
8437
8449
  (o = s[r]) && (i = o(i) || i);
8438
8450
  return i;
8439
8451
  }, ti = (s, e) => (t, n) => e(t, n, s);
8440
- let _t = class extends Be {
8452
+ let wt = class extends Be {
8441
8453
  constructor(s) {
8442
8454
  super(), this._injector = s;
8443
8455
  }
8444
8456
  };
8445
- _t = ei([
8457
+ wt = ei([
8446
8458
  ti(0, l(p))
8447
- ], _t);
8459
+ ], wt);
8448
8460
  export {
8449
8461
  ge as FPermission,
8450
8462
  I as FRange,
8451
8463
  _e as FSelection,
8452
8464
  Qs as FSheetEventName,
8453
- _t as FSheetHooks,
8465
+ wt as FSheetHooks,
8454
8466
  Zs as FSheetsEnum,
8455
8467
  v as FWorkbook,
8456
8468
  b as FWorksheet