@univerjs/ui 0.1.0-beta.5 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/lib/cjs/index.js +12 -12
- package/lib/es/index.js +3558 -3142
- package/lib/index.css +1 -1
- package/lib/types/commands/operations/editor/set-editor-resize.operation.d.ts +17 -0
- package/lib/types/common/component-manager.d.ts +0 -1
- package/lib/types/components/custom-label/CustomLabel.d.ts +0 -1
- package/lib/types/components/editor/TextEditor.d.ts +40 -0
- package/lib/types/controllers/ui/ui-desktop.controller.d.ts +3 -5
- package/lib/types/index.d.ts +4 -2
- package/lib/types/locale/en-US.d.ts +3 -47
- package/lib/types/locale/zh-CN.d.ts +6 -2
- package/lib/types/services/editor/editor.service.d.ts +181 -0
- package/lib/types/services/layout/layout.service.d.ts +43 -6
- package/lib/types/services/shortcut/shortcut.service.d.ts +4 -2
- package/lib/umd/index.js +12 -12
- package/package.json +10 -9
- package/lib/types/services/focus/focus.service.d.ts +0 -40
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-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))}.univer-app-container{position:relative;display:flex;flex:1;flex-direction:column}.univer-app-container-header{position:relative;z-index:10;width:100%}.univer-app-container-wrapper{display:grid;grid-template-columns:1fr auto;height:100%}.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-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-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{display:flex;gap:var(--margin-xs);align-items:center;justify-content:center;box-sizing:border-box;height:100%;margin:0 auto}.univer-toolbar-more{max-width:80%}.univer-toolbar-more-container{display:grid;gap:var(--margin-xs) 0;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-group{display:flex;gap:var(--margin-xs);align-items:center}.univer-toolbar-group:not(:last-child,:empty):after{content:"";display:block;width:1px;height:20px;background-color:rgb(var(--border-color))}.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: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: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-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))}.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))}.univer-sidebar-header-close{cursor:pointer;color:rgb(var(--text-color-secondary))}.univer-sidebar-body{padding:0 var(--padding-xl)}.univer-sidebar-footer{position:sticky;bottom:0;padding:var(--padding-xl);background:rgb(var(--bg-color-secondary))}.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))}
|
|
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-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))}.univer-app-container{position:relative;display:flex;flex:1;flex-direction:column}.univer-app-container-header{position:relative;z-index:10;width:100%}.univer-app-container-wrapper{display:grid;grid-template-columns:1fr auto;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-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-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{display:flex;gap:var(--margin-xs);align-items:center;justify-content:center;box-sizing:border-box;height:100%;margin:0 auto}.univer-toolbar-more{max-width:80%}.univer-toolbar-more-container{display:grid;gap:var(--margin-xs) 0;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-group{display:flex;gap:var(--margin-xs);align-items:center}.univer-toolbar-group:not(:last-child,:empty):after{content:"";display:block;width:1px;height:20px;background-color:rgb(var(--border-color))}.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: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: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-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))}.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))}.univer-sidebar-header-close{cursor:pointer;color:rgb(var(--text-color-secondary))}.univer-sidebar-body{padding:0 var(--padding-xl)}.univer-sidebar-footer{position:sticky;bottom:0;padding:var(--padding-xl);background:rgb(var(--bg-color-secondary))}.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{border:1px solid rgb(var(--primary-color))}.univer-text-editor-container-error,.univer-text-editor-container-error:hover{border:1px solid rgb(var(--error-color))}.univer-text-editor-validation-error{font-size:10px;color:rgb(var(--error-color))}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
*/
|
|
16
|
+
import type { IOperation } from '@univerjs/core';
|
|
17
|
+
export declare const SetEditorResizeOperation: IOperation;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
/// <reference types="react" />
|
|
17
16
|
import type { Observable } from 'rxjs';
|
|
18
17
|
import type { IMenuSelectorItem } from '../../services/menu/menu';
|
|
19
18
|
export type ICustomLabelProps<T = undefined> = {
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
*/
|
|
16
|
+
import { type IDocumentData, type Nullable } from '@univerjs/core';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import type { IEditorCanvasStyle } from '../../services/editor/editor.service';
|
|
19
|
+
type MyComponentProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
20
|
+
export interface ITextEditorProps {
|
|
21
|
+
id: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
snapshot?: IDocumentData;
|
|
24
|
+
resizeCallBack?: (editor: Nullable<HTMLDivElement>) => void;
|
|
25
|
+
cancelDefaultResizeListener?: boolean;
|
|
26
|
+
isSheetEditor?: boolean;
|
|
27
|
+
canvasStyle?: IEditorCanvasStyle;
|
|
28
|
+
value?: string;
|
|
29
|
+
isSingle?: boolean;
|
|
30
|
+
isReadonly?: boolean;
|
|
31
|
+
onlyInputFormula?: boolean;
|
|
32
|
+
onlyInputRange?: boolean;
|
|
33
|
+
onlyInputContent?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The component to render toolbar item label and menu item label.
|
|
37
|
+
* @param props
|
|
38
|
+
*/
|
|
39
|
+
export declare function TextEditor(props: ITextEditorProps & MyComponentProps): JSX.Element | null;
|
|
40
|
+
export {};
|
|
@@ -20,8 +20,7 @@ import { Injector } from '@wendellhu/redi';
|
|
|
20
20
|
import type { ComponentType } from 'react';
|
|
21
21
|
import React from 'react';
|
|
22
22
|
import type { Observable } from 'rxjs';
|
|
23
|
-
import {
|
|
24
|
-
import { LayoutService } from '../../services/layout/layout.service';
|
|
23
|
+
import { ILayoutService } from '../../services/layout/layout.service';
|
|
25
24
|
import type { IWorkbenchOptions } from './ui.controller';
|
|
26
25
|
import { IUIController } from './ui.controller';
|
|
27
26
|
export declare enum DesktopUIPart {
|
|
@@ -48,15 +47,14 @@ export declare class DesktopUIController extends Disposable implements IDesktopU
|
|
|
48
47
|
private readonly _injector;
|
|
49
48
|
private readonly _lifecycleService;
|
|
50
49
|
private readonly _renderManagerService;
|
|
51
|
-
private readonly
|
|
52
|
-
private readonly _layoutService?;
|
|
50
|
+
private readonly _layoutService;
|
|
53
51
|
private _headerComponents;
|
|
54
52
|
private _headerMenuComponents;
|
|
55
53
|
private _contentComponents;
|
|
56
54
|
private _footerComponents;
|
|
57
55
|
private _componentRegistered$;
|
|
58
56
|
componentRegistered$: Observable<void>;
|
|
59
|
-
constructor(_injector: Injector, _lifecycleService: LifecycleService, _renderManagerService: IRenderManagerService,
|
|
57
|
+
constructor(_injector: Injector, _lifecycleService: LifecycleService, _renderManagerService: IRenderManagerService, _layoutService: ILayoutService);
|
|
60
58
|
bootstrapWorkbench(options: IWorkbenchOptions): void;
|
|
61
59
|
private _initializeEngine;
|
|
62
60
|
registerComponent(part: DesktopUIPart, component: () => React.ComponentType): IDisposable;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -30,8 +30,7 @@ export { DesktopConfirmService } from './services/confirm/desktop-confirm.servic
|
|
|
30
30
|
export { DesktopContextMenuService, type IContextMenuHandler, IContextMenuService, } from './services/contextmenu/contextmenu.service';
|
|
31
31
|
export { DesktopDialogService } from './services/dialog/desktop-dialog.service';
|
|
32
32
|
export { IDialogService } from './services/dialog/dialog.service';
|
|
33
|
-
export {
|
|
34
|
-
export { LayoutService } from './services/layout/layout.service';
|
|
33
|
+
export { ILayoutService, DesktopLayoutService } from './services/layout/layout.service';
|
|
35
34
|
export { type ICustomComponentProps, type IDisplayMenuItem, type IMenuButtonItem, type IMenuItem, type IMenuItemFactory, type IMenuSelectorItem, type IValueOption, MenuGroup, MenuItemType, MenuPosition, } from './services/menu/menu';
|
|
36
35
|
export { DesktopMenuService, IMenuService } from './services/menu/menu.service';
|
|
37
36
|
export { DesktopMessageService } from './services/message/desktop-message.service';
|
|
@@ -49,3 +48,6 @@ export { IZenZoneService } from './services/zen-zone/zen-zone.service';
|
|
|
49
48
|
export { UniverUIPlugin } from './ui-plugin';
|
|
50
49
|
export * from './utils';
|
|
51
50
|
export { type IConfirmPartMethodOptions } from './views/components/confirm-part/interface';
|
|
51
|
+
export { IEditorService, EditorService } from './services/editor/editor.service';
|
|
52
|
+
export { TextEditor } from './components/editor/TextEditor';
|
|
53
|
+
export { SetEditorResizeOperation } from './commands/operations/editor/set-editor-resize.operation';
|
|
@@ -13,50 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
insert: string;
|
|
20
|
-
formulas: string;
|
|
21
|
-
data: string;
|
|
22
|
-
view: string;
|
|
23
|
-
others: string;
|
|
24
|
-
};
|
|
25
|
-
fontFamily: {
|
|
26
|
-
TimesNewRoman: string;
|
|
27
|
-
Arial: string;
|
|
28
|
-
Tahoma: string;
|
|
29
|
-
Verdana: string;
|
|
30
|
-
MicrosoftYaHei: string;
|
|
31
|
-
SimSun: string;
|
|
32
|
-
SimHei: string;
|
|
33
|
-
Kaiti: string;
|
|
34
|
-
FangSong: string;
|
|
35
|
-
NSimSun: string;
|
|
36
|
-
STXinwei: string;
|
|
37
|
-
STXingkai: string;
|
|
38
|
-
STLiti: string;
|
|
39
|
-
HanaleiFill: string;
|
|
40
|
-
Anton: string;
|
|
41
|
-
Pacifico: string;
|
|
42
|
-
};
|
|
43
|
-
'shortcut-panel': {
|
|
44
|
-
title: string;
|
|
45
|
-
};
|
|
46
|
-
shortcut: {
|
|
47
|
-
undo: string;
|
|
48
|
-
redo: string;
|
|
49
|
-
cut: string;
|
|
50
|
-
copy: string;
|
|
51
|
-
paste: string;
|
|
52
|
-
};
|
|
53
|
-
'common-edit': string;
|
|
54
|
-
'toggle-shortcut-panel': string;
|
|
55
|
-
clipboard: {
|
|
56
|
-
authentication: {
|
|
57
|
-
title: string;
|
|
58
|
-
content: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
export default _default;
|
|
16
|
+
import type zhCN from './zh-CN';
|
|
17
|
+
declare const locale: typeof zhCN;
|
|
18
|
+
export default locale;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
declare const
|
|
16
|
+
declare const locale: {
|
|
17
17
|
uiToolbar: {
|
|
18
18
|
start: string;
|
|
19
19
|
insert: string;
|
|
@@ -58,5 +58,9 @@ declare const _default: {
|
|
|
58
58
|
content: string;
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
+
textEditor: {
|
|
62
|
+
formulaError: string;
|
|
63
|
+
rangeError: string;
|
|
64
|
+
};
|
|
61
65
|
};
|
|
62
|
-
export default
|
|
66
|
+
export default locale;
|
|
@@ -0,0 +1,181 @@
|
|
|
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
|
+
*/
|
|
16
|
+
import type { DocumentDataModel, IDocumentBody, IDocumentData, IPosition, Nullable } from '@univerjs/core';
|
|
17
|
+
import { Disposable, IContextService, IUniverInstanceService } from '@univerjs/core';
|
|
18
|
+
import type { IDisposable } from '@wendellhu/redi';
|
|
19
|
+
import type { Observable } from 'rxjs';
|
|
20
|
+
import type { IRender, ISuccinctTextRangeParam } from '@univerjs/engine-render';
|
|
21
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
22
|
+
import { LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
23
|
+
export interface IEditorStateParam extends Partial<IPosition> {
|
|
24
|
+
visible?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface IEditorCanvasStyle {
|
|
27
|
+
fontSize?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface IEditorConfigParam {
|
|
30
|
+
editorUnitId: string;
|
|
31
|
+
initialSnapshot?: IDocumentData;
|
|
32
|
+
cancelDefaultResizeListener?: boolean;
|
|
33
|
+
canvasStyle?: IEditorCanvasStyle;
|
|
34
|
+
isSheetEditor: boolean;
|
|
35
|
+
isSingle: boolean;
|
|
36
|
+
isReadonly: boolean;
|
|
37
|
+
onlyInputFormula: boolean;
|
|
38
|
+
onlyInputRange: boolean;
|
|
39
|
+
onlyInputContent: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface IEditorSetParam extends IEditorConfigParam, IEditorStateParam {
|
|
42
|
+
render: IRender;
|
|
43
|
+
documentDataModel: DocumentDataModel;
|
|
44
|
+
editorDom: HTMLDivElement;
|
|
45
|
+
}
|
|
46
|
+
export interface IEditorSetValueParam {
|
|
47
|
+
editorUnitId: string;
|
|
48
|
+
body: IDocumentBody;
|
|
49
|
+
}
|
|
50
|
+
export interface IEditorInputFormulaParam {
|
|
51
|
+
editorUnitId: string;
|
|
52
|
+
formulaString: string;
|
|
53
|
+
}
|
|
54
|
+
declare class Editor {
|
|
55
|
+
private _param;
|
|
56
|
+
private _focus;
|
|
57
|
+
private _valueLegality;
|
|
58
|
+
constructor(_param: IEditorSetParam);
|
|
59
|
+
get documentDataModel(): DocumentDataModel;
|
|
60
|
+
get editorUnitId(): string;
|
|
61
|
+
get cancelDefaultResizeListener(): boolean | undefined;
|
|
62
|
+
get render(): IRender;
|
|
63
|
+
isValueLegality(): boolean;
|
|
64
|
+
setValueLegality(state?: boolean): void;
|
|
65
|
+
isFocus(): boolean;
|
|
66
|
+
setFocus(state?: boolean): void;
|
|
67
|
+
isSingle(): boolean;
|
|
68
|
+
isReadOnly(): boolean;
|
|
69
|
+
onlyInputContent(): boolean;
|
|
70
|
+
onlyInputFormula(): boolean;
|
|
71
|
+
onlyInputRange(): boolean;
|
|
72
|
+
getBoundingClientRect(): DOMRect;
|
|
73
|
+
isVisible(): boolean | undefined;
|
|
74
|
+
isSheetEditor(): boolean;
|
|
75
|
+
getValue(): string;
|
|
76
|
+
getBody(): IDocumentBody | undefined;
|
|
77
|
+
update(param: IEditorStateParam): void;
|
|
78
|
+
verticalAlign(): void;
|
|
79
|
+
updateCanvasStyle(): void;
|
|
80
|
+
}
|
|
81
|
+
export interface IEditorService {
|
|
82
|
+
getEditor(id?: string): Readonly<Nullable<Editor>>;
|
|
83
|
+
setState(param: IEditorStateParam, id: string): void;
|
|
84
|
+
register(config: IEditorConfigParam, container: HTMLDivElement): IDisposable;
|
|
85
|
+
unRegister(editorUnitId: string): void;
|
|
86
|
+
isVisible(id: string): Nullable<boolean>;
|
|
87
|
+
inputFormula$: Observable<IEditorInputFormulaParam>;
|
|
88
|
+
setFormula(formulaString: string): void;
|
|
89
|
+
resize$: Observable<string>;
|
|
90
|
+
resize(id: string): void;
|
|
91
|
+
getAllEditor(): Map<string, Editor>;
|
|
92
|
+
/**
|
|
93
|
+
* The sheet currently being operated on will determine
|
|
94
|
+
* whether to include unitId information in the ref.
|
|
95
|
+
*/
|
|
96
|
+
setOperationSheetUnitId(unitId: Nullable<string>): void;
|
|
97
|
+
getOperationSheetUnitId(): Nullable<string>;
|
|
98
|
+
/**
|
|
99
|
+
* The sub-table within the sheet currently being operated on
|
|
100
|
+
* will determine whether to include subUnitId information in the ref.
|
|
101
|
+
*/
|
|
102
|
+
setOperationSheetSubUnitId(sheetId: Nullable<string>): void;
|
|
103
|
+
getOperationSheetSubUnitId(): Nullable<string>;
|
|
104
|
+
isEditor(editorUnitId: string): boolean;
|
|
105
|
+
isSheetEditor(editorUnitId: string): boolean;
|
|
106
|
+
changeEditorFocus$: Observable<unknown>;
|
|
107
|
+
changeEditorFocus(): void;
|
|
108
|
+
blur$: Observable<unknown>;
|
|
109
|
+
blur(): void;
|
|
110
|
+
focus$: Observable<ISuccinctTextRangeParam>;
|
|
111
|
+
focus(editorUnitId?: string): void;
|
|
112
|
+
setValue$: Observable<IEditorSetValueParam>;
|
|
113
|
+
valueChange$: Observable<Readonly<Editor>>;
|
|
114
|
+
setValue(val: string, editorUnitId?: string): void;
|
|
115
|
+
setRichValue(body: IDocumentBody, editorUnitId?: string): void;
|
|
116
|
+
getFirstEditor(): Editor;
|
|
117
|
+
focusStyle$: Observable<string>;
|
|
118
|
+
focusStyle(editorUnitId: string): void;
|
|
119
|
+
refreshValueChange(editorId: string): void;
|
|
120
|
+
checkValueLegality(editorId: string): boolean;
|
|
121
|
+
}
|
|
122
|
+
export declare class EditorService extends Disposable implements IEditorService, IDisposable {
|
|
123
|
+
private readonly _currentUniverService;
|
|
124
|
+
private readonly _renderManagerService;
|
|
125
|
+
private readonly _lexerTreeBuilder;
|
|
126
|
+
private readonly _contextService;
|
|
127
|
+
private _editors;
|
|
128
|
+
private readonly _state$;
|
|
129
|
+
readonly state$: Observable<Nullable<IEditorStateParam>>;
|
|
130
|
+
private _currentSheetUnitId;
|
|
131
|
+
private _currentSheetSubUnitId;
|
|
132
|
+
private readonly _inputFormula$;
|
|
133
|
+
readonly inputFormula$: Observable<IEditorInputFormulaParam>;
|
|
134
|
+
private readonly _resize$;
|
|
135
|
+
readonly resize$: Observable<string>;
|
|
136
|
+
private readonly _changeEditorFocus$;
|
|
137
|
+
readonly changeEditorFocus$: Observable<unknown>;
|
|
138
|
+
private readonly _blur$;
|
|
139
|
+
readonly blur$: Observable<unknown>;
|
|
140
|
+
private readonly _focus$;
|
|
141
|
+
readonly focus$: Observable<ISuccinctTextRangeParam>;
|
|
142
|
+
private readonly _setValue$;
|
|
143
|
+
readonly setValue$: Observable<IEditorSetValueParam>;
|
|
144
|
+
private readonly _valueChange$;
|
|
145
|
+
readonly valueChange$: Observable<Readonly<Editor>>;
|
|
146
|
+
private readonly _focusStyle$;
|
|
147
|
+
readonly focusStyle$: Observable<string>;
|
|
148
|
+
constructor(_currentUniverService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _lexerTreeBuilder: LexerTreeBuilder, _contextService: IContextService);
|
|
149
|
+
isEditor(editorUnitId: string): boolean;
|
|
150
|
+
isSheetEditor(editorUnitId: string): boolean;
|
|
151
|
+
changeEditorFocus(): void;
|
|
152
|
+
focusStyle(editorUnitId: string): false | undefined;
|
|
153
|
+
blur(): void;
|
|
154
|
+
focus(editorUnitId?: string): void;
|
|
155
|
+
setFormula(formulaString: string, editorUnitId?: string): void;
|
|
156
|
+
setValue(val: string, editorUnitId?: string): void;
|
|
157
|
+
getValue(id?: string): string | undefined;
|
|
158
|
+
setRichValue(body: IDocumentBody, editorUnitId?: string): void;
|
|
159
|
+
getRichValue(id?: string): IDocumentBody | undefined;
|
|
160
|
+
dispose(): void;
|
|
161
|
+
getEditor(id?: string): Readonly<Nullable<Editor>>;
|
|
162
|
+
getAllEditor(): Map<string, Editor>;
|
|
163
|
+
getFirstEditor(): Editor;
|
|
164
|
+
resize(unitId: string): void;
|
|
165
|
+
setState(param: IEditorStateParam, id: string): void;
|
|
166
|
+
isVisible(id: string): boolean | undefined;
|
|
167
|
+
setOperationSheetUnitId(unitId: Nullable<string>): void;
|
|
168
|
+
getOperationSheetUnitId(): Nullable<string>;
|
|
169
|
+
setOperationSheetSubUnitId(sheetId: Nullable<string>): void;
|
|
170
|
+
getOperationSheetSubUnitId(): Nullable<string>;
|
|
171
|
+
register(config: IEditorConfigParam, container: HTMLDivElement): IDisposable;
|
|
172
|
+
unRegister(editorUnitId: string): void;
|
|
173
|
+
refreshValueChange(editorUnitId: string): void;
|
|
174
|
+
checkValueLegality(editorUnitId: string): boolean;
|
|
175
|
+
private _refreshValueChange;
|
|
176
|
+
private _getCurrentEditorUnitId;
|
|
177
|
+
private _refresh;
|
|
178
|
+
private _getBlank;
|
|
179
|
+
}
|
|
180
|
+
export declare const IEditorService: import("@wendellhu/redi").IdentifierDecorator<IEditorService>;
|
|
181
|
+
export {};
|
|
@@ -13,13 +13,50 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type {
|
|
16
|
+
import type { ContextService } from '@univerjs/core';
|
|
17
|
+
import { Disposable, ILogService, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
|
|
18
|
+
import { type IDisposable } from '@wendellhu/redi';
|
|
19
|
+
type FocusHandlerFn = (unitId: string) => void;
|
|
20
|
+
export declare const FOCUSING_UNIVER = "FOCUSING_UNIVER";
|
|
21
|
+
export interface ILayoutService {
|
|
22
|
+
readonly isFocused: boolean;
|
|
23
|
+
/** Re-focus the currently focused Univer business instance. */
|
|
24
|
+
focus(): void;
|
|
25
|
+
/** Register a focus handler to focus on certain type of Univer unit. */
|
|
26
|
+
registerFocusHandler(type: UniverInstanceType, handler: FocusHandlerFn): IDisposable;
|
|
27
|
+
/** Register the root container element. */
|
|
28
|
+
registerRootContainerElement(container: HTMLElement): IDisposable;
|
|
29
|
+
/** Register a canvas element. */
|
|
30
|
+
registerCanvasElement(container: HTMLCanvasElement): IDisposable;
|
|
31
|
+
/** Register an element as a container, especially floating components like Dialogs and Notifications. */
|
|
32
|
+
registerContainerElement(container: HTMLElement): IDisposable;
|
|
33
|
+
checkElementInCurrentContainers(element: HTMLElement): boolean;
|
|
34
|
+
checkCanvasIsFocused(): boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare const ILayoutService: import("@wendellhu/redi").IdentifierDecorator<ILayoutService>;
|
|
17
37
|
/**
|
|
18
38
|
* This service is responsible for storing layout information of the current
|
|
19
|
-
* Univer application instance
|
|
39
|
+
* Univer application instance.
|
|
20
40
|
*/
|
|
21
|
-
export declare class
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
|
|
41
|
+
export declare class DesktopLayoutService extends Disposable implements ILayoutService {
|
|
42
|
+
private readonly _contextService;
|
|
43
|
+
private readonly _univerInstanceService;
|
|
44
|
+
private readonly _logService;
|
|
45
|
+
private _rootContainerElement;
|
|
46
|
+
private _isFocused;
|
|
47
|
+
get isFocused(): boolean;
|
|
48
|
+
private readonly _focusHandlers;
|
|
49
|
+
private _canvasContainers;
|
|
50
|
+
private _allContainers;
|
|
51
|
+
constructor(_contextService: ContextService, _univerInstanceService: IUniverInstanceService, _logService: ILogService);
|
|
52
|
+
focus(): void;
|
|
53
|
+
registerFocusHandler(type: UniverInstanceType, handler: FocusHandlerFn): IDisposable;
|
|
54
|
+
registerCanvasElement(container: HTMLCanvasElement): IDisposable;
|
|
55
|
+
registerRootContainerElement(container: HTMLElement): IDisposable;
|
|
56
|
+
registerContainerElement(container: HTMLElement): IDisposable;
|
|
57
|
+
checkElementInCurrentContainers(element: HTMLElement): boolean;
|
|
58
|
+
checkCanvasIsFocused(): boolean;
|
|
59
|
+
private _initUniverFocusListener;
|
|
60
|
+
private _initEditorStatus;
|
|
25
61
|
}
|
|
62
|
+
export {};
|
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
import { Disposable, ICommandService, IContextService } from '@univerjs/core';
|
|
17
17
|
import type { IDisposable } from '@wendellhu/redi';
|
|
18
18
|
import type { Observable } from 'rxjs';
|
|
19
|
-
import {
|
|
19
|
+
import { ILayoutService } from '../layout/layout.service';
|
|
20
20
|
import { IPlatformService } from '../platform/platform.service';
|
|
21
21
|
export interface IShortcutItem<P extends object = object> {
|
|
22
22
|
/** This should reuse the corresponding command's id. */
|
|
23
23
|
id: string;
|
|
24
|
+
/** Description of the shortcut. */
|
|
24
25
|
description?: string;
|
|
26
|
+
/** If two shortcuts have the same binding, the one with higher priority would be check first. */
|
|
25
27
|
priority?: number;
|
|
26
28
|
/** A callback that will be triggered to examine if the shortcut should be invoked. */
|
|
27
29
|
preconditions?: (contextService: IContextService) => boolean;
|
|
@@ -59,7 +61,7 @@ export declare class DesktopShortcutService extends Disposable implements IShort
|
|
|
59
61
|
readonly shortcutChanged$: Observable<void>;
|
|
60
62
|
private _forceEscaped;
|
|
61
63
|
private _disable;
|
|
62
|
-
constructor(_commandService: ICommandService, _platformService: IPlatformService, _contextService: IContextService, _layoutService?:
|
|
64
|
+
constructor(_commandService: ICommandService, _platformService: IPlatformService, _contextService: IContextService, _layoutService?: ILayoutService | undefined);
|
|
63
65
|
setDisable(disable: boolean): void;
|
|
64
66
|
getAllShortcuts(): IShortcutItem[];
|
|
65
67
|
registerShortcut(shortcut: IShortcutItem): IDisposable;
|