@univerjs/sheets-ui 0.4.2 → 0.5.0-nightly.202411091605

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 (72) hide show
  1. package/lib/cjs/facade.js +1 -0
  2. package/lib/cjs/index.js +18 -18
  3. package/lib/cjs/locale/en-US.js +1 -0
  4. package/lib/cjs/locale/fa-IR.js +1 -0
  5. package/lib/cjs/locale/ru-RU.js +1 -0
  6. package/lib/cjs/locale/vi-VN.js +1 -0
  7. package/lib/cjs/locale/zh-CN.js +1 -0
  8. package/lib/cjs/locale/zh-TW.js +1 -0
  9. package/lib/es/facade.js +195 -0
  10. package/lib/es/index.js +15480 -16043
  11. package/lib/es/locale/en-US.js +604 -0
  12. package/lib/es/locale/fa-IR.js +604 -0
  13. package/lib/es/locale/ru-RU.js +602 -0
  14. package/lib/es/locale/vi-VN.js +602 -0
  15. package/lib/es/locale/zh-CN.js +603 -0
  16. package/lib/es/locale/zh-TW.js +603 -0
  17. package/lib/index.css +1 -1
  18. package/lib/types/commands/commands/range-protection.command.d.ts +0 -8
  19. package/lib/types/commands/commands/set-frozen.command.d.ts +0 -5
  20. package/lib/types/commands/commands/set-scroll.command.d.ts +2 -0
  21. package/lib/types/commands/commands/worksheet-protection.command.d.ts +0 -17
  22. package/lib/types/commands/operations/sheet-permission-open-panel.operation.d.ts +3 -0
  23. package/lib/types/common/keys.d.ts +1 -0
  24. package/lib/types/consts/permission.d.ts +1 -0
  25. package/lib/types/controllers/clipboard/utils.d.ts +2 -2
  26. package/lib/types/controllers/editor/editing.render-controller.d.ts +3 -2
  27. package/lib/types/controllers/editor/utils/isEmbeddingFormulaEditor.d.ts +17 -0
  28. package/lib/types/controllers/editor/utils/isRangeSelector.d.ts +1 -1
  29. package/lib/types/controllers/permission/sheet-permission-render.controller.d.ts +6 -3
  30. package/lib/types/controllers/render-controllers/scroll.render-controller.d.ts +1 -1
  31. package/lib/types/facade/f-permission.d.ts +28 -0
  32. package/lib/types/facade/f-range.d.ts +57 -0
  33. package/lib/types/facade/f-sheet-hooks.d.ts +32 -0
  34. package/lib/types/facade/f-univer.d.ts +73 -0
  35. package/lib/types/facade/f-workbook.d.ts +27 -0
  36. package/lib/types/facade/index.d.ts +20 -0
  37. package/lib/types/index.d.ts +5 -4
  38. package/lib/types/locale/zh-CN.d.ts +1 -0
  39. package/lib/types/services/canvas-pop-manager.service.d.ts +3 -2
  40. package/lib/types/services/clipboard/html-to-usm/utils.d.ts +13 -1
  41. package/lib/types/services/editor-bridge.service.d.ts +4 -22
  42. package/lib/types/services/permission/sheet-permission-panel.model.d.ts +4 -25
  43. package/lib/types/services/permission/sheet-permission-user-list.service.d.ts +1 -4
  44. package/lib/types/services/sheet-skeleton-manager.service.d.ts +5 -0
  45. package/lib/types/views/permission/index.d.ts +0 -2
  46. package/lib/types/views/permission/panel/index.d.ts +4 -1
  47. package/lib/types/views/permission/panel-detail/PermissionDetailFooterPart.d.ts +16 -0
  48. package/lib/types/views/permission/panel-detail/PermissionDetailMainPart.d.ts +14 -0
  49. package/lib/types/views/permission/panel-detail/PermissionDetailPanel.d.ts +9 -0
  50. package/lib/types/views/permission/panel-detail/PermissionDetailUserPart.d.ts +11 -0
  51. package/lib/types/views/permission/panel-list/index.d.ts +1 -1
  52. package/lib/types/views/permission/util.d.ts +17 -0
  53. package/lib/umd/facade.js +1 -0
  54. package/lib/umd/index.js +18 -18
  55. package/lib/umd/locale/en-US.js +1 -0
  56. package/lib/umd/locale/fa-IR.js +1 -0
  57. package/lib/umd/locale/ru-RU.js +1 -0
  58. package/lib/umd/locale/vi-VN.js +1 -0
  59. package/lib/umd/locale/zh-CN.js +1 -0
  60. package/lib/umd/locale/zh-TW.js +1 -0
  61. package/package.json +43 -26
  62. package/LICENSE +0 -176
  63. package/lib/locale/en-US.json +0 -616
  64. package/lib/locale/fa-IR.json +0 -616
  65. package/lib/locale/ru-RU.json +0 -616
  66. package/lib/locale/vi-VN.json +0 -616
  67. package/lib/locale/zh-CN.json +0 -616
  68. package/lib/locale/zh-TW.json +0 -616
  69. package/lib/types/views/permission/footer/index.d.ts +0 -4
  70. package/lib/types/views/permission/footer/permission-detail-footer.d.ts +0 -2
  71. package/lib/types/views/permission/footer/permission-list-footer.d.ts +0 -2
  72. package/lib/types/views/permission/panel-detail/index.d.ts +0 -4
@@ -1,7 +1,7 @@
1
1
  import { INeedCheckDisposable, Nullable, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
2
  import { BaseObject, IBoundRectNoAngle, Viewport, IRenderManagerService } from '@univerjs/engine-render';
3
+ import { ISheetLocationBase, RefRangeService } from '@univerjs/sheets';
3
4
  import { IPopup, ICanvasPopupService } from '@univerjs/ui';
4
- import { RefRangeService } from '@univerjs/sheets';
5
5
  export interface ICanvasPopup extends Omit<IPopup, 'anchorRect' | 'anchorRect$' | 'unitId' | 'subUnitId' | 'canvasElement'> {
6
6
  mask?: boolean;
7
7
  extraProps?: Record<string, any>;
@@ -13,6 +13,7 @@ export declare class SheetCanvasPopManagerService extends Disposable {
13
13
  private readonly _refRangeService;
14
14
  private readonly _commandService;
15
15
  constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _refRangeService: RefRangeService, _commandService: ICommandService);
16
+ private _createHiddenRectObserver;
16
17
  private _createPositionObserver;
17
18
  /**
18
19
  * attach a popup to canvas object
@@ -21,7 +22,7 @@ export declare class SheetCanvasPopManagerService extends Disposable {
21
22
  * @returns disposable
22
23
  */
23
24
  attachPopupToObject(targetObject: BaseObject, popup: ICanvasPopup): INeedCheckDisposable;
24
- attachPopupByPosition(bound: IBoundRectNoAngle, popup: ICanvasPopup, _unitId?: string, _subUnitId?: string): Nullable<INeedCheckDisposable>;
25
+ attachPopupByPosition(bound: IBoundRectNoAngle, popup: ICanvasPopup, location: ISheetLocationBase): Nullable<INeedCheckDisposable>;
25
26
  attachPopupToAbsolutePosition(bound: IBoundRectNoAngle, popup: ICanvasPopup, _unitId?: string, _subUnitId?: string): {
26
27
  dispose: () => void;
27
28
  canDispose: () => boolean;
@@ -1,4 +1,16 @@
1
- import { IParagraph, IParagraphStyle, Nullable } from '@univerjs/core';
1
+ import { IParagraph, IParagraphStyle, ITextRun, Nullable } from '@univerjs/core';
2
+ import { ICellDataWithSpanInfo } from '../type';
2
3
  export default function parseToDom(rawHtml: string): HTMLBodyElement;
3
4
  export declare function getParagraphStyle(el: HTMLElement): Nullable<IParagraphStyle>;
4
5
  export declare function generateParagraphs(dataStream: string, prevParagraph?: IParagraph): IParagraph[];
6
+ export declare function convertToCellStyle(cell: ICellDataWithSpanInfo, dataStream: string, textRuns: ITextRun[] | undefined): ICellDataWithSpanInfo | {
7
+ s: import('@univerjs/core').ITextStyle | undefined;
8
+ p?: Nullable<import('@univerjs/core').IDocumentData>;
9
+ v?: Nullable<import('@univerjs/core').CellValue>;
10
+ t?: Nullable<import('@univerjs/core').CellValueType>;
11
+ f?: Nullable<string>;
12
+ si?: Nullable<string>;
13
+ custom?: import('@univerjs/core').CustomData;
14
+ rowSpan?: number;
15
+ colSpan?: number;
16
+ };
@@ -1,6 +1,6 @@
1
- import { ICellData, ICellDataForSheetInterceptor, IDisposable, IPosition, ISelectionCell, Nullable, Workbook, Worksheet, Disposable, IContextService, InterceptorManager, IUniverInstanceService, ThemeService } from '@univerjs/core';
1
+ import { IDisposable, IPosition, ISelectionCell, Nullable, Disposable, IContextService, IUniverInstanceService, ThemeService } from '@univerjs/core';
2
2
  import { Engine, IDocumentLayoutObject, Scene, DeviceInputEventType, IRenderManagerService } from '@univerjs/engine-render';
3
- import { ISheetLocation, SheetsSelectionsService } from '@univerjs/sheets';
3
+ import { SheetsSelectionsService, SheetInterceptorService } from '@univerjs/sheets';
4
4
  import { KeyCode } from '@univerjs/ui';
5
5
  import { Observable } from 'rxjs';
6
6
  import { IEditorService } from '@univerjs/docs-ui';
@@ -37,22 +37,11 @@ export interface ICellEditorLayout {
37
37
  }
38
38
  export interface IEditorBridgeServiceParam extends ICellEditorState, ICellEditorLayout {
39
39
  }
40
- interface ISheetLocationForEditor extends ISheetLocation {
41
- origin: Nullable<ICellData>;
42
- }
43
- declare const BEFORE_CELL_EDIT: import('@univerjs/core').IInterceptor<ICellDataForSheetInterceptor, ISheetLocationForEditor>;
44
- declare const AFTER_CELL_EDIT: import('@univerjs/core').IInterceptor<ICellDataForSheetInterceptor, ISheetLocationForEditor>;
45
- declare const AFTER_CELL_EDIT_ASYNC: import('@univerjs/core').IInterceptor<Promise<Nullable<ICellDataForSheetInterceptor>>, ISheetLocationForEditor>;
46
40
  export interface IEditorBridgeService {
47
41
  currentEditCellState$: Observable<Nullable<ICellEditorState>>;
48
42
  currentEditCellLayout$: Observable<Nullable<ICellEditorLayout>>;
49
43
  currentEditCell$: Observable<Nullable<IEditorBridgeServiceParam>>;
50
44
  visible$: Observable<IEditorBridgeServiceVisibleParam>;
51
- interceptor: InterceptorManager<{
52
- BEFORE_CELL_EDIT: typeof BEFORE_CELL_EDIT;
53
- AFTER_CELL_EDIT: typeof AFTER_CELL_EDIT;
54
- AFTER_CELL_EDIT_ASYNC: typeof AFTER_CELL_EDIT_ASYNC;
55
- }>;
56
45
  dispose(): void;
57
46
  refreshEditCellState(): void;
58
47
  refreshEditCellPosition(resetSizeOnly?: boolean): void;
@@ -69,9 +58,9 @@ export interface IEditorBridgeService {
69
58
  disableForceKeepVisible(): void;
70
59
  isForceKeepVisible(): boolean;
71
60
  getCurrentEditorId(): Nullable<string>;
72
- beforeSetRangeValue(workbook: Workbook, worksheet: Worksheet, row: number, column: number, cellData: ICellData): Promise<Nullable<ICellData>>;
73
61
  }
74
62
  export declare class EditorBridgeService extends Disposable implements IEditorBridgeService, IDisposable {
63
+ private readonly _sheetInterceptorService;
75
64
  private readonly _renderManagerService;
76
65
  private readonly _themeService;
77
66
  private readonly _univerInstanceService;
@@ -110,12 +99,7 @@ export declare class EditorBridgeService extends Disposable implements IEditorBr
110
99
  readonly visible$: Observable<IEditorBridgeServiceVisibleParam>;
111
100
  private readonly _afterVisible$;
112
101
  readonly afterVisible$: Observable<IEditorBridgeServiceVisibleParam>;
113
- readonly interceptor: InterceptorManager<{
114
- BEFORE_CELL_EDIT: import('@univerjs/core').IInterceptor<ICellDataForSheetInterceptor, ISheetLocationForEditor>;
115
- AFTER_CELL_EDIT: import('@univerjs/core').IInterceptor<ICellDataForSheetInterceptor, ISheetLocationForEditor>;
116
- AFTER_CELL_EDIT_ASYNC: import('@univerjs/core').IInterceptor<Promise<Nullable<ICellDataForSheetInterceptor>>, ISheetLocationForEditor>;
117
- }>;
118
- constructor(_renderManagerService: IRenderManagerService, _themeService: ThemeService, _univerInstanceService: IUniverInstanceService, _editorService: IEditorService, _refSelectionsService: SheetsSelectionsService, _contextService: IContextService);
102
+ constructor(_sheetInterceptorService: SheetInterceptorService, _renderManagerService: IRenderManagerService, _themeService: ThemeService, _univerInstanceService: IUniverInstanceService, _editorService: IEditorService, _refSelectionsService: SheetsSelectionsService, _contextService: IContextService);
119
103
  refreshEditCellState(): void;
120
104
  refreshEditCellPosition(resetSizeOnly?: boolean): void;
121
105
  setEditCell(param: ICurrentEditCellParam): void;
@@ -152,7 +136,5 @@ export declare class EditorBridgeService extends Disposable implements IEditorBr
152
136
  isForceKeepVisible(): boolean;
153
137
  changeEditorDirty(dirtyStatus: boolean): void;
154
138
  getEditorDirty(): boolean;
155
- beforeSetRangeValue(workbook: Workbook, worksheet: Worksheet, row: number, column: number, cellData: ICellData): Promise<Nullable<ICellDataForSheetInterceptor>>;
156
139
  }
157
140
  export declare const IEditorBridgeService: import('@wendellhu/redi').IdentifierDecorator<EditorBridgeService>;
158
- export {};
@@ -1,35 +1,14 @@
1
- import { IRange, Nullable } from '@univerjs/core';
1
+ import { IRange } from '@univerjs/core';
2
2
  import { IRangeProtectionRule, IWorksheetProtectionRule } from '@univerjs/sheets';
3
- export declare enum viewState {
4
- othersCanView = "othersCanView",
5
- noOneElseCanView = "noOneElseCanView"
6
- }
7
- export declare enum editState {
8
- designedUserCanEdit = "designedUserCanEdit",
9
- onlyMe = "onlyMe"
10
- }
11
- type IPermissionPanelBaseRule = IRangeProtectionRule | IWorksheetProtectionRule;
12
- export type IPermissionPanelRule = IPermissionPanelBaseRule & {
13
- viewStatus?: viewState;
14
- editStatus?: editState;
3
+ export declare const DEFAULT_RANGE_RULE: IRangeProtectionRule;
4
+ export type IPermissionPanelRule = (IRangeProtectionRule | IWorksheetProtectionRule) & {
15
5
  ranges: IRange[];
6
+ id: string;
16
7
  };
17
8
  export declare class SheetPermissionPanelModel {
18
9
  private _rule;
19
- private _rule$;
20
- private _oldRule;
21
- private _rangeErrorMsg$;
22
10
  private _visible;
23
11
  setVisible(v: boolean): void;
24
12
  getVisible(): boolean;
25
- rangeErrorMsg$: import('rxjs').Observable<string | undefined>;
26
- setRangeErrorMsg(msg: string | undefined): void;
27
- rule$: import('rxjs').Observable<IPermissionPanelRule>;
28
- get rule(): IPermissionPanelRule;
29
- setRule(ruleObj: Partial<IPermissionPanelRule>): void;
30
- resetRule(): void;
31
13
  reset(): void;
32
- get oldRule(): Nullable<IPermissionPanelRule>;
33
- setOldRule(ruleObj: Nullable<IPermissionPanelRule>): void;
34
14
  }
35
- export {};
@@ -3,13 +3,10 @@ export declare class SheetPermissionUserManagerService {
3
3
  private _userList;
4
4
  private _oldCollaboratorList;
5
5
  private _selectUserList;
6
- private _allUserList;
7
6
  private _selectUserList$;
8
7
  selectUserList$: import('rxjs').Observable<ICollaborator[]>;
9
8
  get userList(): ICollaborator[];
10
- get allUserList(): ICollaborator[];
11
- setAllUserList(userList: ICollaborator[]): void;
12
- setUserList(userList: ICollaborator[]): void;
9
+ setCanEditUserList(userList: ICollaborator[]): void;
13
10
  reset(): void;
14
11
  get oldCollaboratorList(): ICollaborator[];
15
12
  setOldCollaboratorList(userList: ICollaborator[]): void;
@@ -46,6 +46,11 @@ export declare class SheetSkeletonManagerService extends Disposable implements I
46
46
  private _setCurrent;
47
47
  reCalculate(): void;
48
48
  private _reCalculate;
49
+ /**
50
+ * Make param dirty, if param is dirty, then the skeleton will be makeDirty in _reCalculate()
51
+ * @param searchParm
52
+ * @param state
53
+ */
49
54
  makeDirty(searchParm: ISheetSkeletonManagerSearch, state?: boolean): void;
50
55
  getOrCreateSkeleton(searchParam: ISheetSkeletonManagerSearch): SpreadsheetSkeleton | undefined;
51
56
  disposeSkeleton(searchParm: ISheetSkeletonManagerSearch): void;
@@ -13,8 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export { SheetPermissionPanelFooter } from './footer';
17
- export { SheetPermissionPanelAddFooter } from './footer/permission-list-footer';
18
16
  export { SheetPermissionPanel } from './panel';
19
17
  export { SheetPermissionPanelList } from './panel-list';
20
18
  export { SheetPermissionDialog } from './permission-dialog';
@@ -1,7 +1,10 @@
1
+ import { IPermissionPanelRule } from '../../../services/permission/sheet-permission-panel.model';
1
2
  import { default as React } from 'react';
2
3
  interface ISheetPermissionPanelProps {
3
4
  showDetail: boolean;
4
5
  fromSheetBar: boolean;
6
+ rule?: IPermissionPanelRule;
7
+ oldRule?: IPermissionPanelRule;
5
8
  }
6
- export declare const SheetPermissionPanel: ({ showDetail, fromSheetBar }: ISheetPermissionPanelProps) => React.JSX.Element | null;
9
+ export declare const SheetPermissionPanel: ({ showDetail, fromSheetBar, rule, oldRule }: ISheetPermissionPanelProps) => React.JSX.Element | null;
7
10
  export {};
@@ -0,0 +1,16 @@
1
+ import { IRange } from '@univerjs/core';
2
+ import { IPermissionPanelRule } from '../../../services/permission/sheet-permission-panel.model';
3
+ import { EditStateEnum, ViewStateEnum } from '@univerjs/sheets';
4
+ import { default as React } from 'react';
5
+ interface IPermissionDetailFooterPartProps {
6
+ permissionId: string;
7
+ id: string;
8
+ ranges: IRange[];
9
+ rangesErrMsg?: string;
10
+ desc?: string;
11
+ editState: EditStateEnum;
12
+ viewState: ViewStateEnum;
13
+ oldRule?: IPermissionPanelRule;
14
+ }
15
+ export declare const PermissionDetailFooterPart: (props: IPermissionDetailFooterPartProps) => React.JSX.Element | null;
16
+ export {};
@@ -0,0 +1,14 @@
1
+ import { IRange } from '@univerjs/core';
2
+ import { default as React } from 'react';
3
+ interface IPermissionDetailMainPartProps {
4
+ permissionId: string;
5
+ ranges: IRange[];
6
+ onRangesChange: (ranges: IRange[], err?: string) => void;
7
+ isFocusRangeSelector: boolean;
8
+ rangesErrMsg?: string;
9
+ desc?: string;
10
+ onDescChange: (desc: string) => void;
11
+ rangeSelectorRef: React.MutableRefObject<any>;
12
+ }
13
+ export declare const PermissionDetailMainPart: (props: IPermissionDetailMainPartProps) => React.JSX.Element | null;
14
+ export {};
@@ -0,0 +1,9 @@
1
+ import { IPermissionPanelRule } from '../../../services/permission/sheet-permission-panel.model';
2
+ import { default as React } from 'react';
3
+ interface ISheetPermissionPanelDetailProps {
4
+ fromSheetBar: boolean;
5
+ rule?: IPermissionPanelRule;
6
+ oldRule?: IPermissionPanelRule;
7
+ }
8
+ export declare const SheetPermissionPanelDetail: (props: ISheetPermissionPanelDetailProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { EditStateEnum, ViewStateEnum } from '@univerjs/sheets';
2
+ import { default as React } from 'react';
3
+ interface IPermissionDetailUserPartProps {
4
+ editState: EditStateEnum;
5
+ onEditStateChange: (v: EditStateEnum) => void;
6
+ viewState: ViewStateEnum;
7
+ onViewStateChange: (v: ViewStateEnum) => void;
8
+ permissionId: string;
9
+ }
10
+ export declare const PermissionDetailUserPart: (props: IPermissionDetailUserPartProps) => React.JSX.Element | null;
11
+ export {};
@@ -1,2 +1,2 @@
1
1
  import { default as React } from 'react';
2
- export declare const SheetPermissionPanelList: () => React.JSX.Element;
2
+ export declare const SheetPermissionPanelList: () => React.JSX.Element | null;
@@ -0,0 +1,17 @@
1
+ import { Injector, IRange, Worksheet } from '@univerjs/core';
2
+ import { IPermissionPanelRule } from '../../services/permission/sheet-permission-panel.model';
3
+ import { EditStateEnum, UnitObject, ViewStateEnum } from '@univerjs/sheets';
4
+ export declare const checkRangeValid: (injector: Injector, permissionRanges: IRange[], permissionId: string, unitId: string, subUnitId: string) => string | undefined;
5
+ export declare const checkRangesIsWholeSheet: (ranges: IRange[], sheet: Worksheet) => boolean;
6
+ export declare const generateDefaultRule: (injector: Injector, fromSheetBar: boolean) => {
7
+ unitId: string;
8
+ subUnitId: string;
9
+ permissionId: string;
10
+ unitType: UnitObject.Worksheet | UnitObject.SelectRange;
11
+ description: string;
12
+ id: string;
13
+ ranges: IRange[];
14
+ editState: EditStateEnum;
15
+ viewState: ViewStateEnum;
16
+ };
17
+ export declare const generateRuleByUnitType: (injector: Injector, rule: IPermissionPanelRule) => IPermissionPanelRule;
@@ -0,0 +1 @@
1
+ (function(s,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/sheets-ui"),require("@univerjs/sheets/facade"),require("@univerjs/ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/sheets-ui","@univerjs/sheets/facade","@univerjs/ui"],o):(s=typeof globalThis<"u"?globalThis:s||self,o(s.UniverSheetsUiFacade={},s.UniverCore,s.UniverEngineRender,s.UniverSheetsUi,s.UniverSheetsFacade,s.UniverUi))})(this,function(s,o,u,a,h,g){"use strict";class S extends o.FUniver{customizeColumnHeader(e){const t=this.getActiveWorkbook();if(!t){console.error("WorkBook not exist");return}const r=t==null?void 0:t.getId();this._getSheetRenderComponent(r,a.SHEET_VIEW_KEY.COLUMN).setCustomHeader(e)}customizeRowHeader(e){const t=this.getActiveWorkbook();if(!t){console.error("WorkBook not exist");return}const r=t==null?void 0:t.getId();this._getSheetRenderComponent(r,a.SHEET_VIEW_KEY.ROW).setCustomHeader(e)}registerSheetRowHeaderExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.ROW),n=r.register(...t);return o.toDisposable(()=>{n.dispose(),r.makeDirty(!0)})}registerSheetColumnHeaderExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.COLUMN),n=r.register(...t);return o.toDisposable(()=>{n.dispose(),r.makeDirty(!0)})}registerSheetMainExtension(e,...t){const r=this._getSheetRenderComponent(e,a.SHEET_VIEW_KEY.MAIN),n=r.register(...t);return o.toDisposable(()=>{n.dispose(),r.makeDirty(!0)})}_getSheetRenderComponent(e,t){const n=this._injector.get(u.IRenderManagerService).getRenderById(e);if(!n)throw new Error("Render not found");const{components:i}=n,d=i.get(t);if(!d)throw new Error("Render component not found");return d}}o.FUniver.extend(S);class v extends h.FWorkbook{openSiderbar(e){return this._logDeprecation("openSiderbar"),this._injector.get(g.ISidebarService).open(e)}openDialog(e){this._logDeprecation("openDialog");const r=this._injector.get(g.IDialogService).open({...e,onClose:()=>{r.dispose()}});return r}_logDeprecation(e){this._injector.get(o.ILogService).warn("[FWorkbook]",`${e} is deprecated. Please use the function of the same name on "FUniver".`)}}h.FWorkbook.extend(v);class _ extends h.FPermission{setPermissionDialogVisible(e){this._permissionService.setShowComponents(e)}}h.FPermission.extend(_);class m extends h.FRange{getCell(){const e=this._injector.get(u.IRenderManagerService),t=this._workbook.getUnitId(),r=this._worksheet.getSheetId();return e.getRenderById(t).with(a.SheetSkeletonManagerService).getWorksheetSkeleton(r).skeleton.getCellByIndex(this._range.startRow,this._range.startColumn)}getCellRect(){const{startX:e,startY:t,endX:r,endY:n}=this.getCell(),i={x:e,y:t,width:r-e,height:n-t,top:t,left:e,bottom:n,right:r};return{...i,toJSON:()=>JSON.stringify(i)}}generateHTML(){var t;const e=this._injector.get(a.ISheetClipboardService).generateCopyContent(this._workbook.getUnitId(),this._worksheet.getSheetId(),this._range);return(t=e==null?void 0:e.html)!=null?t:""}attachPopup(e){const{key:t,disposableCollection:r}=p(e,this._injector.get(g.ComponentManager)),i=this._injector.get(a.SheetCanvasPopManagerService).attachPopupToCell(this._range.startRow,this._range.startColumn,{...e,componentKey:t},this.getUnitId(),this._worksheet.getSheetId());return i?(r.add(i),r):(r.dispose(),null)}attachAlertPopup(e){const t=this._injector.get(a.CellAlertManagerService),r={workbook:this._workbook,worksheet:this._worksheet,row:this._range.startRow,col:this._range.startColumn,unitId:this.getUnitId(),subUnitId:this._worksheet.getSheetId()};return t.showAlert({...e,location:r}),{dispose:()=>{t.removeAlert(e.key)}}}}h.FRange.extend(m);function p(c,e){const{componentKey:t,isVue3:r}=c;let n;const i=new o.DisposableCollection;return typeof t=="string"?n=t:(n=`External_${o.generateRandomId(6)}`,i.add(e.register(n,t,{framework:r?"vue3":"react"}))),{key:n,disposableCollection:i}}var C=Object.defineProperty,k=Object.getOwnPropertyDescriptor,I=(c,e,t,r)=>{for(var n=r>1?void 0:r?k(e,t):e,i=c.length-1,d;i>=0;i--)(d=c[i])&&(n=(r?d(e,t,n):d(n))||n);return r&&n&&C(e,t,n),n},l=(c,e)=>(t,r)=>e(t,r,c);s.FSheetHooks=class{constructor(e,t,r){this._injector=e,this._hoverManagerService=t,this._dragManagerService=r}onCellPointerMove(e){return o.toDisposable(this._hoverManagerService.currentPosition$.subscribe(e))}onCellPointerOver(e){return o.toDisposable(this._hoverManagerService.currentCell$.subscribe(e))}onCellDragOver(e){return o.toDisposable(this._dragManagerService.currentCell$.subscribe(e))}onCellDrop(e){return o.toDisposable(this._dragManagerService.endCell$.subscribe(e))}},s.FSheetHooks=I([l(0,o.Inject(o.Injector)),l(1,o.Inject(a.HoverManagerService)),l(2,o.Inject(a.DragManagerService))],s.FSheetHooks),s.transformComponentKey=p,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});