@univerjs/ui 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +377 -43
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -391
- package/lib/es/index.js +378 -12224
- package/lib/es/locale/ca-ES.js +1 -85
- package/lib/es/locale/en-US.js +1 -85
- package/lib/es/locale/es-ES.js +1 -85
- package/lib/es/locale/fa-IR.js +1 -85
- package/lib/es/locale/fr-FR.js +1 -85
- package/lib/es/locale/ja-JP.js +1 -85
- package/lib/es/locale/ko-KR.js +1 -85
- package/lib/es/locale/ru-RU.js +1 -85
- package/lib/es/locale/sk-SK.js +1 -85
- package/lib/es/locale/vi-VN.js +1 -85
- package/lib/es/locale/zh-CN.js +1 -85
- package/lib/es/locale/zh-TW.js +1 -85
- package/lib/facade.js +1 -391
- package/lib/index.css +1662 -1
- package/lib/index.js +378 -12224
- package/lib/locale/ca-ES.js +1 -85
- package/lib/locale/en-US.js +1 -85
- package/lib/locale/es-ES.js +1 -85
- package/lib/locale/fa-IR.js +1 -85
- package/lib/locale/fr-FR.js +1 -85
- package/lib/locale/ja-JP.js +1 -85
- package/lib/locale/ko-KR.js +1 -85
- package/lib/locale/ru-RU.js +1 -85
- package/lib/locale/sk-SK.js +1 -85
- package/lib/locale/vi-VN.js +1 -85
- package/lib/locale/zh-CN.js +1 -85
- package/lib/locale/zh-TW.js +1 -85
- package/lib/types/commands/operations/toggle-shortcut-panel.operation.d.ts +16 -1
- package/lib/types/common/component-manager.d.ts +17 -1
- package/lib/types/common/lifecycle.d.ts +16 -1
- package/lib/types/common/menu-hidden-observable.d.ts +16 -1
- package/lib/types/common/menu-merge-configs.d.ts +16 -1
- package/lib/types/components/custom-label/CustomLabel.d.ts +18 -3
- package/lib/types/components/font-family/FontFamily.d.ts +16 -1
- package/lib/types/components/font-family/interface.d.ts +17 -2
- package/lib/types/components/font-size/FontSize.d.ts +16 -1
- package/lib/types/components/font-size/interface.d.ts +17 -2
- package/lib/types/components/heading-item/index.d.ts +16 -1
- package/lib/types/components/hooks/layout.d.ts +16 -1
- package/lib/types/components/hooks/locale.d.ts +15 -0
- package/lib/types/components/hooks/update-effect.d.ts +15 -0
- package/lib/types/components/hooks/use-click-out-side.d.ts +16 -1
- package/lib/types/components/menu/common/hook.d.ts +16 -1
- package/lib/types/components/menu/desktop/DesignTinyMenuGroup.d.ts +30 -0
- package/lib/types/components/menu/desktop/TinyMenuGroup.d.ts +17 -2
- package/lib/types/components/menu/mobile/MobileMenu.d.ts +20 -3
- package/lib/types/components/menu/mobile/MobileMenu.stories.d.ts +16 -1
- package/lib/types/components/menu/types.d.ts +29 -0
- package/lib/types/components/notification/Notification.d.ts +17 -1
- package/lib/types/components/notification/Notification.stories.d.ts +16 -1
- package/lib/types/components/slider/Slider.stories.d.ts +16 -1
- package/lib/types/config/config.d.ts +18 -3
- package/lib/types/controllers/error/error.controller.d.ts +15 -0
- package/lib/types/controllers/menus/menus.d.ts +17 -2
- package/lib/types/controllers/shared-shortcut.controller.d.ts +17 -1
- package/lib/types/controllers/shortcut-display/menu.d.ts +16 -1
- package/lib/types/controllers/shortcut-display/shortcut-panel.controller.d.ts +15 -0
- package/lib/types/controllers/ui/ui-desktop.controller.d.ts +18 -2
- package/lib/types/controllers/ui/ui-mobile.controller.d.ts +25 -4
- package/lib/types/controllers/ui/ui-shared.controller.d.ts +19 -3
- package/lib/types/controllers/ui/ui.controller.d.ts +17 -2
- package/lib/types/facade/f-enum.d.ts +15 -0
- package/lib/types/facade/f-hooks.d.ts +16 -1
- package/lib/types/facade/f-menu-builder.d.ts +17 -1
- package/lib/types/facade/f-shortcut.d.ts +17 -1
- package/lib/types/facade/f-univer.d.ts +21 -4
- package/lib/types/index.d.ts +1 -2
- package/lib/types/locale/ca-ES.d.ts +16 -1
- package/lib/types/locale/es-ES.d.ts +16 -1
- package/lib/types/locale/fa-IR.d.ts +16 -1
- package/lib/types/locale/fr-FR.d.ts +16 -1
- package/lib/types/locale/ja-JP.d.ts +16 -1
- package/lib/types/locale/ko-KR.d.ts +16 -1
- package/lib/types/locale/ru-RU.d.ts +16 -1
- package/lib/types/locale/sk-SK.d.ts +16 -1
- package/lib/types/locale/vi-VN.d.ts +16 -1
- package/lib/types/locale/zh-CN.d.ts +16 -1
- package/lib/types/locale/zh-TW.d.ts +16 -1
- package/lib/types/menu/schema.d.ts +16 -1
- package/lib/types/mobile-plugin.d.ts +16 -1
- package/lib/types/plugin.d.ts +16 -1
- package/lib/types/services/before-close/before-close.service.d.ts +17 -2
- package/lib/types/services/clipboard/clipboard-interface.service.d.ts +16 -1
- package/lib/types/services/clipboard/clipboard.command.d.ts +16 -1
- package/lib/types/services/confirm/desktop-confirm.service.d.ts +18 -2
- package/lib/types/services/contextmenu/contextmenu-host.service.d.ts +18 -2
- package/lib/types/services/contextmenu/contextmenu.service.d.ts +19 -3
- package/lib/types/services/dialog/desktop-dialog.service.d.ts +20 -4
- package/lib/types/services/dialog/dialog.service.d.ts +19 -4
- package/lib/types/services/dom/canvas-dom-layer.service.d.ts +17 -2
- package/lib/types/services/font.service.d.ts +18 -2
- package/lib/types/services/gallery/desktop-gallery.service.d.ts +19 -3
- package/lib/types/services/gallery/gallery.service.d.ts +19 -4
- package/lib/types/services/global-zone/desktop-global-zone.service.d.ts +18 -3
- package/lib/types/services/global-zone/global-zone.service.d.ts +18 -3
- package/lib/types/services/layout/layout.service.d.ts +18 -2
- package/lib/types/services/local-file/desktop-local-file.service.d.ts +16 -1
- package/lib/types/services/local-file/local-file.service.d.ts +1 -1
- package/lib/types/services/local-storage/local-storage.service.d.ts +16 -1
- package/lib/types/services/menu/menu-manager.service.d.ts +21 -4
- package/lib/types/services/menu/menu.d.ts +18 -2
- package/lib/types/services/menu/types.d.ts +5 -1
- package/lib/types/services/message/__testing__/mock-message.service.d.ts +18 -3
- package/lib/types/services/message/desktop-message.service.d.ts +19 -3
- package/lib/types/services/message/message.service.d.ts +18 -3
- package/lib/types/services/notification/desktop-notification.service.d.ts +19 -3
- package/lib/types/services/notification/notification.service.d.ts +18 -3
- package/lib/types/services/parts/parts.service.d.ts +20 -4
- package/lib/types/services/platform/platform.service.d.ts +1 -1
- package/lib/types/services/popup/canvas-popup.service.d.ts +21 -5
- package/lib/types/services/ribbon/ribbon.service.d.ts +19 -3
- package/lib/types/services/shortcut/shortcut-panel.service.d.ts +16 -1
- package/lib/types/services/shortcut/shortcut.service.d.ts +20 -4
- package/lib/types/services/sidebar/desktop-sidebar.service.d.ts +18 -3
- package/lib/types/services/sidebar/sidebar.service.d.ts +20 -5
- package/lib/types/services/theme-switcher/theme-switcher.service.d.ts +16 -1
- package/lib/types/services/zen-zone/desktop-zen-zone.service.d.ts +20 -4
- package/lib/types/services/zen-zone/zen-zone.service.d.ts +19 -4
- package/lib/types/utils/cell.d.ts +16 -1
- package/lib/types/utils/di.d.ts +19 -4
- package/lib/types/views/components/ComponentContainer.d.ts +18 -3
- package/lib/types/views/components/confirm-part/interface.d.ts +17 -2
- package/lib/types/views/components/context-menu/AnchoredContextMenu.d.ts +16 -1
- package/lib/types/views/components/context-menu/ContextMenuPanel.d.ts +17 -1
- package/lib/types/views/components/context-menu/MobileContextMenu.d.ts +1 -1
- package/lib/types/views/components/dialog-part/interface.d.ts +17 -2
- package/lib/types/views/components/dom/FloatDom.d.ts +17 -2
- package/lib/types/views/components/dom/print.d.ts +17 -2
- package/lib/types/views/components/popup/CanvasPopup.d.ts +17 -2
- package/lib/types/views/components/popup/RectPopup.d.ts +18 -3
- package/lib/types/views/components/ribbon/MobileRibbon.d.ts +22 -0
- package/lib/types/views/components/ribbon/Ribbon.d.ts +17 -2
- package/lib/types/views/components/ribbon/ToolbarItem.d.ts +18 -3
- package/lib/types/views/components/ribbon/TooltipButtonWrapper.d.ts +19 -4
- package/lib/types/views/components/ribbon/hook.d.ts +16 -1
- package/lib/types/views/components/ribbon/ribbon-menu/ClassicMenu.d.ts +16 -1
- package/lib/types/views/components/ribbon/ribbon-menu/DefaultMenu.d.ts +16 -1
- package/lib/types/views/components/sidebar/Sidebar.d.ts +17 -2
- package/lib/types/views/mobile-workbench/MobileWorkbench.d.ts +16 -1
- package/lib/types/views/workbench/Workbench.d.ts +16 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +384 -43
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +10 -9
- package/lib/types/components/menu/desktop/Menu.d.ts +0 -17
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require(`@univerjs/core/facade`),require(`@univerjs/engine-render`),require(`@univerjs/ui`),require(`@univerjs/core`)):typeof define==`function`&&define.amd?define([`@univerjs/core/facade`,`@univerjs/engine-render`,`@univerjs/ui`,`@univerjs/core`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCoreFacade,e.UniverEngineRender,e.UniverUi,e.UniverCore))})(this,function(e,t,n,r){function i(e){"@babel/helpers - typeof";return i=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i(e)}function a(e,t){if(i(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(i(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function o(e){var t=a(e,`string`);return i(t)==`symbol`?t:t+``}function s(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(n,r){t(n,r,e)}}function l(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var u=class extends e.FBase{appendTo(e){let t=typeof e==`string`?e.split(`|`):e,n=t.length,r={},i=r,a=this.__getSchema();t.forEach((e,t)=>{t===n-1?i[e]=a:i[e]={},i=i[e]}),this._menuManagerService.mergeMenu(r)}};let d=class extends u{constructor(e,t,i,a){super(),this._item=e,this._injector=t,this._commandService=i,this._menuManagerService=a,s(this,`_commandToRegister`,new Map),s(this,`_buildingSchema`,void 0);let o=typeof e.action==`string`?e.action:(0,r.generateRandomId)(12);o!==e.action&&this._commandToRegister.set(o,e.action),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:n.MenuItemType.BUTTON,icon:e.icon,title:e.title,tooltip:e.tooltip,commandId:o})},e.order!==void 0&&(this._buildingSchema.order=e.order)}__getSchema(){return this._commandToRegister.forEach((e,t)=>{this._commandService.hasCommand(t)||this._commandService.registerCommand({id:t,type:r.CommandType.COMMAND,handler:e})}),{[this._item.id]:this._buildingSchema}}};s(d,`RibbonStartGroup`,n.RibbonStartGroup),s(d,`RibbonPosition`,n.RibbonPosition),s(d,`MenuManagerPosition`,n.MenuManagerPosition),d=l([c(1,(0,r.Inject)(r.Injector)),c(2,r.ICommandService),c(3,n.IMenuManagerService)],d);let f=class extends u{constructor(e,t,r){super(),this._item=e,this._injector=t,this._menuManagerService=r,s(this,`_menuByGroups`,[]),s(this,`_submenus`,[]),s(this,`_buildingSchema`,void 0),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:n.MenuItemType.SUBITEMS,icon:e.icon,title:e.title,tooltip:e.tooltip})},e.order!==void 0&&(this._buildingSchema.order=e.order)}addSubmenu(e){return this._submenus.push(e),this}addSeparator(){return this._menuByGroups.push(this._submenus),this._submenus=[],this}__getSchema(){let e={};return this.addSeparator(),this._menuByGroups.forEach((t,n)=>{let r={};t.forEach(e=>{Object.assign(r,e.__getSchema())}),e[`${this._item.id}-group-${n}`]=r}),{[this._item.id]:Object.assign(this._buildingSchema,e)}}};f=l([c(1,(0,r.Inject)(r.Injector)),c(2,n.IMenuManagerService)],f);let p=class extends e.FBase{constructor(e,t,n,r){super(),this._injector=e,this._renderManagerService=t,this._univerInstanceService=n,this._shortcutService=r,s(this,`_forceDisableDisposable`,null)}enableShortcut(){var e;return(e=this._forceDisableDisposable)==null||e.dispose(),this._forceDisableDisposable=null,this}disableShortcut(){return this._forceDisableDisposable||(this._forceDisableDisposable=this._shortcutService.forceDisable()),this}triggerShortcut(e){let t=this._univerInstanceService.getCurrentUnitForType(r.UniverInstanceType.UNIVER_SHEET);if(!t)return;let n=this._renderManagerService.getRenderById(t.getUnitId());if(n)return n.engine.getCanvasElement().dispatchEvent(e),this._shortcutService.dispatch(e)}dispatchShortcutEvent(e){return this._shortcutService.dispatch(e)}};p=l([c(0,(0,r.Inject)(r.Injector)),c(1,(0,r.Inject)(t.IRenderManagerService)),c(2,r.IUniverInstanceService),c(3,n.IShortcutService)],p);var m=class extends e.FUniver{getURL(){return new URL(window.location.href)}getShortcut(){return this._injector.createInstance(p)}copy(){return this._commandService.executeCommand(n.CopyCommand.id)}paste(){return this._commandService.executeCommand(n.PasteCommand.id)}createMenu(e){return this._injector.createInstance(d,e)}createSubmenu(e){return this._injector.createInstance(f,e)}openSiderbar(e){return this._injector.get(n.ISidebarService).open(e)}openSidebar(e){return this.openSiderbar(e)}openDialog(e){let t=this._injector.get(n.IDialogService).open({...e,onClose:()=>{t.dispose()}});return t}getComponentManager(){return this._injector.get(n.ComponentManager)}showMessage(e){return this._injector.get(n.IMessageService).show(e),this}setUIVisible(e,t){return this._injector.get(n.IUIPartsService).setUIVisible(e,t),this}isUIVisible(e){return this._injector.get(n.IUIPartsService).isUIVisible(e)}registerUIPart(e,t){return this._injector.get(n.IUIPartsService).registerComponent(e,()=>(0,n.connectInjector)(t,this._injector))}registerComponent(e,t,r){let i=this._injector.get(n.ComponentManager);return this.disposeWithMe(i.register(e,t,r))}setCurrent(e){if(!this._injector.get(t.IRenderManagerService).getRenderById(e))throw Error(`Unit not found`);this._univerInstanceService.setCurrentUnitForType(e)}addFonts(e){let t=this._injector.get(n.IFontService);e.forEach(e=>{t.addFont(e)})}};e.FUniver.extend(m);var h=class extends e.FHooks{onBeforeCopy(e){return this._injector.get(r.ICommandService).beforeCommandExecuted(t=>{t.id===n.CopyCommand.id&&e()})}onCopy(e){return this._injector.get(r.ICommandService).onCommandExecuted(t=>{t.id===n.CopyCommand.id&&e()})}onBeforePaste(e){return this._injector.get(r.ICommandService).beforeCommandExecuted(t=>{t.id===n.PasteCommand.id&&e()})}onPaste(e){return this._injector.get(r.ICommandService).onCommandExecuted(t=>{(t.id===n.PasteCommand.id||t.id===n.SheetPasteShortKeyCommandName)&&e()})}};e.FHooks.extend(h);var g=class extends e.FEnum{get BuiltInUIPart(){return n.BuiltInUIPart}get KeyCode(){return n.KeyCode}};e.FEnum.extend(g)});
|