@univerjs/ui 0.1.11 → 0.1.13
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/index.js +14 -14
- package/lib/es/index.js +5762 -5704
- package/lib/index.css +1 -1
- package/lib/locale/en-US.json +61 -0
- package/lib/locale/ru-RU.json +61 -0
- package/lib/locale/zh-CN.json +61 -0
- package/lib/types/common/menu-merge-configs.d.ts +3 -0
- package/lib/types/components/editor/TextEditor.d.ts +1 -0
- package/lib/types/components/notification/Notification.d.ts +9 -5
- package/lib/types/components/progress-bar/ProgressBar.d.ts +4 -1
- package/lib/types/components/range-selector/RangeSelector.d.ts +1 -0
- package/lib/types/controllers/shared-shortcut.controller.d.ts +3 -1
- package/lib/types/controllers/shortcut-display/shortcut-panel.controller.d.ts +3 -1
- package/lib/types/controllers/ui/ui-desktop.controller.d.ts +7 -23
- package/lib/types/controllers/ui/ui.controller.d.ts +10 -15
- package/lib/types/index.d.ts +17 -5
- package/lib/types/services/confirm/desktop-confirm.service.d.ts +8 -2
- package/lib/types/services/dialog/desktop-dialog.service.d.ts +6 -1
- package/lib/types/services/dom/canvas-dom-layer.service.d.ts +31 -0
- package/lib/types/services/menu/menu.d.ts +8 -2
- package/lib/types/services/menu/menu.service.d.ts +8 -3
- package/lib/types/services/message/__testing__/mock-message.service.d.ts +2 -2
- package/lib/types/services/message/desktop-message.service.d.ts +4 -4
- package/lib/types/services/message/message.service.d.ts +2 -2
- package/lib/types/services/notification/desktop-notification.service.d.ts +10 -4
- package/lib/types/services/notification/notification.service.d.ts +2 -2
- package/lib/types/services/parts/parts.service.d.ts +30 -0
- package/lib/types/services/popup/canvas-popup.service.d.ts +9 -10
- package/lib/types/services/progress/progress.service.d.ts +5 -0
- package/lib/types/services/zen-zone/desktop-zen-zone.service.d.ts +2 -0
- package/lib/types/services/zen-zone/zen-zone.service.d.ts +1 -0
- package/lib/types/ui-plugin.d.ts +4 -7
- package/lib/types/views/App.d.ts +1 -6
- package/lib/types/views/components/context-menu/ContextMenu.d.ts +0 -2
- package/lib/types/views/components/doc-bars/Toolbar.d.ts +3 -2
- package/lib/types/views/components/doc-bars/hook.d.ts +44 -0
- package/lib/types/views/components/dom/FloatDom.d.ts +3 -0
- package/lib/types/views/parts.d.ts +1 -1
- package/lib/umd/index.js +14 -14
- package/package.json +15 -14
- package/lib/types/locale/index.d.ts +0 -18
- package/lib/types/views/components/popup/index.d.ts +0 -16
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-float-dom-wrapper{z-index:10}.univer-float-dom{overflow:hidden}.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,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uiToolbar": {
|
|
3
|
+
"start": "Start",
|
|
4
|
+
"insert": "Insert",
|
|
5
|
+
"formulas": "Formulas",
|
|
6
|
+
"data": "Data",
|
|
7
|
+
"view": "View",
|
|
8
|
+
"others": "Others"
|
|
9
|
+
},
|
|
10
|
+
"more": "More",
|
|
11
|
+
"fontFamily": {
|
|
12
|
+
"TimesNewRoman": "Times New Roman",
|
|
13
|
+
"Arial": "Arial",
|
|
14
|
+
"Tahoma": "Tahoma",
|
|
15
|
+
"Verdana": "Verdana",
|
|
16
|
+
"MicrosoftYaHei": "Microsoft YaHei",
|
|
17
|
+
"SimSun": "SimSun",
|
|
18
|
+
"SimHei": "SimHei",
|
|
19
|
+
"Kaiti": "Kaiti",
|
|
20
|
+
"FangSong": "FangSong",
|
|
21
|
+
"NSimSun": "NSimSun",
|
|
22
|
+
"STXinwei": "STXinwei",
|
|
23
|
+
"STXingkai": "STXingkai",
|
|
24
|
+
"STLiti": "STLiti",
|
|
25
|
+
"HanaleiFill": "HanaleiFill",
|
|
26
|
+
"Anton": "Anton",
|
|
27
|
+
"Pacifico": "Pacifico"
|
|
28
|
+
},
|
|
29
|
+
"shortcut-panel": {
|
|
30
|
+
"title": "Shortcuts"
|
|
31
|
+
},
|
|
32
|
+
"shortcut": {
|
|
33
|
+
"undo": "Undo",
|
|
34
|
+
"redo": "Redo",
|
|
35
|
+
"cut": "Cut",
|
|
36
|
+
"copy": "Copy",
|
|
37
|
+
"paste": "Paste",
|
|
38
|
+
"shortcut-panel": "Toggle Shortcut Panel"
|
|
39
|
+
},
|
|
40
|
+
"common-edit": "Common Editing Shortcuts",
|
|
41
|
+
"toggle-shortcut-panel": "Toggle Shortcut Panel",
|
|
42
|
+
"clipboard": {
|
|
43
|
+
"authentication": {
|
|
44
|
+
"title": "Permission Denied",
|
|
45
|
+
"content": "Please allow Univer to access your clipboard."
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"textEditor": {
|
|
49
|
+
"formulaError": "Please enter a valid formula, such as =SUM(A1)",
|
|
50
|
+
"rangeError": "Please enter a valid range, such as A1:B10"
|
|
51
|
+
},
|
|
52
|
+
"rangeSelector": {
|
|
53
|
+
"title": "Select a data range",
|
|
54
|
+
"addAnotherRange": "Add range",
|
|
55
|
+
"buttonTooltip": "Select data range",
|
|
56
|
+
"placeHolder": "Select range or enter.",
|
|
57
|
+
"confirm": "Confirm",
|
|
58
|
+
"cancel": "Cancel"
|
|
59
|
+
},
|
|
60
|
+
"global-shortcut": "Global Shortcut"
|
|
61
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uiToolbar": {
|
|
3
|
+
"start": "Начало",
|
|
4
|
+
"insert": "Вставка",
|
|
5
|
+
"formulas": "Формулы",
|
|
6
|
+
"data": "Данные",
|
|
7
|
+
"view": "Вид",
|
|
8
|
+
"others": "Другие"
|
|
9
|
+
},
|
|
10
|
+
"more": "Больше",
|
|
11
|
+
"fontFamily": {
|
|
12
|
+
"TimesNewRoman": "Times New Roman",
|
|
13
|
+
"Arial": "Arial",
|
|
14
|
+
"Tahoma": "Tahoma",
|
|
15
|
+
"Verdana": "Verdana",
|
|
16
|
+
"MicrosoftYaHei": "Microsoft YaHei",
|
|
17
|
+
"SimSun": "SimSun",
|
|
18
|
+
"SimHei": "SimHei",
|
|
19
|
+
"Kaiti": "Kaiti",
|
|
20
|
+
"FangSong": "FangSong",
|
|
21
|
+
"NSimSun": "NSimSun",
|
|
22
|
+
"STXinwei": "STXinwei",
|
|
23
|
+
"STXingkai": "STXingkai",
|
|
24
|
+
"STLiti": "STLiti",
|
|
25
|
+
"HanaleiFill": "HanaleiFill",
|
|
26
|
+
"Anton": "Anton",
|
|
27
|
+
"Pacifico": "Pacifico"
|
|
28
|
+
},
|
|
29
|
+
"shortcut-panel": {
|
|
30
|
+
"title": "Ярлыки"
|
|
31
|
+
},
|
|
32
|
+
"shortcut": {
|
|
33
|
+
"undo": "Отменить",
|
|
34
|
+
"redo": "Повторить",
|
|
35
|
+
"cut": "Вырезать",
|
|
36
|
+
"copy": "Копировать",
|
|
37
|
+
"paste": "Вставить",
|
|
38
|
+
"shortcut-panel": "Переключить панель ярлыков"
|
|
39
|
+
},
|
|
40
|
+
"common-edit": "Общие команды редактирования",
|
|
41
|
+
"toggle-shortcut-panel": "Переключить панель ярлыков",
|
|
42
|
+
"clipboard": {
|
|
43
|
+
"authentication": {
|
|
44
|
+
"title": "Доступ запрещен",
|
|
45
|
+
"content": "Пожалуйста, разрешите Univer доступ к вашему буферу обмена."
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"textEditor": {
|
|
49
|
+
"formulaError": "Пожалуйста, введите корректную формулу, например =SUM(A1)",
|
|
50
|
+
"rangeError": "Пожалуйста, введите корректный диапазон, например A1:B10"
|
|
51
|
+
},
|
|
52
|
+
"rangeSelector": {
|
|
53
|
+
"title": "Выберите диапазон данных",
|
|
54
|
+
"addAnotherRange": "Добавить диапазон",
|
|
55
|
+
"buttonTooltip": "Выбрать диапазон данных",
|
|
56
|
+
"placeHolder": "Выберите диапазон или введите.",
|
|
57
|
+
"confirm": "Подтвердить",
|
|
58
|
+
"cancel": "Отменить"
|
|
59
|
+
},
|
|
60
|
+
"global-shortcut": "Глобальные ярлыки"
|
|
61
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uiToolbar": {
|
|
3
|
+
"start": "开始",
|
|
4
|
+
"insert": "插入",
|
|
5
|
+
"formulas": "公式",
|
|
6
|
+
"data": "数据",
|
|
7
|
+
"view": "视图",
|
|
8
|
+
"others": "其他"
|
|
9
|
+
},
|
|
10
|
+
"more": "更多",
|
|
11
|
+
"fontFamily": {
|
|
12
|
+
"TimesNewRoman": "Times New Roman",
|
|
13
|
+
"Arial": "Arial",
|
|
14
|
+
"Tahoma": "Tahoma",
|
|
15
|
+
"Verdana": "Verdana",
|
|
16
|
+
"MicrosoftYaHei": "微软雅黑",
|
|
17
|
+
"SimSun": "宋体",
|
|
18
|
+
"SimHei": "黑体",
|
|
19
|
+
"Kaiti": "楷体",
|
|
20
|
+
"FangSong": "仿宋",
|
|
21
|
+
"NSimSun": "新宋体",
|
|
22
|
+
"STXinwei": "华文新魏",
|
|
23
|
+
"STXingkai": "华文行楷",
|
|
24
|
+
"STLiti": "华文隶书",
|
|
25
|
+
"HanaleiFill": "HanaleiFill",
|
|
26
|
+
"Anton": "Anton",
|
|
27
|
+
"Pacifico": "Pacifico"
|
|
28
|
+
},
|
|
29
|
+
"shortcut-panel": {
|
|
30
|
+
"title": "快捷键面板"
|
|
31
|
+
},
|
|
32
|
+
"shortcut": {
|
|
33
|
+
"undo": "撤销",
|
|
34
|
+
"redo": "重做",
|
|
35
|
+
"cut": "剪切",
|
|
36
|
+
"copy": "复制",
|
|
37
|
+
"paste": "粘贴",
|
|
38
|
+
"shortcut-panel": "打开收起快捷键面板"
|
|
39
|
+
},
|
|
40
|
+
"common-edit": "常用编辑",
|
|
41
|
+
"toggle-shortcut-panel": "打开收起快捷键面板",
|
|
42
|
+
"clipboard": {
|
|
43
|
+
"authentication": {
|
|
44
|
+
"title": "无法访问剪贴板",
|
|
45
|
+
"content": "请允许 Univer 访问您的剪贴板。"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"textEditor": {
|
|
49
|
+
"formulaError": "请输入合法的公式,例如=SUM(A1)",
|
|
50
|
+
"rangeError": "请输入合法的范围,例如 A1:B10"
|
|
51
|
+
},
|
|
52
|
+
"rangeSelector": {
|
|
53
|
+
"title": "选择一个数据范围",
|
|
54
|
+
"addAnotherRange": "添加范围",
|
|
55
|
+
"buttonTooltip": "选择数据范围",
|
|
56
|
+
"placeHolder": "框选范围或输入",
|
|
57
|
+
"confirm": "确认",
|
|
58
|
+
"cancel": "取消"
|
|
59
|
+
},
|
|
60
|
+
"global-shortcut": "全局快捷键"
|
|
61
|
+
}
|
|
@@ -3,7 +3,11 @@ 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
|
|
6
|
+
export interface INotificationOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Key of the notification.
|
|
9
|
+
*/
|
|
10
|
+
key?: string;
|
|
7
11
|
/**
|
|
8
12
|
* Component type, optional success, warning, error
|
|
9
13
|
*/
|
|
@@ -33,9 +37,9 @@ export interface INotificationMethodOptions {
|
|
|
33
37
|
*/
|
|
34
38
|
lines?: number;
|
|
35
39
|
}
|
|
36
|
-
export declare const notificationObserver: Subject<
|
|
37
|
-
export declare const PureContent: (props:
|
|
38
|
-
export declare function Notification(): React.JSX.Element;
|
|
40
|
+
export declare const notificationObserver: Subject<INotificationOptions>;
|
|
41
|
+
export declare const PureContent: (props: INotificationOptions) => React.JSX.Element;
|
|
42
|
+
export declare function Notification(): React.JSX.Element | null;
|
|
39
43
|
export declare const notification: {
|
|
40
|
-
show: (options:
|
|
44
|
+
show: (options: INotificationOptions) => void;
|
|
41
45
|
};
|
|
@@ -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
|
-
|
|
12
|
+
private readonly _config;
|
|
13
|
+
constructor(_config: Partial<IUniverUIConfig>, injector: Injector, componentManager: ComponentManager, shortcutService: IShortcutService, menuService: IMenuService, commandService: ICommandService);
|
|
12
14
|
}
|
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
import { Disposable, IUniverInstanceService, LifecycleService } from '@univerjs/core';
|
|
2
2
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
-
import {
|
|
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 {
|
|
5
|
+
import { IUIPartsService } from '../../services/parts/parts.service';
|
|
6
|
+
import { IWorkbenchOptions } from './ui.controller';
|
|
8
7
|
|
|
9
|
-
export declare
|
|
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 {
|
|
8
|
+
export declare class DesktopUIController extends Disposable {
|
|
22
9
|
private readonly _instanceService;
|
|
23
10
|
private readonly _renderManagerService;
|
|
24
11
|
private readonly _injector;
|
|
25
12
|
private readonly _lifecycleService;
|
|
13
|
+
private readonly _uiPartsService;
|
|
26
14
|
private readonly _layoutService?;
|
|
27
|
-
|
|
28
|
-
private readonly _componentRegistered$;
|
|
29
|
-
readonly componentRegistered$: Observable<void>;
|
|
30
|
-
constructor(_instanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _injector: Injector, _lifecycleService: LifecycleService, _layoutService?: ILayoutService | undefined);
|
|
15
|
+
constructor(_instanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _injector: Injector, _lifecycleService: LifecycleService, _uiPartsService: IUIPartsService, _layoutService?: ILayoutService | undefined);
|
|
31
16
|
bootstrapWorkbench(options: IWorkbenchOptions): void;
|
|
32
|
-
|
|
33
|
-
getComponents(part: DesktopUIPart): Set<() => ComponentType>;
|
|
17
|
+
private _initBuiltinComponents;
|
|
34
18
|
}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -21,8 +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
|
|
25
|
-
export {
|
|
24
|
+
export { DesktopUIController } from './controllers/ui/ui-desktop.controller';
|
|
25
|
+
export { IUIPartsService, BuiltInUIPart, UIPartsService } from './services/parts/parts.service';
|
|
26
26
|
export { DesktopBeforeCloseService, IBeforeCloseService } from './services/before-close/before-close.service';
|
|
27
27
|
export { CopyCommand, CutCommand, PasteCommand } from './services/clipboard/clipboard.command';
|
|
28
28
|
export { BrowserClipboardService, HTML_CLIPBOARD_MIME_TYPE, IClipboardInterfaceService, PLAIN_TEXT_CLIPBOARD_MIME_TYPE, } from './services/clipboard/clipboard-interface.service';
|
|
@@ -33,11 +33,12 @@ export { DesktopDialogService } from './services/dialog/desktop-dialog.service';
|
|
|
33
33
|
export { type IDialogPartMethodOptions } from './views/components/dialog-part/interface';
|
|
34
34
|
export { IDialogService } from './services/dialog/dialog.service';
|
|
35
35
|
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';
|
|
36
|
+
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
37
|
export { DesktopMenuService, IMenuService } from './services/menu/menu.service';
|
|
38
38
|
export { DesktopMessageService } from './services/message/desktop-message.service';
|
|
39
39
|
export { IMessageService } from './services/message/message.service';
|
|
40
40
|
export { DesktopNotificationService } from './services/notification/desktop-notification.service';
|
|
41
|
+
export { type NotificationType, type INotificationOptions } from './components/notification/Notification';
|
|
41
42
|
export { INotificationService } from './services/notification/notification.service';
|
|
42
43
|
export { DesktopPlatformService, IPlatformService } from './services/platform/platform.service';
|
|
43
44
|
export { DesktopGlobalZoneService } from './services/global-zone/desktop-global-zone.service';
|
|
@@ -50,12 +51,23 @@ export { IZenZoneService } from './services/zen-zone/zen-zone.service';
|
|
|
50
51
|
export { UniverUIPlugin, DISABLE_AUTO_FOCUS_KEY } from './ui-plugin';
|
|
51
52
|
export * from './utils';
|
|
52
53
|
export { type IConfirmPartMethodOptions } from './views/components/confirm-part/interface';
|
|
54
|
+
export { ComponentContainer } from './views/components/ComponentContainer';
|
|
53
55
|
export { IEditorService, EditorService } from './services/editor/editor.service';
|
|
54
56
|
export { TextEditor } from './components/editor/TextEditor';
|
|
55
57
|
export { SetEditorResizeOperation } from './commands/operations/editor/set-editor-resize.operation';
|
|
56
58
|
export { RangeSelector } from './components/range-selector/RangeSelector';
|
|
57
59
|
export { IRangeSelectorService } from './services/range-selector/range-selector.service';
|
|
58
60
|
export { DesktopLocalStorageService } from './services/local-storage/local-storage.service';
|
|
59
|
-
export { CanvasPopupService, ICanvasPopupService } from './services/popup/canvas-popup.service';
|
|
61
|
+
export { CanvasPopupService, ICanvasPopupService, type IPopup } from './services/popup/canvas-popup.service';
|
|
60
62
|
export { ProgressBar } from './components/progress-bar/ProgressBar';
|
|
61
|
-
export {
|
|
63
|
+
export { type IMenuGroup, useToolbarGroups, useToolbarItemStatus, useToolbarCollapseObserver } from './views/components/doc-bars/hook';
|
|
64
|
+
export { mergeMenuConfigs } from './common/menu-merge-configs';
|
|
65
|
+
export { IProgressService, ProgressService } from './services/progress/progress.service';
|
|
66
|
+
export type { IProgressStep } from './services/progress/progress.service';
|
|
67
|
+
export { GlobalZone } from './views/components/global-zone/GlobalZone';
|
|
68
|
+
export { builtInGlobalComponents } from './views/parts';
|
|
69
|
+
export { ContextMenu } from './views/components/context-menu/ContextMenu';
|
|
70
|
+
export { Sidebar } from './views/components/sidebar/Sidebar';
|
|
71
|
+
export { ZenZone } from './views/components/zen-zone/ZenZone';
|
|
72
|
+
export { CanvasPopup } from './views/components/popup/CanvasPopup';
|
|
73
|
+
export { CanvasFloatDomService, type IFloatDomLayout } from './services/dom/canvas-dom-layer.service';
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import {
|
|
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
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IPosition } from '@univerjs/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
export interface IFloatDomLayout extends IPosition {
|
|
5
|
+
rotate: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
absolute: {
|
|
9
|
+
left: boolean;
|
|
10
|
+
top: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface IFloatDom {
|
|
14
|
+
position$: Observable<IFloatDomLayout>;
|
|
15
|
+
id: string;
|
|
16
|
+
componentKey: string | React.ComponentType;
|
|
17
|
+
onPointerMove: (evt: PointerEvent | MouseEvent) => void;
|
|
18
|
+
onPointerDown: (evt: PointerEvent | MouseEvent) => void;
|
|
19
|
+
onPointerUp: (evt: PointerEvent | MouseEvent) => void;
|
|
20
|
+
onWheel: (evt: WheelEvent) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare class CanvasFloatDomService {
|
|
23
|
+
private _domLayerMap;
|
|
24
|
+
private _domLayers$;
|
|
25
|
+
domLayers$: Observable<[string, IFloatDom][]>;
|
|
26
|
+
get domLayers(): [string, IFloatDom][];
|
|
27
|
+
private _notice;
|
|
28
|
+
addFloatDom(item: IFloatDom): void;
|
|
29
|
+
removeFloatDom(id: string): void;
|
|
30
|
+
removeAll(): void;
|
|
31
|
+
}
|
|
@@ -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
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IMessageOptions, IMessageProps } from '@univerjs/design';
|
|
2
2
|
import { IDisposable } from '@wendellhu/redi';
|
|
3
3
|
import { IMessageService } from '../message.service';
|
|
4
4
|
|
|
@@ -6,6 +6,6 @@ import { IMessageService } from '../message.service';
|
|
|
6
6
|
* This is a mocked message service for testing purposes.
|
|
7
7
|
*/
|
|
8
8
|
export declare class MockMessageService implements IMessageService {
|
|
9
|
-
show(_options:
|
|
9
|
+
show(_options: IMessageOptions & Omit<IMessageProps, 'key'>): IDisposable;
|
|
10
10
|
setContainer(): void;
|
|
11
11
|
}
|