@univerjs/ui 1.0.0-rc.0 → 1.0.1

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
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/ar-SA.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/ar-SA.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "مسح التنسيق",
7361
+ formatPainter: "نسخ التنسيق",
7361
7362
  accessibility: {
7362
7363
  menu: "القائمة",
7363
7364
  zoom: "التكبير والتصغير",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/ca-ES.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/ca-ES.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Esborra el format",
7361
+ formatPainter: "Copia el format",
7361
7362
  accessibility: {
7362
7363
  menu: "Menú",
7363
7364
  zoom: "Zoom",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/de-DE.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/de-DE.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Formatierung löschen",
7361
+ formatPainter: "Format übertragen",
7361
7362
  accessibility: {
7362
7363
  menu: "Menü",
7363
7364
  zoom: "Zoom",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/en-US.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7373,6 +7372,8 @@ const emojiLocale = {
7373
7372
  * limitations under the License.
7374
7373
  */
7375
7374
  const locale = { ui: {
7375
+ clearFormatting: "Clear formatting",
7376
+ formatPainter: "Format Painter",
7376
7377
  accessibility: {
7377
7378
  menu: "Menu",
7378
7379
  zoom: "Zoom",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/es-ES.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/es-ES.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Borrar formato",
7361
+ formatPainter: "Copiar formato",
7361
7362
  accessibility: {
7362
7363
  menu: "Menú",
7363
7364
  zoom: "Zoom",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/fa-IR.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/fa-IR.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "پاک کردن قالب‌بندی",
7361
+ formatPainter: "کپی قالب‌بندی",
7361
7362
  accessibility: {
7362
7363
  menu: "منو",
7363
7364
  zoom: "بزرگ‌نمایی",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/fr-FR.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/fr-FR.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Effacer la mise en forme",
7361
+ formatPainter: "Reproduire la mise en forme",
7361
7362
  accessibility: {
7362
7363
  menu: "Menu",
7363
7364
  zoom: "Zoom",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/id-ID.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/id-ID.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Hapus pemformatan",
7361
+ formatPainter: "Salin Format",
7361
7362
  accessibility: {
7362
7363
  menu: "Menu",
7363
7364
  zoom: "Zoom",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/it-IT.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/it-IT.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Cancella formattazione",
7361
+ formatPainter: "Copia formato",
7361
7362
  accessibility: {
7362
7363
  menu: "Menu",
7363
7364
  zoom: "Zoom",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/ja-JP.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/ja-JP.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "書式をクリア",
7361
+ formatPainter: "書式のコピー",
7361
7362
  accessibility: {
7362
7363
  menu: "メニュー",
7363
7364
  zoom: "ズーム",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/ko-KR.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/ko-KR.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "서식 지우기",
7361
+ formatPainter: "서식 복사",
7361
7362
  accessibility: {
7362
7363
  menu: "메뉴",
7363
7364
  zoom: "확대/축소",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/pl-PL.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/pl-PL.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Wyczyść formatowanie",
7361
+ formatPainter: "Malarz formatów",
7361
7362
  accessibility: {
7362
7363
  menu: "Menu",
7363
7364
  zoom: "Powiększenie",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/pt-BR.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/pt-BR.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Limpar formatação",
7361
+ formatPainter: "Pincel de Formatação",
7361
7362
  accessibility: {
7362
7363
  menu: "Menu",
7363
7364
  zoom: "Zoom",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/ru-RU.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/ru-RU.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Очистить форматирование",
7361
+ formatPainter: "Формат по образцу",
7361
7362
  accessibility: {
7362
7363
  menu: "Меню",
7363
7364
  zoom: "Масштаб",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/sk-SK.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/sk-SK.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Vymazať formátovanie",
7361
+ formatPainter: "Kopírovať formát",
7361
7362
  accessibility: {
7362
7363
  menu: "Ponuka",
7363
7364
  zoom: "Priblíženie",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/vi-VN.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/vi-VN.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "Xóa định dạng",
7361
+ formatPainter: "Sao chép định dạng",
7361
7362
  accessibility: {
7362
7363
  menu: "Trình đơn",
7363
7364
  zoom: "Thu phóng",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/zh-CN.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/zh-CN.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "清除格式",
7361
+ formatPainter: "格式刷",
7361
7362
  accessibility: {
7362
7363
  menu: "菜单",
7363
7364
  zoom: "缩放",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/zh-HK.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/zh-HK.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "清除格式",
7361
+ formatPainter: "複製格式",
7361
7362
  accessibility: {
7362
7363
  menu: "選單",
7363
7364
  zoom: "縮放",
@@ -1,4 +1,3 @@
1
-
2
1
  //#region src/locale/emoji-locale/zh-TW.generated.ts
3
2
  const emojiLocale = {
4
3
  "emojiSearchIndex": {
@@ -7358,6 +7357,8 @@ const emojiLocale = {
7358
7357
  //#endregion
7359
7358
  //#region src/locale/zh-TW.ts
7360
7359
  const locale = { ui: {
7360
+ clearFormatting: "清除格式",
7361
+ formatPainter: "複製格式",
7361
7362
  accessibility: {
7362
7363
  menu: "選單",
7363
7364
  zoom: "縮放",
package/lib/es/facade.js CHANGED
@@ -3,7 +3,7 @@ import { FBase, FEnum, FUniver } from "@univerjs/core/facade";
3
3
  import { IRenderManagerService } from "@univerjs/engine-render";
4
4
  import { BuiltInUIPart, ComponentManager, CopyCommand, IDialogService, IFontService, IMenuManagerService, IMessageService, IShortcutService, ISidebarService, IUIPartsService, KeyCode, MenuItemType, MenuManagerPosition, PasteCommand, RibbonPosition, RibbonStartGroup, UI_PLUGIN_CONFIG_KEY, connectInjector } from "@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 FUniver {
393
395
  createSubmenu(submenuItem) {
394
396
  return this._injector.createInstance(FSubmenu, submenuItem);
395
397
  }
398
+ updateMenuConfig(config) {
399
+ this._injector.get(IMenuManagerService).updateMenuConfig(config);
400
+ return this;
401
+ }
396
402
  openSidebar(params) {
397
403
  return this._injector.get(ISidebarService).open(params);
398
404
  }