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

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 (113) hide show
  1. package/lib/cjs/facade.js +47 -37
  2. package/lib/cjs/index.js +1161 -272
  3. package/lib/cjs/locale/ar-SA.js +5 -0
  4. package/lib/cjs/locale/ca-ES.js +5 -0
  5. package/lib/cjs/locale/de-DE.js +5 -0
  6. package/lib/cjs/locale/en-US.js +5 -0
  7. package/lib/cjs/locale/es-ES.js +6 -1
  8. package/lib/cjs/locale/fa-IR.js +5 -0
  9. package/lib/cjs/locale/fr-FR.js +5 -0
  10. package/lib/cjs/locale/id-ID.js +5 -0
  11. package/lib/cjs/locale/it-IT.js +5 -0
  12. package/lib/cjs/locale/ja-JP.js +5 -0
  13. package/lib/cjs/locale/ko-KR.js +5 -0
  14. package/lib/cjs/locale/pl-PL.js +5 -0
  15. package/lib/cjs/locale/pt-BR.js +5 -0
  16. package/lib/cjs/locale/ru-RU.js +5 -0
  17. package/lib/cjs/locale/sk-SK.js +5 -0
  18. package/lib/cjs/locale/vi-VN.js +5 -0
  19. package/lib/cjs/locale/zh-CN.js +5 -0
  20. package/lib/cjs/locale/zh-HK.js +5 -0
  21. package/lib/cjs/locale/zh-TW.js +5 -0
  22. package/lib/es/facade.js +47 -37
  23. package/lib/es/index.js +1140 -247
  24. package/lib/es/locale/ar-SA.js +5 -0
  25. package/lib/es/locale/ca-ES.js +5 -0
  26. package/lib/es/locale/de-DE.js +5 -0
  27. package/lib/es/locale/en-US.js +5 -0
  28. package/lib/es/locale/es-ES.js +6 -1
  29. package/lib/es/locale/fa-IR.js +5 -0
  30. package/lib/es/locale/fr-FR.js +5 -0
  31. package/lib/es/locale/id-ID.js +5 -0
  32. package/lib/es/locale/it-IT.js +5 -0
  33. package/lib/es/locale/ja-JP.js +5 -0
  34. package/lib/es/locale/ko-KR.js +5 -0
  35. package/lib/es/locale/pl-PL.js +5 -0
  36. package/lib/es/locale/pt-BR.js +5 -0
  37. package/lib/es/locale/ru-RU.js +5 -0
  38. package/lib/es/locale/sk-SK.js +5 -0
  39. package/lib/es/locale/vi-VN.js +5 -0
  40. package/lib/es/locale/zh-CN.js +5 -0
  41. package/lib/es/locale/zh-HK.js +5 -0
  42. package/lib/es/locale/zh-TW.js +5 -0
  43. package/lib/facade.js +47 -37
  44. package/lib/index.css +4 -0
  45. package/lib/index.js +1140 -247
  46. package/lib/locale/ar-SA.js +5 -0
  47. package/lib/locale/ca-ES.js +5 -0
  48. package/lib/locale/de-DE.js +5 -0
  49. package/lib/locale/en-US.js +5 -0
  50. package/lib/locale/es-ES.js +6 -1
  51. package/lib/locale/fa-IR.js +5 -0
  52. package/lib/locale/fr-FR.js +5 -0
  53. package/lib/locale/id-ID.js +5 -0
  54. package/lib/locale/it-IT.js +5 -0
  55. package/lib/locale/ja-JP.js +5 -0
  56. package/lib/locale/ko-KR.js +5 -0
  57. package/lib/locale/pl-PL.js +5 -0
  58. package/lib/locale/pt-BR.js +5 -0
  59. package/lib/locale/ru-RU.js +5 -0
  60. package/lib/locale/sk-SK.js +5 -0
  61. package/lib/locale/vi-VN.js +5 -0
  62. package/lib/locale/zh-CN.js +5 -0
  63. package/lib/locale/zh-HK.js +5 -0
  64. package/lib/locale/zh-TW.js +5 -0
  65. package/lib/types/commands/commands/set-scroll.command.d.ts +3 -0
  66. package/lib/types/controllers/editor/editing.render-controller.d.ts +1 -0
  67. package/lib/types/controllers/editor/formula-editor.controller.d.ts +1 -0
  68. package/lib/types/controllers/render-controllers/contextmenu.render-controller.d.ts +7 -2
  69. package/lib/types/controllers/render-controllers/editor-bridge.render-controller.d.ts +7 -1
  70. package/lib/types/controllers/render-controllers/header-unhide.render-controller.d.ts +0 -1
  71. package/lib/types/embed-tab-anchor.d.ts +23 -0
  72. package/lib/types/facade/f-univer.d.ts +1 -0
  73. package/lib/types/index.d.ts +16 -3
  74. package/lib/types/locale/en-US.d.ts +5 -0
  75. package/lib/types/services/canvas-pop-manager.service.d.ts +9 -0
  76. package/lib/types/services/cell-popup-manager.service.d.ts +1 -0
  77. package/lib/types/services/editor/cell-editor-resize.service.d.ts +4 -1
  78. package/lib/types/services/editor-bridge.service.d.ts +2 -0
  79. package/lib/types/services/print-interceptor.service.d.ts +8 -0
  80. package/lib/types/services/selection/base-selection-render.service.d.ts +1 -0
  81. package/lib/types/services/sheet-embed-integration.service.d.ts +126 -0
  82. package/lib/types/services/sheet-embed-runtime.service.d.ts +26 -0
  83. package/lib/types/services/sheet-host-chrome-override.service.d.ts +25 -0
  84. package/lib/types/services/sheet-skeleton-manager.service.d.ts +2 -0
  85. package/lib/types/views/border-panel/interface.d.ts +63 -2
  86. package/lib/types/views/editor-container/EditorContainer.d.ts +7 -5
  87. package/lib/types/{menu/mobile-menu.d.ts → views/editor-container/EditorContainer.spec.d.ts} +1 -1
  88. package/lib/types/views/editor-container/focus-editor.d.ts +25 -0
  89. package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarItem.d.ts +2 -1
  90. package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/sheet-tab-drag-sort.d.ts +1 -0
  91. package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.d.ts +2 -1
  92. package/lib/umd/facade.js +1 -1
  93. package/lib/umd/index.js +12 -12
  94. package/lib/umd/locale/ar-SA.js +1 -1
  95. package/lib/umd/locale/ca-ES.js +1 -1
  96. package/lib/umd/locale/de-DE.js +1 -1
  97. package/lib/umd/locale/en-US.js +1 -1
  98. package/lib/umd/locale/es-ES.js +1 -1
  99. package/lib/umd/locale/fa-IR.js +1 -1
  100. package/lib/umd/locale/fr-FR.js +1 -1
  101. package/lib/umd/locale/id-ID.js +1 -1
  102. package/lib/umd/locale/it-IT.js +1 -1
  103. package/lib/umd/locale/ja-JP.js +1 -1
  104. package/lib/umd/locale/ko-KR.js +1 -1
  105. package/lib/umd/locale/pl-PL.js +1 -1
  106. package/lib/umd/locale/pt-BR.js +1 -1
  107. package/lib/umd/locale/ru-RU.js +1 -1
  108. package/lib/umd/locale/sk-SK.js +1 -1
  109. package/lib/umd/locale/vi-VN.js +1 -1
  110. package/lib/umd/locale/zh-CN.js +1 -1
  111. package/lib/umd/locale/zh-HK.js +1 -1
  112. package/lib/umd/locale/zh-TW.js +1 -1
  113. package/package.json +15 -15
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
  */