@univerjs/ui 1.3.1 → 1.5.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/README.md +7 -19
- package/lib/cjs/facade.js +15 -26
- package/lib/cjs/index.js +973 -707
- package/lib/cjs/locale/ar-SA.js +2 -4
- package/lib/cjs/locale/ca-ES.js +2 -4
- package/lib/cjs/locale/de-DE.js +2 -4
- package/lib/cjs/locale/en-US.js +2 -4
- package/lib/cjs/locale/es-ES.js +2 -4
- package/lib/cjs/locale/fa-IR.js +2 -4
- package/lib/cjs/locale/fr-FR.js +2 -4
- package/lib/cjs/locale/id-ID.js +2 -4
- package/lib/cjs/locale/it-IT.js +2 -4
- package/lib/cjs/locale/ja-JP.js +2 -4
- package/lib/cjs/locale/ko-KR.js +2 -4
- package/lib/cjs/locale/pl-PL.js +2 -4
- package/lib/cjs/locale/pt-BR.js +2 -4
- package/lib/cjs/locale/ru-RU.js +2 -4
- package/lib/cjs/locale/sk-SK.js +2 -4
- package/lib/cjs/locale/vi-VN.js +2 -4
- package/lib/cjs/locale/zh-CN.js +2 -4
- package/lib/cjs/locale/zh-HK.js +2 -4
- package/lib/cjs/locale/zh-TW.js +2 -4
- package/lib/es/facade.js +15 -25
- package/lib/es/index.js +881 -615
- package/lib/es/locale/ar-SA.js +2 -4
- package/lib/es/locale/ca-ES.js +2 -4
- package/lib/es/locale/de-DE.js +2 -4
- package/lib/es/locale/en-US.js +2 -4
- package/lib/es/locale/es-ES.js +2 -4
- package/lib/es/locale/fa-IR.js +2 -4
- package/lib/es/locale/fr-FR.js +2 -4
- package/lib/es/locale/id-ID.js +2 -4
- package/lib/es/locale/it-IT.js +2 -4
- package/lib/es/locale/ja-JP.js +2 -4
- package/lib/es/locale/ko-KR.js +2 -4
- package/lib/es/locale/pl-PL.js +2 -4
- package/lib/es/locale/pt-BR.js +2 -4
- package/lib/es/locale/ru-RU.js +2 -4
- package/lib/es/locale/sk-SK.js +2 -4
- package/lib/es/locale/vi-VN.js +2 -4
- package/lib/es/locale/zh-CN.js +2 -4
- package/lib/es/locale/zh-HK.js +2 -4
- package/lib/es/locale/zh-TW.js +2 -4
- package/lib/facade.js +15 -25
- package/lib/index.css +57 -42
- package/lib/index.js +881 -615
- package/lib/locale/ar-SA.js +2 -4
- package/lib/locale/ca-ES.js +2 -4
- package/lib/locale/de-DE.js +2 -4
- package/lib/locale/en-US.js +2 -4
- package/lib/locale/es-ES.js +2 -4
- package/lib/locale/fa-IR.js +2 -4
- package/lib/locale/fr-FR.js +2 -4
- package/lib/locale/id-ID.js +2 -4
- package/lib/locale/it-IT.js +2 -4
- package/lib/locale/ja-JP.js +2 -4
- package/lib/locale/ko-KR.js +2 -4
- package/lib/locale/pl-PL.js +2 -4
- package/lib/locale/pt-BR.js +2 -4
- package/lib/locale/ru-RU.js +2 -4
- package/lib/locale/sk-SK.js +2 -4
- package/lib/locale/vi-VN.js +2 -4
- package/lib/locale/zh-CN.js +2 -4
- package/lib/locale/zh-HK.js +2 -4
- package/lib/locale/zh-TW.js +2 -4
- package/lib/types/menu/shortcut-panel.menu.d.ts +2 -1
- package/lib/types/mobile-plugin.d.ts +1 -1
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/services/contextmenu/contextmenu-host.service.d.ts +15 -2
- package/lib/types/services/dialog/desktop-dialog.service.d.ts +5 -3
- package/lib/types/services/dialog/mobile-dialog.service.d.ts +2 -1
- package/lib/types/services/dom/canvas-dom-layer.service.d.ts +4 -0
- package/lib/types/services/menu/menu-manager.service.d.ts +2 -0
- package/lib/types/services/menu/menu.d.ts +1 -0
- package/lib/types/services/sidebar/desktop-sidebar.service.d.ts +5 -2
- package/lib/types/utils/di.d.ts +6 -10
- package/lib/types/utils/use-menu-host.d.ts +17 -0
- package/lib/types/views/components/mobile-drawer/MobileDrawer.d.ts +1 -0
- package/lib/types/views/components/popup/RectPopup.d.ts +8 -6
- package/lib/types/views/components/ribbon/ToolbarButton.d.ts +3 -5
- package/lib/types/views/components/ribbon/TooltipButtonWrapper.d.ts +2 -1
- package/lib/types/views/components/ribbon/ribbon-grid-layout.d.ts +2 -0
- package/lib/types/views/components/ribbon/ribbon-menu/use-ribbon-tabs.d.ts +18 -0
- package/lib/types/views/custom-label/CustomLabel.d.ts +1 -0
- package/lib/types/views/emoji-picker/emoji-picker-utils.d.ts +2 -2
- package/lib/types/views/font-family/FontFamily.d.ts +1 -1
- package/lib/types/views/object-permission/ObjectPermissionPanel.d.ts +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +23 -22
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
## Package Overview
|
|
10
10
|
|
|
11
|
-
| Package | UMD global | CSS | Locales | Facade entry |
|
|
12
|
-
| --- | --- | :---: | :---: | :---: |
|
|
13
|
-
| `@univerjs/ui` | `UniverUi` | Yes | Yes | Yes |
|
|
11
|
+
| Package | UMD global | CSS | Locales | Facade entry | Worker entry |
|
|
12
|
+
| --- | --- | :---: | :---: | :---: | :---: |
|
|
13
|
+
| `@univerjs/ui` | `UniverUi` | Yes | Yes | Yes | No |
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
@@ -20,10 +20,10 @@ pnpm add @univerjs/ui
|
|
|
20
20
|
npm install @univerjs/ui
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Keep all `@univerjs/*` packages on the same version.
|
|
24
|
-
|
|
25
23
|
## Usage
|
|
26
24
|
|
|
25
|
+
Start with the [integration setup](https://docs.univer.ai/) for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.
|
|
26
|
+
|
|
27
27
|
```ts
|
|
28
28
|
import '@univerjs/ui/lib/index.css';
|
|
29
29
|
import EnUS from '@univerjs/ui/locale/en-US';
|
|
@@ -39,21 +39,9 @@ Exported plugin classes:
|
|
|
39
39
|
- `UniverUIPlugin`
|
|
40
40
|
- `UniverMobileUIPlugin`
|
|
41
41
|
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
The desktop Start ribbon has one format painter entry. A single click captures a detached
|
|
45
|
-
format snapshot for one application; a double click keeps it active until Escape or another
|
|
46
|
-
click on the entry. Unsupported targets do not consume the snapshot. The canvas displays a
|
|
47
|
-
brush cursor on supported targets and an unavailable cursor elsewhere.
|
|
48
|
-
|
|
49
|
-
`FormatPainterSessionService` coordinates the local session. Host adapters claim the active
|
|
50
|
-
editing context and apply formatting through their domain commands. A higher-priority shape
|
|
51
|
-
selection prevents a stale cell selection from becoming the source. Changing the focused
|
|
52
|
-
Unit or disposing the source Unit cancels the session. The session itself is not persisted.
|
|
42
|
+
## Integration Notes
|
|
53
43
|
|
|
54
|
-
|
|
55
|
-
formatting without removing content. Clearing cancels an active brush; each domain applies
|
|
56
|
-
the change through its undoable commands.
|
|
44
|
+
- Import `@univerjs/ui/facade` when using this package through Univer Facade APIs.
|
|
57
45
|
|
|
58
46
|
## Resources
|
|
59
47
|
|
package/lib/cjs/facade.js
CHANGED
|
@@ -3,7 +3,7 @@ let _univerjs_core_facade = require("@univerjs/core/facade");
|
|
|
3
3
|
let _univerjs_engine_render = require("@univerjs/engine-render");
|
|
4
4
|
let _univerjs_ui = require("@univerjs/ui");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// \0@oxc-project+runtime@0.157.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) {
|
|
@@ -13,28 +13,25 @@ function _typeof(o) {
|
|
|
13
13
|
}, _typeof(o);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function toPrimitive(t, r) {
|
|
16
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPrimitive.js
|
|
17
|
+
function toPrimitive(t, e) {
|
|
19
18
|
if ("object" != _typeof(t) || !t) return t;
|
|
20
|
-
var
|
|
21
|
-
if (void 0 !==
|
|
22
|
-
var i =
|
|
19
|
+
var r;
|
|
20
|
+
if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
|
|
21
|
+
var i = r.call(t, e || "default");
|
|
23
22
|
if ("object" != _typeof(i)) return i;
|
|
24
23
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
25
24
|
}
|
|
26
|
-
return ("string" ===
|
|
25
|
+
return ("string" === e ? String : Number)(t);
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
28
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/toPropertyKey.js
|
|
31
29
|
function toPropertyKey(t) {
|
|
32
30
|
var i = toPrimitive(t, "string");
|
|
33
31
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
34
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/defineProperty.js
|
|
38
35
|
function _defineProperty(e, r, t) {
|
|
39
36
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
40
37
|
value: t,
|
|
@@ -44,16 +41,14 @@ function _defineProperty(e, r, t) {
|
|
|
44
41
|
}) : e[r] = t, e;
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
44
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorateParam.js
|
|
49
45
|
function __decorateParam(paramIndex, decorator) {
|
|
50
46
|
return function(target, key) {
|
|
51
47
|
decorator(target, key, paramIndex);
|
|
52
48
|
};
|
|
53
49
|
}
|
|
54
50
|
|
|
55
|
-
|
|
56
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
51
|
+
// \0@oxc-project+runtime@0.157.0/helpers/esm/decorate.js
|
|
57
52
|
function __decorate(decorators, target, key, desc) {
|
|
58
53
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
59
54
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -61,8 +56,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
61
56
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
62
57
|
}
|
|
63
58
|
|
|
64
|
-
|
|
65
|
-
//#region src/facade/f-menu-builder.ts
|
|
59
|
+
// src/facade/f-menu-builder.ts
|
|
66
60
|
/**
|
|
67
61
|
* @ignore
|
|
68
62
|
*/
|
|
@@ -264,8 +258,7 @@ let FSubmenu = class FSubmenu extends FMenuBase {
|
|
|
264
258
|
};
|
|
265
259
|
FSubmenu = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)), __decorateParam(2, _univerjs_ui.IMenuManagerService)], FSubmenu);
|
|
266
260
|
|
|
267
|
-
|
|
268
|
-
//#region src/facade/f-shortcut.ts
|
|
261
|
+
// src/facade/f-shortcut.ts
|
|
269
262
|
let FShortcut = class FShortcut extends _univerjs_core_facade.FBase {
|
|
270
263
|
constructor(_injector, _renderManagerService, _univerInstanceService, _shortcutService) {
|
|
271
264
|
super();
|
|
@@ -371,8 +364,7 @@ FShortcut = __decorate([
|
|
|
371
364
|
__decorateParam(3, _univerjs_ui.IShortcutService)
|
|
372
365
|
], FShortcut);
|
|
373
366
|
|
|
374
|
-
|
|
375
|
-
//#region src/facade/f-univer.ts
|
|
367
|
+
// src/facade/f-univer.ts
|
|
376
368
|
/**
|
|
377
369
|
* @ignore
|
|
378
370
|
*/
|
|
@@ -452,8 +444,7 @@ var FUniverUIMixin = class extends _univerjs_core_facade.FUniver {
|
|
|
452
444
|
};
|
|
453
445
|
_univerjs_core_facade.FUniver.extend(FUniverUIMixin);
|
|
454
446
|
|
|
455
|
-
|
|
456
|
-
//#region src/facade/f-enum.ts
|
|
447
|
+
// src/facade/f-enum.ts
|
|
457
448
|
/**
|
|
458
449
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
459
450
|
*
|
|
@@ -481,5 +472,3 @@ var FUIEnumMixin = class extends _univerjs_core_facade.FEnum {
|
|
|
481
472
|
}
|
|
482
473
|
};
|
|
483
474
|
_univerjs_core_facade.FEnum.extend(FUIEnumMixin);
|
|
484
|
-
|
|
485
|
-
//#endregion
|