@univerjs/ui 0.6.1 → 0.6.2

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 (53) hide show
  1. package/README.md +4 -0
  2. package/lib/cjs/facade.js +1 -1
  3. package/lib/cjs/index.js +46 -35
  4. package/lib/cjs/locale/en-US.js +1 -1
  5. package/lib/cjs/locale/fa-IR.js +1 -1
  6. package/lib/cjs/locale/fr-FR.js +1 -1
  7. package/lib/cjs/locale/ru-RU.js +1 -1
  8. package/lib/cjs/locale/vi-VN.js +1 -1
  9. package/lib/cjs/locale/zh-CN.js +1 -1
  10. package/lib/cjs/locale/zh-TW.js +1 -1
  11. package/lib/es/facade.js +176 -74
  12. package/lib/es/index.js +3902 -3618
  13. package/lib/es/locale/en-US.js +4 -1
  14. package/lib/es/locale/fa-IR.js +4 -1
  15. package/lib/es/locale/fr-FR.js +4 -1
  16. package/lib/es/locale/ru-RU.js +4 -1
  17. package/lib/es/locale/vi-VN.js +4 -1
  18. package/lib/es/locale/zh-CN.js +6 -3
  19. package/lib/es/locale/zh-TW.js +6 -3
  20. package/lib/index.css +1 -1
  21. package/lib/types/components/index.d.ts +1 -0
  22. package/lib/types/components/menu/desktop/Menu.d.ts +2 -0
  23. package/lib/types/components/slider/Slider.d.ts +47 -0
  24. package/lib/types/components/slider/Slider.stories.d.ts +7 -0
  25. package/lib/types/components/slider/index.d.ts +16 -0
  26. package/lib/types/controllers/ui/ui-desktop.controller.d.ts +5 -16
  27. package/lib/types/controllers/ui/ui-mobile.controller.d.ts +5 -13
  28. package/lib/types/controllers/ui/ui-shared.controller.d.ts +18 -0
  29. package/lib/types/facade/f-enum.d.ts +9 -1
  30. package/lib/types/facade/f-hooks.d.ts +4 -6
  31. package/lib/types/facade/f-menu-builder.d.ts +61 -2
  32. package/lib/types/facade/f-shortcut.d.ts +37 -2
  33. package/lib/types/facade/f-univer.d.ts +275 -38
  34. package/lib/types/index.d.ts +0 -1
  35. package/lib/types/locale/zh-CN.d.ts +3 -0
  36. package/lib/types/services/menu/menu.d.ts +4 -0
  37. package/lib/types/services/shortcut/shortcut.service.d.ts +4 -4
  38. package/lib/types/views/components/ribbon/Button/ToolbarButton.d.ts +15 -1
  39. package/lib/types/views/components/ribbon/ToolbarItem.d.ts +1 -5
  40. package/lib/types/views/components/ribbon/TooltipButtonWrapper.d.ts +16 -5
  41. package/lib/types/views/mobile-workbench/MobileWorkbench.d.ts +6 -0
  42. package/lib/umd/facade.js +1 -1
  43. package/lib/umd/index.js +46 -35
  44. package/lib/umd/locale/en-US.js +1 -1
  45. package/lib/umd/locale/fa-IR.js +1 -1
  46. package/lib/umd/locale/fr-FR.js +1 -1
  47. package/lib/umd/locale/ru-RU.js +1 -1
  48. package/lib/umd/locale/vi-VN.js +1 -1
  49. package/lib/umd/locale/zh-CN.js +1 -1
  50. package/lib/umd/locale/zh-TW.js +1 -1
  51. package/package.json +8 -9
  52. package/lib/types/views/MobileApp.d.ts +0 -6
  53. package/lib/types/views/parts.d.ts +0 -2
@@ -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 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","zoom-slider":{resetTo:"Reset to"}};module.exports=e;
@@ -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 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":"کلید میانبر جهانی","zoom-slider":{resetTo:"بازنشانی به"}};module.exports=i;
@@ -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 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","zoom-slider":{resetTo:"Réinitialiser à"}};module.exports=e;
@@ -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 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":"Глобальные ярлыки","zoom-slider":{resetTo:"Сбросить до"}};module.exports=i;
@@ -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 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","zoom-slider":{resetTo:"Khôi phục đến"}};module.exports=n;
@@ -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 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":"全局快捷键","zoom-slider":{resetTo:"恢复至"}};module.exports=t;
@@ -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 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":"全域快捷鍵","zoom-slider":{resetTo:"恢復至"}};module.exports=t;
package/lib/es/facade.js CHANGED
@@ -1,16 +1,16 @@
1
- var B = Object.defineProperty;
2
- var F = (i, e, t) => e in i ? B(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var o = (i, e, t) => F(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { FBase as M, FUniver as j, FHooks as C, FEnum as y } from "@univerjs/core/facade";
5
- import { IRenderManagerService as w } from "@univerjs/engine-render";
6
- import { IMenuManagerService as P, MenuItemType as U, RibbonStartGroup as R, RibbonPosition as T, MenuManagerPosition as O, IShortcutService as G, CopyCommand as S, PasteCommand as g, ISidebarService as $, IDialogService as V, ComponentManager as f, IMessageService as N, IUIPartsService as m, connectInjector as H, SheetPasteShortKeyCommandName as L, BuiltInUIPart as A } from "@univerjs/ui";
7
- import { Inject as v, Injector as b, ICommandService as u, Tools as K, CommandType as W } from "@univerjs/core";
8
- var k = Object.getOwnPropertyDescriptor, x = (i, e, t, r) => {
9
- for (var n = r > 1 ? void 0 : r ? k(e, t) : e, s = i.length - 1, c; s >= 0; s--)
10
- (c = i[s]) && (n = c(n) || n);
11
- return n;
12
- }, d = (i, e) => (t, r) => e(t, r, i);
13
- class D extends M {
1
+ var F = Object.defineProperty;
2
+ var R = (n, e, t) => e in n ? F(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var o = (n, e, t) => R(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { FBase as C, FUniver as M, FHooks as j, FEnum as y } from "@univerjs/core/facade";
5
+ import { IRenderManagerService as U } from "@univerjs/engine-render";
6
+ import { IMenuManagerService as P, MenuItemType as x, RibbonStartGroup as T, RibbonPosition as w, MenuManagerPosition as O, IShortcutService as G, CopyCommand as v, PasteCommand as l, ISidebarService as V, IDialogService as $, ComponentManager as I, IMessageService as N, IUIPartsService as g, connectInjector as H, SheetPasteShortKeyCommandName as K, BuiltInUIPart as k, KeyCode as L } from "@univerjs/ui";
7
+ import { Inject as m, Injector as f, ICommandService as u, Tools as A, CommandType as W, IUniverInstanceService as q, UniverInstanceType as z } from "@univerjs/core";
8
+ var J = Object.getOwnPropertyDescriptor, D = (n, e, t, r) => {
9
+ for (var i = r > 1 ? void 0 : r ? J(e, t) : e, s = n.length - 1, c; s >= 0; s--)
10
+ (c = n[s]) && (i = c(i) || i);
11
+ return i;
12
+ }, d = (n, e) => (t, r) => e(t, r, n);
13
+ class E extends C {
14
14
  /**
15
15
  * Append the menu to any menu position on Univer UI.
16
16
  * @param {string | string[]} path - Some predefined path to append the menu. The paths can be an array,
@@ -23,39 +23,43 @@ class D extends M {
23
23
  * univerAPI.createMenu({
24
24
  * id: 'custom-menu-id-1',
25
25
  * title: 'Custom Menu 1',
26
- * action: () => {},
26
+ * action: () => {
27
+ * console.log('Custom Menu 1 clicked');
28
+ * },
27
29
  * }).appendTo('contextMenu.others');
28
30
  *
29
31
  * // This menu item will only appear on the `contextMenu.others` section on the main area.
30
32
  * univerAPI.createMenu({
31
33
  * id: 'custom-menu-id-2',
32
34
  * title: 'Custom Menu 2',
33
- * action: () => { console.log(123); },
35
+ * action: () => {
36
+ * console.log('Custom Menu 2 clicked');
37
+ * },
34
38
  * }).appendTo(['contextMenu.mainArea', 'contextMenu.others']);
35
39
  * ```
36
40
  */
37
41
  appendTo(e) {
38
- const t = typeof e == "string" ? e.split("|") : e, r = t.length, n = {};
39
- let s = n;
42
+ const t = typeof e == "string" ? e.split("|") : e, r = t.length, i = {};
43
+ let s = i;
40
44
  const c = this.__getSchema();
41
- t.forEach((h, E) => {
42
- E === r - 1 ? s[h] = c : s[h] = {}, s = s[h];
43
- }), this._menuManagerService.mergeMenu(n);
45
+ t.forEach((S, B) => {
46
+ B === r - 1 ? s[S] = c : s[S] = {}, s = s[S];
47
+ }), this._menuManagerService.mergeMenu(i);
44
48
  }
45
49
  }
46
50
  var a;
47
- let l = (a = class extends D {
48
- constructor(e, t, r, n) {
51
+ let p = (a = class extends E {
52
+ constructor(e, t, r, i) {
49
53
  super();
50
54
  o(this, "_commandToRegister", /* @__PURE__ */ new Map());
51
55
  o(this, "_buildingSchema");
52
- this._item = e, this._injector = t, this._commandService = r, this._menuManagerService = n;
53
- const s = typeof e.action == "string" ? e.action : K.generateRandomId(12);
56
+ this._item = e, this._injector = t, this._commandService = r, this._menuManagerService = i;
57
+ const s = typeof e.action == "string" ? e.action : A.generateRandomId(12);
54
58
  s !== e.action && this._commandToRegister.set(s, e.action), this._buildingSchema = {
55
59
  // eslint-disable-next-line ts/explicit-function-return-type
56
60
  menuItemFactory: () => ({
57
61
  id: e.id,
58
- type: U.BUTTON,
62
+ type: x.BUTTON,
59
63
  // we only support button for now
60
64
  icon: e.icon,
61
65
  title: e.title,
@@ -76,13 +80,13 @@ let l = (a = class extends D {
76
80
  });
77
81
  }), { [this._item.id]: this._buildingSchema };
78
82
  }
79
- }, o(a, "RibbonStartGroup", R), o(a, "RibbonPosition", T), o(a, "MenuManagerPosition", O), a);
80
- l = x([
81
- d(1, v(b)),
83
+ }, o(a, "RibbonStartGroup", T), o(a, "RibbonPosition", w), o(a, "MenuManagerPosition", O), a);
84
+ p = D([
85
+ d(1, m(f)),
82
86
  d(2, u),
83
87
  d(3, P)
84
- ], l);
85
- let p = class extends D {
88
+ ], p);
89
+ let _ = class extends E {
86
90
  constructor(e, t, r) {
87
91
  super();
88
92
  o(this, "_menuByGroups", []);
@@ -92,7 +96,7 @@ let p = class extends D {
92
96
  // eslint-disable-next-line ts/explicit-function-return-type
93
97
  menuItemFactory: () => ({
94
98
  id: e.id,
95
- type: U.SUBITEMS,
99
+ type: x.SUBITEMS,
96
100
  icon: e.icon,
97
101
  title: e.title,
98
102
  tooltip: e.tooltip
@@ -103,6 +107,35 @@ let p = class extends D {
103
107
  * Add a menu to the submenu. It can be a {@link FMenu} or a {@link FSubmenu}.
104
108
  * @param {FMenu | FSubmenu} submenu - Menu to add to the submenu.
105
109
  * @returns {FSubmenu} The FSubmenu itself for chaining calls.
110
+ * @example
111
+ * ```typescript
112
+ * // Create two leaf menus.
113
+ * const menu1 = univerAPI.createMenu({
114
+ * id: 'submenu-nested-1',
115
+ * title: 'Item 1',
116
+ * action: () => {
117
+ * console.log('Item 1 clicked');
118
+ * }
119
+ * });
120
+ * const menu2 = univerAPI.createMenu({
121
+ * id: 'submenu-nested-2',
122
+ * title: 'Item 2',
123
+ * action: () => {
124
+ * console.log('Item 2 clicked');
125
+ * }
126
+ * });
127
+ *
128
+ * // Add the leaf menus to a submenu.
129
+ * const submenu = univerAPI.createSubmenu({ id: 'submenu-nested', title: 'Nested Submenu' })
130
+ * .addSubmenu(menu1)
131
+ * .addSeparator()
132
+ * .addSubmenu(menu2);
133
+ *
134
+ * // Create a root submenu append to the `contextMenu.others` section.
135
+ * univerAPI.createSubmenu({ id: 'custom-submenu', title: 'Custom Submenu' })
136
+ * .addSubmenu(submenu)
137
+ * .appendTo('contextMenu.others');
138
+ * ```
106
139
  */
107
140
  addSubmenu(e) {
108
141
  return this._submenus.push(e), this;
@@ -110,6 +143,32 @@ let p = class extends D {
110
143
  /**
111
144
  * Add a separator to the submenu.
112
145
  * @returns {FSubmenu} The FSubmenu itself for chaining calls.
146
+ * @example
147
+ * ```typescript
148
+ * // Create two leaf menus.
149
+ * const menu1 = univerAPI.createMenu({
150
+ * id: 'submenu-nested-1',
151
+ * title: 'Item 1',
152
+ * action: () => {
153
+ * console.log('Item 1 clicked');
154
+ * }
155
+ * });
156
+ * const menu2 = univerAPI.createMenu({
157
+ * id: 'submenu-nested-2',
158
+ * title: 'Item 2',
159
+ * action: () => {
160
+ * console.log('Item 2 clicked');
161
+ * }
162
+ * });
163
+ *
164
+ * // Add the leaf menus to a submenu and add a separator between them.
165
+ * // Append the submenu to the `contextMenu.others` section.
166
+ * univerAPI.createSubmenu({ id: 'submenu-nested', title: 'Nested Submenu' })
167
+ * .addSubmenu(menu1)
168
+ * .addSeparator()
169
+ * .addSubmenu(menu2)
170
+ * .appendTo('contextMenu.others');
171
+ * ```
113
172
  */
114
173
  addSeparator() {
115
174
  return this._menuByGroups.push(this._submenus), this._submenus = [], this;
@@ -120,27 +179,27 @@ let p = class extends D {
120
179
  __getSchema() {
121
180
  const e = {};
122
181
  return this.addSeparator(), this._menuByGroups.forEach((t, r) => {
123
- const n = {};
182
+ const i = {};
124
183
  t.forEach((s) => {
125
- Object.assign(n, s.__getSchema());
126
- }), e[`${this._item.id}-group-${r}`] = n;
184
+ Object.assign(i, s.__getSchema());
185
+ }), e[`${this._item.id}-group-${r}`] = i;
127
186
  }), { [this._item.id]: Object.assign(this._buildingSchema, e) };
128
187
  }
129
188
  };
130
- p = x([
131
- d(1, v(b)),
189
+ _ = D([
190
+ d(1, m(f)),
132
191
  d(2, P)
133
- ], p);
134
- var q = Object.getOwnPropertyDescriptor, z = (i, e, t, r) => {
135
- for (var n = r > 1 ? void 0 : r ? q(e, t) : e, s = i.length - 1, c; s >= 0; s--)
136
- (c = i[s]) && (n = c(n) || n);
137
- return n;
138
- }, I = (i, e) => (t, r) => e(t, r, i);
139
- let _ = class extends M {
140
- constructor(e, t) {
192
+ ], _);
193
+ var Q = Object.getOwnPropertyDescriptor, X = (n, e, t, r) => {
194
+ for (var i = r > 1 ? void 0 : r ? Q(e, t) : e, s = n.length - 1, c; s >= 0; s--)
195
+ (c = n[s]) && (i = c(i) || i);
196
+ return i;
197
+ }, h = (n, e) => (t, r) => e(t, r, n);
198
+ let b = class extends C {
199
+ constructor(e, t, r, i) {
141
200
  super();
142
201
  o(this, "_forceDisableDisposable", null);
143
- this._injector = e, this._shortcutService = t;
202
+ this._injector = e, this._renderManagerService = t, this._univerInstanceService = r, this._shortcutService = i;
144
203
  }
145
204
  /**
146
205
  * Enable shortcuts of Univer.
@@ -168,6 +227,44 @@ let _ = class extends M {
168
227
  disableShortcut() {
169
228
  return this._forceDisableDisposable || (this._forceDisableDisposable = this._shortcutService.forceDisable()), this;
170
229
  }
230
+ /**
231
+ * Trigger shortcut of Univer by a KeyboardEvent and return the matched shortcut item.
232
+ * @param {KeyboardEvent} e - The KeyboardEvent to trigger.
233
+ * @returns {IShortcutItem<object> | undefined} The matched shortcut item.
234
+ *
235
+ * @example
236
+ * ```typescript
237
+ * // Assum the current sheet is empty sheet.
238
+ * const fWorkbook = univerAPI.getActiveWorkbook();
239
+ * const fWorksheet = fWorkbook.getActiveSheet();
240
+ * const fRange = fWorksheet.getRange('A1');
241
+ *
242
+ * // Set A1 cell active and set value to 'Hello Univer'.
243
+ * fRange.activate();
244
+ * fRange.setValue('Hello Univer');
245
+ * console.log(fRange.getCellStyle().bold); // false
246
+ *
247
+ * // Set A1 cell bold by shortcut.
248
+ * const fShortcut = univerAPI.getShortcut();
249
+ * const pseudoEvent = new KeyboardEvent('keydown', {
250
+ * key: 'b',
251
+ * ctrlKey: true,
252
+ * keyCode: univerAPI.Enum.KeyCode.B
253
+ * });
254
+ * const ifShortcutItem = fShortcut.triggerShortcut(pseudoEvent);
255
+ * if (ifShortcutItem) {
256
+ * const commandId = ifShortcutItem.id;
257
+ * console.log(fRange.getCellStyle().bold); // true
258
+ * }
259
+ * ```
260
+ */
261
+ triggerShortcut(e) {
262
+ const t = this._univerInstanceService.getCurrentUnitForType(z.UNIVER_SHEET);
263
+ if (!t)
264
+ return;
265
+ const r = this._renderManagerService.getRenderById(t.getUnitId());
266
+ return r ? (r.engine.getCanvasElement().dispatchEvent(e), this._shortcutService.dispatch(e)) : void 0;
267
+ }
171
268
  /**
172
269
  * Dispatch a KeyboardEvent to the shortcut service and return the matched shortcut item.
173
270
  * @param {KeyboardEvent} e - The KeyboardEvent to dispatch.
@@ -188,37 +285,39 @@ let _ = class extends M {
188
285
  return this._shortcutService.dispatch(e);
189
286
  }
190
287
  };
191
- _ = z([
192
- I(0, v(b)),
193
- I(1, G)
194
- ], _);
195
- class J extends j {
288
+ b = X([
289
+ h(0, m(f)),
290
+ h(1, m(U)),
291
+ h(2, q),
292
+ h(3, G)
293
+ ], b);
294
+ class Y extends M {
196
295
  getURL() {
197
296
  return new URL(window.location.href);
198
297
  }
199
298
  getShortcut() {
200
- return this._injector.createInstance(_);
299
+ return this._injector.createInstance(b);
201
300
  }
202
301
  copy() {
203
- return this._commandService.syncExecuteCommand(S.id);
302
+ return this._commandService.executeCommand(v.id);
204
303
  }
205
304
  paste() {
206
- return this._commandService.syncExecuteCommand(g.id);
305
+ return this._commandService.executeCommand(l.id);
207
306
  }
208
307
  createMenu(e) {
209
- return this._injector.createInstance(l, e);
308
+ return this._injector.createInstance(p, e);
210
309
  }
211
310
  createSubmenu(e) {
212
- return this._injector.createInstance(p, e);
311
+ return this._injector.createInstance(_, e);
213
312
  }
214
313
  openSiderbar(e) {
215
- return this._injector.get($).open(e);
314
+ return this._injector.get(V).open(e);
216
315
  }
217
316
  openSidebar(e) {
218
317
  return this.openSiderbar(e);
219
318
  }
220
319
  openDialog(e) {
221
- const r = this._injector.get(V).open({
320
+ const r = this._injector.get($).open({
222
321
  ...e,
223
322
  onClose: () => {
224
323
  r.dispose();
@@ -227,57 +326,60 @@ class J extends j {
227
326
  return r;
228
327
  }
229
328
  getComponentManager() {
230
- return this._injector.get(f);
329
+ return this._injector.get(I);
231
330
  }
232
331
  showMessage(e) {
233
332
  return this._injector.get(N).show(e), this;
234
333
  }
235
334
  setUIVisible(e, t) {
236
- return this._injector.get(m).setUIVisible(e, t), this;
335
+ return this._injector.get(g).setUIVisible(e, t), this;
237
336
  }
238
337
  isUIVisible(e) {
239
- return this._injector.get(m).isUIVisible(e);
338
+ return this._injector.get(g).isUIVisible(e);
240
339
  }
241
340
  registerUIPart(e, t) {
242
- return this._injector.get(m).registerComponent(e, () => H(t, this._injector));
341
+ return this._injector.get(g).registerComponent(e, () => H(t, this._injector));
243
342
  }
244
343
  registerComponent(e, t, r) {
245
- const n = this._injector.get(f);
246
- return this.disposeWithMe(n.register(e, t, r));
344
+ const i = this._injector.get(I);
345
+ return this.disposeWithMe(i.register(e, t, r));
247
346
  }
248
347
  setCurrent(e) {
249
- if (!this._injector.get(w).getRenderById(e))
348
+ if (!this._injector.get(U).getRenderById(e))
250
349
  throw new Error("Unit not found");
251
350
  this._univerInstanceService.setCurrentUnitForType(e);
252
351
  }
253
352
  }
254
- j.extend(J);
255
- class Q extends C {
353
+ M.extend(Y);
354
+ class Z extends j {
256
355
  onBeforeCopy(e) {
257
356
  return this._injector.get(u).beforeCommandExecuted((r) => {
258
- r.id === S.id && e();
357
+ r.id === v.id && e();
259
358
  });
260
359
  }
261
360
  onCopy(e) {
262
361
  return this._injector.get(u).onCommandExecuted((r) => {
263
- r.id === S.id && e();
362
+ r.id === v.id && e();
264
363
  });
265
364
  }
266
365
  onBeforePaste(e) {
267
366
  return this._injector.get(u).beforeCommandExecuted((r) => {
268
- r.id === g.id && e();
367
+ r.id === l.id && e();
269
368
  });
270
369
  }
271
370
  onPaste(e) {
272
371
  return this._injector.get(u).onCommandExecuted((r) => {
273
- (r.id === g.id || r.id === L) && e();
372
+ (r.id === l.id || r.id === K) && e();
274
373
  });
275
374
  }
276
375
  }
277
- C.extend(Q);
278
- class X extends y {
376
+ j.extend(Z);
377
+ class ee extends y {
279
378
  get BuiltInUIPart() {
280
- return A;
379
+ return k;
380
+ }
381
+ get KeyCode() {
382
+ return L;
281
383
  }
282
384
  }
283
- y.extend(X);
385
+ y.extend(ee);