@univerjs/ui 1.0.0-rc.0 → 1.0.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.
Files changed (111) hide show
  1. package/README.md +16 -0
  2. package/lib/cjs/facade.js +12 -6
  3. package/lib/cjs/index.js +1820 -635
  4. package/lib/cjs/locale/ar-SA.js +2 -1
  5. package/lib/cjs/locale/ca-ES.js +2 -1
  6. package/lib/cjs/locale/de-DE.js +2 -1
  7. package/lib/cjs/locale/en-US.js +2 -1
  8. package/lib/cjs/locale/es-ES.js +2 -1
  9. package/lib/cjs/locale/fa-IR.js +2 -1
  10. package/lib/cjs/locale/fr-FR.js +2 -1
  11. package/lib/cjs/locale/id-ID.js +2 -1
  12. package/lib/cjs/locale/it-IT.js +2 -1
  13. package/lib/cjs/locale/ja-JP.js +2 -1
  14. package/lib/cjs/locale/ko-KR.js +2 -1
  15. package/lib/cjs/locale/pl-PL.js +2 -1
  16. package/lib/cjs/locale/pt-BR.js +2 -1
  17. package/lib/cjs/locale/ru-RU.js +2 -1
  18. package/lib/cjs/locale/sk-SK.js +2 -1
  19. package/lib/cjs/locale/vi-VN.js +2 -1
  20. package/lib/cjs/locale/zh-CN.js +2 -1
  21. package/lib/cjs/locale/zh-HK.js +2 -1
  22. package/lib/cjs/locale/zh-TW.js +2 -1
  23. package/lib/es/facade.js +12 -6
  24. package/lib/es/index.js +1815 -638
  25. package/lib/es/locale/ar-SA.js +2 -0
  26. package/lib/es/locale/ca-ES.js +2 -0
  27. package/lib/es/locale/de-DE.js +2 -0
  28. package/lib/es/locale/en-US.js +2 -0
  29. package/lib/es/locale/es-ES.js +2 -0
  30. package/lib/es/locale/fa-IR.js +2 -0
  31. package/lib/es/locale/fr-FR.js +2 -0
  32. package/lib/es/locale/id-ID.js +2 -0
  33. package/lib/es/locale/it-IT.js +2 -0
  34. package/lib/es/locale/ja-JP.js +2 -0
  35. package/lib/es/locale/ko-KR.js +2 -0
  36. package/lib/es/locale/pl-PL.js +2 -0
  37. package/lib/es/locale/pt-BR.js +2 -0
  38. package/lib/es/locale/ru-RU.js +2 -0
  39. package/lib/es/locale/sk-SK.js +2 -0
  40. package/lib/es/locale/vi-VN.js +2 -0
  41. package/lib/es/locale/zh-CN.js +2 -0
  42. package/lib/es/locale/zh-HK.js +2 -0
  43. package/lib/es/locale/zh-TW.js +2 -0
  44. package/lib/facade.js +12 -6
  45. package/lib/index.css +102 -34
  46. package/lib/index.js +1815 -638
  47. package/lib/locale/ar-SA.js +2 -0
  48. package/lib/locale/ca-ES.js +2 -0
  49. package/lib/locale/de-DE.js +2 -0
  50. package/lib/locale/en-US.js +2 -0
  51. package/lib/locale/es-ES.js +2 -0
  52. package/lib/locale/fa-IR.js +2 -0
  53. package/lib/locale/fr-FR.js +2 -0
  54. package/lib/locale/id-ID.js +2 -0
  55. package/lib/locale/it-IT.js +2 -0
  56. package/lib/locale/ja-JP.js +2 -0
  57. package/lib/locale/ko-KR.js +2 -0
  58. package/lib/locale/pl-PL.js +2 -0
  59. package/lib/locale/pt-BR.js +2 -0
  60. package/lib/locale/ru-RU.js +2 -0
  61. package/lib/locale/sk-SK.js +2 -0
  62. package/lib/locale/vi-VN.js +2 -0
  63. package/lib/locale/zh-CN.js +2 -0
  64. package/lib/locale/zh-HK.js +2 -0
  65. package/lib/locale/zh-TW.js +2 -0
  66. package/lib/types/controllers/format-painter.controller.d.ts +25 -0
  67. package/lib/types/facade/f-menu-builder.d.ts +14 -1
  68. package/lib/types/facade/f-univer.d.ts +30 -5
  69. package/lib/types/index.d.ts +10 -0
  70. package/lib/types/locale/en-US.d.ts +2 -0
  71. package/lib/types/menu/format-painter.menu.d.ts +19 -0
  72. package/lib/types/services/contextmenu/contextmenu.service.d.ts +1 -0
  73. package/lib/types/services/format-painter/format-painter-canvas.d.ts +28 -0
  74. package/lib/types/services/format-painter/format-painter-session.service.d.ts +61 -0
  75. package/lib/types/services/menu/menu-manager.service.d.ts +13 -1
  76. package/lib/types/services/menu/menu.d.ts +6 -0
  77. package/lib/types/utils/mobile-canvas-gesture.d.ts +50 -0
  78. package/lib/types/views/components/context-menu/MobileContextMenu.d.ts +6 -0
  79. package/lib/types/views/components/dialog-part/MobileDialogPart.d.ts +5 -0
  80. package/lib/types/views/components/mobile-drawer/MobileDrawer.d.ts +2 -0
  81. package/lib/types/views/components/mobile-zoom-indicator/mobile-zoom-indicator.d.ts +26 -0
  82. package/lib/types/views/components/ribbon/ToolbarButton.d.ts +1 -1
  83. package/lib/types/views/components/sidebar/MobileSidebar.d.ts +5 -0
  84. package/lib/types/views/emoji-picker/emoji-picker-utils.d.ts +1 -1
  85. package/lib/types/views/font-family/MobileFontFamilyDropdown.d.ts +17 -0
  86. package/lib/types/views/menu/mobile/MobileMenu.d.ts +1 -1
  87. package/lib/types/views/mobile-workbench/MobileCanvasLayout.d.ts +42 -0
  88. package/lib/types/views/mobile-workbench/MobileWorkbench.d.ts +2 -0
  89. package/lib/types/views/notification/Notification.d.ts +6 -1
  90. package/lib/umd/facade.js +1 -1
  91. package/lib/umd/index.js +34 -16
  92. package/lib/umd/locale/ar-SA.js +1 -1
  93. package/lib/umd/locale/ca-ES.js +1 -1
  94. package/lib/umd/locale/de-DE.js +1 -1
  95. package/lib/umd/locale/en-US.js +1 -1
  96. package/lib/umd/locale/es-ES.js +1 -1
  97. package/lib/umd/locale/fa-IR.js +1 -1
  98. package/lib/umd/locale/fr-FR.js +1 -1
  99. package/lib/umd/locale/id-ID.js +1 -1
  100. package/lib/umd/locale/it-IT.js +1 -1
  101. package/lib/umd/locale/ja-JP.js +1 -1
  102. package/lib/umd/locale/ko-KR.js +1 -1
  103. package/lib/umd/locale/pl-PL.js +1 -1
  104. package/lib/umd/locale/pt-BR.js +1 -1
  105. package/lib/umd/locale/ru-RU.js +1 -1
  106. package/lib/umd/locale/sk-SK.js +1 -1
  107. package/lib/umd/locale/vi-VN.js +1 -1
  108. package/lib/umd/locale/zh-CN.js +1 -1
  109. package/lib/umd/locale/zh-HK.js +1 -1
  110. package/lib/umd/locale/zh-TW.js +1 -1
  111. package/package.json +12 -12
package/README.md CHANGED
@@ -39,6 +39,22 @@ Exported plugin classes:
39
39
  - `UniverUIPlugin`
40
40
  - `UniverMobileUIPlugin`
41
41
 
42
+ ## Format painter
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.
53
+
54
+ The icon-only clear-formatting button below the format painter resets the active domain's
55
+ formatting without removing content. Clearing cancels an active brush; each domain applies
56
+ the change through its undoable commands.
57
+
42
58
  ## Resources
43
59
 
44
60
  - [Documentation](https://docs.univer.ai)
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
- //#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
6
+ //#region \0@oxc-project+runtime@0.149.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.140.0/helpers/esm/toPrimitive.js
17
+ //#region \0@oxc-project+runtime@0.149.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.140.0/helpers/esm/toPropertyKey.js
30
+ //#region \0@oxc-project+runtime@0.149.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.140.0/helpers/esm/defineProperty.js
37
+ //#region \0@oxc-project+runtime@0.149.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.140.0/helpers/esm/decorateParam.js
48
+ //#region \0@oxc-project+runtime@0.149.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.140.0/helpers/esm/decorate.js
56
+ //#region \0@oxc-project+runtime@0.149.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);
@@ -128,6 +128,7 @@ let FMenu = class FMenu extends FMenuBase {
128
128
  commandId
129
129
  }) };
130
130
  if (typeof _item.order !== "undefined") this._buildingSchema.order = _item.order;
131
+ if (_item.gridLayout) this._buildingSchema.gridLayout = _item.gridLayout;
131
132
  }
132
133
  /**
133
134
  * @ignore
@@ -169,6 +170,7 @@ let FSubmenu = class FSubmenu extends FMenuBase {
169
170
  tooltip: _item.tooltip
170
171
  }) };
171
172
  if (typeof _item.order !== "undefined") this._buildingSchema.order = _item.order;
173
+ if (_item.gridLayout) this._buildingSchema.gridLayout = _item.gridLayout;
172
174
  }
173
175
  /**
174
176
  * Add a menu to the submenu. It can be a {@link FMenu} or a {@link FSubmenu}.
@@ -393,6 +395,10 @@ var FUniverUIMixin = class extends _univerjs_core_facade.FUniver {
393
395
  createSubmenu(submenuItem) {
394
396
  return this._injector.createInstance(FSubmenu, submenuItem);
395
397
  }
398
+ updateMenuConfig(config) {
399
+ this._injector.get(_univerjs_ui.IMenuManagerService).updateMenuConfig(config);
400
+ return this;
401
+ }
396
402
  openSidebar(params) {
397
403
  return this._injector.get(_univerjs_ui.ISidebarService).open(params);
398
404
  }