@univerjs/ui 1.0.0-alpha.7 → 1.0.0-beta.0

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/cjs/facade.js CHANGED
@@ -3,7 +3,7 @@ let _univerjs_engine_render = require("@univerjs/engine-render");
3
3
  let _univerjs_ui = require("@univerjs/ui");
4
4
  let _univerjs_core = require("@univerjs/core");
5
5
 
6
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
6
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
7
7
  function _typeof(o) {
8
8
  "@babel/helpers - typeof";
9
9
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -14,7 +14,7 @@ function _typeof(o) {
14
14
  }
15
15
 
16
16
  //#endregion
17
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
17
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
18
18
  function toPrimitive(t, r) {
19
19
  if ("object" != _typeof(t) || !t) return t;
20
20
  var e = t[Symbol.toPrimitive];
@@ -27,14 +27,14 @@ function toPrimitive(t, r) {
27
27
  }
28
28
 
29
29
  //#endregion
30
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
30
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
31
31
  function toPropertyKey(t) {
32
32
  var i = toPrimitive(t, "string");
33
33
  return "symbol" == _typeof(i) ? i : i + "";
34
34
  }
35
35
 
36
36
  //#endregion
37
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
37
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
38
38
  function _defineProperty(e, r, t) {
39
39
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
40
40
  value: t,
@@ -45,7 +45,7 @@ function _defineProperty(e, r, t) {
45
45
  }
46
46
 
47
47
  //#endregion
48
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
48
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
49
49
  function __decorateParam(paramIndex, decorator) {
50
50
  return function(target, key) {
51
51
  decorator(target, key, paramIndex);
@@ -53,7 +53,7 @@ function __decorateParam(paramIndex, decorator) {
53
53
  }
54
54
 
55
55
  //#endregion
56
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
56
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
57
57
  function __decorate(decorators, target, key, desc) {
58
58
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
59
59
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -337,7 +337,7 @@ let FShortcut = class FShortcut extends _univerjs_core_facade.FBase {
337
337
  triggerShortcut(e) {
338
338
  const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
339
339
  if (!workbook) return;
340
- const renderUnit = this._renderManagerService.getRenderById(workbook.getUnitId());
340
+ const renderUnit = this._renderManagerService.getRenderUnitById(workbook.getUnitId());
341
341
  if (!renderUnit) return;
342
342
  renderUnit.engine.getCanvasElement().dispatchEvent(e);
343
343
  return this._shortcutService.dispatch(e);
@@ -393,11 +393,8 @@ var FUniverUIMixin = class extends _univerjs_core_facade.FUniver {
393
393
  createSubmenu(submenuItem) {
394
394
  return this._injector.createInstance(FSubmenu, submenuItem);
395
395
  }
396
- openSiderbar(params) {
397
- return this._injector.get(_univerjs_ui.ISidebarService).open(params);
398
- }
399
396
  openSidebar(params) {
400
- return this.openSiderbar(params);
397
+ return this._injector.get(_univerjs_ui.ISidebarService).open(params);
401
398
  }
402
399
  openDialog(dialog) {
403
400
  const disposable = this._injector.get(_univerjs_ui.IDialogService).open({
@@ -430,7 +427,7 @@ var FUniverUIMixin = class extends _univerjs_core_facade.FUniver {
430
427
  return this.disposeWithMe(componentManager.register(name, component, options));
431
428
  }
432
429
  setCurrent(unitId) {
433
- if (!this._injector.get(_univerjs_engine_render.IRenderManagerService).getRenderById(unitId)) throw new Error("Unit not found");
430
+ if (!this._injector.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(unitId)) throw new Error("Unit not found");
434
431
  this._univerInstanceService.setCurrentUnitForType(unitId);
435
432
  }
436
433
  addFonts(fonts) {
@@ -442,35 +439,6 @@ var FUniverUIMixin = class extends _univerjs_core_facade.FUniver {
442
439
  };
443
440
  _univerjs_core_facade.FUniver.extend(FUniverUIMixin);
444
441
 
445
- //#endregion
446
- //#region src/facade/f-hooks.ts
447
- /**
448
- * @ignore
449
- */
450
- var FHooksSheetsMixin = class extends _univerjs_core_facade.FHooks {
451
- onBeforeCopy(callback) {
452
- return this._injector.get(_univerjs_core.ICommandService).beforeCommandExecuted((command) => {
453
- if (command.id === _univerjs_ui.CopyCommand.id) callback();
454
- });
455
- }
456
- onCopy(callback) {
457
- return this._injector.get(_univerjs_core.ICommandService).onCommandExecuted((command) => {
458
- if (command.id === _univerjs_ui.CopyCommand.id) callback();
459
- });
460
- }
461
- onBeforePaste(callback) {
462
- return this._injector.get(_univerjs_core.ICommandService).beforeCommandExecuted((command) => {
463
- if (command.id === _univerjs_ui.PasteCommand.id) callback();
464
- });
465
- }
466
- onPaste(callback) {
467
- return this._injector.get(_univerjs_core.ICommandService).onCommandExecuted((command) => {
468
- if (command.id === _univerjs_ui.PasteCommand.id || command.id === _univerjs_ui.SheetPasteShortKeyCommandName) callback();
469
- });
470
- }
471
- };
472
- _univerjs_core_facade.FHooks.extend(FHooksSheetsMixin);
473
-
474
442
  //#endregion
475
443
  //#region src/facade/f-enum.ts
476
444
  /**