@univerjs/preset-docs-core 0.8.0-nightly.202505281606 → 0.8.0-nightly.202505301607
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/umd/index.js +1 -1
- package/package.json +10 -10
package/lib/umd/index.js
CHANGED
|
@@ -9,7 +9,7 @@ hover:univer-bg-gray-100
|
|
|
9
9
|
`;function C6(e){const{children:t,className:n,style:r,disabled:i=!1,active:l=!1,noIcon:o,onClick:c,onDoubleClick:C,...m}=e,p=w=>{if(i){w.preventDefault();return}c&&c(w)},d=w=>{if(i){w.preventDefault();return}C&&C(w)};return v.jsx("button",{type:"button",className:Z.clsx(h6,{"univer-px-2":o,"!univer-bg-gray-200 dark:!univer-bg-gray-500":l}),style:r,disabled:i,onClick:p,onDoubleClick:d,...m,children:t})}function v6(e){const{disabled$:t,hidden$:n,activated$:r,value$:i}=e,[l,o]=a.useState(),[c,C]=a.useState(!1),[m,p]=a.useState(!1),[d,w]=a.useState(!1);return a.useEffect(()=>{const y=[];return t&&y.push(t.subscribe(S=>C(S))),n&&y.push(n.subscribe(S=>w(S))),r&&y.push(r.subscribe(S=>p(S))),i&&y.push(i.subscribe(S=>o(S))),()=>y.forEach(S=>S.unsubscribe())},[r,t,n,i]),{disabled:c,value:l,activated:m,hidden:d}}const je=a.createContext({dropdownVisible:!1,setDropdownVisible:e=>{}}),u0=a.forwardRef((e,t)=>{const{children:n,...r}=e,i=a.useRef(null),[l,o]=a.useState(!1),[c,C]=a.useState(!1);function m(w){o(c?!1:w)}function p(w){C(w),o(!1)}const d=a.useMemo(()=>({dropdownVisible:c,setDropdownVisible:p}),[c]);return a.useImperativeHandle(t,()=>({el:i.current})),v.jsx(Z.Tooltip,{visible:l,onVisibleChange:m,...r,children:v.jsx("span",{ref:i,children:v.jsx(je.Provider,{value:d,children:n})})})});function d0(e){const{children:t,overlay:n,disabled:r,align:i="start"}=e,{dropdownVisible:l,setDropdownVisible:o}=a.useContext(je);function c(C){o(C)}return v.jsx(Z.Dropdown,{align:i,overlay:v.jsx("div",{className:"univer-grid univer-gap-2",children:n}),disabled:r,open:l,onOpenChange:c,children:v.jsx("div",{className:"univer-h-full",onClick:C=>C.stopPropagation(),children:t})})}function ve({icon:e,value:t,option:n,onOptionSelect:r}){var o;const i=c=>{r==null||r({value:c,label:n==null?void 0:n.label,commandId:n==null?void 0:n.commandId})},l=typeof n.label=="string"||typeof n.label=="object"&&((o=n.label)==null?void 0:o.selectable)!==!1;return v.jsxs("div",{className:Z.clsx("univer-relative univer-flex univer-items-center univer-gap-2",{"univer-pl-6":l}),children:[l&&String(t)===String(n.value)&&v.jsx(Ee,{className:"univer-absolute univer-left-1 univer-top-0.5 univer-text-primary-600"}),v.jsx(f1,{className:"univer-text-sm",icon:e,value$:n.value$,value:n.value,label:n.label,onChange:i})]})}function g6({menuId:e,slot:t,value:n,options:r,children:i,disabled:l,onOptionSelect:o}){var T;const{dropdownVisible:c,setDropdownVisible:C}=a.useContext(je),m=x.useDependency(M1),[p,d]=a.useState({}),w=a.useMemo(()=>e?m.getMenuByPositionKey(e):[],[e]),y=a.useMemo(()=>w.filter(O=>{var N;if(!O.children)return O;const E=((N=O.key)==null?void 0:N.toString())||"";return!p[E]}),[w,p]);function S(O){C(O)}if(a.useEffect(()=>{const O=w.map(E=>{if(!E.children)return null;const N=E.children.map(V=>{var U,M;return(M=(U=V.item)==null?void 0:U.hidden$)!=null?M:z.of(!1)});return z.combineLatest(N).subscribe(V=>{const U=V.every(M=>M===!0);d(M=>({...M,[E.key]:U}))})});return()=>{O.forEach(E=>E==null?void 0:E.unsubscribe()),d({})}},[w]),t)return v.jsx(d0,{disabled:l,overlay:r.map((O,E)=>v.jsx(ve,{value:n,option:O,onOptionSelect:o},E)),children:i});if(r!=null&&r.length){const O=r.map(E=>{var N;return{type:"item",className:Z.clsx({"focus:univer-bg-white":typeof E.label!="string"&&((N=E.label)==null?void 0:N.hoverable)===!1}),children:v.jsx(ve,{icon:E.icon,value:n,option:E,onOptionSelect:o}),disabled:E.disabled,onSelect:()=>{typeof E.value>"u"||o==null||o({...E})}}});for(const E of y){if(!E.item)continue;const{title:N,id:V,commandId:U,icon:M}=E.item;if(!N)throw new Error("Menu item title is required");O.push({type:"item",children:v.jsx(ve,{icon:M,value:n,option:{label:{name:N,selectable:!1}}}),onSelect:()=>{o==null||o({commandId:U,id:V})}})}return v.jsx(Z.DropdownMenu,{align:"start",items:O,disabled:l,open:c,onOpenChange:S,children:i})}else{const O=[];for(const E of y)if(E.item){const{title:N,id:V,commandId:U,icon:M}=E.item;if(!N)throw new Error("Menu item title is required");O.push({type:"item",children:v.jsx(ve,{icon:M,value:n,option:{label:{name:N,selectable:!1}}}),onSelect:()=>{o==null||o({commandId:U,id:V})}})}else(T=E.children)!=null&&T.length;return v.jsx(Z.DropdownMenu,{align:"start",items:O,disabled:l,open:c,onOpenChange:S,children:i})}}const ee=a.forwardRef((e,t)=>{const n=x.useDependency(h.LocaleService),r=x.useDependency(h.ICommandService),i=x.useDependency(S1),l=x.useDependency(v1),{value:o,hidden:c,disabled:C,activated:m}=v6(e),p=(J,X)=>{i.focus(),r.executeCommand(J,X)},{tooltip:d,shortcut:w,icon:y,title:S,label:T,id:O,commandId:E,type:N,slot:V,params:U}=e,M=n.t(d!=null?d:"")+(w?` (${w})`:""),{selections:$}=e,D=a.useMemo(()=>z.isObservable($)?$:new z.Observable(J=>{J.next($)}),[$]),B=x.useObservable(D),G=a.useMemo(()=>z.isObservable(y)?y:new z.Observable(J=>{var n1,l1;const X=(l1=(n1=B==null?void 0:B.find(u1=>u1.value===o))==null?void 0:n1.icon)!=null?l1:y;J.next(X)}),[y,B,o]),Y=x.useObservable(G,void 0,!0);function q(J){var K;const X=e.selectionsCommandId,n1=E!=null?E:O,l1=(K=X!=null?X:E)!=null?K:O;function u1(d1){if(C)return;let L1=l1;d1.id&&(L1=d1.id),p(L1,{value:d1.value})}function b1(d1){C||p(l1,{value:d1})}function a1(){C||J===g1.BUTTON_SELECTOR&&p(n1,{value:o})}return J===g1.BUTTON_SELECTOR?v.jsxs("div",{"data-u-command":O,"data-disabled":C,className:Z.clsx("univer-group univer-relative univer-flex univer-h-6 univer-cursor-pointer univer-items-center univer-rounded univer-pr-5 univer-text-sm univer-transition-colors univer-animate-in univer-fade-in dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",{"univer-text-gray-900 dark:!univer-text-white":!C,"univer-pointer-events-none univer-cursor-not-allowed univer-text-gray-300 dark:!univer-text-gray-600":C}),children:[v.jsx("div",{className:Z.clsx("univer-relative univer-z-[1] univer-flex univer-h-full univer-items-center univer-rounded-l univer-px-1 univer-transition-colors dark:hover:!univer-bg-gray-600 hover:univer-bg-gray-200",{"univer-bg-gray-200 dark:!univer-bg-gray-500":m,"univer-bg-gray-100":m&&C}),onClick:a1,children:v.jsx(f1,{icon:Y,title:S,value:o,label:T,onChange:b1})}),v.jsx(g6,{menuId:O,slot:V,value:o,options:B,disabled:C,onOptionSelect:u1,children:v.jsx("div",{className:Z.clsx("univer-absolute univer-right-0 univer-top-0 univer-box-border univer-flex univer-h-6 univer-w-5 univer-items-center univer-justify-center univer-rounded-r univer-transition-colors dark:hover:!univer-bg-gray-600 hover:univer-bg-gray-200",{"univer-pointer-events-none univer-cursor-not-allowed univer-text-gray-300 dark:!univer-text-gray-600":C,"univer-bg-gray-200 dark:!univer-bg-gray-500":m,"univer-bg-gray-100":m&&C}),"data-disabled":C,children:v.jsx(j1,{})})})]}):v.jsx(g6,{menuId:O,slot:V,value:o,options:B,disabled:C,onOptionSelect:u1,children:v.jsxs("div",{"data-u-command":O,className:Z.clsx("univer-relative univer-flex univer-h-6 univer-cursor-pointer univer-items-center univer-gap-2 univer-whitespace-nowrap univer-rounded univer-px-1 univer-transition-colors univer-animate-in univer-fade-in dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",{"univer-text-gray-900 dark:!univer-text-white":!C,"univer-pointer-events-none univer-cursor-not-allowed univer-text-gray-300 dark:!univer-text-gray-600":C,"univer-bg-gray-200":m,"univer-bg-gray-100":m&&C}),children:[v.jsx(f1,{icon:Y,title:S,value:o,label:T,onChange:b1}),v.jsx("div",{className:Z.clsx("univer-flex univer-h-full univer-items-center",{"univer-pointer-events-none univer-cursor-not-allowed univer-text-gray-300 dark:!univer-text-gray-600":C}),children:v.jsx(j1,{})})]})})}function W(){var X;const J=l.get(typeof T=="string"?T:(X=T==null?void 0:T.name)!=null?X:"");return v.jsx(C6,{"data-u-command":O,className:"univer-text-sm",noIcon:!y,active:m,disabled:C,onClick:()=>{var n1;return p((n1=e.commandId)!=null?n1:e.id,o!=null?o:U)},onDoubleClick:()=>e.subId&&p(e.subId),children:J?v.jsx(f1,{title:S,value:o,label:T}):y?v.jsx(f1,{icon:y}):v.jsx(f1,{title:S})})}function e1(){switch(N){case g1.BUTTON_SELECTOR:case g1.SELECTOR:case g1.SUBITEMS:return q(N);case g1.BUTTON:default:return W()}}return!c&&(M?v.jsx(u0,{ref:t,title:M,placement:"bottom",children:e1()}):e1())}),f0={[h1.START]:mt,[h1.INSERT]:It,[h1.FORMULAS]:Oe,[h1.DATA]:W3,[h1.VIEW]:ot,[h1.OTHERS]:Ve};function m6(e){const{ribbonType:t,headerMenuComponents:n,headerMenu:r=!0}=e,i=x.useDependency(M1),l=x.useDependency(h.LocaleService),[o,c]=a.useState(0);a.useEffect(()=>{const D=i.menuChanged$.subscribe(()=>{c(B=>B+1)});return()=>{D.unsubscribe()}},[]);const C=a.useRef(null),m=a.useRef({}),[p,d]=a.useState([]),[w,y]=a.useState(h1.START),[S,T]=a.useState(!1),[O,E]=a.useState([]),[N,V]=a.useState(!1),U=a.useCallback(D=>{m.current={},y(D.key),T(!1)},[]);a.useEffect(()=>{var Y;const D=i.getMenuByPositionKey(W1.RIBBON),B=[],G=[];for(const q of D)if(q.children){for(const W of q.children)if(W.children)for(const e1 of W.children)(Y=e1.item)!=null&&Y.hidden$&&(B.push(e1.item.hidden$),G.push(`${q.key}/${W.key}/${e1.key}`))}z.combineLatest(B).subscribe(q=>{var J,X,n1,l1,u1,b1;const W=[],e1=q.map((a1,K)=>a1?G[K]:null).filter(a1=>!!a1);for(const a1 of D){const K={...a1,children:[]};if((J=a1.children)!=null&&J.length)for(const d1 of a1.children){const L1={...d1,children:[]};let T1=!0;if((X=d1.children)!=null&&X.length){for(const P1 of d1.children){const U1=`${a1.key}/${d1.key}/${P1.key}`;e1.includes(U1)||(n1=L1.children)==null||n1.push(P1)}(l1=L1.children)!=null&&l1.every(P1=>{var U1;return((U1=P1.children)==null?void 0:U1.length)===0})&&(T1=!1)}T1&&((u1=K.children)==null||u1.push(L1))}(b1=K.children)!=null&&b1.length&&K.children.every(d1=>{var L1;return(L1=d1.children)==null?void 0:L1.length})&&W.push(K)}if(t==="simple"){const a1=[{key:h1.START,children:[],order:0}];W.forEach(K=>{var d1;(d1=K.children)==null||d1.forEach(L1=>{var T1;(T1=a1[0].children)==null||T1.push(L1)})}),d(a1)}else d(W)}).unsubscribe()},[o]);const M=a.useMemo(()=>{var Y,q;const D=(q=(Y=p.find(W=>W.key===w))==null?void 0:Y.children)!=null?q:[],B=[],G=[];for(const W of D)if(W.children){const e1=W.children.filter(J=>!O.includes(J.key));e1.length>0&&B.push({...W,children:e1}),e1.length<W.children.length&&G.push({...W,children:W.children.filter(J=>O.includes(J.key))})}return{allGroups:D,visibleGroups:B,hiddenGroups:G}},[O,p,w]);a.useEffect(()=>{let D=null;const B=new ResizeObserver(h.throttle(G=>{for(const Y of G)V(!0),D=requestAnimationFrame(()=>{var u1,b1;const{width:q}=Y.contentRect,e1=Object.values(m.current).sort((a1,K)=>a1.order-K.order||a1.groupOrder-K.groupOrder||a1.itemOrder-K.itemOrder),J=[];let X=32;const l1=(((b1=(u1=p.find(a1=>a1.key===w))==null?void 0:u1.children)!=null?b1:[]).length-1)*8;X+=l1;for(const{width:a1,key:K}of e1)X+=a1+8,X>q&&J.push(K);E(J),V(!1)})},100));return B.observe(C.current),()=>{D&&cancelAnimationFrame(D),B.disconnect()}},[p,w]);const $=a.useMemo(()=>v.jsx("div",{"aria-hidden":"true",className:Z.clsx("univer-invisible univer-absolute -univer-left-[99999] -univer-top-[99999] univer-box-border univer-flex univer-h-10 univer-min-w-min univer-items-center univer-px-3 univer-opacity-0",{"univer-hidden":!N},Z.borderBottomClassName),children:M.allGroups.map((D,B)=>{var G,Y;return(((G=D.children)==null?void 0:G.length)||D.item)&&v.jsx(a.Fragment,{children:v.jsx("div",{className:"univer-grid univer-grid-flow-col univer-gap-2 univer-px-2",children:D.children&&((Y=D.children)==null?void 0:Y.map(q=>q.item&&v.jsx(ee,{...q.item,ref:W=>{W!=null&&W.el&&(m.current[q.key]={width:W.el.getBoundingClientRect().width,key:q.key,order:B,groupOrder:D.order,itemOrder:q.order})}},q.key)))})},D.key)})}),[M.allGroups,N]);return v.jsxs(v.Fragment,{children:[r&&n&&n.size>0&&v.jsx("header",{className:Z.clsx("univer-relative univer-h-11 univer-select-none",Z.borderBottomClassName),children:v.jsx("div",{className:"univer-absolute univer-right-2 univer-top-0 univer-flex univer-h-full univer-items-center univer-gap-2 [&>*]:univer-inline-flex [&>*]:univer-h-6 [&>*]:univer-items-center [&>*]:univer-rounded [&>*]:univer-px-1 [&>*]:univer-transition-colors hover:[&>*]:univer-bg-gray-100",children:v.jsx(m1,{components:n})})}),v.jsxs("div",{className:Z.clsx("univer-box-border univer-grid univer-h-10 univer-grid-flow-col univer-items-center univer-px-3",{"univer-grid-cols-[auto,1fr]":p.length>1,"univer-grid-cols-none":p.length===1},Z.borderBottomClassName),children:[p.length>1&&v.jsx(Z.HoverCard,{className:"univer-max-w-96 !univer-rounded-xl",align:"start",open:S,overlay:v.jsx("div",{className:"univer-grid univer-gap-1 univer-px-2 univer-py-1",children:p.map(D=>{const B=f0[D.key];return v.jsxs("a",{"data-u-comp":"ribbon-group-btn",className:"univer-box-border univer-flex univer-cursor-pointer univer-items-center univer-gap-2.5 univer-rounded-lg univer-px-2 univer-py-1.5 dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",onClick:()=>U(D),children:[v.jsx("span",{className:Z.clsx("univer-box-border univer-flex univer-size-9 univer-flex-shrink-0 univer-items-center univer-justify-center univer-rounded-lg",Z.borderClassName),children:v.jsx(B,{className:"univer-text-gray-500 dark:!univer-text-gray-300"})}),v.jsxs("span",{className:"univer-flex univer-flex-col",children:[v.jsx("strong",{className:"univer-text-sm univer-font-semibold univer-text-gray-800 dark:!univer-text-gray-200",children:l.t(D.key)}),v.jsx("span",{className:"univer-text-xs univer-text-gray-400",children:l.t(`${D.key}Desc`)})]})]},D.key)})}),onOpenChange:T,children:v.jsxs("a",{className:"univer-mr-2 univer-flex univer-h-7 univer-cursor-pointer univer-items-center univer-gap-1.5 univer-whitespace-nowrap !univer-rounded-full univer-bg-gray-700 univer-pl-3 univer-pr-2 univer-text-sm univer-text-white dark:!univer-bg-gray-200 dark:!univer-text-gray-800",onClick:()=>T(!0),children:[l.t(w),v.jsx(j1,{className:"univer-text-gray-200 dark:!univer-text-gray-500"})]})}),v.jsxs("div",{"data-u-comp":"ribbon-toolbar",ref:C,className:Z.clsx("univer-flex univer-overflow-hidden",Z.divideXClassName),children:[M.visibleGroups.map(D=>{var B,G;return(((B=D.children)==null?void 0:B.length)||D.item)&&v.jsx(a.Fragment,{children:v.jsx("div",{className:"univer-grid univer-grid-flow-col univer-gap-2 univer-px-2",children:D.children&&((G=D.children)==null?void 0:G.map(Y=>Y.item&&v.jsx(ee,{...Y.item},Y.key)))})},D.key)}),O.length>0&&v.jsx("div",{"data-u-comp":"ribbon-toolbar-more",className:"univer-pl-2 rtl:univer-pr-2",children:v.jsx(Z.Dropdown,{collisionPadding:{right:12,left:12},overlay:v.jsx("div",{className:"univer-box-border univer-grid univer-max-w-[var(--radix-popper-available-width)] univer-gap-2 univer-p-2",children:M.hiddenGroups.map(D=>{var B;return v.jsx("div",{className:"univer-flex univer-items-center univer-gap-2",children:v.jsx("div",{className:"univer-flex univer-flex-wrap univer-gap-2",children:D.children?(B=D.children)==null?void 0:B.map(G=>G.item&&v.jsx(ee,{...G.item},G.key)):D.item&&v.jsx(ee,{...D.item},D.key)})},D.key)})}),children:v.jsx("a",{className:h6,type:"button",children:v.jsx(Ve,{})})})})]})]}),$]})}class ze extends h.Disposable{constructor(){super(...arguments);j(this,"_styleSheetId","univer-theme-css-variables")}injectThemeToHead(n){function r(c,C="--univer"){const m=[];function p(d,w=""){for(const y in d){const S=d[y],T=w?`${w}-${y}`:y;typeof S=="object"&&S!==null?p(S,T):m.push(`${C}-${T}: ${S};`)}}return p(c),m.join(`
|
|
10
10
|
`)}const i=r(n),l=document.getElementById(this._styleSheetId);l&&l.remove();const o=document.createElement("style");o.setAttribute("id",this._styleSheetId),o.innerHTML=`:root {
|
|
11
11
|
${i}
|
|
12
|
-
}`,document.head.appendChild(o)}dispose(){super.dispose();const n=document.getElementById(this._styleSheetId);n&&document.head.removeChild(n)}}const te=h.createIdentifier("ui.contextmenu.service");class Ge extends h.Disposable{constructor(){super(...arguments);j(this,"_currentHandler",null);j(this,"disabled",!1)}get visible(){var n,r;return(r=(n=this._currentHandler)==null?void 0:n.visible)!=null?r:!1}disable(){this.disabled=!0}enable(){this.disabled=!1}triggerContextMenu(n,r){var i;n.stopPropagation(),!this.disabled&&((i=this._currentHandler)==null||i.handleContextMenu(n,r))}hideContextMenu(){var n;(n=this._currentHandler)==null||n.hideContextMenu()}registerContextMenuHandler(n){if(this._currentHandler)throw new Error("There is already a context menu handler!");return this._currentHandler=n,h.toDisposable(()=>this._currentHandler=null)}}function p6(){const e=a.useRef(null),[t,n]=a.useState(!1),[r,i]=a.useState(""),[l,o]=a.useState([0,0]),c=a.useRef(t),C=x.useDependency(te),m=x.useDependency(h.ICommandService),p=x.useInjector();c.current=t,a.useEffect(()=>{const y=C.registerContextMenuHandler({handleContextMenu:d,hideContextMenu(){n(!1)},get visible(){return c.current}});function S(T){e.current&&!e.current.contains(T.target)&&w()}return document.addEventListener("pointerdown",S),document.addEventListener("wheel",w),()=>{document.removeEventListener("pointerdown",S),document.removeEventListener("wheel",w),y.dispose()}},[C]);function d(y,S){n(!1),requestAnimationFrame(()=>{i(S),o([y.clientX,y.clientY]),n(!0)})}function w(){n(!1)}return v.jsx(Z.Popup,{visible:t,offset:l,children:v.jsx("section",{ref:e,children:r&&v.jsx(xe,{menuType:r,onOptionSelect:y=>{const{label:S,commandId:T,value:O}=y;m&&m.executeCommand(T!=null?T:S,{value:O}),p.get(S1).focus(),n(!1)}})})})}const ge=h.createIdentifier("univer.global-zone-service");function We(){const e=x.useDependency(ge),[t,n]=a.useState(!1),r=x.useObservable(e.componentKey$,e.componentKey),i=x.useDependency(v1),l=a.useMemo(()=>{const o=i.get(r!=null?r:"");if(o)return o},[r,i]);return a.useEffect(()=>{const o=e.visible$.subscribe(c=>{n(c)});return()=>{o.unsubscribe()}},[e.visible$]),t?v.jsx("section",{className:Z.clsx("univer-absolute univer-bg-gray-100",{"univer-hidden":!t,"univer-inset-0 univer-z-[100] univer-block univer-size-full":t}),children:l&&v.jsx(l,{})}):null}function Ye(){const e=x.useDependency(k1),t=x.useObservable(e.sidebarOptions$),n=a.useRef(null),r=a.useMemo(()=>{if(!t)return null;const o={...t};for(const c of["children","header","footer"]){const C=c;if(t[C]){const{key:m,...p}=t[C];p&&(o[C]=v.jsx(f1,{...p},m))}}return o},[t]);a.useEffect(()=>(n.current&&e.setContainer(n.current),()=>{e.setContainer(void 0)}),[e]),a.useEffect(()=>{const o=C=>{e.scrollEvent$.next(C)},c=n.current;return c&&c.addEventListener("scroll",o),()=>{c==null||c.removeEventListener("scroll",o)}},[e]);const i=a.useMemo(()=>r!=null&&r.visible?typeof r.width=="number"?`${r.width}px`:r.width:0,[r]);function l(){var c;const o={...t,visible:!1};e.options.visible=!1,e.sidebarOptions$.next(o),(c=o==null?void 0:o.onClose)==null||c.call(o)}return v.jsx("section",{"data-u-comp":"sidebar",className:Z.clsx("univer-relative univer-h-full univer-bg-white univer-text-gray-900 dark:!univer-bg-gray-900 dark:!univer-text-white",{"univer-w-96 univer-translate-x-0":r==null?void 0:r.visible,"univer-w-0 univer-translate-x-full":!(r!=null&&r.visible)}),style:{width:i},children:v.jsxs("section",{ref:n,className:Z.clsx("univer-box-border univer-grid univer-h-0 univer-min-h-full univer-grid-rows-[auto_1fr_auto] univer-overflow-y-auto",Z.borderLeftBottomClassName,Z.scrollbarClassName),children:[v.jsxs("header",{className:"univer-sticky univer-top-0 univer-z-10 univer-box-border univer-flex univer-items-center univer-justify-between univer-bg-white univer-p-4 univer-pb-2 univer-text-base univer-font-medium univer-text-gray-800 dark:!univer-bg-gray-900 dark:!univer-text-white",children:[r==null?void 0:r.header,v.jsx("a",{className:"univer-cursor-pointer univer-text-gray-500 dark:!univer-text-gray-300",onClick:l,children:v.jsx(De,{})})]}),v.jsx("section",{className:"univer-box-border univer-px-4",style:r==null?void 0:r.bodyStyle,children:r==null?void 0:r.children}),(r==null?void 0:r.footer)&&v.jsx("footer",{className:"univer-sticky univer-bottom-0 univer-box-border univer-bg-white univer-p-4 dark:!univer-bg-gray-900",children:r.footer})]})})}const me=h.createIdentifier("univer.zen-zone-service");function Xe(){const e=x.useDependency(me),[t,n]=a.useState(!1),[r,i]=a.useState(),l=x.useObservable(e.temporaryHidden$),o=x.useDependency(v1);a.useEffect(()=>{const C=[e.visible$.subscribe(m=>{n(m)}),e.componentKey$.subscribe(m=>{i(m)})];return()=>{C.forEach(m=>{m.unsubscribe()})}},[]);const c=a.useMemo(()=>{const C=o.get(r!=null?r:"");if(C)return C},[r]);return v.jsx("section",{className:Z.clsx("univer-absolute univer-z-[-1] univer-flex",{"univer-inset-0 univer-z-[100] univer-bg-gray-100 univer-animate-in univer-fade-in":t,"univer-hidden":l}),children:v.jsx("div",{className:"univer-relative univer-flex-1",children:c&&v.jsx(c,{})})})}function h0(e){const t=N9(G1);return v.jsx(C0,{...e,...t})}function C0(e){var e1;const{header:t=!0,toolbar:n=!0,footer:r=!0,headerMenu:i=!0,contextMenu:l=!0,ribbonType:o="default",mountContainer:c,onRendered:C}=e,m=x.useDependency(h.LocaleService),p=x.useDependency(h.ThemeService),d=x.useDependency(ze),w=a.useRef(null),S=x.useDependency(h.IConfigService).getConfig(G1),T=p1(o1.CUSTOM_HEADER),O=p1(o1.FOOTER),E=p1(o1.HEADER),N=p1(o1.HEADER_MENU),V=p1(o1.CONTENT),U=p1(o1.LEFT_SIDEBAR),M=p1(o1.GLOBAL),$=p1(o1.TOOLBAR),D=(e1=S==null?void 0:S.popupRootId)!=null?e1:"univer-popup-portal";a.useLayoutEffect(()=>{const J=p.currentTheme$.subscribe(X=>{d.injectThemeToHead(X)});return()=>{J.unsubscribe()}},[]);const[B,G]=a.useState(!1);a.useLayoutEffect(()=>{const J=p.darkMode$.subscribe(X=>{G(X),X?document.documentElement.classList.add("univer-dark"):document.documentElement.classList.remove("univer-dark")});return()=>{J.unsubscribe()}},[]),a.useEffect(()=>{w.current&&(C==null||C(w.current))},[C]);const[Y,q]=a.useState(m.getLocales()),W=a.useMemo(()=>document.createElement("div"),[]);return a.useEffect(()=>{document.body.appendChild(W);const J=[m.localeChanged$.subscribe(()=>{q(m.getLocales())})];return()=>{J.forEach(X=>X.unsubscribe()),document.body.removeChild(W)}},[m,c,W,p.currentTheme$]),v.jsxs(Z.ConfigProvider,{locale:Y==null?void 0:Y.design,mountContainer:W,children:[v.jsxs("div",{"data-u-comp":"workbench-layout",className:Z.clsx("univer-flex univer-h-full univer-min-h-0 univer-flex-col univer-bg-white dark:!univer-bg-gray-800",{"univer-dark":B}),tabIndex:-1,onBlur:J=>J.stopPropagation(),onContextMenu:J=>J.preventDefault(),children:[v.jsx("div",{className:"univer-relative univer-flex univer-min-h-0 univer-flex-col univer-bg-white",children:v.jsx(m1,{components:T},"custom-header")}),t&&n&&v.jsx("header",{"data-u-comp":"headerbar",className:"univer-relative univer-z-10 univer-w-full",children:v.jsx(m1,{components:$,sharedProps:{ribbonType:o,headerMenuComponents:N,headerMenu:i}},"toolbar")}),v.jsxs("section",{className:"univer-relative univer-flex univer-min-h-0 univer-flex-1 univer-flex-col",children:[v.jsxs("div",{className:"univer-grid univer-h-full univer-grid-cols-[auto_1fr_auto] univer-grid-rows-[100%] univer-overflow-hidden",children:[v.jsx("aside",{"data-u-comp":"left-sidebar",className:"univer-h-full",children:v.jsx(m1,{components:U},"left-sidebar")}),v.jsxs("section",{className:Z.clsx("univer-relative univer-grid univer-flex-1 univer-grid-rows-[auto_1fr] univer-overflow-hidden univer-bg-white",Z.borderBottomClassName),children:[v.jsx("header",{children:t&&v.jsx(m1,{components:E},"header")}),v.jsx("section",{className:"univer-relative univer-overflow-hidden dark:!univer-bg-gray-900",ref:w,"data-range-selector":!0,onContextMenu:J=>J.preventDefault(),children:v.jsx(m1,{components:V},"content")})]}),v.jsx("aside",{"data-u-comp":"right-sidebar",className:"univer-h-full",children:v.jsx(Ye,{})})]}),r&&v.jsx("footer",{children:v.jsx(m1,{components:O,sharedProps:{contextMenu:l}},"footer")}),v.jsx(Xe,{})]})]}),v.jsx(m1,{components:M},"global"),v.jsx(We,{}),l&&v.jsx(p6,{}),v.jsx(v0,{}),v.jsx("div",{id:D})]})}function v0(){const{mountContainer:e}=a.useContext(Z.ConfigContext),t=p1(o1.FLOATING);return L3.createPortal(v.jsx(m1,{components:t},"floating"),e)}const g0=3e3;class qe extends h.Disposable{constructor(n,r,i,l,o){super();j(this,"_steadyTimeout");j(this,"_renderTimeout");j(this,"_currentRenderId",null);this._injector=n,this._instanceService=r,this._layoutService=i,this._lifecycleService=l,this._renderManagerService=o}dispose(){super.dispose(),clearTimeout(this._steadyTimeout),clearTimeout(this._renderTimeout)}_bootstrapWorkbench(){this.disposeWithMe(this.bootstrap(async(n,r)=>{this._layoutService&&(this.disposeWithMe(this._layoutService.registerRootContainerElement(r)),this.disposeWithMe(this._layoutService.registerContentElement(n))),await this._lifecycleService.onStage(h.LifecycleStages.Ready),this._renderTimeout=window.setTimeout(()=>{const i=this._renderManagerService.getRenderAll();for(const[l,o]of i)if(this._changeRenderUnit(l,n))break;this.disposeWithMe(this._instanceService.focused$.subscribe(l=>{l&&this._changeRenderUnit(l,n)})),this.disposeWithMe(this._renderManagerService.created$.subscribe(l=>{var o;l.unitId===((o=this._instanceService.getFocusedUnit())==null?void 0:o.getUnitId())&&this._changeRenderUnit(l.unitId,n)})),this.disposeWithMe(this._renderManagerService.disposed$.subscribe(l=>{this._currentRenderId===l&&(this._currentRenderId=null)})),this._lifecycleService.stage=h.LifecycleStages.Rendered,this._steadyTimeout=window.setTimeout(()=>{this._lifecycleService.stage=h.LifecycleStages.Steady},g0)},300)}))}_changeRenderUnit(n,r){if(this._currentRenderId===n)return!1;const i=this._renderManagerService.getRenderById(n);if(!i||!i.unitId||h.isInternalEditorID(i.unitId))return!1;const l=this._currentRenderId?this._renderManagerService.getRenderById(this._currentRenderId):null;return l==null||l.deactivate(),l==null||l.engine.unmount(),i.engine.mount(r),i.activate(),this._currentRenderId=n,!0}}var m0=Object.getOwnPropertyDescriptor,p0=(e,t,n,r)=>{for(var i=r>1?void 0:r?m0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},D1=(e,t)=>(n,r)=>t(n,r,e);f.DesktopUIController=class extends qe{constructor(t,n,r,i,l,o,c,C,m){super(n,o,l,r,i),this._config=t,this._componentManager=m,c.mergeMenu(e6),this._initBuiltinComponents(C),this._registerComponents(),this._bootstrapWorkbench()}_registerComponents(){[[E9,H9],[O9,D9],[A9,x9],[$9,Z9],[k9,T9],[R9,Z.ColorPicker]].forEach(([t,n])=>{this.disposeWithMe(this._componentManager.register(t,n))})}bootstrap(t){return b0(this._injector,this._config,t)}_initBuiltinComponents(t){this.disposeWithMe(t.registerComponent(o1.FLOATING,()=>x.connectInjector(Fe,this._injector))),this.disposeWithMe(t.registerComponent(o1.CONTENT,()=>x.connectInjector(Ue,this._injector))),this.disposeWithMe(t.registerComponent(o1.TOOLBAR,()=>x.connectInjector(m6,this._injector)))}},f.DesktopUIController=p0([D1(1,h.Inject(h.Injector)),D1(2,h.Inject(h.LifecycleService)),D1(3,F1.IRenderManagerService),D1(4,S1),D1(5,h.IUniverInstanceService),D1(6,M1),D1(7,_1),D1(8,h.Inject(v1))],f.DesktopUIController);function b0(e,t,n){let r;const i=t.container;if(typeof i=="string"){const C=document.getElementById(i);C?r=C:r=b6(i)}else i instanceof HTMLElement?r=i:r=b6("univer");const l=x.connectInjector(h0,e),o=C=>n(C,r);function c(){Z.render(v.jsx(l,{...t,mountContainer:r,onRendered:o}),r)}return c(),h.toDisposable(()=>{Z.render(v.jsx("div",{}),r),setTimeout(()=>Z.render(v.jsx("div",{}),r),200),setTimeout(()=>Z.unmount(r),500)})}function b6(e){const t=document.createElement("div");return t.id=e,t}function L0(e){const{menuType:t,onOptionSelect:n}=e,r=x.useDependency(M1);if(!t)return null;const i=a.useMemo(()=>{const l=r.getMenuByPositionKey(t);function o(c){return c.reduce((C,m)=>m.children?[...C,...o(m.children)]:[...C,m],[])}return o(l)},[t]);return v.jsx("div",{className:"univer-box-border univer-grid univer-min-w-8 univer-max-w-52 univer-gap-1 univer-rounded univer-bg-gray-900 univer-px-2 univer-py-1",style:{gridTemplateColumns:`repeat(${Math.min(2,i.length)}, 48px)`},children:i.map(l=>l.item&&v.jsx(w0,{menuItem:l.item,onClick:o=>n==null?void 0:n({value:"",label:l.key,...o})},l.key))})}function w0(e){const{menuItem:t,onClick:n}=e,{id:r,type:i,title:l,label:o,icon:c}=t;if(i!==g1.BUTTON)throw new Error(`[MobileMenuItem]: on mobile devices only "BUTTON" type menu items are supported. Please check "${r}".`);const C=x.useObservable(t.disabled$,!1),m=x.useObservable(t.value$);return v.jsx("button",{type:"button",className:Z.clsx("univer-flex univer-w-12 univer-flex-col univer-items-center univer-justify-center univer-border-none univer-bg-transparent univer-text-white [&>span]:univer-mt-0.5 [&>span]:univer-w-full [&>span]:univer-truncate [&>span]:univer-text-sm [&>svg]:univer-size-[18px] [&>svg]:univer-text-lg"),disabled:C,onClick:()=>n({id:r}),children:v.jsx(f1,{value:m,title:l,label:o,icon:c})},r)}function L6(){const[e,t]=a.useState(!1),[n,r]=a.useState(""),[i,l]=a.useState([0,0]),o=a.useRef(e),c=x.useDependency(te),C=x.useDependency(h.ICommandService);o.current=e,a.useEffect(()=>{const d=c.registerContextMenuHandler({handleContextMenu:m,hideContextMenu(){t(!1)},get visible(){return o.current}});return document.addEventListener("pointerdown",p),document.addEventListener("wheel",p),()=>{document.removeEventListener("pointerdown",p),document.removeEventListener("wheel",p),d.dispose()}},[c]);function m(d,w){r(w),l([d.clientX,d.clientY]),t(!0)}function p(){t(!1)}return v.jsx(Z.Popup,{visible:e,offset:i,children:v.jsx("section",{onPointerDown:d=>d.stopPropagation(),children:n&&v.jsx(L0,{menuType:n,onOptionSelect:d=>{const{label:w,value:y,commandId:S}=d;C&&C.executeCommand(S!=null?S:w,{value:y}),t(!1)}})})})}function _0(e){const{header:t=!0,footer:n=!0,contextMenu:r=!0,mountContainer:i,onRendered:l}=e,o=x.useDependency(h.LocaleService),c=x.useDependency(h.ThemeService),C=a.useRef(null),m=p1(o1.FOOTER),p=p1(o1.HEADER),d=p1(o1.CONTENT),w=p1(o1.LEFT_SIDEBAR),y=p1(o1.GLOBAL),[S,T]=a.useState(!1);a.useEffect(()=>{const V=c.darkMode$.subscribe(U=>{T(U)});return()=>{V.unsubscribe()}},[]),a.useEffect(()=>{C.current&&(l==null||l(C.current))},[l]);const[O,E]=a.useState(o.getLocales()),N=a.useMemo(()=>document.createElement("div"),[]);return a.useEffect(()=>{document.body.appendChild(N);const V=[o.localeChanged$.subscribe(()=>{E(o.getLocales())})];return()=>{V.forEach(U=>U.unsubscribe()),document.body.removeChild(N)}},[o,i,N,c.currentTheme$]),v.jsxs(Z.ConfigProvider,{locale:O==null?void 0:O.design,mountContainer:N,children:[v.jsxs("div",{"data-u-comp":"app-layout",className:Z.clsx("univer-relative univer-flex univer-h-full univer-min-h-0 univer-flex-col univer-bg-white dark:!univer-bg-gray-800",{"univer-dark":S}),tabIndex:-1,onBlur:V=>V.stopPropagation(),children:[t&&v.jsx("header",{className:"univer-relative univer-z-10 univer-w-full"}),v.jsxs("section",{className:"univer-relative univer-flex univer-min-h-0 univer-flex-1 univer-flex-col",children:[v.jsxs("div",{className:"univer-grid univer-h-full univer-grid-cols-[auto_1fr_auto] univer-grid-rows-[100%] univer-overflow-hidden",children:[v.jsx("aside",{className:"univer-h-full",children:v.jsx(m1,{components:w},"left-sidebar")}),v.jsxs("section",{className:Z.clsx("univer-relative univer-grid univer-flex-1 univer-grid-rows-[auto_1fr] univer-overflow-hidden univer-bg-white",Z.borderBottomClassName),children:[v.jsx("header",{className:"univer-w-screen",children:t&&v.jsx(m1,{components:p},"header")}),v.jsx("section",{ref:C,className:"univer-relative univer-overflow-hidden","data-range-selector":!0,onContextMenu:V=>V.preventDefault(),children:v.jsx(m1,{components:d},"content")})]}),v.jsx("aside",{className:"univer-h-full",children:v.jsx(Ye,{})})]}),n&&v.jsx("footer",{children:v.jsx(m1,{components:m},"footer")}),v.jsx(We,{}),v.jsx(Xe,{})]})]}),v.jsx(m1,{components:y},"global"),r&&v.jsx(L6,{})]})}var y0=Object.getOwnPropertyDescriptor,M0=(e,t,n,r)=>{for(var i=r>1?void 0:r?y0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},$1=(e,t)=>(n,r)=>t(n,r,e);let Je=class extends qe{constructor(e,t,n,r,i,l,o){super(t,l,i,n,r),this._config=e,this._initBuiltinComponents(o),this._bootstrapWorkbench()}bootstrap(e){return S0(this._injector,this._config,e)}_initBuiltinComponents(e){this.disposeWithMe(e.registerComponent(o1.CONTENT,()=>x.connectInjector(Fe,this._injector))),this.disposeWithMe(e.registerComponent(o1.CONTENT,()=>x.connectInjector(Ue,this._injector)))}};Je=M0([$1(1,h.Inject(h.Injector)),$1(2,h.Inject(h.LifecycleService)),$1(3,F1.IRenderManagerService),$1(4,S1),$1(5,h.IUniverInstanceService),$1(6,_1)],Je);function S0(e,t,n){let r;const i=t.container;if(typeof i=="string"){const C=document.getElementById(i);C?r=C:r=w6(i)}else i instanceof HTMLElement?r=i:r=w6("univer");const l=x.connectInjector(_0,e),o=C=>n(C,r);function c(){Z.render(v.jsx(l,{...t,mountContainer:r,onRendered:o}),r)}return c(),h.toDisposable(()=>{Z.unmount(r)})}function w6(e){const t=document.createElement("div");return t.id=e,t}const ne=h.createIdentifier("ui.notification.service");var I0=Object.getOwnPropertyDescriptor,H0=(e,t,n,r)=>{for(var i=r>1?void 0:r?I0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},E0=(e,t)=>(n,r)=>t(n,r,e);const Qe=h.createIdentifier("univer.ui.before-close-service");f.DesktopBeforeCloseService=class{constructor(t){j(this,"_beforeUnloadCallbacks",[]);j(this,"_onCloseCallbacks",[]);this._notificationService=t,this._init()}registerBeforeClose(t){return this._beforeUnloadCallbacks.push(t),{dispose:()=>{this._beforeUnloadCallbacks=this._beforeUnloadCallbacks.filter(n=>n!==t)}}}registerOnClose(t){return this._onCloseCallbacks.push(t),{dispose:()=>{this._onCloseCallbacks=this._onCloseCallbacks.filter(n=>n!==t)}}}_init(){window.addEventListener("beforeunload",t=>{let n=t;const r=this._beforeUnloadCallbacks.map(i=>i()).filter(i=>!!i).join(`
|
|
12
|
+
}`,document.head.appendChild(o)}dispose(){super.dispose()}}const te=h.createIdentifier("ui.contextmenu.service");class Ge extends h.Disposable{constructor(){super(...arguments);j(this,"_currentHandler",null);j(this,"disabled",!1)}get visible(){var n,r;return(r=(n=this._currentHandler)==null?void 0:n.visible)!=null?r:!1}disable(){this.disabled=!0}enable(){this.disabled=!1}triggerContextMenu(n,r){var i;n.stopPropagation(),!this.disabled&&((i=this._currentHandler)==null||i.handleContextMenu(n,r))}hideContextMenu(){var n;(n=this._currentHandler)==null||n.hideContextMenu()}registerContextMenuHandler(n){if(this._currentHandler)throw new Error("There is already a context menu handler!");return this._currentHandler=n,h.toDisposable(()=>this._currentHandler=null)}}function p6(){const e=a.useRef(null),[t,n]=a.useState(!1),[r,i]=a.useState(""),[l,o]=a.useState([0,0]),c=a.useRef(t),C=x.useDependency(te),m=x.useDependency(h.ICommandService),p=x.useInjector();c.current=t,a.useEffect(()=>{const y=C.registerContextMenuHandler({handleContextMenu:d,hideContextMenu(){n(!1)},get visible(){return c.current}});function S(T){e.current&&!e.current.contains(T.target)&&w()}return document.addEventListener("pointerdown",S),document.addEventListener("wheel",w),()=>{document.removeEventListener("pointerdown",S),document.removeEventListener("wheel",w),y.dispose()}},[C]);function d(y,S){n(!1),requestAnimationFrame(()=>{i(S),o([y.clientX,y.clientY]),n(!0)})}function w(){n(!1)}return v.jsx(Z.Popup,{visible:t,offset:l,children:v.jsx("section",{ref:e,children:r&&v.jsx(xe,{menuType:r,onOptionSelect:y=>{const{label:S,commandId:T,value:O}=y;m&&m.executeCommand(T!=null?T:S,{value:O}),p.get(S1).focus(),n(!1)}})})})}const ge=h.createIdentifier("univer.global-zone-service");function We(){const e=x.useDependency(ge),[t,n]=a.useState(!1),r=x.useObservable(e.componentKey$,e.componentKey),i=x.useDependency(v1),l=a.useMemo(()=>{const o=i.get(r!=null?r:"");if(o)return o},[r,i]);return a.useEffect(()=>{const o=e.visible$.subscribe(c=>{n(c)});return()=>{o.unsubscribe()}},[e.visible$]),t?v.jsx("section",{className:Z.clsx("univer-absolute univer-bg-gray-100",{"univer-hidden":!t,"univer-inset-0 univer-z-[100] univer-block univer-size-full":t}),children:l&&v.jsx(l,{})}):null}function Ye(){const e=x.useDependency(k1),t=x.useObservable(e.sidebarOptions$),n=a.useRef(null),r=a.useMemo(()=>{if(!t)return null;const o={...t};for(const c of["children","header","footer"]){const C=c;if(t[C]){const{key:m,...p}=t[C];p&&(o[C]=v.jsx(f1,{...p},m))}}return o},[t]);a.useEffect(()=>(n.current&&e.setContainer(n.current),()=>{e.setContainer(void 0)}),[e]),a.useEffect(()=>{const o=C=>{e.scrollEvent$.next(C)},c=n.current;return c&&c.addEventListener("scroll",o),()=>{c==null||c.removeEventListener("scroll",o)}},[e]);const i=a.useMemo(()=>r!=null&&r.visible?typeof r.width=="number"?`${r.width}px`:r.width:0,[r]);function l(){var c;const o={...t,visible:!1};e.options.visible=!1,e.sidebarOptions$.next(o),(c=o==null?void 0:o.onClose)==null||c.call(o)}return v.jsx("section",{"data-u-comp":"sidebar",className:Z.clsx("univer-relative univer-h-full univer-bg-white univer-text-gray-900 dark:!univer-bg-gray-900 dark:!univer-text-white",{"univer-w-96 univer-translate-x-0":r==null?void 0:r.visible,"univer-w-0 univer-translate-x-full":!(r!=null&&r.visible)}),style:{width:i},children:v.jsxs("section",{ref:n,className:Z.clsx("univer-box-border univer-grid univer-h-0 univer-min-h-full univer-grid-rows-[auto_1fr_auto] univer-overflow-y-auto",Z.borderLeftBottomClassName,Z.scrollbarClassName),children:[v.jsxs("header",{className:"univer-sticky univer-top-0 univer-z-10 univer-box-border univer-flex univer-items-center univer-justify-between univer-bg-white univer-p-4 univer-pb-2 univer-text-base univer-font-medium univer-text-gray-800 dark:!univer-bg-gray-900 dark:!univer-text-white",children:[r==null?void 0:r.header,v.jsx("a",{className:"univer-cursor-pointer univer-text-gray-500 dark:!univer-text-gray-300",onClick:l,children:v.jsx(De,{})})]}),v.jsx("section",{className:"univer-box-border univer-px-4",style:r==null?void 0:r.bodyStyle,children:r==null?void 0:r.children}),(r==null?void 0:r.footer)&&v.jsx("footer",{className:"univer-sticky univer-bottom-0 univer-box-border univer-bg-white univer-p-4 dark:!univer-bg-gray-900",children:r.footer})]})})}const me=h.createIdentifier("univer.zen-zone-service");function Xe(){const e=x.useDependency(me),[t,n]=a.useState(!1),[r,i]=a.useState(),l=x.useObservable(e.temporaryHidden$),o=x.useDependency(v1);a.useEffect(()=>{const C=[e.visible$.subscribe(m=>{n(m)}),e.componentKey$.subscribe(m=>{i(m)})];return()=>{C.forEach(m=>{m.unsubscribe()})}},[]);const c=a.useMemo(()=>{const C=o.get(r!=null?r:"");if(C)return C},[r]);return v.jsx("section",{className:Z.clsx("univer-absolute univer-z-[-1] univer-flex",{"univer-inset-0 univer-z-[100] univer-bg-gray-100 univer-animate-in univer-fade-in":t,"univer-hidden":l}),children:v.jsx("div",{className:"univer-relative univer-flex-1",children:c&&v.jsx(c,{})})})}function h0(e){const t=N9(G1);return v.jsx(C0,{...e,...t})}function C0(e){var e1;const{header:t=!0,toolbar:n=!0,footer:r=!0,headerMenu:i=!0,contextMenu:l=!0,ribbonType:o="default",mountContainer:c,onRendered:C}=e,m=x.useDependency(h.LocaleService),p=x.useDependency(h.ThemeService),d=x.useDependency(ze),w=a.useRef(null),S=x.useDependency(h.IConfigService).getConfig(G1),T=p1(o1.CUSTOM_HEADER),O=p1(o1.FOOTER),E=p1(o1.HEADER),N=p1(o1.HEADER_MENU),V=p1(o1.CONTENT),U=p1(o1.LEFT_SIDEBAR),M=p1(o1.GLOBAL),$=p1(o1.TOOLBAR),D=(e1=S==null?void 0:S.popupRootId)!=null?e1:"univer-popup-portal";a.useLayoutEffect(()=>{const J=p.currentTheme$.subscribe(X=>{d.injectThemeToHead(X)});return()=>{J.unsubscribe()}},[]);const[B,G]=a.useState(!1);a.useLayoutEffect(()=>{const J=p.darkMode$.subscribe(X=>{G(X),X?document.documentElement.classList.add("univer-dark"):document.documentElement.classList.remove("univer-dark")});return()=>{J.unsubscribe()}},[]),a.useEffect(()=>{w.current&&(C==null||C(w.current))},[C]);const[Y,q]=a.useState(m.getLocales()),W=a.useMemo(()=>document.createElement("div"),[]);return a.useEffect(()=>{document.body.appendChild(W);const J=[m.localeChanged$.subscribe(()=>{q(m.getLocales())})];return()=>{J.forEach(X=>X.unsubscribe()),document.body.removeChild(W)}},[m,c,W,p.currentTheme$]),v.jsxs(Z.ConfigProvider,{locale:Y==null?void 0:Y.design,mountContainer:W,children:[v.jsxs("div",{"data-u-comp":"workbench-layout",className:Z.clsx("univer-flex univer-h-full univer-min-h-0 univer-flex-col univer-bg-white dark:!univer-bg-gray-800",{"univer-dark":B}),tabIndex:-1,onBlur:J=>J.stopPropagation(),onContextMenu:J=>J.preventDefault(),children:[v.jsx("div",{className:"univer-relative univer-flex univer-min-h-0 univer-flex-col univer-bg-white",children:v.jsx(m1,{components:T},"custom-header")}),t&&n&&v.jsx("header",{"data-u-comp":"headerbar",className:"univer-relative univer-z-10 univer-w-full",children:v.jsx(m1,{components:$,sharedProps:{ribbonType:o,headerMenuComponents:N,headerMenu:i}},"toolbar")}),v.jsxs("section",{className:"univer-relative univer-flex univer-min-h-0 univer-flex-1 univer-flex-col",children:[v.jsxs("div",{className:"univer-grid univer-h-full univer-grid-cols-[auto_1fr_auto] univer-grid-rows-[100%] univer-overflow-hidden",children:[v.jsx("aside",{"data-u-comp":"left-sidebar",className:"univer-h-full",children:v.jsx(m1,{components:U},"left-sidebar")}),v.jsxs("section",{className:Z.clsx("univer-relative univer-grid univer-flex-1 univer-grid-rows-[auto_1fr] univer-overflow-hidden univer-bg-white",Z.borderBottomClassName),children:[v.jsx("header",{children:t&&v.jsx(m1,{components:E},"header")}),v.jsx("section",{className:"univer-relative univer-overflow-hidden dark:!univer-bg-gray-900",ref:w,"data-range-selector":!0,onContextMenu:J=>J.preventDefault(),children:v.jsx(m1,{components:V},"content")})]}),v.jsx("aside",{"data-u-comp":"right-sidebar",className:"univer-h-full",children:v.jsx(Ye,{})})]}),r&&v.jsx("footer",{children:v.jsx(m1,{components:O,sharedProps:{contextMenu:l}},"footer")}),v.jsx(Xe,{})]})]}),v.jsx(m1,{components:M},"global"),v.jsx(We,{}),l&&v.jsx(p6,{}),v.jsx(v0,{}),v.jsx("div",{id:D})]})}function v0(){const{mountContainer:e}=a.useContext(Z.ConfigContext),t=p1(o1.FLOATING);return L3.createPortal(v.jsx(m1,{components:t},"floating"),e)}const g0=3e3;class qe extends h.Disposable{constructor(n,r,i,l,o){super();j(this,"_steadyTimeout");j(this,"_renderTimeout");j(this,"_currentRenderId",null);this._injector=n,this._instanceService=r,this._layoutService=i,this._lifecycleService=l,this._renderManagerService=o}dispose(){super.dispose(),clearTimeout(this._steadyTimeout),clearTimeout(this._renderTimeout)}_bootstrapWorkbench(){this.disposeWithMe(this.bootstrap(async(n,r)=>{this._layoutService&&(this.disposeWithMe(this._layoutService.registerRootContainerElement(r)),this.disposeWithMe(this._layoutService.registerContentElement(n))),await this._lifecycleService.onStage(h.LifecycleStages.Ready),this._renderTimeout=window.setTimeout(()=>{const i=this._renderManagerService.getRenderAll();for(const[l,o]of i)if(this._changeRenderUnit(l,n))break;this.disposeWithMe(this._instanceService.focused$.subscribe(l=>{l&&this._changeRenderUnit(l,n)})),this.disposeWithMe(this._renderManagerService.created$.subscribe(l=>{var o;l.unitId===((o=this._instanceService.getFocusedUnit())==null?void 0:o.getUnitId())&&this._changeRenderUnit(l.unitId,n)})),this.disposeWithMe(this._renderManagerService.disposed$.subscribe(l=>{this._currentRenderId===l&&(this._currentRenderId=null)})),this._lifecycleService.stage=h.LifecycleStages.Rendered,this._steadyTimeout=window.setTimeout(()=>{this._lifecycleService.stage=h.LifecycleStages.Steady},g0)},300)}))}_changeRenderUnit(n,r){if(this._currentRenderId===n)return!1;const i=this._renderManagerService.getRenderById(n);if(!i||!i.unitId||h.isInternalEditorID(i.unitId))return!1;const l=this._currentRenderId?this._renderManagerService.getRenderById(this._currentRenderId):null;return l==null||l.deactivate(),l==null||l.engine.unmount(),i.engine.mount(r),i.activate(),this._currentRenderId=n,!0}}var m0=Object.getOwnPropertyDescriptor,p0=(e,t,n,r)=>{for(var i=r>1?void 0:r?m0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},D1=(e,t)=>(n,r)=>t(n,r,e);f.DesktopUIController=class extends qe{constructor(t,n,r,i,l,o,c,C,m){super(n,o,l,r,i),this._config=t,this._componentManager=m,c.mergeMenu(e6),this._initBuiltinComponents(C),this._registerComponents(),this._bootstrapWorkbench()}_registerComponents(){[[E9,H9],[O9,D9],[A9,x9],[$9,Z9],[k9,T9],[R9,Z.ColorPicker]].forEach(([t,n])=>{this.disposeWithMe(this._componentManager.register(t,n))})}bootstrap(t){return b0(this._injector,this._config,t)}_initBuiltinComponents(t){this.disposeWithMe(t.registerComponent(o1.FLOATING,()=>x.connectInjector(Fe,this._injector))),this.disposeWithMe(t.registerComponent(o1.CONTENT,()=>x.connectInjector(Ue,this._injector))),this.disposeWithMe(t.registerComponent(o1.TOOLBAR,()=>x.connectInjector(m6,this._injector)))}},f.DesktopUIController=p0([D1(1,h.Inject(h.Injector)),D1(2,h.Inject(h.LifecycleService)),D1(3,F1.IRenderManagerService),D1(4,S1),D1(5,h.IUniverInstanceService),D1(6,M1),D1(7,_1),D1(8,h.Inject(v1))],f.DesktopUIController);function b0(e,t,n){let r;const i=t.container;if(typeof i=="string"){const C=document.getElementById(i);C?r=C:r=b6(i)}else i instanceof HTMLElement?r=i:r=b6("univer");const l=x.connectInjector(h0,e),o=C=>n(C,r);function c(){Z.render(v.jsx(l,{...t,mountContainer:r,onRendered:o}),r)}return c(),h.toDisposable(()=>{Z.render(v.jsx("div",{}),r),setTimeout(()=>Z.render(v.jsx("div",{}),r),200),setTimeout(()=>Z.unmount(r),500)})}function b6(e){const t=document.createElement("div");return t.id=e,t}function L0(e){const{menuType:t,onOptionSelect:n}=e,r=x.useDependency(M1);if(!t)return null;const i=a.useMemo(()=>{const l=r.getMenuByPositionKey(t);function o(c){return c.reduce((C,m)=>m.children?[...C,...o(m.children)]:[...C,m],[])}return o(l)},[t]);return v.jsx("div",{className:"univer-box-border univer-grid univer-min-w-8 univer-max-w-52 univer-gap-1 univer-rounded univer-bg-gray-900 univer-px-2 univer-py-1",style:{gridTemplateColumns:`repeat(${Math.min(2,i.length)}, 48px)`},children:i.map(l=>l.item&&v.jsx(w0,{menuItem:l.item,onClick:o=>n==null?void 0:n({value:"",label:l.key,...o})},l.key))})}function w0(e){const{menuItem:t,onClick:n}=e,{id:r,type:i,title:l,label:o,icon:c}=t;if(i!==g1.BUTTON)throw new Error(`[MobileMenuItem]: on mobile devices only "BUTTON" type menu items are supported. Please check "${r}".`);const C=x.useObservable(t.disabled$,!1),m=x.useObservable(t.value$);return v.jsx("button",{type:"button",className:Z.clsx("univer-flex univer-w-12 univer-flex-col univer-items-center univer-justify-center univer-border-none univer-bg-transparent univer-text-white [&>span]:univer-mt-0.5 [&>span]:univer-w-full [&>span]:univer-truncate [&>span]:univer-text-sm [&>svg]:univer-size-[18px] [&>svg]:univer-text-lg"),disabled:C,onClick:()=>n({id:r}),children:v.jsx(f1,{value:m,title:l,label:o,icon:c})},r)}function L6(){const[e,t]=a.useState(!1),[n,r]=a.useState(""),[i,l]=a.useState([0,0]),o=a.useRef(e),c=x.useDependency(te),C=x.useDependency(h.ICommandService);o.current=e,a.useEffect(()=>{const d=c.registerContextMenuHandler({handleContextMenu:m,hideContextMenu(){t(!1)},get visible(){return o.current}});return document.addEventListener("pointerdown",p),document.addEventListener("wheel",p),()=>{document.removeEventListener("pointerdown",p),document.removeEventListener("wheel",p),d.dispose()}},[c]);function m(d,w){r(w),l([d.clientX,d.clientY]),t(!0)}function p(){t(!1)}return v.jsx(Z.Popup,{visible:e,offset:i,children:v.jsx("section",{onPointerDown:d=>d.stopPropagation(),children:n&&v.jsx(L0,{menuType:n,onOptionSelect:d=>{const{label:w,value:y,commandId:S}=d;C&&C.executeCommand(S!=null?S:w,{value:y}),t(!1)}})})})}function _0(e){const{header:t=!0,footer:n=!0,contextMenu:r=!0,mountContainer:i,onRendered:l}=e,o=x.useDependency(h.LocaleService),c=x.useDependency(h.ThemeService),C=a.useRef(null),m=p1(o1.FOOTER),p=p1(o1.HEADER),d=p1(o1.CONTENT),w=p1(o1.LEFT_SIDEBAR),y=p1(o1.GLOBAL),[S,T]=a.useState(!1);a.useEffect(()=>{const V=c.darkMode$.subscribe(U=>{T(U)});return()=>{V.unsubscribe()}},[]),a.useEffect(()=>{C.current&&(l==null||l(C.current))},[l]);const[O,E]=a.useState(o.getLocales()),N=a.useMemo(()=>document.createElement("div"),[]);return a.useEffect(()=>{document.body.appendChild(N);const V=[o.localeChanged$.subscribe(()=>{E(o.getLocales())})];return()=>{V.forEach(U=>U.unsubscribe()),document.body.removeChild(N)}},[o,i,N,c.currentTheme$]),v.jsxs(Z.ConfigProvider,{locale:O==null?void 0:O.design,mountContainer:N,children:[v.jsxs("div",{"data-u-comp":"app-layout",className:Z.clsx("univer-relative univer-flex univer-h-full univer-min-h-0 univer-flex-col univer-bg-white dark:!univer-bg-gray-800",{"univer-dark":S}),tabIndex:-1,onBlur:V=>V.stopPropagation(),children:[t&&v.jsx("header",{className:"univer-relative univer-z-10 univer-w-full"}),v.jsxs("section",{className:"univer-relative univer-flex univer-min-h-0 univer-flex-1 univer-flex-col",children:[v.jsxs("div",{className:"univer-grid univer-h-full univer-grid-cols-[auto_1fr_auto] univer-grid-rows-[100%] univer-overflow-hidden",children:[v.jsx("aside",{className:"univer-h-full",children:v.jsx(m1,{components:w},"left-sidebar")}),v.jsxs("section",{className:Z.clsx("univer-relative univer-grid univer-flex-1 univer-grid-rows-[auto_1fr] univer-overflow-hidden univer-bg-white",Z.borderBottomClassName),children:[v.jsx("header",{className:"univer-w-screen",children:t&&v.jsx(m1,{components:p},"header")}),v.jsx("section",{ref:C,className:"univer-relative univer-overflow-hidden","data-range-selector":!0,onContextMenu:V=>V.preventDefault(),children:v.jsx(m1,{components:d},"content")})]}),v.jsx("aside",{className:"univer-h-full",children:v.jsx(Ye,{})})]}),n&&v.jsx("footer",{children:v.jsx(m1,{components:m},"footer")}),v.jsx(We,{}),v.jsx(Xe,{})]})]}),v.jsx(m1,{components:y},"global"),r&&v.jsx(L6,{})]})}var y0=Object.getOwnPropertyDescriptor,M0=(e,t,n,r)=>{for(var i=r>1?void 0:r?y0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},$1=(e,t)=>(n,r)=>t(n,r,e);let Je=class extends qe{constructor(e,t,n,r,i,l,o){super(t,l,i,n,r),this._config=e,this._initBuiltinComponents(o),this._bootstrapWorkbench()}bootstrap(e){return S0(this._injector,this._config,e)}_initBuiltinComponents(e){this.disposeWithMe(e.registerComponent(o1.CONTENT,()=>x.connectInjector(Fe,this._injector))),this.disposeWithMe(e.registerComponent(o1.CONTENT,()=>x.connectInjector(Ue,this._injector)))}};Je=M0([$1(1,h.Inject(h.Injector)),$1(2,h.Inject(h.LifecycleService)),$1(3,F1.IRenderManagerService),$1(4,S1),$1(5,h.IUniverInstanceService),$1(6,_1)],Je);function S0(e,t,n){let r;const i=t.container;if(typeof i=="string"){const C=document.getElementById(i);C?r=C:r=w6(i)}else i instanceof HTMLElement?r=i:r=w6("univer");const l=x.connectInjector(_0,e),o=C=>n(C,r);function c(){Z.render(v.jsx(l,{...t,mountContainer:r,onRendered:o}),r)}return c(),h.toDisposable(()=>{Z.unmount(r)})}function w6(e){const t=document.createElement("div");return t.id=e,t}const ne=h.createIdentifier("ui.notification.service");var I0=Object.getOwnPropertyDescriptor,H0=(e,t,n,r)=>{for(var i=r>1?void 0:r?I0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},E0=(e,t)=>(n,r)=>t(n,r,e);const Qe=h.createIdentifier("univer.ui.before-close-service");f.DesktopBeforeCloseService=class{constructor(t){j(this,"_beforeUnloadCallbacks",[]);j(this,"_onCloseCallbacks",[]);this._notificationService=t,this._init()}registerBeforeClose(t){return this._beforeUnloadCallbacks.push(t),{dispose:()=>{this._beforeUnloadCallbacks=this._beforeUnloadCallbacks.filter(n=>n!==t)}}}registerOnClose(t){return this._onCloseCallbacks.push(t),{dispose:()=>{this._onCloseCallbacks=this._onCloseCallbacks.filter(n=>n!==t)}}}_init(){window.addEventListener("beforeunload",t=>{let n=t;const r=this._beforeUnloadCallbacks.map(i=>i()).filter(i=>!!i).join(`
|
|
13
13
|
`);if(r)return this._notificationService.show({type:"error",title:"Some changes are not saved",content:r}),typeof n>"u"&&(n=window.event),n.returnValue=r,r}),window.addEventListener("unload",()=>{this._onCloseCallbacks.forEach(t=>t())})}},f.DesktopBeforeCloseService=H0([E0(0,ne)],f.DesktopBeforeCloseService);function _6(){return typeof navigator.clipboard<"u"&&typeof navigator.clipboard.readText<"u"}var D0=Object.getOwnPropertyDescriptor,O0=(e,t,n,r)=>{for(var i=r>1?void 0:r?D0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},Ke=(e,t)=>(n,r)=>t(n,r,e);const e3="text/plain",t3="text/html",y6="image/png",M6="image/jpeg",S6="image/bmp",I6="image/webp",V0="image/svg+xml",N0=new Set([S6,M6,I6,y6]),n3=h.createIdentifier("univer.clipboard-interface-service");f.BrowserClipboardService=class extends h.Disposable{constructor(t,n,r){super(),this._localeService=t,this._logService=n,this._notificationService=r}get supportClipboard(){return _6()}async write(t,n){if(!this.supportClipboard)return this._legacyCopyHtml(n);try{return await navigator.clipboard.write([new ClipboardItem({[e3]:new Blob([t],{type:e3}),[t3]:new Blob([n],{type:t3})})])}catch(r){this._logService.error("[BrowserClipboardService]",r),this._showClipboardAuthenticationNotification()}}async writeText(t){if(!this.supportClipboard)return this._legacyCopyText(t);try{return await navigator.clipboard.writeText(t)}catch(n){this._logService.error("[BrowserClipboardService]",n),this._showClipboardAuthenticationNotification()}}async read(){if(!this.supportClipboard)throw new Error("[BrowserClipboardService] read() is not supported on this platform.");try{return navigator.clipboard.read()}catch(t){return this._logService.error("[BrowserClipboardService]",t),this._showClipboardAuthenticationNotification(),[]}}async readText(){if(!this.supportClipboard)throw new Error("[BrowserClipboardService] read() is not supported on this platform.");try{return await navigator.clipboard.readText()}catch(t){return this._logService.error("[BrowserClipboardService]",t),this._showClipboardAuthenticationNotification(),""}}_legacyCopyHtml(t){const n=document.activeElement,r=T0();document.body.appendChild(r),r.innerHTML=t;try{H6(r),document.execCommand("copy")}finally{n instanceof HTMLElement&&n.focus(),document.body.removeChild(r)}}_legacyCopyText(t){const n=document.activeElement,r=R0();document.body.appendChild(r),r.value=t;try{H6(r),document.execCommand("copy")}finally{n instanceof HTMLElement&&n.focus(),document.body.removeChild(r)}}_showClipboardAuthenticationNotification(){var t;(t=this._notificationService)==null||t.show({type:"warning",title:this._localeService.t("clipboard.authentication.title"),content:this._localeService.t("clipboard.authentication.content")})}},f.BrowserClipboardService=O0([Ke(0,h.Inject(h.LocaleService)),Ke(1,h.ILogService),Ke(2,h.Optional(ne))],f.BrowserClipboardService);function R0(){const e=document.createElement("textarea");return e.style.position="absolute",e.style.height="1px",e.style.width="1px",e.style.opacity="0",e.readOnly=!0,e}function T0(){const e=document.createElement("div");return e.contentEditable="true",e.style.position="absolute",e.style.opacity="0",e.style.height="1px",e.style.width="1px",e}function H6(e){if(e instanceof HTMLTextAreaElement){const r=e.hasAttribute("readonly");return r||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),r||e.removeAttribute("readonly"),e.value}e.hasAttribute("contenteditable")&&e.focus();const t=document.createRange();t.selectNodeContents(e);const n=window.getSelection();if(!n)throw new Error;return n.removeAllRanges(),n.addRange(t),n.toString()}const pe=h.createIdentifier("univer.confirm-service");class x0{constructor(){j(this,"confirmOptions$",new z.Subject)}dispose(){this.confirmOptions$.complete()}open(t){throw new Error("This is not implemented in the test service!")}confirm(t){return Promise.resolve(!0)}close(t){throw new Error("This is not implemented in the test service!")}}const Z0=e=>{const{children:t,onClose:n,onConfirm:r}=e,[i]=a.useState({}),l=t?a.cloneElement(t,{hooks:i}):null;return v.jsx(Z.Confirm,{...e,children:l,onClose:()=>{const o=i.beforeClose;if(o){const c=o();if(c.cancel)return;n==null||n(c);return}n==null||n()},onConfirm:()=>{const o=i.beforeConfirm;if(o){const c=o();if(c.cancel)return;r==null||r(c);return}r==null||r()}})};function k0(){const e=x.useDependency(pe),[t,n]=a.useState([]);a.useEffect(()=>{const i=e.confirmOptions$.subscribe(l=>{n(l)});return()=>{i.unsubscribe()}},[]);const r=t.map(i=>{const{children:l,title:o,...c}=i,C=c;for(const m of["children","title"]){const p=m,d=i[p];d&&(C[p]=v.jsx(f1,{...d}))}return C});return r==null?void 0:r.map((i,l)=>v.jsx(Z0,{...i,children:i.children},l))}var A0=Object.getOwnPropertyDescriptor,$0=(e,t,n,r)=>{for(var i=r>1?void 0:r?A0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},E6=(e,t)=>(n,r)=>t(n,r,e);f.DesktopConfirmService=class extends h.Disposable{constructor(n,r){super();j(this,"_confirmOptions",[]);j(this,"confirmOptions$",new z.BehaviorSubject([]));this._injector=n,this._uiPartsService=r,this._initUIPart()}open(n){return this._confirmOptions.find(r=>r.id===n.id)?this._confirmOptions=this._confirmOptions.map(r=>({...r.id===n.id?n:r,visible:r.id===n.id?!0:r.visible})):this._confirmOptions.push({...n,visible:!0}),this.confirmOptions$.next(this._confirmOptions),h.toDisposable(()=>{this._confirmOptions=[],this.confirmOptions$.next([])})}confirm(n){return new Promise(r=>{const i=this.open({...n,onConfirm:()=>{i.dispose(),r(!0)},onClose:()=>{i.dispose(),r(!1)}})})}close(n){this._confirmOptions=this._confirmOptions.map(r=>({...r,visible:r.id===n?!1:r.visible})),this.confirmOptions$.next([...this._confirmOptions])}_initUIPart(){this.disposeWithMe(this._uiPartsService.registerComponent(o1.GLOBAL,()=>x.connectInjector(k0,this._injector)))}},f.DesktopConfirmService=$0([E6(0,h.Inject(h.Injector)),E6(1,_1)],f.DesktopConfirmService);const be=h.createIdentifier("univer.ui.dialog-service");function P0(){const e=x.useDependency(be),[t,n]=a.useState([]);a.useEffect(()=>{const l=e.getDialogs$().subscribe(o=>{n(o)});return()=>l.unsubscribe()},[]);const r=a.useMemo(()=>t.map(i=>{const{children:l,title:o,footer:c,...C}=i,m=C;for(const p of["children","title","footer"]){const d=p,w=i[d];w&&(m[d]=v.jsx(f1,{...w}))}return m}),[t]);return r==null?void 0:r.map(i=>v.jsx(Z.Dialog,{...i},i.id))}var U0=Object.getOwnPropertyDescriptor,B0=(e,t,n,r)=>{for(var i=r>1?void 0:r?U0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},D6=(e,t)=>(n,r)=>t(n,r,e);f.DesktopDialogService=class extends h.Disposable{constructor(n,r){super();j(this,"_dialogOptions",[]);j(this,"_dialogOptions$",new z.Subject);this._injector=n,this._uiPartsService=r,this._initUIPart()}dispose(){super.dispose(),this._dialogOptions=[],this._dialogOptions$.complete()}open(n){return this._dialogOptions.find(r=>r.id===n.id)?this._dialogOptions=this._dialogOptions.map(r=>({...r.id===n.id?n:r,open:r.id===n.id?!0:r.open})):this._dialogOptions.push({...n,open:!0}),this._dialogOptions$.next(this._dialogOptions),h.toDisposable(()=>{this._dialogOptions=[],this._dialogOptions$.next([])})}close(n){this._dialogOptions=this._dialogOptions.map(r=>({...r,open:r.id===n?!1:r.open})),this._dialogOptions$.next([...this._dialogOptions])}closeAll(n){const r=new Set(n);this._dialogOptions=this._dialogOptions.map(i=>({...i,open:r.has(i.id)?i.open:!1})),this._dialogOptions$.next([...this._dialogOptions])}getDialogs$(){return this._dialogOptions$.asObservable()}_initUIPart(){this.disposeWithMe(this._uiPartsService.registerComponent(o1.GLOBAL,()=>x.connectInjector(P0,this._injector)))}},f.DesktopDialogService=B0([D6(0,h.Inject(h.Injector)),D6(1,_1)],f.DesktopDialogService);const Le=h.createIdentifier("univer.ui.gallery-service");function F0(){const e=x.useDependency(Le),t=x.useObservable(e.gallery$);return t?v.jsx(Z.Gallery,{...t}):null}var j0=Object.getOwnPropertyDescriptor,z0=(e,t,n,r)=>{for(var i=r>1?void 0:r?j0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},O6=(e,t)=>(n,r)=>t(n,r,e);f.DesktopGalleryService=class extends h.Disposable{constructor(n,r){super();j(this,"gallery$",new z.Subject);this._injector=n,this._uiPartsService=r,this._initUIPart()}dispose(){super.dispose()}open(n){return this.gallery$.next({open:!0,...n}),h.toDisposable(()=>{this.gallery$.complete()})}close(){this.gallery$.next({open:!1,images:[]})}_initUIPart(){this.disposeWithMe(this._uiPartsService.registerComponent(o1.GLOBAL,()=>x.connectInjector(F0,this._injector)))}},f.DesktopGalleryService=z0([O6(0,h.Inject(h.Injector)),O6(1,_1)],f.DesktopGalleryService);var G0=Object.getOwnPropertyDescriptor,W0=(e,t,n,r)=>{for(var i=r>1?void 0:r?G0(t,n):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=o(i)||i);return i},Y0=(e,t)=>(n,r)=>t(n,r,e);f.DesktopGlobalZoneService=class{constructor(t){j(this,"visible$",new z.Subject);j(this,"componentKey$",new z.Subject);j(this,"_componentKey","");this._componentManager=t}get componentKey(){return this._componentKey}set(t,n){return this._componentManager.register(t,n),this.componentKey$.next(t),this._componentKey=t,h.toDisposable(()=>{this._componentManager.delete(t),this.visible$.complete(),this.componentKey$.complete()})}open(){this.visible$.next(!0)}close(){this.visible$.next(!1)}},f.DesktopGlobalZoneService=W0([Y0(0,h.Inject(v1))],f.DesktopGlobalZoneService);var we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function X0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _e(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var r3={exports:{}};/*!
|
|
14
14
|
localForage -- Offline Storage, Improved
|
|
15
15
|
Version 1.10.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/preset-docs-core",
|
|
3
|
-
"version": "0.8.0-nightly.
|
|
3
|
+
"version": "0.8.0-nightly.202505301607",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -57,21 +57,21 @@
|
|
|
57
57
|
"rxjs": ">=7.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@univerjs/design": "0.8.0-nightly.
|
|
61
|
-
"@univerjs/docs": "0.8.0-nightly.
|
|
62
|
-
"@univerjs/docs-ui": "0.8.0-nightly.
|
|
63
|
-
"@univerjs/engine-formula": "0.8.0-nightly.
|
|
64
|
-
"@univerjs/engine-render": "0.8.0-nightly.
|
|
65
|
-
"@univerjs/network": "0.8.0-nightly.
|
|
66
|
-
"@univerjs/ui": "0.8.0-nightly.
|
|
60
|
+
"@univerjs/design": "0.8.0-nightly.202505301607",
|
|
61
|
+
"@univerjs/docs": "0.8.0-nightly.202505301607",
|
|
62
|
+
"@univerjs/docs-ui": "0.8.0-nightly.202505301607",
|
|
63
|
+
"@univerjs/engine-formula": "0.8.0-nightly.202505301607",
|
|
64
|
+
"@univerjs/engine-render": "0.8.0-nightly.202505301607",
|
|
65
|
+
"@univerjs/network": "0.8.0-nightly.202505301607",
|
|
66
|
+
"@univerjs/ui": "0.8.0-nightly.202505301607"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@univerjs/core": "0.8.0-nightly.
|
|
69
|
+
"@univerjs/core": "0.8.0-nightly.202505301607",
|
|
70
70
|
"react": "18.3.1",
|
|
71
71
|
"react-dom": "18.3.1",
|
|
72
72
|
"rxjs": "7.8.2",
|
|
73
73
|
"typescript": "^5.8.3",
|
|
74
|
-
"@univerjs-infra/shared": "0.8.0-beta.
|
|
74
|
+
"@univerjs-infra/shared": "0.8.0-beta.1"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"prebuild:preset": "tsx prepare.ts",
|