@univerjs/sheets-ui 1.0.0-alpha.2 → 1.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/lib/cjs/facade.js +47 -37
  2. package/lib/cjs/index.js +8906 -7574
  3. package/lib/cjs/locale/ar-SA.js +9 -1
  4. package/lib/cjs/locale/ca-ES.js +9 -1
  5. package/lib/cjs/locale/de-DE.js +9 -1
  6. package/lib/cjs/locale/en-US.js +9 -1
  7. package/lib/cjs/locale/es-ES.js +10 -2
  8. package/lib/cjs/locale/fa-IR.js +9 -1
  9. package/lib/cjs/locale/fr-FR.js +9 -1
  10. package/lib/cjs/locale/id-ID.js +9 -1
  11. package/lib/cjs/locale/it-IT.js +9 -1
  12. package/lib/cjs/locale/ja-JP.js +9 -1
  13. package/lib/cjs/locale/ko-KR.js +9 -1
  14. package/lib/cjs/locale/pl-PL.js +9 -1
  15. package/lib/cjs/locale/pt-BR.js +9 -1
  16. package/lib/cjs/locale/ru-RU.js +9 -1
  17. package/lib/cjs/locale/sk-SK.js +9 -1
  18. package/lib/cjs/locale/vi-VN.js +9 -1
  19. package/lib/cjs/locale/zh-CN.js +9 -1
  20. package/lib/cjs/locale/zh-HK.js +9 -1
  21. package/lib/cjs/locale/zh-TW.js +9 -1
  22. package/lib/es/facade.js +47 -37
  23. package/lib/es/index.js +8894 -7559
  24. package/lib/es/locale/ar-SA.js +9 -1
  25. package/lib/es/locale/ca-ES.js +9 -1
  26. package/lib/es/locale/de-DE.js +9 -1
  27. package/lib/es/locale/en-US.js +9 -1
  28. package/lib/es/locale/es-ES.js +10 -2
  29. package/lib/es/locale/fa-IR.js +9 -1
  30. package/lib/es/locale/fr-FR.js +9 -1
  31. package/lib/es/locale/id-ID.js +9 -1
  32. package/lib/es/locale/it-IT.js +9 -1
  33. package/lib/es/locale/ja-JP.js +9 -1
  34. package/lib/es/locale/ko-KR.js +9 -1
  35. package/lib/es/locale/pl-PL.js +9 -1
  36. package/lib/es/locale/pt-BR.js +9 -1
  37. package/lib/es/locale/ru-RU.js +9 -1
  38. package/lib/es/locale/sk-SK.js +9 -1
  39. package/lib/es/locale/vi-VN.js +9 -1
  40. package/lib/es/locale/zh-CN.js +9 -1
  41. package/lib/es/locale/zh-HK.js +9 -1
  42. package/lib/es/locale/zh-TW.js +9 -1
  43. package/lib/facade.js +47 -37
  44. package/lib/index.css +49 -0
  45. package/lib/index.js +8894 -7559
  46. package/lib/locale/ar-SA.js +9 -1
  47. package/lib/locale/ca-ES.js +9 -1
  48. package/lib/locale/de-DE.js +9 -1
  49. package/lib/locale/en-US.js +9 -1
  50. package/lib/locale/es-ES.js +10 -2
  51. package/lib/locale/fa-IR.js +9 -1
  52. package/lib/locale/fr-FR.js +9 -1
  53. package/lib/locale/id-ID.js +9 -1
  54. package/lib/locale/it-IT.js +9 -1
  55. package/lib/locale/ja-JP.js +9 -1
  56. package/lib/locale/ko-KR.js +9 -1
  57. package/lib/locale/pl-PL.js +9 -1
  58. package/lib/locale/pt-BR.js +9 -1
  59. package/lib/locale/ru-RU.js +9 -1
  60. package/lib/locale/sk-SK.js +9 -1
  61. package/lib/locale/vi-VN.js +9 -1
  62. package/lib/locale/zh-CN.js +9 -1
  63. package/lib/locale/zh-HK.js +9 -1
  64. package/lib/locale/zh-TW.js +9 -1
  65. package/lib/types/commands/commands/set-scroll.command.d.ts +3 -0
  66. package/lib/types/{controllers/cell-alert.controller.d.ts → commands/commands/set-zoom-ratio-from-toolbar.command.d.ts} +4 -8
  67. package/lib/types/controllers/editor/editing.render-controller.d.ts +1 -0
  68. package/lib/types/controllers/editor/formula-editor.controller.d.ts +1 -0
  69. package/lib/types/controllers/permission/sheet-permission-render.controller.d.ts +1 -9
  70. package/lib/types/controllers/render-controllers/contextmenu.render-controller.d.ts +7 -2
  71. package/lib/types/controllers/render-controllers/editor-bridge.render-controller.d.ts +7 -1
  72. package/lib/types/controllers/render-controllers/header-unhide.render-controller.d.ts +0 -1
  73. package/lib/types/embed-tab-anchor.d.ts +23 -0
  74. package/lib/types/facade/f-univer.d.ts +1 -0
  75. package/lib/types/index.d.ts +17 -3
  76. package/lib/types/locale/en-US.d.ts +9 -1
  77. package/lib/types/menu/frozen.menu.d.ts +2 -0
  78. package/lib/types/menu/fullscreen.menu.d.ts +19 -0
  79. package/lib/types/menu/menu.d.ts +1 -0
  80. package/lib/types/menu/text-to-number.menu.d.ts +0 -2
  81. package/lib/types/menu/zoom.menu.d.ts +20 -0
  82. package/lib/types/services/canvas-pop-manager.service.d.ts +9 -0
  83. package/lib/types/services/cell-dropdown-manager.service.d.ts +1 -3
  84. package/lib/types/services/cell-popup-manager.service.d.ts +1 -0
  85. package/lib/types/services/editor/cell-editor-resize.service.d.ts +4 -1
  86. package/lib/types/services/editor-bridge.service.d.ts +2 -0
  87. package/lib/types/services/print-interceptor.service.d.ts +8 -0
  88. package/lib/types/services/selection/base-selection-render.service.d.ts +1 -0
  89. package/lib/types/services/sheet-embed-integration.service.d.ts +126 -0
  90. package/lib/types/services/sheet-embed-runtime.service.d.ts +26 -0
  91. package/lib/types/services/sheet-host-chrome-override.service.d.ts +25 -0
  92. package/lib/types/services/sheet-loading-render.service.d.ts +65 -0
  93. package/lib/types/services/sheet-skeleton-manager.service.d.ts +2 -0
  94. package/lib/types/views/CellPopup.d.ts +2 -2
  95. package/lib/types/views/border-panel/interface.d.ts +63 -2
  96. package/lib/types/views/defined-name/DefinedNameInput.d.ts +1 -1
  97. package/lib/types/views/dropdown/CascaderDropdown.d.ts +2 -2
  98. package/lib/types/views/dropdown/ColorDropdown.d.ts +2 -2
  99. package/lib/types/views/dropdown/DateDropdown.d.ts +2 -2
  100. package/lib/types/views/dropdown/ListDropDown.d.ts +2 -2
  101. package/lib/types/views/editor-container/EditorContainer.d.ts +7 -5
  102. package/lib/types/{menu/mobile-menu.d.ts → views/editor-container/EditorContainer.spec.d.ts} +1 -1
  103. package/lib/types/views/editor-container/focus-editor.d.ts +25 -0
  104. package/lib/types/views/hook.d.ts +4 -0
  105. package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarItem.d.ts +2 -1
  106. package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/sheet-tab-drag-sort.d.ts +1 -0
  107. package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.d.ts +2 -1
  108. package/lib/types/views/sheet-slider/SheetZoomInput.d.ts +18 -0
  109. package/lib/umd/facade.js +1 -1
  110. package/lib/umd/index.js +12 -12
  111. package/lib/umd/locale/ar-SA.js +1 -1
  112. package/lib/umd/locale/ca-ES.js +1 -1
  113. package/lib/umd/locale/de-DE.js +1 -1
  114. package/lib/umd/locale/en-US.js +1 -1
  115. package/lib/umd/locale/es-ES.js +1 -1
  116. package/lib/umd/locale/fa-IR.js +1 -1
  117. package/lib/umd/locale/fr-FR.js +1 -1
  118. package/lib/umd/locale/id-ID.js +1 -1
  119. package/lib/umd/locale/it-IT.js +1 -1
  120. package/lib/umd/locale/ja-JP.js +1 -1
  121. package/lib/umd/locale/ko-KR.js +1 -1
  122. package/lib/umd/locale/pl-PL.js +1 -1
  123. package/lib/umd/locale/pt-BR.js +1 -1
  124. package/lib/umd/locale/ru-RU.js +1 -1
  125. package/lib/umd/locale/sk-SK.js +1 -1
  126. package/lib/umd/locale/vi-VN.js +1 -1
  127. package/lib/umd/locale/zh-CN.js +1 -1
  128. package/lib/umd/locale/zh-HK.js +1 -1
  129. package/lib/umd/locale/zh-TW.js +1 -1
  130. package/package.json +16 -16
package/lib/cjs/facade.js CHANGED
@@ -449,7 +449,7 @@ var FUniverSheetsUIMixin = class extends _univerjs_core_facade.FUniver {
449
449
  if (!workbook) return;
450
450
  combined$Disposable.dispose();
451
451
  const scrollManagerService = sheetRenderUnit.with(_univerjs_sheets_ui.SheetScrollManagerService);
452
- const selectionService = sheetRenderUnit.with(_univerjs_sheets.SheetsSelectionsService);
452
+ const selectionService = this._tryGetRenderDependency(sheetRenderUnit, _univerjs_sheets.SheetsSelectionsService);
453
453
  combined$Disposable.add(this.registerEventHandler(this.Event.Scroll, () => scrollManagerService.validViewportScrollInfo$.subscribe((params) => {
454
454
  if (!params) return;
455
455
  const eventParams = {
@@ -459,46 +459,56 @@ var FUniverSheetsUIMixin = class extends _univerjs_core_facade.FUniver {
459
459
  };
460
460
  this.fireEvent(this.Event.Scroll, eventParams);
461
461
  })));
462
- combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoveStart, () => selectionService.selectionMoveStart$.subscribe((selections) => {
463
- var _selections$map;
464
- const eventParams = {
465
- workbook,
466
- worksheet: workbook.getActiveSheet(),
467
- selections: (_selections$map = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map !== void 0 ? _selections$map : []
468
- };
469
- this.fireEvent(this.Event.SelectionMoveStart, eventParams);
470
- })));
471
- combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoving, () => selectionService.selectionMoving$.subscribe((selections) => {
472
- var _selections$map2;
473
- const eventParams = {
474
- workbook,
475
- worksheet: workbook.getActiveSheet(),
476
- selections: (_selections$map2 = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map2 !== void 0 ? _selections$map2 : []
477
- };
478
- this.fireEvent(this.Event.SelectionMoving, eventParams);
479
- })));
480
- combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoveEnd, () => selectionService.selectionMoveEnd$.subscribe((selections) => {
481
- var _selections$map3;
482
- const eventParams = {
483
- workbook,
484
- worksheet: workbook.getActiveSheet(),
485
- selections: (_selections$map3 = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map3 !== void 0 ? _selections$map3 : []
486
- };
487
- this.fireEvent(this.Event.SelectionMoveEnd, eventParams);
488
- })));
489
- combined$Disposable.add(this.registerEventHandler(this.Event.SelectionChanged, () => selectionService.selectionChanged$.subscribe((selections) => {
490
- var _selections$map4;
491
- const eventParams = {
492
- workbook,
493
- worksheet: workbook.getActiveSheet(),
494
- selections: (_selections$map4 = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map4 !== void 0 ? _selections$map4 : []
495
- };
496
- this.fireEvent(this.Event.SelectionChanged, eventParams);
497
- })));
462
+ if (selectionService) {
463
+ combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoveStart, () => selectionService.selectionMoveStart$.subscribe((selections) => {
464
+ var _selections$map;
465
+ const eventParams = {
466
+ workbook,
467
+ worksheet: workbook.getActiveSheet(),
468
+ selections: (_selections$map = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map !== void 0 ? _selections$map : []
469
+ };
470
+ this.fireEvent(this.Event.SelectionMoveStart, eventParams);
471
+ })));
472
+ combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoving, () => selectionService.selectionMoving$.subscribe((selections) => {
473
+ var _selections$map2;
474
+ const eventParams = {
475
+ workbook,
476
+ worksheet: workbook.getActiveSheet(),
477
+ selections: (_selections$map2 = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map2 !== void 0 ? _selections$map2 : []
478
+ };
479
+ this.fireEvent(this.Event.SelectionMoving, eventParams);
480
+ })));
481
+ combined$Disposable.add(this.registerEventHandler(this.Event.SelectionMoveEnd, () => selectionService.selectionMoveEnd$.subscribe((selections) => {
482
+ var _selections$map3;
483
+ const eventParams = {
484
+ workbook,
485
+ worksheet: workbook.getActiveSheet(),
486
+ selections: (_selections$map3 = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map3 !== void 0 ? _selections$map3 : []
487
+ };
488
+ this.fireEvent(this.Event.SelectionMoveEnd, eventParams);
489
+ })));
490
+ combined$Disposable.add(this.registerEventHandler(this.Event.SelectionChanged, () => selectionService.selectionChanged$.subscribe((selections) => {
491
+ var _selections$map4;
492
+ const eventParams = {
493
+ workbook,
494
+ worksheet: workbook.getActiveSheet(),
495
+ selections: (_selections$map4 = selections === null || selections === void 0 ? void 0 : selections.map((s) => s.range)) !== null && _selections$map4 !== void 0 ? _selections$map4 : []
496
+ };
497
+ this.fireEvent(this.Event.SelectionChanged, eventParams);
498
+ })));
499
+ }
498
500
  sheetRenderUnit = null;
499
501
  this.disposeWithMe(combined$Disposable);
500
502
  }));
501
503
  }
504
+ _tryGetRenderDependency(render, dependency) {
505
+ try {
506
+ return render.with(dependency);
507
+ } catch (error) {
508
+ if (error instanceof Error && (error.message.includes("DependencyNotFoundError") || error.message.includes("Cannot find"))) return null;
509
+ throw error;
510
+ }
511
+ }
502
512
  /**
503
513
  * @ignore
504
514
  */