@univerjs/ui 0.5.4 → 0.5.5-experimental.20250122-3362a4a

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 (69) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +23 -32
  3. package/lib/cjs/locale/en-US.js +1 -1
  4. package/lib/cjs/locale/fa-IR.js +1 -1
  5. package/lib/cjs/locale/fr-FR.js +1 -1
  6. package/lib/cjs/locale/ru-RU.js +1 -1
  7. package/lib/cjs/locale/vi-VN.js +1 -1
  8. package/lib/cjs/locale/zh-CN.js +1 -1
  9. package/lib/cjs/locale/zh-TW.js +1 -1
  10. package/lib/es/facade.js +149 -137
  11. package/lib/es/index.js +5756 -6080
  12. package/lib/es/locale/en-US.js +2 -2
  13. package/lib/es/locale/fa-IR.js +2 -2
  14. package/lib/es/locale/fr-FR.js +2 -2
  15. package/lib/es/locale/ru-RU.js +2 -2
  16. package/lib/es/locale/vi-VN.js +2 -2
  17. package/lib/es/locale/zh-CN.js +2 -2
  18. package/lib/es/locale/zh-TW.js +2 -2
  19. package/lib/index.css +1 -1
  20. package/lib/types/components/custom-label/CustomLabel.d.ts +2 -2
  21. package/lib/types/components/font-family/FontFamily.d.ts +1 -2
  22. package/lib/types/components/font-family/FontFamilyItem.d.ts +1 -2
  23. package/lib/types/components/font-size/FontSize.d.ts +1 -2
  24. package/lib/types/components/hooks/index.d.ts +20 -0
  25. package/lib/types/components/hooks/update-effect.d.ts +2 -0
  26. package/lib/types/components/hooks/useClickOutSide.d.ts +5 -0
  27. package/lib/types/components/menu/desktop/Menu.d.ts +1 -2
  28. package/lib/types/components/menu/mobile/MobileMenu.d.ts +1 -2
  29. package/lib/types/components/menu/mobile/MobileMenu.stories.d.ts +1 -2
  30. package/lib/types/components/notification/Notification.d.ts +2 -3
  31. package/lib/types/components/notification/Notification.stories.d.ts +1 -2
  32. package/lib/types/components/progress-bar/ProgressBar.d.ts +16 -2
  33. package/lib/types/controllers/ui/ui-mobile.controller.d.ts +3 -3
  34. package/lib/types/facade/f-menu-builder.d.ts +4 -0
  35. package/lib/types/facade/f-shortcut.d.ts +3 -0
  36. package/lib/types/facade/f-univer.d.ts +11 -1
  37. package/lib/types/index.d.ts +3 -5
  38. package/lib/types/services/clipboard/clipboard-interface.service.d.ts +1 -0
  39. package/lib/types/services/parts/parts.service.d.ts +2 -1
  40. package/lib/types/views/MobileApp.d.ts +1 -2
  41. package/lib/types/views/components/ComponentContainer.d.ts +1 -1
  42. package/lib/types/views/components/confirm-part/ConfirmPart.d.ts +16 -2
  43. package/lib/types/views/components/context-menu/ContextMenu.d.ts +16 -2
  44. package/lib/types/views/components/context-menu/MobileContextMenu.d.ts +16 -2
  45. package/lib/types/views/components/dialog-part/DialogPart.d.ts +16 -2
  46. package/lib/types/views/components/dom/FloatDom.d.ts +16 -2
  47. package/lib/types/views/components/global-zone/GlobalZone.d.ts +16 -2
  48. package/lib/types/views/components/popup/CanvasPopup.d.ts +16 -2
  49. package/lib/types/views/components/popup/RectPopup.d.ts +3 -2
  50. package/lib/types/views/components/popup/dom-popup.d.ts +12 -0
  51. package/lib/types/views/components/popup/single-canvas-popup.d.ts +9 -0
  52. package/lib/types/views/components/ribbon/Button/ToolbarButton.d.ts +1 -1
  53. package/lib/types/views/components/ribbon/Ribbon.d.ts +2 -2
  54. package/lib/types/views/components/ribbon/TooltipButtonWrapper.d.ts +1 -1
  55. package/lib/types/views/components/shortcut-panel/ShortcutPanel.d.ts +16 -2
  56. package/lib/types/views/components/sidebar/Sidebar.d.ts +16 -2
  57. package/lib/types/views/components/zen-zone/ZenZone.d.ts +16 -2
  58. package/lib/types/views/workbench/Workbench.d.ts +1 -2
  59. package/lib/umd/facade.js +1 -1
  60. package/lib/umd/index.js +23 -32
  61. package/lib/umd/locale/en-US.js +1 -1
  62. package/lib/umd/locale/fa-IR.js +1 -1
  63. package/lib/umd/locale/fr-FR.js +1 -1
  64. package/lib/umd/locale/ru-RU.js +1 -1
  65. package/lib/umd/locale/vi-VN.js +1 -1
  66. package/lib/umd/locale/zh-CN.js +1 -1
  67. package/lib/umd/locale/zh-TW.js +1 -1
  68. package/package.json +7 -7
  69. package/LICENSE +0 -176
@@ -1 +1 @@
1
- "use strict";const e={ribbon:{start:"Start",insert:"Insert",formulas:"Formulas",data:"Data",view:"View",others:"Others",more:"More"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"Microsoft YaHei",SimSun:"SimSun",SimHei:"SimHei",Kaiti:"Kaiti",FangSong:"FangSong",NSimSun:"NSimSun",STXinwei:"STXinwei",STXingkai:"STXingkai",STLiti:"STLiti",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"Shortcuts"},shortcut:{undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste","shortcut-panel":"Toggle Shortcut Panel"},"common-edit":"Common Editing Shortcuts","toggle-shortcut-panel":"Toggle Shortcut Panel",clipboard:{authentication:{title:"Permission Denied",content:"Please allow Univer to access your clipboard."}},textEditor:{formulaError:"Please enter a valid formula, such as =SUM(A1)",rangeError:"Please enter a valid range, such as A1:B10"},rangeSelector:{title:"Select a data range",addAnotherRange:"Add range",buttonTooltip:"Select data range",placeHolder:"Select range or enter.",confirm:"Confirm",cancel:"Cancel"},"global-shortcut":"Global Shortcut"};module.exports=e;
1
+ "use strict";const locale={ribbon:{start:"Start",insert:"Insert",formulas:"Formulas",data:"Data",view:"View",others:"Others",more:"More"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"Microsoft YaHei",SimSun:"SimSun",SimHei:"SimHei",Kaiti:"Kaiti",FangSong:"FangSong",NSimSun:"NSimSun",STXinwei:"STXinwei",STXingkai:"STXingkai",STLiti:"STLiti",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"Shortcuts"},shortcut:{undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste","shortcut-panel":"Toggle Shortcut Panel"},"common-edit":"Common Editing Shortcuts","toggle-shortcut-panel":"Toggle Shortcut Panel",clipboard:{authentication:{title:"Permission Denied",content:"Please allow Univer to access your clipboard."}},textEditor:{formulaError:"Please enter a valid formula, such as =SUM(A1)",rangeError:"Please enter a valid range, such as A1:B10"},rangeSelector:{title:"Select a data range",addAnotherRange:"Add range",buttonTooltip:"Select data range",placeHolder:"Select range or enter.",confirm:"Confirm",cancel:"Cancel"},"global-shortcut":"Global Shortcut"};module.exports=locale;
@@ -1 +1 @@
1
- "use strict";const i={ribbon:{start:"شروع",insert:"درج",formulas:"فرمول‌ها",data:"داده‌ها",view:"نمایش",others:"دیگر",more:"بیشتر"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"Microsoft YaHei",SimSun:"SimSun",SimHei:"SimHei",Kaiti:"Kaiti",FangSong:"FangSong",NSimSun:"NSimSun",STXinwei:"STXinwei",STXingkai:"STXingkai",STLiti:"STLiti",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"کلیدهای میانبر"},shortcut:{undo:"بازگرداندن",redo:"تکرار",cut:"بریدن",copy:"کپی کردن",paste:"چسباندن","shortcut-panel":"نمایش/مخفی کردن پنل کلیدهای میانبر"},"common-edit":"کلیدهای میانبر ویرایش عمومی","toggle-shortcut-panel":"نمایش/مخفی کردن پنل کلیدهای میانبر",clipboard:{authentication:{title:"اجازه دسترسی داده نشده است",content:"لطفا به Univer اجازه دسترسی به کلیپ بورد خود را بدهید."}},textEditor:{formulaError:"لطفا یک فرمول معتبر مانند =SUM(A1) وارد کنید.",rangeError:"لطفا یک محدوده معتبر مانند A1:B10 وارد کنید."},rangeSelector:{title:"انتخاب محدوده داده",addAnotherRange:"افزودن محدوده",buttonTooltip:"انتخاب محدوده داده",placeHolder:"انتخاب محدوده یا وارد کردن.",confirm:"تایید",cancel:"انصراف"},"global-shortcut":"کلید میانبر جهانی"};module.exports=i;
1
+ "use strict";const locale={ribbon:{start:"شروع",insert:"درج",formulas:"فرمول‌ها",data:"داده‌ها",view:"نمایش",others:"دیگر",more:"بیشتر"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"Microsoft YaHei",SimSun:"SimSun",SimHei:"SimHei",Kaiti:"Kaiti",FangSong:"FangSong",NSimSun:"NSimSun",STXinwei:"STXinwei",STXingkai:"STXingkai",STLiti:"STLiti",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"کلیدهای میانبر"},shortcut:{undo:"بازگرداندن",redo:"تکرار",cut:"بریدن",copy:"کپی کردن",paste:"چسباندن","shortcut-panel":"نمایش/مخفی کردن پنل کلیدهای میانبر"},"common-edit":"کلیدهای میانبر ویرایش عمومی","toggle-shortcut-panel":"نمایش/مخفی کردن پنل کلیدهای میانبر",clipboard:{authentication:{title:"اجازه دسترسی داده نشده است",content:"لطفا به Univer اجازه دسترسی به کلیپ بورد خود را بدهید."}},textEditor:{formulaError:"لطفا یک فرمول معتبر مانند =SUM(A1) وارد کنید.",rangeError:"لطفا یک محدوده معتبر مانند A1:B10 وارد کنید."},rangeSelector:{title:"انتخاب محدوده داده",addAnotherRange:"افزودن محدوده",buttonTooltip:"انتخاب محدوده داده",placeHolder:"انتخاب محدوده یا وارد کردن.",confirm:"تایید",cancel:"انصراف"},"global-shortcut":"کلید میانبر جهانی"};module.exports=locale;
@@ -1 +1 @@
1
- "use strict";const e={ribbon:{start:"Démarrer",insert:"Insérer",formulas:"Formules",data:"Données",view:"Vue",others:"Autres",more:"Plus"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"Microsoft YaHei",SimSun:"SimSun",SimHei:"SimHei",Kaiti:"Kaiti",FangSong:"FangSong",NSimSun:"NSimSun",STXinwei:"STXinwei",STXingkai:"STXingkai",STLiti:"STLiti",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"Raccourcis"},shortcut:{undo:"Annuler",redo:"Refaire",cut:"Couper",copy:"Copier",paste:"Coller","shortcut-panel":"Basculer le panneau de raccourcis"},"common-edit":"Raccourcis d'édition courants","toggle-shortcut-panel":"Basculer le panneau de raccourcis",clipboard:{authentication:{title:"Permission refusée",content:"Veuillez autoriser Univer à accéder à votre presse-papiers."}},textEditor:{formulaError:"Veuillez entrer une formule valide, telle que =SOMME(A1)",rangeError:"Veuillez entrer une plage valide, telle que A1:B10"},rangeSelector:{title:"Sélectionner une plage de données",addAnotherRange:"Ajouter une plage",buttonTooltip:"Sélectionner une plage de données",placeHolder:"Sélectionner une plage ou entrer.",confirm:"Confirmer",cancel:"Annuler"},"global-shortcut":"Raccourci global"};module.exports=e;
1
+ "use strict";const locale={ribbon:{start:"Démarrer",insert:"Insérer",formulas:"Formules",data:"Données",view:"Vue",others:"Autres",more:"Plus"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"Microsoft YaHei",SimSun:"SimSun",SimHei:"SimHei",Kaiti:"Kaiti",FangSong:"FangSong",NSimSun:"NSimSun",STXinwei:"STXinwei",STXingkai:"STXingkai",STLiti:"STLiti",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"Raccourcis"},shortcut:{undo:"Annuler",redo:"Refaire",cut:"Couper",copy:"Copier",paste:"Coller","shortcut-panel":"Basculer le panneau de raccourcis"},"common-edit":"Raccourcis d'édition courants","toggle-shortcut-panel":"Basculer le panneau de raccourcis",clipboard:{authentication:{title:"Permission refusée",content:"Veuillez autoriser Univer à accéder à votre presse-papiers."}},textEditor:{formulaError:"Veuillez entrer une formule valide, telle que =SOMME(A1)",rangeError:"Veuillez entrer une plage valide, telle que A1:B10"},rangeSelector:{title:"Sélectionner une plage de données",addAnotherRange:"Ajouter une plage",buttonTooltip:"Sélectionner une plage de données",placeHolder:"Sélectionner une plage ou entrer.",confirm:"Confirmer",cancel:"Annuler"},"global-shortcut":"Raccourci global"};module.exports=locale;
@@ -1 +1 @@
1
- "use strict";const i={ribbon:{start:"Начало",insert:"Вставка",formulas:"Формулы",data:"Данные",view:"Вид",others:"Другие",more:"Больше"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"Microsoft YaHei",SimSun:"SimSun",SimHei:"SimHei",Kaiti:"Kaiti",FangSong:"FangSong",NSimSun:"NSimSun",STXinwei:"STXinwei",STXingkai:"STXingkai",STLiti:"STLiti",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"Ярлыки"},shortcut:{undo:"Отменить",redo:"Повторить",cut:"Вырезать",copy:"Копировать",paste:"Вставить","shortcut-panel":"Переключить панель ярлыков"},"common-edit":"Общие команды редактирования","toggle-shortcut-panel":"Переключить панель ярлыков",clipboard:{authentication:{title:"Доступ запрещен",content:"Пожалуйста, разрешите Univer доступ к вашему буферу обмена."}},textEditor:{formulaError:"Пожалуйста, введите корректную формулу, например =SUM(A1)",rangeError:"Пожалуйста, введите корректный диапазон, например A1:B10"},rangeSelector:{title:"Выберите диапазон данных",addAnotherRange:"Добавить диапазон",buttonTooltip:"Выбрать диапазон данных",placeHolder:"Выберите диапазон или введите.",confirm:"Подтвердить",cancel:"Отменить"},"global-shortcut":"Глобальные ярлыки"};module.exports=i;
1
+ "use strict";const locale={ribbon:{start:"Начало",insert:"Вставка",formulas:"Формулы",data:"Данные",view:"Вид",others:"Другие",more:"Больше"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"Microsoft YaHei",SimSun:"SimSun",SimHei:"SimHei",Kaiti:"Kaiti",FangSong:"FangSong",NSimSun:"NSimSun",STXinwei:"STXinwei",STXingkai:"STXingkai",STLiti:"STLiti",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"Ярлыки"},shortcut:{undo:"Отменить",redo:"Повторить",cut:"Вырезать",copy:"Копировать",paste:"Вставить","shortcut-panel":"Переключить панель ярлыков"},"common-edit":"Общие команды редактирования","toggle-shortcut-panel":"Переключить панель ярлыков",clipboard:{authentication:{title:"Доступ запрещен",content:"Пожалуйста, разрешите Univer доступ к вашему буферу обмена."}},textEditor:{formulaError:"Пожалуйста, введите корректную формулу, например =SUM(A1)",rangeError:"Пожалуйста, введите корректный диапазон, например A1:B10"},rangeSelector:{title:"Выберите диапазон данных",addAnotherRange:"Добавить диапазон",buttonTooltip:"Выбрать диапазон данных",placeHolder:"Выберите диапазон или введите.",confirm:"Подтвердить",cancel:"Отменить"},"global-shortcut":"Глобальные ярлыки"};module.exports=locale;
@@ -1 +1 @@
1
- "use strict";const n={ribbon:{start:"Bắt đầu",insert:"Chèn",formulas:"Công thức",data:"Dữ liệu",view:"Xem",others:"Khác",more:"Thêm"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"Microsoft YaHei",SimSun:"SimSun",SimHei:"SimHei",Kaiti:"Kaiti",FangSong:"FangSong",NSimSun:"NSimSun",STXinwei:"STXinwei",STXingkai:"STXingkai",STLiti:"STLiti",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"Bảng phím tắt"},shortcut:{undo:"Hoàn tác",redo:"Làm lại",cut:"Cắt",copy:"Sao chép",paste:"Dán","shortcut-panel":"Mở/Đóng bảng phím tắt"},"common-edit":"Chỉnh sửa thường dùng","toggle-shortcut-panel":"Mở/Đóng bảng phím tắt",clipboard:{authentication:{title:"Không thể truy cập vào bảng nhớ tạm",content:"Vui lòng cho phép Univer truy cập vào bảng nhớ tạm của bạn."}},textEditor:{formulaError:"Vui lòng nhập công thức hợp lệ, ví dụ =SUM(A1)",rangeError:"Vui lòng nhập phạm vi hợp lệ, ví dụ A1:B10"},rangeSelector:{title:"Chọn một phạm vi dữ liệu",addAnotherRange:"Thêm phạm vi",buttonTooltip:"Chọn phạm vi dữ liệu",placeHolder:"Chọn phạm vi hoặc nhập",confirm:"Xác nhận",cancel:"Hủy"},"global-shortcut":"Phím tắt toàn cầu"};module.exports=n;
1
+ "use strict";const locale={ribbon:{start:"Bắt đầu",insert:"Chèn",formulas:"Công thức",data:"Dữ liệu",view:"Xem",others:"Khác",more:"Thêm"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"Microsoft YaHei",SimSun:"SimSun",SimHei:"SimHei",Kaiti:"Kaiti",FangSong:"FangSong",NSimSun:"NSimSun",STXinwei:"STXinwei",STXingkai:"STXingkai",STLiti:"STLiti",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"Bảng phím tắt"},shortcut:{undo:"Hoàn tác",redo:"Làm lại",cut:"Cắt",copy:"Sao chép",paste:"Dán","shortcut-panel":"Mở/Đóng bảng phím tắt"},"common-edit":"Chỉnh sửa thường dùng","toggle-shortcut-panel":"Mở/Đóng bảng phím tắt",clipboard:{authentication:{title:"Không thể truy cập vào bảng nhớ tạm",content:"Vui lòng cho phép Univer truy cập vào bảng nhớ tạm của bạn."}},textEditor:{formulaError:"Vui lòng nhập công thức hợp lệ, ví dụ =SUM(A1)",rangeError:"Vui lòng nhập phạm vi hợp lệ, ví dụ A1:B10"},rangeSelector:{title:"Chọn một phạm vi dữ liệu",addAnotherRange:"Thêm phạm vi",buttonTooltip:"Chọn phạm vi dữ liệu",placeHolder:"Chọn phạm vi hoặc nhập",confirm:"Xác nhận",cancel:"Hủy"},"global-shortcut":"Phím tắt toàn cầu"};module.exports=locale;
@@ -1 +1 @@
1
- "use strict";const t={ribbon:{start:"开始",insert:"插入",formulas:"公式",data:"数据",view:"视图",others:"其他",more:"更多"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"微软雅黑",SimSun:"宋体",SimHei:"黑体",Kaiti:"楷体",FangSong:"仿宋",NSimSun:"新宋体",STXinwei:"华文新魏",STXingkai:"华文行楷",STLiti:"华文隶书",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"快捷键面板"},shortcut:{undo:"撤销",redo:"重做",cut:"剪切",copy:"复制",paste:"粘贴","shortcut-panel":"打开收起快捷键面板"},"common-edit":"常用编辑","toggle-shortcut-panel":"打开收起快捷键面板",clipboard:{authentication:{title:"无法访问剪贴板",content:"请允许 Univer 访问您的剪贴板。"}},textEditor:{formulaError:"请输入合法的公式,例如=SUM(A1)",rangeError:"请输入合法的范围,例如 A1:B10"},rangeSelector:{title:"选择一个数据范围",addAnotherRange:"添加范围",buttonTooltip:"选择数据范围",placeHolder:"框选范围或输入",confirm:"确认",cancel:"取消"},"global-shortcut":"全局快捷键"};module.exports=t;
1
+ "use strict";const locale={ribbon:{start:"开始",insert:"插入",formulas:"公式",data:"数据",view:"视图",others:"其他",more:"更多"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"微软雅黑",SimSun:"宋体",SimHei:"黑体",Kaiti:"楷体",FangSong:"仿宋",NSimSun:"新宋体",STXinwei:"华文新魏",STXingkai:"华文行楷",STLiti:"华文隶书",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"快捷键面板"},shortcut:{undo:"撤销",redo:"重做",cut:"剪切",copy:"复制",paste:"粘贴","shortcut-panel":"打开收起快捷键面板"},"common-edit":"常用编辑","toggle-shortcut-panel":"打开收起快捷键面板",clipboard:{authentication:{title:"无法访问剪贴板",content:"请允许 Univer 访问您的剪贴板。"}},textEditor:{formulaError:"请输入合法的公式,例如=SUM(A1)",rangeError:"请输入合法的范围,例如 A1:B10"},rangeSelector:{title:"选择一个数据范围",addAnotherRange:"添加范围",buttonTooltip:"选择数据范围",placeHolder:"框选范围或输入",confirm:"确认",cancel:"取消"},"global-shortcut":"全局快捷键"};module.exports=locale;
@@ -1 +1 @@
1
- "use strict";const t={ribbon:{start:"開始",insert:"插入",formulas:"公式",data:"資料",view:"視圖",others:"其他",more:"更多"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"微軟雅黑",SimSun:"宋體",SimHei:"黑體",Kaiti:"楷體",FangSong:"仿宋",NSimSun:"新宋體",STXinwei:"華文新魏",STXingkai:"華文行楷",STLiti:"華文隸書",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"快捷鍵面板"},shortcut:{undo:"撤銷",redo:"重做",cut:"剪切",copy:"複製",paste:"貼上","shortcut-panel":"開啟收起快捷鍵面板"},"common-edit":"常用編輯","toggle-shortcut-panel":"開啟收起快速鍵面板",clipboard:{authentication:{title:"無法存取剪貼簿",content:"請允許 Univer 存取您的剪貼簿。 "}},textEditor:{formulaError:"請輸入合法的公式,例如=SUM(A1)",rangeError:"請輸入合法的範圍,例如 A1:B10"},rangeSelector:{title:"選擇一個資料範圍",addAnotherRange:"新增範圍",buttonTooltip:"選擇資料範圍",placeHolder:"框選範圍或輸入",confirm:"確認",cancel:"取消"},"global-shortcut":"全域快捷鍵"};module.exports=t;
1
+ "use strict";const locale={ribbon:{start:"開始",insert:"插入",formulas:"公式",data:"資料",view:"視圖",others:"其他",more:"更多"},fontFamily:{TimesNewRoman:"Times New Roman",Arial:"Arial",Tahoma:"Tahoma",Verdana:"Verdana",MicrosoftYaHei:"微軟雅黑",SimSun:"宋體",SimHei:"黑體",Kaiti:"楷體",FangSong:"仿宋",NSimSun:"新宋體",STXinwei:"華文新魏",STXingkai:"華文行楷",STLiti:"華文隸書",HanaleiFill:"HanaleiFill",Anton:"Anton",Pacifico:"Pacifico"},"shortcut-panel":{title:"快捷鍵面板"},shortcut:{undo:"撤銷",redo:"重做",cut:"剪切",copy:"複製",paste:"貼上","shortcut-panel":"開啟收起快捷鍵面板"},"common-edit":"常用編輯","toggle-shortcut-panel":"開啟收起快速鍵面板",clipboard:{authentication:{title:"無法存取剪貼簿",content:"請允許 Univer 存取您的剪貼簿。 "}},textEditor:{formulaError:"請輸入合法的公式,例如=SUM(A1)",rangeError:"請輸入合法的範圍,例如 A1:B10"},rangeSelector:{title:"選擇一個資料範圍",addAnotherRange:"新增範圍",buttonTooltip:"選擇資料範圍",placeHolder:"框選範圍或輸入",confirm:"確認",cancel:"取消"},"global-shortcut":"全域快捷鍵"};module.exports=locale;
package/lib/es/facade.js CHANGED
@@ -1,40 +1,41 @@
1
- var x = Object.defineProperty;
2
- var E = (i, e, t) => e in i ? x(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var o = (i, e, t) => E(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { Inject as l, Injector as v, ICommandService as u, FBase as b, Tools as U, CommandType as B, FUniver as I, connectInjector as D, FHooks as P, FEnum as j } from "@univerjs/core";
5
- import { IMenuManagerService as M, MenuItemType as C, RibbonStartGroup as F, RibbonPosition as O, MenuManagerPosition as T, IShortcutService as w, CopyCommand as m, PasteCommand as S, ISidebarService as R, IDialogService as $, ComponentManager as G, IMessageService as V, IUIPartsService as h, SheetPasteShortKeyCommandName as N, BuiltInUIPart as H } from "@univerjs/ui";
6
- var L = Object.defineProperty, A = Object.getOwnPropertyDescriptor, y = (i, e, t, r) => {
7
- for (var n = r > 1 ? void 0 : r ? A(e, t) : e, s = i.length - 1, c; s >= 0; s--)
8
- (c = i[s]) && (n = (r ? c(e, t, n) : c(n)) || n);
9
- return r && n && L(e, t, n), n;
10
- }, d = (i, e) => (t, r) => e(t, r, i), a;
11
- let p = (a = class extends b {
12
- constructor(e, t, r, n) {
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
+ import { Inject, Injector, ICommandService, FBase, Tools, CommandType, FUniver, connectInjector, FHooks, FEnum } from "@univerjs/core";
6
+ import { IMenuManagerService, MenuItemType, RibbonStartGroup, RibbonPosition, MenuManagerPosition, IShortcutService, CopyCommand, PasteCommand, ISidebarService, IDialogService, ComponentManager, IMessageService, IUIPartsService, SheetPasteShortKeyCommandName, BuiltInUIPart } from "@univerjs/ui";
7
+ var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
8
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
9
+ (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
10
+ return kind && result && __defProp$1(target, key, result), result;
11
+ }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a;
12
+ let FMenu = (_a = class extends FBase {
13
+ constructor(_item, _injector, _commandService, _menuManagerService) {
13
14
  super();
14
- o(this, "_commandToRegister", /* @__PURE__ */ new Map());
15
- o(this, "_buildingSchema");
16
- this._item = e, this._injector = t, this._commandService = r, this._menuManagerService = n;
17
- const s = typeof e.action == "string" ? e.action : U.generateRandomId(12);
18
- s !== e.action && this._commandToRegister.set(s, e.action), this._buildingSchema = {
15
+ __publicField(this, "_commandToRegister", /* @__PURE__ */ new Map());
16
+ __publicField(this, "_buildingSchema");
17
+ this._item = _item, this._injector = _injector, this._commandService = _commandService, this._menuManagerService = _menuManagerService;
18
+ const commandId = typeof _item.action == "string" ? _item.action : Tools.generateRandomId(12);
19
+ commandId !== _item.action && this._commandToRegister.set(commandId, _item.action), this._buildingSchema = {
19
20
  // eslint-disable-next-line ts/explicit-function-return-type
20
- menuItemFactory: () => ({
21
- id: e.id,
22
- type: C.BUTTON,
21
+ menuItemFactory: /* @__PURE__ */ __name(() => ({
22
+ id: _item.id,
23
+ type: MenuItemType.BUTTON,
23
24
  // we only support button for now
24
- icon: e.icon,
25
- title: e.title,
26
- tooltip: e.tooltip,
27
- commandId: s
28
- })
29
- }, typeof e.order < "u" && (this._buildingSchema.order = e.order);
25
+ icon: _item.icon,
26
+ title: _item.title,
27
+ tooltip: _item.tooltip,
28
+ commandId
29
+ }), "menuItemFactory")
30
+ }, typeof _item.order < "u" && (this._buildingSchema.order = _item.order);
30
31
  }
31
32
  /** @ignore */
32
33
  __getSchema() {
33
- return this._commandToRegister.forEach((e, t) => {
34
- this._commandService.hasCommand(t) || this._commandService.registerCommand({
35
- id: t,
36
- type: B.COMMAND,
37
- handler: e
34
+ return this._commandToRegister.forEach((command, id) => {
35
+ this._commandService.hasCommand(id) || this._commandService.registerCommand({
36
+ id,
37
+ type: CommandType.COMMAND,
38
+ handler: command
38
39
  });
39
40
  }), { [this._item.id]: this._buildingSchema };
40
41
  }
@@ -42,42 +43,43 @@ let p = (a = class extends b {
42
43
  * Append the menu to any menu position on Univer UI.
43
44
  * @param path Some predefined path to append the menu.
44
45
  */
45
- appendTo(e) {
46
- const t = this.__getSchema();
46
+ appendTo(path) {
47
+ const schema = this.__getSchema();
47
48
  this._menuManagerService.mergeMenu({
48
- [e]: t
49
+ [path]: schema
49
50
  });
50
51
  }
51
- }, o(a, "RibbonStartGroup", F), o(a, "RibbonPosition", O), o(a, "MenuManagerPosition", T), a);
52
- p = y([
53
- d(1, l(v)),
54
- d(2, u),
55
- d(3, M)
56
- ], p);
57
- let _ = class extends b {
58
- constructor(e, t, r) {
52
+ }, __name(_a, "FMenu"), __publicField(_a, "RibbonStartGroup", RibbonStartGroup), __publicField(_a, "RibbonPosition", RibbonPosition), __publicField(_a, "MenuManagerPosition", MenuManagerPosition), _a);
53
+ FMenu = __decorateClass$1([
54
+ __decorateParam$1(1, Inject(Injector)),
55
+ __decorateParam$1(2, ICommandService),
56
+ __decorateParam$1(3, IMenuManagerService)
57
+ ], FMenu);
58
+ var _a2;
59
+ let FSubmenu = (_a2 = class extends FBase {
60
+ constructor(_item, _injector, _menuManagerService) {
59
61
  super();
60
- o(this, "_menuByGroups", []);
61
- o(this, "_submenus", []);
62
- o(this, "_buildingSchema");
63
- this._item = e, this._injector = t, this._menuManagerService = r, this._buildingSchema = {
62
+ __publicField(this, "_menuByGroups", []);
63
+ __publicField(this, "_submenus", []);
64
+ __publicField(this, "_buildingSchema");
65
+ this._item = _item, this._injector = _injector, this._menuManagerService = _menuManagerService, this._buildingSchema = {
64
66
  // eslint-disable-next-line ts/explicit-function-return-type
65
- menuItemFactory: () => ({
66
- id: e.id,
67
- type: C.SUBITEMS,
68
- icon: e.icon,
69
- title: e.title,
70
- tooltip: e.tooltip
71
- })
72
- }, typeof e.order < "u" && (this._buildingSchema.order = e.order);
67
+ menuItemFactory: /* @__PURE__ */ __name(() => ({
68
+ id: _item.id,
69
+ type: MenuItemType.SUBITEMS,
70
+ icon: _item.icon,
71
+ title: _item.title,
72
+ tooltip: _item.tooltip
73
+ }), "menuItemFactory")
74
+ }, typeof _item.order < "u" && (this._buildingSchema.order = _item.order);
73
75
  }
74
76
  /**
75
77
  * Add a menu to the submenu. It can be a {@link FMenu} or a {@link FSubmenu}.
76
78
  * @param submenu Menu to add to the submenu.
77
79
  * @returns The FSubmenu itself for chaining calls.
78
80
  */
79
- addSubmenu(e) {
80
- return this._submenus.push(e), this;
81
+ addSubmenu(submenu) {
82
+ return this._submenus.push(submenu), this;
81
83
  }
82
84
  /**
83
85
  * Add a separator to the submenu.
@@ -90,41 +92,41 @@ let _ = class extends b {
90
92
  * Append the menu to any menu position on Univer UI.
91
93
  * @param path Some predefined path to append the menu.
92
94
  */
93
- appendTo(e) {
94
- const t = this.__getSchema();
95
+ appendTo(path) {
96
+ const schema = this.__getSchema();
95
97
  this._menuManagerService.mergeMenu({
96
- [e]: t
98
+ [path]: schema
97
99
  });
98
100
  }
99
101
  /** @ignore */
100
102
  __getSchema() {
101
- const e = {};
102
- return this.addSeparator(), this._menuByGroups.forEach((t, r) => {
103
- const n = {};
104
- t.forEach((s) => {
105
- Object.assign(n, s.__getSchema());
106
- }), e[`${this._item.id}-group-${r}`] = n;
107
- }), { [this._item.id]: Object.assign(this._buildingSchema, e) };
108
- }
109
- };
110
- _ = y([
111
- d(1, l(v)),
112
- d(2, M)
113
- ], _);
114
- var K = Object.defineProperty, q = Object.getOwnPropertyDescriptor, z = (i, e, t, r) => {
115
- for (var n = r > 1 ? void 0 : r ? q(e, t) : e, s = i.length - 1, c; s >= 0; s--)
116
- (c = i[s]) && (n = (r ? c(e, t, n) : c(n)) || n);
117
- return r && n && K(e, t, n), n;
118
- }, f = (i, e) => (t, r) => e(t, r, i);
119
- let g = class extends b {
120
- constructor(e, t) {
103
+ const schema = {};
104
+ return this.addSeparator(), this._menuByGroups.forEach((group, index) => {
105
+ const groupSchema = {};
106
+ group.forEach((menu) => {
107
+ Object.assign(groupSchema, menu.__getSchema());
108
+ }), schema[`${this._item.id}-group-${index}`] = groupSchema;
109
+ }), { [this._item.id]: Object.assign(this._buildingSchema, schema) };
110
+ }
111
+ }, __name(_a2, "FSubmenu"), _a2);
112
+ FSubmenu = __decorateClass$1([
113
+ __decorateParam$1(1, Inject(Injector)),
114
+ __decorateParam$1(2, IMenuManagerService)
115
+ ], FSubmenu);
116
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
117
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
118
+ (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
119
+ return kind && result && __defProp2(target, key, result), result;
120
+ }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam"), _a3;
121
+ let FShortcut = (_a3 = class extends FBase {
122
+ constructor(_injector, _shortcutService) {
121
123
  super();
122
- o(this, "_forceEscapeDisposable", null);
123
- this._injector = e, this._shortcutService = t;
124
+ __publicField(this, "_forceEscapeDisposable", null);
125
+ this._injector = _injector, this._shortcutService = _shortcutService;
124
126
  }
125
127
  enableShortcut() {
126
- var e;
127
- (e = this._forceEscapeDisposable) == null || e.dispose(), this._forceEscapeDisposable = null;
128
+ var _a4;
129
+ (_a4 = this._forceEscapeDisposable) == null || _a4.dispose(), this._forceEscapeDisposable = null;
128
130
  }
129
131
  disableShortcut() {
130
132
  this._forceEscapeDisposable || (this._forceEscapeDisposable = this._shortcutService.forceEscape());
@@ -132,88 +134,98 @@ let g = class extends b {
132
134
  dispatchShortcutEvent(e) {
133
135
  return this._shortcutService.dispatch(e);
134
136
  }
135
- };
136
- g = z([
137
- f(0, l(v)),
138
- f(1, w)
139
- ], g);
140
- class J extends I {
137
+ }, __name(_a3, "FShortcut"), _a3);
138
+ FShortcut = __decorateClass([
139
+ __decorateParam(0, Inject(Injector)),
140
+ __decorateParam(1, IShortcutService)
141
+ ], FShortcut);
142
+ const _FUniverUIMixin = class _FUniverUIMixin extends FUniver {
141
143
  getURL() {
142
144
  return new URL(window.location.href);
143
145
  }
144
146
  getShortcut() {
145
- return this._injector.createInstance(g);
147
+ return this._injector.createInstance(FShortcut);
146
148
  }
147
149
  copy() {
148
- return this._commandService.executeCommand(m.id);
150
+ return this._commandService.syncExecuteCommand(CopyCommand.id);
149
151
  }
150
152
  paste() {
151
- return this._commandService.executeCommand(S.id);
153
+ return this._commandService.syncExecuteCommand(PasteCommand.id);
152
154
  }
153
- createMenu(e) {
154
- return this._injector.createInstance(p, e);
155
+ createMenu(menuItem) {
156
+ return this._injector.createInstance(FMenu, menuItem);
155
157
  }
156
- createSubmenu(e) {
157
- return this._injector.createInstance(_, e);
158
+ createSubmenu(submenuItem) {
159
+ return this._injector.createInstance(FSubmenu, submenuItem);
158
160
  }
159
- openSiderbar(e) {
160
- return this._injector.get(R).open(e);
161
+ openSiderbar(params) {
162
+ return this._injector.get(ISidebarService).open(params);
161
163
  }
162
- openSidebar(e) {
163
- return this.openSiderbar(e);
164
+ openSidebar(params) {
165
+ return this.openSiderbar(params);
164
166
  }
165
- openDialog(e) {
166
- const r = this._injector.get($).open({
167
- ...e,
168
- onClose: () => {
169
- r.dispose();
170
- }
167
+ openDialog(dialog) {
168
+ const disposable = this._injector.get(IDialogService).open({
169
+ ...dialog,
170
+ onClose: /* @__PURE__ */ __name(() => {
171
+ disposable.dispose();
172
+ }, "onClose")
171
173
  });
172
- return r;
174
+ return disposable;
173
175
  }
174
176
  getComponentManager() {
175
- return this._injector.get(G);
177
+ return this._injector.get(ComponentManager);
178
+ }
179
+ showMessage(options) {
180
+ return this._injector.get(IMessageService).show(options), this;
176
181
  }
177
- showMessage(e) {
178
- return this._injector.get(V).show(e), this;
182
+ setUIVisible(ui, visible) {
183
+ return this._injector.get(IUIPartsService).setUIVisible(ui, visible), this;
179
184
  }
180
- setUIVisible(e, t) {
181
- return this._injector.get(h).setUIVisible(e, t), this;
185
+ isUIVisible(ui) {
186
+ return this._injector.get(IUIPartsService).isUIVisible(ui);
182
187
  }
183
- isUIVisible(e) {
184
- return this._injector.get(h).isUIVisible(e);
188
+ registerUIPart(key, component) {
189
+ return this._injector.get(IUIPartsService).registerComponent(key, () => connectInjector(component, this._injector));
185
190
  }
186
- registerUIPart(e, t) {
187
- return this._injector.get(h).registerComponent(e, () => D(t, this._injector));
191
+ registerComponent(name, component, options) {
192
+ const componentManager = this._injector.get(ComponentManager);
193
+ return this.disposeWithMe(componentManager.register(name, component, options));
188
194
  }
189
- }
190
- I.extend(J);
191
- class Q extends P {
192
- onBeforeCopy(e) {
193
- return this._injector.get(u).beforeCommandExecuted((r) => {
194
- r.id === m.id && e();
195
+ };
196
+ __name(_FUniverUIMixin, "FUniverUIMixin");
197
+ let FUniverUIMixin = _FUniverUIMixin;
198
+ FUniver.extend(FUniverUIMixin);
199
+ const _FHooksSheetsMixin = class _FHooksSheetsMixin extends FHooks {
200
+ onBeforeCopy(callback) {
201
+ return this._injector.get(ICommandService).beforeCommandExecuted((command) => {
202
+ command.id === CopyCommand.id && callback();
195
203
  });
196
204
  }
197
- onCopy(e) {
198
- return this._injector.get(u).onCommandExecuted((r) => {
199
- r.id === m.id && e();
205
+ onCopy(callback) {
206
+ return this._injector.get(ICommandService).onCommandExecuted((command) => {
207
+ command.id === CopyCommand.id && callback();
200
208
  });
201
209
  }
202
- onBeforePaste(e) {
203
- return this._injector.get(u).beforeCommandExecuted((r) => {
204
- r.id === S.id && e();
210
+ onBeforePaste(callback) {
211
+ return this._injector.get(ICommandService).beforeCommandExecuted((command) => {
212
+ command.id === PasteCommand.id && callback();
205
213
  });
206
214
  }
207
- onPaste(e) {
208
- return this._injector.get(u).onCommandExecuted((r) => {
209
- (r.id === S.id || r.id === N) && e();
215
+ onPaste(callback) {
216
+ return this._injector.get(ICommandService).onCommandExecuted((command) => {
217
+ (command.id === PasteCommand.id || command.id === SheetPasteShortKeyCommandName) && callback();
210
218
  });
211
219
  }
212
- }
213
- P.extend(Q);
214
- class W extends j {
220
+ };
221
+ __name(_FHooksSheetsMixin, "FHooksSheetsMixin");
222
+ let FHooksSheetsMixin = _FHooksSheetsMixin;
223
+ FHooks.extend(FHooksSheetsMixin);
224
+ const _FUIEnum = class _FUIEnum extends FEnum {
215
225
  get BuiltInUIPart() {
216
- return H;
226
+ return BuiltInUIPart;
217
227
  }
218
- }
219
- j.extend(W);
228
+ };
229
+ __name(_FUIEnum, "FUIEnum");
230
+ let FUIEnum = _FUIEnum;
231
+ FEnum.extend(FUIEnum);