@univerjs/ui 0.1.11 → 0.1.12

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 (28) hide show
  1. package/lib/cjs/index.js +14 -14
  2. package/lib/es/index.js +5854 -5711
  3. package/lib/index.css +1 -1
  4. package/lib/types/common/menu-merge-configs.d.ts +3 -0
  5. package/lib/types/components/notification/Notification.d.ts +4 -4
  6. package/lib/types/components/progress-bar/ProgressBar.d.ts +4 -1
  7. package/lib/types/controllers/shared-shortcut.controller.d.ts +3 -1
  8. package/lib/types/controllers/shortcut-display/shortcut-panel.controller.d.ts +3 -1
  9. package/lib/types/controllers/ui/ui-desktop.controller.d.ts +3 -22
  10. package/lib/types/controllers/ui/ui.controller.d.ts +10 -15
  11. package/lib/types/index.d.ts +12 -4
  12. package/lib/types/services/confirm/desktop-confirm.service.d.ts +8 -2
  13. package/lib/types/services/dialog/desktop-dialog.service.d.ts +6 -1
  14. package/lib/types/services/menu/menu.d.ts +8 -2
  15. package/lib/types/services/menu/menu.service.d.ts +8 -3
  16. package/lib/types/services/notification/desktop-notification.service.d.ts +10 -4
  17. package/lib/types/services/notification/notification.service.d.ts +2 -2
  18. package/lib/types/services/parts/parts.service.d.ts +30 -0
  19. package/lib/types/services/popup/canvas-popup.service.d.ts +9 -10
  20. package/lib/types/services/zen-zone/desktop-zen-zone.service.d.ts +2 -0
  21. package/lib/types/services/zen-zone/zen-zone.service.d.ts +1 -0
  22. package/lib/types/ui-plugin.d.ts +4 -7
  23. package/lib/types/views/App.d.ts +1 -6
  24. package/lib/types/views/components/doc-bars/Toolbar.d.ts +3 -2
  25. package/lib/types/views/components/doc-bars/hook.d.ts +44 -0
  26. package/lib/types/views/parts.d.ts +1 -1
  27. package/lib/umd/index.js +14 -14
  28. package/package.json +13 -13
package/lib/index.css CHANGED
@@ -1 +1 @@
1
- .univer-ui-plugin-sheets-font-family{overflow:hidden;width:120px;font-size:var(--font-size-xs);text-overflow:ellipsis;white-space:nowrap}.univer-ui-plugin-sheets-font-family-item{font-size:var(--font-size-xs)}.univer-ui-plugin-sheets-font-size{width:28px;height:24px;font-size:var(--font-size-xs)}.univer-ui-plugin-sheets-font-size-input{height:24px;line-height:24px;background-color:transparent;border:none}.univer-ui-plugin-sheets-font-size-input input{font-size:var(--font-size-xs);background-color:transparent}.univer-menu-item-no-hover{background:none}.univer-menu-item-activated{background-color:rgb(var(--bg-color-hover))}.univer-menu-item-content{display:inline-flex;gap:var(--margin-xs);align-items:center}.univer-menu-item-selectable{position:relative;padding-left:var(--padding-xl)}.univer-menu-item-selectable-icon{position:absolute;left:0;display:inline-flex;align-items:center;font-size:var(--font-size-lg)}.univer-menu-item-more-icon{font-size:var(--font-size-sm);color:rgb(var(--text-color))}.univer-app-layout{display:flex;flex-direction:column;height:100%;background-color:rgb(var(--bg-color));min-height:0;position:relative}.univer-app-container{position:relative;display:flex;flex:1;flex-direction:column;min-height:0}.univer-app-container-header{position:relative;z-index:10;width:100%}.univer-app-container-wrapper{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:100%;height:100%;overflow:hidden}.univer-app-container-content{position:relative;overflow:hidden;display:grid;grid-template-rows:auto 1fr;flex:1;background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color))}.univer-app-container-canvas{position:relative}.univer-app-container-left-sidebar,.univer-app-container-sidebar{height:100%}.univer-toolbar-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0;font-size:var(--font-size-lg);color:rgb(var(--text-color));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none}.univer-toolbar-btn:not([disabled]):hover{background-color:rgb(var(--grey-100))}.univer-toolbar-btn[disabled]{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-btn-active{background-color:rgb(var(--grey-100))}.univer-toolbar-btn-active[disabled]{color:rgba(var(--text-color),.25)}.univer-headerbar{user-select:none;position:relative}.univer-headerbar>.univer-header-menu{position:absolute;top:0;right:0;display:flex;box-sizing:border-box;height:100%}.univer-headerbar>.univer-header-menu>div{user-select:none;display:inline-flex;align-items:center;height:28px;margin-left:4px;padding:2px 4px;text-align:center;border-radius:4px}.univer-headerbar>.univer-header-menu>div:hover{background-color:rgb(var(--grey-300))}.univer-menubar{display:flex;gap:var(--margin-xs);align-items:center;justify-content:center;height:32px}.univer-menubar-item{cursor:pointer;display:block;padding:var(--padding-xs) var(--padding-sm);font-size:var(--font-size-xs);font-weight:400;border-radius:var(--border-radius-base);transition:all .1s ease-in-out}.univer-menubar-item:hover:not(.univer-menubar-item-active){background:rgb(var(--grey-300))}.univer-menubar-item-active{color:rgb(var(--color-white));background:rgb(var(--primary-color))}.univer-toolbar{user-select:none;position:relative;display:flex;align-items:center;box-sizing:border-box;height:32px;font-size:var(--font-size-base);color:rgb(var(--text-color));background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color))}.univer-toolbar-container{padding:0 var(--padding-lg);display:flex;gap:var(--margin-xs);align-items:center;justify-content:center;box-sizing:border-box;height:100%;margin:0 auto;max-width:100%;overflow:hidden}.univer-toolbar-more{max-width:80%}.univer-toolbar-more-container{display:grid;box-sizing:border-box;padding:var(--padding-sm);background-color:rgb(var(--bg-color-secondary));border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-base)}.univer-toolbar-more-container .univer-toolbar-group{flex-wrap:wrap}.univer-toolbar-more-container .univer-toolbar-group:not(:last-child):after{content:initial}.univer-toolbar-more-container .univer-toolbar-group:not(:last-child)>*{margin-bottom:var(--margin-xs)}.univer-toolbar-group{display:flex;gap:var(--margin-xs);align-items:center;flex-shrink:0}.univer-toolbar-group>*{flex-shrink:0}.univer-toolbar-group:not(:last-child,:empty):after{content:"";display:block;width:1px;height:20px;background-color:rgb(var(--border-color));flex-shrink:0}.univer-toolbar-item-select-button{cursor:pointer;position:relative;overflow:hidden;display:flex;gap:var(--margin-xs);align-items:center;height:24px;padding-right:18px;font-size:var(--font-size-lg);border-radius:var(--border-radius-base)}.univer-toolbar-item-select-button-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-item-select-button-disabled.univer-toolbar-item-select-button-activated{color:rgba(var(--text-color),.25)}.univer-toolbar-item-select-button-disabled.univer-toolbar-item-select-button-activated .univer-toolbar-item-select-button-label:hover,.univer-toolbar-item-select-button-disabled.univer-toolbar-item-select-button-activated .univer-toolbar-item-select-button-arrow:hover{background-color:rgb(var(--grey-100))!important}.univer-toolbar-item-select-button-activated,.univer-toolbar-item-select-button:hover,.univer-toolbar-item-select-button:hover .univer-toolbar-item-select-button-label{background-color:rgb(var(--grey-100))}.univer-toolbar-item-select-button-label{position:relative;z-index:1;display:flex;align-items:center;height:100%;padding:0 var(--padding-xs)}.univer-toolbar-item-select-button-label:hover{background-color:rgb(var(--grey-300))!important}.univer-toolbar-item-select-button-arrow{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:flex-end;box-sizing:border-box;width:100%;height:100%;padding-right:var(--padding-xs);font-size:10px;color:rgb(var(--grey-400))}.univer-toolbar-item-select-button-arrow:hover{background-color:rgb(var(--grey-300))}.univer-toolbar-item-select{cursor:pointer;position:relative;display:flex;gap:var(--margin-xs);align-items:center;height:24px;padding:0 var(--padding-xs);font-size:var(--font-size-lg);border-radius:var(--border-radius-base)}.univer-toolbar-item-select-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-item-select-disabled.univer-toolbar-item-select-activated{color:rgba(var(--text-color),.25)}.univer-toolbar-item-select-disabled.univer-toolbar-item-select-activated:hover,.univer-toolbar-item-select-activated{background-color:rgb(var(--grey-100))}.univer-toolbar-item-select:hover{background-color:rgb(var(--grey-100));border-radius:var(--border-radius-base)}.univer-toolbar-item-select-arrow{display:flex;align-items:center;height:100%;font-size:10px;color:rgb(var(--grey-400))}.univer-toolbar-item-select-arrow-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-item-select-arrow-disabled.univer-toolbar-item-select-arrow-activated{color:rgba(var(--text-color),.25)}.univer-toolbar-item-select-arrow-disabled.univer-toolbar-item-select-arrow-activated:hover,.univer-toolbar-item-select-arrow-activated{background-color:rgb(var(--grey-100))}.univer-sidebar{position:relative;transform:translate(100%);box-sizing:border-box;width:0;height:100%;color:rgb(var(--text-color));transition:all .15s}.univer-sidebar.univer-sidebar-open{transform:translate(0);width:380px}.univer-sidebar-container{overflow-y:auto;display:grid;grid-template-rows:auto 1fr auto;box-sizing:border-box;width:100%;height:0;min-height:100%;margin:auto;background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color));border-left:1px solid rgb(var(--border-color));scrollbar-color:rgba(var(--scrollbar-color),.7) transparent;scrollbar-gutter:auto;scrollbar-width:thin}.univer-sidebar-header{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;height:44px;padding:var(--padding-xl) var(--padding-xl) 0;font-size:var(--font-size-lg);font-weight:500;background:rgb(var(--bg-color-secondary));box-sizing:border-box;z-index:10}.univer-sidebar-header-close{cursor:pointer;color:rgb(var(--text-color-secondary))}.univer-sidebar-body{padding:0 var(--padding-xl);box-sizing:border-box}.univer-sidebar-footer{position:sticky;bottom:0;padding:var(--padding-xl);background:rgb(var(--bg-color-secondary));box-sizing:border-box}.univer-zen-zone{position:absolute;display:none}.univer-zen-zone-open{z-index:100;top:0;left:0;display:block;width:100%;height:100%;background:rgb(var(--bg-color))}.univer-zen-zone-close{display:none}.univer-notification{position:fixed;z-index:1000;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;box-sizing:border-box;margin:var(--margin-xs) 0}.univer-notification-notice{display:flex;gap:var(--margin-xs);justify-content:space-between;width:280px;padding:var(--padding-lg);font-size:var(--font-size-lg);background-color:rgb(var(--color-white));border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-lg)}.univer-notification-notice-wrapper{margin:var(--margin-xs) var(--margin-base)}.univer-notification-notice-content{display:inline-flex;gap:var(--margin-xs);align-items:center;align-items:flex-start}.univer-notification-notice-close{cursor:pointer;display:flex;align-items:center;justify-content:center;width:fit-content;height:fit-content;padding:var(--padding-xs);color:rgb(var(--text-color-secondary));border-radius:var(--border-radius-base);outline:none;transition:background-color .2s}.univer-notification-notice-close:hover{background-color:rgb(var(--bg-color-hover))}.univer-notification-icon{padding:var(--padding-xs)}.univer-notification-icon-success{color:rgb(var(--success-color))}.univer-notification-icon-info{color:rgb(var(--info-color))}.univer-notification-icon-warning{color:rgb(var(--warning-color))}.univer-notification-icon-error{color:rgb(var(--error-color))}.univer-notification-content-container{display:inline-flex;flex-direction:column;gap:var(--margin-xs);align-items:flex-start;padding-top:var(--padding-xs)}.univer-notification-title{color:rgb(var(--text-color))}.univer-notification-content{color:rgb(var(--text-color-secondary))}.univer-notification-content-ellipsis{overflow:hidden;display:-webkit-box;text-overflow:ellipsis;-webkit-box-orient:vertical}.univer-notification-top,.univer-notification-topLeft,.univer-notification-topRight{top:0}.univer-notification-bottom,.univer-notification-bottomRight,.univer-notification-bottomLeft{bottom:0}.univer-notification-bottomRight,.univer-notification-topRight{right:0}.univer-notification-fade{overflow:hidden;transition:all .3s}.univer-notification-fade-appear-prepare{opacity:0}.univer-notification-fade-appear-start{transform:translate(100%);opacity:0}.univer-notification-fade-appear-active{transform:translate(0);opacity:1}.univer-notification-fade-appear,.univer-notification-fade-enter{opacity:0;animation-play-state:paused;animation-duration:.3s;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-fill-mode:both}.univer-notification-fade-leave{animation-duration:.3s;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-fill-mode:both;animation-play-state:paused}.univer-notification-fade-appear.univer-notification-fade-appear-active,.univer-notification-fade-enter.univer-notification-fade-enter-active{animation-name:univer-notification-fade-in;animation-play-state:running}.univer-notification-fade-leave.univer-notification-fade-leave-active{animation-name:univer-notification-fade-out;animation-play-state:running}@keyframes univer-notification-fade-in{0%{opacity:0}to{opacity:1}}@keyframes univer-notification-fade-out{0%{opacity:1}to{opacity:0}}.univer-global-zone{position:absolute;display:none}.univer-global-zone-open{z-index:100;top:0;left:0;display:block;width:100%;height:100%;background:rgb(var(--bg-color))}.univer-global-zone-close{display:none}.univer-shortcut-panel-group-title{height:40px;font-size:13px;font-weight:700;line-height:40px}.univer-shortcut-panel-item{display:flex;justify-content:space-between;height:40px;font-size:13px;line-height:40px}.univer-shortcut-panel-item-title{overflow:hidden;flex-grow:1;flex-shrink:1;max-width:200px;text-overflow:ellipsis;text-wrap:nowrap}.univer-shortcut-panel-item-shortcut{flex-grow:0;flex-shrink:0}.univer-shortcut-panel-item:not(:last-of-type){border-bottom:1px solid rgb(var(--grey-200))}.univer-text-editor-container{position:relative;width:100%;height:30px;user-select:none;border:1px solid rgb(var(--border-color));transition:all .15s;border-radius:var(--border-radius-base)}.univer-text-editor-container:hover,.univer-text-editor-container:active,.univer-text-editor-container-active,.univer-text-editor-container-active:hover{border:1px solid rgb(var(--hyacinth-500))}.univer-text-editor-container-error,.univer-text-editor-container-error:hover{border:1px solid rgb(var(--red-400))}.univer-text-editor-container-disabled,.univer-text-editor-container-disabled:hover{border-color:rgb(var(--grey-100))}.univer-text-editor-container-placeholder{position:absolute;top:49%;left:5px;transform:translateY(-50%);color:rgb(var(--grey-400));font-size:var(--font-size-xs);pointer-events:none}.univer-text-editor-validation-error{font-size:10px;color:rgb(var(--red-400))}.univer-range-selector{overflow:hidden;display:flex;align-items:center;justify-content:space-between;color:rgb(var(--grey-600));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-base);width:220px;height:28px}.univer-range-selector-editor{position:relative;user-select:none;width:100%;height:100%;border:0;outline:0}.univer-range-selector-icon{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;margin-right:4px;font-size:var(--font-size-lg);color:rgb(var(--text-color));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none}.univer-range-selector-icon:not([disabled]):hover{background-color:rgb(var(--grey-100))}.univer-range-selector-icon[disabled]{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-range-selector:hover,.univer-range-selector-active{border-color:rgb(var(--hyacinth-500))}.univer-range-selector-active .univer-range-selector-icon{color:rgb(var(--hyacinth-500))}.univer-range-selector-error{border-color:rgb(var(--red-400))}.univer-range-selector-error .univer-range-selector-icon{color:rgb(var(--red-400))}.univer-range-selector-error:hover{border-color:rgb(var(--red-400))}.univer-range-selector-disabled{border-color:rgb(var(--grey-100))}.univer-range-selector-disabled .univer-range-selector-icon{color:rgb(var(--grey-100))}.univer-range-selector-disabled:hover{border-color:rgb(var(--grey-100))}.univer-range-selector-modal{position:relative;max-height:500px;overflow:hidden;overflow-y:auto}.univer-range-selector-modal-container{display:flex;flex-direction:row;align-items:center;margin-bottom:10px}.univer-range-selector-modal-container-input{display:inline-block;width:280px}.univer-range-selector-modal-container-input-active{border-color:rgb(var(--hyacinth-500))}.univer-range-selector-modal-container-button{display:inline-block;text-align:center;width:28px}.univer-range-selector-modal-container-button:hover{cursor:pointer;color:rgb(var(--hyacinth-500))}.univer-range-selector-modal-add{position:relative;width:300px;margin-top:5px;text-align:left;color:rgb(var(--hyacinth-500));font-size:var(--font-size-xs)}.univer-range-selector-modal-add-button{display:flex;align-items:center;justify-content:center}.univer-range-selector-modal-add-button:hover{cursor:pointer;background-color:rgb(var(--hyacinth-500),.05)}.univer-progress-bar{margin:12px 8px 0;width:160px;height:4px;background-color:rgb(var(--border-color));border-radius:var(--border-radius-lg)}.univer-progress-bar-inner{height:4px;border-radius:var(--border-radius-lg);transition:width .5s}
1
+ .univer-ui-plugin-sheets-font-family{overflow:hidden;width:120px;font-size:var(--font-size-xs);text-overflow:ellipsis;white-space:nowrap}.univer-ui-plugin-sheets-font-family-item{font-size:var(--font-size-xs)}.univer-ui-plugin-sheets-font-size{width:28px;height:24px;font-size:var(--font-size-xs)}.univer-ui-plugin-sheets-font-size-input{height:24px;line-height:24px;background-color:transparent;border:none}.univer-ui-plugin-sheets-font-size-input input{font-size:var(--font-size-xs);background-color:transparent}.univer-menu-item-no-hover{background:none}.univer-menu-item-activated{background-color:rgb(var(--bg-color-hover))}.univer-menu-item-content{display:inline-flex;gap:var(--margin-xs);align-items:center}.univer-menu-item-selectable{position:relative;padding-left:var(--padding-xl)}.univer-menu-item-selectable-icon{position:absolute;left:0;display:inline-flex;align-items:center;font-size:var(--font-size-lg)}.univer-menu-item-more-icon{font-size:var(--font-size-sm);color:rgb(var(--text-color))}.univer-app-layout{display:flex;flex-direction:column;height:100%;background-color:rgb(var(--bg-color));min-height:0;position:relative}.univer-app-container{position:relative;display:flex;flex:1;flex-direction:column;min-height:0}.univer-app-container-header{position:relative;z-index:10;width:100%}.univer-app-container-wrapper{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:100%;height:100%;overflow:hidden}.univer-app-container-content{position:relative;overflow:hidden;display:grid;grid-template-rows:auto 1fr;flex:1;background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color))}.univer-app-container-canvas{position:relative;overflow:hidden}.univer-app-container-left-sidebar,.univer-app-container-sidebar{height:100%}.univer-toolbar-btn{cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0;font-size:var(--font-size-lg);color:rgb(var(--text-color));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none}.univer-toolbar-btn:not([disabled]):hover{background-color:rgb(var(--grey-100))}.univer-toolbar-btn[disabled]{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-btn-active{background-color:rgb(var(--grey-100))}.univer-toolbar-btn-active[disabled]{color:rgba(var(--text-color),.25)}.univer-headerbar{user-select:none;position:relative}.univer-headerbar>.univer-header-menu{position:absolute;top:0;right:0;display:flex;box-sizing:border-box;height:100%}.univer-headerbar>.univer-header-menu>div{user-select:none;display:inline-flex;align-items:center;height:28px;margin-left:4px;padding:2px 4px;text-align:center;border-radius:4px}.univer-headerbar>.univer-header-menu>div:hover{background-color:rgb(var(--grey-300))}.univer-menubar{display:flex;gap:var(--margin-xs);align-items:center;justify-content:center;height:32px}.univer-menubar-item{cursor:pointer;display:block;padding:var(--padding-xs) var(--padding-sm);font-size:var(--font-size-xs);font-weight:400;border-radius:var(--border-radius-base);transition:all .1s ease-in-out}.univer-menubar-item:hover:not(.univer-menubar-item-active){background:rgb(var(--grey-300))}.univer-menubar-item-active{color:rgb(var(--color-white));background:rgb(var(--primary-color))}.univer-toolbar{user-select:none;position:relative;display:flex;align-items:center;box-sizing:border-box;height:32px;font-size:var(--font-size-base);color:rgb(var(--text-color));background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color))}.univer-toolbar-container{padding:0 var(--padding-lg);display:flex;gap:var(--margin-xs);align-items:center;justify-content:center;box-sizing:border-box;height:100%;margin:0 auto;max-width:100%;overflow:hidden}.univer-toolbar-more{max-width:80%}.univer-toolbar-more-container{display:grid;box-sizing:border-box;padding:var(--padding-sm);background-color:rgb(var(--bg-color-secondary));border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-base)}.univer-toolbar-more-container .univer-toolbar-group{flex-wrap:wrap}.univer-toolbar-more-container .univer-toolbar-group:not(:last-child):after{content:initial}.univer-toolbar-more-container .univer-toolbar-group:not(:last-child)>*{margin-bottom:var(--margin-xs)}.univer-toolbar-group{display:flex;gap:var(--margin-xs);align-items:center;flex-shrink:0}.univer-toolbar-group>*{flex-shrink:0}.univer-toolbar-group:not(:last-child,:empty):after{content:"";display:block;width:1px;height:20px;background-color:rgb(var(--border-color));flex-shrink:0}.univer-toolbar-item-select-button{cursor:pointer;position:relative;overflow:hidden;display:flex;gap:var(--margin-xs);align-items:center;height:24px;padding-right:18px;font-size:var(--font-size-lg);border-radius:var(--border-radius-base)}.univer-toolbar-item-select-button-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-item-select-button-disabled.univer-toolbar-item-select-button-activated{color:rgba(var(--text-color),.25)}.univer-toolbar-item-select-button-disabled.univer-toolbar-item-select-button-activated .univer-toolbar-item-select-button-label:hover,.univer-toolbar-item-select-button-disabled.univer-toolbar-item-select-button-activated .univer-toolbar-item-select-button-arrow:hover{background-color:rgb(var(--grey-100))!important}.univer-toolbar-item-select-button-activated,.univer-toolbar-item-select-button:hover,.univer-toolbar-item-select-button:hover .univer-toolbar-item-select-button-label{background-color:rgb(var(--grey-100))}.univer-toolbar-item-select-button-label{position:relative;z-index:1;display:flex;align-items:center;height:100%;padding:0 var(--padding-xs)}.univer-toolbar-item-select-button-label:hover{background-color:rgb(var(--grey-300))!important}.univer-toolbar-item-select-button-arrow{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:flex-end;box-sizing:border-box;width:100%;height:100%;padding-right:var(--padding-xs);color:rgb(var(--grey-400))}.univer-toolbar-item-select-button-arrow:hover{background-color:rgb(var(--grey-300))}.univer-toolbar-item-select{cursor:pointer;position:relative;display:flex;gap:var(--margin-xs);align-items:center;height:24px;padding:0 var(--padding-xs);font-size:var(--font-size-lg);border-radius:var(--border-radius-base)}.univer-toolbar-item-select-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-item-select-disabled.univer-toolbar-item-select-activated{color:rgba(var(--text-color),.25)}.univer-toolbar-item-select-disabled.univer-toolbar-item-select-activated:hover,.univer-toolbar-item-select-activated{background-color:rgb(var(--grey-100))}.univer-toolbar-item-select:hover{background-color:rgb(var(--grey-100));border-radius:var(--border-radius-base)}.univer-toolbar-item-select-arrow{display:flex;align-items:center;height:100%;color:rgb(var(--grey-400))}.univer-toolbar-item-select-arrow-disabled{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-toolbar-item-select-arrow-disabled.univer-toolbar-item-select-arrow-activated{color:rgba(var(--text-color),.25)}.univer-toolbar-item-select-arrow-disabled.univer-toolbar-item-select-arrow-activated:hover,.univer-toolbar-item-select-arrow-activated{background-color:rgb(var(--grey-100))}.univer-sidebar{position:relative;transform:translate(100%);box-sizing:border-box;width:0;height:100%;color:rgb(var(--text-color));transition:all .15s}.univer-sidebar.univer-sidebar-open{transform:translate(0);width:380px}.univer-sidebar-container{overflow-y:auto;display:grid;grid-template-rows:auto 1fr auto;box-sizing:border-box;width:100%;height:0;min-height:100%;margin:auto;background-color:rgb(var(--bg-color-secondary));border-bottom:1px solid rgb(var(--border-color));border-left:1px solid rgb(var(--border-color));scrollbar-color:rgba(var(--scrollbar-color),.7) transparent;scrollbar-gutter:auto;scrollbar-width:thin}.univer-sidebar-header{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;height:44px;padding:var(--padding-xl) var(--padding-xl) 0;font-size:var(--font-size-lg);font-weight:500;background:rgb(var(--bg-color-secondary));box-sizing:border-box;z-index:10}.univer-sidebar-header-close{cursor:pointer;color:rgb(var(--text-color-secondary))}.univer-sidebar-body{padding:0 var(--padding-xl);box-sizing:border-box}.univer-sidebar-footer{position:sticky;bottom:0;padding:var(--padding-xl);background:rgb(var(--bg-color-secondary));box-sizing:border-box}.univer-zen-zone{position:absolute;display:none}.univer-zen-zone-open{z-index:100;top:0;left:0;display:block;width:100%;height:100%;background:rgb(var(--bg-color))}.univer-zen-zone-close{display:none}.univer-global-zone{position:absolute;display:none}.univer-global-zone-open{z-index:100;top:0;left:0;display:block;width:100%;height:100%;background:rgb(var(--bg-color))}.univer-global-zone-close{display:none}.univer-notification{position:fixed;z-index:1000;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;box-sizing:border-box;margin:var(--margin-xs) 0}.univer-notification-notice{display:flex;gap:var(--margin-xs);justify-content:space-between;width:280px;padding:var(--padding-lg);font-size:var(--font-size-lg);background-color:rgb(var(--color-white));border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-lg)}.univer-notification-notice-wrapper{margin:var(--margin-xs) var(--margin-base)}.univer-notification-notice-content{display:inline-flex;gap:var(--margin-xs);align-items:center;align-items:flex-start}.univer-notification-notice-close{cursor:pointer;display:flex;align-items:center;justify-content:center;width:fit-content;height:fit-content;padding:var(--padding-xs);color:rgb(var(--text-color-secondary));border-radius:var(--border-radius-base);outline:none;transition:background-color .2s}.univer-notification-notice-close:hover{background-color:rgb(var(--bg-color-hover))}.univer-notification-icon{padding:var(--padding-xs)}.univer-notification-icon-success{color:rgb(var(--success-color))}.univer-notification-icon-info{color:rgb(var(--info-color))}.univer-notification-icon-warning{color:rgb(var(--warning-color))}.univer-notification-icon-error{color:rgb(var(--error-color))}.univer-notification-content-container{display:inline-flex;flex-direction:column;gap:var(--margin-xs);align-items:flex-start;padding-top:var(--padding-xs)}.univer-notification-title{color:rgb(var(--text-color))}.univer-notification-content{color:rgb(var(--text-color-secondary))}.univer-notification-content-ellipsis{overflow:hidden;display:-webkit-box;text-overflow:ellipsis;-webkit-box-orient:vertical}.univer-notification-top,.univer-notification-topLeft,.univer-notification-topRight{top:0}.univer-notification-bottom,.univer-notification-bottomRight,.univer-notification-bottomLeft{bottom:0}.univer-notification-bottomRight,.univer-notification-topRight{right:0}.univer-notification-fade{overflow:hidden;transition:all .3s}.univer-notification-fade-appear-prepare{opacity:0}.univer-notification-fade-appear-start{transform:translate(100%);opacity:0}.univer-notification-fade-appear-active{transform:translate(0);opacity:1}.univer-notification-fade-appear,.univer-notification-fade-enter{opacity:0;animation-play-state:paused;animation-duration:.3s;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-fill-mode:both}.univer-notification-fade-leave{animation-duration:.3s;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-fill-mode:both;animation-play-state:paused}.univer-notification-fade-appear.univer-notification-fade-appear-active,.univer-notification-fade-enter.univer-notification-fade-enter-active{animation-name:univer-notification-fade-in;animation-play-state:running}.univer-notification-fade-leave.univer-notification-fade-leave-active{animation-name:univer-notification-fade-out;animation-play-state:running}@keyframes univer-notification-fade-in{0%{opacity:0}to{opacity:1}}@keyframes univer-notification-fade-out{0%{opacity:1}to{opacity:0}}.univer-shortcut-panel-group-title{height:40px;font-size:13px;font-weight:700;line-height:40px}.univer-shortcut-panel-item{display:flex;justify-content:space-between;height:40px;font-size:13px;line-height:40px}.univer-shortcut-panel-item-title{overflow:hidden;flex-grow:1;flex-shrink:1;max-width:200px;text-overflow:ellipsis;text-wrap:nowrap}.univer-shortcut-panel-item-shortcut{flex-grow:0;flex-shrink:0}.univer-shortcut-panel-item:not(:last-of-type){border-bottom:1px solid rgb(var(--grey-200))}.univer-text-editor-container{position:relative;width:100%;height:30px;user-select:none;border:1px solid rgb(var(--border-color));transition:all .15s;border-radius:var(--border-radius-base)}.univer-text-editor-container:hover,.univer-text-editor-container:active,.univer-text-editor-container-active,.univer-text-editor-container-active:hover{border:1px solid rgb(var(--hyacinth-500))}.univer-text-editor-container-error,.univer-text-editor-container-error:hover{border:1px solid rgb(var(--red-400))}.univer-text-editor-container-disabled,.univer-text-editor-container-disabled:hover{border-color:rgb(var(--grey-100))}.univer-text-editor-container-placeholder{position:absolute;top:49%;left:5px;transform:translateY(-50%);color:rgb(var(--grey-400));font-size:var(--font-size-xs);pointer-events:none}.univer-text-editor-validation-error{font-size:10px;color:rgb(var(--red-400))}.univer-range-selector{overflow:hidden;display:flex;align-items:center;justify-content:space-between;color:rgb(var(--grey-600));border:1px solid rgb(var(--border-color));border-radius:var(--border-radius-base);width:220px;height:28px}.univer-range-selector-editor{position:relative;user-select:none;width:100%;height:100%;border:0;outline:0}.univer-range-selector-icon{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;margin-right:4px;font-size:var(--font-size-lg);color:rgb(var(--text-color));background-color:transparent;border:none;border-radius:var(--border-radius-base);outline:none}.univer-range-selector-icon:not([disabled]):hover{background-color:rgb(var(--grey-100))}.univer-range-selector-icon[disabled]{cursor:not-allowed;color:rgb(var(--grey-200))}.univer-range-selector:hover,.univer-range-selector-active{border-color:rgb(var(--hyacinth-500))}.univer-range-selector-active .univer-range-selector-icon{color:rgb(var(--hyacinth-500))}.univer-range-selector-error{border-color:rgb(var(--red-400))}.univer-range-selector-error .univer-range-selector-icon{color:rgb(var(--red-400))}.univer-range-selector-error:hover{border-color:rgb(var(--red-400))}.univer-range-selector-disabled{border-color:rgb(var(--grey-100))}.univer-range-selector-disabled .univer-range-selector-icon{color:rgb(var(--grey-100))}.univer-range-selector-disabled:hover{border-color:rgb(var(--grey-100))}.univer-range-selector-modal{position:relative;max-height:500px;overflow:hidden;overflow-y:auto}.univer-range-selector-modal-container{display:flex;flex-direction:row;align-items:center;margin-bottom:10px}.univer-range-selector-modal-container-input{display:inline-block;width:280px}.univer-range-selector-modal-container-input-active{border-color:rgb(var(--hyacinth-500))}.univer-range-selector-modal-container-button{display:inline-block;text-align:center;width:28px}.univer-range-selector-modal-container-button:hover{cursor:pointer;color:rgb(var(--hyacinth-500))}.univer-range-selector-modal-add{position:relative;width:300px;margin-top:5px;text-align:left;color:rgb(var(--hyacinth-500));font-size:var(--font-size-xs)}.univer-range-selector-modal-add-button{display:flex;align-items:center;justify-content:center}.univer-range-selector-modal-add-button:hover{cursor:pointer;background-color:rgb(var(--hyacinth-500),.05)}.univer-progress-bar{margin:12px 8px 0;width:160px;height:4px;background-color:rgb(var(--border-color));border-radius:var(--border-radius-lg)}.univer-progress-bar-inner{height:4px;border-radius:var(--border-radius-lg);transition:width .5s}
@@ -0,0 +1,3 @@
1
+ import { MenuConfig, MenuItemConfig } from '../services/menu/menu';
2
+
3
+ export declare function mergeMenuConfigs<T = MenuConfig>(baseConfig: T, additionalConfig: MenuItemConfig | null): T;
@@ -3,7 +3,7 @@ import { default as React } from 'react';
3
3
  import { Subject } from 'rxjs';
4
4
 
5
5
  export type NotificationType = 'success' | 'info' | 'warning' | 'error';
6
- export interface INotificationMethodOptions {
6
+ export interface INotificationOptions {
7
7
  /**
8
8
  * Component type, optional success, warning, error
9
9
  */
@@ -33,9 +33,9 @@ export interface INotificationMethodOptions {
33
33
  */
34
34
  lines?: number;
35
35
  }
36
- export declare const notificationObserver: Subject<INotificationMethodOptions>;
37
- export declare const PureContent: (props: INotificationMethodOptions) => React.JSX.Element;
36
+ export declare const notificationObserver: Subject<INotificationOptions>;
37
+ export declare const PureContent: (props: INotificationOptions) => React.JSX.Element;
38
38
  export declare function Notification(): React.JSX.Element;
39
39
  export declare const notification: {
40
- show: (options: INotificationMethodOptions) => void;
40
+ show: (options: INotificationOptions) => void;
41
41
  };
@@ -1,3 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export declare function ProgressBar(): React.JSX.Element;
3
+ export interface IProgressBarProps {
4
+ barColor: string;
5
+ }
6
+ export declare function ProgressBar(props: IProgressBarProps): React.JSX.Element;
@@ -2,6 +2,7 @@ import { Disposable, ICommandService } from '@univerjs/core';
2
2
  import { Injector } from '@wendellhu/redi';
3
3
  import { IMenuService } from '../services/menu/menu.service';
4
4
  import { IShortcutItem, IShortcutService } from '../services/shortcut/shortcut.service';
5
+ import { IUniverUIConfig } from './ui/ui.controller';
5
6
 
6
7
  export declare const CopyShortcutItem: IShortcutItem;
7
8
  export declare const CutShortcutItem: IShortcutItem;
@@ -15,11 +16,12 @@ export declare const RedoShortcutItem: IShortcutItem;
15
16
  * Define shared UI behavior across Univer business. Including undo / redo and clipboard operations.
16
17
  */
17
18
  export declare class SharedController extends Disposable {
19
+ private readonly _config;
18
20
  private readonly _injector;
19
21
  private readonly _menuService;
20
22
  private readonly _shortcutService;
21
23
  private readonly _commandService;
22
- constructor(_injector: Injector, _menuService: IMenuService, _shortcutService: IShortcutService, _commandService: ICommandService);
24
+ constructor(_config: Partial<IUniverUIConfig>, _injector: Injector, _menuService: IMenuService, _shortcutService: IShortcutService, _commandService: ICommandService);
23
25
  initialize(): void;
24
26
  private _registerMenus;
25
27
  private _registerCommands;
@@ -3,10 +3,12 @@ import { Injector } from '@wendellhu/redi';
3
3
  import { ComponentManager } from '../../common/component-manager';
4
4
  import { IMenuService } from '../../services/menu/menu.service';
5
5
  import { IShortcutService } from '../../services/shortcut/shortcut.service';
6
+ import { IUniverUIConfig } from '../ui/ui.controller';
6
7
 
7
8
  /**
8
9
  * This controller add a side panel to the application to display the shortcuts.
9
10
  */
10
11
  export declare class ShortcutPanelController extends Disposable {
11
- constructor(injector: Injector, componentManager: ComponentManager, shortcutService: IShortcutService, menuService: IMenuService, commandService: ICommandService);
12
+ private readonly _config;
13
+ constructor(_config: Partial<IUniverUIConfig>, injector: Injector, componentManager: ComponentManager, shortcutService: IShortcutService, menuService: IMenuService, commandService: ICommandService);
12
14
  }
@@ -1,34 +1,15 @@
1
1
  import { Disposable, IUniverInstanceService, LifecycleService } from '@univerjs/core';
2
2
  import { IRenderManagerService } from '@univerjs/engine-render';
3
- import { IDisposable, Injector } from '@wendellhu/redi';
4
- import { ComponentType, default as React } from 'react';
5
- import { Observable } from 'rxjs';
3
+ import { Injector } from '@wendellhu/redi';
6
4
  import { ILayoutService } from '../../services/layout/layout.service';
7
- import { IWorkbenchOptions, IUIController } from './ui.controller';
5
+ import { IWorkbenchOptions } from './ui.controller';
8
6
 
9
- export declare enum DesktopUIPart {
10
- HEADER = "header",
11
- HEADER_MENU = "header-menu",
12
- CONTENT = "content",
13
- FOOTER = "footer",
14
- LEFT_SIDEBAR = "left-sidebar"
15
- }
16
- export interface IDesktopUIController extends IUIController {
17
- componentRegistered$: Observable<void>;
18
- registerComponent(part: DesktopUIPart, component: () => ComponentType): IDisposable;
19
- getComponents(part: DesktopUIPart): Set<() => ComponentType>;
20
- }
21
- export declare class DesktopUIController extends Disposable implements IDesktopUIController {
7
+ export declare class DesktopUIController extends Disposable {
22
8
  private readonly _instanceService;
23
9
  private readonly _renderManagerService;
24
10
  private readonly _injector;
25
11
  private readonly _lifecycleService;
26
12
  private readonly _layoutService?;
27
- private _componentsByPart;
28
- private readonly _componentRegistered$;
29
- readonly componentRegistered$: Observable<void>;
30
13
  constructor(_instanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _injector: Injector, _lifecycleService: LifecycleService, _layoutService?: ILayoutService | undefined);
31
14
  bootstrapWorkbench(options: IWorkbenchOptions): void;
32
- registerComponent(part: DesktopUIPart, component: () => React.ComponentType): IDisposable;
33
- getComponents(part: DesktopUIPart): Set<() => ComponentType>;
34
15
  }
@@ -1,24 +1,19 @@
1
- /**
2
- * Copyright 2023-present DreamNum Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
1
+ import { DependencyOverride } from '@univerjs/core';
2
+ import { MenuConfig } from '../../services/menu/menu';
3
+
16
4
  export interface IWorkbenchOptions {
17
5
  container?: string | HTMLElement;
18
6
  header?: boolean;
19
7
  footer?: boolean;
8
+ contextMenu?: boolean;
20
9
  }
21
10
  export interface IUIController {
22
11
  bootstrapWorkbench(options: IWorkbenchOptions): void;
23
12
  }
24
13
  export declare const IUIController: import('@wendellhu/redi').IdentifierDecorator<IUIController>;
14
+ export interface IUniverUIConfig extends IWorkbenchOptions {
15
+ /** Disable auto focus when Univer bootstraps. */
16
+ disableAutoFocus?: true;
17
+ override?: DependencyOverride;
18
+ menu?: MenuConfig;
19
+ }
@@ -21,7 +21,8 @@ export { useObservable } from './components/hooks/observable';
21
21
  export { useEvent } from './components/hooks/event';
22
22
  export { CopyShortcutItem, CutShortcutItem, RedoShortcutItem, SharedController, UndoShortcutItem, } from './controllers/shared-shortcut.controller';
23
23
  export { IUIController, type IWorkbenchOptions } from './controllers/ui/ui.controller';
24
- export { DesktopUIController, DesktopUIPart, type IDesktopUIController } from './controllers/ui/ui-desktop.controller';
24
+ export { DesktopUIController } from './controllers/ui/ui-desktop.controller';
25
+ export { IUIPartsService, BuiltInUIPart, UIPartsService } from './services/parts/parts.service';
25
26
  export { enUS, zhCN, ruRU } from './locale';
26
27
  export { DesktopBeforeCloseService, IBeforeCloseService } from './services/before-close/before-close.service';
27
28
  export { CopyCommand, CutCommand, PasteCommand } from './services/clipboard/clipboard.command';
@@ -33,11 +34,12 @@ export { DesktopDialogService } from './services/dialog/desktop-dialog.service';
33
34
  export { type IDialogPartMethodOptions } from './views/components/dialog-part/interface';
34
35
  export { IDialogService } from './services/dialog/dialog.service';
35
36
  export { ILayoutService, DesktopLayoutService } from './services/layout/layout.service';
36
- export { type ICustomComponentProps, type IDisplayMenuItem, type IMenuButtonItem, type IMenuItem, type IMenuItemFactory, type IMenuSelectorItem, type IValueOption, MenuGroup, MenuItemType, MenuPosition, } from './services/menu/menu';
37
+ export { type ICustomComponentProps, type IDisplayMenuItem, type IMenuButtonItem, type IMenuItem, type IMenuItemFactory, type IMenuSelectorItem, type IValueOption, type MenuConfig, MenuGroup, MenuItemType, MenuPosition, type MenuItemDefaultValueType, } from './services/menu/menu';
37
38
  export { DesktopMenuService, IMenuService } from './services/menu/menu.service';
38
39
  export { DesktopMessageService } from './services/message/desktop-message.service';
39
40
  export { IMessageService } from './services/message/message.service';
40
41
  export { DesktopNotificationService } from './services/notification/desktop-notification.service';
42
+ export { type NotificationType, type INotificationOptions } from './components/notification/Notification';
41
43
  export { INotificationService } from './services/notification/notification.service';
42
44
  export { DesktopPlatformService, IPlatformService } from './services/platform/platform.service';
43
45
  export { DesktopGlobalZoneService } from './services/global-zone/desktop-global-zone.service';
@@ -47,6 +49,7 @@ export { DesktopShortcutService, type IShortcutItem, IShortcutService } from './
47
49
  export { DesktopSidebarService } from './services/sidebar/desktop-sidebar.service';
48
50
  export { ISidebarService } from './services/sidebar/sidebar.service';
49
51
  export { IZenZoneService } from './services/zen-zone/zen-zone.service';
52
+ export { ZenZone } from './views/components/zen-zone/ZenZone';
50
53
  export { UniverUIPlugin, DISABLE_AUTO_FOCUS_KEY } from './ui-plugin';
51
54
  export * from './utils';
52
55
  export { type IConfirmPartMethodOptions } from './views/components/confirm-part/interface';
@@ -56,6 +59,11 @@ export { SetEditorResizeOperation } from './commands/operations/editor/set-edito
56
59
  export { RangeSelector } from './components/range-selector/RangeSelector';
57
60
  export { IRangeSelectorService } from './services/range-selector/range-selector.service';
58
61
  export { DesktopLocalStorageService } from './services/local-storage/local-storage.service';
59
- export { CanvasPopupService, ICanvasPopupService } from './services/popup/canvas-popup.service';
62
+ export { CanvasPopupService, ICanvasPopupService, type IPopup } from './services/popup/canvas-popup.service';
63
+ export { ContextMenu } from './views/components/context-menu/ContextMenu';
64
+ export { CanvasPopup } from './views/components/popup/CanvasPopup';
60
65
  export { ProgressBar } from './components/progress-bar/ProgressBar';
61
- export { IProgressService } from './services/progress/progress.service';
66
+ export { type IMenuGroup, useToolbarGroups, useToolbarItemStatus, useToolbarCollapseObserver } from './views/components/doc-bars/hook';
67
+ export { mergeMenuConfigs } from './common/menu-merge-configs';
68
+ export { IProgressService, ProgressService } from './services/progress/progress.service';
69
+ export type { IProgressStep } from './services/progress/progress.service';
@@ -1,12 +1,18 @@
1
- import { IDisposable } from '@wendellhu/redi';
1
+ import { Disposable } from '@univerjs/core';
2
+ import { IDisposable, Injector } from '@wendellhu/redi';
2
3
  import { Subject } from 'rxjs';
3
4
  import { IConfirmPartMethodOptions } from '../../views/components/confirm-part/interface';
5
+ import { IUIPartsService } from '../parts/parts.service';
4
6
  import { IConfirmService } from './confirm.service';
5
7
 
6
- export declare class DesktopConfirmService implements IConfirmService {
8
+ export declare class DesktopConfirmService extends Disposable implements IConfirmService {
9
+ protected readonly _injector: Injector;
10
+ protected readonly _uiPartsService: IUIPartsService;
7
11
  private _confirmOptions;
8
12
  readonly confirmOptions$: Subject<IConfirmPartMethodOptions[]>;
13
+ constructor(_injector: Injector, _uiPartsService: IUIPartsService);
9
14
  open(option: IConfirmPartMethodOptions): IDisposable;
10
15
  confirm(params: IConfirmPartMethodOptions): Promise<boolean>;
11
16
  close(id: string): void;
17
+ protected _initUIPart(): void;
12
18
  }
@@ -1,14 +1,19 @@
1
1
  import { Disposable } from '@univerjs/core';
2
- import { IDisposable } from '@wendellhu/redi';
2
+ import { IDisposable, Injector } from '@wendellhu/redi';
3
3
  import { Subject } from 'rxjs';
4
4
  import { IDialogPartMethodOptions } from '../../views/components/dialog-part/interface';
5
+ import { IUIPartsService } from '../parts/parts.service';
5
6
  import { IDialogService } from './dialog.service';
6
7
 
7
8
  export declare class DesktopDialogService extends Disposable implements IDialogService {
9
+ protected readonly _injector: Injector;
10
+ protected readonly _uiPartsService: IUIPartsService;
8
11
  protected _dialogOptions: IDialogPartMethodOptions[];
9
12
  protected readonly _dialogOptions$: Subject<IDialogPartMethodOptions[]>;
13
+ constructor(_injector: Injector, _uiPartsService: IUIPartsService);
10
14
  dispose(): void;
11
15
  open(option: IDialogPartMethodOptions): IDisposable;
12
16
  close(id: string): void;
13
17
  getDialogs$(): import('rxjs').Observable<IDialogPartMethodOptions[]>;
18
+ protected _initUIPart(): void;
14
19
  }
@@ -94,9 +94,15 @@ export interface IMenuSelectorItem<V = MenuItemDefaultValueType, T = undefined>
94
94
  }
95
95
  export declare function isMenuSelectorItem<T extends MenuItemDefaultValueType>(v: IMenuItem): v is IMenuSelectorItem<T>;
96
96
  export type MenuItemDefaultValueType = string | number | undefined;
97
- export type IMenuItem = IMenuButtonItem | IMenuSelectorItem<MenuItemDefaultValueType>;
97
+ export type IMenuItem = IMenuButtonItem<MenuItemDefaultValueType> | IMenuSelectorItem<MenuItemDefaultValueType>;
98
98
  export type IDisplayMenuItem<T extends IMenuItem> = T & {
99
99
  shortcut?: string;
100
100
  };
101
- export type IMenuItemFactory = (accessor: IAccessor) => IMenuItem;
101
+ export type MenuItemConfig<T extends MenuItemDefaultValueType = MenuItemDefaultValueType> = Partial<Omit<IMenuItem, 'id' | 'subId' | 'value$' | 'hidden$' | 'disabled$' | 'activated$' | 'icon$'> & {
102
+ hidden?: boolean;
103
+ disabled?: boolean;
104
+ activated?: boolean;
105
+ }>;
106
+ export type MenuConfig<T extends MenuItemDefaultValueType = MenuItemDefaultValueType> = Record<string, MenuItemConfig<T>>;
107
+ export type IMenuItemFactory = (accessor: IAccessor, menuConfig?: MenuConfig<MenuItemDefaultValueType>) => IMenuItem;
102
108
  export {};
@@ -2,12 +2,13 @@ import { Disposable } from '@univerjs/core';
2
2
  import { IDisposable } from '@wendellhu/redi';
3
3
  import { Observable } from 'rxjs';
4
4
  import { IShortcutService } from '../shortcut/shortcut.service';
5
- import { IDisplayMenuItem, IMenuItem, MenuPosition } from './menu';
5
+ import { IDisplayMenuItem, IMenuItem, MenuConfig, MenuPosition } from './menu';
6
6
 
7
7
  export declare const IMenuService: import('@wendellhu/redi').IdentifierDecorator<IMenuService>;
8
8
  export interface IMenuService {
9
9
  menuChanged$: Observable<void>;
10
- addMenuItem(item: IMenuItem): IDisposable;
10
+ addMenuItem(item: IMenuItem, config: MenuConfig): IDisposable;
11
+ setMenuItem(item: IMenuItem): void;
11
12
  /** Get menu items for display at a given position or a submenu. */
12
13
  getMenuItems(position: MenuPosition | string): Array<IDisplayMenuItem<IMenuItem>>;
13
14
  getMenuItem(id: string): IMenuItem | null;
@@ -16,13 +17,17 @@ export declare class DesktopMenuService extends Disposable implements IMenuServi
16
17
  private readonly _shortcutService;
17
18
  private readonly _menuItemMap;
18
19
  private readonly _menuByPositions;
20
+ private readonly _menuConfigs;
19
21
  private _menuChanged$;
20
22
  menuChanged$: Observable<void>;
21
23
  constructor(_shortcutService: IShortcutService);
22
24
  dispose(): void;
23
- addMenuItem(item: IMenuItem): IDisposable;
25
+ addMenuItem(item: IMenuItem, config: MenuConfig): IDisposable;
24
26
  getMenuItems(positions: MenuPosition | string): Array<IDisplayMenuItem<IMenuItem>>;
27
+ setMenuItem(item: IMenuItem): void;
25
28
  getMenuItem(id: string): IMenuItem | null;
29
+ setMenuConfigs(id: string, config: MenuConfig): void;
30
+ getMenuConfig(id: string): MenuConfig | null;
26
31
  private _getDisplayMenuItems;
27
32
  private _appendMenuToPosition;
28
33
  }
@@ -1,7 +1,13 @@
1
- import { IDisposable } from '@wendellhu/redi';
2
- import { INotificationMethodOptions } from '../../components/notification/Notification';
1
+ import { Disposable } from '@univerjs/core';
2
+ import { IDisposable, Injector } from '@wendellhu/redi';
3
+ import { INotificationOptions } from '../../components/notification/Notification';
4
+ import { IUIPartsService } from '../parts/parts.service';
3
5
  import { INotificationService } from './notification.service';
4
6
 
5
- export declare class DesktopNotificationService implements INotificationService {
6
- show(params: INotificationMethodOptions): IDisposable;
7
+ export declare class DesktopNotificationService extends Disposable implements INotificationService {
8
+ private readonly _injector;
9
+ private readonly _uiPartsService;
10
+ constructor(_injector: Injector, _uiPartsService: IUIPartsService);
11
+ show(params: INotificationOptions): IDisposable;
12
+ protected _initUIPart(): void;
7
13
  }
@@ -1,7 +1,7 @@
1
1
  import { IDisposable } from '@wendellhu/redi';
2
- import { INotificationMethodOptions } from '../../components/notification/Notification';
2
+ import { INotificationOptions } from '../../components/notification/Notification';
3
3
 
4
4
  export declare const INotificationService: import('@wendellhu/redi').IdentifierDecorator<INotificationService>;
5
5
  export interface INotificationService {
6
- show(params: INotificationMethodOptions): IDisposable;
6
+ show(params: INotificationOptions): IDisposable;
7
7
  }
@@ -0,0 +1,30 @@
1
+ import { IDisposable } from '@wendellhu/redi';
2
+ import { Observable } from 'rxjs';
3
+ import { Disposable } from '@univerjs/core';
4
+ import { ComponentType } from '../../common/component-manager';
5
+
6
+ type ComponentRenderer = () => ComponentType;
7
+ type ComponentPartKey = BuiltInUIPart | string;
8
+ export declare enum BuiltInUIPart {
9
+ GLOBAL = "global",
10
+ HEADER = "header",
11
+ HEADER_MENU = "header-menu",
12
+ CONTENT = "content",
13
+ FOOTER = "footer",
14
+ LEFT_SIDEBAR = "left-sidebar"
15
+ }
16
+ export interface IUIPartsService {
17
+ componentRegistered$: Observable<ComponentPartKey>;
18
+ registerComponent(part: ComponentPartKey, component: () => ComponentType): IDisposable;
19
+ getComponents(part: ComponentPartKey): Set<ComponentRenderer>;
20
+ }
21
+ export declare const IUIPartsService: import('@wendellhu/redi').IdentifierDecorator<IUIPartsService>;
22
+ export declare class UIPartsService extends Disposable implements IUIPartsService {
23
+ private _componentsByPart;
24
+ private readonly _componentRegistered$;
25
+ readonly componentRegistered$: Observable<string>;
26
+ dispose(): void;
27
+ registerComponent(part: ComponentPartKey, component: () => React.ComponentType): IDisposable;
28
+ getComponents(part: ComponentPartKey): Set<ComponentRenderer>;
29
+ }
30
+ export {};
@@ -1,16 +1,14 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ import { IRectPopupProps } from '@univerjs/design';
1
3
  import { IBoundRectNoAngle } from '@univerjs/engine-render';
2
4
  import { Observable } from 'rxjs';
3
5
 
4
- export interface IPopup {
6
+ export interface IPopup extends Pick<IRectPopupProps, 'closeOnSelfTarget' | 'direction' | 'excludeOutside' | 'onClickOutside'> {
5
7
  anchorRect: IBoundRectNoAngle;
6
8
  anchorRect$: Observable<IBoundRectNoAngle>;
7
9
  componentKey: string;
8
- onClickOutside?: (e: MouseEvent) => void;
9
- closeOnSelfTarget?: boolean;
10
- excludeOutside?: HTMLElement[];
11
10
  unitId: string;
12
11
  subUnitId: string;
13
- direction?: 'vertical' | 'horizontal';
14
12
  offset?: [number, number];
15
13
  }
16
14
  export interface ICanvasPopupService {
@@ -21,12 +19,13 @@ export interface ICanvasPopupService {
21
19
  get popups(): [string, IPopup][];
22
20
  }
23
21
  export declare const ICanvasPopupService: import('@wendellhu/redi').IdentifierDecorator<ICanvasPopupService>;
24
- export declare class CanvasPopupService implements ICanvasPopupService {
25
- private _popupMap;
26
- private _popups$;
27
- popups$: Observable<[string, IPopup][]>;
22
+ export declare class CanvasPopupService extends Disposable implements ICanvasPopupService {
23
+ private readonly _popupMap;
24
+ private readonly _popups$;
25
+ readonly popups$: Observable<[string, IPopup][]>;
28
26
  get popups(): [string, IPopup][];
29
- private _notice;
27
+ private _update;
28
+ dispose(): void;
30
29
  addPopup(item: IPopup): string;
31
30
  removePopup(id: string): void;
32
31
  removeAll(): void;
@@ -8,6 +8,8 @@ export declare class DesktopZenZoneService implements IZenZoneService {
8
8
  private readonly _componentManager;
9
9
  readonly visible$: Subject<boolean>;
10
10
  readonly componentKey$: Subject<string>;
11
+ private _visible;
12
+ get visible(): boolean;
11
13
  constructor(_componentManager: ComponentManager);
12
14
  set(key: string, component: ForwardRefExoticComponent<any>): IDisposable;
13
15
  open(): void;
@@ -5,6 +5,7 @@ export declare const IZenZoneService: import('@wendellhu/redi').IdentifierDecora
5
5
  export interface IZenZoneService {
6
6
  readonly visible$: Subject<boolean>;
7
7
  readonly componentKey$: Subject<string>;
8
+ readonly visible: boolean;
8
9
  set(key: string, component: any): IDisposable;
9
10
  open(): void;
10
11
  close(): void;
@@ -1,12 +1,8 @@
1
- import { DependencyOverride, IContextService, LocaleService, Plugin } from '@univerjs/core';
1
+ import { IContextService, LocaleService, Plugin } from '@univerjs/core';
2
2
  import { Injector } from '@wendellhu/redi';
3
- import { IWorkbenchOptions } from './controllers/ui/ui.controller';
3
+ import { IUniverUIConfig } from './controllers/ui/ui.controller';
4
4
 
5
- export interface IUniverUIConfig extends IWorkbenchOptions {
6
- /** Disable auto focus when Univer bootstraps. */
7
- disableAutoFocus?: true;
8
- override?: DependencyOverride;
9
- }
5
+ export declare const DefaultUiConfig: {};
10
6
  export declare const DISABLE_AUTO_FOCUS_KEY = "DISABLE_AUTO_FOCUS";
11
7
  /**
12
8
  * UI plugin provides basic interaction with users. Including workbench (menus, UI parts, notifications etc.), copy paste, shortcut.
@@ -19,6 +15,7 @@ export declare class UniverUIPlugin extends Plugin {
19
15
  static pluginName: string;
20
16
  constructor(_config: Partial<IUniverUIConfig>, _contextService: IContextService, _injector: Injector, _localeService: LocaleService);
21
17
  onStarting(_injector: Injector): void;
18
+ onReady(): void;
22
19
  private _initDependencies;
23
20
  private _initUI;
24
21
  }
@@ -1,13 +1,8 @@
1
- import { ComponentType, default as React } from 'react';
1
+ import { default as React } from 'react';
2
2
  import { IWorkbenchOptions } from '../controllers/ui/ui.controller';
3
3
 
4
4
  export interface IUniverAppProps extends IWorkbenchOptions {
5
5
  mountContainer: HTMLElement;
6
- headerComponents?: Set<() => ComponentType>;
7
- contentComponents?: Set<() => ComponentType>;
8
- footerComponents?: Set<() => ComponentType>;
9
- headerMenuComponents?: Set<() => ComponentType>;
10
- leftSidebarComponents?: Set<() => ComponentType>;
11
6
  onRendered?: (container: HTMLElement) => void;
12
7
  }
13
8
  export declare function App(props: IUniverAppProps): React.JSX.Element;
@@ -1,8 +1,9 @@
1
1
  import { ComponentType, default as React } from 'react';
2
- import { MenuPosition } from '../../../services/menu/menu';
3
2
 
4
- export declare const positions: MenuPosition[];
5
3
  export interface IToolbarProps {
6
4
  headerMenuComponents?: Set<() => ComponentType>;
7
5
  }
6
+ /**
7
+ * Univer's built in toolbar component.
8
+ */
8
9
  export declare function Toolbar(props: IToolbarProps): React.JSX.Element;
@@ -0,0 +1,44 @@
1
+ import { IDisplayMenuItem, IMenuItem, MenuGroup, MenuPosition } from '../../../services/menu/menu';
2
+
3
+ type MenuPositionWithCustom = MenuPosition | string;
4
+ export interface IMenuGroup {
5
+ name: MenuPositionWithCustom;
6
+ menuItems: Array<IDisplayMenuItem<IMenuItem>>;
7
+ }
8
+ export interface IToolbarRenderHookHandler {
9
+ /** The activated category. */
10
+ category: MenuPositionWithCustom;
11
+ /** Update current activate category. */
12
+ setCategory: (position: MenuPositionWithCustom) => void;
13
+ visibleItems: IDisplayMenuItem<IMenuItem>[];
14
+ /** Menu grouped in this category. */
15
+ groups: IMenuGroup[];
16
+ groupsByKey: Record<MenuGroup, Array<IDisplayMenuItem<IMenuItem>>>;
17
+ }
18
+ /**
19
+ * If your custom toolbar component need to render menu items by their category,
20
+ * you can use this hook to get the toolbar status.
21
+ * @returns toolbar status
22
+ */
23
+ export declare function useToolbarGroups(categories: MenuPositionWithCustom[]): IToolbarRenderHookHandler;
24
+ export interface IToolbarItemStatus {
25
+ disabled: boolean;
26
+ value: any;
27
+ activated: boolean;
28
+ hidden: boolean;
29
+ }
30
+ /**
31
+ * Subscribe to a menu item's status change and return the latest status.
32
+ * @param menuItem The menu item
33
+ * @returns The menu item's status
34
+ */
35
+ export declare function useToolbarItemStatus(menuItem: IDisplayMenuItem<IMenuItem>): IToolbarItemStatus;
36
+ export declare function useToolbarCollapseObserver(visibleItems: IToolbarRenderHookHandler['visibleItems']): {
37
+ toolbarRef: import('react').RefObject<HTMLDivElement>;
38
+ toolbarItemRefs: import('react').MutableRefObject<Record<string, {
39
+ el: HTMLDivElement;
40
+ key: string;
41
+ }>>;
42
+ collapsedId: string[];
43
+ };
44
+ export {};
@@ -1,3 +1,3 @@
1
1
  import { ComponentType } from 'react';
2
2
 
3
- export declare const globalComponents: Set<() => ComponentType>;
3
+ export declare const builtInGlobalComponents: Set<() => ComponentType>;