@univerjs/sheets 0.1.11 → 0.1.13

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.
Files changed (85) hide show
  1. package/lib/cjs/index.js +2 -2
  2. package/lib/es/index.js +5305 -3783
  3. package/lib/locale/en-US.json +14 -0
  4. package/lib/locale/ru-RU.json +14 -0
  5. package/lib/locale/zh-CN.json +14 -0
  6. package/lib/types/commands/commands/add-range-protection.command.d.ts +8 -0
  7. package/lib/types/commands/commands/delete-range-protection.command.d.ts +9 -0
  8. package/lib/types/commands/commands/set-range-protection.command.d.ts +9 -0
  9. package/lib/types/commands/commands/set-worksheet-permission-points.command.d.ts +7 -0
  10. package/lib/types/commands/mutations/add-range-protection.mutation.d.ts +13 -0
  11. package/lib/types/commands/mutations/add-worksheet-protection.mutation.d.ts +8 -0
  12. package/lib/types/commands/mutations/delete-range-protection.mutation.d.ts +11 -0
  13. package/lib/types/commands/mutations/delete-worksheet-protection.mutation.d.ts +7 -0
  14. package/lib/types/commands/mutations/set-range-protection.mutation.d.ts +12 -0
  15. package/lib/types/commands/mutations/set-worksheet-permission-points.mutation.d.ts +9 -0
  16. package/lib/types/commands/mutations/set-worksheet-protection.mutation.d.ts +9 -0
  17. package/lib/types/controllers/config.d.ts +16 -0
  18. package/lib/types/index.d.ts +30 -6
  19. package/lib/types/model/range-protection-render.model.d.ts +18 -0
  20. package/lib/types/model/range-protection-rule.model.d.ts +48 -0
  21. package/lib/types/render/image/protect-background-img.d.ts +16 -0
  22. package/lib/types/render/range-protection/range-protection.render.d.ts +32 -0
  23. package/lib/types/render/worksheet-protection/worksheet-permission.render.d.ts +13 -0
  24. package/lib/types/services/permission/index.d.ts +1 -3
  25. package/lib/types/services/permission/permission-point/index.d.ts +51 -0
  26. package/lib/types/services/permission/permission-point/range/edit.d.ts +14 -0
  27. package/lib/types/services/permission/permission-point/range/view.d.ts +14 -0
  28. package/lib/types/services/permission/permission-point/workbook/comment.d.ts +12 -0
  29. package/lib/types/services/permission/permission-point/workbook/copy-sheet.d.ts +12 -0
  30. package/lib/types/services/permission/permission-point/workbook/copy.d.ts +12 -0
  31. package/lib/types/services/permission/permission-point/workbook/create-sheet.d.ts +12 -0
  32. package/lib/types/services/permission/permission-point/workbook/delete-sheet.d.ts +12 -0
  33. package/lib/types/services/permission/permission-point/workbook/duplicate.d.ts +12 -0
  34. package/lib/types/services/permission/permission-point/workbook/editable.d.ts +12 -0
  35. package/lib/types/services/permission/permission-point/workbook/export.d.ts +12 -0
  36. package/lib/types/services/permission/permission-point/workbook/hide-sheet.d.ts +12 -0
  37. package/lib/types/services/permission/permission-point/workbook/history.d.ts +12 -0
  38. package/lib/types/services/permission/permission-point/workbook/manage-collaborator.d.ts +12 -0
  39. package/lib/types/services/permission/permission-point/workbook/move-sheet.d.ts +12 -0
  40. package/lib/types/services/permission/permission-point/workbook/print.d.ts +12 -0
  41. package/lib/types/services/permission/permission-point/workbook/rename-sheet.d.ts +12 -0
  42. package/lib/types/services/permission/permission-point/workbook/share.d.ts +12 -0
  43. package/lib/types/services/permission/permission-point/workbook/view.d.ts +12 -0
  44. package/lib/types/services/permission/permission-point/worksheet/copy.d.ts +13 -0
  45. package/lib/types/services/permission/permission-point/worksheet/delete-column.d.ts +13 -0
  46. package/lib/types/services/permission/permission-point/worksheet/delete-row.d.ts +13 -0
  47. package/lib/types/services/permission/permission-point/worksheet/edit-extra-object.d.ts +13 -0
  48. package/lib/types/services/permission/permission-point/worksheet/edit.d.ts +13 -0
  49. package/lib/types/services/permission/permission-point/worksheet/filter.d.ts +13 -0
  50. package/lib/types/services/permission/permission-point/worksheet/insert-column.d.ts +13 -0
  51. package/lib/types/services/permission/permission-point/worksheet/insert-hyperlink.d.ts +13 -0
  52. package/lib/types/services/permission/permission-point/worksheet/insert-row.d.ts +13 -0
  53. package/lib/types/services/permission/permission-point/worksheet/manage-collaborator.d.ts +13 -0
  54. package/lib/types/services/permission/permission-point/worksheet/pivot-table.d.ts +13 -0
  55. package/lib/types/services/permission/permission-point/worksheet/select-protected-cells.d.ts +13 -0
  56. package/lib/types/services/permission/permission-point/worksheet/select-un-protected-cells.d.ts +13 -0
  57. package/lib/types/services/permission/permission-point/worksheet/set-cell-style.d.ts +13 -0
  58. package/lib/types/services/permission/permission-point/worksheet/set-cell-value.d.ts +13 -0
  59. package/lib/types/services/permission/permission-point/worksheet/set-column-style.d.ts +13 -0
  60. package/lib/types/services/permission/permission-point/worksheet/set-row-style.d.ts +13 -0
  61. package/lib/types/services/permission/permission-point/worksheet/sort.d.ts +13 -0
  62. package/lib/types/services/permission/permission-point/worksheet/view.d.ts +13 -0
  63. package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +35 -0
  64. package/lib/types/services/permission/range-permission/range-protection.service.d.ts +11 -0
  65. package/lib/types/services/permission/range-permission/util.d.ts +7 -0
  66. package/lib/types/services/permission/type.d.ts +19 -0
  67. package/lib/types/{locale → services/permission/workbook-permission}/index.d.ts +1 -3
  68. package/lib/types/services/permission/workbook-permission/util.d.ts +5 -0
  69. package/lib/types/services/permission/workbook-permission/workbook-permission.service.d.ts +8 -0
  70. package/lib/types/services/permission/worksheet-permission/index.d.ts +19 -0
  71. package/lib/types/services/permission/worksheet-permission/type.d.ts +12 -0
  72. package/lib/types/services/permission/worksheet-permission/utils.d.ts +6 -0
  73. package/lib/types/services/permission/worksheet-permission/worksheet-permission-point.model.d.ts +18 -0
  74. package/lib/types/services/permission/worksheet-permission/worksheet-permission-render.service.d.ts +10 -0
  75. package/lib/types/services/permission/worksheet-permission/worksheet-permission-rule.model.d.ts +36 -0
  76. package/lib/types/services/permission/worksheet-permission/worksheet-permission.service.d.ts +22 -0
  77. package/lib/types/services/ref-range/ref-range.service.d.ts +1 -1
  78. package/lib/types/services/ref-range/util.d.ts +11 -1
  79. package/lib/types/services/sheet-interceptor/utils/interceptor.d.ts +5 -3
  80. package/lib/types/sheets-plugin.d.ts +11 -3
  81. package/lib/umd/index.js +2 -2
  82. package/package.json +16 -12
  83. package/lib/types/services/permission/permission-point.d.ts +0 -10
  84. package/lib/types/services/permission/sheet-permission.service.d.ts +0 -16
  85. package/lib/types/services/permission/tool.d.ts +0 -3
@@ -0,0 +1,14 @@
1
+ {
2
+ "sheets": {
3
+ "tabs": {
4
+ "sheetCopy": "(Copy)",
5
+ "sheet": "Sheet"
6
+ },
7
+ "info": {
8
+ "overlappingSelections": "Cannot use that command on overlapping selections",
9
+ "acrossMergedCell": "Across a merged cell",
10
+ "partOfCell": "Only part of a merged cell is selected",
11
+ "hideSheet": "No visible sheet after you hide this"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "sheets": {
3
+ "tabs": {
4
+ "sheetCopy": "(Копия)",
5
+ "sheet": "Лист"
6
+ },
7
+ "info": {
8
+ "overlappingSelections": "Невозможно использовать эту команду на пересекающихся выделениях",
9
+ "acrossMergedCell": "Через объединенную ячейку",
10
+ "partOfCell": "Выделена только часть объединенной ячейки",
11
+ "hideSheet": "После скрытия этого листа не будет видно ни одного листа"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "sheets": {
3
+ "tabs": {
4
+ "sheetCopy": "(副本)",
5
+ "sheet": "工作表"
6
+ },
7
+ "info": {
8
+ "overlappingSelections": "无法对重叠选区使用该命令",
9
+ "acrossMergedCell": "无法跨越合并单元格",
10
+ "partOfCell": "仅选择了合并单元格的一部分",
11
+ "hideSheet": "隐藏后无可见工作表"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IRangeProtectionRule } from '../../model/range-protection-rule.model';
3
+
4
+ export interface IAddRangeProtectionCommandParams {
5
+ permissionId: string;
6
+ rule: IRangeProtectionRule;
7
+ }
8
+ export declare const AddRangeProtectionCommand: ICommand<IAddRangeProtectionCommandParams>;
@@ -0,0 +1,9 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IRangeProtectionRule } from '../../model/range-protection-rule.model';
3
+
4
+ export interface IDeleteRangeProtectionCommandParams {
5
+ unitId: string;
6
+ subUnitId: string;
7
+ rule: IRangeProtectionRule;
8
+ }
9
+ export declare const DeleteRangeProtectionCommand: ICommand<IDeleteRangeProtectionCommandParams>;
@@ -0,0 +1,9 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IRangeProtectionRule } from '../../model/range-protection-rule.model';
3
+
4
+ export interface ISetRangeProtectionCommandParams {
5
+ permissionId: string;
6
+ rule: IRangeProtectionRule;
7
+ oldRule: IRangeProtectionRule;
8
+ }
9
+ export declare const SetRangeProtectionCommand: ICommand<ISetRangeProtectionCommandParams>;
@@ -0,0 +1,7 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IWorksheetProtectionPointRule } from '../../services/permission/type';
3
+
4
+ export interface ISetWorksheetPermissionPointsCommandParams {
5
+ rule: IWorksheetProtectionPointRule;
6
+ }
7
+ export declare const SetWorksheetPermissionPointsCommand: ICommand<ISetWorksheetPermissionPointsCommandParams>;
@@ -0,0 +1,13 @@
1
+ import { IMutation, IMutationInfo } from '@univerjs/core';
2
+ import { IRangeProtectionRule } from '../../model/range-protection-rule.model';
3
+ import { IDeleteSelectionProtectionMutationParams } from './delete-range-protection.mutation';
4
+
5
+ export interface IAddRangeProtectionMutationParams {
6
+ rules: IRangeProtectionRule[];
7
+ unitId: string;
8
+ subUnitId: string;
9
+ name: string;
10
+ description?: string;
11
+ }
12
+ export declare const FactoryAddRangeProtectionMutation: (param: IAddRangeProtectionMutationParams) => IMutationInfo<IDeleteSelectionProtectionMutationParams>;
13
+ export declare const AddRangeProtectionMutation: IMutation<IAddRangeProtectionMutationParams>;
@@ -0,0 +1,8 @@
1
+ import { IMutation } from '@univerjs/core';
2
+ import { IWorksheetProtectionRule } from '../../services/permission/type';
3
+
4
+ export interface IAddWorksheetProtectionParams {
5
+ unitId: string;
6
+ rule: IWorksheetProtectionRule;
7
+ }
8
+ export declare const AddWorksheetProtectionMutation: IMutation<IAddWorksheetProtectionParams>;
@@ -0,0 +1,11 @@
1
+ import { IAccessor } from '@wendellhu/redi';
2
+ import { IMutation, IMutationInfo } from '@univerjs/core';
3
+ import { IAddRangeProtectionMutationParams } from './add-range-protection.mutation';
4
+
5
+ export interface IDeleteSelectionProtectionMutationParams {
6
+ ruleIds: string[];
7
+ unitId: string;
8
+ subUnitId: string;
9
+ }
10
+ export declare const FactoryDeleteRangeProtectionMutation: (accessor: IAccessor, param: IDeleteSelectionProtectionMutationParams) => IMutationInfo<Omit<IAddRangeProtectionMutationParams, "name">>;
11
+ export declare const DeleteRangeProtectionMutation: IMutation<IDeleteSelectionProtectionMutationParams>;
@@ -0,0 +1,7 @@
1
+ import { IMutation } from '@univerjs/core';
2
+
3
+ export interface IDeleteWorksheetProtectionParams {
4
+ unitId: string;
5
+ subUnitId: string;
6
+ }
7
+ export declare const DeleteWorksheetProtectionMutation: IMutation<IDeleteWorksheetProtectionParams>;
@@ -0,0 +1,12 @@
1
+ import { IAccessor } from '@wendellhu/redi';
2
+ import { IMutation, IMutationInfo } from '@univerjs/core';
3
+ import { IRangeProtectionRule } from '../../model/range-protection-rule.model';
4
+
5
+ export interface ISetRangeProtectionMutationParams {
6
+ rule: IRangeProtectionRule;
7
+ unitId: string;
8
+ subUnitId: string;
9
+ ruleId: string;
10
+ }
11
+ export declare const SetRangeProtectionMutation: IMutation<ISetRangeProtectionMutationParams>;
12
+ export declare const FactorySetRangeProtectionMutation: (accessor: IAccessor, param: ISetRangeProtectionMutationParams) => IMutationInfo<ISetRangeProtectionMutationParams> | null;
@@ -0,0 +1,9 @@
1
+ import { IMutation } from '@univerjs/core';
2
+ import { IWorksheetProtectionPointRule } from '../../services/permission/type';
3
+
4
+ export interface ISetWorksheetPermissionPointsMutationParams {
5
+ rule: IWorksheetProtectionPointRule;
6
+ unitId: string;
7
+ subUnitId: string;
8
+ }
9
+ export declare const SetWorksheetPermissionPointsMutation: IMutation<ISetWorksheetPermissionPointsMutationParams>;
@@ -0,0 +1,9 @@
1
+ import { IMutation } from '@univerjs/core';
2
+ import { IWorksheetProtectionRule } from '../../services/permission/type';
3
+
4
+ export interface ISetWorksheetProtectionParams {
5
+ unitId: string;
6
+ subUnitId: string;
7
+ rule: IWorksheetProtectionRule;
8
+ }
9
+ export declare const SetWorksheetProtectionMutation: IMutation<ISetWorksheetProtectionParams>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare const ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY = "ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY";
@@ -21,7 +21,9 @@ export { getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationT
21
21
  export { alignToMergedCellsBorders, getCellAtRowCol, setEndForRange, isSingleCellSelection } from './commands/commands/utils/selection-utils';
22
22
  export { MAX_CELL_PER_SHEET_KEY } from './controllers/config/config';
23
23
  export { BorderStyleManagerService, type IBorderInfo } from './services/border-style-manager.service';
24
- export { getCurrentSheetDisabled$, SheetEditablePermission, SheetPermissionService } from './services/permission';
24
+ export * from './services/permission/permission-point';
25
+ export { WorksheetPermissionService } from './services/permission/worksheet-permission/worksheet-permission.service';
26
+ export { WorkbookPermissionService } from './services/permission/workbook-permission/workbook-permission.service';
25
27
  export { NORMAL_SELECTION_PLUGIN_NAME, SelectionManagerService, SelectionMoveType, } from './services/selection-manager.service';
26
28
  export { rangeMerge, createTopMatrixFromRanges, createTopMatrixFromMatrix, findAllRectangle, RangeMergeUtil } from './basics/rangeMerge';
27
29
  export { ClearSelectionAllCommand } from './commands/commands/clear-selection-all.command';
@@ -69,9 +71,7 @@ export { InsertColMutation, InsertColMutationUndoFactory, InsertRowMutation, Ins
69
71
  export { InsertSheetMutation, InsertSheetUndoMutationFactory } from './commands/mutations/insert-sheet.mutation';
70
72
  export { MoveRangeMutation } from './commands/mutations/move-range.mutation';
71
73
  export { type IMoveRangeMutationParams } from './commands/mutations/move-range.mutation';
72
- export { type IMoveColumnsMutationParams } from './commands/mutations/move-rows-cols.mutation';
73
- export { type IMoveRowsMutationParams, MoveRowsMutation } from './commands/mutations/move-rows-cols.mutation';
74
- export { MoveColsMutation } from './commands/mutations/move-rows-cols.mutation';
74
+ export { MoveColsMutation, MoveRowsMutation, type IMoveColumnsMutationParams, MoveColsMutationUndoFactory, MoveRowsMutationUndoFactory, type IMoveRowsMutationParams, } from './commands/mutations/move-rows-cols.mutation';
75
75
  export type { IRemoveNumfmtMutationParams, ISetCellsNumfmt, ISetNumfmtMutationParams, } from './commands/mutations/numfmt-mutation';
76
76
  export { factoryRemoveNumfmtUndoMutation, factorySetNumfmtUndoMutation, RemoveNumfmtMutation, SetNumfmtMutation, transformCellsToRange, } from './commands/mutations/numfmt-mutation';
77
77
  export { RemoveColMutation, RemoveRowMutation } from './commands/mutations/remove-row-col.mutation';
@@ -102,7 +102,6 @@ export { getInsertRangeMutations, getRemoveRangeMutations } from './commands/uti
102
102
  export { handleInsertRangeMutation } from './commands/utils/handle-range-mutation';
103
103
  export { type ISheetCommandSharedParams } from './commands/utils/interface';
104
104
  export { getAddMergeMutationRangeByType } from './controllers/merge-cell.controller';
105
- export { enUS, zhCN, ruRU } from './locale';
106
105
  export { NumfmtService } from './services/numfmt/numfmt.service';
107
106
  export type { INumfmtItem, INumfmtItemWithCache } from './services/numfmt/type';
108
107
  export { INumfmtService } from './services/numfmt/type';
@@ -111,10 +110,11 @@ export type { EffectRefRangeParams, IOperator } from './services/ref-range/type'
111
110
  export { EffectRefRangId, OperatorType } from './services/ref-range/type';
112
111
  export { type ISetWorkbookNameCommandParams, SetWorkbookNameCommand } from './commands/commands/set-workbook-name.command';
113
112
  export { type ISetWorkbookNameMutationParams, SetWorkbookNameMutation } from './commands/mutations/set-workbook-name.mutation';
113
+ export { DefinedNameDataController } from './controllers/defined-name-data.controller';
114
114
  export { handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRow, handleIRemoveCol, handleIRemoveRow, handleMoveCols, handleMoveRange, handleMoveRows, rotateRange, runRefRangeMutations, handleCommonDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommands, } from './services/ref-range/util';
115
115
  export { INTERCEPTOR_POINT } from './services/sheet-interceptor/interceptor-const';
116
116
  export { SheetInterceptorService } from './services/sheet-interceptor/sheet-interceptor.service';
117
- export type { ISheetLocation } from './services/sheet-interceptor/utils/interceptor';
117
+ export type { ISheetLocation, ISheetLocationBase, ISheetRowLocation } from './services/sheet-interceptor/utils/interceptor';
118
118
  export { MergeCellController } from './controllers/merge-cell.controller';
119
119
  export { AddMergeRedoSelectionsOperationFactory, AddMergeUndoSelectionsOperationFactory } from './commands/utils/handle-merge-operation';
120
120
  export { InsertDefinedNameCommand } from './commands/commands/insert-defined-name.command';
@@ -123,3 +123,27 @@ export { SetDefinedNameCommand, type ISetDefinedNameCommandParams } from './comm
123
123
  export { ScrollToCellOperation } from './commands/operations/scroll-to-cell.operation';
124
124
  export type { FormatType } from './services/numfmt/type';
125
125
  export { getMoveRangeUndoRedoMutations } from './commands/commands/move-range.command';
126
+ export { defaultWorksheetPermissionPoint, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel } from './services/permission';
127
+ export type { IWorksheetProtectionRule } from './services/permission/type';
128
+ export { WorksheetProtectionRuleModel, WorksheetProtectionPointModel, WorksheetProtectionRenderService } from './services/permission/worksheet-permission';
129
+ export { AddWorksheetProtectionMutation } from './commands/mutations/add-worksheet-protection.mutation';
130
+ export { SetWorksheetProtectionMutation } from './commands/mutations/set-worksheet-protection.mutation';
131
+ export { DeleteWorksheetProtectionMutation } from './commands/mutations/delete-worksheet-protection.mutation';
132
+ export { SetWorksheetPermissionPointsCommand } from './commands/commands/set-worksheet-permission-points.command';
133
+ export { getAllWorkbookPermissionPoint, defaultWorkbookPermissionPoints } from './services/permission/workbook-permission';
134
+ export { WorksheetCopyPermission, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetViewPermission, WorksheetSetRowStylePermission, WorksheetSetColumnStylePermission, WorksheetInsertRowPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetDeleteRowPermission, WorksheetDeleteColumnPermission, WorksheetSortPermission, WorksheetFilterPermission, WorksheetPivotTablePermission, WorksheetEditExtraObjectPermission, WorksheetManageCollaboratorPermission, WorksheetEditPermission, WorkbookCommentPermission, WorkbookEditablePermission, WorkbookDuplicatePermission, WorkbookPrintPermission, WorkbookExportPermission, WorkbookMoveSheetPermission, WorkbookDeleteSheetPermission, WorkbookHideSheetPermission, WorkbookRenameSheetPermission, WorkbookCreateSheetPermission, WorkbookHistoryPermission, WorkbookViewPermission, WorkbookSharePermission, WorkbookCopyPermission, WorkbookManageCollaboratorPermission, } from './services/permission/permission-point';
135
+ export { AddRangeProtectionCommand, type IAddRangeProtectionCommandParams } from './commands/commands/add-range-protection.command';
136
+ export { DeleteRangeProtectionCommand, type IDeleteRangeProtectionCommandParams } from './commands/commands/delete-range-protection.command';
137
+ export { SetRangeProtectionCommand, type ISetRangeProtectionCommandParams } from './commands/commands/set-range-protection.command';
138
+ export { AddRangeProtectionMutation, FactoryAddRangeProtectionMutation, type IAddRangeProtectionMutationParams } from './commands/mutations/add-range-protection.mutation';
139
+ export { DeleteRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, type IDeleteSelectionProtectionMutationParams } from './commands/mutations/delete-range-protection.mutation';
140
+ export { SetRangeProtectionMutation, FactorySetRangeProtectionMutation, type ISetRangeProtectionMutationParams } from './commands/mutations/set-range-protection.mutation';
141
+ export { RangeProtectionCanViewRenderExtension, RangeProtectionCanNotViewRenderExtension, type IRangeProtectionRenderCellData, RANGE_PROTECTION_CAN_VIEW_RENDER_EXTENSION_KEY, RANGE_PROTECTION_CAN_NOT_VIEW_RENDER_EXTENSION_KEY } from './render/range-protection/range-protection.render';
142
+ export { RangeProtectionRenderModel, type ICellPermission } from './model/range-protection-render.model';
143
+ export { RangeProtectionRuleModel, type IObjectModel, type IRangeProtectionRule, type IModel } from './model/range-protection-rule.model';
144
+ export type { IWorksheetProtectionRenderCellData } from './services/permission/worksheet-permission/type';
145
+ export { RangeProtectionRefRangeService } from './services/permission/range-permission/range-protection.ref-range';
146
+ export { RangeProtectionService } from './services/permission/range-permission/range-protection.service';
147
+ export { type IRangePermissionPoint, getAllRangePermissionPoint, getDefaultRangePermission, } from './services/permission/range-permission/util';
148
+ export { RangeProtectionPermissionEditPoint } from './services/permission/permission-point/range/edit';
149
+ export { RangeProtectionPermissionViewPoint } from './services/permission/permission-point/range/view';
@@ -0,0 +1,18 @@
1
+ import { IPermissionService, IRange } from '@univerjs/core';
2
+ import { UnitAction } from '@univerjs/protocol';
3
+ import { RangeProtectionRuleModel } from './range-protection-rule.model';
4
+
5
+ export type ICellPermission = Record<UnitAction, boolean> & {
6
+ ruleId?: string;
7
+ ranges?: IRange[];
8
+ };
9
+ export declare class RangeProtectionRenderModel {
10
+ private _selectionProtectionRuleModel;
11
+ private _permissionService;
12
+ private _cache;
13
+ constructor(_selectionProtectionRuleModel: RangeProtectionRuleModel, _permissionService: IPermissionService);
14
+ private _init;
15
+ private _createKey;
16
+ getCellInfo(unitId: string, subUnitId: string, row: number, col: number): ICellPermission[];
17
+ clear(): void;
18
+ }
@@ -0,0 +1,48 @@
1
+ import { IRange } from '@univerjs/core';
2
+ import { UnitObject } from '@univerjs/protocol';
3
+
4
+ export interface IRangeProtectionRule {
5
+ ranges: IRange[];
6
+ permissionId: string;
7
+ id: string;
8
+ name: string;
9
+ description?: string;
10
+ unitType: UnitObject;
11
+ unitId: string;
12
+ subUnitId: string;
13
+ }
14
+ export type IObjectModel = Record<string, Record<string, IRangeProtectionRule[]>>;
15
+ export type IModel = Map<string, Map<string, Map<string, IRangeProtectionRule>>>;
16
+ type IRuleChangeType = 'add' | 'set' | 'delete';
17
+ export declare class RangeProtectionRuleModel {
18
+ /**
19
+ *
20
+ * Map<unitId, Map<subUnitId, Map<ruleId, IRangeProtectionRule>>>
21
+ */
22
+ private _model;
23
+ private _ruleChange;
24
+ ruleChange$: import('rxjs').Observable<{
25
+ unitId: string;
26
+ subUnitId: string;
27
+ rule: IRangeProtectionRule;
28
+ oldRule?: IRangeProtectionRule | undefined;
29
+ type: IRuleChangeType;
30
+ }>;
31
+ private _ruleRefresh;
32
+ ruleRefresh$: import('rxjs').Observable<unknown>;
33
+ ruleRefresh(id: string): void;
34
+ private _rangeRuleInitStateChange;
35
+ rangeRuleInitStateChange$: import('rxjs').Observable<boolean>;
36
+ changeRuleInitState(state: boolean): void;
37
+ addRule(unitId: string, subUnitId: string, rule: IRangeProtectionRule): void;
38
+ deleteRule(unitId: string, subUnitId: string, id: string): void;
39
+ setRule(unitId: string, subUnitId: string, id: string, rule: IRangeProtectionRule): void;
40
+ getRule(unitId: string, subUnitId: string, id: string): IRangeProtectionRule | undefined;
41
+ getSubunitRuleList(unitId: string, subUnitId: string): IRangeProtectionRule[];
42
+ private _ensureRuleMap;
43
+ toObject(): IObjectModel;
44
+ fromObject(obj: IObjectModel): void;
45
+ deleteUnitModel(): void;
46
+ createRuleId(unitId: string, subUnitId: string): string;
47
+ }
48
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare const base64 = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNCIgaGVpZ2h0PSI0IiB2aWV3Qm94PSIwIDAgNCA0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8bWFzayBpZD0ibWFzazBfNzU5XzExMDgiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjRDZEOEQ5Ii8+CjwvbWFzaz4KPGcgbWFzaz0idXJsKCNtYXNrMF83NTlfMTEwOCkiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTS0zLjY0MDAyIDMuNDQxNDFMMi4wNzM5NyAtMi4yNzI1OEwyLjc4MTA4IC0xLjU2NTQ4TC0yLjkzMjkxIDQuMTQ4NTJMLTMuNjQwMDIgMy40NDE0MVoiIGZpbGw9IiNENkQ4REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0tMS41MTg2OCA1LjU2Mjc1TDQuMTk1MzEgLTAuMTUxMjQ1TDQuOTAyNDIgMC41NTU4NjJMLTAuODExNTc1IDYuMjY5ODZMLTEuNTE4NjggNS41NjI3NVoiIGZpbGw9IiNENkQ4REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjYwMjY1NiA3LjY4NDAzTDYuMzE2NjUgMS45NzAwM0w3LjAyMzc2IDIuNjc3MTRMMS4zMDk3NiA4LjM5MTEzTDAuNjAyNjU2IDcuNjg0MDNaIiBmaWxsPSIjRDZEOERCIi8+CjwvZz4KPC9zdmc+";
@@ -0,0 +1,32 @@
1
+ import { ICellDataForSheetInterceptor, IRange, IScale } from '@univerjs/core';
2
+ import { SpreadsheetSkeleton, UniverRenderingContext, SheetExtension } from '@univerjs/engine-render';
3
+ import { ICellPermission } from '../../model/range-protection-render.model';
4
+
5
+ export declare const RANGE_PROTECTION_CAN_VIEW_RENDER_EXTENSION_KEY = "RANGE_PROTECTION_CAN_VIEW_RENDER_EXTENSION_KEY";
6
+ export declare const RANGE_PROTECTION_CAN_NOT_VIEW_RENDER_EXTENSION_KEY = "RANGE_PROTECTION_CAN_NOT_VIEW_RENDER_EXTENSION_KEY";
7
+ export type IRangeProtectionRenderCellData = ICellDataForSheetInterceptor & {
8
+ selectionProtection: ICellPermission[];
9
+ };
10
+ export declare abstract class RangeProtectionRenderExtension extends SheetExtension {
11
+ abstract uKey: string;
12
+ abstract Z_INDEX: number;
13
+ protected _pattern: CanvasPattern | null;
14
+ protected _img: HTMLImageElement;
15
+ renderCache: Set<string>;
16
+ constructor();
17
+ clearCache(): void;
18
+ protected abstract shouldRender(config: ICellPermission): boolean;
19
+ draw(ctx: UniverRenderingContext, _parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, _diffRanges?: IRange[]): void;
20
+ }
21
+ export declare class RangeProtectionCanViewRenderExtension extends RangeProtectionRenderExtension {
22
+ uKey: string;
23
+ Z_INDEX: number;
24
+ constructor();
25
+ protected shouldRender(config: ICellPermission): boolean;
26
+ }
27
+ export declare class RangeProtectionCanNotViewRenderExtension extends RangeProtectionRenderExtension {
28
+ uKey: string;
29
+ Z_INDEX: number;
30
+ constructor();
31
+ protected shouldRender(config: ICellPermission): boolean;
32
+ }
@@ -0,0 +1,13 @@
1
+ import { IRange, IScale } from '@univerjs/core';
2
+ import { SpreadsheetSkeleton, UniverRenderingContext, SheetExtension } from '@univerjs/engine-render';
3
+
4
+ export declare const worksheetProtectionKey = "worksheet-protection";
5
+ export declare class WorksheetProtectionRenderExtension extends SheetExtension {
6
+ uKey: string;
7
+ Z_INDEX: number;
8
+ private _pattern;
9
+ private _img;
10
+ constructor();
11
+ draw(ctx: UniverRenderingContext, _parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, _diffRanges?: IRange[]): false | undefined;
12
+ setZIndex(zIndex: number): void;
13
+ }
@@ -13,6 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export { SheetEditablePermission } from './permission-point';
17
- export { SheetPermissionService } from './sheet-permission.service';
18
- export * from './tool';
16
+ export { defaultWorksheetPermissionPoint, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel } from './worksheet-permission/utils';
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export { WorksheetCopyPermission } from './worksheet/copy';
17
+ export { WorksheetSelectProtectedCellsPermission } from './worksheet/select-protected-cells';
18
+ export { WorksheetSelectUnProtectedCellsPermission } from './worksheet/select-un-protected-cells';
19
+ export { WorksheetSetCellStylePermission } from './worksheet/set-cell-style';
20
+ export { WorksheetSetCellValuePermission } from './worksheet/set-cell-value';
21
+ export { WorksheetViewPermission } from './worksheet/view';
22
+ export { WorksheetSetRowStylePermission } from './worksheet/set-row-style';
23
+ export { WorksheetSetColumnStylePermission } from './worksheet/set-column-style';
24
+ export { WorksheetInsertRowPermission } from './worksheet/insert-row';
25
+ export { WorksheetInsertColumnPermission } from './worksheet/insert-column';
26
+ export { WorksheetInsertHyperlinkPermission } from './worksheet/insert-hyperlink';
27
+ export { WorksheetDeleteRowPermission } from './worksheet/delete-row';
28
+ export { WorksheetDeleteColumnPermission } from './worksheet/delete-column';
29
+ export { WorksheetSortPermission } from './worksheet/sort';
30
+ export { WorksheetFilterPermission } from './worksheet/filter';
31
+ export { WorksheetPivotTablePermission } from './worksheet/pivot-table';
32
+ export { WorksheetEditExtraObjectPermission } from './worksheet/edit-extra-object';
33
+ export { WorksheetManageCollaboratorPermission } from './worksheet/manage-collaborator';
34
+ export { WorksheetEditPermission } from './worksheet/edit';
35
+ export { WorkbookCommentPermission } from './workbook/comment';
36
+ export { WorkbookEditablePermission } from './workbook/editable';
37
+ export { WorkbookDuplicatePermission } from './workbook/duplicate';
38
+ export { WorkbookPrintPermission } from './workbook/print';
39
+ export { WorkbookExportPermission } from './workbook/export';
40
+ export { WorkbookMoveSheetPermission } from './workbook/move-sheet';
41
+ export { WorkbookDeleteSheetPermission } from './workbook/delete-sheet';
42
+ export { WorkbookHideSheetPermission } from './workbook/hide-sheet';
43
+ export { WorkbookRenameSheetPermission } from './workbook/rename-sheet';
44
+ export { WorkbookCreateSheetPermission } from './workbook/create-sheet';
45
+ export { WorkbookHistoryPermission } from './workbook/history';
46
+ export { WorkbookViewPermission } from './workbook/view';
47
+ export { WorkbookSharePermission } from './workbook/share';
48
+ export { WorkbookCopyPermission } from './workbook/copy';
49
+ export { WorkbookManageCollaboratorPermission } from './workbook/manage-collaborator';
50
+ export { RangeProtectionPermissionEditPoint } from './range/edit';
51
+ export { RangeProtectionPermissionViewPoint } from './range/view';
@@ -0,0 +1,14 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class RangeProtectionPermissionEditPoint implements IPermissionPoint {
5
+ type: UnitObject;
6
+ subType: UnitAction;
7
+ status: PermissionStatus;
8
+ value: boolean;
9
+ id: string;
10
+ unitId: string;
11
+ subUnitId: string;
12
+ permissionId: string;
13
+ constructor(unitId: string, subUnitId: string, permissionId: string);
14
+ }
@@ -0,0 +1,14 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class RangeProtectionPermissionViewPoint implements IPermissionPoint {
5
+ type: UnitObject;
6
+ subType: UnitAction;
7
+ status: PermissionStatus;
8
+ value: boolean;
9
+ id: string;
10
+ unitId: string;
11
+ subUnitId: string;
12
+ permissionId: string;
13
+ constructor(unitId: string, subUnitId: string, permissionId: string);
14
+ }
@@ -0,0 +1,12 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class WorkbookCommentPermission implements IPermissionPoint {
5
+ unitId: string;
6
+ id: string;
7
+ value: boolean;
8
+ type: UnitObject;
9
+ status: PermissionStatus;
10
+ subType: UnitAction;
11
+ constructor(unitId: string);
12
+ }
@@ -0,0 +1,12 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class WorkbookCopySheetPermission implements IPermissionPoint {
5
+ unitId: string;
6
+ id: string;
7
+ value: boolean;
8
+ type: UnitObject;
9
+ subType: UnitAction;
10
+ status: PermissionStatus;
11
+ constructor(unitId: string);
12
+ }
@@ -0,0 +1,12 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class WorkbookCopyPermission implements IPermissionPoint {
5
+ unitId: string;
6
+ id: string;
7
+ value: boolean;
8
+ type: UnitObject;
9
+ status: PermissionStatus;
10
+ subType: UnitAction;
11
+ constructor(unitId: string);
12
+ }
@@ -0,0 +1,12 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class WorkbookCreateSheetPermission implements IPermissionPoint {
5
+ unitId: string;
6
+ id: string;
7
+ value: boolean;
8
+ type: UnitObject;
9
+ status: PermissionStatus;
10
+ subType: UnitAction;
11
+ constructor(unitId: string);
12
+ }
@@ -0,0 +1,12 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class WorkbookDeleteSheetPermission implements IPermissionPoint {
5
+ unitId: string;
6
+ id: string;
7
+ value: boolean;
8
+ type: UnitObject;
9
+ status: PermissionStatus;
10
+ subType: UnitAction;
11
+ constructor(unitId: string);
12
+ }
@@ -0,0 +1,12 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class WorkbookDuplicatePermission implements IPermissionPoint {
5
+ unitId: string;
6
+ id: string;
7
+ value: boolean;
8
+ type: UnitObject;
9
+ status: PermissionStatus;
10
+ subType: UnitAction;
11
+ constructor(unitId: string);
12
+ }
@@ -0,0 +1,12 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class WorkbookEditablePermission implements IPermissionPoint {
5
+ unitId: string;
6
+ id: string;
7
+ value: boolean;
8
+ type: UnitObject;
9
+ status: PermissionStatus;
10
+ subType: UnitAction;
11
+ constructor(unitId: string);
12
+ }
@@ -0,0 +1,12 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class WorkbookExportPermission implements IPermissionPoint {
5
+ unitId: string;
6
+ id: string;
7
+ value: boolean;
8
+ type: UnitObject;
9
+ status: PermissionStatus;
10
+ subType: UnitAction;
11
+ constructor(unitId: string);
12
+ }
@@ -0,0 +1,12 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class WorkbookHideSheetPermission implements IPermissionPoint {
5
+ unitId: string;
6
+ id: string;
7
+ value: boolean;
8
+ type: UnitObject;
9
+ status: PermissionStatus;
10
+ subType: UnitAction;
11
+ constructor(unitId: string);
12
+ }
@@ -0,0 +1,12 @@
1
+ import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
2
+ import { UnitAction, UnitObject } from '@univerjs/protocol';
3
+
4
+ export declare class WorkbookHistoryPermission implements IPermissionPoint {
5
+ unitId: string;
6
+ id: string;
7
+ value: boolean;
8
+ type: UnitObject;
9
+ status: PermissionStatus;
10
+ subType: UnitAction;
11
+ constructor(unitId: string);
12
+ }