@univerjs/preset-docs-core 0.6.10-nightly.202504241607 → 0.6.10-nightly.202504251607
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 +9 -9
package/lib/umd/index.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
`,children:a.items.map(l=>C.jsxs("li",{className:`
|
|
22
22
|
univer-flex univer-h-10 univer-items-center univer-justify-between univer-text-[13px]
|
|
23
23
|
last:univer-border-b-0
|
|
24
|
-
`,children:[C.jsx("span",{className:"univer-line-clamp-1",children:l.title}),l.shortcut&&C.jsx(R.KBD,{keyboard:l.shortcut})]},`${l.title}-${l.shortcut}`))})]},a.name))})}var H4=Object.getOwnPropertyDescriptor,I4=(e,t,n,r)=>{for(var i=r>1?void 0:r?H4(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=a(i)||i);return i},De=(e,t)=>(n,r)=>t(n,r,e);const O4={id:Oe.id,binding:S1.CTRL_COMMAND|re.BACK_SLASH,description:"shortcut.shortcut-panel",group:"10_global-shortcut"};h.ShortcutPanelController=class extends m.Disposable{constructor(t,n,r,i,o){super(),this._menuManagerService=i,this.disposeWithMe(n.register(Zr,E4)),this.disposeWithMe(o.registerCommand(Oe)),this.disposeWithMe(r.registerShortcut(O4))}},h.ShortcutPanelController=I4([De(0,m.Inject(m.Injector)),De(1,m.Inject(T1)),De(2,Ce),De(3,q1),De(4,m.ICommandService)],h.ShortcutPanelController);const Te=m.createIdentifier("univer.ui.ui-controller");var d1=(e=>(e.GLOBAL="global",e.HEADER="header",e.HEADER_MENU="header-menu",e.CONTENT="content",e.FOOTER="footer",e.LEFT_SIDEBAR="left-sidebar",e.FLOATING="floating",e.UNIT="unit",e.CUSTOM_HEADER="custom-header",e.CUSTOM_LEFT="custom-left",e.CUSTOM_RIGHT="custom-right",e.CUSTOM_FOOTER="custom-footer",e.TOOLBAR="toolbar",e))(d1||{});const F1=m.createIdentifier("ui.parts.service");class Et extends m.Disposable{constructor(){super(...arguments);J(this,"_componentsByPart",new Map);J(this,"_componentRegistered$",new X.Subject);J(this,"componentRegistered$",this._componentRegistered$.asObservable());J(this,"_uiVisible",new Map);J(this,"_uiVisibleChange$",new X.Subject);J(this,"uiVisibleChange$",this._uiVisibleChange$.asObservable())}dispose(){super.dispose(),this._componentRegistered$.complete()}setUIVisible(n,r){this._uiVisible.set(n,r),this._uiVisibleChange$.next({ui:n,visible:r})}isUIVisible(n){var r;return(r=this._uiVisible.get(n))!=null?r:!0}registerComponent(n,r){const i=r(),o=(this._componentsByPart.get(n)||this._componentsByPart.set(n,new Set).get(n)).add(i);return this._componentRegistered$.next(n),m.toDisposable(()=>{o.delete(i),o.size===0&&this._componentsByPart.delete(n),this._componentRegistered$.next(n)})}getComponents(n){return new Set([...this._componentsByPart.get(n)||new Set])}}class Re{constructor(){J(this,"_domLayerMap",new Map);J(this,"_domLayers$",new X.BehaviorSubject([]));J(this,"domLayers$",this._domLayers$.asObservable())}get domLayers(){return Array.from(this._domLayerMap.entries())}_notice(){this._domLayers$.next(Array.from(this._domLayerMap.entries()))}addFloatDom(t){this._domLayerMap.set(t.id,t),this._notice()}removeFloatDom(t){this._domLayerMap.delete(t)&&this._notice()}removeAll(){this._domLayerMap.clear(),this._notice()}}const n9=s.memo(e=>{var D,k;const{layer:t,id:n}=e,r=s.useMemo(()=>t.position$.pipe(X.distinctUntilChanged((I,N)=>I.absolute.left===N.absolute.left&&I.absolute.top===N.absolute.top&&I.endX-I.startX===N.endX-N.startX&&I.endY-I.startY===N.endY-N.startY)),[t.position$]),i=B.useDependency(m.IUniverInstanceService),o=B.useObservable(s.useMemo(()=>t.position$.pipe(X.first()),[t.position$])),a=s.useRef(null),l=s.useRef(null),f=s.useRef(`transform: rotate(${o==null?void 0:o.rotate}deg) translate(${o==null?void 0:o.startX}px, ${o==null?void 0:o.startY}px)`),v=s.useRef((D=o==null?void 0:o.startY)!=null?D:0),b=s.useRef((k=o==null?void 0:o.startX)!=null?k:0),u=s.useRef({}),p=typeof t.componentKey=="string"?B.useDependency(T1).get(t.componentKey):t.componentKey,L=s.useMemo(()=>({data:t.data,...t.props}),[t.data,t.props]);s.useEffect(()=>{const I=t.position$.subscribe(w=>{var O;f.current=`rotate(${w.rotate}deg)`,v.current=w.startY,b.current=w.startX,a.current&&(a.current.style.transform=f.current,a.current.style.top=`${v.current}px`,a.current.style.left=`${b.current}px`,a.current.style.opacity=`${(O=w.opacity)!=null?O:1}`)}),N=r.subscribe(w=>{if(a.current&&(a.current.style.width=`${Math.max(w.endX-w.startX-2,0)}px`,a.current.style.height=`${Math.max(w.endY-w.startY-2,0)}px`),l.current){const O={width:`${w.width-4}px`,height:`${w.height-4}px`,left:`${w.absolute.left?0:"auto"}`,top:`${w.absolute.top?0:"auto"}`,right:`${w.absolute.left?"auto":0}`,bottom:`${w.absolute.top?"auto":0}`};l.current.style.width=O.width,l.current.style.height=O.height,l.current.style.left=O.left,l.current.style.top=O.top,l.current.style.right=O.right,l.current.style.bottom=O.bottom,u.current=O}});return()=>{I.unsubscribe(),N.unsubscribe()}},[t.position$,r]);const E=i.getUnit(t.unitId),H=E instanceof m.DocumentDataModel?E.getDisabled():void 0,g=s.useMemo(()=>p?C.jsx(p,{...L,unitId:t.unitId,unit:E,floatDomId:t.id,context:{docDisabled:H,root:l}}):null,[p,L]);return o?C.jsx("div",{ref:a,className:"univer-z-10",style:{position:"absolute",top:v.current,left:b.current,width:Math.max(o.endX-o.startX-2,0),height:Math.max(o.endY-o.startY-2,0),transform:f.current,overflow:"hidden",transformOrigin:"center center"},onPointerMove:I=>{t.onPointerMove(I.nativeEvent)},onPointerDown:I=>{t.onPointerDown(I.nativeEvent)},onPointerUp:I=>{t.onPointerUp(I.nativeEvent)},onWheel:I=>{t.onWheel(I.nativeEvent)},children:C.jsx("div",{id:n,ref:l,className:"univer-overflow-hidden",style:{position:"absolute",...u.current},children:g})}):null}),Ht=({unitId:e})=>{var
|
|
24
|
+
`,children:[C.jsx("span",{className:"univer-line-clamp-1",children:l.title}),l.shortcut&&C.jsx(R.KBD,{keyboard:l.shortcut})]},`${l.title}-${l.shortcut}`))})]},a.name))})}var H4=Object.getOwnPropertyDescriptor,I4=(e,t,n,r)=>{for(var i=r>1?void 0:r?H4(t,n):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=a(i)||i);return i},De=(e,t)=>(n,r)=>t(n,r,e);const O4={id:Oe.id,binding:S1.CTRL_COMMAND|re.BACK_SLASH,description:"shortcut.shortcut-panel",group:"10_global-shortcut"};h.ShortcutPanelController=class extends m.Disposable{constructor(t,n,r,i,o){super(),this._menuManagerService=i,this.disposeWithMe(n.register(Zr,E4)),this.disposeWithMe(o.registerCommand(Oe)),this.disposeWithMe(r.registerShortcut(O4))}},h.ShortcutPanelController=I4([De(0,m.Inject(m.Injector)),De(1,m.Inject(T1)),De(2,Ce),De(3,q1),De(4,m.ICommandService)],h.ShortcutPanelController);const Te=m.createIdentifier("univer.ui.ui-controller");var d1=(e=>(e.GLOBAL="global",e.HEADER="header",e.HEADER_MENU="header-menu",e.CONTENT="content",e.FOOTER="footer",e.LEFT_SIDEBAR="left-sidebar",e.FLOATING="floating",e.UNIT="unit",e.CUSTOM_HEADER="custom-header",e.CUSTOM_LEFT="custom-left",e.CUSTOM_RIGHT="custom-right",e.CUSTOM_FOOTER="custom-footer",e.TOOLBAR="toolbar",e))(d1||{});const F1=m.createIdentifier("ui.parts.service");class Et extends m.Disposable{constructor(){super(...arguments);J(this,"_componentsByPart",new Map);J(this,"_componentRegistered$",new X.Subject);J(this,"componentRegistered$",this._componentRegistered$.asObservable());J(this,"_uiVisible",new Map);J(this,"_uiVisibleChange$",new X.Subject);J(this,"uiVisibleChange$",this._uiVisibleChange$.asObservable())}dispose(){super.dispose(),this._componentRegistered$.complete()}setUIVisible(n,r){this._uiVisible.set(n,r),this._uiVisibleChange$.next({ui:n,visible:r})}isUIVisible(n){var r;return(r=this._uiVisible.get(n))!=null?r:!0}registerComponent(n,r){const i=r(),o=(this._componentsByPart.get(n)||this._componentsByPart.set(n,new Set).get(n)).add(i);return this._componentRegistered$.next(n),m.toDisposable(()=>{o.delete(i),o.size===0&&this._componentsByPart.delete(n),this._componentRegistered$.next(n)})}getComponents(n){return new Set([...this._componentsByPart.get(n)||new Set])}}class Re{constructor(){J(this,"_domLayerMap",new Map);J(this,"_domLayers$",new X.BehaviorSubject([]));J(this,"domLayers$",this._domLayers$.asObservable())}get domLayers(){return Array.from(this._domLayerMap.entries())}_notice(){this._domLayers$.next(Array.from(this._domLayerMap.entries()))}addFloatDom(t){this._domLayerMap.set(t.id,t),this._notice()}removeFloatDom(t){this._domLayerMap.delete(t)&&this._notice()}removeAll(){this._domLayerMap.clear(),this._notice()}}const n9=s.memo(e=>{var D,k;const{layer:t,id:n}=e,r=s.useMemo(()=>t.position$.pipe(X.distinctUntilChanged((I,N)=>I.absolute.left===N.absolute.left&&I.absolute.top===N.absolute.top&&I.endX-I.startX===N.endX-N.startX&&I.endY-I.startY===N.endY-N.startY)),[t.position$]),i=B.useDependency(m.IUniverInstanceService),o=B.useObservable(s.useMemo(()=>t.position$.pipe(X.first()),[t.position$])),a=s.useRef(null),l=s.useRef(null),f=s.useRef(`transform: rotate(${o==null?void 0:o.rotate}deg) translate(${o==null?void 0:o.startX}px, ${o==null?void 0:o.startY}px)`),v=s.useRef((D=o==null?void 0:o.startY)!=null?D:0),b=s.useRef((k=o==null?void 0:o.startX)!=null?k:0),u=s.useRef({}),p=typeof t.componentKey=="string"?B.useDependency(T1).get(t.componentKey):t.componentKey,L=s.useMemo(()=>({data:t.data,...t.props}),[t.data,t.props]);s.useEffect(()=>{const I=t.position$.subscribe(w=>{var O;f.current=`rotate(${w.rotate}deg)`,v.current=w.startY,b.current=w.startX,a.current&&(a.current.style.transform=f.current,a.current.style.top=`${v.current}px`,a.current.style.left=`${b.current}px`,a.current.style.opacity=`${(O=w.opacity)!=null?O:1}`)}),N=r.subscribe(w=>{if(a.current&&(a.current.style.width=`${Math.max(w.endX-w.startX-2,0)}px`,a.current.style.height=`${Math.max(w.endY-w.startY-2,0)}px`),l.current){const O={width:`${w.width-4}px`,height:`${w.height-4}px`,left:`${w.absolute.left?0:"auto"}`,top:`${w.absolute.top?0:"auto"}`,right:`${w.absolute.left?"auto":0}`,bottom:`${w.absolute.top?"auto":0}`};l.current.style.width=O.width,l.current.style.height=O.height,l.current.style.left=O.left,l.current.style.top=O.top,l.current.style.right=O.right,l.current.style.bottom=O.bottom,u.current=O}});return()=>{I.unsubscribe(),N.unsubscribe()}},[t.position$,r]);const E=i.getUnit(t.unitId),H=E instanceof m.DocumentDataModel?E.getDisabled():void 0,g=s.useMemo(()=>p?C.jsx(p,{...L,unitId:t.unitId,unit:E,floatDomId:t.id,context:{docDisabled:H,root:l}}):null,[p,L]);return o?C.jsx("div",{ref:a,className:"univer-z-10",style:{position:"absolute",top:v.current,left:b.current,width:Math.max(o.endX-o.startX-2,0),height:Math.max(o.endY-o.startY-2,0),transform:f.current,overflow:"hidden",transformOrigin:"center center"},onPointerMove:I=>{t.onPointerMove(I.nativeEvent)},onPointerDown:I=>{t.onPointerDown(I.nativeEvent)},onPointerUp:I=>{t.onPointerUp(I.nativeEvent)},onWheel:I=>{t.onWheel(I.nativeEvent)},children:C.jsx("div",{id:n,ref:l,className:"univer-overflow-hidden",style:{position:"absolute",...u.current},children:g})}):null}),Ht=({unitId:e})=>{var a;const t=B.useDependency(m.IUniverInstanceService),n=B.useDependency(Re),r=B.useObservable(n.domLayers$),i=B.useObservable(t.focused$),o=e||i;return(a=r==null?void 0:r.filter(l=>l[1].unitId===o))==null?void 0:a.map(l=>C.jsx(n9,{id:l[0],layer:l[1]},l[0]))},We=m.createIdentifier("ui.popup.service");class It extends m.Disposable{constructor(){super(...arguments);J(this,"_popupMap",new Map);J(this,"_popups$",new X.BehaviorSubject([]));J(this,"popups$",this._popups$.asObservable());J(this,"_activePopupId",null)}get popups(){return Array.from(this._popupMap.entries())}get activePopupId(){return this._activePopupId}_update(){this._popups$.next(Array.from(this._popupMap.entries()))}dispose(){super.dispose(),this._popups$.next([]),this._popups$.complete(),this._popupMap.clear()}addPopup(n){const r=m.Tools.generateRandomId();return this._popupMap.set(r,{...n,onActiveChange:i=>{i?this._activePopupId=r:this._activePopupId===r&&(this._activePopupId=null)}}),this._update(),r}removePopup(n){this._popupMap.delete(n)&&this._update()}removeAll(){this._popupMap.clear(),this._update()}}const D4=({popup:e,children:t})=>{const[n,r]=s.useState(!1),i=s.useMemo(()=>e.anchorRect$.pipe(X.throttleTime(0,X.animationFrameScheduler),X.map(u=>{var k;const{bottom:p,left:L,right:E,top:H}=u,[g=0,D=0]=(k=e.offset)!=null?k:[];return{left:L-g,right:E+g,top:H-D,bottom:p+D}})),[e.anchorRect$,e.offset]),o=s.useMemo(()=>{var u,p;return(p=(u=e.hiddenRects$)==null?void 0:u.pipe(X.throttleTime(0,X.animationFrameScheduler)))!=null?p:X.of([])},[e.hiddenRects$]),a=s.useMemo(()=>{var u;return(u=e.excludeRects$)==null?void 0:u.pipe(X.throttleTime(0,X.animationFrameScheduler))},[e.excludeRects$]),l=wr(a,e.excludeRects),{canvasElement:f,hideOnInvisible:v=!0,hiddenType:b="destroy"}=e;return s.useEffect(()=>{if(!v)return;const u=X.combineLatest([i,o]).subscribe(([p,L])=>{const E=f.getBoundingClientRect(),{top:H,left:g,bottom:D,right:k}=E,I=p.bottom-p.top,N=p.right-p.left,w=L.some(O=>p.top>=O.top-.5*I&&p.bottom<=O.bottom+.5*I&&p.left>=O.left-.5*N&&p.right<=O.right+.5*N);p.bottom<H||p.top>D||p.right<g||p.left>k||w?r(!0):r(!1)});return()=>u.unsubscribe()},[f,v,i,o]),n&&b==="destroy"?null:C.jsx(Be,{...e,hidden:n,anchorRect$:i,direction:e.direction,onClickOutside:e.onClickOutside,excludeOutside:e.excludeOutside,excludeRects:l,...e.customActive?null:{onPointerEnter:()=>{var u;return(u=e.onActiveChange)==null?void 0:u.call(e,!0)},onPointerLeave:()=>{var u;return(u=e.onActiveChange)==null?void 0:u.call(e,!1)}},onClick:e.onClick,onContextMenu:e.onContextMenu,children:t})};function Ot(){const e=B.useDependency(We),t=B.useDependency(T1);return B.useObservable(e.popups$,void 0,!0).map(r=>{const[i,o]=r,a=t.get(o.componentKey);return C.jsx(D4,{popup:o,children:a?C.jsx(a,{popup:o}):null},i)})}function E1(e){const{components:t,fallback:n,sharedProps:r}=e;return!t||t.size===0?n!=null?n:null:Array.from(t.values()).map((i,o)=>{var a;return s.createElement(i,{key:`${(a=i.displayName)!=null?a:o}`,...r})})}function H1(e,t){var l;const n=(l=t==null?void 0:t.get(F1))!=null?l:B.useDependency(F1),r=s.useMemo(()=>n.uiVisibleChange$.pipe(X.filter(f=>f.ui===e)),[e,n]),i=B.useObservable(r),o=s.useRef(0),a=B.useObservable(()=>n.componentRegistered$.pipe(X.filter(f=>f===e),X.debounceTime(200),X.map(()=>o.current+=1),X.startWith(o.current+=1)),void 0,void 0,[n,e,i]);return s.useMemo(()=>n.isUIVisible(e)?n.getComponents(e):new Set,[a])}function Dt(e){const{children:t,className:n,style:r,disabled:i=!1,active:o=!1,noIcon:a,onClick:l,onDoubleClick:f,...v}=e,b=p=>{if(i){p.preventDefault();return}l&&l(p)},u=p=>{if(i){p.preventDefault();return}f&&f(p)};return C.jsx("button",{type:"button",className:R.clsx(`
|
|
25
25
|
univer-flex univer-h-6 univer-min-w-6 univer-cursor-pointer univer-items-center univer-justify-center
|
|
26
26
|
univer-rounded univer-border-none univer-bg-transparent univer-p-0 univer-text-base univer-text-gray-900
|
|
27
27
|
univer-outline-none univer-transition-colors univer-animate-in univer-fade-in
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/preset-docs-core",
|
|
3
|
-
"version": "0.6.10-nightly.
|
|
3
|
+
"version": "0.6.10-nightly.202504251607",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
"rxjs": ">=7.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@univerjs/design": "0.6.10-nightly.
|
|
61
|
-
"@univerjs/docs": "0.6.10-nightly.
|
|
62
|
-
"@univerjs/docs-ui": "0.6.10-nightly.
|
|
63
|
-
"@univerjs/engine-formula": "0.6.10-nightly.
|
|
64
|
-
"@univerjs/engine-render": "0.6.10-nightly.
|
|
65
|
-
"@univerjs/network": "0.6.10-nightly.
|
|
66
|
-
"@univerjs/ui": "0.6.10-nightly.
|
|
60
|
+
"@univerjs/design": "0.6.10-nightly.202504251607",
|
|
61
|
+
"@univerjs/docs": "0.6.10-nightly.202504251607",
|
|
62
|
+
"@univerjs/docs-ui": "0.6.10-nightly.202504251607",
|
|
63
|
+
"@univerjs/engine-formula": "0.6.10-nightly.202504251607",
|
|
64
|
+
"@univerjs/engine-render": "0.6.10-nightly.202504251607",
|
|
65
|
+
"@univerjs/network": "0.6.10-nightly.202504251607",
|
|
66
|
+
"@univerjs/ui": "0.6.10-nightly.202504251607"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@univerjs/core": "0.6.10-nightly.
|
|
69
|
+
"@univerjs/core": "0.6.10-nightly.202504251607",
|
|
70
70
|
"react": "18.3.1",
|
|
71
71
|
"react-dom": "18.3.1",
|
|
72
72
|
"typescript": "^5.8.2",
|