@univerjs/ui 0.5.4 → 0.5.5-nightly.202501201336
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +22 -23
- package/lib/es/facade.js +57 -53
- package/lib/es/index.js +3505 -3551
- package/lib/index.css +1 -1
- package/lib/types/components/hooks/index.d.ts +20 -0
- package/lib/types/components/hooks/update-effect.d.ts +2 -0
- package/lib/types/components/hooks/useClickOutSide.d.ts +5 -0
- package/lib/types/controllers/ui/ui-mobile.controller.d.ts +3 -3
- package/lib/types/facade/f-univer.d.ts +11 -1
- package/lib/types/index.d.ts +2 -4
- package/lib/types/views/components/popup/RectPopup.d.ts +1 -0
- package/lib/types/views/components/popup/dom-popup.d.ts +12 -0
- package/lib/types/views/components/popup/single-canvas-popup.d.ts +9 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +21 -22
- package/package.json +5 -5
- package/LICENSE +0 -176
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-pointer-events-none{pointer-events:none}.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-right-0{right:0}.univer-right-2{right:.5rem}.univer-top-0{top:0}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-grid{display:grid}.univer-h-0{height:0px}.univer-h-6{height:1.5rem}.univer-h-8{height:2rem}.univer-h-full{height:100%}.univer-w-5{width:1.25rem}.univer-cursor-not-allowed{cursor:not-allowed}.univer-cursor-pointer{cursor:pointer}.univer-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.univer-items-center{align-items:center}.univer-justify-center{justify-content:center}.univer-gap-2{gap:.5rem}.univer-overflow-hidden{overflow:hidden}.univer-rounded{border-radius:.25rem}.\!univer-bg-primary-500{--tw-bg-opacity: 1 !important;background-color:rgb(70 106 247 / var(--tw-bg-opacity, 1))!important}.univer-bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(227 229 234 / var(--tw-bg-opacity, 1))}.univer-bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.univer-bg-primary-500{--tw-bg-opacity: 1;background-color:rgb(70 106 247 / var(--tw-bg-opacity, 1))}.univer-px-2{padding-left:.5rem;padding-right:.5rem}.univer-py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.univer-pr-5{padding-right:1.25rem}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-text-gray-200{--tw-text-opacity: 1;color:rgb(227 229 234 / var(--tw-text-opacity, 1))}.univer-text-gray-400{--tw-text-opacity: 1;color:rgb(151 157 172 / var(--tw-text-opacity, 1))}.univer-text-gray-700{--tw-text-opacity: 1;color:rgb(44 48 64 / var(--tw-text-opacity, 1))}.univer-text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.univer-underline{text-decoration-line:underline}.univer-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:\!univer-bg-primary-500:hover{--tw-bg-opacity: 1 !important;background-color:rgb(70 106 247 / var(--tw-bg-opacity, 1))!important}.hover\:univer-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(238 239 241 / var(--tw-bg-opacity, 1))}.hover\:univer-bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(227 229 234 / var(--tw-bg-opacity, 1))}.hover\:univer-bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(205 208 216 / var(--tw-bg-opacity, 1))}.\[\&\>\*\]\:univer-inline-flex>*{display:inline-flex}.\[\&\>\*\]\:univer-h-6>*{height:1.5rem}.\[\&\>\*\]\:univer-items-center>*{align-items:center}.\[\&\>\*\]\:univer-rounded>*{border-radius:.25rem}.\[\&\>\*\]\:univer-px-1>*{padding-left:.25rem;padding-right:.25rem}.\[\&\>\*\]\:univer-transition-colors>*{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:\[\&\>\*\]\:univer-bg-gray-300>*:hover{--tw-bg-opacity: 1;background-color:rgb(205 208 216 / var(--tw-bg-opacity, 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-popup-fixed{position:fixed;z-index:1000;top:-9999px;left:-9999px}.univer-menu-item-no-hover,.univer-menu-item-no-hover.univer-menu-item-active{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-progress-bar{width:160px;height:4px;background-color:rgb(var(--border-color));border-radius:var(--border-radius-lg);margin-right:var(--margin-xs)}.univer-progress-bar-container{display:flex;align-items:center;margin:0 var(--margin-xs) 0 var(--margin-xs)}.univer-progress-bar-label{font-size:var(--font-size-xxs);color:rgb(var(--text-color-secondary));width:98px;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:var(--margin-xs);line-height:17px}.univer-progress-bar-inner{height:4px;border-radius:var(--border-radius-lg);transition:width .5s}.univer-progress-bar-close-button{background:none;border:none;font-size:var(--font-size-xxs);color:rgb(var(--text-color));cursor:pointer;padding:0;margin:0;line-height:1;display:flex;align-items:center}.univer-progress-bar-close-button:hover{color:rgb(var(--text-color-secondary))}.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-float-dom-wrapper{z-index:10}.univer-float-dom{overflow:hidden}.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-no-icon{padding:var(--padding-xs)}.univer-toolbar-btn-active{background-color:rgb(var(--grey-100))}.univer-toolbar-btn-active[disabled]{color:rgba(var(--text-color),.25)}.univer-toolbar{-webkit-user-select:none;-moz-user-select:none;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{flex:1;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;align-items:center;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{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{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%;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{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))}.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;z-index:-1;transition:all .2s ease-in-out;display:flex;flex-direction:row}.univer-zen-zone-open{z-index:100;top:0;left:0;width:100%;height:100%;background:rgb(var(--bg-color));opacity:1}.univer-zen-zone-close{opacity:0}.univer-zen-zone-editor-container{flex:1;position:relative}.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-workbench-layout{display:flex;flex-direction:column;height:100%;background-color:rgb(var(--bg-color));min-height:0;position:relative}.univer-workbench-custom-header{position:relative;display:flex;flex-direction:column;min-height:0;background-color:rgb(var(--color-white))}.univer-workbench-container{position:relative;display:flex;flex:1;flex-direction:column;min-height:0}.univer-workbench-container-header{position:relative;z-index:10;width:100%}.univer-workbench-container-wrapper{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:100%;height:100%;overflow:hidden}.univer-workbench-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-workbench-container-doc-content{background:rgb(var(--bg-color-secondary))}.univer-workbench-container-canvas{position:relative;overflow:hidden}.univer-workbench-container-left-sidebar,.univer-workbench-container-sidebar{height:100%}.univer-mobile-menu-container{min-width:32px;max-width:200px;display:grid;grid-gap:4px;background-color:#000;border-radius:4px;padding:4px 8px}.univer-mobile-menu-item{display:flex;flex-direction:column;justify-content:center;align-items:center;border:none;background:none;color:#fff;width:48px}.univer-mobile-menu-item>svg{font-size:18px;height:18px;width:18px}.univer-mobile-menu-item>span{width:100%;margin-top:2px;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.univer-app-layout{display:flex;flex-direction:column;height:100%;background-color:rgb(var(--bg-color));min-height:0;position:relative}.univer-app-custom-header{position:relative;display:flex;flex-direction:column;min-height:0;background-color:rgb(var(--color-white))}.univer-app-header{width:100vw}.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-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:-moz-fit-content;width:fit-content;height:-moz-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}}
|
|
1
|
+
.univer-pointer-events-none{pointer-events:none}.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-right-0{right:0}.univer-right-2{right:.5rem}.univer-top-0{top:0}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-grid{display:grid}.univer-h-0{height:0px}.univer-h-6{height:1.5rem}.univer-h-8{height:2rem}.univer-h-full{height:100%}.univer-w-5{width:1.25rem}.univer-cursor-not-allowed{cursor:not-allowed}.univer-cursor-pointer{cursor:pointer}.univer-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.univer-items-center{align-items:center}.univer-justify-center{justify-content:center}.univer-gap-2{gap:.5rem}.univer-overflow-hidden{overflow:hidden}.univer-rounded{border-radius:.25rem}.\!univer-bg-primary-500{--tw-bg-opacity: 1 !important;background-color:#466af7!important;background-color:rgba(70,106,247,var(--tw-bg-opacity, 1))!important}.univer-bg-gray-200{--tw-bg-opacity: 1;background-color:#e3e5ea;background-color:rgba(227,229,234,var(--tw-bg-opacity, 1))}.univer-bg-gray-50{--tw-bg-opacity: 1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--tw-bg-opacity, 1))}.univer-bg-primary-500{--tw-bg-opacity: 1;background-color:#466af7;background-color:rgba(70,106,247,var(--tw-bg-opacity, 1))}.univer-px-2{padding-left:.5rem;padding-right:.5rem}.univer-py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.univer-pr-5{padding-right:1.25rem}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-text-gray-200{--tw-text-opacity: 1;color:#e3e5ea;color:rgba(227,229,234,var(--tw-text-opacity, 1))}.univer-text-gray-400{--tw-text-opacity: 1;color:#979dac;color:rgba(151,157,172,var(--tw-text-opacity, 1))}.univer-text-gray-700{--tw-text-opacity: 1;color:#2c3040;color:rgba(44,48,64,var(--tw-text-opacity, 1))}.univer-text-white{--tw-text-opacity: 1;color:#fff;color:rgba(255,255,255,var(--tw-text-opacity, 1))}.univer-underline{text-decoration-line:underline}.univer-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:\!univer-bg-primary-500:hover{--tw-bg-opacity: 1 !important;background-color:#466af7!important;background-color:rgba(70,106,247,var(--tw-bg-opacity, 1))!important}.hover\:univer-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:#eeeff1;background-color:rgba(238,239,241,var(--tw-bg-opacity, 1))}.hover\:univer-bg-gray-200:hover{--tw-bg-opacity: 1;background-color:#e3e5ea;background-color:rgba(227,229,234,var(--tw-bg-opacity, 1))}.hover\:univer-bg-gray-300:hover{--tw-bg-opacity: 1;background-color:#cdd0d8;background-color:rgba(205,208,216,var(--tw-bg-opacity, 1))}.\[\&\>\*\]\:univer-inline-flex>*{display:inline-flex}.\[\&\>\*\]\:univer-h-6>*{height:1.5rem}.\[\&\>\*\]\:univer-items-center>*{align-items:center}.\[\&\>\*\]\:univer-rounded>*{border-radius:.25rem}.\[\&\>\*\]\:univer-px-1>*{padding-left:.25rem;padding-right:.25rem}.\[\&\>\*\]\:univer-transition-colors>*{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:\[\&\>\*\]\:univer-bg-gray-300>*:hover{--tw-bg-opacity: 1;background-color:#cdd0d8;background-color:rgba(205,208,216,var(--tw-bg-opacity, 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-popup-fixed{position:fixed;z-index:1020;top:-9999px;left:-9999px}.univer-menu-item-no-hover,.univer-menu-item-no-hover.univer-menu-item-active{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-progress-bar{width:160px;height:4px;background-color:rgb(var(--border-color));border-radius:var(--border-radius-lg);margin-right:var(--margin-xs)}.univer-progress-bar-container{display:flex;align-items:center;margin:0 var(--margin-xs) 0 var(--margin-xs)}.univer-progress-bar-label{font-size:var(--font-size-xxs);color:rgb(var(--text-color-secondary));width:98px;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:var(--margin-xs);line-height:17px}.univer-progress-bar-inner{height:4px;border-radius:var(--border-radius-lg);transition:width .5s}.univer-progress-bar-close-button{background:none;border:none;font-size:var(--font-size-xxs);color:rgb(var(--text-color));cursor:pointer;padding:0;margin:0;line-height:1;display:flex;align-items:center}.univer-progress-bar-close-button:hover{color:rgb(var(--text-color-secondary))}.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-float-dom-wrapper{z-index:10}.univer-float-dom{overflow:hidden}.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-no-icon{padding:var(--padding-xs)}.univer-toolbar-btn-active{background-color:rgb(var(--grey-100))}.univer-toolbar-btn-active[disabled]{color:rgba(var(--text-color),.25)}.univer-toolbar{-webkit-user-select:none;-moz-user-select:none;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{flex:1;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:normal;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):not(: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;align-items:center;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{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{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%;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{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))}.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;z-index:-1;transition:all .2s ease-in-out;display:flex;flex-direction:row}.univer-zen-zone-open{z-index:100;top:0;left:0;width:100%;height:100%;background:rgb(var(--bg-color));opacity:1}.univer-zen-zone-close{opacity:0}.univer-zen-zone-editor-container{flex:1;position:relative}.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-workbench-layout{display:flex;flex-direction:column;height:100%;background-color:rgb(var(--bg-color));min-height:0;position:relative}.univer-workbench-custom-header{position:relative;display:flex;flex-direction:column;min-height:0;background-color:rgb(var(--color-white))}.univer-workbench-container{position:relative;display:flex;flex:1;flex-direction:column;min-height:0}.univer-workbench-container-header{position:relative;z-index:10;width:100%}.univer-workbench-container-wrapper{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:100%;height:100%;overflow:hidden}.univer-workbench-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-workbench-container-doc-content{background:rgb(var(--bg-color-secondary))}.univer-workbench-container-canvas{position:relative;overflow:hidden}.univer-workbench-container-left-sidebar,.univer-workbench-container-sidebar{height:100%}.univer-mobile-menu-container{min-width:32px;max-width:200px;display:grid;grid-gap:4px;background-color:#000;border-radius:4px;padding:4px 8px}.univer-mobile-menu-item{display:flex;flex-direction:column;justify-content:center;align-items:center;border:none;background:none;color:#fff;width:48px}.univer-mobile-menu-item>svg{font-size:18px;height:18px;width:18px}.univer-mobile-menu-item>span{width:100%;margin-top:2px;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.univer-app-layout{display:flex;flex-direction:column;height:100%;background-color:rgb(var(--bg-color));min-height:0;position:relative}.univer-app-custom-header{position:relative;display:flex;flex-direction:column;min-height:0;background-color:rgb(var(--color-white))}.univer-app-header{width:100vw}.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-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:-moz-fit-content;width:fit-content;height:-moz-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}}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
export { useEvent } from './event';
|
|
17
|
+
export { useObservable, useObservableRef } from './observable';
|
|
18
|
+
export { useUpdateEffect } from './update-effect';
|
|
19
|
+
export { useClickOutSide } from './useClickOutSide';
|
|
20
|
+
export { useVirtualList } from './virtual-list';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { IUniverUIConfig } from '../config.schema';
|
|
2
|
+
import { IUIController } from './ui.controller';
|
|
1
3
|
import { Disposable, Injector, IUniverInstanceService, LifecycleService } from '@univerjs/core';
|
|
2
4
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
3
5
|
import { ILayoutService } from '../../services/layout/layout.service';
|
|
4
|
-
import { IUIPartsService } from '../../services/parts/parts.service';
|
|
5
|
-
import { IUniverUIConfig } from '../config.schema';
|
|
6
6
|
import { IMenuManagerService } from '../../services/menu/menu-manager.service';
|
|
7
|
-
import {
|
|
7
|
+
import { IUIPartsService } from '../../services/parts/parts.service';
|
|
8
8
|
export declare class MobileUIController extends Disposable implements IUIController {
|
|
9
9
|
private readonly _config;
|
|
10
10
|
private readonly _instanceService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IDisposable, FUniver } from '@univerjs/core';
|
|
2
2
|
import { IMessageProps } from '@univerjs/design';
|
|
3
|
-
import { BuiltInUIPart, IDialogPartMethodOptions, ISidebarMethodOptions, ComponentManager } from '@univerjs/ui';
|
|
3
|
+
import { BuiltInUIPart, ComponentType, IComponentOptions, IDialogPartMethodOptions, ISidebarMethodOptions, ComponentManager } from '@univerjs/ui';
|
|
4
4
|
import { IFacadeMenuItem, IFacadeSubmenuItem, FMenu, FSubmenu } from './f-menu-builder';
|
|
5
5
|
import { FShortcut } from './f-shortcut';
|
|
6
6
|
export interface IFUniverUIMixin {
|
|
@@ -117,6 +117,15 @@ export interface IFUniverUIMixin {
|
|
|
117
117
|
* ```
|
|
118
118
|
*/
|
|
119
119
|
registerUIPart(key: BuiltInUIPart, component: any): IDisposable;
|
|
120
|
+
/**
|
|
121
|
+
* register an component.
|
|
122
|
+
* @param component
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* univerAPI.registerComponent(() => React.createElement('h1', null, 'Custom Header'));
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
registerComponent(name: string, component: ComponentType, options?: IComponentOptions): IDisposable;
|
|
120
129
|
}
|
|
121
130
|
export declare class FUniverUIMixin extends FUniver implements IFUniverUIMixin {
|
|
122
131
|
getURL(): URL;
|
|
@@ -133,6 +142,7 @@ export declare class FUniverUIMixin extends FUniver implements IFUniverUIMixin {
|
|
|
133
142
|
setUIVisible(ui: BuiltInUIPart, visible: boolean): FUniver;
|
|
134
143
|
isUIVisible(ui: BuiltInUIPart): boolean;
|
|
135
144
|
registerUIPart(key: BuiltInUIPart, component: any): IDisposable;
|
|
145
|
+
registerComponent(name: string, component: any, options?: IComponentOptions): IDisposable;
|
|
136
146
|
}
|
|
137
147
|
declare module '@univerjs/core' {
|
|
138
148
|
interface FUniver extends IFUniverUIMixin {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -18,11 +18,9 @@ export * from './common';
|
|
|
18
18
|
export { getHeaderFooterMenuHiddenObservable, getMenuHiddenObservable } from './common/menu-hidden-observable';
|
|
19
19
|
export { mergeMenuConfigs } from './common/menu-merge-configs';
|
|
20
20
|
export * from './components';
|
|
21
|
-
export { useEvent } from './components/hooks/event';
|
|
22
21
|
export { t } from './components/hooks/locale';
|
|
23
|
-
export
|
|
22
|
+
export * from './components/hooks';
|
|
24
23
|
export { RectPopup } from './views/components/popup/RectPopup';
|
|
25
|
-
export { useVirtualList } from './components/hooks/virtual-list';
|
|
26
24
|
export { Menu as UIMenu } from './components/menu/desktop/Menu';
|
|
27
25
|
export { type INotificationOptions, type NotificationType } from './components/notification/Notification';
|
|
28
26
|
export { ProgressBar } from './components/progress-bar/ProgressBar';
|
|
@@ -44,7 +42,7 @@ export { DesktopConfirmService } from './services/confirm/desktop-confirm.servic
|
|
|
44
42
|
export { ContextMenuService, type IContextMenuHandler, IContextMenuService, } from './services/contextmenu/contextmenu.service';
|
|
45
43
|
export { DesktopDialogService } from './services/dialog/desktop-dialog.service';
|
|
46
44
|
export { IDialogService } from './services/dialog/dialog.service';
|
|
47
|
-
export { CanvasFloatDomService, type IFloatDomLayout } from './services/dom/canvas-dom-layer.service';
|
|
45
|
+
export { CanvasFloatDomService, type IFloatDom, type IFloatDomLayout } from './services/dom/canvas-dom-layer.service';
|
|
48
46
|
export { DesktopGlobalZoneService } from './services/global-zone/desktop-global-zone.service';
|
|
49
47
|
export { IGlobalZoneService } from './services/global-zone/global-zone.service';
|
|
50
48
|
export { DesktopLayoutService, ILayoutService } from './services/layout/layout.service';
|
|
@@ -22,6 +22,7 @@ export interface IRectPopupProps {
|
|
|
22
22
|
onPointerEnter?: (e: React.PointerEvent<HTMLElement>) => void;
|
|
23
23
|
onPointerLeave?: (e: React.PointerEvent<HTMLElement>) => void;
|
|
24
24
|
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
25
|
+
portal?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {
|
|
27
28
|
position: IAbsolutePosition;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPopup } from '../../../services/popup/canvas-popup.service';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
interface ISingleDOMPopupProps {
|
|
4
|
+
popup: IPopup;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Align position is diff from SingleCanvasPopup
|
|
9
|
+
*/
|
|
10
|
+
declare const SingleDOMPopup: ({ popup, children }: ISingleDOMPopupProps) => React.JSX.Element | null;
|
|
11
|
+
export type { ISingleDOMPopupProps };
|
|
12
|
+
export { SingleDOMPopup };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPopup } from '../../../services/popup/canvas-popup.service';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
interface ISingleCanvasPopupProps {
|
|
4
|
+
popup: IPopup;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const SingleCanvasPopup: ({ popup, children }: ISingleCanvasPopupProps) => React.JSX.Element | null;
|
|
8
|
+
export type { ISingleCanvasPopupProps };
|
|
9
|
+
export { SingleCanvasPopup };
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(r,n){typeof exports=="object"&&typeof module<"u"?n(require("@univerjs/core"),require("@univerjs/ui")):typeof define=="function"&&define.amd?define(["@univerjs/core","@univerjs/ui"],n):(r=typeof globalThis<"u"?globalThis:r||self,n(r.UniverCore,r.UniverUi))})(this,function(r,n){"use strict";var M=Object.defineProperty;var y=(r,n,m)=>n in r?M(r,n,{enumerable:!0,configurable:!0,writable:!0,value:m}):r[n]=m;var a=(r,n,m)=>y(r,typeof n!="symbol"?n+"":n,m);var u;var m=Object.defineProperty,l=Object.getOwnPropertyDescriptor,v=(o,e,t,i)=>{for(var s=i>1?void 0:i?l(e,t):e,c=o.length-1,d;c>=0;c--)(d=o[c])&&(s=(i?d(e,t,s):d(s))||s);return i&&s&&m(e,t,s),s},h=(o,e)=>(t,i)=>e(t,i,o);let p=(u=class extends r.FBase{constructor(e,t,i,s){super();a(this,"_commandToRegister",new Map);a(this,"_buildingSchema");this._item=e,this._injector=t,this._commandService=i,this._menuManagerService=s;const c=typeof e.action=="string"?e.action:r.Tools.generateRandomId(12);c!==e.action&&this._commandToRegister.set(c,e.action),this._buildingSchema={menuItemFactory:()=>({id:e.id,type:n.MenuItemType.BUTTON,icon:e.icon,title:e.title,tooltip:e.tooltip,commandId:c})},typeof e.order<"u"&&(this._buildingSchema.order=e.order)}__getSchema(){return this._commandToRegister.forEach((e,t)=>{this._commandService.hasCommand(t)||this._commandService.registerCommand({id:t,type:r.CommandType.COMMAND,handler:e})}),{[this._item.id]:this._buildingSchema}}appendTo(e){const t=this.__getSchema();this._menuManagerService.mergeMenu({[e]:t})}},a(u,"RibbonStartGroup",n.RibbonStartGroup),a(u,"RibbonPosition",n.RibbonPosition),a(u,"MenuManagerPosition",n.MenuManagerPosition),u);p=v([h(1,r.Inject(r.Injector)),h(2,r.ICommandService),h(3,n.IMenuManagerService)],p);let S=class extends r.FBase{constructor(e,t,i){super();a(this,"_menuByGroups",[]);a(this,"_submenus",[]);a(this,"_buildingSchema");this._item=e,this._injector=t,this._menuManagerService=i,this._buildingSchema={menuItemFactory:()=>({id:e.id,type:n.MenuItemType.SUBITEMS,icon:e.icon,title:e.title,tooltip:e.tooltip})},typeof e.order<"u"&&(this._buildingSchema.order=e.order)}addSubmenu(e){return this._submenus.push(e),this}addSeparator(){return this._menuByGroups.push(this._submenus),this._submenus=[],this}appendTo(e){const t=this.__getSchema();this._menuManagerService.mergeMenu({[e]:t})}__getSchema(){const e={};return this.addSeparator(),this._menuByGroups.forEach((t,i)=>{const s={};t.forEach(c=>{Object.assign(s,c.__getSchema())}),e[`${this._item.id}-group-${i}`]=s}),{[this._item.id]:Object.assign(this._buildingSchema,e)}}};S=v([h(1,r.Inject(r.Injector)),h(2,n.IMenuManagerService)],S);var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,I=(o,e,t,i)=>{for(var s=i>1?void 0:i?b(e,t):e,c=o.length-1,d;c>=0;c--)(d=o[c])&&(s=(i?d(e,t,s):d(s))||s);return i&&s&&f(e,t,s),s},g=(o,e)=>(t,i)=>e(t,i,o);let _=class extends r.FBase{constructor(e,t){super();a(this,"_forceEscapeDisposable",null);this._injector=e,this._shortcutService=t}enableShortcut(){var e;(e=this._forceEscapeDisposable)==null||e.dispose(),this._forceEscapeDisposable=null}disableShortcut(){this._forceEscapeDisposable||(this._forceEscapeDisposable=this._shortcutService.forceEscape())}dispatchShortcutEvent(e){return this._shortcutService.dispatch(e)}};_=I([g(0,r.Inject(r.Injector)),g(1,n.IShortcutService)],_);class j extends r.FUniver{getURL(){return new URL(window.location.href)}getShortcut(){return this._injector.createInstance(_)}copy(){return this._commandService.syncExecuteCommand(n.CopyCommand.id)}paste(){return this._commandService.syncExecuteCommand(n.PasteCommand.id)}createMenu(e){return this._injector.createInstance(p,e)}createSubmenu(e){return this._injector.createInstance(S,e)}openSiderbar(e){return this._injector.get(n.ISidebarService).open(e)}openSidebar(e){return this.openSiderbar(e)}openDialog(e){const i=this._injector.get(n.IDialogService).open({...e,onClose:()=>{i.dispose()}});return i}getComponentManager(){return this._injector.get(n.ComponentManager)}showMessage(e){return this._injector.get(n.IMessageService).show(e),this}setUIVisible(e,t){return this._injector.get(n.IUIPartsService).setUIVisible(e,t),this}isUIVisible(e){return this._injector.get(n.IUIPartsService).isUIVisible(e)}registerUIPart(e,t){return this._injector.get(n.IUIPartsService).registerComponent(e,()=>r.connectInjector(t,this._injector))}registerComponent(e,t,i){const s=this._injector.get(n.ComponentManager);return this.disposeWithMe(s.register(e,t,i))}}r.FUniver.extend(j);class C extends r.FHooks{onBeforeCopy(e){return this._injector.get(r.ICommandService).beforeCommandExecuted(i=>{i.id===n.CopyCommand.id&&e()})}onCopy(e){return this._injector.get(r.ICommandService).onCommandExecuted(i=>{i.id===n.CopyCommand.id&&e()})}onBeforePaste(e){return this._injector.get(r.ICommandService).beforeCommandExecuted(i=>{i.id===n.PasteCommand.id&&e()})}onPaste(e){return this._injector.get(r.ICommandService).onCommandExecuted(i=>{(i.id===n.PasteCommand.id||i.id===n.SheetPasteShortKeyCommandName)&&e()})}}r.FHooks.extend(C);class P extends r.FEnum{get BuiltInUIPart(){return n.BuiltInUIPart}}r.FEnum.extend(P)});
|