@univerjs/ui 1.0.0-alpha.7 → 1.0.0-alpha.8

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/facade.js CHANGED
@@ -1,9 +1,9 @@
1
- import { FBase, FEnum, FHooks, FUniver } from "@univerjs/core/facade";
1
+ import { FBase, FEnum, FUniver } from "@univerjs/core/facade";
2
2
  import { IRenderManagerService } from "@univerjs/engine-render";
3
- import { BuiltInUIPart, ComponentManager, CopyCommand, IDialogService, IFontService, IMenuManagerService, IMessageService, IShortcutService, ISidebarService, IUIPartsService, KeyCode, MenuItemType, MenuManagerPosition, PasteCommand, RibbonPosition, RibbonStartGroup, SheetPasteShortKeyCommandName, connectInjector } from "@univerjs/ui";
3
+ import { BuiltInUIPart, ComponentManager, CopyCommand, IDialogService, IFontService, IMenuManagerService, IMessageService, IShortcutService, ISidebarService, IUIPartsService, KeyCode, MenuItemType, MenuManagerPosition, PasteCommand, RibbonPosition, RibbonStartGroup, connectInjector } from "@univerjs/ui";
4
4
  import { CommandType, ICommandService, IUniverInstanceService, Inject, Injector, UniverInstanceType, generateRandomId } from "@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 FBase {
337
337
  triggerShortcut(e) {
338
338
  const workbook = this._univerInstanceService.getCurrentUnitOfType(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 FUniver {
393
393
  createSubmenu(submenuItem) {
394
394
  return this._injector.createInstance(FSubmenu, submenuItem);
395
395
  }
396
- openSiderbar(params) {
397
- return this._injector.get(ISidebarService).open(params);
398
- }
399
396
  openSidebar(params) {
400
- return this.openSiderbar(params);
397
+ return this._injector.get(ISidebarService).open(params);
401
398
  }
402
399
  openDialog(dialog) {
403
400
  const disposable = this._injector.get(IDialogService).open({
@@ -430,7 +427,7 @@ var FUniverUIMixin = class extends FUniver {
430
427
  return this.disposeWithMe(componentManager.register(name, component, options));
431
428
  }
432
429
  setCurrent(unitId) {
433
- if (!this._injector.get(IRenderManagerService).getRenderById(unitId)) throw new Error("Unit not found");
430
+ if (!this._injector.get(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 FUniver {
442
439
  };
443
440
  FUniver.extend(FUniverUIMixin);
444
441
 
445
- //#endregion
446
- //#region src/facade/f-hooks.ts
447
- /**
448
- * @ignore
449
- */
450
- var FHooksSheetsMixin = class extends FHooks {
451
- onBeforeCopy(callback) {
452
- return this._injector.get(ICommandService).beforeCommandExecuted((command) => {
453
- if (command.id === CopyCommand.id) callback();
454
- });
455
- }
456
- onCopy(callback) {
457
- return this._injector.get(ICommandService).onCommandExecuted((command) => {
458
- if (command.id === CopyCommand.id) callback();
459
- });
460
- }
461
- onBeforePaste(callback) {
462
- return this._injector.get(ICommandService).beforeCommandExecuted((command) => {
463
- if (command.id === PasteCommand.id) callback();
464
- });
465
- }
466
- onPaste(callback) {
467
- return this._injector.get(ICommandService).onCommandExecuted((command) => {
468
- if (command.id === PasteCommand.id || command.id === SheetPasteShortKeyCommandName) callback();
469
- });
470
- }
471
- };
472
- FHooks.extend(FHooksSheetsMixin);
473
-
474
442
  //#endregion
475
443
  //#region src/facade/f-enum.ts
476
444
  /**
package/lib/index.css CHANGED
@@ -97,6 +97,10 @@
97
97
  z-index: 20;
98
98
  }
99
99
 
100
+ .univer-z-50 {
101
+ z-index: 50;
102
+ }
103
+
100
104
  .univer-z-\[100\] {
101
105
  z-index: 100;
102
106
  }
@@ -131,6 +135,10 @@
131
135
  margin-bottom: 0;
132
136
  }
133
137
 
138
+ .univer-ml-2 {
139
+ margin-left: .5rem;
140
+ }
141
+
134
142
  .univer-ml-auto {
135
143
  margin-left: auto;
136
144
  }
@@ -272,10 +280,22 @@
272
280
  height: 2.5rem;
273
281
  }
274
282
 
283
+ .univer-h-11 {
284
+ height: 2.75rem;
285
+ }
286
+
287
+ .univer-h-2 {
288
+ height: .5rem;
289
+ }
290
+
275
291
  .univer-h-4 {
276
292
  height: 1rem;
277
293
  }
278
294
 
295
+ .univer-h-5 {
296
+ height: 1.25rem;
297
+ }
298
+
279
299
  .univer-h-6 {
280
300
  height: 1.5rem;
281
301
  }
@@ -356,10 +376,18 @@
356
376
  width: .25rem;
357
377
  }
358
378
 
379
+ .univer-w-1\/3 {
380
+ width: 33.3333%;
381
+ }
382
+
359
383
  .univer-w-10 {
360
384
  width: 2.5rem;
361
385
  }
362
386
 
387
+ .univer-w-14 {
388
+ width: 3.5rem;
389
+ }
390
+
363
391
  .univer-w-24 {
364
392
  width: 6rem;
365
393
  }
@@ -529,6 +557,16 @@
529
557
  transform: translate(var(--univer-tw-translate-x), var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skewX(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));
530
558
  }
531
559
 
560
+ @keyframes univer-pulse {
561
+ 50% {
562
+ opacity: .5;
563
+ }
564
+ }
565
+
566
+ .univer-animate-pulse {
567
+ animation: 2s cubic-bezier(.4, 0, .6, 1) infinite univer-pulse;
568
+ }
569
+
532
570
  .univer-cursor-col-resize {
533
571
  cursor: col-resize;
534
572
  }
@@ -847,6 +885,10 @@
847
885
  border-bottom-width: 3px;
848
886
  }
849
887
 
888
+ .univer-border-t {
889
+ border-top-width: 1px;
890
+ }
891
+
850
892
  .univer-border-solid {
851
893
  border-style: solid;
852
894
  }
@@ -1521,6 +1563,12 @@
1521
1563
  background-color: #0000;
1522
1564
  }
1523
1565
 
1566
+ @media (prefers-reduced-motion: reduce) {
1567
+ .motion-reduce\:univer-animate-none {
1568
+ animation: none;
1569
+ }
1570
+ }
1571
+
1524
1572
  @media (min-width: 640px) {
1525
1573
  .sm\:\!univer-flex {
1526
1574
  display: flex !important;