@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 +9 -41
- package/lib/cjs/index.js +744 -525
- package/lib/es/facade.js +11 -43
- package/lib/es/index.js +747 -531
- package/lib/facade.js +11 -43
- package/lib/index.css +49 -8
- package/lib/index.js +747 -531
- package/lib/types/facade/f-univer.d.ts +0 -8
- package/lib/types/facade/index.d.ts +0 -2
- package/lib/types/index.d.ts +3 -2
- package/lib/types/services/dom/canvas-dom-layer.service.d.ts +3 -0
- package/lib/types/services/parts/parts.service.d.ts +3 -0
- package/lib/types/services/shortcut/shortcut.service.d.ts +17 -0
- package/lib/types/services/workbench/workbench.service.d.ts +30 -0
- package/lib/types/views/components/context-menu/ContextMenuPanel.d.ts +2 -1
- package/lib/types/views/components/workbench-skeleton/WorkbenchSkeleton.d.ts +22 -0
- package/lib/types/views/emoji-picker/emoji-picker-utils.d.ts +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +17 -14
- package/package.json +8 -8
- package/lib/types/facade/f-hooks.d.ts +0 -63
package/lib/facade.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FBase, FEnum,
|
|
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,
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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).
|
|
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
|
@@ -27,10 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.univer-inset-0 {
|
|
30
|
-
|
|
31
|
-
bottom: 0;
|
|
32
|
-
left: 0;
|
|
33
|
-
right: 0;
|
|
30
|
+
inset: 0;
|
|
34
31
|
}
|
|
35
32
|
|
|
36
33
|
.\!univer-top-auto {
|
|
@@ -97,6 +94,10 @@
|
|
|
97
94
|
z-index: 20;
|
|
98
95
|
}
|
|
99
96
|
|
|
97
|
+
.univer-z-50 {
|
|
98
|
+
z-index: 50;
|
|
99
|
+
}
|
|
100
|
+
|
|
100
101
|
.univer-z-\[100\] {
|
|
101
102
|
z-index: 100;
|
|
102
103
|
}
|
|
@@ -131,6 +132,10 @@
|
|
|
131
132
|
margin-bottom: 0;
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
.univer-ml-2 {
|
|
136
|
+
margin-left: .5rem;
|
|
137
|
+
}
|
|
138
|
+
|
|
134
139
|
.univer-ml-auto {
|
|
135
140
|
margin-left: auto;
|
|
136
141
|
}
|
|
@@ -272,10 +277,22 @@
|
|
|
272
277
|
height: 2.5rem;
|
|
273
278
|
}
|
|
274
279
|
|
|
280
|
+
.univer-h-11 {
|
|
281
|
+
height: 2.75rem;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.univer-h-2 {
|
|
285
|
+
height: .5rem;
|
|
286
|
+
}
|
|
287
|
+
|
|
275
288
|
.univer-h-4 {
|
|
276
289
|
height: 1rem;
|
|
277
290
|
}
|
|
278
291
|
|
|
292
|
+
.univer-h-5 {
|
|
293
|
+
height: 1.25rem;
|
|
294
|
+
}
|
|
295
|
+
|
|
279
296
|
.univer-h-6 {
|
|
280
297
|
height: 1.5rem;
|
|
281
298
|
}
|
|
@@ -356,10 +373,18 @@
|
|
|
356
373
|
width: .25rem;
|
|
357
374
|
}
|
|
358
375
|
|
|
376
|
+
.univer-w-1\/3 {
|
|
377
|
+
width: 33.3333%;
|
|
378
|
+
}
|
|
379
|
+
|
|
359
380
|
.univer-w-10 {
|
|
360
381
|
width: 2.5rem;
|
|
361
382
|
}
|
|
362
383
|
|
|
384
|
+
.univer-w-14 {
|
|
385
|
+
width: 3.5rem;
|
|
386
|
+
}
|
|
387
|
+
|
|
363
388
|
.univer-w-24 {
|
|
364
389
|
width: 6rem;
|
|
365
390
|
}
|
|
@@ -529,6 +554,16 @@
|
|
|
529
554
|
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
555
|
}
|
|
531
556
|
|
|
557
|
+
@keyframes univer-pulse {
|
|
558
|
+
50% {
|
|
559
|
+
opacity: .5;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.univer-animate-pulse {
|
|
564
|
+
animation: 2s cubic-bezier(.4, 0, .6, 1) infinite univer-pulse;
|
|
565
|
+
}
|
|
566
|
+
|
|
532
567
|
.univer-cursor-col-resize {
|
|
533
568
|
cursor: col-resize;
|
|
534
569
|
}
|
|
@@ -554,7 +589,6 @@
|
|
|
554
589
|
}
|
|
555
590
|
|
|
556
591
|
.univer-appearance-none {
|
|
557
|
-
-webkit-appearance: none;
|
|
558
592
|
appearance: none;
|
|
559
593
|
}
|
|
560
594
|
|
|
@@ -847,6 +881,10 @@
|
|
|
847
881
|
border-bottom-width: 3px;
|
|
848
882
|
}
|
|
849
883
|
|
|
884
|
+
.univer-border-t {
|
|
885
|
+
border-top-width: 1px;
|
|
886
|
+
}
|
|
887
|
+
|
|
850
888
|
.univer-border-solid {
|
|
851
889
|
border-style: solid;
|
|
852
890
|
}
|
|
@@ -1521,6 +1559,12 @@
|
|
|
1521
1559
|
background-color: #0000;
|
|
1522
1560
|
}
|
|
1523
1561
|
|
|
1562
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1563
|
+
.motion-reduce\:univer-animate-none {
|
|
1564
|
+
animation: none;
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1524
1568
|
@media (min-width: 640px) {
|
|
1525
1569
|
.sm\:\!univer-flex {
|
|
1526
1570
|
display: flex !important;
|
|
@@ -1747,7 +1791,6 @@
|
|
|
1747
1791
|
}
|
|
1748
1792
|
|
|
1749
1793
|
.\[\&\>\*\]\:univer-appearance-none > * {
|
|
1750
|
-
-webkit-appearance: none;
|
|
1751
1794
|
appearance: none;
|
|
1752
1795
|
}
|
|
1753
1796
|
|
|
@@ -1989,7 +2032,6 @@
|
|
|
1989
2032
|
}
|
|
1990
2033
|
|
|
1991
2034
|
.\[\&_button\]\:\!univer-appearance-none button {
|
|
1992
|
-
-webkit-appearance: none !important;
|
|
1993
2035
|
appearance: none !important;
|
|
1994
2036
|
}
|
|
1995
2037
|
|
|
@@ -2047,7 +2089,6 @@
|
|
|
2047
2089
|
}
|
|
2048
2090
|
|
|
2049
2091
|
.\[\&_input\]\:\!univer-appearance-none input {
|
|
2050
|
-
-webkit-appearance: none !important;
|
|
2051
2092
|
appearance: none !important;
|
|
2052
2093
|
}
|
|
2053
2094
|
|